cookbook-bridge 0.1.10 → 0.1.12

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
@@ -2,6 +2,19 @@
2
2
 
3
3
  ## Changelog
4
4
 
5
+ **0.1.12** (2026-09-02)
6
+ - Kimi Code is the fourth agent: `connect` finds `kimi`, mints a "Kimi" token and writes `~/.kimi-code/mcp.json` (owner-only, other servers kept). Runs use `kimi -p ... --output-format stream-json`; the board gets live text and the work log, resume by session id, and a duration-only receipt (kimi reports no token counts).
7
+ - A headless kimi run approves every tool and has no `--allowedTools` flag, so the Bridge turns the config's `--allowedTools` into a per-run agent file (`--agent-file`, a 0600 temp file) whose tools allowlist is exactly that list. `doctor` fails a Kimi agent that has no `--allowedTools`.
8
+ - Billing protection also hides `KIMI_API_KEY`, `MOONSHOT_API_KEY` and `KIMI_MODEL_API_KEY`.
9
+ - `doctor` gained Kimi rows: version, login (config.toml providers or OAuth credentials), the MCP file, and the two flags a headless run needs.
10
+
11
+ **0.1.11** (2026-09-02)
12
+ - The Bridge has a home: `~/.cookbook/config.json` (file 0600, folder 0700) for every command. `bridge.state.json`, `local.json` and `bridge.log` sit next to it. Before, the config lived next to `bridge.mjs`, so every `npx cookbook-bridge@latest` landed in a fresh cache folder and lost it. A config found next to `bridge.mjs` is copied to the home once (the old file stays) and the move is announced in one line. `--config <path>` and `COOKBOOK_CONFIG` still win.
13
+ - `connect` runs the Bridge right after the approval (pass `--no-run` to stop at "connected"). With no agent CLI found it prints the doctor instead.
14
+ - Every hint is a command that works where you are: `npx cookbook-bridge@latest <cmd>` from an npm install, `node bridge/bridge.mjs <cmd>` from a tarball.
15
+ - `doctor` gained rows for the config home (path, exists, mode), other Bridge processes on this machine (pids and config paths), Bridge Local (does the port answer), and whether the local files are behind the app deploy, with the same update line the running Bridge prints. `connect` prints that line too.
16
+ - Visiting agents can read `~/.cookbook/bridge.state.json` as a projection; `~/.cookbook/local.json` is never readable, like the desktop app's copy.
17
+
5
18
  **0.1.10** (2026-09-02)
6
19
  - Works on every Node from 18 up. Before, on Node older than 22.18 every command exited silently, doing nothing.
7
20
  - The npm package and the desktop app now ship every runtime file (realtime, sessions, synthesis, the approval relay, the hook reporter). Install-time crashes on import are gone, and a test now fails the build if a file is left out.
@@ -18,7 +31,7 @@
18
31
  - Set `COOKBOOK_NO_BROWSER=1` to stop `login`/`connect` from opening a browser (the URL is still printed).
19
32
 
20
33
 
21
- Runs your **own AI agents** (Claude Code, Codex, Gemini) on **your own subscriptions**,
34
+ Runs your **own AI agents** (Claude Code, Codex, Gemini, Kimi Code) on **your own subscriptions**,
22
35
  against your Cookbook workspaces — so tasks on the board get done by your agents
23
36
  automatically, on your machine, with **no API credits**.
24
37
 
@@ -37,66 +50,84 @@ Trust model: your Cookbook's `/security` page.
37
50
  ## Quick start (2 minutes)
38
51
 
39
52
  ```bash
40
- npx cookbook-bridge@latest connect # one-time: ONE approval connects the Bridge AND every
41
- # installed agent CLI (claude, codex, agy, openclaw),
42
- # each with its own attributed token
53
+ npx cookbook-bridge@latest connect # ONE approval connects the Bridge AND every installed
54
+ # agent CLI (claude, codex, agy, kimi, openclaw), each with its
55
+ # own attributed token, then RUNS the Bridge. Leave it open.
56
+ ```
57
+
58
+ That is the whole setup. Later:
59
+
60
+ ```bash
61
+ npx cookbook-bridge@latest # run it again (config is remembered in ~/.cookbook)
43
62
  npx cookbook-bridge@latest doctor # preflight: checks every prerequisite, with exact fixes
44
- npx cookbook-bridge@latest # run it (leave it running)
45
63
  ```
46
64
 
47
65
  Always `@latest`: bare `npx cookbook-bridge` happily runs a weeks-old cached copy
48
- that predates subcommands you need (`host` shipped in 0.1.1).
66
+ that predates subcommands you need (`host` shipped in 0.1.1). Your config is not in
67
+ that cache, so `@latest` never loses it.
49
68
 
50
69
  Node 18+. No dependencies, nothing to configure by hand: `connect` writes
51
- `config.json` for you and never prints or stores a secret you have to copy.
70
+ `~/.cookbook/config.json` for you and never prints or stores a secret you have to copy.
71
+ Pass `--no-run` to stop at "connected" without starting the Bridge.
52
72
 
53
73
  <details>
