@vibe-agent-toolkit/utils 0.2.0-rc.6 → 0.2.0-rc.8

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 (193) hide show
  1. package/README.md +43 -9
  2. package/dist/asset-reference.js +3 -11
  3. package/dist/asset-reference.js.map +1 -1
  4. package/dist/crawl-timing.d.ts +3 -3
  5. package/dist/crawl-timing.js +3 -3
  6. package/dist/dirent-kind.d.ts +83 -0
  7. package/dist/dirent-kind.d.ts.map +1 -0
  8. package/dist/dirent-kind.js +129 -0
  9. package/dist/dirent-kind.js.map +1 -0
  10. package/dist/entrypoint.d.ts +54 -0
  11. package/dist/entrypoint.d.ts.map +1 -0
  12. package/dist/entrypoint.js +71 -0
  13. package/dist/entrypoint.js.map +1 -0
  14. package/dist/env-flag.d.ts +46 -0
  15. package/dist/env-flag.d.ts.map +1 -0
  16. package/dist/env-flag.js +57 -0
  17. package/dist/env-flag.js.map +1 -0
  18. package/dist/errors/errno.d.ts +51 -0
  19. package/dist/errors/errno.d.ts.map +1 -0
  20. package/dist/errors/errno.js +112 -0
  21. package/dist/errors/errno.js.map +1 -0
  22. package/dist/errors/vat-error.d.ts +60 -0
  23. package/dist/errors/vat-error.d.ts.map +1 -0
  24. package/dist/errors/vat-error.js +86 -0
  25. package/dist/errors/vat-error.js.map +1 -0
  26. package/dist/file-crawler.d.ts +22 -0
  27. package/dist/file-crawler.d.ts.map +1 -1
  28. package/dist/file-crawler.js +83 -22
  29. package/dist/file-crawler.js.map +1 -1
  30. package/dist/fs/file-hash.d.ts.map +1 -1
  31. package/dist/fs/file-hash.js +0 -1
  32. package/dist/fs/file-hash.js.map +1 -1
  33. package/dist/fs-utils.d.ts +422 -217
  34. package/dist/fs-utils.d.ts.map +1 -1
  35. package/dist/fs-utils.js +535 -283
  36. package/dist/fs-utils.js.map +1 -1
  37. package/dist/fs.d.ts +3 -2
  38. package/dist/fs.d.ts.map +1 -1
  39. package/dist/fs.js +5 -7
  40. package/dist/fs.js.map +1 -1
  41. package/dist/git-run.d.ts +1 -1
  42. package/dist/git-run.js +1 -1
  43. package/dist/git-tracker.d.ts +41 -2
  44. package/dist/git-tracker.d.ts.map +1 -1
  45. package/dist/git-tracker.js +84 -19
  46. package/dist/git-tracker.js.map +1 -1
  47. package/dist/git-utils.d.ts +47 -2
  48. package/dist/git-utils.d.ts.map +1 -1
  49. package/dist/git-utils.js +123 -20
  50. package/dist/git-utils.js.map +1 -1
  51. package/dist/git.d.ts +1 -0
  52. package/dist/git.d.ts.map +1 -1
  53. package/dist/git.js.map +1 -1
  54. package/dist/gitignore-checker.d.ts.map +1 -1
  55. package/dist/gitignore-checker.js +9 -3
  56. package/dist/gitignore-checker.js.map +1 -1
  57. package/dist/index.d.ts +10 -4
  58. package/dist/index.d.ts.map +1 -1
  59. package/dist/index.js +48 -22
  60. package/dist/index.js.map +1 -1
  61. package/dist/listing-refusal.d.ts +112 -0
  62. package/dist/listing-refusal.d.ts.map +1 -0
  63. package/dist/listing-refusal.js +105 -0
  64. package/dist/listing-refusal.js.map +1 -0
  65. package/dist/path-containment.d.ts +64 -0
  66. package/dist/path-containment.d.ts.map +1 -0
  67. package/dist/path-containment.js +111 -0
  68. package/dist/path-containment.js.map +1 -0
  69. package/dist/path-core.d.ts +77 -3
  70. package/dist/path-core.d.ts.map +1 -1
  71. package/dist/path-core.js +96 -6
  72. package/dist/path-core.js.map +1 -1
  73. package/dist/path-utils.d.ts.map +1 -1
  74. package/dist/path-utils.js +42 -47
  75. package/dist/path-utils.js.map +1 -1
  76. package/dist/path.d.ts +1 -1
  77. package/dist/path.d.ts.map +1 -1
  78. package/dist/path.js +1 -1
  79. package/dist/path.js.map +1 -1
  80. package/dist/process.d.ts +7 -0
  81. package/dist/process.d.ts.map +1 -1
  82. package/dist/process.js +7 -0
  83. package/dist/process.js.map +1 -1
  84. package/dist/project-utils.d.ts.map +1 -1
  85. package/dist/project-utils.js +9 -6
  86. package/dist/project-utils.js.map +1 -1
  87. package/dist/safe-exec.d.ts +2 -1
  88. package/dist/safe-exec.d.ts.map +1 -1
  89. package/dist/safe-exec.js +26 -8
  90. package/dist/safe-exec.js.map +1 -1
  91. package/dist/skill-targets.d.ts +2 -2
  92. package/dist/skill-targets.js +2 -2
  93. package/dist/skill-test/auth-resolver.d.ts +10 -2
  94. package/dist/skill-test/auth-resolver.d.ts.map +1 -1
  95. package/dist/skill-test/auth-resolver.js +26 -11
  96. package/dist/skill-test/auth-resolver.js.map +1 -1
  97. package/dist/skill-test/spawn-claude.d.ts +2 -1
  98. package/dist/skill-test/spawn-claude.d.ts.map +1 -1
  99. package/dist/skill-test/spawn-claude.js +20 -3
  100. package/dist/skill-test/spawn-claude.js.map +1 -1
  101. package/dist/skill-test/transcript.d.ts.map +1 -1
  102. package/dist/skill-test/transcript.js +18 -17
  103. package/dist/skill-test/transcript.js.map +1 -1
  104. package/dist/stdio-blocking.js +13 -14
  105. package/dist/stdio-blocking.js.map +1 -1
  106. package/dist/test-helpers.d.ts +56 -193
  107. package/dist/test-helpers.d.ts.map +1 -1
  108. package/dist/test-helpers.js +115 -284
  109. package/dist/test-helpers.js.map +1 -1
  110. package/dist/testing/executables.d.ts +32 -0
  111. package/dist/testing/executables.d.ts.map +1 -0
  112. package/dist/testing/executables.js +70 -0
  113. package/dist/testing/executables.js.map +1 -0
  114. package/dist/testing/hostile-tree.d.ts +79 -0
  115. package/dist/testing/hostile-tree.d.ts.map +1 -0
  116. package/dist/testing/hostile-tree.js +164 -0
  117. package/dist/testing/hostile-tree.js.map +1 -0
  118. package/dist/testing/platform-gates.d.ts +31 -0
  119. package/dist/testing/platform-gates.d.ts.map +1 -0
  120. package/dist/testing/platform-gates.js +31 -0
  121. package/dist/testing/platform-gates.js.map +1 -0
  122. package/dist/testing/temp-dir.d.ts +255 -0
  123. package/dist/testing/temp-dir.d.ts.map +1 -0
  124. package/dist/testing/temp-dir.js +363 -0
  125. package/dist/testing/temp-dir.js.map +1 -0
  126. package/dist/testing.d.ts +21 -0
  127. package/dist/testing.d.ts.map +1 -1
  128. package/dist/testing.js +27 -1
  129. package/dist/testing.js.map +1 -1
  130. package/dist/text-content.d.ts.map +1 -1
  131. package/dist/text-content.js +7 -1
  132. package/dist/text-content.js.map +1 -1
  133. package/dist/text-file.d.ts.map +1 -1
  134. package/dist/text-file.js +0 -2
  135. package/dist/text-file.js.map +1 -1
  136. package/dist/timing-dump.d.ts +1 -1
  137. package/dist/timing-dump.d.ts.map +1 -1
  138. package/dist/timing-dump.js +1 -2
  139. package/dist/timing-dump.js.map +1 -1
  140. package/dist/windows-shell.d.ts +0 -1
  141. package/dist/windows-shell.d.ts.map +1 -1
  142. package/dist/windows-shell.js +0 -1
  143. package/dist/windows-shell.js.map +1 -1
  144. package/dist/zod-introspection.js +2 -2
  145. package/dist/zod-introspection.js.map +1 -1
  146. package/eslint/README.md +132 -60
  147. package/eslint/index.cjs +111 -147
  148. package/eslint/index.d.cts +14 -14
  149. package/eslint/rules/callee-name.cjs +23 -0
  150. package/eslint/rules/commands-import-boundary.cjs +148 -0
  151. package/eslint/rules/dead-import.cjs +1 -1
  152. package/eslint/rules/dirent-type-needs-symlink-check.cjs +282 -0
  153. package/eslint/rules/eslint-rule-factory.cjs +5 -2
  154. package/eslint/rules/exempt-path-matcher.cjs +1 -1
  155. package/eslint/rules/explicit-zod-strictness.cjs +120 -0
  156. package/eslint/rules/no-bare-dynamic-import-path.cjs +5 -1
  157. package/eslint/rules/no-bare-executable-spawn.cjs +70 -0
  158. package/eslint/rules/no-bare-symlink-in-tests.cjs +16 -3
  159. package/eslint/rules/no-blind-catch.cjs +171 -0
  160. package/eslint/rules/no-child-process-execSync.cjs +8 -0
  161. package/eslint/rules/no-decaying-referent.cjs +216 -0
  162. package/eslint/rules/no-dotdot-containment.cjs +160 -0
  163. package/eslint/rules/no-file-url-string-concat.cjs +4 -1
  164. package/eslint/rules/no-fragile-entrypoint-guard.cjs +228 -0
  165. package/eslint/rules/no-fs-mkdirSync.cjs +8 -0
  166. package/eslint/rules/no-fs-promises-cp.cjs +7 -0
  167. package/eslint/rules/no-fs-realpathSync.cjs +8 -0
  168. package/eslint/rules/no-hardcoded-path-split.cjs +7 -2
  169. package/eslint/rules/no-io-in-unit-tier.cjs +128 -0
  170. package/eslint/rules/no-literal-process-exit.cjs +129 -0
  171. package/eslint/rules/no-manual-path-normalize.cjs +7 -2
  172. package/eslint/rules/no-os-tmpdir.cjs +8 -0
  173. package/eslint/rules/no-path-operations-in-comparisons.cjs +7 -2
  174. package/eslint/rules/no-path-sep-in-strings.cjs +7 -2
  175. package/eslint/rules/no-path-startswith.cjs +7 -2
  176. package/eslint/rules/no-process-exit-in-phase.cjs +12 -2
  177. package/eslint/rules/no-raw-node-path.cjs +563 -0
  178. package/eslint/rules/no-raw-text-decode.cjs +10 -1
  179. package/eslint/rules/no-registry-count-pin.cjs +255 -0
  180. package/eslint/rules/no-self-package-import.cjs +13 -2
  181. package/eslint/rules/no-test-scoped-functions.cjs +10 -3
  182. package/eslint/rules/no-unix-shell-commands.cjs +6 -2
  183. package/eslint/rules/no-unsafe-root-join.cjs +23 -2
  184. package/eslint/rules/no-url-pathname-for-fs.cjs +5 -1
  185. package/eslint/rules/no-version-literal.cjs +151 -0
  186. package/eslint/rules/prefer-startswith-over-regex.cjs +9 -0
  187. package/eslint/rules/require-justified-skip.cjs +8 -2
  188. package/eslint/rules/safe-import.cjs +1 -1
  189. package/package.json +5 -10
  190. package/eslint/rules/no-path-join.cjs +0 -14
  191. package/eslint/rules/no-path-relative.cjs +0 -14
  192. package/eslint/rules/no-path-resolve.cjs +0 -14
  193. package/eslint/rules/path-function-rule-factory.cjs +0 -496
