captain-tool 0.0.106 → 0.0.108

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
@@ -13,6 +13,48 @@ Once installed, your AI agent can interact with your Captain workspace directly
13
13
  - VS Code + Copilot
14
14
  - Cursor
15
15
  - Windsurf
16
+ - Codex (manual setup below)
17
+
18
+ ---
19
+
20
+ ## How it runs
21
+
22
+ Every client starts `captain-tool` as a stdio MCP server: no URL, no headers, no secret in your
23
+ config. That process is a small relay. It forwards your agent's MCP traffic to Captain's local
24
+ service on `127.0.0.1` (the same service the Captain extension runs, one per user), and starts
25
+ that service if it is not running. The relay keeps no state of its own: your sign-in, your
26
+ efforts and your sessions live in the shared service, so two agents on one machine share one
27
+ sign-in.
28
+
29
+ **Update captain-tool and the Captain extension together.** The relay and the service must be
30
+ the same release: a service that predates the relay offers it no tools, and a newer service
31
+ refuses an older extension's agents. Update both at the same time.
32
+
33
+ What keeps your place:
34
+
35
+ - **Your terminal is who you are.** Each agent process gets a terminal id: the Captain extension
36
+ sets it; a hand-registered Claude Code agent uses its own session id; otherwise a fresh one is
37
+ made for each process. A task you claim belongs to that terminal.
38
+ - **Stepping away keeps your task.** If your agent's process ends (it crashes, you close the
39
+ laptop, the service restarts) the terminal reads as *away*, and its task stays claimed for it
40
+ for up to an hour. Come back with the same terminal (`claude --resume`, the extension
41
+ reopening it) and the task is still yours. Close the tab or stop the session on purpose and
42
+ the task is released at once.
43
+ - **After a long sleep.** If the hour passed, the task was released. When your agent comes back
44
+ it takes the task back if it is still first in line; otherwise it is told the task moved on,
45
+ and it claims the next one.
46
+
47
+ What does not carry over:
48
+
49
+ - **`/clear` in Claude Code** starts a new conversation in the same terminal. Captain still knows
50
+ the terminal's effort and stage; the new conversation has none of the earlier one's reasoning.
51
+ - **`claude --continue`** starts the relay with a new session id (`claude --resume <id>` keeps
52
+ it). A hand-registered agent then lands as a new terminal: call `set_active_effort` once to
53
+ pick the effort up again.
54
+ Launched from the Captain extension, the terminal id is set for you and nothing is lost.
55
+ - **Codex** runs one relay per thread and has no terminal id to keep. A thread you abandon
56
+ leaves its terminal away; its claim lapses after the hour. Resuming a thread lands as a new
57
+ terminal: call `set_active_effort` once.
16
58
 
17
59
  ---
18
60
 
