sessionpipe-core 0.7.0 → 0.10.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 (73) hide show
  1. package/README.md +1 -1
  2. package/dist/control.js +172 -12
  3. package/dist/control.js.map +2 -2
  4. package/dist/index.js +1508 -431
  5. package/dist/index.js.map +4 -4
  6. package/dist/schema/v1.d.ts +405 -104
  7. package/dist/schema/v1.d.ts.map +1 -1
  8. package/dist/schema.js +174 -28
  9. package/dist/schema.js.map +2 -2
  10. package/dist/service.js +155 -0
  11. package/dist/service.js.map +7 -0
  12. package/dist/src/adapters/acp-control.d.ts +87 -0
  13. package/dist/src/adapters/acp-control.d.ts.map +1 -0
  14. package/dist/src/adapters/antigravity-control.d.ts +15 -5
  15. package/dist/src/adapters/antigravity-control.d.ts.map +1 -1
  16. package/dist/src/adapters/antigravity.d.ts +1 -2
  17. package/dist/src/adapters/antigravity.d.ts.map +1 -1
  18. package/dist/src/adapters/claude-code-control.d.ts +41 -4
  19. package/dist/src/adapters/claude-code-control.d.ts.map +1 -1
  20. package/dist/src/adapters/claude-code.d.ts +10 -0
  21. package/dist/src/adapters/claude-code.d.ts.map +1 -1
  22. package/dist/src/adapters/claude-shaped.d.ts.map +1 -1
  23. package/dist/src/adapters/codex-config.d.ts +2 -2
  24. package/dist/src/adapters/codex-config.d.ts.map +1 -1
  25. package/dist/src/adapters/codex-control.d.ts +23 -7
  26. package/dist/src/adapters/codex-control.d.ts.map +1 -1
  27. package/dist/src/adapters/codex-rollout.d.ts +8 -0
  28. package/dist/src/adapters/codex-rollout.d.ts.map +1 -0
  29. package/dist/src/adapters/codex.d.ts +1 -1
  30. package/dist/src/adapters/codex.d.ts.map +1 -1
  31. package/dist/src/adapters/devin.d.ts +32 -0
  32. package/dist/src/adapters/devin.d.ts.map +1 -0
  33. package/dist/src/adapters/gemini-cli.d.ts.map +1 -1
  34. package/dist/src/adapters/headless.d.ts +4 -1
  35. package/dist/src/adapters/headless.d.ts.map +1 -1
  36. package/dist/src/adapters/index.d.ts +11 -3
  37. package/dist/src/adapters/index.d.ts.map +1 -1
  38. package/dist/src/adapters/types.d.ts +9 -1
  39. package/dist/src/adapters/types.d.ts.map +1 -1
  40. package/dist/src/control/verify.d.ts +96 -13
  41. package/dist/src/control/verify.d.ts.map +1 -1
  42. package/dist/src/index.d.ts +4 -2
  43. package/dist/src/index.d.ts.map +1 -1
  44. package/dist/src/launched-by.d.ts +12 -0
  45. package/dist/src/launched-by.d.ts.map +1 -0
  46. package/dist/src/outbox.d.ts +13 -2
  47. package/dist/src/outbox.d.ts.map +1 -1
  48. package/dist/src/paths.d.ts +7 -1
  49. package/dist/src/paths.d.ts.map +1 -1
  50. package/dist/src/privacy/filter.d.ts +2 -0
  51. package/dist/src/privacy/filter.d.ts.map +1 -1
  52. package/dist/src/privacy/index.d.ts +1 -1
  53. package/dist/src/privacy/index.d.ts.map +1 -1
  54. package/dist/src/readers/files.d.ts.map +1 -1
  55. package/dist/src/readers/git.d.ts.map +1 -1
  56. package/dist/src/readers/sqlite.d.ts +23 -0
  57. package/dist/src/readers/sqlite.d.ts.map +1 -0
  58. package/dist/src/readers/transcripts.d.ts +5 -2
  59. package/dist/src/readers/transcripts.d.ts.map +1 -1
  60. package/dist/src/service/index.d.ts +83 -0
  61. package/dist/src/service/index.d.ts.map +1 -0
  62. package/dist/src/short-id.d.ts +2 -0
  63. package/dist/src/short-id.d.ts.map +1 -0
  64. package/dist/src/sinks/file.d.ts.map +1 -1
  65. package/dist/src/sinks/stdout.d.ts.map +1 -1
  66. package/dist/src/types.d.ts +1 -0
  67. package/dist/src/types.d.ts.map +1 -1
  68. package/dist/src/ulid.d.ts.map +1 -1
  69. package/dist/src/version.d.ts +39 -0
  70. package/dist/src/version.d.ts.map +1 -0
  71. package/dist/version.js +75 -0
  72. package/dist/version.js.map +7 -0
  73. package/package.json +11 -3
