@vibe-commit/capture 0.6.1 → 0.8.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.
- package/README.md +191 -9
- package/dist/account_not_here.d.ts +15 -0
- package/dist/account_not_here.js +25 -0
- package/dist/account_not_here.js.map +1 -0
- package/dist/agent_hooks.d.ts +8 -0
- package/dist/agent_hooks.js +31 -1
- package/dist/agent_hooks.js.map +1 -1
- package/dist/agents/claude_code.d.ts +34 -0
- package/dist/agents/claude_code.js +141 -8
- package/dist/agents/claude_code.js.map +1 -1
- package/dist/agents/codex_cli.d.ts +13 -0
- package/dist/agents/codex_cli.js +241 -2
- package/dist/agents/codex_cli.js.map +1 -1
- package/dist/agents/cursor.d.ts +34 -0
- package/dist/agents/cursor.js +115 -1
- package/dist/agents/cursor.js.map +1 -1
- package/dist/agents/session_listing.d.ts +29 -0
- package/dist/agents/session_listing.js +49 -0
- package/dist/agents/session_listing.js.map +1 -0
- package/dist/agents/types.d.ts +118 -8
- package/dist/agents/types.js +17 -3
- package/dist/agents/types.js.map +1 -1
- package/dist/commands/approval_pending.d.ts +9 -0
- package/dist/commands/approval_pending.js +23 -0
- package/dist/commands/approval_pending.js.map +1 -0
- package/dist/commands/auth.d.ts +7 -0
- package/dist/commands/auth.js +52 -11
- package/dist/commands/auth.js.map +1 -1
- package/dist/commands/backfill.d.ts +160 -0
- package/dist/commands/backfill.js +748 -0
- package/dist/commands/backfill.js.map +1 -0
- package/dist/commands/browser_credential.d.ts +6 -2
- package/dist/commands/browser_credential.js +34 -14
- package/dist/commands/browser_credential.js.map +1 -1
- package/dist/commands/connect.d.ts +146 -0
- package/dist/commands/connect.js +216 -117
- package/dist/commands/connect.js.map +1 -1
- package/dist/commands/connect_account.d.ts +135 -0
- package/dist/commands/connect_account.js +321 -0
- package/dist/commands/connect_account.js.map +1 -0
- package/dist/commands/connect_picker.d.ts +27 -0
- package/dist/commands/connect_picker.js +549 -0
- package/dist/commands/connect_picker.js.map +1 -0
- package/dist/commands/context.d.ts +16 -0
- package/dist/commands/context.js +27 -0
- package/dist/commands/context.js.map +1 -1
- package/dist/commands/credential_problem.d.ts +15 -4
- package/dist/commands/credential_problem.js +29 -22
- package/dist/commands/credential_problem.js.map +1 -1
- package/dist/commands/device_credential.d.ts +5 -1
- package/dist/commands/device_credential.js +17 -14
- package/dist/commands/device_credential.js.map +1 -1
- package/dist/commands/finalize.d.ts +95 -0
- package/dist/commands/finalize.js +249 -74
- package/dist/commands/finalize.js.map +1 -1
- package/dist/commands/finish_mint.d.ts +30 -6
- package/dist/commands/finish_mint.js +26 -6
- package/dist/commands/finish_mint.js.map +1 -1
- package/dist/commands/report.js +38 -30
- package/dist/commands/report.js.map +1 -1
- package/dist/commands/scan.d.ts +162 -0
- package/dist/commands/scan.js +507 -0
- package/dist/commands/scan.js.map +1 -0
- package/dist/commands/status.d.ts +19 -1
- package/dist/commands/status.js +232 -26
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/status_hooks.d.ts +14 -0
- package/dist/commands/status_hooks.js +81 -0
- package/dist/commands/status_hooks.js.map +1 -0
- package/dist/commands/status_machine.d.ts +27 -0
- package/dist/commands/status_machine.js +210 -0
- package/dist/commands/status_machine.js.map +1 -0
- package/dist/commands/sync_reason.d.ts +17 -0
- package/dist/commands/sync_reason.js +25 -0
- package/dist/commands/sync_reason.js.map +1 -0
- package/dist/commands/why.js +44 -31
- package/dist/commands/why.js.map +1 -1
- package/dist/consent.d.ts +217 -0
- package/dist/consent.js +400 -1
- package/dist/consent.js.map +1 -1
- package/dist/copy/error_codes.d.ts +222 -0
- package/dist/copy/error_codes.js +105 -0
- package/dist/copy/error_codes.js.map +1 -0
- package/dist/copy/index.d.ts +2 -2
- package/dist/copy/index.js +2 -2
- package/dist/copy/index.js.map +1 -1
- package/dist/copy/strings.d.ts +617 -30
- package/dist/copy/strings.js +741 -36
- package/dist/copy/strings.js.map +1 -1
- package/dist/copy/time.d.ts +11 -0
- package/dist/copy/time.js +18 -0
- package/dist/copy/time.js.map +1 -1
- package/dist/credential.d.ts +5 -1
- package/dist/credential.js +2 -2
- package/dist/credential.js.map +1 -1
- package/dist/git.d.ts +43 -0
- package/dist/git.js +95 -0
- package/dist/git.js.map +1 -1
- package/dist/grants_sync.d.ts +165 -0
- package/dist/grants_sync.js +289 -0
- package/dist/grants_sync.js.map +1 -0
- package/dist/grants_verb.d.ts +70 -0
- package/dist/grants_verb.js +121 -0
- package/dist/grants_verb.js.map +1 -0
- package/dist/hooks/entry.d.ts +18 -1
- package/dist/hooks/entry.js +117 -14
- package/dist/hooks/entry.js.map +1 -1
- package/dist/hooks/post_commit.js +3 -3
- package/dist/hooks/post_commit.js.map +1 -1
- package/dist/hooks/post_rewrite.js +6 -4
- package/dist/hooks/post_rewrite.js.map +1 -1
- package/dist/hooks/session_grants.d.ts +59 -0
- package/dist/hooks/session_grants.js +91 -0
- package/dist/hooks/session_grants.js.map +1 -0
- package/dist/hooks/session_start.d.ts +114 -0
- package/dist/hooks/session_start.js +243 -0
- package/dist/hooks/session_start.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +76 -11
- package/dist/index.js.map +1 -1
- package/dist/install.d.ts +57 -0
- package/dist/install.js +54 -20
- package/dist/install.js.map +1 -1
- package/dist/json.d.ts +32 -9
- package/dist/json.js +35 -8
- package/dist/json.js.map +1 -1
- package/dist/machine_state.d.ts +52 -0
- package/dist/machine_state.js +63 -0
- package/dist/machine_state.js.map +1 -0
- package/dist/oauth/retire.d.ts +10 -0
- package/dist/oauth/retire.js +13 -0
- package/dist/oauth/retire.js.map +1 -1
- package/dist/oauth/session.d.ts +1 -0
- package/dist/org_pending.d.ts +52 -0
- package/dist/org_pending.js +109 -0
- package/dist/org_pending.js.map +1 -0
- package/dist/paths.d.ts +70 -0
- package/dist/paths.js +90 -0
- package/dist/paths.js.map +1 -1
- package/dist/pending_revoke.d.ts +117 -0
- package/dist/pending_revoke.js +233 -0
- package/dist/pending_revoke.js.map +1 -0
- package/dist/pending_revoke_file.d.ts +55 -0
- package/dist/pending_revoke_file.js +74 -0
- package/dist/pending_revoke_file.js.map +1 -0
- package/dist/picker.d.ts +208 -0
- package/dist/picker.js +526 -0
- package/dist/picker.js.map +1 -0
- package/dist/picker_checklist.d.ts +141 -0
- package/dist/picker_checklist.js +411 -0
- package/dist/picker_checklist.js.map +1 -0
- package/dist/policy.d.ts +70 -1
- package/dist/policy.js +68 -2
- package/dist/policy.js.map +1 -1
- package/dist/post.d.ts +91 -18
- package/dist/post.js +259 -27
- package/dist/post.js.map +1 -1
- package/dist/state.d.ts +6 -0
- package/dist/state.js +38 -1
- package/dist/state.js.map +1 -1
- package/dist/system_message.d.ts +32 -2
- package/dist/system_message.js +47 -5
- package/dist/system_message.js.map +1 -1
- package/dist/term.d.ts +28 -2
- package/dist/term.js +23 -2
- package/dist/term.js.map +1 -1
- package/dist/verb_help.d.ts +13 -0
- package/dist/verb_help.js +40 -0
- package/dist/verb_help.js.map +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +5 -9
|
@@ -0,0 +1,549 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `connect` picker flow — style guide §10.12 (0.7.0, PR 3): scan → picker → disclosure → grant y/N → sign in → hooks →
|
|
3
|
+
* (in a repo) the test capture → "Capture is on" or the held beat → backfill offer → URL.
|
|
4
|
+
*
|
|
5
|
+
* ⛔ LOADED LAZILY, AND THAT IS THE POINT OF THIS FILE BEING SEPARATE. `connect.ts` imports it with `await import(...)` at
|
|
6
|
+
* the two call sites that reach the picker. `src/index.ts` statically imports every verb, so everything `connect.ts`
|
|
7
|
+
* imports is loaded by EVERY process, a hook's included; the picker, its checklist and the scan engine are a person-at-a-
|
|
8
|
+
* terminal feature and must not ride along on the hook's load path. (Measured: no timing difference at all in 120
|
|
9
|
+
* interleaved starts, so this is for the principle and for the SIGTERM cell's sake, not for a number.)
|
|
10
|
+
* The helpers it shares with the 0.6.0 flow are exported from `connect.ts`; the import is circular only at call time.
|
|
11
|
+
*/
|
|
12
|
+
import { dialectFor } from "../agents/registry.js";
|
|
13
|
+
import { AGENT_HOOKS, COMMANDS, COMMIT_HOOK, CONNECT, PICKER, SCAN, URLS } from "../copy/index.js";
|
|
14
|
+
import { EMPTY_GRANTS, GrantsUnreadableError, grantsUnreadable, isAffirmative, normalizeOwner, normalizeSlug, ownerOfSlug, readGrants, revokeProject, updateGrants, } from "../consent.js";
|
|
15
|
+
import { loadCredential } from "../credential.js";
|
|
16
|
+
import { EXIT } from "../exit.js";
|
|
17
|
+
import { mergePending } from "../grants_sync.js";
|
|
18
|
+
import { readAccountView, syncForVerb } from "../grants_verb.js";
|
|
19
|
+
import { channelCommand, connectCommandFor, installCaptureHooks } from "../install.js";
|
|
20
|
+
import { machineCapture, machineSummary, readPerClone } from "../machine_state.js";
|
|
21
|
+
import { buildModel, grantQuestion, hasAdditions, isNoChange, NO_CHANGE, notUnderstoodLines, parseTyped, preChange, renderGrantBlock, renderTyped, } from "../picker.js";
|
|
22
|
+
import { runChecklist } from "../picker_checklist.js";
|
|
23
|
+
import { credentialFingerprint } from "../post.js";
|
|
24
|
+
import { metaFor } from "../credential_meta.js";
|
|
25
|
+
import { paint, renderErrorBlock, tildePath, truncatePath, wrap } from "../term.js";
|
|
26
|
+
import { signInBeat } from "./browser_credential.js";
|
|
27
|
+
import { accountChange, accountNoteLines, changeOps, commitG, joiningMachine, lastAccountState, mintForG, settleG, splitAccountExclusions, } from "./connect_account.js";
|
|
28
|
+
import { agentHookBeat, approvalPending, approvalPendingBeat, askOrCancel, cancelled, disclosure, grantsUnreadableBlock, obtainCredential, sendTestCapture, tail, } from "./connect.js";
|
|
29
|
+
import { writeLines } from "./context.js";
|
|
30
|
+
import { pickerNotListedLines, sawNoSession, scanMachine } from "./scan.js";
|
|
31
|
+
/**
|
|
32
|
+
* `connect` from any folder: scan → picker → disclosure → grant y/N → sign in → hooks → "Capture is on" → backfill offer
|
|
33
|
+
* → URL (§10.12). At most three questions in a run (D7 · 3A): the grant, the workspace (inside the mint, only where
|
|
34
|
+
* 0.6.0 already asks it) and the backfill (PR 5's seam).
|
|
35
|
+
*
|
|
36
|
+
* ⛔ **CONSENT STAYS AHEAD OF THE CREDENTIAL, and nothing before the grant opens a transcript.** The scan, the picker and
|
|
37
|
+
* the offer read directory entries and four Codex index columns only. The grant is written BEFORE the sign-in, as the
|
|
38
|
+
* per-clone consent always was.
|
|
39
|
+
*/
|
|
40
|
+
export async function connectPicker(ctx, options, deps, here,
|
|
41
|
+
/** The working folder's keys, when it is a work tree: the in-repo path probes its session (VQ item 7). */
|
|
42
|
+
keys = null) {
|
|
43
|
+
// ⛔ ONE `finally` FOR `g` (VQ + VT, #88): whatever way a run that holds a credential `g` made ends without committing it — a no,
|
|
44
|
+
// Ctrl+C, Enter, an empty account, a removals-only yes, a failed write, an unexpected throw — it makes one best-effort revoke and
|
|
45
|
+
// clears its write-ahead row. Nothing else revokes: the branches below only SAY how the run ended (`g.end`).
|
|
46
|
+
const g = { credential: null, snapshot: null, origin: "", notes: [], committed: false, end: null };
|
|
47
|
+
try {
|
|
48
|
+
return await connectPickerRun(ctx, options, deps, here, keys, g);
|
|
49
|
+
}
|
|
50
|
+
finally {
|
|
51
|
+
await settleG(ctx, deps, g);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
async function connectPickerRun(ctx, options, deps, here, keys, g) {
|
|
55
|
+
if (grantsUnreadable(ctx.home)) {
|
|
56
|
+
writeLines(ctx.stderr, grantsUnreadableBlock(ctx));
|
|
57
|
+
return EXIT.failure;
|
|
58
|
+
}
|
|
59
|
+
// ⛔ THE NON-TTY REFUSAL COMES BEFORE THE SCAN (VQ + VT, PR 6 item 6): "Nothing was read and nothing was uploaded" stays
|
|
60
|
+
// literally true, and a CI job that pipes `connect` never walks the filesystem. The disclosure still prints first
|
|
61
|
+
// (CR-117), under the picker heading. It names the folder to run it in when `connect` runs INSIDE a repo (`here.kind === "repo"`,
|
|
62
|
+
// the folder `connectPicker` was already given, never one the scan found), cut from the left as the `local:` refusal does; from a
|
|
63
|
+
// folder that is not a repo, and from `$HOME` (a dotfiles repo there is `kind: "folder"` and the run is machine-level), it names none.
|
|
64
|
+
if (!ctx.stdinIsTty) {
|
|
65
|
+
writeLines(ctx.stdout, disclosure(ctx, true));
|
|
66
|
+
writeLines(ctx.stderr, renderErrorBlock({
|
|
67
|
+
kind: "bad",
|
|
68
|
+
code: "CONSENT_NEEDS_TTY",
|
|
69
|
+
what: CONNECT.pickerNonInteractiveWhat,
|
|
70
|
+
why: [CONNECT.pickerNonInteractiveWhy],
|
|
71
|
+
fixLabel: here !== null && here.kind === "repo"
|
|
72
|
+
? CONNECT.nonInteractiveFix(truncatePath(tildePath(here.toplevel, ctx.home), 46))
|
|
73
|
+
: CONNECT.pickerNonInteractiveFix,
|
|
74
|
+
fixes: [connectCommandFor(ctx.env, ctx.selfPath)],
|
|
75
|
+
}, ctx.colour));
|
|
76
|
+
return EXIT.usage;
|
|
77
|
+
}
|
|
78
|
+
// D17: one static beat line, overwritten once with `done` on a terminal. `ctx.colour` is false with no terminal and under
|
|
79
|
+
// NO_COLOR, where it prints plainly with no overwrite. No spinner (§13.8): the bytes are the same at any speed.
|
|
80
|
+
const beat = ` ${SCAN.beat}`;
|
|
81
|
+
if (ctx.colour)
|
|
82
|
+
ctx.stdout.write(`\n${beat}`);
|
|
83
|
+
const scanned = (deps.scan ?? scanMachine)(ctx.home, ctx.env);
|
|
84
|
+
ctx.stdout.write(ctx.colour ? `\r${beat} ${SCAN.beatDone}\n` : `\n${beat} ${SCAN.beatDone}\n`);
|
|
85
|
+
// ⛔ SLICE 2 (S4 part 3). `deps.account` is the account's network; left out, `connect` talks to nobody about grants and behaves as
|
|
86
|
+
// 0.7.0 did. A machine that ALREADY has a credential syncs first, before the model is built, so the "on your account" group is
|
|
87
|
+
// what the server last said; a machine without one has no account to read until it signs in (`g` is how it asks).
|
|
88
|
+
const account = deps.account ?? null;
|
|
89
|
+
const loaded = loadCredential({ env: ctx.env, home: ctx.home });
|
|
90
|
+
const credentialAtStart = loaded.kind === "ok";
|
|
91
|
+
// The first-sync line is said once per run: if this one prints it, the sync after the writes does not.
|
|
92
|
+
let firstSyncSaid = false;
|
|
93
|
+
if (account !== null && credentialAtStart) {
|
|
94
|
+
const first = await syncForVerb(ctx, false, account);
|
|
95
|
+
firstSyncSaid = first.kind === "ran" && first.disclosed === true;
|
|
96
|
+
}
|
|
97
|
+
const read = readGrants(ctx.home);
|
|
98
|
+
const grants = read.kind === "ok" ? read.grants : EMPTY_GRANTS;
|
|
99
|
+
const perClone = readPerClone(ctx.home);
|
|
100
|
+
const accountView = account !== null && credentialAtStart
|
|
101
|
+
? readAccountView(ctx.home, perClone.flatMap((clone) => (clone.slug === null ? [] : [clone.slug])), { kind: "skipped" })
|
|
102
|
+
: null;
|
|
103
|
+
const model = buildModel({
|
|
104
|
+
repos: scanned.repos,
|
|
105
|
+
grants,
|
|
106
|
+
perClone,
|
|
107
|
+
notListed: pickerNotListedLines(scanned.notListed, connectCommandFor(ctx.env, ctx.selfPath)),
|
|
108
|
+
sawNothing: sawNoSession(scanned.notListed, ctx.home),
|
|
109
|
+
here,
|
|
110
|
+
accountNotHere: accountView === null ? [] : accountView.notHere,
|
|
111
|
+
});
|
|
112
|
+
// ⛔ `g` IS OFFERED ONLY WHERE THE CREDENTIAL BEAT WOULD MINT (exception 3): no credential at all (an `absent` file, not a faulty
|
|
113
|
+
// one), a terminal, and a browser to sign in with. The `auth` chain passes no browser and always leaves a credential, so it can
|
|
114
|
+
// never reach this; the same gate as `obtainCredential`'s keeps the two in step.
|
|
115
|
+
const offerAccount = account !== null && loaded.kind === "absent" && ctx.stdinIsTty && deps.browser !== undefined;
|
|
116
|
+
let pick = await choose(ctx, options, deps, model, offerAccount);
|
|
117
|
+
/** The grant block's heading and the repos `g` named, when the list is the account's own. */
|
|
118
|
+
let accountList = null;
|
|
119
|
+
if (pick.kind === "account" && account !== null) {
|
|
120
|
+
const minted = await mintForG(ctx, options, deps, account);
|
|
121
|
+
if (minted.kind === "exit")
|
|
122
|
+
return minted.code;
|
|
123
|
+
g.credential = minted.credential;
|
|
124
|
+
g.notes = minted.notes;
|
|
125
|
+
g.snapshot = minted.snapshot;
|
|
126
|
+
g.origin = minted.origin;
|
|
127
|
+
const change = minted.snapshot === null ? NO_CHANGE : accountChange(minted.snapshot);
|
|
128
|
+
if (isNoChange(change)) {
|
|
129
|
+
// Screen 1c: the account grants nothing (or could not be read). The credential is held; the person chooses here, and a run
|
|
130
|
+
// that ends with nothing granted revokes it (`settleG`).
|
|
131
|
+
writeLines(ctx.stdout, [
|
|
132
|
+
"",
|
|
133
|
+
...wrap(minted.snapshot === null ? PICKER.gUnavailable(connectCommandFor(ctx.env, ctx.selfPath)) : PICKER.gEmpty, 2),
|
|
134
|
+
]);
|
|
135
|
+
pick = await choose(ctx, options, deps, model, false);
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
const known = new Set(model.owners.flatMap((group) => group.repos.map((repo) => repo.slug)));
|
|
139
|
+
accountList = { noClone: new Set(change.addRepos.filter((slug) => !known.has(slug))) };
|
|
140
|
+
pick = { kind: "change", change, noClone: accountList.noClone };
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
/** Nothing was granted: say how the run ended. With a credential `g` made, `settleG` (the `finally`) revokes it and prints the line. */
|
|
144
|
+
const abandon = (ctrlC) => {
|
|
145
|
+
if (g.credential === null)
|
|
146
|
+
return ctrlC ? cancelled(ctx) : EXIT.ok;
|
|
147
|
+
g.end = ctrlC ? "cancelled" : "declined";
|
|
148
|
+
return ctrlC ? EXIT.failure : EXIT.ok;
|
|
149
|
+
};
|
|
150
|
+
if (pick.kind === "cancel" || pick.kind === "account")
|
|
151
|
+
return abandon(true);
|
|
152
|
+
if (pick.kind === "none" || isNoChange(pick.change)) {
|
|
153
|
+
// Enter is "change nothing" (D5): no grant, no credential, and a completed consent flow (§13.7).
|
|
154
|
+
const on = machineCapture(ctx.home);
|
|
155
|
+
const line = on.kind === "on" ? PICKER.noChanges(machineSummary(on)) : PICKER.nothingGranted(connectCommandFor(ctx.env, ctx.selfPath));
|
|
156
|
+
writeLines(ctx.stdout, ["", ...wrap(line, 2)]);
|
|
157
|
+
return abandon(false);
|
|
158
|
+
}
|
|
159
|
+
// A repo the ACCOUNT turned off, picked as an ordinary add, is a re-include: it gets its own `turn on` row (the yes wins).
|
|
160
|
+
const accountState = account !== null && accountList === null ? lastAccountState(ctx.home) : null;
|
|
161
|
+
const split = splitAccountExclusions(pick.change, accountState === null ? [] : accountState.excluded);
|
|
162
|
+
const change = split.change;
|
|
163
|
+
// One disclosure and one y/N cover additions and removals together, and a No changes nothing. Removals alone skip the
|
|
164
|
+
// disclosure and ask the stop question (§10.12 "The grant y/N").
|
|
165
|
+
const facts = { reposHere: reposByOwner(model), noClone: pick.noClone, accountOff: split.accountOff };
|
|
166
|
+
writeLines(ctx.stdout, hasAdditions(change) ? ["", ...disclosure(ctx, true)] : [""]);
|
|
167
|
+
writeLines(ctx.stdout, renderGrantBlock(change, facts, ctx.colour, accountList === null ? PICKER.chose : PICKER.accountGrants));
|
|
168
|
+
const answer = await askOrCancel(ctx, grantQuestion(change, ctx.colour, CONNECT.consentAnswers));
|
|
169
|
+
if (answer === null)
|
|
170
|
+
return abandon(true);
|
|
171
|
+
if (!isAffirmative(answer)) {
|
|
172
|
+
if (g.credential === null)
|
|
173
|
+
writeLines(ctx.stdout, ["", ...wrap(CONNECT.declined, 2)]);
|
|
174
|
+
return abandon(false);
|
|
175
|
+
}
|
|
176
|
+
// The ops the account is to hear about go into the SAME write as the grants: one `updateGrants`, so a crash cannot leave one
|
|
177
|
+
// without the other. The account's own list (`g`) is already on the account and needs none.
|
|
178
|
+
const queueOps = account !== null && accountList === null;
|
|
179
|
+
try {
|
|
180
|
+
applyChange(ctx, model, change, queueOps);
|
|
181
|
+
}
|
|
182
|
+
catch (error) {
|
|
183
|
+
if (!(error instanceof GrantsUnreadableError))
|
|
184
|
+
throw error;
|
|
185
|
+
// Raced with an edit of `grants.json` since the check above. Nothing was written.
|
|
186
|
+
writeLines(ctx.stderr, grantsUnreadableBlock(ctx));
|
|
187
|
+
return EXIT.failure;
|
|
188
|
+
}
|
|
189
|
+
if (!hasAdditions(change)) {
|
|
190
|
+
writeLines(ctx.stdout, ["", ...wrap(PICKER.stopped, 2)]);
|
|
191
|
+
// Removals reach the account too; nothing more to say about it.
|
|
192
|
+
if (queueOps && credentialAtStart)
|
|
193
|
+
await syncForVerb(ctx, false, account, { quietFirst: firstSyncSaid });
|
|
194
|
+
// A removals-only yes grants nothing: a credential `g` is holding is not kept (`settleG` revokes it).
|
|
195
|
+
return abandon(false);
|
|
196
|
+
}
|
|
197
|
+
if (options.signIn === true) {
|
|
198
|
+
const code = await signInBeat(ctx, { retry: "sign-in", verify: true, ...(deps.fetch === undefined ? {} : { fetch: deps.fetch }) });
|
|
199
|
+
if (code !== EXIT.ok)
|
|
200
|
+
return code;
|
|
201
|
+
}
|
|
202
|
+
// ⛔ THE COMMIT, in this order: the grants (written above), then `credentials.json`, then the write-ahead row's deletion.
|
|
203
|
+
const committed = g.credential === null ? "committed" : commitG(ctx, g);
|
|
204
|
+
if (committed !== "committed") {
|
|
205
|
+
// The row was settled by another command, or a concurrent mint holds credentials.json: nothing is saved, the finally revokes the
|
|
206
|
+
// token held in memory, the grants already written stay, and the exit is 1 — never the exit-3 "connected over a dead credential".
|
|
207
|
+
g.end = committed;
|
|
208
|
+
return EXIT.failure;
|
|
209
|
+
}
|
|
210
|
+
const got = await obtainCredential(ctx, deps, options, "repos");
|
|
211
|
+
if (got.kind === "exit")
|
|
212
|
+
return got.code;
|
|
213
|
+
// The credential exists now. A machine that had none was just minted one (by the beat above, or by `g`): its first sync is the
|
|
214
|
+
// moment the server learns what this machine named; one that already had one syncs again only if this run queued something.
|
|
215
|
+
const minted = !credentialAtStart;
|
|
216
|
+
let joined = [];
|
|
217
|
+
/** What the sync after the writes answered, or `null` when none was needed. A sync that did not tell the account is said under "Capture is on". */
|
|
218
|
+
let accountSync = null;
|
|
219
|
+
/** Ctrl+C at the joining question: a No, and nothing more is asked (the backfill offer below is a question). */
|
|
220
|
+
let askedNoMore = false;
|
|
221
|
+
if (account !== null) {
|
|
222
|
+
if (minted || queueOps) {
|
|
223
|
+
// ONE bounded sync after the writes and before "Capture is on" (VQ, on VT's question): a repo granted or re-included in this
|
|
224
|
+
// run is admitted in this run, not at the next verb. Silent on failure; `pending` is kept and the line below says so.
|
|
225
|
+
const after = await syncForVerb(ctx, false, account, { quietFirst: firstSyncSaid });
|
|
226
|
+
accountSync = after;
|
|
227
|
+
if (after.kind === "ran" && after.disclosed === true)
|
|
228
|
+
firstSyncSaid = true;
|
|
229
|
+
}
|
|
230
|
+
// ⛔ SCREEN 2 — only for a machine that did NOT know the account when it showed the picker, after its own y/N, the credential
|
|
231
|
+
// and the first sync, and BEFORE the hooks step so the hooks cover every clone named. A machine that already had a credential
|
|
232
|
+
// saw the account's grants in the picker's "on your account" group and chose among them there.
|
|
233
|
+
if (minted && g.credential === null) {
|
|
234
|
+
const join = await joiningMachine(ctx, account, CONNECT.consentAnswers, firstSyncSaid);
|
|
235
|
+
joined = join.names;
|
|
236
|
+
askedNoMore = join.cancelled;
|
|
237
|
+
// The joining question's sync is the latest word on whether the account was told: it gets the same handling.
|
|
238
|
+
if (join.sync !== null)
|
|
239
|
+
accountSync = join.sync;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
// L11: the hooks print first. Commit hooks for every clone found of what is now on, then the agent hooks.
|
|
243
|
+
const on = onSlugs(ctx, model, change);
|
|
244
|
+
const onRepos = scanned.repos.filter((repo) => on(normalizeSlug(repo.slug)));
|
|
245
|
+
const clones = [
|
|
246
|
+
...new Set([
|
|
247
|
+
...onRepos.flatMap((repo) => repo.clones.map((clone) => clone.path)),
|
|
248
|
+
...(here !== null && here.kind === "repo" && on(normalizeSlug(here.slug)) ? [here.toplevel] : []),
|
|
249
|
+
]),
|
|
250
|
+
];
|
|
251
|
+
commitHooksStep(ctx, clones);
|
|
252
|
+
agentHookBeat(ctx);
|
|
253
|
+
// ⛔ IN A REPO, THE TEST CAPTURE RUNS BEFORE "Capture is on", AND ITS OUTCOME PICKS THE ENDING (VQ item 7, adopting VT).
|
|
254
|
+
// 0.6.0's payoff was evidence — this session, recorded, with a link — and "Capture is on" printed ahead of a result that
|
|
255
|
+
// can contradict it (an org that has not approved capture) would say the opposite of what happens next. So: hooks
|
|
256
|
+
// (L11), then the probe inside ONE hook budget (the same call the `local:` path makes), then either the held beat or
|
|
257
|
+
// "Capture is on" with the session link as the one URL line. From `~` there is no session to probe and nothing changes.
|
|
258
|
+
let probe = null;
|
|
259
|
+
if (keys !== null && here !== null && here.kind === "repo" && on(normalizeSlug(here.slug))) {
|
|
260
|
+
const { hasLocator, found } = locateTranscript(ctx, keys.worktree);
|
|
261
|
+
const { delivery } = hasLocator && found === null
|
|
262
|
+
? { delivery: null }
|
|
263
|
+
: await sendTestCapture(ctx, keys, got.credential, found);
|
|
264
|
+
probe = { hasLocator, found, delivery };
|
|
265
|
+
const pending = approvalPending(delivery);
|
|
266
|
+
if (pending !== null) {
|
|
267
|
+
// `capture_not_approved` for THIS repo (CR-110, D81): armed, waiting on an owner. Never "Capture is on" over it, and no
|
|
268
|
+
// offer to upload more into a refusal. `deliver` has recorded it, so `status` says the same.
|
|
269
|
+
approvalPendingBeat(ctx, keys.worktree, pending.ownersNotified);
|
|
270
|
+
return tail(ctx, got.unconfirmed);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
// D18 · D19: "Capture is on" before the optional upload, so it is on screen within seconds of the sign-in.
|
|
274
|
+
// The block cannot know whether an organization has approved capture for a repo it did not probe: it says one may need to,
|
|
275
|
+
// when a granted owner is not the person's own account. In a repo the owner the test capture CHECKED is left out.
|
|
276
|
+
const checkedOwner = probe !== null && here !== null && answeredWith2xx(probe.delivery) ? ownerOfSlug(normalizeSlug(here.slug)) : null;
|
|
277
|
+
captureOnBlock(ctx, model, change, clones.length === 0, otherOwnersCaveat(ctx, got.credential, checkedOwner), joined, accountNoteLines(ctx, accountSync));
|
|
278
|
+
// The backfill offer. Left out (`deps.backfill`), no offer is made and the ending is the one after a no. The URL follows
|
|
279
|
+
// what LANDED (D19): the conversations list once at least one session was uploaded, whether the run finished or stopped.
|
|
280
|
+
let url = probeUrl(probe);
|
|
281
|
+
if (deps.backfill !== undefined && onRepos.length > 0 && !askedNoMore) {
|
|
282
|
+
const outcome = await deps.backfill(ctx, onRepos);
|
|
283
|
+
if (outcome.kind !== "declined" && outcome.uploaded > 0)
|
|
284
|
+
url = URLS.conversations;
|
|
285
|
+
}
|
|
286
|
+
writeLines(ctx.stdout, ["", ` ${paint(ctx.colour, "accent", url)}`]);
|
|
287
|
+
return tail(ctx, got.unconfirmed);
|
|
288
|
+
}
|
|
289
|
+
/** Where the current session's transcript is, per the dialect's locator: `hasLocator` is false for an agent that has none. */
|
|
290
|
+
function locateTranscript(ctx, projectKey) {
|
|
291
|
+
const locate = dialectFor(ctx.agentId).locateCurrentTranscript;
|
|
292
|
+
return { hasLocator: locate !== undefined, found: locate === undefined ? null : locate(ctx.home, ctx.env, projectKey) };
|
|
293
|
+
}
|
|
294
|
+
/** Did the server answer any delta of the test capture with a 2xx? (`ok`, or a `later` that carries delta 1's session id.) */
|
|
295
|
+
function answeredWith2xx(delivery) {
|
|
296
|
+
return delivery?.kind === "attempted" && (delivery.disposition === "ok" || delivery.conversationId !== undefined);
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* Does any granted owner differ from the signed-in person's own GitHub handle? (Alexander, 2026-10-24: "Caveat for other
|
|
300
|
+
* owners".) Compared case-insensitively over the owners granted whole AND the owners of repos granted one by one; an `account`
|
|
301
|
+
* the server did not give (`null`) cannot be shown to match, so it counts as differing. Nothing granted, nothing to caveat.
|
|
302
|
+
* `account` is whatever the whoami probe or the mint recorded for this credential, so it is known by the time the block prints.
|
|
303
|
+
*
|
|
304
|
+
* ⛔ **IN A REPO, THE CHECKED OWNER DOES NOT COUNT** (Alexander, 17:20). "Checked" means the server answered ANY delta of the
|
|
305
|
+
* test capture with a 2xx — the delivery is `ok`, or it carries a `conversationId` (after PR 4a a big session can get a 2xx on
|
|
306
|
+
* delta 1 and a timeout on delta 2, which combines to `later` with delta 1's id; a 2xx proves the org approved). Every other
|
|
307
|
+
* outcome — no transcript, a `later`, a network loss — leaves this repo's owner unchecked, and it counts like any other.
|
|
308
|
+
*/
|
|
309
|
+
function otherOwnersCaveat(ctx, credential, checkedOwner) {
|
|
310
|
+
const on = machineCapture(ctx.home);
|
|
311
|
+
if (on.kind !== "on")
|
|
312
|
+
return false;
|
|
313
|
+
// The owner of the repo the test capture just checked is not "another owner": the server answered for it (see `checkedOwner`).
|
|
314
|
+
const skip = checkedOwner === null ? null : checkedOwner.toLowerCase();
|
|
315
|
+
const owners = [...on.grants.owners, ...on.grants.repos.map(ownerOfSlug)].filter((o) => o !== "" && o.toLowerCase() !== skip);
|
|
316
|
+
if (owners.length === 0)
|
|
317
|
+
return false;
|
|
318
|
+
const account = metaFor(ctx.home, credentialFingerprint(credential))?.account ?? null;
|
|
319
|
+
if (account === null)
|
|
320
|
+
return true;
|
|
321
|
+
const own = account.toLowerCase();
|
|
322
|
+
return owners.some((owner) => owner.toLowerCase() !== own);
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* The one URL line after "Capture is on". From `~` (no probe) it is the dashboard, as after a no. In a repo it is the
|
|
326
|
+
* recorded session's own page when the 2xx carried its id (`DX D8`); the captures list where 0.6.0 falls back to it (a
|
|
327
|
+
* delivery with no id, an agent with no locator); and the dashboard when there was no transcript to link.
|
|
328
|
+
*/
|
|
329
|
+
function probeUrl(probe) {
|
|
330
|
+
if (probe === null)
|
|
331
|
+
return URLS.dashboard;
|
|
332
|
+
if (probe.hasLocator && probe.found === null)
|
|
333
|
+
return URLS.dashboard;
|
|
334
|
+
const id = probe.delivery?.kind === "attempted" ? probe.delivery.conversationId : undefined;
|
|
335
|
+
return id === undefined ? URLS.commits : URLS.conversation(id);
|
|
336
|
+
}
|
|
337
|
+
/** The checklist when a person is driving a real terminal (D28); the typed prompt otherwise. */
|
|
338
|
+
function useChecklist(ctx, options, model) {
|
|
339
|
+
if (options.typed === true || !ctx.stdinIsTty)
|
|
340
|
+
return false;
|
|
341
|
+
const out = ctx.stdout;
|
|
342
|
+
if (out.isTTY !== true || ctx.env.TERM === "dumb")
|
|
343
|
+
return false;
|
|
344
|
+
// The frame is erased by line count, so a terminal narrower than the frame (which soft-wraps) would leave debris. A width
|
|
345
|
+
// of 0 or none is a terminal that does not say, which is not a narrow one.
|
|
346
|
+
if (out.columns !== undefined && out.columns > 0 && out.columns < 80)
|
|
347
|
+
return false;
|
|
348
|
+
return model.onNow.length + model.owners.length + model.account.length + model.turnedOff.length > 0;
|
|
349
|
+
}
|
|
350
|
+
async function choose(ctx, options, deps, model,
|
|
351
|
+
/** Slice 2: `g` is a choice here (screen 1a). */
|
|
352
|
+
offerAccount) {
|
|
353
|
+
const nowMs = ctx.now().getTime();
|
|
354
|
+
if (useChecklist(ctx, options, model)) {
|
|
355
|
+
const result = await runChecklist(model, { colour: ctx.colour, nowMs, typedCommand: channelCommand(ctx.env, ctx.selfPath, COMMANDS.connectTyped), offerAccount }, { input: deps.checklist?.input ?? process.stdin, output: ctx.stdout, ...deps.checklist });
|
|
356
|
+
if (result.kind === "cancel")
|
|
357
|
+
return { kind: "cancel" };
|
|
358
|
+
if (result.kind === "account")
|
|
359
|
+
return { kind: "account" };
|
|
360
|
+
if (result.kind === "done")
|
|
361
|
+
return { kind: "change", change: result.change, noClone: new Set() };
|
|
362
|
+
// `t`: the typed prompt, from the same model.
|
|
363
|
+
}
|
|
364
|
+
return await typedPick(ctx, model, nowMs, offerAccount);
|
|
365
|
+
}
|
|
366
|
+
/** How many answers in a row the typed prompt will refuse before it gives up. */
|
|
367
|
+
const MAX_MISSES = 10;
|
|
368
|
+
/** The typed prompt (§10.12 "The picker, typed"): re-asks on any token it does not understand, never applying part. */
|
|
369
|
+
async function typedPick(ctx, model, nowMs, offerAccount) {
|
|
370
|
+
const pre = preChange(model);
|
|
371
|
+
let showAll = false;
|
|
372
|
+
for (;;) {
|
|
373
|
+
writeLines(ctx.stdout, renderTyped(model, { colour: ctx.colour, nowMs, showAll, offerAccount }));
|
|
374
|
+
let misses = 0;
|
|
375
|
+
for (;;) {
|
|
376
|
+
const answer = await askOrCancel(ctx, ` ${PICKER.promptMark}`);
|
|
377
|
+
if (answer === null)
|
|
378
|
+
return { kind: "cancel" };
|
|
379
|
+
const parsed = parseTyped(answer, model, showAll, offerAccount);
|
|
380
|
+
if (parsed.kind === "account")
|
|
381
|
+
return { kind: "account" };
|
|
382
|
+
if (parsed.kind === "more") {
|
|
383
|
+
// `more` reprints with every repo shown and numbered afresh, then asks again. Nothing is chosen yet.
|
|
384
|
+
showAll = true;
|
|
385
|
+
break;
|
|
386
|
+
}
|
|
387
|
+
if (parsed.kind === "error") {
|
|
388
|
+
writeLines(ctx.stdout, notUnderstoodLines(parsed.tokens));
|
|
389
|
+
// A prompt that re-asks without end is a hang for anything driving it (a closed input, a script). Ten misses in a
|
|
390
|
+
// row is somebody who is not going to get there: treat it as the Ctrl+C it is, which changes nothing.
|
|
391
|
+
misses += 1;
|
|
392
|
+
if (misses >= MAX_MISSES)
|
|
393
|
+
return { kind: "cancel" };
|
|
394
|
+
continue;
|
|
395
|
+
}
|
|
396
|
+
if (parsed.kind === "empty") {
|
|
397
|
+
// Enter. A pre-selected repo (D34) is the one thing Enter leads to the y/N with; otherwise it changes nothing.
|
|
398
|
+
return pre === null ? { kind: "none" } : { kind: "change", change: pre, noClone: new Set() };
|
|
399
|
+
}
|
|
400
|
+
return { kind: "change", change: parsed.change, noClone: new Set(parsed.noClone) };
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
/** How many repos an owner row covers HERE: the same count the owner row printed (`a1 all 2 repos here`), so they agree. */
|
|
405
|
+
function reposByOwner(model) {
|
|
406
|
+
return new Map(model.owners.map((group) => [normalizeOwner(group.owner), group.repos.length]));
|
|
407
|
+
}
|
|
408
|
+
/**
|
|
409
|
+
* Write the change. `grants.json` first (atomic, and it THROWS rather than overwrite a file it cannot read), then the
|
|
410
|
+
* per-clone consents a removal withdraws. A turned-off repo that is chosen again is re-included here: removing it from
|
|
411
|
+
* `excluded` is the exclusion lifting, and only this yes does it (`off`'s contract). It joins `repos` unless an owner
|
|
412
|
+
* grant already covers it.
|
|
413
|
+
*/
|
|
414
|
+
function applyChange(ctx, model, change, queueOps) {
|
|
415
|
+
updateGrants(ctx.home, (g) => {
|
|
416
|
+
const owners = [...new Set([...g.owners.filter((o) => !change.stopOwners.includes(o)), ...change.addOwners])];
|
|
417
|
+
const covered = (slug) => owners.includes(ownerOfSlug(slug));
|
|
418
|
+
return {
|
|
419
|
+
disclosed_at: hasAdditions(change) ? ctx.now().toISOString() : g.disclosed_at,
|
|
420
|
+
owners,
|
|
421
|
+
repos: [
|
|
422
|
+
...g.repos.filter((r) => !change.stopRepos.includes(r)),
|
|
423
|
+
...change.addRepos,
|
|
424
|
+
...change.turnOn.filter((slug) => !covered(slug)),
|
|
425
|
+
],
|
|
426
|
+
excluded: g.excluded.filter((x) => !change.turnOn.includes(x)),
|
|
427
|
+
refused: g.refused,
|
|
428
|
+
// Slice 2: what the account is to hear, queued in the same write (the last word on each axis wins: `mergePending`).
|
|
429
|
+
pending: queueOps ? mergePending(g.pending, changeOps(change, covered), ctx.now()) : g.pending,
|
|
430
|
+
synced_at: g.synced_at,
|
|
431
|
+
};
|
|
432
|
+
});
|
|
433
|
+
for (const slug of change.stopClones) {
|
|
434
|
+
for (const row of model.onNow) {
|
|
435
|
+
if (row.kind !== "clone" || row.key !== slug)
|
|
436
|
+
continue;
|
|
437
|
+
for (const commonDir of row.commonDirs)
|
|
438
|
+
revokeProject(ctx.home, commonDir);
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
/** Is this slug on once `change` is applied? Reads the grants just written, and keeps the per-clone consents not withdrawn. */
|
|
443
|
+
function onSlugs(ctx, model, change) {
|
|
444
|
+
const read = readGrants(ctx.home);
|
|
445
|
+
const grants = read.kind === "ok" ? read.grants : EMPTY_GRANTS;
|
|
446
|
+
const kept = new Set(model.onNow.filter((r) => r.kind === "clone" && !change.stopClones.includes(r.key)).map((r) => r.key));
|
|
447
|
+
return (slug) => !grants.excluded.includes(slug) &&
|
|
448
|
+
(grants.owners.includes(ownerOfSlug(slug)) || grants.repos.includes(slug) || kept.has(slug));
|
|
449
|
+
}
|
|
450
|
+
/** `~/code/x core.hooksPath is set` — one exception row, the path cut from the left to leave the reason room (§13.4). */
|
|
451
|
+
function exceptionRow(ctx, path, reason) {
|
|
452
|
+
const room = 80 - 4 - 3 - reason.length;
|
|
453
|
+
return ` ${paint(ctx.colour, "muted", `${truncatePath(tildePath(path, ctx.home), room)} ${reason}`)}`;
|
|
454
|
+
}
|
|
455
|
+
/**
|
|
456
|
+
* The hooks step (D13 · 7A): one beat line with a count, then an exceptions block naming ONLY the clones where hooks were
|
|
457
|
+
* not added, each with its path and reason, the fix last. `connect` runs with the user watching, so it chains a clone's
|
|
458
|
+
* existing hook (kept, runs first) and counts it as added. The only skip is `core.hooksPath`; a failed write is listed too.
|
|
459
|
+
* ⚠ Never changes the exit code, for `commitHookBeat`'s reason.
|
|
460
|
+
*/
|
|
461
|
+
function commitHooksStep(ctx, clones) {
|
|
462
|
+
if (clones.length === 0)
|
|
463
|
+
return;
|
|
464
|
+
const beat = ` ${PICKER.hooksBeat(clones.length)}`;
|
|
465
|
+
if (ctx.colour)
|
|
466
|
+
ctx.stdout.write(`\n${beat}`);
|
|
467
|
+
let added = 0;
|
|
468
|
+
let chained = 0;
|
|
469
|
+
const skipped = [];
|
|
470
|
+
for (const path of clones) {
|
|
471
|
+
const verdict = installCaptureHooks(path, ctx.selfPath).commit;
|
|
472
|
+
if (verdict.kind === "hooks-path")
|
|
473
|
+
skipped.push({ path, reason: PICKER.hooksPathReason, hooksPath: true });
|
|
474
|
+
else if (verdict.kind === "failed")
|
|
475
|
+
skipped.push({ path, reason: PICKER.hooksFailedReason, hooksPath: false });
|
|
476
|
+
else {
|
|
477
|
+
added += 1;
|
|
478
|
+
if (verdict.kind === "chained")
|
|
479
|
+
chained += 1;
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
const done = `${beat.padEnd(45)} ${PICKER.hooksDone}`;
|
|
483
|
+
ctx.stdout.write(ctx.colour ? `\r${done}\n` : `\n${done}\n`);
|
|
484
|
+
writeLines(ctx.stdout, [` ${paint(ctx.colour, "muted", PICKER.hooksCount(added, chained, skipped.length))}`]);
|
|
485
|
+
if (skipped.length === 0)
|
|
486
|
+
return;
|
|
487
|
+
// ⛔ EACH EXCEPTION GETS ITS OWN FIX, and only its own: `core.hooksPath` gets the shipped unset/chain pair, a write that
|
|
488
|
+
// failed gets `vibecommit connect` (run in that clone, it adds the hook with the person watching), and neither is
|
|
489
|
+
// shown the other's. Session capture is unaffected by either, so that is said once.
|
|
490
|
+
const hooksPathHit = skipped.some((s) => s.hooksPath);
|
|
491
|
+
const failedHit = skipped.some((s) => !s.hooksPath);
|
|
492
|
+
writeLines(ctx.stdout, [
|
|
493
|
+
"",
|
|
494
|
+
paint(ctx.colour, "warn", ` ${PICKER.hooksNotAdded(skipped.length)}`),
|
|
495
|
+
...skipped.map((s) => exceptionRow(ctx, s.path, s.reason)),
|
|
496
|
+
...wrap(hooksPathHit ? PICKER.hooksStillCaptured : PICKER.hooksStillCapturedOther, 2),
|
|
497
|
+
...(hooksPathHit
|
|
498
|
+
? [COMMIT_HOOK.hooksPathFixUnset, COMMIT_HOOK.hooksPathFixManual(channelCommand(ctx.env, ctx.selfPath, COMMANDS.postCommit))].map((fix) => ` ${paint(ctx.colour, "accent", fix)}`)
|
|
499
|
+
: []),
|
|
500
|
+
...(failedHit
|
|
501
|
+
? [...wrap(PICKER.hooksFailedFixLabel, 2), ` ${paint(ctx.colour, "accent", connectCommandFor(ctx.env, ctx.selfPath))}`]
|
|
502
|
+
: []),
|
|
503
|
+
]);
|
|
504
|
+
}
|
|
505
|
+
/**
|
|
506
|
+
* "Capture is on" (D18 · 12A, D19 · 13A): what is on, then the first proof to expect (§10.1 state 4). A new laptop whose
|
|
507
|
+
* granted owner has no clone here gets its own block. ⛔ **No variant says "Nothing else to do"**: that line stays on the
|
|
508
|
+
* 0.6.0 in-repo screen only.
|
|
509
|
+
*/
|
|
510
|
+
function captureOnBlock(ctx, model, change, noClones,
|
|
511
|
+
/** The "other owners" caveat, for owners the test capture did not check: see `otherOwnersCaveat`. */
|
|
512
|
+
caveat,
|
|
513
|
+
/** What the joining-machine question (screen 2) named here, for the new-laptop line. */
|
|
514
|
+
joined = [],
|
|
515
|
+
/** Muted lines under the block when the sync after the writes did not tell the account (`accountNoteLines`). */
|
|
516
|
+
untold = []) {
|
|
517
|
+
// What is on NOW, read back from disk after the write: the same counts `status` and `auth` give.
|
|
518
|
+
const summary = machineSummary(machineCapture(ctx.home));
|
|
519
|
+
if (noClones) {
|
|
520
|
+
const names = [
|
|
521
|
+
...model.onNow.filter((r) => !change.stopOwners.includes(r.key) && !change.stopRepos.includes(r.key) && !change.stopClones.includes(r.key)).map((r) => (r.kind === "owner" ? `${r.key}/` : r.key)),
|
|
522
|
+
...change.addOwners.map((o) => `${o}/`),
|
|
523
|
+
...change.addRepos,
|
|
524
|
+
...change.turnOn,
|
|
525
|
+
...joined,
|
|
526
|
+
];
|
|
527
|
+
writeLines(ctx.stdout, [
|
|
528
|
+
"",
|
|
529
|
+
...renderErrorBlock({
|
|
530
|
+
kind: "ok",
|
|
531
|
+
what: PICKER.onNewLaptop(names.length <= 3 ? names.join(", ") : summary),
|
|
532
|
+
why: [PICKER.onNewLaptopProof, AGENT_HOOKS.codexTrust, ...(caveat ? [PICKER.ownerApproval(channelCommand(ctx.env, ctx.selfPath, COMMANDS.status))] : [])],
|
|
533
|
+
}, ctx.colour),
|
|
534
|
+
...untold,
|
|
535
|
+
]);
|
|
536
|
+
return;
|
|
537
|
+
}
|
|
538
|
+
writeLines(ctx.stdout, [
|
|
539
|
+
"",
|
|
540
|
+
...renderErrorBlock({
|
|
541
|
+
kind: "ok",
|
|
542
|
+
what: PICKER.onFor(summary),
|
|
543
|
+
why: [PICKER.onProof, AGENT_HOOKS.codexTrust, ...(caveat ? [PICKER.ownerApproval(channelCommand(ctx.env, ctx.selfPath, COMMANDS.status))] : [])],
|
|
544
|
+
}, ctx.colour),
|
|
545
|
+
...untold,
|
|
546
|
+
...wrap(`${PICKER.stopOne} ${channelCommand(ctx.env, ctx.selfPath, COMMANDS.off)}`, 2),
|
|
547
|
+
]);
|
|
548
|
+
}
|
|
549
|
+
//# sourceMappingURL=connect_picker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connect_picker.js","sourceRoot":"","sources":["../../src/commands/connect_picker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACnG,OAAO,EACL,YAAY,EACZ,qBAAqB,EACrB,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,aAAa,EACb,WAAW,EACX,UAAU,EACV,aAAa,EACb,YAAY,GAEb,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,cAAc,EAAyB,MAAM,kBAAkB,CAAC;AACzE,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,WAAW,EAAiB,MAAM,mBAAmB,CAAC;AAChF,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,mB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GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;aAC1J,EACD,GAAG,CAAC,MAAM,CACX;YACD,GAAG,MAAM;SACV,CAAC,CAAC;QACH,OAAO;IACT,CAAC;IACD,UAAU,CAAC,GAAG,CAAC,MAAM,EAAE;QACrB,EAAE;QACF,GAAG,gBAAgB,CACjB;YACE,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC;YAC3B,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,WAAW,CAAC,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;SACjJ,EACD,GAAG,CAAC,MAAM,CACX;QACD,GAAG,MAAM;QACT,GAAG,IAAI,CAAC,GAAG,MAAM,CAAC,OAAO,IAAI,cAAc,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC;KACvF,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
* the risk of a test run touching the developer's own credentials.
|
|
8
8
|
*/
|
|
9
9
|
import type { Writable } from "node:stream";
|
|
10
|
+
import { type JsonVerb } from "../json.js";
|
|
11
|
+
import { type ErrorBlock } from "../term.js";
|
|
10
12
|
export interface CommandContext {
|
|
11
13
|
readonly env: NodeJS.ProcessEnv;
|
|
12
14
|
readonly home: string;
|
|
@@ -43,3 +45,17 @@ export interface CommandContext {
|
|
|
43
45
|
readonly agentId?: string;
|
|
44
46
|
}
|
|
45
47
|
export declare function writeLines(stream: Writable, lines: readonly string[]): void;
|
|
48
|
+
/**
|
|
49
|
+
* A `bad` block, written the way the verb's mode wants it: under `--json` ONE failure document on stdout and nothing on
|
|
50
|
+
* stderr; otherwise §13.6's block on stderr. `lead` is the blank line some callers print before the block.
|
|
51
|
+
*/
|
|
52
|
+
export declare function writeFailure(ctx: CommandContext, block: Extract<ErrorBlock, {
|
|
53
|
+
kind: "bad";
|
|
54
|
+
}>, json?: JsonVerb | null, lead?: readonly string[]): void;
|
|
55
|
+
/**
|
|
56
|
+
* `NOT_A_REPO` — the one block `why`, `report` and `finalize` share. Names the folder (tilde, cut from the LEFT so the
|
|
57
|
+
* end that identifies it stays, §13.4) and says where to run it; there is no command to type, so the fix is a label.
|
|
58
|
+
*/
|
|
59
|
+
export declare function notAGitRepoBlock(ctx: CommandContext): Extract<ErrorBlock, {
|
|
60
|
+
kind: "bad";
|
|
61
|
+
}>;
|