@vibe-commit/capture 0.8.0 → 0.9.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.
Files changed (101) hide show
  1. package/README.md +124 -0
  2. package/dist/agents/claude_code.js +13 -0
  3. package/dist/agents/claude_code.js.map +1 -1
  4. package/dist/agents/codex_cli.js +11 -0
  5. package/dist/agents/codex_cli.js.map +1 -1
  6. package/dist/agents/cursor.js +7 -1
  7. package/dist/agents/cursor.js.map +1 -1
  8. package/dist/agents/registry.d.ts +7 -0
  9. package/dist/agents/registry.js +9 -0
  10. package/dist/agents/registry.js.map +1 -1
  11. package/dist/agents/types.d.ts +32 -0
  12. package/dist/agents/types.js.map +1 -1
  13. package/dist/bounded_id.d.ts +29 -0
  14. package/dist/bounded_id.js +42 -0
  15. package/dist/bounded_id.js.map +1 -0
  16. package/dist/codex_folders.d.ts +340 -0
  17. package/dist/codex_folders.js +1448 -0
  18. package/dist/codex_folders.js.map +1 -0
  19. package/dist/commands/backfill.d.ts +29 -7
  20. package/dist/commands/backfill.js +387 -109
  21. package/dist/commands/backfill.js.map +1 -1
  22. package/dist/commands/connect.d.ts +1 -1
  23. package/dist/commands/connect.js +1 -1
  24. package/dist/commands/connect.js.map +1 -1
  25. package/dist/commands/connect_picker.js +48 -7
  26. package/dist/commands/connect_picker.js.map +1 -1
  27. package/dist/commands/finalize.d.ts +67 -0
  28. package/dist/commands/finalize.js +450 -114
  29. package/dist/commands/finalize.js.map +1 -1
  30. package/dist/commands/scan.d.ts +28 -0
  31. package/dist/commands/scan.js +11 -0
  32. package/dist/commands/scan.js.map +1 -1
  33. package/dist/commands/status_machine.js +47 -10
  34. package/dist/commands/status_machine.js.map +1 -1
  35. package/dist/consent.d.ts +22 -0
  36. package/dist/consent.js +38 -1
  37. package/dist/consent.js.map +1 -1
  38. package/dist/copy/strings.d.ts +43 -1
  39. package/dist/copy/strings.js +48 -4
  40. package/dist/copy/strings.js.map +1 -1
  41. package/dist/folder_grants.d.ts +44 -0
  42. package/dist/folder_grants.js +101 -0
  43. package/dist/folder_grants.js.map +1 -0
  44. package/dist/git.d.ts +26 -4
  45. package/dist/git.js +82 -11
  46. package/dist/git.js.map +1 -1
  47. package/dist/hooks/entry.d.ts +30 -50
  48. package/dist/hooks/entry.js +593 -559
  49. package/dist/hooks/entry.js.map +1 -1
  50. package/dist/hooks/fire_lock.d.ts +31 -0
  51. package/dist/hooks/fire_lock.js +120 -12
  52. package/dist/hooks/fire_lock.js.map +1 -1
  53. package/dist/machine_state.d.ts +44 -1
  54. package/dist/machine_state.js +75 -12
  55. package/dist/machine_state.js.map +1 -1
  56. package/dist/oauth/discovery.js +2 -1
  57. package/dist/oauth/discovery.js.map +1 -1
  58. package/dist/oauth/pkce.js +2 -1
  59. package/dist/oauth/pkce.js.map +1 -1
  60. package/dist/paths.d.ts +34 -1
  61. package/dist/paths.js +62 -12
  62. package/dist/paths.js.map +1 -1
  63. package/dist/physical_path.d.ts +46 -0
  64. package/dist/physical_path.js +151 -0
  65. package/dist/physical_path.js.map +1 -0
  66. package/dist/picker.d.ts +52 -3
  67. package/dist/picker.js +129 -5
  68. package/dist/picker.js.map +1 -1
  69. package/dist/picker_checklist.d.ts +9 -1
  70. package/dist/picker_checklist.js +41 -2
  71. package/dist/picker_checklist.js.map +1 -1
  72. package/dist/policy.d.ts +9 -1
  73. package/dist/policy.js +11 -2
  74. package/dist/policy.js.map +1 -1
  75. package/dist/post.d.ts +14 -0
  76. package/dist/post.js +32 -10
  77. package/dist/post.js.map +1 -1
  78. package/dist/project.d.ts +89 -0
  79. package/dist/project.js +123 -0
  80. package/dist/project.js.map +1 -1
  81. package/dist/redact.d.ts +77 -2
  82. package/dist/redact.js +713 -47
  83. package/dist/redact.js.map +1 -1
  84. package/dist/session_targets.d.ts +713 -0
  85. package/dist/session_targets.js +2602 -0
  86. package/dist/session_targets.js.map +1 -0
  87. package/dist/spool.d.ts +12 -0
  88. package/dist/spool.js +29 -1
  89. package/dist/spool.js.map +1 -1
  90. package/dist/spool_union.d.ts +51 -0
  91. package/dist/spool_union.js +57 -0
  92. package/dist/spool_union.js.map +1 -0
  93. package/dist/state.d.ts +5 -0
  94. package/dist/state.js +19 -1
  95. package/dist/state.js.map +1 -1
  96. package/dist/text_tail.d.ts +8 -0
  97. package/dist/text_tail.js +19 -0
  98. package/dist/text_tail.js.map +1 -0
  99. package/dist/version.d.ts +1 -1
  100. package/dist/version.js +1 -1
  101. package/package.json +3 -3
