genaicode 2.36.0 → 2.37.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/mcp-server.d.ts +2 -0
- package/dist/agents/mcp-server.js +6 -2
- package/dist/agents/mcp-server.js.map +1 -1
- package/dist/agents/mcp-tools.d.ts +1 -0
- package/dist/agents/mcp-tools.js +4 -1
- package/dist/agents/mcp-tools.js.map +1 -1
- package/dist/agents/sessions/answer.d.ts +53 -0
- package/dist/agents/sessions/answer.js +225 -0
- package/dist/agents/sessions/answer.js.map +1 -0
- package/dist/agents/sessions/archive.d.ts +26 -0
- package/dist/agents/sessions/archive.js +71 -0
- package/dist/agents/sessions/archive.js.map +1 -0
- package/dist/agents/sessions/files.js +2 -1
- package/dist/agents/sessions/files.js.map +1 -1
- package/dist/agents/sessions/group.d.ts +12 -0
- package/dist/agents/sessions/group.js +22 -0
- package/dist/agents/sessions/group.js.map +1 -1
- package/dist/agents/sessions/hook-input.d.ts +17 -0
- package/dist/agents/sessions/hook-input.js +110 -0
- package/dist/agents/sessions/hook-input.js.map +1 -0
- package/dist/agents/sessions/hooks.d.ts +19 -4
- package/dist/agents/sessions/hooks.js +113 -29
- package/dist/agents/sessions/hooks.js.map +1 -1
- package/dist/agents/sessions/index.d.ts +11 -4
- package/dist/agents/sessions/index.js +12 -5
- package/dist/agents/sessions/index.js.map +1 -1
- package/dist/agents/sessions/live.d.ts +6 -0
- package/dist/agents/sessions/live.js +14 -2
- package/dist/agents/sessions/live.js.map +1 -1
- package/dist/agents/sessions/notify.d.ts +34 -0
- package/dist/agents/sessions/notify.js +87 -0
- package/dist/agents/sessions/notify.js.map +1 -0
- package/dist/agents/sessions/tools.d.ts +7 -0
- package/dist/agents/sessions/tools.js +11 -2
- package/dist/agents/sessions/tools.js.map +1 -1
- package/dist/agents/sessions/types.d.ts +7 -0
- package/dist/agents.d.ts +2 -2
- package/dist/agents.js +1 -1
- package/dist/agents.js.map +1 -1
- package/dist/cli/args.d.ts +28 -0
- package/dist/cli/args.js +85 -6
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/hook.d.ts +13 -1
- package/dist/cli/hook.js +54 -8
- package/dist/cli/hook.js.map +1 -1
- package/dist/cli/main.d.ts +4 -1
- package/dist/cli/main.js +215 -20
- package/dist/cli/main.js.map +1 -1
- package/dist/cli.js +15 -2
- package/dist/cli.js.map +1 -1
- package/dist/ui/index.js +96 -85
- package/dist/ui/sessions.d.ts +10 -2
- package/dist/ui/sessions.js +16 -1
- package/dist/ui/sessions.js.map +1 -1
- package/dist/ui/web-client.js +15 -15
- package/docs/CHANGELOG.md +20 -0
- package/docs/agents.md +79 -7
- package/docs/cli.md +15 -1
- package/package.json +1 -1
package/dist/cli/args.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"args.js","sourceRoot":"","sources":["../../src/cli/args.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AA2GtC,MAAM,OAAO,UAAW,SAAQ,KAAK;CAAG;AAExC,qGAAqG;AACrG,MAAM,UAAU,QAAQ,CAAC,IAAuB;IAC9C,MAAM,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;IAChC,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,MAAM,IAAI,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,IAAI;QAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IACrH,IAAI,OAAO,KAAK,WAAW,IAAI,OAAO,KAAK,IAAI;QAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;IAE5E,IAAI,OAAO,KAAK,QAAQ,EAAE,CAAC;QACzB,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC,GAAG,EAAE,CAC5B,SAAS,CAAC;YACR,IAAI,EAAE,IAAI;YACV,MAAM,EAAE,IAAI;YACZ,OAAO,EAAE;g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ook.d.ts
CHANGED
|
@@ -1,7 +1,19 @@
|
|
|
1
|
+
import { type WaitOptions } from '../agents/sessions/answer.js';
|
|
2
|
+
import { type Notice } from '../agents/sessions/notify.js';
|
|
1
3
|
/**
|
|
2
4
|
* `genaicode hook <agent>`: what an agent's hook runs. Notes what the session is doing from the
|
|
3
5
|
* hook's input on stdin and never gets in the agent's way: no output it would act on, exit 0.
|
|
4
6
|
*/
|
|
5
7
|
export declare function runHook(agent: string | undefined, input: string | undefined, env: NodeJS.ProcessEnv, stdout: {
|
|
6
8
|
write(text: string): unknown;
|
|
7
|
-
}
|
|
9
|
+
}, send?: (notice: Notice) => unknown,
|
|
10
|
+
/** The event the hook was installed for, for an agent whose input does not name it (Copilot). */
|
|
11
|
+
name?: string): Promise<number>;
|
|
12
|
+
/**
|
|
13
|
+
* `genaicode hook <agent> --answer`: the `PermissionRequest` hook that holds the question open
|
|
14
|
+
* for the tower. The agent's own dialog shows it meanwhile; an answer given here is printed as
|
|
15
|
+
* the hook's decision, and with none (answered in the agent, timed out) it decides nothing.
|
|
16
|
+
*/
|
|
17
|
+
export declare function runAnswerHook(agent: string | undefined, input: string | undefined, env: NodeJS.ProcessEnv, stdout: {
|
|
18
|
+
write(text: string): unknown;
|
|
19
|
+
}, options?: Omit<WaitOptions, 'env'>): Promise<number>;
|
package/dist/cli/hook.js
CHANGED
|
@@ -1,21 +1,67 @@
|
|
|
1
|
+
import { waitForAnswer } from '../agents/sessions/answer.js';
|
|
2
|
+
import { hookInput, hookOutput } from '../agents/sessions/hook-input.js';
|
|
1
3
|
import { recordHook } from '../agents/sessions/live.js';
|
|
4
|
+
import { noticeFor, readNotify, sendNotice } from '../agents/sessions/notify.js';
|
|
2
5
|
/**
|
|
3
6
|
* `genaicode hook <agent>`: what an agent's hook runs. Notes what the session is doing from the
|
|
4
7
|
* hook's input on stdin and never gets in the agent's way: no output it would act on, exit 0.
|
|
5
8
|
*/
|
|
6
|
-
export async function runHook(agent, input, env, stdout)
|
|
9
|
+
export async function runHook(agent, input, env, stdout, send = (notice) => sendNotice(notice),
|
|
10
|
+
/** The event the hook was installed for, for an agent whose input does not name it (Copilot). */
|
|
11
|
+
name) {
|
|
12
|
+
let own = name;
|
|
7
13
|
try {
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
const raw = JSON.parse(input ?? '');
|
|
15
|
+
const named = raw?.hook_event_name;
|
|
16
|
+
own ??= typeof named === 'string' ? named : undefined;
|
|
17
|
+
const event = agent ? hookInput(agent, raw, own) : raw;
|
|
18
|
+
if (agent) {
|
|
19
|
+
// `genaicode notify on`: a question asked, or a turn over, shows on the desktop.
|
|
20
|
+
const settings = await readNotify(env);
|
|
21
|
+
const wanted = settings.approval || settings.done;
|
|
22
|
+
let notice;
|
|
23
|
+
await recordHook(agent, event, {
|
|
24
|
+
env,
|
|
25
|
+
...(wanted ? { onRecord: (before, after) => void (notice = noticeFor(before, after, settings)) } : {}),
|
|
26
|
+
});
|
|
27
|
+
if (notice)
|
|
28
|
+
send(notice);
|
|
29
|
+
}
|
|
15
30
|
}
|
|
16
31
|
catch {
|
|
17
32
|
// A hook that fails would show an error in the agent for nothing the user can act on.
|
|
18
33
|
}
|
|
34
|
+
// Some hooks answer in JSON (Claude Code's `Stop`, every one of Cursor's and Gemini's): this one
|
|
35
|
+
// decides nothing, and is printed even when the report failed.
|
|
36
|
+
const output = hookOutput(agent ?? '', own);
|
|
37
|
+
if (output)
|
|
38
|
+
stdout.write(output);
|
|
39
|
+
return 0;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* `genaicode hook <agent> --answer`: the `PermissionRequest` hook that holds the question open
|
|
43
|
+
* for the tower. The agent's own dialog shows it meanwhile; an answer given here is printed as
|
|
44
|
+
* the hook's decision, and with none (answered in the agent, timed out) it decides nothing.
|
|
45
|
+
*/
|
|
46
|
+
export async function runAnswerHook(agent, input, env, stdout, options = {}) {
|
|
47
|
+
try {
|
|
48
|
+
const event = JSON.parse(input ?? '');
|
|
49
|
+
if (!agent || event?.hook_event_name !== 'PermissionRequest')
|
|
50
|
+
return 0;
|
|
51
|
+
const decision = await waitForAnswer(agent, event, { ...options, env });
|
|
52
|
+
if (decision) {
|
|
53
|
+
const message = decision.behavior === 'deny' ? (decision.message ?? 'Denied from genaicode.') : undefined;
|
|
54
|
+
stdout.write(`${JSON.stringify({
|
|
55
|
+
hookSpecificOutput: {
|
|
56
|
+
hookEventName: 'PermissionRequest',
|
|
57
|
+
decision: { behavior: decision.behavior, ...(message ? { message } : {}) },
|
|
58
|
+
},
|
|
59
|
+
})}\n`);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
catch {
|
|
63
|
+
// The agent's own dialog still decides.
|
|
64
|
+
}
|
|
19
65
|
return 0;
|
|
20
66
|
}
|
|
21
67
|
//# sourceMappingURL=hook.js.map
|
package/dist/cli/hook.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hook.js","sourceRoot":"","sources":["../../src/cli/hook.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"hook.js","sourceRoot":"","sources":["../../src/cli/hook.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAoB,MAAM,8BAA8B,CAAC;AAC/E,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAe,MAAM,8BAA8B,CAAC;AAE9F;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,OAAO,CAC3B,KAAyB,EACzB,KAAyB,EACzB,GAAsB,EACtB,MAAwC,EACxC,OAAoC,CAAC,MAAM,EAAE,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;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C;IACjC,OAAO,CAAC,CAAC;AACX,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,KAAyB,EACzB,KAAyB,EACzB,GAAsB,EACtB,MAAwC,EACxC,UAAoC,EAAE;IAEtC,IAAI,CAAC;QACH,MAAM,KAAK,GAAY,IAAI,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;QAC/C,IAAI,CAAC,KAAK,IAAK,KAA8C,EAAE,eAAe,KAAK,mBAAmB;YAAE,OAAO,CAAC,CAAC;QACjH,MAAM,QAAQ,GAAG,MAAM,aAAa,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,GAAG,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC;QACxE,IAAI,QAAQ,EAAE,CAAC;YACb,MAAM,OAAO,GAAG,QAAQ,CAAC,QAAQ,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,IAAI,wBAAwB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;YAC1G,MAAM,CAAC,KAAK,CACV,GAAG,IAAI,CAAC,SAAS,CAAC;gBAChB,kBAAkB,EAAE;oBAClB,aAAa,EAAE,mBAAmB;oBAClC,QAAQ,EAAE,EAAE,QAAQ,EAAE,QAAQ,CAAC,QAAQ,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE;iBAC3E;aACF,CAAC,IAAI,CACP,CAAC;QACJ,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,wCAAwC;IAC1C,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC"}
|
package/dist/cli/main.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { AgentBudget, CodingAgent, McpServer } from '../agents/types.js';
|
|
2
|
+
import { type Notice } from '../agents/sessions/notify.js';
|
|
2
3
|
import type { SessionSource } from '../agents/sessions/types.js';
|
|
3
4
|
import { type Output } from './render.js';
|
|
4
5
|
import { type UpdateDeps } from './update.js';
|
|
@@ -27,6 +28,8 @@ export interface CliEnvironment {
|
|
|
27
28
|
loadUi?(): Promise<UiModule>;
|
|
28
29
|
/** What `update` and the daily check use. Defaults to the npm registry and this package. */
|
|
29
30
|
updater?: Partial<UpdateDeps>;
|
|
31
|
+
/** Shows a desktop notification (`notify test`). Default: `sendNotice()`. */
|
|
32
|
+
notify?(notice: Notice): boolean;
|
|
30
33
|
/** Runs the `--verify` command. Defaults to a shell in the task directory. */
|
|
31
34
|
runCheck?(command: string, cwd: string, env: NodeJS.ProcessEnv, signal?: AbortSignal): Promise<CheckResult>;
|
|
32
35
|
}
|
|
@@ -81,6 +84,6 @@ export declare const EXIT_OK = 0;
|
|
|
81
84
|
export declare const EXIT_FAILED = 1;
|
|
82
85
|
export declare const EXIT_USAGE = 2;
|
|
83
86
|
export declare const EXIT_ABORTED = 130;
|
|
84
|
-
export declare const helpText = "genaicode: run the coding-agent CLIs installed on this machine behind one interface.\n\nUsage:\n genaicode Chat with an agent in this terminal (same as \"chat\")\n genaicode chat [options] Chat with an agent in this terminal\n genaicode ui [options] Chat with an agent in the browser (local server)\n genaicode agents [--json] List supported agents and whether each is installed\n genaicode sessions [options] List the sessions agents keep on this machine, by project\n genaicode sessions doctor Check that the agents' session stores still read as expected\n genaicode sessions mcp Serve the session index to an agent as MCP tools (stdio)\n genaicode hooks [install|uninstall] Have agents report what their sessions do (default: status)\n genaicode run [options] <prompt...> Run one task (reads the prompt from stdin if omitted)\n genaicode embed [options] [request] Have an agent add genaicode to the project here\n genaicode acp [options] Serve the Agent Client Protocol on stdin/stdout\n genaicode update [options] Update the installed genaicode command\n\nUpdate options (for the command scripts/install.sh installs; npx and npm -g update through npm):\n --check Only say whether a newer version is out\n --version <v> Install this version instead of the latest\n --auto on|off Check daily and update in the background (default: on)\n\nSessions options:\n -a, --agent <name> Only this agent's sessions\n --cloud Also Cursor Cloud Agents (needs CURSOR_API_KEY)\n -C, --cwd <dir> Only sessions in this directory or below it\n --since <age> Only sessions active in the last 90m, 12h, 7d, 2w...\n -n, --limit <n> At most this many sessions, newest first (default 30)\n --json One JSON object per session\n\n Each line ends with the session id: continue it with\n \"genaicode chat -a <agent> -C <dir> -r <id>\".\n\n \"sessions doctor\" (-a, --since, --json, --api) checks each store: how many sessions it lists, how\n many have a prompt and a directory, whether the newest conversations open, and whether the\n agent's CLI is newer than the one the reader was checked with. It prints counts, never what\n was said, and exits 1 when a store reads differently than expected. With --api it also asks\n the agents that can be asked (Codex's app server) and compares; that starts the agent's own\n process, which keeps its state and logs in its home.\n\n \"sessions mcp\" (-a) is an MCP server on stdio with the tools sessions_projects, sessions_list and\n sessions_read, so any agent can answer what is open and what waits for you across all of them:\n \"claude mcp add sessions -- npx genaicode sessions mcp\". The agent you give it to reads what\n the other agents' sessions said. \"genaicode chat --sessions\" gives the same tools to the chat.\n\nHooks options:\n -a, --agent <name> Only this agent (claude, codex); default: both\n\n \"hooks install\" adds a hook to the agent's own user settings (~/.claude/settings.json,\n ~/.codex/hooks.json; Codex asks you to trust it under /hooks). The agent then tells genaicode\n when a session works, asks for approval or has finished its turn, so \"sessions\" and the\n browser's Sessions view show which ones need you. \"hooks uninstall\" takes it out again.\n\nChat and UI options:\n -a, --agent <name> Agent to start with (default: the first installed one)\n -C, --cwd <dir> Directory the agent works in (default: current directory)\n -m, --model <id> Model id passed to the agent CLI\n --effort <level> Reasoning effort, in the agent's own vocabulary\n -r, --resume <id> Continue this agent session\n --from <id> Take over a session of any agent in this directory (ids: \"genaicode\n sessions\"): its own agent resumes it, another one gets a handoff\n -y, --yes Approve every permission request the agent asks for\n --web (chat) Also open the session in the browser\n --port <n> Port for the browser UI, on 127.0.0.1 (default: a free port)\n --no-open (ui) Print the link instead of opening a browser\n --exit-with-stdin (ui) Stop when stdin closes, for apps that start the server\n --mcp <name=url> Give the agent this MCP server (streamable HTTP); repeatable.\n Only agents with MCP support (claude, codex, copilot, antigravity) take it\n --no-artifacts Do not give the agent the publish_artifact tool (pages, images and\n documents it shows in the chat)\n --sessions Give the agent the session index as tools (sessions_projects,\n sessions_list, sessions_read): ask it what is open or waits for you\n in every agent. It reads what those sessions said\n --max-tokens <n> Token budget for the whole session; prompts stop starting once it is used\n --max-cost <usd> Cost budget for the whole session, for agents that report cost\n --fallback <agents> Agents to switch to when the current one runs out (quota, sign-in,\n missing CLI, crash), e.g. --fallback codex,gemini. /fallback changes it\n\n Each prompt after the first continues the agent's session (claude, codex, cursor,\n opencode, copilot, antigravity). Prompts sent while the agent works wait in a queue. Type /help in\n the chat for commands. The terminal and the browser can show one session: /web in the\n chat opens it in the browser, and Enter in \"genaicode ui\" brings it into the terminal.\n\nRun options:\n -a, --agent <name> Agent to use (default: the first installed one, see \"agents\")\n -C, --cwd <dir> Directory the agent works in (default: current directory)\n -m, --model <id> Model id passed to the agent CLI\n --effort <level> Reasoning effort, in the agent's own vocabulary\n --max-turns <n> Turn limit, where the agent supports one\n -r, --resume <id> Continue the agent session with this id (printed after each run)\n --from <id> Continue a session of another agent: the agent gets a recap of it and\n the transcript to read (ids: \"genaicode sessions\")\n --timeout <sec> Stop the agent after this many seconds\n --verify <command> Shell command that checks the work; on failure its output goes\n back to the agent for another attempt\n --max-repairs <n> Repair attempts after a failed check (default 2)\n --max-tokens <n> Stop the agent past this many tokens (repairs included)\n --max-cost <usd> Stop the agent past this cost in US dollars, for agents that report cost\n --fallback <agents> Agents to run the task on when the agent runs out (quota, sign-in,\n missing CLI, crash), in order, e.g. --fallback codex,gemini\n --json Print agent events as JSON lines instead of text\n\nEmbed options:\n --print Print the agent's instructions instead of starting one\n --ui Follow the agent in the browser instead of this terminal\n -a, -C, -m, --effort, -y, --port, --no-open: as for chat and ui\n\n The agent reads the project and chooses how to wire genaicode in; [request] steers it,\n e.g. \"only the dev panel\". Without a terminal it runs headless like \"run\". The\n instructions also ship as a Claude Code skill: docs/skills/genaicode-embed/SKILL.md.\n\nACP options:\n -a, -m, --effort, -y: as for chat (the host can change agent, effort and approvals)\n\n For editors and other apps that speak ACP (https://agentclientprotocol.com): the app\n starts \"genaicode acp\", opens sessions in its own directories and sends prompts.\n\nThe agent uses its own login, billing, and permission defaults. GenAIcode adds no agent\nloop or sandbox of its own, and no prompts but embed's instructions.\nLibrary API: https://github.com/gtanczyk/genaicode#readme\n\nLooking for the legacy 1.x coding agent?\n Run it: npx genaicode@1\n Source: https://github.com/gtanczyk/genaicode/tree/1.x\n";
|
|
87
|
+
export declare const helpText = "genaicode: run the coding-agent CLIs installed on this machine behind one interface.\n\nUsage:\n genaicode Chat with an agent in this terminal (same as \"chat\")\n genaicode chat [options] Chat with an agent in this terminal\n genaicode ui [options] Chat with an agent in the browser (local server)\n genaicode agents [--json] List supported agents and whether each is installed\n genaicode sessions [options] List the sessions agents keep on this machine, by project\n genaicode sessions doctor Check that the agents' session stores still read as expected\n genaicode sessions mcp Serve the session index to an agent as MCP tools (stdio)\n genaicode sessions approve|deny <q> Answer a question a session asks (see \"hooks install --answer\")\n genaicode sessions archive <id...> Put sessions away (--stale: all left for 2 days or more)\n genaicode hooks [install|uninstall] Have agents report what their sessions do (default: status)\n genaicode notify [on|off|test] Desktop notification when a session asks for approval\n genaicode run [options] <prompt...> Run one task (reads the prompt from stdin if omitted)\n genaicode embed [options] [request] Have an agent add genaicode to the project here\n genaicode acp [options] Serve the Agent Client Protocol on stdin/stdout\n genaicode update [options] Update the installed genaicode command\n\nUpdate options (for the command scripts/install.sh installs; npx and npm -g update through npm):\n --check Only say whether a newer version is out\n --version <v> Install this version instead of the latest\n --auto on|off Check daily and update in the background (default: on)\n\nSessions options:\n -a, --agent <name> Only this agent's sessions\n --cloud Also Cursor Cloud Agents (needs CURSOR_API_KEY)\n -w, --waiting Only sessions waiting for you (approvals first), each with the\n command that continues it; the last 7 days unless --since says\n -C, --cwd <dir> Only sessions in this directory or below it\n --since <age> Only sessions active in the last 90m, 12h, 7d, 2w...\n -n, --limit <n> At most this many sessions, newest first (default 30)\n --json One JSON object per session\n --archived Also the sessions put away with \"sessions archive\"\n\n Each line ends with the session id: continue it with\n \"genaicode chat -a <agent> -C <dir> -r <id>\".\n\n \"sessions archive <id...>\" hides sessions you will not come back to; \"sessions archive --stale\"\n (--older 5d, -a) does it for every one waiting for you or left half way for 2 days or more.\n The agents' own files stay as they are, and a session with any news comes back by itself;\n \"sessions unarchive <id...>\" brings one back. Kept in ~/.genaicode/archived.json.\n\n \"sessions doctor\" (-a, --since, --json, --api) checks each store: how many sessions it lists, how\n many have a prompt and a directory, whether the newest conversations open, and whether the\n agent's CLI is newer than the one the reader was checked with. It prints counts, never what\n was said, and exits 1 when a store reads differently than expected. With --api it also asks\n the agents that can be asked (Codex's app server) and compares; that starts the agent's own\n process, which keeps its state and logs in its home.\n\n \"sessions mcp\" (-a) is an MCP server on stdio with the tools sessions_projects, sessions_list and\n sessions_read, so any agent can answer what is open and what waits for you across all of them:\n \"claude mcp add sessions -- npx genaicode sessions mcp\". The agent you give it to reads what\n the other agents' sessions said. \"genaicode chat --sessions\" gives the same tools to the chat.\n\nHooks options:\n -a, --agent <name> Only this agent (claude, codex, gemini, copilot, cursor); default: all installed\n --answer With \"install\" (Claude Code): questions can also be answered here\n\n \"hooks install\" adds a hook to the agent's own user settings (~/.claude/settings.json,\n ~/.codex/hooks.json, ~/.gemini/settings.json, ~/.cursor/hooks.json,\n ~/.copilot/hooks/genaicode.json; Codex asks you to trust it under /hooks). The agent then tells genaicode\n when a session works, asks for approval or has finished its turn, so \"sessions\" and the\n browser's Sessions view show which ones need you. \"hooks uninstall\" takes it out again.\n\n \"hooks install --answer\" also holds each approval question of Claude Code open for up to 9\n minutes: Claude Code shows its dialog as always, and \"sessions --waiting\" or the browser's\n Sessions view can answer it too (\"sessions approve <q>\", \"sessions deny <q> -m <why>\").\n Whichever answer comes first counts.\n\nNotify options:\n --done With \"on\": also when a session finishes its turn\n\n \"notify on\" has the hooks show a desktop notification (macOS Notification Center, notify-send\n on Linux) when a session asks for approval: the agent, the project's directory name and the\n tool, nothing of what was said. It needs \"genaicode hooks install\". \"notify test\" shows one now.\n\nChat and UI options:\n -a, --agent <name> Agent to start with (default: the first installed one)\n -C, --cwd <dir> Directory the agent works in (default: current directory)\n -m, --model <id> Model id passed to the agent CLI\n --effort <level> Reasoning effort, in the agent's own vocabulary\n -r, --resume <id> Continue this agent session\n --from <id> Take over a session of any agent in this directory (ids: \"genaicode\n sessions\"): its own agent resumes it, another one gets a handoff\n -y, --yes Approve every permission request the agent asks for\n --web (chat) Also open the session in the browser\n --port <n> Port for the browser UI, on 127.0.0.1 (default: a free port)\n --no-open (ui) Print the link instead of opening a browser\n --exit-with-stdin (ui) Stop when stdin closes, for apps that start the server\n --mcp <name=url> Give the agent this MCP server (streamable HTTP); repeatable.\n Only agents with MCP support (claude, codex, copilot, antigravity) take it\n --no-artifacts Do not give the agent the publish_artifact tool (pages, images and\n documents it shows in the chat)\n --sessions Give the agent the session index as tools (sessions_projects,\n sessions_list, sessions_read): ask it what is open or waits for you\n in every agent. It reads what those sessions said\n --max-tokens <n> Token budget for the whole session; prompts stop starting once it is used\n --max-cost <usd> Cost budget for the whole session, for agents that report cost\n --fallback <agents> Agents to switch to when the current one runs out (quota, sign-in,\n missing CLI, crash), e.g. --fallback codex,gemini. /fallback changes it\n\n Each prompt after the first continues the agent's session (claude, codex, cursor,\n opencode, copilot, antigravity). Prompts sent while the agent works wait in a queue. Type /help in\n the chat for commands. The terminal and the browser can show one session: /web in the\n chat opens it in the browser, and Enter in \"genaicode ui\" brings it into the terminal.\n\nRun options:\n -a, --agent <name> Agent to use (default: the first installed one, see \"agents\")\n -C, --cwd <dir> Directory the agent works in (default: current directory)\n -m, --model <id> Model id passed to the agent CLI\n --effort <level> Reasoning effort, in the agent's own vocabulary\n --max-turns <n> Turn limit, where the agent supports one\n -r, --resume <id> Continue the agent session with this id (printed after each run)\n --from <id> Continue a session of another agent: the agent gets a recap of it and\n the transcript to read (ids: \"genaicode sessions\")\n --timeout <sec> Stop the agent after this many seconds\n --verify <command> Shell command that checks the work; on failure its output goes\n back to the agent for another attempt\n --max-repairs <n> Repair attempts after a failed check (default 2)\n --max-tokens <n> Stop the agent past this many tokens (repairs included)\n --max-cost <usd> Stop the agent past this cost in US dollars, for agents that report cost\n --fallback <agents> Agents to run the task on when the agent runs out (quota, sign-in,\n missing CLI, crash), in order, e.g. --fallback codex,gemini\n --json Print agent events as JSON lines instead of text\n\nEmbed options:\n --print Print the agent's instructions instead of starting one\n --ui Follow the agent in the browser instead of this terminal\n -a, -C, -m, --effort, -y, --port, --no-open: as for chat and ui\n\n The agent reads the project and chooses how to wire genaicode in; [request] steers it,\n e.g. \"only the dev panel\". Without a terminal it runs headless like \"run\". The\n instructions also ship as a Claude Code skill: docs/skills/genaicode-embed/SKILL.md.\n\nACP options:\n -a, -m, --effort, -y: as for chat (the host can change agent, effort and approvals)\n\n For editors and other apps that speak ACP (https://agentclientprotocol.com): the app\n starts \"genaicode acp\", opens sessions in its own directories and sends prompts.\n\nThe agent uses its own login, billing, and permission defaults. GenAIcode adds no agent\nloop or sandbox of its own, and no prompts but embed's instructions.\nLibrary API: https://github.com/gtanczyk/genaicode#readme\n\nLooking for the legacy 1.x coding agent?\n Run it: npx genaicode@1\n Source: https://github.com/gtanczyk/genaicode/tree/1.x\n";
|
|
85
88
|
/** Run the CLI and return its exit code. */
|
|
86
89
|
export declare function main(cli: CliEnvironment): Promise<number>;
|
package/dist/cli/main.js
CHANGED
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
import { spawn } from 'node:child_process';
|
|
2
|
+
import { promises as fs } from 'node:fs';
|
|
2
3
|
import { createRequire } from 'node:module';
|
|
3
4
|
import { dirname, resolve } from 'node:path';
|
|
4
5
|
import { detectAgents } from '../agents/discovery.js';
|
|
5
6
|
import { withFallback } from '../agents/failover.js';
|
|
6
7
|
import { runWithVerify } from '../agents/verify.js';
|
|
7
8
|
import { defaultAgents } from '../agents/defaults.js';
|
|
8
|
-
import { ago } from '../ui/sessions.js';
|
|
9
|
+
import { ago, resumeCommand } from '../ui/sessions.js';
|
|
9
10
|
import { cursorCloud } from '../agents/drivers/cursor-cloud.js';
|
|
10
|
-
import { agentSessionSources, checkSessions, cliVersion, findSession, groupSessions, HOOK_AGENTS, hooksFile, hooksStatus, installHooks, liveDir, readLive, uninstallHooks, listSessions, readSession, } from '../agents/sessions/index.js';
|
|
11
|
-
import { serveMcpStdio, sessionTools } from '../agents/sessions/tools.js';
|
|
11
|
+
import { agentSessionSources, checkSessions, cliVersion, findSession, groupSessions, waitingSessions, HOOK_AGENTS, hooksFile, hooksStatus, installHooks, liveDir, readLive, uninstallHooks, listSessions, readSession, } from '../agents/sessions/index.js';
|
|
12
|
+
import { serveMcpStdio, SESSION_TOOLS_INSTRUCTIONS, sessionTools } from '../agents/sessions/tools.js';
|
|
13
|
+
import { answerAsk, pendingAsks } from '../agents/sessions/answer.js';
|
|
14
|
+
import { ANSWER_AGENTS } from '../agents/sessions/hooks.js';
|
|
15
|
+
import { archiveSessions, readArchive, STALE_MS, staleSessions } from '../agents/sessions/archive.js';
|
|
12
16
|
import { startLocalMcpServer } from '../agents/mcp-server.js';
|
|
17
|
+
import { notifyFile, readNotify, sendNotice, writeNotify, } from '../agents/sessions/notify.js';
|
|
13
18
|
import { HANDOFF_DIR, handoffPreamble, writeHandoff } from '../agents/handoff.js';
|
|
14
|
-
import { isWithin } from '../agents/sessions/files.js';
|
|
19
|
+
import { isWithin, oneLine } from '../agents/sessions/files.js';
|
|
15
20
|
import { serveAcp } from '../acp/server.js';
|
|
16
21
|
import { parseCli, UsageError } from './args.js';
|
|
17
22
|
import { embedPrompt, embedRequest, readEmbedInstructions } from './embed.js';
|
|
@@ -31,7 +36,10 @@ Usage:
|
|
|
31
36
|
genaicode sessions [options] List the sessions agents keep on this machine, by project
|
|
32
37
|
genaicode sessions doctor Check that the agents' session stores still read as expected
|
|
33
38
|
genaicode sessions mcp Serve the session index to an agent as MCP tools (stdio)
|
|
39
|
+
genaicode sessions approve|deny <q> Answer a question a session asks (see "hooks install --answer")
|
|
40
|
+
genaicode sessions archive <id...> Put sessions away (--stale: all left for 2 days or more)
|
|
34
41
|
genaicode hooks [install|uninstall] Have agents report what their sessions do (default: status)
|
|
42
|
+
genaicode notify [on|off|test] Desktop notification when a session asks for approval
|
|
35
43
|
genaicode run [options] <prompt...> Run one task (reads the prompt from stdin if omitted)
|
|
36
44
|
genaicode embed [options] [request] Have an agent add genaicode to the project here
|
|
37
45
|
genaicode acp [options] Serve the Agent Client Protocol on stdin/stdout
|
|
@@ -45,14 +53,22 @@ Update options (for the command scripts/install.sh installs; npx and npm -g upda
|
|
|
45
53
|
Sessions options:
|
|
46
54
|
-a, --agent <name> Only this agent's sessions
|
|
47
55
|
--cloud Also Cursor Cloud Agents (needs CURSOR_API_KEY)
|
|
56
|
+
-w, --waiting Only sessions waiting for you (approvals first), each with the
|
|
57
|
+
command that continues it; the last 7 days unless --since says
|
|
48
58
|
-C, --cwd <dir> Only sessions in this directory or below it
|
|
49
59
|
--since <age> Only sessions active in the last 90m, 12h, 7d, 2w...
|
|
50
60
|
-n, --limit <n> At most this many sessions, newest first (default 30)
|
|
51
61
|
--json One JSON object per session
|
|
62
|
+
--archived Also the sessions put away with "sessions archive"
|
|
52
63
|
|
|
53
64
|
Each line ends with the session id: continue it with
|
|
54
65
|
"genaicode chat -a <agent> -C <dir> -r <id>".
|
|
55
66
|
|
|
67
|
+
"sessions archive <id...>" hides sessions you will not come back to; "sessions archive --stale"
|
|
68
|
+
(--older 5d, -a) does it for every one waiting for you or left half way for 2 days or more.
|
|
69
|
+
The agents' own files stay as they are, and a session with any news comes back by itself;
|
|
70
|
+
"sessions unarchive <id...>" brings one back. Kept in ~/.genaicode/archived.json.
|
|
71
|
+
|
|
56
72
|
"sessions doctor" (-a, --since, --json, --api) checks each store: how many sessions it lists, how
|
|
57
73
|
many have a prompt and a directory, whether the newest conversations open, and whether the
|
|
58
74
|
agent's CLI is newer than the one the reader was checked with. It prints counts, never what
|
|
@@ -66,13 +82,27 @@ Sessions options:
|
|
|
66
82
|
the other agents' sessions said. "genaicode chat --sessions" gives the same tools to the chat.
|
|
67
83
|
|
|
68
84
|
Hooks options:
|
|
69
|
-
-a, --agent <name> Only this agent (claude, codex); default:
|
|
85
|
+
-a, --agent <name> Only this agent (claude, codex, gemini, copilot, cursor); default: all installed
|
|
86
|
+
--answer With "install" (Claude Code): questions can also be answered here
|
|
70
87
|
|
|
71
88
|
"hooks install" adds a hook to the agent's own user settings (~/.claude/settings.json,
|
|
72
|
-
~/.codex/hooks.json
|
|
89
|
+
~/.codex/hooks.json, ~/.gemini/settings.json, ~/.cursor/hooks.json,
|
|
90
|
+
~/.copilot/hooks/genaicode.json; Codex asks you to trust it under /hooks). The agent then tells genaicode
|
|
73
91
|
when a session works, asks for approval or has finished its turn, so "sessions" and the
|
|
74
92
|
browser's Sessions view show which ones need you. "hooks uninstall" takes it out again.
|
|
75
93
|
|
|
94
|
+
"hooks install --answer" also holds each approval question of Claude Code open for up to 9
|
|
95
|
+
minutes: Claude Code shows its dialog as always, and "sessions --waiting" or the browser's
|
|
96
|
+
Sessions view can answer it too ("sessions approve <q>", "sessions deny <q> -m <why>").
|
|
97
|
+
Whichever answer comes first counts.
|
|
98
|
+
|
|
99
|
+
Notify options:
|
|
100
|
+
--done With "on": also when a session finishes its turn
|
|
101
|
+
|
|
102
|
+
"notify on" has the hooks show a desktop notification (macOS Notification Center, notify-send
|
|
103
|
+
on Linux) when a session asks for approval: the agent, the project's directory name and the
|
|
104
|
+
tool, nothing of what was said. It needs "genaicode hooks install". "notify test" shows one now.
|
|
105
|
+
|
|
76
106
|
Chat and UI options:
|
|
77
107
|
-a, --agent <name> Agent to start with (default: the first installed one)
|
|
78
108
|
-C, --cwd <dir> Directory the agent works in (default: current directory)
|
|
@@ -193,6 +223,12 @@ function dispatch(cli, command, agents, updater) {
|
|
|
193
223
|
return serveSessions(cli, agents, command);
|
|
194
224
|
case 'hooks':
|
|
195
225
|
return manageHooks(cli, command, updater);
|
|
226
|
+
case 'notify':
|
|
227
|
+
return manageNotify(cli, command);
|
|
228
|
+
case 'answer':
|
|
229
|
+
return answerQuestion(cli, command);
|
|
230
|
+
case 'archive':
|
|
231
|
+
return archiveCommand(cli, agents, command);
|
|
196
232
|
case 'run':
|
|
197
233
|
return runTask(cli, agents, command);
|
|
198
234
|
case 'chat':
|
|
@@ -353,6 +389,7 @@ async function runUi(cli, agents, options, extra = {}) {
|
|
|
353
389
|
? await startLocalMcpServer({
|
|
354
390
|
name: 'sessions',
|
|
355
391
|
tools: sessionTools(indexed, { env: cli.env }),
|
|
392
|
+
instructions: SESSION_TOOLS_INSTRUCTIONS,
|
|
356
393
|
})
|
|
357
394
|
: undefined;
|
|
358
395
|
const mcpServers = [...options.mcpServers, ...(index ? [index.mcpServer] : [])];
|
|
@@ -414,6 +451,72 @@ function loadBundledUi() {
|
|
|
414
451
|
return import(bundle);
|
|
415
452
|
}
|
|
416
453
|
const STATE_MARK = { active: '●', waiting: '○', unfinished: '◌', approval: '◆' };
|
|
454
|
+
const WAITING_SINCE_MS = 7 * 24 * 60 * 60 * 1000;
|
|
455
|
+
/** `sessions --waiting`: one line per session that waits for you, approvals first, with the command that continues it. */
|
|
456
|
+
function showWaiting(cli, sessions, now, sinceMs, questions = []) {
|
|
457
|
+
const period = sinceMs === undefined ? '' : ` in the last ${ago(sinceMs)}`;
|
|
458
|
+
if (!sessions.length) {
|
|
459
|
+
cli.stdout.write(`Nothing waits for you${period}.\n`);
|
|
460
|
+
return EXIT_OK;
|
|
461
|
+
}
|
|
462
|
+
const asks = sessions.filter((session) => session.waitingFor === 'approval').length;
|
|
463
|
+
cli.stdout.write(`${sessions.length} session${sessions.length === 1 ? '' : 's'} wait${sessions.length === 1 ? 's' : ''} for you${period}${asks ? `, ${asks} for approval` : ''}:\n`);
|
|
464
|
+
for (const session of sessions) {
|
|
465
|
+
const place = session.cwd ?? session.repository ?? '';
|
|
466
|
+
const project = place.split(/[\\/]/).filter(Boolean).pop() ?? place;
|
|
467
|
+
const label = session.title ?? session.lastPrompt ?? session.firstPrompt ?? '(no prompt)';
|
|
468
|
+
const text = label.length > 60 ? `${label.slice(0, 59)}…` : label;
|
|
469
|
+
const what = session.waitingFor === 'approval'
|
|
470
|
+
? `asks to use ${session.waitingTool ?? 'a tool'}`
|
|
471
|
+
: session.lastReply
|
|
472
|
+
? `said: ${oneLine(session.lastReply, 80)}`
|
|
473
|
+
: 'your turn';
|
|
474
|
+
const resume = resumeCommand(session);
|
|
475
|
+
// Questions held open for the tower: what the tool would do, and how to answer.
|
|
476
|
+
const open = questions
|
|
477
|
+
.filter((ask) => ask.agent === session.agent && ask.session === session.id)
|
|
478
|
+
.map((ask) => ` ? ${ask.tool ?? 'a tool'}${ask.preview ? `: ${oneLine(ask.preview, 100)}` : ''}\n` +
|
|
479
|
+
` genaicode sessions approve ${ask.id} (or: sessions deny ${ask.id} -m <why>)\n`)
|
|
480
|
+
.join('');
|
|
481
|
+
cli.stdout.write(`\n${session.waitingFor === 'approval' ? '◆' : '○'} ${project || '(no directory)'} ${session.agent} ${ago(now - session.updatedAt)} ago\n ${text}\n ${what}\n${open}${resume ? ` ${resume}\n` : ''}`);
|
|
482
|
+
}
|
|
483
|
+
return EXIT_OK;
|
|
484
|
+
}
|
|
485
|
+
async function answerQuestion(cli, command) {
|
|
486
|
+
const decision = command.behavior === 'allow'
|
|
487
|
+
? { behavior: 'allow' }
|
|
488
|
+
: { behavior: 'deny', ...(command.message !== undefined ? { message: command.message } : {}) };
|
|
489
|
+
if (!(await answerAsk(command.id, decision, cli.env))) {
|
|
490
|
+
cli.stderr.write(`No open question ${command.id}: it was answered already or its session moved on. See "genaicode sessions --waiting".\n`);
|
|
491
|
+
return EXIT_FAILED;
|
|
492
|
+
}
|
|
493
|
+
cli.stdout.write(`${command.behavior === 'allow' ? 'Approved' : 'Denied'}.\n`);
|
|
494
|
+
return EXIT_OK;
|
|
495
|
+
}
|
|
496
|
+
async function manageNotify(cli, command) {
|
|
497
|
+
const describe = (settings) => settings.approval ? `on: when a session asks for approval${settings.done ? ' or finishes its turn' : ''}` : 'off';
|
|
498
|
+
if (command.action === 'test') {
|
|
499
|
+
const shown = (cli.notify ?? sendNotice)({ title: 'genaicode', body: 'Notifications work.' });
|
|
500
|
+
if (!shown) {
|
|
501
|
+
cli.stderr.write(`No desktop notifications on ${process.platform} yet (macOS and Linux only).\n`);
|
|
502
|
+
return EXIT_FAILED;
|
|
503
|
+
}
|
|
504
|
+
cli.stdout.write('Sent a test notification.\n');
|
|
505
|
+
return EXIT_OK;
|
|
506
|
+
}
|
|
507
|
+
if (command.action !== 'status') {
|
|
508
|
+
await writeNotify({ approval: command.action === 'on', done: command.action === 'on' && command.done }, cli.env);
|
|
509
|
+
}
|
|
510
|
+
const settings = await readNotify(cli.env);
|
|
511
|
+
cli.stdout.write(`Notifications ${describe(settings)} ${notifyFile(cli.env)}\n`);
|
|
512
|
+
if (settings.approval) {
|
|
513
|
+
const statuses = await Promise.all(HOOK_AGENTS.map((agent) => hooksStatus(agent, { env: cli.env }).catch(() => undefined)));
|
|
514
|
+
if (!statuses.some((status) => status?.events.length)) {
|
|
515
|
+
cli.stdout.write('No agent reports to genaicode yet: run "genaicode hooks install" for the notifications.\n');
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
return EXIT_OK;
|
|
519
|
+
}
|
|
417
520
|
async function manageHooks(cli, command, updater) {
|
|
418
521
|
const known = HOOK_AGENTS;
|
|
419
522
|
if (command.agent !== undefined && !known.includes(command.agent)) {
|
|
@@ -432,13 +535,21 @@ async function manageHooks(cli, command, updater) {
|
|
|
432
535
|
for (const agent of chosen) {
|
|
433
536
|
try {
|
|
434
537
|
if (command.action === 'install') {
|
|
435
|
-
// Asked for by name, an agent gets its hooks even when its CLI is not found.
|
|
436
|
-
if (
|
|
437
|
-
|
|
438
|
-
|
|
538
|
+
// Asked for by name, an agent gets its hooks even when its CLI is not found: said so.
|
|
539
|
+
if (!installedHere.get(agent)) {
|
|
540
|
+
if (command.agent === undefined) {
|
|
541
|
+
cli.stdout.write(`${agent}: not installed, skipped\n`);
|
|
542
|
+
continue;
|
|
543
|
+
}
|
|
544
|
+
cli.stdout.write(`${agent}: its CLI is not found here; the hooks run once it is installed.\n`);
|
|
439
545
|
}
|
|
440
|
-
const
|
|
546
|
+
const answer = command.answer === true && ANSWER_AGENTS.includes(agent);
|
|
547
|
+
const status = await installHooks(agent, { ...hookOptions, ...(answer ? { answer } : {}) });
|
|
441
548
|
cli.stdout.write(`${agent}: hook added to ${status.file} (${status.events.join(', ')})\n`);
|
|
549
|
+
if (answer)
|
|
550
|
+
cli.stdout.write(' Questions can also be answered with "genaicode sessions approve|deny".\n');
|
|
551
|
+
else if (command.answer)
|
|
552
|
+
cli.stdout.write(` --answer: not for ${agent}, its approvals stay in ${agent}.\n`);
|
|
442
553
|
if (agent === 'codex')
|
|
443
554
|
cli.stdout.write(' Codex runs it once you trust it: open Codex and use /hooks.\n');
|
|
444
555
|
}
|
|
@@ -453,7 +564,7 @@ async function manageHooks(cli, command, updater) {
|
|
|
453
564
|
: status.events.length
|
|
454
565
|
? 'installed by another genaicode or incomplete: run "genaicode hooks install"'
|
|
455
566
|
: 'not installed';
|
|
456
|
-
cli.stdout.write(`${agent}: ${state} ${status.file}\n`);
|
|
567
|
+
cli.stdout.write(`${agent}: ${state}${status.answer ? ', answers from here' : ''} ${status.file}\n`);
|
|
457
568
|
}
|
|
458
569
|
}
|
|
459
570
|
catch (error) {
|
|
@@ -463,7 +574,13 @@ async function manageHooks(cli, command, updater) {
|
|
|
463
574
|
}
|
|
464
575
|
if (command.action === 'status') {
|
|
465
576
|
const live = await readLive(cli.env);
|
|
466
|
-
|
|
577
|
+
// Ended ones are kept a while too, but are not open.
|
|
578
|
+
const all = await fs
|
|
579
|
+
.readdir(liveDir(cli.env))
|
|
580
|
+
.then((names) => names.filter((name) => name.endsWith('.json')).length)
|
|
581
|
+
.catch(() => 0);
|
|
582
|
+
const ended = Math.max(0, all - live.size);
|
|
583
|
+
cli.stdout.write(`${live.size} open session${live.size === 1 ? '' : 's'}${ended ? ` (and ${ended} ended)` : ''} reported in ${liveDir(cli.env)}\n`);
|
|
467
584
|
}
|
|
468
585
|
return failed ? EXIT_FAILED : EXIT_OK;
|
|
469
586
|
}
|
|
@@ -483,22 +600,40 @@ async function showSessions(cli, agents, command) {
|
|
|
483
600
|
return EXIT_USAGE;
|
|
484
601
|
}
|
|
485
602
|
const now = Date.now();
|
|
486
|
-
|
|
487
|
-
|
|
603
|
+
// What waits is picked from everything listed, so the limit comes after; a week back by default.
|
|
604
|
+
const sinceMs = command.sinceMs ?? (command.waiting ? WAITING_SINCE_MS : undefined);
|
|
605
|
+
// Archived sessions may take places in the listing: as many more are read, and left out after.
|
|
606
|
+
const extra = command.archived || command.waiting ? 0 : (await readArchive(cli.env)).size;
|
|
607
|
+
const listing = await listSessions(sources, {
|
|
608
|
+
...(command.waiting ? {} : { limit: command.limit + extra }),
|
|
488
609
|
env: cli.env,
|
|
489
610
|
...(command.cwd !== undefined ? { cwd: resolve(cli.cwd, command.cwd) } : {}),
|
|
490
|
-
...(
|
|
611
|
+
...(sinceMs !== undefined ? { since: now - sinceMs } : {}),
|
|
491
612
|
...(cli.signal ? { signal: cli.signal } : {}),
|
|
492
613
|
});
|
|
614
|
+
const { errors } = listing;
|
|
615
|
+
// Archived sessions stay out unless asked for.
|
|
616
|
+
const listed = command.archived ? listing.sessions : listing.sessions.filter((session) => !session.archived);
|
|
617
|
+
const hidden = listing.sessions.length - listed.length;
|
|
618
|
+
const sessions = (command.waiting ? waitingSessions(listed) : listed).slice(0, command.limit);
|
|
493
619
|
for (const error of errors)
|
|
494
620
|
cli.stderr.write(`${error.source}: ${error.message}\n`);
|
|
621
|
+
const questions = command.waiting ? await pendingAsks(cli.env) : [];
|
|
495
622
|
if (command.json) {
|
|
496
|
-
for (const session of sessions)
|
|
497
|
-
|
|
623
|
+
for (const session of sessions) {
|
|
624
|
+
// `--waiting`: with the questions it holds open for the tower (`hooks install --answer`).
|
|
625
|
+
const asks = questions
|
|
626
|
+
.filter((ask) => ask.agent === session.agent && ask.session === session.id)
|
|
627
|
+
.map(({ id, tool, preview, at }) => ({ id, ...(tool ? { tool } : {}), ...(preview ? { preview } : {}), at }));
|
|
628
|
+
cli.stdout.write(`${JSON.stringify(asks.length ? { ...session, asks } : session)}\n`);
|
|
629
|
+
}
|
|
498
630
|
return EXIT_OK;
|
|
499
631
|
}
|
|
632
|
+
if (command.waiting)
|
|
633
|
+
return showWaiting(cli, sessions, now, sinceMs, questions);
|
|
634
|
+
const archivedNote = hidden ? `${hidden} archived not shown: --archived shows them.\n` : '';
|
|
500
635
|
if (!sessions.length) {
|
|
501
|
-
cli.stdout.write(
|
|
636
|
+
cli.stdout.write(`No sessions found.\n${archivedNote}`);
|
|
502
637
|
return EXIT_OK;
|
|
503
638
|
}
|
|
504
639
|
for (const project of groupSessions(sessions)) {
|
|
@@ -510,11 +645,71 @@ async function showSessions(cli, agents, command) {
|
|
|
510
645
|
const label = session.title ?? session.lastPrompt ?? session.lastReply ?? '(no prompt)';
|
|
511
646
|
const text = label.length > 70 ? `${label.slice(0, 69)}…` : label;
|
|
512
647
|
// A session that asks for approval stands out from one that just finished its turn.
|
|
513
|
-
const state = session.
|
|
648
|
+
const state = session.archived
|
|
649
|
+
? 'archived'
|
|
650
|
+
: session.waitingFor === 'approval'
|
|
651
|
+
? 'approval'
|
|
652
|
+
: (session.state ?? '');
|
|
514
653
|
cli.stdout.write(` ${STATE_MARK[state] ?? ' '} ${session.agent.padEnd(7)} ${ago(now - session.updatedAt).padStart(4)} ${state.padEnd(10)} ${text} ${session.id}\n`);
|
|
515
654
|
}
|
|
516
655
|
}
|
|
517
656
|
cli.stdout.write('\n● active ◆ asks for approval ○ waiting for you ◌ unfinished\n');
|
|
657
|
+
if (archivedNote)
|
|
658
|
+
cli.stdout.write(archivedNote);
|
|
659
|
+
else if (staleSessions(sessions, STALE_MS, now).length) {
|
|
660
|
+
cli.stdout.write('Put away the ones left for days with "genaicode sessions archive --stale".\n');
|
|
661
|
+
}
|
|
662
|
+
return EXIT_OK;
|
|
663
|
+
}
|
|
664
|
+
/** `sessions archive|unarchive`: put sessions away in genaicode, or bring them back. Their stores stay as they are. */
|
|
665
|
+
async function archiveCommand(cli, agents, command) {
|
|
666
|
+
const sources = agentSessionSources(agents.filter((agent) => command.agent === undefined || agent.name === command.agent));
|
|
667
|
+
if (!sources.length) {
|
|
668
|
+
cli.stderr.write(`No session store for agent "${command.agent}".\n`);
|
|
669
|
+
return EXIT_USAGE;
|
|
670
|
+
}
|
|
671
|
+
const now = Date.now();
|
|
672
|
+
const query = { env: cli.env, ...(cli.signal ? { signal: cli.signal } : {}) };
|
|
673
|
+
if (command.stale) {
|
|
674
|
+
const olderMs = command.olderMs ?? STALE_MS;
|
|
675
|
+
const listing = await listSessions(sources, query);
|
|
676
|
+
for (const error of listing.errors)
|
|
677
|
+
cli.stderr.write(`${error.source}: ${error.message}\n`);
|
|
678
|
+
const stale = staleSessions(listing.sessions, olderMs, now);
|
|
679
|
+
if (!stale.length) {
|
|
680
|
+
cli.stdout.write(`No session left for ${ago(olderMs)} or more.\n`);
|
|
681
|
+
return EXIT_OK;
|
|
682
|
+
}
|
|
683
|
+
await archiveSessions(stale, true, { env: cli.env, now });
|
|
684
|
+
cli.stdout.write(`Archived ${stale.length} session${stale.length === 1 ? '' : 's'} left for ${ago(olderMs)} or more:\n`);
|
|
685
|
+
for (const session of stale) {
|
|
686
|
+
const label = session.title ?? session.lastPrompt ?? session.firstPrompt ?? '(no prompt)';
|
|
687
|
+
const place = session.cwd ?? '';
|
|
688
|
+
const project = place.split(/[\\/]/).filter(Boolean).pop() ?? place;
|
|
689
|
+
cli.stdout.write(` ${project || '(no directory)'} ${session.agent} ${ago(now - session.updatedAt)} ago ${oneLine(label, 60)} ${session.id}\n`);
|
|
690
|
+
}
|
|
691
|
+
cli.stdout.write('Bring one back with "genaicode sessions unarchive <id>"; any news in it brings it back too.\n');
|
|
692
|
+
return EXIT_OK;
|
|
693
|
+
}
|
|
694
|
+
const found = [];
|
|
695
|
+
for (const id of command.ids) {
|
|
696
|
+
let match;
|
|
697
|
+
try {
|
|
698
|
+
match = (await findSession(sources, id, query))?.session;
|
|
699
|
+
}
|
|
700
|
+
catch (error) {
|
|
701
|
+
cli.stderr.write(`${error instanceof Error ? error.message : String(error)}\n`);
|
|
702
|
+
return EXIT_USAGE;
|
|
703
|
+
}
|
|
704
|
+
if (!match) {
|
|
705
|
+
cli.stderr.write(`No session "${id}". Ids are at the end of each line of "genaicode sessions".\n`);
|
|
706
|
+
return EXIT_FAILED;
|
|
707
|
+
}
|
|
708
|
+
found.push(match);
|
|
709
|
+
}
|
|
710
|
+
const changed = await archiveSessions(found, command.archived, { env: cli.env, now });
|
|
711
|
+
const verb = command.archived ? 'Archived' : 'Brought back';
|
|
712
|
+
cli.stdout.write(`${verb} ${changed} session${changed === 1 ? '' : 's'}.\n`);
|
|
518
713
|
return EXIT_OK;
|
|
519
714
|
}
|
|
520
715
|
/** `sessions doctor`: counts per store, and what looks broken. Nothing of what was said. */
|