@vibe-agent-toolkit/utils 0.2.0-rc.10 → 0.2.0-rc.12

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 (330) hide show
  1. package/README.md +112 -10
  2. package/dist/archive/archive.d.ts +129 -0
  3. package/dist/archive/archive.d.ts.map +1 -0
  4. package/dist/archive/archive.js +223 -0
  5. package/dist/archive/archive.js.map +1 -0
  6. package/dist/archive/entries.d.ts +132 -0
  7. package/dist/archive/entries.d.ts.map +1 -0
  8. package/dist/archive/entries.js +223 -0
  9. package/dist/archive/entries.js.map +1 -0
  10. package/dist/archive/limits.d.ts +39 -0
  11. package/dist/archive/limits.d.ts.map +1 -0
  12. package/dist/archive/limits.js +59 -0
  13. package/dist/archive/limits.js.map +1 -0
  14. package/dist/archive/records.d.ts +14 -0
  15. package/dist/archive/records.d.ts.map +1 -0
  16. package/dist/archive/records.js +3 -0
  17. package/dist/archive/records.js.map +1 -0
  18. package/dist/archive/tar-reader.d.ts +18 -0
  19. package/dist/archive/tar-reader.d.ts.map +1 -0
  20. package/dist/archive/tar-reader.js +173 -0
  21. package/dist/archive/tar-reader.js.map +1 -0
  22. package/dist/archive/zip-reader.d.ts +76 -0
  23. package/dist/archive/zip-reader.d.ts.map +1 -0
  24. package/dist/archive/zip-reader.js +376 -0
  25. package/dist/archive/zip-reader.js.map +1 -0
  26. package/dist/archive.d.ts +14 -0
  27. package/dist/archive.d.ts.map +1 -0
  28. package/dist/archive.js +12 -0
  29. package/dist/archive.js.map +1 -0
  30. package/dist/asset-reference.d.ts +17 -1
  31. package/dist/asset-reference.d.ts.map +1 -1
  32. package/dist/asset-reference.js +31 -7
  33. package/dist/asset-reference.js.map +1 -1
  34. package/dist/dirent-kind.d.ts +13 -40
  35. package/dist/dirent-kind.d.ts.map +1 -1
  36. package/dist/dirent-kind.js +21 -69
  37. package/dist/dirent-kind.js.map +1 -1
  38. package/dist/entrypoint.d.ts +2 -2
  39. package/dist/entrypoint.d.ts.map +1 -1
  40. package/dist/entrypoint.js +4 -3
  41. package/dist/entrypoint.js.map +1 -1
  42. package/dist/env-flag.d.ts +13 -5
  43. package/dist/env-flag.d.ts.map +1 -1
  44. package/dist/env-flag.js +13 -5
  45. package/dist/env-flag.js.map +1 -1
  46. package/dist/errors/confirmed-absent.d.ts +41 -0
  47. package/dist/errors/confirmed-absent.d.ts.map +1 -0
  48. package/dist/errors/confirmed-absent.js +43 -0
  49. package/dist/errors/confirmed-absent.js.map +1 -0
  50. package/dist/errors/errno-table.d.ts +177 -0
  51. package/dist/errors/errno-table.d.ts.map +1 -0
  52. package/dist/errors/errno-table.js +343 -0
  53. package/dist/errors/errno-table.js.map +1 -0
  54. package/dist/errors/fs-boundary.d.ts +36 -0
  55. package/dist/errors/fs-boundary.d.ts.map +1 -0
  56. package/dist/errors/fs-boundary.js +121 -0
  57. package/dist/errors/fs-boundary.js.map +1 -0
  58. package/dist/errors/fs-fault.d.ts +176 -0
  59. package/dist/errors/fs-fault.d.ts.map +1 -0
  60. package/dist/errors/fs-fault.js +215 -0
  61. package/dist/errors/fs-fault.js.map +1 -0
  62. package/dist/errors/git-errno.d.ts +13 -0
  63. package/dist/errors/git-errno.d.ts.map +1 -0
  64. package/dist/errors/git-errno.js +45 -0
  65. package/dist/errors/git-errno.js.map +1 -0
  66. package/dist/errors/path-present.d.ts +72 -0
  67. package/dist/errors/path-present.d.ts.map +1 -0
  68. package/dist/errors/path-present.js +110 -0
  69. package/dist/errors/path-present.js.map +1 -0
  70. package/dist/errors/rag-index-empty.d.ts +16 -0
  71. package/dist/errors/rag-index-empty.d.ts.map +1 -0
  72. package/dist/errors/rag-index-empty.js +16 -0
  73. package/dist/errors/rag-index-empty.js.map +1 -0
  74. package/dist/errors/suppressed-faults.d.ts +34 -0
  75. package/dist/errors/suppressed-faults.d.ts.map +1 -0
  76. package/dist/errors/suppressed-faults.js +66 -0
  77. package/dist/errors/suppressed-faults.js.map +1 -0
  78. package/dist/file-crawler.d.ts +13 -18
  79. package/dist/file-crawler.d.ts.map +1 -1
  80. package/dist/file-crawler.js +140 -24
  81. package/dist/file-crawler.js.map +1 -1
  82. package/dist/fs-utils.d.ts +75 -50
  83. package/dist/fs-utils.d.ts.map +1 -1
  84. package/dist/fs-utils.js +148 -158
  85. package/dist/fs-utils.js.map +1 -1
  86. package/dist/fs.d.ts +5 -4
  87. package/dist/fs.d.ts.map +1 -1
  88. package/dist/fs.js +5 -4
  89. package/dist/fs.js.map +1 -1
  90. package/dist/git-snapshot.d.ts +25 -17
  91. package/dist/git-snapshot.d.ts.map +1 -1
  92. package/dist/git-snapshot.js +65 -11
  93. package/dist/git-snapshot.js.map +1 -1
  94. package/dist/git-tracker.d.ts +11 -3
  95. package/dist/git-tracker.d.ts.map +1 -1
  96. package/dist/git-tracker.js +29 -6
  97. package/dist/git-tracker.js.map +1 -1
  98. package/dist/git-utils.d.ts.map +1 -1
  99. package/dist/git-utils.js +7 -35
  100. package/dist/git-utils.js.map +1 -1
  101. package/dist/git.d.ts +1 -1
  102. package/dist/git.d.ts.map +1 -1
  103. package/dist/git.js +1 -1
  104. package/dist/git.js.map +1 -1
  105. package/dist/gitignore-checker.d.ts.map +1 -1
  106. package/dist/gitignore-checker.js +5 -4
  107. package/dist/gitignore-checker.js.map +1 -1
  108. package/dist/in-order.d.ts +93 -0
  109. package/dist/in-order.d.ts.map +1 -0
  110. package/dist/in-order.js +165 -0
  111. package/dist/in-order.js.map +1 -0
  112. package/dist/index.d.ts +20 -4
  113. package/dist/index.d.ts.map +1 -1
  114. package/dist/index.js +30 -4
  115. package/dist/index.js.map +1 -1
  116. package/dist/kill-process-tree.d.ts +43 -0
  117. package/dist/kill-process-tree.d.ts.map +1 -0
  118. package/dist/kill-process-tree.js +48 -0
  119. package/dist/kill-process-tree.js.map +1 -0
  120. package/dist/link-following.d.ts +115 -0
  121. package/dist/link-following.d.ts.map +1 -0
  122. package/dist/link-following.js +283 -0
  123. package/dist/link-following.js.map +1 -0
  124. package/dist/listing-refusal.d.ts +44 -0
  125. package/dist/listing-refusal.d.ts.map +1 -1
  126. package/dist/listing-refusal.js +79 -2
  127. package/dist/listing-refusal.js.map +1 -1
  128. package/dist/name-fold.d.ts +25 -0
  129. package/dist/name-fold.d.ts.map +1 -0
  130. package/dist/name-fold.js +40 -0
  131. package/dist/name-fold.js.map +1 -0
  132. package/dist/path-containment.d.ts +17 -0
  133. package/dist/path-containment.d.ts.map +1 -1
  134. package/dist/path-containment.js +28 -5
  135. package/dist/path-containment.js.map +1 -1
  136. package/dist/path-utils.d.ts +14 -17
  137. package/dist/path-utils.d.ts.map +1 -1
  138. package/dist/path-utils.js +37 -55
  139. package/dist/path-utils.js.map +1 -1
  140. package/dist/process.d.ts +2 -0
  141. package/dist/process.d.ts.map +1 -1
  142. package/dist/process.js +2 -0
  143. package/dist/process.js.map +1 -1
  144. package/dist/project-utils.d.ts.map +1 -1
  145. package/dist/project-utils.js +8 -9
  146. package/dist/project-utils.js.map +1 -1
  147. package/dist/safe-exec.d.ts +6 -2
  148. package/dist/safe-exec.d.ts.map +1 -1
  149. package/dist/safe-exec.js +1 -1
  150. package/dist/safe-exec.js.map +1 -1
  151. package/dist/skill-targets.d.ts.map +1 -1
  152. package/dist/skill-targets.js +3 -1
  153. package/dist/skill-targets.js.map +1 -1
  154. package/dist/skill-test/spawn-claude.d.ts +0 -15
  155. package/dist/skill-test/spawn-claude.d.ts.map +1 -1
  156. package/dist/skill-test/spawn-claude.js +11 -50
  157. package/dist/skill-test/spawn-claude.js.map +1 -1
  158. package/dist/special-file.d.ts +18 -0
  159. package/dist/special-file.d.ts.map +1 -0
  160. package/dist/special-file.js +21 -0
  161. package/dist/special-file.js.map +1 -0
  162. package/dist/terminating-signals.d.ts +129 -0
  163. package/dist/terminating-signals.d.ts.map +1 -0
  164. package/dist/terminating-signals.js +210 -0
  165. package/dist/terminating-signals.js.map +1 -0
  166. package/dist/test-helpers.d.ts +9 -5
  167. package/dist/test-helpers.d.ts.map +1 -1
  168. package/dist/test-helpers.js +18 -21
  169. package/dist/test-helpers.js.map +1 -1
  170. package/dist/test-scratch-guard.d.ts +34 -0
  171. package/dist/test-scratch-guard.d.ts.map +1 -0
  172. package/dist/test-scratch-guard.js +45 -0
  173. package/dist/test-scratch-guard.js.map +1 -0
  174. package/dist/testing/archive-fixtures.d.ts +147 -0
  175. package/dist/testing/archive-fixtures.d.ts.map +1 -0
  176. package/dist/testing/archive-fixtures.js +449 -0
  177. package/dist/testing/archive-fixtures.js.map +1 -0
  178. package/dist/testing/executables.d.ts +6 -0
  179. package/dist/testing/executables.d.ts.map +1 -1
  180. package/dist/testing/executables.js +20 -9
  181. package/dist/testing/executables.js.map +1 -1
  182. package/dist/testing/fault-fs-preload.d.ts +16 -0
  183. package/dist/testing/fault-fs-preload.d.ts.map +1 -0
  184. package/dist/testing/fault-fs-preload.js +22 -0
  185. package/dist/testing/fault-fs-preload.js.map +1 -0
  186. package/dist/testing/fault-fs.d.ts +115 -0
  187. package/dist/testing/fault-fs.d.ts.map +1 -0
  188. package/dist/testing/fault-fs.js +411 -0
  189. package/dist/testing/fault-fs.js.map +1 -0
  190. package/dist/testing/fault-spec.d.ts +83 -0
  191. package/dist/testing/fault-spec.d.ts.map +1 -0
  192. package/dist/testing/fault-spec.js +132 -0
  193. package/dist/testing/fault-spec.js.map +1 -0
  194. package/dist/testing/hostile-tree.d.ts.map +1 -1
  195. package/dist/testing/hostile-tree.js +3 -4
  196. package/dist/testing/hostile-tree.js.map +1 -1
  197. package/dist/testing/platform-gates.d.ts +8 -0
  198. package/dist/testing/platform-gates.d.ts.map +1 -1
  199. package/dist/testing/platform-gates.js +24 -0
  200. package/dist/testing/platform-gates.js.map +1 -1
  201. package/dist/testing/temp-dir.d.ts +31 -0
  202. package/dist/testing/temp-dir.d.ts.map +1 -1
  203. package/dist/testing/temp-dir.js +63 -0
  204. package/dist/testing/temp-dir.js.map +1 -1
  205. package/dist/testing/tier-timeout.d.ts +34 -0
  206. package/dist/testing/tier-timeout.d.ts.map +1 -0
  207. package/dist/testing/tier-timeout.js +45 -0
  208. package/dist/testing/tier-timeout.js.map +1 -0
  209. package/dist/testing/tree-snapshot.d.ts +71 -0
  210. package/dist/testing/tree-snapshot.d.ts.map +1 -0
  211. package/dist/testing/tree-snapshot.js +163 -0
  212. package/dist/testing/tree-snapshot.js.map +1 -0
  213. package/dist/testing.d.ts +6 -0
  214. package/dist/testing.d.ts.map +1 -1
  215. package/dist/testing.js +8 -1
  216. package/dist/testing.js.map +1 -1
  217. package/dist/text-content.d.ts +29 -0
  218. package/dist/text-content.d.ts.map +1 -1
  219. package/dist/text-content.js +64 -0
  220. package/dist/text-content.js.map +1 -1
  221. package/dist/text-file.d.ts +58 -6
  222. package/dist/text-file.d.ts.map +1 -1
  223. package/dist/text-file.js +111 -11
  224. package/dist/text-file.js.map +1 -1
  225. package/dist/text.d.ts +1 -1
  226. package/dist/text.d.ts.map +1 -1
  227. package/dist/text.js +1 -1
  228. package/dist/text.js.map +1 -1
  229. package/dist/timing-dump.d.ts.map +1 -1
  230. package/dist/timing-dump.js +2 -10
  231. package/dist/timing-dump.js.map +1 -1
  232. package/dist/tree-change/apply-decisions.d.ts +101 -0
  233. package/dist/tree-change/apply-decisions.d.ts.map +1 -0
  234. package/dist/tree-change/apply-decisions.js +139 -0
  235. package/dist/tree-change/apply-decisions.js.map +1 -0
  236. package/dist/tree-change/apply.d.ts +98 -0
  237. package/dist/tree-change/apply.d.ts.map +1 -0
  238. package/dist/tree-change/apply.js +364 -0
  239. package/dist/tree-change/apply.js.map +1 -0
  240. package/dist/tree-change/copy-decisions.d.ts +58 -0
  241. package/dist/tree-change/copy-decisions.d.ts.map +1 -0
  242. package/dist/tree-change/copy-decisions.js +66 -0
  243. package/dist/tree-change/copy-decisions.js.map +1 -0
  244. package/dist/tree-change/copy-tree.d.ts +125 -0
  245. package/dist/tree-change/copy-tree.d.ts.map +1 -0
  246. package/dist/tree-change/copy-tree.js +279 -0
  247. package/dist/tree-change/copy-tree.js.map +1 -0
  248. package/dist/tree-change/files.d.ts +167 -0
  249. package/dist/tree-change/files.d.ts.map +1 -0
  250. package/dist/tree-change/files.js +423 -0
  251. package/dist/tree-change/files.js.map +1 -0
  252. package/dist/tree-change/followed-walk.d.ts +54 -0
  253. package/dist/tree-change/followed-walk.d.ts.map +1 -0
  254. package/dist/tree-change/followed-walk.js +81 -0
  255. package/dist/tree-change/followed-walk.js.map +1 -0
  256. package/dist/tree-change/host-chain.d.ts +48 -0
  257. package/dist/tree-change/host-chain.d.ts.map +1 -0
  258. package/dist/tree-change/host-chain.js +85 -0
  259. package/dist/tree-change/host-chain.js.map +1 -0
  260. package/dist/tree-change/identity-compare.d.ts +61 -0
  261. package/dist/tree-change/identity-compare.d.ts.map +1 -0
  262. package/dist/tree-change/identity-compare.js +115 -0
  263. package/dist/tree-change/identity-compare.js.map +1 -0
  264. package/dist/tree-change/identity.d.ts +62 -0
  265. package/dist/tree-change/identity.d.ts.map +1 -0
  266. package/dist/tree-change/identity.js +152 -0
  267. package/dist/tree-change/identity.js.map +1 -0
  268. package/dist/tree-change/index.d.ts +24 -0
  269. package/dist/tree-change/index.d.ts.map +1 -0
  270. package/dist/tree-change/index.js +14 -0
  271. package/dist/tree-change/index.js.map +1 -0
  272. package/dist/tree-change/link-chain.d.ts +180 -0
  273. package/dist/tree-change/link-chain.d.ts.map +1 -0
  274. package/dist/tree-change/link-chain.js +377 -0
  275. package/dist/tree-change/link-chain.js.map +1 -0
  276. package/dist/tree-change/link-containment.d.ts +105 -0
  277. package/dist/tree-change/link-containment.d.ts.map +1 -0
  278. package/dist/tree-change/link-containment.js +196 -0
  279. package/dist/tree-change/link-containment.js.map +1 -0
  280. package/dist/tree-change/link-walk.d.ts +49 -0
  281. package/dist/tree-change/link-walk.d.ts.map +1 -0
  282. package/dist/tree-change/link-walk.js +69 -0
  283. package/dist/tree-change/link-walk.js.map +1 -0
  284. package/dist/tree-change/plan.d.ts +206 -0
  285. package/dist/tree-change/plan.d.ts.map +1 -0
  286. package/dist/tree-change/plan.js +320 -0
  287. package/dist/tree-change/plan.js.map +1 -0
  288. package/dist/tree-change/readable-tree.d.ts +44 -0
  289. package/dist/tree-change/readable-tree.d.ts.map +1 -0
  290. package/dist/tree-change/readable-tree.js +52 -0
  291. package/dist/tree-change/readable-tree.js.map +1 -0
  292. package/dist/tree-change/rollback-error.d.ts +29 -0
  293. package/dist/tree-change/rollback-error.d.ts.map +1 -0
  294. package/dist/tree-change/rollback-error.js +31 -0
  295. package/dist/tree-change/rollback-error.js.map +1 -0
  296. package/dist/tree-change/staging-names.d.ts +27 -0
  297. package/dist/tree-change/staging-names.d.ts.map +1 -0
  298. package/dist/tree-change/staging-names.js +40 -0
  299. package/dist/tree-change/staging-names.js.map +1 -0
  300. package/dist/tree-change/tree-walk.d.ts +81 -0
  301. package/dist/tree-change/tree-walk.d.ts.map +1 -0
  302. package/dist/tree-change/tree-walk.js +212 -0
  303. package/dist/tree-change/tree-walk.js.map +1 -0
  304. package/dist/win32-namespace.d.ts +24 -0
  305. package/dist/win32-namespace.d.ts.map +1 -0
  306. package/dist/win32-namespace.js +31 -0
  307. package/dist/win32-namespace.js.map +1 -0
  308. package/dist/yaml/surgical-yaml.d.ts +12 -3
  309. package/dist/yaml/surgical-yaml.d.ts.map +1 -1
  310. package/dist/yaml/surgical-yaml.js +16 -6
  311. package/dist/yaml/surgical-yaml.js.map +1 -1
  312. package/eslint/README.md +12 -4
  313. package/eslint/rules/fs-binding-scan.cjs +278 -0
  314. package/eslint/rules/no-adhoc-errno.cjs +364 -0
  315. package/eslint/rules/no-bare-symlink-in-tests.cjs +2 -3
  316. package/eslint/rules/no-blind-catch.cjs +1 -1
  317. package/eslint/rules/no-destructive-fs.cjs +359 -0
  318. package/eslint/rules/no-existssync.cjs +70 -0
  319. package/eslint/rules/no-fragile-entrypoint-guard.cjs +3 -2
  320. package/eslint/rules/no-link-following-fs.cjs +68 -0
  321. package/eslint/rules/no-literal-process-exit.cjs +96 -8
  322. package/eslint/rules/no-literal-test-timeout.cjs +214 -0
  323. package/eslint/rules/no-raw-signal-listener.cjs +224 -0
  324. package/eslint/rules/no-stdout-outside-writer.cjs +135 -0
  325. package/package.json +10 -2
  326. package/dist/errors/errno.d.ts +0 -51
  327. package/dist/errors/errno.d.ts.map +0 -1
  328. package/dist/errors/errno.js +0 -112
  329. package/dist/errors/errno.js.map +0 -1
  330. package/eslint/rules/no-fs-promises-cp.cjs +0 -43
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zip-reader.js","sourceRoot":"","sources":["../../src/archive/zip-reader.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,MAAM,MAAM,SAAS,CAAC;AAE7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD,OAAO,EAA6C,mBAAmB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3G,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAKpF,0FAA0F;AAC1F,MAAM,YAAY,GAAG,CAAC,CAAC;AACvB,mEAAmE;AACnE,MAAM,SAAS,GAAG,QAAQ,CAAC;AAC3B,MAAM,YAAY,GAAG,QAAQ,CAAC;AAC9B,MAAM,cAAc,GAAG,QAAQ,CAAC;AAChC,MAAM,SAAS,GAAG,QAAQ,CAAC;AAC3B,qDAAqD;AACrD,MAAM,YAAY,GAAG,KAAK,CAAC;AAC3B,qGAAqG;AACrG,MAAM,cAAc,GAAG,KAAK,CAAC;AAC7B,MAAM,eAAe,GAAG,KAAK,CAAC;AAC9B,MAAM,SAAS,GAAG,KAAK,CAAC;AAExB,8GAA8G;AAC9G,SAAS,UAAU,CAAC,KAAe;IACjC,OAAO,KAAK,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,KAAK,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;AAClF,CAAC;AAED,S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G,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;IAC9B,OAAO,eAAe,CAAC,GAAG,CAAC,CAAC;AAC9B,CAAC;AAUD;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY,CAAC,OAAmC;IAC9D,MAAM,GAAG,GAAG,IAAI,MAAM,EAAE,CAAC;IACzB,KAAK,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,OAAO,EAAE,CAAC;QAClD,sGAAsG;QACtG,IAAI,IAAI,KAAK,SAAS;YAAE,GAAG,CAAC,OAAO,CAAC,GAAG,KAAK,GAAG,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,cAAc,CAAC,CAAC;;YACjF,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,UAAU,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAC9E,CAAC;IACD,OAAO,eAAe,CAAC,GAAG,CAAC,CAAC;AAC9B,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @vibe-agent-toolkit/utils/archive
3
+ *
4
+ * The one archive primitive: read, list, extract and create. It is the only module in VAT that
5
+ * imports `tar` or `adm-zip` (`no-restricted-imports` holds every other file to that), so it is
6
+ * quarantined behind its own subpath — a command that touches no archive never loads either.
7
+ */
8
+ export { extractArchive, listArchive, openArchive, readArchiveFile, zipOfArchive } from './archive/archive.js';
9
+ export type { ArchiveExtractOptions, ArchiveReadOptions, ArchiveSource, OpenedArchive } from './archive/archive.js';
10
+ export { ARCHIVE_ENTRY_UNREADABLE_CODE, ARCHIVE_REFUSED_CODE, ArchiveEntryReadError, archiveEntryRefusal, ArchiveRefusedError } from './archive/entries.js';
11
+ export type { ArchiveEntry, ArchiveEntryKind, ArchiveFormat, ArchiveLimits, ArchiveRefusalReason, EntryRefusal } from './archive/entries.js';
12
+ export { ARCHIVE_DOWNLOAD_MAX_BYTES, ARCHIVE_LIMITS } from './archive/limits.js';
13
+ export { zipOfDirectory } from './archive/zip-reader.js';
14
+ //# sourceMappingURL=archive.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"archive.d.ts","sourceRoot":"","sources":["../src/archive.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,WAAW,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAC/G,YAAY,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACpH,OAAO,EAAE,6BAA6B,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC5J,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,aAAa,EAAE,aAAa,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAC7I,OAAO,EAAE,0BAA0B,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @vibe-agent-toolkit/utils/archive
3
+ *
4
+ * The one archive primitive: read, list, extract and create. It is the only module in VAT that
5
+ * imports `tar` or `adm-zip` (`no-restricted-imports` holds every other file to that), so it is
6
+ * quarantined behind its own subpath — a command that touches no archive never loads either.
7
+ */
8
+ export { extractArchive, listArchive, openArchive, readArchiveFile, zipOfArchive } from './archive/archive.js';
9
+ export { ARCHIVE_ENTRY_UNREADABLE_CODE, ARCHIVE_REFUSED_CODE, ArchiveEntryReadError, archiveEntryRefusal, ArchiveRefusedError } from './archive/entries.js';
10
+ export { ARCHIVE_DOWNLOAD_MAX_BYTES, ARCHIVE_LIMITS } from './archive/limits.js';
11
+ export { zipOfDirectory } from './archive/zip-reader.js';
12
+ //# sourceMappingURL=archive.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"archive.js","sourceRoot":"","sources":["../src/archive.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,WAAW,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAE/G,OAAO,EAAE,6BAA6B,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE5J,OAAO,EAAE,0BAA0B,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC"}
@@ -1,3 +1,17 @@
1
+ /**
2
+ * A bare specifier Node could not resolve to a file: the package is not
3
+ * installed, its `exports` map does not expose the subpath, or the file it
4
+ * points at is not on disk. Always about the reference a user supplied, so a
5
+ * caller reports it against that input — never as VAT's defect.
6
+ */
7
+ export declare const ASSET_REFERENCE_UNRESOLVED_CODE = "ASSET_REFERENCE_UNRESOLVED";
8
+ /**
9
+ * A bare specifier whose package IS installed, but which Node could not read
10
+ * its way through: a malformed or unreadable `package.json`, or an `exports`
11
+ * map that is itself invalid. The reference names something; the package is
12
+ * broken — so a caller reports it as an unreadable input, never as "missing".
13
+ */
14
+ export declare const ASSET_REFERENCE_UNREADABLE_CODE = "ASSET_REFERENCE_UNREADABLE";
1
15
  /**
2
16
  * Resolve a VAT "asset reference" to an absolute filesystem path.
3
17
  *
@@ -29,7 +43,9 @@
29
43
  * @param specifier - The asset reference (path or bare npm specifier)
30
44
  * @param baseDir - Absolute directory used as the resolution anchor
31
45
  * @returns Absolute filesystem path to the asset
32
- * @throws Error with actionable message and `cause` on resolution failure
46
+ * @throws {VatError} `ASSET_REFERENCE_UNRESOLVED`, with an actionable message and
47
+ * Node's error as `cause`, when a bare specifier names nothing Node can reach;
48
+ * `ASSET_REFERENCE_UNREADABLE` when the package is there and Node cannot read it
33
49
  */
