@vibe-commit/capture 0.10.0 → 0.11.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.
Files changed (84) hide show
  1. package/README.md +36 -1
  2. package/dist/agent_hooks.js +2 -2
  3. package/dist/cli.d.ts +35 -0
  4. package/dist/cli.js +412 -0
  5. package/dist/cli.js.map +1 -0
  6. package/dist/commands/backfill.js +19 -2
  7. package/dist/commands/backfill.js.map +1 -1
  8. package/dist/commands/finalize.d.ts +37 -1
  9. package/dist/commands/finalize.js +129 -29
  10. package/dist/commands/finalize.js.map +1 -1
  11. package/dist/commands/status.js +7 -0
  12. package/dist/commands/status.js.map +1 -1
  13. package/dist/commands/status_machine.js +5 -0
  14. package/dist/commands/status_machine.js.map +1 -1
  15. package/dist/commands/upload_worker.d.ts +65 -0
  16. package/dist/commands/upload_worker.js +337 -0
  17. package/dist/commands/upload_worker.js.map +1 -0
  18. package/dist/copy/strings.d.ts +25 -8
  19. package/dist/copy/strings.js +43 -9
  20. package/dist/copy/strings.js.map +1 -1
  21. package/dist/drain.d.ts +68 -0
  22. package/dist/drain.js +234 -0
  23. package/dist/drain.js.map +1 -0
  24. package/dist/firing.d.ts +169 -0
  25. package/dist/firing.js +334 -0
  26. package/dist/firing.js.map +1 -0
  27. package/dist/hooks/entry.d.ts +171 -26
  28. package/dist/hooks/entry.js +337 -508
  29. package/dist/hooks/entry.js.map +1 -1
  30. package/dist/hooks/fire_lock.d.ts +36 -87
  31. package/dist/hooks/fire_lock.js +40 -99
  32. package/dist/hooks/fire_lock.js.map +1 -1
  33. package/dist/hooks/post_commit.d.ts +2 -0
  34. package/dist/hooks/post_commit.js +7 -3
  35. package/dist/hooks/post_commit.js.map +1 -1
  36. package/dist/hooks/session_start.d.ts +18 -0
  37. package/dist/hooks/session_start.js +29 -0
  38. package/dist/hooks/session_start.js.map +1 -1
  39. package/dist/identity.d.ts +32 -0
  40. package/dist/identity.js +38 -0
  41. package/dist/identity.js.map +1 -0
  42. package/dist/index.d.ts +3 -17
  43. package/dist/index.js +59 -450
  44. package/dist/index.js.map +1 -1
  45. package/dist/paths.d.ts +18 -0
  46. package/dist/paths.js +31 -0
  47. package/dist/paths.js.map +1 -1
  48. package/dist/pending_prune.d.ts +2 -2
  49. package/dist/pending_prune.js +2 -2
  50. package/dist/policy.d.ts +17 -0
  51. package/dist/policy.js +7 -0
  52. package/dist/policy.js.map +1 -1
  53. package/dist/post.d.ts +52 -4
  54. package/dist/post.js +59 -21
  55. package/dist/post.js.map +1 -1
  56. package/dist/replay.d.ts +172 -0
  57. package/dist/replay.js +302 -0
  58. package/dist/replay.js.map +1 -0
  59. package/dist/session_targets.d.ts +12 -0
  60. package/dist/session_targets.js +6 -1
  61. package/dist/session_targets.js.map +1 -1
  62. package/dist/spool.d.ts +44 -16
  63. package/dist/spool.js +174 -33
  64. package/dist/spool.js.map +1 -1
  65. package/dist/spool_union.d.ts +18 -2
  66. package/dist/spool_union.js +23 -2
  67. package/dist/spool_union.js.map +1 -1
  68. package/dist/state.js +21 -14
  69. package/dist/state.js.map +1 -1
  70. package/dist/stdin.d.ts +2 -0
  71. package/dist/stdin.js +13 -0
  72. package/dist/stdin.js.map +1 -0
  73. package/dist/uploader_status.d.ts +34 -0
  74. package/dist/uploader_status.js +25 -0
  75. package/dist/uploader_status.js.map +1 -0
  76. package/dist/uploader_view.d.ts +39 -0
  77. package/dist/uploader_view.js +106 -0
  78. package/dist/uploader_view.js.map +1 -0
  79. package/dist/verbs.d.ts +11 -0
  80. package/dist/verbs.js +13 -0
  81. package/dist/verbs.js.map +1 -0
  82. package/dist/version.d.ts +1 -1
  83. package/dist/version.js +1 -1
  84. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -1,59 +1,24 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * `vibecommit` — CLI entry point.
3
+ * `vibecommit` — the process entry. A DISPATCHER, and deliberately nothing more.
4
4
  *
