genaicode 2.34.0 → 2.35.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.
Files changed (134) hide show
  1. package/dist/agents/artifacts.d.ts +1 -1
  2. package/dist/agents/artifacts.js +4 -65
  3. package/dist/agents/artifacts.js.map +1 -1
  4. package/dist/agents/cli-agent.d.ts +3 -0
  5. package/dist/agents/cli-agent.js +1 -0
  6. package/dist/agents/cli-agent.js.map +1 -1
  7. package/dist/agents/drivers/anthropic-managed.d.ts +4 -0
  8. package/dist/agents/drivers/anthropic-managed.js +46 -0
  9. package/dist/agents/drivers/anthropic-managed.js.map +1 -1
  10. package/dist/agents/drivers/antigravity.js +2 -0
  11. package/dist/agents/drivers/antigravity.js.map +1 -1
  12. package/dist/agents/drivers/claude.js +2 -0
  13. package/dist/agents/drivers/claude.js.map +1 -1
  14. package/dist/agents/drivers/codex-live.js +2 -0
  15. package/dist/agents/drivers/codex-live.js.map +1 -1
  16. package/dist/agents/drivers/codex.js +2 -0
  17. package/dist/agents/drivers/codex.js.map +1 -1
  18. package/dist/agents/drivers/copilot.js +2 -0
  19. package/dist/agents/drivers/copilot.js.map +1 -1
  20. package/dist/agents/drivers/cursor-cloud.js +45 -0
  21. package/dist/agents/drivers/cursor-cloud.js.map +1 -1
  22. package/dist/agents/drivers/cursor.js +2 -0
  23. package/dist/agents/drivers/cursor.js.map +1 -1
  24. package/dist/agents/drivers/gemini-managed.js +2 -0
  25. package/dist/agents/drivers/gemini-managed.js.map +1 -1
  26. package/dist/agents/drivers/gemini.js +2 -0
  27. package/dist/agents/drivers/gemini.js.map +1 -1
  28. package/dist/agents/drivers/muse-live.js +2 -0
  29. package/dist/agents/drivers/muse-live.js.map +1 -1
  30. package/dist/agents/drivers/muse.js +2 -0
  31. package/dist/agents/drivers/muse.js.map +1 -1
  32. package/dist/agents/drivers/openai-managed.js +2 -0
  33. package/dist/agents/drivers/openai-managed.js.map +1 -1
  34. package/dist/agents/drivers/opencode.js +2 -0
  35. package/dist/agents/drivers/opencode.js.map +1 -1
  36. package/dist/agents/drivers/vibe.js +2 -0
  37. package/dist/agents/drivers/vibe.js.map +1 -1
  38. package/dist/agents/hosted.js +2 -0
  39. package/dist/agents/hosted.js.map +1 -1
  40. package/dist/agents/live-agent.d.ts +3 -0
  41. package/dist/agents/live-agent.js +1 -0
  42. package/dist/agents/live-agent.js.map +1 -1
  43. package/dist/agents/managed.d.ts +3 -0
  44. package/dist/agents/managed.js +1 -0
  45. package/dist/agents/managed.js.map +1 -1
  46. package/dist/agents/mcp-server.d.ts +19 -0
  47. package/dist/agents/mcp-server.js +74 -0
  48. package/dist/agents/mcp-server.js.map +1 -0
  49. package/dist/agents/pack-git.d.ts +23 -0
  50. package/dist/agents/pack-git.js +112 -0
  51. package/dist/agents/pack-git.js.map +1 -0
  52. package/dist/agents/pack.d.ts +68 -0
  53. package/dist/agents/pack.js +611 -0
  54. package/dist/agents/pack.js.map +1 -0
  55. package/dist/agents/session.d.ts +10 -0
  56. package/dist/agents/session.js +26 -0
  57. package/dist/agents/session.js.map +1 -1
  58. package/dist/agents/sessions/claude.d.ts +14 -0
  59. package/dist/agents/sessions/claude.js +233 -0
  60. package/dist/agents/sessions/claude.js.map +1 -0
  61. package/dist/agents/sessions/codex-api.d.ts +32 -0
  62. package/dist/agents/sessions/codex-api.js +233 -0
  63. package/dist/agents/sessions/codex-api.js.map +1 -0
  64. package/dist/agents/sessions/codex.d.ts +28 -0
  65. package/dist/agents/sessions/codex.js +430 -0
  66. package/dist/agents/sessions/codex.js.map +1 -0
  67. package/dist/agents/sessions/doctor.d.ts +67 -0
  68. package/dist/agents/sessions/doctor.js +182 -0
  69. package/dist/agents/sessions/doctor.js.map +1 -0
  70. package/dist/agents/sessions/files.d.ts +44 -0
  71. package/dist/agents/sessions/files.js +150 -0
  72. package/dist/agents/sessions/files.js.map +1 -0
  73. package/dist/agents/sessions/group.d.ts +24 -0
  74. package/dist/agents/sessions/group.js +27 -0
  75. package/dist/agents/sessions/group.js.map +1 -0
  76. package/dist/agents/sessions/hooks.d.ts +32 -0
  77. package/dist/agents/sessions/hooks.js +155 -0
  78. package/dist/agents/sessions/hooks.js.map +1 -0
  79. package/dist/agents/sessions/index.d.ts +42 -0
  80. package/dist/agents/sessions/index.js +97 -0
  81. package/dist/agents/sessions/index.js.map +1 -0
  82. package/dist/agents/sessions/live.d.ts +67 -0
  83. package/dist/agents/sessions/live.js +308 -0
  84. package/dist/agents/sessions/live.js.map +1 -0
  85. package/dist/agents/sessions/sqlite.d.ts +12 -0
  86. package/dist/agents/sessions/sqlite.js +61 -0
  87. package/dist/agents/sessions/sqlite.js.map +1 -0
  88. package/dist/agents/sessions/stores.d.ts +38 -0
  89. package/dist/agents/sessions/stores.js +616 -0
  90. package/dist/agents/sessions/stores.js.map +1 -0
  91. package/dist/agents/sessions/transcript.d.ts +20 -0
  92. package/dist/agents/sessions/transcript.js +134 -0
  93. package/dist/agents/sessions/transcript.js.map +1 -0
  94. package/dist/agents/sessions/types.d.ts +95 -0
  95. package/dist/agents/sessions/types.js +2 -0
  96. package/dist/agents/sessions/types.js.map +1 -0
  97. package/dist/agents/types.d.ts +31 -0
  98. package/dist/agents.d.ts +6 -0
  99. package/dist/agents.js +3 -0
  100. package/dist/agents.js.map +1 -1
  101. package/dist/cli/args.d.ts +26 -0
  102. package/dist/cli/args.js +66 -0
  103. package/dist/cli/args.js.map +1 -1
  104. package/dist/cli/hook.d.ts +7 -0
  105. package/dist/cli/hook.js +21 -0
  106. package/dist/cli/hook.js.map +1 -0
  107. package/dist/cli/main.d.ts +3 -1
  108. package/dist/cli/main.js +237 -2
  109. package/dist/cli/main.js.map +1 -1
  110. package/dist/cli.js +31 -21
  111. package/dist/cli.js.map +1 -1
  112. package/dist/providers/google-converter.js +18 -8
  113. package/dist/providers/google-converter.js.map +1 -1
  114. package/dist/providers/openai-converter.js +3 -2
  115. package/dist/providers/openai-converter.js.map +1 -1
  116. package/dist/providers/openai-responses-converter.d.ts +35 -0
  117. package/dist/providers/openai-responses-converter.js +188 -0
  118. package/dist/providers/openai-responses-converter.js.map +1 -0
  119. package/dist/providers/openai.d.ts +6 -1
  120. package/dist/providers/openai.js +16 -1
  121. package/dist/providers/openai.js.map +1 -1
  122. package/dist/providers.d.ts +1 -0
  123. package/dist/providers.js +1 -0
  124. package/dist/providers.js.map +1 -1
  125. package/dist/ui/index.js +109 -82
  126. package/dist/ui/sessions.d.ts +19 -0
  127. package/dist/ui/sessions.js +59 -0
  128. package/dist/ui/sessions.js.map +1 -0
  129. package/dist/ui/web-client.js +15 -14
  130. package/docs/CHANGELOG.md +20 -0
  131. package/docs/agents.md +210 -1
  132. package/docs/cli.md +39 -0
  133. package/docs/llm.md +6 -1
  134. package/package.json +1 -1
