@unbrained/pm-cli 2026.7.20 → 2026.7.21

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 (421) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +11 -0
  3. package/dist/cli/commander-usage.d.ts +1 -1
  4. package/dist/cli/commander-usage.js +5 -5
  5. package/dist/cli/commander-usage.js.map +1 -1
  6. package/dist/cli/commands/completion.js +13 -5
  7. package/dist/cli/commands/completion.js.map +1 -1
  8. package/dist/cli/commands/contracts.js +4 -3
  9. package/dist/cli/commands/contracts.js.map +1 -1
  10. package/dist/cli/error-guidance.d.ts +2 -0
  11. package/dist/cli/error-guidance.js +7 -2
  12. package/dist/cli/error-guidance.js.map +1 -1
  13. package/dist/cli/main.d.ts +1 -5
  14. package/dist/cli/main.js +12 -50
  15. package/dist/cli/main.js.map +1 -1
  16. package/dist/cli/register-list-query.js +13 -3
  17. package/dist/cli/register-list-query.js.map +1 -1
  18. package/dist/cli/register-mutation.js +45 -3
  19. package/dist/cli/register-mutation.js.map +1 -1
  20. package/dist/cli/register-structured-mutation.d.ts +14 -0
  21. package/dist/cli/register-structured-mutation.js +62 -0
  22. package/dist/cli/register-structured-mutation.js.map +1 -0
  23. package/dist/cli/registration-helpers.js +5 -3
  24. package/dist/cli/registration-helpers.js.map +1 -1
  25. package/dist/cli-bundle/bundle-manifest.json +280 -296
  26. package/dist/cli-bundle/chunks/{append-E6V54WOQ.js → append-7OVFYR3C.js} +3 -3
  27. package/dist/cli-bundle/chunks/{append-NNJ3EFIT.js → append-DFETHAZL.js} +3 -3
  28. package/dist/cli-bundle/chunks/{chunk-C3KD7U3T.js → chunk-2L6ZP22J.js} +241 -10
  29. package/dist/cli-bundle/chunks/chunk-2L6ZP22J.js.map +7 -0
  30. package/dist/cli-bundle/chunks/{chunk-KZEANWJS.js → chunk-4PUUNQDV.js} +98 -30
  31. package/dist/cli-bundle/chunks/chunk-4PUUNQDV.js.map +7 -0
  32. package/dist/cli-bundle/chunks/{chunk-RDV4ZFYS.js → chunk-4QOB7L7I.js} +7 -9
  33. package/dist/cli-bundle/chunks/{chunk-RDV4ZFYS.js.map → chunk-4QOB7L7I.js.map} +1 -1
  34. package/dist/cli-bundle/chunks/{chunk-3LPFHE3P.js → chunk-4QSQ6XDK.js} +62 -20
  35. package/dist/cli-bundle/chunks/chunk-4QSQ6XDK.js.map +1 -0
  36. package/dist/cli-bundle/chunks/{chunk-QJKL5PHS.js → chunk-7656MAUL.js} +2 -2
  37. package/dist/cli-bundle/chunks/{chunk-3AO5VSDR.js → chunk-7RW4JCU2.js} +328 -6
  38. package/dist/cli-bundle/chunks/chunk-7RW4JCU2.js.map +7 -0
  39. package/dist/cli-bundle/chunks/{chunk-X6K5XTTN.js → chunk-7W2UAXXT.js} +5 -5
  40. package/dist/cli-bundle/chunks/{chunk-SSKOQNMS.js → chunk-ABWCF646.js} +9 -11
  41. package/dist/cli-bundle/chunks/{chunk-SSKOQNMS.js.map → chunk-ABWCF646.js.map} +1 -1
  42. package/dist/cli-bundle/chunks/{chunk-WVA4DVNV.js → chunk-ADBTSVGK.js} +71 -33
  43. package/dist/cli-bundle/chunks/chunk-ADBTSVGK.js.map +7 -0
  44. package/dist/cli-bundle/chunks/{chunk-J4FBIFU6.js → chunk-AELMUANP.js} +12 -6
  45. package/dist/cli-bundle/chunks/chunk-AELMUANP.js.map +1 -0
  46. package/dist/cli-bundle/chunks/{chunk-4F6BWJ4J.js → chunk-AMJPSANK.js} +57 -36
  47. package/dist/cli-bundle/chunks/chunk-AMJPSANK.js.map +7 -0
  48. package/dist/cli-bundle/chunks/{chunk-6VIJ7UA5.js → chunk-AS4SAZ5R.js} +850 -819
  49. package/dist/cli-bundle/chunks/chunk-AS4SAZ5R.js.map +7 -0
  50. package/dist/cli-bundle/chunks/{chunk-SG74J6MV.js → chunk-ATBCUC7Y.js} +574 -5
  51. package/dist/cli-bundle/chunks/chunk-ATBCUC7Y.js.map +1 -0
  52. package/dist/cli-bundle/chunks/{chunk-5OK4UGFV.js → chunk-BXNDKOR2.js} +3 -3
  53. package/dist/cli-bundle/chunks/{chunk-KSPWRNVP.js → chunk-CPX275C6.js} +2 -2
  54. package/dist/cli-bundle/chunks/{chunk-JH2ZSLO3.js → chunk-DZRV2OPA.js} +2 -2
  55. package/dist/cli-bundle/chunks/{chunk-L7BH7IWU.js → chunk-E5XMKOSB.js} +2 -2
  56. package/dist/cli-bundle/chunks/{chunk-CQTQKUUV.js → chunk-EWJWSNRU.js} +3 -3
  57. package/dist/cli-bundle/chunks/{chunk-DAQ45GCS.js → chunk-F2LBF7XJ.js} +22 -15
  58. package/dist/cli-bundle/chunks/chunk-F2LBF7XJ.js.map +7 -0
  59. package/dist/cli-bundle/chunks/{chunk-6XMUURSS.js → chunk-FJIFFBJX.js} +64 -33
  60. package/dist/cli-bundle/chunks/chunk-FJIFFBJX.js.map +1 -0
  61. package/dist/cli-bundle/chunks/{chunk-E7ICD63T.js → chunk-FO6OSVEN.js} +4 -6
  62. package/dist/cli-bundle/chunks/{chunk-E7ICD63T.js.map → chunk-FO6OSVEN.js.map} +1 -1
  63. package/dist/cli-bundle/chunks/{chunk-3MCTMJXI.js → chunk-FPBMLYPI.js} +2 -2
  64. package/dist/cli-bundle/chunks/{chunk-UZDQXNUB.js → chunk-FSE2IKJQ.js} +46 -5
  65. package/dist/cli-bundle/chunks/chunk-FSE2IKJQ.js.map +1 -0
  66. package/dist/cli-bundle/chunks/{chunk-IX677TRO.js → chunk-GKX4NJ7U.js} +8 -10
  67. package/dist/cli-bundle/chunks/{chunk-IX677TRO.js.map → chunk-GKX4NJ7U.js.map} +1 -1
  68. package/dist/cli-bundle/chunks/{chunk-DVDBQA3B.js → chunk-GTK4DTEW.js} +5 -5
  69. package/dist/cli-bundle/chunks/chunk-H7EAER5L.js +974 -0
  70. package/dist/cli-bundle/chunks/chunk-H7EAER5L.js.map +1 -0
  71. package/dist/cli-bundle/chunks/{chunk-5UX66S6U.js → chunk-ICDAQ4TD.js} +316 -8
  72. package/dist/cli-bundle/chunks/chunk-ICDAQ4TD.js.map +1 -0
  73. package/dist/cli-bundle/chunks/{chunk-YQQNAKW3.js → chunk-JFD5LPMI.js} +6 -8
  74. package/dist/cli-bundle/chunks/{chunk-YQQNAKW3.js.map → chunk-JFD5LPMI.js.map} +1 -1
  75. package/dist/cli-bundle/chunks/{chunk-QANSTTC7.js → chunk-JXCW2TI2.js} +6 -8
  76. package/dist/cli-bundle/chunks/{chunk-QANSTTC7.js.map → chunk-JXCW2TI2.js.map} +1 -1
  77. package/dist/cli-bundle/chunks/{chunk-GSJSM5BJ.js → chunk-K36WV5J6.js} +76 -13
  78. package/dist/cli-bundle/chunks/chunk-K36WV5J6.js.map +1 -0
  79. package/dist/cli-bundle/chunks/{chunk-GVI6FAFG.js → chunk-K55VMLSS.js} +7 -5
  80. package/dist/cli-bundle/chunks/chunk-K55VMLSS.js.map +7 -0
  81. package/dist/cli-bundle/chunks/{chunk-GIQSU6S2.js → chunk-KBLZ3AA5.js} +2 -2
  82. package/dist/cli-bundle/chunks/{chunk-XJF7CDNH.js → chunk-KH44WBAT.js} +2 -2
  83. package/dist/cli-bundle/chunks/{chunk-GV2262OF.js → chunk-LAV26CQG.js} +2 -2
  84. package/dist/cli-bundle/chunks/{chunk-VDO2JMD4.js → chunk-LVC72YRD.js} +2 -2
  85. package/dist/cli-bundle/chunks/{chunk-3VY6MIEO.js → chunk-LZYP423P.js} +35 -6
  86. package/dist/cli-bundle/chunks/chunk-LZYP423P.js.map +7 -0
  87. package/dist/cli-bundle/chunks/{chunk-ZYPFOO3L.js → chunk-MATHDCGG.js} +3 -3
  88. package/dist/cli-bundle/chunks/{chunk-OV7MSW3I.js → chunk-MWQ2HC2A.js} +99 -31
  89. package/dist/cli-bundle/chunks/chunk-MWQ2HC2A.js.map +1 -0
  90. package/dist/cli-bundle/chunks/{chunk-NHT3F4WZ.js → chunk-NUF7ROFH.js} +840 -816
  91. package/dist/cli-bundle/chunks/chunk-NUF7ROFH.js.map +1 -0
  92. package/dist/cli-bundle/chunks/{chunk-AOEOYL3S.js → chunk-O4BCOJTZ.js} +3 -3
  93. package/dist/cli-bundle/chunks/{chunk-RJO3YAFM.js → chunk-OCUBRA6D.js} +2 -2
  94. package/dist/cli-bundle/chunks/{chunk-5IZJWSDB.js → chunk-OG5DVFMA.js} +22 -15
  95. package/dist/cli-bundle/chunks/chunk-OG5DVFMA.js.map +1 -0
  96. package/dist/cli-bundle/chunks/{chunk-I577UHC7.js → chunk-OR42SO64.js} +2 -2
  97. package/dist/cli-bundle/chunks/{chunk-ZOJ3LR7O.js → chunk-OY7DMU5P.js} +2 -2
  98. package/dist/cli-bundle/chunks/{chunk-HEWM6CEN.js → chunk-P7MTHPJQ.js} +50 -9
  99. package/dist/cli-bundle/chunks/chunk-P7MTHPJQ.js.map +7 -0
  100. package/dist/cli-bundle/chunks/{chunk-2BO4CA46.js → chunk-PFNHX655.js} +236 -12
  101. package/dist/cli-bundle/chunks/{chunk-2BO4CA46.js.map → chunk-PFNHX655.js.map} +1 -1
  102. package/dist/cli-bundle/chunks/{chunk-ZV2NTVMJ.js → chunk-PONKZPCJ.js} +2 -2
  103. package/dist/cli-bundle/chunks/{chunk-THAOZG4U.js → chunk-PQSEQD6E.js} +8 -6
  104. package/dist/cli-bundle/chunks/chunk-PQSEQD6E.js.map +1 -0
  105. package/dist/cli-bundle/chunks/chunk-PWDEHT3L.js +991 -0
  106. package/dist/cli-bundle/chunks/chunk-PWDEHT3L.js.map +7 -0
  107. package/dist/cli-bundle/chunks/{chunk-UX6SSO2I.js → chunk-PZC2FUOQ.js} +2 -2
  108. package/dist/cli-bundle/chunks/{chunk-WUVEBQW6.js → chunk-QG4GFLQ6.js} +3 -5
  109. package/dist/cli-bundle/chunks/{chunk-WUVEBQW6.js.map → chunk-QG4GFLQ6.js.map} +1 -1
  110. package/dist/cli-bundle/chunks/{chunk-VQIHNHMJ.js → chunk-QIH77CAG.js} +2 -2
  111. package/dist/cli-bundle/chunks/{chunk-R3EWPG4A.js → chunk-QJIKE24M.js} +2 -2
  112. package/dist/cli-bundle/chunks/{chunk-QLZ643FM.js → chunk-QOOTOD3W.js} +10 -12
  113. package/dist/cli-bundle/chunks/{chunk-QLZ643FM.js.map → chunk-QOOTOD3W.js.map} +1 -1
  114. package/dist/cli-bundle/chunks/{chunk-MYSS5H2A.js → chunk-R3P6FZJW.js} +5 -7
  115. package/dist/cli-bundle/chunks/{chunk-MYSS5H2A.js.map → chunk-R3P6FZJW.js.map} +1 -1
  116. package/dist/cli-bundle/chunks/{chunk-G3COA6GS.js → chunk-RNPZYNHS.js} +56 -35
  117. package/dist/cli-bundle/chunks/chunk-RNPZYNHS.js.map +1 -0
  118. package/dist/cli-bundle/chunks/{chunk-T44FMVRL.js → chunk-RPESLSO5.js} +62 -20
  119. package/dist/cli-bundle/chunks/chunk-RPESLSO5.js.map +7 -0
  120. package/dist/cli-bundle/chunks/{chunk-INSTSQNZ.js → chunk-SY4SFZSD.js} +595 -3
  121. package/dist/cli-bundle/chunks/chunk-SY4SFZSD.js.map +7 -0
  122. package/dist/cli-bundle/chunks/{chunk-HB3P4M52.js → chunk-TRSHFPRZ.js} +2 -2
  123. package/dist/cli-bundle/chunks/{chunk-HRW7GF6T.js → chunk-UCBDQI5E.js} +2 -2
  124. package/dist/cli-bundle/chunks/{chunk-4U4Z6AHI.js → chunk-V22ZPOKN.js} +2 -2
  125. package/dist/cli-bundle/chunks/{chunk-JM6YAXTR.js → chunk-VHXHVTUU.js} +2 -2
  126. package/dist/cli-bundle/chunks/{chunk-LPEYZRUR.js → chunk-VJQG4BIM.js} +35 -6
  127. package/dist/cli-bundle/chunks/chunk-VJQG4BIM.js.map +1 -0
  128. package/dist/cli-bundle/chunks/{chunk-D6NXDNP3.js → chunk-VLRGDBLY.js} +2 -2
  129. package/dist/cli-bundle/chunks/{chunk-JAPE62Y5.js → chunk-VNTCM3VW.js} +3 -3
  130. package/dist/cli-bundle/chunks/{chunk-FDHPAVVB.js → chunk-VXOOB6YX.js} +2 -2
  131. package/dist/cli-bundle/chunks/{chunk-GFQP7HAZ.js → chunk-VZIZB6QH.js} +3 -5
  132. package/dist/cli-bundle/chunks/{chunk-GFQP7HAZ.js.map → chunk-VZIZB6QH.js.map} +1 -1
  133. package/dist/cli-bundle/chunks/{chunk-HQ3SB4CN.js → chunk-X3W65QK3.js} +2 -2
  134. package/dist/cli-bundle/chunks/{chunk-RZJLNXFG.js → chunk-XJTABV3X.js} +3 -3
  135. package/dist/cli-bundle/chunks/{chunk-GVT754PX.js → chunk-YCIUJJOD.js} +11 -5
  136. package/dist/cli-bundle/chunks/chunk-YCIUJJOD.js.map +7 -0
  137. package/dist/cli-bundle/chunks/{chunk-IJNK6WW2.js → chunk-Z75ONV25.js} +75 -12
  138. package/dist/cli-bundle/chunks/chunk-Z75ONV25.js.map +7 -0
  139. package/dist/cli-bundle/chunks/{chunk-4L23AGQ7.js → chunk-Z7VWXXJM.js} +5 -7
  140. package/dist/cli-bundle/chunks/{chunk-4L23AGQ7.js.map → chunk-Z7VWXXJM.js.map} +1 -1
  141. package/dist/cli-bundle/chunks/{chunk-YBT7O4KT.js → chunk-ZTVA4KLN.js} +4 -6
  142. package/dist/cli-bundle/chunks/{chunk-YBT7O4KT.js.map → chunk-ZTVA4KLN.js.map} +1 -1
  143. package/dist/cli-bundle/chunks/{chunk-TYHJDFYW.js → chunk-ZVZGXPQ5.js} +2 -2
  144. package/dist/cli-bundle/chunks/{close-many-SDA426VT.js → close-many-5RZXVN4J.js} +5 -6
  145. package/dist/cli-bundle/chunks/{close-many-UTZANOCQ.js → close-many-RZVTUGBG.js} +5 -6
  146. package/dist/cli-bundle/chunks/{comments-LZN6FXXC.js → comments-TPU7QRBL.js} +4 -4
  147. package/dist/cli-bundle/chunks/{comments-VBQ345ND.js → comments-Z4KV6FU3.js} +4 -4
  148. package/dist/cli-bundle/chunks/{create-GG4RBCGC.js → create-EIFBIVNQ.js} +6 -6
  149. package/dist/cli-bundle/chunks/{create-JBC5KUW6.js → create-RGSPN5GD.js} +6 -6
  150. package/dist/cli-bundle/chunks/{deps-FI4O6NQS.js → deps-UH5EQQUY.js} +3 -3
  151. package/dist/cli-bundle/chunks/{deps-DELOO4TL.js → deps-YG7UF3VR.js} +3 -3
  152. package/dist/cli-bundle/chunks/{docs-6Z2MP526.js → docs-G32TK6XS.js} +4 -4
  153. package/dist/cli-bundle/chunks/{docs-2UYBP5D6.js → docs-JWWNRC27.js} +4 -4
  154. package/dist/cli-bundle/chunks/{files-HKEAN5MA.js → files-3H32UQ4K.js} +4 -4
  155. package/dist/cli-bundle/chunks/{files-HEUGSJZL.js → files-4ALMCSKB.js} +4 -4
  156. package/dist/cli-bundle/chunks/{history-compact-7NDVP3PT.js → history-compact-77BT2LUB.js} +3 -4
  157. package/dist/cli-bundle/chunks/{history-compact-65YVN5DB.js → history-compact-VCKGTX64.js} +3 -4
  158. package/dist/cli-bundle/chunks/{history-redact-7YBL4XSG.js → history-redact-LJPZPNFA.js} +2 -3
  159. package/dist/cli-bundle/chunks/{history-redact-IZGNJBU4.js → history-redact-PWTTJ3XS.js} +2 -3
  160. package/dist/cli-bundle/chunks/{history-repair-7M4PYQUH.js → history-repair-I7CBNCV3.js} +5 -6
  161. package/dist/cli-bundle/chunks/{history-repair-GNGETJLI.js → history-repair-YTDZRK5E.js} +5 -6
  162. package/dist/cli-bundle/chunks/{learnings-3YXDRWFT.js → learnings-CYNOICKR.js} +4 -4
  163. package/dist/cli-bundle/chunks/{learnings-ALC6IMNL.js → learnings-KTYW3AL7.js} +4 -4
  164. package/dist/cli-bundle/chunks/{notes-7JMLQ447.js → notes-FGO63FXL.js} +4 -4
  165. package/dist/cli-bundle/chunks/{notes-JFCLTC5C.js → notes-ZERD3KB2.js} +4 -4
  166. package/dist/cli-bundle/chunks/{plan-T3XB3WTK.js → plan-OFJUBIM5.js} +7 -7
  167. package/dist/cli-bundle/chunks/{plan-KOIPWVOZ.js → plan-SGCDDTYR.js} +7 -7
  168. package/dist/cli-bundle/chunks/{profile-OILJHKUW.js → profile-3THJPIQY.js} +4 -5
  169. package/dist/cli-bundle/chunks/{profile-RJXA7PGS.js → profile-XEZAMMBW.js} +4 -5
  170. package/dist/cli-bundle/chunks/{register-list-query-CFVG75P3.js → register-list-query-BR435Q2H.js} +19 -16
  171. package/dist/cli-bundle/chunks/register-list-query-BR435Q2H.js.map +1 -0
  172. package/dist/cli-bundle/chunks/{register-list-query-E7UVY4TN.js → register-list-query-RWTWLOBE.js} +18 -15
  173. package/dist/cli-bundle/chunks/register-list-query-RWTWLOBE.js.map +7 -0
  174. package/dist/cli-bundle/chunks/{register-mutation-IQ55E25C.js → register-mutation-HLWC2WNP.js} +167 -31
  175. package/dist/cli-bundle/chunks/register-mutation-HLWC2WNP.js.map +1 -0
  176. package/dist/cli-bundle/chunks/{register-mutation-4VJTXBZW.js → register-mutation-ZJX5AZM5.js} +173 -30
  177. package/dist/cli-bundle/chunks/register-mutation-ZJX5AZM5.js.map +7 -0
  178. package/dist/cli-bundle/chunks/{register-operations-AR7RMX4W.js → register-operations-744YBJMV.js} +23 -25
  179. package/dist/cli-bundle/chunks/{register-operations-AR7RMX4W.js.map → register-operations-744YBJMV.js.map} +1 -1
  180. package/dist/cli-bundle/chunks/{register-operations-NOLZGORC.js → register-operations-UEBJH6AN.js} +21 -23
  181. package/dist/cli-bundle/chunks/{register-operations-NOLZGORC.js.map → register-operations-UEBJH6AN.js.map} +1 -1
  182. package/dist/cli-bundle/chunks/{register-setup-EYZ7VTPZ.js → register-setup-5DA4UZXI.js} +7 -8
  183. package/dist/cli-bundle/chunks/{register-setup-EYZ7VTPZ.js.map → register-setup-5DA4UZXI.js.map} +1 -1
  184. package/dist/cli-bundle/chunks/{register-setup-BB77VUEE.js → register-setup-6H25M3BH.js} +9 -10
  185. package/dist/cli-bundle/chunks/{register-setup-BB77VUEE.js.map → register-setup-6H25M3BH.js.map} +1 -1
  186. package/dist/cli-bundle/chunks/{restore-ZH65GZFB.js → restore-6TDVSATY.js} +4 -5
  187. package/dist/cli-bundle/chunks/{restore-L6IAGOD7.js → restore-RSL7C7LO.js} +4 -5
  188. package/dist/cli-bundle/chunks/{schema-4ERWM5QJ.js → schema-HFXFSGPG.js} +2 -3
  189. package/dist/cli-bundle/chunks/{schema-55DL3Q52.js → schema-TPVTIJPO.js} +2 -3
  190. package/dist/cli-bundle/chunks/{update-FW6FKDOP.js → update-LJZCL5SI.js} +7 -7
  191. package/dist/cli-bundle/chunks/{update-TJHSPRPT.js → update-SIA7LH5Y.js} +7 -7
  192. package/dist/cli-bundle/chunks/{update-many-PWXX5WHO.js → update-many-BDBZVGQL.js} +11 -12
  193. package/dist/cli-bundle/chunks/{update-many-NNALYQCN.js → update-many-MOY3A5B3.js} +11 -12
  194. package/dist/cli-bundle/main.js +60 -85
  195. package/dist/cli-bundle/main.js.map +2 -2
  196. package/dist/cli-bundle/sdk-runtime.js +37 -37
  197. package/dist/cli-bundle/sdk.js +126 -291
  198. package/dist/cli-bundle/sdk.js.map +4 -4
  199. package/dist/core/item/parse.d.ts +1 -1
  200. package/dist/core/item/parse.js +13 -7
  201. package/dist/core/item/parse.js.map +1 -1
  202. package/dist/core/output/mutation-projection.d.ts +2 -0
  203. package/dist/core/output/mutation-projection.js +33 -2
  204. package/dist/core/output/mutation-projection.js.map +1 -1
  205. package/dist/core/output/output.d.ts +4 -0
  206. package/dist/core/output/output.js +18 -13
  207. package/dist/core/output/output.js.map +1 -1
  208. package/dist/core/shared/command-types.d.ts +4 -0
  209. package/dist/core/shared/command-types.js +2 -2
  210. package/dist/core/shared/command-types.js.map +1 -1
  211. package/dist/mcp/server.js +39 -4
  212. package/dist/mcp/server.js.map +1 -1
  213. package/dist/mcp/tool-definitions.js +45 -4
  214. package/dist/mcp/tool-definitions.js.map +1 -1
  215. package/dist/sdk/cli-bootstrap.d.ts +2 -0
  216. package/dist/sdk/cli-bootstrap.js +20 -27
  217. package/dist/sdk/cli-bootstrap.js.map +1 -1
  218. package/dist/sdk/cli-contracts/enum-contracts.d.ts +2 -2
  219. package/dist/sdk/cli-contracts/enum-contracts.js +7 -2
  220. package/dist/sdk/cli-contracts/enum-contracts.js.map +1 -1
  221. package/dist/sdk/cli-contracts/flag-contracts.d.ts +2 -0
  222. package/dist/sdk/cli-contracts/flag-contracts.js +21 -2
  223. package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -1
  224. package/dist/sdk/cli-contracts/tool-option-contracts.js +10 -2
  225. package/dist/sdk/cli-contracts/tool-option-contracts.js.map +1 -1
  226. package/dist/sdk/cli-contracts/tool-parameter-tables.js +16 -3
  227. package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
  228. package/dist/sdk/cli-contracts/tool-schema.js +6 -2
  229. package/dist/sdk/cli-contracts/tool-schema.js.map +1 -1
  230. package/dist/sdk/cli-contracts.d.ts +1 -1
  231. package/dist/sdk/cli-contracts.js +3 -3
  232. package/dist/sdk/cli-contracts.js.map +1 -1
  233. package/dist/sdk/cli-program.js +4 -2
  234. package/dist/sdk/cli-program.js.map +1 -1
  235. package/dist/sdk/dependencies.d.ts +3 -2
  236. package/dist/sdk/dependencies.js +13 -12
  237. package/dist/sdk/dependencies.js.map +1 -1
  238. package/dist/sdk/error-runtime.d.ts +10 -0
  239. package/dist/sdk/error-runtime.js +59 -0
  240. package/dist/sdk/error-runtime.js.map +1 -0
  241. package/dist/sdk/graph/analytics.d.ts +9 -0
  242. package/dist/sdk/graph/analytics.js +24 -13
  243. package/dist/sdk/graph/analytics.js.map +1 -1
  244. package/dist/sdk/graph/assembly.d.ts +39 -0
  245. package/dist/sdk/graph/assembly.js +92 -12
  246. package/dist/sdk/graph/assembly.js.map +1 -1
  247. package/dist/sdk/graph/cache.d.ts +4 -1
  248. package/dist/sdk/graph/cache.js +17 -4
  249. package/dist/sdk/graph/cache.js.map +1 -1
  250. package/dist/sdk/graph/centrality.d.ts +82 -0
  251. package/dist/sdk/graph/centrality.js +259 -0
  252. package/dist/sdk/graph/centrality.js.map +1 -0
  253. package/dist/sdk/graph/durable-cache.d.ts +71 -0
  254. package/dist/sdk/graph/durable-cache.js +205 -0
  255. package/dist/sdk/graph/durable-cache.js.map +1 -0
  256. package/dist/sdk/graph/governance.d.ts +69 -1
  257. package/dist/sdk/graph/governance.js +143 -35
  258. package/dist/sdk/graph/governance.js.map +1 -1
  259. package/dist/sdk/graph/index.d.ts +7 -4
  260. package/dist/sdk/graph/index.js +8 -5
  261. package/dist/sdk/graph/index.js.map +1 -1
  262. package/dist/sdk/graph/mutation-advisory.d.ts +35 -4
  263. package/dist/sdk/graph/mutation-advisory.js +124 -35
  264. package/dist/sdk/graph/mutation-advisory.js.map +1 -1
  265. package/dist/sdk/graph/remediation.js +12 -2
  266. package/dist/sdk/graph/remediation.js.map +1 -1
  267. package/dist/sdk/graph/run.d.ts +133 -2
  268. package/dist/sdk/graph/run.js +217 -8
  269. package/dist/sdk/graph/run.js.map +1 -1
  270. package/dist/sdk/graph/scheduling.d.ts +59 -0
  271. package/dist/sdk/graph/scheduling.js +125 -0
  272. package/dist/sdk/graph/scheduling.js.map +1 -0
  273. package/dist/sdk/graph/traversal.d.ts +11 -0
  274. package/dist/sdk/graph/traversal.js +16 -2
  275. package/dist/sdk/graph/traversal.js.map +1 -1
  276. package/dist/sdk/index.d.ts +4 -0
  277. package/dist/sdk/index.js +6 -2
  278. package/dist/sdk/index.js.map +1 -1
  279. package/dist/sdk/runtime-input.js +7 -2
  280. package/dist/sdk/runtime-input.js.map +1 -1
  281. package/dist/sdk/runtime-primitives.d.ts +10 -0
  282. package/dist/sdk/runtime-primitives.js +14 -0
  283. package/dist/sdk/runtime-primitives.js.map +1 -0
  284. package/dist/sdk/runtime.d.ts +15 -0
  285. package/dist/sdk/runtime.js +16 -3
  286. package/dist/sdk/runtime.js.map +1 -1
  287. package/dist/sdk/structured-mutations.d.ts +21 -0
  288. package/dist/sdk/structured-mutations.js +375 -0
  289. package/dist/sdk/structured-mutations.js.map +1 -0
  290. package/docs/COMMANDS.md +85 -5
  291. package/docs/RELATIONSHIP_GRAPH.md +48 -7
  292. package/docs/SDK.md +78 -3
  293. package/marketplace.json +2 -2
  294. package/package.json +1 -1
  295. package/packages/pm-beads/package.json +1 -1
  296. package/packages/pm-calendar/package.json +1 -1
  297. package/packages/pm-command-kit/package.json +1 -1
  298. package/packages/pm-governance-audit/package.json +1 -1
  299. package/packages/pm-guide-shell/package.json +1 -1
  300. package/packages/pm-kanban/package.json +1 -1
  301. package/packages/pm-lifecycle-hooks/package.json +1 -1
  302. package/packages/pm-linked-test-adapters/package.json +1 -1
  303. package/packages/pm-search-advanced/package.json +1 -1
  304. package/packages/pm-templates/package.json +1 -1
  305. package/packages/pm-todos/package.json +1 -1
  306. package/packages/pm-vcs/package.json +1 -1
  307. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  308. package/plugins/pm-claude/README.md +5 -3
  309. package/plugins/pm-claude/commands/pm-init.md +1 -1
  310. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  311. package/dist/cli-bundle/chunks/chunk-3AO5VSDR.js.map +0 -7
  312. package/dist/cli-bundle/chunks/chunk-3LPFHE3P.js.map +0 -1
  313. package/dist/cli-bundle/chunks/chunk-3VY6MIEO.js.map +0 -7
  314. package/dist/cli-bundle/chunks/chunk-4F6BWJ4J.js.map +0 -7
  315. package/dist/cli-bundle/chunks/chunk-5IZJWSDB.js.map +0 -1
  316. package/dist/cli-bundle/chunks/chunk-5UX66S6U.js.map +0 -1
  317. package/dist/cli-bundle/chunks/chunk-6C2ZZX5Z.js +0 -286
  318. package/dist/cli-bundle/chunks/chunk-6C2ZZX5Z.js.map +0 -1
  319. package/dist/cli-bundle/chunks/chunk-6VIJ7UA5.js.map +0 -7
  320. package/dist/cli-bundle/chunks/chunk-6XMUURSS.js.map +0 -1
  321. package/dist/cli-bundle/chunks/chunk-C3KD7U3T.js.map +0 -7
  322. package/dist/cli-bundle/chunks/chunk-CFHAODHQ.js +0 -334
  323. package/dist/cli-bundle/chunks/chunk-CFHAODHQ.js.map +0 -1
  324. package/dist/cli-bundle/chunks/chunk-DAQ45GCS.js.map +0 -7
  325. package/dist/cli-bundle/chunks/chunk-E6LEMURX.js +0 -249
  326. package/dist/cli-bundle/chunks/chunk-E6LEMURX.js.map +0 -7
  327. package/dist/cli-bundle/chunks/chunk-G3COA6GS.js.map +0 -1
  328. package/dist/cli-bundle/chunks/chunk-GSJSM5BJ.js.map +0 -1
  329. package/dist/cli-bundle/chunks/chunk-GVI6FAFG.js.map +0 -7
  330. package/dist/cli-bundle/chunks/chunk-GVT754PX.js.map +0 -7
  331. package/dist/cli-bundle/chunks/chunk-HEWM6CEN.js.map +0 -7
  332. package/dist/cli-bundle/chunks/chunk-IJNK6WW2.js.map +0 -7
  333. package/dist/cli-bundle/chunks/chunk-INSTSQNZ.js.map +0 -7
  334. package/dist/cli-bundle/chunks/chunk-J4FBIFU6.js.map +0 -1
  335. package/dist/cli-bundle/chunks/chunk-KZEANWJS.js.map +0 -7
  336. package/dist/cli-bundle/chunks/chunk-LPEYZRUR.js.map +0 -1
  337. package/dist/cli-bundle/chunks/chunk-NHT3F4WZ.js.map +0 -1
  338. package/dist/cli-bundle/chunks/chunk-OV7MSW3I.js.map +0 -1
  339. package/dist/cli-bundle/chunks/chunk-P7JTWYLH.js +0 -246
  340. package/dist/cli-bundle/chunks/chunk-P7JTWYLH.js.map +0 -1
  341. package/dist/cli-bundle/chunks/chunk-R5U2VZ3K.js +0 -344
  342. package/dist/cli-bundle/chunks/chunk-R5U2VZ3K.js.map +0 -7
  343. package/dist/cli-bundle/chunks/chunk-SG74J6MV.js.map +0 -1
  344. package/dist/cli-bundle/chunks/chunk-T44FMVRL.js.map +0 -7
  345. package/dist/cli-bundle/chunks/chunk-THAOZG4U.js.map +0 -1
  346. package/dist/cli-bundle/chunks/chunk-UQLXSG72.js +0 -289
  347. package/dist/cli-bundle/chunks/chunk-UQLXSG72.js.map +0 -7
  348. package/dist/cli-bundle/chunks/chunk-UZDQXNUB.js.map +0 -1
  349. package/dist/cli-bundle/chunks/chunk-WVA4DVNV.js.map +0 -7
  350. package/dist/cli-bundle/chunks/register-list-query-CFVG75P3.js.map +0 -1
  351. package/dist/cli-bundle/chunks/register-list-query-E7UVY4TN.js.map +0 -7
  352. package/dist/cli-bundle/chunks/register-mutation-4VJTXBZW.js.map +0 -7
  353. package/dist/cli-bundle/chunks/register-mutation-IQ55E25C.js.map +0 -1
  354. /package/dist/cli-bundle/chunks/{append-E6V54WOQ.js.map → append-7OVFYR3C.js.map} +0 -0
  355. /package/dist/cli-bundle/chunks/{append-NNJ3EFIT.js.map → append-DFETHAZL.js.map} +0 -0
  356. /package/dist/cli-bundle/chunks/{chunk-QJKL5PHS.js.map → chunk-7656MAUL.js.map} +0 -0
  357. /package/dist/cli-bundle/chunks/{chunk-X6K5XTTN.js.map → chunk-7W2UAXXT.js.map} +0 -0
  358. /package/dist/cli-bundle/chunks/{chunk-5OK4UGFV.js.map → chunk-BXNDKOR2.js.map} +0 -0
  359. /package/dist/cli-bundle/chunks/{chunk-KSPWRNVP.js.map → chunk-CPX275C6.js.map} +0 -0
  360. /package/dist/cli-bundle/chunks/{chunk-JH2ZSLO3.js.map → chunk-DZRV2OPA.js.map} +0 -0
  361. /package/dist/cli-bundle/chunks/{chunk-L7BH7IWU.js.map → chunk-E5XMKOSB.js.map} +0 -0
  362. /package/dist/cli-bundle/chunks/{chunk-CQTQKUUV.js.map → chunk-EWJWSNRU.js.map} +0 -0
  363. /package/dist/cli-bundle/chunks/{chunk-3MCTMJXI.js.map → chunk-FPBMLYPI.js.map} +0 -0
  364. /package/dist/cli-bundle/chunks/{chunk-DVDBQA3B.js.map → chunk-GTK4DTEW.js.map} +0 -0
  365. /package/dist/cli-bundle/chunks/{chunk-GIQSU6S2.js.map → chunk-KBLZ3AA5.js.map} +0 -0
  366. /package/dist/cli-bundle/chunks/{chunk-XJF7CDNH.js.map → chunk-KH44WBAT.js.map} +0 -0
  367. /package/dist/cli-bundle/chunks/{chunk-GV2262OF.js.map → chunk-LAV26CQG.js.map} +0 -0
  368. /package/dist/cli-bundle/chunks/{chunk-VDO2JMD4.js.map → chunk-LVC72YRD.js.map} +0 -0
  369. /package/dist/cli-bundle/chunks/{chunk-ZYPFOO3L.js.map → chunk-MATHDCGG.js.map} +0 -0
  370. /package/dist/cli-bundle/chunks/{chunk-AOEOYL3S.js.map → chunk-O4BCOJTZ.js.map} +0 -0
  371. /package/dist/cli-bundle/chunks/{chunk-RJO3YAFM.js.map → chunk-OCUBRA6D.js.map} +0 -0
  372. /package/dist/cli-bundle/chunks/{chunk-I577UHC7.js.map → chunk-OR42SO64.js.map} +0 -0
  373. /package/dist/cli-bundle/chunks/{chunk-ZOJ3LR7O.js.map → chunk-OY7DMU5P.js.map} +0 -0
  374. /package/dist/cli-bundle/chunks/{chunk-ZV2NTVMJ.js.map → chunk-PONKZPCJ.js.map} +0 -0
  375. /package/dist/cli-bundle/chunks/{chunk-UX6SSO2I.js.map → chunk-PZC2FUOQ.js.map} +0 -0
  376. /package/dist/cli-bundle/chunks/{chunk-VQIHNHMJ.js.map → chunk-QIH77CAG.js.map} +0 -0
  377. /package/dist/cli-bundle/chunks/{chunk-R3EWPG4A.js.map → chunk-QJIKE24M.js.map} +0 -0
  378. /package/dist/cli-bundle/chunks/{chunk-HB3P4M52.js.map → chunk-TRSHFPRZ.js.map} +0 -0
  379. /package/dist/cli-bundle/chunks/{chunk-HRW7GF6T.js.map → chunk-UCBDQI5E.js.map} +0 -0
  380. /package/dist/cli-bundle/chunks/{chunk-4U4Z6AHI.js.map → chunk-V22ZPOKN.js.map} +0 -0
  381. /package/dist/cli-bundle/chunks/{chunk-JM6YAXTR.js.map → chunk-VHXHVTUU.js.map} +0 -0
  382. /package/dist/cli-bundle/chunks/{chunk-D6NXDNP3.js.map → chunk-VLRGDBLY.js.map} +0 -0
  383. /package/dist/cli-bundle/chunks/{chunk-JAPE62Y5.js.map → chunk-VNTCM3VW.js.map} +0 -0
  384. /package/dist/cli-bundle/chunks/{chunk-FDHPAVVB.js.map → chunk-VXOOB6YX.js.map} +0 -0
  385. /package/dist/cli-bundle/chunks/{chunk-HQ3SB4CN.js.map → chunk-X3W65QK3.js.map} +0 -0
  386. /package/dist/cli-bundle/chunks/{chunk-RZJLNXFG.js.map → chunk-XJTABV3X.js.map} +0 -0
  387. /package/dist/cli-bundle/chunks/{chunk-TYHJDFYW.js.map → chunk-ZVZGXPQ5.js.map} +0 -0
  388. /package/dist/cli-bundle/chunks/{close-many-SDA426VT.js.map → close-many-5RZXVN4J.js.map} +0 -0
  389. /package/dist/cli-bundle/chunks/{close-many-UTZANOCQ.js.map → close-many-RZVTUGBG.js.map} +0 -0
  390. /package/dist/cli-bundle/chunks/{comments-LZN6FXXC.js.map → comments-TPU7QRBL.js.map} +0 -0
  391. /package/dist/cli-bundle/chunks/{comments-VBQ345ND.js.map → comments-Z4KV6FU3.js.map} +0 -0
  392. /package/dist/cli-bundle/chunks/{create-GG4RBCGC.js.map → create-EIFBIVNQ.js.map} +0 -0
  393. /package/dist/cli-bundle/chunks/{create-JBC5KUW6.js.map → create-RGSPN5GD.js.map} +0 -0
  394. /package/dist/cli-bundle/chunks/{deps-FI4O6NQS.js.map → deps-UH5EQQUY.js.map} +0 -0
  395. /package/dist/cli-bundle/chunks/{deps-DELOO4TL.js.map → deps-YG7UF3VR.js.map} +0 -0
  396. /package/dist/cli-bundle/chunks/{docs-6Z2MP526.js.map → docs-G32TK6XS.js.map} +0 -0
  397. /package/dist/cli-bundle/chunks/{docs-2UYBP5D6.js.map → docs-JWWNRC27.js.map} +0 -0
  398. /package/dist/cli-bundle/chunks/{files-HKEAN5MA.js.map → files-3H32UQ4K.js.map} +0 -0
  399. /package/dist/cli-bundle/chunks/{files-HEUGSJZL.js.map → files-4ALMCSKB.js.map} +0 -0
  400. /package/dist/cli-bundle/chunks/{history-compact-7NDVP3PT.js.map → history-compact-77BT2LUB.js.map} +0 -0
  401. /package/dist/cli-bundle/chunks/{history-compact-65YVN5DB.js.map → history-compact-VCKGTX64.js.map} +0 -0
  402. /package/dist/cli-bundle/chunks/{history-redact-7YBL4XSG.js.map → history-redact-LJPZPNFA.js.map} +0 -0
  403. /package/dist/cli-bundle/chunks/{history-redact-IZGNJBU4.js.map → history-redact-PWTTJ3XS.js.map} +0 -0
  404. /package/dist/cli-bundle/chunks/{history-repair-7M4PYQUH.js.map → history-repair-I7CBNCV3.js.map} +0 -0
  405. /package/dist/cli-bundle/chunks/{history-repair-GNGETJLI.js.map → history-repair-YTDZRK5E.js.map} +0 -0
  406. /package/dist/cli-bundle/chunks/{learnings-3YXDRWFT.js.map → learnings-CYNOICKR.js.map} +0 -0
  407. /package/dist/cli-bundle/chunks/{learnings-ALC6IMNL.js.map → learnings-KTYW3AL7.js.map} +0 -0
  408. /package/dist/cli-bundle/chunks/{notes-7JMLQ447.js.map → notes-FGO63FXL.js.map} +0 -0
  409. /package/dist/cli-bundle/chunks/{notes-JFCLTC5C.js.map → notes-ZERD3KB2.js.map} +0 -0
  410. /package/dist/cli-bundle/chunks/{plan-T3XB3WTK.js.map → plan-OFJUBIM5.js.map} +0 -0
  411. /package/dist/cli-bundle/chunks/{plan-KOIPWVOZ.js.map → plan-SGCDDTYR.js.map} +0 -0
  412. /package/dist/cli-bundle/chunks/{profile-OILJHKUW.js.map → profile-3THJPIQY.js.map} +0 -0
  413. /package/dist/cli-bundle/chunks/{profile-RJXA7PGS.js.map → profile-XEZAMMBW.js.map} +0 -0
  414. /package/dist/cli-bundle/chunks/{restore-ZH65GZFB.js.map → restore-6TDVSATY.js.map} +0 -0
  415. /package/dist/cli-bundle/chunks/{restore-L6IAGOD7.js.map → restore-RSL7C7LO.js.map} +0 -0
  416. /package/dist/cli-bundle/chunks/{schema-4ERWM5QJ.js.map → schema-HFXFSGPG.js.map} +0 -0
  417. /package/dist/cli-bundle/chunks/{schema-55DL3Q52.js.map → schema-TPVTIJPO.js.map} +0 -0
  418. /package/dist/cli-bundle/chunks/{update-FW6FKDOP.js.map → update-LJZCL5SI.js.map} +0 -0
  419. /package/dist/cli-bundle/chunks/{update-TJHSPRPT.js.map → update-SIA7LH5Y.js.map} +0 -0
  420. /package/dist/cli-bundle/chunks/{update-many-PWXX5WHO.js.map → update-many-BDBZVGQL.js.map} +0 -0
  421. /package/dist/cli-bundle/chunks/{update-many-NNALYQCN.js.map → update-many-MOY3A5B3.js.map} +0 -0
