genaicode 2.38.0 → 2.40.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 (58) hide show
  1. package/dist/agents/mcp-tools.d.ts +2 -0
  2. package/dist/agents/mcp-tools.js +6 -1
  3. package/dist/agents/mcp-tools.js.map +1 -1
  4. package/dist/agents/pack.d.ts +18 -1
  5. package/dist/agents/pack.js +91 -56
  6. package/dist/agents/pack.js.map +1 -1
  7. package/dist/agents/session.d.ts +11 -0
  8. package/dist/agents/session.js +76 -3
  9. package/dist/agents/session.js.map +1 -1
  10. package/dist/agents/sessions/answer.d.ts +7 -2
  11. package/dist/agents/sessions/answer.js +18 -13
  12. package/dist/agents/sessions/answer.js.map +1 -1
  13. package/dist/agents/sessions/approval-previews.d.ts +7 -0
  14. package/dist/agents/sessions/approval-previews.js +83 -0
  15. package/dist/agents/sessions/approval-previews.js.map +1 -0
  16. package/dist/agents/sessions/files.d.ts +2 -0
  17. package/dist/agents/sessions/files.js +10 -0
  18. package/dist/agents/sessions/files.js.map +1 -1
  19. package/dist/agents/sessions/hook-input.d.ts +3 -0
  20. package/dist/agents/sessions/hook-input.js +21 -1
  21. package/dist/agents/sessions/hook-input.js.map +1 -1
  22. package/dist/agents/sessions/index.js +10 -2
  23. package/dist/agents/sessions/index.js.map +1 -1
  24. package/dist/agents/sessions/live.d.ts +10 -4
  25. package/dist/agents/sessions/live.js +22 -12
  26. package/dist/agents/sessions/live.js.map +1 -1
  27. package/dist/agents/sessions/stores.js +4 -3
  28. package/dist/agents/sessions/stores.js.map +1 -1
  29. package/dist/agents/sessions/tools.d.ts +2 -2
  30. package/dist/agents/sessions/tools.js +72 -29
  31. package/dist/agents/sessions/tools.js.map +1 -1
  32. package/dist/agents/sessions/types.d.ts +7 -0
  33. package/dist/agents/types.d.ts +5 -0
  34. package/dist/agents.d.ts +1 -1
  35. package/dist/agents.js.map +1 -1
  36. package/dist/cli/args.d.ts +6 -1
  37. package/dist/cli/args.js +21 -2
  38. package/dist/cli/args.js.map +1 -1
  39. package/dist/cli/main.d.ts +4 -1
  40. package/dist/cli/main.js +59 -21
  41. package/dist/cli/main.js.map +1 -1
  42. package/dist/react/agent-chat.css +122 -0
  43. package/dist/react/agent-chat.d.ts +3 -0
  44. package/dist/react/agent-chat.js +14 -4
  45. package/dist/react/agent-chat.js.map +1 -1
  46. package/dist/react/format.d.ts +3 -0
  47. package/dist/react/format.js +20 -0
  48. package/dist/react/format.js.map +1 -1
  49. package/dist/react/pack-tasks.d.ts +12 -0
  50. package/dist/react/pack-tasks.js +49 -0
  51. package/dist/react/pack-tasks.js.map +1 -0
  52. package/dist/ui/index.js +98 -89
  53. package/dist/ui/web-client.js +137 -15
  54. package/docs/CHANGELOG.md +14 -0
  55. package/docs/agents.md +37 -12
  56. package/docs/cli.md +39 -5
  57. package/docs/react.md +1 -0
  58. package/package.json +1 -1
package/docs/CHANGELOG.md CHANGED
@@ -8,6 +8,20 @@ fails. Merging to master refreshes the `release` PR; merging that publishes to n
8
8
 
9
9
  ## Unreleased
10
10
 