34
50
  export declare function resolveAssetReference(specifier: string, baseDir: string): string;
35
51
  //# sourceMappingURL=asset-reference.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"asset-reference.d.ts","sourceRoot":"","sources":["../src/asset-reference.ts"],"names":[],"mappings":"AAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAmBhF"}
1
+ {"version":3,"file":"asset-reference.d.ts","sourceRoot":"","sources":["../src/asset-reference.ts"],"names":[],"mappings":"AAOA;;;;;GAKG;AACH,eAAO,MAAM,+BAA+B,+BAA+B,CAAC;AAE5E;;;;;GAKG;AACH,eAAO,MAAM,+BAA+B,+BAA+B,CAAC;AAW5E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CA4BhF"}
@@ -1,7 +1,24 @@
1
1
  import { existsSync } from 'node:fs';
2
2
  import { createRequire } from 'node:module';
3
3
  import { pathToFileURL } from 'node:url';
4
+ import { VatError } from './errors/vat-error.js';
4
5
  import { isAbsolutePath, safePath } from './path-utils.js';
6
+ /**
7
+ * A bare specifier Node could not resolve to a file: the package is not
8
+ * installed, its `exports` map does not expose the subpath, or the file it
9
+ * points at is not on disk. Always about the reference a user supplied, so a
10
+ * caller reports it against that input — never as VAT's defect.
11
+ */
12
+ export const ASSET_REFERENCE_UNRESOLVED_CODE = 'ASSET_REFERENCE_UNRESOLVED';
13
+ /**
14
+ * A bare specifier whose package IS installed, but which Node could not read
15
+ * its way through: a malformed or unreadable `package.json`, or an `exports`
16
+ * map that is itself invalid. The reference names something; the package is
17
+ * broken — so a caller reports it as an unreadable input, never as "missing".
18
+ */
19
+ export const ASSET_REFERENCE_UNREADABLE_CODE = 'ASSET_REFERENCE_UNREADABLE';
20
+ /** Node's codes for "this specifier names nothing it can reach" — everything else is the package's fault. */
21
+ const NAMES_NOTHING_CODES = new Set(['MODULE_NOT_FOUND', 'ERR_PACKAGE_PATH_NOT_EXPORTED']);
5
22
  // First segment must be a valid npm package name (scoped or unscoped),
