@unbrained/pm-cli 2026.12.1 → 2026.12.3

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 (376) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/dist/cli/commander-usage.js +4 -4
  3. package/dist/cli/expected-revisions.js +1 -1
  4. package/dist/cli/extension-command-help.js +4 -4
  5. package/dist/cli/main.js +5 -5
  6. package/dist/cli/runtime/invocation-rewrites.js +1 -1
  7. package/dist/cli/runtime-field-commands.js +2 -0
  8. package/dist/cli-bundle/bundle-manifest.json +1 -1
  9. package/dist/cli-bundle/chunks/chunk-3ESBFEQC.js +2 -0
  10. package/dist/cli-bundle/chunks/chunk-46AZP5QW.js +2 -0
  11. package/dist/cli-bundle/chunks/{chunk-OBPO6V7H.js → chunk-5WTBF4M4.js} +2 -2
  12. package/dist/cli-bundle/chunks/{chunk-3KEMIPKG.js → chunk-6TOZQ5BQ.js} +2 -2
  13. package/dist/cli-bundle/chunks/{chunk-4YYFY33T.js → chunk-AHVOEE7F.js} +2 -2
  14. package/dist/cli-bundle/chunks/chunk-CQHB3ZZH.js +2 -0
  15. package/dist/cli-bundle/chunks/chunk-DZPOS3YT.js +2 -0
  16. package/dist/cli-bundle/chunks/{chunk-OKEJ4U2I.js → chunk-E5ADC3HT.js} +65 -65
  17. package/dist/cli-bundle/chunks/{chunk-SY5C3U32.js → chunk-E5HO7HWP.js} +2 -2
  18. package/dist/cli-bundle/chunks/{chunk-3HKPVOAN.js → chunk-EDJ3KR2H.js} +2 -2
  19. package/dist/cli-bundle/chunks/{chunk-XME6GIFQ.js → chunk-FWQNWPIV.js} +2 -2
  20. package/dist/cli-bundle/chunks/{chunk-CWPR234D.js → chunk-H4U3LEOD.js} +2 -2
  21. package/dist/cli-bundle/chunks/{chunk-MZZ4ZJ5Z.js → chunk-HNMED75Y.js} +2 -2
  22. package/dist/cli-bundle/chunks/{chunk-U7RBJGLF.js → chunk-HPCMM74Q.js} +22 -22
  23. package/dist/cli-bundle/chunks/{chunk-WSEIEDEK.js → chunk-ITM4AMVM.js} +2 -2
  24. package/dist/cli-bundle/chunks/{chunk-Q6K7HWZ7.js → chunk-IW4A3I4N.js} +2 -2
  25. package/dist/cli-bundle/chunks/{chunk-4YQMQOUO.js → chunk-JJ73G5UT.js} +52 -52
  26. package/dist/cli-bundle/chunks/chunk-L4HMFRHB.js +2 -0
  27. package/dist/cli-bundle/chunks/{chunk-YSVOXCYH.js → chunk-LTQWPQ7H.js} +2 -2
  28. package/dist/cli-bundle/chunks/{chunk-Q6GLSAJY.js → chunk-MRT3ADO4.js} +2 -2
  29. package/dist/cli-bundle/chunks/{chunk-ZL6J6JYT.js → chunk-PBMLIV74.js} +2 -2
  30. package/dist/cli-bundle/chunks/{chunk-NA6D75V5.js → chunk-PJMGWJKU.js} +2 -2
  31. package/dist/cli-bundle/chunks/chunk-Q2HMDV56.js +9 -0
  32. package/dist/cli-bundle/chunks/{chunk-OXC5KBIQ.js → chunk-RRBNCL63.js} +2 -2
  33. package/dist/cli-bundle/chunks/{chunk-CBUC4X7Q.js → chunk-TDOF7BKO.js} +3 -3
  34. package/dist/cli-bundle/chunks/chunk-UXEZXGAD.js +113 -0
  35. package/dist/cli-bundle/chunks/{chunk-PCDTWL6V.js → chunk-W7HA65EO.js} +2 -2
  36. package/dist/cli-bundle/chunks/{chunk-I4SPJQQI.js → chunk-XGNUDSCG.js} +3 -3
  37. package/dist/cli-bundle/chunks/{chunk-AHV3CSQG.js → chunk-XKJ5NWQ7.js} +2 -2
  38. package/dist/cli-bundle/chunks/{field-option-collisions-BBGTV7AD.js → field-option-collisions-DXKTKW6J.js} +2 -2
  39. package/dist/cli-bundle/chunks/item-revision-DXEF4XBU.js +2 -0
  40. package/dist/cli-bundle/chunks/item-transaction-EANA7V4W.js +2 -0
  41. package/dist/cli-bundle/chunks/{linked-resource-value-list-E2DX52LY.js → linked-resource-value-list-5JRGUDUB.js} +2 -2
  42. package/dist/cli-bundle/chunks/{mutation-actor-NHN33ITJ.js → mutation-actor-S5G7FMNG.js} +2 -2
  43. package/dist/cli-bundle/chunks/{mutation-admission-PGKJTCG6.js → mutation-admission-HQVNPOXV.js} +2 -2
  44. package/dist/cli-bundle/chunks/{register-list-query-7S5QWDTI.js → register-list-query-SQF5PSJ4.js} +2 -2
  45. package/dist/cli-bundle/chunks/{register-mutation-2F6JUBST.js → register-mutation-4AQ4CEBL.js} +2 -2
  46. package/dist/cli-bundle/chunks/{register-operations-ET3UKPYK.js → register-operations-76P7OM4P.js} +2 -2
  47. package/dist/cli-bundle/chunks/{register-setup-I63QTFCU.js → register-setup-T6OEOZK3.js} +2 -2
  48. package/dist/cli-bundle/chunks/{stage-4ZCF74G4.js → stage-KUICZHSF.js} +2 -2
  49. package/dist/cli-bundle/focused-chunks/{chunk-4SCFAWAW.js → chunk-3LHBKFPD.js} +2 -2
  50. package/dist/cli-bundle/focused-chunks/chunk-4DDXERKN.js +2 -0
  51. package/dist/cli-bundle/focused-chunks/{chunk-JPZGC3W4.js → chunk-4YU75CWI.js} +2 -2
  52. package/dist/cli-bundle/focused-chunks/{chunk-TXTPAFHJ.js → chunk-5JQVPQMN.js} +2 -2
  53. package/dist/cli-bundle/focused-chunks/{chunk-KNBGHCIP.js → chunk-5Z4DXYBZ.js} +2 -2
  54. package/dist/cli-bundle/focused-chunks/chunk-7DOP5HEZ.js +44 -0
  55. package/dist/cli-bundle/focused-chunks/{chunk-TR22GU7M.js → chunk-AX4RBJ7B.js} +2 -2
  56. package/dist/cli-bundle/focused-chunks/{chunk-7A6SEZEY.js → chunk-BEHQCHQV.js} +2 -2
  57. package/dist/cli-bundle/focused-chunks/chunk-BUIF6CMZ.js +2 -0
  58. package/dist/cli-bundle/focused-chunks/chunk-E2IWEJL5.js +3 -0
  59. package/dist/cli-bundle/focused-chunks/chunk-GBU7GKNJ.js +2 -0
  60. package/dist/cli-bundle/focused-chunks/{chunk-EQCQTYKO.js → chunk-K35KTBDZ.js} +2 -2
  61. package/dist/cli-bundle/focused-chunks/{chunk-VQIC3UZB.js → chunk-KNST4PGF.js} +2 -2
  62. package/dist/cli-bundle/focused-chunks/{chunk-P2H3GTJK.js → chunk-L2XJB5PK.js} +2 -2
  63. package/dist/cli-bundle/focused-chunks/chunk-L6NOGC4N.js +100 -0
  64. package/dist/cli-bundle/focused-chunks/{chunk-VK3IE3TS.js → chunk-LWIIDPAV.js} +2 -2
  65. package/dist/cli-bundle/focused-chunks/{chunk-6IY5CVGJ.js → chunk-M54BMYG4.js} +2 -2
  66. package/dist/cli-bundle/focused-chunks/{chunk-6BKT6XQN.js → chunk-NEK7RX3N.js} +2 -2
  67. package/dist/cli-bundle/focused-chunks/{chunk-BHNBPCHP.js → chunk-OKGWIW6C.js} +2 -2
  68. package/dist/cli-bundle/focused-chunks/{chunk-2DGKVXFT.js → chunk-RFDSSOTZ.js} +2 -2
  69. package/dist/cli-bundle/focused-chunks/chunk-SSX5YBDC.js +2 -0
  70. package/dist/cli-bundle/focused-chunks/{chunk-OG57ESZK.js → chunk-TIEQVIFN.js} +2 -2
  71. package/dist/cli-bundle/focused-chunks/{chunk-SQ72CVUH.js → chunk-VEUBDQDP.js} +54 -54
  72. package/dist/cli-bundle/focused-chunks/{chunk-2UWKU2BQ.js → chunk-WDHNPNHX.js} +3 -3
  73. package/dist/cli-bundle/focused-chunks/{field-option-collisions-2C6DLUC4.js → field-option-collisions-32X7FP3H.js} +2 -2
  74. package/dist/cli-bundle/focused-chunks/item-revision-GUYSVVQD.js +2 -0
  75. package/dist/cli-bundle/focused-chunks/{item-transaction-2K4SFLJ7.js → item-transaction-MLKHZPL7.js} +2 -2
  76. package/dist/cli-bundle/focused-chunks/{mutation-actor-DJMZUIZI.js → mutation-actor-RDZJTRW2.js} +2 -2
  77. package/dist/cli-bundle/focused-chunks/{mutation-admission-SDWQVVHN.js → mutation-admission-IQB6XL75.js} +2 -2
  78. package/dist/cli-bundle/focused-chunks/{stage-QBZIK3T5.js → stage-AA7LORZ2.js} +2 -2
  79. package/dist/cli-bundle/main.js +27 -27
  80. package/dist/cli-bundle/sdk-authoring.js +1 -1
  81. package/dist/cli-bundle/sdk-contracts.js +1 -1
  82. package/dist/cli-bundle/sdk-core.js +1 -1
  83. package/dist/cli-bundle/sdk-governance.js +1 -1
  84. package/dist/cli-bundle/sdk-graph.js +1 -1
  85. package/dist/cli-bundle/sdk-merge.js +63 -63
  86. package/dist/cli-bundle/sdk-query.js +1 -1
  87. package/dist/cli-bundle/sdk-runtime.js +1 -1
  88. package/dist/cli-bundle/sdk-testing.js +1 -1
  89. package/dist/cli-bundle/sdk.js +9 -9
  90. package/dist/core/extensions/loader.d.ts +8 -0
  91. package/dist/core/extensions/loader.js +1 -1
  92. package/dist/core/item/actionability.js +1 -1
  93. package/dist/core/output/output.js +16 -16
  94. package/dist/mcp/server.js +1 -1
  95. package/dist/sdk/cli-contracts/enum-contracts.d.ts +25 -1
  96. package/dist/sdk/cli-contracts/enum-contracts.js +1 -1
  97. package/dist/sdk/cli-contracts/flag-contracts.d.ts +1 -1
  98. package/dist/sdk/cli-contracts/flag-contracts.js +1 -1
  99. package/dist/sdk/cli-contracts/runtime-contracts.js +1 -1
  100. package/dist/sdk/cli-contracts/tool-parameter-tables.js +1 -1
  101. package/dist/sdk/cli-contracts/tool-schema.js +1 -1
  102. package/dist/sdk/context-intent-contracts.js +1 -1
  103. package/dist/sdk/extension/install-sources.d.ts +2 -2
  104. package/dist/sdk/extension/install-sources.js +5 -5
  105. package/dist/sdk/lifecycle/expect-hash-admission.d.ts +27 -8
  106. package/dist/sdk/lifecycle/expect-hash-admission.js +1 -1
  107. package/dist/sdk/lifecycle/item-revision.d.ts +12 -4
  108. package/dist/sdk/lifecycle/item-revision.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/read-output/surfaces.js +1 -1
  113. package/dist/sdk/runtime/schema.js +1 -1
  114. package/dist/sdk/runtime-input.d.ts +6 -0
  115. package/dist/sdk/runtime-input.js +1 -1
  116. package/dist/sdk/runtime-primitives.d.ts +1 -1
  117. package/dist/sdk/runtime-primitives.js +1 -1
  118. package/dist/sdk/runtime.js +1 -1
  119. package/docs/COMMANDS.md +23 -5
  120. package/docs/EXTENSIONS.md +1 -1
  121. package/docs/SDK.md +15 -2
  122. package/marketplace.json +1 -1
  123. package/node_modules/tar/README.md +1792 -1147
  124. package/node_modules/tar/dist/commonjs/bytes.d.ts +21 -0
  125. package/node_modules/tar/dist/commonjs/bytes.js +83 -0
  126. package/node_modules/tar/dist/commonjs/codec.d.ts +53 -0
  127. package/node_modules/tar/dist/commonjs/codec.js +35 -0
  128. package/node_modules/tar/dist/commonjs/concat.d.ts +3 -0
  129. package/node_modules/tar/dist/commonjs/concat.js +20 -0
  130. package/node_modules/tar/dist/commonjs/create.d.ts +39 -2
  131. package/node_modules/tar/dist/commonjs/create.js +150 -64
  132. package/node_modules/tar/dist/commonjs/dealias.d.ts +79 -0
  133. package/node_modules/tar/dist/commonjs/dealias.js +50 -0
  134. package/node_modules/tar/dist/commonjs/delete.d.ts +19 -0
  135. package/node_modules/tar/dist/commonjs/delete.js +121 -0
  136. package/node_modules/tar/dist/commonjs/entries.d.ts +82 -0
  137. package/node_modules/tar/dist/commonjs/entries.js +398 -0
  138. package/node_modules/tar/dist/commonjs/extract.d.ts +14 -2
  139. package/node_modules/tar/dist/commonjs/extract.js +40 -81
  140. package/node_modules/tar/dist/commonjs/fs.d.ts +201 -0
  141. package/node_modules/tar/dist/commonjs/fs.js +5 -0
  142. package/node_modules/tar/dist/commonjs/header.d.ts +4 -4
  143. package/node_modules/tar/dist/commonjs/header.js +71 -53
  144. package/node_modules/tar/dist/commonjs/index.d.ts +25 -18
  145. package/node_modules/tar/dist/commonjs/index.js +46 -18
  146. package/node_modules/tar/dist/commonjs/index.min.js +2 -3
  147. package/node_modules/tar/dist/commonjs/large-numbers.d.ts +2 -2
  148. package/node_modules/tar/dist/commonjs/large-numbers.js +4 -4
  149. package/node_modules/tar/dist/commonjs/list.d.ts +23 -6
  150. package/node_modules/tar/dist/commonjs/list.js +99 -138
  151. package/node_modules/tar/dist/commonjs/mkdir.d.ts +16 -11
  152. package/node_modules/tar/dist/commonjs/mkdir.js +121 -159
  153. package/node_modules/tar/dist/commonjs/normalize-unicode.js +9 -0
  154. package/node_modules/tar/dist/commonjs/options.d.ts +284 -513
  155. package/node_modules/tar/dist/commonjs/options.js +20 -61
  156. package/node_modules/tar/dist/commonjs/pack.d.ts +150 -96
  157. package/node_modules/tar/dist/commonjs/pack.js +752 -445
  158. package/node_modules/tar/dist/commonjs/parser.d.ts +98 -0
  159. package/node_modules/tar/dist/commonjs/parser.js +452 -0
  160. package/node_modules/tar/dist/commonjs/path-reservations.d.ts +17 -7
  161. package/node_modules/tar/dist/commonjs/path-reservations.js +110 -140
  162. package/node_modules/tar/dist/commonjs/path.d.ts +19 -0
  163. package/node_modules/tar/dist/commonjs/path.js +90 -0
  164. package/node_modules/tar/dist/commonjs/pax.d.ts +3 -1
  165. package/node_modules/tar/dist/commonjs/pax.js +67 -36
  166. package/node_modules/tar/dist/commonjs/read-entry.d.ts +97 -11
  167. package/node_modules/tar/dist/commonjs/read-entry.js +251 -97
  168. package/node_modules/tar/dist/commonjs/read-file.d.ts +22 -0
  169. package/node_modules/tar/dist/commonjs/read-file.js +104 -0
  170. package/node_modules/tar/dist/commonjs/replace.d.ts +45 -1
  171. package/node_modules/tar/dist/commonjs/replace.js +164 -211
  172. package/node_modules/tar/dist/commonjs/server/codecs.d.ts +38 -0
  173. package/node_modules/tar/dist/commonjs/server/codecs.js +252 -0
  174. package/node_modules/tar/dist/commonjs/server/index.d.ts +115 -0
  175. package/node_modules/tar/dist/commonjs/server/index.js +166 -0
  176. package/node_modules/tar/dist/commonjs/server/index.min.js +3 -0
  177. package/node_modules/tar/dist/commonjs/strip-absolute-path.d.ts +8 -0
  178. package/node_modules/tar/dist/commonjs/strip-absolute-path.js +17 -20
  179. package/node_modules/tar/dist/commonjs/to-stream.d.ts +7 -0
  180. package/node_modules/tar/dist/commonjs/to-stream.js +22 -0
  181. package/node_modules/tar/dist/commonjs/types.d.ts +4 -3
  182. package/node_modules/tar/dist/commonjs/types.js +4 -3
  183. package/node_modules/tar/dist/commonjs/unpack.d.ts +143 -89
  184. package/node_modules/tar/dist/commonjs/unpack.js +780 -725
  185. package/node_modules/tar/dist/commonjs/update.d.ts +11 -1
  186. package/node_modules/tar/dist/commonjs/update.js +37 -28
  187. package/node_modules/tar/dist/commonjs/warn.d.ts +27 -0
  188. package/node_modules/tar/dist/commonjs/warn.js +36 -0
  189. package/node_modules/tar/dist/commonjs/win32-path.d.ts +16 -0
  190. package/node_modules/tar/dist/commonjs/win32-path.js +67 -0
  191. package/node_modules/tar/dist/commonjs/write-entry.d.ts +64 -111
  192. package/node_modules/tar/dist/commonjs/write-entry.js +108 -672
  193. package/node_modules/tar/dist/commonjs/write-flag.d.ts +18 -0
  194. package/node_modules/tar/dist/commonjs/write-flag.js +29 -0
  195. package/node_modules/tar/dist/esm/bytes.d.ts +21 -0
  196. package/node_modules/tar/dist/esm/bytes.js +72 -0
  197. package/node_modules/tar/dist/esm/codec.d.ts +53 -0
  198. package/node_modules/tar/dist/esm/codec.js +32 -0
  199. package/node_modules/tar/dist/esm/concat.d.ts +3 -0
  200. package/node_modules/tar/dist/esm/concat.js +16 -0
  201. package/node_modules/tar/dist/esm/create.d.ts +39 -2
  202. package/node_modules/tar/dist/esm/create.js +144 -61
  203. package/node_modules/tar/dist/esm/dealias.d.ts +79 -0
  204. package/node_modules/tar/dist/esm/dealias.js +46 -0
  205. package/node_modules/tar/dist/esm/delete.d.ts +19 -0
  206. package/node_modules/tar/dist/esm/delete.js +117 -0
  207. package/node_modules/tar/dist/esm/entries.d.ts +82 -0
  208. package/node_modules/tar/dist/esm/entries.js +388 -0
  209. package/node_modules/tar/dist/esm/extract.d.ts +14 -2
  210. package/node_modules/tar/dist/esm/extract.js +37 -44
  211. package/node_modules/tar/dist/esm/fs.d.ts +201 -0
  212. package/node_modules/tar/dist/esm/fs.js +4 -0
  213. package/node_modules/tar/dist/esm/header.d.ts +4 -4
  214. package/node_modules/tar/dist/esm/header.js +71 -53
  215. package/node_modules/tar/dist/esm/index.d.ts +25 -18
  216. package/node_modules/tar/dist/esm/index.js +23 -18
  217. package/node_modules/tar/dist/esm/index.min.js +2 -3
  218. package/node_modules/tar/dist/esm/large-numbers.d.ts +2 -2
  219. package/node_modules/tar/dist/esm/large-numbers.js +4 -4
  220. package/node_modules/tar/dist/esm/list.d.ts +23 -6
  221. package/node_modules/tar/dist/esm/list.js +96 -101
  222. package/node_modules/tar/dist/esm/mkdir.d.ts +16 -11
  223. package/node_modules/tar/dist/esm/mkdir.js +119 -154
  224. package/node_modules/tar/dist/esm/normalize-unicode.js +9 -0
  225. package/node_modules/tar/dist/esm/options.d.ts +284 -513
  226. package/node_modules/tar/dist/esm/options.js +17 -51
  227. package/node_modules/tar/dist/esm/pack.d.ts +150 -96
  228. package/node_modules/tar/dist/esm/pack.js +750 -441
  229. package/node_modules/tar/dist/esm/parser.d.ts +98 -0
  230. package/node_modules/tar/dist/esm/parser.js +448 -0
  231. package/node_modules/tar/dist/esm/path-reservations.d.ts +17 -7
  232. package/node_modules/tar/dist/esm/path-reservations.js +110 -140
  233. package/node_modules/tar/dist/esm/path.d.ts +19 -0
  234. package/node_modules/tar/dist/esm/path.js +80 -0
  235. package/node_modules/tar/dist/esm/pax.d.ts +3 -1
  236. package/node_modules/tar/dist/esm/pax.js +66 -35
  237. package/node_modules/tar/dist/esm/read-entry.d.ts +97 -11
  238. package/node_modules/tar/dist/esm/read-entry.js +248 -96
  239. package/node_modules/tar/dist/esm/read-file.d.ts +22 -0
  240. package/node_modules/tar/dist/esm/read-file.js +99 -0
  241. package/node_modules/tar/dist/esm/replace.d.ts +45 -1
  242. package/node_modules/tar/dist/esm/replace.js +160 -207
  243. package/node_modules/tar/dist/esm/server/codecs.d.ts +38 -0
  244. package/node_modules/tar/dist/esm/server/codecs.js +214 -0
  245. package/node_modules/tar/dist/esm/server/index.d.ts +115 -0
  246. package/node_modules/tar/dist/esm/server/index.js +102 -0
  247. package/node_modules/tar/dist/esm/server/index.min.js +3 -0
  248. package/node_modules/tar/dist/esm/strip-absolute-path.d.ts +8 -0
  249. package/node_modules/tar/dist/esm/strip-absolute-path.js +17 -20
  250. package/node_modules/tar/dist/esm/to-stream.d.ts +7 -0
  251. package/node_modules/tar/dist/esm/to-stream.js +18 -0
  252. package/node_modules/tar/dist/esm/types.d.ts +4 -3
  253. package/node_modules/tar/dist/esm/types.js +4 -3
  254. package/node_modules/tar/dist/esm/unpack.d.ts +143 -89
  255. package/node_modules/tar/dist/esm/unpack.js +776 -719
  256. package/node_modules/tar/dist/esm/update.d.ts +11 -1
  257. package/node_modules/tar/dist/esm/update.js +35 -28
  258. package/node_modules/tar/dist/esm/warn.d.ts +27 -0
  259. package/node_modules/tar/dist/esm/warn.js +31 -0
  260. package/node_modules/tar/dist/esm/win32-path.d.ts +16 -0
  261. package/node_modules/tar/dist/esm/win32-path.js +60 -0
  262. package/node_modules/tar/dist/esm/write-entry.d.ts +64 -111
  263. package/node_modules/tar/dist/esm/write-entry.js +107 -633
  264. package/node_modules/tar/dist/esm/write-flag.d.ts +18 -0
  265. package/node_modules/tar/dist/esm/write-flag.js +25 -0
  266. package/node_modules/tar/package.json +68 -224
  267. package/package.json +2 -2
  268. package/packages/pm-beads/package.json +1 -1
  269. package/packages/pm-calendar/package.json +1 -1
  270. package/packages/pm-command-kit/package.json +1 -1
  271. package/packages/pm-digital-twin/package.json +1 -1
  272. package/packages/pm-governance-audit/package.json +1 -1
  273. package/packages/pm-guide-shell/package.json +1 -1
  274. package/packages/pm-kanban/package.json +1 -1
  275. package/packages/pm-lifecycle-hooks/package.json +1 -1
  276. package/packages/pm-linked-test-adapters/package.json +1 -1
  277. package/packages/pm-search-advanced/package.json +1 -1
  278. package/packages/pm-templates/package.json +1 -1
  279. package/packages/pm-todos/package.json +1 -1
  280. package/packages/pm-vcs/package.json +1 -1
  281. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  282. package/plugins/pm-claude/package.json +1 -1
  283. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  284. package/plugins/pm-codex/package.json +1 -1
  285. package/plugins/pm-codex/plugin.json +1 -1
  286. package/runtime-dependencies.json +1 -1
  287. package/dist/cli-bundle/chunks/chunk-A5ZEMOVR.js +0 -2
  288. package/dist/cli-bundle/chunks/chunk-AJLU6KLW.js +0 -2
  289. package/dist/cli-bundle/chunks/chunk-C6WM6ZN4.js +0 -9
  290. package/dist/cli-bundle/chunks/chunk-HZZLSBIJ.js +0 -2
  291. package/dist/cli-bundle/chunks/chunk-L2ZSSMYY.js +0 -2
  292. package/dist/cli-bundle/chunks/chunk-NRQCBUYD.js +0 -113
  293. package/dist/cli-bundle/chunks/chunk-QDV7S2QS.js +0 -2
  294. package/dist/cli-bundle/chunks/item-revision-3LENTXYF.js +0 -2
  295. package/dist/cli-bundle/chunks/item-transaction-66RDV7PH.js +0 -2
  296. package/dist/cli-bundle/focused-chunks/chunk-HTDYNY4L.js +0 -2
  297. package/dist/cli-bundle/focused-chunks/chunk-N64AC5G6.js +0 -100
  298. package/dist/cli-bundle/focused-chunks/chunk-PT7RT3T6.js +0 -44
  299. package/dist/cli-bundle/focused-chunks/chunk-QZRYGYTI.js +0 -2
  300. package/dist/cli-bundle/focused-chunks/chunk-SQMOF65W.js +0 -2
  301. package/dist/cli-bundle/focused-chunks/chunk-T3ILWAEV.js +0 -2
  302. package/dist/cli-bundle/focused-chunks/chunk-W4JMV7GF.js +0 -3
  303. package/dist/cli-bundle/focused-chunks/item-revision-723XCQPS.js +0 -2
  304. package/node_modules/@isaacs/fs-minipass/LICENSE +0 -15
  305. package/node_modules/@isaacs/fs-minipass/README.md +0 -71
  306. package/node_modules/@isaacs/fs-minipass/dist/commonjs/index.d.ts +0 -118
  307. package/node_modules/@isaacs/fs-minipass/dist/commonjs/index.js +0 -430
  308. package/node_modules/@isaacs/fs-minipass/dist/commonjs/package.json +0 -3
  309. package/node_modules/@isaacs/fs-minipass/dist/esm/index.d.ts +0 -118
  310. package/node_modules/@isaacs/fs-minipass/dist/esm/index.js +0 -420
  311. package/node_modules/@isaacs/fs-minipass/dist/esm/package.json +0 -3
  312. package/node_modules/@isaacs/fs-minipass/package.json +0 -72
  313. package/node_modules/chownr/LICENSE.md +0 -63
  314. package/node_modules/chownr/README.md +0 -3
  315. package/node_modules/chownr/dist/commonjs/index.d.ts +0 -3
  316. package/node_modules/chownr/dist/commonjs/index.js +0 -93
  317. package/node_modules/chownr/dist/commonjs/package.json +0 -3
  318. package/node_modules/chownr/dist/esm/index.d.ts +0 -3
  319. package/node_modules/chownr/dist/esm/index.js +0 -85
  320. package/node_modules/chownr/dist/esm/package.json +0 -3
  321. package/node_modules/chownr/package.json +0 -69
  322. package/node_modules/minipass/LICENSE.md +0 -55
  323. package/node_modules/minipass/README.md +0 -825
  324. package/node_modules/minipass/dist/commonjs/index.d.ts +0 -545
  325. package/node_modules/minipass/dist/commonjs/index.js +0 -1038
  326. package/node_modules/minipass/dist/commonjs/package.json +0 -3
  327. package/node_modules/minipass/dist/esm/index.d.ts +0 -545
  328. package/node_modules/minipass/dist/esm/index.js +0 -1020
  329. package/node_modules/minipass/dist/esm/package.json +0 -3
  330. package/node_modules/minipass/package.json +0 -77
  331. package/node_modules/minizlib/LICENSE +0 -26
  332. package/node_modules/minizlib/README.md +0 -64
  333. package/node_modules/minizlib/dist/commonjs/constants.d.ts +0 -2
  334. package/node_modules/minizlib/dist/commonjs/constants.js +0 -123
  335. package/node_modules/minizlib/dist/commonjs/index.d.ts +0 -99
  336. package/node_modules/minizlib/dist/commonjs/index.js +0 -416
  337. package/node_modules/minizlib/dist/commonjs/package.json +0 -3
  338. package/node_modules/minizlib/dist/esm/constants.d.ts +0 -2
  339. package/node_modules/minizlib/dist/esm/constants.js +0 -117
  340. package/node_modules/minizlib/dist/esm/index.d.ts +0 -99
  341. package/node_modules/minizlib/dist/esm/index.js +0 -363
  342. package/node_modules/minizlib/dist/esm/package.json +0 -3
  343. package/node_modules/minizlib/package.json +0 -80
  344. package/node_modules/tar/dist/commonjs/get-write-flag.d.ts +0 -2
  345. package/node_modules/tar/dist/commonjs/get-write-flag.js +0 -32
  346. package/node_modules/tar/dist/commonjs/make-command.d.ts +0 -49
  347. package/node_modules/tar/dist/commonjs/make-command.js +0 -52
  348. package/node_modules/tar/dist/commonjs/normalize-windows-path.d.ts +0 -2
  349. package/node_modules/tar/dist/commonjs/normalize-windows-path.js +0 -12
  350. package/node_modules/tar/dist/commonjs/parse.d.ts +0 -92
  351. package/node_modules/tar/dist/commonjs/parse.js +0 -655
  352. package/node_modules/tar/dist/commonjs/process-umask.d.ts +0 -2
  353. package/node_modules/tar/dist/commonjs/process-umask.js +0 -7
  354. package/node_modules/tar/dist/commonjs/warn-method.d.ts +0 -24
  355. package/node_modules/tar/dist/commonjs/warn-method.js +0 -31
  356. package/node_modules/tar/dist/esm/get-write-flag.d.ts +0 -2
  357. package/node_modules/tar/dist/esm/get-write-flag.js +0 -26
  358. package/node_modules/tar/dist/esm/make-command.d.ts +0 -49
  359. package/node_modules/tar/dist/esm/make-command.js +0 -48
  360. package/node_modules/tar/dist/esm/normalize-windows-path.d.ts +0 -2
  361. package/node_modules/tar/dist/esm/normalize-windows-path.js +0 -9
  362. package/node_modules/tar/dist/esm/parse.d.ts +0 -92
  363. package/node_modules/tar/dist/esm/parse.js +0 -651
  364. package/node_modules/tar/dist/esm/process-umask.d.ts +0 -2
  365. package/node_modules/tar/dist/esm/process-umask.js +0 -3
  366. package/node_modules/tar/dist/esm/warn-method.d.ts +0 -24
  367. package/node_modules/tar/dist/esm/warn-method.js +0 -27
  368. package/node_modules/yallist/LICENSE.md +0 -63
  369. package/node_modules/yallist/README.md +0 -205
  370. package/node_modules/yallist/dist/commonjs/index.d.ts +0 -39
  371. package/node_modules/yallist/dist/commonjs/index.js +0 -384
  372. package/node_modules/yallist/dist/commonjs/package.json +0 -3
  373. package/node_modules/yallist/dist/esm/index.d.ts +0 -39
  374. package/node_modules/yallist/dist/esm/index.js +0 -379
  375. package/node_modules/yallist/dist/esm/package.json +0 -3
  376. package/node_modules/yallist/package.json +0 -68
