genaicode 2.35.0 → 2.36.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/docs/CHANGELOG.md CHANGED
@@ -8,24 +8,37 @@ fails. Merging to master refreshes the `release` PR; merging that publishes to n
8
8
 
9
9
  ## Unreleased
10
10
 
11
+ ## 2.36.0 — 2026-11-19
12
+
13
+ ### Added
14
+
15
+ - An installer for the `genaicode` command (`curl -fsSL https://raw.githubusercontent.com/gtanczyk/genaicode/master/scripts/install.sh | sh`) that keeps itself up to date: once a day a background check installs a new version beside the running one; `genaicode update [--check] [--version <v>] [--auto on|off]` updates by hand and prints the release notes (#202)
16
+ - Ask an agent what is open across all of them: `genaicode chat --sessions` (and `ui --sessions`) gives the chat's agent the session index as MCP tools (`sessions_projects`, `sessions_list`, `sessions_read`), and `genaicode sessions mcp` serves them to any agent on stdio. In code: `sessionTools()` and `serveMcpStdio()` in `genaicode/agents` (#201)
17
+
18
+ ## 2.35.1 — 2026-11-19
19
+
20
+ ### Fixed
21
+
22
+ - Copilot CLI sessions that were opened and left with nothing said (no event log, unknown to the CLI's index) are no longer listed, so `sessions doctor` no longer reports Copilot's store as broken because of them; the Cursor reader is stamped as checked with Cursor agent 2026.10.22 (#199)
23
+
11
24
  ## 2.35.0 — 2026-11-18
12
25
 
13
26
  ### Added
14
27
 
15
- - Codex sessions can be asked of Codex itself: `codexSessions({ via: 'app-server' | 'auto' })` or `GENAICODE_CODEX_SESSIONS=app-server` lists and reads through `codex app-server` (`thread/list`, `thread/turns/list`), falling back to the files; `genaicode sessions doctor --api` compares what the files gave with what Codex lists. `openCodexServer()`, `codexThreads()`, `readCodexThread()` exported. The files stay the default. (#194)
16
- - `genaicode sessions doctor` and `checkSessions()`: per session store, how many sessions it lists, how many have a prompt and a directory, whether the newest conversations open, and whether the agent's CLI is newer than the one the reader was checked with (`SessionSource.verified`). Counts only; exits 1 when a store reads differently than expected. (#193)
17
- - `pack({ lead, members })` in `genaicode/agents`: one agent over the installed ones. The lead delegates to the others in parallel git worktrees through MCP tools and merges their work; new `subtask-start`, `subtask` and `subtask-update` events (#184)
18
- - `listSessions()` and `genaicode sessions`: one list of the sessions coding agents keep on this machine, grouped by project, with state (active, waiting for you, unfinished), latest prompt and the id to resume. Every driver names its store in `agent.sessions` (Claude Code, Codex, Copilot, Cursor, Gemini CLI, Antigravity, Muse, Vibe; `null` for opencode); `SessionSource` is the seam for vendor clouds (#186)
19
- - `listSessions()` reads vendor clouds too: `anthropicManaged` lists its agent's sessions and `cursorCloud` the account's Cloud Agents (`where: 'cloud'`, with a link to open them); `geminiManaged`, `openaiManaged` and `hostedAgent` say `sessions: null`, as their APIs list nothing (#187)
20
- - `genaicode ui` and `chat --web`: a Sessions view in the browser lists every agent's sessions by project, with search, filters by agent, state and period, and the command that continues each one (#188)
21
- - Continue a session in another agent: `--from <session id>` in `genaicode chat`, `ui` and `run`, `/continue <id>` in the chat and **Continue here** in the browser's Sessions view bring a Claude Code or Codex session into the chat; its own agent resumes it, any other gets a recap and the transcript. In code: `SessionSource.read()`, `readSession()`, `findSession()` and `AgentSession.adopt()` (#189)
22
- - Sessions of Gemini CLI and Copilot CLI can be taken over too (`--from`, `/continue`, **Continue here**): their sources have `read()`, with `geminiTranscript()` and `copilotTranscript()` (#190)
23
- - Sessions of Muse, Antigravity and Vibe can be taken over too (`museTranscript()`, `antigravityTranscript()`, `vibeTranscript()`); Copilot CLI sessions without an event log are read from its `session-store.db`, and its tool results are kept; `SessionSource.find()` lets `--from` look a Claude Code session up by id without reading every transcript (#191)
24
- - `genaicode hooks install`: Claude Code and Codex report through their own hooks what a session does, so `listSessions()`, `genaicode sessions` and the Sessions view show which sessions ask for approval (`waitingFor`, `waitingTool`) and which finished their turn; `installHooks()`, `recordHook()`, `readLive()`, `withLive()` in `genaicode/agents` (#192)
28
+ - `pack({ lead, members })` in `genaicode/agents`: one agent over the installed ones. The lead delegates to the others in parallel git worktrees through MCP tools and merges their work; new `subtask-start`, `subtask` and `subtask-update` events (#184).
29
+ - `listSessions()` and `genaicode sessions`: one list of the sessions coding agents keep on this machine, grouped by project, with state (active, waiting for you, unfinished), latest prompt and the id to resume. Every driver names its store in `agent.sessions` (Claude Code, Codex, Copilot, Cursor, Gemini CLI, Antigravity, Muse, Vibe; `null` for opencode); SQLite-backed stores require Node 22.5+ (`node:sqlite`), and `SessionSource` is the seam for vendor clouds (#186).
30
+ - `listSessions()` reads vendor clouds too: `anthropicManaged` lists its agent's sessions and `cursorCloud` the account's Cloud Agents (`where: 'cloud'`, with a link to open them); `geminiManaged`, `openaiManaged` and `hostedAgent` say `sessions: null`, as their APIs list nothing (#187).
31
+ - `genaicode ui` and `chat --web`: a Sessions view in the browser lists every agent's sessions by project, with search, filters by agent, state and period, and the command that continues each one (#188).
32
+ - Continue a session in another agent: `--from <session id>` in `genaicode chat`, `ui` and `run`, `/continue <id>` in the chat and **Continue here** in the browser's Sessions view bring a Claude Code or Codex session into the chat; its own agent resumes it, any other gets a recap and the transcript. In code: `SessionSource.read()`, `readSession()`, `findSession()` and `AgentSession.adopt()` (#189).
33
+ - Sessions of Gemini CLI and Copilot CLI can be taken over too (`--from`, `/continue`, **Continue here**): their sources have `read()`, with `geminiTranscript()` and `copilotTranscript()` (#190).
34
+ - Sessions of Muse, Antigravity and Vibe can be taken over too (`museTranscript()`, `antigravityTranscript()`, `vibeTranscript()`); Copilot CLI sessions without an event log are read from its `session-store.db`, and its tool results are kept; `SessionSource.find()` lets `--from` look a Claude Code session up by id without reading every transcript (#191).
35
+ - `genaicode hooks install`: Claude Code and Codex report through their own hooks what a session does, so `listSessions()`, `genaicode sessions` and the Sessions view show which sessions ask for approval (`waitingFor`, `waitingTool`) and which finished their turn; `installHooks()`, `recordHook()`, `readLive()`, `withLive()` in `genaicode/agents` (#192).
36
+ - `genaicode sessions doctor` and `checkSessions()`: per session store, how many sessions it lists, how many have a prompt and a directory, whether the newest conversations open, and whether the agent's CLI is newer than the one the reader was checked with (`SessionSource.verified`). Counts only; exits 1 when a store reads differently than expected (#193).
37
+ - Codex sessions can be asked of Codex itself: `codexSessions({ via: 'app-server' | 'auto' })` or `GENAICODE_CODEX_SESSIONS=app-server` lists and reads through `codex app-server` (`thread/list`, `thread/turns/list`), falling back to the files; `genaicode sessions doctor --api` compares what the files gave with what Codex lists. `openCodexServer()`, `codexThreads()`, `readCodexThread()` exported. The files stay the default (#194).
25
38
 
26
39
  ### Fixed
27
40
 
28
- - OpenAI: `openai()` runs on the Responses API, so function tools work on GPT-6 models (`gpt-6.2-astra`, `gpt-6.2-sol`), which reject them on chat completions; `openai({ api: 'chat' })` keeps chat completions and `openaiCompatible()` stays on them. Temperature is left out for reasoning models (o-series, GPT-5 and later), which accept only their default. `raw` is now the Responses API `Response` (#183).
41
+ - OpenAI: `openai()` runs on the Responses API, so function tools work on GPT-6 models (`gpt-6.2-astra`, `gpt-6.2-sol`), which reject them on chat completions; `openai({ api: 'chat' })` keeps chat completions (use it or `openaiCompatible()` for chat-completions-only `baseURL` proxies). Temperature is left out for reasoning models (o-series, GPT-5 and later), which accept only their default. `raw` is now the Responses API `Response` (#183).
29
42
  - Gemini: `thinking: false` and JSON responses work on Gemini 3.7+, Gemini 3.8 Flash and Gemini 4 (`gemini-4-argon`, `gemini-4-carbon`, `gemini-4-hydrogen`), which reject the `MINIMAL` thinking level: they now get `LOW` (#182).
30
43
 
31
44
  ## 2.34.0 — 2026-11-18
package/docs/agents.md CHANGED
@@ -364,6 +364,40 @@ match the readers (`.github/workflows/drift-canary.yaml`, `node scripts/drift-ca
364
364
  build): it lists each published CLI version beside `verified`, and fails when the latest Codex
365
365
  app-server protocol (`codex app-server generate-ts`) no longer has a field that genaicode reads.
366
366
 
367
+ ### Asking an agent about the sessions: `sessions mcp`
368
+
369
+ The index is also three MCP tools, so an agent can answer "what is open?" and "what waits for
370
+ me?" across all of them:
371
+
372
+ | tool | what it returns |
373
+ | ------------------- | -------------------------------------------------------------------------------------- |
374
+ | `sessions_projects` | projects worked in lately, with counts per agent and per state |
375
+ | `sessions_list` | sessions, newest first; filters `project`, `agent`, `state`, `text`, `days`, `limit` |
376
+ | `sessions_read` | what was said in one session: prompts, the agent's messages and the names of its tools |
377
+
378
+ ```bash
379
+ npx genaicode chat --sessions # the chat's agent gets the tools
380
+ claude mcp add sessions -- npx genaicode sessions mcp # or any agent, as a stdio MCP server
381
+ codex mcp add sessions -- npx genaicode sessions mcp
382
+ ```
383
+
384
+ `state` is `active`, `waiting`, `unfinished` or `approval` (a session that asks whether it may use
385
+ a tool, known once the [hooks](#which-sessions-need-you-hooks) are installed). The tools only read
386
+ the local stores. They are off unless you ask for them, because the agent that has them reads what
387
+ your other agents' sessions said, and that text goes to its model like anything else it reads;
388
+ treat what it finds there as content, not as instructions. `sessions mcp -a codex` serves one
389
+ agent's sessions only.
390
+
391
+ ```ts
392
+ import { agentSessionSources, claude, codex, sessionTools, startLocalMcpServer } from 'genaicode/agents';
393
+
394
+ const index = await startLocalMcpServer({
395
+ name: 'sessions',
396
+ tools: sessionTools(agentSessionSources([claude(), codex()])),
397
+ });
398
+ agent.run({ prompt: 'What waits for me?', cwd, mcpServers: [index.mcpServer] });
399
+ ```
400
+
367
401
  ### Continuing a session in another agent
368
402
 
369
403
  Sources whose conversations can be read have `read(session)`: the turns of a session (prompts, the
@@ -385,26 +419,28 @@ if (found) {
385
419
  `adopt(turns, { sessionId })` is for the agent's own session: the next prompt resumes it, and the
386
420
  turns are there to show. Only the end of a very long transcript is read (the last 8 MB, 100 turns).
387
421
 
388
- | Driver | Source | Reads |
389
- | -------------------- | ----------------------- | ------------------------------------------------------------------------------- |
390
- | `claude` | `claudeSessions()` | `~/.claude/projects/*/*.jsonl` (`CLAUDE_CONFIG_DIR`), without subagents |
391
- | `codex`, `codexLive` | `codexSessions()` | the thread index `~/.codex/state_<n>.sqlite` (`CODEX_HOME`), else rollout files |
392
- | `copilot` | `copilotSessions()` | `~/.copilot/session-state/<id>/workspace.yaml` and `events.jsonl` |
393
- | `cursor` | `cursorSessions()` | `~/.cursor/chats/<hash>/<id>/meta.json`, the model from the chat's `store.db` |
394
- | `gemini` | `geminiSessions()` | `~/.gemini/tmp/<project>/chats/session-*.jsonl` |
395
- | `antigravity` | `antigravitySessions()` | `conversation_summaries.db` in `~/.gemini/antigravity` and `antigravity-cli` |
396
- | `muse`, `museLive` | `museSessions()` | `~/.local/share/muse/session-index.db` |
397
- | `vibe` | `vibeSessions()` | `~/.vibe/logs/session/*/meta.json` (`VIBE_HOME`), with token and cost totals |
398
- | `opencode` | `null` | not read yet |
399
- | `anthropicManaged` | cloud | `GET /v1/sessions` of the driver's agent: title, status, model, usage, cost |
400
- | `cursorCloud` | cloud | `GET /v1/agents`: the account's agents that are not archived, with their links |
401
- | `geminiManaged` | `null` | the Interactions API lists nothing |
402
- | `openaiManaged` | `null` | the Responses API lists nothing |
422
+ | Driver | Source | Reads |
423
+ | -------------------- | ----------------------- | -------------------------------------------------------------------------------------- |
424
+ | `claude` | `claudeSessions()` | `~/.claude/projects/*/*.jsonl` (`CLAUDE_CONFIG_DIR`), without subagents |
425
+ | `codex`, `codexLive` | `codexSessions()` | the thread index `~/.codex/state_<n>.sqlite` (`CODEX_HOME`), else rollout files |
426
+ | `copilot` | `copilotSessions()` | `~/.copilot/session-state/<id>/workspace.yaml`, `events.jsonl` (or `session-store.db`) |
427
+ | `cursor` | `cursorSessions()` | `~/.cursor/chats/<hash>/<id>/meta.json`, the model from the chat's `store.db` |
428
+ | `gemini` | `geminiSessions()` | `~/.gemini/tmp/<project>/chats/session-*.jsonl` |
429
+ | `antigravity` | `antigravitySessions()` | `conversation_summaries.db` in `~/.gemini/antigravity` and `antigravity-cli` |
430
+ | `muse`, `museLive` | `museSessions()` | `~/.local/share/muse/session-index.db` |
431
+ | `vibe` | `vibeSessions()` | `~/.vibe/logs/session/*/meta.json` (`VIBE_HOME`), with token and cost totals |
432
+ | `opencode` | `null` | not read yet |
433
+ | `anthropicManaged` | cloud | `GET /v1/sessions` of the driver's agent: title, status, model, usage, cost |
434
+ | `cursorCloud` | cloud | `GET /v1/agents`: the account's agents that are not archived, with their links |
435
+ | `geminiManaged` | `null` | the Interactions API lists nothing |
436
+ | `openaiManaged` | `null` | the Responses API lists nothing |
403
437
 
404
438
  What a store does not keep stays undefined: Cursor has no usage, Antigravity and Vibe no model,
405
- and an index without transcripts (Muse, Antigravity) gives no latest reply. Codex, Muse,
406
- Antigravity and Cursor keep SQLite files, read with `node:sqlite` (Node 22.5 or newer; on an
407
- older Node those sources land in `errors`). Subagent sessions and archived threads are left out.
439
+ and stores listed from an index without opening transcripts (Muse, Antigravity) give no latest
440
+ reply. Codex, Muse, Antigravity, Cursor and Copilot's `session-store.db` fallback read SQLite
441
+ files with `node:sqlite` (Node 22.5 or newer; on an older Node Codex, Muse and Antigravity land
442
+ in `errors`, Cursor skips the model and Copilot needs `events.jsonl`). Subagent sessions and
443
+ archived threads are left out.
408
444
 
409
445
  A hosted driver lists what its platform lists, with `where: 'cloud'` and, where there is one, a
410
446
  `url` to open the session: pass `anthropicManaged(...)` or `cursorCloud()` to
package/docs/cli.md CHANGED
@@ -1,7 +1,40 @@
1
- # Command line: run, chat, ui, embed, acp
1
+ # Command line: install, run, chat, ui, embed, acp
2
2
 
3
3
  [← README](../README.md)
4
4
 
5
+ ## Install the command
6
+
7
+ `npx genaicode` works without installing anything. To type just `genaicode`, and have it
8
+ update itself, run the installer (macOS and Linux, Node.js 20+ with npm):
9
+
10
+ ```bash
11
+ curl -fsSL https://raw.githubusercontent.com/gtanczyk/genaicode/master/scripts/install.sh | sh
12
+ ```
13
+
14
+ It is a short shell script ([scripts/install.sh](../scripts/install.sh), read it first) that
15
+ `npm install`s the published package without lifecycle scripts into
16
+ `~/.genaicode/versions/<version>`, points `~/.genaicode/current` at it and writes a
17
+ `~/.local/bin/genaicode` shim. Nothing needs sudo. If `~/.local/bin` is not on your `PATH`,
18
+ it prints the line to add to your shell profile. `GENAICODE_VERSION`, `GENAICODE_HOME` and
19
+ `GENAICODE_BIN_DIR` change the version, the install directory and the bin directory.
20
+
21
+ ```bash
22
+ genaicode update # install the latest version now and print what changed
23
+ genaicode update --check # only say whether a newer version is out
24
+ genaicode update --version 2.35.1
25
+ genaicode update --auto off # stop the daily check (--auto on brings it back)
26
+ ```
27
+
28
+ Once a day, a `genaicode` start looks for a new version in the npm registry, in a background
29
+ process, so the command never waits on the network. A new version installs beside the
30
+ running one and `current` switches over in one step, so running sessions are not disturbed
31
+ and the next start uses it; that start prints one line with the old and new versions and
32
+ the release notes link. The previous version and any still running are kept; older ones are removed.
33
+ `GENAICODE_NO_AUTO_UPDATE=1` (and `CI`) skip the check for one run. Windows, `npx`, a global
34
+ `npm install -g genaicode` and a project dependency update through npm as usual.
35
+
36
+ To uninstall, remove `~/.genaicode` and `~/.local/bin/genaicode`.
37
+
5
38
  ## From the command line
6
39
 
7
40
  The `genaicode` bin runs the same headless drivers without writing any code:
@@ -33,7 +66,9 @@ npx genaicode sessions --cloud # also Cursor Cloud Agents (CURSOR_
33
66
  ```
34
67
 
35
68
  It reads the stores the agents keep on this machine (Claude Code, Codex, Copilot, Cursor, Gemini
36
- CLI, Antigravity, Muse and Vibe) and changes nothing.
69
+ CLI, Antigravity, Muse and Vibe) and changes nothing. SQLite-backed stores (Codex, Muse,
70
+ Antigravity, Cursor's model lookup and Copilot's `session-store.db` fallback) need Node 22.5 or
71
+ newer (`node:sqlite`); the other stores work on Node 20+.
37
72
  `●` is a session an agent is working in now, `○` one that waits for you, `◌` one that stopped
38
73
  half way. After `npx genaicode hooks install`, Claude Code and Codex report what their sessions
39
74
  do, and `◆` marks one that asks for approval (see [hooks](agents.md#which-sessions-need-you-hooks)). Each line ends with the session id; `genaicode chat -a <agent> -C <dir> -r <id>`
@@ -43,6 +78,12 @@ continues it (see [sessions](agents.md#sessions-across-agents)).
43
78
  updates: counts per store, never content, exit code 1 when one looks broken (see
44
79
  [sessions doctor](agents.md#when-an-agent-changes-its-store-sessions-doctor)).
45
80
 
81
+ `npx genaicode chat --sessions` gives the chat's agent that index as tools, so you can ask it what
82
+ is open or what waits for you in every agent; `npx genaicode sessions mcp` serves the same tools
83
+ to any agent as a stdio MCP server (see
84
+ [sessions mcp](agents.md#asking-an-agent-about-the-sessions-sessions-mcp)). The agent that has
85
+ them reads what the other sessions said.
86
+
46
87
  ## Chat with an agent: terminal and browser
47
88
 
48
89
  ```bash
@@ -5,10 +5,10 @@ separate packages to shrink the default install.
5
5
 
6
6
  ## Current shape
7
7
 
8
- | Package surface | Role |
9
- | ---------------------- | ----------------------------------------- |
10
- | `genaicode` | Core client, IR, plugins, middleware |
11
- | `genaicode/providers` | Adapters + public converters |
8
+ | Package surface | Role |
9
+ | --------------------- | ------------------------------------ |
10
+ | `genaicode` | Core client, IR, plugins, middleware |
11
+ | `genaicode/providers` | Adapters + public converters |
12
12
 
13
13
  Hard dependencies today (approximate installed sizes in this repo's lockfile):
14
14
 
package/docs/retry.md CHANGED
@@ -22,11 +22,11 @@ await withRetry(() => ai('summarize this').text(), {
22
22
 
23
23
  `classifyError` returns `{ class, retryable, reason, status?, code?, cause }`:
24
24
 
25
- | Class | Typical causes | Retry? |
26
- | ----------- | -------------------------------------- | ------ |
27
- | `transient` | 429, 5xx, timeouts, connection resets | yes |
28
- | `permanent` | 4xx (except above), auth, abort | no |
29
- | `unknown` | Unrecognized shapes | no* |
25
+ | Class | Typical causes | Retry? |
26
+ | ----------- | ------------------------------------- | ------ |
27
+ | `transient` | 429, 5xx, timeouts, connection resets | yes |
28
+ | `permanent` | 4xx (except above), auth, abort | no |
29
+ | `unknown` | Unrecognized shapes | no\* |
30
30
 
31
31
  \*Treat unknown as non-retryable by default; override with `shouldRetry` when you
32
32
  know more about your gateway.
@@ -35,7 +35,7 @@ know more about your gateway.
35
35
 
36
36
  Safe to retry without extra coordination:
37
37
 
38
- - Pure generation (`text`, `json`, `toolCalls` that only *propose* tool calls)
38
+ - Pure generation (`text`, `json`, `toolCalls` that only _propose_ tool calls)
39
39
  - Read-only prompts against immutable inputs
40
40
 
41
41
  Not safe to retry blindly:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "genaicode",
3
- "version": "2.35.0",
3
+ "version": "2.36.0",
4
4
  "description": "Drive the coding-agent CLIs you already have (Claude Code, Codex, Copilot, Cursor, Gemini, opencode...) behind one API and one CLI, plus a thin provider-neutral LLM layer.",
5
5
  "author": "Grzegorz Tańczyk",
6
6
  "repository": {