@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
@@ -1,2 +1,2 @@
1
- import{getActiveExtensionRegistrations as S}from"../../core/extensions/index.js";import{URL_CREDENTIAL_PLACEHOLDER as b,redactUrlCredentialsInToken as T}from"../../core/shared/url-credentials.js";import{hashDocument as H}from"../../core/history/history.js";import{readHistoryEntries as N}from"../../core/history/read.js";import{resolveItemTypeRegistry as k}from"../../core/item/type-registry.js";import{bindItemRevisionScope as f,createItemRevisionScope as _,ITEM_REVISION_CONFLICT_CHANGED_REASON as O,ITEM_REVISION_CONFLICT_UNREADABLE_REASON as L,isItemRevisionRefusalFrom as U,isItemRevisionRefusalScoped as F,itemRevisionConflictGuidance as M,markItemRevisionRefusalScoped as P,retainItemRevisionRefusalTracker as l,itemRevisionScopeReceipt as g,runWithItemRevisionScope as v,activeItemRevisionExpectations as $}from"../../core/store/item-mutation-precondition.js";import{buildItemNotFoundError as D,locateItem as q,readLocatedItem as G}from"../../core/store/item-store.js";import{getHistoryPath as W,resolvePmRoot as V}from"../../core/store/paths.js";import{readSettings as j}from"../../core/store/settings.js";import{EXIT_CODE as m}from"../../core/shared/constants.js";import{PmCliError as d}from"../../core/shared/errors.js";import{isExpectHashAdmissibleAction as z,resolveExpectHashAction as B}from"./expect-hash-admission.js";import{isExpectHashAdmissibleAction as Le}from"./expect-hash-admission.js";import{resolveHistorySubject as J}from"../history/subject.js";import{resolvePhysicalItemId as K}from"../query/declared-blockers.js";import{EMPTY_CANONICAL_DOCUMENT as X}from"../../core/shared/constants.js";import{isPmCliExpectedError as Y}from"../errors.js";const w="item_revision_conflict",Q=10,R=/^[0-9a-f]{64}$/u;function p(e,i){return new d(`Invalid expected revision ${JSON.stringify(e)}: ${i}.`,m.USAGE,{code:"expect_hash_invalid",value:e,required:"Pass the 64-character item_hash from pm get <id> --json, optionally as <id>=<item_hash>.",examples:["--expect-hash <item_hash>","--expect-hash pm-a1b2=<item_hash>"]})}function I(e){const i=typeof e=="string"?e.trim().toLowerCase():"";if(!R.test(i))throw p(String(e),"the revision is not a 64-character hexadecimal item_hash");return i}function Z(e){return(e===void 0?[]:typeof e=="string"?[e]:e).flatMap(t=>{if(typeof t!="string")throw p(String(t),"expected a string");const n=t.split(",").map(o=>o.trim()).filter(o=>o.length>0);if(n.length===0)throw p(t,"the value is empty");const r=o=>T(t)===t?o:b;return n.map(o=>{const c=o.lastIndexOf("="),s=c===-1?void 0:o.slice(0,c).trim();if(s!==void 0&&s.length===0)throw p(r(o),"the item id before = is empty");const a=c===-1?o:o.slice(c+1);if(!R.test(a.trim().toLowerCase()))throw p(r(a),"the revision is not a 64-character hexadecimal item_hash");const h=I(a);return s===void 0?{itemHash:h}:{id:s,itemHash:h}})})}async function E(e,i){const t=await j(e),n=k(t,S()).type_to_folder,r=await q(e,i,t.id_prefix,t.item_format,n);if(r){const{document:o}=await G(r,{schema:t.schema});if(o.metadata.id!==await K(r.itemPath,r.id))throw new d(`Item file ${r.id} embeds the id ${o.metadata.id}; no revision can be bound to an item whose identity is in conflict.`,m.CONFLICT,{code:"item_identity_conflict",item_id:r.id,required:`Repair ${r.id}'s identity first (pm validate reports it; pm restore ${r.id} <version> recovers a recorded state), then read its item_hash again.`});return{id:o.metadata.id,document:o}}try{return{id:(await J(e,i,t,n)).id,document:X}}catch{throw await D(e,i,t.id_prefix,n)}}function x(e){return V(e.cwd??process.cwd(),e.pmRoot)}async function Ce(e,i={}){const t=await E(x(i),e);return{id:t.id,item_hash:H(t.document)}}async function y(e,i,t){const n=[];for(const r of i){const o=r.id??t;if(o===void 0||o.trim().length===0)throw new d("A bare expected revision needs an item to bind to.",m.USAGE,{code:"expect_hash_target_required",required:"This command has no single item argument; name each target as --expect-hash <id>=<item_hash>.",examples:["--expect-hash pm-a1b2=<item_hash>"]});n.push({id:(await E(e,o)).id,itemHash:r.itemHash})}return n}function ee(e){return[...new Set(e.patch.map(i=>{const t=i.path.split("/");return String(t[1]==="metadata"?t[2]:t[1])}))].sort()}async function te(e,i,t){let n;try{n=await N(W(e,i),i)}catch{return}let r=-1;for(let s=n.length-1;s>=0;s-=1){const a=n[s];if(a.after_hash===t){r=s+1;break}if(a.before_hash===t){r=s;break}}if(r===-1)return{expected_revision_recorded:!1,changes_since:[],changes_since_omitted:0};const o=n.slice(r),c=o.slice(-Q);return{expected_revision_recorded:!0,changes_since:c.map(s=>({ts:s.ts,op:s.op,author:s.author,fields:ee(s)})),changes_since_omitted:o.length-c.length}}async function Ae(e,i){if(!u(e))return{};const t=await C(e,i);return{error_code:w,expected_revision:String(t.context.expected_revision),current_revision:String(t.context.current_revision),details:t.context.details}}function u(e){return Y(e)&&e.context.code===w}function Se(e){const i=e.find(t=>u(t));if(i!==void 0)throw i}function be(){return new d("--expect-hash cannot guard an invocation an extension override rewrote: which item it writes is not provable.",m.USAGE,{code:"expect_hash_invocation_rewritten",required:"Run the command without the rewriting extension (--no-extensions), or drop --expect-hash.",why:"An extension parser or preflight override changed this invocation's tracker or arguments, and final dispatch, the extension SDK client and the guard do not share one rewritten view."})}function ie(e,i){if(i===void 0||!u(e)||typeof e.context.item_id!="string"||F(e))return e;const t=e.context.reason===L;if(!t&&e.context.reason!==O)return e;const n=P(l(e,new d(e.message,e.exitCode,{...e.context,...M(e.context.item_id,t,i)})));return n.stack=e.stack,n}async function C(e,i,t){if(!U(e,i))return e;const n=ie(e,t);if(!u(n)||n.context.details!==void 0)return n;const r=n.context.item_id,o=n.context.expected_revision;if(typeof r!="string"||typeof o!="string")return n;let c;try{c=await te(i,r,o)}catch{return n}if(c===void 0)return n;const s={expected_revision_recorded:c.expected_revision_recorded,changes_since:c.changes_since.map(h=>({ts:h.ts,op:h.op,author:h.author,fields:[...h.fields]})),changes_since_omitted:c.changes_since_omitted},a=l(n,new d(n.message,n.exitCode,{...n.context,details:s}));return a.stack=n.stack,a}async function A(e,i,t){try{return{result:await v(e,i),...g(e)}}catch(n){throw e.pmRoot===void 0?n:await C(n,e.pmRoot,t)}}function ne(e){return e.cwd===void 0&&e.pmRoot===void 0?void 0:{scopeArgs:["--pm-path",x(e)]}}async function Te(e,i,t={}){return A(await oe(e,t),i,ne(t))}async function oe(e,i={}){const t=x(i),n=e.map(({id:o,itemHash:c})=>({id:o,itemHash:I(c)})),r=_();return f(r,t,await y(t,n)),r}function He(e){const i=$(e);return i===void 0||i.length>0}function re(e){return`expect_hash_unchecked:${e}:no_locked_write_reached_this_item`}function se(e,i={}){const t=B(e);if(!z(e))throw ce(t);if((t==="test"||t==="test-all")&&i.background===!0)throw new d(`--expect-hash cannot guard ${t} --background: the worker runs in another process.`,m.USAGE,{code:"expect_hash_background_unsupported",required:`Run ${t} in the foreground to guard its result recording, or drop --expect-hash for a background run.`})}function ce(e){return new d(`--expect-hash guards item writes, and ${e} is not a mutation.`,m.USAGE,{code:"expect_hash_requires_mutation",required:"Use --expect-hash (MCP/SDK expectHash) only on a command or action that writes items."})}function ae(e,i){if(i.length===0||typeof e!="object"||e===null||Array.isArray(e))return e;const t=e,n=Array.isArray(t.warnings)?t.warnings:[];return{...t,warnings:[...n,...i.map(re)]}}async function Ne(e){const i=e.expectHash;if(i!==void 0&&typeof i!="string"&&!(Array.isArray(i)&&i.every(o=>typeof o=="string")))throw p(JSON.stringify(i)??String(i),"expected a string or an array of strings");const t=Z(i);if(t.length===0)return e.run();se(e.action,{background:e.background===!0||e.options?.background===!0});const n=_();f(n,e.pmRoot,await y(e.pmRoot,t,e.defaultId));const r=await A(n,e.run,e.invocation);return ae(r.result,r.unchecked)}export{Q as ITEM_REVISION_CONFLICT_CHANGE_LIMIT,w as ITEM_REVISION_CONFLICT_CODE,se as assertExpectHashAdmissible,oe as bindExpectedItemRevisions,f as bindItemRevisionScope,_ as createItemRevisionScope,te as describeItemRevisionChanges,Ne as dispatchWithExpectedItemRevisions,C as enrichItemRevisionConflict,be as expectHashInvocationRewrittenError,ce as expectHashRequiresMutationError,Le as isExpectHashAdmissibleAction,u as isItemRevisionConflict,He as isTrackerRevisionGuarded,Ae as itemRevisionConflictRowFields,g as itemRevisionScopeReceipt,re as itemRevisionUncheckedWarning,I as normalizeExpectedItemHash,Z as parseExpectHashSpecs,Ce as readItemRevision,y as resolveExpectedItemRevisions,A as runWithBoundItemRevisionScope,v as runWithItemRevisionScope,ie as scopeItemRevisionConflict,Se as throwFirstItemRevisionConflict,Te as withExpectedItemRevisions};
1
+ import{getActiveExtensionRegistrations as S}from"../../core/extensions/index.js";import{URL_CREDENTIAL_PLACEHOLDER as b,redactUrlCredentialsInToken as H}from"../../core/shared/url-credentials.js";import{hashDocument as T}from"../../core/history/history.js";import{readHistoryEntries as N}from"../../core/history/read.js";import{resolveItemTypeRegistry as k}from"../../core/item/type-registry.js";import{bindItemRevisionScope as f,createItemRevisionScope as x,ITEM_REVISION_CONFLICT_CHANGED_REASON as O,ITEM_REVISION_CONFLICT_UNREADABLE_REASON as L,isItemRevisionRefusalFrom as $,isItemRevisionRefusalScoped as U,itemRevisionConflictGuidance as F,markItemRevisionRefusalScoped as M,retainItemRevisionRefusalTracker as _,itemRevisionScopeReceipt as g,runWithItemRevisionScope as w,activeItemRevisionExpectations as P}from"../../core/store/item-mutation-precondition.js";import{buildItemNotFoundError as q,locateItem as D,readLocatedItem as G}from"../../core/store/item-store.js";import{getHistoryPath as W,resolvePmRoot as j}from"../../core/store/paths.js";import{readSettings as V}from"../../core/store/settings.js";import{EXIT_CODE as m}from"../../core/shared/constants.js";import{PmCliError as d}from"../../core/shared/errors.js";import{expectHashAdmittedSchemaSubcommands as z,isExpectHashAdmissibleInvocation as B,resolveExpectHashAction as J,resolveExpectHashCallAction as K}from"./expect-hash-admission.js";import{expectHashAdmissionCondition as Ue,isExpectHashAdmissibleAction as Fe}from"./expect-hash-admission.js";import{resolveHistorySubject as X}from"../history/subject.js";import{resolvePhysicalItemId as Y}from"../query/declared-blockers.js";import{EMPTY_CANONICAL_DOCUMENT as Q}from"../../core/shared/constants.js";import{isPmCliExpectedError as Z}from"../errors.js";const v="item_revision_conflict",ee=10,I=/^[0-9a-f]{64}$/u;function p(e,i){return new d(`Invalid expected revision ${JSON.stringify(e)}: ${i}.`,m.USAGE,{code:"expect_hash_invalid",value:e,required:"Pass the 64-character item_hash from pm get <id> --json, optionally as <id>=<item_hash>.",examples:["--expect-hash <item_hash>","--expect-hash pm-a1b2=<item_hash>"]})}function R(e){const i=typeof e=="string"?e.trim().toLowerCase():"";if(!I.test(i))throw p(String(e),"the revision is not a 64-character hexadecimal item_hash");return i}function te(e){return(e===void 0?[]:typeof e=="string"?[e]:e).flatMap(t=>{if(typeof t!="string")throw p(String(t),"expected a string");const n=t.split(",").map(o=>o.trim()).filter(o=>o.length>0);if(n.length===0)throw p(t,"the value is empty");const r=o=>H(t)===t?o:b;return n.map(o=>{const c=o.lastIndexOf("="),s=c===-1?void 0:o.slice(0,c).trim();if(s!==void 0&&s.length===0)throw p(r(o),"the item id before = is empty");const a=c===-1?o:o.slice(c+1);if(!I.test(a.trim().toLowerCase()))throw p(r(a),"the revision is not a 64-character hexadecimal item_hash");const h=R(a);return s===void 0?{itemHash:h}:{id:s,itemHash:h}})})}async function y(e,i){const t=await V(e),n=k(t,S()).type_to_folder,r=await D(e,i,t.id_prefix,t.item_format,n);if(r){const{document:o}=await G(r,{schema:t.schema});if(o.metadata.id!==await Y(r.itemPath,r.id))throw new d(`Item file ${r.id} embeds the id ${o.metadata.id}; no revision can be bound to an item whose identity is in conflict.`,m.CONFLICT,{code:"item_identity_conflict",item_id:r.id,required:`Repair ${r.id}'s identity first (pm validate reports it; pm restore ${r.id} <version> recovers a recorded state), then read its item_hash again.`});return{id:o.metadata.id,document:o}}try{return{id:(await X(e,i,t,n)).id,document:Q}}catch{throw await q(e,i,t.id_prefix,n)}}function l(e){return j(e.cwd??process.cwd(),e.pmRoot)}async function Se(e,i={}){const t=await y(l(i),e);return{id:t.id,item_hash:T(t.document)}}async function E(e,i,t){const n=[];for(const r of i){const o=r.id??t;if(o===void 0||o.trim().length===0)throw new d("A bare expected revision needs an item to bind to.",m.USAGE,{code:"expect_hash_target_required",required:"This command has no single item argument; name each target as --expect-hash <id>=<item_hash>.",examples:["--expect-hash pm-a1b2=<item_hash>"]});n.push({id:(await y(e,o)).id,itemHash:r.itemHash})}return n}function ie(e){return[...new Set(e.patch.map(i=>{const t=i.path.split("/");return String(t[1]==="metadata"?t[2]:t[1])}))].sort()}async function ne(e,i,t){let n;try{n=await N(W(e,i),i)}catch{return}let r=-1;for(let s=n.length-1;s>=0;s-=1){const a=n[s];if(a.after_hash===t){r=s+1;break}if(a.before_hash===t){r=s;break}}if(r===-1)return{expected_revision_recorded:!1,changes_since:[],changes_since_omitted:0};const o=n.slice(r),c=o.slice(-ee);return{expected_revision_recorded:!0,changes_since:c.map(s=>({ts:s.ts,op:s.op,author:s.author,fields:ie(s)})),changes_since_omitted:o.length-c.length}}async function be(e,i){if(!u(e))return{};const t=await A(e,i);return{error_code:v,expected_revision:String(t.context.expected_revision),current_revision:String(t.context.current_revision),details:t.context.details}}function u(e){return Z(e)&&e.context.code===v}function He(e){const i=e.find(t=>u(t));if(i!==void 0)throw i}function Te(){return new d("--expect-hash cannot guard an invocation an extension override rewrote: which item it writes is not provable.",m.USAGE,{code:"expect_hash_invocation_rewritten",required:"Run the command without the rewriting extension (--no-extensions), or drop --expect-hash.",why:"An extension parser or preflight override changed this invocation's tracker or arguments, and final dispatch, the extension SDK client and the guard do not share one rewritten view."})}function oe(e,i){if(i===void 0||!u(e)||typeof e.context.item_id!="string"||U(e))return e;const t=e.context.reason===L;if(!t&&e.context.reason!==O)return e;const n=M(_(e,new d(e.message,e.exitCode,{...e.context,...F(e.context.item_id,t,i)})));return n.stack=e.stack,n}async function A(e,i,t){if(!$(e,i))return e;const n=oe(e,t);if(!u(n)||n.context.details!==void 0)return n;const r=n.context.item_id,o=n.context.expected_revision;if(typeof r!="string"||typeof o!="string")return n;let c;try{c=await ne(i,r,o)}catch{return n}if(c===void 0)return n;const s={expected_revision_recorded:c.expected_revision_recorded,changes_since:c.changes_since.map(h=>({ts:h.ts,op:h.op,author:h.author,fields:[...h.fields]})),changes_since_omitted:c.changes_since_omitted},a=_(n,new d(n.message,n.exitCode,{...n.context,details:s}));return a.stack=n.stack,a}async function C(e,i,t){try{return{result:await w(e,i),...g(e)}}catch(n){throw e.pmRoot===void 0?n:await A(n,e.pmRoot,t)}}function re(e){return e.cwd===void 0&&e.pmRoot===void 0?void 0:{scopeArgs:["--pm-path",l(e)]}}async function Ne(e,i,t={}){return C(await se(e,t),i,re(t))}async function se(e,i={}){const t=l(i),n=e.map(({id:o,itemHash:c})=>({id:o,itemHash:R(c)})),r=x();return f(r,t,await E(t,n)),r}function ke(e){const i=P(e);return i===void 0||i.length>0}function ce(e){return`expect_hash_unchecked:${e}:no_locked_write_reached_this_item`}function ae(e,i={}){const t=J(e);if(!B(e,i.subcommand))throw de(t,i.subcommand);if((t==="test"||t==="test-all")&&i.background===!0)throw new d(`--expect-hash cannot guard ${t} --background: the worker runs in another process.`,m.USAGE,{code:"expect_hash_background_unsupported",required:`Run ${t} in the foreground to guard its result recording, or drop --expect-hash for a background run.`})}function de(e,i){const t=e==="create"||e==="copy"?`--expect-hash guards writes to an existing item, and ${e} writes only new items.`:e==="schema"?`--expect-hash guards writes to existing items, and schema ${typeof i=="string"?i:"without a verb"} writes none; only ${z().join(", ")} do.`:`--expect-hash guards writes to existing items, and ${e} writes none.`;return new d(t,m.USAGE,{code:"expect_hash_requires_mutation",required:"Use --expect-hash (MCP/SDK expectHash) only on a command or action that writes an existing item; remove it from this call, and guard a later write to the item instead."})}function he(e,i){if(i.length===0||typeof e!="object"||e===null||Array.isArray(e))return e;const t=e,n=Array.isArray(t.warnings)?t.warnings:[];return{...t,warnings:[...n,...i.map(ce)]}}async function Oe(e){const i=e.expectHash;if(i!==void 0&&typeof i!="string"&&!(Array.isArray(i)&&i.every(o=>typeof o=="string")))throw p(JSON.stringify(i)??String(i),"expected a string or an array of strings");const t=te(i);if(t.length===0)return e.run();ae(K(e.requestedAction,e.action),{background:e.background===!0||e.options?.background===!0,subcommand:e.subcommand});const n=x();f(n,e.pmRoot,await E(e.pmRoot,t,e.defaultId));const r=await C(n,e.run,e.invocation);return he(r.result,r.unchecked)}export{ee as ITEM_REVISION_CONFLICT_CHANGE_LIMIT,v as ITEM_REVISION_CONFLICT_CODE,ae as assertExpectHashAdmissible,se as bindExpectedItemRevisions,f as bindItemRevisionScope,x as createItemRevisionScope,ne as describeItemRevisionChanges,Oe as dispatchWithExpectedItemRevisions,A as enrichItemRevisionConflict,Ue as expectHashAdmissionCondition,Te as expectHashInvocationRewrittenError,de as expectHashRequiresMutationError,Fe as isExpectHashAdmissibleAction,u as isItemRevisionConflict,ke as isTrackerRevisionGuarded,be as itemRevisionConflictRowFields,g as itemRevisionScopeReceipt,ce as itemRevisionUncheckedWarning,R as normalizeExpectedItemHash,te as parseExpectHashSpecs,Se as readItemRevision,E as resolveExpectedItemRevisions,C as runWithBoundItemRevisionScope,w as runWithItemRevisionScope,oe as scopeItemRevisionConflict,He as throwFirstItemRevisionConflict,Ne as withExpectedItemRevisions};
2
2
  //# sourceMappingURL=item-revision.js.map
