@gakim-digital/dexter-bridge 0.5.21 → 0.11.1
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/README.md +129 -35
- package/package.json +19 -5
- package/src/agent.js +1575 -334
- package/src/agentOutput.js +209 -0
- package/src/api.js +82 -1
- package/src/cli.js +267 -39
- package/src/config.js +35 -7
- package/src/framerAgentTools.js +2547 -0
- package/src/framerBehaviorContract.js +962 -0
- package/src/harnessMcpServer.js +240 -0
- package/src/harnessTools.js +548 -0
- package/src/logger.js +2 -1
- package/src/nativeSkills.js +295 -0
- package/src/outcomeWorkspace.js +351 -0
- package/src/protocol.js +288 -0
- package/src/providers/acp.js +241 -0
- package/src/providers/codexAppServer.js +1059 -157
- package/src/providers/codexStructuredOutput.js +243 -16
- package/src/providers/directByok.js +197 -0
- package/src/providers/index.js +33 -7
- package/src/providers/openCode.js +607 -0
- package/src/runtimeProfiles.js +284 -0
- package/src/providers/claudeAgentSdk.js +0 -507
package/README.md
CHANGED
|
@@ -1,35 +1,121 @@
|
|
|
1
1
|
# Local Agent Bridge
|
|
2
2
|
|
|
3
3
|
Local bridge CLI for InstaWebAI and Dexter. It connects a user's existing
|
|
4
|
-
Claude Code or
|
|
5
|
-
InstaWebAI.
|
|
4
|
+
Codex, Claude Code, or OpenCode setup without sending those login credentials
|
|
5
|
+
to InstaWebAI.
|
|
6
6
|
|
|
7
|
-
The two products share the bridge package but not their pairing state
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
`~/.dexter-bridge/app-builder-*` configuration directories.
|
|
11
|
-
- Dexter uses the `framer` connection scope and its standard bridge
|
|
12
|
-
configuration.
|
|
13
|
-
- The API assigns the product identity during pairing. The CLI does not accept
|
|
14
|
-
a flag that can change one product's connection into the other.
|
|
7
|
+
The two products share the bridge package but not their pairing state. The API
|
|
8
|
+
assigns the product identity during pairing; the CLI cannot turn one product's
|
|
9
|
+
pairing code into another product's connection.
|
|
15
10
|
|
|
16
11
|
## InstaWebAI App Builder
|
|
17
12
|
|
|
18
|
-
The
|
|
19
|
-
|
|
13
|
+
The Connections page offers separate Codex, Claude Code, and OpenCode cards.
|
|
14
|
+
Choose an agent, copy its command, and keep that terminal open while building:
|
|
20
15
|
|
|
21
16
|
```bash
|
|
22
17
|
npx --yes @gakim-digital/dexter-bridge@latest connect 123456 \
|
|
23
18
|
--api https://api-insta.instawebai.com/iwm-api/0.0.1 \
|
|
24
|
-
--
|
|
25
|
-
--model codex:gpt-5.5 \
|
|
26
|
-
--config-dir ~/.dexter-bridge/app-builder-codex
|
|
19
|
+
--runtime codex
|
|
27
20
|
```
|
|
28
21
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
22
|
+
Use `--runtime claude-code` or `--runtime opencode` for the other cards. The
|
|
23
|
+
CLI automatically stores each connection in an isolated directory under
|
|
24
|
+
`~/.dexter-bridge/app-builder/`, so any combination of the three agents can be
|
|
25
|
+
connected at the same time. The selected runtime must already be installed and
|
|
26
|
+
signed in or configured on the same computer.
|
|
27
|
+
|
|
28
|
+
The pairing session is scoped to the runtime selected in InstaWebAI. A modified
|
|
29
|
+
command cannot claim the pairing code for a different runtime.
|
|
30
|
+
|
|
31
|
+
## Dexter for Framer
|
|
32
|
+
|
|
33
|
+
Dexter Framer runs are harness-first. The API sends one scoped outcome
|
|
34
|
+
assignment to the connected Codex, Claude Code, or OpenCode runtime. That
|
|
35
|
+
harness inspects and edits the selected Framer project directly through the
|
|
36
|
+
official `@framer/agent` connection while the plugin remains the chat,
|
|
37
|
+
progress, cancellation, and result interface.
|
|
38
|
+
|
|
39
|
+
The Framer harness receives only these project-scoped tools:
|
|
40
|
+
|
|
41
|
+
- `framer_instructions` and `framer_context`
|
|
42
|
+
- `framer_read_project`, `framer_verify_interactions`, and `framer_apply_changes`
|
|
43
|
+
- restricted `framer_read` and `framer_write`
|
|
44
|
+
- `progress_update`
|
|
45
|
+
|
|
46
|
+
Native shell, filesystem, web, and unrelated-project access are disabled for
|
|
47
|
+
Framer outcome runs. Publishing is denied unless a future assignment explicitly
|
|
48
|
+
authorizes it.
|
|
49
|
+
|
|
50
|
+
Bridges advertise `framer-interaction-verification-v1`,
|
|
51
|
+
`framer-behavior-contract-v1`, and `framer-mechanism-verification-v1` only
|
|
52
|
+
when interaction work is declared as observable behavior, checked against the
|
|
53
|
+
selected Framer mechanism before mutation, and verified from live canonical
|
|
54
|
+
Framer nodes afterward. Repeated behavior is verified on one representative
|
|
55
|
+
target before the remaining targets are changed.
|
|
56
|
+
|
|
57
|
+
Project connection is handled inside Dexter and completes before the model
|
|
58
|
+
starts:
|
|
59
|
+
|
|
60
|
+
- The plugin reads the exact active project or branch URL directly from Framer.
|
|
61
|
+
- The user adds a Framer project API key once in Dexter. The API verifies it
|
|
62
|
+
through Framer's documented `connect(projectId, apiKey)` plus
|
|
63
|
+
`getProjectInfo()` flow, then encrypts and stores it only after that succeeds.
|
|
64
|
+
- The active hosted runtime redeems that verified credential only for the
|
|
65
|
+
matching run and device, then installs it with Framer’s official
|
|
66
|
+
`project auth` command against the authoritative 20-character project ID.
|
|
67
|
+
- The runtime opens an official Framer Agent session, reads the active branch
|
|
68
|
+
back from Framer, and confirms the authoritative project ID again.
|
|
69
|
+
- Rejected credentials are revoked. Replacing a key creates a new credential
|
|
70
|
+
version, so a cached runtime session cannot reuse the replacement.
|
|
71
|
+
- Hosted worker images bundle the Framer skills and seed them into each
|
|
72
|
+
runtime's private writable home before processing runs.
|
|
73
|
+
|
|
74
|
+
The user never runs `@framer/agent setup`, `project auth`, or `session new`.
|
|
75
|
+
The raw project credential is scoped to the matching active run and paired
|
|
76
|
+
device, is excluded from run payloads and logs, and is never sent to the Framer
|
|
77
|
+
plugin after the one-time authenticated submission.
|
|
78
|
+
|
|
79
|
+
The bridge reports provider token usage on terminal events, including
|
|
80
|
+
interrupted and cancelled runs. Claude-reported
|
|
81
|
+
dollar cost is stored when available; Codex token-only runs are priced by the
|
|
82
|
+
API’s model cost catalog so they no longer appear as zero-cost runs.
|
|
83
|
+
|
|
84
|
+
On macOS, the bridge holds an idle-sleep assertion only while a claimed run is
|
|
85
|
+
active, then releases it immediately afterward. Closing a laptop lid can still
|
|
86
|
+
suspend local processes; uninterrupted lid-closed execution requires running
|
|
87
|
+
the bridge on an always-on machine or a hosted harness runner.
|
|
88
|
+
|
|
89
|
+
For App Builder runs, planning remains server-owned. Once the workflow
|
|
90
|
+
contract, data model, dependencies, and design direction are ready, the bridge
|
|
91
|
+
receives one bounded product outcome plus a disposable source snapshot. The
|
|
92
|
+
selected harness implements the complete functional outcome in that isolated
|
|
93
|
+
workspace. The API then validates and applies the changed files and runs its
|
|
94
|
+
own type, authorization, API-contract, browser-workflow, responsive, and visual
|
|
95
|
+
checks. A failed verification is returned as one grouped repair brief, with at
|
|
96
|
+
most three complete attempts before the saved workspace is paused for review.
|
|
97
|
+
|
|
98
|
+
Every supported coding harness receives the same seven tools:
|
|
99
|
+
|
|
100
|
+
- `workspace_inspect` and `workspace_sync` for the disposable source tree.
|
|
101
|
+
- `shell_run` for package installation, code generation, tests, builds, and
|
|
102
|
+
other project commands in the isolated build worker.
|
|
103
|
+
- `preview_control` and `browser_control` for the live application.
|
|
104
|
+
- `data_inspect` for owner-scoped, redacted development data.
|
|
105
|
+
- `verification_run` for deterministic and browser workflow checks.
|
|
106
|
+
|
|
107
|
+
Codex receives these as native dynamic tools. Claude Code and OpenCode receive
|
|
108
|
+
the same contract through a local, token-protected MCP bridge. Commands never
|
|
109
|
+
run through the bridge machine's shell. The API delegates them to a
|
|
110
|
+
project-confined build worker with an offline default; only script-disabled npm
|
|
111
|
+
dependency commands receive registry access. The API remains the authority for
|
|
112
|
+
project ownership, protected platform files, data access, command execution,
|
|
113
|
+
and final verification.
|
|
114
|
+
|
|
115
|
+
When a dependency requires a lifecycle build, the harness can run `npm rebuild`
|
|
116
|
+
as a separate offline command after installation. This allows package code to
|
|
117
|
+
prepare itself without combining arbitrary script execution with internet
|
|
118
|
+
access.
|
|
33
119
|
|
|
34
120
|
## Claude Code on macOS
|
|
35
121
|
|
|
@@ -107,11 +193,16 @@ DEXTER_BRIDGE_AGENT=claude-code npx @gakim-digital/dexter-bridge start
|
|
|
107
193
|
DEXTER_BRIDGE_AGENT=codex npx @gakim-digital/dexter-bridge start
|
|
108
194
|
```
|
|
109
195
|
|
|
110
|
-
Codex App Server runs as a model-only engine in a dedicated
|
|
111
|
-
workspace.
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
196
|
+
Codex App Server runs planning turns as a model-only engine in a dedicated
|
|
197
|
+
empty temporary workspace. For an App Builder outcome, it receives a disposable
|
|
198
|
+
snapshot and workspace-write access only inside that snapshot; network, app,
|
|
199
|
+
hook, memory, multi-agent, MCP, plugin, image, and web access remain disabled.
|
|
200
|
+
The bridge reads the effective Codex provider configuration and forwards only
|
|
201
|
+
environment variables explicitly referenced by that provider, such as an
|
|
202
|
+
`env_key`; unrelated process secrets remain excluded. The configured provider
|
|
203
|
+
is preferred, with a cached OpenAI/ChatGPT account used as a fallback when its
|
|
204
|
+
required provider credentials are unavailable. Planning sessions may be reused;
|
|
205
|
+
each coding outcome uses a fresh isolated workspace.
|
|
115
206
|
The bridge retains at most 32 recent Codex threads by default; override this
|
|
116
207
|
with `DEXTER_BRIDGE_CODEX_MAX_THREADS`.
|
|
117
208
|
|
|
@@ -124,11 +215,13 @@ for visibility.
|
|
|
124
215
|
Production API endpoints must use HTTPS. Plain HTTP is accepted only for exact
|
|
125
216
|
localhost loopback addresses during local development.
|
|
126
217
|
|
|
127
|
-
Claude Code
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
218
|
+
Claude Code planning turns run as a model-only engine. App Builder outcome runs
|
|
219
|
+
enable local read/write/edit/search tools inside the disposable snapshot plus
|
|
220
|
+
the strict InstaWebAI MCP tool set. Shell checks, previews, browser actions,
|
|
221
|
+
redacted data inspection, and verification execute through the server-owned
|
|
222
|
+
workspace boundary; local shell, network, and external-directory access
|
|
223
|
+
stay disabled. The bridge supplies a strict JSON schema and a product-specific
|
|
224
|
+
system prompt.
|
|
132
225
|
|
|
133
226
|
Claude Code runs use streaming JSON and Codex runs use JSONL so the bridge can
|
|
134
227
|
report input, output, cache, and reasoning tokens even when a turn is
|
|
@@ -164,9 +257,10 @@ desktop window to open that folder.
|
|
|
164
257
|
Useful events in a stuck run:
|
|
165
258
|
|
|
166
259
|
- `model_turn` / `agent_process_spawn` — Claude Code or Codex was invoked.
|
|
260
|
+
- `outcome` — a harness is implementing the complete bounded product outcome.
|
|
167
261
|
- `agent_process_timeout` — the local agent did not return before the timeout.
|
|
168
262
|
- `event_post_done` — the bridge returned a model completion to the shared server loop.
|
|
169
|
-
- `run_done` — the local model turn completed.
|
|
263
|
+
- `run_done` — the local model turn or outcome completed.
|
|
170
264
|
|
|
171
265
|
## Desktop release
|
|
172
266
|
|
|
@@ -210,10 +304,10 @@ Recommended release env:
|
|
|
210
304
|
|
|
211
305
|
```bash
|
|
212
306
|
FRAMER_COMPANION_DOWNLOAD_URL=https://instawebai.com/dexter-bridge
|
|
213
|
-
NEXT_PUBLIC_DEXTER_BRIDGE_VERSION=0.
|
|
307
|
+
NEXT_PUBLIC_DEXTER_BRIDGE_VERSION=0.11.1
|
|
214
308
|
NEXT_PUBLIC_DEXTER_BRIDGE_DOWNLOAD_BASE_URL=https://instawebai.com/downloads/dexter-bridge
|
|
215
|
-
NEXT_PUBLIC_DEXTER_BRIDGE_MAC_ARM64_URL=https://instawebai.com/downloads/dexter-bridge/Dexter-Bridge-0.
|
|
216
|
-
NEXT_PUBLIC_DEXTER_BRIDGE_MAC_X64_URL=https://instawebai.com/downloads/dexter-bridge/Dexter-Bridge-0.
|
|
217
|
-
NEXT_PUBLIC_DEXTER_BRIDGE_MAC_ZIP_URL=https://instawebai.com/downloads/dexter-bridge/Dexter-Bridge-0.
|
|
218
|
-
NEXT_PUBLIC_DEXTER_BRIDGE_WIN_X64_URL=https://instawebai.com/downloads/dexter-bridge/Dexter-Bridge-0.
|
|
309
|
+
NEXT_PUBLIC_DEXTER_BRIDGE_MAC_ARM64_URL=https://instawebai.com/downloads/dexter-bridge/Dexter-Bridge-0.11.1-mac-arm64.dmg
|
|
310
|
+
NEXT_PUBLIC_DEXTER_BRIDGE_MAC_X64_URL=https://instawebai.com/downloads/dexter-bridge/Dexter-Bridge-0.11.1-mac-x64.dmg
|
|
311
|
+
NEXT_PUBLIC_DEXTER_BRIDGE_MAC_ZIP_URL=https://instawebai.com/downloads/dexter-bridge/Dexter-Bridge-0.11.1-mac-universal.zip
|
|
312
|
+
NEXT_PUBLIC_DEXTER_BRIDGE_WIN_X64_URL=https://instawebai.com/downloads/dexter-bridge/Dexter-Bridge-0.11.1-win-x64.exe
|
|
219
313
|
```
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gakim-digital/dexter-bridge",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Local bridge for InstaWebAI and Dexter — runs Codex
|
|
3
|
+
"version": "0.11.1",
|
|
4
|
+
"description": "Local bridge for InstaWebAI and Dexter — runs Codex, Claude Code, or OpenCode on your machine.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"dexter-bridge": "bin/dexter-bridge.js"
|
|
@@ -16,14 +16,15 @@
|
|
|
16
16
|
"test": "node --test"
|
|
17
17
|
},
|
|
18
18
|
"engines": {
|
|
19
|
-
"node": ">=
|
|
19
|
+
"node": ">=22"
|
|
20
20
|
},
|
|
21
21
|
"keywords": [
|
|
22
22
|
"dexter",
|
|
23
23
|
"framer",
|
|
24
24
|
"instawebai",
|
|
25
25
|
"codex",
|
|
26
|
-
"claude-code"
|
|
26
|
+
"claude-code",
|
|
27
|
+
"opencode"
|
|
27
28
|
],
|
|
28
29
|
"homepage": "https://instawebai.com/dexter-bridge",
|
|
29
30
|
"publishConfig": {
|
|
@@ -31,6 +32,19 @@
|
|
|
31
32
|
},
|
|
32
33
|
"license": "SEE LICENSE IN LICENSE",
|
|
33
34
|
"dependencies": {
|
|
34
|
-
"
|
|
35
|
+
"@framer/agent": "0.0.44",
|
|
36
|
+
"@ai-sdk/anthropic": "^4.0.46",
|
|
37
|
+
"@ai-sdk/deepseek": "^3.0.37",
|
|
38
|
+
"@ai-sdk/google": "^4.0.58",
|
|
39
|
+
"@ai-sdk/openai": "^4.0.52",
|
|
40
|
+
"@ai-sdk/openai-compatible": "^3.0.41",
|
|
41
|
+
"@ai-sdk/xai": "^4.0.50",
|
|
42
|
+
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
43
|
+
"@opencode-ai/sdk": "^1.18.25",
|
|
44
|
+
"@openrouter/ai-sdk-provider": "^3.0.0",
|
|
45
|
+
"ai": "^7.0.85",
|
|
46
|
+
"cross-spawn": "^7.0.6",
|
|
47
|
+
"jsonrepair": "^3.15.0",
|
|
48
|
+
"zod": "^4.5.4"
|
|
35
49
|
}
|
|
36
50
|
}
|