clawdex-mobile 5.0.8 → 5.1.3-internal.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/README.md +41 -2
- package/bin/clawdex.js +6 -1
- package/docs/setup-and-operations.md +128 -8
- package/docs/troubleshooting.md +79 -0
- package/package.json +3 -1
- package/scripts/bridge-binary.js +6 -6
- package/scripts/bridge-self-update.js +246 -65
- package/scripts/codespaces-bootstrap.js +231 -0
- package/scripts/setup-secure-dev.sh +90 -5
- package/scripts/setup-wizard.sh +89 -7
- package/scripts/start-bridge-secure.js +318 -34
- package/scripts/stop-services.sh +10 -7
- package/services/rust-bridge/Cargo.lock +55 -3
- package/services/rust-bridge/Cargo.toml +3 -2
- package/services/rust-bridge/src/main.rs +5065 -337
- package/services/rust-bridge/src/services/git.rs +211 -5
- package/services/rust-bridge/src/services/update.rs +130 -16
- package/vendor/bridge-binaries/darwin-arm64/codex-rust-bridge +0 -0
- package/vendor/bridge-binaries/darwin-x64/codex-rust-bridge +0 -0
- package/vendor/bridge-binaries/linux-arm64/codex-rust-bridge +0 -0
- package/vendor/bridge-binaries/linux-armv7l/codex-rust-bridge +0 -0
- package/vendor/bridge-binaries/linux-x64/codex-rust-bridge +0 -0
- package/vendor/bridge-binaries/win32-x64/codex-rust-bridge.exe +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project are documented in this file.
|
|
4
4
|
|
|
5
|
+
## 5.1.2 - 2026-04-07
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- Local preview browser workflow with desktop and overview shells for mobile web inspection.
|
|
9
|
+
- App-wide font preference support in the mobile client.
|
|
10
|
+
|
|
11
|
+
### Improved
|
|
12
|
+
- Chat transcript tool-call UX now supports grouped tool-call inspection, per-call output expansion, and file-change labels that include changed filenames.
|
|
13
|
+
- Drawer, sheet, and chat header interactions feel smoother and more consistent across open/close, reconnect, and navigation flows.
|
|
14
|
+
- Composer and transcript responsiveness were tightened with lower rerender churn, more stable activity indicators, and cleaner compaction presentation.
|
|
15
|
+
- Browser preview controls, address handling, and preview session stability were refined for everyday use.
|
|
16
|
+
- Manual npm release runs can now build every packaged bridge target without publishing to npm.
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
- Bridge restart cleanup and maintenance behavior are more reliable during repeated local development cycles.
|
|
20
|
+
- Queued thread messages now use guaranteed-unique bridge queue item IDs during blocked-turn queuing.
|
|
21
|
+
- Bridge self-update now reports shutdown failures cleanly while still preserving status updates and `.env.secure` backup cleanup.
|
|
22
|
+
- Browser preview and mobile UI regressions caught during review and CI were resolved before release.
|
|
23
|
+
|
|
5
24
|
## 1.1.0 - 2026-02-23
|
|
6
25
|
|
|
7
26
|
### Added
|
package/README.md
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
<img src="https://raw.githubusercontent.com/Mohit-Patil/clawdex-mobile/main/screenshots/social/clawdex-social-poster-1200x675.png" alt="Clawdex social banner" width="100%" />
|
|
5
5
|
</p>
|
|
6
6
|
|
|
7
|
-
Run Codex or OpenCode from your phone. `clawdex-mobile` ships the bridge CLI plus bundled Rust bridge binaries for supported hosts, and the mobile app pairs to that bridge over Tailscale or
|
|
7
|
+
Run Codex or OpenCode from your phone. `clawdex-mobile` ships the bridge CLI plus bundled Rust bridge binaries for supported hosts, and the mobile app pairs to that bridge over Tailscale, local LAN, or GitHub Codespaces forwarded HTTPS URLs.
|
|
8
8
|
|
|
9
|
-
This project is for trusted/private networking
|
|
9
|
+
This project is for trusted/private networking by default. GitHub Codespaces is supported as an internet-reachable exception: keep bridge auth enabled, use only repos you trust, and remember forwarded public ports reset to private when a codespace restarts.
|
|
10
10
|
|
|
11
11
|
## What You Get
|
|
12
12
|
|
|
@@ -52,6 +52,45 @@ clawdex init
|
|
|
52
52
|
clawdex stop
|
|
53
53
|
```
|
|
54
54
|
|
|
55
|
+
## GitHub Codespaces
|
|
56
|
+
|
|
57
|
+
You can run the bridge inside a GitHub Codespace instead of keeping a laptop or server online.
|
|
58
|
+
|
|
59
|
+
From a repo checkout inside Codespaces:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
npm run setup:wizard
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Pick `GitHub Codespaces` as the network mode. The setup flow writes forwarded HTTPS bridge URLs into `.env.secure`, and bridge startup will try to mark both bridge ports public automatically.
|
|
66
|
+
|
|
67
|
+
Notes:
|
|
68
|
+
|
|
69
|
+
- The mobile app should pair to the printed `https://<codespace>-8787.app.github.dev` URL, not `127.0.0.1`.
|
|
70
|
+
- Browser preview uses a second forwarded port (`8788` by default), so both ports need public visibility.
|
|
71
|
+
- GitHub resets public forwarded ports back to private when a codespace restarts. Restarting the bridge reruns the visibility step.
|
|
72
|
+
- If automatic visibility setup fails, run `gh codespace ports visibility 8787:public 8788:public`.
|
|
73
|
+
- If the mobile app is built with `EXPO_PUBLIC_GITHUB_CLIENT_ID`, users can now tap `Use GitHub Codespaces` in onboarding/settings, sign in with GitHub, pick a Codespace, and connect without manually copying the bridge token.
|
|
74
|
+
- The app can also create a new repo-backed Codespace directly. It prefers `<signed-in-user>/<EXPO_PUBLIC_GITHUB_CODESPACES_REPO_NAME>` first. If that repo does not exist, it automatically forks `EXPO_PUBLIC_GITHUB_CODESPACES_SOURCE_OWNER/<EXPO_PUBLIC_GITHUB_CODESPACES_REPO_NAME>` into the signed-in user account, then creates the Codespace there.
|
|
75
|
+
|
|
76
|
+
This repo now also includes a Codespaces bootstrap flow. On Codespace start/resume, `.devcontainer/devcontainer.json` runs:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
npm run codespaces:bootstrap
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
During initial Codespace creation, the devcontainer also runs:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
npm run codespaces:bootstrap -- --prepare-only
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
That pre-installs Codex and prebuilds the Rust bridge binary so the later startup path is faster. The normal bootstrap command rewrites `.env.secure` for Codespaces with `codex` as the only enabled engine and starts the bridge in the background. You can rerun either command manually any time.
|
|
89
|
+
|
|
90
|
+
The published npm package now includes that bootstrap script too, so a minimal Codespaces template repo can install `clawdex-mobile@latest` in `postCreateCommand` and call the packaged bootstrap without vendoring bridge source into the template itself.
|
|
91
|
+
|
|
92
|
+
In Codespaces mode, the bootstrap also enables bridge-side GitHub bearer auth for the current `CODESPACE_NAME`, so the mobile app can authenticate with the same GitHub OAuth token it used to discover and start the Codespace.
|
|
93
|
+
|
|
55
94
|
## OpenCode Setup
|
|
56
95
|
|
|
57
96
|
OpenCode is supported directly from the CLI now.
|
package/bin/clawdex.js
CHANGED
|
@@ -34,9 +34,14 @@ Commands:
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
function runCommand(command, args = [], options = {}) {
|
|
37
|
+
const workspaceRoot = process.env.CLAWDEX_WORKSPACE_ROOT || process.cwd();
|
|
37
38
|
const child = spawnSync(command, args, {
|
|
38
39
|
stdio: "inherit",
|
|
39
|
-
env:
|
|
40
|
+
env: {
|
|
41
|
+
...process.env,
|
|
42
|
+
CLAWDEX_WORKSPACE_ROOT: workspaceRoot,
|
|
43
|
+
INIT_CWD: process.env.INIT_CWD || workspaceRoot,
|
|
44
|
+
},
|
|
40
45
|
cwd: process.cwd(),
|
|
41
46
|
...options,
|
|
42
47
|
});
|
|
@@ -37,6 +37,75 @@ Published npm releases bundle prebuilt bridge binaries for `darwin-arm64`, `darw
|
|
|
37
37
|
|
|
38
38
|
Published CLI installs are bridge-only. They do not include the Expo workspace or mobile app source files.
|
|
39
39
|
|
|
40
|
+
## GitHub Codespaces Setup
|
|
41
|
+
|
|
42
|
+
Codespaces can replace a user-managed always-on machine for development and lightweight remote use.
|
|
43
|
+
|
|
44
|
+
From a repo checkout inside an active codespace:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
npm run setup:wizard
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Choose `GitHub Codespaces` for the bridge network mode.
|
|
51
|
+
|
|
52
|
+
What that does:
|
|
53
|
+
|
|
54
|
+
- binds the bridge locally inside the codespace
|
|
55
|
+
- writes `BRIDGE_CONNECT_URL` and `BRIDGE_PREVIEW_CONNECT_URL` using the codespace forwarded HTTPS domain
|
|
56
|
+
- enables bridge-side GitHub bearer auth for the current codespace
|
|
57
|
+
- starts the bridge normally
|
|
58
|
+
- attempts to mark the bridge port and browser-preview port public on each startup
|
|
59
|
+
|
|
60
|
+
Important constraints:
|
|
61
|
+
|
|
62
|
+
- Pair the mobile app to the printed `https://<codespace>-8787.app.github.dev` URL, not `127.0.0.1`
|
|
63
|
+
- Browser preview uses the preview port (`8788` by default), so that forwarded port must also be public
|
|
64
|
+
- GitHub resets public forwarded ports back to private whenever the codespace restarts
|
|
65
|
+
- Keep bridge auth enabled and use Codespaces only for repos you trust, because public forwarded ports are internet-reachable
|
|
66
|
+
- If the mobile app build sets `EXPO_PUBLIC_GITHUB_CLIENT_ID`, onboarding/settings can now sign in with GitHub, start the Codespace, and connect directly with the same OAuth token instead of copying `BRIDGE_AUTH_TOKEN`
|
|
67
|
+
- The same in-app GitHub flow can create a new Codespace. It prefers `<signed-in-user>/<EXPO_PUBLIC_GITHUB_CODESPACES_REPO_NAME>`. If that repo does not exist yet, Clawdex automatically forks `EXPO_PUBLIC_GITHUB_CODESPACES_SOURCE_OWNER/<EXPO_PUBLIC_GITHUB_CODESPACES_REPO_NAME>` into the signed-in user account and creates the Codespace from that fork
|
|
68
|
+
|
|
69
|
+
Manual recovery if port visibility does not update automatically:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
gh codespace ports visibility 8787:public 8788:public
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Codespaces Bootstrap
|
|
76
|
+
|
|
77
|
+
The repo devcontainer now includes:
|
|
78
|
+
|
|
79
|
+
- `postCreateCommand`: `npm install --include=dev && npm run codespaces:bootstrap -- --prepare-only`
|
|
80
|
+
- `postStartCommand`: `npm run codespaces:bootstrap`
|
|
81
|
+
|
|
82
|
+
`npm run codespaces:bootstrap` does the following:
|
|
83
|
+
|
|
84
|
+
- installs the Codex CLI via `npm install -g @openai/codex` if it is missing
|
|
85
|
+
- in `--prepare-only` mode, prebuilds the Rust bridge binary without starting it
|
|
86
|
+
- rewrites `.env.secure` for `BRIDGE_NETWORK_MODE=codespaces` with `BRIDGE_ACTIVE_ENGINE=codex`, `BRIDGE_ENABLED_ENGINES=codex`, and `BRIDGE_GITHUB_CODESPACES_AUTH=true`
|
|
87
|
+
- starts the bridge in the background unless you set `CLAWDEX_CODESPACES_SKIP_START=true` or pass `--no-start`
|
|
88
|
+
|
|
89
|
+
That means the first Codespace create now front-loads the expensive bridge compile during `postCreateCommand`, so the later `postStartCommand` can usually start the bridge much faster.
|
|
90
|
+
|
|
91
|
+
The same bootstrap script is included in the published `clawdex-mobile` npm package. That lets the `clawdex-codespace` template stay minimal: it can install `clawdex-mobile@latest` globally in the devcontainer and invoke the packaged bootstrap against the current workspace instead of copying `scripts/*` and `services/rust-bridge/*` into the template repo.
|
|
92
|
+
|
|
93
|
+
Manual examples:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
npm run codespaces:bootstrap -- --prepare-only
|
|
97
|
+
npm run codespaces:bootstrap
|
|
98
|
+
npm run codespaces:bootstrap -- --no-start
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Minimal template equivalent:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
npm install -g clawdex-mobile@latest @openai/codex
|
|
105
|
+
CLAWDEX_WORKSPACE_ROOT="$PWD" node "$(npm root -g)/clawdex-mobile/scripts/codespaces-bootstrap.js" --prepare-only
|
|
106
|
+
CLAWDEX_WORKSPACE_ROOT="$PWD" node "$(npm root -g)/clawdex-mobile/scripts/codespaces-bootstrap.js"
|
|
107
|
+
```
|
|
108
|
+
|
|
40
109
|
## Manual Secure Setup (No Wizard)
|
|
41
110
|
|
|
42
111
|
### 1) Install dependencies
|
|
@@ -78,18 +147,22 @@ When both CLIs are selected, the bridge starts both backends and merges chat lis
|
|
|
78
147
|
|
|
79
148
|
### 4) Pair from the mobile app
|
|
80
149
|
|
|
81
|
-
Open the installed mobile app on your phone, then scan the bridge QR. If needed, enter the bridge URL manually (for example `http://100.x.y.z:8787
|
|
150
|
+
Open the installed mobile app on your phone, then scan the bridge QR. If needed, enter the bridge URL manually (for example `http://100.x.y.z:8787`, `http://192.168.x.y:8787`, or `https://<codespace>-8787.app.github.dev`). The chosen bridge URL is stored on-device and can be changed later in Settings.
|
|
82
151
|
|
|
83
|
-
### In-app Bridge
|
|
152
|
+
### In-app Bridge Maintenance
|
|
84
153
|
|
|
85
|
-
For
|
|
154
|
+
For secure-launcher installs, the mobile Settings screen can trigger bridge maintenance safely.
|
|
86
155
|
|
|
87
156
|
- Open `Settings > Bridge Maintenance`
|
|
88
|
-
- Tap `
|
|
89
|
-
- The app will disconnect briefly while
|
|
157
|
+
- Tap `Restart bridge safely` to stop the current bridge and relaunch it through `scripts/start-bridge-secure.js`
|
|
158
|
+
- The app will disconnect briefly while the detached helper waits for bridge health to recover
|
|
159
|
+
|
|
160
|
+
Published `clawdex-mobile` CLI installs also expose `Update bridge`.
|
|
161
|
+
|
|
162
|
+
- `Update bridge` stops the current bridge, runs `npm install -g clawdex-mobile@latest`, and starts the bridge again
|
|
90
163
|
- If the upgrade step fails, the helper attempts to restart the previous bridge automatically
|
|
91
164
|
|
|
92
|
-
Source checkouts
|
|
165
|
+
Source checkouts expose only the restart action because repo-specific update logic is not safe to automate generically from mobile.
|
|
93
166
|
|
|
94
167
|
## Local Mobile Development Only
|
|
95
168
|
|
|
@@ -110,6 +183,39 @@ Optional environment variables:
|
|
|
110
183
|
- `EXPO_AUTO_REPAIR=true` — auto-repair React Native runtime on `npm run mobile`
|
|
111
184
|
- `EXPO_CLEAR_CACHE=true` — force `expo start --clear` via `npm run mobile`
|
|
112
185
|
|
|
186
|
+
## Local Browser Preview
|
|
187
|
+
|
|
188
|
+
The mobile app includes a `Browser` screen that can open loopback-only web apps from the bridge
|
|
189
|
+
machine inside the app itself.
|
|
190
|
+
|
|
191
|
+
Typical examples:
|
|
192
|
+
|
|
193
|
+
- `localhost:3000`
|
|
194
|
+
- `127.0.0.1:5173`
|
|
195
|
+
- `3000`
|
|
196
|
+
|
|
197
|
+
How it works:
|
|
198
|
+
|
|
199
|
+
- The app creates a short-lived preview session through the bridge RPC API
|
|
200
|
+
- The bridge serves a dedicated preview origin on a separate port
|
|
201
|
+
- HTTP requests, subresources, cookies, and WebSocket/HMR traffic are proxied from the phone to
|
|
202
|
+
the bridge host's loopback target
|
|
203
|
+
- Browser runtime calls to other loopback origins on the host are also rewritten through the
|
|
204
|
+
preview origin for `fetch`, XHR, `EventSource`, `WebSocket`, and form submissions
|
|
205
|
+
|
|
206
|
+
Current scope:
|
|
207
|
+
|
|
208
|
+
- Supports `http://` and `https://` loopback targets only
|
|
209
|
+
- Intended for local web dev servers such as Next.js, Vite, CRA, or simple static servers
|
|
210
|
+
- Separate local frontend/backend ports can work together inside the preview as long as the app
|
|
211
|
+
reaches the backend through normal browser APIs or form posts
|
|
212
|
+
- Hard-coded absolute localhost asset URLs outside those browser APIs may still need a same-origin
|
|
213
|
+
dev proxy in the app itself
|
|
214
|
+
- Does not preview native React Native simulator/device UI directly
|
|
215
|
+
|
|
216
|
+
For a concise list of supported cases and known limitations, see
|
|
217
|
+
`docs/browser-preview-limitations.md`.
|
|
218
|
+
|
|
113
219
|
## Teardown / Cleanup
|
|
114
220
|
|
|
115
221
|
```bash
|
|
@@ -136,10 +242,17 @@ npm run teardown -- --yes
|
|
|
136
242
|
|
|
137
243
|
| Variable | Purpose |
|
|
138
244
|
|---|---|
|
|
245
|
+
| `BRIDGE_NETWORK_MODE` | bridge connectivity mode (`tailscale`, `local`, or `codespaces`) |
|
|
139
246
|
| `BRIDGE_HOST` | bind host for rust bridge |
|
|
140
247
|
| `BRIDGE_PORT` | bridge port (default `8787`) |
|
|
248
|
+
| `BRIDGE_PREVIEW_PORT` | browser preview port for proxied localhost web apps (default `BRIDGE_PORT + 1`) |
|
|
249
|
+
| `BRIDGE_CONNECT_URL` | externally reachable bridge base URL used for pairing/QR output |
|
|
250
|
+
| `BRIDGE_PREVIEW_CONNECT_URL` | externally reachable browser preview base URL |
|
|
141
251
|
| `BRIDGE_AUTH_TOKEN` | required auth token |
|
|
142
252
|
| `BRIDGE_ALLOW_QUERY_TOKEN_AUTH` | query-token auth fallback |
|
|
253
|
+
| `BRIDGE_GITHUB_CODESPACES_AUTH` | accept GitHub bearer tokens for the current codespace |
|
|
254
|
+
| `BRIDGE_GITHUB_CODESPACE_NAME` | codespace name used when validating GitHub bearer tokens |
|
|
255
|
+
| `BRIDGE_GITHUB_API_URL` | GitHub REST API base URL for Codespaces auth checks |
|
|
143
256
|
| `CODEX_CLI_BIN` | codex executable |
|
|
144
257
|
| `BRIDGE_ACTIVE_ENGINE` | internal preferred routing backend used when multiple harnesses are enabled |
|
|
145
258
|
| `BRIDGE_ENABLED_ENGINES` | selected harnesses to expose (`codex`, `opencode`, or both) |
|
|
@@ -156,6 +269,11 @@ npm run teardown -- --yes
|
|
|
156
269
|
| Variable | Purpose |
|
|
157
270
|
|---|---|
|
|
158
271
|
| `EXPO_PUBLIC_HOST_BRIDGE_TOKEN` | token used by local mobile dev builds |
|
|
272
|
+
| `EXPO_PUBLIC_GITHUB_CLIENT_ID` | GitHub OAuth app client ID for in-app Codespaces sign-in |
|
|
273
|
+
| `EXPO_PUBLIC_GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN` | forwarded port domain used to derive Codespaces bridge URLs (`app.github.dev` by default) |
|
|
274
|
+
| `EXPO_PUBLIC_GITHUB_CODESPACES_REPO_NAME` | repository name to sort matching Codespaces first in the in-app picker |
|
|
275
|
+
| `EXPO_PUBLIC_GITHUB_CODESPACES_SOURCE_OWNER` | template/source repository owner used for automatic forking when the signed-in user does not have a same-name repo |
|
|
276
|
+
| `EXPO_PUBLIC_GITHUB_CODESPACES_REPO_REF` | optional git ref/branch used when creating a new Codespace |
|
|
159
277
|
| `EXPO_PUBLIC_ALLOW_QUERY_TOKEN_AUTH` | query-token behavior for WebSocket auth fallback |
|
|
160
278
|
| `EXPO_PUBLIC_ALLOW_INSECURE_REMOTE_BRIDGE` | suppress insecure-HTTP warning |
|
|
161
279
|
| `EXPO_PUBLIC_PRIVACY_POLICY_URL` | in-app Privacy link |
|
|
@@ -175,8 +293,9 @@ If you enable the optional tip jar:
|
|
|
175
293
|
|
|
176
294
|
## Production Readiness Checklist
|
|
177
295
|
|
|
178
|
-
- Keep bridge network-private only (Tailscale/private LAN/VPN + host firewall)
|
|
179
|
-
-
|
|
296
|
+
- Keep bridge network-private only by default (Tailscale/private LAN/VPN + host firewall)
|
|
297
|
+
- If using GitHub Codespaces, remember the bridge is internet-reachable whenever its forwarded ports are public
|
|
298
|
+
- Require bridge auth of some kind (`BRIDGE_AUTH_TOKEN` or GitHub Codespaces auth)
|
|
180
299
|
- Keep `BRIDGE_ALLOW_QUERY_TOKEN_AUTH=true` only on private networks (required for Android WS auth fallback)
|
|
181
300
|
- Do not set `BRIDGE_ALLOW_INSECURE_NO_AUTH=true` outside local debugging
|
|
182
301
|
- Scope `BRIDGE_WORKDIR` to minimal required root
|
|
@@ -207,6 +326,7 @@ Expected response contains `"status":"ok"`.
|
|
|
207
326
|
6. Open Git from header and verify status/diff/commit/push behavior
|
|
208
327
|
7. Test attachment menu (`+`) with workspace path + phone file/image
|
|
209
328
|
8. Run long task and verify stop button interrupts run and transcript logs stop
|
|
329
|
+
9. Open `Browser`, enter `localhost:3000` or another active loopback dev port, and verify the page loads inside the app
|
|
210
330
|
|
|
211
331
|
## Chat Controls (Workspace, Model, Mode, Approvals)
|
|
212
332
|
|
package/docs/troubleshooting.md
CHANGED
|
@@ -34,10 +34,89 @@ npm run stop:services
|
|
|
34
34
|
## Bridge auth errors (`401`, invalid token)
|
|
35
35
|
|
|
36
36
|
- For the shipped mobile app, rescan the bridge QR or update the stored token in Settings.
|
|
37
|
+
- For GitHub-auth Codespaces profiles, reopen `GitHub Codespaces` in the app and sign in with GitHub again if the OAuth token was revoked or expired.
|
|
37
38
|
- For a local dev build, also ensure `BRIDGE_AUTH_TOKEN` in `.env.secure` matches `EXPO_PUBLIC_HOST_BRIDGE_TOKEN` in `apps/mobile/.env`.
|
|
38
39
|
- Restart the bridge after token changes.
|
|
40
|
+
- On secure-launcher installs, `Settings > Bridge Maintenance > Restart bridge safely` can do that from the phone.
|
|
39
41
|
- If an in-app bridge update fails, inspect `.bridge-updater.log` and `.bridge-update-status.json` in the bridge install root.
|
|
40
42
|
|
|
43
|
+
## GitHub Codespaces bridge URL does not connect
|
|
44
|
+
|
|
45
|
+
- Pair to the printed forwarded HTTPS URL such as `https://<codespace>-8787.app.github.dev`, not `127.0.0.1`.
|
|
46
|
+
- Public forwarded ports reset back to private when the codespace restarts.
|
|
47
|
+
- Restart the bridge or rerun `npm run codespaces:bootstrap` to rerun the automatic visibility step.
|
|
48
|
+
- If needed, set both ports public manually:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
gh codespace ports visibility 8787:public 8788:public
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
- If `gh` is unavailable in the codespace, use the Codespaces `Ports` panel and change both forwarded ports to `Public`.
|
|
55
|
+
- Keep bridge auth enabled. Public forwarded ports without bridge auth are not a safe setup.
|
|
56
|
+
- If GitHub direct sign-in is not showing in the app, confirm the build includes `EXPO_PUBLIC_GITHUB_CLIENT_ID`.
|
|
57
|
+
- If in-app Codespace creation forks or targets the wrong repo, check `EXPO_PUBLIC_GITHUB_CODESPACES_REPO_NAME`, `EXPO_PUBLIC_GITHUB_CODESPACES_SOURCE_OWNER`, and `EXPO_PUBLIC_GITHUB_CODESPACES_REPO_REF` in the mobile build env.
|
|
58
|
+
|
|
59
|
+
## GitHub Codespaces bootstrap did not start the bridge
|
|
60
|
+
|
|
61
|
+
- Check the post-start command output in the Codespace terminal or rerun it manually:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
npm run codespaces:bootstrap -- --prepare-only
|
|
65
|
+
npm run codespaces:bootstrap
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
- On the minimal `clawdex-codespace` template, rerun the packaged bootstrap instead:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
CLAWDEX_WORKSPACE_ROOT="$PWD" node "$(npm root -g)/clawdex-mobile/scripts/codespaces-bootstrap.js" --prepare-only
|
|
72
|
+
CLAWDEX_WORKSPACE_ROOT="$PWD" node "$(npm root -g)/clawdex-mobile/scripts/codespaces-bootstrap.js"
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
- The Codespaces bootstrap only prepares the `codex` engine. It will try to install Codex automatically with `npm install -g @openai/codex`.
|
|
76
|
+
- `--prepare-only` installs Codex if needed and prebuilds the Rust bridge binary without starting the bridge.
|
|
77
|
+
- The bootstrap also enables `BRIDGE_GITHUB_CODESPACES_AUTH=true` so GitHub bearer tokens can connect directly to the bridge.
|
|
78
|
+
- If that install fails, fix npm/global package permissions in the codespace and rerun the bootstrap.
|
|
79
|
+
- Bridge startup logs and runtime state live in the Codespace repo root:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
tail -n 200 .bridge.log
|
|
83
|
+
ls -la .bridge.pid .bridge.log .env.secure
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
- To only rewrite `.env.secure` without starting the bridge:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
npm run codespaces:bootstrap -- --no-start
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Voice transcription says no credentials were found
|
|
93
|
+
|
|
94
|
+
- The bridge can transcribe with either `OPENAI_API_KEY`, `BRIDGE_CHATGPT_ACCESS_TOKEN`, or the same ChatGPT auth tokens already used for Codex login.
|
|
95
|
+
- In GitHub Codespaces, finish the ChatGPT/Codex login step from the app first. The bridge will persist those tokens to `BRIDGE_WORKDIR/.clawdex-chatgpt-auth.json` and reuse them for voice transcription.
|
|
96
|
+
- If you still see the error after logging in, restart the bridge once so it reloads the persisted auth cache:
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
npm run secure:bridge
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
- You can inspect whether the bridge captured the token bundle:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
ls -la .clawdex-chatgpt-auth.json
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Local browser preview does not open
|
|
109
|
+
|
|
110
|
+
- The in-app browser only supports loopback targets from the bridge host: `localhost`, `127.0.0.1`, or `::1`.
|
|
111
|
+
- Use entries like `localhost:3000`, `127.0.0.1:5173`, or just a port number.
|
|
112
|
+
- If a separate local API runs on another port, make sure the app reaches it through `fetch`, XHR, `EventSource`, `WebSocket`, or a normal form post so the preview runtime can rewrite it through the bridge.
|
|
113
|
+
- See `docs/browser-preview-limitations.md` for the current support boundaries and known caveats.
|
|
114
|
+
- If Browser reports preview is unavailable, check whether `BRIDGE_PREVIEW_PORT` is already in use on the host.
|
|
115
|
+
- By default the preview server binds to `BRIDGE_PORT + 1`.
|
|
116
|
+
- Restart the bridge after changing `BRIDGE_PREVIEW_PORT`.
|
|
117
|
+
- If the page shell loads but live reload does not, verify the target dev server is still serving its WebSocket/HMR endpoint locally.
|
|
118
|
+
- In GitHub Codespaces, the preview port (`8788` by default) must also be public or the Browser screen will fail even if the main bridge port works.
|
|
119
|
+
|
|
41
120
|
## Tailscale issues
|
|
42
121
|
|
|
43
122
|
- Verify host and phone are on the same Tailscale network
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clawdex-mobile",
|
|
3
|
-
"version": "5.0
|
|
3
|
+
"version": "5.1.3-internal.0",
|
|
4
4
|
"description": "Private-network mobile bridge and CLI for Codex and OpenCode",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"codex",
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
"docs/troubleshooting.md",
|
|
35
35
|
"scripts/bridge-binary.js",
|
|
36
36
|
"scripts/bridge-self-update.js",
|
|
37
|
+
"scripts/codespaces-bootstrap.js",
|
|
37
38
|
"scripts/setup-secure-dev.sh",
|
|
38
39
|
"scripts/setup-wizard.sh",
|
|
39
40
|
"scripts/start-bridge-secure.js",
|
|
@@ -58,6 +59,7 @@
|
|
|
58
59
|
"secure:setup": "./scripts/setup-secure-dev.sh",
|
|
59
60
|
"secure:bridge": "node ./scripts/start-bridge-secure.js",
|
|
60
61
|
"secure:bridge:dev": "node ./scripts/start-bridge-secure.js --dev",
|
|
62
|
+
"codespaces:bootstrap": "node ./scripts/codespaces-bootstrap.js",
|
|
61
63
|
"bridge:ts": "BRIDGE_WORKDIR=$(pwd) npm run -w @codex/mac-bridge dev",
|
|
62
64
|
"version:sync": "node scripts/sync-versions.js",
|
|
63
65
|
"build": "npm run --workspaces build",
|
package/scripts/bridge-binary.js
CHANGED
|
@@ -81,9 +81,9 @@ function packagedBinaryPath(rootDir = repoRoot(), target = resolveRuntimeTarget(
|
|
|
81
81
|
return path.join(rootDir, "vendor", "bridge-binaries", target, binaryNameForTarget(target));
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
function builtBinaryPath(rootDir = repoRoot(), platform = os.platform()) {
|
|
84
|
+
function builtBinaryPath(rootDir = repoRoot(), platform = os.platform(), profile = "release") {
|
|
85
85
|
const binaryName = platform === "win32" ? "codex-rust-bridge.exe" : "codex-rust-bridge";
|
|
86
|
-
return path.join(rootDir, "services", "rust-bridge", "target",
|
|
86
|
+
return path.join(rootDir, "services", "rust-bridge", "target", profile, binaryName);
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
function ensureExecutable(filePath) {
|
|
@@ -168,13 +168,13 @@ function main() {
|
|
|
168
168
|
return;
|
|
169
169
|
}
|
|
170
170
|
case "current-built-path": {
|
|
171
|
-
console.log(builtBinaryPath(rootDir));
|
|
171
|
+
console.log(builtBinaryPath(rootDir, os.platform(), flags.profile || "release"));
|
|
172
172
|
return;
|
|
173
173
|
}
|
|
174
174
|
case "stage-current": {
|
|
175
175
|
const destination = stageBinary({
|
|
176
176
|
rootDir,
|
|
177
|
-
from: builtBinaryPath(rootDir),
|
|
177
|
+
from: builtBinaryPath(rootDir, os.platform(), flags.profile || "release"),
|
|
178
178
|
target: flags.target || resolveRuntimeTarget(),
|
|
179
179
|
});
|
|
180
180
|
console.log(destination);
|
|
@@ -194,8 +194,8 @@ function main() {
|
|
|
194
194
|
console.error(" node scripts/bridge-binary.js current-target");
|
|
195
195
|
console.error(" node scripts/bridge-binary.js has-current-packaged");
|
|
196
196
|
console.error(" node scripts/bridge-binary.js current-packaged-path [--target <target>]");
|
|
197
|
-
console.error(" node scripts/bridge-binary.js current-built-path");
|
|
198
|
-
console.error(" node scripts/bridge-binary.js stage-current [--target <target>]");
|
|
197
|
+
console.error(" node scripts/bridge-binary.js current-built-path [--profile <debug|release>]");
|
|
198
|
+
console.error(" node scripts/bridge-binary.js stage-current [--target <target>] [--profile <debug|release>]");
|
|
199
199
|
console.error(" node scripts/bridge-binary.js stage --from <binary> [--target <target>]");
|
|
200
200
|
process.exit(1);
|
|
201
201
|
}
|