54
74
  <summary>Prefer no package manager? Download the tarball instead.</summary>
55
75
 
56
76
  ```bash
57
77
  curl -fsSL https://cookbook.team/api/bridge/download | tar xz
58
- node bridge/bridge.mjs connect
78
+ node bridge/bridge.mjs connect # same flow: one approval, then it runs
59
79
  ```
60
80
 
61
- The commands below are written for this layout (`node bridge/bridge.mjs <command>`);
62
- with the npm install, every one of them is `npx cookbook-bridge <command>`.
81
+ From a tarball every command is `node bridge/bridge.mjs <command>` (run it from the
82
+ folder you unpacked, the one that contains `bridge/`); with the npm install it is
83
+ `npx cookbook-bridge@latest <command>`. The Bridge knows which layout it runs from and
84
+ prints the right one in every hint. The config lives in `~/.cookbook` either way.
63
85
 
64
86
  </details>
65
87
 
66
- ```bash
67
- # from the folder you unpacked (it contains bridge/)
68
- node bridge/bridge.mjs connect-agents # one-time: ONE approval connects the Bridge
69
- # AND every installed agent CLI (claude, agy, codex)
70
- # to Cookbook, each with its own attributed token
71
- node bridge/bridge.mjs doctor # preflight: checks EVERY prerequisite, prints
72
- # the exact fix for anything that's missing
73
- node bridge/bridge.mjs # run it (leave it running)
74
- ```
75
-
76
- No hand-pasting tokens: `connect-agents` is the intended path (device flow, like a TV
77
- app; the code expires in ~10 minutes — just re-run it if it lapses). One browser click
78
- authorizes the Bridge **and** mints a named token per detected agent CLI — the name is
79
- the attribution label ("Claude · via you") — then configures each CLI via its own
80
- `mcp add`. Prefer just the Bridge? `login` does the device flow without touching your
81
- CLIs. Fully manual: copy `config.example.json` → `config.json` and paste a token from
82
- your Cookbook **Account → Tokens** page.
88
+ No hand-pasting tokens: `connect` is the intended path (device flow, like a TV app; the
89
+ code expires in ~10 minutes, just re-run it if it lapses). One browser click authorizes
90
+ the Bridge **and** mints a named token per detected agent CLI (the name is the
91
+ attribution label, "Claude · via you"), then configures each CLI via its own `mcp add`.
92
+ `connect-agents` is the same command under its original name. Prefer just the Bridge?
93
+ `login` does the device flow without touching your CLIs. Fully manual: copy
94
+ `config.example.json` to `~/.cookbook/config.json` and paste a token from your Cookbook
95
+ **Account Tokens** page.
83
96
 
84
97
  Requires **Node 18+** (built-in `fetch`, no npm install) and at least one agent CLI
85
- installed and logged in (`claude`, `agy` — the Antigravity CLI for Gemini — or the Codex app). Each agent must also be
98
+ installed and logged in (`claude`, `agy` — the Antigravity CLI for Gemini — `kimi`, or the Codex app). Each agent must also be
86
99
  connected to Cookbook over MCP — that's how it completes tasks. Run `doctor`; it tells
87
100
  you exactly which parts are ready and how to fix the rest.
88
101
 
89
102
  ## Commands
90
103
 
104
+ Written as `npx cookbook-bridge@latest <command>`; from a tarball, `node bridge/bridge.mjs <command>`.
105
+
91
106
  | Command | What it does |
92
107
  |---|---|
93
- | `node bridge.mjs` | Run the Bridge (uses `config.json` next to it; or pass a path) |
94
- | `node bridge.mjs connect-agents` | One approval connects the Bridge + every installed agent CLI (attributed tokens) |
95
- | `node bridge.mjs login` | Device-flow auth for the Bridge only, writes your config |
96
- | `node bridge.mjs doctor` | Preflight every prerequisite with exact fixes |
97
- | `node bridge.mjs status` | Liveness + agent readiness |
98
- | `node bridge.mjs update` | Update the Bridge to match the app (see Self-updating) |
99
- | `cookbook-bridge host` | Open the door: let an agent someone else runs help you set this machine up, inside a grant you approve. `--off` closes it. |
108
+ | (none) | Run the Bridge (uses `~/.cookbook/config.json`; or pass a path) |
109
+ | `connect` | One approval connects the Bridge + every installed agent CLI (attributed tokens), then runs the Bridge. `--no-run` stops at connected. `connect-agents` is the same command. |
110
+ | `login` | Device-flow auth for the Bridge only, writes your config |
111
+ | `doctor` | Preflight every prerequisite with exact fixes: config home, token, agents, other Bridge processes, Bridge Local, and whether the files are behind the app |
112
+ | `status` | Liveness + agent readiness |
113
+ | `update` | Update the Bridge to match the app (see Self-updating) |
114
+ | `host` | Open the door: let an agent someone else runs help you set this machine up, inside a grant you approve. `--off` closes it. |
115
+ | `connectors` | Survey MCP connectors across Claude, Codex and Gemini; `sync` gives every agent the same tools; `approve <name>` installs a team stdio connector |
116
+
117
+ ## Where things live (the config home)
118
+
119
+ Every command resolves the config the same way, first match wins:
120
+
121
+ 1. `--config <path>` (or, for the run command, a positional path)
122
+ 2. `COOKBOOK_CONFIG` in the environment
123
+ 3. `~/.cookbook/config.json` (folder 0700, file 0600)
124
+ 4. A `config.json` next to `bridge.mjs`, only when 3 does not exist yet. It is copied to
125
+ the home once, the old file is left in place, and one line says where the config
126
+ now lives (pre-0.1.11 installs kept it next to the code).
127
+
128
+ `bridge.state.json` (attempt counters), `local.json` (the Bridge Local loopback port and
129
+ token) and `bridge.log` sit in the same folder as whichever config is in use. The desktop
130
+ app passes its own `--config` path and keeps its files in its data folder.
100
131
 
