@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
@@ -1,36 +1,122 @@
1
- import { Minipass } from 'minipass';
2
1
  import type { Header } from './header.js';
3
2
  import type { Pax } from './pax.js';
4
3
  import type { EntryTypeName } from './types.js';
5
- export declare class ReadEntry extends Minipass<Buffer, Buffer> {
4
+ /**
5
+ * The metadata of one archive entry: the header fields, with the
6
+ * values of the PAX and GNU extended headers applied.
7
+ */
8
+ export declare class EntryData {
6
9
  #private;
10
+ /** The header block of the entry. */
11
+ header: Header;
12
+ /** The PAX header that applies to this entry only. */
7
13
  extended?: Pax;
14
+ /** The global PAX header in effect. */
8
15
  globalExtended?: Pax;
9
- header: Header;
10
- startBlockSize: number;
11
- blockRemain: number;
12
- remain: number;
13
16
  type: EntryTypeName;
14
- meta: boolean;
15
- ignore: boolean;
16
17
  path: string;
18
+ /** The permission bits only. */
17
19
  mode?: number;
18
20
  uid?: number;
19
21
  gid?: number;
20
22
  uname?: string;
21
23
  gname?: string;
24
+ /** The number of bytes in the body. */
22
25
  size: number;
23
26
  mtime?: Date;
24
27
  atime?: Date;
25
28
  ctime?: Date;
26
29
  linkpath?: string;
30
+ devmaj: number;
31
+ devmin: number;
27
32
  dev?: number;
28
33
  ino?: number;
29
34
  nlink?: number;
30
- invalid: boolean;
35
+ /** The absolute path of the entry, when a consumer resolves it. */
31
36
  absolute?: string;
37
+ /**
38
+ * The body is skipped. Set for a type that is not an object of the
39
+ * file system, and for an entry that the filter refuses.
40
+ */
41
+ ignore: boolean;
42
+ /** A consumer sets this when it refuses the entry. */
43
+ invalid: boolean;
44
+ /** A consumer sets this when it does not support the type. */
32
45
  unsupported: boolean;
33
- constructor(header: Header, ex?: Pax, gex?: Pax);
34
- write(data: Buffer): boolean;
46
+ /**
47
+ * @param win32 change each `\` in `path` and `linkpath` to `/`
48
+ */
49
+ constructor(header: Header, ex?: Pax, gex?: Pax, win32?: boolean);
50
+ }
51
+ /** Where a `ReadEntry` gets its body. */
52
+ export type BodySource = {
53
+ /**
54
+ * The next part of the body of `entry`. `null` at the end of the
55
+ * body. `undefined` if more input is needed: then await `fill()`
56
+ * and call this again. Throws if the source moved to a later entry.
57
+ */
58
+ readBody(entry: ReadEntry): Uint8Array | null | undefined;
59
+ /** Read more input. */
60
+ fill(): Promise<void>;
61
+ };
62
+ /** Where a `ReadEntrySync` gets its body. */
63
+ export type BodySourceSync = {
64
+ /**
65
+ * The next part of the body of `entry`, or `null` at the end of the
66
+ * body. Throws if the source moved to a later entry.
67
+ */
68
+ readBody(entry: ReadEntrySync): Uint8Array | null;
69
+ };
70
+ /**
71
+ * An archive entry with its body, in the shape of a `Response`. The
72
+ * body can be consumed one time, in one way. It must be consumed
73
+ * before the next entry is read: after that, the rest of it is gone.
74
+ */
75
+ export declare class ReadEntry extends EntryData {
76
+ #private;
77
+ constructor(header: Header, ex?: Pax, gex?: Pax, win32?: boolean, source?: BodySource);
78
+ /** True when the body started to be consumed. */
79
+ get bodyUsed(): boolean;
80
+ /**
81
+ * The body as a stream. Each chunk is a view into the input, not a
82
+ * copy. Input is read only when the stream is read.
83
+ */
84
+ get body(): ReadableStream<Uint8Array>;
85
+ /** The body in a new `Uint8Array`. */
86
+ bytes(): Promise<Uint8Array<ArrayBuffer>>;
87
+ /** The body in a new `ArrayBuffer`. */
88
+ arrayBuffer(): Promise<ArrayBuffer>;
89
+ /**
90
+ * The body, decoded as UTF-8. As with `Response.text()`, a byte
91
+ * order mark at the start is not in the text.
92
+ */
93
+ text(): Promise<string>;
94
+ /** The body in a new `Blob`. */
95
+ blob(): Promise<Blob>;
96
+ }
97
+ /**
98
+ * An archive entry with its body, for sync code. The body can be
99
+ * consumed one time, in one way. It must be consumed before the next
100
+ * entry is read: after that, the rest of it is gone.
101
+ */
102
+ export declare class ReadEntrySync extends EntryData {
103
+ #private;
104
+ constructor(header: Header, ex?: Pax, gex?: Pax, win32?: boolean, source?: BodySourceSync);
105
+ /** True when the body started to be consumed. */
106
+ get bodyUsed(): boolean;
107
+ /**
108
+ * The parts of the body. Each one is a view into the input, not a
109
+ * copy. Input is read only when the iterator is read.
110
+ */
111
+ get body(): IterableIterator<Uint8Array>;
112
+ /** The body in a new `Uint8Array`. */
113
+ bytes(): Uint8Array<ArrayBuffer>;
114
+ /** The body in a new `ArrayBuffer`. */
115
+ arrayBuffer(): ArrayBuffer;
116
+ /**
117
+ * The body, decoded as UTF-8. A byte order mark at the start is not
118
+ * in the text.
119
+ */
120
+ text(): string;
35
121
  }
36
122
  //# sourceMappingURL=read-entry.d.ts.map
@@ -1,132 +1,284 @@
1
- import { Minipass } from 'minipass';
2
- import { normalizeWindowsPath } from './normalize-windows-path.js';
3
- export class ReadEntry extends Minipass {
1
+ import { concat } from './concat.js';
2
+ // The types that are an object of the file system.
3
+ const fsTypes = new Set([
4
+ 'File',
5
+ 'OldFile',
6
+ 'Link',
7
+ 'SymbolicLink',
8
+ 'CharacterDevice',
9
+ 'BlockDevice',
10
+ 'Directory',
11
+ 'FIFO',
12
+ 'ContiguousFile',
13
+ 'GNUDumpDir',
14
+ ]);
15
+ const winPath = (path) => path.replaceAll('\\', '/');
16
+ /**
17
+ * The metadata of one archive entry: the header fields, with the
18
+ * values of the PAX and GNU extended headers applied.
19
+ */
20
+ export class EntryData {
21
+ /** The header block of the entry. */
22
+ header;
23
+ /** The PAX header that applies to this entry only. */
4
24
  extended;
25
+ /** The global PAX header in effect. */
5
26
  globalExtended;
6
- header;
7
- startBlockSize;
8
- blockRemain;
9
- remain;
10
27
  type;
11
- meta = false;
12
- ignore = false;
13
28
  path;
29
+ /** The permission bits only. */
14
30
  mode;
15
31
  uid;
16
32
  gid;
17
33
  uname;
18
34
  gname;
19
- size = 0;
35
+ /** The number of bytes in the body. */
36
+ size;
20
37
  mtime;
21
38
  atime;
22
39
  ctime;
23
40
  linkpath;
41
+ devmaj;
42
+ devmin;
24
43
  dev;
25
44
  ino;
26
45
  nlink;
27
- invalid = false;
46
+ /** The absolute path of the entry, when a consumer resolves it. */
28
47
  absolute;
48
+ /**
49
+ * The body is skipped. Set for a type that is not an object of the
50
+ * file system, and for an entry that the filter refuses.
51
+ */
52
+ ignore;
53
+ /** A consumer sets this when it refuses the entry. */
54
+ invalid = false;
55
+ /** A consumer sets this when it does not support the type. */
29
56
  unsupported = false;
30
- constructor(header, ex, gex) {
31
- super({});
32
- // read entries always start life paused. this is to avoid the
33
- // situation where Minipass's auto-ending empty streams results
34
- // in an entry ending before we're ready for it.
35
- this.pause();
36
- this.extended = ex;
37
- this.globalExtended = gex;
38
- this.header = header;
39
- /* c8 ignore start */
40
- this.remain = header.size ?? 0;
41
- /* c8 ignore stop */
42
- this.startBlockSize = 512 * Math.ceil(this.remain / 512);
43
- this.blockRemain = this.startBlockSize;
44
- this.type = header.type;
45
- switch (this.type) {
46
- case 'File':
47
- case 'OldFile':
48
- case 'Link':
49
- case 'SymbolicLink':
50
- case 'CharacterDevice':
51
- case 'BlockDevice':
52
- case 'Directory':
53
- case 'FIFO':
54
- case 'ContiguousFile':
55
- case 'GNUDumpDir':
56
- break;
57
- case 'NextFileHasLongLinkpath':
58
- case 'NextFileHasLongPath':
59
- case 'OldGnuLongPath':
60
- case 'GlobalExtendedHeader':
61
- case 'ExtendedHeader':
62
- case 'OldExtendedHeader':
63
- this.meta = true;
64
- break;
65
- // NOTE: gnutar and bsdtar treat unrecognized types as 'File'
66
- // it may be worth doing the same, but with a warning.
67
- default:
68
- this.ignore = true;
69
- }
70
- /* c8 ignore start */
57
+ /**
58
+ * @param win32 change each `\` in `path` and `linkpath` to `/`
59
+ */
60
+ constructor(header, ex, gex, win32 = false) {
71
61
  if (!header.path) {
72
62
  throw new Error('no path provided for tar.ReadEntry');
73
63
  }
74
- /* c8 ignore stop */
75
- this.path = normalizeWindowsPath(header.path);
76
- this.mode = header.mode;
77
- if (this.mode) {
78
- this.mode = this.mode & 0o7777;
79
- }
64
+ this.header = header;
65
+ this.extended = ex;
66
+ this.globalExtended = gex;
67
+ this.type = header.type;
68
+ this.ignore = !fsTypes.has(this.type);
69
+ this.path = win32 ? winPath(header.path) : header.path;
70
+ this.mode = header.mode && header.mode & 0o7777;
80
71
  this.uid = header.uid;
81
72
  this.gid = header.gid;
82
73
  this.uname = header.uname;
83
74
  this.gname = header.gname;
84
- this.size = this.remain;
75
+ this.size = header.size ?? 0;
85
76
  this.mtime = header.mtime;
86
77
  this.atime = header.atime;
87
78
  this.ctime = header.ctime;
88
- /* c8 ignore start */
79
+ // Only a link has a linkpath. Other tar programs do not use the
80
+ // link name of an entry of a different type.
81
+ const link = this.type === 'Link' || this.type === 'SymbolicLink';
89
82
  this.linkpath =
90
- header.linkpath ? normalizeWindowsPath(header.linkpath) : undefined;
91
- /* c8 ignore stop */
92
- this.uname = header.uname;
93
- this.gname = header.gname;
83
+ link && header.linkpath ?
84
+ win32 ? winPath(header.linkpath)
85
+ : header.linkpath
86
+ : undefined;
87
+ this.devmaj = header.devmaj;
88
+ this.devmin = header.devmin;
89
+ // Apply the global values first, so that the local values win.
90
+ // The header already has the size.
91
+ if (gex)
92
+ this.#apply(gex);
94
93
  if (ex) {
95
- this.#slurp(ex);
96
- }
97
- if (gex) {
98
- this.#slurp(gex, true);
94
+ this.#apply(ex);
95
+ // A global header does not set a path or a linkpath.
96
+ if (ex.path != null)
97
+ this.path = win32 ? winPath(ex.path) : ex.path;
98
+ if (link && ex.linkpath != null) {
99
+ this.linkpath = win32 ? winPath(ex.linkpath) : ex.linkpath;
100
+ }
99
101
  }
100
102
  }
101
- write(data) {
102
- const writeLen = data.length;
103
- if (writeLen > this.blockRemain) {
104
- throw new Error('writing more to entry than is appropriate');
105
- }
106
- const r = this.remain;
107
- const br = this.blockRemain;
108
- this.remain = Math.max(0, r - writeLen);
109
- this.blockRemain = Math.max(0, br - writeLen);
110
- if (this.ignore) {
111
- return true;
112
- }
113
- if (r >= writeLen) {
114
- return super.write(data);
103
+ #apply(ex) {
104
+ if (ex.uid != null)
105
+ this.uid = ex.uid;
106
+ if (ex.gid != null)
107
+ this.gid = ex.gid;
108
+ if (ex.uname != null)
109
+ this.uname = ex.uname;
110
+ if (ex.gname != null)
111
+ this.gname = ex.gname;
112
+ if (ex.mtime != null)
113
+ this.mtime = ex.mtime;
114
+ if (ex.atime != null)
115
+ this.atime = ex.atime;
116
+ if (ex.ctime != null)
117
+ this.ctime = ex.ctime;
118
+ if (ex.dev != null)
119
+ this.dev = ex.dev;
120
+ if (ex.ino != null)
121
+ this.ino = ex.ino;
122
+ if (ex.nlink != null)
123
+ this.nlink = ex.nlink;
124
+ }
125
+ }
126
+ // As `Response.text()` does, this decoder removes a byte order mark
127
+ // at the start of the body.
128
+ const decoder = new TextDecoder();
129
+ const decode = (parts) => {
130
+ let text = '';
131
+ for (const part of parts)
132
+ text += decoder.decode(part, { stream: true });
133
+ return text + decoder.decode();
134
+ };
135
+ const usedError = () => new TypeError('Body has already been consumed');
136
+ /**
137
+ * An archive entry with its body, in the shape of a `Response`. The
138
+ * body can be consumed one time, in one way. It must be consumed
139
+ * before the next entry is read: after that, the rest of it is gone.
140
+ */
141
+ export class ReadEntry extends EntryData {
142
+ #source;
143
+ #used = false;
144
+ #stream;
145
+ constructor(header, ex, gex, win32, source) {
146
+ super(header, ex, gex, win32);
147
+ this.#source = source;
148
+ }
149
+ /** True when the body started to be consumed. */
150
+ get bodyUsed() {
151
+ return this.#used;
152
+ }
153
+ /**
154
+ * The body as a stream. Each chunk is a view into the input, not a
155
+ * copy. Input is read only when the stream is read.
156
+ */
157
+ get body() {
158
+ if (this.#stream)
159
+ return this.#stream;
160
+ let started = false;
161
+ return (this.#stream = new ReadableStream({
162
+ pull: async (controller) => {
163
+ if (!started) {
164
+ this.#claim();
165
+ started = true;
166
+ }
167
+ const [part] = await this.#read(1);
168
+ if (part)
169
+ controller.enqueue(part);
170
+ else
171
+ controller.close();
172
+ },
173
+ }, { highWaterMark: 0 }));
174
+ }
175
+ #claim() {
176
+ if (this.#used)
177
+ throw usedError();
178
+ this.#used = true;
179
+ }
180
+ // Add the parts of the body that are in memory to `parts`, up to
181
+ // `max` parts. False if the body has more parts that need input.
182
+ #collect(parts, max = Infinity) {
183
+ const source = this.#source;
184
+ while (source && parts.length < max) {
185
+ const part = source.readBody(this);
186
+ if (part === null)
187
+ break;
188
+ if (part === undefined)
189
+ return false;
190
+ parts.push(part);
115
191
  }
116
- // r < writeLen
117
- return super.write(data.subarray(0, r));
118
- }
119
- #slurp(ex, gex = false) {
120
- if (ex.path)
121
- ex.path = normalizeWindowsPath(ex.path);
122
- if (ex.linkpath)
123
- ex.linkpath = normalizeWindowsPath(ex.linkpath);
124
- Object.assign(this, Object.fromEntries(Object.entries(ex).filter(([k, v]) => {
125
- // we slurp in everything except for the path attribute in
126
- // a global extended header, because that's weird. Also, any
127
- // null/undefined values are ignored.
128
- return !(v === null || v === undefined || (k === 'path' && gex));
129
- })));
192
+ return true;
193
+ }
194
+ // Read all the parts of the body that are left, or `max` of them.
195
+ async #read(max) {
196
+ const parts = [];
197
+ while (!this.#collect(parts, max))
198
+ await this.#source?.fill();
199
+ return parts;
200
+ }
201
+ /** The body in a new `Uint8Array`. */
202
+ async bytes() {
203
+ this.#claim();
204
+ const parts = [];
205
+ while (!this.#collect(parts))
206
+ await this.#source?.fill();
207
+ return concat(parts);
208
+ }
209
+ /** The body in a new `ArrayBuffer`. */
210
+ async arrayBuffer() {
211
+ return (await this.bytes()).buffer;
212
+ }
213
+ /**
214
+ * The body, decoded as UTF-8. As with `Response.text()`, a byte
215
+ * order mark at the start is not in the text.
216
+ */
217
+ async text() {
218
+ this.#claim();
219
+ return decode(await this.#read());
220
+ }
221
+ /** The body in a new `Blob`. */
222
+ async blob() {
223
+ this.#claim();
224
+ return new Blob((await this.#read()));
225
+ }
226
+ }
227
+ /**
228
+ * An archive entry with its body, for sync code. The body can be
229
+ * consumed one time, in one way. It must be consumed before the next
230
+ * entry is read: after that, the rest of it is gone.
231
+ */
232
+ export class ReadEntrySync extends EntryData {
233
+ #source;
234
+ #used = false;
235
+ #body;
236
+ constructor(header, ex, gex, win32, source) {
237
+ super(header, ex, gex, win32);
238
+ this.#source = source;
239
+ }
240
+ /** True when the body started to be consumed. */
241
+ get bodyUsed() {
242
+ return this.#used;
243
+ }
244
+ /**
245
+ * The parts of the body. Each one is a view into the input, not a
246
+ * copy. Input is read only when the iterator is read.
247
+ */
248
+ get body() {
249
+ return (this.#body ??= this.#iterate());
250
+ }
251
+ *#iterate() {
252
+ this.#claim();
253
+ for (let part; (part = this.#source?.readBody(this));)
254
+ yield part;
255
+ }
256
+ #claim() {
257
+ if (this.#used)
258
+ throw usedError();
259
+ this.#used = true;
260
+ }
261
+ #read() {
262
+ this.#claim();
263
+ const parts = [];
264
+ for (let part; (part = this.#source?.readBody(this));)
265
+ parts.push(part);
266
+ return parts;
267
+ }
268
+ /** The body in a new `Uint8Array`. */
269
+ bytes() {
270
+ return concat(this.#read());
271
+ }
272
+ /** The body in a new `ArrayBuffer`. */
273
+ arrayBuffer() {
274
+ return this.bytes().buffer;
275
+ }
276
+ /**
277
+ * The body, decoded as UTF-8. A byte order mark at the start is not
278
+ * in the text.
279
+ */
280
+ text() {
281
+ return decode(this.#read());
130
282
  }
131
283
  }
132
284
  //# sourceMappingURL=read-entry.js.map
@@ -0,0 +1,22 @@
1
+ import type { TarFS, TarFSSync } from './fs.js';
2
+ /**
3
+ * The key of the method of a chunk source that skips input. A
4
+ * `TarReader` calls it with the number of bytes of a body that are
5
+ * after the chunks given so far, when no consumer reads that body.
6
+ * If it returns true, the next chunk starts after those bytes.
7
+ */
8
+ export declare const SKIP: unique symbol;
9
+ /** A chunk source that can skip input. */
10
+ export type Skip = {
11
+ [SKIP](n: number): boolean;
12
+ };
13
+ /**
14
+ * Read a file in chunks of `maxReadSize` bytes at most. The default,
15
+ * and the value for 0, is 16 MiB. Each chunk is a new array. The
16
+ * first chunk is small, and the chunks grow. A reader can skip a
17
+ * large part of the file.
18
+ */
19
+ export declare const readFile: (fs: TarFS, file: string, maxReadSize?: number) => AsyncGenerator<Uint8Array, void, void> & Skip;
20
+ /** The sync form of `readFile`. */
21
+ export declare const readFileSync: (fs: TarFSSync, file: string, maxReadSize?: number) => Generator<Uint8Array, void, void> & Skip;
22
+ //# sourceMappingURL=read-file.d.ts.map
@@ -0,0 +1,99 @@
1
+ import { countOption } from './options.js';
2
+ const MAX_READ = 16 * 1024 * 1024;
3
+ // The size of the first read, and of the read after a skip.
4
+ const FIRST_READ = 64 * 1024;
5
+ // A skip of fewer bytes than this is slower than a read of them.
6
+ const MIN_SKIP = 1024 * 1024;
7
+ /**
8
+ * The key of the method of a chunk source that skips input. A
9
+ * `TarReader` calls it with the number of bytes of a body that are
10
+ * after the chunks given so far, when no consumer reads that body.
11
+ * If it returns true, the next chunk starts after those bytes.
12
+ */
13
+ export const SKIP = Symbol.for('tar.readFile.skip');
14
+ // The place and the size of the next read of a file.
15
+ class Plan {
16
+ pos = 0;
17
+ /** The size of the file. 0 before the file is open. */
18
+ size = 0;
19
+ #max;
20
+ #want = FIRST_READ;
21
+ constructor(maxReadSize) {
22
+ this.#max = countOption('maxReadSize', maxReadSize, MAX_READ);
23
+ }
24
+ // The number of bytes to read at `pos`. 0 at the end of the file.
25
+ // Each read is two times the size of the read before it, so that
26
+ // an archive of small entries is read in few reads.
27
+ next() {
28
+ const n = Math.min(this.#want, this.#max, this.size - this.pos);
29
+ this.#want *= 2;
30
+ return n;
31
+ }
32
+ // Skip only inside the file: the parser must see where a truncated
33
+ // file ends. The read after a skip is small, because a header
34
+ // comes next, and the body after it can be skipped also.
35
+ skip(n) {
36
+ if (n < MIN_SKIP || this.pos + n > this.size)
37
+ return false;
38
+ this.pos += n;
39
+ this.#want = FIRST_READ;
40
+ return true;
41
+ }
42
+ }
43
+ async function* chunks(fs, file, plan) {
44
+ const handle = await fs.open(file, 'r');
45
+ try {
46
+ plan.size = (await handle.stat()).size;
47
+ for (let n; (n = plan.next());) {
48
+ const buf = new Uint8Array(n);
49
+ const { bytesRead } = await handle.read(buf, 0, n, plan.pos);
50
+ if (!bytesRead)
51
+ break;
52
+ plan.pos += bytesRead;
53
+ yield bytesRead < n ? buf.subarray(0, bytesRead) : buf;
54
+ }
55
+ }
56
+ finally {
57
+ await handle.close().catch(() => { });
58
+ }
59
+ }
60
+ function* chunksSync(fs, file, plan) {
61
+ const fd = fs.openSync(file, 'r');
62
+ try {
63
+ plan.size = fs.fstatSync(fd).size;
64
+ for (let n; (n = plan.next());) {
65
+ const buf = new Uint8Array(n);
66
+ const bytesRead = fs.readSync(fd, buf, 0, n, plan.pos);
67
+ if (!bytesRead)
68
+ break;
69
+ plan.pos += bytesRead;
70
+ yield bytesRead < n ? buf.subarray(0, bytesRead) : buf;
71
+ }
72
+ }
73
+ finally {
74
+ try {
75
+ fs.closeSync(fd);
76
+ }
77
+ catch { }
78
+ }
79
+ }
80
+ /**
81
+ * Read a file in chunks of `maxReadSize` bytes at most. The default,
82
+ * and the value for 0, is 16 MiB. Each chunk is a new array. The
83
+ * first chunk is small, and the chunks grow. A reader can skip a
84
+ * large part of the file.
85
+ */
86
+ export const readFile = (fs, file, maxReadSize) => {
87
+ const plan = new Plan(maxReadSize);
88
+ return Object.assign(chunks(fs, file, plan), {
89
+ [SKIP]: (n) => plan.skip(n),
90
+ });
91
+ };
92
+ /** The sync form of `readFile`. */
93
+ export const readFileSync = (fs, file, maxReadSize) => {
94
+ const plan = new Plan(maxReadSize);
95
+ return Object.assign(chunksSync(fs, file, plan), {
96
+ [SKIP]: (n) => plan.skip(n),
97
+ });
98
+ };
99
+ //# sourceMappingURL=read-file.js.map
@@ -1,2 +1,46 @@
1
- export declare const replace: import("./make-command.js").TarCommand<never, never>;
1
+ import { type Codec } from './codec.js';
2
+ import { type WithAliases } from './dealias.js';
3
+ import type { ReplaceOptions, ReplaceOptionsSync } from './options.js';
4
+ import type { PackInput, PackInputSync } from './pack.js';
5
+ /**
6
+ * Finds the place in an archive file where new entries go: the end
7
+ * of the last complete entry before the first block that is not a
8
+ * valid header. A PAX or GNU header with no entry after it is not a
9
+ * complete entry.
10
+ *
11
+ * Read the file into `buf` at `pos`, and call `push()`, until it
12
+ * returns false. The bodies of the entries are not read.
13
+ */
14
+ export declare class AppendScan {
15
+ #private;
16
+ buf: Uint8Array;
17
+ /** The place in the file of the next read. */
18
+ pos: number;
19
+ /**
20
+ * @param size the size of the file
21
+ * @param mtimes gets the path and the `mtime` of each complete entry
22
+ */
23
+ constructor(size: number, codecs?: Codec[], mtimes?: Map<string, Date>);
24
+ /** The place in the file where new entries go. */
25
+ get position(): number;
26
+ /** The number of bytes to read into `buf` at `pos`. */
27
+ get want(): number;
28
+ /**
29
+ * Parse the first `length` bytes of `buf`. False if the place is
30
+ * found. Throws if the file is compressed.
31
+ */
32
+ push(length: number): boolean;
33
+ }
34
+ /**
35
+ * Add the files to the end of an archive file that is not
36
+ * compressed. The files are the same as for `create`. If the archive
37
+ * does not exist, it is made.
38
+ *
39
+ * The new entries go after the last complete entry of the archive.
40
+ * A reader of the archive gets the old entry and then the new entry
41
+ * of a path that is in it two times.
42
+ */
43
+ export declare const replace: (options: WithAliases<ReplaceOptions>, files: PackInput[]) => Promise<void>;
44
+ /** The sync form of `replace`. */
45
+ export declare const replaceSync: (options: WithAliases<ReplaceOptionsSync>, files: PackInputSync[]) => void;
2
46
  //# sourceMappingURL=replace.d.ts.map