genaicode 2.34.0 → 2.35.1
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/dist/agents/artifacts.d.ts +1 -1
- package/dist/agents/artifacts.js +4 -65
- package/dist/agents/artifacts.js.map +1 -1
- package/dist/agents/cli-agent.d.ts +3 -0
- package/dist/agents/cli-agent.js +1 -0
- package/dist/agents/cli-agent.js.map +1 -1
- package/dist/agents/drivers/anthropic-managed.d.ts +4 -0
- package/dist/agents/drivers/anthropic-managed.js +46 -0
- package/dist/agents/drivers/anthropic-managed.js.map +1 -1
- package/dist/agents/drivers/antigravity.js +2 -0
- package/dist/agents/drivers/antigravity.js.map +1 -1
- package/dist/agents/drivers/claude.js +2 -0
- package/dist/agents/drivers/claude.js.map +1 -1
- package/dist/agents/drivers/codex-live.js +2 -0
- package/dist/agents/drivers/codex-live.js.map +1 -1
- package/dist/agents/drivers/codex.js +2 -0
- package/dist/agents/drivers/codex.js.map +1 -1
- package/dist/agents/drivers/copilot.js +2 -0
- package/dist/agents/drivers/copilot.js.map +1 -1
- package/dist/agents/drivers/cursor-cloud.js +45 -0
- package/dist/agents/drivers/cursor-cloud.js.map +1 -1
- package/dist/agents/drivers/cursor.js +2 -0
- package/dist/agents/drivers/cursor.js.map +1 -1
- package/dist/agents/drivers/gemini-managed.js +2 -0
- package/dist/agents/drivers/gemini-managed.js.map +1 -1
- package/dist/agents/drivers/gemini.js +2 -0
- package/dist/agents/drivers/gemini.js.map +1 -1
- package/dist/agents/drivers/muse-live.js +2 -0
- package/dist/agents/drivers/muse-live.js.map +1 -1
- package/dist/agents/drivers/muse.js +2 -0
- package/dist/agents/drivers/muse.js.map +1 -1
- package/dist/agents/drivers/openai-managed.js +2 -0
- package/dist/agents/drivers/openai-managed.js.map +1 -1
- package/dist/agents/drivers/opencode.js +2 -0
- package/dist/agents/drivers/opencode.js.map +1 -1
- package/dist/agents/drivers/vibe.js +2 -0
- package/dist/agents/drivers/vibe.js.map +1 -1
- package/dist/agents/hosted.js +2 -0
- package/dist/agents/hosted.js.map +1 -1
- package/dist/agents/live-agent.d.ts +3 -0
- package/dist/agents/live-agent.js +1 -0
- package/dist/agents/live-agent.js.map +1 -1
- package/dist/agents/managed.d.ts +3 -0
- package/dist/agents/managed.js +1 -0
- package/dist/agents/managed.js.map +1 -1
- package/dist/agents/mcp-server.d.ts +19 -0
- package/dist/agents/mcp-server.js +74 -0
- package/dist/agents/mcp-server.js.map +1 -0
- package/dist/agents/pack-git.d.ts +23 -0
- package/dist/agents/pack-git.js +112 -0
- package/dist/agents/pack-git.js.map +1 -0
- package/dist/agents/pack.d.ts +68 -0
- package/dist/agents/pack.js +611 -0
- package/dist/agents/pack.js.map +1 -0
- package/dist/agents/session.d.ts +10 -0
- package/dist/agents/session.js +26 -0
- package/dist/agents/session.js.map +1 -1
- package/dist/agents/sessions/claude.d.ts +14 -0
- package/dist/agents/sessions/claude.js +233 -0
- package/dist/agents/sessions/claude.js.map +1 -0
- package/dist/agents/sessions/codex-api.d.ts +32 -0
- package/dist/agents/sessions/codex-api.js +233 -0
- package/dist/agents/sessions/codex-api.js.map +1 -0
- package/dist/agents/sessions/codex.d.ts +28 -0
- package/dist/agents/sessions/codex.js +430 -0
- package/dist/agents/sessions/codex.js.map +1 -0
- package/dist/agents/sessions/doctor.d.ts +67 -0
- package/dist/agents/sessions/doctor.js +182 -0
- package/dist/agents/sessions/doctor.js.map +1 -0
- package/dist/agents/sessions/files.d.ts +44 -0
- package/dist/agents/sessions/files.js +150 -0
- package/dist/agents/sessions/files.js.map +1 -0
- package/dist/agents/sessions/group.d.ts +24 -0
- package/dist/agents/sessions/group.js +27 -0
- package/dist/agents/sessions/group.js.map +1 -0
- package/dist/agents/sessions/hooks.d.ts +32 -0
- package/dist/agents/sessions/hooks.js +155 -0
- package/dist/agents/sessions/hooks.js.map +1 -0
- package/dist/agents/sessions/index.d.ts +42 -0
- package/dist/agents/sessions/index.js +97 -0
- package/dist/agents/sessions/index.js.map +1 -0
- package/dist/agents/sessions/live.d.ts +67 -0
- package/dist/agents/sessions/live.js +308 -0
- package/dist/agents/sessions/live.js.map +1 -0
- package/dist/agents/sessions/sqlite.d.ts +12 -0
- package/dist/agents/sessions/sqlite.js +61 -0
- package/dist/agents/sessions/sqlite.js.map +1 -0
- package/dist/agents/sessions/stores.d.ts +38 -0
- package/dist/agents/sessions/stores.js +630 -0
- package/dist/agents/sessions/stores.js.map +1 -0
- package/dist/agents/sessions/transcript.d.ts +20 -0
- package/dist/agents/sessions/transcript.js +134 -0
- package/dist/agents/sessions/transcript.js.map +1 -0
- package/dist/agents/sessions/types.d.ts +95 -0
- package/dist/agents/sessions/types.js +2 -0
- package/dist/agents/sessions/types.js.map +1 -0
- package/dist/agents/types.d.ts +31 -0
- package/dist/agents.d.ts +6 -0
- package/dist/agents.js +3 -0
- package/dist/agents.js.map +1 -1
- package/dist/cli/args.d.ts +26 -0
- package/dist/cli/args.js +66 -0
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/hook.d.ts +7 -0
- package/dist/cli/hook.js +21 -0
- package/dist/cli/hook.js.map +1 -0
- package/dist/cli/main.d.ts +3 -1
- package/dist/cli/main.js +237 -2
- package/dist/cli/main.js.map +1 -1
- package/dist/cli.js +31 -21
- package/dist/cli.js.map +1 -1
- package/dist/providers/google-converter.js +18 -8
- package/dist/providers/google-converter.js.map +1 -1
- package/dist/providers/openai-converter.js +3 -2
- package/dist/providers/openai-converter.js.map +1 -1
- package/dist/providers/openai-responses-converter.d.ts +35 -0
- package/dist/providers/openai-responses-converter.js +188 -0
- package/dist/providers/openai-responses-converter.js.map +1 -0
- package/dist/providers/openai.d.ts +6 -1
- package/dist/providers/openai.js +16 -1
- package/dist/providers/openai.js.map +1 -1
- package/dist/providers.d.ts +1 -0
- package/dist/providers.js +1 -0
- package/dist/providers.js.map +1 -1
- package/dist/ui/index.js +109 -82
- package/dist/ui/sessions.d.ts +19 -0
- package/dist/ui/sessions.js +59 -0
- package/dist/ui/sessions.js.map +1 -0
- package/dist/ui/web-client.js +15 -14
- package/docs/CHANGELOG.md +26 -0
- package/docs/agents.md +212 -1
- package/docs/cli.md +41 -0
- package/docs/llm.md +6 -1
- package/package.json +1 -1
package/docs/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,32 @@ fails. Merging to master refreshes the `release` PR; merging that publishes to n
|
|
|
8
8
|
|
|
9
9
|
## Unreleased
|
|
10
10
|
|
|
11
|
+
## 2.35.1 — 2026-11-19
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
|
|
15
|
+
- 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)
|
|
16
|
+
|
|
17
|
+
## 2.35.0 — 2026-11-18
|
|
18
|
+
|
|
19
|
+
### Added
|
|
20
|
+
|
|
21
|
+
- `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).
|
|
22
|
+
- `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).
|
|
23
|
+
- `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).
|
|
24
|
+
- `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).
|
|
25
|
+
- 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).
|
|
26
|
+
- 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).
|
|
27
|
+
- 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).
|
|
28
|
+
- `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).
|
|
29
|
+
- `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).
|
|
30
|
+
- 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).
|
|
31
|
+
|
|
32
|
+
### Fixed
|
|
33
|
+
|
|
34
|
+
- 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).
|
|
35
|
+
- 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).
|
|
36
|
+
|
|
11
37
|
## 2.34.0 — 2026-11-18
|
|
12
38
|
|
|
13
39
|
### 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,216 @@ 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`, `events.jsonl` (or `session-store.db`) |
|
|
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 stores listed from an index without opening transcripts (Muse, Antigravity) give no latest
|
|
406
|
+
reply. Codex, Muse, Antigravity, Cursor and Copilot's `session-store.db` fallback read SQLite
|
|
407
|
+
files with `node:sqlite` (Node 22.5 or newer; on an older Node Codex, Muse and Antigravity land
|
|
408
|
+
in `errors`, Cursor skips the model and Copilot needs `events.jsonl`). Subagent sessions and
|
|
409
|
+
archived threads are left out.
|
|
410
|
+
|
|
411
|
+
A hosted driver lists what its platform lists, with `where: 'cloud'` and, where there is one, a
|
|
412
|
+
`url` to open the session: pass `anthropicManaged(...)` or `cursorCloud()` to
|
|
413
|
+
`agentSessionSources` next to the local agents. A cloud session has no local directory, so a
|
|
414
|
+
query with `cwd` leaves the clouds out.
|
|
415
|
+
|
|
416
|
+
Reading is read-only. Transcripts are read at their start and end only, so a store with hundreds
|
|
417
|
+
of long sessions lists quickly. `query` takes `since`, `cwd` and `limit`. A source that cannot be
|
|
418
|
+
read lands in `errors` and the others are still listed. A `SessionSource` is `{ name, where,
|
|
419
|
+
list(query) }`: implement one for another agent or for a vendor's cloud and pass it in the list.
|
|
420
|
+
`genaicode sessions` prints the same from the command line (see [cli.md](./cli.md)).
|
|
421
|
+
|
|
212
422
|
## Follow-up turns
|
|
213
423
|
|
|
214
424
|
`result.sessionId` names the agent's own session. Pass it as `resume` to continue that
|
|
@@ -862,3 +1072,4 @@ way the built-in drivers are tested.
|
|
|
862
1072
|
3. MCP server injection per driver, an env scrub helper, and an opt-in verify/repair helper. Done.
|
|
863
1073
|
4. More CLIs (gemini, cursor, opencode) and a hosted coding-agent seam (`hostedAgent`, `managedAgent`). Done.
|
|
864
1074
|
5. A Copilot CLI driver (`copilot`). Done.
|
|
1075
|
+
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,28 @@ 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. SQLite-backed stores (Codex, Muse,
|
|
37
|
+
Antigravity, Cursor's model lookup and Copilot's `session-store.db` fallback) need Node 22.5 or
|
|
38
|
+
newer (`node:sqlite`); the other stores work on Node 20+.
|
|
39
|
+
`●` is a session an agent is working in now, `○` one that waits for you, `◌` one that stopped
|
|
40
|
+
half way. After `npx genaicode hooks install`, Claude Code and Codex report what their sessions
|
|
41
|
+
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>`
|
|
42
|
+
continues it (see [sessions](agents.md#sessions-across-agents)).
|
|
43
|
+
|
|
44
|
+
`npx genaicode sessions doctor` checks that those stores still read as expected after an agent
|
|
45
|
+
updates: counts per store, never content, exit code 1 when one looks broken (see
|
|
46
|
+
[sessions doctor](agents.md#when-an-agent-changes-its-store-sessions-doctor)).
|
|
47
|
+
|
|
26
48
|
## Chat with an agent: terminal and browser
|
|
27
49
|
|
|
28
50
|
```bash
|
|
@@ -32,6 +54,12 @@ npx genaicode ui # the same chat in your browser, served on 12
|
|
|
32
54
|
npx genaicode chat --web # both: the terminal and the browser on one session
|
|
33
55
|
```
|
|
34
56
|
|
|
57
|
+
In the browser, **Sessions** in the header shows what every agent on this machine has going on:
|
|
58
|
+
the same list as `genaicode sessions`, by project, with search over titles, prompts, directories
|
|
59
|
+
and branches, and filters by agent, state and period. A local session gives the command that
|
|
60
|
+
continues it in a terminal, and **Continue here** when it is from this directory; a cloud session
|
|
61
|
+
links to its page.
|
|
62
|
+
|
|
35
63
|
The terminal and the browser can show one session. `/web` in the terminal chat opens it in
|
|
36
64
|
the browser (`/web off` stops the server), and Enter in the terminal that runs
|
|
37
65
|
`genaicode ui` brings it into that terminal. A prompt, an approval or a stop from either
|
|
@@ -50,6 +78,19 @@ conversation over: codex gets a recap and a transcript file in `.genaicode/hando
|
|
|
50
78
|
switching back resumes the earlier agent's own session (`/agent codex --fresh` starts with no
|
|
51
79
|
context).
|
|
52
80
|
|
|
81
|
+
A session from `genaicode sessions` continues the same way, in whichever agent you like:
|
|
82
|
+
|
|
83
|
+
```sh
|
|
84
|
+
npx genaicode chat -a codex --from a1b2c3d4 # codex takes over a Claude Code session
|
|
85
|
+
npx genaicode run -a gemini --from a1b2c3d4 "Finish the export and run the tests"
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
`--from` takes a session id or the start of one. The session's turns show in the chat, and the
|
|
89
|
+
agent hears them with your first prompt: its own agent resumes the session, another one gets the
|
|
90
|
+
recap and the transcript file. `/continue <id>` does it inside a chat, and **Continue here** in
|
|
91
|
+
the browser's Sessions view. It works for sessions from the directory genaicode runs in (`-C`) or below it, in the
|
|
92
|
+
stores genaicode can read conversations from (every agent `genaicode sessions` lists locally, except Cursor).
|
|
93
|
+
|
|
53
94
|
<p align="center">
|
|
54
95
|
<picture>
|
|
55
96
|
<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.
|
|
3
|
+
"version": "2.35.1",
|
|
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": {
|