Skip to content

Commit cc8981c

Browse files
authored
Merge pull request #90 from bobleer/pr/unified-image-pipeline-mobile-enhancements-20250309
feat: unified image analysis pipeline, bot image support, and mobile-web enhancements
2 parents 2ec6feb + 03a0ac3 commit cc8981c

84 files changed

Lines changed: 5109 additions & 1339 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/apps/desktop/src/api/app_state.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ impl AppState {
115115
.map(|workspace| workspace.root_path);
116116

117117
if let Some(workspace_path) = initial_workspace_path.clone() {
118+
bitfun_core::infrastructure::set_workspace_path(Some(workspace_path.clone()));
118119
miniapp_manager
119120
.set_workspace_path(Some(workspace_path.clone()))
120121
.await;

src/apps/desktop/src/lib.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -766,13 +766,11 @@ fn start_event_loop_with_transport(
766766

767767
if !batch.is_empty() {
768768
for envelope in batch {
769-
let router = event_router.clone();
770-
let env_clone = envelope.clone();
771-
tokio::spawn(async move {
772-
if let Err(e) = router.route(env_clone).await {
773-
log::warn!("Internal event routing failed: {:?}", e);
774-
}
775-
});
769+
// Route to internal subscribers (e.g. RemoteSessionStateTracker)
770+
// sequentially so that text chunks are appended in order.
771+
if let Err(e) = event_router.route(envelope.clone()).await {
772+
log::warn!("Internal event routing failed: {:?}", e);
773+
}
776774

777775
if let Err(e) = transport.emit_event("", envelope.event).await {
778776
log::error!("Failed to emit event: {:?}", e);

src/apps/relay-server/README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ WebSocket relay server for BitFun Remote Connect. Bridges desktop (WebSocket) an
1818
```bash
1919
# One-click deploy
2020
bash deploy.sh
21-
22-
# With mobile web client rebuild
23-
bash deploy.sh --build-mobile
2421
```
2522

2623
### What URL should I fill in BitFun Desktop?
@@ -123,7 +120,7 @@ Only desktop clients connect via WebSocket. Mobile clients use the HTTP endpoint
123120

124121
1. Clone the repository
125122
2. Navigate to `src/apps/relay-server/`
126-
3. Run `bash deploy.sh --build-mobile`
123+
3. Run `bash deploy.sh`
127124
4. Configure DNS/firewall as needed
128125
5. In BitFun desktop, select "Custom Server" and enter your server URL
129126

src/apps/relay-server/deploy.sh

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
#!/usr/bin/env bash
22
# BitFun Relay Server — one-click deploy script.
3-
# Usage: bash deploy.sh [--build-mobile] [--skip-build] [--skip-health-check]
3+
# Usage: bash deploy.sh [--skip-build] [--skip-health-check]
44
#
55
# Prerequisites: Docker, Docker Compose
66

77
set -euo pipefail
88

99
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
10-
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../../.." && pwd)"
1110

12-
BUILD_MOBILE=false
1311
SKIP_BUILD=false
1412
SKIP_HEALTH_CHECK=false
1513

@@ -21,7 +19,6 @@ Usage:
2119
bash deploy.sh [options]
2220
2321
Options:
24-
--build-mobile Build mobile-web static files before deploy
2522
--skip-build Skip docker compose build, only restart services
2623
--skip-health-check Skip post-deploy health check
2724
-h, --help Show this help message
@@ -46,7 +43,6 @@ check_docker_compose() {
4643

4744
for arg in "$@"; do
4845
case "$arg" in
49-
--build-mobile) BUILD_MOBILE=true ;;
5046
--skip-build) SKIP_BUILD=true ;;
5147
--skip-health-check) SKIP_HEALTH_CHECK=true ;;
5248
-h|--help)
@@ -65,31 +61,16 @@ echo "=== BitFun Relay Server Deploy ==="
6561
check_command docker
6662
check_docker_compose
6763

68-
# Build mobile web static files if requested
69-
if [ "$BUILD_MOBILE" = true ] && [ -d "$PROJECT_ROOT/src/mobile-web" ]; then
70-
check_command npm
71-
echo "[1/3] Building mobile web client..."
72-
cd "$PROJECT_ROOT/src/mobile-web"
73-
npm ci
74-
npm run build
75-
mkdir -p "$SCRIPT_DIR/static"
76-
cp -r dist/* "$SCRIPT_DIR/static/"
77-
cd "$SCRIPT_DIR"
78-
echo " Mobile web built → $SCRIPT_DIR/static/"
79-
else
80-
echo "[1/3] Skipping mobile web build (use --build-mobile to include)"
81-
fi
82-
8364
# Build and start containers
8465
cd "$SCRIPT_DIR"
8566
if [ "$SKIP_BUILD" = true ]; then
86-
echo "[2/3] Skipping Docker build (--skip-build)"
67+
echo "[1/2] Skipping Docker build (--skip-build)"
8768
else
88-
echo "[2/3] Building Docker images..."
69+
echo "[1/2] Building Docker images..."
8970
docker compose build
9071
fi
9172

92-
echo "[3/3] Starting services..."
73+
echo "[2/2] Starting services..."
9374
docker compose up -d
9475

9576
if [ "$SKIP_HEALTH_CHECK" = false ]; then

src/apps/relay-server/src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,10 @@ pub fn build_relay_router(
247247
.route("/health", get(routes::api::health_check))
248248
.route("/api/info", get(routes::api::server_info))
249249
.route("/api/rooms/:room_id/pair", post(routes::api::pair))
250-
.route("/api/rooms/:room_id/command", post(routes::api::command))
250+
.route(
251+
"/api/rooms/:room_id/command",
252+
post(routes::api::command).layer(DefaultBodyLimit::max(10 * 1024 * 1024)),
253+
)
251254
.route(
252255
"/api/rooms/:room_id/upload-web",
253256
post(routes::api::upload_web).layer(DefaultBodyLimit::max(10 * 1024 * 1024)),

src/apps/relay-server/src/routes/websocket.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ pub async fn websocket_handler(
7070
ws: WebSocketUpgrade,
7171
State(state): State<AppState>,
7272
) -> Response {
73-
ws.on_upgrade(move |socket| handle_socket(socket, state))
73+
ws.max_message_size(64 * 1024 * 1024)
74+
.on_upgrade(move |socket| handle_socket(socket, state))
7475
}
7576

7677
async fn handle_socket(socket: WebSocket, state: AppState) {

0 commit comments

Comments
 (0)