@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/README.md
CHANGED
|
@@ -25,10 +25,12 @@ the approved direction points at `Vibe-Commit/claude-plugin`, which vendors the
|
|
|
25
25
|
|
|
26
26
|
| Command | What it does |
|
|
27
27
|
|---|---|
|
|
28
|
-
| `vibecommit connect` |
|
|
29
|
-
| `vibecommit auth` | Replace this machine's credential: sign in through the browser, or `--paste` one you made in Settings. Run it again whenever `status` or a hook says the credential is no longer accepted.
|
|
30
|
-
| `vibecommit
|
|
31
|
-
| `vibecommit
|
|
28
|
+
| `vibecommit connect` | Choose the repositories to capture, from any folder, and connect them: whole owners, including repos you clone later, or single repos. It shows what is uploaded and asks before it signs in, adds commit hooks to each clone, and offers to upload sessions still on this machine. A repo with no remote keeps the one-repo flow. `--typed` uses the typed prompt instead of the arrow-key list. On a machine with no credential it signs you in through the browser after you say yes; with a browser to sign in with, `g` instead signs in first to read the repositories your account already grants, then asks before anything is captured. |
|
|
29
|
+
| `vibecommit auth` | Replace this machine's credential: sign in through the browser, or `--paste` one you made in Settings. Run it again whenever `status` or a hook says the credential is no longer accepted. On a terminal it then goes on to `connect`: inside a git repo, or outside one on a machine that captures nothing yet; with `--stdin` or no terminal it only saves the credential. On a terminal, a credential it saves on a machine that has already synced with your account is synced before `auth` returns. |
|
|
30
|
+
| `vibecommit scan [--json]` | List the repositories you have used a coding agent in on this machine, from the agents' folder names and Codex's thread index. It opens no session file, uploads nothing and changes no setting. Exit `4` when none is found; `--json` prints one document, including what it could not list and why. |
|
|
31
|
+
| `vibecommit backfill` | Upload the earlier coding-agent sessions still on this machine, for the repositories you chose. It lists them first and asks (default no); a Claude Code session is sent only after reading one value from its transcript, the folder it started in, to check it belongs to that repository. Sessions arrive without commit links. Not offered: Cursor sessions (Cursor does not record that folder), sessions over 50 MiB, and sessions in a clone with no reflog. It asks again about each repository as it goes, so `vibecommit off` stops the rest of that repository. **Exit codes:** `0` done, declined at the question, or interrupted with Ctrl+C (sessions held for an organization's approval are done too), `1` stopped with the resume fix (the server asked to wait, could not be reached, or refused this machine's credential) or could not run, `2` no terminal, or an argument was given, `3` not connected, `4` nothing to upload. **Resuming:** a stopped or interrupted run loses nothing already sent; run it again and it offers only the sessions not yet uploaded. |
|
|
32
|
+
| `vibecommit status` | Show whether capture is on for this repo, or for this machine from outside a repo, and when it last succeeded. Inside a repo it also says why it is on (`basis`). On a machine with a credential it first syncs with your account (3 s at most), and lists what your account grants that this machine has not named. |
|
|
33
|
+
| `vibecommit off` | Stop capturing for this repo, for every clone of it on this machine. On a machine with a credential it also tells your account, so your other machines running VibeCommit 0.8.0 or later stop capturing it once they sync. |
|
|
32
34
|
| `vibecommit why <file>:<line>` | Show the conversation turns recorded against the commit that last changed this line. |
|
|
33
35
|
| `vibecommit report --since <when>` | Summarise capture coverage over a time window. |
|
|
34
36
|
| `vibecommit finalize --session <id>` \| `--latest` | Close a finished session's last turn so commits made in it can be recorded. |
|
|
@@ -68,7 +70,10 @@ vibecommit finalize --session <session_id> # or --latest when only one sessio
|
|
|
68
70
|
Exit `0` — the server confirmed the last turn is recorded. Exit `5` — the data was delivered
|
|
69
71
|
but the server did not confirm it (a server older than this command): treat as **not** closed.
|
|
70
72
|
Exit `2` — nothing was sent (bad arguments, an unknown or still-running session, or several
|
|
71
|
-
recent sessions for `--latest`). Exit `3` — this repo is not connected
|
|
73
|
+
recent sessions for `--latest`). Exit `3` — this repo is not connected, this machine has no credential, or its
|
|
74
|
+
credential can't be used (it is not an ingest credential, its file is readable by other accounts, or it can't be read).
|
|
75
|
+
Exit `1` — it was not confirmed closed for any other reason: the folder is not a git repository, the transcript cannot
|
|
76
|
+
be found or read, the credential is no longer accepted, or the delivery failed. It is safe to run twice.
|
|
72
77
|
Resuming the session afterwards opens a new turn; nothing already recorded is changed.
|
|
73
78
|
|
|
74
79
|
`finalize` refuses a session whose transcript changed in the last few seconds. `--force` skips that check,
|
|
@@ -163,17 +168,194 @@ ask `connect`'s consent question; outside a repository, with `--stdin`, or with
|
|
|
163
168
|
credential, exactly as before, and a refused replacement (`declined`) still exits 1 without connecting. The chained
|
|
164
169
|
`connect` never opens a second sign-in. `vibecommit connect` in a repository where Claude Code has not run yet now
|
|
165
170
|
installs the git and agent hooks and exits 0 (it used to exit 1 and install neither); its "no Claude Code session"
|
|
166
|
-
warning is on stdout, and a `vibecommit` command on PATH that is not this one still exits 1. An
|
|
171
|
+
warning is on stdout, and a `vibecommit` command on PATH that is not this one still exits 1. An organization that
|
|
167
172
|
has not approved capture yet now gets its hooks installed too: the "capture is armed" screen was previously
|
|
168
173
|
printed without them. The ending reports hook setup first, then prints "Connected." and, when the server's reply
|
|
169
174
|
names the recorded session, a link to that session's page (`/app/conversations/<id>`), falling back to the
|
|
170
175
|
captures list; the PATH check and the unconfirmed-credential note follow it. Only `connect` reads that part of the
|
|
171
|
-
server's reply; the hooks never read a successful response body.
|
|
176
|
+
server's reply; the hooks never read a successful response body (from 0.8.0 one hook does: SessionStart's single, bounded `GET` of
|
|
177
|
+
your account's grants).
|
|
172
178
|
|
|
173
179
|
0.6.1 changes no contract. When the server answers an upload with an error, the client now stops reading that
|
|
174
180
|
error's body at 64 KiB even when the server does not declare its length; it used to buffer the whole body before
|
|
175
|
-
checking. The hooks still never read a successful response body.
|
|
176
|
-
|
|
181
|
+
checking. The hooks still never read a successful response body (from 0.8.0 one hook does: SessionStart's single, bounded `GET` of
|
|
182
|
+
your account's grants).
|
|
183
|
+
|
|
184
|
+
0.7.0 lets you connect from any folder, adds `scan` and `backfill`, puts a stable code on every error, and changes
|
|
185
|
+
the contracts below. The hooks still never read a successful response body (from 0.8.0 one hook does: SessionStart's
|
|
186
|
+
single, bounded `GET` of your account's grants).
|
|
187
|
+
|
|
188
|
+
*Connecting.* `vibecommit connect` no longer needs a git work tree. It lists the repositories you have used a coding
|
|
189
|
+
agent in (Claude Code, Codex CLI and Cursor) from the agents' folder names and Codex's thread index, without opening
|
|
190
|
+
a session file, and you choose whole owners, including repositories you clone later, or single repositories. The
|
|
191
|
+
disclosure's heading now says "coding-agent transcripts"; its paragraphs are unchanged. Your choices are saved in
|
|
192
|
+
`~/.vibecommit/grants.json`; consent given per clone by 0.6.x keeps working beside it, and a `grants.json` that cannot
|
|
193
|
+
be read stops capture for every repository with a remote until it is fixed. A 0.7.0 command that rewrites it keeps any
|
|
194
|
+
fields it doesn't recognize, so a newer client's state survives it. After "Capture is on", `connect` offers to
|
|
195
|
+
upload the earlier sessions still on this machine, a separate question that defaults to no. Inside a repository it
|
|
196
|
+
shows the same list with that repository ticked, and a repository with no remote keeps the 0.6.0 flow. A repository
|
|
197
|
+
with a remote and no Claude Code session yet ends on "Capture is on" and the dashboard, not 0.6.0's "no Claude Code
|
|
198
|
+
session" warning; the hooks are still installed and the exit is still 0. With no terminal, `connect` refuses with exit
|
|
199
|
+
`2` and the code `CONSENT_NEEDS_TTY`; the disclosure still prints first. A terminal `vibecommit auth` now continues
|
|
200
|
+
into this flow, inside a git repository or outside one on a machine that captures nothing yet, so it may also offer to
|
|
201
|
+
upload earlier sessions (default no); with `--stdin` or no terminal it still only saves the credential. That replaces
|
|
202
|
+
the "outside a repository" clause of the 0.6.0 paragraph above; its `--stdin` and no-terminal clauses, and "The
|
|
203
|
+
chained `connect` never opens a second sign-in", still hold.
|
|
204
|
+
|
|
205
|
+
*New verbs and changed ones.* `vibecommit scan [--json]` lists repositories and exits `4` when it finds none.
|
|
206
|
+
`vibecommit backfill` uploads earlier sessions for the repositories you chose, after two yeses and without commit
|
|
207
|
+
links; its exit codes are in the table above. `vibecommit status` now answers from any folder; `status --json` gains
|
|
208
|
+
`scope` and `basis` on a repository's document (`basis` is `owner`, `repo` or `per_clone`, or `null` when it is off),
|
|
209
|
+
a machine document with its own keys, and `org_pending`: `{at_ms}` or `null` inside a repository, and the list of
|
|
210
|
+
waiting repositories at machine level. `status` names a repository whose organization has not approved capture yet,
|
|
211
|
+
from inside it or from any folder. `vibecommit off` turns the repository off by its name, for every clone of it on
|
|
212
|
+
this machine.
|
|
213
|
+
|
|
214
|
+
*Delivery.* A 413 no longer writes off the span. A span goes in deltas of at most 8 MiB cut on a record boundary, a
|
|
215
|
+
413 halves the delta and retries, and only a single record that alone exceeds a limit (8 MiB raw, or 960 KiB
|
|
216
|
+
compressed) is skipped and counted; `status` reports it as "skipped … will not be sent later". A hook sends further
|
|
217
|
+
deltas only while its existing budget lasts and leaves the rest for its next event or `vibecommit finalize`. The test
|
|
218
|
+
capture in `connect` sends at most one hook budget and its first upload times out after about 3 seconds (it was 5).
|
|
219
|
+
|
|
220
|
+
*Hooks.* Claude Code, Codex and Cursor now register a `SessionStart` hook. In a clone you have granted, it installs the
|
|
221
|
+
commit hooks once, by plain writes only (if either slot holds someone else's hook it writes nothing, and `status`
|
|
222
|
+
says so), says so in one short notice, and uploads nothing, opens no transcript and makes no request. Notices show only
|
|
223
|
+
in the agents' terminal interfaces, so `status` is the record in `claude -p` and `codex exec`; Cursor's `sessionStart`
|
|
224
|
+
has no way to show one, and that hook is registered from reading Cursor's code, not from watching it run. Codex asks you to trust new hooks the next time it starts — until you do, it will not run them. The new `SessionStart` entry arrives untrusted, so
|
|
225
|
+
existing Codex users see one review after upgrading and running `connect`, and again whenever the path of the
|
|
226
|
+
`vibecommit` binary changes (an nvm switch, a plugin update). The Claude Code plugin installs no git hooks, including
|
|
227
|
+
from `SessionStart`.
|
|
228
|
+
|
|
229
|
+
*Errors.* Every error block now carries a stable code on its own muted line before the fix, with a link:
|
|
230
|
+
`NOT_A_REPO · vibecommit.ai/docs/errors#not-a-repo`. There are 61 codes (`test/error-codes.golden.txt`); a code names
|
|
231
|
+
a condition and carries no exit code. `UNKNOWN_COMMAND` replaces the help dump for an unknown verb: it prints a block
|
|
232
|
+
that points to `vibecommit --help`, and the exit is still `2`. `CONSENT_NEEDS_TTY` is now on its own code line, not in
|
|
233
|
+
parentheses in the sentence. A `--json` failure of `status`, `why` or `report`, and an unexpected error under `scan --json`, is now one document
|
|
234
|
+
on stdout and nothing on stderr, where 0.6.x left stdout empty: `{ schema, verb, outcome: "error", error: { code, what, why, fix } }`.
|
|
235
|
+
`fix` is `null` only when the block has no fix label at all; a label with nothing to type is `{ "label": …,
|
|
236
|
+
"commands": [] }`. Every fix command, in the text and in `--json`, follows the install channel: a machine that has only
|
|
237
|
+
the Claude Code plugin is told `node <path> …`, not a `vibecommit` it does not have. `vibecommit <verb> --help` now
|
|
238
|
+
prints usage, options and exit codes for `connect`, `auth`, `scan`, `status`, `why`, `report`, `finalize` and
|
|
239
|
+
`backfill`. `finalize` outside a git repository still exits `1`, and the README now says so. When `finalize` finds no
|
|
240
|
+
credential it says "This machine isn't connected." (`NO_CREDENTIAL`); a credential that is present but unusable gets
|
|
241
|
+
the same precise block `status` and `connect` print, and both exit `3`. A credential the server rejects still
|
|
242
|
+
reaches the send and exits `1`. `auth` with an empty or wrong-kind credential now puts the settings link first and the
|
|
243
|
+
commands last. Commands written inside a sentence, such as "run `vibecommit connect` to add them", follow the install
|
|
244
|
+
channel too. `CLIENT_TOO_OLD` (the server sent an answer this version is too old to show) now tells an npm install to
|
|
245
|
+
"Update VibeCommit to pick up the current client, then run this again:" with `npm install -g @vibe-commit/capture@latest`;
|
|
246
|
+
the plugin's reinstall line is unchanged. When the folder that holds the credential file, `~/.vibecommit`, is open to
|
|
247
|
+
other accounts, `CREDENTIAL_FILE_INSECURE` names the folder and gives `chmod 700 ~/.vibecommit`, not the file's
|
|
248
|
+
`chmod 600`. The package's `homepage` is `https://www.vibecommit.ai/install`, its `bugs` link is the plugin's
|
|
249
|
+
issues page, and `repository` is dropped, because this repository is private.
|
|
250
|
+
|
|
251
|
+
*A 0.6.x defect fixed.* For a repository whose path held an `_`, a space or another character outside letters and
|
|
252
|
+
digits, `connect`'s test capture looked in a Claude Code folder that does not exist and skipped the upload; it now
|
|
253
|
+
spells the folder name as Claude Code does.
|
|
254
|
+
|
|
255
|
+
0.8.0 lets your VibeCommit account remember which repositories you capture, so another machine can offer the same
|
|
256
|
+
choices. It changes the contracts below. It needs a server that has the account-grants routes; against one that has not
|
|
257
|
+
(a 404, a timeout, an answer it cannot read), a sync reads as unavailable: changes wait, and a machine that has never
|
|
258
|
+
synced decides capture by its own choices, as under 0.7.0.
|
|
259
|
+
|
|
260
|
+
*Account grants.* Your choices (the owners and repositories in `~/.vibecommit/grants.json`, and the repositories you
|
|
261
|
+
turn off) are sent to your account by a sync (`POST /ingest/v1/grants/sync`, in requests of at most 500 changes, all
|
|
262
|
+
within 3 s in total), which reads back what your account grants. A sync runs at the start of `connect` and `status`, at
|
|
263
|
+
the end of `off`, once more in `connect` after the picker's changes and before "Capture is on", and in a terminal `auth`
|
|
264
|
+
that saves a credential on a machine that has already synced, so that `auth` contacts the server before it returns (a
|
|
265
|
+
`--stdin`, piped or no-terminal `auth` only saves the credential and sends nothing else). Changes a sync could not
|
|
266
|
+
deliver wait in `grants.json` (`pending`) and go out with the next sync, and `status` and `off` say so. On a machine
|
|
267
|
+
that has synced before, a repository whose only basis here is a grant still waiting to be delivered is held: its
|
|
268
|
+
sessions wait on this machine, with nothing dropped, and go once a sync delivers the grant. What your account grants is
|
|
269
|
+
shown, never acted on: a repository your account grants but you have not named on this machine is not captured here
|
|
270
|
+
until you choose it in `connect`. What your account turns off does apply here: a repository turned off on your account,
|
|
271
|
+
or refused as turned off, is not captured on this machine once this machine has learned of it (at a sync, at a read of
|
|
272
|
+
your account, or from the refusal itself). The first sync on a machine also sends the choices it already holds
|
|
273
|
+
(including repositories consented to per clone by 0.6.x or 0.7.0), and says so on a terminal: `Saving this machine's
|
|
274
|
+
repository choices to your VibeCommit account: <names>.` Past three names it shows two and `and N more`, then all of
|
|
275
|
+
them. It waits off a terminal and under `--json`. The consent sentence of the disclosure now ends: "…and is saved to
|
|
276
|
+
your VibeCommit account so your other machines running VibeCommit 0.8.0 or later can offer it." Its other paragraphs are
|
|
277
|
+
unchanged.
|
|
278
|
+
|
|
279
|
+
*Hooks.* The hooks now read one successful response body. SessionStart makes a single `GET /ingest/v1/grants`, only when
|
|
280
|
+
all of these hold: this machine's account state is stale (an upload's answer carried an `X-Grant-Epoch` that differs
|
|
281
|
+
from the recorded one; no recorded state counts as epoch `0`), the last such request was over an hour ago (across all
|
|
282
|
+
clones), the machine has a credential, and the hook has time left. It waits at most 1,000 ms and reads at most 64 KiB;
|
|
283
|
+
if the answer stalls, is cut off, is too large or is not what the contract says, the state stays stale and nothing else
|
|
284
|
+
happens. The request carries the credential and the client version and nothing about the clone: no query, no repository,
|
|
285
|
+
no path. From a clone this machine does not capture it is made only when the cached account state already names an owner
|
|
286
|
+
or a repository. What the GET learns is written only to `~/.vibecommit/grants-account.json` (`account`, `refused`,
|
|
287
|
+
`stale`, `last_get_at`; written whole and atomically; an unreadable one is ignored, never read as "deny everything"),
|
|
288
|
+
never to `grants.json`: an upload's refusal writes `refused`, an upload's epoch header writes `stale`, and the GET
|
|
289
|
+
writes `account` and `last_get_at`, clears `stale`, and leaves `refused` alone. This amends three sentences above: "the
|
|
290
|
+
hooks never read a successful response body" in the 0.6.0 and 0.6.1 paragraphs and "The hooks still never read a
|
|
291
|
+
successful response body." in the 0.7.0 paragraph; each now carries a pointer here. The client reads `X-Grant-Epoch`
|
|
292
|
+
among the headers of every credential-lane upload answer, and nothing in the body of a successful one. When that GET
|
|
293
|
+
finds grants this machine has not named, SessionStart says so once per machine per account epoch, in Claude Code and
|
|
294
|
+
Codex on an npm install: "Your account grants 2 repositories not captured on this machine yet. Run `vibecommit status`."
|
|
295
|
+
(owners and repositories counted separately); Cursor makes no such request. The "installed but not connected" notice
|
|
296
|
+
that the plugin's Stop hook can show now names the connect command of the install channel, and falls back to `Connect
|
|
297
|
+
it: vibecommit.ai/install` when the line would pass 120 characters; on npm it is unchanged.
|
|
298
|
+
|
|
299
|
+
*Refusals.* A server that has seen a machine sync may answer an upload with `403` and the error `repository_not_granted`
|
|
300
|
+
or `repository_excluded`; the client tells them apart by that code alone. `repository_not_granted` is retried later: the
|
|
301
|
+
bytes wait. `repository_excluded` is not retried: the slug is remembered in `grants-account.json`, so this machine stops
|
|
302
|
+
capturing that repository until a sync clears it. A `403` with any other, missing, cut-off or unreadable body is retried
|
|
303
|
+
later, as before. On a machine that has synced, a grant that has not reached your account yet holds that repository's
|
|
304
|
+
uploads back on this machine (they wait; nothing is dropped), unless the clone's own per-clone consent admits it or the
|
|
305
|
+
last synced state already grants it. Under the server's contract (vibecommit-mcp), only a credential that has synced may
|
|
306
|
+
be refused; a machine running only 0.6.x or 0.7.0 never syncs. The refusal follows the credential, not the version. Once
|
|
307
|
+
a 0.8.0 command has synced on a machine, a 0.7.0 plugin hook there that uses the same credential is refused for a
|
|
308
|
+
repository your account doesn't grant yet. It holds what it would have uploaded, and drops the oldest of it once that is
|
|
309
|
+
more than 24 hours old or the total passes 8 MiB. A repository chosen in a 0.8.0 command reaches your account with that
|
|
310
|
+
command's sync or the next one, and what is still held then goes. A repository chosen with a 0.7.0 command after that
|
|
311
|
+
sync is never granted on your account (a sync names it but asks for no grant), so every hook on the machine is refused
|
|
312
|
+
for it, with the same holding and dropping, until you add it at vibecommit.ai/app/settings/repos. The plugin's update to
|
|
313
|
+
0.8.0 ends both cases for new choices.
|
|
314
|
+
|
|
315
|
+
*Connecting.* `vibecommit connect` on a machine with a credential syncs before it builds the picker, and the picker
|
|
316
|
+
gains a group, "on your account", of what your account grants and this machine has not named; choosing one is an
|
|
317
|
+
ordinary addition, with the same disclosure and question. A repository your account has turned off shows as `turn on …
|
|
318
|
+
(turned off on your account)`, and a yes there turns it back on for the account too. A machine that had no credential
|
|
319
|
+
when the picker was shown asks one more question after its own: `Your account also grants … Capture those here too?
|
|
320
|
+
[y/N]` (past three names, two and `and N more`, then all of them); no leaves them granted on your account and not
|
|
321
|
+
captured here, and `status` lists them. If the sync after the picker's changes does not reach your account, a muted line
|
|
322
|
+
under "Capture is on" says so: "Your account hasn't been told yet; running `status` retries." on a machine that had not
|
|
323
|
+
synced before, or when nothing you just chose waits for it, and otherwise "Your account hasn't been told yet. Until it
|
|
324
|
+
is, sessions in the repositories you just chose that it doesn't grant wait on this machine; running `status` retries."
|
|
325
|
+
(the install channel's command). On a terminal, on a machine with no credential, typing `g` instead of choosing signs in
|
|
326
|
+
first, reads the repositories your account grants with one request, and then shows them under the same disclosure and
|
|
327
|
+
asks; it is never offered by `auth` or without a terminal. The credential `g` makes is held in memory until you say yes:
|
|
328
|
+
the moment it is made, a row for it goes into `~/.vibecommit/pending-revoke.json` (mode 0600 in a 0700 folder, atomic,
|
|
329
|
+
never printed; it holds the token, so it is the same exposure as `credentials.json`), and `credentials.json` is written
|
|
330
|
+
only after the grants. Any other ending tries to revoke it, within 3 s, at the server that made it: no, Enter, Ctrl+C, a
|
|
331
|
+
run that grants nothing (including an account that grants nothing yet, if you then choose nothing here), a yes that only
|
|
332
|
+
removes, a failed write, an error, or a yes whose commit is refused because another command revoked the credential, its
|
|
333
|
+
record became unusable, or a credential was saved meanwhile (No, Enter, a run that grants nothing and a yes that only
|
|
334
|
+
removes exit `0`; Ctrl+C, a failed write, an error and a refused commit exit `1`, and a refused commit says which). A
|
|
335
|
+
revoke that gets no answer, or a kill that stops the process first, leaves the row, and the next command tries again. A
|
|
336
|
+
row leaves on a revoke that was answered (revoked, or already not accepted), on a server that cannot revoke it (`g` then
|
|
337
|
+
says where to revoke it in Settings), or 91 days after it was made, is never dropped before that, and the queue refuses
|
|
338
|
+
a ninth row rather than drop one. If the row cannot be written, `g` tries to revoke it at once, says where to revoke it
|
|
339
|
+
in Settings if that gets no answer, and ends with exit `1`. Every verb except `scan`, `--help`, `--version` and a
|
|
340
|
+
`--stdin`, piped or no-terminal `auth` retries waiting rows once at its start, silently, inside one 3 s bound; `scan`
|
|
341
|
+
stays free of network requests, and no hook retries.
|
|
342
|
+
|
|
343
|
+
*`status` and `off`.* Both now contact the server on a machine with a credential. `status` shows `on account` (what your
|
|
344
|
+
account grants that this machine has not named; an owner is written `owner/`) and `pending` (changes not yet sent, or
|
|
345
|
+
`your account didn't accept · report this: github.com/Vibe-Commit/claude-plugin/issues`); machine `status --json` gains
|
|
346
|
+
`account`, `account_not_here`, `pending` and `pending_rejected`, and a repository's `basis` gains the value
|
|
347
|
+
`"account_not_here"` (granted on your account, not on this machine; the exit is still `3`): read `outcome` for on or
|
|
348
|
+
off, not `basis !== null`. `off` turns the repository off here first, as before, and then tells your account: `Turned
|
|
349
|
+
off <slug> for every clone on this machine, and on your other machines running VibeCommit 0.8.0 or later once they
|
|
350
|
+
sync.`, with `N of your machines haven't synced and keep capturing it until they sync on VibeCommit 0.8.0 or later.`
|
|
351
|
+
when your account knows of unsynced machines, or `Stopped here. Your other machines running VibeCommit 0.8.0 or later
|
|
352
|
+
don't know yet; it will retry.` when it could not reach it; a repository your account has already turned off says so and
|
|
353
|
+
is turned off here too. A machine with no credential gets 0.7.0's `off` output, byte for byte, and makes no grants
|
|
354
|
+
request; a waiting revoke row is still retried.
|
|
355
|
+
|
|
356
|
+
*Files.* `grants.json` gains `pending` and `synced_at` and stays written only by the commands, never by a hook; a 0.7.0
|
|
357
|
+
command that rewrites it keeps both. `grants-account.json` is new, and the hooks' file. `pending-revoke.json` is new and
|
|
358
|
+
holds a bearer token while a revoke is waiting.
|
|
177
359
|
## Status
|
|
178
360
|
|
|
179
361
|
**Implemented**, not a scaffold. All six commands above have real bodies — OAuth sign-in
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What the account grants that THIS machine has not named — the pure rule behind `status`'s "on account" row and SessionStart's notice 10.
|
|
3
|
+
*
|
|
4
|
+
* Its own module so the hook path can use the rule without importing `grants_verb.ts`, which is a verb's (it syncs, prints and reaches the
|
|
5
|
+
* network); the hook-path import-graph cell in `test/connect-g-lifecycle.test.ts` keeps hooks off that module.
|
|
6
|
+
*
|
|
7
|
+
* ⛔ "Not on this machine" is what THIS machine has not named: not in its owners, its repos, or a per-clone consent, and not turned off here
|
|
8
|
+
* or on the account. A repo under an owner the account grants is covered by that owner's row, not listed again. An owner or repo the user
|
|
9
|
+
* turned off is a choice, not a gap.
|
|
10
|
+
*/
|
|
11
|
+
import { type AccountGrants, type Grants } from "./consent.js";
|
|
12
|
+
/** `owner/` for an owner, the slug for a repo — the way every account row and the first-sync line name them. */
|
|
13
|
+
export declare const ownerName: (owner: string) => string;
|
|
14
|
+
/** The account's owners (as `owner/`) and then its repos this machine has not named. Pure. */
|
|
15
|
+
export declare function accountNotHere(grants: Grants, account: AccountGrants, perCloneSlugs: readonly string[]): string[];
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What the account grants that THIS machine has not named — the pure rule behind `status`'s "on account" row and SessionStart's notice 10.
|
|
3
|
+
*
|
|
4
|
+
* Its own module so the hook path can use the rule without importing `grants_verb.ts`, which is a verb's (it syncs, prints and reaches the
|
|
5
|
+
* network); the hook-path import-graph cell in `test/connect-g-lifecycle.test.ts` keeps hooks off that module.
|
|
6
|
+
*
|
|
7
|
+
* ⛔ "Not on this machine" is what THIS machine has not named: not in its owners, its repos, or a per-clone consent, and not turned off here
|
|
8
|
+
* or on the account. A repo under an owner the account grants is covered by that owner's row, not listed again. An owner or repo the user
|
|
9
|
+
* turned off is a choice, not a gap.
|
|
10
|
+
*/
|
|
11
|
+
import { normalizeSlug, ownerOfSlug } from "./consent.js";
|
|
12
|
+
/** `owner/` for an owner, the slug for a repo — the way every account row and the first-sync line name them. */
|
|
13
|
+
export const ownerName = (owner) => `${owner}/`;
|
|
14
|
+
/** The account's owners (as `owner/`) and then its repos this machine has not named. Pure. */
|
|
15
|
+
export function accountNotHere(grants, account, perCloneSlugs) {
|
|
16
|
+
const off = new Set([...grants.excluded, ...account.excluded]);
|
|
17
|
+
const named = new Set([...grants.repos, ...perCloneSlugs.map(normalizeSlug)]);
|
|
18
|
+
const owners = account.owners.filter((o) => !grants.owners.includes(o));
|
|
19
|
+
const repos = account.repos.filter((r) => !off.has(r) &&
|
|
20
|
+
!named.has(r) &&
|
|
21
|
+
!grants.owners.includes(ownerOfSlug(r)) &&
|
|
22
|
+
!account.owners.includes(ownerOfSlug(r)));
|
|
23
|
+
return [...owners.map(ownerName), ...repos];
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=account_not_here.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account_not_here.js","sourceRoot":"","sources":["../src/account_not_here.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,aAAa,EAAE,WAAW,EAAmC,MAAM,cAAc,CAAC;AAE3F,gHAAgH;AAChH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,KAAa,EAAU,EAAE,CAAC,GAAG,KAAK,GAAG,CAAC;AAEhE,8FAA8F;AAC9F,MAAM,UAAU,cAAc,CAAC,MAAc,EAAE,OAAsB,EAAE,aAAgC;IACrG,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,QAAQ,EAAE,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC/D,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,KAAK,EAAE,GAAG,aAAa,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;IAC9E,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;IACxE,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,MAAM,CAChC,CAAC,CAAC,EAAE,EAAE,CACJ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;QACX,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;QACb,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;QACvC,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAC3C,CAAC;IACF,OAAO,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,GAAG,KAAK,CAAC,CAAC;AAC9C,CAAC"}
|
package/dist/agent_hooks.d.ts
CHANGED
|
@@ -146,6 +146,14 @@ export declare function mergeHookDocument(raw: string | null, shape: HookDocShap
|
|
|
146
146
|
* and costs at most a duplicate. `writeAgentHooks` passes `existsSync`.
|
|
147
147
|
*/
|
|
148
148
|
binaryExists?: (path: string) => boolean): MergeOutcome;
|
|
149
|
+
/**
|
|
150
|
+
* Is one of OUR entries registered for this event in `raw`? Read-only, for `status` (0.7.0): a 0.6.x machine has
|
|
151
|
+
* `Stop`, `PreCompact` and `SessionEnd` but no `SessionStart`, and `npm i -g` alone never adds one.
|
|
152
|
+
*
|
|
153
|
+
* Unparseable, absent or the wrong shape all answer false — "not registered" is the honest reading of a file
|
|
154
|
+
* this client cannot use, and `connect` is the verb that explains a refusal.
|
|
155
|
+
*/
|
|
156
|
+
export declare function hasRegistration(raw: string | null, shape: HookDocShape, registration: HookRegistration, binaryExists?: (path: string) => boolean): boolean;
|
|
149
157
|
export type AgentHookInstall = {
|
|
150
158
|
readonly kind: "installed";
|
|
151
159
|
readonly path: string;
|
package/dist/agent_hooks.js
CHANGED
|
@@ -268,6 +268,28 @@ function isOurs(entry, shape, registration, binaryExists) {
|
|
|
268
268
|
typeof inner.command === "string" &&
|
|
269
269
|
commandIsOurs(inner.command, registration.command, binaryExists));
|
|
270
270
|
}
|
|
271
|
+
/**
|
|
272
|
+
* Is one of OUR entries registered for this event in `raw`? Read-only, for `status` (0.7.0): a 0.6.x machine has
|
|
273
|
+
* `Stop`, `PreCompact` and `SessionEnd` but no `SessionStart`, and `npm i -g` alone never adds one.
|
|
274
|
+
*
|
|
275
|
+
* Unparseable, absent or the wrong shape all answer false — "not registered" is the honest reading of a file
|
|
276
|
+
* this client cannot use, and `connect` is the verb that explains a refusal.
|
|
277
|
+
*/
|
|
278
|
+
export function hasRegistration(raw, shape, registration, binaryExists = existsSync) {
|
|
279
|
+
if (raw === null)
|
|
280
|
+
return false;
|
|
281
|
+
let doc;
|
|
282
|
+
try {
|
|
283
|
+
doc = JSON.parse(raw);
|
|
284
|
+
}
|
|
285
|
+
catch {
|
|
286
|
+
return false;
|
|
287
|
+
}
|
|
288
|
+
if (!isRecord(doc) || !isRecord(doc.hooks))
|
|
289
|
+
return false;
|
|
290
|
+
const entries = doc.hooks[registration.event];
|
|
291
|
+
return Array.isArray(entries) && entries.some((e) => isOurs(e, shape, registration, binaryExists));
|
|
292
|
+
}
|
|
271
293
|
/**
|
|
272
294
|
* ⛔ **THE WHOLE STRING, NEVER A SUBSTRING — the trap `TODOS[138]` names.**
|
|
273
295
|
*
|
|
@@ -368,6 +390,15 @@ export function writeAgentHooks(path, shape, registrations) {
|
|
|
368
390
|
const merged = mergeHookDocument(raw, shape, registrations, existsSync);
|
|
369
391
|
if (merged.kind === "refused")
|
|
370
392
|
return { kind: "refused", path, why: merged.why };
|
|
393
|
+
const events = registrations.map((registration) => registration.event);
|
|
394
|
+
// ⛔ **A BYTE-IDENTICAL RESULT IS NOT WRITTEN AT ALL** (0.7.0, VQ ruling). Codex hashes each hook's normalized
|
|
395
|
+
// config (event, matcher, command, timeout) and runs a user-level hook only while a persisted hash matches, so
|
|
396
|
+
// the entry this client writes is something the user has to APPROVE. A re-`connect` with the same binary path
|
|
397
|
+
// rebuilds the same entry; rewriting the file anyway churns its mtime for nothing and invites every tool that
|
|
398
|
+
// watches it to react. A MOVED binary path still lands here as different text and is refreshed, because a stale
|
|
399
|
+
// path is worse than a fresh review — the hook would point at a binary that is gone.
|
|
400
|
+
if (raw !== null && merged.text === raw)
|
|
401
|
+
return { kind: "already", path, events };
|
|
371
402
|
const temp = join(dirname(path), `.${AGENT_HOOK_MARKER.replace(/\W+/g, "-")}.tmp`);
|
|
372
403
|
try {
|
|
373
404
|
mkdirSync(dirname(path), { recursive: true });
|
|
@@ -379,7 +410,6 @@ export function writeAgentHooks(path, shape, registrations) {
|
|
|
379
410
|
catch (error) {
|
|
380
411
|
return { kind: "failed", path, why: error instanceof Error ? error.message : "write failed" };
|
|
381
412
|
}
|
|
382
|
-
const events = registrations.map((registration) => registration.event);
|
|
383
413
|
// "already" is not "nothing happened" — the command was still refreshed. It is
|
|
384
414
|
// the answer to *did this connect ADD anything*, which is what a user reads.
|
|
385
415
|
return merged.added.length === 0
|
package/dist/agent_hooks.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent_hooks.js","sourceRoot":"","sources":["../src/agent_hooks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuEG;AAEH,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,SAAS,CAA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C,OAAO,CAAC,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAC9C,aAAa,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,IAAI,KAAK,EAAE,CAAC,CAAC;QAC1D,IAAI,IAAI,KAAK,SAAS;YAAE,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC9C,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACzB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,cAAc,EAAE,CAAC;IAChG,CAAC;IAED,+EAA+E;IAC/E,6EAA6E;IAC7E,OAAO,MAAM,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC;QAC9B,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE;QACnC,CAAC,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AAC1C,CAAC"}
|
|
@@ -8,4 +8,38 @@
|
|
|
8
8
|
* confinement call, which now runs against the registry's union.
|
|
9
9
|
*/
|
|
10
10
|
import type { TranscriptDialect } from "./types.js";
|
|
11
|
+
/**
|
|
12
|
+
* The longest folder name Claude Code writes verbatim.
|
|
13
|
+
*
|
|
14
|
+
* ⛔ **MEASURED (Open Question 3, VS, 2026-10-24).** An encoded path that would
|
|
15
|
+
* pass 200 characters is cut to 200, then `-`, then 6 hash characters (a
|
|
16
|
+
* measured name was 207 long, `…-x911fg`). The hash is not invertible from here,
|
|
17
|
+
* so such a folder cannot be matched to a path — and so a name LONGER than this
|
|
18
|
+
* is always a hashed one, since a verbatim name never exceeds it.
|
|
19
|
+
*/
|
|
20
|
+
export declare const CLAUDE_NAME_LIMIT = 200;
|
|
21
|
+
/**
|
|
22
|
+
* The folder name Claude Code gives a project path — Open Question 3.
|
|
23
|
+
*
|
|
24
|
+
* ⛔ **EVERY UTF-16 CODE UNIT OUTSIDE `[A-Za-z0-9]` BECOMES ONE `-`.** Measured by
|
|
25
|
+
* running throwaway sessions in folders named with `. _`, a space, `@ + ~ ( ) ' =
|
|
26
|
+
* , # % &`, `é` and an emoji: all of them, and the emoji TWICE, because the
|
|
27
|
+
* regular expression below runs over code units (no `u` flag) and an emoji is
|
|
28
|
+
* two. Runs do NOT collapse (`501/-Users` gave `501--Users`), a literal `-` stays
|
|
29
|
+
* itself, case is kept, and a leading `/` gives a leading `-`.
|
|
30
|
+
*
|
|
31
|
+
* ⚠ **This replaces `/[/.]/g`, which was the rule the first version of
|
|
32
|
+
* `locateCurrentTranscript` derived from 17 folders none of which held anything
|
|
33
|
+
* else.** For a repo whose path held an `_` or a space, `connect`'s test capture
|
|
34
|
+
* looked in a folder that does not exist and skipped the beat (a 0.6.x defect;
|
|
35
|
+
* `test/scan-encodings.test.ts` carries its regression cell).
|
|
36
|
+
*
|
|
37
|
+
* ⚠ **It returns the FULL encoding even past the limit**, and the callers decide
|
|
38
|
+
* what that means: `locateCurrentTranscript` cannot find a hashed folder, and the
|
|
39
|
+
* scan's walk compares PREFIXES of a name that is itself at most the limit, so a
|
|
40
|
+
* longer prefix simply never matches. One function, no second spelling of the rule.
|
|
41
|
+
*/
|
|
42
|
+
export declare function encodeProjectPath(path: string): string;
|
|
43
|
+
/** Is this folder name one Claude Code cut and hashed? See `CLAUDE_NAME_LIMIT`. */
|
|
44
|
+
export declare function isHashedProjectName(name: string): boolean;
|
|
11
45
|
export declare const CLAUDE_CODE: TranscriptDialect;
|