@@ -1,7 +1,22 @@
1
+ import {
2
+ close,
3
+ commitWorkspaceTransaction,
4
+ create,
5
+ deleteItem,
6
+ get,
7
+ restore,
8
+ update
9
+ } from "./chunk-AMJPSANK.js";
10
+ import {
11
+ CLOSE_FLAG_CONTRACTS,
12
+ CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,
13
+ UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS
14
+ } from "./chunk-P7MTHPJQ.js";
1
15
  import {
2
16
  historyEntriesToRaw,
17
+ readHistoryEntries,
3
18
  reanchorHistoryEntries
4
- } from "./chunk-E6LEMURX.js";
19
+ } from "./chunk-2L6ZP22J.js";
5
20
  import {
6
21
  canonicalDocument,
7
22
  compareTimestampStrings,
@@ -18,6 +33,7 @@ import {
18
33
  PmCliError,
19
34
  collectRegisteredItemFieldNames,
20
35
  getSettingsPath,
36
+ levenshteinDistanceWithinLimit,
21
37
  pathExists,
22
38
  resolvePmRoot
23
39
  } from "./chunk-7AVEY74G.js";
@@ -610,6 +626,576 @@ async function runMergeDriver(options, global2) {
610
626
  }
611
627
  })();
612
628
 
