genaicode 2.45.0 → 2.47.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 (79) hide show
  1. package/dist/agents/drivers/claude.js +58 -3
  2. package/dist/agents/drivers/claude.js.map +1 -1
  3. package/dist/agents/pack-checks.d.ts +32 -0
  4. package/dist/agents/pack-checks.js +87 -0
  5. package/dist/agents/pack-checks.js.map +1 -0
  6. package/dist/agents/pack-git.d.ts +7 -3
  7. package/dist/agents/pack-git.js +58 -13
  8. package/dist/agents/pack-git.js.map +1 -1
  9. package/dist/agents/pack.d.ts +20 -2
  10. package/dist/agents/pack.js +242 -20
  11. package/dist/agents/pack.js.map +1 -1
  12. package/dist/agents/session.d.ts +6 -0
  13. package/dist/agents/session.js +72 -28
  14. package/dist/agents/session.js.map +1 -1
  15. package/dist/agents/sessions/codex.d.ts +11 -0
  16. package/dist/agents/sessions/codex.js +42 -2
  17. package/dist/agents/sessions/codex.js.map +1 -1
  18. package/dist/agents/sessions/group.d.ts +4 -0
  19. package/dist/agents/sessions/group.js +33 -5
  20. package/dist/agents/sessions/group.js.map +1 -1
  21. package/dist/agents/sessions/hooks.d.ts +5 -0
  22. package/dist/agents/sessions/hooks.js +11 -2
  23. package/dist/agents/sessions/hooks.js.map +1 -1
  24. package/dist/agents/sessions/index.d.ts +6 -3
  25. package/dist/agents/sessions/index.js +3 -2
  26. package/dist/agents/sessions/index.js.map +1 -1
  27. package/dist/agents/sessions/send-tool.d.ts +50 -0
  28. package/dist/agents/sessions/send-tool.js +114 -0
  29. package/dist/agents/sessions/send-tool.js.map +1 -0
  30. package/dist/agents/sessions/send.d.ts +2 -0
  31. package/dist/agents/sessions/send.js +1 -1
  32. package/dist/agents/sessions/send.js.map +1 -1
  33. package/dist/agents/sessions/stores.js +6 -0
  34. package/dist/agents/sessions/stores.js.map +1 -1
  35. package/dist/agents/sessions/topics.d.ts +22 -5
  36. package/dist/agents/sessions/topics.js +53 -9
  37. package/dist/agents/sessions/topics.js.map +1 -1
  38. package/dist/agents/types.d.ts +5 -0
  39. package/dist/agents/usage.d.ts +6 -0
  40. package/dist/agents/usage.js +18 -0
  41. package/dist/agents/usage.js.map +1 -1
  42. package/dist/agents.d.ts +3 -2
  43. package/dist/agents.js +1 -1
  44. package/dist/agents.js.map +1 -1
  45. package/dist/cli/args.d.ts +3 -0
  46. package/dist/cli/args.js +6 -0
  47. package/dist/cli/args.js.map +1 -1
  48. package/dist/cli/check-limits.d.ts +13 -0
  49. package/dist/cli/check-limits.js +129 -0
  50. package/dist/cli/check-limits.js.map +1 -0
  51. package/dist/cli/check-process.d.ts +13 -0
  52. package/dist/cli/check-process.js +86 -0
  53. package/dist/cli/check-process.js.map +1 -0
  54. package/dist/cli/check-storage.d.ts +3 -0
  55. package/dist/cli/check-storage.js +52 -0
  56. package/dist/cli/check-storage.js.map +1 -0
  57. package/dist/cli/limit-test.sh +37 -0
  58. package/dist/cli/mac-fork.cjs +22 -0
  59. package/dist/cli/main.d.ts +3 -5
  60. package/dist/cli/main.js +124 -31
  61. package/dist/cli/main.js.map +1 -1
  62. package/dist/cli/pack-verify.d.ts +3 -0
  63. package/dist/cli/pack-verify.js +214 -0
  64. package/dist/cli/pack-verify.js.map +1 -0
  65. package/dist/react/agent-chat.css +20 -0
  66. package/dist/react/format.d.ts +2 -0
  67. package/dist/react/format.js +12 -0
  68. package/dist/react/format.js.map +1 -1
  69. package/dist/react/pack-tasks.js +25 -6
  70. package/dist/react/pack-tasks.js.map +1 -1
  71. package/dist/ui/index.js +104 -100
  72. package/dist/ui/sessions.d.ts +17 -0
  73. package/dist/ui/sessions.js +30 -1
  74. package/dist/ui/sessions.js.map +1 -1
  75. package/dist/ui/web-client.js +37 -17
  76. package/docs/CHANGELOG.md +29 -0
  77. package/docs/agents.md +33 -2
  78. package/docs/cli.md +59 -9
  79. package/package.json +1 -1