@@ -0,0 +1,155 @@
1
+ // sessionpipe-core 0.10.0 · Apache-2.0 · https://sessionpipe.org
2
+
3
+ // src/service/index.ts
4
+ import { execFileSync } from "node:child_process";
5
+ import { existsSync, mkdirSync, unlinkSync, writeFileSync } from "node:fs";
6
+ import os from "node:os";
7
+ import path from "node:path";
8
+ var execQuiet = (cmd, args) => execFileSync(cmd, args, { encoding: "utf8", stdio: ["ignore", "pipe", "ignore"], timeout: 15e3 });
9
+ var xml = (s) => s.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
10
+ var sd = (s) => `"${s.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/%/g, "%%")}"`;
11
+ function serviceFiles(s) {
12
+ const home = s.home ?? os.homedir();
13
+ const env = (manager) => ({ SESSIONPIPE_SERVICE: manager, ...s.env });
14
+ const plistEnv = Object.entries(env("launchd")).map(([k, v]) => `<key>${xml(k)}</key><string>${xml(v)}</string>`).join("");
15
+ const plist = `<?xml version="1.0" encoding="UTF-8"?>
16
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
17
+ <plist version="1.0">
18
+ <dict>
19
+ <key>Label</key><string>${xml(s.label)}</string>
20
+ <key>ProgramArguments</key>
21
+ <array>${s.argv.map((a) => `<string>${xml(a)}</string>`).join("")}</array>
22
+ <key>EnvironmentVariables</key><dict>${plistEnv}</dict>
23
+ <key>RunAtLoad</key><true/>
24
+ <key>KeepAlive</key><dict><key>SuccessfulExit</key><false/></dict>
25
+ <key>ProcessType</key><string>Background</string>
26
+ <key>StandardOutPath</key><string>${xml(s.logPath)}</string>
27
+ <key>StandardErrorPath</key><string>${xml(s.logPath)}</string>
28
+ </dict>
29
+ </plist>
30
+ `;
31
+ const unitEnv = Object.entries(env("systemd")).map(([k, v]) => `Environment=${k === "SESSIONPIPE_SERVICE" ? `${k}=${v}` : sd(`${k}=${v}`)}`).join("\n");
32
+ const unit = `[Unit]
33
+ Description=${s.description.replace(/\n/g, " ")}
34
+ After=network-online.target
35
+
36
+ [Service]
37
+ ExecStart=${s.argv.map(sd).join(" ")}
38
+ ${unitEnv}
39
+ Restart=on-failure
40
+ RestartForceExitStatus=75
41
+ RestartSec=5
42
+
43
+ [Install]
44
+ WantedBy=default.target
45
+ `;
46
+ return {
47
+ plist: { path: path.join(home, "Library", "LaunchAgents", `${s.label}.plist`), text: plist },
48
+ unit: { path: path.join(home, ".config", "systemd", "user", s.unit), text: unit }
49
+ };
50
+ }
51
+ function ensureLinger(user, exec = execQuiet) {
52
+ const lingering = () => {
53
+ try {
54
+ return /^Linger=yes/m.test(exec("loginctl", ["show-user", user, "--property=Linger"]));
55
+ } catch {
56
+ return false;
57
+ }
58
+ };
59
+ if (lingering()) return { on: true, note: "it keeps running after you log out (linger was already on)" };
60
+ try {
61
+ exec("loginctl", ["enable-linger", user]);
62
+ } catch {
63
+ }
64
+ if (lingering()) return { on: true, note: "it keeps running after you log out (turned linger on)" };
65
+ return {
66
+ on: false,
67
+ note: `it stops when you log out: run \`sudo loginctl enable-linger ${user}\` once to keep it running`
68
+ };
69
+ }
70
+ var line = (cmd, args) => [cmd, ...args].join(" ");
71
+ function installService(o) {
72
+ const f = serviceFiles(o);
73
+ const platform = o.platform ?? process.platform;
74
+ const uid = o.uid ?? String(process.getuid?.() ?? "");
75
+ const commands = [];
76
+ const real = o.exec ?? execQuiet;
77
+ const run = (cmd, args) => {
78
+ commands.push(line(cmd, args));
79
+ return o.dryRun ? "" : real(cmd, args);
80
+ };
81
+ const write = (file) => {
82
+ if (o.dryRun) return;
83
+ mkdirSync(path.dirname(file.path), { recursive: true });
84
+ writeFileSync(file.path, file.text);
85
+ };
86
+ if (platform === "darwin") {
87
+ write(f.plist);
88
+ for (const d of ["gui", "user"])
89
+ try {
90
+ run("launchctl", ["bootout", `${d}/${uid}/${o.label}`]);
91
+ } catch {
92
+ }
93
+ try {
94
+ run("launchctl", ["bootstrap", `gui/${uid}`, f.plist.path]);
95
+ return { files: [f.plist], commands, manager: "launchd", domain: "gui" };
96
+ } catch {
97
+ }
98
+ run("launchctl", ["bootstrap", `user/${uid}`, f.plist.path]);
99
+ return { files: [f.plist], commands, manager: "launchd", domain: "user" };
100
+ }
101
+ if (platform === "linux") {
102
+ write(f.unit);
103
+ try {
104
+ run("systemctl", ["--user", "daemon-reload"]);
105
+ run("systemctl", ["--user", "enable", "--now", o.unit]);
106
+ } catch {
107
+ return { files: [f.unit], commands, manager: null, unreachable: f.unit.path };
108
+ }
109
+ const user = o.user ?? os.userInfo().username;
110
+ if (o.dryRun) {
111
+ commands.push(line("loginctl", ["enable-linger", user]));
112
+ return { files: [f.unit], commands, manager: "systemd", linger: { on: false, note: "dry run" } };
113
+ }
114
+ return { files: [f.unit], commands, manager: "systemd", linger: ensureLinger(user, run) };
115
+ }
116
+ return { files: [], commands, manager: null };
117
+ }
118
+ function uninstallService(o) {
119
+ const f = serviceFiles({ ...o, description: "", argv: [], logPath: "" });
120
+ const platform = o.platform ?? process.platform;
121
+ const uid = o.uid ?? String(process.getuid?.() ?? "");
122
+ const commands = [];
123
+ const files = [];
124
+ const real = o.exec ?? execQuiet;
125
+ const run = (cmd, args) => {
126
+ commands.push(line(cmd, args));
127
+ if (o.dryRun) return;
128
+ try {
129
+ real(cmd, args);
130
+ } catch {
131
+ }
132
+ };
133
+ const remove = (file) => {
134
+ files.push(file);
135
+ if (!o.dryRun) unlinkSync(file);
136
+ };
137
+ if (platform === "darwin" && existsSync(f.plist.path)) {
138
+ run("launchctl", ["bootout", `gui/${uid}/${o.label}`]);
139
+ run("launchctl", ["bootout", `user/${uid}/${o.label}`]);
140
+ remove(f.plist.path);
141
+ }
142
+ if (platform === "linux" && existsSync(f.unit.path)) {
143
+ run("systemctl", ["--user", "disable", "--now", o.unit]);
144
+ remove(f.unit.path);
145
+ run("systemctl", ["--user", "daemon-reload"]);
146
+ }
147
+ return { files, commands };
148
+ }
149
+ export {
150
+ ensureLinger,
151
+ installService,
152
+ serviceFiles,
153
+ uninstallService
154
+ };
155
+ //# sourceMappingURL=service.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/service/index.ts"],
4
+ "sourcesContent": ["// SPDX-License-Identifier: Apache-2.0\n/** sessionpipe-core/service \u2014 a per-user background service for a sessionpipe process:\n * a launchd agent on macOS, a systemd user unit on Linux. The control daemon runs\n * under it (`org.sessionpipe.control`), and so can a receiver of the person's own (a\n * board on their machine), with the same files and the same commands. Node only: it\n * writes files and runs launchctl, systemctl and loginctl, so it is never part of the\n * root export, which stays Worker- and browser-safe.\n *\n * Both files restart the process when it exits non-zero, and when it exits\n * UPDATE_EXIT (75, sessionpipe-core/version) to come back on new code. The process is\n * told which manager that is in SESSIONPIPE_SERVICE (`launchd`, `systemd`). Nothing\n * here needs root, and a dry run touches nothing: it answers the files it would write\n * and the commands it would run. */\nimport { execFileSync } from \"node:child_process\";\nimport { existsSync, mkdirSync, unlinkSync, writeFileSync } from \"node:fs\";\nimport os from \"node:os\";\nimport path from \"node:path\";\n\n/** One service, as both managers need it. */\nexport interface ServiceSpec {\n /** The launchd label, also the plist's name: `org.sessionpipe.control`. */\n label: string;\n /** The systemd user unit's file name: `sessionpipe-control.service`. */\n unit: string;\n /** The unit's Description line. */\n description: string;\n /** The program and its arguments, each one argument (never through a shell). */\n argv: string[];\n /** More environment for the process, beside SESSIONPIPE_SERVICE. */\n env?: Record<string, string>;\n /** Where launchd writes its stdout and stderr (journald keeps a unit's). */\n logPath: string;\n /** The home the files go under; the user's own by default. */\n home?: string;\n}\n\n/** A file the service writes, and what is in it. */\nexport interface ServiceFile {\n path: string;\n text: string;\n}\n\n/** Runs one command and answers its stdout; throws when it fails. */\nexport type Exec = (cmd: string, args: string[]) => string;\n\nconst execQuiet: Exec = (cmd, args) =>\n execFileSync(cmd, args, { encoding: \"utf8\", stdio: [\"ignore\", \"pipe\", \"ignore\"], timeout: 15_000 });\n\nconst xml = (s: string) => s.replace(/&/g, \"&amp;\").replace(/</g, \"&lt;\").replace(/>/g, \"&gt;\");\n/** One systemd argument, quoted: backslashes and quotes escaped, `%` doubled (a specifier otherwise). */\nconst sd = (s: string) => `\"${s.replace(/\\\\/g, \"\\\\\\\\\").replace(/\"/g, '\\\\\"').replace(/%/g, \"%%\")}\"`;\n\n/** The plist and the unit for a service, and where each goes. */\nexport function serviceFiles(s: ServiceSpec): { plist: ServiceFile; unit: ServiceFile } {\n const home = s.home ?? os.homedir();\n const env = (manager: string) => ({ SESSIONPIPE_SERVICE: manager, ...s.env });\n const plistEnv = Object.entries(env(\"launchd\"))\n .map(([k, v]) => `<key>${xml(k)}</key><string>${xml(v)}</string>`)\n .join(\"\");\n const plist = `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n <key>Label</key><string>${xml(s.label)}</string>\n <key>ProgramArguments</key>\n <array>${s.argv.map((a) => `<string>${xml(a)}</string>`).join(\"\")}</array>\n <key>EnvironmentVariables</key><dict>${plistEnv}</dict>\n <key>RunAtLoad</key><true/>\n <key>KeepAlive</key><dict><key>SuccessfulExit</key><false/></dict>\n <key>ProcessType</key><string>Background</string>\n <key>StandardOutPath</key><string>${xml(s.logPath)}</string>\n <key>StandardErrorPath</key><string>${xml(s.logPath)}</string>\n</dict>\n</plist>\n`;\n const unitEnv = Object.entries(env(\"systemd\"))\n .map(([k, v]) => `Environment=${k === \"SESSIONPIPE_SERVICE\" ? `${k}=${v}` : sd(`${k}=${v}`)}`)\n .join(\"\\n\");\n const unit = `[Unit]\nDescription=${s.description.replace(/\\n/g, \" \")}\nAfter=network-online.target\n\n[Service]\nExecStart=${s.argv.map(sd).join(\" \")}\n${unitEnv}\nRestart=on-failure\nRestartForceExitStatus=75\nRestartSec=5\n\n[Install]\nWantedBy=default.target\n`;\n return {\n plist: { path: path.join(home, \"Library\", \"LaunchAgents\", `${s.label}.plist`), text: plist },\n unit: { path: path.join(home, \".config\", \"systemd\", \"user\", s.unit), text: unit },\n };\n}\n\n/** A systemd user service stops when its person's last login ends \u2014 closing the ssh\n * session to a lab workstation or a cloud machine stopped the daemon with it \u2014 unless\n * the user lingers. `loginctl enable-linger` for yourself needs no root on systemd's\n * default policy; where it does, say the one command that does it. */\nexport function ensureLinger(user: string, exec: Exec = execQuiet): { on: boolean; note: string } {\n const lingering = () => {\n try {\n return /^Linger=yes/m.test(exec(\"loginctl\", [\"show-user\", user, \"--property=Linger\"]));\n } catch {\n return false;\n }\n };\n if (lingering()) return { on: true, note: \"it keeps running after you log out (linger was already on)\" };\n try {\n exec(\"loginctl\", [\"enable-linger\", user]);\n } catch {}\n if (lingering()) return { on: true, note: \"it keeps running after you log out (turned linger on)\" };\n return {\n on: false,\n note: `it stops when you log out: run \\`sudo loginctl enable-linger ${user}\\` once to keep it running`,\n };\n}\n\n/** What an install did, or would do in a dry run. */\nexport interface ServicePlan {\n /** The files written (or that would be). */\n files: ServiceFile[];\n /** The commands run (or that would be), one string each, in order. */\n commands: string[];\n /** Which manager runs it now: null on a platform with none, or where it isn't reachable. */\n manager: \"launchd\" | \"systemd\" | null;\n /** launchd: `gui` when someone is at the screen, else `user` (it starts again at the next login there). */\n domain?: \"gui\" | \"user\";\n /** systemd: whether it outlives the login, in words. */\n linger?: { on: boolean; note: string };\n /** The file that was written for a manager that couldn't be reached. */\n unreachable?: string;\n}\n\nexport interface InstallOptions extends ServiceSpec {\n /** Answer the plan and touch nothing. */\n dryRun?: boolean;\n exec?: Exec;\n platform?: NodeJS.Platform;\n /** The user's id (launchd's domains) and name (linger); this process's by default. */\n uid?: string;\n user?: string;\n}\n\nconst line = (cmd: string, args: string[]) => [cmd, ...args].join(\" \");\n\n/** Write the service for this platform and start it now; a service already there is\n * replaced (launchd: booted out first). */\nexport function installService(o: InstallOptions): ServicePlan {\n const f = serviceFiles(o);\n const platform = o.platform ?? process.platform;\n const uid = o.uid ?? String(process.getuid?.() ?? \"\");\n const commands: string[] = [];\n const real = o.exec ?? execQuiet;\n const run: Exec = (cmd, args) => {\n commands.push(line(cmd, args));\n return o.dryRun ? \"\" : real(cmd, args);\n };\n const write = (file: ServiceFile) => {\n if (o.dryRun) return;\n mkdirSync(path.dirname(file.path), { recursive: true });\n writeFileSync(file.path, file.text);\n };\n if (platform === \"darwin\") {\n write(f.plist);\n for (const d of [\"gui\", \"user\"])\n try {\n run(\"launchctl\", [\"bootout\", `${d}/${uid}/${o.label}`]);\n } catch {}\n try {\n run(\"launchctl\", [\"bootstrap\", `gui/${uid}`, f.plist.path]);\n return { files: [f.plist], commands, manager: \"launchd\", domain: \"gui\" };\n } catch {}\n // No one logged in at the screen (an ssh session to a Mac mini): the gui domain\n // doesn't exist. The user domain runs it now; after a restart it starts again at\n // the next login at the screen.\n run(\"launchctl\", [\"bootstrap\", `user/${uid}`, f.plist.path]);\n return { files: [f.plist], commands, manager: \"launchd\", domain: \"user\" };\n }\n if (platform === \"linux\") {\n write(f.unit);\n try {\n run(\"systemctl\", [\"--user\", \"daemon-reload\"]);\n run(\"systemctl\", [\"--user\", \"enable\", \"--now\", o.unit]);\n } catch {\n return { files: [f.unit], commands, manager: null, unreachable: f.unit.path };\n }\n const user = o.user ?? os.userInfo().username;\n if (o.dryRun) {\n commands.push(line(\"loginctl\", [\"enable-linger\", user]));\n return { files: [f.unit], commands, manager: \"systemd\", linger: { on: false, note: \"dry run\" } };\n }\n return { files: [f.unit], commands, manager: \"systemd\", linger: ensureLinger(user, run) };\n }\n return { files: [], commands, manager: null };\n}\n\nexport interface UninstallOptions {\n label: string;\n unit: string;\n home?: string;\n dryRun?: boolean;\n exec?: Exec;\n platform?: NodeJS.Platform;\n uid?: string;\n}\n\n/** Stop the service and remove its file, where this platform has one; nothing where\n * there is none. A manager that says it wasn't loaded is no failure. */\nexport function uninstallService(o: UninstallOptions): { files: string[]; commands: string[] } {\n const f = serviceFiles({ ...o, description: \"\", argv: [], logPath: \"\" });\n const platform = o.platform ?? process.platform;\n const uid = o.uid ?? String(process.getuid?.() ?? \"\");\n const commands: string[] = [];\n const files: string[] = [];\n const real = o.exec ?? execQuiet;\n const run = (cmd: string, args: string[]) => {\n commands.push(line(cmd, args));\n if (o.dryRun) return;\n try {\n real(cmd, args);\n } catch {}\n };\n const remove = (file: string) => {\n files.push(file);\n if (!o.dryRun) unlinkSync(file);\n };\n if (platform === \"darwin\" && existsSync(f.plist.path)) {\n run(\"launchctl\", [\"bootout\", `gui/${uid}/${o.label}`]);\n run(\"launchctl\", [\"bootout\", `user/${uid}/${o.label}`]);\n remove(f.plist.path);\n }\n if (platform === \"linux\" && existsSync(f.unit.path)) {\n run(\"systemctl\", [\"--user\", \"disable\", \"--now\", o.unit]);\n remove(f.unit.path);\n run(\"systemctl\", [\"--user\", \"daemon-reload\"]);\n }\n return { files, commands };\n}\n"],
5
+ "mappings": ";;;AAaA,SAAS,oBAAoB;AAC7B,SAAS,YAAY,WAAW,YAAY,qBAAqB;AACjE,OAAO,QAAQ;AACf,OAAO,UAAU;AA6BjB,IAAM,YAAkB,CAAC,KAAK,SAC5B,aAAa,KAAK,MAAM,EAAE,UAAU,QAAQ,OAAO,CAAC,UAAU,QAAQ,QAAQ,GAAG,SAAS,KAAO,CAAC;AAEpG,IAAM,MAAM,CAAC,MAAc,EAAE,QAAQ,MAAM,OAAO,EAAE,QAAQ,MAAM,MAAM,EAAE,QAAQ,MAAM,MAAM;AAE9F,IAAM,KAAK,CAAC,MAAc,IAAI,EAAE,QAAQ,OAAO,MAAM,EAAE,QAAQ,MAAM,KAAK,EAAE,QAAQ,MAAM,IAAI,CAAC;AAGxF,SAAS,aAAa,GAA2D;AACtF,QAAM,OAAO,EAAE,QAAQ,GAAG,QAAQ;AAClC,QAAM,MAAM,CAAC,aAAqB,EAAE,qBAAqB,SAAS,GAAG,EAAE,IAAI;AAC3E,QAAM,WAAW,OAAO,QAAQ,IAAI,SAAS,CAAC,EAC3C,IAAI,CAAC,CAAC,GAAG,CAAC,MAAM,QAAQ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,QAAQ;AACvB,QAAM,MAAM,CAAC,KAAa,SAAmB;AAC3C,aAAS,KAAK,KAAK,KAAK,IAAI,CAAC;AAC7B,QAAI,EAAE,OAAQ;AACd,QAAI;AACF,WAAK,KAAK,IAAI;AAAA,IAChB,QAAQ;AAAA,IAAC;AAAA,EACX;AACA,QAAM,SAAS,CAAC,SAAiB;AAC/B,UAAM,KAAK,IAAI;AACf,QAAI,CAAC,EAAE,OAAQ,YAAW,IAAI;AAAA,EAChC;AACA,MAAI,aAAa,YAAY,WAAW,EAAE,MAAM,IAAI,GAAG;AACrD,QAAI,aAAa,CAAC,WAAW,OAAO,GAAG,IAAI,EAAE,KAAK,EAAE,CAAC;AACrD,QAAI,aAAa,CAAC,WAAW,QAAQ,GAAG,IAAI,EAAE,KAAK,EAAE,CAAC;AACtD,WAAO,EAAE,MAAM,IAAI;AAAA,EACrB;AACA,MAAI,aAAa,WAAW,WAAW,EAAE,KAAK,IAAI,GAAG;AACnD,QAAI,aAAa,CAAC,UAAU,WAAW,SAAS,EAAE,IAAI,CAAC;AACvD,WAAO,EAAE,KAAK,IAAI;AAClB,QAAI,aAAa,CAAC,UAAU,eAAe,CAAC;AAAA,EAC9C;AACA,SAAO,EAAE,OAAO,SAAS;AAC3B;",
6
+ "names": []
7
+ }
@@ -0,0 +1,87 @@
1
+ import { type Mode } from "./headless.js";
2
+ export interface AcpAgent {
3
+ /** sessionpipe's harness name (ADAPTERS.md): the registry's id unless a hook adapter already named it. */
4
+ harness: string;
5
+ /** The registry's id. */
6
+ registry: string;
7
+ label: string;
8
+ /** The CLI's name on PATH. */
9
+ bin: string;
10
+ args: string[];
11
+ }
12
+ /** The agents the daemon can drive, with the launch line the registry publishes. */
13
+ export declare const ACP_AGENTS: readonly AcpAgent[];
14
+ export declare const ACP_HARNESSES: readonly string[];
15
+ export declare const acpAgent: (harness: string) => AcpAgent | undefined;
16
+ /** The env var that names an agent's CLI by hand: `SESSIONPIPE_ACP_GEMINI_CLI`. */
17
+ export declare const acpOverride: (harness: string) => string;
18
+ /** An agent's CLI on this machine: the override, else on PATH, else beside the node
19
+ * running this (an `npm install -g` there) or where the installers put it. */
20
+ export declare function findAcpAgent(harness: string, env?: NodeJS.ProcessEnv, home?: string, nodeDir?: string): {
21
+ bin: string;
22
+ args: string[];
23
+ } | null;
24
+ /** The ACP agents installed here, by harness name, for the daemon's hello. */
25
+ export declare function acpHarnesses(env?: NodeJS.ProcessEnv): string[];
26
+ type Json = Record<string, unknown>;
27
+ interface Option {
28
+ optionId: string;
29
+ kind: string;
30
+ }
31
+ /** Which permission option the machine's mode picks, or null for `cancelled`: safe
32
+ * refuses (once, else always), auto allows (once, else always). Inherit refuses as safe
33
+ * does: the agent asked because its own settings want a person, and none is there.
34
+ * Never the other way. */
35
+ export declare function permissionChoice(options: unknown, mode: Mode): Option | null;
36
+ /** A JSON-RPC error in words: its message, and its `data` where that says more (goose
37
+ * 1.55 answers session/new with "Internal error" and the reason in `data`). */
38
+ export declare function errorWords(err: Json): string;
39
+ /** A session the daemon holds (the shape of daemon.ts's SdkSession, plus the agent's own id). */
40
+ export interface AcpHeld {
41
+ /** Deliver one message; resolves with the agent's reply when the turn ends. */
42
+ send(text: string): Promise<{
43
+ reply: string;
44
+ error?: string;
45
+ }>;
46
+ interrupt(): Promise<void>;
47
+ close(): void;
48
+ readonly busy: boolean;
49
+ readonly lastUsed: number;
50
+ readonly mode: "api";
51
+ /** The id the agent gave the session. */
52
+ readonly session: string;
53
+ /** The process is gone or was closed: nothing more can be sent. */
54
+ readonly closed: boolean;
55
+ }
56
+ export interface AcpOptions {
57
+ bin: string;
58
+ args: string[];
59
+ cwd: string;
60
+ mode: Mode;
61
+ label: string;
62
+ env?: NodeJS.ProcessEnv;
63
+ /** Reopen this session of the agent's (`session/load`) instead of starting a new one. */
64
+ load?: string;
65
+ /** The reply so far, each time it grows. */
66
+ onText?: (text: string) => void;
67
+ log?: (line: string) => void;
68
+ now?: () => number;
69
+ /** A turn still running after this is cancelled, then stopped. */
70
+ timeoutMs?: number;
71
+ /** How long the agent may take to answer `initialize` and open the session. */
72
+ openTimeoutMs?: number;
73
+ /** On close, how long the agent gets to leave by itself before SIGTERM (then SIGKILL). */
74
+ closeGraceMs?: number;
75
+ }
76
+ export type AcpStart = {
77
+ held: AcpHeld;
78
+ } | {
79
+ failed: string;
80
+ } | {
81
+ unsupported: string;
82
+ };
83
+ /** Run an ACP agent and open a session in it. Resolves once the agent has answered
84
+ * `session/new` (or `session/load`); every later turn goes through `held.send`. */
85
+ export declare function startAcp(o: AcpOptions): Promise<AcpStart>;
86
+ export {};
87
+ //# sourceMappingURL=acp-control.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acp-control.d.ts","sourceRoot":"","sources":["../../../src/adapters/acp-control.ts"],"names":[],"mappings":"AAeA,OAAO,EAAkD,KAAK,IAAI,EAAE,MAAM,eAAe,CAAC;AAE1F,MAAM,WAAW,QAAQ;IACvB,0GAA0G;IAC1G,OAAO,EAAE,MAAM,CAAC;IAChB,yBAAyB;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,8BAA8B;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB;AAED,oFAAoF;AACpF,eAAO,MAAM,UAAU,EAAE,SAAS,QAAQ,EA0CzC,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,SAAS,MAAM,EAAqC,CAAC;AAEjF,eAAO,MAAM,QAAQ,YAAa,MAAM,KAAG,QAAQ,GAAG,SAA0D,CAAC;AAEjH,mFAAmF;AACnF,eAAO,MAAM,WAAW,YAAa,MAAM,KAAG,MAAuE,CAAC;AAEtH;+EAC+E;AAC/E,wBAAgB,YAAY,CAC1B,OAAO,EAAE,MAAM,EACf,GAAG,GAAE,MAAM,CAAC,UAAwB,EACpC,IAAI,SAAe,EACnB,OAAO,SAAiC,GACvC;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,I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C,UAAU,CAAC;IACxB,yFAAyF;IACzF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,4CAA4C;IAC5C,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7B,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;IACnB,kEAAkE;IAClE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+EAA+E;IAC/E,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,0FAA0F;IAC1F,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,MAAM,QAAQ,GAAG;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC;AAIxF;oFACoF;AACpF,wBAAgB,QAAQ,CAAC,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,QAAQ,CAAC,CA+QzD"}
@@ -1,14 +1,24 @@
1
+ import type { RunLevel, StartPermission } from "../control/verify.js";
1
2
  import { type Mode, type Reading, type RunResult } from "./headless.js";
