@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,21 @@
1
+ /** True for a `Uint8Array`, and for a subclass such as `Buffer`. */
2
+ export declare const isUint8Array: (x: unknown) => x is Uint8Array;
3
+ /** True for an `ArrayBuffer`. */
4
+ export declare const isArrayBuffer: (x: unknown) => x is ArrayBuffer;
5
+ /** True for an object that has the size and the stream of a `Blob`. */
6
+ export declare const isBlob: (x: unknown) => x is Blob;
7
+ /** True for an object that has the reader of a `ReadableStream`. */
8
+ export declare const isReadableStream: (x: unknown) => x is ReadableStream<Uint8Array>;
9
+ /** The number of bytes in the UTF-8 form of the string. */
10
+ export declare const utf8Length: (str: string) => number;
11
+ /** Decode the bytes from `start` to `end` as UTF-8. */
12
+ export declare const decodeUtf8: (buf: Uint8Array, start?: number, end?: number) => string;
13
+ /**
14
+ * Write the string as UTF-8 into `size` bytes at `off`. Fill the bytes
15
+ * that are left with zeros. A character that does not fit completely
16
+ * is not written.
17
+ */
18
+ export declare const encodeUtf8Into: (str: string, buf: Uint8Array, off: number, size: number) => void;
19
+ /** Write a string of ASCII characters at `off`. */
20
+ export declare const writeAscii: (str: string, buf: Uint8Array, off: number) => void;
21
+ //# sourceMappingURL=bytes.d.ts.map
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+ // Text and byte helpers that work on a plain Uint8Array in any
3
+ // JavaScript runtime, and type checks for the input of a caller.
4
+ //
5
+ // A check with `instanceof` is false for an object that a different
6
+ // realm made, such as a Node.js `Buffer` in a `node:vm` context, or a
7
+ // `Blob` of a different window. These checks are true for an object
8
+ // of each realm.
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.writeAscii = exports.encodeUtf8Into = exports.decodeUtf8 = exports.utf8Length = exports.isReadableStream = exports.isBlob = exports.isArrayBuffer = exports.isUint8Array = void 0;
11
+ /** True for a `Uint8Array`, and for a subclass such as `Buffer`. */
12
+ const isUint8Array = (x) => ArrayBuffer.isView(x) &&
13
+ x[Symbol.toStringTag] === 'Uint8Array';
14
+ exports.isUint8Array = isUint8Array;
15
+ /** True for an `ArrayBuffer`. */
16
+ const isArrayBuffer = (x) => Object.prototype.toString.call(x) === '[object ArrayBuffer]';
17
+ exports.isArrayBuffer = isArrayBuffer;
18
+ /** True for an object that has the size and the stream of a `Blob`. */
19
+ const isBlob = (x) => typeof x?.size === 'number' &&
20
+ typeof x.stream === 'function';
21
+ exports.isBlob = isBlob;
22
+ /** True for an object that has the reader of a `ReadableStream`. */
23
+ const isReadableStream = (x) => typeof x?.getReader === 'function';
24
+ exports.isReadableStream = isReadableStream;
25
+ // A name can start with U+FEFF. The decoder must keep it.
26
+ const decoder = new TextDecoder('utf-8', { ignoreBOM: true });
27
+ const encoder = new TextEncoder();
28
+ /** The number of bytes in the UTF-8 form of the string. */
29
+ const utf8Length = (str) => {
30
+ let len = str.length;
31
+ for (let i = 0; i < str.length; i++) {
32
+ const c = str.charCodeAt(i);
33
+ if (c < 0x80)
34
+ continue;
35
+ if (c < 0x800) {
36
+ len += 1;
37
+ }
38
+ else if (c >= 0xd800 &&
39
+ c <= 0xdbff &&
40
+ (str.charCodeAt(i + 1) & 0xfc00) === 0xdc00) {
41
+ // A surrogate pair is 2 code units, and 4 bytes.
42
+ len += 2;
43
+ i++;
44
+ }
45
+ else {
46
+ len += 2;
47
+ }
48
+ }
49
+ return len;
50
+ };
51
+ exports.utf8Length = utf8Length;
52
+ /** Decode the bytes from `start` to `end` as UTF-8. */
53
+ const decodeUtf8 = (buf, start = 0, end = buf.length) => {
54
+ // Most names in an archive are short ASCII. That case needs no
55
+ // decoder call.
56
+ let str = '';
57
+ for (let i = start; i < end; i++) {
58
+ const c = buf[i];
59
+ if (c >= 0x80)
60
+ return decoder.decode(buf.subarray(start, end));
61
+ str += String.fromCharCode(c);
62
+ }
63
+ return str;
64
+ };
65
+ exports.decodeUtf8 = decodeUtf8;
66
+ /**
67
+ * Write the string as UTF-8 into `size` bytes at `off`. Fill the bytes
68
+ * that are left with zeros. A character that does not fit completely
69
+ * is not written.
70
+ */
71
+ const encodeUtf8Into = (str, buf, off, size) => {
72
+ const { written } = encoder.encodeInto(str, buf.subarray(off, off + size));
73
+ buf.fill(0, off + written, off + size);
74
+ };
75
+ exports.encodeUtf8Into = encodeUtf8Into;
76
+ /** Write a string of ASCII characters at `off`. */
77
+ const writeAscii = (str, buf, off) => {
78
+ for (let i = 0; i < str.length; i++) {
79
+ buf[off + i] = str.charCodeAt(i);
80
+ }
81
+ };
82
+ exports.writeAscii = writeAscii;
83
+ //# sourceMappingURL=bytes.js.map
@@ -0,0 +1,53 @@
1
+ /** The two ends of a stream that changes data, as a `TransformStream`. */
2
+ export type CodecStream = {
3
+ readable: ReadableStream<Uint8Array>;
4
+ writable: WritableStream<Uint8Array>;
5
+ };
6
+ /**
7
+ * One compression format. Pass codecs in the `codecs` option to add
8
+ * a format, or to replace the gzip support of the runtime.
9
+ *
10
+ * The readers use the first codec for which `detect` returns true.
11
+ * If there is none, and the archive has a file name, and the input
12
+ * does not start with a tar header, they use the first codec that
13
+ * has an ending of the file name in `extensions`.
14
+ *
15
+ * The readers enforce `maxDecompressionRatio` for each codec.
16
+ */
17
+ export type Codec = {
18
+ name: string;
19
+ /** The number of bytes that `detect` needs. */
20
+ headLength: number;
21
+ /**
22
+ * True if the input is in this format. `head` is the start of the
23
+ * input: `headLength` bytes or more, or all of a shorter input.
24
+ */
25
+ detect(head: Uint8Array): boolean;
26
+ /**
27
+ * File name endings, such as `.tar.br`, for a format that `detect`
28
+ * cannot identify.
29
+ */
30
+ extensions?: string[];
31
+ /** Make a stream that decompresses. */
32
+ decompress(): CodecStream;
33
+ /** Make a stream that compresses. */
34
+ compress?(options?: Record<string, unknown>): CodecStream;
35
+ /**
36
+ * Decompress all of `data`. The sync readers need it. It must throw
37
+ * before it makes more than `limit.maxOutputLength` bytes. That
38
+ * number is `Infinity` when the caller sets no ratio limit.
39
+ */
40
+ decompressSync?(data: Uint8Array, limit: {
41
+ maxOutputLength: number;
42
+ }): Uint8Array;
43
+ /** Compress all of `data`. */
44
+ compressSync?(data: Uint8Array, options?: Record<string, unknown>): Uint8Array;
45
+ };
46
+ /**
47
+ * Gzip with the `DecompressionStream` and `CompressionStream` of the
48
+ * runtime. The async readers always have it, after `opt.codecs`.
49
+ * The option `portable` of `compress` makes output that does not
50
+ * name the system.
51
+ */
52
+ export declare const gzip: Codec;
53
+ //# sourceMappingURL=codec.d.ts.map
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.gzip = void 0;
4
+ /**
5
+ * Gzip with the `DecompressionStream` and `CompressionStream` of the
6
+ * runtime. The async readers always have it, after `opt.codecs`.
7
+ * The option `portable` of `compress` makes output that does not
8
+ * name the system.
9
+ */
10
+ exports.gzip = {
11
+ name: 'gzip',
12
+ headLength: 2,
13
+ detect: head => head[0] === 0x1f && head[1] === 0x8b,
14
+ decompress: () => new DecompressionStream('gzip'),
15
+ compress: options => {
16
+ const stream = new CompressionStream('gzip');
17
+ if (!options?.portable)
18
+ return stream;
19
+ // Byte 9 of a gzip stream names the system that made it. Set it
20
+ // to 255, "unknown", so that each system makes the same bytes.
21
+ let pos = 0;
22
+ return {
23
+ writable: stream.writable,
24
+ readable: stream.readable.pipeThrough(new TransformStream({
25
+ transform: (chunk, controller) => {
26
+ if (pos <= 9 && pos + chunk.length > 9)
27
+ chunk[9 - pos] = 255;
28
+ pos += chunk.length;
29
+ controller.enqueue(chunk);
30
+ },
31
+ })),
32
+ };
33
+ },
34
+ };
35
+ //# sourceMappingURL=codec.js.map
@@ -0,0 +1,3 @@
1
+ /** Copy the parts into one new array. */
2
+ export declare const concat: (parts: Uint8Array[]) => Uint8Array<ArrayBuffer>;
3
+ //# sourceMappingURL=concat.d.ts.map
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.concat = void 0;
4
+ /** Copy the parts into one new array. */
5
+ const concat = (parts) => {
6
+ if (parts.length === 1)
7
+ return parts[0].slice();
8
+ let length = 0;
9
+ for (const part of parts)
10
+ length += part.length;
11
+ const out = new Uint8Array(length);
12
+ let pos = 0;
13
+ for (const part of parts) {
14
+ out.set(part, pos);
15
+ pos += part.length;
16
+ }
17
+ return out;
18
+ };
19
+ exports.concat = concat;
20
+ //# sourceMappingURL=concat.js.map
@@ -1,3 +1,40 @@
1
- import { Pack, PackSync } from './pack.js';
2
- export declare const create: import("./make-command.js").TarCommand<Pack, PackSync>;
1
+ import { type FileOption, type NoFileOption, type WithAliases } from './dealias.js';
2
+ import type { CreateFileHandle, CreateFSSync } from './fs.js';
3
+ import type { CreateOptions, CreateOptionsSync } from './options.js';
4
+ import { Pack, PackSync, type PackInput, type PackInputSync } from './pack.js';
5
+ /**
6
+ * Write the chunks to the file, from `position`. Chunks that are
7
+ * smaller than 64 KiB are put together for one write.
8
+ */
9
+ export declare const writeChunks: (handle: CreateFileHandle, chunks: AsyncIterable<Uint8Array>, position: number) => Promise<void>;
10
+ /** The sync form of `writeChunks`. */
11
+ export declare const writeChunksSync: (fs: CreateFSSync, fd: number, chunks: Iterable<Uint8Array>, position: number) => void;
12
+ /**
13
+ * Make the pack for the files of a command. A name that starts with
14
+ * `@` is the path of an archive: the pack gets its entries.
15
+ */
16
+ export declare const packFiles: (opt: CreateOptions, files: PackInput[]) => Pack;
17
+ /** The sync form of `packFiles`. */
18
+ export declare const packFilesSync: (opt: CreateOptionsSync, files: PackInputSync[]) => PackSync;
19
+ /**
20
+ * Make an archive of the files. A directory is added with all that
21
+ * is in it. A name that starts with `@` is the path of an archive:
22
+ * its entries are added. A file can also be an entry, or a source of
23
+ * entries, as in `Pack.add()`.
24
+ *
25
+ * With `opt.file`, the archive is written to that path through
26
+ * `opt.fs`. With no `opt.file`, the result is a stream of the bytes
27
+ * of the archive. Files are read only when the stream is read.
28
+ */
29
+ export declare function create(opt: WithAliases<CreateOptions> & FileOption, files: PackInput[]): Promise<void>;
30
+ export declare function create(opt: WithAliases<CreateOptions> & NoFileOption, files: PackInput[]): ReadableStream<Uint8Array>;
31
+ export declare function create(opt: WithAliases<CreateOptions>, files: PackInput[]): Promise<void> | ReadableStream<Uint8Array>;
32
+ /**
33
+ * The sync form of `create`. With no `opt.file`, the result is an
34
+ * iterator of the bytes of the archive. Files are read only when the
35
+ * iterator is read.
36
+ */
37
+ export declare function createSync(opt: WithAliases<CreateOptionsSync> & FileOption, files: PackInputSync[]): void;
38
+ export declare function createSync(opt: WithAliases<CreateOptionsSync> & NoFileOption, files: PackInputSync[]): IterableIterator<Uint8Array, undefined>;
39
+ export declare function createSync(opt: WithAliases<CreateOptionsSync>, files: PackInputSync[]): void | IterableIterator<Uint8Array, undefined>;
3
40
  //# sourceMappingURL=create.d.ts.map
