@vibe-commit/capture 0.1.0 → 0.2.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/agent_hooks.d.ts +133 -0
- package/dist/agent_hooks.js +228 -0
- package/dist/agent_hooks.js.map +1 -0
- package/dist/agent_install.d.ts +79 -0
- package/dist/agent_install.js +108 -0
- package/dist/agent_install.js.map +1 -0
- package/dist/agents/claude_code.js +12 -1
- package/dist/agents/claude_code.js.map +1 -1
- package/dist/agents/codex_cli.js +21 -1
- package/dist/agents/codex_cli.js.map +1 -1
- package/dist/agents/cursor.js +32 -6
- package/dist/agents/cursor.js.map +1 -1
- package/dist/agents/registry.d.ts +39 -1
- package/dist/agents/registry.js +47 -1
- package/dist/agents/registry.js.map +1 -1
- package/dist/agents/types.d.ts +76 -0
- package/dist/agents/types.js.map +1 -1
- package/dist/commands/auth.d.ts +66 -0
- package/dist/commands/auth.js +119 -0
- package/dist/commands/auth.js.map +1 -0
- package/dist/commands/connect.js +83 -1
- package/dist/commands/connect.js.map +1 -1
- package/dist/commands/status.js +18 -12
- package/dist/commands/status.js.map +1 -1
- package/dist/copy/index.d.ts +1 -1
- package/dist/copy/index.js +1 -1
- package/dist/copy/index.js.map +1 -1
- package/dist/copy/strings.d.ts +102 -4
- package/dist/copy/strings.js +114 -4
- package/dist/copy/strings.js.map +1 -1
- package/dist/credential.d.ts +46 -0
- package/dist/credential.js +59 -1
- package/dist/credential.js.map +1 -1
- package/dist/hooks/entry.d.ts +12 -1
- package/dist/hooks/entry.js +157 -12
- package/dist/hooks/entry.js.map +1 -1
- package/dist/hooks/fire_lock.d.ts +90 -0
- package/dist/hooks/fire_lock.js +192 -0
- package/dist/hooks/fire_lock.js.map +1 -0
- package/dist/hooks/post_commit.js +8 -2
- package/dist/hooks/post_commit.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +53 -1
- package/dist/index.js.map +1 -1
- package/dist/install.d.ts +8 -9
- package/dist/install.js +61 -6
- package/dist/install.js.map +1 -1
- package/dist/paths.d.ts +24 -0
- package/dist/paths.js +38 -0
- package/dist/paths.js.map +1 -1
- package/dist/spool.d.ts +83 -1
- package/dist/spool.js +196 -6
- package/dist/spool.js.map +1 -1
- package/dist/term.d.ts +9 -0
- package/dist/term.js +14 -0
- package/dist/term.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One firing, one process — `CR-195`/U4, D205.
|
|
3
|
+
*
|
|
4
|
+
* ## ⛔ THE DEFECT THIS EXISTS FOR, MEASURED IN CURSOR'S OWN BUNDLE
|
|
5
|
+
*
|
|
6
|
+
* `connect` registers our hook in each agent's config. Cursor then reads **more
|
|
7
|
+
* than its own**: `isClaudeCodeHooksEnabled()` returns
|
|
8
|
+
* `thirdPartyExtensibilityObservable.get() ?? true` — ⛔ **defaulting to ON** —
|
|
9
|
+
* and under it Cursor loads the USER-level `~/.claude/settings.json` and runs
|
|
10
|
+
* every entry through a Claude→Cursor mapper whose table maps all three events
|
|
11
|
+
* we register:
|
|
12
|
+
*
|
|
13
|
+
* W2i = { …, Stop: stop, SessionEnd: sessionEnd, PreCompact: preCompact, … }
|
|
14
|
+
*
|
|
15
|
+
* So on a machine with both agents configured, ONE Cursor event fires our binary
|
|
16
|
+
* TWICE — once from `~/.cursor/hooks.json` and once from Claude's settings,
|
|
17
|
+
* mapped. Cursor does dedupe Claude-sourced entries against its own
|
|
18
|
+
* (`_getDeduplicatedClaudeHooks`), but the key is derived from the entry, and
|
|
19
|
+
* ours deliberately differ: the Cursor registration carries `--agent=cursor` so
|
|
20
|
+
* the budget and event vocabulary are right. **Different key, no dedupe.**
|
|
21
|
+
*
|
|
22
|
+
* ⛔ **Two processes then race on one session state file.** Both read the same
|
|
23
|
+
* `sentOffset`, both send the same span, both write it back — a duplicate
|
|
24
|
+
* upload — and both reach `dropSpooled`, which truncates the spool by LINES
|
|
25
|
+
* CONSUMED. Dropping the same lines twice discards commits that were never
|
|
26
|
+
* sent, and `capture_commits` rows cannot be retracted (D105/D108). That is
|
|
27
|
+
* unrecoverable, which puts it in the same class as the `SessionEnd` hole.
|
|
28
|
+
*
|
|
29
|
+
* ## ⚠ WHY THE LOSER BOWS OUT INSTEAD OF WAITING — the opposite of `oauth/lock.ts`
|
|
30
|
+
*
|
|
31
|
+
* The refresh lock makes its loser WAIT and re-read, because both callers need
|
|
32
|
+
* the result. Here the loser needs nothing: the holder is running the same work
|
|
33
|
+
* with the same inputs, so a second pass would send nothing anyway.
|
|
34
|
+
*
|
|
35
|
+
* ⛔ And waiting would be actively harmful on the one event that cannot afford
|
|
36
|
+
* it. A waiter spends the budget the watchdog is counting down, and `stampGaps`
|
|
37
|
+
* runs AFTER the send loop — which is precisely the arithmetic that produced the
|
|
38
|
+
* G6 defect, where the reserve was measured against the wrong clock and the
|
|
39
|
+
* final turn was lost. Adding a wait in front of `SessionEnd` would re-open it
|
|
40
|
+
* from the other side.
|
|
41
|
+
*
|
|
42
|
+
* ## ⚠ WHY SKIPPING CANNOT SUPPRESS A LEGITIMATE CAPTURE
|
|
43
|
+
*
|
|
44
|
+
* The key is `(repo, session, event)`, so the only thing a skip can lose is a
|
|
45
|
+
* SECOND firing of the SAME event in the SAME session while the first is still
|
|
46
|
+
* running. Taken one event at a time:
|
|
47
|
+
*
|
|
48
|
+
* - `Stop` and `PreCompact` fire repeatedly, and an overlapping one is
|
|
49
|
+
* harmless to drop: `hookBody`'s own comment is that *"every other event has
|
|
50
|
+
* a next invocation to pick up a lagging write"*. The bytes are not lost,
|
|
51
|
+
* they are sent by the next turn.
|
|
52
|
+
* - ⛔ `SessionEnd` has no next invocation — which is exactly why it is safe
|
|
53
|
+
* here. It fires **once per session**, so a concurrent second one is not a
|
|
54
|
+
* later capture at all; it is the duplicate this file exists to stop.
|
|
55
|
+
*
|
|
56
|
+
* So the arm that would be dangerous does not exist, and the arm that exists is
|
|
57
|
+
* not dangerous. Stated rather than assumed, because "a lock that silently drops
|
|
58
|
+
* work" is the right thing to be suspicious of.
|
|
59
|
+
*/
|
|
60
|
+
import { linkSync, openSync, readFileSync, unlinkSync, writeFileSync, closeSync, mkdirSync } from "node:fs";
|
|
61
|
+
import { randomBytes } from "node:crypto";
|
|
62
|
+
import { join } from "node:path";
|
|
63
|
+
import { repoSessionsDir } from "../paths.js";
|
|
64
|
+
/** How much longer than the budget a lock may sit before anyone may reclaim it. */
|
|
65
|
+
const STALE_MARGIN_MS = 2_000;
|
|
66
|
+
/**
|
|
67
|
+
* Where one firing's lock lives — beside the session state it protects.
|
|
68
|
+
*
|
|
69
|
+
* `null` when the repo key is empty, matching `sessionStatePath`: a hook with no
|
|
70
|
+
* project resolved has nothing to serialise against and must not invent a path.
|
|
71
|
+
*/
|
|
72
|
+
export function fireLockPath(home, key) {
|
|
73
|
+
const dir = repoSessionsDir(home, key.repoKey);
|
|
74
|
+
if (dir === null)
|
|
75
|
+
return null;
|
|
76
|
+
const session = key.sessionId.replace(/[^A-Za-z0-9._-]/g, "_") || "_";
|
|
77
|
+
const event = key.event.replace(/[^A-Za-z0-9._-]/g, "_") || "_";
|
|
78
|
+
return join(dir, `${session}.${event}.fire.lock`);
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Claim this firing, or report that another process already has it.
|
|
82
|
+
*
|
|
83
|
+
* `null` means **a live invocation is already doing this exact work** — the
|
|
84
|
+
* caller's whole remaining job is to exit 0 quietly.
|
|
85
|
+
*
|
|
86
|
+
* ⚠ `budgetMs` is what makes the staleness bound DERIVED rather than guessed.
|
|
87
|
+
* The watchdog ends a healthy holder at `budgetMs`, so nothing can legitimately
|
|
88
|
+
* hold this longer than that plus the I/O either side; a lock older than
|
|
89
|
+
* `budgetMs + STALE_MARGIN_MS` therefore belongs to a process that is gone.
|
|
90
|
+
* Reclaiming too EARLY re-admits the double-send this prevents, and reclaiming
|
|
91
|
+
* too LATE only skips one redundant invocation — so the margin leans late.
|
|
92
|
+
*/
|
|
93
|
+
export function claimFiring(home, key, budgetMs) {
|
|
94
|
+
const path = fireLockPath(home, key);
|
|
95
|
+
if (path === null)
|
|
96
|
+
return null;
|
|
97
|
+
const mine = JSON.stringify({
|
|
98
|
+
pid: process.pid,
|
|
99
|
+
at: Date.now(),
|
|
100
|
+
nonce: randomBytes(8).toString("hex"),
|
|
101
|
+
});
|
|
102
|
+
if (!publish(path, mine)) {
|
|
103
|
+
// Taken. Is the holder alive, or did one die mid-flight?
|
|
104
|
+
const held = heldSince(path);
|
|
105
|
+
if (held !== null && Date.now() - held <= budgetMs + STALE_MARGIN_MS)
|
|
106
|
+
return null;
|
|
107
|
+
// ⚠ Stale (or undatable, which means it was not written by this code).
|
|
108
|
+
// Remove and try EXACTLY ONCE more: if a third process wins that race, it is
|
|
109
|
+
// a live holder and bowing out is the correct answer anyway.
|
|
110
|
+
try {
|
|
111
|
+
unlinkSync(path);
|
|
112
|
+
}
|
|
113
|
+
catch {
|
|
114
|
+
// Someone else reclaimed it first — they are now the live holder.
|
|
115
|
+
return null;
|
|
116
|
+
}
|
|
117
|
+
if (!publish(path, mine))
|
|
118
|
+
return null;
|
|
119
|
+
}
|
|
120
|
+
let released = false;
|
|
121
|
+
return {
|
|
122
|
+
release: () => {
|
|
123
|
+
if (released)
|
|
124
|
+
return;
|
|
125
|
+
released = true;
|
|
126
|
+
try {
|
|
127
|
+
// ⛔ ONLY IF STILL OURS. A stale reclaim may have handed this path to
|
|
128
|
+
// another process while we were running; deleting it then would drop
|
|
129
|
+
// THEIR lock and re-admit the double-send.
|
|
130
|
+
if (readFileSync(path, "utf8") === mine)
|
|
131
|
+
unlinkSync(path);
|
|
132
|
+
}
|
|
133
|
+
catch {
|
|
134
|
+
// Already gone, or unreadable. Either way there is nothing of ours left.
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Create the lock atomically, contents first.
|
|
141
|
+
*
|
|
142
|
+
* ⛔ **WRITE FIRST, PUBLISH SECOND — and `oauth/lock.ts` paid for this lesson
|
|
143
|
+
* with a measured bug.** `openSync(path, "wx")` then `writeFileSync` creates the
|
|
144
|
+
* lock EMPTY and fills it a moment later; in that window a second process reads
|
|
145
|
+
* a zero-byte file, cannot date it, treats it as stale and reclaims a lock that
|
|
146
|
+
* was just taken. `link()` is atomic and fails with `EEXIST`, and the staging
|
|
147
|
+
* file already holds the full stamp before the link publishes it.
|
|
148
|
+
*/
|
|
149
|
+
function publish(path, contents) {
|
|
150
|
+
const staging = `${path}.${process.pid}.${randomBytes(6).toString("hex")}`;
|
|
151
|
+
try {
|
|
152
|
+
mkdirSync(join(path, ".."), { recursive: true, mode: 0o700 });
|
|
153
|
+
// `wx` on the staging file also refuses to follow a symlink.
|
|
154
|
+
const fd = openSync(staging, "wx", 0o600);
|
|
155
|
+
try {
|
|
156
|
+
writeFileSync(fd, contents);
|
|
157
|
+
}
|
|
158
|
+
finally {
|
|
159
|
+
closeSync(fd);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
catch {
|
|
163
|
+
return false;
|
|
164
|
+
}
|
|
165
|
+
try {
|
|
166
|
+
linkSync(staging, path);
|
|
167
|
+
return true;
|
|
168
|
+
}
|
|
169
|
+
catch {
|
|
170
|
+
return false;
|
|
171
|
+
}
|
|
172
|
+
finally {
|
|
173
|
+
try {
|
|
174
|
+
unlinkSync(staging);
|
|
175
|
+
}
|
|
176
|
+
catch {
|
|
177
|
+
// The staging file is ours alone; a failure to clean it up is not a
|
|
178
|
+
// failure to lock, and the hook contract forbids saying anything.
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
/** When the lock on disk was taken, or `null` if it cannot be dated. */
|
|
183
|
+
function heldSince(path) {
|
|
184
|
+
try {
|
|
185
|
+
const at = JSON.parse(readFileSync(path, "utf8")).at;
|
|
186
|
+
return typeof at === "number" ? at : null;
|
|
187
|
+
}
|
|
188
|
+
catch {
|
|
189
|
+
return null;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
//# sourceMappingURL=fire_lock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fire_lock.js","sourceRoot":"","sources":["../../src/hooks/fire_lock.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AAEH,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAC5G,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,mFAAmF;AACnF,MAAM,eAAe,GAAG,KAAK,CAAC;AAS9B;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,IAAY,EAAE,GAAY;IACrD,MAAM,GAAG,GAAG,eAAe,CAAC,IAAI,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;IAC/C,IAAI,GAAG,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAC9B,MAAM,OAAO,GAAG,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,kBAAkB,EAAE,GAAG,CAAC,IAAI,GAAG,CAAC;IACtE,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,kBAAkB,EAAE,GAAG,CAAC,IAAI,GAAG,CAAC;IAChE,OAAO,IAAI,CAAC,GAAG,EAAE,GAAG,OAAO,IAAI,KAAK,YAAY,CAAC,CAAC;AACpD,CAAC;AAOD;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,WAAW,CAAC,IAAY,EAAE,GAAY,EAAE,QAAgB;IACtE,MAAM,IAAI,GAAG,YAAY,C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CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -37,7 +37,7 @@ import { DEFAULT_AGENT_ID, dialectFor } from "../agents/registry.js";
|
|
|
37
37
|
import { isProjectAllowed } from "../consent.js";
|
|
38
38
|
import { gitProbe, headRef } from "../git.js";
|
|
39
39
|
import { resolveProjectKeys } from "../project.js";
|
|
40
|
-
import { activeSessionFor, appendSpool } from "../spool.js";
|
|
40
|
+
import { activeSessionFor, appendPending, appendSpool } from "../spool.js";
|
|
41
41
|
/**
|
|
42
42
|
* Observe the commit that just happened, or do nothing.
|
|
43
43
|
*
|
|
@@ -102,7 +102,13 @@ export function observe(ctx) {
|
|
|
102
102
|
// immediately after one — so this is a git we could not read, not a case.
|
|
103
103
|
if (head === null)
|
|
104
104
|
return false;
|
|
105
|
-
|
|
105
|
+
// ⛔ THE COLD RUNG GOES TO THE SIDECAR, NOT THE SPOOL (`CR-195`/D208).
|
|
106
|
+
// `capSpool` counts every taken line toward the truncation, so a non-wire line
|
|
107
|
+
// in `.spool.jsonl` is discarded by the next 2xx — the very post that could not
|
|
108
|
+
// carry it. `.pending.jsonl` gives it different retention without touching that
|
|
109
|
+
// truncation rule, whose `count`-not-`shas.length` semantics are load-bearing.
|
|
110
|
+
const write = active.attribution === "env_session_uncorroborated" ? appendPending : appendSpool;
|
|
111
|
+
return write(ctx.home, { repoKey: toplevel, sessionId: active.sessionId }, {
|
|
106
112
|
sha: head.sha,
|
|
107
113
|
branch: head.branch,
|
|
108
114
|
at: committedAt(toplevel),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"post_commit.js","sourceRoot":"","sources":["../../src/hooks/post_commit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACrE,O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sEAAsE;QACtE,wEAAwE;QACxE,kCAAkC;QAClC,KAAK,EAAE,YAAY,CAAC,QAAQ,CAAC;QAC7B,uEAAuE;QACvE,uEAAuE;QACvE,sEAAsE;QACtE,+DAA+D;QAC/D,WAAW,EAAE,MAAM,CAAC,WAAW;KAChC,CACF,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,SAAS,YAAY,CAAC,GAAsB;IAC1C,OAAO,UAAU,CAAC,gBAAgB,CAAC,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;AAC5D,CAAC;AAED,6DAA6D;AAC7D,SAAS,WAAW,CAAC,GAAW;IAC9B,MAAM,GAAG,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC,CAAC;IACzD,OAAO,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;AACxC,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,YAAY,CAAC,GAAW;IAC/B,MAAM,GAAG,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,gBAAgB,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;IACxF,IAAI,GAAG,KAAK,IAAI;QAAE,OAAO,EAAE,CAAC;IAC5B,OAAO,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC;AACtE,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { type InvocationMode } from "./exit.js";
|
|
3
|
-
declare const VERBS: readonly ["connect", "status", "off", "why", "report"];
|
|
3
|
+
declare const VERBS: readonly ["auth", "connect", "status", "off", "why", "report"];
|
|
4
4
|
export type Verb = (typeof VERBS)[number];
|
|
5
5
|
export declare function isVerb(value: string): value is Verb;
|
|
6
6
|
/**
|
package/dist/index.js
CHANGED
|
@@ -19,7 +19,9 @@
|
|
|
19
19
|
import { writeSync } from "node:fs";
|
|
20
20
|
import { homedir } from "node:os";
|
|
21
21
|
import { createInterface } from "node:readline/promises";
|
|
22
|
+
import { Writable } from "node:stream";
|
|
22
23
|
import { resolveAgentId } from "./agents/registry.js";
|
|
24
|
+
import { auth } from "./commands/auth.js";
|
|
23
25
|
import { connect } from "./commands/connect.js";
|
|
24
26
|
import { off, status } from "./commands/status.js";
|
|
25
27
|
import { report } from "./commands/report.js";
|
|
@@ -31,7 +33,14 @@ import { runPostCommit } from "./hooks/post_commit.js";
|
|
|
31
33
|
import { runPostRewrite } from "./hooks/post_rewrite.js";
|
|
32
34
|
import { LABEL_GUTTER, renderErrorBlock, resolveColour, wrap } from "./term.js";
|
|
33
35
|
import { CLIENT_VERSION } from "./version.js";
|
|
34
|
-
|
|
36
|
+
// `CR-216/U2` adds `auth`, and adding it MOVES `test/help.golden.txt` — which
|
|
37
|
+
// `CR-084d` and the `post-commit` note below were both careful not to do. The
|
|
38
|
+
// difference is the point: those two are a FLAG and a HIDDEN verb, neither of
|
|
39
|
+
// which a human types, so moving the golden file for them would have been noise.
|
|
40
|
+
// `auth` is typed by a human on a new machine before anything else works, so a
|
|
41
|
+
// help screen that omitted it would be the defect one layer up. The golden file
|
|
42
|
+
// exists to make a change to that screen deliberate, not to make it impossible.
|
|
43
|
+
const VERBS = ["auth", "connect", "status", "off", "why", "report"];
|
|
35
44
|
export function isVerb(value) {
|
|
36
45
|
return VERBS.includes(value);
|
|
37
46
|
}
|
|
@@ -149,6 +158,14 @@ async function main(argv) {
|
|
|
149
158
|
}
|
|
150
159
|
const ctx = interactiveContext(argv);
|
|
151
160
|
switch (verb) {
|
|
161
|
+
case "auth":
|
|
162
|
+
// `CR-216/U2`. Both readers are injected here rather than reached for
|
|
163
|
+
// inside the verb, the same way `why` takes its reader: the suite drives
|
|
164
|
+
// every arm, and neither a TTY nor a pipe can be typed into by a test.
|
|
165
|
+
return await auth(ctx, argv.slice(1), {
|
|
166
|
+
readSecret: readSecretFromTty,
|
|
167
|
+
readStdin,
|
|
168
|
+
});
|
|
152
169
|
case "connect":
|
|
153
170
|
// `--sign-in` (CR-084d) is a FLAG, not a verb: `VERBS` is what `renderHelp`
|
|
154
171
|
// iterates, so a sixth verb would move `test/help.golden.txt`, and the
|
|
@@ -174,6 +191,41 @@ async function main(argv) {
|
|
|
174
191
|
return await report(ctx, argv.slice(1));
|
|
175
192
|
}
|
|
176
193
|
}
|
|
194
|
+
/**
|
|
195
|
+
* Read a secret from the terminal WITHOUT ECHOING IT — `CR-216/U2`.
|
|
196
|
+
*
|
|
197
|
+
* `ctx.ask` is not reusable for this. It is the consent prompt: it echoes, which
|
|
198
|
+
* is correct for `y/N` and wrong for a long-lived credential, which would then
|
|
199
|
+
* sit in the terminal's scrollback to be scrolled back to, screenshotted into a
|
|
200
|
+
* bug report, or captured by a terminal logger.
|
|
201
|
+
*
|
|
202
|
+
* The mute is the ordinary readline technique: `output` receives the prompt
|
|
203
|
+
* first and is muted only for the keystrokes that follow, so the question is
|
|
204
|
+
* still visible and the answer never is. The trailing newline is ours to write —
|
|
205
|
+
* the user's own Return was swallowed with the rest, and without it whatever
|
|
206
|
+
* prints next lands on the prompt line.
|
|
207
|
+
*
|
|
208
|
+
* Nothing here holds the secret: `rl.question`'s resolved string goes straight to
|
|
209
|
+
* the caller, which wraps it in an `IngestCredential` before doing anything else
|
|
210
|
+
* with it.
|
|
211
|
+
*/
|
|
212
|
+
function readSecretFromTty(prompt) {
|
|
213
|
+
let muted = false;
|
|
214
|
+
const muffled = new Writable({
|
|
215
|
+
write(chunk, encoding, cb) {
|
|
216
|
+
if (!muted)
|
|
217
|
+
process.stdout.write(chunk, encoding);
|
|
218
|
+
cb();
|
|
219
|
+
},
|
|
220
|
+
});
|
|
221
|
+
const rl = createInterface({ input: process.stdin, output: muffled, terminal: true });
|
|
222
|
+
const answer = rl.question(prompt);
|
|
223
|
+
muted = true;
|
|
224
|
+
return answer.finally(() => {
|
|
225
|
+
rl.close();
|
|
226
|
+
process.stdout.write("\n");
|
|
227
|
+
});
|
|
228
|
+
}
|
|
177
229
|
function readStdin() {
|
|
178
230
|
return new Promise((resolve) => {
|
|
179
231
|
let buf = "";
|
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,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,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,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAExC,OAAO,EAAE,IAAI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E,cAAc,CAAC,IAAI,CAAC;YAC7B,SAAS;SACV,CAAC,CAAC;IACL,CAAC;SAAM,CAAC;QACN,wBAAwB,CAAC,IAAI,CAAC,CAAC;QAC/B,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAClB,CAAC,IAAI,EAAE,EAAE;YACP,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;QAC1B,CAAC,EACD,CAAC,KAAc,EAAE,EAAE;YACjB,gBAAgB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;YAC9B,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC;QAClC,CAAC,CACF,CAAC;IACJ,CAAC;AACH,CAAC"}
|
package/dist/install.d.ts
CHANGED
|
@@ -114,8 +114,14 @@ export type HookInstall =
|
|
|
114
114
|
* owned by whatever tool configured it, and a file we drop in gets regenerated
|
|
115
115
|
* away without warning. The honest move is to say so.
|
|
116
116
|
*
|
|
117
|
-
*
|
|
118
|
-
*
|
|
117
|
+
* ⛔ **THAT CLAIM WAS TRUE AND IS NOT ANY MORE — `TODOS[127]`.** This said
|
|
118
|
+
* *"VERIFIED that our own repos set NEITHER `core.hooksPath` NOR husky, so
|
|
119
|
+
* dogfooding cannot exercise this path."* `code` sets `core.hooksPath`, and
|
|
120
|
+
* dogfooding is exactly how the false negative surfaced: `connect` refused a
|
|
121
|
+
* clone whose hooks would have run. ⚠ Corrected rather than deleted, because a
|
|
122
|
+
* verified-then-falsified claim is worth more to the next reader than a silent
|
|
123
|
+
* edit — the lesson is that "our repos don't do X" decays without a guard, and
|
|
124
|
+
* nothing here watches it.
|
|
119
125
|
*/
|
|
120
126
|
export declare function installPostCommitHook(toplevel: string, binPath: string): HookInstall;
|
|
121
127
|
/** One verdict per hook. Both are installed, or neither is. */
|
|
@@ -143,11 +149,4 @@ export interface CaptureHooks {
|
|
|
143
149
|
* the block at the top of this section calls the third silent no-op.
|
|
144
150
|
*/
|
|
145
151
|
export declare function installCaptureHooks(toplevel: string, binPath: string): CaptureHooks;
|
|
146
|
-
/**
|
|
147
|
-
* The hooks directory git itself would use.
|
|
148
|
-
*
|
|
149
|
-
* `rev-parse --git-path hooks` rather than `<toplevel>/.git/hooks`, because the
|
|
150
|
-
* two differ for a linked work tree and for a repository with a separate git
|
|
151
|
-
* dir — and it answers RELATIVE to the work tree, so it is resolved here.
|
|
152
|
-
*/
|
|
153
152
|
export declare function resolveHooksDir(toplevel: string): string | null;
|
package/dist/install.js
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
* only fake by building a directory of shims.
|
|
26
26
|
*/
|
|
27
27
|
import { accessSync, chmodSync, constants, mkdirSync, readFileSync, realpathSync, renameSync, statSync, writeFileSync } from "node:fs";
|
|
28
|
-
import { delimiter, isAbsolute, join } from "node:path";
|
|
28
|
+
import { delimiter, isAbsolute, join, resolve } from "node:path";
|
|
29
29
|
import { gitProbe } from "./git.js";
|
|
30
30
|
/** The command name D55 kept. */
|
|
31
31
|
const BIN = "vibecommit";
|
|
@@ -183,8 +183,14 @@ function shellQuote(value) {
|
|
|
183
183
|
* owned by whatever tool configured it, and a file we drop in gets regenerated
|
|
184
184
|
* away without warning. The honest move is to say so.
|
|
185
185
|
*
|
|
186
|
-
*
|
|
187
|
-
*
|
|
186
|
+
* ⛔ **THAT CLAIM WAS TRUE AND IS NOT ANY MORE — `TODOS[127]`.** This said
|
|
187
|
+
* *"VERIFIED that our own repos set NEITHER `core.hooksPath` NOR husky, so
|
|
188
|
+
* dogfooding cannot exercise this path."* `code` sets `core.hooksPath`, and
|
|
189
|
+
* dogfooding is exactly how the false negative surfaced: `connect` refused a
|
|
190
|
+
* clone whose hooks would have run. ⚠ Corrected rather than deleted, because a
|
|
191
|
+
* verified-then-falsified claim is worth more to the next reader than a silent
|
|
192
|
+
* edit — the lesson is that "our repos don't do X" decays without a guard, and
|
|
193
|
+
* nothing here watches it.
|
|
188
194
|
*/
|
|
189
195
|
export function installPostCommitHook(toplevel, binPath) {
|
|
190
196
|
return installCaptureHooks(toplevel, binPath).commit;
|
|
@@ -212,10 +218,22 @@ export function installCaptureHooks(toplevel, binPath) {
|
|
|
212
218
|
const configured = gitProbe(toplevel, ["config", "--get", "core.hooksPath"]);
|
|
213
219
|
// `--get` exits 1 when unset, which `gitProbe` reports as null. A SET value
|
|
214
220
|
// is the failure case here, which is the opposite of the usual reading.
|
|
221
|
+
//
|
|
222
|
+
// ⛔ **SET IS NOT THE SAME AS REDIRECTED — `TODOS[127]`.** A value pointing at
|
|
223
|
+
// the directory git would have used ANYWAY is not a redirect, and refusing it
|
|
224
|
+
// costs the user their commit binding for nothing. Alexander hit exactly this:
|
|
225
|
+
// `code` sets `core.hooksPath` to `<toplevel>/.git/hooks` and `connect`
|
|
226
|
+
// answered "could NOT be installed". MEASURED in a throwaway `git init` — a
|
|
227
|
+
// `post-commit` under a `core.hooksPath` pointed at its own default DOES fire.
|
|
215
228
|
if (configured !== null && configured.trim() !== "") {
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
229
|
+
if (!redirectsHooks(toplevel, configured.trim())) {
|
|
230
|
+
// Not a redirect. Fall through and install exactly as an unset repo would.
|
|
231
|
+
}
|
|
232
|
+
else {
|
|
233
|
+
// ⛔ BOTH refuse. `.git/hooks` is dead for every hook in it, not just ours.
|
|
234
|
+
const verdict = { kind: "hooks-path", configured: configured.trim() };
|
|
235
|
+
return { commit: verdict, rewrite: verdict };
|
|
236
|
+
}
|
|
219
237
|
}
|
|
220
238
|
const hooksDir = resolveHooksDir(toplevel);
|
|
221
239
|
if (hooksDir === null) {
|
|
@@ -264,6 +282,43 @@ function writeHook(hooksDir, hookName, script) {
|
|
|
264
282
|
* two differ for a linked work tree and for a repository with a separate git
|
|
265
283
|
* dir — and it answers RELATIVE to the work tree, so it is resolved here.
|
|
266
284
|
*/
|
|
285
|
+
/**
|
|
286
|
+
* ⛔ **DOES `core.hooksPath` SEND HOOKS SOMEWHERE ELSE? — `TODOS[127]`.**
|
|
287
|
+
*
|
|
288
|
+
* ⛔ **NOT `rev-parse --git-path hooks`, AND THAT IS THE WHOLE TRAP.** The
|
|
289
|
+
* obvious narrowing is to compare the configured value against that command's
|
|
290
|
+
* output, and it is wrong in the direction that does damage: `--git-path hooks`
|
|
291
|
+
* **respects `core.hooksPath`**, so it returns the configured directory itself
|
|
292
|
+
* and the two are equal for EVERY set value — husky's included. That comparison
|
|
293
|
+
* retires the refusal entirely and starts writing into directories other tools
|
|
294
|
+
* own and regenerate. MEASURED both ways before this function was written.
|
|
295
|
+
*
|
|
296
|
+
* The honest question is *"is this the directory git would use if the setting
|
|
297
|
+
* were absent"*, so the answer comes from `--git-common-dir`, which is what the
|
|
298
|
+
* default is built from and is not itself affected by the setting.
|
|
299
|
+
*
|
|
300
|
+
* ⚠ **FAILS CLOSED.** Anything unresolvable — a probe that fails, a path that
|
|
301
|
+
* normalises to neither form — is treated as a REDIRECT and refused. The two
|
|
302
|
+
* errors are not the same size: a false refusal costs commit binding and says
|
|
303
|
+
* so out loud, while a false accept drops a file into a directory another tool
|
|
304
|
+
* regenerates, silently, which is the failure the refusal exists to prevent.
|
|
305
|
+
*/
|
|
306
|
+
function redirectsHooks(toplevel, configured) {
|
|
307
|
+
const common = gitProbe(toplevel, ["rev-parse", "--git-common-dir"]);
|
|
308
|
+
if (common === null || common.trim() === "")
|
|
309
|
+
return true;
|
|
310
|
+
const commonDir = common.trim();
|
|
311
|
+
const fallback = join(isAbsolute(commonDir) ? commonDir : join(toplevel, commonDir), "hooks");
|
|
312
|
+
// `core.hooksPath` is interpreted relative to the top of the work tree.
|
|
313
|
+
const a = resolve(toplevel, configured);
|
|
314
|
+
const b = resolve(toplevel, fallback);
|
|
315
|
+
if (a === b)
|
|
316
|
+
return false;
|
|
317
|
+
// Only then pay for `realpath`, which also settles a symlinked `.git`.
|
|
318
|
+
const ra = realpathOrNull(a);
|
|
319
|
+
const rb = realpathOrNull(b);
|
|
320
|
+
return !(ra !== null && rb !== null && ra === rb);
|
|
321
|
+
}
|
|
267
322
|
export function resolveHooksDir(toplevel) {
|
|
268
323
|
const out = gitProbe(toplevel, ["rev-parse", "--git-path", "hooks"]);
|
|
269
324
|
if (out === null)
|
package/dist/install.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.js","sourceRoot":"","sources":["../src/install.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACvI,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"install.js","sourceRoot":"","sources":["../src/install.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACvI,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEjE,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAUpC,iCAAiC;AACjC,MAAM,GAAG,GAAG,YAAY,CAAC;AAEzB;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,eAAe,CAAC,GAAsB,EAAE,QAAgB;IACtE,MAAM,KAAK,GAAG,aAAa,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACtC,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;IAE9C,MAAM,IAAI,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAC;IACtC,MAAM,KAAK,GAAG,cAA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AAE,KAAK,IAAI,IAAI,EAAE,KAAK,IAAI,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;AACpD,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,QAAgB;IAC9C,MAAM,GAAG,GAAG,QAAQ,CAAC,QAAQ,EAAE,CAAC,WAAW,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC,CAAC;IACrE,IAAI,GAAG,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAC9B,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;IACxB,IAAI,IAAI,KAAK,EAAE;QAAE,OAAO,IAAI,CAAC;IAC7B,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;AACxD,CAAC;AAED,SAAS,aAAa,CAAC,IAAY;IACjC,IAAI,CAAC;QACH,OAAO,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACpC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
|
package/dist/paths.d.ts
CHANGED
|
@@ -364,3 +364,27 @@ export declare function isInside(root: string, candidate: string): boolean;
|
|
|
364
364
|
* means nothing is known to be inside one.
|
|
365
365
|
*/
|
|
366
366
|
export declare function isInsideAny(roots: readonly string[], candidate: string): boolean;
|
|
367
|
+
/**
|
|
368
|
+
* ⛔ **WHERE EACH AGENT'S HOOK CONFIG LIVES — `CR-195`/U4b, D205.**
|
|
369
|
+
*
|
|
370
|
+
* A sibling set to the `*TranscriptRoot` functions above, and separate from them
|
|
371
|
+
* on purpose: those name where an agent WRITES transcripts, and these name the
|
|
372
|
+
* one file `connect` WRITES INTO. Same home, same env, different question — and
|
|
373
|
+
* conflating them would put an install-time write behind the confinement
|
|
374
|
+
* boundary's reasoning, where it does not belong.
|
|
375
|
+
*
|
|
376
|
+
* ⚠ **The env vars are honoured on exactly the evidence the transcript roots
|
|
377
|
+
* cite: because the product honours them.** `CLAUDE_CONFIG_DIR` relocates the
|
|
378
|
+
* whole `~/.claude` tree, settings included, and `CODEX_HOME` relocates
|
|
379
|
+
* `~/.codex` — MEASURED for Codex rather than assumed, since every probe in this
|
|
380
|
+
* unit drove a real `codex` through a throwaway `CODEX_HOME` and it read the
|
|
381
|
+
* `hooks.json` there. Hard-coding either would write a file the agent never
|
|
382
|
+
* reads, which is the silent no-op this whole unit exists to delete.
|
|
383
|
+
*
|
|
384
|
+
* ⛔ **No Cursor equivalent, for the reason `cursorTranscriptRoot` gives:** none
|
|
385
|
+
* has been measured, and inventing one is a configuration surface this client
|
|
386
|
+
* would read and nothing would write.
|
|
387
|
+
*/
|
|
388
|
+
export declare function claudeSettingsPath(home: string, env: NodeJS.ProcessEnv): string;
|
|
389
|
+
export declare function codexHooksPath(home: string, env: NodeJS.ProcessEnv): string;
|
|
390
|
+
export declare function cursorHooksPath(home: string): string;
|
package/dist/paths.js
CHANGED
|
@@ -457,4 +457,42 @@ function sanitise(value) {
|
|
|
457
457
|
const cleaned = value.replace(/[^A-Za-z0-9._-]/g, "_").slice(0, 128);
|
|
458
458
|
return cleaned === "" || /^\.+$/.test(cleaned) ? "_" : cleaned;
|
|
459
459
|
}
|
|
460
|
+
/**
|
|
461
|
+
* ⛔ **WHERE EACH AGENT'S HOOK CONFIG LIVES — `CR-195`/U4b, D205.**
|
|
462
|
+
*
|
|
463
|
+
* A sibling set to the `*TranscriptRoot` functions above, and separate from them
|
|
464
|
+
* on purpose: those name where an agent WRITES transcripts, and these name the
|
|
465
|
+
* one file `connect` WRITES INTO. Same home, same env, different question — and
|
|
466
|
+
* conflating them would put an install-time write behind the confinement
|
|
467
|
+
* boundary's reasoning, where it does not belong.
|
|
468
|
+
*
|
|
469
|
+
* ⚠ **The env vars are honoured on exactly the evidence the transcript roots
|
|
470
|
+
* cite: because the product honours them.** `CLAUDE_CONFIG_DIR` relocates the
|
|
471
|
+
* whole `~/.claude` tree, settings included, and `CODEX_HOME` relocates
|
|
472
|
+
* `~/.codex` — MEASURED for Codex rather than assumed, since every probe in this
|
|
473
|
+
* unit drove a real `codex` through a throwaway `CODEX_HOME` and it read the
|
|
474
|
+
* `hooks.json` there. Hard-coding either would write a file the agent never
|
|
475
|
+
* reads, which is the silent no-op this whole unit exists to delete.
|
|
476
|
+
*
|
|
477
|
+
* ⛔ **No Cursor equivalent, for the reason `cursorTranscriptRoot` gives:** none
|
|
478
|
+
* has been measured, and inventing one is a configuration surface this client
|
|
479
|
+
* would read and nothing would write.
|
|
480
|
+
*/
|
|
481
|
+
export function claudeSettingsPath(home, env) {
|
|
482
|
+
const configured = env.CLAUDE_CONFIG_DIR;
|
|
483
|
+
const root = configured !== undefined && configured.trim() !== ""
|
|
484
|
+
? configured.trim()
|
|
485
|
+
: join(home, ".claude");
|
|
486
|
+
return join(root, "settings.json");
|
|
487
|
+
}
|
|
488
|
+
export function codexHooksPath(home, env) {
|
|
489
|
+
const configured = env.CODEX_HOME;
|
|
490
|
+
const root = configured !== undefined && configured.trim() !== ""
|
|
491
|
+
? configured.trim()
|
|
492
|
+
: join(home, ".codex");
|
|
493
|
+
return join(root, "hooks.json");
|
|
494
|
+
}
|
|
495
|
+
export function cursorHooksPath(home) {
|
|
496
|
+
return join(home, ".cursor", "hooks.json");
|
|
497
|
+
}
|
|
460
498
|
//# sourceMappingURL=paths.js.map
|
package/dist/paths.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../src/paths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAEtC,0FAA0F;AAC1F,MAAM,UAAU,OAAO,CAAC,IAAY;IAClC,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