6
23
  // followed by `/` and at least one subpath segment. Paths starting with
7
24
  // `.`, `/`, or a Windows drive letter are filesystem paths, never bare
@@ -38,7 +55,9 @@ const BARE_SPECIFIER_RE = /^(?:@[^/]+\/[^/]+|[a-z0-9][a-z0-9._-]*)\/.+/i;
38
55
  * @param specifier - The asset reference (path or bare npm specifier)
39
56
  * @param baseDir - Absolute directory used as the resolution anchor
40
57
  * @returns Absolute filesystem path to the asset
41
- * @throws Error with actionable message and `cause` on resolution failure
58
+ * @throws {VatError} `ASSET_REFERENCE_UNRESOLVED`, with an actionable message and
59
+ * Node's error as `cause`, when a bare specifier names nothing Node can reach;
60
+ * `ASSET_REFERENCE_UNREADABLE` when the package is there and Node cannot read it
42
61
  */
43
62
  export function resolveAssetReference(specifier, baseDir) {
44
63
  if (!isBareSpecifier(specifier)) {
@@ -56,7 +75,12 @@ export function resolveAssetReference(specifier, baseDir) {
56
75
  if (!specifier.startsWith('@') && isModuleNotFound(cause)) {
57
76
  return safePath.resolve(baseDir, specifier);
58
77
  }
59
- throw new Error(formatActionableError(specifier, baseDir, cause), { cause: cause });
78
+ if (!NAMES_NOTHING_CODES.has(errorCodeOf(cause) ?? '')) {
79
+ throw new VatError(ASSET_REFERENCE_UNREADABLE_CODE, `Failed to resolve asset reference '${specifier}': its package is installed but Node cannot read it ` +
80
+ `(a malformed or unreadable package.json, or an invalid "exports" map) — fix or reinstall the package.\n` +
81
+ `Node error: ${formatResolutionError(cause)}`, { cause });
82
+ }
83
+ throw new VatError(ASSET_REFERENCE_UNRESOLVED_CODE, formatActionableError(specifier, baseDir, cause), { cause });
60
84
  }
61
85
  }
62
86
  /**
@@ -66,7 +90,7 @@ export function resolveAssetReference(specifier, baseDir) {
66
90
  */
67
91
  function formatActionableError(specifier, baseDir, cause) {
68
92
  const headline = formatResolutionError(cause);
69
- const code = cause?.code;
93
+ const code = errorCodeOf(cause);
70
94
  const missingPath = extractMissingModulePath(cause);
71
95
  // Mode 1: Node walked the package's `exports` map, computed an absolute
72
96
  // target path, and that file is not on disk. This is the most confusing
@@ -112,11 +136,11 @@ function extractMissingModulePath(cause) {
112
136
  function isBareSpecifier(value) {
113
137
  return BARE_SPECIFIER_RE.test(value);
114
138
  }
139
+ function errorCodeOf(err) {
140
+ return err?.code;
141
+ }
115
142
  function isModuleNotFound(err) {
116
- return (typeof err === 'object' &&
117
- err !== null &&
118
- 'code' in err &&
119
- err.code === 'MODULE_NOT_FOUND');
143
+ return errorCodeOf(err) === 'MODULE_NOT_FOUND';
120
144
  }
121
145
  function formatResolutionError(err) {
122
146
  if (err instanceof Error) {
@@ -1 +1 @@
1
- {"version":3,"file":"asset-reference.js","sourceRoot":"","sources":["../src/asset-reference.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3D,uEAAuE;AACvE,wEAAwE;AACxE,uEAAuE;AACvE,cAAc;AACd,MAAM,iBAAiB,GAAG,8CAA8C,CAAC;AAEzE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAM,UAAU,qBAAqB,CAAC,SAAiB,EAAE,OAAe;IACtE,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,EAAE,CAAC;QAChC,OAAO,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IAC9C,CAAC;IAED,MAAM,SAAS,GAAG,aAAa,CAAC,aAAa,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,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15,16 @@
15
15
  * points at. For a walk that must NOT follow (a delete, a size count of
16
16
  * what `rm -rf` will remove, a bundle that travels as a tarball).
17
17
  * - {@link direntKindFollowing} — stat semantics. A link is answered by its
18
- * target: `'file'`, `'directory'`, or `'dangling'`. For a walk over a tree
19
- * the caller trusts (its own build output, a dev-mode install, a fixture),
20
- * where a link is simply how the entry got there.
18
+ * target: `'file'`, `'directory'`, or `'dangling'`. The link's chain is read
19
+ * by its text beneath the tree the walk is in (`within`) before the kernel
20
+ * follows it (`link-following.ts`): a cycle is `'dangling'`, a link to a
21
+ * network or device path a `LinkChainRefusedError`.
21
22
  *
22
23
  * Neither helper decides for the caller. A `'symlink'` or `'dangling'` that
23
24
  * the caller ignores is still ignored — but it is ignored in a `case` the
24
25
  * reader can see, which is the whole difference.
25
26
  */
26
27
  import type { Dirent } from 'node:fs';
27
- import { VatError } from './errors/vat-error.js';
28
28
  /** What the entry itself is. A link is a link. */
29
29
  export type DirentKind = 'file' | 'directory' | 'symlink' | 'other';
30
30
  /** What the entry resolves to. A link is answered by its target, or is `dangling`. */
@@ -37,47 +37,20 @@ export type FollowedKind = 'file' | 'directory' | 'dangling' | 'other';
37
37
  */
38
38
  export declare function direntKind(entry: Dirent): DirentKind;
39
39
  /**
40
- * Classify an entry by what it resolves to, following a link with one `stat`.
40
+ * Classify an entry by what it resolves to, following a link only once its
41
+ * chain is read beneath `within` (`link-following.ts`).
41
42
  *
42
- * A non-link entry costs no syscall. A link whose target is absent is
43
- * `'dangling'`; a link the OS refuses to resolve (`ELOOP`, `EACCES`) is a
44
- * refusal, not an absence, and stays loud.
43
+ * A non-link entry costs no syscall. A link that resolves to nothing — absent,
44
+ * a cycle — is `'dangling'`; a probe the OS refuses (`EACCES`) is a refusal, not
45
+ * an absence, and stays loud, raw, for the caller's classifier.
45
46
  *
46
47
  * @param dir - The directory `entry` was listed from
47
48
  * @param entry - A `Dirent` from a `withFileTypes` listing of `dir`
49
+ * @param within - The tree the walk is in: the operator's own input
48
50
  * @returns The target's kind, or `'dangling'`
51
+ * @throws LinkChainRefusedError for a link to a network or device path
49
52
  */
50
- export declare function direntKindFollowingSync(dir: string, entry: Dirent): FollowedKind;
53
+ export declare function direntKindFollowingSync(dir: string, entry: Dirent, within: string): FollowedKind;
51
54
  /** The async counterpart of {@link direntKindFollowingSync}. */
52
- export declare function direntKindFollowing(dir: string, entry: Dirent): Promise<FollowedKind>;
53
- /** Thrown when a following walk is led back into a directory it has already entered. */
54
- export declare class DirectoryWalkRevisitedError extends VatError {
55
- constructor(dir: string, enteredAs: string);
56
- }
57
- /**
58
- * The directories a FOLLOWING walk has entered, by realpath, so a link that
59
- * leads back into the walk is refused instead of recursed until
60
- * `ENAMETOOLONG`.
61
- *
62
- * A walk that follows links (`direntKindFollowing`) has no cycle guard by
63
- * construction: `scripts/loop -> .` makes a copy create `dest/loop/loop/…`,
64
- * writing every file at every level first, and a hashing walk do the same in
65
- * memory. Every following walk holds one of these and calls {@link enter}
66
- * on every directory it recurses into — the root included. A REVISIT is
67
- * refused, not just a cycle: two links to one directory make the walk's
68
- * output ambiguous (which spelling is the file's path?), and a refusal that
69
- * names both spellings is the answer the author can act on.
70
- */
71
- export declare class FollowedWalk {
72
- #private;
73
- /**
74
- * Record that the walk is entering `dir`. Synchronous on purpose — one
75
- * realpath per directory entered is nothing beside the listing itself, and
76
- * the sync and async walkers then share one guard.
77
- *
78
- * @param dir - A directory the walk is about to list, in any spelling
79
- * @throws {DirectoryWalkRevisitedError} When its realpath was entered before
80
- */
81
- enter(dir: string): void;
82
- }
55
+ export declare function direntKindFollowing(dir: string, entry: Dirent, within: string): Promise<FollowedKind>;
83
56
  //# sourceMappingURL=dirent-kind.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dirent-kind.d.ts","sourceRoot":"","sources":["../src/dirent-kind.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CA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D;;;;;;;;;;;;;GAaG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,YAAY,CAGhG;AAED,gEAAgE;AAChE,wBAAsB,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAG3G"}
@@ -15,20 +15,17 @@
15
15
  * points at. For a walk that must NOT follow (a delete, a size count of
16
16
  * what `rm -rf` will remove, a bundle that travels as a tarball).
17
17
  * - {@link direntKindFollowing} — stat semantics. A link is answered by its
18
- * target: `'file'`, `'directory'`, or `'dangling'`. For a walk over a tree
19
- * the caller trusts (its own build output, a dev-mode install, a fixture),
20
- * where a link is simply how the entry got there.
18
+ * target: `'file'`, `'directory'`, or `'dangling'`. The link's chain is read
19
+ * by its text beneath the tree the walk is in (`within`) before the kernel
20
+ * follows it (`link-following.ts`): a cycle is `'dangling'`, a link to a
21
+ * network or device path a `LinkChainRefusedError`.
21
22
  *
22
23
  * Neither helper decides for the caller. A `'symlink'` or `'dangling'` that
23
24
  * the caller ignores is still ignored — but it is ignored in a `case` the
24
25
  * reader can see, which is the whole difference.
25
26
  */
26
- import { statSync } from 'node:fs';
27
- import fs from 'node:fs/promises';
28
- import { isPathAbsentError } from './errors/errno.js';
29
- import { VatError } from './errors/vat-error.js';
30
- import { toForwardSlash } from './path-core.js';
31
- import { normalizePath, safePath } from './path-utils.js';
27
+ import { followedKind, followedKindSync } from './link-following.js';
28
+ import { safePath } from './path-core.js';
32
29
  /**
33
30
  * Classify an entry WITHOUT following it.
34
31
  *
@@ -52,78 +49,33 @@ function kindOfStats(stats) {
52
49
  return 'file';
53
50
  return 'other';
54
51
  }
52
+ /** A followed kind, a link that resolves to nothing named `dangling`. */
53
+ function followed(kind) {
54
+ return kind === 'absent' ? 'dangling' : kind;
55
+ }
55
56
  /**
56
- * Classify an entry by what it resolves to, following a link with one `stat`.
57
+ * Classify an entry by what it resolves to, following a link only once its
58
+ * chain is read beneath `within` (`link-following.ts`).
57
59
  *
58
- * A non-link entry costs no syscall. A link whose target is absent is
59
- * `'dangling'`; a link the OS refuses to resolve (`ELOOP`, `EACCES`) is a
60
- * refusal, not an absence, and stays loud.
60
+ * A non-link entry costs no syscall. A link that resolves to nothing — absent,
61
+ * a cycle — is `'dangling'`; a probe the OS refuses (`EACCES`) is a refusal, not
62
+ * an absence, and stays loud, raw, for the caller's classifier.
61
63
  *
62
64
  * @param dir - The directory `entry` was listed from
63
65
  * @param entry - A `Dirent` from a `withFileTypes` listing of `dir`
66
+ * @param within - The tree the walk is in: the operator's own input
64
67
  * @returns The target's kind, or `'dangling'`
68
+ * @throws LinkChainRefusedError for a link to a network or device path
65
69
  */
66
- export function direntKindFollowingSync(dir, entry) {
70
+ export function direntKindFollowingSync(dir, entry, within) {
67
71
  if (!entry.isSymbolicLink())
68
72
  return kindOfStats(entry);
69
- try {
70
- return kindOfStats(statSync(safePath.join(dir, entry.name)));
71
- }
72
- catch (error) {
73
- if (isPathAbsentError(error))
74
- return 'dangling';
75
- throw error;
76
- }
73
+ return followed(followedKindSync(safePath.join(dir, entry.name), within));
77
74
  }
78
75
  /** The async counterpart of {@link direntKindFollowingSync}. */
79
- export async function direntKindFollowing(dir, entry) {
76
+ export async function direntKindFollowing(dir, entry, within) {
80
77
  if (!entry.isSymbolicLink())
81
78
  return kindOfStats(entry);
82
- try {
83
- return kindOfStats(await fs.stat(safePath.join(dir, entry.name)));
84
- }
85
- catch (error) {
86
- if (isPathAbsentError(error))
87
- return 'dangling';
88
- throw error;
89
- }
90
- }
91
- /** Thrown when a following walk is led back into a directory it has already entered. */
92
- export class DirectoryWalkRevisitedError extends VatError {
93
- constructor(dir, enteredAs) {
94
- super('DIRECTORY_WALK_REVISITED', `Refusing to enter ${dir}: it is the directory already walked as ${enteredAs} — a symlink leads the walk back into itself.`);
95
- }
96
- }
97
- /**
98
- * The directories a FOLLOWING walk has entered, by realpath, so a link that
99
- * leads back into the walk is refused instead of recursed until
100
- * `ENAMETOOLONG`.
101
- *
102
- * A walk that follows links (`direntKindFollowing`) has no cycle guard by
103
- * construction: `scripts/loop -> .` makes a copy create `dest/loop/loop/…`,
104
- * writing every file at every level first, and a hashing walk do the same in
105
- * memory. Every following walk holds one of these and calls {@link enter}
106
- * on every directory it recurses into — the root included. A REVISIT is
107
- * refused, not just a cycle: two links to one directory make the walk's
108
- * output ambiguous (which spelling is the file's path?), and a refusal that
109
- * names both spellings is the answer the author can act on.
110
- */
111
- export class FollowedWalk {
112
- #entered = new Map();
113
- /**
114
- * Record that the walk is entering `dir`. Synchronous on purpose — one
115
- * realpath per directory entered is nothing beside the listing itself, and
116
- * the sync and async walkers then share one guard.
117
- *
118
- * @param dir - A directory the walk is about to list, in any spelling
119
- * @throws {DirectoryWalkRevisitedError} When its realpath was entered before
120
- */
121
- enter(dir) {
122
- const real = toForwardSlash(normalizePath(dir));
123
- const before = this.#entered.get(real);
124
- if (before !== undefined)
125
- throw new DirectoryWalkRevisitedError(dir, before);
126
- this.#entered.set(real, dir);
127
- }
79
+ return followed(await followedKind(safePath.join(dir, entry.name), within));
128
80
  }
129
81
  //# sourceMappingURL=dirent-kind.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dirent-kind.js","sourceRoot":"","sources":["../src/dirent-kind.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAElC,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AA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,MAAM,EAAE;QAAE,OAAO,MAAM,CAAC;IAClC,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,wCAAwC;AACxC,SAAS,WAAW,CAAC,KAAoD;IACvE,IAAI,KAAK,CAAC,WAAW,EAAE;QAAE,OAAO,WAAW,CAAC;IAC5C,IAAI,KAAK,CAAC,MAAM,EAAE;QAAE,OAAO,MAAM,CAAC;IAClC,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,yEAAyE;AACzE,SAAS,QAAQ,CAAC,IAAsB;IACtC,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC;AAC/C,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,uBAAuB,CAAC,GAAW,EAAE,KAAa,EAAE,MAAc;IAChF,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE;QAAE,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC;IACvD,OAAO,QAAQ,CAAC,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;AAC5E,CAAC;AAED,gEAAgE;AAChE,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,GAAW,EAAE,KAAa,EAAE,MAAc;IAClF,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE;QAAE,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC;IACvD,OAAO,QAAQ,CAAC,MAAM,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;AAC9E,CAAC"}
@@ -11,8 +11,8 @@
11
11
  * Was this module invoked as the process entrypoint, rather than imported?
12
12
  *
13
13
  * ⛔ **Do not reach for `import.meta.main` here.** It shipped in Node 24.2 and
14
- * 22.18; this repo declares a floor of `>=22.13.0`, and on a real 22.13.0 the
15
- * property is `undefined`:
14
+ * 22.18; this repo declares a floor of `>=22.16.0`, and on a real 22.13.0 and
15
+ * 22.16.0 the property is `undefined`:
16
16
  *
17
17
  * ```
18
18
  * $ node-v22.13.0 --input-type=module -e "console.log(import.meta.main)" -> undefined
@@ -1 +1 @@
1
- {"version":3,"file":"entrypoint.d.ts","sourceRoot":"","sources":["../src/entrypoint.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAOH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,wBAAgB,YAAY,CAC1B,aAAa,EAAE,MAAM,EACrB,SAAS,GAAE,MAAM,GAAG,SAA2B,GAC9C,OAAO,CAcT"}
1
+ {"version":3,"file":"entrypoint.d.ts","sourceRoot":"","sources":["../src/entrypoint.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAOH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,wBAAgB,YAAY,CAC1B,aAAa,EAAE,MAAM,EACrB,SAAS,GAAE,MAAM,GAAG,SAA2B,GAC9C,OAAO,CAeT"}
@@ -14,8 +14,8 @@ import { normalizePath } from './path-utils.js';
14
14
  * Was this module invoked as the process entrypoint, rather than imported?
15
15
  *
16
16
  * ⛔ **Do not reach for `import.meta.main` here.** It shipped in Node 24.2 and
17
- * 22.18; this repo declares a floor of `>=22.13.0`, and on a real 22.13.0 the
18
- * property is `undefined`:
17
+ * 22.18; this repo declares a floor of `>=22.16.0`, and on a real 22.13.0 and
18
+ * 22.16.0 the property is `undefined`:
19
19
  *
20
20
  * ```
21
21
  * $ node-v22.13.0 --input-type=module -e "console.log(import.meta.main)" -> undefined
@@ -66,6 +66,7 @@ export function isEntrypoint(importMetaUrl, entryPath = process.argv[1]) {
66
66
  // the path unchanged when it cannot — which is the right answer here, since
67
67
  // the string comparison above has already decided the two differ and an
68
68
  // unresolvable path carries no symlink information to compare.
69
- return toForwardSlash(normalizePath(modulePath)) === toForwardSlash(normalizePath(invokedPath));
69
+ // Both are the process's own entry points, not a crawled path: each is its own edge.
70
+ return toForwardSlash(normalizePath(modulePath, modulePath)) === toForwardSlash(normalizePath(invokedPath, invokedPath));
70
71
  }
71
72
  //# sourceMappingURL=entrypoint.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"entrypoint.js","sourceRoot":"","sources":["../src/entrypoint.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,MAAM,UAAU,YAAY,CAC1B,aAAqB,EACrB,YAAgC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IAE/C,6EAA6E;IAC7E,2EAA2E;IAC3E,IAAI,SAAS,KAAK,SAAS,IAAI,SAAS,KAAK,EAAE;QAAE,OAAO,KAAK,CAAC;IAE9D,MAAM,UAAU,GAAG,QAAQ,CAAC,OAAO,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC,CAAC;IAClE,MAAM,WAAW,GAAG,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChD,IAAI,UAAU,KAAK,WAAW;QAAE,OAAO,IAAI,CAAC;IAE5C,6EAA6E;IAC7E,4EAA4E;IAC5E,wEAAwE;IACxE,+DAA+D;IAC/D,OAAO,cAAc,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC,KAAK,cAAc,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC;AAClG,CAAC"}
1
+ {"version":3,"file":"entrypoint.js","sourceRoot":"","sources":["../src/entrypoint.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,MAAM,UAAU,YAAY,CAC1B,aAAqB,EACrB,YAAgC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IAE/C,6EAA6E;IAC7E,2EAA2E;IAC3E,IAAI,SAAS,KAAK,SAAS,IAAI,SAAS,KAAK,EAAE;QAAE,OAAO,KAAK,CAAC;IAE9D,MAAM,UAAU,GAAG,QAAQ,CAAC,OAAO,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC,CAAC;IAClE,MAAM,WAAW,GAAG,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChD,IAAI,UAAU,KAAK,WAAW;QAAE,OAAO,IAAI,CAAC;IAE5C,6EAA6E;IAC7E,4EAA4E;IAC5E,wEAAwE;IACxE,+DAA+D;IAC/D,qFAAqF;IACrF,OAAO,cAAc,CAAC,aAAa,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC,KAAK,cAAc,CAAC,aAAa,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC;AAC3H,CAAC"}
@@ -20,21 +20,29 @@
20
20
  * needs it rather than speculatively. That second package arrived:
21
21
  * `packages/cli`'s `projectionStoreSelected()` reads the same `VAT_CACHE` the
22
22
  * `resources` parse cache does, and two independent readings of one variable is
23
- * the defect, not the fix. The four consumers today:
23
+ * the defect, not the fix. The consumers today:
24
24
  *
25
25
  * | Caller | Variable | Reads `undefined` as | Why |
26
26
  * |---|---|---|---|
27
- * | `link-auth/resolve-token.ts` | `VAT_LINKAUTH_ALLOW_COMMAND` | **deny** | gates a capability — fail closed |
27
+ * | `resources/link-auth/resolve-token.ts` | `VAT_LINKAUTH_ALLOW_COMMAND` | **deny** | gates a capability — fail closed |
28
28
  * | `resources/parse-cache.ts` | `VAT_CACHE` | cache stays on | gates a cache — an unreadable value must not silently change behaviour |
29
29
  * | `cli/utils/projection-store.ts` | `VAT_CACHE` | not a veto | same variable, same reading, one implementation |
30
30
  * | `cli/utils/projection-store.ts` | `VAT_PROJECTION_STORE` | not a veto | the projection store is ON by default; only an explicit off spelling (or an empty value, which that call site handles before asking) turns it off |
31
+ * | `lab/harness/population-expectation.ts` | `VAT_CACHE` | not a veto | mirrors the two readings above, so the lab expects a parse shard and a store exactly where vat writes them (pinned against the built cli and resources) |
32
+ * | `lab/harness/population-expectation.ts` | `VAT_PROJECTION_STORE` | not a veto | mirrors `projectionStoreSelected()`, empty handled before asking, as that call site does (pinned against the built cli) |
33
+ * | `resources/parse-dispatcher.ts` | `VAT_PARSE_POOL` | pool stays on | gates a measured speed-up — only an explicit off spelling disables it; a typo must not silently cost it |
31
34
  *
32
35
  * Same parser, different safe sides, each chosen at its own call site. That is
33
36
  * the contract; do not move a default in here.
34
37
  *
35
- * 🔑 The last two rows are the interesting pair: one variable defaults OFF and
36
- * the other defaults ON, and both are still read through this one function,
37
- * because what it answers is not "is this on" but "did the operator say no".
38
+ * 🔑 The two `projection-store.ts` rows are the interesting pair: one variable
39
+ * defaults OFF and the other defaults ON, and both are still read through this
40
+ * one function, because what it answers is not "is this on" but "did the
41
+ * operator say no".
42
+ *
43
+ * The table is asserted both ways, per (file, variable), against every
44
+ * `parseEnvBoolean` call (aliased imports included) in every package's `src` by
45
+ * `test/env-flag.test.ts`.
38
46
  */
39
47
  /**
40
48
  * Parse an env value as a boolean.
@@ -1 +1 @@
1
- {"version":3,"file":"env-flag.d.ts","sourceRoot":"","sources":["../src/env-flag.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAKH;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAM5E"}
1
+ {"version":3,"file":"env-flag.d.ts","sourceRoot":"","sources":["../src/env-flag.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAKH;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAM5E"}
package/dist/env-flag.js CHANGED
@@ -20,21 +20,29 @@
20
20
  * needs it rather than speculatively. That second package arrived:
21
21
  * `packages/cli`'s `projectionStoreSelected()` reads the same `VAT_CACHE` the
22
22
  * `resources` parse cache does, and two independent readings of one variable is
23
- * the defect, not the fix. The four consumers today:
23
+ * the defect, not the fix. The consumers today:
24
24
  *
25
25
  * | Caller | Variable | Reads `undefined` as | Why |
26
26
  * |---|---|---|---|
27
- * | `link-auth/resolve-token.ts` | `VAT_LINKAUTH_ALLOW_COMMAND` | **deny** | gates a capability — fail closed |
27
+ * | `resources/link-auth/resolve-token.ts` | `VAT_LINKAUTH_ALLOW_COMMAND` | **deny** | gates a capability — fail closed |
28
28
  * | `resources/parse-cache.ts` | `VAT_CACHE` | cache stays on | gates a cache — an unreadable value must not silently change behaviour |
29
29
  * | `cli/utils/projection-store.ts` | `VAT_CACHE` | not a veto | same variable, same reading, one implementation |
30
30
  * | `cli/utils/projection-store.ts` | `VAT_PROJECTION_STORE` | not a veto | the projection store is ON by default; only an explicit off spelling (or an empty value, which that call site handles before asking) turns it off |
31
+ * | `lab/harness/population-expectation.ts` | `VAT_CACHE` | not a veto | mirrors the two readings above, so the lab expects a parse shard and a store exactly where vat writes them (pinned against the built cli and resources) |
32
+ * | `lab/harness/population-expectation.ts` | `VAT_PROJECTION_STORE` | not a veto | mirrors `projectionStoreSelected()`, empty handled before asking, as that call site does (pinned against the built cli) |
33
+ * | `resources/parse-dispatcher.ts` | `VAT_PARSE_POOL` | pool stays on | gates a measured speed-up — only an explicit off spelling disables it; a typo must not silently cost it |
31
34
  *
32
35
  * Same parser, different safe sides, each chosen at its own call site. That is
33
36
  * the contract; do not move a default in here.
34
37
  *
35
- * 🔑 The last two rows are the interesting pair: one variable defaults OFF and
36
- * the other defaults ON, and both are still read through this one function,
37
- * because what it answers is not "is this on" but "did the operator say no".
38
+ * 🔑 The two `projection-store.ts` rows are the interesting pair: one variable
39
+ * defaults OFF and the other defaults ON, and both are still read through this
40
+ * one function, because what it answers is not "is this on" but "did the
41
+ * operator say no".
42
+ *
43
+ * The table is asserted both ways, per (file, variable), against every
44
+ * `parseEnvBoolean` call (aliased imports included) in every package's `src` by
45
+ * `test/env-flag.test.ts`.
38
46
  */
39
47
  const TRUE_SPELLINGS = new Set(['1', 'true', 'yes', 'y', 'on']);
40
48
  const FALSE_SPELLINGS = new Set(['0', 'false', 'no', 'n', 'off']);
@@ -1 +1 @@
1
- {"version":3,"file":"env-flag.js","sourceRoot":"","sources":["../src/env-flag.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,MAAM,cAAc,GAAwB,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC;AACrF,MAAM,eAAe,GAAwB,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC;AAEvF;;;;;;;;;;GAUG;AACH,MAAM,UAAU,eAAe,CAAC,GAAuB;IACrD,IAAI,GAAG,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IACxC,MAAM,UAAU,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC5C,IAAI,cAAc,CAAC,GAAG,CAAC,UAAU,CAAC;QAAE,OAAO,IAAI,CAAC;IAChD,IAAI,eAAe,CAAC,GAAG,CAAC,UAAU,CAAC;QAAE,OAAO,KAAK,CAAC;IAClD,OAAO,SAAS,CAAC;AACnB,CAAC"}
1
+ {"version":3,"file":"env-flag.js","sourceRoot":"","sources":["../src/env-flag.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAEH,MAAM,cAAc,GAAwB,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC;AACrF,MAAM,eAAe,GAAwB,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC;AAEvF;;;;;;;;;;GAUG;AACH,MAAM,UAAU,eAAe,CAAC,GAAuB;IACrD,IAAI,GAAG,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IACxC,MAAM,UAAU,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC5C,IAAI,cAAc,CAAC,GAAG,CAAC,UAAU,CAAC;QAAE,OAAO,IAAI,CAAC;IAChD,IAAI,eAAe,CAAC,GAAG,CAAC,UAAU,CAAC;QAAE,OAAO,KAAK,CAAC;IAClD,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Believe "nothing there" only when the parent's listing agrees.
3
+ *
4
+ * A probe — a read, an `lstat` — that the OS answers with `ENOENT` or `ENOTDIR`
5
+ * means absent only if it is right. Read as absent on its own word, a refusal of a
6
+ * file that IS there turns a registry into an empty one and a destination into a
7
+ * free one, and the write after it drops what was there. The parent's listing is a
8
+ * second, independent witness: an entry it names is there, and the probe's answer
9
+ * was a fault — except a link under a probe that follows links (a read), which
10
+ * sees through it to a target that really is missing. An `lstat` sees the link
11
+ * itself, so for it a listed link is a fault like any entry.
12
+ */
13
+ import { type FsFaultContext, type SideOfPath } from './fs-fault.js';
14
+ /**
15
+ * The caller's action for a confirmation's fault, with no side of its own: the side is
16
+ * `sideOf(<the path refused>)` — the listed parent's for a refused listing, the entry's for a
17
+ * contradicted probe — never the side of the question the probe was answering.
18
+ */
19
+ export type ConfirmationContext = Omit<FsFaultContext, 'side'> & {
20
+ readonly side?: never;
21
+ };
22
+ /** How the probe that said "absent" looked, and whose each path it may touch is. */
23
+ export interface ConfirmationProbe {
24
+ /** Whether the probe followed a link (a read, a `stat`) or saw it (`lstat`). */
25
+ readonly follows: boolean;
26
+ /** The side of each path: the entry, and the parent whose listing is the second witness. */
27
+ readonly sideOf: SideOfPath;
28
+ }
29
+ /**
30
+ * Confirm that nothing is at `entry` after a probe of it said "absent".
31
+ *
32
+ * @param entry - The path the probe examined
33
+ * @param absent - What the probe threw (`ENOENT` / `ENOTDIR`)
34
+ * @param ctx - The caller's action, for the fault
35
+ * @param probe - How the probe looked, and the side of each path it may charge
36
+ * @throws the probe's own error classified on `sideOf(entry)` (naming `entry`) when the parent
37
+ * lists it (a link only to a probe that does not follow); the listing's error classified on
38
+ * `sideOf(parent)` when the parent is there but cannot be listed — absence was never shown
39
+ */
40
+ export declare function requireConfirmedAbsent(entry: string, absent: unknown, ctx: ConfirmationContext, probe: ConfirmationProbe): void;
41
+ //# sourceMappingURL=confirmed-absent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"confirmed-absent.d.ts","sourceRoot":"","sources":["../../src/errors/confirmed-absent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAMH,OAAO,EAAmB,KAAK,cAAc,EAAiB,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AAErG;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC,GAAG;IAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC;AAE3F,oFAAoF;AACpF,MAAM,WAAW,iBAAiB;IAChC,gFAAgF;IAChF,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,4FAA4F;IAC5F,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;CAC7B;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,mBAAmB,EAAE,KAAK,EAAE,iBAAiB,GAAG,IAAI,CAW/H"}