@@ -1,82 +1,168 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.create = void 0;
7
- const fs_minipass_1 = require("@isaacs/fs-minipass");
8
- const node_path_1 = __importDefault(require("node:path"));
9
- const list_js_1 = require("./list.js");
10
- const make_command_js_1 = require("./make-command.js");
3
+ exports.packFilesSync = exports.packFiles = exports.writeChunksSync = exports.writeChunks = void 0;
4
+ exports.create = create;
5
+ exports.createSync = createSync;
6
+ const dealias_js_1 = require("./dealias.js");
7
+ const entries_js_1 = require("./entries.js");
11
8
  const pack_js_1 = require("./pack.js");
12
- const createFileSync = (opt, files) => {
13
- const p = new pack_js_1.PackSync(opt);
14
- const stream = new fs_minipass_1.WriteStreamSync(opt.file, {
15
- mode: opt.mode || 0o666,
16
- });
17
- p.pipe(stream);
18
- addFilesSync(p, files);
9
+ const read_file_js_1 = require("./read-file.js");
10
+ const to_stream_js_1 = require("./to-stream.js");
11
+ // Chunks that are smaller than this are put together for one write.
12
+ const SMALL = 64 * 1024;
13
+ const BATCH = 4 * SMALL;
14
+ const noop = () => { };
15
+ const check = (opt, files) => {
16
+ if (!files?.length) {
17
+ throw new TypeError('no paths specified to add to archive');
18
+ }
19
+ if (opt.file && !opt.fs) {
20
+ throw new TypeError('the file option needs the fs option');
21
+ }
19
22
  };
20
- const createFile = (opt, files) => {
21
- const p = new pack_js_1.Pack(opt);
22
- const stream = new fs_minipass_1.WriteStream(opt.file, {
23
- mode: opt.mode || 0o666,
24
- });
25
- p.pipe(stream);
26
- const promise = new Promise((res, rej) => {
27
- stream.on('error', rej);
28
- stream.on('close', res);
29
- p.on('error', rej);
30
- });
31
- addFilesAsync(p, files).catch(er => p.emit('error', er));
32
- return promise;
23
+ const writeAll = async (handle, buf, length, position) => {
24
+ for (let off = 0; off < length;) {
25
+ off += (await handle.write(buf, off, length - off, position + off))
26
+ .bytesWritten;
27
+ }
33
28
  };
34
- const addFilesSync = (p, files) => {
35
- files.forEach(file => {
36
- if (file.charAt(0) === '@') {
37
- (0, list_js_1.list)({
38
- file: node_path_1.default.resolve(p.cwd, file.slice(1)),
39
- sync: true,
40
- noResume: true,
41
- onReadEntry: entry => p.add(entry),
42
- });
29
+ /**
30
+ * Write the chunks to the file, from `position`. Chunks that are
31
+ * smaller than 64 KiB are put together for one write.
32
+ */
33
+ const writeChunks = async (handle, chunks, position) => {
34
+ const batch = new Uint8Array(BATCH);
35
+ let used = 0;
36
+ const flush = async () => {
37
+ await writeAll(handle, batch, used, position);
38
+ position += used;
39
+ used = 0;
40
+ };
41
+ for await (const chunk of chunks) {
42
+ if (used + chunk.length > BATCH || chunk.length >= SMALL)
43
+ await flush();
44
+ if (chunk.length >= SMALL) {
45
+ await writeAll(handle, chunk, chunk.length, position);
46
+ position += chunk.length;
43
47
  }
44
48
  else {
45
- p.add(file);
49
+ batch.set(chunk, used);
50
+ used += chunk.length;
46
51
  }
47
- });
48
- p.end();
52
+ }
53
+ await flush();
49
54
  };
50
- const addFilesAsync = async (p, files) => {
51
- for (const file of files) {
52
- if (file.charAt(0) === '@') {
53
- await (0, list_js_1.list)({
54
- file: node_path_1.default.resolve(String(p.cwd), file.slice(1)),
55
- noResume: true,
56
- onReadEntry: entry => {
57
- p.add(entry);
58
- },
59
- });
55
+ exports.writeChunks = writeChunks;
56
+ /** The sync form of `writeChunks`. */
57
+ const writeChunksSync = (fs, fd, chunks, position) => {
58
+ const batch = new Uint8Array(BATCH);
59
+ let used = 0;
60
+ const write = (buf, length) => {
61
+ for (let off = 0; off < length;) {
62
+ off += fs.writeSync(fd, buf, off, length - off, position + off);
63
+ }
64
+ position += length;
65
+ };
66
+ for (const chunk of chunks) {
67
+ if (used + chunk.length > BATCH || chunk.length >= SMALL) {
68
+ write(batch, used);
69
+ used = 0;
60
70
  }
71
+ if (chunk.length >= SMALL)
72
+ write(chunk, chunk.length);
61
73
  else {
62
- p.add(file);
74
+ batch.set(chunk, used);
75
+ used += chunk.length;
63
76
  }
64
77
  }
65
- p.end();
78
+ write(batch, used);
79
+ };
80
+ exports.writeChunksSync = writeChunksSync;
81
+ const createFile = async (pack, fs, file, mode) => {
82
+ const handle = await fs.open(file, 'w', mode);
83
+ let ok = false;
84
+ try {
85
+ await (0, exports.writeChunks)(handle, pack, 0);
86
+ ok = true;
87
+ }
88
+ finally {
89
+ const closed = handle.close();
90
+ await (ok ? closed : closed.catch(noop));
91
+ }
66
92
  };
67
- const createSync = (opt, files) => {
68
- const p = new pack_js_1.PackSync(opt);
69
- addFilesSync(p, files);
70
- return p;
93
+ /**
94
+ * Make the pack for the files of a command. A name that starts with
95
+ * `@` is the path of an archive: the pack gets its entries.
96
+ */
97
+ const packFiles = (opt, files) => {
98
+ const { fs, strict, onwarn, codecs, platform } = opt;
99
+ const pack = new pack_js_1.Pack(opt);
100
+ for (const item of files) {
101
+ if (typeof item !== 'string' || item.charAt(0) !== '@')
102
+ pack.add(item);
103
+ else {
104
+ const archive = pack.resolve(item.slice(1));
105
+ pack.add(new entries_js_1.TarReader((0, read_file_js_1.readFile)(fs, archive, opt.maxReadSize), {
106
+ strict,
107
+ onwarn,
108
+ codecs,
109
+ platform,
110
+ file: archive,
111
+ }));
112
+ }
113
+ }
114
+ return pack.end();
71
115
  };
72
- const createAsync = (opt, files) => {
73
- const p = new pack_js_1.Pack(opt);
74
- addFilesAsync(p, files).catch(er => p.emit('error', er));
75
- return p;
116
+ exports.packFiles = packFiles;
117
+ /** The sync form of `packFiles`. */
118
+ const packFilesSync = (opt, files) => {
119
+ const { strict, onwarn, codecs, platform } = opt;
120
+ const pack = new pack_js_1.PackSync(opt);
121
+ for (const item of files) {
122
+ if (typeof item !== 'string' || item.charAt(0) !== '@')
123
+ pack.add(item);
124
+ else {
125
+ const archive = pack.resolve(item.slice(1));
126
+ pack.add(new entries_js_1.TarReaderSync((0, read_file_js_1.readFileSync)(opt.fs, archive, opt.maxReadSize), { strict, onwarn, codecs, platform, file: archive }));
127
+ }
128
+ }
129
+ return pack;
76
130
  };
77
- exports.create = (0, make_command_js_1.makeCommand)(createFileSync, createFile, createSync, createAsync, (_opt, files) => {
78
- if (!files?.length) {
79
- throw new TypeError('no paths specified to add to archive');
131
+ exports.packFilesSync = packFilesSync;
132
+ function create(options, files) {
133
+ const opt = (0, dealias_js_1.dealias)(options);
134
+ if (!opt.file) {
135
+ check(opt, files);
136
+ return (0, to_stream_js_1.toStream)((0, exports.packFiles)(opt, files));
137
+ }
138
+ // The file form returns a promise, so a bad argument rejects it.
139
+ try {
140
+ check(opt, files);
141
+ return createFile((0, exports.packFiles)(opt, files), opt.fs, opt.file, opt.mode || 0o666);
142
+ }
143
+ catch (er) {
144
+ return Promise.reject(er);
145
+ }
146
+ }
147
+ function createSync(options, files) {
148
+ const opt = (0, dealias_js_1.dealias)(options);
149
+ check(opt, files);
150
+ const { file } = opt;
151
+ const fs = opt.fs;
152
+ const pack = (0, exports.packFilesSync)(opt, files);
153
+ if (!file)
154
+ return pack;
155
+ const fd = fs.openSync(file, 'w', opt.mode || 0o666);
156
+ try {
157
+ (0, exports.writeChunksSync)(fs, fd, pack, 0);
158
+ }
159
+ catch (er) {
160
+ try {
161
+ fs.closeSync(fd);
162
+ }
163
+ catch { }
164
+ throw er;
80
165
  }
81
- });
166
+ fs.closeSync(fd);
167
+ }
82
168
  //# sourceMappingURL=create.js.map
@@ -0,0 +1,79 @@
1
+ /**
2
+ * The option aliases of the commands: the short names of the tar
3
+ * program, and the long names of version 7. Each alias has the name
4
+ * of its option.
5
+ */
6
+ export declare const aliases: {
7
+ readonly C: "cwd";
8
+ readonly f: "file";
9
+ readonly z: "gzip";
10
+ readonly P: "preservePaths";
11
+ readonly U: "unlink";
12
+ readonly 'strip-components': "strip";
13
+ readonly stripComponents: "strip";
14
+ readonly 'keep-newer': "newer";
15
+ readonly keepNewer: "newer";
16
+ readonly 'keep-newer-files': "newer";
17
+ readonly keepNewerFiles: "newer";
18
+ readonly k: "keep";
19
+ readonly 'keep-existing': "keep";
20
+ readonly keepExisting: "keep";
21
+ readonly m: "noMtime";
22
+ readonly 'no-mtime': "noMtime";
23
+ readonly p: "preserveOwner";
24
+ readonly L: "follow";
25
+ readonly h: "follow";
26
+ readonly onentry: "onEntry";
27
+ readonly onReadEntry: "onEntry";
28
+ };
29
+ /** The alias names, and the name of the option of each one. */
30
+ export type Aliases = typeof aliases;
31
+ /** The names of the options that have an alias. */
32
+ export type Aliased = Aliases[keyof Aliases];
33
+ /** The alias names of the option `K`. */
34
+ export type AliasOf<K> = {
35
+ [A in keyof Aliases]: Aliases[A] extends K ? A : never;
36
+ }[keyof Aliases];
37
+ /**
38
+ * For each option `K` of `T`, an object type that requires the option
39
+ * or one of its aliases.
40
+ */
41
+ export type RequiredOption<T, K extends keyof T> = [
42
+ K
43
+ ] extends [never] ? unknown : (K extends unknown ? (x: {
44
+ v: {
45
+ [N in K | AliasOf<K>]: {
46
+ [P in N]: T[K];
47
+ };
48
+ }[K | AliasOf<K>];
49
+ }) => void : never) extends (x: infer I extends {
50
+ v: unknown;
51
+ }) => void ? I['v'] : never;
52
+ /**
53
+ * The option type `T` of a command, and the aliases of its options.
54
+ * An alias has the type of its option. An option that `T` requires
55
+ * can be given with its name or with an alias.
56
+ */
57
+ export type WithAliases<T> = T extends unknown ? Omit<T, Aliased> & Partial<Pick<T, keyof T & Aliased>> & {
58
+ [A in keyof Aliases as Aliases[A] extends keyof T ? A : never]?: T[Aliases[A] & keyof T];
59
+ } & ('chmod' extends keyof T ? {
60
+ /** `noChmod: false` is `chmod: true`, if `chmod` is not set. */
61
+ noChmod?: boolean;
62
+ } : unknown) & RequiredOption<T, {
63
+ [K in keyof T]-?: object extends Pick<T, K> ? never : K;
64
+ }[keyof T] & Aliased> : never;
65
+ /** The `file` option, with its name or with its alias. */
66
+ export type FileOption = RequiredOption<{
67
+ file: string;
68
+ }, 'file'>;
69
+ /** No `file` option. */
70
+ export type NoFileOption = {
71
+ [N in 'file' | AliasOf<'file'>]?: undefined;
72
+ };
73
+ /**
74
+ * A copy of the options, with no prototype, that has the name of the
75
+ * option in place of each alias. An option that is set wins over its
76
+ * aliases.
77
+ */
78
+ export declare const dealias: <T extends object>(options: WithAliases<T>) => T;
79
+ //# sourceMappingURL=dealias.d.ts.map
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.dealias = exports.aliases = void 0;
4
+ /**
5
+ * The option aliases of the commands: the short names of the tar
6
+ * program, and the long names of version 7. Each alias has the name
7
+ * of its option.
8
+ */
9
+ exports.aliases = {
10
+ C: 'cwd',
11
+ f: 'file',
12
+ z: 'gzip',
13
+ P: 'preservePaths',
14
+ U: 'unlink',
15
+ 'strip-components': 'strip',
16
+ stripComponents: 'strip',
17
+ 'keep-newer': 'newer',
18
+ keepNewer: 'newer',
19
+ 'keep-newer-files': 'newer',
20
+ keepNewerFiles: 'newer',
21
+ k: 'keep',
22
+ 'keep-existing': 'keep',
23
+ keepExisting: 'keep',
24
+ m: 'noMtime',
25
+ 'no-mtime': 'noMtime',
26
+ p: 'preserveOwner',
27
+ L: 'follow',
28
+ h: 'follow',
29
+ onentry: 'onEntry',
30
+ onReadEntry: 'onEntry',
31
+ };
32
+ /**
33
+ * A copy of the options, with no prototype, that has the name of the
34
+ * option in place of each alias. An option that is set wins over its
35
+ * aliases.
36
+ */
37
+ const dealias = (options) => {
38
+ const opt = Object.assign(Object.create(null), options);
39
+ for (const [alias, name] of Object.entries(exports.aliases)) {
40
+ if (opt[alias] !== undefined)
41
+ opt[name] ??= opt[alias];
42
+ delete opt[alias];
43
+ }
44
+ if (opt.noChmod === false)
45
+ opt.chmod ??= true;
46
+ delete opt.noChmod;
47
+ return opt;
48
+ };
49
+ exports.dealias = dealias;
50
+ //# sourceMappingURL=dealias.js.map
@@ -0,0 +1,19 @@
1
+ import { type WithAliases } from './dealias.js';
2
+ import type { DeleteOptions, DeleteOptionsSync } from './options.js';
3
+ /**
4
+ * Remove entries from an archive file. An entry is removed if
5
+ * `files` lists its path or one of its parent directories. With
6
+ * `opt.filter`, only if the filter also returns true. With no
7
+ * `files`, each entry that the filter accepts is removed. A listed
8
+ * path that no entry matches is a warning.
9
+ *
10
+ * The other entries are written to a new file next to the archive,
11
+ * with the compression and the mode of the archive. The new file
12
+ * then gets the path of the archive. The archive does not change if
13
+ * the command fails.
14
+ */
15
+ declare const del: (options: WithAliases<DeleteOptions>, files?: string[]) => Promise<void>;
16
+ /** The sync form of `delete`. */
17
+ export declare const deleteSync: (options: WithAliases<DeleteOptionsSync>, files?: string[]) => void;
18
+ export { del as delete };
19
+ //# sourceMappingURL=delete.d.ts.map