5
- * Verb bodies that are NOT here, each an owned task in
6
- * `coordination/CAPTURE_REFACTOR_TASKS.md`:
5
+ * ⛔ THIS FILE'S STATIC IMPORTS ARE THE LOAD COST OF EVERY HOOK. It used to import every interactive verb (`auth`,
6
+ * `connect`, `status`, the OAuth stack...), so `vibecommit hook` and the git hooks paid ~390 ms of module loading for code
7
+ * they never run. Now each branch below loads only what it runs, with a dynamic `import()`, and the interactive half
8
+ * lives in `cli.ts`. `test/load-path.test.ts` fails the build if a value import of an interactive verb reaches a hook path.
7
9
  *
8
- * why CR-086 report CR-108 connect's live-capture ending CR-025
9
- * status/off output spec CR-021 failure policy CR-018
10
- * repo binding key + X-Repo-Slug CR-017 / CR-019
11
- *
12
- * What IS established here, and must not be undone by those tasks:
10
+ * What is established in `cli.ts`, and must not be undone:
13
11
  * - no user-facing string literal in a command body (CR-090 → `src/copy/`)
14
12
  * - the exit-code contract is split hook vs interactive (CR-022 → `src/exit.ts`)
15
- * - one commit-header renderer taking the grade (CR-090 → `src/copy/grades.ts`)
16
- * - every escape sequence comes from `src/term.ts` (DESIGN.md §13.2)
17
13
  * - the hook contract is enforced by the entry, not by each verb
18
14
  */
19
- import { realpathSync, writeSync } from "node:fs";
15
+ import { realpathSync } from "node:fs";
20
16
  import { homedir } from "node:os";
21
17
  import { fileURLToPath } from "node:url";
22
- import { createInterface } from "node:readline/promises";
23
- import { Writable } from "node:stream";
24
- import { resolveAgentId } from "./agents/registry.js";
25
- import { auth } from "./commands/auth.js";
26
- import { browserCredential } from "./commands/browser_credential.js";
27
- import { updateNudge } from "./update_nudge.js";
28
- import { connect } from "./commands/connect.js";
29
- import { finalize } from "./commands/finalize.js";
30
- import { offVerb, statusVerb } from "./commands/status.js";
31
- import { report } from "./commands/report.js";
32
- import { backfill, backfillForConnect } from "./commands/backfill.js";
33
- import { scan } from "./commands/scan.js";
34
- import { why } from "./commands/why.js";
35
- import { HELP, INTERNAL, USAGE } from "./copy/index.js";
36
18
  import { EXIT } from "./exit.js";