package/dist/git-utils.js CHANGED
@@ -4,9 +4,118 @@
4
4
  */
5
5
  import { existsSync } from 'node:fs';
6
6
  import { dirname, parse } from 'node:path';
7
+ import { directoryRefusalFor, listingFailure } from './fs-utils.js';
7
8
  import { lookupGitRoot, rememberGitRoot } from './git-root-cache.js';
8
9
  import { runGit } from './git-run.js';
10
+ import { requireUnreadablePolicy, settleRefusal } from './listing-refusal.js';
9
11
  import { safePath } from './path-utils.js';
12
+ /**
13
+ * One line of git's stderr that means "I skipped this directory".
14
+ *
15
+ * `git ls-files --others` (and `--ignored`, and `git add --all`) walks the
16
+ * working tree to find untracked files. On a directory it cannot open it prints
17
+ * this warning, exits 0, and omits the subtree — so stdout alone is a shorter
18
+ * list that nothing can tell from a complete one. The path is spelled
19
+ * **relative to the worktree root** with a trailing slash, even when git was
20
+ * run from a subdirectory (measured: cwd `docs/open`, warning names
21
+ * `'docs/open/sub/'`).
22
+ *
23
+ * Anchored to the line so an unrelated warning naming a directory in passing
24
+ * is not read as a refusal. The reason after the colon is `strerror` text —
25
+ * see {@link STRERROR_TO_ERRNO}.
26
+ */
27
+ const UNLISTABLE_DIRECTORY_LINE = /^warning: could not open directory '(.+?)\/?': (.*)$/gm;
28
+ /**
29
+ * C-locale `strerror` text → errno, for the reasons git can print here.
30
+ *
31
+ * git does not print the errno name, only its message; every listing below
32
+ * runs with `LC_ALL=C` so the message is the C-locale one and this table can
33
+ * be short. An unlisted reason is still a refusal — it becomes `UNKNOWN`, the
34
+ * same answer `listingFailure` gives an error carrying no errno — because
35
+ * dropping the line would reinstate the silent gap for exactly the errnos
36
+ * nobody thought of.
37
+ *
38
+ * The two ABSENCE reasons are listed so that `listingFailure` — the one owner
39
+ * of the absent/unreadable split — can recognise them and the line can be
40
+ * skipped: git prints "No such file or directory" for an untracked directory
41
+ * deleted between its parent's `readdir` and its own `opendir` (a concurrent
42
+ * `rm -rf tmp/`), and the walk route treats that same race as "no longer in
43
+ * the population" rather than as a refusal. Left unmapped it read as an
44
+ * `UNKNOWN` refusal, and the git route aborted a run the walk completed.
45
+ */
46
+ const STRERROR_TO_ERRNO = new Map([
47
+ ['Permission denied', 'EACCES'],
48
+ ['Too many open files', 'EMFILE'],
49
+ ['Too many open files in system', 'ENFILE'],
50
+ ['Too many levels of symbolic links', 'ELOOP'],
51
+ ['Resource temporarily unavailable', 'EAGAIN'],
52
+ ['Input/output error', 'EIO'],
53
+ ['Stale file handle', 'ESTALE'],
54
+ ['Stale NFS file handle', 'ESTALE'],
55
+ ['No such file or directory', 'ENOENT'],
56
+ ['Not a directory', 'ENOTDIR'],
57
+ ]);
58
+ /**
59
+ * The directories a git listing was REFUSED, read off its stderr.
60
+ *
61
+ * Pure. Returns each refused directory once, worktree-relative and without
62
+ * git's trailing slash, with the errno its reason maps to. A directory git
63
+ * could not open because it no longer exists is not returned: that is the
64
+ * `absent` outcome of {@link listingFailure}, decided there and not here, so
65
+ * the two routes classify a vanished directory the same way.
66
+ *
67
+ * @param stderr - What the listing wrote to stderr
68
+ * @returns The refusals, in the order git printed them, deduplicated
69
+ */
70
+ export function unlistableDirectoriesIn(stderr) {
71
+ const seen = new Set();
72
+ const refusals = [];
73
+ for (const match of stderr.matchAll(UNLISTABLE_DIRECTORY_LINE)) {
74
+ const directory = match[1] ?? '';
75
+ if (directory === '' || seen.has(directory))
76
+ continue;
77
+ seen.add(directory);
78
+ const listing = listingFailure({ code: STRERROR_TO_ERRNO.get((match[2] ?? '').trim()) });
79
+ if (listing.outcome === 'unreadable')
80
+ refusals.push({ directory, code: listing.code });
81
+ }
82
+ return refusals;
83
+ }
84
+ /**
85
+ * Run one NUL-delimited `ls-files` listing and report what git skipped.
86
+ *
87
+ * `LC_ALL=C` so the stderr reason is the C-locale `strerror` text the parser
88
+ * knows; `trim: false` because the output is NUL-delimited (see the callers).
89
+ *
90
+ * @param args - The `ls-files` argv
91
+ * @param cwd - Where to run it
92
+ * @param api - The entry point, for the sentence an omitted policy gets
93
+ * @param unreadable - What a skipped directory means to the caller
94
+ * @returns The listed paths, or null when git did not answer
95
+ */
96
+ function runListing(args, cwd, api, unreadable) {
97
+ // Before the spawn: an omitted policy is a programming error, not a fact
98
+ // about the tree, and a tree with nothing unreadable must not hide it.
99
+ requireUnreadablePolicy(unreadable, api);
100
+ const result = runGit(args, { cwd, trim: false, env: { LC_ALL: 'C' } });
101
+ // Every failure means the same thing to this caller — no listing. That covers
102
+ // "not a repository" (128), git missing entirely, and a listing too large for
103
+ // the buffer, which `ok` folds in because a truncated answer here is files
104
+ // silently missing rather than a short list.
105
+ if (!result.ok) {
106
+ return null;
107
+ }
108
+ if (result.stderr !== '') {
109
+ // The warning is worktree-root-relative regardless of `cwd`.
110
+ const worktreeRoot = gitFindRoot(cwd) ?? cwd;
111
+ for (const { directory, code } of unlistableDirectoriesIn(result.stderr)) {
112
+ settleRefusal(unreadable, directoryRefusalFor({ outcome: 'unreadable', code }, safePath.resolve(worktreeRoot, directory)));
113
+ }
114
+ }
115
+ // NUL-separated (from -z), so no path can ever need quote-unescaping — a
116
+ // trailing NUL just produces one empty string at the end, dropped here.
117
+ return result.stdout.split('\0').filter((line) => line.length > 0);
118
+ }
10
119
  /**
11
120
  * Find the git repository root by walking up from the given directory.
12
121
  *
@@ -34,7 +143,6 @@ export function gitFindRoot(startDir) {
34
143
  return rememberGitRoot(climbed, memoized);
35
144
  climbed.push(currentDir);
36
145
  const gitDir = safePath.join(currentDir, '.git');
37
- // eslint-disable-next-line security/detect-non-literal-fs-filename -- walking up from validated startDir
38
146
  if (existsSync(gitDir)) {
39
147
  return rememberGitRoot(climbed, currentDir);
40
148
  }
@@ -49,6 +157,8 @@ export function gitFindRoot(startDir) {
49
157
  * @param options.cwd - Working directory (git repository root or subdirectory)
50
158
  * @param options.patterns - Optional glob patterns to filter files (e.g., '*.md', 'docs/**\/*.ts')
51
159
  * @param options.includeUntracked - Include untracked files that aren't gitignored (default: false)
160
+ * @param options.unreadable - See {@link GitListingOptions}. Only the untracked
161
+ * listing walks the working tree, so only it can have skipped a directory
52
162
  * @returns Array of file paths relative to the git root, or null if not in a git repo
53
163
  *
54
164
  * @example
@@ -74,20 +184,10 @@ export function gitLsFiles(options) {
74
184
  if (options.patterns && options.patterns.length > 0) {
75
185
  args.push('--', ...options.patterns);
76
186
  }
77
- // `trim: false` because the output is NUL-delimited: git sorts by byte value,
78
- // so a path beginning with a space sorts FIRST and a trim would silently
79
- // rename it to a path that does not exist.
80
- const result = runGit(args, { cwd: options.cwd, trim: false });
81
- // Every failure means the same thing to this caller — no listing. That covers
82
- // "not a repository" (128), git missing entirely, and a listing too large for
83
- // the buffer, which `ok` folds in because a truncated answer here is files
84
- // silently missing rather than a short list.
85
- if (!result.ok) {
86
- return null;
87
- }
88
- // NUL-separated (from -z above), so no path can ever need quote-unescaping —
89
- // a trailing NUL just produces one empty string at the end, dropped below.
90
- return result.stdout.split('\0').filter((line) => line.length > 0);
187
+ // `trim: false` (inside `runListing`) because the output is NUL-delimited:
188
+ // git sorts by byte value, so a path beginning with a space sorts FIRST and a
189
+ // trim would silently rename it to a path that does not exist.
190
+ return runListing(args, options.cwd, 'gitLsFiles', options.unreadable);
91
191
  }
92
192
  /**
93
193
  * List paths git does NOT track, with each wholly-untracked directory collapsed
@@ -113,6 +213,13 @@ export function gitLsFiles(options) {
113
213
  * untracked directory, since a directory with no files in it is invisible to
114
214
  * `ls-files` and to any tree object
115
215
  * @param options.directory - Collapse a wholly-untracked directory to one entry
216
+ * @param options.unreadable - See {@link GitListingOptions}. ⚠ïļ The two
217
+ * listings meet different refusals: without `--ignored`, git collapses a
218
+ * WHOLLY-untracked directory without opening it, but it still opens a
219
+ * non-ignored directory that holds tracked files (to look for untracked
220
+ * siblings) and warns when it cannot; the `ignored` listing opens every
221
+ * non-ignored directory and so meets every refusal the first one does and
222
+ * more (measured on git 2.50)
116
223
  * @returns Paths relative to the git root, or null if git did not answer
117
224
  *
118
225
  * @example
@@ -136,11 +243,7 @@ export function gitLsOthers(options) {
136
243
  }
137
244
  // See `gitLsFiles`: NUL-delimited output must not be trimmed, or a path
138
245
  // beginning with a space — which git sorts FIRST — comes back renamed.
139
- const result = runGit(args, { cwd: options.cwd, trim: false });
140
- if (!result.ok) {
141
- return null;
142
- }
143
- return result.stdout.split('\0').filter((line) => line.length > 0);
246
+ return runListing(args, options.cwd, 'gitLsOthers', options.unreadable);
144
247
  }
145
248
  /**
146
249
  * Check if a file path is ignored by git
@@ -1 +1 @@
1
- {"version":3,"file":"git-utils.js","sourceRoot":"","sources":["../src/git-utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAG3C;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,WAAW,CAAC,QAAgB;IAC1C,IAAI,UAAU,GAAG,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC5C,MAAM,IAAI,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC;IACpC,MAAM,OAAO,GAAa,EAAE,CAAC;IAE7B,OAAO,UAAU,KAAK,IAAI,EAAE,CAAC;QAC3B,MAAM,QAAQ,GAAG,aAAa,CAAC,UAAU,CAAC,CAAC;QAC3C,IAAI,QAAQ,KAAK,SAAS;YAAE,OAAO,eAAe,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QACtE,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAEzB,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;QACjD,yGAAyG;QACzG,IAAI,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;YACvB,OAAO,eAAe,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;QAC9C,CAAC;QACD,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IACnC,CAAC;IAED,OAAO,eAAe,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AACxC,CAAC;A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d.ts CHANGED
@@ -24,6 +24,7 @@
24
24
  */
