@unbrained/pm-cli 2026.11.30 → 2026.12.2

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 (382) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/dist/cli/commander-usage.js +10 -10
  3. package/dist/cli/error-guidance.js +5 -5
  4. package/dist/cli/extension-command-help.js +6 -6
  5. package/dist/cli/help-json-payload.js +7 -7
  6. package/dist/cli/main.js +5 -5
  7. package/dist/cli/register-list-query.js +10 -10
  8. package/dist/cli/register-mutation.js +3 -3
  9. package/dist/cli/runtime/invocation-command-path.js +2 -0
  10. package/dist/cli/runtime/read-output-mutation-retry.js +1 -1
  11. package/dist/cli-bundle/bundle-manifest.json +1 -1
  12. package/dist/cli-bundle/chunks/{chunk-DCWGM7CY.js → chunk-3HKPVOAN.js} +2 -2
  13. package/dist/cli-bundle/chunks/{chunk-Z7YL2SUM.js → chunk-3KEMIPKG.js} +2 -2
  14. package/dist/cli-bundle/chunks/{chunk-TX74QJ4W.js → chunk-4YYFY33T.js} +2 -2
  15. package/dist/cli-bundle/chunks/{chunk-47ZS6RPL.js → chunk-7NAO7I75.js} +2 -2
  16. package/dist/cli-bundle/chunks/{chunk-IGEFPHV7.js → chunk-7V65VACG.js} +52 -52
  17. package/dist/cli-bundle/chunks/chunk-A5ZEMOVR.js +2 -0
  18. package/dist/cli-bundle/chunks/{chunk-5PNOVDVO.js → chunk-AHV3CSQG.js} +2 -2
  19. package/dist/cli-bundle/chunks/{chunk-KCVSSONY.js → chunk-C6WM6ZN4.js} +3 -3
  20. package/dist/cli-bundle/chunks/chunk-CBUC4X7Q.js +127 -0
  21. package/dist/cli-bundle/chunks/{chunk-CCKM5YQM.js → chunk-G6TARHFK.js} +2 -2
  22. package/dist/cli-bundle/chunks/{chunk-TY55UX6M.js → chunk-GOEQXVOI.js} +2 -2
  23. package/dist/cli-bundle/chunks/chunk-I4SPJQQI.js +3 -0
  24. package/dist/cli-bundle/chunks/{chunk-Q4VZSMUL.js → chunk-L2ZSSMYY.js} +2 -2
  25. package/dist/cli-bundle/chunks/{chunk-NHBG5ET3.js → chunk-MZZ4ZJ5Z.js} +2 -2
  26. package/dist/cli-bundle/chunks/chunk-NRQCBUYD.js +113 -0
  27. package/dist/cli-bundle/chunks/{chunk-YVTALIN3.js → chunk-OBPO6V7H.js} +2 -2
  28. package/dist/cli-bundle/chunks/{chunk-KXTKLDKD.js → chunk-OXC5KBIQ.js} +2 -2
  29. package/dist/cli-bundle/chunks/{chunk-HXQ3OHQR.js → chunk-PCDTWL6V.js} +2 -2
  30. package/dist/cli-bundle/chunks/{chunk-AOTI76Q6.js → chunk-Q6K7HWZ7.js} +2 -2
  31. package/dist/cli-bundle/chunks/chunk-QDV7S2QS.js +2 -0
  32. package/dist/cli-bundle/chunks/{chunk-NZSXWIX7.js → chunk-ROTEELDL.js} +7 -7
  33. package/dist/cli-bundle/chunks/{chunk-WFYE34TO.js → chunk-SDXCJZKB.js} +23 -23
  34. package/dist/cli-bundle/chunks/{chunk-2SBTXR6C.js → chunk-SY5C3U32.js} +3 -3
  35. package/dist/cli-bundle/chunks/{chunk-FR7ULTM4.js → chunk-TKUG2X24.js} +2 -2
  36. package/dist/cli-bundle/chunks/{chunk-FECZV72T.js → chunk-UNBW2LF3.js} +2 -2
  37. package/dist/cli-bundle/chunks/chunk-V2S4XAX3.js +2 -0
  38. package/dist/cli-bundle/chunks/chunk-WSEIEDEK.js +2 -0
  39. package/dist/cli-bundle/chunks/{chunk-ZA5NS3PL.js → chunk-ZL6J6JYT.js} +6 -6
  40. package/dist/cli-bundle/chunks/{field-option-collisions-2F2Z7R7B.js → field-option-collisions-BBGTV7AD.js} +2 -2
  41. package/dist/cli-bundle/chunks/item-revision-3LENTXYF.js +2 -0
  42. package/dist/cli-bundle/chunks/item-transaction-56J5OCHA.js +2 -0
  43. package/dist/cli-bundle/chunks/{linked-resource-value-list-WXPPYUVQ.js → linked-resource-value-list-ZBIY4H23.js} +2 -2
  44. package/dist/cli-bundle/chunks/{mutation-actor-UK3QNEEB.js → mutation-actor-NHN33ITJ.js} +2 -2
  45. package/dist/cli-bundle/chunks/{mutation-admission-UTDYPFWP.js → mutation-admission-PGKJTCG6.js} +2 -2
  46. package/dist/cli-bundle/chunks/{register-list-query-DRA3CWHI.js → register-list-query-7S5QWDTI.js} +11 -11
  47. package/dist/cli-bundle/chunks/{register-mutation-WO74VLEQ.js → register-mutation-EK6DVIQK.js} +5 -5
  48. package/dist/cli-bundle/chunks/{register-operations-CRBKH7WN.js → register-operations-6MURXE4V.js} +2 -2
  49. package/dist/cli-bundle/chunks/{register-setup-6V6NQB5C.js → register-setup-RW26X3GJ.js} +2 -2
  50. package/dist/cli-bundle/chunks/{stage-DYEHGASU.js → stage-4ZCF74G4.js} +2 -2
  51. package/dist/cli-bundle/focused-chunks/{chunk-RQYVX2T6.js → chunk-2DGKVXFT.js} +2 -2
  52. package/dist/cli-bundle/focused-chunks/chunk-2UWKU2BQ.js +3 -0
  53. package/dist/cli-bundle/focused-chunks/{chunk-A3DORTXS.js → chunk-3COWDIPX.js} +54 -54
  54. package/dist/cli-bundle/focused-chunks/{chunk-UQJ4PY2Y.js → chunk-4SCFAWAW.js} +2 -2
  55. package/dist/cli-bundle/focused-chunks/{chunk-7G7JIXLL.js → chunk-6BKT6XQN.js} +2 -2
  56. package/dist/cli-bundle/focused-chunks/chunk-6IY5CVGJ.js +2 -0
  57. package/dist/cli-bundle/focused-chunks/chunk-7A6SEZEY.js +4 -0
  58. package/dist/cli-bundle/focused-chunks/{chunk-IJ3T3W4U.js → chunk-BHNBPCHP.js} +2 -2
  59. package/dist/cli-bundle/focused-chunks/{chunk-LWBZ7UGG.js → chunk-EQCQTYKO.js} +2 -2
  60. package/dist/cli-bundle/focused-chunks/{chunk-FM5WQ6ZU.js → chunk-HTDYNY4L.js} +2 -2
  61. package/dist/cli-bundle/focused-chunks/{chunk-TQQO42C2.js → chunk-J72TRWR5.js} +26 -26
  62. package/dist/cli-bundle/focused-chunks/{chunk-L357ZAES.js → chunk-JPZGC3W4.js} +5 -5
  63. package/dist/cli-bundle/focused-chunks/{chunk-62AMZMR4.js → chunk-KNBGHCIP.js} +3 -3
  64. package/dist/cli-bundle/focused-chunks/chunk-N64AC5G6.js +100 -0
  65. package/dist/cli-bundle/focused-chunks/{chunk-IIVDBAJM.js → chunk-OG57ESZK.js} +2 -2
  66. package/dist/cli-bundle/focused-chunks/{chunk-MZNV26XE.js → chunk-P2H3GTJK.js} +2 -2
  67. package/dist/cli-bundle/focused-chunks/chunk-QZRYGYTI.js +2 -0
  68. package/dist/cli-bundle/focused-chunks/chunk-SQMOF65W.js +2 -0
  69. package/dist/cli-bundle/focused-chunks/chunk-T3ILWAEV.js +2 -0
  70. package/dist/cli-bundle/focused-chunks/{chunk-SXC3NVZI.js → chunk-TR22GU7M.js} +2 -2
  71. package/dist/cli-bundle/focused-chunks/{chunk-M57KDG7I.js → chunk-TXTPAFHJ.js} +2 -2
  72. package/dist/cli-bundle/focused-chunks/chunk-VK3IE3TS.js +29 -0
  73. package/dist/cli-bundle/focused-chunks/{chunk-NJTKGBSK.js → chunk-VQIC3UZB.js} +2 -2
  74. package/dist/cli-bundle/focused-chunks/{chunk-U35K7FSE.js → chunk-W4JMV7GF.js} +2 -2
  75. package/dist/cli-bundle/focused-chunks/{field-option-collisions-7TG7STO7.js → field-option-collisions-2C6DLUC4.js} +2 -2
  76. package/dist/cli-bundle/focused-chunks/item-revision-723XCQPS.js +2 -0
  77. package/dist/cli-bundle/focused-chunks/{item-transaction-2IC2MLML.js → item-transaction-LQLQLZE7.js} +2 -2
  78. package/dist/cli-bundle/focused-chunks/{mutation-actor-LJVF2HVD.js → mutation-actor-DJMZUIZI.js} +2 -2
  79. package/dist/cli-bundle/focused-chunks/mutation-admission-SDWQVVHN.js +2 -0
  80. package/dist/cli-bundle/focused-chunks/{stage-MWR73LTZ.js → stage-QBZIK3T5.js} +2 -2
  81. package/dist/cli-bundle/main.js +27 -27
  82. package/dist/cli-bundle/sdk-authoring.js +1 -1
  83. package/dist/cli-bundle/sdk-contracts.js +1 -1
  84. package/dist/cli-bundle/sdk-core.js +1 -1
  85. package/dist/cli-bundle/sdk-governance.js +1 -1
  86. package/dist/cli-bundle/sdk-graph.js +1 -1
  87. package/dist/cli-bundle/sdk-merge.js +61 -61
  88. package/dist/cli-bundle/sdk-query.js +1 -1
  89. package/dist/cli-bundle/sdk-runtime.js +1 -1
  90. package/dist/cli-bundle/sdk-testing.js +1 -1
  91. package/dist/cli-bundle/sdk.js +2 -2
  92. package/dist/core/extensions/reserved-host-flags.js +1 -1
  93. package/dist/core/shared/secret-rules.d.ts +86 -12
  94. package/dist/core/shared/secret-rules.js +7 -5
  95. package/dist/sdk/cli-bootstrap.js +1 -1
  96. package/dist/sdk/cli-contracts/flag-contracts.d.ts +50 -0
  97. package/dist/sdk/cli-contracts/flag-contracts.js +1 -1
  98. package/dist/sdk/cli-contracts/runtime-contracts.d.ts +3 -1
  99. package/dist/sdk/cli-contracts/runtime-contracts.js +1 -1
  100. package/dist/sdk/extension/command-options.js +1 -1
  101. package/dist/sdk/extension/install-sources.d.ts +2 -2
  102. package/dist/sdk/extension/install-sources.js +5 -5
  103. package/dist/sdk/lifecycle/expect-hash-admission.d.ts +15 -0
  104. package/dist/sdk/lifecycle/expect-hash-admission.js +2 -0
  105. package/dist/sdk/lifecycle/item-revision.d.ts +4 -1
  106. package/dist/sdk/lifecycle/item-revision.js +1 -1
  107. package/dist/sdk/mutation-guard.js +1 -1
  108. package/dist/sdk/output-contracts.js +1 -1
  109. package/dist/sdk/output-projection.d.ts +1 -1
  110. package/dist/sdk/output-projection.js +1 -1
  111. package/dist/sdk/public-surface.json +1 -1
  112. package/dist/sdk/query/aggregate.js +1 -1
  113. package/dist/sdk/query/context.js +1 -1
  114. package/dist/sdk/query/list.js +1 -1
  115. package/dist/sdk/query/next.js +1 -1
  116. package/dist/sdk/query/search-contracts.js +1 -1
  117. package/dist/sdk/read-output/surfaces.js +1 -1
  118. package/dist/sdk/read-output-budget.d.ts +1 -1
  119. package/dist/sdk/read-output-budget.js +1 -1
  120. package/dist/sdk/read-output-contracts.js +1 -1
  121. package/dist/sdk/read-output-rows.js +1 -1
  122. package/docs/COMMANDS.md +37 -0
  123. package/docs/MUTATION_INTEGRITY.md +226 -10
  124. package/docs/SDK.md +16 -6
  125. package/docs/agent-task-token-baseline.json +1 -1
  126. package/marketplace.json +1 -1
  127. package/node_modules/tar/README.md +1792 -1147
  128. package/node_modules/tar/dist/commonjs/bytes.d.ts +21 -0
  129. package/node_modules/tar/dist/commonjs/bytes.js +83 -0
  130. package/node_modules/tar/dist/commonjs/codec.d.ts +53 -0
  131. package/node_modules/tar/dist/commonjs/codec.js +35 -0
  132. package/node_modules/tar/dist/commonjs/concat.d.ts +3 -0
  133. package/node_modules/tar/dist/commonjs/concat.js +20 -0
  134. package/node_modules/tar/dist/commonjs/create.d.ts +39 -2
  135. package/node_modules/tar/dist/commonjs/create.js +150 -64
  136. package/node_modules/tar/dist/commonjs/dealias.d.ts +79 -0
  137. package/node_modules/tar/dist/commonjs/dealias.js +50 -0
  138. package/node_modules/tar/dist/commonjs/delete.d.ts +19 -0
  139. package/node_modules/tar/dist/commonjs/delete.js +121 -0
  140. package/node_modules/tar/dist/commonjs/entries.d.ts +82 -0
  141. package/node_modules/tar/dist/commonjs/entries.js +398 -0
  142. package/node_modules/tar/dist/commonjs/extract.d.ts +14 -2
  143. package/node_modules/tar/dist/commonjs/extract.js +40 -81
  144. package/node_modules/tar/dist/commonjs/fs.d.ts +201 -0
  145. package/node_modules/tar/dist/commonjs/fs.js +5 -0
  146. package/node_modules/tar/dist/commonjs/header.d.ts +4 -4
  147. package/node_modules/tar/dist/commonjs/header.js +71 -53
  148. package/node_modules/tar/dist/commonjs/index.d.ts +25 -18
  149. package/node_modules/tar/dist/commonjs/index.js +46 -18
  150. package/node_modules/tar/dist/commonjs/index.min.js +2 -3
  151. package/node_modules/tar/dist/commonjs/large-numbers.d.ts +2 -2
  152. package/node_modules/tar/dist/commonjs/large-numbers.js +4 -4
  153. package/node_modules/tar/dist/commonjs/list.d.ts +23 -6
  154. package/node_modules/tar/dist/commonjs/list.js +99 -138
  155. package/node_modules/tar/dist/commonjs/mkdir.d.ts +16 -11
  156. package/node_modules/tar/dist/commonjs/mkdir.js +121 -159
  157. package/node_modules/tar/dist/commonjs/normalize-unicode.js +9 -0
  158. package/node_modules/tar/dist/commonjs/options.d.ts +284 -513
  159. package/node_modules/tar/dist/commonjs/options.js +20 -61
  160. package/node_modules/tar/dist/commonjs/pack.d.ts +150 -96
  161. package/node_modules/tar/dist/commonjs/pack.js +752 -445
  162. package/node_modules/tar/dist/commonjs/parser.d.ts +98 -0
  163. package/node_modules/tar/dist/commonjs/parser.js +452 -0
  164. package/node_modules/tar/dist/commonjs/path-reservations.d.ts +17 -7
  165. package/node_modules/tar/dist/commonjs/path-reservations.js +110 -140
  166. package/node_modules/tar/dist/commonjs/path.d.ts +19 -0
  167. package/node_modules/tar/dist/commonjs/path.js +90 -0
  168. package/node_modules/tar/dist/commonjs/pax.d.ts +3 -1
  169. package/node_modules/tar/dist/commonjs/pax.js +67 -36
  170. package/node_modules/tar/dist/commonjs/read-entry.d.ts +97 -11
  171. package/node_modules/tar/dist/commonjs/read-entry.js +251 -97
  172. package/node_modules/tar/dist/commonjs/read-file.d.ts +22 -0
  173. package/node_modules/tar/dist/commonjs/read-file.js +104 -0
  174. package/node_modules/tar/dist/commonjs/replace.d.ts +45 -1
  175. package/node_modules/tar/dist/commonjs/replace.js +164 -211
  176. package/node_modules/tar/dist/commonjs/server/codecs.d.ts +38 -0
  177. package/node_modules/tar/dist/commonjs/server/codecs.js +252 -0
  178. package/node_modules/tar/dist/commonjs/server/index.d.ts +115 -0
  179. package/node_modules/tar/dist/commonjs/server/index.js +166 -0
  180. package/node_modules/tar/dist/commonjs/server/index.min.js +3 -0
  181. package/node_modules/tar/dist/commonjs/strip-absolute-path.d.ts +8 -0
  182. package/node_modules/tar/dist/commonjs/strip-absolute-path.js +17 -20
  183. package/node_modules/tar/dist/commonjs/to-stream.d.ts +7 -0
  184. package/node_modules/tar/dist/commonjs/to-stream.js +22 -0
  185. package/node_modules/tar/dist/commonjs/types.d.ts +4 -3
  186. package/node_modules/tar/dist/commonjs/types.js +4 -3
  187. package/node_modules/tar/dist/commonjs/unpack.d.ts +143 -89
  188. package/node_modules/tar/dist/commonjs/unpack.js +780 -725
  189. package/node_modules/tar/dist/commonjs/update.d.ts +11 -1
  190. package/node_modules/tar/dist/commonjs/update.js +37 -28
  191. package/node_modules/tar/dist/commonjs/warn.d.ts +27 -0
  192. package/node_modules/tar/dist/commonjs/warn.js +36 -0
  193. package/node_modules/tar/dist/commonjs/win32-path.d.ts +16 -0
  194. package/node_modules/tar/dist/commonjs/win32-path.js +67 -0
  195. package/node_modules/tar/dist/commonjs/write-entry.d.ts +64 -111
  196. package/node_modules/tar/dist/commonjs/write-entry.js +108 -672
  197. package/node_modules/tar/dist/commonjs/write-flag.d.ts +18 -0
  198. package/node_modules/tar/dist/commonjs/write-flag.js +29 -0
  199. package/node_modules/tar/dist/esm/bytes.d.ts +21 -0
  200. package/node_modules/tar/dist/esm/bytes.js +72 -0
  201. package/node_modules/tar/dist/esm/codec.d.ts +53 -0
  202. package/node_modules/tar/dist/esm/codec.js +32 -0
  203. package/node_modules/tar/dist/esm/concat.d.ts +3 -0
  204. package/node_modules/tar/dist/esm/concat.js +16 -0
  205. package/node_modules/tar/dist/esm/create.d.ts +39 -2
  206. package/node_modules/tar/dist/esm/create.js +144 -61
  207. package/node_modules/tar/dist/esm/dealias.d.ts +79 -0
  208. package/node_modules/tar/dist/esm/dealias.js +46 -0
  209. package/node_modules/tar/dist/esm/delete.d.ts +19 -0
  210. package/node_modules/tar/dist/esm/delete.js +117 -0
  211. package/node_modules/tar/dist/esm/entries.d.ts +82 -0
  212. package/node_modules/tar/dist/esm/entries.js +388 -0
  213. package/node_modules/tar/dist/esm/extract.d.ts +14 -2
  214. package/node_modules/tar/dist/esm/extract.js +37 -44
  215. package/node_modules/tar/dist/esm/fs.d.ts +201 -0
  216. package/node_modules/tar/dist/esm/fs.js +4 -0
  217. package/node_modules/tar/dist/esm/header.d.ts +4 -4
  218. package/node_modules/tar/dist/esm/header.js +71 -53
  219. package/node_modules/tar/dist/esm/index.d.ts +25 -18
  220. package/node_modules/tar/dist/esm/index.js +23 -18
  221. package/node_modules/tar/dist/esm/index.min.js +2 -3
  222. package/node_modules/tar/dist/esm/large-numbers.d.ts +2 -2
  223. package/node_modules/tar/dist/esm/large-numbers.js +4 -4
  224. package/node_modules/tar/dist/esm/list.d.ts +23 -6
  225. package/node_modules/tar/dist/esm/list.js +96 -101
  226. package/node_modules/tar/dist/esm/mkdir.d.ts +16 -11
  227. package/node_modules/tar/dist/esm/mkdir.js +119 -154
  228. package/node_modules/tar/dist/esm/normalize-unicode.js +9 -0
  229. package/node_modules/tar/dist/esm/options.d.ts +284 -513
  230. package/node_modules/tar/dist/esm/options.js +17 -51
  231. package/node_modules/tar/dist/esm/pack.d.ts +150 -96
  232. package/node_modules/tar/dist/esm/pack.js +750 -441
  233. package/node_modules/tar/dist/esm/parser.d.ts +98 -0
  234. package/node_modules/tar/dist/esm/parser.js +448 -0
  235. package/node_modules/tar/dist/esm/path-reservations.d.ts +17 -7
  236. package/node_modules/tar/dist/esm/path-reservations.js +110 -140
  237. package/node_modules/tar/dist/esm/path.d.ts +19 -0
  238. package/node_modules/tar/dist/esm/path.js +80 -0
  239. package/node_modules/tar/dist/esm/pax.d.ts +3 -1
  240. package/node_modules/tar/dist/esm/pax.js +66 -35
  241. package/node_modules/tar/dist/esm/read-entry.d.ts +97 -11
  242. package/node_modules/tar/dist/esm/read-entry.js +248 -96
  243. package/node_modules/tar/dist/esm/read-file.d.ts +22 -0
  244. package/node_modules/tar/dist/esm/read-file.js +99 -0
  245. package/node_modules/tar/dist/esm/replace.d.ts +45 -1
  246. package/node_modules/tar/dist/esm/replace.js +160 -207
  247. package/node_modules/tar/dist/esm/server/codecs.d.ts +38 -0
  248. package/node_modules/tar/dist/esm/server/codecs.js +214 -0
  249. package/node_modules/tar/dist/esm/server/index.d.ts +115 -0
  250. package/node_modules/tar/dist/esm/server/index.js +102 -0
  251. package/node_modules/tar/dist/esm/server/index.min.js +3 -0
  252. package/node_modules/tar/dist/esm/strip-absolute-path.d.ts +8 -0
  253. package/node_modules/tar/dist/esm/strip-absolute-path.js +17 -20
  254. package/node_modules/tar/dist/esm/to-stream.d.ts +7 -0
  255. package/node_modules/tar/dist/esm/to-stream.js +18 -0
  256. package/node_modules/tar/dist/esm/types.d.ts +4 -3
  257. package/node_modules/tar/dist/esm/types.js +4 -3
  258. package/node_modules/tar/dist/esm/unpack.d.ts +143 -89
  259. package/node_modules/tar/dist/esm/unpack.js +776 -719
  260. package/node_modules/tar/dist/esm/update.d.ts +11 -1
  261. package/node_modules/tar/dist/esm/update.js +35 -28
  262. package/node_modules/tar/dist/esm/warn.d.ts +27 -0
  263. package/node_modules/tar/dist/esm/warn.js +31 -0
  264. package/node_modules/tar/dist/esm/win32-path.d.ts +16 -0
  265. package/node_modules/tar/dist/esm/win32-path.js +60 -0
  266. package/node_modules/tar/dist/esm/write-entry.d.ts +64 -111
  267. package/node_modules/tar/dist/esm/write-entry.js +107 -633
  268. package/node_modules/tar/dist/esm/write-flag.d.ts +18 -0
  269. package/node_modules/tar/dist/esm/write-flag.js +25 -0
  270. package/node_modules/tar/package.json +68 -224
  271. package/package.json +2 -2
  272. package/packages/pm-beads/package.json +1 -1
  273. package/packages/pm-calendar/package.json +1 -1
  274. package/packages/pm-command-kit/package.json +1 -1
  275. package/packages/pm-digital-twin/package.json +1 -1
  276. package/packages/pm-governance-audit/package.json +1 -1
  277. package/packages/pm-guide-shell/package.json +1 -1
  278. package/packages/pm-kanban/package.json +1 -1
  279. package/packages/pm-lifecycle-hooks/package.json +1 -1
  280. package/packages/pm-linked-test-adapters/package.json +1 -1
  281. package/packages/pm-search-advanced/package.json +1 -1
  282. package/packages/pm-templates/package.json +1 -1
  283. package/packages/pm-todos/package.json +1 -1
  284. package/packages/pm-vcs/package.json +1 -1
  285. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  286. package/plugins/pm-claude/package.json +1 -1
  287. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  288. package/plugins/pm-codex/package.json +1 -1
  289. package/plugins/pm-codex/plugin.json +1 -1
  290. package/runtime-dependencies.json +1 -1
  291. package/dist/cli-bundle/chunks/chunk-3TXEWHQX.js +0 -125
  292. package/dist/cli-bundle/chunks/chunk-JPJNJHQW.js +0 -2
  293. package/dist/cli-bundle/chunks/chunk-NVYDPNQP.js +0 -2
  294. package/dist/cli-bundle/chunks/chunk-SJWIPGZW.js +0 -113
  295. package/dist/cli-bundle/chunks/chunk-USBTXMKS.js +0 -2
  296. package/dist/cli-bundle/chunks/chunk-VCXQ6A35.js +0 -3
  297. package/dist/cli-bundle/chunks/chunk-YPMNXG2C.js +0 -2
  298. package/dist/cli-bundle/chunks/item-revision-UAF6L47R.js +0 -2
  299. package/dist/cli-bundle/chunks/item-transaction-RJECL53Y.js +0 -2
  300. package/dist/cli-bundle/focused-chunks/chunk-2UUBS4BG.js +0 -2
  301. package/dist/cli-bundle/focused-chunks/chunk-4ER3VMST.js +0 -2
  302. package/dist/cli-bundle/focused-chunks/chunk-4YBMHMBJ.js +0 -2
  303. package/dist/cli-bundle/focused-chunks/chunk-HXM7K6VH.js +0 -100
  304. package/dist/cli-bundle/focused-chunks/chunk-NGHT2LNG.js +0 -3
  305. package/dist/cli-bundle/focused-chunks/chunk-P55AZPFN.js +0 -2
  306. package/dist/cli-bundle/focused-chunks/chunk-WAP3DF4B.js +0 -27
  307. package/dist/cli-bundle/focused-chunks/chunk-XR745UGE.js +0 -4
  308. package/dist/cli-bundle/focused-chunks/item-revision-J7EUGCHR.js +0 -2
  309. package/dist/cli-bundle/focused-chunks/mutation-admission-SLFAUONA.js +0 -2
  310. package/node_modules/@isaacs/fs-minipass/LICENSE +0 -15
  311. package/node_modules/@isaacs/fs-minipass/README.md +0 -71
  312. package/node_modules/@isaacs/fs-minipass/dist/commonjs/index.d.ts +0 -118
  313. package/node_modules/@isaacs/fs-minipass/dist/commonjs/index.js +0 -430
  314. package/node_modules/@isaacs/fs-minipass/dist/commonjs/package.json +0 -3
  315. package/node_modules/@isaacs/fs-minipass/dist/esm/index.d.ts +0 -118
  316. package/node_modules/@isaacs/fs-minipass/dist/esm/index.js +0 -420
  317. package/node_modules/@isaacs/fs-minipass/dist/esm/package.json +0 -3
  318. package/node_modules/@isaacs/fs-minipass/package.json +0 -72
  319. package/node_modules/chownr/LICENSE.md +0 -63
  320. package/node_modules/chownr/README.md +0 -3
  321. package/node_modules/chownr/dist/commonjs/index.d.ts +0 -3
  322. package/node_modules/chownr/dist/commonjs/index.js +0 -93
  323. package/node_modules/chownr/dist/commonjs/package.json +0 -3
  324. package/node_modules/chownr/dist/esm/index.d.ts +0 -3
  325. package/node_modules/chownr/dist/esm/index.js +0 -85
  326. package/node_modules/chownr/dist/esm/package.json +0 -3
  327. package/node_modules/chownr/package.json +0 -69
  328. package/node_modules/minipass/LICENSE.md +0 -55
  329. package/node_modules/minipass/README.md +0 -825
  330. package/node_modules/minipass/dist/commonjs/index.d.ts +0 -545
  331. package/node_modules/minipass/dist/commonjs/index.js +0 -1038
  332. package/node_modules/minipass/dist/commonjs/package.json +0 -3
  333. package/node_modules/minipass/dist/esm/index.d.ts +0 -545
  334. package/node_modules/minipass/dist/esm/index.js +0 -1020
  335. package/node_modules/minipass/dist/esm/package.json +0 -3
  336. package/node_modules/minipass/package.json +0 -77
  337. package/node_modules/minizlib/LICENSE +0 -26
  338. package/node_modules/minizlib/README.md +0 -64
  339. package/node_modules/minizlib/dist/commonjs/constants.d.ts +0 -2
  340. package/node_modules/minizlib/dist/commonjs/constants.js +0 -123
  341. package/node_modules/minizlib/dist/commonjs/index.d.ts +0 -99
  342. package/node_modules/minizlib/dist/commonjs/index.js +0 -416
  343. package/node_modules/minizlib/dist/commonjs/package.json +0 -3
  344. package/node_modules/minizlib/dist/esm/constants.d.ts +0 -2
  345. package/node_modules/minizlib/dist/esm/constants.js +0 -117
  346. package/node_modules/minizlib/dist/esm/index.d.ts +0 -99
  347. package/node_modules/minizlib/dist/esm/index.js +0 -363
  348. package/node_modules/minizlib/dist/esm/package.json +0 -3
  349. package/node_modules/minizlib/package.json +0 -80
  350. package/node_modules/tar/dist/commonjs/get-write-flag.d.ts +0 -2
  351. package/node_modules/tar/dist/commonjs/get-write-flag.js +0 -32
  352. package/node_modules/tar/dist/commonjs/make-command.d.ts +0 -49
  353. package/node_modules/tar/dist/commonjs/make-command.js +0 -52
  354. package/node_modules/tar/dist/commonjs/normalize-windows-path.d.ts +0 -2
  355. package/node_modules/tar/dist/commonjs/normalize-windows-path.js +0 -12
  356. package/node_modules/tar/dist/commonjs/parse.d.ts +0 -92
  357. package/node_modules/tar/dist/commonjs/parse.js +0 -655
  358. package/node_modules/tar/dist/commonjs/process-umask.d.ts +0 -2
  359. package/node_modules/tar/dist/commonjs/process-umask.js +0 -7
  360. package/node_modules/tar/dist/commonjs/warn-method.d.ts +0 -24
  361. package/node_modules/tar/dist/commonjs/warn-method.js +0 -31
  362. package/node_modules/tar/dist/esm/get-write-flag.d.ts +0 -2
  363. package/node_modules/tar/dist/esm/get-write-flag.js +0 -26
  364. package/node_modules/tar/dist/esm/make-command.d.ts +0 -49
  365. package/node_modules/tar/dist/esm/make-command.js +0 -48
  366. package/node_modules/tar/dist/esm/normalize-windows-path.d.ts +0 -2
  367. package/node_modules/tar/dist/esm/normalize-windows-path.js +0 -9
  368. package/node_modules/tar/dist/esm/parse.d.ts +0 -92
  369. package/node_modules/tar/dist/esm/parse.js +0 -651
  370. package/node_modules/tar/dist/esm/process-umask.d.ts +0 -2
  371. package/node_modules/tar/dist/esm/process-umask.js +0 -3
  372. package/node_modules/tar/dist/esm/warn-method.d.ts +0 -24
  373. package/node_modules/tar/dist/esm/warn-method.js +0 -27
  374. package/node_modules/yallist/LICENSE.md +0 -63
  375. package/node_modules/yallist/README.md +0 -205
  376. package/node_modules/yallist/dist/commonjs/index.d.ts +0 -39
  377. package/node_modules/yallist/dist/commonjs/index.js +0 -384
  378. package/node_modules/yallist/dist/commonjs/package.json +0 -3
  379. package/node_modules/yallist/dist/esm/index.d.ts +0 -39
  380. package/node_modules/yallist/dist/esm/index.js +0 -379
  381. package/node_modules/yallist/dist/esm/package.json +0 -3
  382. package/node_modules/yallist/package.json +0 -68
