@gakim-digital/dexter-bridge 0.5.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/LICENSE ADDED
@@ -0,0 +1,16 @@
1
+ Dexter Bridge License
2
+
3
+ Copyright (c) 2026 InstaWeb AI. All rights reserved.
4
+
5
+ Permission is granted to download, install, and run this software solely to
6
+ connect your local machine to the Dexter / InstaWeb AI service. You may not
7
+ modify, redistribute, sublicense, or sell this software or use it to build a
8
+ competing service.
9
+
10
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
11
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
12
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
13
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
14
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
15
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
16
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,154 @@
1
+ # Dexter Bridge
2
+
3
+ Local Companion CLI for Dexter's Framer plugin.
4
+
5
+ ## Claude Code on macOS
6
+
7
+ Dexter's Claude setup wizard uses Homebrew so the bridge starts automatically
8
+ at login and the user can close Terminal after setup. The wizard fills in the
9
+ pairing code, API URL, agent, and model:
10
+
11
+ ```bash
12
+ brew install gakim-digital/tap/dexter-bridge \
13
+ && dexter-bridge pair 123456 --api https://api.example.com/iwm-api/0.0.1 --agent claude-code --model claude-code:sonnet \
14
+ && brew services restart gakim-digital/tap/dexter-bridge
15
+ ```
16
+
17
+ Claude Code must already be installed and signed in on the same Mac. Pairing
18
+ records the resolved Claude executable path in `~/.dexter-bridge/config.json`
19
+ so the background service can find installations managed by NVM or another
20
+ shell-specific tool.
21
+
22
+ Useful service commands:
23
+
24
+ ```bash
25
+ brew services info gakim-digital/tap/dexter-bridge
26
+ brew services restart gakim-digital/tap/dexter-bridge
27
+ brew services stop gakim-digital/tap/dexter-bridge
28
+ dexter-bridge status
29
+ dexter-bridge doctor
30
+ ```
31
+
32
+ Users without Homebrew can select the temporary command in the wizard. That
33
+ uses `npx` and must remain open while Dexter is using Claude Code.
34
+
35
+ ## Temporary CLI connection
36
+
37
+ One command pairs and goes online — the Dexter plugin's Connect wizard prints it
38
+ with your pairing code and API URL filled in:
39
+
40
+ ```bash
41
+ npx --yes @gakim-digital/dexter-bridge@latest connect 123456 --api https://api.example.com/iwm-api/0.0.1 --agent codex
42
+ ```
43
+
44
+ Run `connect` with no code to reuse a saved pairing. Lower-level commands remain
45
+ for support and automation:
46
+
47
+ ```bash
48
+ npx @gakim-digital/dexter-bridge pair 123456 --api http://localhost:3800/iwm-api/0.0.1
49
+ npx @gakim-digital/dexter-bridge start --agent claude-code
50
+ npx @gakim-digital/dexter-bridge start --agent codex
51
+ npx @gakim-digital/dexter-bridge status
52
+ npx @gakim-digital/dexter-bridge doctor
53
+ npx @gakim-digital/dexter-bridge logout
54
+ ```
55
+
56
+ `dry-run` verifies pairing, run polling, and event delivery without editing the
57
+ canvas. `claude-code` executes through its local CLI. Codex uses one persistent
58
+ `codex app-server` process for authentication, threads, usage, and cancellation:
59
+
60
+ ```bash
61
+ DEXTER_BRIDGE_AGENT=claude-code npx @gakim-digital/dexter-bridge start
62
+ DEXTER_BRIDGE_AGENT=codex npx @gakim-digital/dexter-bridge start
63
+ ```
64
+
65
+ Codex App Server threads run with a read-only sandbox and approvals disabled.
66
+ The CLI and desktop bridge keep one app-server process alive across model turns.
67
+ Set `DEXTER_BRIDGE_CODEX_APP_SERVER=false` to temporarily use the legacy
68
+ `codex exec --sandbox read-only --skip-git-repo-check` path.
69
+ The bridge retains at most 32 recent Codex threads by default; override this
70
+ with `DEXTER_BRIDGE_CODEX_MAX_THREADS`.
71
+
72
+ The CLI stores the device token in `~/.dexter-bridge/config.json` with mode
73
+ `0600` where supported. The macOS desktop app stores the token through Electron
74
+ `safeStorage`, backed by the user’s macOS credential encryption. Dexter platform
75
+ credits are not charged for companion runs; the backend records reported usage
76
+ for visibility.
77
+
78
+ Claude Code runs use `--output-format json` and Codex runs use `--json` so the
79
+ bridge can report input, output, cache, and reasoning tokens when the local CLI
80
+ provides them. Claude's reported `total_cost_usd` is displayed as an estimated
81
+ API-equivalent cost, not an amount Dexter charged. If an older or customized
82
+ CLI does not support structured output, set `DEXTER_BRIDGE_STRUCTURED_USAGE=false`;
83
+ the run will continue, but its token usage will be marked unavailable rather
84
+ than estimated from text.
85
+
86
+ ## Debugging
87
+
88
+ The Dexter Bridge terminal is the shell where `dexter-bridge start` is running.
89
+ For each companion run, the bridge also writes a redacted JSONL trace:
90
+
91
+ ```bash
92
+ ~/.dexter-bridge/logs/run-<runId>.jsonl
93
+ ```
94
+
95
+ Set `DEXTER_BRIDGE_LOG_DIR=/path/to/logs` to override the location. The desktop
96
+ app writes the same run traces next to its app log; use **Reveal log** in the
97
+ desktop window to open that folder.
98
+
99
+ Useful events in a stuck run:
100
+
101
+ - `model_turn` / `agent_process_spawn` — Claude Code or Codex was invoked.
102
+ - `agent_process_timeout` — the local agent did not return before the timeout.
103
+ - `event_post_done` — the bridge returned a model completion to the shared server loop.
104
+ - `run_done` — the local model turn completed.
105
+
106
+ ## Desktop release
107
+
108
+ From `framer-plugin`:
109
+
110
+ ```bash
111
+ npm run bridge:desktop:dev
112
+ npm run bridge:desktop:build:mac
113
+ npm run bridge:desktop:build:win
114
+ npm run bridge:desktop:dist
115
+ npm --prefix packages/dexter-bridge-desktop run verify:mac
116
+ npm --prefix packages/dexter-bridge-desktop run verify:win
117
+ ```
118
+
119
+ The Mac build emits `.dmg` and `.zip` artifacts from
120
+ `packages/dexter-bridge-desktop/release`.
121
+
122
+ The Windows x64 build emits an NSIS `.exe` installer and a `.zip` artifact from
123
+ the same release directory. Build it on Windows directly or through
124
+ `.github/workflows/dexter-bridge-windows.yml`; Windows packaging must not depend
125
+ on a developer’s macOS environment.
126
+
127
+ Release builds automatically sign when a Developer ID identity is available to
128
+ electron-builder. Notarization runs from `afterSign` when either App Store
129
+ Connect API credentials (`APPLE_API_KEY`, `APPLE_API_KEY_ID`,
130
+ `APPLE_API_ISSUER`) or Apple ID credentials (`APPLE_ID`,
131
+ `APPLE_APP_SPECIFIC_PASSWORD`, `APPLE_TEAM_ID`) are configured. Set
132
+ `DEXTER_REQUIRE_NOTARIZATION=true` in release CI so missing credentials fail the
133
+ build instead of producing an unnotarized artifact.
134
+
135
+ Windows signing is configured through electron-builder’s standard certificate
136
+ environment variables, such as `CSC_LINK` and `CSC_KEY_PASSWORD`. Set
137
+ `DEXTER_REQUIRE_WINDOWS_SIGNING=true` when running `verify:win` for a public
138
+ release. Unsigned installers are only suitable for internal testing.
139
+
140
+ The unsigned desktop app is not the public Claude setup path. Until a notarized
141
+ build is available, macOS Claude users should receive the Homebrew service flow
142
+ above.
143
+
144
+ Recommended release env:
145
+
146
+ ```bash
147
+ FRAMER_COMPANION_DOWNLOAD_URL=https://instawebai.com/dexter-bridge
148
+ NEXT_PUBLIC_DEXTER_BRIDGE_VERSION=0.2.0
149
+ NEXT_PUBLIC_DEXTER_BRIDGE_DOWNLOAD_BASE_URL=https://instawebai.com/downloads/dexter-bridge
150
+ NEXT_PUBLIC_DEXTER_BRIDGE_MAC_ARM64_URL=https://instawebai.com/downloads/dexter-bridge/Dexter-Bridge-0.2.0-mac-arm64.dmg
151
+ NEXT_PUBLIC_DEXTER_BRIDGE_MAC_X64_URL=https://instawebai.com/downloads/dexter-bridge/Dexter-Bridge-0.2.0-mac-x64.dmg
152
+ NEXT_PUBLIC_DEXTER_BRIDGE_MAC_ZIP_URL=https://instawebai.com/downloads/dexter-bridge/Dexter-Bridge-0.2.0-mac-universal.zip
153
+ NEXT_PUBLIC_DEXTER_BRIDGE_WIN_X64_URL=https://instawebai.com/downloads/dexter-bridge/Dexter-Bridge-0.2.0-win-x64.exe
154
+ ```
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env node
2
+ import { runCli } from '../src/cli.js';
3
+
4
+ runCli(process.argv.slice(2)).catch((error) => {
5
+ const message = error && typeof error === 'object' && 'message' in error
6
+ ? error.message
7
+ : String(error);
8
+ console.error(`Dexter Bridge failed: ${message}`);
9
+ process.exitCode = typeof error?.exitCode === 'number' ? error.exitCode : 1;
10
+ });
package/package.json ADDED
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "@gakim-digital/dexter-bridge",
3
+ "version": "0.5.0",
4
+ "description": "Local Companion bridge for the Dexter Framer plugin — runs Codex or Claude Code on your machine.",
5
+ "type": "module",
6
+ "bin": {
7
+ "dexter-bridge": "./bin/dexter-bridge.js"
8
+ },
9
+ "files": [
10
+ "bin",
11
+ "src",
12
+ "README.md",
13
+ "LICENSE"
14
+ ],
15
+ "scripts": {
16
+ "test": "node --test"
17
+ },
18
+ "engines": {
19
+ "node": ">=18.17"
20
+ },
21
+ "keywords": [
22
+ "dexter",
23
+ "framer",
24
+ "instawebai",
25
+ "codex",
26
+ "claude-code"
27
+ ],
28
+ "homepage": "https://instawebai.com/dexter-bridge",
29
+ "publishConfig": {
30
+ "access": "public"
31
+ },
32
+ "license": "SEE LICENSE IN LICENSE"
33
+ }