2
3
  /** The `agy` to run: SESSIONPIPE_AGY, else on PATH, else where its installer puts it. */
3
4
  export declare function findAgy(env?: NodeJS.ProcessEnv, home?: string): string | null;
4
- /** Permission flags for the machine's mode. Safe: none — agy denies every tool call
5
- * nobody is there to approve, and says which. Auto: `--mode accept-edits`. Never
6
- * `--dangerously-skip-permissions`: no path here writes it. */
7
- export declare function agyModeFlags(mode: Mode): string[];
5
+ /** Permission flags for a level. Safe: none — agy denies every tool call nobody is
6
+ * there to approve, and says which. Edits: `--mode accept-edits`, its widest, which is
7
+ * also what an auto machine's mode means for it. Inherit: none either, so agy runs as
8
+ * it would by itself. agy has no read-only mode known, so `read` is never offered and
9
+ * throws rather than run at safe. Never `--dangerously-skip-permissions`: no path here
10
+ * writes it. */
11
+ export declare function agyModeFlags(level: RunLevel): string[];
12
+ /** The levels a start may ask agy for on a machine in `mode`: safe, and edits on an
13
+ * auto machine. */
14
+ export declare const offeredLevels: (mode: Mode) => StartPermission[];
15
+ /** What a start that names no level gets, said as what it is: edits on an auto machine,
16
+ * no flag on an inherit one. */
17
+ export declare const defaultLevel: (mode: Mode) => RunLevel;
8
18
  /** One headless turn in the folder it is spawned in. A message that starts with a dash
9
19
  * would read as a flag after `-p`; a leading space keeps it the prompt. */