11
+ ## 2.40.0 — 2026-11-20
12
+
13
+ ### Added
14
+
15
+ - `genaicode tower` opens an indexed chat with waiting sessions across projects. Use `/waiting [project]` to refresh the queue and `/read <id>` to preview a conversation locally (#217)
16
+ - The waiting queue and browser Sessions view show up to 200 characters of a shell command awaiting approval in GitHub Copilot CLI or Gemini CLI (#219)
17
+ - `genaicode chat` and `ui` accept `--pack claude:codex,gemini` to follow delegated tasks, answer approvals, steer a worker and review or merge its changes from either view (#220)
18
+
19
+ ## 2.39.0 — 2026-11-20
20
+
21
+ ### Added
22
+
23
+ - Ask “Which sessions need my attention?” in `genaicode chat --sessions`. The new `sessions_waiting` MCP tool lists pending approvals and replies across projects, including open questions (#215)
24
+
11
25
  ## 2.38.0 — 2026-11-20
12
26
 
13
27
  ### Added
package/docs/agents.md CHANGED
@@ -253,6 +253,12 @@ its own. The lead needs `capabilities.mcp` and sees these tools on an MCP server
253
253
  - `resume`, `steer()` and `result.sessionId` are the lead's. Tasks still running when the lead
254
254
  finishes are stopped. Unmerged worktrees stay for the next turn; `agent.close()` removes them.
255
255
 
256
+ In a live chat, `turn.pack.tasks` holds the delegated work under its original turn.
257
+ `session.actOnPackTask?.(turn.id, id, { type: 'diff' })` returns the unified patch.
258
+ The same method accepts `merge`, `discard`, `stop` and `{ type: 'steer', text }`.
259
+ Each run also exposes these controls as `run.pack`. A chat can still review and merge
260
+ finished tasks after a later turn starts. Adopted transcripts are read-only.
261
+
256
262
  ## Sessions across agents
257
263
 
258
264
  Every agent keeps its conversations somewhere of its own. `listSessions()` reads those stores and
@@ -304,10 +310,9 @@ prompt, asks for approval, gets its answer, finishes a turn and ends. It keeps o
304
310
  per session in `~/.genaicode/live` with the state, the time, the directory and the name of the
305
311
  tool asked for: nothing of what was said, and nothing leaves the machine.
306
312
 
307
- What each agent tells differs. Claude Code, Codex and Copilot tell when a session asks for
308
- approval and which tool; Gemini CLI tells that it asks, not for which tool; Cursor's hooks tell
309
- of no question at all, so a Cursor session shows as working or waiting for your reply, never as
310
- asking. Gemini and Cursor wait for their hooks (genaicode's takes a few milliseconds), and Gemini
313
+ Claude Code, Codex and Copilot identify the tool in an approval request. Gemini CLI identifies
314
+ shell commands in its permission notifications and can also send a generic request for attention.
315
+ Cursor reports working sessions and finished turns. Gemini and Cursor wait for their hooks, and Gemini
311
316
  shows that a hook runs unless `hooksConfig.notifications` is off.
312
317
 
313
318
  `listSessions()` puts that over what the stores suggest: `state` is exact, and a `waiting`
@@ -322,6 +327,15 @@ the command that continues it. It looks a week back unless `--since` says otherw
322
327
  browser's Sessions view has the same as a "N wait for you" button; in code,
323
328
  `waitingSessions(sessions)` picks and orders them.
324
329
 
330
+ For Copilot and Gemini shell approvals, `waitingCommands` contains the tool name and up to
331
+ 200 characters of each matching command. Genaicode keeps a digest in its private hook record
332
+ and reads the text on demand from the agent's own local session journal. A session with a
333
+ missing journal or incomplete permission details still reports the approval. The CLI, the
334
+ browser and the opt-in `sessions_waiting` MCP tool show the preview. Desktop alerts contain
335
+ only the agent, project and tool name. The user answers these requests in the native agent.
336
+ Copilot records the decision as soon as it is made. Gemini CLI 0.70 reports the result when
337
+ the tool finishes, so a refresh can still show its last request while the command runs.
338
+
325
339
  In code: `installHooks('claude')`, `hooksStatus()`, `uninstallHooks()`, and `recordHook(agent,
326
340
  input)` with `readLive()` and `withLive(sessions, records)` to do the same for an agent of your
327
341
  own whose hooks give the same JSON (`session_id`, `hook_event_name`, `cwd`); `hookInput(agent,
@@ -460,14 +474,15 @@ app-server protocol (`codex app-server generate-ts`) no longer has a field that
460
474
 
461
475
  ### Asking an agent about the sessions: `sessions mcp`
462
476
 
463
- The index is also three MCP tools, so an agent can answer "what is open?" and "what waits for
464
- me?" across all of them:
477
+ The session index provides four read-only MCP tools. In `genaicode chat --sessions`, ask
478
+ "Which sessions need my attention?" to see which project needs a decision or a reply.
465
479
 
466
- | tool | what it returns |
467
- | ------------------- | -------------------------------------------------------------------------------------- |
468
- | `sessions_projects` | projects worked in lately, with counts per agent and per state |
469
- | `sessions_list` | sessions, newest first; filters `project`, `agent`, `state`, `text`, `days`, `limit` |
470
- | `sessions_read` | what was said in one session: prompts, the agent's messages and the names of its tools |
480
+ | tool | what it returns |
481
+ | ------------------- | --------------------------------------------------------------------------------------------- |
482
+ | `sessions_projects` | projects worked in lately, with counts per agent and per state |
483
+ | `sessions_list` | sessions, newest first; filters `project`, `agent`, `state`, `text`, `days`, `limit` |
484
+ | `sessions_waiting` | approvals and replies with open questions, filtered by `project`, `agent`, `days` and `limit` |
485
+ | `sessions_read` | what was said in one session: prompts, the agent's messages and the names of its tools |
471
486
 
472
487
  ```bash
473
488
  npx genaicode chat --sessions # the chat's agent gets the tools
@@ -475,6 +490,16 @@ claude mcp add sessions -- npx genaicode sessions mcp # or any agent, as a
475
490
  codex mcp add sessions -- npx genaicode sessions mcp
476
491
  ```
477
492
 
493
+ `sessions_waiting` uses the same order as `genaicode sessions --waiting`. It shows approvals
494
+ first, then sessions awaiting a reply, newest first within each group. It looks back seven days
495
+ and shows up to 30 sessions by default. For questions held open by `hooks install --answer`,
496
+ the agent can read the question ID, tool name and preview. Archived sessions stay out of this
497
+ view and appear with `[archived]` in `sessions_list` and `sessions_read`.
498
+
499
+ The [session tower](cli.md#open-the-session-tower) opens an indexed chat with a local preview
500
+ of the queue. Its `/waiting [project]` and `/read <id>` commands call the same read-only
501
+ operations and display the results to the user. A regular chat message starts an agent turn.
502
+
478
503
  `state` is `active`, `waiting`, `unfinished` or `approval` (a session that asks whether it may use
479
504
  a tool, known once the [hooks](#which-sessions-need-you-hooks) are installed). The tools only read
480
505
  the local stores. They are off unless you ask for them, because the agent that has them reads what
@@ -1202,4 +1227,4 @@ way the built-in drivers are tested.
1202
1227
  3. MCP server injection per driver, an env scrub helper, and an opt-in verify/repair helper. Done.
1203
1228
  4. More CLIs (gemini, cursor, opencode) and a hosted coding-agent seam (`hostedAgent`, `managedAgent`). Done.
1204
1229
  5. A Copilot CLI driver (`copilot`). Done.
1205
- 6. `pack()`: a lead agent that delegates to the other installed agents. Done; CLI and chat front ends next.
1230
+ 6. `pack()`: a lead agent delegates to installed agents. The terminal and browser chat expose it with `--pack`.
package/docs/cli.md CHANGED
@@ -97,6 +97,12 @@ must finish first. The check uses the latest store and hook information availabl
97
97
  `npx genaicode notify on` then shows a desktop notification when a session asks for approval
98
98
  (`--done`: also when one finishes its turn; see [notify](agents.md#being-told-notify)).
99
99
 
100
+ With Copilot or Gemini hooks installed, `sessions --waiting`, the tower's `/waiting` command
101
+ and the browser's Sessions view show up to 200 characters of a shell command awaiting approval.
102
+ Refresh the queue to see which commands still need a decision. Answer in the agent that asked.
103
+ Copilot reports a decision immediately. Gemini CLI may show the last request until the tool
104
+ finishes. Desktop notifications show the project and tool name.
105
+
100
106
  With `hooks install --answer`, Claude Code's approval questions can also be answered from here:
101
107
  `sessions --waiting` lists them, `sessions approve <q>` / `sessions deny <q> -m <why>` answer, and
102
108
  the browser's Sessions view has Approve and Deny (see
@@ -111,11 +117,26 @@ them); the agents' files stay as they are (see
111
117
  updates: counts per store, never content, exit code 1 when one looks broken (see
112
118
  [sessions doctor](agents.md#when-an-agent-changes-its-store-sessions-doctor)).
113
119
 
114
- `npx genaicode chat --sessions` gives the chat's agent that index as tools, so you can ask it what
115
- is open or what waits for you in every agent; `npx genaicode sessions mcp` serves the same tools
116
- to any agent as a stdio MCP server (see
117
- [sessions mcp](agents.md#asking-an-agent-about-the-sessions-sessions-mcp)). The agent that has
118
- them reads what the other sessions said.
120
+ In `npx genaicode chat --sessions`, ask "Which sessions need my attention?" The
121
+ `sessions_waiting` tool shows the same sessions as `genaicode sessions --waiting`, including
122
+ the project, open approval questions and the latest reply. `npx genaicode sessions mcp` serves
123
+ the same read-only tools over stdio. The agent can read what the other sessions said and what
124
+ their open questions ask. See [session tools](agents.md#asking-an-agent-about-the-sessions-sessions-mcp).
125
+
126
+ ### Open the session tower
127
+
128
+ Run `npx genaicode tower` to open a terminal chat with up to five sessions waiting for you.
129
+ Approvals come first. Each entry includes the project and the session ID. Use `-a <agent>` to
130
+ choose an installed agent with MCP support, or `--web` to open the same chat in a browser.
131
+
132
+ | In the chat | What it does |
133
+ | ----------------- | --------------------------------------------------------------------------------------------------- |
134
+ | `/waiting` | Refresh the waiting queue across projects, showing up to 30 sessions from the last seven days. |
135
+ | `/waiting harbor` | Show waiting sessions whose project directory or repository contains `harbor`. |
136
+ | `/read <id>` | Preview up to three recent turns in place. A unique prefix of at least eight characters also works. |
137
+
138
+ These commands also work in `chat --sessions` and `ui --sessions`. Their results appear locally
139
+ in the chat. To ask the agent for a summary, type your own question with the session ID.
119
140
 
120
141
  ## Chat with an agent: terminal and browser
121
142
 
@@ -124,6 +145,7 @@ npx genaicode # chat in this terminal (same as "genaicode c
124
145
  npx genaicode chat -a claude -C ../api
125
146
  npx genaicode ui # the same chat in your browser, served on 127.0.0.1
126
147
  npx genaicode chat --web # both: the terminal and the browser on one session
148
+ npx genaicode chat --pack claude:codex,gemini --web
127
149
  ```
128
150
 
129
151
  In the browser, **Sessions** in the header shows what every agent on this machine has going on:
@@ -137,6 +159,18 @@ the browser (`/web off` stops the server), and Enter in the terminal that runs
137
159
  `genaicode ui` brings it into that terminal. A prompt, an approval or a stop from either
138
160
  side shows up in both.
139
161
 
162
+ With `--pack lead:member,member`, the lead chooses which tasks to delegate. **Pack tasks**
163
+ under its turn shows each worker's prompt, activity, result and changed files. The slot counter
164
+ includes workers waiting for approval. `--max-parallel` sets the slot limit (default 4).
165
+ `--max-tokens` and `--max-cost` include the lead and its workers.
166
+
167
+ In the browser, select a task or open **Approvals**. In the terminal, press Tab on an empty
168
+ prompt, use ↑/↓ to select a task, and press `q` for the shared approval queue. The inspector
169
+ shows which keys are available. You can steer a live worker, stop it, inspect a finished
170
+ worktree's diff, merge the changes into the lead's directory, or discard the worktree.
171
+ Merging leaves the files available for review and commit. Unmerged worktrees stay on disk
172
+ when you exit. The task controls belong to the chat process that started them.
173
+
140
174
  Each prompt after the first continues the agent's own session (`AgentTask.resume`), so you
141
175
  can say "now add a test for that". Prompts sent while the agent works wait in a queue and
142
176
  run next; Esc stops the agent. When the agent asks for permission, `y` approves, `n`
package/docs/react.md CHANGED
@@ -76,6 +76,7 @@ sends, Shift+Enter adds a line and Esc stops. Props:
76
76
  | `state` | `SessionState`, or null before there is a session |
77
77
  | `onSend(text)`, `onStop()` | Enter or Send; Stop or Esc. No `onStop`, no Stop button |
78
78
  | `onApprove(id, decision)` | answers `state.approvals`; without it they show as waiting |
79
+ | `onPackAction(turnId, id, action)` | pass the session's `actOnPackTask` to enable worker controls and return a diff or result text |
79
80
  | `renderPrompt(text, turn?)` | how a sent prompt shows (return null to hide it) |
80
81
  | `renderAfterTurn(turn, i)`, `renderFooter()` | your content after a turn, or at the end |
81
82
  | `notices` | `{ id, afterTurn, text, tone? }[]`: your own lines between turns |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "genaicode",
3
- "version": "2.38.0",
3
+ "version": "2.40.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": {