@@ -43,7 +43,7 @@ toon_encoding?:"tabular_when_uniform";}
43
43
  /** Universal selector for results carrying a {@link ReadRowContract}. */
44
44
  export declare const PM_READ_ROW_JQ_SELECTOR=".row_contract.row_keys[] as $key | getpath($key | split(\".\")) | if type == \"array\" then .[] else if type == \"object\" then to_entries[] else empty end end";
45
45
  /** Static row declarations shared by CLI, SDK, MCP, and package consumers. */
46
- export declare const PM_READ_ROW_CONTRACTS:{readonly context:{readonly row_keys:readonly["high_level","low_level"];readonly fields:"supported";};readonly get:{readonly row_keys:readonly["children"];readonly fields:"supported";};readonly list:{readonly row_keys:readonly["items"];readonly fields:"supported";};readonly next:{readonly row_keys:readonly["recommended","ready","decision_needed","gate_needed","containers","blocked","held_by_others"];readonly fields:"unsupported";};readonly search:{readonly row_keys:readonly["items"];readonly fields:"supported";};readonly activity:{readonly row_keys:readonly["activity_digest","compact_activity","provenance_activity","activity"];readonly fields:"unsupported";};readonly history:{readonly row_keys:readonly["compact_history","provenance_history","history","diff"];readonly fields:"unsupported";};readonly deps:{readonly row_keys:readonly["graph.nodes","graph.edges","context.nodes","context.edges"];readonly fields:"unsupported";};readonly health:{readonly row_keys:readonly["checks"];readonly fields:"unsupported";};readonly aggregate:{readonly row_keys:readonly["groups"];readonly fields:"unsupported";};readonly duplicates:{readonly row_keys:readonly["clusters"];readonly fields:"unsupported";};readonly stats:{readonly row_keys:readonly["by_type","by_status"];readonly fields:"unsupported";};readonly comments:{readonly row_keys:readonly["comments"];readonly fields:"unsupported";};readonly notes:{readonly row_keys:readonly["notes"];readonly fields:"unsupported";};readonly learnings:{readonly row_keys:readonly["learnings"];readonly fields:"unsupported";};readonly files:{readonly row_keys:readonly["files","matches"];readonly fields:"unsupported";};readonly docs:{readonly row_keys:readonly["docs"];readonly fields:"unsupported";};readonly validate:{readonly row_keys:readonly["checks","warnings"];readonly fields:"unsupported";};readonly contracts:{readonly row_keys:readonly["command_summaries","commands"];readonly fields:"unsupported";};};
46
+ export declare const PM_READ_ROW_CONTRACTS:{readonly context:{readonly row_keys:readonly["high_level","low_level"];readonly fields:"supported";};readonly get:{readonly row_keys:readonly["children"];readonly fields:"supported";};readonly list:{readonly row_keys:readonly["items"];readonly fields:"supported";};readonly next:{readonly row_keys:readonly["recommended","ready","decision_needed","gate_needed","containers","blocked","held_by_others"];readonly fields:"unsupported";};readonly search:{readonly row_keys:readonly["items"];readonly fields:"supported";};readonly activity:{readonly row_keys:readonly["activity_digest","compact_activity","provenance_activity","activity"];readonly fields:"unsupported";};readonly history:{readonly row_keys:readonly["compact_history","provenance_history","history","diff"];readonly fields:"unsupported";};readonly deps:{readonly row_keys:readonly["graph.nodes","graph.edges","context.nodes","context.edges"];readonly fields:"unsupported";};readonly health:{readonly row_keys:readonly["checks"];readonly fields:"unsupported";};readonly aggregate:{readonly row_keys:readonly["groups"];readonly fields:"unsupported";};readonly duplicates:{readonly row_keys:readonly["clusters"];readonly fields:"unsupported";};readonly stats:{readonly row_keys:readonly["by_type","by_status"];readonly fields:"unsupported";};readonly comments:{readonly row_keys:readonly["comments"];readonly fields:"unsupported";};readonly notes:{readonly row_keys:readonly["notes"];readonly fields:"unsupported";};readonly learnings:{readonly row_keys:readonly["learnings"];readonly fields:"unsupported";};readonly files:{readonly row_keys:readonly["files","matches"];readonly fields:"unsupported";};readonly docs:{readonly row_keys:readonly["docs"];readonly fields:"unsupported";};readonly validate:{readonly row_keys:readonly["checks","warnings"];readonly fields:"unsupported";};readonly contracts:{readonly row_keys:readonly["command_summaries","commands"];readonly fields:"unsupported";};readonly "package-catalog":{readonly row_keys:readonly["details.packages"];readonly fields:"supported";};};
47
47
  /** Contract for a command whose output modes expose mutually exclusive row shapes. */
