@gleapai/kai-bridge 0.6.0 → 0.9.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/README.md CHANGED
@@ -1,8 +1,7 @@
1
- # kai-bridge
1
+ # Kai Code Bridge
2
2
 
3
- Run [Gleap Kai Code](https://gleap.io) sessions on your own machine — with your own
4
- Claude Code / Codex login — and preview your real dev servers from the dashboard or the
5
- Gleap app on your phone.
3
+ Run [Gleap Kai Code](https://gleap.io) on your computer or server with your own
4
+ Claude Code / Codex login, local dev-server previews, and photo or video verification.
6
5
 
7
6
  ```bash
8
7
  npm i -g @gleapai/kai-bridge # one install, so the background service has a stable path
@@ -43,3 +42,28 @@ kai-bridge run --task "Explain the auth flow in this repo" --cwd ~/code/my-app
43
42
 
44
43
  `npm run sync-runner` copies the ACP runner from a sibling `gleap_code_analyzer` checkout;
45
44
  `npm test` runs the unit suite (uses real `git`).
45
+
46
+
47
+ ### Computers and your own servers
48
+
49
+ Kai Code offers **Kai Code Cloud** (Gleap's managed execution, using AI credits) or **Kai Code Bridge** (your coding agents on your computer or a server you manage, using your own AI subscriptions).
50
+
51
+ Run `npm i -g @gleapai/kai-bridge && kai-bridge` in a local terminal or over SSH. The guided setup pairs the device, installs its background service and helps sign in to coding agents. Node.js 20+ and Git are required. On a Linux server, keep the user service running after logout using your system's service configuration; `kai-bridge doctor` reports service status.
52
+
53
+ Codex and Claude Code ship with Kai Code Bridge. Missing agents can be installed or repaired, and existing agents can be updated independently:
54
+
55
+ ```sh
56
+ kai-bridge harness install codex
57
+ kai-bridge harness update codex
58
+ kai-bridge harness login codex --device-auth
59
+
60
+ kai-bridge harness install claude
61
+ kai-bridge harness update claude
62
+ kai-bridge harness login claude
63
+ ```
64
+
65
+ Updates install into `~/.kai/harnesses`, verify the new executable, then select it for subsequent sessions. A failed download or startup leaves the previous version selected. Existing versions are retained for running sessions; your global CLI installations and agent logins are not overwritten. `--version <version>` selects a specific package version (for Claude, the Claude Agent SDK package version).
66
+
67
+ Codex automatically uses device-code sign-in over SSH or on headless Linux. Enable device-code sign-in in the account settings if Codex asks. Claude uses its native `auth login` flow: follow the URL and prompts in the SSH terminal. Dashboard **Sign in** opens a terminal on desktop devices; for headless servers it shows the exact command to run over SSH. The login is picked up automatically.
68
+
69
+ **Previews are local to the Kai Code Bridge device.** Open them on that computer, on the same network when supported, or use your own SSH port forwarding. Kai Code Bridge does not expose previews through a public tunnel. Screenshot and video verification runs on the Kai Code Bridge device and uploads its evidence to the Kai Code session, so those checks still work on a remote server.
@@ -7,7 +7,7 @@
7
7
  // kai-bridge install | uninstall run at login (launchd / systemd / Task Scheduler)
8
8
  // kai-bridge start run in the foreground (what the service runs)
9
9
  // kai-bridge status device, service, profiles, repos
10
- // kai-bridge harness list|install <id>|login <id> Claude Code + Codex are bundled; Cursor is downloaded
10
+ // kai-bridge harness list|install <id>|update <id>|login <id> [--device-auth] Claude Code + Codex are bundled; Cursor is downloaded
11
11
  // kai-bridge profile list|add <id> --harness claude|codex|cursor [--label …]|login <id>|remove <id>
12
12
  // kai-bridge repo scan|roots [add <dir>|remove <dir>]|primary <repoKey> <path>
13
13
  // kai-bridge run --task "…" [--model …] [--profile …] [--cwd …] (local turn, no server)
@@ -89,7 +89,8 @@ async function profile() {
89
89
  if (sub === "login") {
90
90
  const p = resolveProfiles(config).find((x) => x.id === positional[1]);
91
91
  if (!p) fail("unknown profile");
92
- const c = loginCommand(p.harness, p.configDir);
92
+ await installHarness(p.harness, { kaiHome: KAI_HOME, onLog: out });
93
+ const c = loginCommand(p.harness, p.configDir, KAI_HOME, flags["device-auth"] ? { deviceAuth: true } : undefined);
93
94
  if (!c) fail(`${p.harness} is not installed`);
94
95
  const child = spawn(c.cmd, c.args, { env: c.env, stdio: "inherit" });
95
96
  child.on("close", (code) => process.exit(code ?? 0));
@@ -111,9 +112,9 @@ async function harness() {
111
112
  return;
112
113
  }
113
114
  const id = positional[1];
114
- if (!HARNESS_INFO[id]) fail("usage: harness list|install <claude|codex|cursor>|login <id>");
115
+ if (!HARNESS_INFO[id]) fail("usage: harness list|install <id>|update <id>|login <id> (claude|codex|cursor)");
115
116
  if (sub === "install" || sub === "update") {
116
- const res = await installHarness(id, { kaiHome: KAI_HOME, onLog: out });
117
+ const res = await installHarness(id, { kaiHome: KAI_HOME, onLog: out, update: sub === "update", version: typeof flags.version === "string" ? flags.version : undefined });
117
118
  if (!res.ok) fail(`${id} is not usable`);
118
119
  out(`${HARNESS_INFO[id].label} ${res.version} → ${res.binary}`);
119
120
  return;
@@ -123,7 +124,7 @@ async function harness() {
123
124
  positional[0] = "login";
124
125
  return profile();
125
126
  }
126
- fail("usage: harness list|install <id>|login <id>");
127
+ fail("usage: harness list|install <id>|update <id>|login <id> [--device-auth]");
127
128
  }
128
129
 
129
130
  async function repo() {
@@ -280,7 +281,7 @@ try {
280
281
 
281
282
  setup guided onboarding (pair · service · sign-ins)
282
283
  login | logout | install | uninstall | start | status | doctor | update
283
- harness list|install <id>|login <id>
284
+ harness list|install <id>|update <id>|login <id> [--device-auth]
284
285
  profile list|add <id> --harness claude|codex|cursor|login <id>|remove <id>
285
286
  repo scan|roots [add|remove <dir>]|primary <repoKey> <path>
286
287
  run --task "…" [--model …] [--profile …] [--cwd …]`);