@@ -146,6 +188,17 @@ Edit `~/.codeium/windsurf/mcp_config.json` (macOS/Linux) or `%USERPROFILE%\.code
146
188
 
147
189
  Restart Windsurf to activate.
148
190
 
191
+ ### Codex
192
+
193
+ Edit `~/.codex/config.toml`:
194
+
195
+ ```toml
196
+ [mcp_servers.captain]
197
+ command = "captain-tool"
198
+ ```
199
+
200
+ On Windows, use `command = "cmd"` and `args = ["/c", "captain-tool"]`.
201
+
149
202
  ---
150
203
 
151
204
  ## First use
@@ -168,14 +221,49 @@ Show me the deployment history for component comp-xyz.
168
221
 
169
222
  ## Configuration
170
223
 
224
+ The relay reads only these variables:
225
+
171
226
  | Variable | Default | Description |
172
227
  |----------|---------|-------------|
173
- | `CAPTAIN_API_BASE_URL` | `https://app.getcaptain.dev` | Captain backend URL. Leave unset to use the default; setting it pins this backend and disables switching |
174
- | `CAPTAIN_DB_PATH` | platform default | Local state and auth token |
175
- | `CAPTAIN_REQUEST_TIMEOUT_SECONDS` | `30` | HTTP timeout per request |
228
+ | `CAPTAIN_PORT` | `37849` (`37860` when `CAPTAIN_DATA_DIR` or `CAPTAIN_API_BASE_URL` is set) | Port of Captain's local service. Leave unset to share the Captain extension's |
229
+ | `CAPTAIN_TERMINAL_ID` | your client's session id, else a new one | The terminal this agent is. Set by the Captain extension; rarely set by hand |
230
+ | `CAPTAIN_DATA_DIR` | platform default | Where the relay finds a running service's secret (an isolated or dev setup) |
231
+
232
+ **The service the relay starts takes no settings from the agent's environment.** An agent's
233
+ environment is partly the project's (a repository's `.claude/settings.json` env reaches the
234
+ MCP servers it runs), and that service holds your Captain sign-in for every terminal. So when
235
+ no service is running, the relay starts one with only the operating system's basics (`PATH`,
236
+ `HOME`, `LANG`, `SSH_AUTH_SOCK` and the like): no `CAPTAIN_*` setting, no proxy, no log level.
237
+ And if the agent's environment sets any Captain setting beyond the variables above (such as
238
+ `CAPTAIN_API_BASE_URL`, `CAPTAIN_DB_PATH` or `CAPTAIN_DATA_DIR`), the relay starts no service
239
+ at all: it connects to one that is running, or exits saying how to start one.
240
+
241
+ To use another backend with an agent you register by hand, set `api_base_url` in
242
+ captain-tool's own `config.toml` (`~/.config/captain-tool/config.toml`, or
243
+ `%APPDATA%\captain-tool\config.toml` on Windows), or start the service yourself with
244
+ `captain-tool --transport http` and your settings. A service already running keeps its own
245
+ settings: the relay never restarts or replaces it.
246
+
247
+ A project can also set `CAPTAIN_PORT` or `CAPTAIN_DATA_DIR` for the relay it runs. That cannot
248
+ take your Captain secret (the relay reads the secret of the port it is given, and stops if
249
+ there is none), but it can send that agent's own Captain traffic to another local service.
176
250
 
177
251
  ---
178
252
 
179
253
  ## Learn more
180
254
 
181
255
  Visit [app.getcaptain.dev](https://app.getcaptain.dev) to learn more about Captain.
256
+
257
+ ---
258
+
259
+ ## Diagnose review findings (no account needed)
260
+
261
+ ```bash
262
+ npx -y captain-tool@latest diagnose --repo owner/name
263
+ ```
264
+
265
+ Measures how many of the review findings your team acted on were preventable upstream, using Claude Code, Codex, an
266
+ API key or (without any of those) a labelled keyword heuristic. Needs `gh` logged in. Sends finding text only to the
267
+ model source you chose; anonymous usage counts can be turned off with
268
+ `npx -y captain-tool@latest telemetry off`. See the main
269
+ README's "Diagnose your review findings" section for the privacy details and exit codes.
@@ -657,6 +657,13 @@ async function main() {
657
657
  }
658
658
 
659
659
  console.log('Setup complete. The captain server is registered and ready to use.');
660
+ // CAP-ADR-0030: the registered `captain-tool` is a relay to Captain's local service (the
661
+ // daemon the Captain extension also runs). The two must be the same release.
662
+ console.log('');
663
+ console.log('captain-tool relays your agent to Captain\'s local service and starts it if it is');
664
+ console.log('not running. If you also use the Captain extension,');
665
+ console.log('update captain-tool and the Captain extension together:');
666
+ console.log('each refuses the other across a version that changed how agents connect.');
660
667
  }
661
668
 
662
669
  // Only run the interactive wizard when invoked directly. Guarding on
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "captain-tool",
3
- "version": "0.0.106",
3
+ "version": "0.0.108",
4
4
  "description": "MCP server connecting Claude Desktop and VS Code Copilot to Captain Cloud",
5
5
  "bin": {
6
6
  "captain-tool": "bin/captain-tool",
@@ -11,10 +11,10 @@
11
11
  "test": "node test/setup.test.js"
12
12
  },
13
13
  "optionalDependencies": {
14
- "@captain-tool/captain-tool-win32-x64": "0.0.106",
15
- "@captain-tool/captain-tool-darwin-x64": "0.0.106",
16
- "@captain-tool/captain-tool-darwin-arm64": "0.0.106",
17
- "@captain-tool/captain-tool-linux-x64": "0.0.106"
14
+ "@captain-tool/captain-tool-win32-x64": "0.0.108",
15
+ "@captain-tool/captain-tool-darwin-x64": "0.0.108",
16
+ "@captain-tool/captain-tool-darwin-arm64": "0.0.108",
17
+ "@captain-tool/captain-tool-linux-x64": "0.0.108"
18
18
  },
19
19
  "files": [
20
20
  "bin/",