48
48
  export interface ModePairedOutputProjectionContract{
49
49
  /** Stable command name. */
@@ -1,2 +1,2 @@
1
- import{EXIT_CODE as g}from"../core/shared/constants.js";import{PmCliError as k}from"../core/shared/errors.js";import{resolvePmCommandOperation as O}from"./cli-contracts/command-aliases.js";const _=new WeakMap;function K(e,t){_.set(e,new Set(t))}const f='.row_contract.row_keys[] as $key | getpath($key | split(".")) | if type == "array" then .[] else if type == "object" then to_entries[] else empty end end',u={context:{row_keys:["high_level","low_level"],fields:"supported"},get:{row_keys:["children"],fields:"supported"},list:{row_keys:["items"],fields:"supported"},next:{row_keys:["recommended","ready","decision_needed","gate_needed","containers","blocked","held_by_others"],fields:"unsupported"},search:{row_keys:["items"],fields:"supported"},activity:{row_keys:["activity_digest","compact_activity","provenance_activity","activity"],fields:"unsupported"},history:{row_keys:["compact_history","provenance_history","history","diff"],fields:"unsupported"},deps:{row_keys:["graph.nodes","graph.edges","context.nodes","context.edges"],fields:"unsupported"},health:{row_keys:["checks"],fields:"unsupported"},aggregate:{row_keys:["groups"],fields:"unsupported"},duplicates:{row_keys:["clusters"],fields:"unsupported"},stats:{row_keys:["by_type","by_status"],fields:"unsupported"},comments:{row_keys:["comments"],fields:"unsupported"},notes:{row_keys:["notes"],fields:"unsupported"},learnings:{row_keys:["learnings"],fields:"unsupported"},files:{row_keys:["files","matches"],fields:"unsupported"},docs:{row_keys:["docs"],fields:"unsupported"},validate:{row_keys:["checks","warnings"],fields:"unsupported"},contracts:{row_keys:["command_summaries","commands"],fields:"unsupported"}},b=[{command:"activity",complete_mode:"full",omissions_by_mode:{digest:[{name:"event_rows",restore_with:"--raw"}],compact:[{name:"provenance",restore_with:"--full"}],provenance:[{name:"patch_and_hashes",restore_with:"--full"}]}},{command:"history",complete_mode:"full",omissions_by_mode:{compact:[{name:"raw_history",restore_with:"--full"}],provenance:[{name:"patch_and_hashes",restore_with:"--full"}]}}];function $(e,t,n){if(e&&t)throw new k(`${n} cannot be combined with --full`,g.USAGE)}function a(e,t=new Set){const n=e.filter(o=>!t.has(o.name)).map(o=>({...o}));return{has_omissions:n.length>0,omitted_field_group_count:n.length,omitted_field_groups:n}}function q(e,t){const n=b.find(s=>s.command===e);if(n===void 0)throw new TypeError(`Unknown mode-paired output command: ${e}`);if(t===n.complete_mode)return a([]);const o=n.omissions_by_mode[t];if(o===void 0)throw new TypeError(`Unknown ${e} output mode: ${t}`);return a(o)}const R=[{name:"hierarchy",restore_with:"--section hierarchy"},{name:"activity",restore_with:"--section activity"},{name:"progress",restore_with:"--section progress"},{name:"blockers",restore_with:"--section blockers"},{name:"recently_created",restore_with:"--section recently_created"},{name:"unparented",restore_with:"--section unparented"},{name:"files",restore_with:"--section files"},{name:"workload",restore_with:"--section workload"},{name:"staleness",restore_with:"--section staleness"},{name:"tests",restore_with:"--section tests"}];function c(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const j=new Set([void 0,"tabular_when_uniform"]),E=new Set(["collection","none"]),A=new Set(["supported","unsupported"]);function m(e,t){return Array.isArray(e)&&(t||e.length>0)&&e.every(n=>typeof n=="string"&&n.length>0)&&new Set(e).size===e.length}function S(e){return c(e)&&typeof e.command=="string"&&e.command.trim().length>0&&E.has(e.row_kind)&&m(e.row_keys,!0)&&(e.continuation_row_keys===void 0||m(e.continuation_row_keys,!1))&&A.has(e.fields)&&j.has(e.toon_encoding)&&(e.row_kind==="collection"?e.row_keys.length>0&&typeof e.jq_selector=="string"&&e.jq_selector.trim().length>0:e.row_keys.length===0&&e.jq_selector===void 0)}const v={ancestors:["ids"],descendants:["ids"],predecessors:["ids"],successors:["ids"],paths:["paths"],impact:["affected"],audit:["findings"],communities:["communities"],redundancy:["redundant"],dominators:["bottlenecks"],slack:["rows"],centrality:["rows"],articulation:["articulation_points","bridges"],plan:["steps"]},C={context:["sections_included","high_level","low_level"],get:["item"],list:["items","projection"],next:["recommended","ready","decision_needed","gate_needed","containers","blocked","held_by_others"],search:["items","projection"],activity:["activity_digest","compact_activity","provenance_activity","activity"],history:["compact_history","provenance_history","history","diff"],deps:["tree","graph","projection"],health:["checks"],aggregate:["groups"],duplicates:["clusters"],stats:["totals","by_type","by_status"],comments:["comments"],notes:["notes"],learnings:["learnings"],files:["files","matches"],docs:["docs"],validate:["checks","warnings"],contracts:["command_summaries","commands","selected"]};function x(e){const t=e.split(/\s+/u,1)[0];return t==="graph"||t.startsWith("list-")||Object.hasOwn(u,t)?t:O(e).split(/\s+/u,1)[0]}function T(e,t){const n=x(e.trim().toLowerCase()),o=n?.startsWith("list-")?"list":n;if(o==="graph"){const r=typeof t.subcommand=="string"?t.subcommand:"";if(r.length===0)return;const i=v[r];if(i===void 0)return;const l=i.filter(p=>Array.isArray(t[p])||c(t[p]));return{command:"graph",row_kind:l.length>0?"collection":"none",row_keys:l,fields:"unsupported",...l.length>0?{jq_selector:f}:{},toon_encoding:"tabular_when_uniform"}}const s=u[o],d=C[o];return s===void 0||d===void 0||!d.some(r=>Object.hasOwn(t,r))?void 0:(()=>{const r=s.row_keys.filter(i=>{const l=i.split(".").reduce((p,w)=>c(p)?p[w]:void 0,t);return Array.isArray(l)||c(l)});return{command:o,row_kind:r.length>0?"collection":"none",row_keys:r,fields:s.fields,...r.length>0?{jq_selector:f}:{},toon_encoding:"tabular_when_uniform"}})()}function D(e){if(!c(e.projection)||typeof e.projection.mode!="string"||e.projection.mode.trim().length===0)return;const t=e.projection.declared_field_groups,n=e.projection.included_field_groups;if(!Array.isArray(t)||!Array.isArray(n))return;const o=t.filter(r=>c(r)&&typeof r.name=="string"&&r.name.trim().length>0&&typeof r.restore_with=="string"&&r.restore_with.trim().length>0),s=n.filter(r=>typeof r=="string");if(o.length!==t.length||s.length!==n.length)return;const d=new Set(o.map(r=>r.name));if(!(d.size!==o.length||new Set(s).size!==s.length||s.some(r=>!d.has(r))))return a(o,new Set(s))}function G(e){if(!Array.isArray(e.sections_included))return;const t=a(R,new Set(e.sections_included.filter(n=>typeof n=="string")));return c(e.summary)&&e.summary.scope==="matching_items"&&(t.summary_scope="matching_items"),t}function N(e,t,n){if(e==="dependency_provenance")return!1;const o=h(e);if(o!==void 0){const s=n[o.facet];return c(s)&&Object.hasOwn(s,o.member)}return Object.hasOwn(t,e)||(e==="reminders"||e==="events")&&c(n.schedule)&&Object.hasOwn(n.schedule,e)||["files","tests","docs"].includes(e)&&c(n.linked)&&Array.isArray(n.linked[e])&&n.linked[e].length>0}function h(e){const t=e.indexOf(".");return t===-1?void 0:{facet:e.slice(0,t),member:e.slice(t+1)}}function P(e){if(!c(e.item))return;const t=e.item,n=["comments","notes","learnings","files","tests","docs","reminders","events"],o=["body","children","claim_state","linked","schedule"],s=_.get(e),d=i=>n.includes(i)||i==="body"||i==="dependency_provenance"?t:e,r=["body",...n,...o.slice(1),...s?.has("dependency_provenance")?["dependency_provenance"]:[],...s?.has("blockers")||Object.hasOwn(e,"blockers")?["blockers"]:[],...[...s??[]].filter(i=>h(i)!==void 0)].filter(i=>s===void 0||s.has(i)||Object.hasOwn(d(i),i)).map(i=>({name:i,restore_with:i==="blockers"?"--full":i==="dependency_provenance"?"--fields dependencies":`--fields ${i}`}));return a(r,new Set(r.flatMap(({name:i})=>N(i,d(i),e)?[i]:[])))}function y(e){if(c(e.projection))return a([{name:"full_item_fields",restore_with:"--full"}],new Set(e.projection.mode==="full"?["full_item_fields"]:[]))}function I(e){if(!c(e.projection))return a([]);if(typeof e.projection.mode=="string")return a([{name:"full_check_details",restore_with:"--full"}],new Set(e.projection.mode==="full"?["full_check_details"]:[]))}function M(e){if(!(!c(e.selected)||typeof e.selected.summary!="boolean"))return a([{name:"full_contract_catalog",restore_with:"--full"}],new Set(e.selected.summary?[]:["full_contract_catalog"]))}function L(e,t){const n=D(t);if(n!==void 0)return n;const[o]=e.split(/\s+/u,1);if(o==="context")return G(t);if(o==="get")return P(t);if(o==="list"||o.startsWith("list-"))return y(t);if(o==="search")return y(t)??a([{name:"projection_metadata",restore_with:"--full"}]);if(o==="health")return I(t);if(o==="contracts")return M(t)}function z(e,t){if(e===void 0||!c(t))return t;const n=L(e,t),o=t.row_contract,s=S(o)?o:T(e,t),d=s!==void 0?{...t,row_contract:s}:Object.hasOwn(t,"row_contract")?Object.fromEntries(Object.entries(t).filter(([r])=>r!=="row_contract")):t;return c(d.omission_receipt)||n===void 0?d:{...d,omission_receipt:n}}export{b as PM_MODE_PAIRED_OUTPUT_PROJECTION_CONTRACTS,u as PM_READ_ROW_CONTRACTS,f as PM_READ_ROW_JQ_SELECTOR,$ as assertProjectionModeChoice,z as attachOutputOmissionReceipt,a as createOutputOmissionReceipt,S as isReadRowContract,K as registerOutputMaterialFieldGroups,q as resolveModePairedOutputOmissionReceipt,L as resolveOutputOmissionReceipt,T as resolveReadRowContract};
1
+ import{EXIT_CODE as w}from"../core/shared/constants.js";import{PmCliError as g}from"../core/shared/errors.js";import{resolvePmCommandOperation as k}from"./cli-contracts/command-aliases.js";import{PACKAGE_CATALOG_SPELLINGS as O}from"./read-output/surfaces.js";const p=new WeakMap;function Y(e,t){p.set(e,new Set(t))}const _='.row_contract.row_keys[] as $key | getpath($key | split(".")) | if type == "array" then .[] else if type == "object" then to_entries[] else empty end end',f={context:{row_keys:["high_level","low_level"],fields:"supported"},get:{row_keys:["children"],fields:"supported"},list:{row_keys:["items"],fields:"supported"},next:{row_keys:["recommended","ready","decision_needed","gate_needed","containers","blocked","held_by_others"],fields:"unsupported"},search:{row_keys:["items"],fields:"supported"},activity:{row_keys:["activity_digest","compact_activity","provenance_activity","activity"],fields:"unsupported"},history:{row_keys:["compact_history","provenance_history","history","diff"],fields:"unsupported"},deps:{row_keys:["graph.nodes","graph.edges","context.nodes","context.edges"],fields:"unsupported"},health:{row_keys:["checks"],fields:"unsupported"},aggregate:{row_keys:["groups"],fields:"unsupported"},duplicates:{row_keys:["clusters"],fields:"unsupported"},stats:{row_keys:["by_type","by_status"],fields:"unsupported"},comments:{row_keys:["comments"],fields:"unsupported"},notes:{row_keys:["notes"],fields:"unsupported"},learnings:{row_keys:["learnings"],fields:"unsupported"},files:{row_keys:["files","matches"],fields:"unsupported"},docs:{row_keys:["docs"],fields:"unsupported"},validate:{row_keys:["checks","warnings"],fields:"unsupported"},contracts:{row_keys:["command_summaries","commands"],fields:"unsupported"},"package-catalog":{row_keys:["details.packages"],fields:"supported"}},R=[{command:"activity",complete_mode:"full",omissions_by_mode:{digest:[{name:"event_rows",restore_with:"--raw"}],compact:[{name:"provenance",restore_with:"--full"}],provenance:[{name:"patch_and_hashes",restore_with:"--full"}]}},{command:"history",complete_mode:"full",omissions_by_mode:{compact:[{name:"raw_history",restore_with:"--full"}],provenance:[{name:"patch_and_hashes",restore_with:"--full"}]}}];function z(e,t,n){if(e&&t)throw new g(`${n} cannot be combined with --full`,w.USAGE)}function a(e,t=new Set){const n=e.filter(o=>!t.has(o.name)).map(o=>({...o}));return{has_omissions:n.length>0,omitted_field_group_count:n.length,omitted_field_groups:n}}function H(e,t){const n=R.find(s=>s.command===e);if(n===void 0)throw new TypeError(`Unknown mode-paired output command: ${e}`);if(t===n.complete_mode)return a([]);const o=n.omissions_by_mode[t];if(o===void 0)throw new TypeError(`Unknown ${e} output mode: ${t}`);return a(o)}const b=[{name:"hierarchy",restore_with:"--section hierarchy"},{name:"activity",restore_with:"--section activity"},{name:"progress",restore_with:"--section progress"},{name:"blockers",restore_with:"--section blockers"},{name:"recently_created",restore_with:"--section recently_created"},{name:"unparented",restore_with:"--section unparented"},{name:"files",restore_with:"--section files"},{name:"workload",restore_with:"--section workload"},{name:"staleness",restore_with:"--section staleness"},{name:"tests",restore_with:"--section tests"}];function d(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const A=new Set([void 0,"tabular_when_uniform"]),E=new Set(["collection","none"]),S=new Set(["supported","unsupported"]);function u(e,t){return Array.isArray(e)&&(t||e.length>0)&&e.every(n=>typeof n=="string"&&n.length>0)&&new Set(e).size===e.length}function j(e){return d(e)&&typeof e.command=="string"&&e.command.trim().length>0&&E.has(e.row_kind)&&u(e.row_keys,!0)&&(e.continuation_row_keys===void 0||u(e.continuation_row_keys,!1))&&S.has(e.fields)&&A.has(e.toon_encoding)&&(e.row_kind==="collection"?e.row_keys.length>0&&typeof e.jq_selector=="string"&&e.jq_selector.trim().length>0:e.row_keys.length===0&&e.jq_selector===void 0)}const v={ancestors:["ids"],descendants:["ids"],predecessors:["ids"],successors:["ids"],paths:["paths"],impact:["affected"],audit:["findings"],communities:["communities"],redundancy:["redundant"],dominators:["bottlenecks"],slack:["rows"],centrality:["rows"],articulation:["articulation_points","bridges"],plan:["steps"]},C={context:["sections_included","high_level","low_level"],get:["item"],list:["items","projection"],next:["recommended","ready","decision_needed","gate_needed","containers","blocked","held_by_others"],search:["items","projection"],activity:["activity_digest","compact_activity","provenance_activity","activity"],history:["compact_history","provenance_history","history","diff"],deps:["tree","graph","projection"],health:["checks"],aggregate:["groups"],duplicates:["clusters"],stats:["totals","by_type","by_status"],comments:["comments"],notes:["notes"],learnings:["learnings"],files:["files","matches"],docs:["docs"],validate:["checks","warnings"],contracts:["command_summaries","commands","selected"],"package-catalog":["details"]},x=new Set(["package","packages","extension"]);function T(e){const t=e.replace(/\s+/gu," ");if(O.has(t)||x.has(t))return"package-catalog";const n=e.split(/\s+/u,1)[0];return n==="graph"||n.startsWith("list-")||Object.hasOwn(f,n)?n:k(e).split(/\s+/u,1)[0]}function G(e,t){const n=C[e];return n===void 0||!n.some(o=>Object.hasOwn(t,o))?!1:e!=="package-catalog"||t.action==="catalog"}function D(e,t){const n=T(e.trim().toLowerCase()),o=n?.startsWith("list-")?"list":n;if(o==="graph"){const c=typeof t.subcommand=="string"?t.subcommand:"";if(c.length===0)return;const i=v[c];if(i===void 0)return;const r=i.filter(l=>Array.isArray(t[l])||d(t[l]));return{command:"graph",row_kind:r.length>0?"collection":"none",row_keys:r,fields:"unsupported",...r.length>0?{jq_selector:_}:{},toon_encoding:"tabular_when_uniform"}}const s=f[o];return s===void 0||!G(o,t)?void 0:(()=>{const c=s.row_keys.filter(i=>{const r=i.split(".").reduce((l,y)=>d(l)?l[y]:void 0,t);return Array.isArray(r)||d(r)});return{command:o,row_kind:c.length>0?"collection":"none",row_keys:c,fields:s.fields,...c.length>0?{jq_selector:_}:{},toon_encoding:"tabular_when_uniform"}})()}function L(e){if(!d(e.projection)||typeof e.projection.mode!="string"||e.projection.mode.trim().length===0)return;const t=e.projection.declared_field_groups,n=e.projection.included_field_groups;if(!Array.isArray(t)||!Array.isArray(n))return;const o=t.filter(i=>d(i)&&typeof i.name=="string"&&i.name.trim().length>0&&typeof i.restore_with=="string"&&i.restore_with.trim().length>0),s=n.filter(i=>typeof i=="string");if(o.length!==t.length||s.length!==n.length)return;const c=new Set(o.map(i=>i.name));if(!(c.size!==o.length||new Set(s).size!==s.length||s.some(i=>!c.has(i))))return a(o,new Set(s))}function P(e){if(!Array.isArray(e.sections_included))return;const t=a(b,new Set(e.sections_included.filter(n=>typeof n=="string")));return d(e.summary)&&e.summary.scope==="matching_items"&&(t.summary_scope="matching_items"),t}function N(e,t,n){if(e==="dependency_provenance")return!1;const o=m(e);if(o!==void 0){const s=n[o.facet];return d(s)&&Object.hasOwn(s,o.member)}return Object.hasOwn(t,e)||(e==="reminders"||e==="events")&&d(n.schedule)&&Object.hasOwn(n.schedule,e)||["files","tests","docs"].includes(e)&&d(n.linked)&&Array.isArray(n.linked[e])&&n.linked[e].length>0}function m(e){const t=e.indexOf(".");return t===-1?void 0:{facet:e.slice(0,t),member:e.slice(t+1)}}function I(e){if(!d(e.item))return;const t=e.item,n=["comments","notes","learnings","files","tests","docs","reminders","events"],o=["body","children","claim_state","linked","schedule"],s=p.get(e),c=r=>n.includes(r)||r==="body"||r==="dependency_provenance"?t:e,i=["body",...n,...o.slice(1),...s?.has("dependency_provenance")?["dependency_provenance"]:[],...s?.has("blockers")||Object.hasOwn(e,"blockers")?["blockers"]:[],...[...s??[]].filter(r=>m(r)!==void 0)].filter(r=>s===void 0||s.has(r)||Object.hasOwn(c(r),r)).map(r=>({name:r,restore_with:r==="blockers"?"--full":r==="dependency_provenance"?"--fields dependencies":`--fields ${r}`}));return a(i,new Set(i.flatMap(({name:r})=>N(r,c(r),e)?[r]:[])))}function h(e){if(d(e.projection))return a([{name:"full_item_fields",restore_with:"--full"}],new Set(e.projection.mode==="full"?["full_item_fields"]:[]))}function M(e){if(!d(e.projection))return a([]);if(typeof e.projection.mode=="string")return a([{name:"full_check_details",restore_with:"--full"}],new Set(e.projection.mode==="full"?["full_check_details"]:[]))}function U(e){if(!(!d(e.selected)||typeof e.selected.summary!="boolean"))return a([{name:"full_contract_catalog",restore_with:"--full"}],new Set(e.selected.summary?[]:["full_contract_catalog"]))}function W(e,t){const n=L(t);if(n!==void 0)return n;const[o]=e.split(/\s+/u,1);if(o==="context")return P(t);if(o==="get")return I(t);if(o==="list"||o.startsWith("list-"))return h(t);if(o==="search")return h(t)??a([{name:"projection_metadata",restore_with:"--full"}]);if(o==="health")return M(t);if(o==="contracts")return U(t)}function J(e,t){if(e===void 0||!d(t))return t;const n=W(e,t),o=t.row_contract,s=j(o)?o:D(e,t),c=s!==void 0?{...t,row_contract:s}:Object.hasOwn(t,"row_contract")?Object.fromEntries(Object.entries(t).filter(([i])=>i!=="row_contract")):t;return d(c.omission_receipt)||n===void 0?c:{...c,omission_receipt:n}}export{R as PM_MODE_PAIRED_OUTPUT_PROJECTION_CONTRACTS,f as PM_READ_ROW_CONTRACTS,_ as PM_READ_ROW_JQ_SELECTOR,z as assertProjectionModeChoice,J as attachOutputOmissionReceipt,a as createOutputOmissionReceipt,j as isReadRowContract,Y as registerOutputMaterialFieldGroups,H as resolveModePairedOutputOmissionReceipt,W as resolveOutputOmissionReceipt,D as resolveReadRowContract};
2
2
  //# sourceMappingURL=output-projection.js.map