@@ -0,0 +1,201 @@
1
+ import type { OpenConstants } from './write-flag.js';
2
+ /** The subset of a `node:fs/promises` `FileHandle` that the code uses. */
3
+ export type TarFileHandle = {
4
+ read(buffer: Uint8Array, offset: number, length: number, position: number): Promise<{
5
+ bytesRead: number;
6
+ }>;
7
+ stat(): Promise<{
8
+ size: number;
9
+ }>;
10
+ close(): Promise<void>;
11
+ };
12
+ /** The subset of `node:fs/promises` that the code uses. */
13
+ export type TarFS = {
14
+ open(path: string, flags: string): Promise<TarFileHandle>;
15
+ };
16
+ /** The subset of `node:fs` that the sync code uses. */
17
+ export type TarFSSync = {
18
+ openSync(path: string, flags: string): number;
19
+ fstatSync(fd: number): {
20
+ size: number;
21
+ };
22
+ readSync(fd: number, buffer: Uint8Array, offset: number, length: number, position: number): number;
23
+ closeSync(fd: number): void;
24
+ };
25
+ /** The subset of the `Stats` of `lstat` that the extraction uses. */
26
+ export type ExtractStats = {
27
+ isDirectory(): boolean;
28
+ isFile(): boolean;
29
+ isSymbolicLink(): boolean;
30
+ nlink: number;
31
+ mode: number;
32
+ mtime: Date;
33
+ };
34
+ /** The subset of a `FileHandle` that the extraction uses. */
35
+ export type ExtractFileHandle = {
36
+ write(data: Uint8Array): Promise<unknown>;
37
+ utimes(atime: Date, mtime: Date): Promise<void>;
38
+ chown(uid: number, gid: number): Promise<void>;
39
+ close(): Promise<void>;
40
+ };
41
+ /**
42
+ * The subset of `node:fs/promises` that the extraction uses. To read
43
+ * the archive from a file, it also uses `TarFS`.
44
+ */
45
+ export type ExtractFS = {
46
+ /** Without it, the flag of `open` is `'w'`. */
47
+ constants?: OpenConstants;
48
+ open(path: string, flags: string | number, mode: number): Promise<ExtractFileHandle>;
49
+ stat(path: string): Promise<{
50
+ isDirectory(): boolean;
51
+ }>;
52
+ lstat(path: string): Promise<ExtractStats>;
53
+ mkdir(path: string, options: {
54
+ mode: number;
55
+ recursive?: boolean;
56
+ }): Promise<string | undefined>;
57
+ chmod(path: string, mode: number): Promise<void>;
58
+ chown(path: string, uid: number, gid: number): Promise<void>;
59
+ lchown(path: string, uid: number, gid: number): Promise<void>;
60
+ utimes(path: string, atime: Date, mtime: Date): Promise<void>;
61
+ lutimes(path: string, atime: Date, mtime: Date): Promise<void>;
62
+ rmdir(path: string): Promise<void>;
63
+ unlink(path: string): Promise<void>;
64
+ rename(from: string, to: string): Promise<void>;
65
+ link(target: string, path: string): Promise<void>;
66
+ symlink(target: string, path: string): Promise<void>;
67
+ };
68
+ /**
69
+ * The subset of `node:fs` that the sync extraction uses. To read the
70
+ * archive from a file, it also uses `TarFSSync`.
71
+ */
72
+ export type ExtractFSSync = {
73
+ /** Without it, the flag of `openSync` is `'w'`. */
74
+ constants?: OpenConstants;
75
+ openSync(path: string, flags: string | number, mode: number): number;
76
+ writeSync(fd: number, data: Uint8Array): number;
77
+ futimesSync(fd: number, atime: Date, mtime: Date): void;
78
+ fchownSync(fd: number, uid: number, gid: number): void;
79
+ closeSync(fd: number): void;
80
+ statSync(path: string): {
81
+ isDirectory(): boolean;
82
+ };
83
+ lstatSync(path: string): ExtractStats;
84
+ mkdirSync(path: string, options: {
85
+ mode: number;
86
+ recursive?: boolean;
87
+ }): string | undefined;
88
+ chmodSync(path: string, mode: number): void;
89
+ chownSync(path: string, uid: number, gid: number): void;
90
+ lchownSync(path: string, uid: number, gid: number): void;
91
+ utimesSync(path: string, atime: Date, mtime: Date): void;
92
+ lutimesSync(path: string, atime: Date, mtime: Date): void;
93
+ rmdirSync(path: string): void;
94
+ unlinkSync(path: string): void;
95
+ renameSync(from: string, to: string): void;
96
+ linkSync(target: string, path: string): void;
97
+ symlinkSync(target: string, path: string): void;
98
+ };
99
+ /**
100
+ * The device number and the inode number of a file. With the option
101
+ * `bigint: true`, `node:fs` gives them as `bigint` values, which are
102
+ * exact. A `number` larger than `Number.MAX_SAFE_INTEGER` is not
103
+ * exact: two files can have the same value.
104
+ */
105
+ export type FileId = {
106
+ dev: number | bigint;
107
+ ino: number | bigint;
108
+ };
109
+ /** The option that asks for the exact `FileId` of a file. */
110
+ export type BigIntOption = {
111
+ bigint: true;
112
+ };
113
+ /** The subset of the `Stats` of `lstat` that the creation uses. */
114
+ export type CreateStats = {
115
+ isFile(): boolean;
116
+ isDirectory(): boolean;
117
+ isSymbolicLink(): boolean;
118
+ dev: number;
119
+ ino: number;
120
+ nlink: number;
121
+ mode: number;
122
+ uid: number;
123
+ gid: number;
124
+ size: number;
125
+ mtime: Date;
126
+ atime: Date;
127
+ ctime: Date;
128
+ };
129
+ /** The subset of a `FileHandle` that the creation uses. */
130
+ export type CreateFileHandle = {
131
+ read(buffer: Uint8Array, offset: number, length: number, position: number): Promise<{
132
+ bytesRead: number;
133
+ }>;
134
+ write(buffer: Uint8Array, offset: number, length: number, position: number): Promise<{
135
+ bytesWritten: number;
136
+ }>;
137
+ stat(): Promise<{
138
+ size: number;
139
+ dev: number;
140
+ ino: number;
141
+ }>;
142
+ close(): Promise<void>;
143
+ };
144
+ /**
145
+ * The subset of `node:fs/promises` that the creation uses. It also
146
+ * fits `TarFS`, which reads an `@archive` operand.
147
+ *
148
+ * The creation calls `lstat` (`stat` with `follow`) a second time,
149
+ * with the option `bigint: true`, only when the `dev` or `ino` number
150
+ * is not a safe integer, and only for a file with more than one link,
151
+ * or with `follow` for a directory. A function can ignore the option
152
+ * and return numbers.
153
+ */
154
+ export type CreateFS = {
155
+ open(path: string, flags: string, mode?: number): Promise<CreateFileHandle>;
156
+ lstat(path: string): Promise<CreateStats>;
157
+ lstat(path: string, options: BigIntOption): Promise<FileId>;
158
+ stat(path: string): Promise<CreateStats>;
159
+ stat(path: string, options: BigIntOption): Promise<FileId>;
160
+ readdir(path: string): Promise<string[]>;
161
+ readlink(path: string): Promise<string>;
162
+ };
163
+ /**
164
+ * The subset of `node:fs` that the sync creation uses. It also fits
165
+ * `TarFSSync`, which reads an `@archive` operand. The `bigint` option
166
+ * is used as in `CreateFS`.
167
+ */
168
+ export type CreateFSSync = {
169
+ openSync(path: string, flags: string, mode?: number): number;
170
+ fstatSync(fd: number): {
171
+ size: number;
172
+ dev: number;
173
+ ino: number;
174
+ };
175
+ readSync(fd: number, buffer: Uint8Array, offset: number, length: number, position: number): number;
176
+ writeSync(fd: number, buffer: Uint8Array, offset: number, length: number, position: number): number;
177
+ closeSync(fd: number): void;
178
+ lstatSync(path: string): CreateStats;
179
+ lstatSync(path: string, options: BigIntOption): FileId;
180
+ statSync(path: string): CreateStats;
181
+ statSync(path: string, options: BigIntOption): FileId;
182
+ readdirSync(path: string): string[];
183
+ readlinkSync(path: string): string;
184
+ };
185
+ /**
186
+ * The subset of `node:fs/promises` that `replace` and `update` use:
187
+ * `open` with the flags `'r+'`, `'w+'`, and `'r'`, the functions of a
188
+ * file handle, and the functions that read the files to add.
189
+ */
190
+ export type ReplaceFS = CreateFS;
191
+ /** The subset of `node:fs` that `replaceSync` and `updateSync` use. */
192
+ export type ReplaceFSSync = CreateFSSync;
193
+ /**
194
+ * The subset of `node:fs/promises` that `delete` uses: the functions
195
+ * that read and write an archive file, `stat`, `rename`, and
196
+ * `unlink`.
197
+ */
198
+ export type DeleteFS = TarFS & CreateFS & Pick<ExtractFS, 'rename' | 'unlink'>;
199
+ /** The subset of `node:fs` that `deleteSync` uses. */
200
+ export type DeleteFSSync = TarFSSync & CreateFSSync & Pick<ExtractFSSync, 'renameSync' | 'unlinkSync'>;
201
+ //# sourceMappingURL=fs.d.ts.map
@@ -0,0 +1,4 @@
1
+ // The file system functions that this package calls. `node:fs/promises`
2
+ // fits `TarFS`, and `node:fs` fits `TarFSSync`.
3
+ export {};
4
+ //# sourceMappingURL=fs.js.map
@@ -26,7 +26,7 @@ export declare class Header implements HeaderData {
26
26
  cksumValid: boolean;
27
27
  needPax: boolean;
28
28
  nullBlock: boolean;
29
- block?: Buffer;
29
+ block?: Uint8Array;
30
30
  path?: string;
31
31
  mode?: number;
32
32
  uid?: number;
@@ -43,9 +43,9 @@ export declare class Header implements HeaderData {
43
43
  mtime?: Date;
44
44
  charset?: string;
45
45
  comment?: string;
46
- constructor(data?: Buffer | HeaderData, off?: number, ex?: HeaderData, gex?: HeaderData);
47
- decode(buf: Buffer, off: number, ex?: HeaderData, gex?: HeaderData): void;
48
- encode(buf?: Buffer, off?: number): boolean;
46
+ constructor(data?: Uint8Array | HeaderData, off?: number, ex?: HeaderData, gex?: HeaderData);
47
+ decode(buf: Uint8Array, off: number, ex?: HeaderData, gex?: HeaderData): void;
48
+ encode(buf?: Uint8Array, off?: number): boolean;
49
49
  get type(): EntryTypeName;
50
50
  get typeKey(): EntryTypeCode | 'Unsupported';
51
51
  set type(type: EntryTypeCode | EntryTypeName | 'Unsupported');
@@ -2,8 +2,9 @@
2
2
  // encode returns `true` if a pax extended header is needed, because
3
3
  // the data could not be faithfully encoded in a simple header.
4
4
  // (Also, check header.needPax to see if it needs a pax header.)
5
- import { posix as pathModule } from 'node:path';
5
+ import { decodeUtf8, encodeUtf8Into, isUint8Array, utf8Length, writeAscii, } from './bytes.js';
6
6
  import * as large from './large-numbers.js';
7
+ import { basename, dirname, join } from './path.js';
7
8
  import * as types from './types.js';
8
9
  const notNegative = (n) => n === undefined || n < 0 ? undefined : n;
9
10
  export class Header {
@@ -29,7 +30,7 @@ export class Header {
29
30
  charset;
30
31
  comment;
31
32
  constructor(data, off = 0, ex, gex) {
32
- if (Buffer.isBuffer(data)) {
33
+ if (isUint8Array(data)) {
33
34
  this.decode(data, off || 0, ex, gex);
34
35
  }
35
36
  else if (data) {
@@ -43,18 +44,20 @@ export class Header {
43
44
  if (!buf || !(buf.length >= off + 512)) {
44
45
  throw new Error('need 512 bytes for header');
45
46
  }
46
- // Decode the typeflag (independent of any pending PAX/GNU extended header)
47
- // up front so we can tell whether THIS block is itself an intermediary
48
- // extension header (PAX `x`/`g`, GNU long-name `L`, GNU long-link `K`).
49
- // Per POSIX pax, a PAX extended header describes the *next file entry*, not
50
- // the extension headers that may sit between it and that file. Applying the
51
- // pending PAX overrides (notably `size`) to an intervening `L`/`K`/`x`/`g`
52
- // header desynchronizes the stream relative to other tar implementations
53
- // and enables tar interpretation-conflict / file-smuggling attacks.
47
+ // Decode the typeflag (independent of any pending PAX/GNU extended
48
+ // header) up front so we can tell whether THIS block is itself an
49
+ // intermediary extension header (PAX `x`/`g`, GNU long-name `L`,
50
+ // GNU long-link `K`). Per POSIX pax, a PAX extended header
51
+ // describes the *next file entry*, not the extension headers that
52
+ // may sit between it and that file. Applying the pending PAX
53
+ // overrides (notably `size`) to an intervening `L`/`K`/`x`/`g`
54
+ // header desynchronizes the stream relative to other tar
55
+ // implementations and enables tar interpretation-conflict /
56
+ // file-smuggling attacks.
54
57
  const t = decString(buf, off + 156, 1);
55
- const isNormalFS = types.normalFsTypes.has(t);
56
- const exForFields = isNormalFS ? ex : undefined;
57
- const gexForFields = isNormalFS ? gex : undefined;
58
+ const isMeta = /^[xgXLK]$/.test(t);
59
+ const exForFields = isMeta ? undefined : ex;
60
+ const gexForFields = isMeta ? undefined : gex;
58
61
  this.path = exForFields?.path ?? decString(buf, off, 100);
59
62
  this.mode =
60
63
  exForFields?.mode ??
@@ -64,9 +67,9 @@ export class Header {
64
67
  exForFields?.uid ?? gexForFields?.uid ?? decNumber(buf, off + 108, 8);
65
68
  this.gid =
66
69
  exForFields?.gid ?? gexForFields?.gid ?? decNumber(buf, off + 116, 8);
67
- this.size = notNegative(exForFields?.size ??
68
- gexForFields?.size ??
69
- decNumber(buf, off + 124, 12));
70
+ this.size = notNegative(
71
+ // A global header does not set a size.
72
+ exForFields?.size ?? decSize(buf, off + 124));
70
73
  this.mtime =
71
74
  exForFields?.mtime ??
72
75
  gexForFields?.mtime ??
@@ -96,8 +99,7 @@ export class Header {
96
99
  this.size = 0;
97
100
  }
98
101
  this.linkpath = decString(buf, off + 157, 100);
99
- if (buf.subarray(off + 257, off + 265).toString() === 'ustar\u000000') {
100
- /* c8 ignore start */
102
+ if (decodeUtf8(buf, off + 257, off + 265) === 'ustar\u000000') {
101
103
  this.uname =
102
104
  exForFields?.uname ??
103
105
  gexForFields?.uname ??
@@ -116,7 +118,6 @@ export class Header {
116
118
  gexForFields?.devmin ??
117
119
  decNumber(buf, off + 337, 8) ??
118
120
  0;
119
- /* c8 ignore stop */
120
121
  if (buf[off + 475] !== 0) {
121
122
  // definitely a prefix, definitely >130 chars.
122
123
  const prefix = decString(buf, off + 345, 155);
@@ -127,10 +128,8 @@ export class Header {
127
128
  if (prefix) {
128
129
  this.path = prefix + '/' + this.path;
129
130
  }
130
- /* c8 ignore start */
131
131
  this.atime = ex?.atime ?? gex?.atime ?? decDate(buf, off + 476, 12);
132
132
  this.ctime = ex?.ctime ?? gex?.ctime ?? decDate(buf, off + 488, 12);
133
- /* c8 ignore stop */
134
133
  }
135
134
  }
136
135
  let sum = 8 * 0x20;
@@ -147,12 +146,12 @@ export class Header {
147
146
  }
148
147
  #slurp(ex, gex = false) {
149
148
  Object.assign(this, Object.fromEntries(Object.entries(ex).filter(([k, v]) => {
150
- // we slurp in everything except for the path attribute in
151
- // a global extended header, because that's weird. Also, any
152
- // null/undefined values are ignored.
149
+ // A global extended header does not set a path, a
150
+ // linkpath, or a size. Also, any null/undefined values are
151
+ // ignored.
153
152
  return !(v === null ||
154
153
  v === undefined ||
155
- (k === 'size' && Number(v) < 0) ||
154
+ (k === 'size' && (gex || Number(v) < 0)) ||
156
155
  (k === 'path' && gex) ||
157
156
  (k === 'linkpath' && gex) ||
158
157
  k === 'global');
@@ -160,7 +159,7 @@ export class Header {
160
159
  }
161
160
  encode(buf, off = 0) {
162
161
  if (!buf) {
163
- buf = this.block = Buffer.alloc(512);
162
+ buf = this.block = new Uint8Array(512);
164
163
  }
165
164
  if (this.#type === 'Unsupported') {
166
165
  this.#type = '0';
@@ -182,7 +181,7 @@ export class Header {
182
181
  buf[off + 156] = Number(this.#type.codePointAt(0));
183
182
  this.needPax =
184
183
  encString(buf, off + 157, 100, this.linkpath) || this.needPax;
185
- buf.write('ustar\u000000', off + 257, 8);
184
+ writeAscii('ustar\u000000', buf, off + 257);
186
185
  this.needPax =
187
186
  encString(buf, off + 265, 32, this.uname) || this.needPax;
188
187
  this.needPax =
@@ -241,29 +240,28 @@ const splitPrefix = (p, prefixSize) => {
241
240
  let pp = p;
242
241
  let prefix = '';
243
242
  let ret = undefined;
244
- const root = pathModule.parse(p).root || '.';
245
- if (Buffer.byteLength(pp) < pathSize) {
243
+ const root = p.charAt(0) === '/' ? '/' : '.';
244
+ if (utf8Length(pp) < pathSize) {
246
245
  ret = [pp, prefix, false];
247
246
  }
248
247
  else {
249
248
  // first set prefix to the dir, and path to the base
250
- prefix = pathModule.dirname(pp);
251
- pp = pathModule.basename(pp);
249
+ prefix = dirname(pp);
250
+ pp = basename(pp);
252
251
  do {
253
- if (Buffer.byteLength(pp) <= pathSize &&
254
- Buffer.byteLength(prefix) <= prefixSize) {
252
+ if (utf8Length(pp) <= pathSize && utf8Length(prefix) <= prefixSize) {
255
253
  // both fit!
256
254
  ret = [pp, prefix, false];
257
255
  }
258
- else if (Buffer.byteLength(pp) > pathSize &&
259
- Buffer.byteLength(prefix) <= prefixSize) {
256
+ else if (utf8Length(pp) > pathSize &&
257
+ utf8Length(prefix) <= prefixSize) {
260
258
  // prefix fits in prefix, but path doesn't fit in path
261
259
  ret = [pp.slice(0, pathSize - 1), prefix, true];
262
260
  }
263
261
  else {
264
262
  // make path take a bit from prefix
265
- pp = pathModule.join(pathModule.basename(prefix), pp);
266
- prefix = pathModule.dirname(prefix);
263
+ pp = join(basename(prefix), pp);
264
+ prefix = dirname(prefix);
267
265
  }
268
266
  } while (prefix !== root && ret === undefined);
269
267
  // at this point, found no resolution, just truncate
@@ -273,21 +271,43 @@ const splitPrefix = (p, prefixSize) => {
273
271
  }
274
272
  return ret;
275
273
  };
276
- const decString = (buf, off, size) => buf
277
- .subarray(off, off + size)
278
- .toString('utf8')
279
- .replace(/\0.*/, '');
274
+ // The string ends at the first NUL, or at the end of the field.
275
+ const decString = (buf, off, size) => {
276
+ let end = off;
277
+ const max = Math.min(off + size, buf.length);
278
+ while (end < max && buf[end] !== 0)
279
+ end++;
280
+ return decodeUtf8(buf, off, end);
281
+ };
280
282
  const decDate = (buf, off, size) => numToDate(decNumber(buf, off, size));
281
283
  const numToDate = (num) => num === undefined ? undefined : new Date(num * 1000);
282
284
  const decNumber = (buf, off, size) => Number(buf[off]) & 0x80 ?
283
- large.parse(buf.subarray(off, off + size))
285
+ decLarge(buf.subarray(off, off + size))
284
286
  : decSmallNumber(buf, off, size);
287
+ // A base-256 field that is not valid has no value.
288
+ const decLarge = (buf) => {
289
+ try {
290
+ return large.parse(buf);
291
+ }
292
+ catch {
293
+ return undefined;
294
+ }
295
+ };
296
+ // The size sets where the next header is. Other tar programs read a
297
+ // field that is not only octal digits in different ways, so such a
298
+ // field has no value. A field with no digits is 0.
299
+ const decSize = (buf, off) => {
300
+ if (Number(buf[off]) & 0x80)
301
+ return decNumber(buf, off, 12);
302
+ const s = decString(buf, off, 12);
303
+ // No byte after the first NUL has a value.
304
+ return (/^ *[0-7]* *$/.test(s) &&
305
+ buf.subarray(off + s.length, off + 12).every(b => b === 0)) ?
306
+ parseInt(s, 8) || 0
307
+ : undefined;
308
+ };
285
309
  const nanUndef = (value) => (isNaN(value) ? undefined : value);
286
- const decSmallNumber = (buf, off, size) => nanUndef(parseInt(buf
287
- .subarray(off, off + size)
288
- .toString('utf8')
289
- .replace(/\0.*$/, '')
290
- .trim(), 8));
310
+ const decSmallNumber = (buf, off, size) => nanUndef(parseInt(decString(buf, off, size).trim(), 8));
291
311
  // the maximum encodable as a null-terminated octal, by field size
292
312
  const MAXNUM = {
293
313
  12: 0o77777777777,
@@ -297,15 +317,13 @@ const encNumber = (buf, off, size, num) => num === undefined ? false
297
317
  : num > MAXNUM[size] || num < 0 ?
298
318
  (large.encode(num, buf.subarray(off, off + size)), true)
299
319
  : (encSmallNumber(buf, off, size, num), false);
300
- const encSmallNumber = (buf, off, size, num) => buf.write(octalString(num, size), off, size, 'ascii');
320
+ const encSmallNumber = (buf, off, size, num) => writeAscii(octalString(num, size), buf, off);
301
321
  const octalString = (num, size) => padOctal(Math.floor(num).toString(8), size);
302
322
  const padOctal = (str, size) => (str.length === size - 1 ?
303
323
  str
304
- : new Array(size - str.length - 1).join('0') + str + ' ') + '\0';
324
+ : '0'.repeat(size - str.length - 2) + str + ' ') + '\0';
305
325
  const encDate = (buf, off, size, date) => date === undefined ? false : (encNumber(buf, off, size, date.getTime() / 1000));
306
- // enough to fill the longest string we've got
307
- const NULLS = new Array(156).join('\0');
308
326
  // pad with nulls, return true if it's longer or non-ascii
309
- const encString = (buf, off, size, str) => str === undefined ? false : ((buf.write(str + NULLS, off, size, 'utf8'),
310
- str.length !== Buffer.byteLength(str) || str.length > size));
327
+ const encString = (buf, off, size, str) => str === undefined ? false : ((encodeUtf8Into(str, buf, off, size),
328
+ str.length !== utf8Length(str) || str.length > size));
311
329
  //# sourceMappingURL=header.js.map
@@ -1,20 +1,27 @@
1
- export { type TarOptionsWithAliasesAsync, type TarOptionsWithAliasesAsyncFile, type TarOptionsWithAliasesAsyncNoFile, type TarOptionsWithAliasesSyncNoFile, type TarOptionsWithAliases, type TarOptionsWithAliasesFile, type TarOptionsWithAliasesSync, type TarOptionsWithAliasesSyncFile, } from './options.js';
2
- export * from './create.js';
3
- export { create as c } from './create.js';
4
- export * from './extract.js';
5
- export { extract as x } from './extract.js';
6
- export * from './header.js';
7
- export * from './list.js';
8
- export { list as t } from './list.js';
9
- export * from './pack.js';
10
- export * from './parse.js';
11
- export * from './pax.js';
12
- export * from './read-entry.js';
13
- export * from './replace.js';
14
- export { replace as r } from './replace.js';
1
+ export { Header, type HeaderData } from './header.js';
2
+ export { Pax } from './pax.js';
15
3
  export * as types from './types.js';
16
- export * from './unpack.js';
17
- export * from './update.js';
18
- export { update as u } from './update.js';
19
- export * from './write-entry.js';
4
+ export { gzip, type Codec, type CodecStream } from './codec.js';
5
+ export { create, create as c } from './create.js';
6
+ export { delete } from './delete.js';
7
+ export { CwdError } from './cwd-error.js';
8
+ export { aliases } from './dealias.js';
9
+ export type { Aliased, Aliases, AliasOf, FileOption, NoFileOption, RequiredOption, WithAliases, } from './dealias.js';
10
+ export { entries, EntryCursor, TarReader } from './entries.js';
11
+ export { extract, extract as x } from './extract.js';
12
+ export type * from './fs.js';
13
+ export { list, list as t } from './list.js';
14
+ export type { MkdirOptions } from './mkdir.js';
15
+ export type * from './options.js';
16
+ export { Pack, PackBase, PackJob, type Ancestor, type QueueNode, type PackInput, type PackInputSync, type PackLoad, } from './pack.js';
17
+ export { Parser, type CreateEntry, type ParseEvent } from './parser.js';
18
+ export { PathReservations } from './path-reservations.js';
19
+ export { EntryData, ReadEntry, type BodySource, type BodySourceSync, } from './read-entry.js';
20
+ export { AppendScan, replace, replace as r } from './replace.js';
21
+ export { SymlinkError } from './symlink-error.js';
22
+ export { Unpack, UnpackBase, type UnpackBaseOptions } from './unpack.js';
23
+ export { update, update as u } from './update.js';
24
+ export type { TarError, WarnData, WarnOptions } from './warn.js';
25
+ export { WriteEntry, type EncodeOptions, type WriteBody, type WriteEntryData, } from './write-entry.js';
26
+ export type { OpenConstants } from './write-flag.js';
20
27
  //# sourceMappingURL=index.d.ts.map
@@ -1,20 +1,25 @@
1
- export * from './create.js';
2
- export { create as c } from './create.js';
3
- export * from './extract.js';
4
- export { extract as x } from './extract.js';
5
- export * from './header.js';
6
- export * from './list.js';
7
- export { list as t } from './list.js';
8
- // classes
9
- export * from './pack.js';
10
- export * from './parse.js';
11
- export * from './pax.js';
12
- export * from './read-entry.js';
13
- export * from './replace.js';
14
- export { replace as r } from './replace.js';
1
+ // The entry point for each runtime. It reads no file system and no
2
+ // process state: the caller gives them in the options. The entry
3
+ // point `server/index.ts` fills in those options, and adds the sync
4
+ // commands.
5
+ export { Header } from './header.js';
6
+ export { Pax } from './pax.js';
15
7
  export * as types from './types.js';
16
- export * from './unpack.js';
17
- export * from './update.js';
18
- export { update as u } from './update.js';
19
- export * from './write-entry.js';
8
+ export { gzip } from './codec.js';
9
+ export { create, create as c } from './create.js';
10
+ export { delete } from './delete.js';
11
+ export { CwdError } from './cwd-error.js';
12
+ export { aliases } from './dealias.js';
13
+ export { entries, EntryCursor, TarReader } from './entries.js';
14
+ export { extract, extract as x } from './extract.js';
15
+ export { list, list as t } from './list.js';
16
+ export { Pack, PackBase, PackJob, } from './pack.js';
17
+ export { Parser } from './parser.js';
18
+ export { PathReservations } from './path-reservations.js';
19
+ export { EntryData, ReadEntry, } from './read-entry.js';
20
+ export { AppendScan, replace, replace as r } from './replace.js';
21
+ export { SymlinkError } from './symlink-error.js';
22
+ export { Unpack, UnpackBase } from './unpack.js';
23
+ export { update, update as u } from './update.js';
24
+ export { WriteEntry, } from './write-entry.js';
20
25
  //# sourceMappingURL=index.js.map