37
- import { runHook } from "./hooks/entry.js";
38
- import { runPostCommit } from "./hooks/post_commit.js";
39
- import { runPostRewrite } from "./hooks/post_rewrite.js";
40
- import { channelCommand, installChannel } from "./install.js";
41
- import { renderJsonError } from "./json.js";
42
- import { LABEL_GUTTER, renderErrorBlock, resolveColour, wrap } from "./term.js";
43
- import { CLIENT_VERSION } from "./version.js";
44
- // `CR-216/U2` adds `auth`, and adding it MOVES `test/help.golden.txt` — which
45
- // `CR-084d` and the `post-commit` note below were both careful not to do. The
46
- // difference is the point: those two are a FLAG and a HIDDEN verb, neither of
47
- // which a human types, so moving the golden file for them would have been noise.
48
- // `auth` is typed by a human on a new machine before anything else works, so a
49
- // help screen that omitted it would be the defect one layer up. The golden file
50
- // exists to make a change to that screen deliberate, not to make it impossible.
51
- /** The verbs with a `--json` mode (`src/json.ts`'s `JsonVerb`): a failure under the flag is a document, not a block. */
52
- const JSON_VERBS = ["status", "why", "report", "scan"];
53
- const VERBS = ["auth", "connect", "scan", "backfill", "status", "off", "why", "report", "finalize"];
54
- export function isVerb(value) {
55
- return VERBS.includes(value);
56
- }
19
+ import { readStdin } from "./stdin.js";
20
+ import { isVerb } from "./verbs.js";
21
+ export { isVerb };
57
22
  /**
58
23
  * Hook invocations are distinguished by ARGV FIRST, then by env.
59
24
  *
@@ -73,359 +38,6 @@ export function invocationMode(env, argv) {
73
38
  return "hook";
74
39
  return env.CLAUDE_HOOK_EVENT ? "hook" : "interactive";
75
40
  }
76
- /**
77
- * `--help`, wrapped hard at 80 columns per DESIGN.md §13.4.
78
- *
79
- * Never reflows to `process.stdout.columns`: identical commands must emit
80
- * identical bytes, or issue-paste, screenshots and every golden-file test of the
81
- * copy break. `test/help-golden.test.ts` is that golden file.
82
- *
83
- * No SGR here at all. Colour would have to be resolved before help could be
84
- * rendered, and help is the one surface where structure alone is enough —
85
- * indentation and the label gutter carry it, which is §13.1's point about
86
- * `NO_COLOR` being a lossless degradation rather than a downgrade.
87
- */
88
- export function renderHelp() {
89
- const lines = [
90
- ...wrap(HELP.tagline, 2),
91
- "",
92
- ...wrap(`${USAGE.usageLabel} ${HELP.usage}`, 2),
93
- "",
94
- ...wrap(USAGE.commandsLabel, 2),
95
- ];
96
- for (const verb of VERBS) {
97
- // The description is wrapped on its own and the verb column is written over
98
- // the first line's indent. Wrapping `verb + padding + description` as one
99
- // string would not work: `wrap` normalises whitespace, so the fixed gutter
100
- // would collapse to a single space.
101
- const head = ` ${verb.padEnd(LABEL_GUTTER)}`;
102
- const body = wrap(HELP.commands[verb], head.length);
103
- lines.push(head + body[0].slice(head.length), ...body.slice(1));
104
- }
105
- lines.push("", ...wrap(`${USAGE.docsLabel} ${HELP.docsUrl}`, 2));
106
- return lines.join("\n");
107
- }
108
- function interactiveContext(argv) {
109
- return {
110
- env: process.env,
111
- home: homedir(),
112
- cwd: process.cwd(),
113
- nodeVersion: process.versions.node,
114
- // `CR-183`. Resolved from argv HERE, the same pure read the hook branch at
115
- // the bottom of this file makes — `connect` needs it to know whether the
116
- // agent it was told about has a way to find the running session at all.
117
- agentId: resolveAgentId(argv),
118
- colour: resolveColour({
119
- env: process.env,
120
- isTty: process.stdout.isTTY === true,
121
- noColorFlag: argv.includes("--no-color"),
122
- json: argv.includes("--json"),
123
- }),
124
- stdinIsTty: process.stdin.isTTY === true,
125
- stdout: process.stdout,
126
- stderr: process.stderr,
127
- /**
128
- * The readline interface is created HERE, on the first question, and not
129
- * once per invocation — CR-117.
130
- *
131
- * `createInterface` RESUMES stdin, and a resumed stdin keeps the event loop
132
- * alive until it ends. Built eagerly, a verb that returns without ever
133
- * prompting sat there until the pipe closed: `connect` refusing a non-TTY,
134
- * and `status` / `off`, which never ask anything. On a terminal that looked
135
- * fine, because stdin ends at EOF; under `cmd | vibecommit connect` in CI it
136
- * is the hang the source finding names first, burning the job's whole
137
- * timeout with the refusal already on screen and no way to explain it.
138
- *
139
- * It also makes style guide §10.2 rule 2 literally true rather than nearly
140
- * true: on the refusal path stdin is not read, resumed, or opened at all.
141
- */
142
- ask: async (question) => {
143
- const rl = createInterface({ input: process.stdin, output: process.stdout });
144
- try {
145
- return await rl.question(question);
146
- }
147
- finally {
148
- rl.close();
149
- }
150
- },
151
- now: () => new Date(),
152
- selfPath: process.argv[1] ?? "",
153
- };
154
- }
155
- async function main(argv) {
156
- const [verb] = argv;
157
- if (verb === undefined || verb === "--help" || verb === "-h") {
158
- process.stdout.write(`${renderHelp()}\n`);
159
- return EXIT.ok;
160
- }
161
- if (verb === "--version" || verb === "-v") {
162
- process.stdout.write(`${CLIENT_VERSION}\n`);
163
- return EXIT.ok;
164
- }
165
- if (!isVerb(verb)) {
166
- // PR 7 (Q6): a block like every other failure — a code, and the way to the command list as the LAST line. No help dump.
167
- const colour = resolveColour({
168
- env: process.env,
169
- isTty: process.stderr.isTTY === true,
170
- noColorFlag: argv.includes("--no-color"),
171
- json: false,
172
- });
173
- process.stderr.write(`${renderErrorBlock({
174
- kind: "bad",
175
- code: "UNKNOWN_COMMAND",
176
- what: USAGE.unknownCommandWhat(verb),
177
- why: [],
178
- fixLabel: USAGE.unknownCommandFix,
179
- fixes: [channelCommand(process.env, process.argv[1] ?? "", USAGE.unknownCommandHelp)],
180
- }, colour).join("\n")}\n`);
181
- return EXIT.usage;
182
- }
183
- const ctx = interactiveContext(argv);
184
- // Slice 2 (S4, R3-11): a credential `g` made and did not keep is revoked by the NEXT verb that runs — once, at its start, silent,
185
- // needing no credential, inside one 3 s bound across every row. Not for `--help`, not for `scan` (network-free by contract,
186
- // README), not for a `--stdin`, piped or no-terminal `auth` (below), and never from a hook (this is the verb path; hooks branch off at the bottom of this file).
187
- // F8 (L10): nor for `auth` run with `--stdin`, piped or with no terminal ("it only saves the credential" stays exactly true of it).
188
- const authSavesOnly = verb === "auth" && (argv.includes("--stdin") || !ctx.stdinIsTty);
189
- if (verb !== "scan" && !authSavesOnly && !argv.includes("--help") && !argv.includes("-h")) {
190
- // Loaded HERE, on the verb path only (the connect.ts rule): `vibecommit hook` never imports the module that holds a token.
191
- const { retryPendingRevokes } = await import("./pending_revoke.js");
192
- await retryPendingRevokes(ctx.home, ctx.env, globalThis.fetch, ctx.now());
193
- }
194
- const code = await runVerb(verb, argv, ctx);
195
- // `13A`: the nudge is the LAST line of a verb that SUCCEEDED — never after an error (the §13.6 fix
196
- // line must stay last) and never with `--json`. It lives here, not in the verbs, so no verb's own
197
- // output or exit path can reach it by accident; `updateNudge` itself fails silent.
198
- if (code === EXIT.ok &&
199
- (verb === "status" || verb === "connect" || verb === "auth") &&
200
- !argv.includes("--json") &&
201
- !argv.includes("--help") &&
202
- !argv.includes("-h")) {
203
- const lines = await updateNudge(ctx);
204
- if (lines.length > 0)
205
- process.stdout.write(`${lines.join("\n")}\n`);
206
- }
207
- return code;
208
- }
209
- /** The real browser beat for `auth` and `connect`: the real network and the real clock, plus `--device`. */
210
- const realBrowser = (ctx, retry, options) => browserCredential(ctx, retry, {}, options);
211
- async function runVerb(verb, argv, ctx) {
212
- switch (verb) {
213
- case "auth":
214
- // `CR-216/U2`. Both readers are injected here rather than reached for
215
- // inside the verb, the same way `why` takes its reader: the suite drives
216
- // every arm, and neither a TTY nor a pipe can be typed into by a test.
217
- return await auth(ctx, argv.slice(1), {
218
- readSecret: readSecretFromTty,
219
- readStdin,
220
- // `CR-226`. The browser mint, first on a terminal; the two readers above
221
- // stay the fallback. Injected HERE and nowhere else — the verb's default
222
- // is paste-only, so this line is what makes the route reachable.
223
- browser: realBrowser,
224
- // `CR-236`. After a save inside a git work tree on a terminal, `auth` continues into `connect`.
225
- // ⛔ NO `browser` HERE, AND THAT IS THE "ONE AUTH" GUARANTEE: this verb just saved a credential, so
226
- // the chained `connect` finds one; were it ever absent it falls to the old warning, never to a
227
- // second sign-in. `test/auth-connect-chain.test.ts` brace-matches this call to keep it so.
228
- // The backfill offer IS passed: it is not a sign-in, it asks its own y/N (default N) on a terminal only, and the chain
229
- // itself runs only on a terminal (the `!piped` gate, D32 guard 1), so a piped or CI `auth` never reaches it.
230
- // Slice 2: the account's network is passed (it is not a sign-in), so the chained `connect` syncs and shows the picker's
231
- // "on your account" group. `g` needs a `browser`, which this call never has, so the chain can never reach it.
232
- connect: (c) => connect(c, {}, { backfill: backfillForConnect, account: { fetch: globalThis.fetch } }),
233
- // R3-7: a credential this verb saves, off the chain, is synced before it returns (only on a machine that has synced before).
234
- account: { fetch: globalThis.fetch },
235
- });
236
- case "connect":
237
- // `--sign-in` (CR-084d) is a FLAG, not a verb: `VERBS` is what `renderHelp`
238
- // iterates, so a sixth verb would move `test/help.golden.txt`, and the
239
- // brief for this task is explicit that the golden file must not move.
240
- // `CR-226`: the browser beat for a fresh machine. Same rule as `auth` —
241
- // `connect`'s default never opens a browser, so without this argument the
242
- // route is unreachable from the install path.
243
- // `TODOS[184]`: `help` added — `connect` has no `argv` param, so its `--help`/`-h` check reads this
244
- // option field, computed the same way `signIn` already is.
245
- return await connect(ctx, {
246
- signIn: argv.includes("--sign-in"),
247
- // `CR-234d`: sign in by code.
248
- device: argv.includes("--device"),
249
- // `D28`: the typed prompt even on a terminal — the checklist's way out for a screen reader.
250
- typed: argv.includes("--typed"),
251
- help: argv.includes("--help") || argv.includes("-h"),
252
- },
253
- // `D14`/`D15`: the backfill offer after "Capture is on" (PR 5's `backfillForConnect`).
254
- // Slice 2: `account` is the network for the sync, the "on your account" group, `g` and the joining-machine question.
255
- { browser: realBrowser, backfill: backfillForConnect, account: { fetch: globalThis.fetch } });
256
- case "scan":
257
- // `D33 · 27A`. Read-only, no network, and a public verb so an agent can list capturable repos
258
- // without entering a consent flow. Reads its own `--json` like `status`.
259
- return scan(ctx, argv.slice(1));
260
- case "backfill":
261
- // `D14`/`D15`. Asks first (default N), uploads earlier sessions one at a time, no commit links. Takes no arguments.
262
- return await backfill(ctx, argv.slice(1));
263
- case "status":
264
- // `argv.slice(1)` for the same reason `why` and `report` take it: `status`
265
- // reads its own `--json` flag rather than this package acquiring an
266
- // argument parser it has deliberately never had (DESIGN.md §13.3).
267
- // Slice 2 (S4): one bounded account sync first, then the screen. The sync only refreshes the files `status` reads.
268
- return await statusVerb(ctx, argv.slice(1), { fetch: globalThis.fetch });
269
- case "off":
270
- // `TODOS[184]`: `off` now takes its trailing argv, so a stray argument (including `--help`
271
- // landing here by accident) can no longer silently revoke consent.
272
- // Slice 2 (S4): the turn-off is local first; with a credential it is then queued for the account and synced once.
273
- return await offVerb(ctx, argv.slice(1), { fetch: globalThis.fetch });
274
- case "why":
275
- // CR-086. `argv.slice(1)` is everything after the verb — there is no
276
- // argument parser in this package and `why` does not add one; it reads
277
- // `<file>:<line>` and refuses `--json`, which is the smallest shape that
278
- // satisfies the verbatim-approved `--help` sentence.
279
- return await why(ctx, argv.slice(1));
280
- case "report":
281
- // CR-108, W10. Same shape as `why`: `argv.slice(1)` is everything after
282
- // the verb, and the verb reads its own two flags rather than adding an
283
- // argument parser this package deliberately does not have.
284
- return await report(ctx, argv.slice(1));
285
- case "finalize":
286
- // `TODOS[146]`. Same shape as `report`: the verb reads its own flags.
287
- return await finalize(ctx, argv.slice(1));
288
- }
289
- }
290
- /**
291
- * Read a secret from the terminal WITHOUT ECHOING IT — `CR-216/U2`.
292
- *
293
- * `ctx.ask` is not reusable for this. It is the consent prompt: it echoes, which
294
- * is correct for `y/N` and wrong for a long-lived credential, which would then
295
- * sit in the terminal's scrollback to be scrolled back to, screenshotted into a
296
- * bug report, or captured by a terminal logger.
297
- *
298
- * The mute is the ordinary readline technique: `output` receives the prompt
299
- * first and is muted only for the keystrokes that follow, so the question is
300
- * still visible and the answer never is. The trailing newline is ours to write —
301
- * the user's own Return was swallowed with the rest, and without it whatever
302
- * prints next lands on the prompt line.
303
- *
304
- * Nothing here holds the secret: `rl.question`'s resolved string goes straight to
305
- * the caller, which wraps it in an `IngestCredential` before doing anything else
306
- * with it.
307
- */
308
- function readSecretFromTty(prompt) {
309
- let muted = false;
310
- const muffled = new Writable({
311
- write(chunk, encoding, cb) {
312
- if (!muted)
313
- process.stdout.write(chunk, encoding);
314
- cb();
315
- },
316
- });
317
- const rl = createInterface({ input: process.stdin, output: muffled, terminal: true });
318
- const answer = rl.question(prompt);
319
- muted = true;
320
- return answer.finally(() => {
321
- rl.close();
322
- process.stdout.write("\n");
323
- });
324
- }
325
- function readStdin() {
326
- return new Promise((resolve) => {
327
- let buf = "";
328
- process.stdin.setEncoding("utf8");
329
- process.stdin.on("data", (chunk) => {
330
- buf += chunk;
331
- });
332
- process.stdin.on("end", () => resolve(buf));
333
- process.stdin.on("error", () => resolve(""));
334
- });
335
- }
336
- /**
337
- * The INTERACTIVE half of the split exit contract — CR-022, D61 round 3 §D8.
338
- *
339
- * The hook half is enforced in `hooks/entry.ts`: swallow everything, exit 0, stay
340
- * silent, because a non-zero hook feeds stderr back into the user's agent and
341
- * derails the task they were actually doing. **An interactive verb must not
342
- * inherit that blanket.** As originally written the exit-0/stdout-empty rule read
343
- * as governing the whole binary, which would make `why` on a read-lane 5xx exit 0
344
- * and print nothing — a read verb failing silently, which is the defect this
345
- * split exists to prevent.
346
- *
347
- * So: same fault, same binary, two modes, two behaviours. Interactive gets exit 1
348
- * and §13.6's shape.
349
- *
350
- * Two things this deliberately does NOT do:
351
- * - **No signal handling.** `Ctrl-C` cancelling a `connect` prompt is normal
352
- * CLI behaviour, and suppressing `SIGINT` globally would be a UX regression
353
- * dressed up as a fix. The hook's signal override stays scoped to hook mode.
354
- * - **No stack trace** unless `VIBECOMMIT_DEBUG` is set (§13.6, first
355
- * prohibition). The detail then goes out RAW, after the block, rather than
356
- * through `wrap()`, which would reflow a stack into nonsense.
357
- */
358
- function reportUnexpected(error, argv) {
359
- const colour = resolveColour({
360
- env: process.env,
361
- isTty: process.stderr.isTTY === true,
362
- noColorFlag: argv.includes("--no-color"),
363
- json: argv.includes("--json"),
364
- });
365
- const block = {
366
- kind: "bad",
367
- code: "INTERNAL_ERROR",
368
- what: INTERNAL.unexpectedWhat,
369
- why: [INTERNAL.unexpectedWhy],
370
- fixLabel: INTERNAL.unexpectedFix,
371
- fixes: [INTERNAL.unexpectedDebugCommand(installChannel(process.env, process.argv[1] ?? "").command)],
372
- };
373
- // PR 7: under `--json` on a read verb the failure is ONE document on stdout and nothing on stderr — the same shape every
374
- // other `--json` failure has. (`VIBECOMMIT_DEBUG` is an explicit opt-in to the raw detail on stderr, and still prints.)
375
- const jsonVerb = argv.includes("--json") ? JSON_VERBS.find((v) => v === argv[0]) : undefined;
376
- const lines = jsonVerb === undefined ? renderErrorBlock(block, colour) : [];
377
- if (jsonVerb !== undefined) {
378
- try {
379
- writeSync(1, renderJsonError(jsonVerb, block));
380
- }
381
- catch {
382
- // An unwritable stdout is not worth a second exception on this path.
383
- }
384
- }
385
- if (process.env.VIBECOMMIT_DEBUG !== undefined)
386
- lines.push(...(lines.length > 0 ? [""] : []), detailOf(error));
387
- if (lines.length === 0)
388
- return;
389
- // `writeSync(2, …)` rather than `process.stderr.write`: stderr to a pipe is
390
- // asynchronous and `process.exit` does not flush it, so the caller below would
391
- // race its own diagnostic away. Same reason `finish()` uses it on fd 1.
392
- try {
393
- writeSync(2, `${lines.join("\n")}\n`);
394
- }
395
- catch {
396
- // An unwritable stderr is not worth a second exception on this path.
397
- }
398
- }
399
- /**
400
- * The raw detail, for `VIBECOMMIT_DEBUG` only.
401
- *
402
- * Interpolating an error is safe by construction here: an `IngestCredential`
403
- * renders `vcik_…redacted` through `toString`, `toJSON` and the inspect hook, so
404
- * a stack that embedded one cannot print the plaintext.
405
- */
406
- function detailOf(error) {
407
- if (error instanceof Error && typeof error.stack === "string")
408
- return error.stack;
409
- return String(error);
410
- }
411
- /**
412
- * Catch what escapes `main()` entirely — a stray timer's throw, a rejection from
413
- * a promise nobody awaited. Without these, Node prints its own stack trace to
414
- * stderr, which §13.6 forbids outright.
415
- *
416
- * These force an exit rather than setting `process.exitCode`, because by
417
- * definition something unexpected is still in flight and may be holding the event
418
- * loop open. The `main()` rejection path below does not: nothing is in flight
419
- * there, and letting the loop drain preserves whatever the verb already wrote.
420
- */
421
- function installInteractiveGuards(argv) {
422
- const fail = (error) => {
423
- reportUnexpected(error, argv);
424
- process.exit(EXIT.failure);
425
- };
426
- process.on("uncaughtException", fail);
427
- process.on("unhandledRejection", fail);
428
- }
429
41
  /**
430
42
  * Swallow EPIPE.
431
43
  *
@@ -478,83 +90,80 @@ function invokedAsBinary() {
478
90
  return false;
479
91
  }
480
92
  }
93
+ /**
94
+ * Every dispatch below is a dynamic `import()` that FAILS CLOSED to the verb's own contract. A hook, `post-commit` and
95
+ * `post-rewrite` run inside the user's agent or `git commit`: an import that throws (a plugin update replacing `bin/` under a
96
+ * running process, a truncated install) must exit 0 and print nothing, not put a stack trace in their terminal. The
97
+ * interactive branch is the opposite on purpose: a broken install should be LOUD there, so its rejection is not caught.
98
+ */
481
99
  if (invokedAsBinary()) {
482
100
  installPipeGuards();
483
101
  const argv = process.argv.slice(2);
484
102
  if (argv[0] === "post-commit") {
485
- // ⛔ A HIDDEN VERB, dispatched here rather than through `main`, and NOT in
486
- // `VERBS` — `renderHelp` iterates that list, so adding it would move
487
- // `test/help.golden.txt` for a verb no human ever types. `hook` is dispatched
488
- // the same way, for the same reason.
103
+ // ⛔ A HIDDEN VERB, dispatched here rather than through `main`, and NOT in `VERBS` — `renderHelp` iterates that list, so
104
+ // adding it would move `test/help.golden.txt` for a verb no human ever types. `hook` is dispatched the same way.
489
105
  //
490
- // It runs inside the user's `git commit`, so it exits 0 unconditionally and
491
- // writes nothing to either stream (`hooks/post_commit.ts`).
106
+ // It runs inside the user's `git commit`, so it exits 0 unconditionally and writes nothing to either stream
107
+ // (`hooks/post_commit.ts`).
492
108
  //
493
- // ⛔ `env` IS THE LADDER'S FIRST RUNG. Claude Code exports
494
- // `CLAUDE_CODE_SESSION_ID` into the Bash tool's environment and git passes it
495
- // through to us (`M1`), so the committing session identifies ITSELF instead of
496
- // being guessed at by mtime. This is the one place the real environment is
497
- // read on this path; everything below takes it as a parameter.
498
- process.exit(runPostCommit({ home: homedir(), cwd: process.cwd(), env: process.env }));
499
- }
500
- if (argv[0] === "post-rewrite") {
501
- // The other hidden verb, for the same reason — and it is `post-commit`'s
502
- // other half: `--amend` and `rebase` fire `post-commit` for a sha they then
503
- // DESTROY (`M5`), and this is the only hook git tells about the pairing.
109
+ // ⛔ `env` IS THE LADDER'S FIRST RUNG. Claude Code exports `CLAUDE_CODE_SESSION_ID` into the Bash tool's environment and
110
+ // git passes it through to us (`M1`), so the committing session identifies ITSELF instead of being guessed at by mtime.
111
+ // This is the one place the real environment is read on this path; everything below takes it as a parameter.
112
+ void import("./hooks/post_commit.js")
113
+ .then(({ runPostCommit }) => process.exit(runPostCommit({ home: homedir(), cwd: process.cwd(), env: process.env })))
114
+ .catch(() => process.exit(EXIT.ok));
115
+ }
116
+ else if (argv[0] === "post-rewrite") {
117
+ // The other hidden verb, for the same reason — and it is `post-commit`'s other half: `--amend` and `rebase` fire
118
+ // `post-commit` for a sha they then DESTROY (`M5`), and this is the only hook git tells about the pairing.
504
119
  //
505
- // ⛔ THE PAIRS ARRIVE ON STDIN, and it is read HERE so `hooks/post_rewrite.ts`
506
- // opens nothing — the same seam that keeps every other module in this package
507
- // free of a real file descriptor. ⚠ `readStdin` REUSED rather than a second
508
- // synchronous reader beside it: it already resolves an `error` to `""`, and
509
- // two stdin readers in one file is how the two come to disagree about what an
510
- // unreadable stream means. An empty read parses to zero pairs, which is an
511
- // ordinary answer rather than a failure.
512
- void readStdin().then((stdin) => process.exit(runPostRewrite({
120
+ // ⛔ THE PAIRS ARRIVE ON STDIN, and it is read HERE so `hooks/post_rewrite.ts` opens nothing — the same seam that keeps
121
+ // every other module in this package free of a real file descriptor. `readStdin` resolves an `error` to `""`, and an empty
122
+ // read parses to zero pairs, which is an ordinary answer rather than a failure.
123
+ void Promise.all([import("./hooks/post_rewrite.js"), readStdin()])
124
+ .then(([{ runPostRewrite }, stdin]) => process.exit(runPostRewrite({
513
125
  home: homedir(),
514
126
  cwd: process.cwd(),
515
127
  env: process.env,
516
128
  // git's own `argv[1]` — `amend` or `rebase`.
517
129
  kind: argv[1] ?? "",
518
130
  stdin,
519
- })));
520
- // ⛔ `else if` FROM HERE, AND THE BRANCH ABOVE IS WHY. Reading stdin is
521
- // asynchronous, so unlike `post-commit` this block RETURNS rather than
522
- // exiting — and a plain `if` below would then run `main(["post-rewrite"])`
523
- // synchronously, print an unknown-verb error, and put it in the terminal of
524
- // someone in the middle of a `git rebase`. The contract this hook is held to
525
- // is silence.
131
+ })))
132
+ .catch(() => process.exit(EXIT.ok));
133
+ }
134
+ else if (argv[0] === "__upload-worker") {
135
+ // The third hidden verb: the detached upload worker (U5). Spawned by a hook with `stdio: "ignore"`, so it has nobody to talk to and exits 0
136
+ // unconditionally. Dispatched BEFORE the env-keyed hook branch below, so an inherited `CLAUDE_HOOK_EVENT` cannot route it into the hook.
137
+ // Not in `VERBS`, for the same reason `hook` is not: `renderHelp` iterates that list and no human types this.
138
+ void import("./commands/upload_worker.js")
139
+ .then(({ runUploadWorkerMain }) => runUploadWorkerMain(process.env, homedir()))
140
+ .then((code) => process.exit(code))
141
+ .catch(() => process.exit(EXIT.ok));
526
142
  }
527
143
  else if (invocationMode(process.env, argv) === "hook") {
528
- // `runHook` installs the contract guards before it does any work and always
529
- // calls `process.exit(0)`. It never returns, so nothing follows it.
530
- void runHook({
144
+ // `runHook` installs the contract guards before it does any work and always calls `process.exit(0)`. It never returns, so
145
+ // nothing follows it.
146
+ void Promise.all([import("./hooks/entry.js"), import("./agents/registry.js")])
147
+ .then(([{ runHook }, { resolveAgentId }]) => runHook({
531
148
  env: process.env,
532
149
  home: homedir(),
533
150
  nodeVersion: process.versions.node,
534
- // ⛔ `CR-183` — THE ONE PLACE THE FLAG IS READ ON THIS PATH, and it is read
535
- // HERE rather than inside the hook for a structural reason: `runHook` never
536
- // receives argv at all, and `parseHookInput` must not select the adapter
537
- // because stdin is the input the confinement boundary exists to constrain.
538
- // This is the seam that already injects `home` and `nodeVersion`.
151
+ // ⛔ `CR-183` — THE ONE PLACE THE FLAG IS READ ON THIS PATH, and it is read HERE rather than inside the hook for a
152
+ // structural reason: `runHook` never receives argv at all, and `parseHookInput` must not select the adapter because
153
+ // stdin is the input the confinement boundary exists to constrain. This is the seam that already injects `home` and
154
+ // `nodeVersion`.
539
155
  //
540
- // ⚠ Note what the line ABOVE this block does and does not do: resolving an
541
- // id is not entering hook mode. `invocationMode` keys on `argv[0]`, so the
542
- // registered command MUST lead with the `hook` verb — put the flag first
543
- // and this branch is never taken.
156
+ // ⚠ Resolving an id is not entering hook mode. `invocationMode` keys on `argv[0]`, so the registered command MUST
157
+ // lead with the `hook` verb — put the flag first and this branch is never taken.
544
158
  agentId: resolveAgentId(argv),
545
159
  readStdin,
546
160
  // `11A`: state 2 names the command that reconnects THIS install.
547
161
  selfPath: process.argv[1] ?? "",
548
- });
162
+ }))
163
+ .catch(() => process.exit(EXIT.ok));
549
164
  }
550
165
  else {
551
- installInteractiveGuards(argv);
552
- void main(argv).then((code) => {
553
- process.exitCode = code;
554
- }, (error) => {
555
- reportUnexpected(error, argv);
556
- process.exitCode = EXIT.failure;
557
- });
166
+ void import("./cli.js").then(({ runCli }) => runCli(argv));
558
167
  }
559
168
  }
