genaicode 2.39.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 (53) hide show
  1. package/dist/agents/pack.d.ts +18 -1
  2. package/dist/agents/pack.js +91 -56
  3. package/dist/agents/pack.js.map +1 -1
  4. package/dist/agents/session.d.ts +11 -0
  5. package/dist/agents/session.js +76 -3
  6. package/dist/agents/session.js.map +1 -1
  7. package/dist/agents/sessions/answer.js +2 -3
  8. package/dist/agents/sessions/answer.js.map +1 -1
  9. package/dist/agents/sessions/approval-previews.d.ts +7 -0
  10. package/dist/agents/sessions/approval-previews.js +83 -0
  11. package/dist/agents/sessions/approval-previews.js.map +1 -0
  12. package/dist/agents/sessions/files.d.ts +2 -0
  13. package/dist/agents/sessions/files.js +10 -0
  14. package/dist/agents/sessions/files.js.map +1 -1
  15. package/dist/agents/sessions/hook-input.d.ts +3 -0
  16. package/dist/agents/sessions/hook-input.js +21 -1
  17. package/dist/agents/sessions/hook-input.js.map +1 -1
  18. package/dist/agents/sessions/index.js +9 -1
  19. package/dist/agents/sessions/index.js.map +1 -1
  20. package/dist/agents/sessions/live.d.ts +5 -1
  21. package/dist/agents/sessions/live.js +13 -5
  22. package/dist/agents/sessions/live.js.map +1 -1
  23. package/dist/agents/sessions/stores.js +4 -3
  24. package/dist/agents/sessions/stores.js.map +1 -1
  25. package/dist/agents/sessions/tools.js +2 -1
  26. package/dist/agents/sessions/tools.js.map +1 -1
  27. package/dist/agents/sessions/types.d.ts +5 -0
  28. package/dist/agents/types.d.ts +5 -0
  29. package/dist/agents.d.ts +1 -1
  30. package/dist/agents.js.map +1 -1
  31. package/dist/cli/args.d.ts +6 -1
  32. package/dist/cli/args.js +21 -2
  33. package/dist/cli/args.js.map +1 -1
  34. package/dist/cli/main.d.ts +4 -1
  35. package/dist/cli/main.js +47 -10
  36. package/dist/cli/main.js.map +1 -1
  37. package/dist/react/agent-chat.css +122 -0
  38. package/dist/react/agent-chat.d.ts +3 -0
  39. package/dist/react/agent-chat.js +14 -4
  40. package/dist/react/agent-chat.js.map +1 -1
  41. package/dist/react/format.d.ts +3 -0
  42. package/dist/react/format.js +20 -0
  43. package/dist/react/format.js.map +1 -1
  44. package/dist/react/pack-tasks.d.ts +12 -0
  45. package/dist/react/pack-tasks.js +49 -0
  46. package/dist/react/pack-tasks.js.map +1 -0
  47. package/dist/ui/index.js +98 -89
  48. package/dist/ui/web-client.js +137 -15
  49. package/docs/CHANGELOG.md +8 -0
  50. package/docs/agents.md +23 -5
  51. package/docs/cli.md +34 -0
  52. package/docs/react.md +1 -0
  53. package/package.json +1 -1
package/docs/CHANGELOG.md CHANGED
@@ -8,6 +8,14 @@ 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
+
11
19
  ## 2.39.0 — 2026-11-20
12
20
 
13
21
  ### 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,
@@ -482,6 +496,10 @@ and shows up to 30 sessions by default. For questions held open by `hooks instal
482
496
  the agent can read the question ID, tool name and preview. Archived sessions stay out of this
483
497
  view and appear with `[archived]` in `sessions_list` and `sessions_read`.
484
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
+
485
503
  `state` is `active`, `waiting`, `unfinished` or `approval` (a session that asks whether it may use
486
504
  a tool, known once the [hooks](#which-sessions-need-you-hooks) are installed). The tools only read
487
505
  the local stores. They are off unless you ask for them, because the agent that has them reads what
@@ -1209,4 +1227,4 @@ way the built-in drivers are tested.
1209
1227
  3. MCP server injection per driver, an env scrub helper, and an opt-in verify/repair helper. Done.
1210
1228
  4. More CLIs (gemini, cursor, opencode) and a hosted coding-agent seam (`hostedAgent`, `managedAgent`). Done.
1211
1229
  5. A Copilot CLI driver (`copilot`). Done.
1212
- 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
@@ -117,6 +123,21 @@ the project, open approval questions and the latest reply. `npx genaicode sessio
117
123
  the same read-only tools over stdio. The agent can read what the other sessions said and what
118
124
  their open questions ask. See [session tools](agents.md#asking-an-agent-about-the-sessions-sessions-mcp).
119
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.
140
+
120
141
  ## Chat with an agent: terminal and browser
121
142
 
122
143
  ```bash
@@ -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.39.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": {