101
132
  ## Self-updating
102
133
 
@@ -104,8 +135,11 @@ you exactly which parts are ready and how to fix the rest.
104
135
  to the deploy's manifest (`/api/bridge/manifest`) and — with `"autoUpdate": true`, the
105
136
  default — replaces them (every file hash-verified first, originals kept in
106
137
  a per-version `bridge.backup/<deploy>/` dir, your `config.json` and token never touched) and restarts itself.
107
- Set `"autoUpdate": false` to pin your version; `node bridge.mjs update` updates manually
108
- and works even from a broken install.
138
+ Set `"autoUpdate": false` to pin your version; `node bridge/bridge.mjs update` updates
139
+ manually and works even from a broken install. An npm install is updated by npm: re-run
140
+ `npx cookbook-bridge@latest`, and your config in `~/.cookbook` comes along untouched.
141
+ `doctor` and `connect` run the same comparison and print the same update line when the
142
+ local files are behind.
109
143
 
110
144
  ## Agents (config.json)
111
145
 
@@ -115,6 +149,8 @@ and works even from a broken install.
115
149
  "command": ["claude", "-p", "{prompt}", "--allowedTools", "mcp__cookbook__*", "--output-format", "json"] },
116
150
  { "name": "Gemini", "match": ["gemini"], "enabled": true,
117
151
  "command": ["agy", "-p", "{prompt}", "--sandbox", "--print-timeout", "3600s"] },
152
+ { "name": "Kimi", "match": ["kimi"], "enabled": true,
153
+ "command": ["kimi", "-p", "{prompt}", "--allowedTools", "mcp__cookbook__*", "--output-format", "stream-json"] },
118
154
  { "name": "Codex", "match": ["codex", "chatgpt"], "enabled": false, "runner": "app-server",
119
155
  "command": ["/Applications/Codex.app/Contents/Resources/codex"] }
120
156
  ]
@@ -130,6 +166,13 @@ and works even from a broken install.
130
166
  usual cause — `doctor` checks it.
131
167
  - **Codex (ChatGPT)** runs through `codex app-server` (its headless `exec` can't call
132
168
  MCP tools); see `_setup` in `config.example.json` for the 3-step enable.
169
+ - **Kimi Code** runs `kimi -p` with `--output-format stream-json` (live text, work log,
170
+ session resume; no token counts, so the receipt is duration only). Its headless mode
171
+ approves every tool and has no `--allowedTools` flag, so the Bridge turns that value
172
+ into a per-run agent file (`--agent-file`) whose `tools:` allowlist is exactly the
173
+ list. Keep it on the command; `doctor` fails a Kimi agent without it. `connect`
174
+ writes `~/.kimi-code/mcp.json` (kimi has no `mcp add`). Kimi does not stream its
175
+ thinking, so a long think looks like silence to `livenessTimeoutSeconds`.
133
176
  - `"default"`: which agent takes tasks assigned to **any**.
134
177
 
135
178
  ## What rides into (and out of) every run
@@ -152,9 +195,11 @@ you opt an agent in, and only tasks explicitly posted as goals are ever eligible
152
195
 
153
196
  ## Safety rails (on by default)
154
197
 
155
- - **Billing protection**: vendor API keys (`ANTHROPIC_API_KEY` etc.) are hidden from
156
- agent processes, so a task can never silently bill your API account instead of your
157
- subscription. Opt out with `"allowApiKeyBilling": true`.
198
+ - **Billing protection**: vendor API keys (`ANTHROPIC_API_KEY`, `OPENAI_API_KEY`,
199
+ `GEMINI_API_KEY`, `GOOGLE_API_KEY`, `KIMI_API_KEY`, `MOONSHOT_API_KEY`,
200
+ `KIMI_MODEL_API_KEY`) are hidden from agent processes, so a task can never silently
201
+ bill your API account instead of your subscription. Opt out with
202
+ `"allowApiKeyBilling": true`.
158
203
  - **Vulnerable-version gate**: gemini-cli below 0.39.1 (the CVSS-10.0 RCE fix) is refused; agy below 1.1.1 (headless MCP) is refused.
159
204
  - **Who can use your agents**: `"acceptFrom": "anyone"` (default) or a list of member
160
205
  names (e.g. `["dp", "pierre"]`); per-agent overrides supported. Plus the per-person