10
20
  export declare function agyArgs(o: {
11
- mode: Mode;
21
+ permission: RunLevel;
12
22
  prompt: string;
13
23
  resume?: string;
14
24
  }): string[];
@@ -1 +1 @@
1
- {"version":3,"file":"antigravity-control.d.ts","sourceRoot":"","sources":["../../../src/adapters/antigravity-control.ts"],"names":[],"mappings":"AAUA,OAAO,EAAkC,KAAK,IAAI,EAAE,KAAK,OAAO,EAAE,KAAK,SAAS,EAAc,MAAM,eAAe,CAAC;AAIpH,yFAAyF;AACzF,wBAAgB,OAAO,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,EAAE,IAAI,SAAe,GAAG,MAAM,GAAG,IAAI,CAOhG;AAED;;gEAEgE;AAChE,wBAAgB,YAAY,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,EAAE,CAEjD;AAED;4EAC4E;AAC5E,wBAAgB,OAAO,CAAC,CAAC,EAAE;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,EAAE,CAUpF;AAED,yCAAyC;AACzC,eAAO,MAAM,MAAM,GAAI,MAAK,MAAM,CAAC,UAAwB,KAAG,MAAM,CAAC,UAAyB,CAAC;AAE/F,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,OAAO,EAAE,CAA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SAAS,GAAG,MAAM,CAU3D;AAED;yCACyC;AACzC,qBAAa,UAAW,YAAW,OAAO;IACxC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAQ;IAC9B,KAAK,SAAK;IACV,OAAO,CAAC,GAAG,CAAM;IACjB,OAAO,CAAC,IAAI,CAAuB;IACnC,OAAO,CAAC,MAAM,CAA0B;IACxC,OAAO,CAAC,IAAI,CAAuB;IAEnC,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAa1B;IAED,OAAO,CAAC,GAAG,EAAE,SAAS,GAAG;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAiB9D;CACF;AAED,eAAO,MAAM,OAAO,QAAO,UAA8B,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { Adapter, FactsState, SessionFacts } from "./types.js";
1
+ import type { Adapter, SessionFacts } from "./types.js";
2
2
  export declare const AG_EVENTS: readonly ["PreInvocation", "PostInvocation", "PostToolUse", "Stop"];
3
3
  /** What a PreToolUse entry an older install left behind gets, until a restarted
4
4
  * conversation reads the rewritten hooks.json: the person's own prompt, with why. The
@@ -26,7 +26,6 @@ export declare function antigravityRemoteUrl(transcript: string, opts: {
26
26
  export declare function antigravityFacts(file: string, opts: {
27
27
  conversation: string;
28
28
  workspaces: string[];
29
- state: FactsState;
30
29
  env: NodeJS.ProcessEnv;
31
30
  }): SessionFacts;
32
31
  //# sourceMappingURL=antigravity.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"antigravity.d.ts","sourceRoot":"","sources":["../../../src/adapters/antigravity.ts"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EACV,OAAO,EAEP,UAAU,EAMV,YAAY,EACb,MAAM,YAAY,CAAC;AAIpB,eAAO,MAAM,SAAS,qEAAsE,CAAC;AAC7F;;yFAEyF;AACzF,eAAO,MAAM,gBAAgB,yKACmI,CAAC;AACj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,eAAO,MAAM,gBAAgB,yKACmI,CAAC;AACjK,0FAA0F;AAC1F,eAAO,MAAM,iBAAiB,UAAW,MAAM,KAAG,MAA8D,CAAC;AAiBjH,eAAO,MAAM,WAAW,EAAE,OAoJzB,CAAC;AAOF,+FAA+F;AAC/F,wBAAgB,MAAM,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAahD;AACD,eAAO,MAAM,YAAY,UAAW,OAAO,KAAG,MAAM,EAIR,CAAC;AAuC7C,kFAAkF;AAClF,wBAAgB,cAAc,CAAC,QAAQ,EAAE;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,IAAI,CAiBjH;AAED;uEACuE;AACvE,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE;IAAE,YAAY,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC,UAAU,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,GACnG,MAAM,GAAG,IAAI,CAiBf;AAED,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,EAAE,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC,UAAU,CAAA;CAAE,GAC3E,YAAY,CAyBd"}
@@ -1,5 +1,8 @@
1
+ import { type RunLevel, type StartPermission } from "../control/verify.js";
1
2
  import { JOB_TIMEOUT_MS, type Login, type Mode, type RunOptions, type RunResult } from "./headless.js";
2
3
  export { JOB_TIMEOUT_MS, type Login, type Mode, type RunResult };
4
+ /** Dotted versions by number, a missing part as 0: 1.9.0 < 1.10 = 1.10.0. */
5
+ export declare const cmpVersion: (a: string, b: string) => number;
3
6
  /** The `claude` to run: on PATH, else where the installers put it, else the newest
4
7
  * copy the desktop app ships. Null when this machine has none. */
5
8
  export declare function findClaude(env?: NodeJS.ProcessEnv, home?: string): string | null;
@@ -13,10 +16,44 @@ export interface Caps {
13
16
  stream?: boolean;
14
17
  }
15
18
  export declare function parseCaps(help: string): Caps;
16
- /** Permission flags for the machine's mode. Safe: `dontAsk` (nothing that needs
17
- * approval runs). Auto: Claude Code's own auto mode, or a refusal. Never
18
- * bypassPermissions — no path here writes it. */
19
- export declare function modeFlags(mode: Mode, caps: Caps): {
19
+ /** Permission flags for a level (a machine's mode is one: safe, auto, inherit). Read:
20
+ * plan mode. Safe: `dontAsk` (nothing that needs approval runs). Edits: acceptEdits.
21
+ * Auto: Claude Code's own auto mode. Inherit: none, so the turn starts in the mode
22
+ * Claude Code picks by itself here, its settings' `permissions.defaultMode` (a resume
23
+ * too: Claude Code never restores a session's earlier mode). A level this Claude Code
24
+ * has no mode for is a refusal, never another level. Never bypassPermissions — no path
25
+ * here writes it. */
26
+ export declare function modeFlags(level: RunLevel, caps: Caps): {
27
+ args: string[];
28
+ } | {
29
+ error: string;
30
+ };
31
+ /** The widest level a start may name on a machine in `mode`: the mode itself, and safe
32
+ * on an inherit machine, whose own default sessionpipe can't rank, so a message there may
33
+ * only narrow to a level that never runs anything needing approval. */
34
+ export declare const ceilingLevel: (mode: Mode) => StartPermission;
35
+ /** The levels a start may ask Claude Code for on a machine in `mode`: never above its
36
+ * ceiling, and each only where `claude --help` lists the mode it maps to (safe always). */
37
+ export declare function offeredLevels(mode: Mode, caps: Caps): StartPermission[];
38
+ /** What a start that names no level gets: what the machine's mode means for Claude Code. */
39
+ export declare const defaultLevel: (mode: Mode) => RunLevel;
40
+ /** How a headless run prints: streamed where this Claude Code can, else one JSON at the end. */
41
+ export declare function outputArgs(caps: {
42
+ stream?: boolean;
43
+ }): string[];
44
+ /** One headless `claude -p` run: a new session (`session`), or the next message of one
45
+ * (`resume`, optionally as a fork). The model is its own argument after `--model`, and
46
+ * a prompt that starts with a dash gets a leading space, so it is never read as a flag. */
47
+ export declare function claudeArgs(o: {
48
+ caps: Caps;
49
+ level: RunLevel;
50
+ prompt: string;
51
+ session?: string;
52
+ resume?: string;
53
+ fork?: boolean;
54
+ model?: string;
55
+ allowedTools?: string[];
56
+ }): {
20
57
  args: string[];
21
58
  } | {
22
59
  error: string;
@@ -1 +1 @@
1
- {"version":3,"file":"claude-code-control.d.ts","sourceRoot":"","sources":["../../../src/adapters/claude-code-control.ts"],"names":[],"mappings":"AAYA,OAAO,EAEL,cAAc,EACd,KAAK,KAAK,EACV,KAAK,IAAI,EACT,KAAK,UAAU,EACf,KAAK,SAAS,EAEf,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,cAAc,EAAE,KAAK,KAAK,EAAE,KAAK,IAAI,EAAE,KAAK,SAAS,EAAE,CAAC;AAcjE;mEACmE;AACnE,wBAAgB,UAAU,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,EAAE,IAAI,SAAe,GAAG,MAAM,GAAG,IAAI,CA2BnG;AAcD,MAAM,WAAW,IAAI;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,WAAW,EAAE,OAAO,CAAC;IACrB,IAAI,EAAE,OAAO,CAAC;IACd;sFACkF;IAClF,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAU5C;AAED;;kDAEkD;AAClD,wBAAgB,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,GAAG;IAAE,IAAI,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAexF;AAED;uFACuF;AACvF,wBAAgB,SAAS,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAAC,UAAU,C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AAE,EAAE,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,SAAS,CAAC,CAExF;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,kBAAkB,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE,EAAE,CAAC;CAChD;AAED,8FAA8F;AAC9F,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,YAAY,GAAG,IAAI,CAqBlF;AAED,eAAO,MAAM,MAAM,MAAO,OAAO,KAAG,CAAC,IAAI,MAAkD,CAAC"}
@@ -1,3 +1,4 @@
1
+ import type { HarnessAccount } from "../types.js";
1
2
  import type { Adapter, FactsState, SessionFacts } from "./types.js";
2
3
  export declare const CLAUDE_EVENTS: readonly ["SessionStart", "UserPromptSubmit", "PreToolUse", "PostToolUse", "PostToolUseFailure", "PermissionRequest", "Notification", "Stop", "SubagentStart", "SubagentStop", "PreCompact", "PostCompact", "SessionEnd", "StopFailure"];
3
4
  /** Every Claude Code config dir on this machine. `home` follows the env's HOME, so a
@@ -5,9 +6,18 @@ export declare const CLAUDE_EVENTS: readonly ["SessionStart", "UserPromptSubmit"
5
6
  * once rewrote a real settings.json with its fake hook paths on every run. */
6
7
  export declare function claudeDirs(env?: NodeJS.ProcessEnv, home?: string): string[];
7
8
  export declare const claudeCode: Adapter;
9
+ /** Another harness reading this settings file, not Claude Code. Several harnesses
10
+ * import `~/.claude/settings.json` hooks, so our entries there can be run by a tool
11
+ * that has its own adapter: it would arrive under the wrong name, with ids that mean
12
+ * nothing to a Claude Code reader. Every Claude Code payload names a transcript and a
13
+ * UUID session (all 21 recorded fixtures do); a payload with neither is somebody else's. */
14
+ export declare function notClaudeCode(id: string, s: Record<string, unknown>): boolean;
8
15
  /** The Claude Code process that ran this hook: the nearest ancestor with a registry
9
16
  * file (hooks run under a shell, so usually the parent's parent). */
10
17
  export declare function claudePid(env?: NodeJS.ProcessEnv): number | null;
18
+ /** Every account signed in across these config dirs, read fresh (a person signs in to
19
+ * another account without restarting anything), for control's pair and hello. */
20
+ export declare function claudeAccounts(dirs: string[], home?: string): HarnessAccount[];
11
21
  /** A first ask as the Claude Code app titles an untitled session: whitespace
12
22
  * collapsed, whole up to 50 characters, else its first 50 and "...". */
13
23
  export declare function appTitle(text: string): string;
@@ -1 +1 @@
1
- {"version":3,"file":"claude-code.d.ts","sourceRoot":"","sources":["../../../src/adapters/claude-code.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EACV,OAAO,EAEP,UAAU,EAKV,YAAY,EACb,MAAM,YAAY,CAAC;AAGpB,eAAO,MAAM,aAAa,0OAehB,CAAC;AAaX;;+EAE+E;AAC/E,wBAAgB,UAAU,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,EAAE,IAAI,SAAmB,GAAG,MAAM,EAAE,CAiBlG;AAgBD,eAAO,MAAM,UAAU,EAAE,OAwMxB,CAAC;AA4EF;sEACsE;AACtE,wBAAgB,SAAS,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,GAAG,IAAI,CAa7E;AA4DD;yEACyE;AACzE,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAG7C;AA2DD;;qFAEqF;AACrF,wBAAgB,WAAW,CACzB,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,KAAK,EAAE,UAAU,GAChB,YAAY,CA6Fd;AAED,6GAA6G;AAC7G,eAAO,MAAM,kBAAkB,QAAO,IAGrC,CAAC"}
1
+ {"version":3,"file":"claude-code.d.ts","sourceRoot":"","sources":["../../../src/adapters/cla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AE,MAAM,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,OAAO,CAAA;CAAE,GAAG,MAAM,CAG5G;AAED,qDAAqD;AACrD,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAG9D;AAUD,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,SAAS,MAAM,EAAE,EACzB,GAAG,EAAE,WAAW,EAChB,CAAC,EAAE,mBAAmB,GACrB,aAAa,CAyCf;AAED,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,SAAS,MAAM,EAAE,EACzB,IAAI,GAAE;IAAE,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAAO,GAC3C,aAAa,CAyBf;AAED,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,SAAS,MAAM,EAAE,EACzB,GAAG,EAAE,WAAW,EAChB,CAAC,EAAE,mBAAmB,GACrB,SAAS,GAAG,OAAO,GAAG,SAAS,CAiBjC"}
@@ -17,8 +17,8 @@ export declare function readNotify(text: string): Notify | null;
17
17
  export declare function insertTopLevel(text: string, line: string): string;
18
18
  /** The config with `line` as its notify, for a config whose notify is ours or absent. */
19
19
  export declare function withNotify(text: string, line: string): string;
20
- /** The config with its top-level notify line replaced by `line`. */
21
- export declare function replaceNotify(text: string, line: string): string | null;
20
+ /** The config with its notify line `n` (as readNotify found it in `text`) replaced by `line`. */
21
+ export declare function replaceNotify(text: string, n: Notify, line: string): string;
22
22
  /** The config with our top-level or misplaced notify removed. */
23
23
  export declare function withoutNotify(text: string): string;
24
24
  export declare function previousNotify(argv: string[] | null): string[] | null;
@@ -1 +1 @@
1
- {"version":3,"file":"codex-config.d.ts","sourceRoot":"","sources":["../../../src/adap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AAc,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,GAAG,MAAM,EAAE,GAAG,IAAI,CAIrE;AACD,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,GAAG,MAAM,EAAE,CAM5E;AACD,qFAAqF;AACrF,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEpD;AACD,8FAA8F;AAC9F,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,CAGnE;AACD,eAAO,MAAM,aAAa,SAAU,MAAM,EAAE,GAAG,IAAI,KAAG,OAC6C,CAAC"}
@@ -1,21 +1,37 @@
1
+ import { type RunLevel, type StartPermission } from "../control/verify.js";
1
2
  import { type Login, type Mode, type Reading, type RunResult } from "./headless.js";
2
3
  export { codexFacts, findRollout } from "./codex.js";
3
4
  /** The `codex` to run: SESSIONPIPE_CODEX, else on PATH, else beside the node running
4
5
  * this (an `npm install -g` there) or where the installers put it. */
5
6
  export declare function findCodex(env?: NodeJS.ProcessEnv, home?: string, nodeDir?: string): string | null;
6
- /** Sandbox flags for the machine's mode. Safe: workspace-write, and nothing escalates
7
- * unattended (exec never asks). Auto: approval requests go through Codex's own
8
- * automatic review. Never `--dangerously-bypass-approvals-and-sandbox` or
9
- * `--dangerously-bypass-hook-trust`: no path here writes them. */
10
- export declare function codexModeFlags(mode: Mode, resume?: boolean): string[];
7
+ /** Sandbox flags for a level (a machine's mode is one: safe, auto, inherit). Read: the
8
+ * read-only sandbox. Safe: workspace-write, and nothing escalates unattended (exec never
9
+ * asks); that sandbox already edits inside the folder, so `edits` is never offered and
10
+ * means the same. Auto: approval requests go through Codex's own automatic review.
11
+ * Inherit: none, so `sandbox_mode` and `approval_policy` come from the person's own
12
+ * config.toml, a new session's and a resume's alike. Never
13
+ * `--dangerously-bypass-approvals-and-sandbox`, `--dangerously-bypass-hook-trust` or
14
+ * `danger-full-access`: no path here writes them. */
15
+ export declare function codexModeFlags(level: RunLevel, resume?: boolean): string[];
16
+ /** The levels a start may ask Codex for on a machine in `mode`: read and safe, and auto
17
+ * on an auto machine. */
18
+ export declare const offeredLevels: (mode: Mode) => StartPermission[];
19
+ /** What a start that names no level gets: what the machine's mode means for Codex. */
20
+ export declare const defaultLevel: (mode: Mode) => RunLevel;
11
21
  /** One headless turn. A new session runs in `cwd` (`-C`); a resume names the thread.
12
- * The prompt goes after `--`, so a message that starts with a dash is never a flag. */
22
+ * The model is its own argument after `-m`. The prompt goes after `--`, so a message
23
+ * that starts with a dash is never a flag. */
13
24
  export declare function codexArgs(o: {
14
- mode: Mode;
25
+ permission: RunLevel;
15
26
  prompt: string;
16
27
  cwd?: string;
17
28
  resume?: string;
29
+ model?: string;
18
30
  }): string[];
31
+ /** The models a hello offers for Codex (CONTROL.md §2 `start`): the slugs Codex's own
32
+ * picker lists, from `$CODEX_HOME/models_cache.json` (visibility `list`; hidden ones,
33
+ * such as its review model, left out), at most 50. Empty when there is no cache. */
34
+ export declare function codexModels(env?: NodeJS.ProcessEnv, home?: string): string[];
19
35
  /** The env a headless turn runs with. */
20
36
  export declare const codexEnv: (env?: NodeJS.ProcessEnv) => NodeJS.ProcessEnv;
21
37
  export declare const LOGIN_HINT = "Codex isn't signed in on this machine: run `codex login --device-auth` there.";
@@ -1 +1 @@
1
- {"version":3,"file":"codex-control.d.ts","sourceRoot":"","sources":["../../../src/adapters/codex-control.ts"],"names":[],"mappings":"AAWA,OAAO,EAGL,KAAK,KAAK,EACV,KAAK,IAAI,EACT,KAAK,OAAO,EACZ,KAAK,SAAS,EAGf,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAIrD;uEACuE;AACvE,wBAAgB,SAAS,CACvB,GAAG,GAAE,MAAM,CAAC,UAAwB,EACpC,IAAI,SAAe,EACnB,OAAO,SAAiC,G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uB;IAEnC,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAc1B;IAED;2EACuE;IACvE,OAAO,CAAC,GAAG,EAAE,SAAS,GAAG;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAQ9D;CACF;AAYD,eAAO,MAAM,OAAO,QAAO,YAAkC,CAAC"}
@@ -0,0 +1,8 @@
1
+ /** A thread another thread started — a subagent, a review — names a `source.subagent`
2
+ * in its own metadata (the rollout's first record). A fork the person made carries
3
+ * only `forked_from_id`, and is a session of its own. */
4
+ export declare function codexSubagent(meta: Record<string, unknown> | null | undefined): boolean;
5
+ /** A fork starts with its own metadata, then replays the parent's history. Only
6
+ * an event naming the new thread establishes where its own records begin. */
7
+ export declare function codexReplayBoundary(meta: Record<string, unknown> | null | undefined): ((record: Record<string, unknown> | null) => boolean) | undefined;
8
+ //# sourceMappingURL=codex-rollout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codex-rollout.d.ts","sourceRoot":"","sources":["../../../src/adapters/codex-rollout.ts"],"names":[],"mappings":"AAEA;;0DAE0D;AAC1D,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAIvF;AAED;8EAC8E;AAC9E,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GAAG,SAAS,aAIlE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,0BAK/C"}
@@ -5,6 +5,6 @@ export declare const CODEX_EVENTS: readonly ["SessionStart", "UserPromptSubmit",
5
5
  * short or odd one never matches some other session's file. */
6
6
  export declare function findRollout(threadId: string, env?: NodeJS.ProcessEnv): string | null;
7
7
  export declare const codex: Adapter;
8
- /** Codex keeps no title; its first real ask stands in. */
8
+ /** Codex keeps no title; its first real ask stands in. A fork's replay is not its ask. */
9
9
  export declare function codexFacts(file: string): SessionFacts;
10
10
  //# sourceMappingURL=codex.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"codex.d.ts","sourceRoot":"","sources":["../../../src/adapters/codex.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EACV,OAAO,EAOP,YAAY,EACb,MAAM,YAAY,CAAC;AAGpB,eAAO,MAAM,YAAY,kMAaf,CAAC;AAuFX;;gEAEgE;AAChE,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,GAAG,IAAI,CAwBjG;AAED,eAAO,MAAM,KAAK,EAAE,OAoLnB,CAAC;AAOF,0DAA0D;AAC1D,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,CA2CrD"}
1
+ {"version":3,"file":"codex.d.ts","sourceRoot":"","sources":["../../../src/adapters/codex.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EACV,OAAO,EAOP,YAAY,EACb,MAAM,YAAY,CAAC;AAGpB,eAAO,MAAM,YAAY,YACvB,cAAc,EACd,kBAAkB,EAClB,YAAY,EACZ,aAAa,EACb,mBAAmB,EACnB,MAAM,EACN,WAAW,EACX,eAAe,EACf,cAAc,EACd,YAAY,EACZ,aAAa,EACb,YAAY,CACJ,CAAC;AAmFX;;gEAEgE;AAChE,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,GAAG,IAAI,CAwBjG;AAeD,eAAO,MAAM,KAAK,EAAE,OAwMnB,CAAC;AAOF,0FAA0F;AAC1F,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,CA2DrD"}