package/docs/CHANGELOG.md CHANGED
@@ -8,6 +8,35 @@ fails. Merging to master refreshes the `release` PR; merging that publishes to n
8
8
 
9
9
  ## Unreleased
10
10
 
11
+ ## 2.47.0 — 2026-11-21
12
+
13
+ ### Added
14
+
15
+ - `sessions_send` in `chat --sessions` and `ui --sessions` (the desktop app): ask the agent to tell another session something and it sends it there; the first message to each session waits for your approval in the chat, and the chat shows the answer (#253)
16
+ - `genaicode sessions send` refuses in a shell that a coding agent runs, so prompts to other sessions come from a person; `--force` sends anyway (#247)
17
+ - The desktop app starts its chat with the session tools (`ui --sessions`), so the agent answers what goes on in a project from the session index (#251)
18
+ - `genaicode ui` and the desktop app fold a turn's tool calls into one "N steps" line that opens on click; the answer, errors and open approvals stay in view (#251)
19
+ - The browser's Sessions view groups sessions by topic once `genaicode topics refresh` has sorted them (those that ask for you first; **By directory** brings projects back), and the header shows the chosen agent's plan limits as `genaicode limits` last saw them, without a price when a plan limit is known (#251)
20
+ - `genaicode sessions --waiting --json --watch` carries the topics: each session the name of its `topic`, and the line `topics` (name, sessions, asking, active). The desktop app's menu names a waiting session by its topic and lists the topics agents work on now (#250)
21
+ - `genaicode topics refresh` puts the sessions that worked in a directory of a Codex desktop app project in a topic named as that project, whichever agent they were in (`codexProjects()`, `folderTopics()`), after the claude.ai projects and before any agent is asked; the agent is told to keep topics few and broad (#248)
22
+
23
+ ### Fixed
24
+
25
+ - `sessions --waiting --json --watch` (the desktop app's menu bar) lists only the sessions that ask now, not every session whose turn ended; `hooks status` says `broken` when the Node its hook was installed with is gone (#252)
26
+ - `genaicode hooks install` gives Codex's `SessionEnd` hook the three seconds Codex allows, so Codex no longer warns about it in every session (#251)
27
+ - `genaicode topics` lists topics without their directories, and with names up to 48 characters (#248)
28
+ - Threads the Codex desktop app's server ran for another program, and Muse Code's probes and test-provider sessions, count as automated (#248)
29
+
30
+ ## 2.46.0 — 2026-11-21
31
+
32
+ ### Added
33
+
34
+ - Pack task cards let you request an independent review, test an isolated copy of the worker's files and see when either result is outdated before merging (#239)
35
+
36
+ ### Fixed
37
+
38
+ - `replyEnding()` strips trailing punctuation/emoji and inspects the closing clause in linear time, eliminating polynomial regex backtracking on long whitespace runs (#245)
39
+
11
40
  ## 2.45.0 — 2026-11-21
12
41
 
13
42
  ### Added
package/docs/agents.md CHANGED
@@ -235,6 +235,7 @@ its own. The lead needs `capabilities.mcp` and sees these tools on an MCP server
235
235
  | `steer` | More input for a running task, where the member has `steer()` |
236
236
  | `stop` | Stops a running task |
237
237
  | `diff` | A worktree task's changes as a unified diff |
238
+ | `review` | A read-only second opinion on the full patch, attached to the worker's task |
238
239
  | `merge` | Applies a finished task's changes to the lead's directory (`threeWay` for conflict markers) |
239
240
  | `discard` | Drops a finished task's changes |
240
241
 
@@ -259,6 +260,20 @@ The same method accepts `merge`, `discard`, `stop` and `{ type: 'steer', text }`
259
260
  Each run also exposes these controls as `run.pack`. A chat can still review and merge
260
261
  finished tasks after a later turn starts. Adopted transcripts are read-only.
261
262
 
263
+ Use `{ type: 'review' }` to get a fresh review from the first eligible installed agent,
264
+ starting with the lead and excluding the worker. The pack passes the complete patch as text
265
+ to `CodingAgent.runText`. Claude Code implements this with tools, MCP, hooks and project
266
+ context disabled. A custom driver can supply the same capability. Other drivers remain
267
+ eligible to do the work. `{ type: 'verify' }` runs the pack's configured
268
+ `verification: { label, run(cwd, signal, snapshotRoot) }` in a private checkout of the
269
+ recorded Git tree. The pack removes the checkout after the callback finishes. An
270
+ embedding application supplies the isolation for its own verifier. The callback returns
271
+ `{ ok, detail }`. Both results appear in `task.checks`. Each result records its
272
+ Git tree in `revision`. Compare it with `checks.revision` to spot an outdated result.
273
+ Pass the revision displayed to the operator in `{ type: 'merge', revision }` so a
274
+ concurrent edit leaves the worktree open for inspection. Set `operatorMerge: true` to
275
+ have the lead leave completed changes for the operator by default.
276
+
262
277
  ## Sessions across agents
263
278
 
264
279
  Every agent keeps its conversations somewhere of its own. `listSessions()` reads those stores and
@@ -338,7 +353,8 @@ statement is not seen.
338
353
  Sessions nobody typed into are left out of every listing: scheduled tasks and notifications in
339
354
  Claude Code (every prompt has `origin.kind` or `turnOrigin` other than `human`, or the session
340
355
  opens with a scheduled task nobody answered), headless runs of it with a single prompt (a program
341
- driving it through more prompts is somebody's chat) and `codex exec` runs. They carry `automated: true`;
356
+ driving it through more prompts is somebody's chat), `codex exec` runs, threads the Codex desktop
357
+ app's server ran for another program, and Muse Code's probes. They carry `automated: true`;
342
358
  `sessions --automated`, or `{ automated: true }` in the query, lists them too.
343
359
 
344
360
  **Topics.** Sessions can be kept as pieces of work that cross agents and directories
@@ -381,6 +397,10 @@ only the agent, project and tool name. The user answers these requests in the na
381
397
  Copilot records the decision as soon as it is made. Gemini CLI 0.70 reports the result when
382
398
  the tool finishes, so a refresh can still show its last request while the command runs.
383
399
 
400
+ The hook is declared with the Node that installed it. When that Node goes (a version manager
401
+ removed it), the hook fails without a word; `genaicode hooks status` says `broken` then (`missing`
402
+ in `hooksStatus()`), and `genaicode hooks install` writes it again.
403
+
384
404
  In code: `installHooks('claude')`, `hooksStatus()`, `uninstallHooks()`, and `recordHook(agent,
385
405
  input)` with `readLive()` and `withLive(sessions, records)` to do the same for an agent of your
386
406
  own whose hooks give the same JSON (`session_id`, `hook_event_name`, `cwd`); `hookInput(agent,
@@ -524,7 +544,7 @@ app-server protocol (`codex app-server generate-ts`) no longer has a field that
524
544
 
525
545
  ### Asking an agent about the sessions: `sessions mcp`
526
546
 
527
- The session index provides four read-only MCP tools. In `genaicode chat --sessions`, ask
547
+ The session index provides four read-only MCP tools (and, in a chat, `sessions_send`, below). In `genaicode chat --sessions`, ask
528
548
  "Which sessions need my attention?" to see which project needs a decision or a reply.
529
549
 
530
550
  | tool | what it returns |
@@ -550,6 +570,17 @@ The [session tower](cli.md#open-the-session-tower) opens an indexed chat with a
550
570
  of the queue. Its `/waiting [project]` and `/read <id>` commands call the same read-only
551
571
  operations and display the results to the user. A regular chat message starts an agent turn.
552
572
 
573
+ In `chat --sessions` and `ui --sessions` (the desktop app) the agent also gets `sessions_send`:
574
+ ask it "tell Codex in knights that the bakery is done" and it finds the session and sends the
575
+ message there as a new turn, with that session's own agent in its own directory. The first
576
+ message to each session shows as an approval in the chat, with the recipient and the exact
577
+ text; once allowed, later messages to that session go without asking until the chat closes.
578
+ With auto-approve on (`--yes`, `/auto`) nothing is asked. The tool returns once the message is
579
+ sent, and the chat shows the session's answer when its turn ends. Only a waiting or unfinished
580
+ local session takes a message, as with `sessions send`; closing the chat stops a turn still
581
+ running there. In code: `sessionSendTool(agents, gate)` with a `SessionSendGate` the chat
582
+ attaches to, and `AgentSession.ask()` for the question.
583
+
553
584
  When the tower runs a pack, its lead also receives `propose_session_message` on the pack MCP
554
585
  server. It takes the full session `id`, the exact `text` and an optional `source`. A successful
555
586
  call queues a draft in the operator's inbox. The operator can dismiss it or send it once,
package/docs/cli.md CHANGED
@@ -93,6 +93,10 @@ You can pipe the prompt on stdin or use `-a <agent>` to search one agent's store
93
93
  stays in the native conversation. The driver uses its default permissions unless you select
94
94
  `--sandbox read-only|workspace-write|unrestricted`. Each driver accepts its supported modes.
95
95
 
96
+ Prompts to other sessions are sent by a person. In a shell that a coding agent runs (the agent's
97
+ CLI marks it with a variable such as `CLAUDECODE` or `GEMINI_CLI`) the command refuses unless you
98
+ pass `--force`. This stops an agent sending by accident; it is not a security boundary.
99
+
96
100
  In the browser, choose **Sessions → Reply**, enter the message and choose **Send**. The reply appears
97
101
  in the Sessions view. Both entry points require a local session that is waiting for a reply or
98
102
  stopped mid-turn, with a driver that supports resuming. A running turn or pending tool approval
@@ -120,11 +124,14 @@ the browser's Sessions view has Approve and Deny (see
120
124
 
121
125
  A program that shows what waits (a menu bar, a status line) can keep one process open instead of
122
126
  asking again and again: `npx genaicode sessions --waiting --json --watch` prints one line
123
- `{"sessions":[...]}` at once and another whenever the waiting sessions or their open questions
124
- change. With `--exit-with-stdin` it ends when its stdin closes, so it cannot outlive its parent.
127
+ `{"sessions":[...]}` at once and another whenever they or their open questions change. The
128
+ watch lists only the sessions that ask now: an approval, or a last message that asked something
129
+ in the last three days, not every session whose turn ended. With `--exit-with-stdin` it ends when its stdin closes, so it cannot outlive its parent.
125
130
  It looks every 3 seconds: a question or anything else a hook reports shows at once, a session
126
131
  that only finished its turn within 15 seconds. Once limits are known, the line also carries them
127
- as `"limits":[...]`.
132
+ as `"limits":[...]`. Once there are [topics](#your-work-as-topics-topics), each session carries the name
133
+ of its topic as `"topic"`, and the line the topics of the listed week as
134
+ `"topics":[{"id","name","sessions","asking","active"}]`, at most 12, those that ask first.
128
135
 
129
136
  ### How much of your plans is used: `limits`
130
137
 
@@ -157,9 +164,9 @@ with several agents and from several directories. `npx genaicode topics` shows t
157
164
  agents as topics, what asks for you first:
158
165
 
159
166
  ```
160
- ● Pack mode t1 claude 9, codex 3 12m ago 1 ask you src/genaicode
161
- ▶ Desktop app t2 claude 6 1h ago 1 working src/genaicode, src/site
162
- YouTube pins t3 codex 2 2d ago src/site
167
+ ● Pack mode t1 claude 9, codex 3 12m ago 1 ask you
168
+ ▶ Desktop app t2 claude 6 1h ago 1 working
169
+ YouTube pins t3 codex 2 2d ago
163
170
  14 sessions not sorted yet: "genaicode topics refresh" sorts them.
164
171
  ```
165
172
 
@@ -172,7 +179,9 @@ otherwise); `--since` looks further back than the 30 days it and `topics` cover
172
179
 
173
180
  Sessions that Claude Code ran for a claude.ai project (Remote Control) say which project in their
174
181
  first message. Those go to a topic named as the project, before any agent is asked and at no
175
- cost, so the topics start from the projects you already have. `topics refresh --again` drops the
182
+ cost, so the topics start from the projects you already have. What is left and worked in a
183
+ directory of a project of the Codex desktop app goes to a topic named as that project, whichever
184
+ agent it was. Only the rest is given to an agent. `topics refresh --again` drops the
176
185
  topics there are, corrections included, and sorts every session anew.
177
186
 
178
187
  A topic asks for you (`●`) when a session waits for an approval, or when its last message asked
@@ -199,7 +208,9 @@ In `npx genaicode chat --sessions`, ask "Which sessions need my attention?" The
199
208
  `sessions_waiting` tool shows the same sessions as `genaicode sessions --waiting`, including
200
209
  the project, open approval questions and the latest reply. `npx genaicode sessions mcp` serves
201
210
  the same read-only tools over stdio. The agent can read what the other sessions said and what
202
- their open questions ask. See [session tools](agents.md#asking-an-agent-about-the-sessions-sessions-mcp).
211
+ their open questions ask. Ask it to pass something to another session ("tell Codex in
212
+ knights that...") and it sends it with `sessions_send`; you allow the first message to each
213
+ session in the chat. See [session tools](agents.md#asking-an-agent-about-the-sessions-sessions-mcp).
203
214
 
204
215
  ### Open the session tower
205
216
 
@@ -242,7 +253,13 @@ In the browser, **Sessions** in the header shows what every agent on this machin
242
253
  the same list as `genaicode sessions`, by project, with search over titles, prompts, directories
243
254
  and branches, and filters by agent, state and period. A local session gives the command that
244
255
  continues it in a terminal, and **Continue here** when it is from this directory; a cloud session
245
- links to its page.
256
+ links to its page. Once [`genaicode topics refresh`](#your-work-as-topics-topics) has sorted
257
+ your sessions, the view groups them by topic instead (those that ask for you first), and
258
+ **By directory** brings the projects back.
259
+
260
+ The header shows how much of the chosen agent's plan is used (`7d 19%`): what the session's runs
261
+ report, and before that what `genaicode limits` last saw. With a plan limit known, the price of
262
+ the session's tokens is left out: on a plan it would be an estimate nobody pays.
246
263
 
247
264
  The terminal and the browser can show one session. `/web` in the terminal chat opens it in
248
265
  the browser (`/web off` stops the server), and Enter in the terminal that runs
@@ -262,6 +279,39 @@ worktree's diff, merge the changes into the lead's directory, or discard the wor
262
279
  Merging leaves the files available for review and commit. Unmerged worktrees stay on disk
263
280
  when you exit. The task controls belong to the chat process that started them.
264
281
 
282
+ Chat packs leave completed changes on the task card by default. Choose **Request review**
283
+ to send the full diff to another agent with its tools disabled. The lead reviews when eligible.
284
+ Claude Code supports this mode. For example, Claude can review a Codex worker in `--pack claude:codex`.
285
+ **Run tests** runs the displayed command in a private copy of the worker's directory. A project with an npm
286
+ test script gets a test button automatically. Choose a different check at startup, for
287
+ example `genaicode ui --pack --verify "python -m pytest"`. Tests run when you request them.
288
+
289
+ The CLI checks out the recorded Git tree, excluding the worker's ignored files. It runs
290
+ tests under Seatbelt on macOS or `/usr/bin/bwrap` (bubblewrap) on Linux, with a temporary
291
+ home and writable space for test output and bundler caches. Installed dependencies are read-only,
292
+ and npm workspace links point to the checked-out packages. Network access is disabled. A missing or disabled
293
+ sandbox reports a failed check. The built-in test runner is unavailable on Windows.
294
+
295
+ Each pack runs one test command at a time under an unprivileged account, for up to five
296
+ minutes and 180 CPU seconds per process. On Linux, a systemd user manager (254 or newer)
297
+ and cgroup v2 enforce 2 GiB of memory across the whole check, zero swap and 64 tasks,
298
+ including threads. The runner checks the kernel's limits before executing the command.
299
+ On macOS, it monitors total resident memory and process count, stopping the group above
300
+ 2 GiB or 64 processes. macOS also applies a system memory limit of 1.5 GiB per process.
301
+
302
+ Each check has a disposable 1 GiB filesystem for the workspace and temporary files. Linux
303
+ mounts the installed dependencies read-only and allows another 16 MiB of shared memory.
304
+ On macOS, the workspace and its copied dependencies share a private sparse disk image. Each
305
+ newly written file is limited to 128 MiB.
306
+
307
+ On macOS, test helpers stay in one process group and exit with the command. Node's child
308
+ process APIs use `fork` and `exec`. Native tools that require Darwin's `posix_spawn` system
309
+ call receive a permission error. Linux runs the command in its own PID namespace.
310
+
311
+ Read **Review notes** and **Test output** beside **Merge locally**. A further edit marks
312
+ earlier results **Outdated**. Run the checks again, or inspect the changed diff and decide
313
+ whether to merge it. In the terminal use `r` for review, `v` for tests and `c` to read the results.
314
+
265
315
  Each prompt after the first continues the agent's own session (`AgentTask.resume`), so you
266
316
  can say "now add a test for that". Prompts sent while the agent works wait in a queue and
267
317
  run next; Esc stops the agent. When the agent asks for permission, `y` approves, `n`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "genaicode",
3
- "version": "2.45.0",
3
+ "version": "2.47.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": {