25
25
  export { runGit, runGitOrThrow, type GitRunOptions, type GitRunResult, } from './git-run.js';
26
26
  export { gitFindRoot, gitLsFiles, gitLsOthers, isGitIgnored } from './git-utils.js';
27
+ export type { RefuseListingContext, UnreadablePolicy } from './listing-refusal.js';
27
28
  export { gitTreeSnapshot, peekGitTreeSnapshot, withGitSnapshotCache, type GitSnapshotEntry, type GitTreeSnapshot, } from './git-snapshot.js';
28
29
  export { loadGitignoreRules } from './gitignore-checker.js';
29
30
  export { GitTracker, type GitTrackerInitOptions } from './git-tracker.js';
package/dist/git.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../src/git.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EACL,MAAM,EACN,aAAa,EACb,KAAK,aAAa,EAClB,KAAK,YAAY,GAClB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACpF,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,oBAAoB,EACpB,KAAK,gBAAgB,EACrB,KAAK,eAAe,GACrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,KAAK,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAC1E,OAAO,EACL,QAAQ,EACR,0BAA0B,EAC1B,WAAW,EACX,KAAK,0BAA0B,EAC/B,KAAK,YAAY,GAClB,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../src/git.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EACL,MAAM,EACN,aAAa,EACb,KAAK,aAAa,EAClB,KAAK,YAAY,GAClB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAIpF,YAAY,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACnF,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,oBAAoB,EACpB,KAAK,gBAAgB,EACrB,KAAK,eAAe,GACrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,KAAK,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAC1E,OAAO,EACL,QAAQ,EACR,0BAA0B,EAC1B,WAAW,EACX,KAAK,0BAA0B,EAC/B,KAAK,YAAY,GAClB,MAAM,cAAc,CAAC"}
package/dist/git.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"git.js","sourceRoot":"","sources":["../src/git.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EACL,MAAM,EACN,aAAa,GAGd,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACpF,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,oBAAoB,GAGrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAA8B,MAAM,kBAAkB,CAAC;AAC1E,OAAO,EACL,QAAQ,EACR,0BAA0B,EAC1B,WAAW,GAGZ,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"git.js","sourceRoot":"","sources":["../src/git.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EACL,MAAM,EACN,aAAa,GAGd,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAKpF,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,oBAAoB,GAGrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAA8B,MAAM,kBAAkB,CAAC;AAC1E,OAAO,EACL,QAAQ,EACR,0BAA0B,EAC1B,WAAW,GAGZ,MAAM,cAAc,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"gitignore-checker.d.ts","sourceRoot":"","sources":["../src/gitignore-checker.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAe,EAAE,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAC;AAK7C;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CA0CnF"}
1
+ {"version":3,"file":"gitignore-checker.d.ts","sourceRoot":"","sources":["../src/gitignore-checker.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAe,EAAE,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAC;AAM7C;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CA8CnF"}
@@ -8,6 +8,7 @@
8
8
  import fs from 'node:fs';
9
9
  import path from 'node:path';
10
10
  import ignore from 'ignore';
11
+ import { isPathAbsentError } from './errors/errno.js';
11
12
  import { safePath, toForwardSlash } from './path-utils.js';
12
13
  import { readTextContentSync } from './text-file.js';
13
14
  /**
@@ -40,7 +41,6 @@ export function loadGitignoreRules(gitRoot, baseDir) {
40
41
  // Load .gitignore files from git root down to baseDir
41
42
  for (const dir of dirsToCheck) {
42
43
  const gitignorePath = safePath.join(dir, '.gitignore');
43
- // eslint-disable-next-line security/detect-non-literal-fs-filename -- constructed from validated gitRoot and baseDir
44
44
  if (fs.existsSync(gitignorePath)) {
45
45
  try {
46
46
  // Through the decoding seam. A `.gitignore` written by PowerShell's `>`
@@ -49,8 +49,14 @@ export function loadGitignoreRules(gitRoot, baseDir) {
49
49
  // no error anywhere.
50
50
  ig.add(readTextContentSync(gitignorePath).text);
51
51
  }
52
- catch {
53
- // Skip gitignore files we can't read
52
+ catch (error) {
53
+ // Gone between `existsSync` and the read: no rules here. A `.gitignore`
54
+ // the OS refuses to read (`EACCES`), or one that is a directory
55
+ // (`EISDIR`), holds rules this checker cannot honour — and a crawl that
56
+ // quietly proceeded without them enumerated the ignored tree with
57
+ // nothing anywhere saying so. Those stay loud.
58
+ if (!isPathAbsentError(error))
59
+ throw error;
54
60
  }
55
61
  }
56
62
  }
@@ -1 +1 @@
1
- {"version":3,"file":"gitignore-checker.js","sourceRoot":"","sources":["../src/gitignore-checker.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,MAAuB,MAAM,QAAQ,CAAC;AAE7C,OAAO,EAAE,QAAQ,EAAG,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAErD;;;;;;;GAOG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAAe,EAAE,OAAgB;IAClE,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC;IACpB,IAAI,QAAQ,GAAG,KAAK,CAAC;IAErB,+BAA+B;IAC/B,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACf,QAAQ,GAAG,IAAI,CAAC;IAEhB,kDAAkD;IAClD,MAAM,WAAW,GAAa,EAAE,CAAC;IACjC,IAAI,UAAU,GAAG,QAAQ,CAAC,OAAO,CAA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C,aAAa,CAAC,CAAC,IAAI,CAAC,CAAC;YAClD,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,wEAAwE;gBACxE,gEAAgE;gBAChE,wEAAwE;gBACxE,kEAAkE;gBAClE,+CAA+C;gBAC/C,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC;oBAAE,MAAM,KAAK,CAAC;YAC7C,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AAC9B,CAAC"}
package/dist/index.d.ts CHANGED
@@ -22,20 +22,26 @@
22
22
  * here — directly or transitively, through any module below — turns that row red
23
23
  * and has to be an argued edit rather than an unnoticed one.
24
24
  */
25
+ export * from './errors/vat-error.js';
25
26
  export * from './path-utils.js';
27
+ export * from './path-containment.js';
28
+ export * from './dirent-kind.js';
26
29
  export * from './text-content.js';
27
30
  export * from './text-file.js';
28
31
  export * from './asset-reference.js';
29
- export { classifyFilenameCaseFrom, copyDirectory, fillRealpaths, fillSiblingNames, FsLookupCache, isFilesystemAccessError, realpathFrom, } from './fs-utils.js';
30
- export type { FilenameCaseVerdict, FilenameMatch, PathProbe, PathProbeStats, RealpathTable, SiblingNamesTable, } from './fs-utils.js';
32
+ export { isFilesystemAccessError, isPathAbsentError } from './errors/errno.js';
33
+ export { copyDirectory, CopyLinkEscapesSourceError, FsLookupCache, transientRefusalClause, } from './fs-utils.js';
34
+ export { DirectorySpellingIndex, fillPathSpellings, fillRealpaths, pathSpellingFrom, realpathFrom, spellingWalkRoot, } from './fs-utils.js';
35
+ export type { AbsenceCause, ComponentMatch, FilenameMatch, PathProbe, PathProbeStats, PathSpelling, PathSpellingRequest, PathSpellingTable, RealpathTable, VerifiedPrefix, } from './fs-utils.js';
31
36
  export * from './project-utils.js';
32
- export * from './test-helpers.js';
37
+ export { createSymlink, createSymlinkAsync, detachGitEnv, errnoError, INHERITED_GIT_ENV, symlinkCapability, type SymlinkCapability, } from './test-helpers.js';
33
38
  export * from './zod-introspection.js';
34
39
  export * from './skill-targets.js';
35
40
  export * from './glob/glob-pattern.js';
36
41
  export * from './fs/file-hash.js';
37
42
  export { parseWholeNumberAtLeast } from './numeric-args.js';
43
+ export { parseEnvBoolean } from './env-flag.js';
38
44
  export { compareCodeUnits } from './compare-code-units.js';
39
- export { CRAWL_BLOB_POPULATE_ID, CRAWL_CLOSURE_CONTRIBUTE_ID, CRAWL_CLOSURE_RESOLVE_ID, CRAWL_PASS_INSIDE, CRAWL_REGISTRY_ADMIT_ID, CRAWL_REGISTRY_ENUMERATE_ID, CRAWL_REGISTRY_ID_PREFIX, CRAWL_REGISTRY_RESOLVE_LINKS_ID, CRAWL_SHARED_GIT_TRACKER_ID, CRAWL_STORE_READ_ID, CRAWL_STORE_WRITE_ID, CRAWL_STRATA, CRAWL_WALKER_GITIGNORE_ID, CRAWL_WALKER_ID, crawlTimingStart, recordContributorInvocation, recordCrawlPass, recordRegistryPass, recordSharedPass, withContributorStratum, withOuterBracket, type CrawlDriverStratum, type CrawlStratum, type CrawlTimingDump, type CrawlTimingEntry, type CrawlTimingProcess, __readCrawlTimingSnapshot, __setCrawlTimingForTest, __writeCrawlTimingDumpForTest, } from './crawl-timing.js';
45
+ export { CRAWL_BLOB_POPULATE_ID, CRAWL_CLOSURE_CONTRIBUTE_ID, CRAWL_CLOSURE_RESOLVE_ID, CRAWL_PASS_INSIDE, CRAWL_REGISTRY_ADMIT_ID, CRAWL_REGISTRY_ENUMERATE_ID, CRAWL_REGISTRY_ID_PREFIX, CRAWL_REGISTRY_RESOLVE_LINKS_ID, CRAWL_SHARED_GIT_TRACKER_ID, CRAWL_STORE_READ_ID, CRAWL_STORE_WRITE_ID, CRAWL_STRATA, CRAWL_WALKER_GITIGNORE_ID, CRAWL_WALKER_ID, crawlTimingStart, recordContributorInvocation, recordCrawlPass, recordRegistryPass, recordSharedPass, withContributorStratum, withOuterBracket, type CrawlDriverStratum, type CrawlStratum, type CrawlTimingDump, type CrawlTimingEntry, type CrawlTimingProcess, } from './crawl-timing.js';
40
46
  export { ensureTimingDirectory, normalizeTimingDirectory, readTimingProcess, type TimingProcess, writeTimingDump, } from './timing-dump.js';
41
47
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAGH,cAAc,iBAAiB,CAAC;AAShC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAG/B,cAAc,sBAAsB,CAAC;AAqCrC,OAAO,EACL,wBAAwB,EACxB,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,uBAAuB,EACvB,YAAY,GACb,MAAM,eAAe,CAAC;AACvB,YAAY,EACV,mBAAmB,EACnB,aAAa,EACb,SAAS,EACT,cAAc,EACd,aAAa,EACb,iBAAiB,GAClB,MAAM,eAAe,CAAC;AAIvB,cAAc,oBAAoB,CAAC;AAGnC,cAAc,mBAAmB,CAAC;AAGlC,cAAc,wBAAwB,CAAC;AAGvC,cAAc,oBAAoB,CAAC;AAGnC,cAAc,wBAAwB,CAAC;AAGvC,cAAc,mBAAmB,CAAC;AAElC,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAG5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAgB3D,OAAO,EACL,sBAAsB,EACtB,2BAA2B,EAC3B,wBAAwB,EACxB,iBAAiB,EACjB,uBAAuB,EACvB,2BAA2B,EAC3B,wBAAwB,EACxB,+BAA+B,EAC/B,2BAA2B,EAC3B,mBAAmB,EACnB,oBAAoB,EACpB,YAAY,EACZ,yBAAyB,EACzB,eAAe,EACf,gBAAgB,EAChB,2BAA2B,EAC3B,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,sBAAsB,EACtB,gBAAgB,EAChB,KAAK,kBAAkB,EACvB,KAAK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mBAAmB,CAAC;AAElC,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAK5D,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAGhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAgB3D,OAAO,EACL,sBAAsB,EACtB,2BAA2B,EAC3B,wBAAwB,EACxB,iBAAiB,EACjB,uBAAuB,EACvB,2BAA2B,EAC3B,wBAAwB,EACxB,+BAA+B,EAC/B,2BAA2B,EAC3B,mBAAmB,EACnB,oBAAoB,EACpB,YAAY,EACZ,yBAAyB,EACzB,eAAe,EACf,gBAAgB,EAChB,2BAA2B,EAC3B,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,sBAAsB,EACtB,gBAAgB,EAChB,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,GACxB,MAAM,mBAAmB,CAAC;AAM3B,OAAO,EACL,qBAAqB,EACrB,wBAAwB,EACxB,iBAAiB,EACjB,KAAK,aAAa,EAClB,eAAe,GAChB,MAAM,kBAAkB,CAAC"}
package/dist/index.js CHANGED
@@ -22,8 +22,15 @@
22
22
  * here — directly or transitively, through any module below — turns that row red
23
23
  * and has to be an argued edit rather than an unnoticed one.
24
24
  */
25
+ // The base of every error VAT throws on purpose; `code` is what a catch
26
+ // block dispatches on, never `message`.
27
+ export * from './errors/vat-error.js';
25
28
  // Cross-platform path utilities
26
29
  export * from './path-utils.js';
30
+ // The filesystem-backed containment verdict every delete/copy/uninstall sink asks.
31
+ export * from './path-containment.js';
32
+ // The Dirent classifiers a walk uses instead of a bare isFile()/isDirectory().
33
+ export * from './dirent-kind.js';
27
34
  // THE content-decoding seam: bytes to text, in one place. `decodeTextContent` is
28
35
  // pure and also reachable from the dependency-free `./text` entry; the two
29
36
  // file-reading wrappers need `node:fs` and are also on `./fs`. Other routes from
@@ -37,45 +44,59 @@ export * from './text-file.js';
37
44
  export * from './asset-reference.js';
38
45
  // Filesystem utilities.
39
46
  //
40
- // Named rather than `export *` on purpose: `classifyFilenameCase` (the pure
41
- // judge over a hand-held row) and `siblingNamesFrom` (the table lookup that
42
- // throws on a miss) are internal members of the fill+judge pairs below, and a
43
- // star re-export would publish them on this barrel the moment they were written.
44
- // (The `./fs` subpath was already an explicit list and was never at risk.) The
45
- // public surface is a decision, not a side effect of module layout.
47
+ // Named rather than `export *` on purpose: `fs-utils.ts` holds internal members
48
+ // of the fill+judge pairs below — the per-directory index build, the table-key
49
+ // derivation — and a star re-export would publish each of them on this barrel
50
+ // the moment it was written. (The `./fs` subpath was already an explicit list
51
+ // and was never at risk.) The public surface is a decision, not a side effect of
52
+ // module layout.
46
53
  //
47
54
  // TWO materialized columns are published, both shaped fill-first-then-judge:
48
55
  //
49
- // - sibling names — `fillSiblingNames` (every listing, once, up front) plus
50
- // `classifyFilenameCaseFrom` (pure judgement over the filled table). Its row
51
- // lookup `siblingNamesFrom` stays internal because a row there is not yet an
52
- // answer: it still needs a judge, and that judge is what we export.
56
+ // - path spellings — `fillPathSpellings` plus `pathSpellingFrom`. It judges a
57
+ // WHOLE path, which is what a caller validating references needs: judging
58
+ // only the basename hands every directory component back to the host
59
+ // filesystem's own folding, so a link that resolves on macOS 404s on a
60
+ // case-sensitive filesystem. The `DirectorySpellingIndex` underneath is
61
+ // published too, for the lazy caller that cannot enumerate its targets up
62
+ // front.
53
63
  // - realpaths — `fillRealpaths` (every canonicalization, once, up front) plus
54
- // `realpathFrom`. Here the row lookup IS the judge: the canonical path is the
55
- // answer, so there is nothing left to keep internal.
64
+ // `realpathFrom`.
65
+ //
66
+ // In both, the row lookup IS the judge: the row is the answer, so there is
67
+ // nothing left to keep internal.
56
68
  //
57
69
  // There is deliberately no one-call wrapper composing either pair: handed one, a
58
70
  // caller with many paths loops over it, which reinstates the per-path `await` the
59
71
  // pairs exist to remove.
60
72
  //
61
- // The `SiblingNames` row type is withheld for the same reason its judge is: it is
62
- // only ever that judge's parameter, so publishing it would advertise a shape no
63
- // consumer can hand anywhere. `SiblingNamesTable` and `RealpathTable` — what the
64
- // fills return and the judges consume — are the ones a caller can name, as are
65
- // `FilenameCaseVerdict`/`FilenameMatch`, which a consumer does not hand in but
66
- // does receive and branch on.
73
+ // `PathSpellingTable` and `RealpathTable` — what the fills return and the judges
74
+ // consume — are the types a caller can name, as are `PathSpelling`,
75
+ // `PathSpellingRequest`, `ComponentMatch` and `FilenameMatch`, which a consumer
76
+ // receives and branches on.
67
77
  //
68
78
  // The cost of that decision, stated so it is not a surprise: a new *type* added
69
79
  // to `fs-utils.ts` no longer reaches consumers automatically, and
70
80
  // `barrel-exports.test.ts` pins runtime names only, so nothing will fail. The
71
81
  // symptom is a type that cannot be imported, which surfaces the first time
72
82
  // someone tries — not a silent break in existing code.
73
- export { classifyFilenameCaseFrom, copyDirectory, fillRealpaths, fillSiblingNames, FsLookupCache, isFilesystemAccessError, realpathFrom, } from './fs-utils.js';
83
+ // The lookups themselves, plus the memo every fill shares.
84
+ export { isFilesystemAccessError, isPathAbsentError } from './errors/errno.js';
85
+ export { copyDirectory, CopyLinkEscapesSourceError, FsLookupCache, transientRefusalClause, } from './fs-utils.js';
86
+ // The two fill+judge pairs, in the order the note above lists them, plus the
87
+ // lazy index a caller that cannot enumerate its targets up front reaches for.
88
+ export { DirectorySpellingIndex, fillPathSpellings, fillRealpaths, pathSpellingFrom, realpathFrom, spellingWalkRoot, } from './fs-utils.js';
74
89
  // Project root discovery (canonical: config → git → null).
75
90
  // CLI-boundary use only — see docs/concepts/roots-and-config.md.
76
91
  export * from './project-utils.js';
77
- // Test helpers for isolated test output directories
78
- export * from './test-helpers.js';
92
+ // The runtime half of `test-helpers.ts`: symlink creation with its host
93
+ // capability probe, and the git-environment detachment every child process
94
+ // needs. Named rather than `export *` because the SAME module also holds the
95
+ // fs-refusal fakes (`refuseSyncFs` and siblings), which are test scaffolding
96
+ // and reach adopters on the `./testing` subpath only. A published runtime
97
+ // barrel that carried them — eight such names, once — was the audit's finding,
98
+ // and an `export *` here is how they got in.
99
+ export { createSymlink, createSymlinkAsync, detachGitEnv, errnoError, INHERITED_GIT_ENV, symlinkCapability, } from './test-helpers.js';
79
100
  // Zod type introspection (version-agnostic)
80
101
  export * from './zod-introspection.js';
81
102
  // Skill target resolution (cross-platform flat skill install paths)
@@ -85,6 +106,10 @@ export * from './glob/glob-pattern.js';
85
106
  // Filesystem hashing (sha256 of raw file bytes)
86
107
  export * from './fs/file-hash.js';
87
108
  export { parseWholeNumberAtLeast } from './numeric-args.js';
109
+ // THE reading of an environment variable as a boolean. One implementation
110
+ // because three switches each had their own `!== '0'` comparison and none of
111
+ // them turned off for `=false`.
112
+ export { parseEnvBoolean } from './env-flag.js';
88
113
  // Machine-independent string ordering for hashed/serialized output — never `localeCompare`.
89
114
  export { compareCodeUnits } from './compare-code-units.js';
90
115
  // The crawl-timing seam: which contributor, stratum and fixpoint pass owns the
@@ -101,7 +126,8 @@ export { compareCodeUnits } from './compare-code-units.js';
101
126
  // `keyOf`, `recordInheritedPass`) are not surface, and `timing-dump.ts` is
102
127
  // plumbing shared with `resources`' package-internal `parse-timing.ts` — a star
103
128
  // re-export would publish both the moment either grew a symbol.
104
- export { CRAWL_BLOB_POPULATE_ID, CRAWL_CLOSURE_CONTRIBUTE_ID, CRAWL_CLOSURE_RESOLVE_ID, CRAWL_PASS_INSIDE, CRAWL_REGISTRY_ADMIT_ID, CRAWL_REGISTRY_ENUMERATE_ID, CRAWL_REGISTRY_ID_PREFIX, CRAWL_REGISTRY_RESOLVE_LINKS_ID, CRAWL_SHARED_GIT_TRACKER_ID, CRAWL_STORE_READ_ID, CRAWL_STORE_WRITE_ID, CRAWL_STRATA, CRAWL_WALKER_GITIGNORE_ID, CRAWL_WALKER_ID, crawlTimingStart, recordContributorInvocation, recordCrawlPass, recordRegistryPass, recordSharedPass, withContributorStratum, withOuterBracket, __readCrawlTimingSnapshot, __setCrawlTimingForTest, __writeCrawlTimingDumpForTest, } from './crawl-timing.js';
129
+ export { CRAWL_BLOB_POPULATE_ID, CRAWL_CLOSURE_CONTRIBUTE_ID, CRAWL_CLOSURE_RESOLVE_ID, CRAWL_PASS_INSIDE, CRAWL_REGISTRY_ADMIT_ID, CRAWL_REGISTRY_ENUMERATE_ID, CRAWL_REGISTRY_ID_PREFIX, CRAWL_REGISTRY_RESOLVE_LINKS_ID, CRAWL_SHARED_GIT_TRACKER_ID, CRAWL_STORE_READ_ID, CRAWL_STORE_WRITE_ID, CRAWL_STRATA, CRAWL_WALKER_GITIGNORE_ID, CRAWL_WALKER_ID, crawlTimingStart, recordContributorInvocation, recordCrawlPass, recordRegistryPass, recordSharedPass, withContributorStratum, withOuterBracket, } from './crawl-timing.js';
130
+ // The three `__*ForTest` seams of the same module are on `./testing`, not here.
105
131
  // The on-disk plumbing both timing seams share. Exported because
106
132
  // `resources`' `parse-timing.ts` is the other consumer and now sits a package
107
133
  // away; nothing else should reach for it.
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,gCAAgC;AAChC,cAAc,iBAAiB,CAAC;AAEhC,iFAAiF;AACjF,2EAA2E;AAC3E,iFAAiF;AACjF,gEAAgE;AAChE,6EAA6E;AAC7E,iFAAiF;AACjF,gFAAgF;AAChF,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAE/B,2DAA2D;AAC3D,cAAc,sBAAsB,CAAC;AAErC,wBAAwB;AACxB,EAAE;AACF,4EAA4E;AAC5E,4EAA4E;AAC5E,8EAA8E;AAC9E,iFAAiF;AACjF,+EAA+E;AAC/E,oEAAoE;AACpE,EAAE;AACF,6EAA6E;AAC7E,EAAE;AACF,8EAA8E;AAC9E,iFAAiF;AACjF,iFAAiF;AACjF,wEAAwE;AACxE,gFAAgF;AAChF,kFAAkF;AAClF,yDAAyD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OAAO,EACL,sBAAsB,EACtB,2BAA2B,EAC3B,wBAAwB,EACxB,iBAAiB,EACjB,uBAAuB,EACvB,2BAA2B,EAC3B,wBAAwB,EACxB,+BAA+B,EAC/B,2BAA2B,EAC3B,mBAAmB,EACnB,oBAAoB,EACpB,YAAY,EACZ,yBAAyB,EACzB,eAAe,EACf,gBAAgB,EAChB,2BAA2B,EAC3B,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,sBAAsB,EACtB,gBAAgB,GAMjB,MAAM,mBAAmB,CAAC;AAC3B,gFAAgF;AAEhF,iEAAiE;AACjE,8EAA8E;AAC9E,0CAA0C;AAC1C,OAAO,EACL,qBAAqB,EACrB,wBAAwB,EACxB,iBAAiB,EAEjB,eAAe,GAChB,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,112 @@
1
+ /**
2
+ * What a listing does with a directory it was refused — the vocabulary shared
3
+ * by the filesystem walk (`file-crawler.ts`) and the git listings
4
+ * (`git-utils.ts`), so a caller decides ONCE for both routes.
5
+ *
6
+ * ðŸšĻ A refused listing is a gap in the POPULATION: every file beneath that
7
+ * directory the listing would have found was never seen and is absent from
8
+ * every count downstream. There are exactly two honest answers — stop, with a
9
+ * sentence the adopter can act on, or keep going and REPORT the gap — and
10
+ * which one is right is the caller's knowledge, not the crawler's. So the
11
+ * policy is {@link UnreadablePolicy}, it is REQUIRED wherever a listing is
12
+ * asked for, and it has no default.
13
+ *
14
+ * ðŸŠĪ It used to be `onUnreadable?`, an optional callback. Every caller that
15
+ * ignored it compiled; the two routes then defaulted differently (the walk
16
+ * threw a programmer-facing sentence, the git route dropped the refusal off
17
+ * its stderr without a word); and the miss surfaced one review round later as
18
+ * a HIGH. A required field is what makes `tsc` enumerate the callers.
19
+ */
20
+ import { VatError } from './errors/vat-error.js';
21
+ import { type DirectoryRefusal } from './fs-utils.js';
22
+ /**
23
+ * What a caller that STOPS on a refusal tells the person reading the error.
24
+ *
25
+ * A caller that has decided to stop — a build that must not ship an incomplete
26
+ * bundle, a discovery that must not silently find fewer skills — owes the
27
+ * adopter the directory against the root they know, and the knob THEY have.
28
+ */
29
+ export interface RefuseListingContext {
30
+ /**
31
+ * The root the refused directory is expressed against. An absolute path in
32
+ * an error is the developer's `$HOME` in every CI log.
33
+ */
34
+ root: string;
35
+ /**
36
+ * What the adopter can do about it — naming this lane's deliberate-drop
37
+ * mechanism (`resources.exclude`, a plugin `exclude:`, `--exclude`), which
38
+ * differs per caller and is why the crawler cannot supply it.
39
+ */
40
+ remedy: string;
41
+ }
42
+ /**
43
+ * The caller's decision about a directory the listing cannot open.
44
+ *
45
+ * - `{ refuse }` — STOP: the listing throws {@link DirectoryListingRefusedError}
46
+ * with the adopter-facing sentence built from the context. Right for every
47
+ * lane whose output is acted on as a complete population (a build, a
48
+ * discovery, a fingerprint, a copy).
49
+ * - `{ degrade }` — KEEP GOING and hand the refusal over. The caller is
50
+ * promising to REPORT the gap — as its own finding, with the directory and
51
+ * errno the refusal carries — not to drop it. Right for a backstop appended
52
+ * to a larger report, where one unlistable directory must not destroy every
53
+ * finding beside it.
54
+ *
55
+ * A directory that VANISHED between being enumerated and being listed
56
+ * (`ENOENT` / `ENOTDIR`) is not a refusal under either arm: it is no longer in
57
+ * the population and is skipped without a call.
58
+ */
59
+ export type UnreadablePolicy = {
60
+ readonly refuse: RefuseListingContext;
61
+ } | {
62
+ readonly degrade: (refusal: DirectoryRefusal) => void;
63
+ };
64
+ /**
65
+ * Thrown by a listing under `{ refuse }` when a directory refused to be
66
+ * listed. The message is the adopter's sentence — see {@link refusedListingMessage}.
67
+ */
68
+ export declare class DirectoryListingRefusedError extends VatError {
69
+ readonly refusal: DirectoryRefusal;
70
+ constructor(refusal: DirectoryRefusal, context: RefuseListingContext);
71
+ }
72
+ /**
73
+ * The adopter-facing sentence: root-relative directory, errno, the gap, and
74
+ * the caller's remedy — **the one owner of that sentence.**
75
+ *
76
+ * Exported so every lane that refuses says the same thing. Three lanes used to
77
+ * compose this by hand and had drifted by a clause each ("enumerated" /
78
+ * "scanned" / "the population could not be enumerated"); the transient clause
79
+ * in particular was written once in `fs-utils.ts` precisely so nobody would.
80
+ * See {@link REFUSAL_GAP_CLAUSE} for why it asserts nothing about what WAS
81
+ * enumerated beneath the directory.
82
+ *
83
+ * @param refusal - What was refused
84
+ * @param context - The root to express it against, and what the adopter can do
85
+ * @returns One sentence, root-relative, never containing the absolute path
86
+ */
87
+ export declare function refusedListingMessage(refusal: DirectoryRefusal, context: RefuseListingContext): string;
88
+ /**
89
+ * Apply the caller's policy to one refusal: throw under `{ refuse }`, hand it
90
+ * over under `{ degrade }`. The single place either route settles a refusal,
91
+ * so the two cannot drift.
92
+ *
93
+ * @param policy - The caller's decision
94
+ * @param refusal - The directory that could not be listed
95
+ */
96
+ export declare function settleRefusal(policy: UnreadablePolicy, refusal: DirectoryRefusal): void;
97
+ /**
98
+ * Refuse an omitted policy up front, by name, before any directory is listed.
99
+ *
100
+ * The type already makes `unreadable` required, and that is what enumerates
101
+ * the TypeScript callers. This is the runtime half, for the callers the type
102
+ * cannot reach — test files are not typechecked by the build, and a JavaScript
103
+ * adopter has no compiler at all. Without it an omitted policy would surface
104
+ * only on the first refusal, as a `TypeError` from the `in` operator, and a
105
+ * tree with nothing unreadable would keep returning complete lists — the
106
+ * optional seam back again, one layer down.
107
+ *
108
+ * @param policy - What the caller passed as `unreadable`
109
+ * @param api - The entry point, for the sentence
110
+ */
111
+ export declare function requireUnreadablePolicy(policy: UnreadablePolicy | undefined, api: string): asserts policy is UnreadablePolicy;
112
+ //# sourceMappingURL=listing-refusal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"listing-refusal.d.ts","sourceRoot":"","sources":["../src/listing-refusal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,KAAK,gBAAgB,EAA0B,MAAM,eAAe,CAAC;AAG9E;;;;;;GAMG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,gBAAgB,GACxB;IAAE,QAAQ,CAAC,MAAM,EAAE,oBAAoB,CAAA;CAAE,GACzC;IAAE,QAAQ,CAAC,OAAO,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,IAAI,CAAA;CAAE,CAAC;AAE9D;;;GAGG;AACH,qBAAa,4BAA6B,SAAQ,QAAQ;IACxD,QAAQ,CAAC,OAAO,EAAE,gBAAgB,CAAC;gBAEvB,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,oBAAoB;CAIrE;AAmBD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,oBAAoB,GAAG,MAAM,CAOtG;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,gBAAgB,EAAE,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAGvF;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,gBAAgB,GAAG,SAAS,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,gBAAgB,CAO7H"}