@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,98 @@
1
+ import { Header } from './header.js';
2
+ import { Pax } from './pax.js';
3
+ import { type ParserOptions } from './options.js';
4
+ import { EntryData } from './read-entry.js';
5
+ import { type WarnData } from './warn.js';
6
+ /** What `Parser.next()` returns. */
7
+ export type ParseEvent<E extends EntryData = EntryData> =
8
+ /**
9
+ * An entry that is not a PAX or GNU meta entry. If `entry.ignore`
10
+ * is set, the parser skips the body, and no other event follows
11
+ * for this entry.
12
+ */
13
+ {
14
+ type: 'entry';
15
+ entry: E;
16
+ }
17
+ /** A part of the body of the entry. A view into the input. */
18
+ | {
19
+ type: 'body';
20
+ data: Uint8Array;
21
+ }
22
+ /** The end of the body of the entry. */
23
+ | {
24
+ type: 'entryEnd';
25
+ }
26
+ /** The end of the archive. No event follows. */
27
+ | {
28
+ type: 'end';
29
+ };
30
+ /** Makes the entry object for a header. */
31
+ export type CreateEntry<E extends EntryData> = (header: Header, ex: Pax | undefined, gex: Pax | undefined) => E;
32
+ /**
33
+ * A tar parser that the caller pulls. Give it input with `push()`,
34
+ * and call `next()` for each event until it returns `undefined`.
35
+ * Then give it more input, or call `end()` and call `next()` again.
36
+ *
37
+ * It does not decompress. It calls no code of the caller but
38
+ * `filter`, `onwarn`, and the function that makes the entry objects.
39
+ *
40
+ * With `strict`, `next()` throws at each problem. The parser stays
41
+ * usable: the next call continues after the block with the problem.
42
+ *
43
+ * If the parser cannot know the size or the name of an entry,
44
+ * `next()` throws a `TAR_BAD_ARCHIVE` error, also without `strict`.
45
+ * The parser reads no more of the archive after that.
46
+ */
47
+ export declare class Parser<E extends EntryData = EntryData> {
48
+ #private;
49
+ maxMetaEntrySize: number;
50
+ /**
51
+ * The number of input bytes up to the end of the last complete
52
+ * entry that is not a meta entry.
53
+ */
54
+ position: number;
55
+ /**
56
+ * The number of input bytes that are parsed: the header blocks and
57
+ * the body blocks. At an `entry` event, it is the place of the body
58
+ * of the entry in the input.
59
+ */
60
+ offset: number;
61
+ /**
62
+ * @param createEntry makes the object for each entry event. It is
63
+ * required if `E` is not `EntryData`.
64
+ */
65
+ constructor(opt?: ParserOptions<E>, createEntry?: CreateEntry<E>);
66
+ /**
67
+ * Report a problem to `onwarn`. Throws if `strict` is set, or if
68
+ * `data.recoverable` is false.
69
+ */
70
+ warn(code: string, message: string | Error, data?: WarnData): void;
71
+ /**
72
+ * Add input. The parser keeps the chunk until `next()` returns
73
+ * `undefined`, and each body event is a view into it. Input after
74
+ * `end()`, or after the end of the archive, is dropped.
75
+ */
76
+ push(chunk: Uint8Array): void;
77
+ /** Tell the parser that the input is complete. */
78
+ end(): void;
79
+ /**
80
+ * The number of bytes of the body of the current entry, with its
81
+ * padding, that are after the input given so far. The caller can
82
+ * skip them in its input, and call `skipBody()`. It is 0 if the
83
+ * parser has input that it did not parse, and in a PAX or GNU
84
+ * header, because the parser reads that body.
85
+ */
86
+ get bodyRemain(): number;
87
+ /**
88
+ * Count the `bodyRemain` bytes as parsed. The next input is the
89
+ * header after the body.
90
+ */
91
+ skipBody(): void;
92
+ /**
93
+ * The next event. `undefined` means that the parser needs more
94
+ * input, or after the `end` event, that it is done.
95
+ */
96
+ next(): ParseEvent<E> | undefined;
97
+ }
98
+ //# sourceMappingURL=parser.d.ts.map
@@ -0,0 +1,452 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Parser = void 0;
4
+ const bytes_js_1 = require("./bytes.js");
5
+ const header_js_1 = require("./header.js");
6
+ const pax_js_1 = require("./pax.js");
7
+ const options_js_1 = require("./options.js");
8
+ const read_entry_js_1 = require("./read-entry.js");
9
+ const warn_js_1 = require("./warn.js");
10
+ const BEGIN = 0;
11
+ const HEADER = 1;
12
+ const BODY = 2;
13
+ const IGNORE = 3;
14
+ const META = 4;
15
+ const ENTRY_END = { type: 'entryEnd' };
16
+ const END = { type: 'end' };
17
+ const metaTypes = new Set([
18
+ 'ExtendedHeader',
19
+ 'OldExtendedHeader',
20
+ 'GlobalExtendedHeader',
21
+ 'NextFileHasLongPath',
22
+ 'NextFileHasLongLinkpath',
23
+ ]);
24
+ // An entry of these types has no body. If its size is not 0, some
25
+ // tar programs skip a body of that size, and others read the next
26
+ // block as a header.
27
+ const noBodyTypes = new Set([
28
+ 'Link',
29
+ 'SymbolicLink',
30
+ 'CharacterDevice',
31
+ 'BlockDevice',
32
+ 'FIFO',
33
+ 'TapeVolumeHeader',
34
+ ]);
35
+ // The text up to the first NUL.
36
+ const cstring = (buf) => {
37
+ const nul = buf.indexOf(0);
38
+ return (0, bytes_js_1.decodeUtf8)(buf, 0, nul === -1 ? buf.length : nul);
39
+ };
40
+ /**
41
+ * A tar parser that the caller pulls. Give it input with `push()`,
42
+ * and call `next()` for each event until it returns `undefined`.
43
+ * Then give it more input, or call `end()` and call `next()` again.
44
+ *
45
+ * It does not decompress. It calls no code of the caller but
46
+ * `filter`, `onwarn`, and the function that makes the entry objects.
47
+ *
48
+ * With `strict`, `next()` throws at each problem. The parser stays
49
+ * usable: the next call continues after the block with the problem.
50
+ *
51
+ * If the parser cannot know the size or the name of an entry,
52
+ * `next()` throws a `TAR_BAD_ARCHIVE` error, also without `strict`.
53
+ * The parser reads no more of the archive after that.
54
+ */
55
+ class Parser {
56
+ maxMetaEntrySize;
57
+ /**
58
+ * The number of input bytes up to the end of the last complete
59
+ * entry that is not a meta entry.
60
+ */
61
+ position = 0;
62
+ /**
63
+ * The number of input bytes that are parsed: the header blocks and
64
+ * the body blocks. At an `entry` event, it is the place of the body
65
+ * of the entry in the input.
66
+ */
67
+ offset = 0;
68
+ #opt;
69
+ #filter;
70
+ #create;
71
+ #queue = [];
72
+ #chunk;
73
+ #pos = 0;
74
+ // a header block that is in more than one chunk
75
+ #block;
76
+ #blockLen = 0;
77
+ #state = BEGIN;
78
+ // the entry of the body that is read or skipped now
79
+ #entry;
80
+ #header;
81
+ #meta;
82
+ #metaLen = 0;
83
+ // body bytes to come, without and with the padding
84
+ #remain = 0;
85
+ #blockRemain = 0;
86
+ #ex;
87
+ // the names of the GNU long name headers for the next entry
88
+ #longPath;
89
+ #longLinkpath;
90
+ #gex;
91
+ #ended = false;
92
+ #sawValid;
93
+ // The body that the parser skips is the body of a refused header.
94
+ #refused = false;
95
+ #entryEnd = false;
96
+ // 0: reading, 1: the end is found, 2: the end event is returned
97
+ #done = 0;
98
+ /**
99
+ * @param createEntry makes the object for each entry event. It is
100
+ * required if `E` is not `EntryData`.
101
+ */
102
+ constructor(opt = {}, createEntry) {
103
+ opt = this.#opt = (0, options_js_1.ownOptions)(opt);
104
+ this.maxMetaEntrySize = opt.maxMetaEntrySize || 1024 * 1024;
105
+ this.#filter = opt.filter;
106
+ const win32 = opt.platform === 'win32';
107
+ this.#create =
108
+ createEntry ??
109
+ ((header, ex, gex) => new read_entry_js_1.EntryData(header, ex, gex, win32));
110
+ }
111
+ /**
112
+ * Report a problem to `onwarn`. Throws if `strict` is set, or if
113
+ * `data.recoverable` is false.
114
+ */
115
+ warn(code, message, data) {
116
+ (0, warn_js_1.warn)(this.#opt, code, message, data);
117
+ }
118
+ /**
119
+ * Add input. The parser keeps the chunk until `next()` returns
120
+ * `undefined`, and each body event is a view into it. Input after
121
+ * `end()`, or after the end of the archive, is dropped.
122
+ */
123
+ push(chunk) {
124
+ if (!this.#ended)
125
+ this.#queue.push(chunk);
126
+ }
127
+ /** Tell the parser that the input is complete. */
128
+ end() {
129
+ this.#ended = true;
130
+ }
131
+ /**
132
+ * The number of bytes of the body of the current entry, with its
133
+ * padding, that are after the input given so far. The caller can
134
+ * skip them in its input, and call `skipBody()`. It is 0 if the
135
+ * parser has input that it did not parse, and in a PAX or GNU
136
+ * header, because the parser reads that body.
137
+ */
138
+ get bodyRemain() {
139
+ const chunk = this.#chunk;
140
+ const state = this.#state;
141
+ return ((state !== BODY && state !== IGNORE) ||
142
+ this.#queue.length ||
143
+ (chunk && this.#pos < chunk.length)) ?
144
+ 0
145
+ : this.#blockRemain;
146
+ }
147
+ /**
148
+ * Count the `bodyRemain` bytes as parsed. The next input is the
149
+ * header after the body.
150
+ */
151
+ skipBody() {
152
+ this.#entryEnd = this.#state === BODY;
153
+ this.offset += this.#blockRemain;
154
+ this.#remain = this.#blockRemain = 0;
155
+ this.#endBody();
156
+ }
157
+ /**
158
+ * The next event. `undefined` means that the parser needs more
159
+ * input, or after the `end` event, that it is done.
160
+ */
161
+ next() {
162
+ if (this.#entryEnd) {
163
+ this.#entryEnd = false;
164
+ return ENTRY_END;
165
+ }
166
+ for (;;) {
167
+ let chunk = this.#chunk;
168
+ let pos = this.#pos;
169
+ if (!chunk || pos === chunk.length) {
170
+ chunk = this.#chunk = this.#queue.shift();
171
+ pos = this.#pos = 0;
172
+ if (!chunk) {
173
+ if (!this.#ended || this.#done === 2)
174
+ return undefined;
175
+ const ev = this.#finish();
176
+ if (ev)
177
+ return ev;
178
+ }
179
+ continue;
180
+ }
181
+ const avail = chunk.length - pos;
182
+ const state = this.#state;
183
+ if (state <= HEADER) {
184
+ let ev;
185
+ if (this.#blockLen === 0 && avail >= 512) {
186
+ this.#pos = pos + 512;
187
+ ev = this.#consumeHeader(chunk, pos);
188
+ }
189
+ else {
190
+ const block = (this.#block ??= new Uint8Array(512));
191
+ const n = Math.min(512 - this.#blockLen, avail);
192
+ block.set(chunk.subarray(pos, pos + n), this.#blockLen);
193
+ this.#pos = pos + n;
194
+ this.#blockLen += n;
195
+ if (this.#blockLen < 512)
196
+ continue;
197
+ this.#blockLen = 0;
198
+ ev = this.#consumeHeader(block, 0);
199
+ }
200
+ if (ev)
201
+ return ev;
202
+ continue;
203
+ }
204
+ const blockRemain = this.#blockRemain;
205
+ const n = avail < blockRemain ? avail : blockRemain;
206
+ const remain = this.#remain;
207
+ const len = n < remain ? n : remain;
208
+ this.#pos = pos + n;
209
+ this.offset += n;
210
+ this.#blockRemain = blockRemain - n;
211
+ this.#remain = remain - len;
212
+ const last = n === blockRemain;
213
+ if (state === META) {
214
+ const meta = this.#meta;
215
+ meta.set(chunk.subarray(pos, pos + len), this.#metaLen);
216
+ this.#metaLen += len;
217
+ if (last) {
218
+ this.#endBody();
219
+ this.#applyMeta(meta);
220
+ }
221
+ continue;
222
+ }
223
+ if (last)
224
+ this.#endBody();
225
+ if (state === IGNORE)
226
+ continue;
227
+ if (len === 0) {
228
+ if (last)
229
+ return ENTRY_END;
230
+ continue;
231
+ }
232
+ this.#entryEnd = last;
233
+ return {
234
+ type: 'body',
235
+ data: len === chunk.length ? chunk : chunk.subarray(pos, pos + len),
236
+ };
237
+ }
238
+ }
239
+ #endBody() {
240
+ const entry = this.#entry;
241
+ if (entry) {
242
+ this.position = this.offset;
243
+ this.#entry = undefined;
244
+ }
245
+ if (!entry?.invalid && !this.#refused)
246
+ this.#sawValid = true;
247
+ this.#refused = false;
248
+ this.#state = HEADER;
249
+ }
250
+ // The input is complete, and all of it is read.
251
+ #finish() {
252
+ const state = this.#state;
253
+ if (state > HEADER) {
254
+ // The body of the last entry is not complete.
255
+ const entry = this.#entry;
256
+ // The bytes of the last block of the input, which is not
257
+ // complete, and the bytes from the start of that block to the
258
+ // end of the body. The chunks of the input do not change them.
259
+ const held = (512 - (this.#blockRemain % 512)) % 512;
260
+ const need = this.#blockRemain + held;
261
+ this.#entry = undefined;
262
+ this.#meta = undefined;
263
+ this.#state = HEADER;
264
+ if (!entry?.invalid && !this.#refused)
265
+ this.#sawValid = true;
266
+ this.#refused = false;
267
+ this.#entryEnd = state === BODY;
268
+ this.warn('TAR_BAD_ARCHIVE', `Truncated input (needed ${need} more bytes, only ${held} available)`, { entry, header: this.#header });
269
+ return undefined;
270
+ }
271
+ if (this.#entryEnd) {
272
+ this.#entryEnd = false;
273
+ return ENTRY_END;
274
+ }
275
+ if (this.#done === 0) {
276
+ this.#done = 1;
277
+ if (state === BEGIN || this.#sawValid === false) {
278
+ // Less than one block of data, or no valid entry.
279
+ this.warn('TAR_BAD_ARCHIVE', 'Unrecognized archive format');
280
+ }
281
+ }
282
+ this.#done = 2;
283
+ return END;
284
+ }
285
+ #consumeHeader(buf, off) {
286
+ this.offset += 512;
287
+ if (this.#sawValid === undefined)
288
+ this.#sawValid = false;
289
+ // A PAX name wins over a GNU long name. The header does not use
290
+ // these values if it is a PAX or GNU header itself.
291
+ let ex = this.#ex;
292
+ const longPath = this.#longPath;
293
+ const longLinkpath = this.#longLinkpath;
294
+ if (longPath !== undefined || longLinkpath !== undefined) {
295
+ ex = Object.assign(Object.create(null), ex);
296
+ ex.path ??= longPath;
297
+ ex.linkpath ??= longLinkpath;
298
+ }
299
+ const header = new header_js_1.Header(buf, off, ex, this.#gex);
300
+ if (header.nullBlock) {
301
+ // A null block is the end of the archive, as it is for bsdtar.
302
+ // A second null block normally comes after it. All the data
303
+ // after the first one is dropped, so an entry there is not
304
+ // read.
305
+ this.#ended = true;
306
+ this.#chunk = undefined;
307
+ this.#queue.length = 0;
308
+ this.#blockLen = 0;
309
+ // The input is not shorter than one block. An archive with no
310
+ // valid entry still gets the warning of `#finish`.
311
+ this.#state = HEADER;
312
+ return;
313
+ }
314
+ const type = header.type;
315
+ const meta = metaTypes.has(type);
316
+ if (!header.cksumValid) {
317
+ this.#refuse(header, 'checksum failure', false);
318
+ return;
319
+ }
320
+ const size = header.size;
321
+ if (size === undefined)
322
+ this.#abort('invalid size', header);
323
+ // bsdtar skips a body for a directory if a PAX header gives the
324
+ // size, and GNU tar does not.
325
+ if ((size && noBodyTypes.has(type)) ||
326
+ (type === 'Directory' && ex?.size)) {
327
+ this.#abort(`${type} entry with a body`, header);
328
+ }
329
+ // Other tar programs do not use the name of a meta entry.
330
+ if (!header.path && !meta) {
331
+ this.#refuse(header, 'path is required', true);
332
+ return;
333
+ }
334
+ // The target of a link can be in a PAX header or a GNU long name.
335
+ if ((type === 'Link' || type === 'SymbolicLink') &&
336
+ !(ex?.linkpath ?? header.linkpath)) {
337
+ this.#refuse(header, 'linkpath required', true);
338
+ return;
339
+ }
340
+ this.#header = header;
341
+ this.#remain = size;
342
+ this.#blockRemain = 512 * Math.ceil(size / 512);
343
+ // A meta entry or an ignored entry is valid tar also.
344
+ if (!size)
345
+ this.#sawValid = true;
346
+ if (meta) {
347
+ if (size > this.maxMetaEntrySize) {
348
+ this.#abort(`${type} entry larger than maxMetaEntrySize`, header);
349
+ }
350
+ // Other tar programs do not agree on which of two PAX headers,
351
+ // or of two GNU long names, is the one to use.
352
+ if (type === 'NextFileHasLongPath' ? longPath !== undefined
353
+ : type === 'NextFileHasLongLinkpath' ? longLinkpath !== undefined
354
+ : type !== 'GlobalExtendedHeader' && this.#ex) {
355
+ this.#abort(`two ${type} entries for one entry`, header);
356
+ }
357
+ // Python 3.13 does not use the PAX size for the entry after the
358
+ // GNU long name.
359
+ if (this.#ex && type.startsWith('NextFile')) {
360
+ this.#abort(`${type} entry after a PAX header`, header);
361
+ }
362
+ if (size > 0) {
363
+ this.#meta = new Uint8Array(size);
364
+ this.#metaLen = 0;
365
+ this.#state = META;
366
+ }
367
+ return;
368
+ }
369
+ this.#ex = this.#longPath = this.#longLinkpath = undefined;
370
+ const entry = this.#create(header, ex, this.#gex);
371
+ if (!entry.ignore &&
372
+ this.#filter &&
373
+ !this.#filter(entry.path, entry)) {
374
+ entry.ignore = true;
375
+ }
376
+ if (size) {
377
+ this.#entry = entry;
378
+ this.#state = entry.ignore ? IGNORE : BODY;
379
+ }
380
+ else {
381
+ this.#state = HEADER;
382
+ this.position = this.offset;
383
+ this.#entryEnd = !entry.ignore;
384
+ }
385
+ return { type: 'entry', entry };
386
+ }
387
+ // Warn about a header that is not valid. The pending PAX fields
388
+ // and GNU long names described this header, so the next header
389
+ // does not get them. `sized` means that the size in the header is
390
+ // reliable, and then the parser skips the body.
391
+ #refuse(header, message, sized) {
392
+ this.#ex = this.#longPath = this.#longLinkpath = undefined;
393
+ const size = sized ? header.size : 0;
394
+ if (size) {
395
+ this.#header = header;
396
+ this.#remain = size;
397
+ this.#blockRemain = 512 * Math.ceil(size / 512);
398
+ this.#state = IGNORE;
399
+ this.#refused = true;
400
+ }
401
+ this.warn('TAR_ENTRY_INVALID', message, { header });
402
+ }
403
+ // Stop the archive with an error. The parser does not know the
404
+ // size or the name of an entry, so it cannot know which of the
405
+ // next blocks are headers.
406
+ #abort(message, header) {
407
+ this.#ended = true;
408
+ this.#chunk = this.#meta = undefined;
409
+ this.#queue.length = 0;
410
+ this.#blockLen = 0;
411
+ this.#state = HEADER;
412
+ this.#done = 2;
413
+ throw (0, warn_js_1.tarError)(this.#opt, 'TAR_BAD_ARCHIVE', message, {
414
+ header,
415
+ recoverable: false,
416
+ });
417
+ }
418
+ #applyMeta(meta) {
419
+ const header = this.#header;
420
+ const type = header.type;
421
+ if (type === 'NextFileHasLongPath') {
422
+ this.#longPath = cstring(meta);
423
+ return;
424
+ }
425
+ if (type === 'NextFileHasLongLinkpath') {
426
+ this.#longLinkpath = cstring(meta);
427
+ return;
428
+ }
429
+ const global = type === 'GlobalExtendedHeader';
430
+ let pax;
431
+ try {
432
+ pax = pax_js_1.Pax.parseBytes(meta, global ? this.#gex : undefined, global);
433
+ }
434
+ catch (er) {
435
+ this.#abort(er.message, header);
436
+ }
437
+ if (!global) {
438
+ this.#ex = pax;
439
+ return;
440
+ }
441
+ // GNU tar uses these fields of a global header for each entry
442
+ // after it, and bsdtar does not.
443
+ if (pax.size !== undefined ||
444
+ pax.path !== undefined ||
445
+ pax.linkpath !== undefined) {
446
+ this.#abort('size or path in a global PAX header', header);
447
+ }
448
+ this.#gex = pax;
449
+ }
450
+ }
451
+ exports.Parser = Parser;
452
+ //# sourceMappingURL=parser.js.map
@@ -1,11 +1,21 @@
1
- export type Reservation = {
2
- paths: string[];
3
- dirs: Set<string>;
4
- };
5
- export type Handler = (clear: () => void) => void;
1
+ /**
2
+ * Gives each task the exclusive use of its paths, and the shared use
3
+ * of their parent directories. A task starts when each task before
4
+ * it that uses one of its paths, or a directory above or below one,
5
+ * is done.
6
+ *
7
+ * Paths that differ only in case or in Unicode form are the same
8
+ * path, because they can be the same file on disk.
9
+ */
6
10
  export declare class PathReservations {
7
11
  #private;
8
- reserve(paths: string[], fn: Handler): boolean;
9
- check(fn: Handler): boolean;
12
+ /** @param win32 run one task at a time */
13
+ constructor(win32?: boolean);
14
+ /**
15
+ * Call `fn` when it is first in line for each of its paths. The
16
+ * paths are free again when the promise of `fn` settles. Returns a
17
+ * promise with the result of `fn`.
18
+ */
19
+ reserve(paths: string[], fn: () => Promise<void>): Promise<void>;
10
20
  }
11
21
  //# sourceMappingURL=path-reservations.d.ts.map