@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
package/dist/redact.d.ts CHANGED
@@ -64,6 +64,14 @@ import type { RedactionProfile } from "./agents/types.js";
64
64
  * verdict inherits down the subtree* — and each agent supplies which keys play
65
65
  * which part. A second agent is a second row in the table below, not a branch.
66
66
  */
67
+ /** `values`: every content string withheld. `strict`: the same, and a record holding a data-shaped KEY (a skill name, a path) is withheld as a whole line (C26's form). */
68
+ export type AlwaysWithheld = "values" | "strict";
69
+ export type AggregateVerdict = {
70
+ readonly kind: "withhold";
71
+ } | {
72
+ readonly kind: "keepKeys";
73
+ readonly paths: ReadonlySet<string>;
74
+ };
67
75
  export interface RedactionRules {
68
76
  /** Keys whose STRING value is a filesystem path. The SELECTOR, never redacted. */
69
77
  readonly pathKeys: ReadonlySet<string>;
@@ -79,6 +87,33 @@ export interface RedactionRules {
79
87
  readonly nestedJsonKeys: ReadonlySet<string>;
80
88
  /** Keys holding `[{ lines: [...] }]` hunk arrays whose lines are content. */
81
89
  readonly patchKeys: ReadonlySet<string>;
90
+ /**
91
+ * C37: extra path and content keys that apply ONLY inside a record's `attachment` subtree. An attachment names its file as `path` or
92
+ * `filename` (not `filePath`) and carries it as `content`, `rawContent` or `snippet`: `nested_memory {path, content: {path, content,
93
+ * rawContent}}`, `edited_text_file {filename, snippet}`, `instructions {files: [{path, content}]}`. `path` cannot be a path key
94
+ * everywhere (a tool input's `path` names a SEARCH root, not the subject of its siblings), so the scope is the subtree.
95
+ */
96
+ readonly attachment?: {
97
+ readonly pathKeys: ReadonlySet<string>;
98
+ readonly contentKeys: ReadonlySet<string>;
99
+ };
100
+ /**
101
+ * C39 (iv): a record this dialect's own schema says is a SUMMARY OF THE WHOLE CONVERSATION (Claude's `isCompactSummary` user record: a
102
+ * model-written digest of everything before it, file text included). Its content is withheld in EVERY copy, single-repo copies and the
103
+ * golden's shape included, with the same length-preserving marks as an isolated record. Decided by the record, never by a path.
104
+ */
105
+ readonly alwaysWithheld?: (record: Record<string, unknown>) => AlwaysWithheld | null;
106
+ /**
107
+ * C27 (R17 for records with no folder of their own): what a MULTI-REPOSITORY copy of a session does with a record whose origin cannot be
108
+ * told from the record. `null`: kept as written (the path rule still applies). `withhold`: every content string is withheld, as in an isolated
109
+ * record. `keepKeys`: strings under the listed key paths stay, every other string is withheld (a KEEP type is bound to its measured keys).
110
+ */
111
+ readonly aggregate?: (record: Record<string, unknown>) => AggregateVerdict | null;
112
+ /**
113
+ * C40 (2): keys whose WHOLE subtree is instruction text this dialect injects (Codex's `developer_instructions`, `base_instructions`):
114
+ * every string under such a key is withheld wherever the key appears, in every copy, whatever path sits beside it.
115
+ */
116
+ readonly withheldKeys?: (key: string) => boolean;
82
117
  }
83
118
  /**
84
119
  * The rules a profile LABEL names.
@@ -136,6 +171,44 @@ export interface RedactionCounts {
136
171
  export interface RedactedLine extends RedactionCounts {
137
172
  readonly line: string;
138
173
  }
174
+ /**
175
+ * ⛔ **THE TWO ADDITIONS ANY-FOLDER CAPTURE MAKES TO THIS CHOKEPOINT** (R6 · R17). Both are decided by the CALLER, which knows
176
+ * the target; this module only applies them, length-preservingly, with the same markers as every other redaction.
177
+ *
178
+ * - `hole` (R6, a FOLDER target's EXCLUSION ROOTS): a path inside `projectRoots` is still OUT OF TREE when `hole` says so. A
179
+ * folder like `~/Documents/VibeCommit` contains repos; the folder stream keeps what is inside the folder and outside every git
180
+ * work tree, and withholds anything inside a nested work tree (a backstop for a repo the evidence missed). "Inside A but not
181
+ * inside B" is not expressible as a root set, which is why this is a predicate.
182
+ * - `foreignRecord` (R17, RECORD ISOLATION): a record whose `cwd` resolves inside a work tree OTHER than the target's is a
183
+ * command, its output, or prose from another repo's session. Every content-bearing string in it is withheld; the structural
184
+ * keys (`STRUCTURAL_KEYS`) stay, so the stream still parses and a turn is still a turn. Records run from the launch folder
185
+ * are untouched: that residual (prompts and prose from the parent folder) is stated in the README and the claims register.
186
+ */
187
+ export interface RedactionScope {
188
+ readonly hole?: (candidate: string) => boolean;
189
+ readonly foreignRecord?: (record: Record<string, unknown>) => boolean;
190
+ /**
191
+ * C48 (11), Codex: the FILES a record's call names (an `apply_patch`'s headers in any form, `view_image`'s path; the same for the call's output), and for a
192
+ * call itself the places only its input is judged by. Each is judged like a Claude path: a file outside this copy's roots, or inside a hole, withholds the
193
+ * whole record (length-preserving), in every copy.
194
+ */
195
+ readonly namedFiles?: (record: Record<string, unknown>) => readonly string[];
196
+ /**
197
+ * C27: this copy belongs to a session that named a work tree other than the target's (or whose status is unknown, which counts the same).
198
+ * Records the dialect cannot attribute (`RedactionRules.aggregate`) are withheld from it.
199
+ */
200
+ readonly multi?: boolean;
201
+ /**
202
+ * C40 (1): the open-calls checkpoint of THIS stream, read at the record `at` was last given. `paths`: the call named these files (judged per copy
203
+ * with the copy's roots and holes); `none`: the call named no file (a stated residual: its result is kept); `unknown`: the call is not known
204
+ * (an overflow, a position the checkpoint no longer covers): its result is withheld, failing closed.
205
+ */
206
+ readonly calls?: (id: string) => readonly string[] | "none" | "unknown";
207
+ /** Called by `redactSpan` with the absolute offset of each segment it is about to redact, so `calls` can judge by position. */
208
+ readonly at?: (absoluteOffset: number) => void;
209
+ /** C42: told each parsed record of a span before it is judged (past the scan cursor, the hook learns calls and a second work tree from it). */
210
+ readonly observe?: (record: Record<string, unknown>) => void;
211
+ }
139
212
  /**
140
213
  * Redact one NDJSON line. **Pure, total, and length-preserving.**
141
214
  *
@@ -144,7 +217,7 @@ export interface RedactedLine extends RedactionCounts {
144
217
  * (DESIGN.md §13.7), and a redactor that dropped a line it could not parse would
145
218
  * be silent data loss on a path where D56 §D8 makes loss permanent.
146
219
  */
147
- export declare function redactLine(line: string, projectRoots: readonly string[], rules: RedactionRules, resolver?: Containment): RedactedLine;
220
+ export declare function redactLine(line: string, projectRoots: readonly string[], rules: RedactionRules, resolver?: Containment, scope?: RedactionScope): RedactedLine;
148
221
  /**
149
222
  * Redact every complete line in a raw transcript span.
150
223
  *
@@ -154,7 +227,9 @@ export declare function redactLine(line: string, projectRoots: readonly string[]
154
227
  * which is what keeps a span that bisects a multi-byte character from changing
155
228
  * length when it is re-encoded.
156
229
  */
157
- export declare function redactSpan(span: Buffer, projectRoots: readonly string[], rules: RedactionRules): {
230
+ export declare function redactSpan(span: Buffer, projectRoots: readonly string[], rules: RedactionRules, scope?: RedactionScope,
231
+ /** The absolute offset of `span[0]` in its file (`scope.at` is told each segment's). */
232
+ spanStart?: number): {
158
233
  bytes: Buffer;
159
234
  } & RedactionCounts;
160
235
  /**