package/docs/CHANGELOG.md CHANGED
@@ -8,6 +8,26 @@ fails. Merging to master refreshes the `release` PR; merging that publishes to n
8
8
 
9
9
  ## Unreleased
10
10
 
11
+ ## 2.35.0 — 2026-11-18
12
+
13
+ ### Added
14
+
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)
25
+
26
+ ### Fixed
27
+
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).
29
+ - 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
+
11
31
  ## 2.34.0 — 2026-11-18
12
32
 
13
33
  ### Added
package/docs/agents.md CHANGED
@@ -71,7 +71,7 @@ In scope:
71
71
  Out of scope, and left to application code:
72
72
 
73
73
  - sandboxing, credentials, and billing, which belong to the agent itself,
74
- - choosing an agent or model, retries, and verify-and-repair loops,
74
+ - choosing an agent or model (`pack()` leaves that to its lead agent), retries, and verify-and-repair loops,
75
75
  - prompts and repository tools. GenAIcode adds no agent loop of its own.
76
76
 
77
77
  ## Running a task
@@ -209,6 +209,214 @@ to brief it again (app agents do: the briefing plus the conversation so far). `c
209
209
  `/fallback` in the chat do it from the command line, and `<AgentChat>`, `chat` and `ui` show the
210
210
  switch in the transcript.
211
211
 
212
+ ## Packs: one agent over the others
213
+
214
+ `pack()` turns the agents on a machine into one `CodingAgent`. The lead takes the prompt and gets
215
+ MCP tools to hand parts of it to the other members, in parallel, and to merge what they did:
216
+
217
+ ```ts
218
+ import { claude, codex, gemini, pack } from 'genaicode/agents';
219
+
220
+ const agent = pack({ lead: claude(), members: [codex(), gemini(), claude()] });
221
+ const run = agent.run({ prompt: 'Add CSV export, with tests, and have it reviewed', cwd });
222
+ for await (const event of run) {
223
+ if (event.type === 'subtask-start') console.log(`→ ${event.agent} ${event.id}: ${event.prompt}`);
224
+ }
225
+ ```
226
+
227
+ The lead decides what to delegate and to whom; genaicode adds the tools, not a loop or a router of
228
+ its own. The lead needs `capabilities.mcp` and sees these tools on an MCP server named `pack`:
229
+
230
+ | Tool | What it does |
231
+ | ---------- | ----------------------------------------------------------------------------------------------- |
232
+ | `agents` | Members: installed or not, tasks running, the plan limits each reported, its last failure kind |
233
+ | `delegate` | Starts `prompt` on a member and returns a task id at once |
234
+ | `wait` | Blocks until tasks end (or `timeoutSeconds`), then reports status, final message, changed files |
235
+ | `steer` | More input for a running task, where the member has `steer()` |
236
+ | `stop` | Stops a running task |
237
+ | `diff` | A worktree task's changes as a unified diff |
238
+ | `merge` | Applies a finished task's changes to the lead's directory (`threeWay` for conflict markers) |
239
+ | `discard` | Drops a finished task's changes |
240
+
241
+ - A delegated task runs in its own git worktree under `.genaicode/worktrees/` (git-ignored): a
242
+ copy of the files as they are, uncommitted and untracked ones included. Nothing reaches the
243
+ working directory until the lead merges it, and a merge stages and commits nothing. Files git
244
+ ignores (`node_modules`, build output) are not in a worktree; `prepareWorktree(dir, repo)` can
245
+ link or install them. Mode `shared` runs a task in the lead's directory instead, for reviews and
246
+ for directories that are not git repositories.
247
+ - Events are the lead's, plus `subtask-start`, `subtask` (a delegated task's own event; its `done`
248
+ ends the task) and `subtask-update` (`merged` or `discarded`). A merge also emits `file-change`.
249
+ - `usage` events and `result.usage` add up the lead and every delegated task, and `task.budget`
250
+ caps the sum. `maxParallel` (default 4) caps how many tasks run at once.
251
+ - Delegated tasks get the run's `env`, `permissions` and `onApproval`; their request ids are
252
+ prefixed with the task id and the summary names the agent.
253
+ - `resume`, `steer()` and `result.sessionId` are the lead's. Tasks still running when the lead
254
+ finishes are stopped. Unmerged worktrees stay for the next turn; `agent.close()` removes them.
255
+
256
+ ## Sessions across agents
257
+
258
+ Every agent keeps its conversations somewhere of its own. `listSessions()` reads those stores and
259
+ returns one list, so an app can show what is going on in every project, whichever agent did it:
260
+
261
+ ```ts
262
+ import { claudeSessions, codexSessions, groupSessions, listSessions } from 'genaicode/agents';
263
+
264
+ const sources = [claudeSessions(), codexSessions()];
265
+ const { sessions, errors } = await listSessions(sources, { since: Date.now() - 7 * 86_400_000 });
266
+ for (const project of groupSessions(sessions)) {
267
+ console.log(project.name, project.agents); // app { claude: 12, codex: 3 }
268
+ for (const s of project.sessions) console.log(' ', s.agent, s.state, s.title ?? s.lastPrompt, s.id);
269
+ }
270
+ ```
271
+
272
+ A `SessionInfo` has the agent, its session `id` (what `AgentTask.resume` takes), the directory it
273
+ started in, branch, title, first and latest prompt, the end of the latest reply, model, usage or
274
+ cost where the store has them, and a `state`: `active` (written to in the last two minutes),
275
+ `waiting` (the agent had the last word) or `unfinished` (it stops at the user's message or in the
276
+ middle of the agent's work).
277
+
278
+ Every driver says where its sessions are in `agent.sessions`: a `SessionSource`, or `null` when
279
+ it keeps none genaicode reads. `agentSessionSources(agents)` collects them (one per store, so
280
+ `codex()` and `codexLive()` count once):
281
+
282
+ ```ts
283
+ const agents = [claude(), codex(), codexLive(), gemini()];
284
+ const { sessions } = await listSessions(agentSessionSources(agents), { limit: 50 });
285
+ ```
286
+
287
+ ### Which sessions need you: hooks
288
+
289
+ The stores say what was written, not what the agent is doing right now: a session that asks
290
+ "may I run this command?" looks the same as one that is thinking. Claude Code and Codex can say
291
+ it themselves through their hooks:
292
+
293
+ ```bash
294
+ npx genaicode hooks install # for the agents installed here; -a claude or -a codex for one
295
+ npx genaicode hooks # what is installed
296
+ npx genaicode hooks uninstall
297
+ ```
298
+
299
+ `install` adds one command hook to the agent's own user settings (`~/.claude/settings.json`,
300
+ `~/.codex/hooks.json`), beside whatever is declared there; Codex runs it once you trust it under
301
+ `/hooks`. The hook runs `genaicode hook <agent>` in the background when a session starts, takes a
302
+ prompt, asks for approval, gets its answer, finishes a turn and ends. It keeps one small file
303
+ per session in `~/.genaicode/live` with the state, the time, the directory and the name of the
304
+ tool asked for: nothing of what was said, and nothing leaves the machine.
305
+
306
+ `listSessions()` puts that over what the stores suggest: `state` is exact, and a `waiting`
307
+ session has `waitingFor`: `'approval'` (with `waitingTool`, such as `Bash`) or `'reply'`.
308
+ `genaicode sessions` marks the first with `◆`, and the browser's Sessions view has a filter for
309
+ them. A record the session's file has since moved past is ignored, so sessions driven without
310
+ the hook fall back to the stores. `{ live: false }` in the query leaves the reports out.
311
+
312
+ In code: `installHooks('claude')`, `hooksStatus()`, `uninstallHooks()`, and `recordHook(agent,
313
+ input)` with `readLive()` and `withLive(sessions, records)` to do the same for an agent of your
314
+ own whose hooks give the same JSON (`session_id`, `hook_event_name`, `cwd`).
315
+
316
+ The command in the settings is the `genaicode` that installed it (`node` and the path of its
317
+ `cli.js`): install it from a `genaicode` that stays where it is (a project's dependency or a
318
+ global install), and run `hooks install` again after moving it.
319
+
320
+ ### When an agent changes its store: `sessions doctor`
321
+
322
+ No agent promises how it keeps its sessions, so an update of its CLI can change the store, and a
323
+ reader that no longer understands it goes quiet instead of failing. `sessions doctor` shows it:
324
+
325
+ ```bash
326
+ npx genaicode sessions doctor # every store; exits 1 when one looks broken
327
+ npx genaicode sessions doctor -a codex --since 7d --json
328
+ ```
329
+
330
+ ```
331
+ claude 2.1.340 (checked with 2.1.327) ok
332
+ 412 sessions: 398 with a prompt or title, 412 with a directory, 412 with a state
333
+ read 5 of the 5 newest: agent messages in 5, tool calls in 4
334
+ hooks: installed, 3 sessions reported
335
+ ```
336
+
337
+ Per store it counts the sessions of the last 30 days and how many have a prompt, a directory and
338
+ a state, opens the five newest conversations, and compares the installed CLI with the version the
339
+ reader was last checked against (`SessionSource.verified`). A store where most sessions lost their
340
+ prompt or directory, or whose conversations no longer open, is a problem; a newer CLI alone is
341
+ not. It prints counts only, never what was said, so the output is safe to paste into an issue.
342
+ From code: `checkSessions(sources, { version })` returns the same as `SessionCheck[]`.
343
+
344
+ Codex can also be asked instead of read. Its app server (`codex app-server`) lists threads and
345
+ their turns in a documented protocol (`thread/list`, `thread/turns/list`), which holds across
346
+ Codex versions where the files may not:
347
+
348
+ ```bash
349
+ npx genaicode sessions doctor --api # compare what was read with what Codex lists
350
+ GENAICODE_CODEX_SESSIONS=app-server npx genaicode sessions # list and read through Codex itself
351
+ ```
352
+
353
+ ```ts
354
+ codexSessions({ via: 'app-server' }); // or 'auto': the app server when `codex` is installed
355
+ ```
356
+
357
+ The files stay the default: reading them changes nothing and starts nothing, while every question
358
+ to the app server starts a Codex process (about half a second) that keeps its own state and logs
359
+ in Codex's home. When the app server cannot be asked, the files are read. `doctor --api` is the
360
+ cheap middle: the files day to day, and Codex's own answer as the reference when you check.
361
+
362
+ The repository also checks every Monday, with no keys, whether the agents' latest releases still
363
+ match the readers (`.github/workflows/drift-canary.yaml`, `node scripts/drift-canary.mjs` after a
364
+ build): it lists each published CLI version beside `verified`, and fails when the latest Codex
365
+ app-server protocol (`codex app-server generate-ts`) no longer has a field that genaicode reads.
366
+
367
+ ### Continuing a session in another agent
368
+
369
+ Sources whose conversations can be read have `read(session)`: the turns of a session (prompts, the
370
+ agent's messages, tool calls with their output), as `createAgentSession` keeps them. Every local store genaicode
371
+ lists has it except Cursor's (Gemini CLI and newer Copilot CLI keep what was said, without tool calls). `session.adopt(turns)` takes them over: they join the transcript, and the
372
+ next prompt hands them to the current agent like `/agent` does, a recap in the prompt and the
373
+ whole transcript in `.genaicode/handoff/`.
374
+
375
+ ```ts
376
+ const sources = agentSessionSources([claude(), codex()]);
377
+ const found = await findSession(sources, 'a1b2c3d4'); // an id, or the start of one
378
+ if (found) {
379
+ const session = createAgentSession({ agent: codex(), cwd: found.session.cwd! });
380
+ session.adopt(await readSession(sources, found.session));
381
+ session.send('Finish what Claude started.');
382
+ }
383
+ ```
384
+
385
+ `adopt(turns, { sessionId })` is for the agent's own session: the next prompt resumes it, and the
386
+ turns are there to show. Only the end of a very long transcript is read (the last 8 MB, 100 turns).
387
+
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 |
403
+
404
+ 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.
408
+
409
+ A hosted driver lists what its platform lists, with `where: 'cloud'` and, where there is one, a
410
+ `url` to open the session: pass `anthropicManaged(...)` or `cursorCloud()` to
411
+ `agentSessionSources` next to the local agents. A cloud session has no local directory, so a
412
+ query with `cwd` leaves the clouds out.
413
+
414
+ Reading is read-only. Transcripts are read at their start and end only, so a store with hundreds
415
+ of long sessions lists quickly. `query` takes `since`, `cwd` and `limit`. A source that cannot be
416
+ read lands in `errors` and the others are still listed. A `SessionSource` is `{ name, where,
417
+ list(query) }`: implement one for another agent or for a vendor's cloud and pass it in the list.
418
+ `genaicode sessions` prints the same from the command line (see [cli.md](./cli.md)).
419
+
212
420
  ## Follow-up turns
213
421
 
214
422
  `result.sessionId` names the agent's own session. Pass it as `resume` to continue that
@@ -862,3 +1070,4 @@ way the built-in drivers are tested.
862
1070
  3. MCP server injection per driver, an env scrub helper, and an opt-in verify/repair helper. Done.
863
1071
  4. More CLIs (gemini, cursor, opencode) and a hosted coding-agent seam (`hostedAgent`, `managedAgent`). Done.
864
1072
  5. A Copilot CLI driver (`copilot`). Done.
1073
+ 6. `pack()`: a lead agent that delegates to the other installed agents. Done; CLI and chat front ends next.
package/docs/cli.md CHANGED
@@ -23,6 +23,26 @@ gets close. `--fallback codex,gemini` runs the task on the next agent when one i
23
23
  not signed in, not installed or crashed (see [failover](agents.md#failover)).
24
24
  `npx genaicode --help` lists every option.
25
25
 
26
+ ## Sessions across agents
27
+
28
+ ```bash
29
+ npx genaicode sessions # what every agent has going on, by project
30
+ npx genaicode sessions --since 7d -C ../api # last week, one project
31
+ npx genaicode sessions -a codex --json # one JSON object per session
32
+ npx genaicode sessions --cloud # also Cursor Cloud Agents (CURSOR_API_KEY)
33
+ ```
34
+
35
+ 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.
37
+ `●` is a session an agent is working in now, `○` one that waits for you, `◌` one that stopped
38
+ half way. After `npx genaicode hooks install`, Claude Code and Codex report what their sessions
39
+ 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>`
40
+ continues it (see [sessions](agents.md#sessions-across-agents)).
41
+
42
+ `npx genaicode sessions doctor` checks that those stores still read as expected after an agent
43
+ updates: counts per store, never content, exit code 1 when one looks broken (see
44
+ [sessions doctor](agents.md#when-an-agent-changes-its-store-sessions-doctor)).
45
+
26
46
  ## Chat with an agent: terminal and browser
27
47
 
28
48
  ```bash
@@ -32,6 +52,12 @@ npx genaicode ui # the same chat in your browser, served on 12
32
52
  npx genaicode chat --web # both: the terminal and the browser on one session
33
53
  ```
34
54
 
55
+ In the browser, **Sessions** in the header shows what every agent on this machine has going on:
56
+ the same list as `genaicode sessions`, by project, with search over titles, prompts, directories
57
+ and branches, and filters by agent, state and period. A local session gives the command that
58
+ continues it in a terminal, and **Continue here** when it is from this directory; a cloud session
59
+ links to its page.
60
+
35
61
  The terminal and the browser can show one session. `/web` in the terminal chat opens it in
36
62
  the browser (`/web off` stops the server), and Enter in the terminal that runs
37
63
  `genaicode ui` brings it into that terminal. A prompt, an approval or a stop from either
@@ -50,6 +76,19 @@ conversation over: codex gets a recap and a transcript file in `.genaicode/hando
50
76
  switching back resumes the earlier agent's own session (`/agent codex --fresh` starts with no
51
77
  context).
52
78
 
79
+ A session from `genaicode sessions` continues the same way, in whichever agent you like:
80
+
81
+ ```sh
82
+ npx genaicode chat -a codex --from a1b2c3d4 # codex takes over a Claude Code session
83
+ npx genaicode run -a gemini --from a1b2c3d4 "Finish the export and run the tests"
84
+ ```
85
+
86
+ `--from` takes a session id or the start of one. The session's turns show in the chat, and the
87
+ agent hears them with your first prompt: its own agent resumes the session, another one gets the
88
+ recap and the transcript file. `/continue <id>` does it inside a chat, and **Continue here** in
89
+ the browser's Sessions view. It works for sessions from the directory genaicode runs in (`-C`) or below it, in the
90
+ stores genaicode can read conversations from (every agent `genaicode sessions` lists locally, except Cursor).
91
+
53
92
  <p align="center">
54
93
  <picture>
55
94
  <source media="(prefers-reduced-motion: reduce)" srcset="media/screenshots/chat-terminal.png">
package/docs/llm.md CHANGED
@@ -317,8 +317,13 @@ Provider-specific options stay at provider construction. For example, Anthropic
317
317
  thinking and output-token defaults, while Gemini and Vertex expose SDK HTTP, auth, API
318
318
  version, and generation configuration options.
319
319
 
320
+ `openai()` talks to the Responses API (stateless, `store: false`), where GPT-6 models take
321
+ function tools; chat completions reject them there. `openai({ api: 'chat' })` keeps chat
322
+ completions. Temperature is left out for reasoning models (o-series, GPT-5 and later), which accept
323
+ only their default.
324
+
320
325
  GitHub Models, Ollama, vLLM, and other compatible gateways use the OpenAI-compatible
321
- adapter:
326
+ adapter, which stays on chat completions:
322
327
 
323
328
  ```ts
324
329
  import { openaiCompatible } from 'genaicode/providers';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "genaicode",
3
- "version": "2.34.0",
3
+ "version": "2.35.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": {