@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
package/dist/picker.d.ts
ADDED
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `connect` picker — style guide §10.12, design review D5-D35; capture 0.7.0, PR 3.
|
|
3
|
+
*
|
|
4
|
+
* Which repositories does the person want captured? This module is the PURE half: it turns a `scan` result and the
|
|
5
|
+
* grants already on disk into rows, parses what the person types, renders the typed screen and the `You chose:` block,
|
|
6
|
+
* and says what a choice changes. It reads no file, opens no transcript and writes nothing — `connect` supplies the
|
|
7
|
+
* facts and applies the change, and `picker_checklist.ts` is the arrow-key driver over the same model.
|
|
8
|
+
*
|
|
9
|
+
* ## What the rows are
|
|
10
|
+
*
|
|
11
|
+
* on now grants and per-clone consents that are already admitting capture. REMOVABLE (D31): unticking one, or
|
|
12
|
+
* typing `-N`, deletes the grant. It is not an exclusion (`off` is), so the repo can be chosen again.
|
|
13
|
+
* owners one group per owner NOT yet granted, its repos behind an `aN` "all, including repos you clone later"
|
|
14
|
+
* row (D9: at most 8 repos before `+ N more`).
|
|
15
|
+
* turned off slugs in `excluded`. Choosing one is a re-include; the grant block names it on a `turn on` row, inside
|
|
16
|
+
* the same y/N (D7 · 3A), and only a yes clears the exclusion.
|
|
17
|
+
* on your account (slice 2) what the account grants that this machine has not named. Unticked until chosen, like any
|
|
18
|
+
* row: choosing one is an ordinary addition, so it goes through the same disclosure and y/N (R3-8, R3-9).
|
|
19
|
+
*
|
|
20
|
+
* ⛔ **A pre-tick is not a consent** (D34): the working folder's repo starts ticked, and Enter on it leads to the naming
|
|
21
|
+
* y/N, which defaults to N. It is an ADDITION to the diff, never part of the baseline.
|
|
22
|
+
*/
|
|
23
|
+
import { type Grants } from "./consent.js";
|
|
24
|
+
import type { ScanClone, ScanRepo } from "./commands/scan.js";
|
|
25
|
+
import type { AgentId } from "./agents/types.js";
|
|
26
|
+
/** D9: each owner group shows at most this many repos before the `+ N more` row. */
|
|
27
|
+
export declare const GROUP_CAP = 8;
|
|
28
|
+
/** An agent session summary shared by the repo rows. */
|
|
29
|
+
interface Counts {
|
|
30
|
+
readonly sessions: number;
|
|
31
|
+
readonly sinceMs: number;
|
|
32
|
+
readonly agents: Readonly<Record<AgentId, number>>;
|
|
33
|
+
}
|
|
34
|
+
/** A repo the person can add. `synthetic` rows come from the working folder, not from the scan. */
|
|
35
|
+
export interface PickRepo extends Counts {
|
|
36
|
+
readonly slug: string;
|
|
37
|
+
readonly owner: string;
|
|
38
|
+
readonly name: string;
|
|
39
|
+
readonly clones: readonly ScanClone[];
|
|
40
|
+
readonly latestMs: number;
|
|
41
|
+
/** The working folder's repo (D34). */
|
|
42
|
+
readonly here: "repo" | "folder" | null;
|
|
43
|
+
/** Starts ticked in the checklist. Only ever the working folder's repo, and only when it is not `$HOME`. */
|
|
44
|
+
readonly pre: boolean;
|
|
45
|
+
}
|
|
46
|
+
/** One `on now` row. `kind` says what removing it deletes. */
|
|
47
|
+
export interface OnNowRow {
|
|
48
|
+
readonly kind: "owner" | "repo" | "clone";
|
|
49
|
+
/** `alexvibecommit` (owner) or a slug. */
|
|
50
|
+
readonly key: string;
|
|
51
|
+
readonly reason: string;
|
|
52
|
+
readonly counts: Counts | null;
|
|
53
|
+
/** Repos found here under an owner row. */
|
|
54
|
+
readonly reposHere: number;
|
|
55
|
+
/** The common dirs a per-clone row stands for (removed together). */
|
|
56
|
+
readonly commonDirs: readonly string[];
|
|
57
|
+
}
|
|
58
|
+
export interface OwnerGroup {
|
|
59
|
+
readonly owner: string;
|
|
60
|
+
/** `a1`, `a2`, … */
|
|
61
|
+
readonly token: string;
|
|
62
|
+
/** Every repo under the owner not already on and not turned off, newest session first. */
|
|
63
|
+
readonly repos: readonly PickRepo[];
|
|
64
|
+
}
|
|
65
|
+
export interface TurnedOffRow {
|
|
66
|
+
readonly slug: string;
|
|
67
|
+
readonly counts: Counts | null;
|
|
68
|
+
/** The working folder's repo, turned off: `connect` inside it pre-selects the `turn on` (D34 + the re-include rule). */
|
|
69
|
+
readonly pre: boolean;
|
|
70
|
+
}
|
|
71
|
+
/** One account grant this machine has not named (slice 2): an owner (`key` without its slash) or a repo (`key` is the slug). */
|
|
72
|
+
export interface AccountRow {
|
|
73
|
+
readonly kind: "owner" | "repo";
|
|
74
|
+
readonly key: string;
|
|
75
|
+
}
|
|
76
|
+
export interface PickerModel {
|
|
77
|
+
readonly onNow: readonly OnNowRow[];
|
|
78
|
+
readonly owners: readonly OwnerGroup[];
|
|
79
|
+
/** What the account grants that this machine has not named. Empty before a sync, or on a machine with no credential. */
|
|
80
|
+
readonly account: readonly AccountRow[];
|
|
81
|
+
readonly turnedOff: readonly TurnedOffRow[];
|
|
82
|
+
/** The picker's `Not listed here:` lines (no remote, can't be matched, unreadable agents). */
|
|
83
|
+
readonly notListed: readonly string[];
|
|
84
|
+
/** Repos the scan listed, for the `Found N repositories` line. */
|
|
85
|
+
readonly found: number;
|
|
86
|
+
/** The scan saw no session at all (the not-listed block is empty): the new-laptop screen. */
|
|
87
|
+
readonly sawNothing: boolean;
|
|
88
|
+
}
|
|
89
|
+
/** What a choice changes. Everything is normalized; the lists are disjoint. */
|
|
90
|
+
export interface PickerChange {
|
|
91
|
+
readonly addOwners: readonly string[];
|
|
92
|
+
readonly addRepos: readonly string[];
|
|
93
|
+
readonly turnOn: readonly string[];
|
|
94
|
+
readonly stopOwners: readonly string[];
|
|
95
|
+
readonly stopRepos: readonly string[];
|
|
96
|
+
/** The slugs of per-clone consents to withdraw. */
|
|
97
|
+
readonly stopClones: readonly string[];
|
|
98
|
+
}
|
|
99
|
+
export declare const NO_CHANGE: PickerChange;
|
|
100
|
+
export declare function isNoChange(change: PickerChange): boolean;
|
|
101
|
+
/**
|
|
102
|
+
* What Enter means when the working folder's repo is pre-selected (D34): choosing it, which leads to the y/N and never to
|
|
103
|
+
* a grant. `null` when nothing is pre-selected, where Enter changes nothing (D5).
|
|
104
|
+
*/
|
|
105
|
+
export declare function preChange(model: PickerModel): PickerChange | null;
|
|
106
|
+
/** Anything the person is ADDING needs the D65 disclosure; removals alone do not. */
|
|
107
|
+
export declare function hasAdditions(change: PickerChange): boolean;
|
|
108
|
+
/** The working folder, as the model needs it (D34). */
|
|
109
|
+
export interface HereRepo {
|
|
110
|
+
readonly slug: string;
|
|
111
|
+
readonly toplevel: string;
|
|
112
|
+
/** `repo`: inside a work tree, pre-ticked. `folder`: `$HOME` is itself a repo — flagged, never pre-ticked. */
|
|
113
|
+
readonly kind: "repo" | "folder";
|
|
114
|
+
}
|
|
115
|
+
export interface ModelInput {
|
|
116
|
+
readonly repos: readonly ScanRepo[];
|
|
117
|
+
readonly grants: Grants;
|
|
118
|
+
/** Per-clone consents (`projects.json`), resolved to the slug of each clone's remote. `null`: no remote. */
|
|
119
|
+
readonly perClone: readonly {
|
|
120
|
+
readonly commonDir: string;
|
|
121
|
+
readonly slug: string | null;
|
|
122
|
+
}[];
|
|
123
|
+
readonly notListed: readonly string[];
|
|
124
|
+
readonly sawNothing: boolean;
|
|
125
|
+
readonly here: HereRepo | null;
|
|
126
|
+
/** The account's grants this machine has not named, as `accountView` lists them: `owner/` for an owner, the slug for a repo. */
|
|
127
|
+
readonly accountNotHere?: readonly string[];
|
|
128
|
+
}
|
|
129
|
+
export declare function buildModel(input: ModelInput): PickerModel;
|
|
130
|
+
/** What a number on screen stands for. On-now rows come first, then each owner's repos, then turned-off. */
|
|
131
|
+
export type RowRef = {
|
|
132
|
+
readonly kind: "on";
|
|
133
|
+
readonly row: OnNowRow;
|
|
134
|
+
} | {
|
|
135
|
+
readonly kind: "repo";
|
|
136
|
+
readonly repo: PickRepo;
|
|
137
|
+
} | {
|
|
138
|
+
readonly kind: "account";
|
|
139
|
+
readonly row: AccountRow;
|
|
140
|
+
} | {
|
|
141
|
+
readonly kind: "off";
|
|
142
|
+
readonly row: TurnedOffRow;
|
|
143
|
+
};
|
|
144
|
+
/**
|
|
145
|
+
* The numbered rows in screen order. `showAll` is the `more` token: every repo is shown and numbered afresh. Without it
|
|
146
|
+
* each owner shows `GROUP_CAP` repos and the rest are reachable only by typing `owner/repo` or `more`.
|
|
147
|
+
*/
|
|
148
|
+
export declare function numberedRows(model: PickerModel, showAll: boolean): RowRef[];
|
|
149
|
+
export type Parsed = {
|
|
150
|
+
readonly kind: "empty";
|
|
151
|
+
} | {
|
|
152
|
+
readonly kind: "more";
|
|
153
|
+
}
|
|
154
|
+
/** `g`, alone, where it was offered (slice 2, exception 3): use the repositories the account already grants. */
|
|
155
|
+
| {
|
|
156
|
+
readonly kind: "account";
|
|
157
|
+
} | {
|
|
158
|
+
readonly kind: "change";
|
|
159
|
+
readonly change: PickerChange;
|
|
160
|
+
readonly noClone: readonly string[];
|
|
161
|
+
} | {
|
|
162
|
+
readonly kind: "error";
|
|
163
|
+
readonly tokens: readonly string[];
|
|
164
|
+
};
|
|
165
|
+
/**
|
|
166
|
+
* Parse one typed answer (D8 · 4A). ⛔ **Never applies part of an answer:** any token that is not understood returns
|
|
167
|
+
* `error` naming each such token, and nothing is chosen. `owner/` and `owner/repo` are always accepted, a clone here or
|
|
168
|
+
* not, because a new laptop needs them; the grant block flags `(no clone here yet)`.
|
|
169
|
+
*
|
|
170
|
+
* ⛔ **`g` STANDS ALONE** (exception 3, R3-12): where `offerAccount` is true, `g` alone is the account's grants, and `g` mixed with
|
|
171
|
+
* any other token is refused with nothing applied, so the y/N after it always names a single list. Where it was not offered `g` is
|
|
172
|
+
* an ordinary token nobody understands.
|
|
173
|
+
*/
|
|
174
|
+
export declare function parseTyped(input: string, model: PickerModel, showAll: boolean, offerAccount?: boolean): Parsed;
|
|
175
|
+
export interface RenderOptions {
|
|
176
|
+
readonly colour: boolean;
|
|
177
|
+
readonly nowMs: number;
|
|
178
|
+
/** Show every repo, numbered afresh (the `more` token). */
|
|
179
|
+
readonly showAll: boolean;
|
|
180
|
+
/** Slice 2: the prompt block's `g` line (screen 1a). Only on a machine with no credential, a terminal and a browser to sign in with. */
|
|
181
|
+
readonly offerAccount?: boolean;
|
|
182
|
+
}
|
|
183
|
+
/** The `Not listed here:` block, muted, or nothing. */
|
|
184
|
+
export declare function notListedBlock(model: PickerModel, colour: boolean): string[];
|
|
185
|
+
/** The screen above the prompt, as lines — the typed picker (§10.12 "The picker, typed"). */
|
|
186
|
+
export declare function renderTyped(model: PickerModel, options: RenderOptions): string[];
|
|
187
|
+
/** The `Not understood:` line the prompt prints before it asks again. */
|
|
188
|
+
export declare function notUnderstoodLines(tokens: readonly string[]): string[];
|
|
189
|
+
/** What the grant block needs to know about the machine, so each row says what it covers. */
|
|
190
|
+
export interface BlockFacts {
|
|
191
|
+
/** owner -> repos found on this machine under it. */
|
|
192
|
+
readonly reposHere: ReadonlyMap<string, number>;
|
|
193
|
+
/** Typed `owner/` and `owner/repo` with no clone here. */
|
|
194
|
+
readonly noClone: ReadonlySet<string>;
|
|
195
|
+
/** `turn on` slugs the ACCOUNT has turned off: the row says so, because the yes re-includes them on every machine. */
|
|
196
|
+
readonly accountOff?: ReadonlySet<string>;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* The `You chose:` block — the thing the y/N is asking about (D7 · 3A), on the §13.5 label gutter. One label per kind of
|
|
200
|
+
* change; an owner row says how many repos are here and that later clones are covered, and a typed name with no clone
|
|
201
|
+
* on this machine says so, so a typo shows BEFORE the question.
|
|
202
|
+
*/
|
|
203
|
+
export declare function renderGrantBlock(change: PickerChange, facts: BlockFacts, colour: boolean,
|
|
204
|
+
/** `You chose:` for the person's picks; the account's own list (`g`, screen 1b) is headed `Your account grants:`. */
|
|
205
|
+
heading?: string): string[];
|
|
206
|
+
/** The grant y/N: additions (with or without removals) get the upload question, removals alone the stop question. */
|
|
207
|
+
export declare function grantQuestion(change: PickerChange, colour: boolean, answers: string): string;
|
|
208
|
+
export {};
|