629
+ // dist/sdk/runtime-primitives.js
630
+ !(function() {
631
+ try {
632
+ var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
633
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "ff1c4a04-7f7b-53a2-9524-9ec918a39b1c");
634
+ } catch (e2) {
635
+ }
636
+ })();
637
+
638
+ // dist/sdk/structured-mutations.js
639
+ !(function() {
640
+ try {
641
+ var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
642
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "916a227a-1ec9-5af6-9b71-e871af2d7f0c");
643
+ } catch (e2) {
644
+ }
645
+ })();
646
+ var MUTATION_ROW_KEYS = ["op", "id", "reason", "options"];
647
+ var ITEM_ENVELOPE_KEYS = [
648
+ "item",
649
+ "linked",
650
+ "schedule",
651
+ "claim_state",
652
+ "children"
653
+ ];
654
+ var READ_ONLY_ITEM_KEYS = /* @__PURE__ */ new Set([
655
+ "created_at",
656
+ "updated_at",
657
+ "closed_at",
658
+ "version",
659
+ "format_version",
660
+ "path",
661
+ "author"
662
+ ]);
663
+ var UPDATE_READ_ONLY_ITEM_KEYS = /* @__PURE__ */ new Set([...READ_ONLY_ITEM_KEYS, "id"]);
664
+ var ITEM_FIELD_KEYS = /* @__PURE__ */ new Set([
665
+ "id",
666
+ "title",
667
+ "description",
668
+ "type",
669
+ "status",
670
+ "priority",
671
+ "tags",
672
+ "body",
673
+ "deadline",
674
+ "estimated_minutes",
675
+ "acceptance_criteria",
676
+ "definition_of_ready",
677
+ "order",
678
+ "rank",
679
+ "goal",
680
+ "objective",
681
+ "value",
682
+ "impact",
683
+ "outcome",
684
+ "why_now",
685
+ "assignee",
686
+ "parent",
687
+ "reviewer",
688
+ "risk",
689
+ "confidence",
690
+ "sprint",
691
+ "release",
692
+ "blocked_by",
693
+ "blocked_reason",
694
+ "unblock_note",
695
+ "reporter",
696
+ "severity",
697
+ "environment",
698
+ "repro_steps",
699
+ "resolution",
700
+ "expected_result",
701
+ "actual_result",
702
+ "affected_version",
703
+ "fixed_version",
704
+ "component",
705
+ "regression",
706
+ "customer_impact",
707
+ "close_reason",
708
+ "dependencies",
709
+ "comments",
710
+ "notes",
711
+ "learnings",
712
+ "files",
713
+ "tests",
714
+ "docs",
715
+ "reminders",
716
+ "events",
717
+ "type_options"
718
+ ]);
719
+ var MUTATION_OPTION_KEYS = {
720
+ create: CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS.map((contract) => contract.target),
721
+ update: UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS.map((contract) => contract.target),
722
+ close: CLOSE_FLAG_CONTRACTS.map((contract) => contract.flag.slice(2).replaceAll(/-([a-z])/gu, (_match, letter) => letter.toUpperCase())).filter((key) => key !== "reason")
723
+ };
724
+ function parseAtomicMutationControls(value) {
725
+ const controls = {};
726
+ const compensation = value.createCompensation;
727
+ if (compensation !== void 0) {
728
+ if (compensation !== "close" && compensation !== "delete") {
729
+ throw new PmCliError("createCompensation must be close or delete.", EXIT_CODE.USAGE);
730
+ }
731
+ controls.createCompensation = compensation;
732
+ }
733
+ for (const key of ["lockTtlSeconds", "lockWaitMs"]) {
734
+ const raw = value[key];
735
+ if (raw === void 0)
736
+ continue;
737
+ const parsed = typeof raw === "number" || typeof raw === "string" && raw.trim().length > 0 ? Number(raw) : Number.NaN;
738
+ if (!Number.isSafeInteger(parsed) || parsed <= 0) {
739
+ throw new PmCliError(`${key} must be a positive safe integer.`, EXIT_CODE.USAGE);
740
+ }
741
+ controls[key] = parsed;
742
+ }
743
+ return controls;
744
+ }
745
+ function isPlainObject2(value) {
746
+ if (typeof value !== "object" || value === null || Array.isArray(value)) {
747
+ return false;
748
+ }
749
+ const prototype = Object.getPrototypeOf(value);
750
+ return prototype === Object.prototype || prototype === null;
751
+ }
752
+ function nearestKey(key, candidates) {
753
+ const limit = Math.max(1, Math.min(3, Math.floor(key.length / 4) + 1));
754
+ let best;
755
+ for (const candidate of candidates) {
756
+ const distance = levenshteinDistanceWithinLimit(key, candidate, limit);
757
+ if (distance !== null && (best === void 0 || distance < best.distance)) {
758
+ best = { key: candidate, distance };
759
+ }
760
+ }
761
+ return best?.key;
762
+ }
763
+ function unknownKeyError(scope, key, candidates) {
764
+ const suggestion = nearestKey(key, candidates);
765
+ return new PmCliError(suggestion === void 0 ? `${scope} does not recognize key "${key}". Allowed keys: ${candidates.join(", ")}.` : `${scope} does not recognize key "${key}". Did you mean "${suggestion}"?`, EXIT_CODE.USAGE, {
766
+ code: "stdin_json_unknown_key",
767
+ required: `Use documented ${scope} keys only.`,
768
+ why: "Strict structured input prevents silent typos from creating incomplete or unintended mutations.",
769
+ nextSteps: [
770
+ suggestion === void 0 ? `Remove or correct "${key}".` : `Replace "${key}" with "${suggestion}".`
771
+ ]
772
+ });
773
+ }
774
+ function parseJsonValue(input, label) {
775
+ try {
776
+ return JSON.parse(input);
777
+ } catch (error) {
778
+ const detail = error instanceof Error ? error.message : String(error);
779
+ throw new PmCliError(`${label} must be valid JSON: ${detail}`, EXIT_CODE.USAGE, {
780
+ code: "stdin_json_invalid",
781
+ required: `Pipe one valid JSON ${label.toLowerCase()} into stdin.`,
782
+ why: "Structured mutation input must parse deterministically before any tracker write begins."
783
+ });
784
+ }
785
+ }
786
+ function validateMutationObject(value, index) {
787
+ if (!isPlainObject2(value)) {
788
+ throw new PmCliError(`Mutation ${index + 1} must be an object.`, EXIT_CODE.USAGE);
789
+ }
790
+ for (const key of Object.keys(value)) {
791
+ if (!MUTATION_ROW_KEYS.includes(key)) {
792
+ throw unknownKeyError(`mutation ${index + 1}`, key, MUTATION_ROW_KEYS);
793
+ }
794
+ }
795
+ return value;
796
+ }
797
+ function validateMutationOptions(options, op, index) {
798
+ if (options === void 0)
799
+ return void 0;
800
+ if (!isPlainObject2(options)) {
801
+ throw new PmCliError(`Mutation ${index + 1} options must be an object.`, EXIT_CODE.USAGE);
802
+ }
803
+ for (const key of Object.keys(options)) {
804
+ if (!MUTATION_OPTION_KEYS[op].includes(key)) {
805
+ throw unknownKeyError(`mutation ${index + 1} ${op} options`, key, MUTATION_OPTION_KEYS[op]);
806
+ }
807
+ }
808
+ return options;
809
+ }
810
+ function validateMutationRow(value, index) {
811
+ const mutation = validateMutationObject(value, index);
812
+ const { op, id, reason } = mutation;
813
+ if (op !== "create" && op !== "update" && op !== "close") {
814
+ throw new PmCliError(`Mutation ${index + 1} op must be create, update, or close.`, EXIT_CODE.USAGE);
815
+ }
816
+ const options = validateMutationOptions(mutation.options, op, index);
817
+ if (typeof id !== "string" || id.trim().length === 0) {
818
+ throw new PmCliError(`Mutation ${index + 1} requires a non-empty id.`, EXIT_CODE.USAGE);
819
+ }
820
+ const normalizedId = id.trim();
821
+ if (op === "close") {
822
+ if (typeof reason !== "string" || reason.trim().length === 0) {
823
+ throw new PmCliError(`Mutation ${index + 1} close requires a non-empty reason.`, EXIT_CODE.USAGE);
824
+ }
825
+ return {
826
+ op,
827
+ id: normalizedId,
828
+ reason: reason.trim(),
829
+ ...options === void 0 ? {} : { options }
830
+ };
831
+ }
832
+ if (!isPlainObject2(options)) {
833
+ throw new PmCliError(`Mutation ${index + 1} ${op} requires an options object.`, EXIT_CODE.USAGE);
834
+ }
835
+ return {
836
+ op,
837
+ id: normalizedId,
838
+ options
839
+ };
840
+ }
841
+ function parseItemMutationBatch(input) {
842
+ const parsed = parseJsonValue(input, "Mutation batch");
843
+ const rows = Array.isArray(parsed) ? parsed : isPlainObject2(parsed) && Array.isArray(parsed.mutations) ? parsed.mutations : void 0;
844
+ if (rows === void 0 || rows.length === 0) {
845
+ throw new PmCliError("Mutation batch must be a non-empty JSON array or an object with a non-empty mutations array.", EXIT_CODE.USAGE);
846
+ }
847
+ return rows.map((row, index) => validateMutationRow(row, index));
848
+ }
849
+ function serializePairs(value, keys) {
850
+ return keys.filter((key) => value[key] !== void 0 && value[key] !== null).map((key) => {
851
+ const rendered = String(value[key]);
852
+ return `${key}=${/[",\n\r\\]/u.test(rendered) ? JSON.stringify(rendered) : rendered}`;
853
+ }).join(",");
854
+ }
855
+ function serializeObjectArray(value, keys, label) {
856
+ if (value === void 0)
857
+ return void 0;
858
+ if (!Array.isArray(value) || !value.every(isPlainObject2)) {
859
+ throw new PmCliError(`${label} must be an array of objects.`, EXIT_CODE.USAGE);
860
+ }
861
+ return value.map((entry) => serializePairs(entry, keys));
862
+ }
863
+ function scalarItemOption(key, value) {
864
+ if (key === "tags" && Array.isArray(value) && value.every((entry) => typeof entry === "string")) {
865
+ return JSON.stringify(value);
866
+ }
867
+ if (typeof value === "number" || typeof value === "boolean") {
868
+ return String(value);
869
+ }
870
+ return value;
871
+ }
872
+ function appendFacetOptions(target, source, skipPersistedAnnotations = false) {
873
+ const mappings = [
874
+ ["dependencies", "dep", ["id", "kind", "created_at", "author"]],
875
+ ["comments", "comment", ["text", "created_at", "author"]],
876
+ ["notes", "note", ["text", "created_at", "author"]],
877
+ ["learnings", "learning", ["text", "created_at", "author"]],
878
+ ["files", "file", ["path", "scope", "note"]],
879
+ ["tests", "test", ["command", "scope", "timeout_seconds"]],
880
+ ["docs", "doc", ["path", "scope", "note"]],
881
+ ["reminders", "reminder", ["at", "text", "created_at"]],
882
+ ["events", "event", ["start_at", "end_at", "title", "location"]],
883
+ ["type_options", "typeOption", ["key", "value"]]
884
+ ];
885
+ for (const [sourceKey, targetKey, keys] of mappings) {
886
+ const sourceValue = source[sourceKey];
887
+ const serialized = serializeObjectArray(skipPersistedAnnotations && ["comments", "notes", "learnings"].includes(sourceKey) && Array.isArray(sourceValue) ? sourceValue.filter((entry) => !isPlainObject2(entry) || entry.created_at === void 0) : sourceValue, keys, sourceKey);
888
+ if (serialized !== void 0 && serialized.length > 0)
889
+ target[targetKey] = serialized;
890
+ }
891
+ }
892
+ function validateItemDocumentKeys(parsed, envelope) {
893
+ for (const key of Object.keys(parsed)) {
894
+ if (envelope) {
895
+ if (!ITEM_ENVELOPE_KEYS.includes(key))
896
+ throw unknownKeyError("item envelope", key, ITEM_ENVELOPE_KEYS);
897
+ continue;
898
+ }
899
+ if (!ITEM_FIELD_KEYS.has(key) && nearestKey(key, [...ITEM_FIELD_KEYS]) === void 0 && nearestKey(key, ITEM_ENVELOPE_KEYS) === "item")
900
+ throw unknownKeyError("item envelope", key, ITEM_ENVELOPE_KEYS);
901
+ }
902
+ }
903
+ function resolveItemDocument(parsed) {
904
+ const envelope = Object.hasOwn(parsed, "item");
905
+ validateItemDocumentKeys(parsed, envelope);
906
+ const item = envelope ? parsed.item : parsed;
907
+ if (!isPlainObject2(item)) {
908
+ throw new PmCliError("Item document item must be an object.", EXIT_CODE.USAGE);
909
+ }
910
+ return {
911
+ item,
912
+ ...envelope && isPlainObject2(parsed.linked) ? { linked: parsed.linked } : {}
913
+ };
914
+ }
915
+ function appendItemDocumentEntry(documentOptions, key, value, mode) {
916
+ const readOnlyKeys = mode === "update" ? UPDATE_READ_ONLY_ITEM_KEYS : READ_ONLY_ITEM_KEYS;
917
+ if (readOnlyKeys.has(key))
918
+ return;
919
+ if (!ITEM_FIELD_KEYS.has(key)) {
920
+ const suggestion = nearestKey(key, [...ITEM_FIELD_KEYS]);
921
+ if (suggestion !== void 0)
922
+ throw unknownKeyError("item document", key, [...ITEM_FIELD_KEYS]);
923
+ const fields = Array.isArray(documentOptions.field) ? documentOptions.field : [];
924
+ fields.push(serializePairs({
925
+ key,
926
+ value: typeof value === "string" ? value : JSON.stringify(value)
927
+ }, ["key", "value"]));
928
+ documentOptions.field = fields;
929
+ return;
930
+ }
931
+ if ([
932
+ "dependencies",
933
+ "comments",
934
+ "notes",
935
+ "learnings",
936
+ "files",
937
+ "tests",
938
+ "docs",
939
+ "reminders",
940
+ "events",
941
+ "type_options"
942
+ ].includes(key))
943
+ return;
944
+ documentOptions[key.replaceAll(/_([a-z])/gu, (_match, letter) => letter.toUpperCase())] = scalarItemOption(key, value);
945
+ }
946
+ function itemDocumentToMutationOptions(input, mode, explicitOptions = {}) {
947
+ const parsed = parseJsonValue(input, "Item document");
948
+ if (!isPlainObject2(parsed)) {
949
+ throw new PmCliError("Item document must be a JSON object.", EXIT_CODE.USAGE);
950
+ }
951
+ const { item, linked } = resolveItemDocument(parsed);
952
+ const documentOptions = {};
953
+ for (const [key, value] of Object.entries(item)) {
954
+ appendItemDocumentEntry(documentOptions, key, value, mode);
955
+ }
956
+ appendFacetOptions(documentOptions, item, mode === "update");
957
+ if (linked !== void 0)
958
+ appendFacetOptions(documentOptions, linked);
959
+ return {
960
+ ...documentOptions,
961
+ ...Object.fromEntries(Object.entries(explicitOptions).filter(([, value]) => value !== void 0)),
962
+ stdinJson: void 0
963
+ };
964
+ }
965
+ function validateItemMutationRows(value) {
966
+ return parseItemMutationBatch(JSON.stringify(value));
967
+ }
968
+
969
+ // dist/sdk/item-transaction.js
970
+ import path2 from "node:path";
971
+ !(function() {
972
+ try {
973
+ var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
974
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "2f005f55-4b5d-5f78-b688-132457f22f99");
975
+ } catch (e2) {
976
+ }
977
+ })();
978
+ async function readItemSnapshot(pmRoot, id) {
979
+ try {
980
+ const located = await get(id, {}, { pmRoot });
981
+ const item = located.item;
982
+ return {
983
+ id: item.id,
984
+ closedAt: item.closed_at,
985
+ updatedAt: item.updated_at
986
+ };
987
+ } catch (error) {
988
+ if (error instanceof PmCliError && error.exitCode === EXIT_CODE.NOT_FOUND) {
989
+ return void 0;
990
+ }
991
+ throw error;
992
+ }
993
+ }
994
+ function deriveStepId(mutation, index) {
995
+ const sanitizedTarget = mutation.id.replaceAll(/[^a-zA-Z0-9._-]/gu, "_");
996
+ return `${index + 1}-${mutation.op}-${sanitizedTarget}`;
997
+ }
998
+ function bulkHistoryMarker(transactionId, stepId, phase) {
999
+ return `bulk-item-transaction ${transactionId} ${stepId} ${phase}`;
1000
+ }
1001
+ async function isUpdateMarkerApplied(pmRoot, canonicalId, transactionId, stepId) {
1002
+ const entries = await readHistoryEntries(path2.join(pmRoot, "history", `${canonicalId}.jsonl`), canonicalId);
1003
+ const applyMarker = bulkHistoryMarker(transactionId, stepId, "apply");
1004
+ const compensateMarker = bulkHistoryMarker(transactionId, stepId, "compensate");
1005
+ for (let index = entries.length - 1; index >= 0; index -= 1) {
1006
+ const message = entries[index].message;
1007
+ if (message === applyMarker) {
1008
+ return true;
1009
+ }
1010
+ if (message === compensateMarker) {
1011
+ return false;
1012
+ }
1013
+ }
1014
+ return false;
1015
+ }
1016
+ async function prepareRestoreCompensation(pmRoot, mutation) {
1017
+ const snapshot = await readItemSnapshot(pmRoot, mutation.id);
1018
+ if (snapshot?.updatedAt === void 0) {
1019
+ throw new PmCliError(`Bulk ${mutation.op} target ${mutation.id} does not exist or has no restorable version`, EXIT_CODE.NOT_FOUND);
1020
+ }
1021
+ return { target_updated_at: snapshot.updatedAt };
1022
+ }
1023
+ async function compensateByRestore(config, itemId, stepId, data) {
1024
+ const target = data !== null && typeof data === "object" && !Array.isArray(data) ? data.target_updated_at : void 0;
1025
+ if (typeof target !== "string") {
1026
+ return;
1027
+ }
1028
+ if (await readItemSnapshot(config.pmRoot, itemId) === void 0) {
1029
+ return;
1030
+ }
1031
+ await restore(itemId, target, {
1032
+ force: true,
1033
+ author: config.author,
1034
+ message: bulkHistoryMarker(config.transactionId, stepId, "compensate")
1035
+ }, { pmRoot: config.pmRoot });
1036
+ }
1037
+ function buildCreateStep(config, mutation, stepId) {
1038
+ return {
1039
+ id: stepId,
1040
+ async inspect() {
1041
+ const snapshot = await readItemSnapshot(config.pmRoot, mutation.id);
1042
+ if (snapshot === void 0) {
1043
+ return { state: "pending" };
1044
+ }
1045
+ return { state: "applied", result: { id: snapshot.id, op: "create" } };
1046
+ },
1047
+ async apply() {
1048
+ const created = await create({ ...mutation.options, author: config.author, id: mutation.id }, { pmRoot: config.pmRoot });
1049
+ const createdItem = created.item;
1050
+ return { id: String(createdItem.id), op: "create" };
1051
+ },
1052
+ async compensate() {
1053
+ const snapshot = await readItemSnapshot(config.pmRoot, mutation.id);
1054
+ if (snapshot === void 0) {
1055
+ return;
1056
+ }
1057
+ if (config.createCompensation === "delete") {
1058
+ await deleteItem(mutation.id, {
1059
+ force: true,
1060
+ author: config.author,
1061
+ message: `Compensate interrupted bulk transaction ${config.transactionId}`
1062
+ }, { pmRoot: config.pmRoot });
1063
+ return;
1064
+ }
1065
+ if (snapshot.closedAt !== void 0) {
1066
+ return;
1067
+ }
1068
+ await close(mutation.id, `Compensated: interrupted bulk transaction ${config.transactionId}`, { force: true, author: config.author }, { pmRoot: config.pmRoot });
1069
+ }
1070
+ };
1071
+ }
1072
+ function buildUpdateStep(config, mutation, stepId) {
1073
+ return {
1074
+ id: stepId,
1075
+ async inspect() {
1076
+ const snapshot = await readItemSnapshot(config.pmRoot, mutation.id);
1077
+ if (snapshot === void 0) {
1078
+ return { state: "pending" };
1079
+ }
1080
+ const applied = await isUpdateMarkerApplied(config.pmRoot, snapshot.id, config.transactionId, stepId);
1081
+ if (!applied) {
1082
+ return { state: "pending" };
1083
+ }
1084
+ return { state: "applied", result: { id: snapshot.id, op: "update" } };
1085
+ },
1086
+ async prepareCompensation() {
1087
+ return prepareRestoreCompensation(config.pmRoot, mutation);
1088
+ },
1089
+ async apply() {
1090
+ const updated = await update(mutation.id, {
1091
+ ...mutation.options,
1092
+ author: config.author,
1093
+ message: bulkHistoryMarker(config.transactionId, stepId, "apply")
1094
+ }, { pmRoot: config.pmRoot });
1095
+ const updatedItem = updated.item;
1096
+ return { id: String(updatedItem.id), op: "update" };
1097
+ },
1098
+ async compensate(data) {
1099
+ await compensateByRestore(config, mutation.id, stepId, data);
1100
+ }
1101
+ };
1102
+ }
1103
+ function buildCloseStep(config, mutation, stepId) {
1104
+ return {
1105
+ id: stepId,
1106
+ // An already-terminal target counts as applied: closing it again would
1107
+ // fight legitimate prior closure, and recovery must adopt completed work.
1108
+ async inspect() {
1109
+ const snapshot = await readItemSnapshot(config.pmRoot, mutation.id);
1110
+ if (snapshot?.closedAt === void 0) {
1111
+ return { state: "pending" };
1112
+ }
1113
+ return { state: "applied", result: { id: snapshot.id, op: "close" } };
1114
+ },
1115
+ async prepareCompensation() {
1116
+ return prepareRestoreCompensation(config.pmRoot, mutation);
1117
+ },
1118
+ async apply() {
1119
+ const closed = await close(mutation.id, mutation.reason, { ...mutation.options, author: config.author }, { pmRoot: config.pmRoot });
1120
+ const closedItem = closed.item;
1121
+ return { id: String(closedItem.id), op: "close" };
1122
+ },
1123
+ async compensate(data) {
1124
+ await compensateByRestore(config, mutation.id, stepId, data);
1125
+ }
1126
+ };
1127
+ }
1128
+ function buildStepForMutation(config, mutation, index) {
1129
+ const stepId = deriveStepId(mutation, index);
1130
+ if (mutation.op === "create") {
1131
+ return buildCreateStep(config, mutation, stepId);
1132
+ }
1133
+ if (mutation.op === "update") {
1134
+ return buildUpdateStep(config, mutation, stepId);
1135
+ }
1136
+ return buildCloseStep(config, mutation, stepId);
1137
+ }
1138
+ function assertValidBulkMutation(mutation, index) {
1139
+ if (mutation === null || typeof mutation !== "object" || Array.isArray(mutation)) {
1140
+ throw new TypeError(`Bulk mutation ${index + 1} must be an object`);
1141
+ }
1142
+ if (!["create", "update", "close"].includes(mutation.op)) {
1143
+ throw new TypeError(`Bulk mutation ${index + 1} op must be create, update, or close`);
1144
+ }
1145
+ if (typeof mutation.id !== "string" || mutation.id.trim().length === 0) {
1146
+ throw new TypeError(`Bulk mutation ${index + 1} requires a non-empty id`);
1147
+ }
1148
+ if (mutation.op === "close" && (typeof mutation.reason !== "string" || mutation.reason.trim().length === 0)) {
1149
+ throw new TypeError(`Bulk close mutation ${index + 1} requires a non-empty reason`);
1150
+ }
1151
+ }
1152
+ async function commitItemMutations(options) {
1153
+ const mutations = [...options.mutations];
1154
+ if (mutations.length === 0) {
1155
+ throw new TypeError("Bulk item transaction requires at least one mutation");
1156
+ }
1157
+ for (const [index, mutation] of mutations.entries()) {
1158
+ assertValidBulkMutation(mutation, index);
1159
+ }
1160
+ const createCompensation = options.createCompensation ?? "close";
1161
+ if (!["close", "delete"].includes(createCompensation)) {
1162
+ throw new TypeError("Bulk item transaction createCompensation must be close or delete");
1163
+ }
1164
+ const stepConfig = {
1165
+ pmRoot: options.pmRoot,
1166
+ author: options.author,
1167
+ transactionId: options.transactionId,
1168
+ createCompensation
1169
+ };
1170
+ const committed = await commitWorkspaceTransaction({
1171
+ pmRoot: options.pmRoot,
1172
+ transactionId: options.transactionId,
1173
+ author: options.author,
1174
+ steps: mutations.map((mutation, index) => buildStepForMutation(stepConfig, mutation, index)),
1175
+ ...options.lockTtlSeconds === void 0 ? {} : { lockTtlSeconds: options.lockTtlSeconds },
1176
+ ...options.lockWaitMs === void 0 ? {} : { lockWaitMs: options.lockWaitMs },
1177
+ ...options.onTransition === void 0 ? {} : { onTransition: options.onTransition }
1178
+ });
1179
+ const results = {};
1180
+ for (const [stepId, value] of Object.entries(committed.results)) {
1181
+ results[stepId] = value;
1182
+ }
1183
+ return {
1184
+ transactionId: committed.transactionId,
1185
+ status: "committed",
1186
+ recovered: committed.recovered,
1187
+ results
1188
+ };
1189
+ }
1190
+ var _testOnlyItemTransaction = {
1191
+ buildCreateStep,
1192
+ bulkHistoryMarker,
1193
+ compensateByRestore,
1194
+ deriveStepId,
1195
+ isUpdateMarkerApplied,
1196
+ readItemSnapshot
1197
+ };
1198
+
613
1199
  export {
614
1200
  mergeHistoryStreams,
615
1201
  mergeRelationshipEventStreams,
@@ -618,6 +1204,12 @@ export {
618
1204
  mergeItemDocuments,
619
1205
  mergeJsonDocuments,
620
1206
  MERGE_DRIVER_ARTIFACT_VALUES,
621
- runMergeDriver
1207
+ runMergeDriver,
1208
+ parseAtomicMutationControls,
1209
+ parseItemMutationBatch,
1210
+ itemDocumentToMutationOptions,
1211
+ validateItemMutationRows,
1212
+ commitItemMutations,
1213
+ _testOnlyItemTransaction
622
1214
  };
623
- //# sourceMappingURL=chunk-INSTSQNZ.js.map
1215
+ //# sourceMappingURL=chunk-SY4SFZSD.js.map