@@ -38,6 +38,7 @@
38
38
  */
39
39
  import { isAllowedIngestUrl } from "../post.js";
40
40
  import { CHALLENGE_METHOD } from "./pkce.js";
41
+ import { stripTrailing } from "../text_tail.js";
41
42
  /** RFC 9728 §3.1. */
42
43
  export const PROTECTED_RESOURCE_PATH = "/.well-known/oauth-protected-resource";
43
44
  /** RFC 8414 §3. */
@@ -115,7 +116,7 @@ export async function discover(resourceUrl, deps) {
115
116
  if (!isAllowedIngestUrl(issuer)) {
116
117
  return { kind: "malformed", url: prmUrl, detail: "insecure_endpoint" };
117
118
  }
118
- const asUrl = `${issuer.replace(/\/+$/, "")}${AUTHORIZATION_SERVER_PATH}`;
119
+ const asUrl = `${stripTrailing(issuer, "/")}${AUTHORIZATION_SERVER_PATH}`;
119
120
  const as = await getJson(asUrl, deps);
120
121
  if (!as.ok)
121
122
  return { kind: "unreachable", url: asUrl };
@@ -1 +1 @@
1
- {"version":3,"file":"discovery.js","sourceRoot":"","sources":["../../src/oauth/discovery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE7C,qBAAqB;AACrB,MAAM,CAAC,MAAM,uBAAuB,GAAG,uCAAuC,CAAC;AAC/E,mBAAmB;AACnB,MAAM,CAAC,MAAM,yBAAyB,GAAG,yCAAyC,CAAC;AAEn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AA6B,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAChG,gCAAgC,EAAE,OAAO;SAC1C;KACF,CAAC;AACJ,CAAC"}
@@ -19,6 +19,7 @@
19
19
  * @provenance vibecommit-mcp src/oauth/discovery.ts — `code_challenge_methods_supported`, retyped
20
20
  */
21
21
  import { createHash, randomBytes, timingSafeEqual } from "node:crypto";
22
+ import { stripTrailing } from "../text_tail.js";
22
23
  /**
23
24
  * The one supported challenge method. Declared `const` so it is a literal type:
24
25
  * `method: "S256"` cannot be assigned `"plain"` anywhere downstream.
@@ -36,7 +37,7 @@ const VERIFIER_BYTES = 32;
36
37
  const STATE_BYTES = 32;
37
38
  /** RFC 4648 §5 base64url, unpadded — the encoding both ends of PKCE use. */
38
39
  export function base64url(bytes) {
39
- return bytes.toString("base64").replace(/=+$/, "").replace(/\+/g, "-").replace(/\//g, "_");
40
+ return stripTrailing(bytes.toString("base64"), "=").replace(/\+/g, "-").replace(/\//g, "_");
40
41
  }
41
42
  /**
42
43
  * Mint a fresh verifier and its challenge.
@@ -1 +1 @@
1
- {"version":3,"file":"pkce.js","sourceRoot":"","sources":["../../src/oauth/pkce.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEvE;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAe,CAAC;AAGhD;;;;;;GAMG;AACH,MAAM,cAAc,GAAG,EAAE,CAAC;AAE1B,+EAA+E;AAC/E,MAAM,WAAW,GAAG,EAAE,CAAC;AAUvB,4EAA4E;AAC5E,MAAM,UAAU,SAAS,CAAC,KAAa;IACrC,OAAO,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,KA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CAAC"}
package/dist/paths.d.ts CHANGED
@@ -19,6 +19,13 @@ export declare function rootDir(home: string): string;
19
19
  export declare function credentialsPath(home: string): string;
20
20
  /** The per-project consent allow list. Consulted BEFORE any transcript read (D56 §D19). */
21
21
  export declare function projectsPath(home: string): string;
22
+ /**
23
+ * Folder grants (any-folder capture, R3): a folder whose no-repo sessions may be captured under a `local:folder:` identity.
24
+ * ⛔ A separate file from `projects.json` on purpose: that one is keyed by git common dir and enumerated as clones (`status`,
25
+ * `machine_state`), and a folder in it would be listed as one. Keyed by the folder's REALPATH. Client-side only: never synced,
26
+ * because the server holds no path and never refuses a `local:` slug. Absent file: no folder is granted.
27
+ */
28
+ export declare function foldersPath(home: string): string;
22
29
  /**
23
30
  * The slug-keyed grant list — owners, repos, exclusions and refusals. Read next to
24
31
  * `projects.json` by `consent.ts`'s `isCaptureAllowed`, BEFORE any transcript read.
@@ -183,6 +190,27 @@ export declare function sessionStatePath(home: string, key: SessionKey): string
183
190
  * repo-less bucket, and a caller with no repo has nothing to scan.
184
191
  */
185
192
  export declare function repoSessionsDir(home: string, repoKey: string): string | null;
193
+ /**
194
+ * ⛔ The directory that holds per-SESSION state which is not any one repo's: the session's target record
195
+ * (`session_targets.ts`) and the digest → work-tree notes.
196
+ *
197
+ * Under `state/notices/` and NOT beside the repo digests, and not a new `state/` entry, on purpose: two suites pin entry-name
198
+ * sets (`study-contract.test.ts` pins `state/` to `notices` and `sessions`; `agent-registry.test.ts` counts the entries of
199
+ * `state/sessions/` as repo digests, and the study harness binds both). `notices/` is already a mixed namespace
200
+ * (`machine-day`, `machine-epoch`, `clone`, `repo-day`, one directory per session id) that nothing enumerates. None of the
201
+ * files here has a `.json` suffix, so no scan that reads `*.json` can mistake one for a repo's session state.
202
+ */
203
+ export declare function targetsDir(home: string): string;
204
+ /** Where every repo's `<digest>/` state directory lives. */
205
+ export declare function sessionsRoot(home: string): string;
206
+ /** One session's target record: scan cursors, resolved roots, targets, undecided names. Not a `.json` (see `targetsDir`). */
207
+ export declare function sessionTargetsPath(home: string, sessionId: string): string;
208
+ /** Which work tree a state digest names — written by `spool.ts` when a commit is spooled. Null for no repo key. */
209
+ export declare function repoKeyNotePath(home: string, repoKey: string): string | null;
210
+ /** The digest a work tree's state directory is named by (`repoSessionsDir`). Exposed for the spool-evidence reader. */
211
+ export declare function repoKeyDigest(repoKey: string): string;
212
+ /** The stem every file of one session is named by (`<stem>.json`, `.spool.jsonl`, …). */
213
+ export declare function sessionFileStem(sessionId: string): string;
186
214
  /**
187
215
  * Where Claude Code writes transcripts.
188
216
  *
@@ -226,7 +254,12 @@ export declare function codexTranscriptRoot(home: string, env: NodeJS.ProcessEnv
226
254
  * all**. The repository that IS one sits a directory below it, so its project
227
255
  * key munges to that workspace's name with the child directory appended — a
228
256
  * name with no directory under `projects/` — and a project-key-derived root
229
- * would refuse the one real transcript there is.
257
+ * would refuse the one real transcript there is. (That is the same shape as the
258
+ * parent-folder sessions any-folder capture now reads: a session launched in a
259
+ * folder above its repos has no single repo whose key could name its transcript's
260
+ * directory. The boundary therefore stays registry-computed and can only refuse;
261
+ * WHICH repos or folder a session's bytes go to is `session_targets`' decision,
262
+ * made after this confinement, never an input to it.)
230
263
  *
231
264
  * ⇒ ⛔ **The interior shape is enforced by `isCursorTranscript` instead**, which
232
265
  * runs AFTER the registry-computed boundary and can only refuse. Read that
package/dist/paths.js CHANGED
@@ -14,8 +14,8 @@
14
14
  * @provenance vibecommit-schema ingest_sessions.file_key — CHECK bound 1..128, retyped
15
15
  */
16
16
  import { createHash } from "node:crypto";
17
- import { realpathSync } from "node:fs";
18
17
  import { join, sep } from "node:path";
18
+ import { physicalPath } from "./physical_path.js";
19
19
  /** Root of the client's own state. Never Claude Code's — see the plan's keychain note. */
20
20
  export function rootDir(home) {
21
21
  return join(home, ".vibecommit");
@@ -28,6 +28,15 @@ export function credentialsPath(home) {
28
28
  export function projectsPath(home) {
29
29
  return join(rootDir(home), "projects.json");
30
30
  }
31
+ /**
32
+ * Folder grants (any-folder capture, R3): a folder whose no-repo sessions may be captured under a `local:folder:` identity.
33
+ * ⛔ A separate file from `projects.json` on purpose: that one is keyed by git common dir and enumerated as clones (`status`,
34
+ * `machine_state`), and a folder in it would be listed as one. Keyed by the folder's REALPATH. Client-side only: never synced,
35
+ * because the server holds no path and never refuses a `local:` slug. Absent file: no folder is granted.
36
+ */
37
+ export function foldersPath(home) {
38
+ return join(rootDir(home), "folders.json");
39
+ }
31
40
  /**
32
41
  * The slug-keyed grant list — owners, repos, exclusions and refusals. Read next to
33
42
  * `projects.json` by `consent.ts`'s `isCaptureAllowed`, BEFORE any transcript read.
@@ -204,6 +213,41 @@ export function repoSessionsDir(home, repoKey) {
204
213
  return null;
205
214
  return join(stateDir(home), "sessions", repoDigest(repoKey));
206
215
  }
216
+ /**
217
+ * ⛔ The directory that holds per-SESSION state which is not any one repo's: the session's target record
218
+ * (`session_targets.ts`) and the digest → work-tree notes.
219
+ *
220
+ * Under `state/notices/` and NOT beside the repo digests, and not a new `state/` entry, on purpose: two suites pin entry-name
221
+ * sets (`study-contract.test.ts` pins `state/` to `notices` and `sessions`; `agent-registry.test.ts` counts the entries of
222
+ * `state/sessions/` as repo digests, and the study harness binds both). `notices/` is already a mixed namespace
223
+ * (`machine-day`, `machine-epoch`, `clone`, `repo-day`, one directory per session id) that nothing enumerates. None of the
224
+ * files here has a `.json` suffix, so no scan that reads `*.json` can mistake one for a repo's session state.
225
+ */
226
+ export function targetsDir(home) {
227
+ return join(stateDir(home), "notices", "_session-targets");
228
+ }
229
+ /** Where every repo's `<digest>/` state directory lives. */
230
+ export function sessionsRoot(home) {
231
+ return join(stateDir(home), "sessions");
232
+ }
233
+ /** One session's target record: scan cursors, resolved roots, targets, undecided names. Not a `.json` (see `targetsDir`). */
234
+ export function sessionTargetsPath(home, sessionId) {
235
+ return join(targetsDir(home), `${sanitise(sessionId)}.targets`);
236
+ }
237
+ /** Which work tree a state digest names — written by `spool.ts` when a commit is spooled. Null for no repo key. */
238
+ export function repoKeyNotePath(home, repoKey) {
239
+ if (repoKey === "")
240
+ return null;
241
+ return join(targetsDir(home), `${repoDigest(repoKey)}.repo`);
242
+ }
243
+ /** The digest a work tree's state directory is named by (`repoSessionsDir`). Exposed for the spool-evidence reader. */
244
+ export function repoKeyDigest(repoKey) {
245
+ return repoDigest(repoKey);
246
+ }
247
+ /** The stem every file of one session is named by (`<stem>.json`, `.spool.jsonl`, …). */
248
+ export function sessionFileStem(sessionId) {
249
+ return sanitise(sessionId);
250
+ }
207
251
  /** A fixed-length, collision-free filename component for a work-tree path. */
208
252
  function repoDigest(repoKey) {
209
253
  return createHash("sha256").update(repoKey).digest("hex").slice(0, 32);
@@ -263,7 +307,12 @@ export function codexTranscriptRoot(home, env) {
263
307
  * all**. The repository that IS one sits a directory below it, so its project
264
308
  * key munges to that workspace's name with the child directory appended — a
265
309
  * name with no directory under `projects/` — and a project-key-derived root
266
- * would refuse the one real transcript there is.
310
+ * would refuse the one real transcript there is. (That is the same shape as the
311
+ * parent-folder sessions any-folder capture now reads: a session launched in a
312
+ * folder above its repos has no single repo whose key could name its transcript's
313
+ * directory. The boundary therefore stays registry-computed and can only refuse;
314
+ * WHICH repos or folder a session's bytes go to is `session_targets`' decision,
315
+ * made after this confinement, never an input to it.)
267
316
  *
268
317
  * ⇒ ⛔ **The interior shape is enforced by `isCursorTranscript` instead**, which
269
318
  * runs AFTER the registry-computed boundary and can only refuse. Read that
@@ -357,15 +406,11 @@ export function isTranscriptFile(_root, path) {
357
406
  export function isCursorTranscript(root, path) {
358
407
  if (!isInside(root, path))
359
408
  return false;
360
- let realRoot;
361
- let realPath;
362
- try {
363
- realRoot = realpathSync(root);
364
- realPath = realpathSync(path);
365
- }
366
- catch {
409
+ // C71 (3): the one resolver.
410
+ const realRoot = physicalPath(root, "fail");
411
+ const realPath = physicalPath(path, "fail");
412
+ if (realRoot === null || realPath === null)
367
413
  return false;
368
- }
369
414
  if (!realPath.endsWith(TRANSCRIPT_SUFFIX))
370
415
  return false;
371
416
  const segments = realPath.slice(realRoot.length + 1).split(sep);
@@ -491,8 +536,13 @@ export function isInside(root, candidate) {
491
536
  let realRoot;
492
537
  let realCandidate;
493
538
  try {
494
- realRoot = realpathSync(root);
495
- realCandidate = realpathSync(candidate);
539
+ // C70: physical resolution (`..` after a link is the link target's parent), missing = outside, as `realpathSync` threw.
540
+ const rootPath = physicalPath(root, "fail");
541
+ const candidatePath = physicalPath(candidate, "fail");
542
+ if (rootPath === null || candidatePath === null)
543
+ return false;
544
+ realRoot = rootPath;
545
+ realCandidate = candidatePath;
496
546
  }
497
547
  catch {
498
548
  return false;
package/dist/paths.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"paths.js","sourceRoot":"","sources":["../src/paths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAEtC,0FAA0F;AAC1F,MAAM,UAAU,OAAO,CAAC,IAAY;IAClC,OAAO,IAAI,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;AACnC,CAAC;AAED,qFAAqF;AACrF,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,kBAAkB,CAAC,CAAC;AACjD,CAAC;AAED,2FAA2F;AAC3F,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,eAAe,CAAC,CAAC;AAC9C,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,aAAa,CAAC,CAAC;AAC5C,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CA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IACzC,OAAO,UAAU,KAAK,SAAS,IAAI,UAAU,CAAC,IAAI,EAAE,KAAK,EAAE;QACzD,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,EAAE,cAAc,CAAC;QACzC,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;AACjC,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,IAAY,EAAE,GAAsB;IACjE,MAAM,UAAU,GAAG,GAAG,CAAC,UAAU,CAAC;IAClC,MAAM,IAAI,GACR,UAAU,KAAK,SAAS,IAAI,UAAU,CAAC,IAAI,EAAE,KAAK,EAAE;QAClD,CAAC,CAAC,UAAU,CAAC,IAAI,EAAE;QACnB,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAC3B,OAAO,IAAI,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;AAClC,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,OAAO,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC;AAC7C,CAAC"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * C70: ONE resolver for every path judgement.
3
+ *
4
+ * JavaScript's `realpathSync` runs `path.resolve` FIRST, which collapses `..` lexically: `A/shared/../secret.env`, with `A/shared` a link to `/repos/B/pkg`, is judged
5
+ * `A/secret.env`, while the kernel (and `realpathSync.native`) open `/repos/B/secret.env`. A call that runs in, or writes into, another repository through a link
6
+ * and a `..` was judged as this one. `physicalPath` walks the RAW components forward with a physical cursor, as the kernel does: `.` and empty components are
7
+ * skipped, `..` is the parent of the PHYSICAL cursor, and a component that is a link is replaced by its fully resolved target. Nothing is normalised before it.
8
+ *
9
+ * Fail closed: a component that exists but cannot be resolved (a dangling link, a loop, an unreadable folder) makes the whole path `null`.
10
+ */
11
+ /** The longest path, in bytes, that is resolved at all: at least the longest the kernel accepts (Linux 4,095 bytes, macOS 1,024), so nothing longer could have been opened. */
12
+ export declare const MAX_PATH_BYTES = 4096;
13
+ /** C74 (3): is this path (as a record wrote it) longer than any path the kernel could have opened? Such a path is unresolvable AT PLACEMENT: it is never stored. */
14
+ export declare function pathTooLong(path: string): boolean;
15
+ /**
16
+ * `base` + `relative`, the way the kernel reads them: a trailing separator is not doubled and `.` / empty components are dropped, but `..` is KEPT (it is only
17
+ * meaningful after the links before it are resolved, which is `physicalPath`'s job).
18
+ */
19
+ export declare function joinRaw(base: string, relative: string): string;
20
+ /** Where a walk ended: `path` is the physical cursor (with the `depth` components below the last place that exists appended, lexically). */
21
+ export interface PhysicalWalk {
22
+ readonly path: string;
23
+ /** How many trailing components of `path` do not exist (0: the whole path exists). Not counted: `..` that came back up through them. */
24
+ readonly depth: number;
25
+ }
26
+ /**
27
+ * The walk behind `physicalPath`. The kernel's own: a component that is a link is replaced, in place, by the components of its target (a relative target is read from
28
+ * the link's own physical parent, an absolute one from the root), so a `..` inside a target is also taken after the links before it. Only `lstat` and `readlink`
29
+ * are used. A link whose target is missing is dangling: `null` (it exists, so it is never "continued past"); so is a loop, a path longer than MAX_PATH_BYTES, and a
30
+ * component `lstat` cannot read (EACCES, ENAMETOOLONG, EIO): the hook cannot tell whether it is a link, so a `..` after it is the same case as a `..` after a link, and
31
+ * when the physical answer cannot be known the rule fails closed (C49 (8)). C72 (1): Claude's `isInside` therefore equals 0.8.0 on every path with no `..` after a link
32
+ * and no `..` after a component that cannot be read; on those paths it WITHHOLDS (over-withholding, never a leak).
33
+ *
34
+ * BELOW the last place that exists nothing can be a link and nothing needs a syscall: a missing component sets `depth` to 1, a name there is appended (depth + 1) and a
35
+ * `..` there takes the parent (depth - 1), all lexically; once `depth` is back at 0 the walk looks at the file system again. So a path with thousands of missing
36
+ * components costs no more than its existing part.
37
+ */
38
+ export declare function physicalWalk(raw: string): PhysicalWalk | null;
39
+ /**
40
+ * The physical place `raw` names. `missing`: `"extend"` (default) keeps a path whose last components are not there (a file that is to be created; the caller
41
+ * works up to the nearest place that exists); `"fail"`: the whole path must exist (`null` otherwise, as `realpathSync` threw). `..` is taken in both after the links
42
+ * before it. A relative `raw` is read from the working folder.
43
+ */
44
+ export declare function physicalPath(raw: string, missing?: "extend" | "fail"): string | null;
45
+ /** The nearest place that EXISTS at or above `raw`, physically; `null` for a dangling link or a loop, or when more than `maxMissing` components are missing. */
46
+ export declare function nearestExistingPhysical(raw: string, maxMissing?: number): string | null;
@@ -0,0 +1,151 @@
1
+ /**
2
+ * C70: ONE resolver for every path judgement.
3
+ *
4
+ * JavaScript's `realpathSync` runs `path.resolve` FIRST, which collapses `..` lexically: `A/shared/../secret.env`, with `A/shared` a link to `/repos/B/pkg`, is judged
5
+ * `A/secret.env`, while the kernel (and `realpathSync.native`) open `/repos/B/secret.env`. A call that runs in, or writes into, another repository through a link
6
+ * and a `..` was judged as this one. `physicalPath` walks the RAW components forward with a physical cursor, as the kernel does: `.` and empty components are
7
+ * skipped, `..` is the parent of the PHYSICAL cursor, and a component that is a link is replaced by its fully resolved target. Nothing is normalised before it.
8
+ *
9
+ * Fail closed: a component that exists but cannot be resolved (a dangling link, a loop, an unreadable folder) makes the whole path `null`.
10
+ */
11
+ import { lstatSync, readlinkSync } from "node:fs";
12
+ import { dirname, isAbsolute, parse, sep } from "node:path";
13
+ /** More components than any path the OS accepts (PATH_MAX is 4096): a longer one is not resolved. */
14
+ const MAX_COMPONENTS = 4096;
15
+ /** The longest path, in bytes, that is resolved at all: at least the longest the kernel accepts (Linux 4,095 bytes, macOS 1,024), so nothing longer could have been opened. */
16
+ export const MAX_PATH_BYTES = 4096;
17
+ /** C74 (3): is this path (as a record wrote it) longer than any path the kernel could have opened? Such a path is unresolvable AT PLACEMENT: it is never stored. */
18
+ export function pathTooLong(path) {
19
+ return Buffer.byteLength(path, "utf8") > MAX_PATH_BYTES;
20
+ }
21
+ /**
22
+ * `base` + `relative`, the way the kernel reads them: a trailing separator is not doubled and `.` / empty components are dropped, but `..` is KEPT (it is only
23
+ * meaningful after the links before it are resolved, which is `physicalPath`'s job).
24
+ */
25
+ export function joinRaw(base, relative) {
26
+ const parts = relative.split("/").filter((part) => part !== "" && part !== ".");
27
+ if (parts.length === 0)
28
+ return base;
29
+ return `${base.endsWith(sep) ? base : base + sep}${parts.join(sep)}`;
30
+ }
31
+ /** The kernel's own limit on links followed while resolving one path (MAXSYMLINKS is 32 on Linux, 40 elsewhere). */
32
+ const MAX_LINKS = 40;
33
+ /**
34
+ * The walk behind `physicalPath`. The kernel's own: a component that is a link is replaced, in place, by the components of its target (a relative target is read from
35
+ * the link's own physical parent, an absolute one from the root), so a `..` inside a target is also taken after the links before it. Only `lstat` and `readlink`
36
+ * are used. A link whose target is missing is dangling: `null` (it exists, so it is never "continued past"); so is a loop, a path longer than MAX_PATH_BYTES, and a
37
+ * component `lstat` cannot read (EACCES, ENAMETOOLONG, EIO): the hook cannot tell whether it is a link, so a `..` after it is the same case as a `..` after a link, and
38
+ * when the physical answer cannot be known the rule fails closed (C49 (8)). C72 (1): Claude's `isInside` therefore equals 0.8.0 on every path with no `..` after a link
39
+ * and no `..` after a component that cannot be read; on those paths it WITHHOLDS (over-withholding, never a leak).
40
+ *
41
+ * BELOW the last place that exists nothing can be a link and nothing needs a syscall: a missing component sets `depth` to 1, a name there is appended (depth + 1) and a
42
+ * `..` there takes the parent (depth - 1), all lexically; once `depth` is back at 0 the walk looks at the file system again. So a path with thousands of missing
43
+ * components costs no more than its existing part.
44
+ */
45
+ export function physicalWalk(raw) {
46
+ // C72 (2): a bound at least as large as the longest path the kernel accepts (Linux PATH_MAX counts the NUL, so 4,095 bytes; macOS 1,024): a longer path is refused with
47
+ // ENAMETOOLONG before any lookup, so nothing could have been opened through it. Checked before any split, so one crafted line cannot cost more than 4,096 bytes of
48
+ // walking (below a missing component the walk is a growing string). The absolute half rests on the agents handing the kernel the cwd-joined form (Codex joins first,
49
+ // mirrored by codex_folders.ts `joinRaw`; Claude's paths are absolute): a tool that passed a long relative string itself would be over-withheld, never leaked.
50
+ if (pathTooLong(raw))
51
+ return null;
52
+ const absolute = isAbsolute(raw) ? raw : joinRaw(process.cwd(), raw);
53
+ if (pathTooLong(absolute))
54
+ return null;
55
+ const root = parse(absolute).root;
56
+ const pending = [];
57
+ const parts = absolute.slice(root.length).split(sep);
58
+ if (parts.length > MAX_COMPONENTS)
59
+ return null;
60
+ for (let i = parts.length - 1; i >= 0; i -= 1)
61
+ pending.push({ part: parts[i], viaLink: false });
62
+ let current = root;
63
+ let depth = 0;
64
+ let links = 0;
65
+ let steps = 0;
66
+ for (let item = pending.pop(); item !== undefined; item = pending.pop()) {
67
+ steps += 1;
68
+ if (steps > 4 * MAX_COMPONENTS)
69
+ return null;
70
+ const { part, viaLink } = item;
71
+ if (part === "" || part === ".")
72
+ continue;
73
+ if (part === "..") {
74
+ current = dirname(current);
75
+ if (depth > 0)
76
+ depth -= 1;
77
+ continue;
78
+ }
79
+ const next = current.endsWith(sep) ? current + part : current + sep + part;
80
+ if (depth > 0) {
81
+ current = next;
82
+ depth += 1;
83
+ continue;
84
+ }
85
+ let isLink;
86
+ try {
87
+ isLink = lstatSync(next).isSymbolicLink();
88
+ }
89
+ catch (error) {
90
+ const code = error.code;
91
+ if (code !== "ENOENT" && code !== "ENOTDIR")
92
+ return null;
93
+ // A component the target of a link names that is not there makes the link dangling: it exists, so it is never continued past.
94
+ if (viaLink)
95
+ return null;
96
+ current = next;
97
+ depth = 1;
98
+ continue;
99
+ }
100
+ if (!isLink) {
101
+ current = next;
102
+ continue;
103
+ }
104
+ links += 1;
105
+ if (links > MAX_LINKS)
106
+ return null;
107
+ let target;
108
+ try {
109
+ target = readlinkSync(next);
110
+ }
111
+ catch {
112
+ return null;
113
+ }
114
+ if (target === "")
115
+ return null;
116
+ let rest = target;
117
+ if (isAbsolute(target)) {
118
+ const targetRoot = parse(target).root;
119
+ current = targetRoot;
120
+ rest = target.slice(targetRoot.length);
121
+ }
122
+ const targetParts = rest.split(sep);
123
+ if (pending.length + targetParts.length > 4 * MAX_COMPONENTS)
124
+ return null;
125
+ for (let i = targetParts.length - 1; i >= 0; i -= 1)
126
+ pending.push({ part: targetParts[i], viaLink: true });
127
+ }
128
+ return { path: current, depth };
129
+ }
130
+ /**
131
+ * The physical place `raw` names. `missing`: `"extend"` (default) keeps a path whose last components are not there (a file that is to be created; the caller
132
+ * works up to the nearest place that exists); `"fail"`: the whole path must exist (`null` otherwise, as `realpathSync` threw). `..` is taken in both after the links
133
+ * before it. A relative `raw` is read from the working folder.
134
+ */
135
+ export function physicalPath(raw, missing = "extend") {
136
+ const walk = physicalWalk(raw);
137
+ if (walk === null)
138
+ return null;
139
+ return missing === "fail" && walk.depth > 0 ? null : walk.path;
140
+ }
141
+ /** The nearest place that EXISTS at or above `raw`, physically; `null` for a dangling link or a loop, or when more than `maxMissing` components are missing. */
142
+ export function nearestExistingPhysical(raw, maxMissing = 64) {
143
+ const walk = physicalWalk(raw);
144
+ if (walk === null || walk.depth > maxMissing)
145
+ return null;
146
+ let current = walk.path;
147
+ for (let i = 0; i < walk.depth; i += 1)
148
+ current = dirname(current);
149
+ return current;
150
+ }
151
+ //# sourceMappingURL=physical_path.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"physical_path.js","sourceRoot":"","sources":["../src/physical_path.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAE5D,qGAAqG;AACrG,MAAM,cAAc,GAAG,IAAI,CAAC;AAC5B,+KAA+K;AAC/K,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,CAAC;AAEnC,oKAAoK;AACpK,MAAM,UAAU,WAAW,CAAC,IAAY;IACtC,OAAO,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,GAAG,cAAc,CAAC;AAC1D,CAAC;AAED;;;GAGG;AACH,MAAM,U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AI,CAAC,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7G,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AAClC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,GAAW,EAAE,UAA6B,QAAQ;IAC7E,MAAM,IAAI,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC;IAC/B,IAAI,IAAI,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAC/B,OAAO,OAAO,KAAK,MAAM,IAAI,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;AACjE,CAAC;AAED,gKAAgK;AAChK,MAAM,UAAU,uBAAuB,CAAC,GAAW,EAAE,UAAU,GAAG,EAAE;IAClE,MAAM,IAAI,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC;IAC/B,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,CAAC,KAAK,GAAG,UAAU;QAAE,OAAO,IAAI,CAAC;IAC1D,IAAI,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC;IACxB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC;QAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACnE,OAAO,OAAO,CAAC;AACjB,CAAC"}
package/dist/picker.d.ts CHANGED
@@ -12,6 +12,9 @@
12
12
  * typing `-N`, deletes the grant. It is not an exclusion (`off` is), so the repo can be chosen again.
13
13
  * owners one group per owner NOT yet granted, its repos behind an `aN` "all, including repos you clone later"
14
14
  * row (D9: at most 8 repos before `+ N more`).
15
+ * folders (any-folder capture, R3) folders outside every work tree that hold sessions, one `Folders` group. A folder grant
16
+ * captures the sessions there that touch no repository, under a `local:folder:` identity that only the uploader
17
+ * can read; its grant line SAYS so ("private to you", R7). Granted folders are `on now` rows, removable like any.
15
18
  * turned off slugs in `excluded`. Choosing one is a re-include; the grant block names it on a `turn on` row, inside
16
19
  * the same y/N (D7 · 3A), and only a yes clears the exclusion.
17
20
  * on your account (slice 2) what the account grants that this machine has not named. Unticked until chosen, like any
@@ -21,7 +24,7 @@
21
24
  * y/N, which defaults to N. It is an ADDITION to the diff, never part of the baseline.
22
25
  */
23
26
  import { type Grants } from "./consent.js";
24
- import type { ScanClone, ScanRepo } from "./commands/scan.js";
27
+ import type { ScanClone, ScanFolder, ScanRepo } from "./commands/scan.js";
25
28
  import type { AgentId } from "./agents/types.js";
26
29
  /** D9: each owner group shows at most this many repos before the `+ N more` row. */
27
30
  export declare const GROUP_CAP = 8;
@@ -43,11 +46,22 @@ export interface PickRepo extends Counts {
43
46
  /** Starts ticked in the checklist. Only ever the working folder's repo, and only when it is not `$HOME`. */
44
47
  readonly pre: boolean;
45
48
  }
49
+ /** A folder the person can grant: outside every work tree, with sessions. `label` is how the row names it (`~/Documents/work`). */
50
+ export interface PickFolder extends Counts {
51
+ /** The REAL path: the key of the grant. */
52
+ readonly path: string;
53
+ readonly label: string;
54
+ readonly latestMs: number;
55
+ /** The person turned this folder off (or declined it). It is offered again, and choosing it turns it back on. */
56
+ readonly excluded?: boolean;
57
+ }
46
58
  /** One `on now` row. `kind` says what removing it deletes. */
47
59
  export interface OnNowRow {
48
- readonly kind: "owner" | "repo" | "clone";
49
- /** `alexvibecommit` (owner) or a slug. */
60
+ readonly kind: "owner" | "repo" | "clone" | "folder";
61
+ /** `alexvibecommit` (owner), a slug, or a folder's REAL path. */
50
62
  readonly key: string;
63
+ /** How a `folder` row is named on screen (its `key` is the path). */
64
+ readonly label?: string;
51
65
  readonly reason: string;
52
66
  readonly counts: Counts | null;
53
67
  /** Repos found here under an owner row. */
@@ -79,6 +93,8 @@ export interface PickerModel {
79
93
  /** What the account grants that this machine has not named. Empty before a sync, or on a machine with no credential. */
80
94
  readonly account: readonly AccountRow[];
81
95
  readonly turnedOff: readonly TurnedOffRow[];
96
+ /** Folders outside every work tree that hold sessions and are not yet granted, newest first (R3). */
97
+ readonly folders: readonly PickFolder[];
82
98
  /** The picker's `Not listed here:` lines (no remote, can't be matched, unreadable agents). */
83
99
  readonly notListed: readonly string[];
84
100
  /** Repos the scan listed, for the `Found N repositories` line. */
@@ -95,6 +111,9 @@ export interface PickerChange {
95
111
  readonly stopRepos: readonly string[];
96
112
  /** The slugs of per-clone consents to withdraw. */
97
113
  readonly stopClones: readonly string[];
114
+ /** Folder grants to add / withdraw, by REAL path. Optional so a change built before folders existed still types. */
115
+ readonly addFolders?: readonly string[];
116
+ readonly stopFolders?: readonly string[];
98
117
  }
99
118
  export declare const NO_CHANGE: PickerChange;
100
119
  export declare function isNoChange(change: PickerChange): boolean;
@@ -125,7 +144,32 @@ export interface ModelInput {
125
144
  readonly here: HereRepo | null;
126
145
  /** The account's grants this machine has not named, as `accountView` lists them: `owner/` for an owner, the slug for a repo. */
127
146
  readonly accountNotHere?: readonly string[];
147
+ /** Folders outside every work tree that hold sessions (`ScanResult.folders`). */
148
+ readonly folders?: readonly ScanFolder[];
149
+ /** The REAL paths of the folders already granted (`folders.json`). */
150
+ readonly grantedFolders?: readonly string[];
151
+ /** The REAL paths of the folders turned off or declined: offered again, marked, so they can be granted later. */
152
+ readonly excludedFolders?: readonly string[];
153
+ /** How a folder path is shown (`~`-relative). Default: the path as is. */
154
+ readonly folderLabel?: (path: string) => string;
155
+ /**
156
+ * C34: may this agent's sessions be captured under a folder? Default `agentIsolatesRecords`, the registry value the resolver gates on.
157
+ * A seam so a cell can flip one agent and prove the picker reads the predicate rather than a list.
158
+ */
159
+ readonly isolates?: (agent: AgentId) => boolean;
128
160
  }
161
+ /**
162
+ * The folder as a FOLDER GRANT would capture it (C34): only the sessions of agents whose records can be isolated count, because a
163
+ * Cursor session (or a Codex one, until its isolation lands) under a granted folder is never captured, and a count or an offer that
164
+ * included it would promise what does not happen. `null` when no session passes. Times and counts are recomputed from the members
165
+ * when the scan kept them; a hand-built folder without members keeps its own times and zeroes the agents that fail.
166
+ */
167
+ export declare function capturableFolder(folder: ScanFolder, isolates?: (agent: AgentId) => boolean): ScanFolder | null;
168
+ /**
169
+ * The agents a folder grant captures, as the copy names them: `Claude Code`, `Claude Code or Codex`, `Claude Code, Codex or Cursor`.
170
+ * Built from the same predicate as the offers (C34), so the sentence and the behaviour cannot disagree.
171
+ */
172
+ export declare function folderCaptureAgents(isolates?: (agent: AgentId) => boolean): string;
129
173
  export declare function buildModel(input: ModelInput): PickerModel;
130
174
  /** What a number on screen stands for. On-now rows come first, then each owner's repos, then turned-off. */
131
175
  export type RowRef = {
@@ -134,6 +178,9 @@ export type RowRef = {
134
178
  } | {
135
179
  readonly kind: "repo";
136
180
  readonly repo: PickRepo;
181
+ } | {
182
+ readonly kind: "folder";
183
+ readonly folder: PickFolder;
137
184
  } | {
138
185
  readonly kind: "account";
139
186
  readonly row: AccountRow;
@@ -194,6 +241,8 @@ export interface BlockFacts {
194
241
  readonly noClone: ReadonlySet<string>;
195
242
  /** `turn on` slugs the ACCOUNT has turned off: the row says so, because the yes re-includes them on every machine. */
196
243
  readonly accountOff?: ReadonlySet<string>;
244
+ /** How each folder in the change is named (`~`-relative); a folder with no entry shows its path. */
245
+ readonly folderLabels?: ReadonlyMap<string, string>;
197
246
  }
198
247
  /**
199
248
  * 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