@@ -0,0 +1,18 @@
1
+ /** The flag values of `fs.constants` that the extraction uses. */
2
+ export type OpenConstants = {
3
+ O_CREAT: number;
4
+ O_TRUNC: number;
5
+ O_WRONLY: number;
6
+ O_NOFOLLOW?: number;
7
+ UV_FS_O_FILEMAP?: number;
8
+ };
9
+ /**
10
+ * Make the function that gives the `open` flag for a new file of a
11
+ * given size.
12
+ *
13
+ * With `O_NOFOLLOW`, `open` fails if the path is a symbolic link.
14
+ * Windows does not have it. If `constants` is not set, the flag is
15
+ * `'w'`.
16
+ */
17
+ export declare const writeFlags: (constants: OpenConstants | undefined, win32: boolean) => ((size: number) => string | number);
18
+ //# sourceMappingURL=write-flag.d.ts.map
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.writeFlags = void 0;
4
+ // Windows writes a small file faster through a file mapping.
5
+ const FMAP_LIMIT = 512 * 1024;
6
+ /**
7
+ * Make the function that gives the `open` flag for a new file of a
8
+ * given size.
9
+ *
10
+ * With `O_NOFOLLOW`, `open` fails if the path is a symbolic link.
11
+ * Windows does not have it. If `constants` is not set, the flag is
12
+ * `'w'`.
13
+ */
14
+ const writeFlags = (constants, win32) => {
15
+ if (!constants)
16
+ return () => 'w';
17
+ const { O_CREAT, O_TRUNC, O_WRONLY, O_NOFOLLOW, UV_FS_O_FILEMAP } = constants;
18
+ const write = O_TRUNC | O_CREAT | O_WRONLY;
19
+ if (!win32) {
20
+ const flag = typeof O_NOFOLLOW === 'number' ? O_NOFOLLOW | write : 'w';
21
+ return () => flag;
22
+ }
23
+ if (!UV_FS_O_FILEMAP)
24
+ return () => 'w';
25
+ const fmap = UV_FS_O_FILEMAP | write;
26
+ return size => (size < FMAP_LIMIT ? fmap : 'w');
27
+ };
28
+ exports.writeFlags = writeFlags;
29
+ //# sourceMappingURL=write-flag.js.map
@@ -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,72 @@
1
+ // Text and byte helpers that work on a plain Uint8Array in any
2
+ // JavaScript runtime, and type checks for the input of a caller.
3
+ //
4
+ // A check with `instanceof` is false for an object that a different
5
+ // realm made, such as a Node.js `Buffer` in a `node:vm` context, or a
6
+ // `Blob` of a different window. These checks are true for an object
7
+ // of each realm.
8
+ /** True for a `Uint8Array`, and for a subclass such as `Buffer`. */
9
+ export const isUint8Array = (x) => ArrayBuffer.isView(x) &&
10
+ x[Symbol.toStringTag] === 'Uint8Array';
11
+ /** True for an `ArrayBuffer`. */
12
+ export const isArrayBuffer = (x) => Object.prototype.toString.call(x) === '[object ArrayBuffer]';
13
+ /** True for an object that has the size and the stream of a `Blob`. */
14
+ export const isBlob = (x) => typeof x?.size === 'number' &&
15
+ typeof x.stream === 'function';
16
+ /** True for an object that has the reader of a `ReadableStream`. */
17
+ export const isReadableStream = (x) => typeof x?.getReader === 'function';
18
+ // A name can start with U+FEFF. The decoder must keep it.
19
+ const decoder = new TextDecoder('utf-8', { ignoreBOM: true });
20
+ const encoder = new TextEncoder();
21
+ /** The number of bytes in the UTF-8 form of the string. */
22
+ export const utf8Length = (str) => {
23
+ let len = str.length;
24
+ for (let i = 0; i < str.length; i++) {
25
+ const c = str.charCodeAt(i);
26
+ if (c < 0x80)
27
+ continue;
28
+ if (c < 0x800) {
29
+ len += 1;
30
+ }
31
+ else if (c >= 0xd800 &&
32
+ c <= 0xdbff &&
33
+ (str.charCodeAt(i + 1) & 0xfc00) === 0xdc00) {
34
+ // A surrogate pair is 2 code units, and 4 bytes.
35
+ len += 2;
36
+ i++;
37
+ }
38
+ else {
39
+ len += 2;
40
+ }
41
+ }
42
+ return len;
43
+ };
44
+ /** Decode the bytes from `start` to `end` as UTF-8. */
45
+ export const decodeUtf8 = (buf, start = 0, end = buf.length) => {
46
+ // Most names in an archive are short ASCII. That case needs no
47
+ // decoder call.
48
+ let str = '';
49
+ for (let i = start; i < end; i++) {
50
+ const c = buf[i];
51
+ if (c >= 0x80)
52
+ return decoder.decode(buf.subarray(start, end));
53
+ str += String.fromCharCode(c);
54
+ }
55
+ return str;
56
+ };
57
+ /**
58
+ * Write the string as UTF-8 into `size` bytes at `off`. Fill the bytes
59
+ * that are left with zeros. A character that does not fit completely
60
+ * is not written.
61
+ */
62
+ export const encodeUtf8Into = (str, buf, off, size) => {
63
+ const { written } = encoder.encodeInto(str, buf.subarray(off, off + size));
64
+ buf.fill(0, off + written, off + size);
65
+ };
66
+ /** Write a string of ASCII characters at `off`. */
67
+ export const writeAscii = (str, buf, off) => {
68
+ for (let i = 0; i < str.length; i++) {
69
+ buf[off + i] = str.charCodeAt(i);
70
+ }
71
+ };
72
+ //# 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,32 @@
1
+ /**
2
+ * Gzip with the `DecompressionStream` and `CompressionStream` of the
3
+ * runtime. The async readers always have it, after `opt.codecs`.
4
+ * The option `portable` of `compress` makes output that does not
5
+ * name the system.
6
+ */
7
+ export const gzip = {
8
+ name: 'gzip',
9
+ headLength: 2,
10
+ detect: head => head[0] === 0x1f && head[1] === 0x8b,
11
+ decompress: () => new DecompressionStream('gzip'),
12
+ compress: options => {
13
+ const stream = new CompressionStream('gzip');
14
+ if (!options?.portable)
15
+ return stream;
16
+ // Byte 9 of a gzip stream names the system that made it. Set it
17
+ // to 255, "unknown", so that each system makes the same bytes.
18
+ let pos = 0;
19
+ return {
20
+ writable: stream.writable,
21
+ readable: stream.readable.pipeThrough(new TransformStream({
22
+ transform: (chunk, controller) => {
23
+ if (pos <= 9 && pos + chunk.length > 9)
24
+ chunk[9 - pos] = 255;
25
+ pos += chunk.length;
26
+ controller.enqueue(chunk);
27
+ },
28
+ })),
29
+ };
30
+ },
31
+ };
32
+ //# 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,16 @@
1
+ /** Copy the parts into one new array. */
2
+ export const concat = (parts) => {
3
+ if (parts.length === 1)
4
+ return parts[0].slice();
5
+ let length = 0;
6
+ for (const part of parts)
7
+ length += part.length;
8
+ const out = new Uint8Array(length);
9
+ let pos = 0;
10
+ for (const part of parts) {
11
+ out.set(part, pos);
12
+ pos += part.length;
13
+ }
14
+ return out;
15
+ };
16
+ //# 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,76 +1,159 @@
1
- import { WriteStream, WriteStreamSync } from '@isaacs/fs-minipass';
2
- import path from 'node:path';
3
- import { list } from './list.js';
4
- import { makeCommand } from './make-command.js';
5
- import { Pack, PackSync } from './pack.js';
6
- const createFileSync = (opt, files) => {
7
- const p = new PackSync(opt);
8
- const stream = new WriteStreamSync(opt.file, {
9
- mode: opt.mode || 0o666,
10
- });
11
- p.pipe(stream);
12
- addFilesSync(p, files);
1
+ import { dealias, } from './dealias.js';
2
+ import { TarReader, TarReaderSync } from './entries.js';
3
+ import { Pack, PackSync, } from './pack.js';
4
+ import { readFile, readFileSync } from './read-file.js';
5
+ import { toStream } from './to-stream.js';
6
+ // Chunks that are smaller than this are put together for one write.
7
+ const SMALL = 64 * 1024;
8
+ const BATCH = 4 * SMALL;
9
+ const noop = () => { };
10
+ const check = (opt, files) => {
11
+ if (!files?.length) {
12
+ throw new TypeError('no paths specified to add to archive');
13
+ }
14
+ if (opt.file && !opt.fs) {
15
+ throw new TypeError('the file option needs the fs option');
16
+ }
13
17
  };
14
- const createFile = (opt, files) => {
15
- const p = new Pack(opt);
16
- const stream = new WriteStream(opt.file, {
17
- mode: opt.mode || 0o666,
18
- });
19
- p.pipe(stream);
20
- const promise = new Promise((res, rej) => {
21
- stream.on('error', rej);
22
- stream.on('close', res);
23
- p.on('error', rej);
24
- });
25
- addFilesAsync(p, files).catch(er => p.emit('error', er));
26
- return promise;
18
+ const writeAll = async (handle, buf, length, position) => {
19
+ for (let off = 0; off < length;) {
20
+ off += (await handle.write(buf, off, length - off, position + off))
21
+ .bytesWritten;
22
+ }
27
23
  };
28
- const addFilesSync = (p, files) => {
29
- files.forEach(file => {
30
- if (file.charAt(0) === '@') {
31
- list({
32
- file: path.resolve(p.cwd, file.slice(1)),
33
- sync: true,
34
- noResume: true,
35
- onReadEntry: entry => p.add(entry),
36
- });
24
+ /**
25
+ * Write the chunks to the file, from `position`. Chunks that are
26
+ * smaller than 64 KiB are put together for one write.
27
+ */
28
+ export const writeChunks = async (handle, chunks, position) => {
29
+ const batch = new Uint8Array(BATCH);
30
+ let used = 0;
31
+ const flush = async () => {
32
+ await writeAll(handle, batch, used, position);
33
+ position += used;
34
+ used = 0;
35
+ };
36
+ for await (const chunk of chunks) {
37
+ if (used + chunk.length > BATCH || chunk.length >= SMALL)
38
+ await flush();
39
+ if (chunk.length >= SMALL) {
40
+ await writeAll(handle, chunk, chunk.length, position);
41
+ position += chunk.length;
37
42
  }
38
43
  else {
39
- p.add(file);
44
+ batch.set(chunk, used);
45
+ used += chunk.length;
40
46
  }
41
- });
42
- p.end();
47
+ }
48
+ await flush();
43
49
  };
44
- const addFilesAsync = async (p, files) => {
45
- for (const file of files) {
46
- if (file.charAt(0) === '@') {
47
- await list({
48
- file: path.resolve(String(p.cwd), file.slice(1)),
49
- noResume: true,
50
- onReadEntry: entry => {
51
- p.add(entry);
52
- },
53
- });
50
+ /** The sync form of `writeChunks`. */
51
+ export const writeChunksSync = (fs, fd, chunks, position) => {
52
+ const batch = new Uint8Array(BATCH);
53
+ let used = 0;
54
+ const write = (buf, length) => {
55
+ for (let off = 0; off < length;) {
56
+ off += fs.writeSync(fd, buf, off, length - off, position + off);
54
57
  }
58
+ position += length;
59
+ };
60
+ for (const chunk of chunks) {
61
+ if (used + chunk.length > BATCH || chunk.length >= SMALL) {
62
+ write(batch, used);
63
+ used = 0;
64
+ }
65
+ if (chunk.length >= SMALL)
66
+ write(chunk, chunk.length);
55
67
  else {
56
- p.add(file);
68
+ batch.set(chunk, used);
69
+ used += chunk.length;
57
70
  }
58
71
  }
59
- p.end();
72
+ write(batch, used);
60
73
  };
61
- const createSync = (opt, files) => {
62
- const p = new PackSync(opt);
63
- addFilesSync(p, files);
64
- return p;
74
+ const createFile = async (pack, fs, file, mode) => {
75
+ const handle = await fs.open(file, 'w', mode);
76
+ let ok = false;
77
+ try {
78
+ await writeChunks(handle, pack, 0);
79
+ ok = true;
80
+ }
81
+ finally {
82
+ const closed = handle.close();
83
+ await (ok ? closed : closed.catch(noop));
84
+ }
65
85
  };
66
- const createAsync = (opt, files) => {
67
- const p = new Pack(opt);
68
- addFilesAsync(p, files).catch(er => p.emit('error', er));
69
- return p;
86
+ /**
87
+ * Make the pack for the files of a command. A name that starts with
88
+ * `@` is the path of an archive: the pack gets its entries.
89
+ */
90
+ export const packFiles = (opt, files) => {
91
+ const { fs, strict, onwarn, codecs, platform } = opt;
92
+ const pack = new Pack(opt);
93
+ for (const item of files) {
94
+ if (typeof item !== 'string' || item.charAt(0) !== '@')
95
+ pack.add(item);
96
+ else {
97
+ const archive = pack.resolve(item.slice(1));
98
+ pack.add(new TarReader(readFile(fs, archive, opt.maxReadSize), {
99
+ strict,
100
+ onwarn,
101
+ codecs,
102
+ platform,
103
+ file: archive,
104
+ }));
105
+ }
106
+ }
107
+ return pack.end();
70
108
  };
71
- export const create = makeCommand(createFileSync, createFile, createSync, createAsync, (_opt, files) => {
72
- if (!files?.length) {
73
- throw new TypeError('no paths specified to add to archive');
109
+ /** The sync form of `packFiles`. */
110
+ export const packFilesSync = (opt, files) => {
111
+ const { strict, onwarn, codecs, platform } = opt;
112
+ const pack = new PackSync(opt);
113
+ for (const item of files) {
114
+ if (typeof item !== 'string' || item.charAt(0) !== '@')
115
+ pack.add(item);
116
+ else {
117
+ const archive = pack.resolve(item.slice(1));
118
+ pack.add(new TarReaderSync(readFileSync(opt.fs, archive, opt.maxReadSize), { strict, onwarn, codecs, platform, file: archive }));
119
+ }
120
+ }
121
+ return pack;
122
+ };
123
+ export function create(options, files) {
124
+ const opt = dealias(options);
125
+ if (!opt.file) {
126
+ check(opt, files);
127
+ return toStream(packFiles(opt, files));
128
+ }
129
+ // The file form returns a promise, so a bad argument rejects it.
130
+ try {
131
+ check(opt, files);
132
+ return createFile(packFiles(opt, files), opt.fs, opt.file, opt.mode || 0o666);
133
+ }
134
+ catch (er) {
135
+ return Promise.reject(er);
136
+ }
137
+ }
138
+ export function createSync(options, files) {
139
+ const opt = dealias(options);
140
+ check(opt, files);
141
+ const { file } = opt;
142
+ const fs = opt.fs;
143
+ const pack = packFilesSync(opt, files);
144
+ if (!file)
145
+ return pack;
146
+ const fd = fs.openSync(file, 'w', opt.mode || 0o666);
147
+ try {
148
+ writeChunksSync(fs, fd, pack, 0);
149
+ }
150
+ catch (er) {
151
+ try {
152
+ fs.closeSync(fd);
153
+ }
154
+ catch { }
155
+ throw er;
74
156
  }
75
- });
157
+ fs.closeSync(fd);
158
+ }
76
159
  //# 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,46 @@
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 const aliases = {
7
+ C: 'cwd',
8
+ f: 'file',
9
+ z: 'gzip',
10
+ P: 'preservePaths',
11
+ U: 'unlink',
12
+ 'strip-components': 'strip',
13
+ stripComponents: 'strip',
14
+ 'keep-newer': 'newer',
15
+ keepNewer: 'newer',
16
+ 'keep-newer-files': 'newer',
17
+ keepNewerFiles: 'newer',
18
+ k: 'keep',
19
+ 'keep-existing': 'keep',
20
+ keepExisting: 'keep',
21
+ m: 'noMtime',
22
+ 'no-mtime': 'noMtime',
23
+ p: 'preserveOwner',
24
+ L: 'follow',
25
+ h: 'follow',
26
+ onentry: 'onEntry',
27
+ onReadEntry: 'onEntry',
28
+ };
29
+ /**
30
+ * A copy of the options, with no prototype, that has the name of the
31
+ * option in place of each alias. An option that is set wins over its
32
+ * aliases.
33
+ */
34
+ export const dealias = (options) => {
35
+ const opt = Object.assign(Object.create(null), options);
36
+ for (const [alias, name] of Object.entries(aliases)) {
37
+ if (opt[alias] !== undefined)
38
+ opt[name] ??= opt[alias];
39
+ delete opt[alias];
40
+ }
41
+ if (opt.noChmod === false)
42
+ opt.chmod ??= true;
43
+ delete opt.noChmod;
44
+ return opt;
45
+ };
46
+ //# 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