- Product design
- Technical design
- iOS to macOS installable MVP implementation
- Feature implementation principles
- External network access design
- Server minimal external security design
- Installable MVP implementation plan
- External network cloud relay plan
- Server minimal external security plan
- Feature delivery tracking
- Feature log
- Cloud relay dev deploy runbook
- Cloud test environment runbook
- External network smoke test runbook
- TestFlight build runbook
- macOS Agent desktop runbook
- Release readiness audit
This workspace uses pnpm through Corepack. Set it up and install dependencies:
corepack enable
corepack prepare pnpm@9.15.0 --activate
pnpm installIf pnpm --version already reports 9.15.0, the corepack prepare step is optional.
Start the development server. By default it listens on 127.0.0.1:8787:
pnpm dev:serverStart the macOS Agent:
REMOTE_DEVICE_ID=mac-dev pnpm dev:agentOr start the Electron desktop Agent shell:
REMOTE_DEVICE_ID=mac-dev pnpm --filter @remote/agent-desktop devStart the mobile app:
pnpm dev:mobileThe mobile app defaults to ws://127.0.0.1:8787/ws/mobile, so the iOS simulator works with the local server without extra environment variables.
In the mobile app, tap Connect, type pwd, and tap 发送.
Expected result: terminal output from the macOS Agent appears in the mobile terminal output panel.
For automated simulator smoke testing, start mobile with explicit autoconnect and a marker command:
EXPO_PUBLIC_REMOTE_AUTOCONNECT=1 \
EXPO_PUBLIC_REMOTE_SMOKE_COMMAND='printf "__APP_SIM__%s\n" "$PWD"' \
pnpm --filter @remote/mobile exec expo start --ios --localhost --port 8081Expected result: the simulator opens a terminal session and prints a marker like __APP_SIM__/Users/<name>.
Detailed iPhone steps are in Physical iPhone to Mac Runbook.
Start the server on all network interfaces:
HOST=0.0.0.0 pnpm dev:serverIf the Agent runs on the same development machine as the server, keep its server URL local:
REMOTE_SERVER_URL=ws://127.0.0.1:8787/ws/agent REMOTE_DEVICE_ID=mac-dev pnpm dev:agentIf the Agent runs on another machine, point it at the server's LAN address instead:
REMOTE_SERVER_URL=ws://<dev-machine-lan-ip>:8787/ws/agent REMOTE_DEVICE_ID=mac-dev pnpm dev:agentStart the mobile app with the development machine's LAN address:
EXPO_PUBLIC_REMOTE_WS_URL=ws://<dev-machine-lan-ip>:8787/ws/mobile pnpm dev:mobileUse this when testing the default external-network path:
iPhone on cellular -> Cloud Relay -> home macOS Agent
Follow Cloud Test Environment Runbook.
Core environment variables:
export REMOTE_RELAY_HOST="<relay-host>"
export REMOTE_DEV_TOKEN="<secret>"
export REMOTE_DEVICE_ID="home-mac"Start the Agent:
REMOTE_SERVER_URL="wss://${REMOTE_RELAY_HOST}/ws/agent" \
REMOTE_DEV_TOKEN="${REMOTE_DEV_TOKEN}" \
REMOTE_DEVICE_ID="${REMOTE_DEVICE_ID}" \
pnpm dev:agentStart the mobile app:
EXPO_PUBLIC_REMOTE_WS_URL="wss://${REMOTE_RELAY_HOST}/ws/mobile" \
EXPO_PUBLIC_REMOTE_API_URL="https://${REMOTE_RELAY_HOST}" \
EXPO_PUBLIC_REMOTE_DEV_TOKEN="${REMOTE_DEV_TOKEN}" \
EXPO_PUBLIC_REMOTE_DEVICE_ID="${REMOTE_DEVICE_ID}" \
pnpm dev:mobileOptional Agent environment variables:
REMOTE_SERVER_URL: Agent relay URL. Defaults tows://127.0.0.1:8787/ws/agent.REMOTE_DEVICE_NAME: Display name reported to the relay. Defaults to the machine hostname.SHELL: Shell spawned for terminal sessions. Defaults to/bin/zshwhen unset.
Run the workspace checks:
pnpm test
pnpm typecheck
pnpm buildVerify the local vertical slice:
-
Start the server:
pnpm dev:server
Confirm it listens on
127.0.0.1:8787. -
In another terminal, check health:
curl http://127.0.0.1:8787/health
Expected:
{"ok":true} -
Start the macOS Agent:
REMOTE_DEVICE_ID=mac-dev pnpm dev:agent
Confirm it registers with the server.
-
Check registered devices:
curl http://127.0.0.1:8787/devices
Expected response includes
mac-dev, capabilities["terminal"], andonline: true. -
Verify terminal routing through the current pairing flow:
-
Use the pairing panel in the mobile app to submit the pairing code printed by the Agent.
-
Approve the pairing request in the Agent terminal.
-
Tap
Connectin the mobile app. -
Run:
printf "__PWD__%s\n" "$PWD"
Expected output contains
__PWD__. The Agent PTY starts in$HOMEby default, so the marker commonly prints__PWD__/Users/<name>on macOS.Raw WebSocket probes must include a valid
sessionToken. Asession.openmessage withoutsessionTokenis rejected by design. -
-
Verify the Expo command does not fail immediately:
pnpm --filter @remote/mobile exec expo --help
Stop the development server and Agent processes when verification is complete.
- Confirm the server is running and listening on the right host. Physical devices need
HOST=0.0.0.0 pnpm dev:server. - Confirm the mobile app uses the matching URL: simulator default
ws://127.0.0.1:8787/ws/mobile, physical deviceEXPO_PUBLIC_REMOTE_WS_URL=ws://<dev-machine-lan-ip>:8787/ws/mobile. - Check
curl http://127.0.0.1:8787/devicesand confirm the Agent is listed withonline: true. - Confirm the mobile app device ID matches the Agent ID. The default is
mac-devwhen you start the Agent withREMOTE_DEVICE_ID=mac-dev.