560
169
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAmC,MAAM,kCAAk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,EAAE;SAChC,CAAC,CACH;aACA,KAAK,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;IACxC,CAAC;SAAM,CAAC;QACN,KAAK,MAAM,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;IAC7D,CAAC;AACH,CAAC"}
package/dist/paths.d.ts CHANGED
@@ -205,6 +205,24 @@ export declare function targetsDir(home: string): string;
205
205
  export declare function sessionsRoot(home: string): string;
206
206
  /** One session's target record: scan cursors, resolved roots, targets, undecided names. Not a `.json` (see `targetsDir`). */
207
207
  export declare function sessionTargetsPath(home: string, sessionId: string): string;
208
+ /**
209
+ * U3 — a session's FIRING LOG: one line per hook that ended a turn, appended by the hook and replayed by the upload worker
210
+ * (`firing.ts`). Beside the session's target record, never under a repo digest: a firing belongs to the SESSION, and the repos it
211
+ * touches are named inside the line. `.firings.jsonl` is not `.json`, for the reason the whole directory is (`targetsDir`).
212
+ */
213
+ export declare function sessionFiringsPath(home: string, sessionId: string): string;
214
+ /** U3 — the worker's progress through `sessionFiringsPath`, written only under the session's writer lock. */
215
+ export declare function sessionFiringsCursorPath(home: string, sessionId: string): string;
216
+ /** U5 — the machine-wide upload worker's lock for ONE identity (`identity.ts`). Beside the session records; neither a `.targets` nor a `.json`; the status file is `.status` for the same reason. */
217
+ export declare function uploaderLockPath(home: string, identity: string): string;
218
+ /** U5 — what the worker reports about itself, for `status` and the hook's notices: counts and classes, never a body, a path or a credential. */
219
+ export declare function uploaderStatusPath(home: string, identity: string): string;
220
+ /**
221
+ * U3 — `<repo digest>/<session>.live`: the HOOK-only liveness stamp (`firing.ts`). Beside the session's state file, with an extension
222
+ * that is neither `.json` nor `.jsonl`, so no scan of state files (`lastSendForRepo`, `stuckForRepo`) takes it for a session.
223
+ * Null on no repo, for the reason `sessionStatePath` is.
224
+ */
225
+ export declare function sessionLivePath(home: string, key: SessionKey): string | null;
208
226
  /** Which work tree a state digest names — written by `spool.ts` when a commit is spooled. Null for no repo key. */
209
227
  export declare function repoKeyNotePath(home: string, repoKey: string): string | null;
210
228
  /** The digest a work tree's state directory is named by (`repoSessionsDir`). Exposed for the spool-evidence reader. */