@unbrained/pm-cli 2026.11.14 → 2026.11.16

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 (281) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/README.md +1 -1
  3. package/dist/cli/error-guidance.js +2 -2
  4. package/dist/cli/extension-command-help.js +2 -2
  5. package/dist/cli/help-content.js +2 -2
  6. package/dist/cli/register-operations.js +1 -1
  7. package/dist/cli-bundle/bundle-manifest.json +1 -1
  8. package/dist/cli-bundle/chunks/{chunk-UJMQP2HP.js → chunk-2D26HRXB.js} +2 -2
  9. package/dist/cli-bundle/chunks/{chunk-EXO4PM5J.js → chunk-2WNORBVN.js} +86 -71
  10. package/dist/cli-bundle/chunks/chunk-4I7YG3VZ.js +3 -0
  11. package/dist/cli-bundle/chunks/chunk-4WIVCOA7.js +2 -0
  12. package/dist/cli-bundle/chunks/chunk-A3WCP4TU.js +6 -0
  13. package/dist/cli-bundle/chunks/chunk-AB5S6TWE.js +124 -0
  14. package/dist/cli-bundle/chunks/chunk-BV7J3LRH.js +114 -0
  15. package/dist/cli-bundle/chunks/{chunk-AXTUB74T.js → chunk-DZWRNL6R.js} +2 -2
  16. package/dist/cli-bundle/chunks/chunk-E4BQRZF2.js +10 -0
  17. package/dist/cli-bundle/chunks/chunk-ERD2RYWM.js +31 -0
  18. package/dist/cli-bundle/chunks/chunk-F7P42FL5.js +9 -0
  19. package/dist/cli-bundle/chunks/{chunk-547OEGDR.js → chunk-FZ4XWWLO.js} +25 -25
  20. package/dist/cli-bundle/chunks/{chunk-65SBMIK6.js → chunk-I3T2FVUA.js} +2 -2
  21. package/dist/cli-bundle/chunks/chunk-IGEBFNWE.js +2 -0
  22. package/dist/cli-bundle/chunks/chunk-IYICNCK2.js +2 -0
  23. package/dist/cli-bundle/chunks/chunk-J257NZRD.js +20 -0
  24. package/dist/cli-bundle/chunks/chunk-JD3XWF66.js +3 -0
  25. package/dist/cli-bundle/chunks/chunk-JLHD7OQ2.js +2 -0
  26. package/dist/cli-bundle/chunks/{chunk-V2OAXGHK.js → chunk-KGOGLKL2.js} +2 -2
  27. package/dist/cli-bundle/chunks/chunk-LC4DJVXR.js +2 -0
  28. package/dist/cli-bundle/chunks/chunk-NHNM3GIP.js +3 -0
  29. package/dist/cli-bundle/chunks/{chunk-RSAN2YUU.js → chunk-NYN5OR2T.js} +2 -2
  30. package/dist/cli-bundle/chunks/chunk-OFZQEQ6X.js +2 -0
  31. package/dist/cli-bundle/chunks/chunk-QGL5IAP4.js +8 -0
  32. package/dist/cli-bundle/chunks/chunk-R24NZ2TB.js +8 -0
  33. package/dist/cli-bundle/chunks/chunk-VJLZHOTP.js +2 -0
  34. package/dist/cli-bundle/chunks/chunk-VO2HSB5F.js +2 -0
  35. package/dist/cli-bundle/chunks/{indexed-receipt-blobs-I6RQGD6Y.js → indexed-receipt-blobs-HNLN6UXH.js} +2 -2
  36. package/dist/cli-bundle/chunks/item-revision-PSOL5I4H.js +2 -0
  37. package/dist/cli-bundle/chunks/item-transaction-55QTCU2M.js +2 -0
  38. package/dist/cli-bundle/chunks/mutation-actor-BDBBH3ZS.js +2 -0
  39. package/dist/cli-bundle/chunks/mutation-admission-WUN7JYVJ.js +2 -0
  40. package/dist/cli-bundle/chunks/{register-list-query-MCNOV6ML.js → register-list-query-AESCVO6H.js} +2 -2
  41. package/dist/cli-bundle/chunks/{register-mutation-KYXLYHOK.js → register-mutation-SKCEP5QU.js} +3 -3
  42. package/dist/cli-bundle/chunks/register-operations-ZT4OYCF3.js +2 -0
  43. package/dist/cli-bundle/chunks/register-setup-JVWNS2TY.js +2 -0
  44. package/dist/cli-bundle/chunks/{settlement-hook-JHXLUBEN.js → settlement-hook-MVVVUIVZ.js} +2 -2
  45. package/dist/cli-bundle/chunks/stage-RMU3JAWM.js +2 -0
  46. package/dist/cli-bundle/focused-chunks/chunk-3WVMEA2A.js +6 -0
  47. package/dist/cli-bundle/focused-chunks/chunk-5UVJOAUP.js +91 -0
  48. package/dist/cli-bundle/focused-chunks/chunk-5WQ3LNUK.js +78 -0
  49. package/dist/cli-bundle/focused-chunks/chunk-6E4X7MQA.js +26 -0
  50. package/dist/cli-bundle/focused-chunks/{chunk-IDAYTYNN.js → chunk-7SEPCQV2.js} +2 -2
  51. package/dist/cli-bundle/focused-chunks/{chunk-EXCVUBAE.js → chunk-7XHE335U.js} +2 -2
  52. package/dist/cli-bundle/focused-chunks/chunk-BEHIMEV2.js +2 -0
  53. package/dist/cli-bundle/focused-chunks/chunk-CZFZCSOX.js +2 -0
  54. package/dist/cli-bundle/focused-chunks/{chunk-TA4EGVE6.js → chunk-DFBHW7HP.js} +3 -3
  55. package/dist/cli-bundle/focused-chunks/chunk-DZMP3VYQ.js +26 -0
  56. package/dist/cli-bundle/focused-chunks/chunk-HHMMIHZP.js +2 -0
  57. package/dist/cli-bundle/focused-chunks/chunk-HPC2M6JD.js +6 -0
  58. package/dist/cli-bundle/focused-chunks/{chunk-EAYRYXA6.js → chunk-HR5FEUUL.js} +2 -2
  59. package/dist/cli-bundle/focused-chunks/chunk-J7ESCE7M.js +24 -0
  60. package/dist/cli-bundle/focused-chunks/chunk-KRNF3WTC.js +3 -0
  61. package/dist/cli-bundle/focused-chunks/chunk-KWZLY35A.js +2 -0
  62. package/dist/cli-bundle/focused-chunks/chunk-M4IA4LC6.js +8 -0
  63. package/dist/cli-bundle/focused-chunks/{chunk-3SUKWYR2.js → chunk-NASE6JC2.js} +2 -2
  64. package/dist/cli-bundle/focused-chunks/chunk-ONM2R32I.js +65 -0
  65. package/dist/cli-bundle/focused-chunks/chunk-PDXSMSO5.js +3 -0
  66. package/dist/cli-bundle/focused-chunks/chunk-PEL4SQXV.js +2 -0
  67. package/dist/cli-bundle/focused-chunks/chunk-QJ647CQE.js +2 -0
  68. package/dist/cli-bundle/focused-chunks/chunk-SFATIM77.js +12 -0
  69. package/dist/cli-bundle/focused-chunks/{chunk-EH7JKGDH.js → chunk-UBBTBNUY.js} +2 -2
  70. package/dist/cli-bundle/focused-chunks/chunk-ZCN35TCK.js +2 -0
  71. package/dist/cli-bundle/focused-chunks/chunk-ZSQ2FT22.js +44 -0
  72. package/dist/cli-bundle/focused-chunks/{indexed-receipt-blobs-7XGVHYAO.js → indexed-receipt-blobs-ADMQXF3N.js} +2 -2
  73. package/dist/cli-bundle/focused-chunks/item-revision-GNKYO6GZ.js +2 -0
  74. package/dist/cli-bundle/focused-chunks/item-transaction-AUUQHR5Z.js +2 -0
  75. package/dist/cli-bundle/focused-chunks/mutation-actor-OBRD7HFZ.js +2 -0
  76. package/dist/cli-bundle/focused-chunks/mutation-admission-6TX3EOJX.js +2 -0
  77. package/dist/cli-bundle/focused-chunks/{settlement-hook-H56537UV.js → settlement-hook-5U2M75BY.js} +2 -2
  78. package/dist/cli-bundle/focused-chunks/stage-LERF2YJU.js +2 -0
  79. package/dist/cli-bundle/main.js +10 -10
  80. package/dist/cli-bundle/sdk-authoring.js +1 -1
  81. package/dist/cli-bundle/sdk-contracts.js +3 -3
  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 +57 -57
  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 +11 -11
  90. package/dist/core/diagnostics/remediation.js +1 -1
  91. package/dist/core/extensions/extension-hook-runtime.js +1 -1
  92. package/dist/core/extensions/extension-types.d.ts +30 -0
  93. package/dist/core/extensions/extension-types.js +1 -1
  94. package/dist/core/extensions/index.d.ts +21 -1
  95. package/dist/core/extensions/index.js +1 -1
  96. package/dist/core/extensions/mutation-actor-snapshot.js +2 -0
  97. package/dist/core/extensions/mutation-actor.js +2 -0
  98. package/dist/core/item/deferred-fields.js +2 -0
  99. package/dist/core/item/item-format-version.d.ts +8 -7
  100. package/dist/core/item/item-format-version.js +1 -1
  101. package/dist/core/item/item-format.js +2 -2
  102. package/dist/core/output/mutation-projection.js +1 -1
  103. package/dist/core/output/output.d.ts +7 -0
  104. package/dist/core/output/output.js +3 -3
  105. package/dist/core/schema/runtime-field-values.d.ts +4 -0
  106. package/dist/core/schema/runtime-field-values.js +1 -1
  107. package/dist/core/shared/errors.d.ts +22 -0
  108. package/dist/core/shared/errors.js +1 -1
  109. package/dist/core/shared/item-metadata-contract.js +1 -1
  110. package/dist/core/store/item-store.d.ts +15 -4
  111. package/dist/core/store/item-store.js +1 -1
  112. package/dist/core/telemetry/policy.d.ts +21 -2
  113. package/dist/core/telemetry/policy.js +1 -1
  114. package/dist/sdk/agent/closed-domain-contracts.js +1 -1
  115. package/dist/sdk/authoring.d.ts +1 -1
  116. package/dist/sdk/authoring.js +1 -1
  117. package/dist/sdk/cli-contracts/commander-mutation-options.js +1 -1
  118. package/dist/sdk/cli-contracts/flag-contracts.js +1 -1
  119. package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +1 -1
  120. package/dist/sdk/cli-contracts/registration-helpers.js +1 -1
  121. package/dist/sdk/cli-contracts/runtime-contracts.d.ts +1 -1
  122. package/dist/sdk/cli-contracts/runtime-contracts.js +1 -1
  123. package/dist/sdk/cli-contracts/tool-option-contracts.d.ts +1 -1
  124. package/dist/sdk/cli-contracts/tool-option-contracts.js +1 -1
  125. package/dist/sdk/cli-contracts/tool-parameter-tables.js +1 -1
  126. package/dist/sdk/cli-contracts/tool-schema.d.ts +1 -1
  127. package/dist/sdk/cli-contracts/tool-schema.js +1 -1
  128. package/dist/sdk/completion/bash.js +1 -1
  129. package/dist/sdk/completion/fish.js +4 -1
  130. package/dist/sdk/completion/zsh.js +14 -2
  131. package/dist/sdk/extension/command-options.d.ts +23 -4
  132. package/dist/sdk/extension/command-options.js +1 -1
  133. package/dist/sdk/extension/native-command-options.js +2 -0
  134. package/dist/sdk/flag-invocation-contracts.js +1 -1
  135. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1 -1
  136. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +1 -1
  137. package/dist/sdk/governance/health.js +2 -2
  138. package/dist/sdk/governance/in-progress-work-health.d.ts +49 -0
  139. package/dist/sdk/governance/in-progress-work-health.js +2 -0
  140. package/dist/sdk/governance/lifecycle-dependency-cycles.d.ts +12 -0
  141. package/dist/sdk/governance/lifecycle-dependency-cycles.js +2 -0
  142. package/dist/sdk/governance/stale-work.d.ts +143 -2
  143. package/dist/sdk/governance/stale-work.js +1 -1
  144. package/dist/sdk/governance/validate-deferred-fields.js +2 -0
  145. package/dist/sdk/governance/validate.d.ts +2 -2
  146. package/dist/sdk/governance/validate.js +1 -1
  147. package/dist/sdk/governance.d.ts +1 -1
  148. package/dist/sdk/governance.js +1 -1
  149. package/dist/sdk/history-compact.js +1 -1
  150. package/dist/sdk/index.d.ts +1 -1
  151. package/dist/sdk/index.js +1 -1
  152. package/dist/sdk/item-transaction.d.ts +2 -2
  153. package/dist/sdk/item-transaction.js +1 -1
  154. package/dist/sdk/lifecycle/claim.d.ts +46 -3
  155. package/dist/sdk/lifecycle/claim.js +1 -1
  156. package/dist/sdk/lifecycle/close.js +1 -1
  157. package/dist/sdk/lifecycle/copy.js +1 -1
  158. package/dist/sdk/lifecycle/create-deferrals.js +2 -0
  159. package/dist/sdk/lifecycle/create.d.ts +6 -2
  160. package/dist/sdk/lifecycle/create.js +1 -1
  161. package/dist/sdk/lifecycle/restore.js +1 -1
  162. package/dist/sdk/lifecycle/shared-unset-fields.d.ts +7 -1
  163. package/dist/sdk/lifecycle/shared-unset-fields.js +1 -1
  164. package/dist/sdk/lifecycle/task-composition.js +1 -1
  165. package/dist/sdk/merge/three-way.d.ts +1 -1
  166. package/dist/sdk/merge/three-way.js +2 -2
  167. package/dist/sdk/ownership-source.d.ts +32 -0
  168. package/dist/sdk/ownership-source.js +1 -1
  169. package/dist/sdk/package-import-adapters.d.ts +9 -1
  170. package/dist/sdk/package-import-adapters.js +1 -1
  171. package/dist/sdk/public-surface.json +1 -1
  172. package/dist/sdk/query/complete-list.d.ts +14 -5
  173. package/dist/sdk/query/complete-list.js +1 -1
  174. package/dist/sdk/query/context.d.ts +5 -1
  175. package/dist/sdk/query/context.js +2 -2
  176. package/dist/sdk/query/list.js +1 -1
  177. package/dist/sdk/query/next.d.ts +19 -3
  178. package/dist/sdk/query/next.js +1 -1
  179. package/dist/sdk/query/projection-contracts.d.ts +6 -0
  180. package/dist/sdk/query/projection-contracts.js +1 -1
  181. package/dist/sdk/read-output/extension.js +1 -1
  182. package/dist/sdk/runtime-input.d.ts +6 -2
  183. package/dist/sdk/runtime-input.js +1 -1
  184. package/dist/sdk/runtime-primitives.d.ts +2 -2
  185. package/dist/sdk/runtime-primitives.js +1 -1
  186. package/dist/sdk/runtime.d.ts +2 -2
  187. package/dist/sdk/runtime.js +1 -1
  188. package/dist/sdk/structured-mutations.js +1 -1
  189. package/dist/sdk/testing.d.ts +15 -2
  190. package/dist/sdk/testing.js +1 -1
  191. package/dist/types.d.ts +8 -0
  192. package/dist/types.js +1 -1
  193. package/docs/AGENT_GUIDE.md +2 -0
  194. package/docs/COMMANDS.md +31 -0
  195. package/docs/CONFIGURATION.md +20 -7
  196. package/docs/EXTENSIONS.md +1 -1
  197. package/docs/LIFECYCLE_COMMANDS.md +8 -1
  198. package/docs/MUTATION_INTEGRITY.md +79 -1
  199. package/docs/SDK.md +139 -5
  200. package/docs/generated/FLAG_LEXICON_BUDGETS.md +3 -3
  201. package/marketplace.json +1 -1
  202. package/node_modules/commander/Readme.md +6 -32
  203. package/node_modules/commander/index.js +1 -1
  204. package/node_modules/commander/lib/command.js +22 -9
  205. package/node_modules/commander/lib/help.js +6 -2
  206. package/node_modules/commander/lib/option.js +1 -1
  207. package/node_modules/commander/package.json +2 -1
  208. package/node_modules/commander/typings/index.d.ts +6 -3
  209. package/node_modules/semver/classes/range.js +2 -2
  210. package/node_modules/semver/internal/constants.js +30 -0
  211. package/node_modules/semver/internal/trim-comparator-whitespace.js +438 -0
  212. package/node_modules/semver/package.json +1 -1
  213. package/package.json +8 -5
  214. package/packages/pm-beads/package.json +1 -1
  215. package/packages/pm-calendar/extensions/calendar/command-definitions.ts +2 -0
  216. package/packages/pm-calendar/package.json +1 -1
  217. package/packages/pm-command-kit/package.json +1 -1
  218. package/packages/pm-digital-twin/package.json +1 -1
  219. package/packages/pm-governance-audit/package.json +1 -1
  220. package/packages/pm-guide-shell/package.json +1 -1
  221. package/packages/pm-kanban/package.json +1 -1
  222. package/packages/pm-lifecycle-hooks/package.json +1 -1
  223. package/packages/pm-linked-test-adapters/package.json +1 -1
  224. package/packages/pm-search-advanced/package.json +1 -1
  225. package/packages/pm-templates/package.json +1 -1
  226. package/packages/pm-todos/extensions/todos/runtime.ts +3 -0
  227. package/packages/pm-todos/package.json +1 -1
  228. package/packages/pm-vcs/package.json +1 -1
  229. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  230. package/plugins/pm-claude/package.json +1 -1
  231. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  232. package/plugins/pm-codex/package.json +1 -1
  233. package/plugins/pm-codex/plugin.json +1 -1
  234. package/runtime-dependencies.json +1 -1
  235. package/dist/cli-bundle/chunks/chunk-25BUKX4W.js +0 -2
  236. package/dist/cli-bundle/chunks/chunk-27FG6ROB.js +0 -2
  237. package/dist/cli-bundle/chunks/chunk-5TGFB34A.js +0 -2
  238. package/dist/cli-bundle/chunks/chunk-BHH65KLL.js +0 -2
  239. package/dist/cli-bundle/chunks/chunk-C7M54YV6.js +0 -122
  240. package/dist/cli-bundle/chunks/chunk-DMWL3K4A.js +0 -20
  241. package/dist/cli-bundle/chunks/chunk-DVN7CD5B.js +0 -2
  242. package/dist/cli-bundle/chunks/chunk-DZ7CWUVM.js +0 -8
  243. package/dist/cli-bundle/chunks/chunk-FRCNYOTG.js +0 -9
  244. package/dist/cli-bundle/chunks/chunk-HXECILIE.js +0 -31
  245. package/dist/cli-bundle/chunks/chunk-IDFRGH4X.js +0 -3
  246. package/dist/cli-bundle/chunks/chunk-JSTBYDLL.js +0 -3
  247. package/dist/cli-bundle/chunks/chunk-MELSYAFE.js +0 -124
  248. package/dist/cli-bundle/chunks/chunk-O4ZLEN4T.js +0 -3
  249. package/dist/cli-bundle/chunks/chunk-OTM6PXZQ.js +0 -8
  250. package/dist/cli-bundle/chunks/chunk-PC5DGK3C.js +0 -6
  251. package/dist/cli-bundle/chunks/chunk-PF3V443A.js +0 -2
  252. package/dist/cli-bundle/chunks/chunk-U2HVJVA5.js +0 -2
  253. package/dist/cli-bundle/chunks/chunk-VERRDW3Q.js +0 -2
  254. package/dist/cli-bundle/chunks/item-revision-VGIHIWZM.js +0 -2
  255. package/dist/cli-bundle/chunks/item-transaction-6OB6BGTD.js +0 -2
  256. package/dist/cli-bundle/chunks/mutation-admission-LL6SGQYU.js +0 -2
  257. package/dist/cli-bundle/chunks/register-operations-6RQF6IAE.js +0 -2
  258. package/dist/cli-bundle/chunks/register-setup-XGPOFFD3.js +0 -2
  259. package/dist/cli-bundle/chunks/stage-ZS7WNUD4.js +0 -2
  260. package/dist/cli-bundle/focused-chunks/chunk-2A4JCFMI.js +0 -2
  261. package/dist/cli-bundle/focused-chunks/chunk-2T6MQ7NP.js +0 -3
  262. package/dist/cli-bundle/focused-chunks/chunk-32QYILXW.js +0 -82
  263. package/dist/cli-bundle/focused-chunks/chunk-4WOF3Q6R.js +0 -2
  264. package/dist/cli-bundle/focused-chunks/chunk-5IQPFV4Y.js +0 -2
  265. package/dist/cli-bundle/focused-chunks/chunk-6C7NBJ7A.js +0 -26
  266. package/dist/cli-bundle/focused-chunks/chunk-7KNF6RCV.js +0 -12
  267. package/dist/cli-bundle/focused-chunks/chunk-FNLOLNPQ.js +0 -2
  268. package/dist/cli-bundle/focused-chunks/chunk-G6ERMFJ5.js +0 -3
  269. package/dist/cli-bundle/focused-chunks/chunk-HRLGC3P7.js +0 -28
  270. package/dist/cli-bundle/focused-chunks/chunk-I7A5VP5E.js +0 -65
  271. package/dist/cli-bundle/focused-chunks/chunk-JHC3X43E.js +0 -2
  272. package/dist/cli-bundle/focused-chunks/chunk-MKYNDWT3.js +0 -91
  273. package/dist/cli-bundle/focused-chunks/chunk-RDTHL44U.js +0 -2
  274. package/dist/cli-bundle/focused-chunks/chunk-UCCLV5GJ.js +0 -8
  275. package/dist/cli-bundle/focused-chunks/chunk-W3RWCLEU.js +0 -2
  276. package/dist/cli-bundle/focused-chunks/chunk-W57DSFSU.js +0 -44
  277. package/dist/cli-bundle/focused-chunks/chunk-YNYO7PMT.js +0 -26
  278. package/dist/cli-bundle/focused-chunks/item-revision-7J7WSCPC.js +0 -2
  279. package/dist/cli-bundle/focused-chunks/item-transaction-F5YMCPRB.js +0 -2
  280. package/dist/cli-bundle/focused-chunks/mutation-admission-2NRQEAOG.js +0 -2
  281. package/dist/cli-bundle/focused-chunks/stage-2KVCKOGC.js +0 -2
@@ -0,0 +1,2 @@
1
+ import{a as T}from"./chunk-I5LGPUWH.js";import{F as U,I as R,Xa as j,_a as H,cb as C,fb as z}from"./chunk-3WVMEA2A.js";import{m as L}from"./chunk-PDXSMSO5.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="a1119a65-4ee5-5362-8fa9-4324c5864990")}catch{}})();var ol=["id","title","status","type","priority","parent","updated_at"],rl=["id","status","type","title"],gl={list:"brief","list-all":"full","list-draft":"full","list-open":"brief","list-in-progress":"brief","list-blocked":"brief","list-closed":"brief","list-canceled":"full"},ye=["tree_depth","tree_parent","tree_children","tree_title"];function Ae(e=[]){return[...new Set([...L,"body",...ye,...e])].flatMap(a=>[a,`item.${a}`]).sort()}function fl(e=[]){return Ae(e).filter(a=>!a.startsWith("item."))}var ke=["brief","standard","deep"],q=[...ke,"full"],Y=["brief","standard","deep"],be=["body","item_hash","linked","claim_state","children","schedule","blockers"],Ce=["linked.files","linked.tests","linked.docs"],Se=["claim_state.claimed","claim_state.assignee","claim_state.last_claim","claim_state.last_release"],Ne=["schedule.deadline","schedule.start_at","schedule.end_at","schedule.location","schedule.reminders","schedule.events"];function cl(e=[]){return[...[...new Set([...L,...e,"notes_count","tests_count","collection_counts"])].flatMap(a=>[a,`item.${a}`]),...be,...Ce,...Se,...Ne].sort()}var pl=["id","title","status","type","priority","updated_at","score","matched_fields"],we=["score","matched_fields","highlights"],X=["id","title","description","type","status","priority","tags","created_at","updated_at","deadline","assignee","author","estimated_minutes","acceptance_criteria","dependencies","comments","notes","learnings","reminders","events","files","tests","docs","close_reason","parent","reviewer","risk","confidence","sprint","release","blocked_by","blocked_reason","reporter","severity","environment","repro_steps","resolution","expected_result","actual_result","affected_version","fixed_version","component","regression","customer_impact","definition_of_ready","order","rank","goal","objective","value","impact","outcome","why_now","plan"];function dl(e=[]){let a=[...new Set(e)];return[...we,...X,...X.map(l=>`item.${l}`),...a,...a.map(l=>`item.${l}`)].sort()}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="85a28710-c767-584c-b3e3-373261f4b5f2")}catch{}})();var G=["item","list","context","search","graph","history","workspace","package","ops","plan","contracts","help"],Oe=["acknowledge","activate","add","adopt","adopt-all","catalog","compact","complete","create","deactivate","delete","describe","doctor","edit","explore","import","init","inspect","install","list","manage","migrate","mutate","read","redact","reload","remove","reopen","repair","restore","run","show","uninstall","upgrade","verify"];function s(e,a,l,t={}){return{name:e,required:l,variadic:t.variadic===!0,value_kind:a,polymorphic:t.polymorphic===!0}}function B(e){let a=e.replaceAll("-"," ");return`${a.charAt(0).toUpperCase()}${a.slice(1)}`}var g=s("id","item_id",!0),y=s("id","item_id",!1),A=s("text","string",!1),k=s("plan-id","item_id",!0),V=s("step","string",!0),Ee=["--acceptance-criteria","--actual-result","--affected-version","--assignee","--blocked-by","--blocked-reason","--blocks","--body","--claim","--comment","--component","--confidence","--create-mode","--customer-impact","--deadline","--definition-of-ready","--description","--doc","--environment","--estimate","--event","--expected-result","--fixed-version","--file","--from-search","--goal","--harness","--impact","--learning","--message","--mode","--note","--objective","--order","--outcome","--parent","--priority","--rank","--related","--release","--reminder","--reporter","--repro-steps","--resolution","--resume-context","--reviewer","--risk","--scope","--severity","--sprint","--status","--step","--step-blocked-reason","--step-body","--step-evidence","--step-owner","--step-replacement","--step-status","--step-title","--tags","--template","--test","--title","--type-option","--unblock-note","--value","--why-now"],I=["--allow-multiple-active","--depends-on","--file","--force","--message","--step-blocked-reason","--step-body","--step-evidence","--step-owner","--step-status","--step-title","--test"],xe={"update-step":"Update one declared Plan step.","complete-step":"Complete one declared Plan step.","block-step":"Block one declared Plan step.","remove-step":"Remove one declared Plan step.",link:"Link one dependency to a declared Plan step.",unlink:"Unlink one dependency from a declared Plan step."},h=[{command:"plan create",parent:"plan",action:"create",slots:[s("title","string",!1,{polymorphic:!0})],accepted_flags:Ee,description:"Create a Plan item and optionally seed its ordered steps.",example:'pm plan create --title "Refactor lock retry"'},{command:"plan show",parent:"plan",action:"show",slots:[k],accepted_flags:["--depth","--fields"],description:"Read one Plan item with a bounded plan projection.",example:"pm plan show pm-a1b2 --depth standard"},{command:"plan add-step",parent:"plan",action:"add-step",slots:[k],accepted_flags:I,description:"Append one ordered step to a Plan item.",example:'pm plan add-step pm-a1b2 --step-title "Run tests"'},...Object.entries(xe).map(([e,a])=>({command:`plan ${e}`,parent:"plan",action:e,slots:[k,V],accepted_flags:I,description:a,example:`pm plan ${e} pm-a1b2 plan-step-001`})),{command:"plan reorder-step",parent:"plan",action:"reorder-step",slots:[k,V,s("new-order","integer",!0)],accepted_flags:["--force","--message"],description:"Move one Plan step to a declared integer order.",example:"pm plan reorder-step pm-a1b2 plan-step-001 2"},...["decision","discovery","validation","resume","approve","materialize"].map(e=>({command:`plan ${e}`,parent:"plan",action:e,slots:[k],accepted_flags:I,description:`${B(e)} for one Plan item.`,example:`pm plan ${e} pm-a1b2`})),...["list","show","put","remove"].map(e=>({command:`assurance ${e}`,parent:"assurance",action:e,slots:[s("kind","string",!0),...e==="list"?[]:[s("id","string",!0)]],accepted_flags:e==="put"?["--author","--definition","--message"]:e==="remove"?["--author","--message"]:[],description:`${B(e)} assurance declarations by kind.`,example:e==="list"?"pm assurance list measurement":`pm assurance ${e} measurement example-id`})),{command:"assurance run",parent:"assurance",action:"run",slots:[s("gate-id","string",!0)],accepted_flags:["--dry-run","--trigger","--tree"],description:"Evaluate one assurance gate for a lifecycle trigger.",example:"pm assurance run tracker-context-quality --trigger ci --dry-run"},{command:"assurance verdicts",parent:"assurance",action:"verdicts",slots:[s("gate-id","string",!1)],accepted_flags:["--gate","--limit"],description:"List bounded assurance verdict history.",example:"pm assurance verdicts --limit 20"},...["presets","apply"].map(e=>({command:`assurance ${e}`,parent:"assurance",action:e,slots:[s("preset","string",e==="apply")],accepted_flags:["--author","--message","--owner"],description:e==="apply"?"Apply one assurance adoption preset.":"List available assurance adoption presets.",example:e==="apply"?"pm assurance apply software-delivery --owner <pm-item-id>":"pm assurance presets"})),{command:"assurance derive",parent:"assurance",action:"derive",slots:[],accepted_flags:["--apply","--author","--message","--owner"],description:"Derive assurance proposals from current project context.",example:"pm assurance derive --owner pm-a1b2"},{command:"assurance promote",parent:"assurance",action:"promote",slots:[s("assertion-id","string",!0)],accepted_flags:["--author","--enforcement","--message"],description:"Promote one assertion into a warning or blocking gate.",example:"pm assurance promote assertion-id --enforcement warn"},{command:"assurance risk",parent:"assurance",action:"risk",slots:[],accepted_flags:["--definition"],description:"Analyze bounded defect-recurrence risk for a proposed change.",example:`pm assurance risk --definition '{"policy":{"version":1,"evidence_epoch":"2026-01-01T00:00:00.000Z","families":[]},"change":{"files":[]}}'`},{command:"assurance lineages",parent:"assurance",action:"lineages",slots:[],accepted_flags:["--definition"],description:"Measure all recorded recurrence lineages with bounded evidence rows.",example:`pm assurance lineages --definition '{"policy":{"version":1,"evidence_epoch":"2026-01-01T00:00:00.000Z","families":[]}}'`},{command:"workspace position",parent:"workspace",action:"position",slots:[],accepted_flags:[],description:"Read bounded merge-fence, receipt, history-drift, and next-action readiness.",example:"pm workspace position"},{command:"workspace snapshot create",parent:"workspace snapshot",action:"create",slots:[s("name","string",!1)],accepted_flags:[],description:"Capture authoritative tracker state as an immutable snapshot.",example:"pm workspace snapshot create before-migration"},{command:"workspace snapshot list",parent:"workspace snapshot",action:"list",slots:[],accepted_flags:[],description:"List immutable workspace snapshots and named references.",example:"pm workspace snapshot list"},{command:"workspace snapshot inspect",parent:"workspace snapshot",action:"inspect",slots:[s("target","string",!0)],accepted_flags:[],description:"Inspect one workspace snapshot target.",example:"pm workspace snapshot inspect before-migration"},{command:"workspace snapshot restore",parent:"workspace snapshot",action:"restore",slots:[s("target","string",!0)],accepted_flags:["--author","--dry-run","--force","--message"],description:"Restore an immutable workspace snapshot with explicit recovery controls.",example:"pm workspace snapshot restore before-migration --dry-run"},{command:"workspace snapshot delete",parent:"workspace snapshot",action:"delete",slots:[s("target","string",!0)],accepted_flags:[],description:"Delete one workspace snapshot target.",example:"pm workspace snapshot delete before-migration"}],Le=[...h].sort((e,a)=>a.command.length-e.command.length),J=new Map([["append",[g,A]],["assurance",[s("action","action",!0),s("kind","string",!1),s("id","string",!1)]],["beads import",[s("file","string",!1)]],["cal",[s("view","string",!1,{polymorphic:!0})]],["calendar",[s("view","string",!1,{polymorphic:!0})]],["changelog corrections",[s("action","string",!0)]],["changelog export",[s("file","string",!1)]],["changelog milestone create",[s("name","string",!0)]],["claim",[y]],["close",[g,A]],["close-task",[g,s("reason","string",!1)]],["comments",[g,A]],["completion",[s("shell","string",!1)]],["config",[s("scope","string",!1,{polymorphic:!0}),s("action","action",!1),s("key","string",!1),s("value","string",!1,{polymorphic:!0})]],["copy",[g]],["create",[s("type-or-title","string",!1,{polymorphic:!0}),s("title","string",!1)]],["delete",[g]],["deps",[g]],["docs",[g]],["event",[s("title","string",!0)]],["files",[g]],["files discover",[g]],["files lookup",[s("paths","string",!0,{variadic:!0})]],["focus",[y]],["get",[g]],["graph",[s("subcommand","action",!0),y,s("target","item_id",!1)]],["guide",[s("topic","string",!1)]],["history",[g]],["history-compact",[y]],["history-redact",[g]],["history-repair",[y]],["init",[s("prefix-or-path","string",!1,{polymorphic:!0})]],["item complete",[g,s("reason","string",!1)]],["item reopen",[g,s("reason","string",!0)]],["learnings",[g,A]],["meet",[s("title","string",!0)]],["merge",[s("subcommand","action",!0),s("artifact","string",!1),s("base","string",!1),s("ours","string",!1),s("theirs","string",!1)]],["notes",[g,A]],["package",[s("target","string",!1,{polymorphic:!0})]],["package list",[]],["package inventory",[s("name","string",!1)]],["package scaffold",[s("target","string",!0)]],["package upgrade",[s("target","string",!1)]],["packages",[s("target","string",!1,{polymorphic:!0})]],["packages list",[]],["packages inventory",[s("name","string",!1)]],["packages scaffold",[s("target","string",!0)]],["packages upgrade",[s("target","string",!1)]],["pause-task",[g]],["plan",[s("subcommand","action",!0),s("id","item_id",!1,{polymorphic:!0}),s("step","string",!1),s("new-order","integer",!1)]],["profile",[s("subcommand","action",!0),s("name","string",!1)]],["release",[g]],["remind",[s("title","string",!0)]],["restore",[g,s("target","string",!0)]],["schema",[s("subcommand","action",!0),s("name","string",!1)]],["search-advanced",[s("keywords","string",!0,{variadic:!0})]],["search",[s("keywords","string",!0,{variadic:!0})]],["start-task",[g]],["templates save",[s("name","string",!0)]],["templates show",[s("name","string",!0)]],["telemetry",[s("namespace-or-subcommand","action",!1,{polymorphic:!0}),s("subcommand","action",!1)]],["test",[g]],["test-runs-worker",[s("runId","string",!0)]],["update",[g]],["workspace snapshot",[s("action","action",!0),s("target","string",!1)]],...["activate","adopt","deactivate","init","uninstall"].flatMap(e=>["extension","package","packages"].map(a=>[`${a} ${e}`,[s("target","string",!0)]])),...["describe"].flatMap(e=>["extension","package","packages"].map(a=>[`${a} ${e}`,[s("target","string",!1)]])),...["install"].flatMap(e=>["extension","package","packages"].map(a=>[`${a} ${e}`,[s("targets","string",!1,{variadic:!0})]])),["vcs abandon",[g]],["vcs create",[s("title","string",!0)]],["vcs merge",[g]],["vcs propose",[g]],["vcs ref-create",[s("name","string",!0)]],["vcs show",[g]]]);function v(e){return e.trim().toLowerCase().replace(/\s+/gu," ")}function _l(e){let a=v(e),l=F.find(i=>i.command===a);if(l)return l;let t=z(a)?.canonical;if(t)return F.find(i=>i.command===t)}function Re(e){let a=v(e);return Le.find(l=>l.command===a||a.startsWith(`${l.command} `))}function vl(e){return`Applicable flags: ${e.length>0?e.join(", "):"none"}.`}function n(e,a,l,t,i){return i.map(f=>({command:f,noun:e,target:a,disposition:l,owner:t}))}var w=[...n("item","item","target_noun","pm-pbyu",["item","item complete","item mutate","item reopen"]),...n("item","item","consolidation","pm-yql1",["append","close-many","close-task","comments","copy","delete","deps","docs","files","learnings","notes","pause-task","start-task","test","update-many"]),...["claim","close","create","get","release","update"].map(e=>({command:e,noun:"item",target:e,disposition:"keep_as_is",owner:"pm-pbyu",reason:"Permanent high-frequency item operations retain concise root spellings under the accepted hot-path grammar policy."})),...n("item","item files","target_noun","pm-yql1",["files discover","files lookup","item files discover","item files lookup"]),...n("item","item test worker","consolidation","pm-lp4j",["test-runs-worker"]),...n("list","list","target_noun","pm-pfqi",["list"]),...n("list","list --group-by","consolidation","pm-xkgq",["aggregate"]),...n("context","context","target_noun","pm-pbyu",["context"]),...n("context","context","consolidation","pm-kcs4",["ctx","focus","next"]),...n("context","context next","consolidation","pm-kcs4",["ctx next"]),...n("context","context focus","consolidation","pm-kcs4",["ctx focus"]),...n("search","search","target_noun","pm-pbyu",["search"]),...n("search","search","package_owned","package:search-advanced",["reindex","search-advanced"]),...n("item","item duplicates","consolidation","pm-fmy9ih",["duplicates"]),...n("item","item duplicates","package_owned","pm-fmy9ih",["dedupe-audit","dedupe-merge","comments-audit"]),...n("graph","graph","target_noun","pm-pbyu",["graph"]),...n("history","history","target_noun","pm-pbyu",["history"]),...n("history","history attest","target_noun","pm-3z0k",["history attest"]),...n("history","history attest","consolidation","pm-3z0k",["history-attest"]),...j.flatMap(({alias:e,canonical:a})=>[...n("history",a,"target_noun","pm-tqel",[a]),...n("history",a,"consolidation","pm-tqel",[e])]),...n("history","history","consolidation","pm-tqel",["events","merge"]),...n("history","history acknowledge","consolidation","pm-djyvbk",["history-author-acknowledge"]),...n("history","history","package_owned","package:builtin-vcs-exemplar",["vcs abandon","vcs create","vcs log","vcs merge","vcs propose","vcs ref-create","vcs show"]),...n("workspace","workspace","target_noun","pm-pbyu",["workspace","workspace position","workspace snapshot","workspace snapshot create","workspace snapshot delete","workspace snapshot inspect","workspace snapshot list","workspace snapshot restore"]),...n("workspace","workspace init","consolidation","pm-npr3",["init"]),...n("package","package","target_noun","pm-pbyu",["package","package activate","package adopt","package adopt-all","package catalog","package deactivate","package describe","package doctor","package explore","package init","package install","package inventory","package list","package manage","package migrate","package reload","package scaffold","package uninstall","package upgrade"]),...n("package","package","consolidation","pm-tnud",["extension activate","extension adopt","extension adopt-all","extension catalog","extension deactivate","extension describe","extension doctor","extension explore","extension init","extension install","extension manage","extension migrate","extension reload","extension uninstall","packages","packages activate","packages adopt","packages adopt-all","packages catalog","packages deactivate","packages describe","packages doctor","packages explore","packages init","packages install","packages inventory","packages list","packages manage","packages migrate","packages reload","packages scaffold","packages uninstall","packages upgrade"]),...n("package","package","package_owned","package:beads",["beads import"]),...n("package","package","package_owned","package:pm-changelog",["changelog audit","changelog contracts","changelog corrections","changelog drift","changelog export","changelog generate","changelog milestone create","changelog upgrades"]),...n("package","package calendar","package_owned","pm-o3fh",["cal","calendar","event","meet","remind"]),...n("ops","ops","target_noun","pm-6apl",["ops"]),...n("ops","ops normalize","package_owned","package:pm-governance-audit",["normalize"]),...n("ops","ops","consolidation","pm-6apl",["eval","gc","health","stats","telemetry","test-all","validate"]),...n("workspace","workspace","consolidation","pm-npr3",["config","profile","schema"]),...["assurance",...h.filter(({parent:e})=>e==="assurance").map(({command:e})=>e)].map(e=>({command:e,noun:"ops",target:e,disposition:"keep_as_is",owner:"pm-djyvbk",reason:"Assurance manages durable measurement, assertion, gate, and verdict data; retain its established domain surface independently of operational diagnostics."})),...n("plan","plan","target_noun","pm-pbyu",["plan"]),...n("plan","plan","target_noun","pm-2tan",h.filter(({parent:e})=>e==="plan").map(({command:e})=>e)),...n("contracts","contracts","target_noun","pm-pbyu",["contracts"]),...n("help","help","target_noun","pm-pbyu",["help"]),...n("workspace","templates","package_owned","package:builtin-templates",["templates","templates list","templates save","templates show"]),...n("help","help","package_owned","package:builtin-guide-shell",["completion","completion-statuses","completion-tags","completion-types","guide"])].flatMap(e=>{let a=H.find(t=>t.alias===e.command);if(!a)return[e];let l=G.find(t=>t===a.canonical_argv[0])??e.noun;return[{...e,noun:l,target:a.canonical,owner:a.owner},{...e,command:a.canonical,noun:l,target:a.canonical,owner:a.owner,disposition:e.disposition==="package_owned"?"package_owned":"target_noun"}]}),F=[...new Set(w.map(({command:e})=>e))].map(e=>({command:e,slots:Re(e)?.slots??J.get(C(e))??[]})),N={nouns:G,shared_verbs:Oe,scope_before_verb:!0,visible_top_level_ceiling:69,ceiling_raise_requires_pm_item:!0,positional_shape_budget:21};function K(e,a){let l=new Set(a);return[...new Set(e)].filter(t=>!l.has(t)).map(t=>({code:"positional_signature_mismatch",command:t,detail:`Positional signature ${t} has no destination declaration.`}))}function Ie(e){return e.map(({required:a,variadic:l,value_kind:t,polymorphic:i})=>`${a?"r":"o"}:${l?"v":"s"}:${t}:${i?"p":"m"}`).join("|")}function S(e){return e.map(({name:a,required:l,variadic:t,value_kind:i,polymorphic:f})=>`${a}:${l?"r":"o"}:${t?"v":"s"}:${i}:${f?"p":"m"}`).join("|")}function W(e,a){let l=new Map;for(let{command:t}of e){let i=v(t);l.set(i,(l.get(i)??0)+1)}return[...l.entries()].filter(([,t])=>t>1).map(([t,i])=>({code:"positional_signature_mismatch",command:t,detail:`${i} ${a} positional signatures exist for ${t}; exactly one is required.`}))}function hl(e,a={}){let l=a.declared??F,t=a.positionalShapeBudget??N.positional_shape_budget,i=new Map(l.map(o=>[v(o.command),o])),f=new Map(e.map(o=>[v(o.command),o])),c=[...W(l,"declared"),...W(e,"observed"),...a.declared===void 0?[...K(J.keys(),w.map(({command:o})=>o)),...K(h.map(({command:o})=>o),w.map(({command:o})=>o))]:[]];for(let o of i.values()){let d=v(o.command),r=f.get(d);r?S(r.slots)!==S(o.slots)&&c.push({code:"positional_signature_mismatch",command:o.command,detail:`Observed positional signature for ${o.command} differs from its declared SDK contract: observed=${S(r.slots)||"<none>"}; declared=${S(o.slots)||"<none>"}.`}):c.push({code:"missing_observed_signature",command:o.command,detail:`No observed positional signature exists for ${o.command}.`})}for(let o of f.values())i.has(v(o.command))||c.push({code:"stale_observed_signature",command:o.command,detail:`Observed positional signature ${o.command} has no declaration.`});let p=new Set(l.map(({slots:o})=>Ie(o))).size;return p>t&&c.push({code:"positional_shape_budget_exceeded",command:"*",detail:`Distinct positional shape count ${p} exceeds budget ${t}.`}),c.sort((o,d)=>o.command!==d.command?o.command.localeCompare(d.command):o.code.localeCompare(d.code)),{ok:c.length===0,declared_command_count:l.length,observed_command_count:e.length,positional_shape_count:p,positional_shape_budget:t,findings:c}}function Fe(e,a,l){return e.flatMap(t=>{let i=a.get(t)??[];if(i.length===0){let c=t.indexOf(" "),p=c===-1?t:t.slice(0,c);return[{code:"missing_destination",spelling:t,message:`Command \`${t}\` has no destination census row.`,nearest_target:l.has(p)?p:`ops ${t}`}]}let f=i.length>1?[{code:"duplicate_destination",spelling:t,message:`Command \`${t}\` has ${i.length} destination rows.`,nearest_target:i[0].target}]:[];return i.reduce((c,p)=>(p.disposition==="keep_as_is"&&(p.reason?.trim().length??0)===0&&c.push({code:"missing_destination",spelling:t,message:`Command \`${t}\` is kept as-is without a documented reason.`,nearest_target:p.target}),l.has(p.noun)||c.push({code:"unknown_noun",spelling:t,message:`Command \`${t}\` names undeclared noun \`${p.noun}\`.`,nearest_target:p.target}),c),f)})}function Ge(e,a){return a.filter(l=>l.disposition!=="package_owned"&&!e.has(l.command)).map(l=>({code:"stale_destination",spelling:l.command,message:`Destination row \`${l.command}\` is absent from live contracts.`,nearest_target:l.target}))}function Pe(e,a){return e.filter(l=>!a.has(l.canonical)).map(l=>({code:"alias_target_missing",spelling:l.alias,message:`Alias \`${l.alias}\` targets missing canonical command \`${l.canonical}\`.`,nearest_target:l.canonical_argv.join(" ")}))}function Tl(e,a=[],l=w){let t=[...new Set(e.map(r=>r.trim()))].filter(r=>r.length>0).sort((r,u)=>r.localeCompare(u)),i=new Set(t),f=new Set(G),c=new Map;for(let r of l){let u=c.get(r.command)??[];u.push(r),c.set(r.command,u)}let p=[...Fe(t,c,f),...Ge(i,l),...Pe(a.filter(r=>i.has(r.alias)||!(c.get(r.canonical)??[]).some(u=>u.disposition==="package_owned")),i)],o=new Set(a.filter(r=>r.hidden).map(r=>r.alias)),d=new Set(t.filter(r=>!r.includes(" ")&&!o.has(r)&&!(c.get(r)??[]).some(u=>u.disposition==="package_owned"))).size;return d>N.visible_top_level_ceiling&&p.push({code:"visible_surface_ceiling_exceeded",spelling:String(d),message:`Visible non-package top-level command count ${d} exceeds ceiling ${N.visible_top_level_ceiling}.`,nearest_target:"Declare the noun placement and tracked waiver before raising the ceiling."}),{ok:p.length===0,command_count:t.length,destination_count:l.length,hidden_alias_count:a.filter(r=>r.hidden).length,visible_top_level_count:d,visible_top_level_ceiling:N.visible_top_level_ceiling,findings:p}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="4e1e3ef4-cdf3-5d4c-88fe-d23f6fc171d1")}catch{}})();function b(e){return[...new Set(Array.from(e,a=>a.trim()).filter(a=>a.length>0))]}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="113dfab2-0c08-5b1a-81e4-a77a4d1ffcb3")}catch{}})();function E(e){return e.startsWith("--")?`--${e.slice(2).replaceAll("_","-")}`:e}function M(e){let a=new Map;for(let l of e){let t=E(l.flag),i=a.get(t)??new Set;l.flag!==t&&i.add(l.flag);for(let f of l.aliases??[])f!==t&&i.add(f);a.set(t,i)}return e.map(l=>{let t=E(l.flag);if(l.flag!==t)return l;let i=b([...l.aliases??[],...a.get(t)]).filter(f=>f!==t);return i.length===0?l:{...l,aliases:i}})}function El(e){let a=M(e),l=new Set(a.map(t=>t.flag));return a.filter(t=>{let i=E(t.flag);return t.flag===i||!l.has(i)})}var D=R.map(e=>({flag:e.flag,reservation_scope:"inherited",...e.aliases?{aliases:[...e.aliases]}:{},...e.value_name?{value_name:e.value_name}:{}}));function xl(e={}){return R.filter(a=>a.extension_command_availability===void 0||a.extension_command_availability==="read_output"&&e.readOutput===!0).map(a=>{let l=a.value_name??a.discovery_value_name;return{flag:a.flag,reservation_scope:"inherited",owner:"host",...a.aliases?{aliases:[...a.aliases]}:{},value_arity:l===void 0?"none":"required",...l===void 0?{}:{value_name:l}}})}var Ll=[...D,{flag:"--version",value_type:"boolean",reservation_scope:"root_only"},{flag:"--all",value_type:"boolean",reservation_scope:"root_only",description:"Expand root help to every command."},{flag:"--explain",value_type:"boolean",reservation_scope:"root_only",description:"Expand root help with command guidance."}],se=[{flag:"--filter-reviewer-missing"},{flag:"--filter-risk-missing"},{flag:"--filter-confidence-missing"},{flag:"--filter-sprint-missing"},{flag:"--filter-release-missing"},{flag:"--has-notes"},{flag:"--no-notes"},{flag:"--has-learnings"},{flag:"--no-learnings"},{flag:"--has-files"},{flag:"--no-files"},{flag:"--filter-files-missing"},{flag:"--has-docs"},{flag:"--no-docs"},{flag:"--filter-docs-missing"},{flag:"--has-tests"},{flag:"--no-tests"},{flag:"--has-comments"},{flag:"--no-comments"},{flag:"--has-deps"},{flag:"--no-deps"},{flag:"--has-body"},{flag:"--empty-body"},{flag:"--has-linked-command"},{flag:"--no-linked-command"}],ie=[{flag:"--filter-reviewer-missing"},{flag:"--filter-risk-missing"},{flag:"--filter-confidence-missing"},{flag:"--filter-sprint-missing"},{flag:"--filter-release-missing"},{flag:"--filter-has-notes"},{flag:"--filter-no-notes"},{flag:"--filter-has-learnings"},{flag:"--filter-no-learnings"},{flag:"--filter-has-files"},{flag:"--filter-no-files"},{flag:"--filter-has-docs"},{flag:"--filter-no-docs"},{flag:"--filter-has-tests"},{flag:"--filter-no-tests"},{flag:"--filter-has-comments"},{flag:"--filter-no-comments"},{flag:"--filter-has-deps"},{flag:"--filter-no-deps"},{flag:"--filter-has-body"},{flag:"--filter-empty-body"},{flag:"--filter-has-linked-command"},{flag:"--filter-no-linked-command"},{flag:"--ids",list:!0},{flag:"--limit"},{flag:"--offset"}],P=$([{flag:"--for",value_name:"intent"},{flag:"--token-budget",aliases:["--token_budget"]},{flag:"--status",list:!0},{flag:"--all",value_type:"boolean"},{flag:"--type",list:!0},{flag:"--tag",aliases:["--tags"],list:!0},{flag:"--priority",list:!0},{flag:"--deadline-before"},{flag:"--deadline-after"},{flag:"--today"},{flag:"--recent"},{flag:"--updated-after"},{flag:"--updated-before"},{flag:"--created-after"},{flag:"--created-before"},{flag:"--ids",list:!0},{flag:"--assignee",list:!0},{flag:"--assignee-filter"},{flag:"--assignee_filter"},{flag:"--parent"},{flag:"--sprint",list:!0},{flag:"--release",list:!0},{flag:"--filter-ac-missing"},{flag:"--filter-estimates-missing",aliases:["--filter-estimate-missing"]},{flag:"--filter-resolution-missing"},{flag:"--filter-metadata-missing"},...se,{flag:"--limit"},{flag:"--offset"},{flag:"--after"},{flag:"--no-truncate"},{flag:"--compact"},{flag:"--brief"},{flag:"--full"},{flag:"--fields",list:!0},{flag:"--sort"},{flag:"--order"},{flag:"--tree"},{flag:"--tree-depth"},{flag:"--tree_depth"},{flag:"--include-body"},{flag:"--strict-read"},{flag:"--format"},{flag:"--stream"}],new Set(["--limit","--token-budget","--offset","--after","--no-truncate","--compact","--brief","--full","--fields","--include-body","--strict-read"])),Me=[{flag:"--group-by",list:!0},{flag:"--set-mode"},{flag:"--limit"},{flag:"--after"},{flag:"--count"},{flag:"--completion"},{flag:"--sum"},{flag:"--avg"},{flag:"--include-unparented"},{flag:"--include_unparented"},{flag:"--status",list:!0},{flag:"--type",list:!0},{flag:"--tag",list:!0},{flag:"--priority",list:!0},{flag:"--deadline-before"},{flag:"--deadline-after"},{flag:"--assignee",list:!0},{flag:"--assignee-filter"},{flag:"--assignee_filter"},{flag:"--parent"},{flag:"--sprint",list:!0},{flag:"--release",list:!0}],De=[{flag:"--id",value_name:"item-id"},{flag:"--add",aliases:["--comment","--body","--text"]},{flag:"--stdin"},{flag:"--file"},{flag:"--edit"},{flag:"--delete"},{flag:"--expect-at"},{flag:"--limit"},{flag:"--full-history"},{flag:"--if-absent",value_type:"boolean"},{flag:"--author"},{flag:"--message"},{flag:"--force"}];function $(e,a){return e.map(l=>a.has(l.flag)?{...l,cursor_semantics:"presentation"}:l)}var $e=[{flag:"--id",value_name:"item-id"},{flag:"--add",aliases:["--note","--text"]},{flag:"--add-json"},{flag:"--stdin"},{flag:"--file"},{flag:"--edit"},{flag:"--delete"},{flag:"--expect-at"},{flag:"--limit"},{flag:"--since"},{flag:"--event-type"},{flag:"--include-meta"},{flag:"--full-history"},{flag:"--if-absent",value_type:"boolean"},{flag:"--author"},{flag:"--message"},{flag:"--force"}],Ue=[{flag:"--id",value_name:"item-id"},{flag:"--add",aliases:["--learning","--text"]},{flag:"--stdin"},{flag:"--file"},{flag:"--edit"},{flag:"--delete"},{flag:"--expect-at"},{flag:"--limit"},{flag:"--full-history"},{flag:"--if-absent",value_type:"boolean"},{flag:"--author"},{flag:"--message"},{flag:"--force"}],je=[{flag:"--id",value_name:"item-id"},{flag:"--add"},{flag:"--add-glob"},{flag:"--remove"},{flag:"--migrate"},{flag:"--note"},{flag:"--note-conflict",value_name:"mode",values:["refuse","replace","append"],default:"refuse"},{flag:"--list"},{flag:"--append-stable"},{flag:"--validate-paths"},{flag:"--full-history"},{flag:"--scope"},{flag:"--limit"},{flag:"--offset"},{flag:"--no-truncate"},{flag:"--strict-read"},{flag:"--explain"},{flag:"--lines",value_name:"start:end"},{flag:"--decision-depth",value_name:"n",value_type:"number"},{flag:"--author"},{flag:"--message"},{flag:"--force"}],He=[{flag:"--id",value_name:"item-id"},{flag:"--add"},{flag:"--add-glob"},{flag:"--remove"},{flag:"--migrate"},{flag:"--note"},{flag:"--note-conflict",value_name:"mode",values:["refuse","replace","append"],default:"refuse"},{flag:"--list"},{flag:"--validate-paths"},{flag:"--full-history"},{flag:"--author"},{flag:"--message"},{flag:"--force"}],ze=[{flag:"--id",value_name:"item-id"},{flag:"--limit"},{flag:"--order",value_name:"value",value_type:"string"},{flag:"--compact"},{flag:"--full"},{flag:"--provenance"},{flag:"--provenance-summary"},{flag:"--harness",repeatable:!0},{flag:"--agent-instance",repeatable:!0},{flag:"--provenance-filter",repeatable:!0},{flag:"--diff"},{flag:"--field"},{flag:"--verify"},{flag:"--strict-exit"},{flag:"--fail-on-warn"},{flag:"--format"}],Xe=[{flag:"--dry-run"},{flag:"--pre-commit-hook",value_type:"boolean"},{flag:"--stage",value_type:"boolean"},{flag:"--message"},{flag:"--force"},{flag:"--include-reconciled"},{flag:"--output"},{flag:"--item-path"},{flag:"--prefer"}],qe=[{flag:"--id",value_name:"item-id"},{flag:"--literal"},{flag:"--regex"},{flag:"--replacement"},{flag:"--dry-run"},{flag:"--author"},{flag:"--message"},{flag:"--force"}],Ye=[{flag:"--id",value_name:"item-id"},{flag:"--all"},{flag:"--dry-run"},{flag:"--normalize-provenance"},{flag:"--salvage-tail",value_type:"boolean"},{flag:"--author"},{flag:"--message"},{flag:"--force"}],Be=[{flag:"--event",repeatable:!0},{flag:"--all-actionable"},{flag:"--dry-run"},{flag:"--plan-fingerprint"},{flag:"--limit",value_type:"number"},{flag:"--attributed-author",aliases:["--attributed_author"]},{flag:"--reviewer"},{flag:"--reason"}],Ve=[{flag:"--id",value_name:"item-id"},{flag:"--before"},{flag:"--ids",list:!0},{flag:"--all-over",value_type:"number"},{flag:"--closed"},{flag:"--all-streams"},{flag:"--min-entries",value_type:"number"},{flag:"--dry-run"},{flag:"--author"},{flag:"--message"},{flag:"--force"}],Ke=[{flag:"--verify",value_name:"file",value_type:"string"},{flag:"--output",value_name:"file",value_type:"string"},{flag:"--hash-algorithm",value_name:"name",value_type:"string"}],We=[{flag:"--definition",value_name:"json"},{flag:"--policy",value_name:"id"},{flag:"--message",value_name:"value"},{flag:"--description"},{flag:"--default-status",aliases:["--default_status"]},{flag:"--folder"},{flag:"--alias"},{flag:"--role"},{flag:"--order"},{flag:"--type"},{flag:"--commands"},{flag:"--cli-flag"},{flag:"--required"},{flag:"--required-on-create"},{flag:"--no-allow-unset"},{flag:"--required-types"},{flag:"--infer"},{flag:"--min-count"},{flag:"--apply",value_type:"boolean"},{flag:"--to"},{flag:"--migration-id",aliases:["--migration_id"]},{flag:"--dry-run"},{flag:"--author"},{flag:"--force"}],Je=[{flag:"--dry-run"},{flag:"--author"},{flag:"--force"}],ne=[{flag:"--title"},{flag:"--description"},{flag:"--scope"},{flag:"--parent"},{flag:"--inherit-focus",value_type:"boolean",default:!0},{flag:"--no-inherit-focus",value_type:"boolean"},{flag:"--related"},{flag:"--blocks"},{flag:"--blocked-by",aliases:["--blocked_by"]},{flag:"--harness"},{flag:"--mode"},{flag:"--resume-context",aliases:["--resume_context"]},{flag:"--tags",aliases:["--tag"],list:!0},{flag:"--priority"},{flag:"--status",short:"-s"},{flag:"--create-mode",aliases:["--create_mode"]},{flag:"--deadline"},{flag:"--estimate",aliases:["--estimated-minutes","--estimated_minutes"]},{flag:"--acceptance-criteria",aliases:["--acceptance_criteria","--ac"],repeatable:!0},{flag:"--definition-of-ready",aliases:["--definition_of_ready"]},{flag:"--order"},{flag:"--rank"},{flag:"--goal"},{flag:"--objective"},{flag:"--value"},{flag:"--impact"},{flag:"--outcome"},{flag:"--why-now",aliases:["--why_now"]},{flag:"--assignee"},{flag:"--reviewer"},{flag:"--risk"},{flag:"--confidence"},{flag:"--sprint"},{flag:"--release"},{flag:"--blocked-reason",aliases:["--blocked_reason"]},{flag:"--unblock-note",aliases:["--unblock_note"]},{flag:"--reporter"},{flag:"--severity"},{flag:"--environment"},{flag:"--repro-steps",aliases:["--repro_steps"]},{flag:"--resolution"},{flag:"--expected-result",aliases:["--expected_result","--expected"]},{flag:"--actual-result",aliases:["--actual_result","--actual"]},{flag:"--affected-version",aliases:["--affected_version"]},{flag:"--fixed-version",aliases:["--fixed_version"]},{flag:"--component"},{flag:"--regression"},{flag:"--customer-impact",aliases:["--customer_impact"]},{flag:"--comment",repeatable:!0},{flag:"--note",repeatable:!0},{flag:"--learning",repeatable:!0},{flag:"--reminder",repeatable:!0},{flag:"--event",repeatable:!0},{flag:"--type-option",aliases:["--type_option"],repeatable:!0},{flag:"--body"},{flag:"--claim"},{flag:"--from-search",aliases:["--from_search"]},{flag:"--template"},{flag:"--step-title",aliases:["--step_title"]},{flag:"--step"},{flag:"--step-body",aliases:["--step_body"]},{flag:"--step-owner",aliases:["--step_owner"]},{flag:"--step-status",aliases:["--step_status"]},{flag:"--step-evidence",aliases:["--step_evidence"]},{flag:"--step-blocked-reason",aliases:["--step_blocked_reason"]},{flag:"--step-replacement",aliases:["--step_replacement"]},{flag:"--depends-on",aliases:["--depends_on"]},{flag:"--link"},{flag:"--link-kind",aliases:["--link_kind"]},{flag:"--link-note",aliases:["--link_note"]},{flag:"--promote-to-item-dep",aliases:["--promote_to_item_dep"]},{flag:"--allow-multiple-active",aliases:["--allow_multiple_active"]},{flag:"--file"},{flag:"--test"},{flag:"--doc"},{flag:"--decision-text",aliases:["--decision_text","--decision"]},{flag:"--decision-rationale",aliases:["--decision_rationale"]},{flag:"--decision-evidence",aliases:["--decision_evidence"]},{flag:"--discovery-text",aliases:["--discovery_text","--discovery"]},{flag:"--validation-text",aliases:["--validation_text","--validation"]},{flag:"--validation-command",aliases:["--validation_command"]},{flag:"--validation-expected",aliases:["--validation_expected"]},{flag:"--depth",values:Y},{flag:"--field"},{flag:"--fields",list:!0},{flag:"--steps"},{flag:"--materialize-type",aliases:["--materialize_type"]},{flag:"--materialize-parent",aliases:["--materialize_parent"]},{flag:"--materialize-tags",aliases:["--materialize_tags"]},{flag:"--author"},{flag:"--message"},{flag:"--force"}],Ze=[{flag:"--id-prefix",aliases:["--prefix"]},{flag:"--preset"},{flag:"--type-preset"},{flag:"--defaults",short:"-y",aliases:["--yes"]},{flag:"--author"},{flag:"--agent-guidance"},{flag:"--with-packages"},{flag:"--no-merge-fence"},{flag:"--workspace"},{flag:"--force"},{flag:"--verbose"}],Qe=[{flag:"--value",value_name:"value"},{flag:"--criterion"},{flag:"--clear-criteria"},{flag:"--format"},{flag:"--policy"},{flag:"--default-depth"},{flag:"--activity-limit"},{flag:"--stale-threshold-days"},{flag:"--section-hierarchy"},{flag:"--section-activity"},{flag:"--section-progress"},{flag:"--section-blockers"},{flag:"--section-files"},{flag:"--section-workload"},{flag:"--section-staleness"},{flag:"--section-tests"}],oe=[{flag:"--dry-run"},{flag:"--init"},{flag:"--scaffold"},{flag:"--capability"},{flag:"--install"},{flag:"--uninstall"},{flag:"--explore"},{flag:"--list"},{flag:"--manage"},{flag:"--offline",value_type:"boolean"},{flag:"--describe"},{flag:"--markdown"},{flag:"--output"},{flag:"--reload"},{flag:"--watch"},{flag:"--doctor"},{flag:"--catalog"},{flag:"--adopt"},{flag:"--adopt-all"},{flag:"--activate"},{flag:"--deactivate"},{flag:"--project"},{flag:"--local"},{flag:"--global"},{flag:"--gh"},{flag:"--github"},{flag:"--ref"},{flag:"--detail"},{flag:"--trace"},{flag:"--runtime-probe"},{flag:"--fix-managed-state"},{flag:"--isolated"},{flag:"--ignore-global"},{flag:"--strict-exit"},{flag:"--fail-on-warn"}],m=[{flag:"--project"},{flag:"--local"},{flag:"--global"}],re=[...m,{flag:"--capability"}],Z=[...oe,{flag:"--declarative"}],ea=[...re,{flag:"--declarative"}],aa=[{flag:"--dry-run"},{flag:"--project"},{flag:"--local"},{flag:"--global"},{flag:"--gh"},{flag:"--github"},{flag:"--ref"}],la=m,ta=m,sa=[...m,{flag:"--markdown"},{flag:"--output"}],ia=m,na=m,oa=m,ra=[...m,{flag:"--dry-run"}],ga=[...m,{flag:"--offline",value_type:"boolean"},{flag:"--runtime-probe"},{flag:"--fix-managed-state"}],fa=[...m,{flag:"--watch"}],ca=[...m,{flag:"--detail"},{flag:"--trace"},{flag:"--fix-managed-state"},{flag:"--isolated"},{flag:"--ignore-global"},{flag:"--strict-exit"},{flag:"--fail-on-warn"}],Q=[...m,{flag:"--fields",list:!0}],pa=[...m,{flag:"--gh"},{flag:"--github"},{flag:"--ref"}],da=[{flag:"--dry-run"},{flag:"--project"},{flag:"--local"},{flag:"--global"},{flag:"--gh"},{flag:"--github"},{flag:"--ref"}],ge=[{flag:"--dry-run"},{flag:"--cli-only"},{flag:"--packages-only"},{flag:"--project"},{flag:"--local"},{flag:"--global"},{flag:"--repair"},{flag:"--tag"},{flag:"--package-name"}],Rl=[{flag:"--mode"},{flag:"--progress"}],ma=[{flag:"--release-assignment",value_type:"boolean"},{flag:"--id",value_name:"item-id"},{flag:"--reason",value_name:"value"},{flag:"--close-reason",value_name:"value"},{flag:"--completed-at",value_name:"value"},{flag:"--duplicate-of",value_name:"value"},{flag:"--author",value_name:"value"},{flag:"--message",value_name:"value"},{flag:"--validate-close",value_name:"off|warn|strict"},{flag:"--resolution",value_name:"value"},{flag:"--expected-result",aliases:["--expected_result","--expected"],value_name:"value"},{flag:"--actual-result",aliases:["--actual_result","--actual"],value_name:"value"},{flag:"--force",value_type:"boolean"}],ua=[{flag:"--filter-status",list:!0},{flag:"--filter-type"},{flag:"--filter-tag"},{flag:"--filter-priority"},{flag:"--filter-deadline-before"},{flag:"--filter-deadline-after"},{flag:"--filter-updated-after"},{flag:"--filter-updated-before"},{flag:"--filter-created-after"},{flag:"--filter-created-before"},{flag:"--filter-assignee"},{flag:"--filter-assignee-filter"},{flag:"--filter-assignee_filter"},{flag:"--filter-parent"},{flag:"--filter-sprint"},{flag:"--filter-release"},...ie,{flag:"--reason"},{flag:"--completed-at"},{flag:"--resolution"},{flag:"--expected-result",aliases:["--expected_result","--expected"]},{flag:"--actual-result",aliases:["--actual_result","--actual"]},{flag:"--validate-close"},{flag:"--author"},{flag:"--message"},{flag:"--force"},{flag:"--dry-run"},{flag:"--rollback"},{flag:"--no-checkpoint"}],_a=[{flag:"--id",value_name:"item-id"},{flag:"--body",short:"-b"},{flag:"--text"},{flag:"--author"},{flag:"--message"},{flag:"--force"}],va=[{flag:"--start",value_type:"boolean"},{flag:"--id",value_name:"item-id"},{flag:"--author",aliases:["--assignee"]},{flag:"--message"},{flag:"--force"},{flag:"--if-available"},{flag:"--takeover-stale"},{flag:"--next"},{flag:"--type"},{flag:"--tag"},{flag:"--priority"},{flag:"--assignee-filter"},{flag:"--parent"},{flag:"--sprint"},{flag:"--release"},{flag:"--max-attempts"},{flag:"--include-decisions"},{flag:"--include-gates"},{flag:"--include-containers"},{flag:"--token-budget",aliases:["--token_budget"]},{flag:"--explain-ranking",aliases:["--explain_ranking"]}],ha=[{flag:"--id",value_name:"item-id"},{flag:"--author"},{flag:"--message"},{flag:"--force"}],Ta=[{flag:"--id",value_name:"item-id"},{flag:"--dry-run"},{flag:"--author"},{flag:"--message"},{flag:"--force"}],ya=[{flag:"--pause",value_type:"boolean"},{flag:"--handoff",value_name:"status"},{flag:"--id",value_name:"item-id"},{flag:"--author",aliases:["--assignee"]},{flag:"--message"},{flag:"--force"}],Aa=[{flag:"--id",value_name:"item-id"},{flag:"--author",aliases:["--assignee"]},{flag:"--message"},{flag:"--force"},{flag:"--takeover-stale"}],ka=[{flag:"--id",value_name:"item-id"},{flag:"--author",aliases:["--assignee"]},{flag:"--message"},{flag:"--force"}],ba=[{flag:"--id",value_name:"item-id"},{flag:"--author",aliases:["--assignee"]},{flag:"--message"},{flag:"--validate-close",value_name:"off|warn|strict"},{flag:"--force"}],fe=[{flag:"--parent"},{flag:"--allow-missing-parent"},{flag:"--tags"},{flag:"--priority"},{flag:"--body"},{flag:"--description"},{flag:"--author"},{flag:"--message"}],ce=[{flag:"--start"},{flag:"--duration"},{flag:"--end"},{flag:"--location"},{flag:"--timezone"},{flag:"--all-day"},...fe],Ca=ce,Sa=[{flag:"--at"},{flag:"--text"},...fe],Na=[{flag:"--list"},{flag:"--id",value_name:"item-id"},{flag:"--add"},{flag:"--add-json"},{flag:"--remove"},{flag:"--remove-index",repeatable:!0},{flag:"--update"},{flag:"--update-index"},{flag:"--set-json"},{flag:"--run"},{flag:"--match"},{flag:"--only-index"},{flag:"--only-last"},{flag:"--full-history"},{flag:"--background"},{flag:"--timeout"},{flag:"--progress"},{flag:"--env-set"},{flag:"--env-clear"},{flag:"--shared-host-safe"},{flag:"--pm-context"},{flag:"--override-linked-pm-context"},{flag:"--workspace-context"},{flag:"--override-linked-workspace-context"},{flag:"--allow-untrusted-linked-tests"},{flag:"--acknowledge-linked-tests"},{flag:"--fail-on-context-mismatch"},{flag:"--fail-on-skipped"},{flag:"--fail-on-empty-test-run"},{flag:"--require-assertions-for-pm"},{flag:"--check-context"},{flag:"--full-output"},{flag:"--auto-pm-context"},{flag:"--measure",list:!0,description:"Record numeric measurement evidence; requires --run and an executed linked command."},{flag:"--metric-below"},{flag:"--metric-diff"},{flag:"--author"},{flag:"--message"},{flag:"--force"}],wa=[{flag:"--status"},{flag:"--limit"},{flag:"--offset"},{flag:"--background"},{flag:"--timeout"},{flag:"--progress"},{flag:"--env-set"},{flag:"--env-clear"},{flag:"--shared-host-safe"},{flag:"--pm-context"},{flag:"--override-linked-pm-context"},{flag:"--workspace-context"},{flag:"--override-linked-workspace-context"},{flag:"--allow-untrusted-linked-tests"},{flag:"--fail-on-context-mismatch"},{flag:"--fail-on-skipped"},{flag:"--fail-on-empty-test-run"},{flag:"--require-assertions-for-pm"},{flag:"--check-context"},{flag:"--full-output"},{flag:"--auto-pm-context"}],Oa=[{flag:"--limit"}],Il=[{flag:"--status"},{flag:"--limit"},{flag:"--stream"},{flag:"--tail"},{flag:"--force"},{flag:"--author"}],Ea=[{flag:"--dry-run"},{flag:"--scope"}],xa=[{flag:"--include-empty"},{flag:"--storage"},{flag:"--metadata-coverage"},{flag:"--field-utilization"},{flag:"--by-assignee"},{flag:"--by-tag"},{flag:"--by-priority"},{flag:"--tag-prefix"},{flag:"--analytics"}],La=[{flag:"--exhaustive",value_type:"boolean"},{flag:"--status",repeatable:!0,list:!0},{flag:"--since"},{flag:"--threshold"},{flag:"--limit"}],Ra=[{flag:"--strict-directories"},{flag:"--require-merge-drivers"},{flag:"--strict-exit"},{flag:"--fail-on-warn"},{flag:"--check-only"},{flag:"--check-telemetry"},{flag:"--no-refresh"},{flag:"--refresh-vectors"},{flag:"--verbose-stale-items"},{flag:"--verbose-author-events"},{flag:"--brief"},{flag:"--summary"},{flag:"--skip-vectors"},{flag:"--skip-integrity"},{flag:"--skip-drift"},{flag:"--full"}],Ia=[{flag:"--check-completeness",value_type:"boolean"},{flag:"--check-metadata"},{flag:"--metadata-profile"},{flag:"--check-resolution"},{flag:"--check-lifecycle"},{flag:"--check-stale-blockers"},{flag:"--dependency-cycle-severity"},{flag:"--parent-cycle-severity"},{flag:"--check-files"},{flag:"--scan-mode"},{flag:"--include-pm-internals"},{flag:"--verbose-file-lists"},{flag:"--verbose-diagnostics"},{flag:"--all-affected-ids"},{flag:"--strict-exit"},{flag:"--fail-on-warn"},{flag:"--fix-hints"},{flag:"--auto-fix"},{flag:"--dry-run"},{flag:"--fix-scope"},{flag:"--prune-missing"},{flag:"--check-history-drift"},{flag:"--check-command-references"},{flag:"--check-storage-integrity"},{flag:"--counts"},{flag:"--full"}],pe=[{flag:"--definition",value_name:"json"},{flag:"--trigger",value_name:"value"},{flag:"--tree",value_name:"value"},{flag:"--gate",value_name:"id"},{flag:"--limit",value_name:"number"},{flag:"--dry-run"},{flag:"--author",value_name:"value"},{flag:"--message",value_name:"value"},{flag:"--owner",value_name:"item-id"},{flag:"--apply",value_type:"boolean"},{flag:"--enforcement",value_name:"level"}],de=[{flag:"--assignee"},{flag:"--parent"},{flag:"--allow-missing-parent"},{flag:"--allow-unresolved-deps"},{flag:"--reviewer"},{flag:"--risk"},{flag:"--confidence"},{flag:"--sprint"},{flag:"--release"},{flag:"--blocked-by"},{flag:"--blocked-reason"},{flag:"--unblock-note"},{flag:"--reporter"},{flag:"--severity"},{flag:"--environment"},{flag:"--repro-steps"},{flag:"--resolution"},{flag:"--expected-result"},{flag:"--actual-result"},{flag:"--affected-version"},{flag:"--fixed-version"}],me=[{flag:"--component"},{flag:"--regression"},{flag:"--customer-impact"},{flag:"--customer_impact"},{flag:"--definition-of-ready"},{flag:"--definition_of_ready"},{flag:"--order"},{flag:"--rank"},{flag:"--goal"},{flag:"--objective"},{flag:"--value"},{flag:"--impact"},{flag:"--outcome"},{flag:"--why-now"},{flag:"--why_now"}],ue=[{short:"-p",flag:"--priority"},{flag:"--type"},{flag:"--tags",aliases:["--tag"],list:!0},{flag:"--add-tags",aliases:["--add_tags"]},{flag:"--remove-tags",aliases:["--remove_tags"]},{flag:"--deadline"},{flag:"--estimate"},{flag:"--estimated-minutes"},{flag:"--estimated_minutes"},{flag:"--acceptance-criteria"},{flag:"--acceptance_criteria"},{flag:"--ac"},{flag:"--add-ac",aliases:["--add_ac"]},{flag:"--remove-ac",aliases:["--remove_ac"]}],ee=[{flag:"--inherit-focus",value_type:"boolean",default:!0},{flag:"--no-inherit-focus",value_type:"boolean"},{flag:"--stdin-json"},{short:"-t",flag:"--title"},{flag:"--id"},{short:"-d",flag:"--description"},{flag:"--type"},{flag:"--template"},{flag:"--create-mode"},{flag:"--create_mode"},{flag:"--defer",repeatable:!0},{flag:"--defer-reason",aliases:["--defer_reason"]},{flag:"--schedule-preset"},{flag:"--schedule_preset"},{short:"-s",flag:"--status"},{flag:"--close-reason"},{flag:"--close_reason"},{flag:"--completed-at"},{flag:"--completed_at"},{short:"-p",flag:"--priority"},{flag:"--tags",aliases:["--tag"],list:!0},{flag:"--add-tags",aliases:["--add_tags"]},{short:"-b",flag:"--body",value_name:"value"},{flag:"--body-file"},{flag:"--deadline"},{flag:"--estimate"},{flag:"--estimated-minutes"},{flag:"--estimated_minutes"},{flag:"--acceptance-criteria"},{flag:"--acceptance_criteria"},{flag:"--ac"},{flag:"--author"},{flag:"--message"},...de,...me,{flag:"--blocked_by"},{flag:"--blocked_reason"},{flag:"--unblock_note"},{flag:"--repro_steps"},{flag:"--expected_result"},{flag:"--actual_result"},{flag:"--expected"},{flag:"--actual"},{flag:"--affected_version"},{flag:"--fixed_version"},{flag:"--dep"},{flag:"--type-option"},{flag:"--type_option"},{flag:"--field"},{flag:"--reminder"},{flag:"--event"},{flag:"--comment"},{flag:"--note"},{flag:"--learning"},{flag:"--file",aliases:["--linked-file"]},{flag:"--test",aliases:["--linked-test"]},{flag:"--doc"},{flag:"--unset",repeatable:!0},{flag:"--clear-deps"},{flag:"--clear-comments"},{flag:"--clear-notes"},{flag:"--clear-learnings"},{flag:"--clear-files"},{flag:"--clear-tests"},{flag:"--clear-docs"},{flag:"--clear-reminders"},{flag:"--clear-events"},{flag:"--clear-type-options"},{flag:"--allow-duplicate",value_type:"boolean"}],Fa=[{flag:"--transaction-id",value_name:"value"},{flag:"--stdin-json"},{flag:"--from",value_name:"path"},{flag:"--upsert-key",value_name:"field"},{flag:"--dry-run"},{flag:"--create-compensation",value_name:"mode"},{flag:"--lock-ttl-seconds",value_name:"n"},{flag:"--lock-wait-ms",value_name:"n"},{flag:"--author",value_name:"value"}],Ga=[{flag:"--id",value_name:"item-id"},{flag:"--transaction-id",value_name:"value",required:!0},{flag:"--reason",value_name:"value"},{flag:"--file",value_name:"value",repeatable:!0},{flag:"--doc",value_name:"value",repeatable:!0},{flag:"--test",value_name:"value",repeatable:!0},{flag:"--comment",value_name:"value",repeatable:!0},{flag:"--note",value_name:"value",repeatable:!0},{flag:"--learning",value_name:"value",repeatable:!0},{flag:"--resolution",value_name:"value"},{flag:"--expected-result",value_name:"value"},{flag:"--actual-result",value_name:"value"},{flag:"--completed-at",value_name:"value"},{flag:"--validate-close",value_name:"off|warn|strict"},{flag:"--lock-ttl-seconds",value_name:"n"},{flag:"--lock-wait-ms",value_name:"n"},{flag:"--dry-run"},{flag:"--force"},{flag:"--author",value_name:"value"}],Pa=[{flag:"--id",value_name:"item-id"},{flag:"--status",value_name:"open|in_progress"},{flag:"--expected-result",value_name:"value",aliases:["--expected"]},{flag:"--message",value_name:"value"},{flag:"--force"},{flag:"--author",value_name:"value"}],Ma=[{flag:"--id",value_name:"item-id"},{flag:"--title",value_name:"value"},{flag:"--author",value_name:"value"},{flag:"--message",value_name:"value"},{flag:"--allow-duplicate",value_type:"boolean"}],Da=[{flag:"--id",value_name:"item-id"},{flag:"--clear"}],$a=[{flag:"--id",value_name:"item-id"},{flag:"--stdin-json"},{short:"-t",flag:"--title"},{short:"-d",flag:"--description"},{short:"-b",flag:"--body"},{flag:"--body-file"},{short:"-s",flag:"--status"},{flag:"--close-reason"},{flag:"--close_reason"},{flag:"--completed-at"},...ue,...de,{flag:"--fixed_version"},...me,{flag:"--author"},{flag:"--message"},{flag:"--blocked_by"},{flag:"--blocked_reason"},{flag:"--unblock_note"},{flag:"--repro_steps"},{flag:"--expected_result"},{flag:"--actual_result"},{flag:"--expected"},{flag:"--actual"},{flag:"--affected_version"},{flag:"--dep"},{flag:"--dep-remove"},{flag:"--dep_remove"},{flag:"--replace-deps"},{flag:"--replace-tests"},{flag:"--replace-files"},{flag:"--replace-docs"},{flag:"--comment"},{flag:"--note"},{flag:"--learning"},{flag:"--file",aliases:["--linked-file"]},{flag:"--test",aliases:["--linked-test"]},{flag:"--doc"},{flag:"--reminder"},{flag:"--event"},{flag:"--type-option"},{flag:"--type_option"},{flag:"--field"},{flag:"--unset",repeatable:!0},{flag:"--clear-deps"},{flag:"--clear-comments"},{flag:"--clear-notes"},{flag:"--clear-learnings"},{flag:"--clear-files"},{flag:"--clear-tests"},{flag:"--clear-docs"},{flag:"--clear-reminders"},{flag:"--clear-events"},{flag:"--clear-type-options"},{flag:"--force"}],Ua=[{flag:"--status",short:"-s"},{flag:"--assignee"},{flag:"--parent"},{flag:"--blocked-by",aliases:["--blocked_by"]},{flag:"--blocked-reason",aliases:["--blocked_reason"]},{flag:"--unblock-note",aliases:["--unblock_note"]},{flag:"--filter-status",list:!0},{flag:"--filter-type",list:!0},{flag:"--filter-tag",list:!0},{flag:"--filter-priority",list:!0},{flag:"--filter-deadline-before"},{flag:"--filter-deadline-after"},{flag:"--filter-updated-after"},{flag:"--filter-updated-before"},{flag:"--filter-created-after"},{flag:"--filter-created-before"},{flag:"--filter-assignee",list:!0},{flag:"--filter-assignee-filter"},{flag:"--filter-assignee_filter"},{flag:"--filter-parent"},{flag:"--filter-sprint",list:!0},{flag:"--filter-release",list:!0},{flag:"--filter-ac-missing"},{flag:"--filter-estimates-missing",aliases:["--filter-estimate-missing"]},{flag:"--filter-resolution-missing"},{flag:"--filter-metadata-missing"},...ie,{flag:"--dry-run"},{flag:"--rollback"},{flag:"--no-checkpoint"},{short:"-t",flag:"--title"},{short:"-d",flag:"--description"},{short:"-b",flag:"--body"},...ue,{flag:"--definition-of-ready"},{flag:"--definition_of_ready"},{flag:"--order"},{flag:"--rank"},{flag:"--goal"},{flag:"--objective"},{flag:"--value"},{flag:"--impact"},{flag:"--outcome"},{flag:"--why-now"},{flag:"--why_now"},{flag:"--reviewer"},{flag:"--risk"},{flag:"--confidence"},{flag:"--sprint"},{flag:"--release"},{flag:"--reporter"},{flag:"--severity"},{flag:"--environment"},{flag:"--repro-steps"},{flag:"--repro_steps"},{flag:"--resolution"},{flag:"--expected-result"},{flag:"--expected_result"},{flag:"--expected"},{flag:"--actual-result"},{flag:"--actual_result"},{flag:"--actual"},{flag:"--affected-version"},{flag:"--affected_version"},{flag:"--fixed-version"},{flag:"--fixed_version"},{flag:"--component"},{flag:"--regression"},{flag:"--customer-impact"},{flag:"--customer_impact"},{flag:"--allow-unresolved-deps"},{flag:"--dep"},{flag:"--dep-remove"},{flag:"--dep_remove"},{flag:"--replace-deps"},{flag:"--replace-tests"},{flag:"--replace-files"},{flag:"--replace-docs"},{flag:"--comment"},{flag:"--note"},{flag:"--learning"},{flag:"--file"},{flag:"--test"},{flag:"--doc"},{flag:"--reminder"},{flag:"--event"},{flag:"--type-option"},{flag:"--type_option"},{flag:"--unset",repeatable:!0},{flag:"--clear-deps"},{flag:"--clear-comments"},{flag:"--clear-notes"},{flag:"--clear-learnings"},{flag:"--clear-files"},{flag:"--clear-tests"},{flag:"--clear-docs"},{flag:"--clear-reminders"},{flag:"--clear-events"},{flag:"--clear-type-options"},{flag:"--author"},{flag:"--message"},{flag:"--force"}],ae=[{flag:"--view"},{flag:"--date"},{flag:"--from"},{flag:"--to"},{flag:"--past"},{flag:"--full-period"},{flag:"--full_period"},{flag:"--type"},{flag:"--tag"},{flag:"--priority"},{flag:"--status"},{flag:"--assignee"},{flag:"--assignee-filter"},{flag:"--assignee_filter"},{flag:"--sprint"},{flag:"--release"},{flag:"--include"},{flag:"--recurrence-lookahead-days"},{flag:"--recurrence-lookback-days"},{flag:"--occurrence-limit"},{flag:"--limit"},{flag:"--after",cursor_semantics:"presentation"},{flag:"--format"}],ja=[{flag:"--id"},{flag:"--op"},{flag:"--author"},{flag:"--from"},{flag:"--to"},{flag:"--limit"},{flag:"--after",cursor_semantics:"presentation"},{flag:"--unbounded"},{flag:"--compact"},{flag:"--raw"},{flag:"--full"},{flag:"--provenance"},{flag:"--provenance-summary"},{flag:"--harness",repeatable:!0},{flag:"--agent-instance",repeatable:!0},{flag:"--provenance-filter",repeatable:!0},{flag:"--stream"}],Ha=[{flag:"--verify"},{flag:"--since"},{flag:"--type",repeatable:!0},{flag:"--author",repeatable:!0},{flag:"--item",repeatable:!0},{flag:"--limit",value_type:"number"},{flag:"--cursor-mode",value_name:"batch|row"},{flag:"--full"},{flag:"--provenance"},{flag:"--provenance-summary"},{flag:"--harness",repeatable:!0},{flag:"--agent-instance",repeatable:!0},{flag:"--provenance-filter",repeatable:!0},{flag:"--follow"},{flag:"--interval-ms",value_type:"number"}],le=$([{flag:"--for",value_name:"intent"},{flag:"--date"},{flag:"--from"},{flag:"--to"},{flag:"--past"},{flag:"--type"},{flag:"--tag"},{flag:"--priority"},{flag:"--assignee"},{flag:"--assignee-filter"},{flag:"--assignee_filter"},{flag:"--sprint"},{flag:"--release"},{flag:"--parent"},{flag:"--limit",aliases:["--max-items"]},{flag:"--after"},{flag:"--format"},{flag:"--depth",values:U},{flag:"--fields",list:!0},{flag:"--section"},{flag:"--activity-limit"},{flag:"--stale-threshold"},{flag:"--explain-ranking"},{flag:"--explain_ranking"},{flag:"--token-budget",aliases:["--token_budget"]},{flag:"--no-extension-health"},{flag:"--no-tags"}],new Set(["--limit","--after","--format","--fields","--section","--activity-limit","--stale-threshold","--explain-ranking","--explain_ranking","--no-extension-health","--no-tags"])),za=[{flag:"--id",value_name:"item-id"},{flag:"--for",value_name:"intent"},{flag:"--token-budget",aliases:["--token_budget"]},{flag:"--depth",values:q},{flag:"--full",value_type:"boolean"},{flag:"--fields",list:!0},{flag:"--at"},{flag:"--tree"},{flag:"--tree-depth"},{flag:"--tree_depth"},{flag:"--format"}],Xa=[{flag:"--list"},{flag:"--format"},{flag:"--depth"}],qa=[{flag:"--id",value_name:"item-id"},{flag:"--format"},{flag:"--max-depth"},{flag:"--collapse"},{flag:"--summary"},{flag:"--full"},{flag:"--node-limit"},{flag:"--edge-limit"},{flag:"--token-budget"},{flag:"--cursor"},{flag:"--direction"},{flag:"--kind",list:!0}],Ya=[{flag:"--kind",list:!0},{flag:"--max-depth",description:`Maximum traversal depth; paths default to ${T.path_depth}.`},{flag:"--limit",description:`Maximum rows per collection; default ${T.rows}. Use --full to remove the row cap.`},{flag:"--after"},{flag:"--direction"},{flag:"--max-paths",description:`Maximum enumerated paths; default ${T.paths}.`},{flag:"--sample",description:`Maximum evidence examples per audit finding; default ${T.samples}.`},{flag:"--exempt-isolate",list:!0},{flag:"--exempt-isolate-type",list:!0},{flag:"--save-baseline"},{flag:"--rebuild"},{flag:"--clear"},{flag:"--summary"},{flag:"--full"}],Ba=[{flag:"--mode"},{flag:"--k"},{flag:"--fail-under"},{flag:"--queries"},{flag:"--format"}],_=[{flag:"--dry-run"},{flag:"--force"},{flag:"--author"},{flag:"--message"}],_e=[],Va=[{flag:"--include-decisions"},{flag:"--include-gates"},{flag:"--include-containers"},{flag:"--for",value_name:"intent"},{flag:"--type"},{flag:"--tag"},{flag:"--priority"},{flag:"--assignee"},{flag:"--assignee-filter"},{flag:"--assignee_filter"},{flag:"--sprint"},{flag:"--release"},{flag:"--parent"},{flag:"--limit"},{flag:"--blocked-limit"},{flag:"--blocked_limit"},{flag:"--ready-only"},{flag:"--ready_only"},{flag:"--format"},{flag:"--explain-ranking"},{flag:"--explain_ranking"},{flag:"--token-budget",aliases:["--token_budget"]}],Ka=$([{flag:"--for",value_name:"intent"},{flag:"--token-budget",aliases:["--token_budget"]},{flag:"--mode"},{flag:"--semantic"},{flag:"--hybrid"},{flag:"--match-mode"},{flag:"--min-score"},{flag:"--count"},{flag:"--semantic-weight"},{flag:"--include-linked"},{flag:"--title-exact"},{flag:"--phrase-exact"},{flag:"--highlight"},{flag:"--compact"},{flag:"--full"},{flag:"--fields",list:!0},{flag:"--format"},{flag:"--limit"},{flag:"--after"},{flag:"--status",list:!0},{flag:"--type",list:!0},{flag:"--tag",aliases:["--tags"],list:!0},{flag:"--priority",list:!0},{flag:"--deadline-before"},{flag:"--deadline-after"},{flag:"--updated-after"},{flag:"--updated-before"},{flag:"--created-after"},{flag:"--created-before"},{flag:"--assignee",list:!0},{flag:"--sprint",list:!0},{flag:"--release",list:!0},{flag:"--parent"},...se],new Set(["--highlight","--compact","--full","--fields","--format","--limit","--token-budget","--after"])),Wa=[{flag:"--action"},{flag:"--command"},{flag:"--summary"},{flag:"--schema-only"},{flag:"--flags-only"},{flag:"--availability-only"},{flag:"--runtime-only"},{flag:"--active-only"},{flag:"--full"}],Ja=[{flag:"--eager-tags"}];function Fl(e){let a=new Set,l=[];for(let t of e){let i=(t.aliases??[]).join(","),f=`${t.flag}|${t.short??""}|${i}`;a.has(f)||(a.add(f),l.push(t))}return l}function O(e,a=!1){let l=new Map;for(let t of[...D,...e]){let i=E(t.flag),f=l.get(i),{aliases:c,...p}=t,o=b([...c??[],...t.flag===i?[]:[t.flag]]).filter(u=>u!==i),d={...p,flag:i,...o.length>0?{aliases:o}:{}},r=b([...f?.aliases??[],...d.aliases??[]]);l.set(i,f===void 0?d:{...f,...d,...r.length>0?{aliases:r}:{}})}if(a&&e.length>0&&!l.has("--format")){let t=l.get("--output-format");l.set("--output-format",{...t,aliases:[...t.aliases??[],"--format"]})}return M([...l.values()])}var Za=["list-draft","list-open","list-in-progress","list-blocked","list-closed","list-canceled"],Qa=P.filter(e=>e.flag!=="--status"&&e.flag!=="--all");function x(e){let a=new Map;for(let l of e)for(let t of[l.flag,...l.aliases??[]]){let i=a.get(t)??[];i.push(l),a.set(t,i)}return a}var el=x(ne),al=x(pe),ll=new Map([["assurance",al],["plan",el],["workspace",x(_e)],["workspace snapshot",x(_)]]);function tl(e=h){return e.map(({command:a,parent:l,accepted_flags:t})=>{let i=ll.get(l);if(!i)throw new Error(`Positional action ${a} has no flag-contract index for ${l}.`);let f=t.map(c=>{let p=i.get(c)??[];if(p.length!==1)throw new Error(`Positional action ${a} accepted flag ${c} does not resolve to exactly one ${l} flag contract.`);return p[0]});return[a,f]})}var sl=tl(),ve=new Map([["list",P],["list-all",P],...Za.map(e=>[e,Qa]),["templates",ee],["cal",ae],["ctx",le],["test-runs-worker",[]],["init",Ze],["config",Qe],["extension",oe],["package",Z],["packages",Z],["install",da],["upgrade",ge],["create",ee],["item",[]],["item mutate",Fa],["item complete",Ga],["item reopen",Pa],["copy",Ma],["focus",Da],["aggregate",Me],["calendar",ae],["context",le],["get",za],["guide",Xa],["search",Ka],["next",Va],["eval",Ba],["workspace",_],["workspace position",_e],["workspace snapshot",_],["workspace snapshot create",_],["workspace snapshot list",_],["workspace snapshot inspect",_],["workspace snapshot restore",_],["workspace snapshot delete",_],["history",ze],["history-redact",qe],["history-repair",Ye],["history-author-acknowledge",Be],["history-compact",Ve],["history-attest",Ke],["merge",Xe],["schema",We],["profile",Je],["plan",ne],["activity",ja],["events",Ha],["restore",ha],["update",$a],["update-many",Ua],["close",ma],["close-many",ua],["delete",Ta],["append",_a],["comments",De],["notes",$e],["learnings",Ue],["files",je],["docs",He],["deps",qa],["graph",Ya],["test",Na],["test-all",wa],["telemetry",Oa],["health",Ra],["assurance",pe],...sl,["validate",Ia],["gc",Ea],["stats",xa],["duplicates",La],["contracts",Wa],["completion",Ja],["claim",va],["release",ya],["start-task",Aa],["pause-task",ka],["close-task",ba],["meet",ce],["event",Ca],["remind",Sa]]),he=new Map([["install",aa],["uninstall",la],["explore",ta],["manage",ga],["describe",sa],["reload",fa],["doctor",ca],["catalog",Q],["list",Q],["adopt",pa],["adopt-all",ia],["activate",na],["deactivate",oa],["migrate",ra]]);function Te(e){return typeof e!="string"?"":C(e.trim().toLowerCase())}function te(e){let a=Te(e);if(ve.has(a))return!0;let[l,t,...i]=a.split(/\s+/);return(l==="extension"||l==="package"||l==="packages")&&t!==void 0&&i.length===0&&(t==="init"||t==="scaffold"||he.has(t))}function il(e,a){return a==="init"||a==="scaffold"?e==="extension"?re:ea:he.get(a)??[]}function Gl(e){let a=Te(e);if(a.length===0)return O([]);let[l,t,...i]=a.split(/\s+/);if((l==="extension"||l==="package"||l==="packages")&&t!==void 0&&i.length===0)return(l==="package"||l==="packages")&&t==="upgrade"?O(ge,!0):O(il(l,t),te(a));let f=ve.get(a)??[];return O(f,te(a))}function Pl(e,a=!0){let l=M(e).flatMap(i=>[i.short,i.flag,...i.aliases??[]]).filter(i=>!!i),t=a?[...l,...D.flatMap(i=>[i.short,i.flag,...i.aliases??[]]).filter(i=>!!i)]:l;return b(t).join(" ")}export{b as a,ol as b,rl as c,gl as d,Ae as e,fl as f,ke as g,q as h,Y as i,cl as j,pl as k,dl as l,G as m,Oe as n,h as o,_l as p,Re as q,vl as r,w as s,F as t,N as u,K as v,Ie as w,S as x,hl as y,Tl as z,M as A,El as B,D as C,xl as D,Ll as E,P as F,Me as G,De as H,$e as I,Ue as J,je as K,He as L,ze as M,Xe as N,qe as O,Ye as P,Be as Q,Ve as R,Ke as S,We as T,Je as U,ne as V,Ze as W,Qe as X,oe as Y,m as Z,re as _,Z as $,ea as aa,aa as ba,la as ca,ta as da,sa as ea,ia as fa,na as ga,oa as ha,ra as ia,ga as ja,fa as ka,ca as la,Q as ma,pa as na,da as oa,ge as pa,Rl as qa,ma as ra,ua as sa,_a as ta,va as ua,ha as va,Ta as wa,ya as xa,Aa as ya,ka as za,ba as Aa,ce as Ba,Ca,Sa as Da,Na as Ea,wa as Fa,Oa as Ga,Il as Ha,Ea as Ia,xa as Ja,La as Ka,Ra as La,Ia as Ma,pe as Na,ee as Oa,Fa as Pa,Ga as Qa,Pa as Ra,Ma as Sa,Da as Ta,$a as Ua,Ua as Va,ae as Wa,ja as Xa,Ha as Ya,le as Za,za as _a,Xa as $a,qa as ab,Ya as bb,Ba as cb,_ as db,Va as eb,Ka as fb,Wa as gb,Ja as hb,Fl as ib,tl as jb,sl as kb,te as lb,Gl as mb,Pl as nb};
2
+ //# sourceMappingURL=chunk-BEHIMEV2.js.map
@@ -0,0 +1,2 @@
1
+ import{ca as l}from"./chunk-KRNF3WTC.js";import{mb as r}from"./chunk-BEHIMEV2.js";import{K as S,L as N,N as E}from"./chunk-J7ESCE7M.js";import{ub as n}from"./chunk-3WVMEA2A.js";(function(){try{var T=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new T.Error().stack;e&&(T._sentryDebugIds=T._sentryDebugIds||{},T._sentryDebugIds[e]="c162c9b5-2566-5a1b-ae26-dafa8b206b27")}catch{}})();var u=new Set(["--author","--expect-hash","--follow","--help","--lean","--token-accounting","--output-include","--output-limit","--output-budget","--output-format","--output-session","--output-cursor","--output-row-contract","--no-changed-fields","--no-extensions","--no-pager","--pm-path","--profile","--quiet","--interval-ms"]),p=new Set([...S,...N]),I=new Set(["--brief","--format","--full","--full-changed-fields","--id-only","--no-truncate","--stream"]),d=new Set(["--body-file","--file","--stdin-json"]),m=new Set(["--global","--local","--project"]),P=new Set(["--activity-limit","--default-depth","--section-activity","--section-blockers","--section-files","--section-hierarchy","--section-progress","--section-staleness","--section-tests","--section-workload","--stale-threshold-days"]),f=new Set(["action","fullChangedFields","idOnly","path","pmExecutable","timeoutMs"]),M=new Set(["configAction","id","name","query","reason","subcommand","target","text"]),G={assurance:{id:"<id>",kind:"<kind>",preset:"[kind]|[id]",subcommand:"<action>"},event:{title:"<title>"},files:{lookupPath:"lookup <path...>"},meet:{title:"<title>"},"item-reopen":{id:"<id>",reason:"<reason>"},merge:{subcommand:"<subcommand>"},remind:{title:"<title>"},workspace:{name:"<name>",subcommand:"snapshot",snapshotAction:"<snapshot-action>",target:"<target>"}},F={append:{"--text":"body"},assurance:{"--tree":"treeId","--owner":"owner","--apply":"apply","--enforcement":"enforcement"},init:{"--id-prefix":"idPrefix","--no-merge-fence":"mergeFence","--workspace":"workspace"},create:{"--no-inherit-focus":"inheritFocus","--ac":"acceptanceCriteria","--estimated-minutes":"estimate","--file":"linkedFile","--test":"linkedTest","--expected":"expectedResult","--actual":"actualResult"},plan:{"--no-inherit-focus":"inheritFocus"},update:{"--ac":"acceptanceCriteria","--estimated-minutes":"estimate","--file":"linkedFile","--test":"linkedTest","--expected":"expectedResult","--actual":"actualResult"},"update-many":{"--ac":"acceptanceCriteria","--estimated-minutes":"estimate","--file":"linkedFile","--test":"linkedTest","--expected":"expectedResult","--actual":"actualResult"},files:{"--note":"addNote","--note-conflict":"noteConflict","--full-history":"full"},docs:{"--note":"addNote","--note-conflict":"noteConflict","--full-history":"full"},test:{"--full-history":"full"},comments:{"--full-history":"full"},notes:{"--file":"text","--full-history":"full"},learnings:{"--file":"text","--full-history":"full"},gc:{"--scope":"gcScope"},contracts:{"--action":"contractAction"},schema:{"--no-allow-unset":"allowUnset","--type":"fieldTypeScope"},"history-author-acknowledge":{"--event":"historyEvent","--all-actionable":"allActionable"},"extension-init":{"--capability":"capability"},"package-init":{"--capability":"capability"},"extension-install":{"--gh":"github"},"package-install":{"--gh":"github"},"extension-adopt":{"--gh":"github"},"package-adopt":{"--gh":"github"},extension:{"--gh":"github","--scaffold":"init"},package:{"--gh":"github","--scaffold":"init"},install:{"--gh":"github"}},D={"--pm-path":"path"},c={stats:{"--analytics":["measurements","metric","measurementLimit","observe","improvementDirection","measurementSource","measurementItem","measurementRevision","author","message","provenanceCoverage","fleetAttribution","since","eventLimit","minimumSample"]}};function h(T){return T.startsWith("extension-")?`extension ${T.slice(10)}`:T.startsWith("package-")?`package ${T.slice(8)}`:T.startsWith("item-")?`item ${T.slice(5)}`:T}function R(T,e){let t=F[T]?.[e]??D[e];return t!==void 0?t:e.replace(/^--/,"").replaceAll("_","-").replace(/-([a-z])/g,(i,_)=>_.toUpperCase())}function g(T){let e=new Set;return T.filter(({flag:t})=>!t.startsWith("--")||e.has(t)?!1:(e.add(t),!0))}function y(T,e){return e.find(({aliases:t})=>t?.includes(T))?.flag}function b(T,e,t,i){let _=c[T]?.[e.flag];if(_!==void 0&&_.every(A=>i.has(A)))return{surface:"cli",input:e.flag,counterpart:_[0],disposition:"shared",reason:"The validated CLI JSON object fans out across strict SDK parameters."};let O=R(T,e.flag);if(i.has(O))return{surface:"cli",input:e.flag,counterpart:O,disposition:"shared",reason:"The CLI flag maps directly to a strict SDK action parameter."};let C=y(e.flag,t);if(C!==void 0){let A=R(T,C);if(i.has(A))return{surface:"cli",input:e.flag,counterpart:A,disposition:"compatibility_alias",reason:`Compatibility spelling for ${C}.`}}return u.has(e.flag)?{surface:"cli",input:e.flag,disposition:"cli_transport",reason:"CLI process transport is supplied by the in-process SDK host."}:I.has(e.flag)?{surface:"cli",input:e.flag,disposition:"cli_presentation",reason:"CLI rendering or mutation projection does not alter the SDK result envelope."}:d.has(e.flag)?{surface:"cli",input:e.flag,disposition:"cli_adapter",reason:"Local file or stdin adaptation is a CLI boundary concern."}:P.has(e.flag)?{surface:"cli",input:e.flag,counterpart:"key",disposition:"compatibility_alias",reason:"CLI config shorthand normalizes to the SDK configAction/key/value contract."}:m.has(e.flag)?{surface:"cli",input:e.flag,counterpart:"scope",disposition:"cli_scope_selector",reason:"Mutually exclusive CLI scope switches normalize to the SDK scope parameter."}:{surface:"cli",input:e.flag,counterpart:O,disposition:"unclassified",reason:"The CLI flag has no strict SDK parameter or approved boundary classification."}}function U(T,e,t){let i=Object.entries(c[T]??{}).find(([C,A])=>A.includes(e)&&t.some(({input:a,disposition:s})=>a===C&&s==="shared"));if(i!==void 0)return{surface:"sdk",input:e,counterpart:i[0],disposition:"shared",reason:"The strict SDK parameter is reachable through the validated CLI JSON object."};let _=t.find(({counterpart:C,disposition:A})=>C===e&&(A==="shared"||A==="compatibility_alias"||A==="cli_scope_selector"));if(_!==void 0)return{surface:"sdk",input:e,counterpart:_.input,disposition:"shared",reason:"The strict SDK parameter is reachable from the CLI contract."};let O=G[T]?.[e];return O!==void 0?{surface:"sdk",input:e,counterpart:O,disposition:"shared",reason:"The strict SDK parameter maps to a canonical CLI positional argument."}:f.has(e)?{surface:"sdk",input:e,disposition:"sdk_transport",reason:"The SDK host supplies in-process transport and workspace selection."}:M.has(e)?{surface:"sdk",input:e,disposition:"cli_positional",reason:"The CLI accepts this SDK parameter as a positional command argument."}:{surface:"sdk",input:e,disposition:"sdk_native",reason:"The typed SDK exposes this structured input without a canonical CLI long flag."}}function v(T={}){let e=T.actions??n,t=T.resolveFlags??r,i=T.resolveParameters??l;return e.map(_=>{let O=h(_),C=g(t(O)).filter(({flag:o})=>E(_)!==void 0||!p.has(o)),A=new Set(i(_)??[]),a=C.map(o=>b(_,o,C,A)),s=[...A].sort((o,L)=>o.localeCompare(L)).map(o=>U(_,o,a));return{action:_,command:O,cli:a,sdk:s,unclassified:[...a,...s].filter(({disposition:o})=>o==="unclassified")}})}(function(){try{var T=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new T.Error().stack;e&&(T._sentryDebugIds=T._sentryDebugIds||{},T._sentryDebugIds[e]="62489699-d1d6-505e-8a23-53922081c6e7")}catch{}})();export{v as a};
2
+ //# sourceMappingURL=chunk-CZFZCSOX.js.map
@@ -1,8 +1,8 @@
1
- import{b as K}from"./chunk-IDAYTYNN.js";import{Bb as V,qb as H,va as U,vb as P,xb as L}from"./chunk-32QYILXW.js";import{Zd as W,_ as G,me as $,ra as B,xa as E}from"./chunk-HRLGC3P7.js";import{a as X,b as y,c as q}from"./chunk-FOA7XKWP.js";import{A as v,C as S,E as j,F,I as N,z as w}from"./chunk-G6ERMFJ5.js";import{access as le,readFile as A,realpath as _}from"node:fs/promises";import{constants as ue}from"node:fs";import{execFile as me}from"node:child_process";import c from"node:path";import{promisify as de}from"node:util";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="6d1f8e03-97b4-5d83-b85c-e47f39c07d48")}catch{}})();var se="PM_SOURCE_CONTEXT_ACCESS",ce="PM_ALLOW_SOURCE_CONTEXT_WRITES";function z(e){let r=e[se],i=r===void 0||r.trim().toLowerCase()==="write"?"write":"read_only",t=i==="read_only"&&e[ce]?.trim()==="1";return{access:i,write_override_applied:t,source_writes_allowed:i==="write"||t}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="b1828465-0619-514c-8956-2a81dea9efbc")}catch{}})();var k=de(me),T="# pm-cli:merge-drivers:start",pe="# pm-cli:merge-drivers:end",x="# pm-cli:merge-drivers:v2:start",Q="# pm-cli:merge-drivers:v2:end",fe="merge-fence",ge="merge-attributes";function R(e){return`'${e.replaceAll("'",`'"'"'`)}'`}async function he(e,r){let i=await _(e);if(/(?:^|[\\/])bun-node-[^\\/]+[\\/]bun(?:\.exe)?$/iu.test(i))return;let{stdout:t}=await k(e,["--version"],{encoding:"utf8",windowsHide:!0,timeout:1e4});return t.trim()===r?i:void 0}async function ye(){let e=G(import.meta.url,["../../.."]),r=process.execPath,i=!1,t=await _(process.execPath),o=process.versions.bun,n=(process.env.PATH??"").split(c.delimiter).filter(a=>c.isAbsolute(a)).map(a=>c.join(a,o===void 0?c.basename(process.execPath):process.platform==="win32"?"bun.exe":"bun")),s=o===void 0?n:[process.env.npm_execpath??"",...n,t].filter(a=>c.isAbsolute(a)&&/^(?:bun|bun\.exe)$/iu.test(c.basename(a)));for(let a of s)try{if(await le(a,ue.X_OK),o!==void 0){let d=await he(a,o);if(d!==void 0){r=d,i=!0;break}continue}if(a!==t&&await _(a)===t){r=a;break}}catch{}if(o!==void 0&&!i)throw new v("Cannot install Bun merge drivers without a durable executable matching the current Bun version.",w.DEPENDENCY_FAILED,{code:"merge_bun_launcher_unavailable",why:"The current Bun process may be a temporary bunx launcher that Git cannot reuse after this command exits.",nextSteps:["Run with a durable version-matched Bun executable, expose one on an absolute PATH entry, or invoke pm through a Bun runner that publishes an absolute npm_execpath.","Retry pm merge install, then check pm health --strict-exit before merging branches."]});return`${R(r)} ${R(c.join(e,"dist","cli.js"))}`}var Z=[{key:"pm-item-toon",name:"pm field-aware TOON item document merge",artifact:"item",itemPath:"%P"},{key:"pm-item-markdown",name:"pm field-aware JSON-markdown item document merge",artifact:"item",itemPath:"%P"},{key:"pm-history",name:"pm append-only history stream merge",artifact:"history",itemPath:void 0},{key:"pm-relationship",name:"pm append-only relationship event store merge",artifact:"relationship",itemPath:void 0},{key:"pm-json",name:"pm key-level JSON config merge",artifact:"json",itemPath:void 0}];function we(e){let r=e.explicitPath?.trim(),i=e.environment.PM_SOURCE_WORKSPACE_ROOT?.trim(),t=e.environment.PM_SOURCE_PM_PATH?.trim(),o=z(e.environment),n=!!(i&&t),s=r===void 0&&n&&(e.dryRun||o.source_writes_allowed);if(r!==void 0){let a=E(e.cwd,r);return{pm_root:a,workspace_start:a,source_coordinates_available:n,source_context_selected:!1,source_policy:o}}return s?{pm_root:c.resolve(t),workspace_start:c.resolve(i),source_coordinates_available:!0,source_context_selected:!0,source_policy:o}:{pm_root:n?E(e.cwd,".agents/pm"):E(e.cwd),workspace_start:e.cwd,source_coordinates_available:n,source_context_selected:!1,source_policy:o}}async function ee(e){try{let{stdout:r}=await k("git",["rev-parse","--show-toplevel"],{cwd:e,env:y(),encoding:"utf8",windowsHide:!0,timeout:1e4});return await _(r.trim())}catch{return null}}async function te(e){let r=await ee(e);if(r===null)throw new v("pm merge install requires a git repository (merge drivers are git configuration).",w.USAGE);return r}function I(e,r){return c.relative(e,r).split(c.sep).join("/")}function J(e){return e.replace(/[\\*?[\]!]/gu,"\\$&")}function h(e){return`"${e.replaceAll("\\","\\\\").replaceAll('"','\\"')}"`}function Y(e,r){if(e[r]!=="'")return null;let i="";for(let t=r+1;t<e.length;t+=1){if(e.startsWith(`'"'"'`,t)){i+="'",t+=4;continue}if(e[t]==="'")return{value:i,nextOffset:t+1};i+=e[t]}return null}async function ve(e,r,i){if(L(r).filter(o=>o.constraint==="exact").some(o=>o.version!==i))return!1;let t=await ee(e);if(t!==null&&t!==await _(r)){let o=await Promise.all([t,r].map(async n=>{let s=await k("git",["rev-parse","--path-format=absolute","--git-common-dir"],{cwd:n,env:y(),timeout:1e4});return _(s.stdout.trim())}));if(o[0]===o[1])return!1}return!0}async function _e(e,r,i){let t=Y(e,0);if(t===null||e[t.nextOffset]!==" ")return!1;let o=Y(e,t.nextOffset+1);if(o===null||e.slice(o.nextOffset)!==r||!/^(?:node|bun)(?:\.exe)?$/iu.test(c.basename(t.value))||c.basename(o.value)!=="cli.js"||c.basename(c.dirname(o.value))!=="dist"||!await S(t.value)||!await S(o.value))return!1;try{let n=c.dirname(c.dirname(o.value)),s=JSON.parse(await A(c.join(n,"package.json"),"utf8")),a=typeof s.bin=="string"?s.bin:s.bin?.pm;return await ve(n,i,s.version)?s.name==="@unbrained/pm-cli"&&a==="dist/cli.js":!1}catch{return!1}}function O(e,r){let i=e.length>0?`${J(e)}/`:"",t=[`${h(`${i}**/*.toon`)} merge=pm-item-toon`,`${h(`${i}**/*.md`)} merge=pm-item-markdown`];for(let o of r){let n=J(o);t.push(`${h(`${i}${n}/*.toon`)} merge=pm-item-toon`),t.push(`${h(`${i}${n}/*.md`)} merge=pm-item-markdown`)}return t.push(`${h(`${i}**/*.jsonl`)} merge=pm-relationship`),t.push(`${h(`${i}history/*.jsonl`)} merge=pm-history`),t.push(`${h(`${i}settings.json`)} merge=pm-json`),t.push(`${h(`${i}**/*.json`)} merge=pm-json`),t.push(`${h(`${i}extensions/**`)} merge=text`),t.push(`${h(`${i}extensions/.managed-extensions.json`)} merge=pm-json`),t}function re(e){let r=[],i=0;for(;i<e.length;){let t=e.indexOf(T,i),o=e.indexOf(x,i),n=t===-1?o:o===-1?t:Math.min(t,o);if(n===-1)break;let s=n===o,a=s?x:T,d=s?Q:pe,u=e.indexOf(d,n+a.length),m=u===-1?e.length:u+d.length;r.push({start:n,end:m,closed:u!==-1,lines:e.slice(n+a.length,u===-1?m:u).split(`
1
+ import{b as K}from"./chunk-7SEPCQV2.js";import{Ya as H,bb as P,db as L,hb as V}from"./chunk-5WQ3LNUK.js";import{F as U}from"./chunk-HPC2M6JD.js";import{$ as G,Jc as $,sa as B,uc as W,za as E}from"./chunk-3WVMEA2A.js";import{a as X,b as y,c as q}from"./chunk-FOA7XKWP.js";import{A as v,C as S,E as j,F,I as N,z as w}from"./chunk-PDXSMSO5.js";import{access as le,readFile as A,realpath as _}from"node:fs/promises";import{constants as ue}from"node:fs";import{execFile as me}from"node:child_process";import c from"node:path";import{promisify as de}from"node:util";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="6d1f8e03-97b4-5d83-b85c-e47f39c07d48")}catch{}})();var se="PM_SOURCE_CONTEXT_ACCESS",ce="PM_ALLOW_SOURCE_CONTEXT_WRITES";function z(e){let r=e[se],i=r===void 0||r.trim().toLowerCase()==="write"?"write":"read_only",t=i==="read_only"&&e[ce]?.trim()==="1";return{access:i,write_override_applied:t,source_writes_allowed:i==="write"||t}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="b1828465-0619-514c-8956-2a81dea9efbc")}catch{}})();var k=de(me),T="# pm-cli:merge-drivers:start",pe="# pm-cli:merge-drivers:end",x="# pm-cli:merge-drivers:v2:start",Q="# pm-cli:merge-drivers:v2:end",fe="merge-fence",ge="merge-attributes";function R(e){return`'${e.replaceAll("'",`'"'"'`)}'`}async function he(e,r){let i=await _(e);if(/(?:^|[\\/])bun-node-[^\\/]+[\\/]bun(?:\.exe)?$/iu.test(i))return;let{stdout:t}=await k(e,["--version"],{encoding:"utf8",windowsHide:!0,timeout:1e4});return t.trim()===r?i:void 0}async function ye(){let e=G(import.meta.url,["../../.."]),r=process.execPath,i=!1,t=await _(process.execPath),o=process.versions.bun,n=(process.env.PATH??"").split(c.delimiter).filter(a=>c.isAbsolute(a)).map(a=>c.join(a,o===void 0?c.basename(process.execPath):process.platform==="win32"?"bun.exe":"bun")),s=o===void 0?n:[process.env.npm_execpath??"",...n,t].filter(a=>c.isAbsolute(a)&&/^(?:bun|bun\.exe)$/iu.test(c.basename(a)));for(let a of s)try{if(await le(a,ue.X_OK),o!==void 0){let d=await he(a,o);if(d!==void 0){r=d,i=!0;break}continue}if(a!==t&&await _(a)===t){r=a;break}}catch{}if(o!==void 0&&!i)throw new v("Cannot install Bun merge drivers without a durable executable matching the current Bun version.",w.DEPENDENCY_FAILED,{code:"merge_bun_launcher_unavailable",why:"The current Bun process may be a temporary bunx launcher that Git cannot reuse after this command exits.",nextSteps:["Run with a durable version-matched Bun executable, expose one on an absolute PATH entry, or invoke pm through a Bun runner that publishes an absolute npm_execpath.","Retry pm merge install, then check pm health --strict-exit before merging branches."]});return`${R(r)} ${R(c.join(e,"dist","cli.js"))}`}var Z=[{key:"pm-item-toon",name:"pm field-aware TOON item document merge",artifact:"item",itemPath:"%P"},{key:"pm-item-markdown",name:"pm field-aware JSON-markdown item document merge",artifact:"item",itemPath:"%P"},{key:"pm-history",name:"pm append-only history stream merge",artifact:"history",itemPath:void 0},{key:"pm-relationship",name:"pm append-only relationship event store merge",artifact:"relationship",itemPath:void 0},{key:"pm-json",name:"pm key-level JSON config merge",artifact:"json",itemPath:void 0}];function we(e){let r=e.explicitPath?.trim(),i=e.environment.PM_SOURCE_WORKSPACE_ROOT?.trim(),t=e.environment.PM_SOURCE_PM_PATH?.trim(),o=z(e.environment),n=!!(i&&t),s=r===void 0&&n&&(e.dryRun||o.source_writes_allowed);if(r!==void 0){let a=E(e.cwd,r);return{pm_root:a,workspace_start:a,source_coordinates_available:n,source_context_selected:!1,source_policy:o}}return s?{pm_root:c.resolve(t),workspace_start:c.resolve(i),source_coordinates_available:!0,source_context_selected:!0,source_policy:o}:{pm_root:n?E(e.cwd,".agents/pm"):E(e.cwd),workspace_start:e.cwd,source_coordinates_available:n,source_context_selected:!1,source_policy:o}}async function ee(e){try{let{stdout:r}=await k("git",["rev-parse","--show-toplevel"],{cwd:e,env:y(),encoding:"utf8",windowsHide:!0,timeout:1e4});return await _(r.trim())}catch{return null}}async function te(e){let r=await ee(e);if(r===null)throw new v("pm merge install requires a git repository (merge drivers are git configuration).",w.USAGE);return r}function I(e,r){return c.relative(e,r).split(c.sep).join("/")}function J(e){return e.replace(/[\\*?[\]!]/gu,"\\$&")}function h(e){return`"${e.replaceAll("\\","\\\\").replaceAll('"','\\"')}"`}function Y(e,r){if(e[r]!=="'")return null;let i="";for(let t=r+1;t<e.length;t+=1){if(e.startsWith(`'"'"'`,t)){i+="'",t+=4;continue}if(e[t]==="'")return{value:i,nextOffset:t+1};i+=e[t]}return null}async function ve(e,r,i){if(L(r).filter(o=>o.constraint==="exact").some(o=>o.version!==i))return!1;let t=await ee(e);if(t!==null&&t!==await _(r)){let o=await Promise.all([t,r].map(async n=>{let s=await k("git",["rev-parse","--path-format=absolute","--git-common-dir"],{cwd:n,env:y(),timeout:1e4});return _(s.stdout.trim())}));if(o[0]===o[1])return!1}return!0}async function _e(e,r,i){let t=Y(e,0);if(t===null||e[t.nextOffset]!==" ")return!1;let o=Y(e,t.nextOffset+1);if(o===null||e.slice(o.nextOffset)!==r||!/^(?:node|bun)(?:\.exe)?$/iu.test(c.basename(t.value))||c.basename(o.value)!=="cli.js"||c.basename(c.dirname(o.value))!=="dist"||!await S(t.value)||!await S(o.value))return!1;try{let n=c.dirname(c.dirname(o.value)),s=JSON.parse(await A(c.join(n,"package.json"),"utf8")),a=typeof s.bin=="string"?s.bin:s.bin?.pm;return await ve(n,i,s.version)?s.name==="@unbrained/pm-cli"&&a==="dist/cli.js":!1}catch{return!1}}function O(e,r){let i=e.length>0?`${J(e)}/`:"",t=[`${h(`${i}**/*.toon`)} merge=pm-item-toon`,`${h(`${i}**/*.md`)} merge=pm-item-markdown`];for(let o of r){let n=J(o);t.push(`${h(`${i}${n}/*.toon`)} merge=pm-item-toon`),t.push(`${h(`${i}${n}/*.md`)} merge=pm-item-markdown`)}return t.push(`${h(`${i}**/*.jsonl`)} merge=pm-relationship`),t.push(`${h(`${i}history/*.jsonl`)} merge=pm-history`),t.push(`${h(`${i}settings.json`)} merge=pm-json`),t.push(`${h(`${i}**/*.json`)} merge=pm-json`),t.push(`${h(`${i}extensions/**`)} merge=text`),t.push(`${h(`${i}extensions/.managed-extensions.json`)} merge=pm-json`),t}function re(e){let r=[],i=0;for(;i<e.length;){let t=e.indexOf(T,i),o=e.indexOf(x,i),n=t===-1?o:o===-1?t:Math.min(t,o);if(n===-1)break;let s=n===o,a=s?x:T,d=s?Q:pe,u=e.indexOf(d,n+a.length),m=u===-1?e.length:u+d.length;r.push({start:n,end:m,closed:u!==-1,lines:e.slice(n+a.length,u===-1?m:u).split(`
2
2
  `).map(l=>l.trim()).filter(Boolean)}),i=m}return r}function ie(e,r,i){let t=new Set(r),o=h(i.length>0?`${i}/`:"").slice(0,-1);return e.some(n=>t.has(n)||n.startsWith(o)&&/^[^/]+\/\*\.(?:toon|md)" merge=pm-item-(?:toon|markdown)$/u.test(n.slice(o.length)))}async function ne(e,r,i,t){let o=c.join(e,".gitattributes"),n=t?null:(await k("git",["rev-parse","--absolute-git-dir"],{cwd:e,env:y(),encoding:"utf8",windowsHide:!0,timeout:1e4})).stdout.trim(),s=n===null?null:await $(n,ge,120,"merge-fence",!1,!0,5e3);try{let a=await F(o)??"",d=[x,...i,Q].join(`
3
3
  `),u=re(a),m=u.filter(p=>ie(p.lines,i,r));m.length===0&&r===".agents/pm"&&u.length===1&&u[0].lines.every(p=>!p.includes("/"))&&m.push(u[0]);let l;if(m.length>0){let p=m[0];l=a;for(let b of m.slice(1).reverse())l=`${l.slice(0,b.start)}${l.slice(b.end)}`;l=`${l.slice(0,p.start)}${d}${l.slice(p.end)}`}else{let p=a.trimEnd();l=`${p.length>0?`${p}
4
4
 
5
5
  `:""}${d}
6
6
  `}return l===a?{path:o,changed:!1}:(t||await N(o,l),{path:o,changed:!0})}finally{await s?.()}}function oe(e){let r=B(e,null);return[...new Set(Object.values(r.type_to_folder))].sort((i,t)=>i.localeCompare(t))}async function qe(e,r){let i=c.resolve(e),t=null,o="",n=i;for(let g=0;g<8;g+=1){let ae=c.join(n,".gitattributes");try{let C=await A(ae,"utf8");if(C.includes(x)||C.includes(T)){t=n,o=C;break}}catch{}let D=c.dirname(n);if(D===n)break;n=D}if(t===null)return{status:"not_installed",missing_patterns:[],stale_patterns:[],schema_scope:"project"};let s=c.join(t,".gitattributes"),a=I(t,i),d=re(o),u=O(a,r),m=d.filter(g=>ie(g.lines,u,a)),l=m.flatMap(g=>g.closed?g.lines:[]),p=new Set(l),b=new Set(u),f=u.filter(g=>!p.has(g)),M=l.filter(g=>!b.has(g));return{status:m.length!==1||!m[0].closed||f.length>0||M.length>0?"drift":"ok",path:s,missing_patterns:f,stale_patterns:M,schema_scope:"project"}}async function ze(e){let r=[],i=[];for(let t of Z){let o=`merge.${t.key}.driver`,n=` merge driver ${t.artifact} "%O" "%A" "%B"${t.itemPath===void 0?"":` --item-path ${t.itemPath}`}`;try{let{stdout:s}=await k("git",["config","--get",o],{cwd:e,env:y(),encoding:"utf8",windowsHide:!0,timeout:1e4}),a=s.trim();await _e(a,n,e)||i.push(o)}catch{r.push(o)}}return{status:r.length>0?"missing":i.length>0?"drift":"ok",missing_keys:r,drifted_keys:i}}async function Je(e){let r;try{r=await te(c.resolve(e))}catch{return{status:"no_git"}}let i=I(r,c.resolve(e)),t=await P(e),o=U(void 0,t.author_default),n=await $(e,fe,t.locks.ttl_seconds,o,!1,H(t).force_required_for_stale_lock,t.locks.wait_ms);try{let s=c.join(r,".gitattributes"),a;try{a=await A(s,"utf8")}catch(l){if(l instanceof Error&&"code"in l&&j(l))return{status:"not_installed",path:s};throw l}if(!a.includes(x)&&!a.includes(T))return{status:"not_installed",path:s};let d=await P(e),u=oe(d),m=await ne(r,i,O(i,u),!1);return{status:m.changed?"refreshed":"unchanged",path:m.path}}finally{await n()}}async function Ye(e,r){let i=we({cwd:process.cwd(),explicitPath:r.path,dryRun:e.dryRun===!0,environment:process.env}),t=i.pm_root;await V(t);let o=await te(i.workspace_start);return ke({pmRoot:t,workspaceRoot:o,dryRun:e.dryRun===!0,preCommitHook:e.preCommitHook===!0})}async function be(e,r){let i=(await k("git",["rev-parse","--path-format=absolute","--git-common-dir"],{cwd:e,env:y(),timeout:1e4})).stdout.trim(),t=await $(i,"merge-driver-config",120,"merge-install",!1,!0,5e3);try{let o=await q(e),n;try{n=(await k("git",["config",o,"--null","--get-regexp","."],{cwd:e,env:y(),timeout:1e4})).stdout}catch(a){if(typeof a!="object"||a===null||!("code"in a)||a.code!==1)throw a;n=""}let s=new Map(n.split("\0").filter(Boolean).map(a=>{let d=a.indexOf(`
7
- `);return[a.slice(0,d),a.slice(d+1)]}));for(let a of r)s.get(a.key)!==a.value&&await X(e,[o,a.key,a.value])}finally{await t()}}async function ke(e){let r=c.resolve(e.pmRoot),i=c.resolve(e.workspaceRoot),t=e.dryRun===!0,o,n;try{[o,n]=await Promise.all([_(r),_(i)])}catch(f){throw new v(`Cannot resolve tracker root ${r} or workspace root ${i}: ${String(f)}`,w.NOT_FOUND,{code:"merge_root_not_found",nextSteps:["Initialize the tracker and ensure both paths are accessible.",'Retry "pm merge install" from the repository workspace.']})}let s=I(n,o);if(K(s))throw new v(`Tracker root ${r} is outside the git repository ${i}; there is nothing to configure for this repository.`,w.USAGE);let a=await P(o),d=oe(a),u=O(s,d),m=[],l=await ye(),p=e.preCommitHook===!0?await import("./settlement-hook-H56537UV.js").then(async f=>({plan:await f.prepareMergeSettlementHook(n,`${l} --pm-path ${R(s||".")}`),write:f.writeMergeSettlementHook})):void 0;for(let f of Z)m.push({key:`merge.${f.key}.name`,value:f.name}),m.push({key:`merge.${f.key}.driver`,value:`${l} merge driver ${f.artifact} "%O" "%A" "%B"${f.itemPath===void 0?"":` --item-path ${f.itemPath}`}`});if(!t)try{await be(n,m)}catch{throw new v(`Cannot install repository-local merge drivers in ${n}. Ensure the repository Git config is writable and no other Git process holds its lock, then retry.`,w.DEPENDENCY_FAILED,{code:"merge_git_config_unwritable",why:"pm merge install must persist clone-local driver commands before publishing their shared .gitattributes mappings.",nextSteps:["Make the repository Git config writable or wait for the process holding its lock to finish.",'Retry "pm merge install"; the operation is idempotent.','Use "pm merge install --dry-run --json" when the workspace is intentionally read-only.']})}let b=await ne(n,s,u,t);return p!==void 0&&!t&&await p.write(p.plan),{ok:!0,dry_run:t,workspace_root:n,pm_root:o,gitattributes:{path:b.path,changed:b.changed,patterns:u,schema_scope:"project"},git_config:m,...p===void 0?{}:{settlement_hook:{path:p.plan.path,changed:p.plan.changed}},guidance:["Commit .gitattributes so every branch and collaborator shares the merge mapping.",'git config is per-clone: each collaborator (and each fresh worktree/clone) runs "pm merge install" once.','After merging branches, run "pm merge reconcile --dry-run" to inspect the complete receipt and history repair, then apply "pm merge reconcile"; use --force only after explicitly accepting any discarded values.',"Custom item types registered later refresh this fence automatically (pm schema add-type/remove-type); rerun pm merge install only after out-of-band type-folder edits."],generated_at:W()}}import{execFile as xe}from"node:child_process";import{promisify as Ee}from"node:util";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="e57ef62f-fd40-5a33-9816-e24d8dba4d1d")}catch{}})();var $e=Ee(xe);async function nt(e,r){if(r.length===0)return[];let i;try{let n=$e("git",["check-ignore","--verbose","-z","--stdin"],{cwd:e,env:y(),timeout:1e4}),s=n.child.stdin;s!==null&&(s.on("error",()=>{n.child.kill()}),s.end(`${r.join("\0")}\0`)),{stdout:i}=await n}catch(n){if(typeof n=="object"&&n!==null&&"code"in n&&n.code===1)return[];throw new v("Git could not verify ignore rules for merge artifacts; no automatic settlement is safe until that check succeeds.",w.CONFLICT,{code:"merge_settlement_review_required",reason:"ignore_check_unavailable",nextSteps:["Check Git configuration and ignore-file readability, then retry pm merge reconcile --stage --dry-run."]})}let t=i.split("\0"),o=[];for(let n=0;n+3<t.length;n+=4){let[s,a,d,u]=t.slice(n,n+4);d.startsWith("!")||o.push({path:u,source:s,line:Number(a),pattern:d})}return o}export{se as a,ce as b,ee as c,oe as d,qe as e,ze as f,Je as g,Ye as h,ke as i,nt as j};
8
- //# sourceMappingURL=chunk-TA4EGVE6.js.map
7
+ `);return[a.slice(0,d),a.slice(d+1)]}));for(let a of r)s.get(a.key)!==a.value&&await X(e,[o,a.key,a.value])}finally{await t()}}async function ke(e){let r=c.resolve(e.pmRoot),i=c.resolve(e.workspaceRoot),t=e.dryRun===!0,o,n;try{[o,n]=await Promise.all([_(r),_(i)])}catch(f){throw new v(`Cannot resolve tracker root ${r} or workspace root ${i}: ${String(f)}`,w.NOT_FOUND,{code:"merge_root_not_found",nextSteps:["Initialize the tracker and ensure both paths are accessible.",'Retry "pm merge install" from the repository workspace.']})}let s=I(n,o);if(K(s))throw new v(`Tracker root ${r} is outside the git repository ${i}; there is nothing to configure for this repository.`,w.USAGE);let a=await P(o),d=oe(a),u=O(s,d),m=[],l=await ye(),p=e.preCommitHook===!0?await import("./settlement-hook-5U2M75BY.js").then(async f=>({plan:await f.prepareMergeSettlementHook(n,`${l} --pm-path ${R(s||".")}`),write:f.writeMergeSettlementHook})):void 0;for(let f of Z)m.push({key:`merge.${f.key}.name`,value:f.name}),m.push({key:`merge.${f.key}.driver`,value:`${l} merge driver ${f.artifact} "%O" "%A" "%B"${f.itemPath===void 0?"":` --item-path ${f.itemPath}`}`});if(!t)try{await be(n,m)}catch{throw new v(`Cannot install repository-local merge drivers in ${n}. Ensure the repository Git config is writable and no other Git process holds its lock, then retry.`,w.DEPENDENCY_FAILED,{code:"merge_git_config_unwritable",why:"pm merge install must persist clone-local driver commands before publishing their shared .gitattributes mappings.",nextSteps:["Make the repository Git config writable or wait for the process holding its lock to finish.",'Retry "pm merge install"; the operation is idempotent.','Use "pm merge install --dry-run --json" when the workspace is intentionally read-only.']})}let b=await ne(n,s,u,t);return p!==void 0&&!t&&await p.write(p.plan),{ok:!0,dry_run:t,workspace_root:n,pm_root:o,gitattributes:{path:b.path,changed:b.changed,patterns:u,schema_scope:"project"},git_config:m,...p===void 0?{}:{settlement_hook:{path:p.plan.path,changed:p.plan.changed}},guidance:["Commit .gitattributes so every branch and collaborator shares the merge mapping.",'git config is per-clone: each collaborator (and each fresh worktree/clone) runs "pm merge install" once.','After merging branches, run "pm merge reconcile --dry-run" to inspect the complete receipt and history repair, then apply "pm merge reconcile"; use --force only after explicitly accepting any discarded values.',"Custom item types registered later refresh this fence automatically (pm schema add-type/remove-type); rerun pm merge install only after out-of-band type-folder edits."],generated_at:W()}}import{execFile as xe}from"node:child_process";import{promisify as Ee}from"node:util";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="e57ef62f-fd40-5a33-9816-e24d8dba4d1d")}catch{}})();var $e=Ee(xe);async function nt(e,r){if(r.length===0)return[];let i;try{let n=$e("git",["check-ignore","--verbose","-z","--stdin"],{cwd:e,env:y(),timeout:1e4}),s=n.child.stdin;s!==null&&(s.on("error",()=>{n.child.kill()}),s.end(`${r.join("\0")}\0`)),{stdout:i}=await n}catch(n){if(typeof n=="object"&&n!==null&&"code"in n&&n.code===1)return[];throw new v("Git could not verify ignore rules for merge artifacts; no automatic settlement is safe until that check succeeds.",w.CONFLICT,{code:"merge_settlement_review_required",reason:"ignore_check_unavailable",nextSteps:["Check Git configuration and ignore-file readability, then retry pm merge reconcile --stage --dry-run."]})}let t=i.split("\0"),o=[];for(let n=0;n+3<t.length;n+=4){let[s,a,d,u]=t.slice(n,n+4);d.startsWith("!")||o.push({path:u,source:s,line:Number(a),pattern:d})}return o}export{se as a,ce as b,ee as c,oe as d,qe as e,ze as f,Je as g,Ye as h,ke as i,nt as j};
8
+ //# sourceMappingURL=chunk-DFBHW7HP.js.map
@@ -0,0 +1,26 @@
1
+ import{f as $,i as h,j as le,k as ce,l as de,o as g,p as pe,q as me,r as fe}from"./chunk-UBBTBNUY.js";import{_ as ye,a as ee,b as te}from"./chunk-KRNF3WTC.js";import{c as y,f as se,g as ie,i as ae}from"./chunk-6E4X7MQA.js";import{B as ne,F as oe,fb as re}from"./chunk-BEHIMEV2.js";import{a as k,d as ue}from"./chunk-5WQ3LNUK.js";import{F as J,J as Q,K as E,Tb as Z,Ub as L,Vb as D,Wb as x,bb as C,fa as I,g as H}from"./chunk-3WVMEA2A.js";import{A as m,a as U,e as V,f as X,g as G,i as Y,z as p}from"./chunk-PDXSMSO5.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="d449d43b-5192-58dc-bdc0-0ec5e8922353")}catch{}})();var Pt=U,qt=V,jt=Y,zt=X,Kt=G;function he(e,t,n,r){let o=e.flag.slice(2).replace(/[-_]([a-z])/gu,(i,a)=>a.toUpperCase()),s=n.has(o);return{long:t,...r?{short:r}:{},description:e.description??`Standard pm ${e.flag} option.`,...e.required===!0?{required:!0}:{},...e.list===!0?{list:!0}:{},...e.repeatable===!0?{repeatable:!0}:{},value_type:s?"string":"boolean",...s?{value_name:e.value_name??"value"}:{}}}function ge(e,t=[]){let n=new Set(t.flatMap(o=>o.keys)),r=[];for(let o of ne(e.map(s=>({...s})))){r.push(he(o,o.flag,n,o.short));for(let s of o.aliases??[])r.push(he(o,s,n))}return r}var Wt=ge(oe,ee),Bt=ge(re,te);(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="59d16a38-d6df-5695-96e3-28b6e384f76b")}catch{}})();var b=["agile","ops","research"],R={agile:{name:"agile",title:"Agile delivery",summary:"Story/Spike delivery with a review stage, story points, and acceptance ownership.",types:$.agile,statuses:[{id:"review",roles:["active"],aliases:["in-review"],description:"Work is implementation-complete and awaiting peer review."}],fields:[{key:"story_points",type:"number",commands:["create","update","list"],description:"Relative estimation size for a story or spike.",aliases:["points"]},{key:"acceptance_owner",type:"string",commands:["create","update","list"],description:"Stakeholder accountable for accepting the delivered story.",aliases:["acceptor"]}],workflows:[{type:"Story",allowed_transitions:[["open","in_progress"],["in_progress","review"],["review","in_progress"],["review","closed"],["in_progress","blocked"],["blocked","in_progress"]]}],config:[{key:"search_provider",value:"bm25",summary:"Offline BM25 lexical search works without an embedding service."},{key:"search_max_results",value:"20",summary:"Sprint-sized result cap for quick triage."}],templates:[{name:"story",options:{type:"Story",priority:"2",tags:"story",acceptanceCriteria:"Story delivers the stated user outcome with tests and docs updated.",body:`## As a
2
+
3
+ ## I want
4
+
5
+ ## So that
6
+
7
+ ## Acceptance
8
+ - [ ]
9
+ `}}],packages:[{spec:"templates",reason:"Reusable create templates for recurring story shapes."},{spec:"calendar",reason:"Sprint and iteration scheduling views."},{spec:"search-advanced",reason:"Richer retrieval as the backlog grows."}]},ops:{name:"ops",title:"Operations",summary:"Incident/Runbook response with mitigation and monitoring stages, severity, and service fields.",types:$.ops,statuses:[{id:"mitigating",roles:["active"],aliases:["mitigation"],description:"Active mitigation is underway to restore service."},{id:"monitoring",roles:["active"],aliases:["observing"],description:"Mitigation applied; monitoring for recurrence before closure."}],fields:[{key:"severity",type:"string",commands:["create","update","list"],description:"Incident severity classification (e.g. sev1, sev2, sev3).",aliases:["sev"]},{key:"service",type:"string",commands:["create","update","list"],description:"Primary affected service or component."}],workflows:[{type:"Incident",allowed_transitions:[["open","mitigating"],["mitigating","monitoring"],["monitoring","mitigating"],["monitoring","closed"],["mitigating","blocked"],["blocked","mitigating"]]}],config:[{key:"search_provider",value:"bm25",summary:"Offline BM25 lexical search for fast incident lookup."},{key:"search_max_results",value:"25",summary:"Wider result cap to surface related incidents and runbooks."}],templates:[{name:"incident",options:{type:"Incident",priority:"1",tags:"incident",acceptanceCriteria:"Service restored, root cause documented, and follow-ups filed.",body:`## Impact
10
+
11
+ ## Timeline
12
+
13
+ ## Root cause
14
+
15
+ ## Mitigation
16
+
17
+ ## Follow-ups
18
+ `}}],packages:[{spec:"lifecycle-hooks",reason:"Automate transitions and notifications on incident state changes."},{spec:"governance-audit",reason:"Audit incident metadata completeness and closure quality."},{spec:"calendar",reason:"On-call and follow-up scheduling."}]},research:{name:"research",title:"Research",summary:"Experiment/Hypothesis investigation with an analysis stage, hypothesis, and method fields.",types:$.research,statuses:[{id:"analyzing",roles:["active"],aliases:["analysis"],description:"Data collected; analysis and synthesis in progress."}],fields:[{key:"hypothesis",type:"string",commands:["create","update"],description:"The testable claim the experiment evaluates."},{key:"method",type:"string",commands:["create","update","list"],description:"Experimental method or protocol used to evaluate the hypothesis.",aliases:["protocol"]}],workflows:[{type:"Experiment",allowed_transitions:[["open","in_progress"],["in_progress","analyzing"],["analyzing","in_progress"],["analyzing","closed"],["in_progress","blocked"],["blocked","in_progress"]]}],config:[{key:"search_provider",value:"bm25",summary:"Offline BM25 lexical search across the research corpus."},{key:"search_max_results",value:"50",summary:"Broader recall cap for literature and prior-experiment discovery."}],templates:[{name:"experiment",options:{type:"Experiment",priority:"2",tags:"experiment",acceptanceCriteria:"Hypothesis is supported, rejected, or refined with recorded evidence.",body:`## Hypothesis
19
+
20
+ ## Method
21
+
22
+ ## Results
23
+
24
+ ## Conclusion
25
+ `}}],packages:[{spec:"search-advanced",reason:"Semantic retrieval over experiments and findings."},{spec:"templates",reason:"Consistent experiment and hypothesis scaffolds."},{spec:"beads",reason:"Import structured prior work into the tracker."}]}};function Me(e){if(e===void 0)return;let t=f(e);if(t.length===0)throw new Error("Profile name must not be empty.");if(b.includes(t))return t;throw new Error(`Invalid profile "${e}". Allowed: ${b.join(", ")}.`)}function Xt(e){let t=Me(e);if(t===void 0)throw new Error(`Profile name is required. Allowed: ${b.join(", ")}.`);return R[t]}function Gt(){return b.map(e=>R[e])}function f(e){return e.trim().toLowerCase().replaceAll("-","_")}function _e(e){return e.map(t=>t.definition.name).join(", ")}function Pe(e=[]){let t=b.map(s=>({definition:R[s],source:"builtin"})),n=new Set(b.map(s=>f(s))),r=new Set(n),o=[];for(let s of e){let i=f(s.profile.name);if(n.has(i)){o.push(`Extension "${s.name}" profile "${s.profile.name}" uses a name reserved by a built-in archetype and was ignored.`);continue}if(r.has(i)){o.push(`Profile "${s.profile.name}" from extension "${s.name}" duplicates an already-registered profile and was ignored.`);continue}r.add(i),t.push({definition:s.profile,source:"extension",package:s.name})}return{profiles:t,warnings:o}}function Yt(e,t=[]){let{profiles:n,warnings:r}=Pe(t);if(typeof e!="string"||e.trim().length===0)throw new Error(`Profile name is required. Allowed: ${_e(n)}.`);let o=f(e),s=n.find(i=>f(i.definition.name)===o);if(s===void 0)throw new Error(`Invalid profile "${e}". Allowed: ${_e(n)}.`);return{resolved:s,warnings:r}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="ab26bcb3-fb2a-5f2f-96e7-7965787b924e")}catch{}})();function qe(e){return{types:e.types.length,statuses:e.statuses.length,fields:e.fields.length,workflows:e.workflows.length,config:e.config.length,templates:e.templates.length,packages:e.packages.length}}function en(e){return{name:e.name,title:e.title,summary:e.summary,composition:qe(e),types:e.types.map(t=>F(()=>y(t).name,()=>String(t.name??""))),statuses:e.statuses.map(t=>F(()=>g(t).id,()=>String(t.id??""))),fields:e.fields.map(t=>F(()=>h(t).key,()=>String(t.key??""))),workflows:e.workflows.map(t=>t.type),config:e.config.map(t=>`${t.key}=${t.value}`),templates:e.templates.map(t=>t.name),packages:e.packages.map(t=>({spec:t.spec,reason:t.reason}))}}function F(e,t){try{return e()}catch{return t()}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="42c9df66-4303-5d06-b931-0a276894e5e5")}catch{}})();var je=[{key:"context_default_depth",path:"context.default_depth",kind:"string",choices:J,summary:"Default context depth."},{key:"context_activity_limit",path:"context.activity_limit",kind:"integer",min:1,max:Number.MAX_SAFE_INTEGER,decimal_only:!0,summary:"Default context activity row limit; positive decimal integer."},{key:"context_stale_threshold_days",path:"context.stale_threshold_days",kind:"integer",min:1,max:Number.MAX_SAFE_INTEGER,decimal_only:!0,summary:"Days before context marks an item stale; positive decimal integer."},...["hierarchy","activity","progress","recently_created","unparented","blockers","files","workload","staleness","tests"].map(e=>({key:`context_sections_${e}`,path:`context.sections.${e}`,kind:"boolean",summary:`Include ${e} in default context output.`})),{key:"context_next_ranking_policy",path:"context.next_ranking_policy",kind:"string",choices:["priority_floor","weighted"],summary:"Ready-queue order for pm next with the built-in scorer: priority_floor (resume in-progress work, then priority tiers, relevance within a tier) or weighted (blended relevance order). An extension context_relevance scorer keeps its own order."},{key:"search_provider",path:"search.provider",kind:"string",summary:"Search embedding provider name (e.g. openai, ollama, or an extension provider)."},{key:"search_default_mode",path:"search.default_mode",kind:"string",choices:["auto","keyword","semantic","hybrid"],summary:"Mode a bare pm search runs in: auto (hybrid when semantic search is explicitly configured and runnable, else keyword), or a pinned keyword, semantic, or hybrid."},{key:"search_mutation_refresh_policy",path:"search.mutation_refresh_policy",kind:"string",choices:["cache_only","semantic_configured","semantic_auto"],summary:"Mutation-time search refresh policy: cache_only, semantic_configured, or semantic_auto."},{key:"search_query_expansion_enabled",path:"search.query_expansion.enabled",kind:"boolean",summary:"Enable or disable query expansion for semantic/hybrid search."},{key:"search_query_expansion_provider",path:"search.query_expansion.provider",kind:"string",summary:"Query expansion provider name (built-in openai/ollama or extension provider)."},{key:"search_rerank_enabled",path:"search.rerank.enabled",kind:"boolean",summary:"Enable or disable post-retrieval reranking for hybrid search."},{key:"search_rerank_model",path:"search.rerank.model",kind:"string",summary:"Rerank model name override used by built-in providers."},{key:"search_rerank_top_k",path:"search.rerank.top_k",kind:"integer",min:1,summary:"Number of top hybrid candidates to rerank when rerank is enabled."},{key:"search_embedding_model",path:"search.embedding_model",kind:"string",summary:"Default embedding model name (overrides provider-specific model when set)."},{key:"search_embedding_corpus_max_characters",path:"search.embedding_corpus_max_characters",kind:"integer",min:1,summary:"Maximum semantic corpus characters per item before truncation."},{key:"search_embedding_batch_size",path:"search.embedding_batch_size",kind:"integer",min:1,summary:"Number of items embedded per request batch."},{key:"search_embedding_timeout_ms",path:"search.embedding_timeout_ms",kind:"integer",min:1,summary:"Per-request embedding timeout in milliseconds."},{key:"search_score_threshold",path:"search.score_threshold",kind:"number",summary:"Minimum score for a hit to be returned (0 keeps all matches)."},{key:"search_hybrid_semantic_weight",path:"search.hybrid_semantic_weight",kind:"ratio",summary:"Hybrid mode semantic weight in [0, 1] (1-weight goes to keyword)."},{key:"search_max_results",path:"search.max_results",kind:"integer",min:1,summary:"Default upper bound on search hits when --limit is not supplied."},{key:"search_bm25_k1",path:"search.bm25.k1",kind:"number",min:0,summary:"Offline BM25 term-frequency saturation (k1); higher saturates repeated terms slower (default 1.2)."},{key:"search_bm25_b",path:"search.bm25.b",kind:"ratio",summary:"Offline BM25 document-length normalization (b) in [0, 1]; 0 disables, 1 fully normalizes (default 0.75)."},{key:"openai_base_url",path:"providers.openai.base_url",kind:"string",summary:"OpenAI-compatible API base URL (LM Studio/vLLM also use this)."},{key:"openai_api_key",path:"providers.openai.api_key",kind:"string",summary:"OpenAI-compatible API key."},{key:"openai_model",path:"providers.openai.model",kind:"string",summary:"OpenAI-compatible embedding model name."},{key:"ollama_base_url",path:"providers.ollama.base_url",kind:"string",summary:"Ollama API base URL (typically http://localhost:11434)."},{key:"ollama_model",path:"providers.ollama.model",kind:"string",summary:"Ollama embedding model name (e.g. nomic-embed-text)."},{key:"vector_store_adapter",path:"vector_store.adapter",kind:"string",summary:"Vector store adapter name (lancedb, qdrant, or an extension adapter)."},{key:"vector_store_collection_name",path:"vector_store.collection_name",kind:"string",non_empty:!0,summary:"Vector collection/table name shared by Qdrant and LanceDB adapters."},{key:"qdrant_url",path:"vector_store.qdrant.url",kind:"string",summary:"Qdrant HTTP API URL."},{key:"qdrant_api_key",path:"vector_store.qdrant.api_key",kind:"string",summary:"Qdrant API key (empty if running unauthenticated)."},{key:"lancedb_path",path:"vector_store.lancedb.path",kind:"string",summary:"LanceDB storage path (relative to pm root or absolute)."},{key:"id_prefix",path:"id_prefix",kind:"string",non_empty:!0,summary:'Prefix for generated item IDs (e.g. "pm" produces pm-xxxx).'},{key:"author_default",path:"author_default",kind:"string",non_empty:!0,summary:"Default author recorded on mutations when --author is not supplied."},{key:"agent_identity_probes_enabled",path:"agent_identity.probes_enabled",kind:"boolean",summary:"Allow privacy-bounded local harness provenance probes; no network or subprocess access is permitted."},{key:"mutation_guard_require_attributed_author",path:"mutation_guard.require_attributed_author",kind:"boolean",summary:"Reject mutations whose effective author resolves to unknown."},{key:"mutation_guard_secret_guard",path:"mutation_guard.secret_guard",kind:"string",choices:["off","advise","block"],summary:"Detect credential-shaped mutation content: off, advise, or block."},{key:"mutation_guard_stale_in_progress_hours",path:"mutation_guard.stale_in_progress_hours",kind:"integer",min:1,summary:"Age threshold for unclaimed in-progress work surfaced by health."},{key:"governance_duplicate_detection_mode",path:"governance.duplicate_detection_mode",kind:"string",choices:["off","advisory","strict"],summary:"Create/copy duplicate governance: off, advisory, or strict explicit-bypass enforcement."},{key:"governance_duplicate_detection_threshold",path:"governance.duplicate_detection_threshold",kind:"ratio",summary:"Minimum shared similarity score in [0, 1] for create/copy duplicate governance."},{key:"governance_duplicate_detection_limit",path:"governance.duplicate_detection_limit",kind:"integer",min:0,max:20,summary:"Maximum likely duplicates returned by create/copy governance (0-20)."},{key:"output_default_format",path:"output.default_format",kind:"string",choices:["toon","json"],summary:"Default output format for commands that support it: toon or json."},{key:"ux_deprecation_hints",path:"ux.deprecation_hints",kind:"boolean",summary:"Emit one stderr migration hint for deprecated command aliases."},{key:"locks_ttl_seconds",path:"locks.ttl_seconds",kind:"integer",min:1,summary:"Claim/lock time-to-live in seconds before a stale lock can be reclaimed."},{key:"locks_wait_ms",path:"locks.wait_ms",kind:"integer",min:0,summary:"Wait budget in milliseconds before a contended lock fails with lock_conflict; item-store mutations, restore and the hierarchy lock treat it as a no-progress window that each observed owner handoff restarts (120 s total cap), other locks as a fixed total; 0 fails fast. PM_LOCK_WAIT_MS overrides per invocation."},{key:"ids_token_length",path:"ids.token_length",kind:"integer",min:4,max:12,summary:"Random base36 token length for newly minted item ids (4-12, default 4). Raise it to shrink cross-branch id collision odds in concurrent multi-agent workflows (pm-pibw)."},{key:"checkpoints_retention_days",path:"checkpoints.retention_days",kind:"integer",min:1,summary:"Age in days above which pm gc --scope checkpoints prunes bulk-mutation rollback checkpoints."},{key:"schema_unknown_field_policy",path:"schema.unknown_field_policy",kind:"string",choices:["allow","warn","reject"],summary:"How item I/O handles metadata keys not in the field registry: allow, warn, or reject."},{key:"history_compact_policy_enabled",path:"history.compact_policy.enabled",kind:"boolean",summary:"Enable the history-compaction advisory: pm health warns on over-threshold streams."},{key:"history_compact_policy_max_entries",path:"history.compact_policy.max_entries",kind:"integer",min:1,summary:"Entry count above which a history stream is flagged (and the default pm history-compact --all-over threshold)."},{key:"history_compact_policy_trigger",path:"history.compact_policy.trigger",kind:"string",choices:["health_warn","auto"],summary:"History-compaction policy intent: health_warn (advisory only) or auto (scheduled sweeps expected)."}],ze=new Map(je.flatMap(e=>[[e.key,e],[e.path.toLowerCase().replaceAll("-","_"),e]]));function A(e){if(typeof e!="string")return;let t=e.trim().toLowerCase().replaceAll("-","_");if(t.length!==0)return ze.get(t)}function Ke(e,t){let n=t.trim().toLowerCase();return n==="true"||n==="1"||n==="yes"||n==="on"?{ok:!0,parsed:{descriptor:e,value:!0}}:n==="false"||n==="0"||n==="no"||n==="off"?{ok:!0,parsed:{descriptor:e,value:!1}}:{ok:!1,error:{message:`Config set ${e.key} requires a boolean value (true|false), got "${t}"`}}}function We(e,t,n){return e.key==="context_default_depth"&&(n=n.toLowerCase()),e.non_empty===!0&&n.length===0?{ok:!1,error:{message:`Config set ${e.key} requires a non-empty value`}}:e.choices&&!e.choices.includes(n)?{ok:!1,error:{message:`Config set ${e.key} must be one of ${e.choices.join("|")}, got "${t}"`}}:{ok:!0,parsed:{descriptor:e,value:n}}}function ke(e,t){let n=[e.min===void 0?"":`minimum ${e.min}`,e.max===void 0?"":`maximum ${e.max}`].filter(Boolean).join(", ");return{message:`Config set ${e.key} requires non-empty decimal integer digits${n?` (${n})`:""}, got "${t}"`}}function Be(e,t,n){if(e.decimal_only&&!/^\d+$/u.test(n))return{ok:!1,error:ke(e,t)};if(n.length===0)return{ok:!1,error:{message:`Config set ${e.key} requires a non-empty value`}};let r=Number(n);return Number.isFinite(r)?{ok:!0,value:r}:{ok:!1,error:e.decimal_only?ke(e,t):{message:`Config set ${e.key} requires a finite number, got "${t}"`}}}function Ue(e,t,n){return!Number.isInteger(n)||n<0?{ok:!1,error:{message:`Config set ${e.key} requires a non-negative integer, got "${t}"`}}:e.min!==void 0&&n<e.min?{ok:!1,error:{message:`Config set ${e.key} requires an integer >= ${e.min}, got "${t}" (the runtime silently ignores 0 here and falls back to the default)`}}:e.max!==void 0&&n>e.max?{ok:!1,error:{message:`Config set ${e.key} requires an integer <= ${e.max}, got "${t}"`}}:{ok:!0,parsed:{descriptor:e,value:n}}}function Ve(e,t,n){return n<0||n>1?{ok:!1,error:{message:`Config set ${e.key} requires a number in [0, 1], got "${t}"`}}:{ok:!0,parsed:{descriptor:e,value:n}}}function Xe(e,t,n){return e.min!==void 0&&n<e.min?{ok:!1,error:{message:`Config set ${e.key} requires a number >= ${e.min}, got "${t}"`}}:{ok:!0,parsed:{descriptor:e,value:n}}}function T(e,t){if(typeof t!="string")return{ok:!1,error:{message:`Config set ${e.key} requires a string value`}};let n=t.trim();if(e.kind==="boolean")return Ke(e,t);if(e.kind==="string")return We(e,t,n);let r=Be(e,t,n);return r.ok?e.kind==="integer"?Ue(e,t,r.value):e.kind==="ratio"?Ve(e,t,r.value):Xe(e,t,r.value):{ok:!1,error:r.error}}function be(e,t){let n=t.path.split("."),r=e;for(let o of n){if(typeof r!="object"||r===null)return null;let s=Object.getOwnPropertyDescriptor(r,o);if(!s||!Object.hasOwn(s,"value"))return null;r=s.value}return typeof r=="string"||typeof r=="number"||typeof r=="boolean"?r:null}function on(e,t,n){let r=t.path.split(".");if(r.some(i=>i.length===0||["__proto__","constructor","prototype"].includes(i)))throw new Error("Unsafe settings path");let o=e;for(let i=0;i<r.length-1;i+=1){let a=r[i],c=Object.getOwnPropertyDescriptor(o,a)?.value;if(typeof c!="object"||c===null||Array.isArray(c)){let d={};Object.defineProperty(o,a,{value:d,writable:!0,enumerable:!0,configurable:!0}),o=d}else o=c}let s=r[r.length-1];return Object.getOwnPropertyDescriptor(o,s)?.value===n?!1:(Object.defineProperty(o,s,{value:n,writable:!0,enumerable:!0,configurable:!0}),!0)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="0b04624c-2096-55dc-9dde-b8c76ead72d6")}catch{}})();var hn=["profile","types","statuses","fields","workflows","config","templates","packages"],gn=["profile_name_empty","profile_name_not_normalized","profile_title_empty","profile_summary_empty","type_invalid","type_duplicate","status_invalid","status_duplicate","field_invalid","field_duplicate","field_mcp_input_collision","workflow_type_empty","workflow_type_unknown","workflow_duplicate_type","workflow_transition_malformed","workflow_status_unknown","config_key_unknown","config_value_invalid","config_duplicate","template_type_unknown","package_spec_empty"],Ge=new Set(ue.flatMap(e=>[k(e.id),...(e.aliases??[]).map(t=>k(t))]).filter(e=>e.length>0)),we=new Set(H.map(e=>e.toLowerCase()));function Ye(e,t){e.name.trim().length===0?t.push({severity:"error",code:"profile_name_empty",dimension:"profile",message:"Profile name must not be empty; profile resolution requires a non-blank name."}):e.name!==f(e.name)&&t.push({severity:"warning",code:"profile_name_not_normalized",dimension:"profile",target:e.name,message:`Profile name "${e.name}" is not in canonical form; resolution folds it to "${f(e.name)}" (lowercase, hyphens as underscores).`}),e.title.trim().length===0&&t.push({severity:"warning",code:"profile_title_empty",dimension:"profile",message:"Profile title is empty; list and show surfaces will render a blank title."}),e.summary.trim().length===0&&t.push({severity:"warning",code:"profile_summary_empty",dimension:"profile",message:"Profile summary is empty; list and show surfaces will render a blank archetype description."})}function He(e,t){let n=new Set,r=new Set;for(let[o,s]of e.types.entries()){let i;try{i=y(s).name}catch(c){t.push({severity:"error",code:"type_invalid",dimension:"types",target:typeof s.name=="string"?s.name:`#${o}`,message:I(c)});continue}let a=i.toLowerCase();if(r.has(a)){t.push({severity:"error",code:"type_duplicate",dimension:"types",target:i,message:`Item type "${i}" is declared more than once; the later definition silently overwrites the earlier upsert.`});continue}r.add(a),n.add(a)}return n}function Je(e,t){let n=new Set,r=new Set;for(let[o,s]of e.statuses.entries()){let i;try{i=g(s)}catch(a){t.push({severity:"error",code:"status_invalid",dimension:"statuses",target:typeof s.id=="string"?s.id:`#${o}`,message:I(a)});continue}if(r.has(i.id)){t.push({severity:"error",code:"status_duplicate",dimension:"statuses",target:i.id,message:`Status "${i.id}" is declared more than once; the later definition silently overwrites the earlier upsert.`});continue}r.add(i.id),n.add(i.id);for(let a of i.aliases??[])n.add(k(a))}return n}function Qe(e,t){let n=new Set;for(let[r,o]of e.fields.entries()){let s;try{s=h(o).key}catch(a){t.push({severity:"error",code:"field_invalid",dimension:"fields",target:typeof o.key=="string"?o.key:`#${r}`,message:I(a)});continue}if(n.has(s)){t.push({severity:"error",code:"field_duplicate",dimension:"fields",target:s,message:`Field "${s}" is declared more than once; the later definition silently overwrites the earlier upsert.`});continue}n.add(s);let i=ye(s);i&&t.push({severity:"warning",code:"field_mcp_input_collision",dimension:"fields",target:s,message:`Field "${s}" collides with canonical MCP property "${i.property}" owned by ${i.owner}; callers must pass the custom value through ${i.nested_path}.`})}}function Ze(e,t,n,r){let o=new Set;for(let[s,i]of e.workflows.entries()){let a=i.type.trim().toLowerCase();if(a.length===0){r.push({severity:"error",code:"workflow_type_empty",dimension:"workflows",target:`#${s}`,message:"Workflow has an empty type; the workflow resolver drops entries without a type."});continue}let c=o.has(a);o.add(a),c?r.push({severity:"warning",code:"workflow_duplicate_type",dimension:"workflows",target:i.type,message:`Workflow type "${i.type}" is declared more than once; the later transition set wins.`}):!we.has(a)&&!t.has(a)&&r.push({severity:"warning",code:"workflow_type_unknown",dimension:"workflows",target:i.type,message:`Workflow governs type "${i.type}" which is neither a built-in type nor declared by this profile; it has no effect unless that type already exists.`});let d=new Set;for(let l of i.allowed_transitions){let u=k(l[0]),B=k(l[1]);if(u.length===0||B.length===0){r.push({severity:"error",code:"workflow_transition_malformed",dimension:"workflows",target:i.type,message:`Workflow "${i.type}" has a transition with an empty status; the workflow resolver silently drops it.`});continue}for(let _ of[u,B])Ge.has(_)||n.has(_)||d.has(_)||(d.add(_),r.push({severity:"warning",code:"workflow_status_unknown",dimension:"workflows",target:_,message:`Workflow "${i.type}" references status "${_}" which is neither a built-in status nor declared by this profile; transitions to or from it are unreachable.`}))}}}function et(e,t){let n=new Set;for(let r of e.config){let o=A(r.key);if(o===void 0){t.push({severity:"error",code:"config_key_unknown",dimension:"config",target:r.key,message:`Config knob "${r.key}" is not a recognized setting; apply rejects it with a usage error.`});continue}n.has(o.key)?t.push({severity:"error",code:"config_duplicate",dimension:"config",target:o.key,message:`Config knob "${o.key}" is set more than once; the later value silently overwrites the earlier one.`}):n.add(o.key);let s=T(o,r.value);s.ok||t.push({severity:"error",code:"config_value_invalid",dimension:"config",target:r.key,message:s.error.message})}}function tt(e,t,n){for(let r of e.templates){let o=r.options.type;if(typeof o!="string"||o.trim().length===0)continue;let s=o.trim().toLowerCase();!we.has(s)&&!t.has(s)&&n.push({severity:"warning",code:"template_type_unknown",dimension:"templates",target:r.name,message:`Template "${r.name}" creates type "${o}" which is neither a built-in type nor declared by this profile.`})}}function nt(e,t){for(let[n,r]of e.packages.entries())r.spec.trim().length===0&&t.push({severity:"warning",code:"package_spec_empty",dimension:"packages",target:`#${n}`,message:"Package recommendation has an empty spec; it cannot be surfaced as an install hint."})}function _n(e){let t=[];Ye(e,t);let n=He(e,t),r=Je(e,t);Qe(e,t),Ze(e,n,r,t),et(e,t),tt(e,n,t),nt(e,t);let o=t.filter(i=>i.severity==="error").length,s=t.length-o;return{profile:e.name,ok:o===0,findings:t,errorCount:o,warningCount:s}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="be2b507d-2797-570c-b211-46d950edcbde")}catch{}})();function M(e,t,n,r,o){let s=e,i=[];for(let a of t){let c=r(s),d=o(s,a),l=r(d.file);s=d.file;let u=c===l?"unchanged":d.replaced?"update":"add";i.push({key:n(a),status:u})}return{file:s,changes:i,changed:i.some(a=>a.status!=="unchanged")}}function ve(e){return JSON.stringify(e.map(t=>t.join("\0")).sort())}function ot(e,t){let n=e.map(o=>({...o})),r=[];for(let o of t){let s=n.findIndex(a=>a.type===o.type),i={type:o.type,allowed_transitions:o.allowed_transitions};s<0?(n.push(i),r.push({type:o.type,status:"add"})):ve(n[s].allowed_transitions)===ve(o.allowed_transitions)?r.push({type:o.type,status:"unchanged"}):(n[s]=i,r.push({type:o.type,status:"update"}))}return{changes:r,result:n,changed:r.some(o=>o.status!=="unchanged")}}function rt(e,t){let n=[];for(let r of e.config){let o=A(r.key);if(o===void 0)throw new Error(`Profile "${e.name}" references unknown config key "${r.key}".`);let s=T(o,r.value);if(!s.ok)throw new Error(`Profile "${e.name}" config ${r.key}: ${s.error.message}`);let i=be(t,o),a=i===null?"add":i===s.parsed.value?"unchanged":"update";n.push({key:o.key,path:o.path,value:s.parsed.value,status:a})}return{changes:n,changed:n.some(r=>r.status!=="unchanged")}}function Se(e){let t=Object.entries(e).sort(([n],[r])=>n.localeCompare(r));return JSON.stringify(t)}function st(e,t){let n=[];for(let r of e.templates){let o=t.get(r.name),s;o===void 0?s="add":Se(o)===Se(r.options)?s="unchanged":s="update",n.push({name:r.name,options:r.options,status:s})}return{changes:n,changed:n.some(r=>r.status!=="unchanged")}}function On(e,t){let n=M(se(t.typesRaw),e.types,l=>y(l).name,ae,(l,u)=>ie(l,y(u))),r=M(pe(t.statusesRaw),e.statuses,l=>g(l).id,me,(l,u)=>fe(l,g(u))),o=M(le(t.fieldsRaw),e.fields,l=>h(l).key,ce,(l,u)=>de(l,h(u))),s=ot(t.workflows,e.workflows),i=rt(e,t.settings),a=st(e,t.templates),c=e.packages.map(l=>({spec:l.spec,reason:l.reason,status:t.installedPackages.has(l.spec)?"installed":"recommended"})),d=n.changed||r.changed||o.changed||s.changed||i.changed||a.changed;return{profile:{name:e.name,title:e.title,summary:e.summary},types:n,statuses:r,fields:o,workflows:s,config:i,templates:a,packages:c,changed:d}}import{isDeepStrictEqual as it}from"node:util";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="ab4e2ed3-e7e8-5a7a-a13e-7b8dce750dc4")}catch{}})();var at=new Set(["__proto__","prototype","constructor"]),$e=Symbol("looseOptionOccurrences");function w(e){return e.trim().toLowerCase().replaceAll(/-([a-z0-9])/g,(t,n)=>n.toUpperCase())}function P(e){return at.has(e)}function Ae(e){let t=(typeof e.value_type=="string"?e.value_type:void 0)??(typeof e.type=="string"?e.type:void 0);return Z(t)}function Te(e){let t=[],n=E(e.long)??"",r=typeof e.short=="string"?e.short.trim():"";if(n.startsWith("--")){let o=w(n.slice(2));o.length>0&&!P(o)&&t.push(o)}if(r.startsWith("-")&&!r.startsWith("--")){let o=w(r.slice(1));o.length>0&&!P(o)&&t.push(o)}return[...new Set(t)]}function S(e){let t=E(e.long)??"";if(t.startsWith("--")){let n=w(t.slice(2));if(n.length>0&&!P(n))return n}return Te(e)[0]??null}function O(e){let t=E(e.long)??"";if(t.startsWith("--")&&t.length>2)return t;let n=typeof e.short=="string"?e.short.trim():"";return n.startsWith("-")&&!n.startsWith("--")&&n.length>1?n:null}function lt(e,t){return[...(t.definitions??e).map(n=>O(n)).filter(n=>n!==null),...t.inheritedFlags??[]]}function ct(e,t,n,r){let o=r.length>0?` Expected one of: ${[...new Set(r)].join(", ")}.`:"";throw new m(`Unknown option '${e}' for extension command '${n}'.${o}`,p.USAGE,{code:"unknown_option",flag:t,required:`Use a flag the command accepts; run pm contracts --command ${n} --flags-only --json to list them.`})}function dt(e,t){throw new m(`Option '${e}' is disabled for extension command '${t}'.`,p.USAGE,{code:"extension_option_disabled",flag:e,required:`Remove ${e}; the command declares it with enabled: false.`,why:"A disabled declaration keeps the flag in the contract while refusing every value for it.",examples:[`pm ${t} --help`],nextSteps:[`Run pm contracts --command ${t} --flags-only --json to list the flags this command accepts.`]})}function ut(e,t,n,r){let o=L(e),s=o.value_arity==="none"?n:o.value_arity==="optional"?`${n} [${o.value_name}]`:`${n} <${o.value_name}>`;throw new m(`Missing required option '${n}' for extension command '${r}'.`,p.USAGE,{code:"missing_required_option",flag:n,field:t,required:`Pass ${s}.`,why:"The command declares this flag as required, so pm refuses the invocation before the extension handler runs.",examples:[`pm ${r} ${s}`],nextSteps:[`Run pm contracts --command ${r} --flags-only --json to read each flag's sdk_option key.`],recovery:{missing:[n]}})}function pt(e){return typeof e=="string"||e==null?e:String(e)}function mt(e){if(typeof e=="number")return e;if(typeof e=="string"&&e.trim().length>0){let t=Number(e);return Number.isFinite(t)?t:e}return e}function Ne(e){if(typeof e=="boolean")return e;if(typeof e=="string"){let t=e.trim().toLowerCase();if(t==="true"||t==="1")return!0;if(t==="false"||t==="0")return!1}return e}var ft={string:pt,number:mt,boolean:Ne};function v(e,t){return Array.isArray(e)?e.map(n=>v(n,t)):ft[t](e)}function j(e,t,n){let r=n?(Array.isArray(e)?e.flat(1/0):[e]).filter(o=>o!=null&&o!==""):D(e);return t?r.map(o=>v(o,t)):r}function yt(e,t){return j(t,null,e.repeatable===!0).length>0}function ht(e,t,n,r){return n?j(e,t,r):t?v(e,t):e}function gt(e,t,n){let r=Le(e,t);return r.length===0?n:r.map(o=>o.value)}function Ce(e){return L(e).value_arity==="none"}function z(e,t,n,r,o){let s=O(e),i=o?` for extension command '${o}'`:"",a=n===!0?"no value":JSON.stringify(n);throw new m(`Option '${s}'${i} expects ${r}; received ${a}.`,p.USAGE,{code:"extension_flag_value_invalid",flag:s,required:`Pass ${s} ${t==="number"?"<number>":"<true|false|1|0>"}.`,why:`The flag declares value_type ${t} with value_validation strict, so a malformed token is refused before the extension handler runs.`,nextSteps:[`Re-run with a valid ${t} value for ${s}.`,`Run pm ${o??"<command>"} --help to review the declared flag contract.`]})}function K(e,t){return e.value_validation==="strict"&&t!=="string"}function Le(e,t){let n=e[$e];if(!n)return[];let r=new Set(t);return n.filter(o=>r.has(o.key))}function _t(e,t,n,r){if(Ce(e))for(let o of Le(n,t)){if(o.attached!==!0)continue;let s=e.list===!0&&e.repeatable!==!0?D(o.value):[o.value];for(let i of s){let a=x(v(i,"boolean"),"boolean");a!==null&&z(e,"boolean",i,a.expected,r)}}}function kt(e,t,n,r,o){let s=Array.isArray(n)?n.flat(1/0):[n],i=r?s:s.flatMap(a=>typeof a=="string"?a.split(","):[a]);for(let a of i)if(typeof a=="string"&&a.trim().length===0){let c=x(a,t);z(e,t,a,c.expected,o)}}function W(e,t,n,r){if(!K(e,n))return t;let o=n==="boolean"&&Ce(e),s=i=>{let a=x(i,n);return a===null?i:o&&typeof i=="string"?!0:z(e,n,i,a.expected,r)};return Array.isArray(t)?t.map(s):s(t)}function bt(e,t,n,r){for(let o of n)if(!(o===t||!Object.hasOwn(e,o))){if(Object.hasOwn(e,t)){if(r){let s=e[t],i=e[o];e[t]=[...Array.isArray(s)?s:[s],...Array.isArray(i)?i:[i]].filter(a=>a!=null)}delete e[o];continue}e[t]=e[o],delete e[o]}}function De(e,t,n=e,r){if(t.length===0)return e;let o=Object.create(null);for(let[i,a]of Object.entries(e))o[i]=a;let s=new Set(t.map(i=>S(i)).filter(i=>i!==null));for(let i of t){let a=S(i);if(a){let c=Te(i).filter(d=>d===a||!s.has(d));wt(o,i,a,c,n,r)}}return o}function wt(e,t,n,r,o,s){let i=t.list===!0,a=Ae(t);a&&!i&&vt(e,t,n,r,a,s),bt(e,n,r,i);let c=t.repeatable===!0;if(!Object.hasOwn(e,n)){t.default!==void 0&&(e[n]=ht(t.default,a,i,c));return}if(a==="boolean"&&K(t,a)&&_t(t,r,o,s),i){e[n]=St(t,r,o,e[n],a,c,s);return}a&&(e[n]=W(t,v(e[n],a),a,s))}function vt(e,t,n,r,o,s){for(let i of r)i!==n&&Object.hasOwn(e,i)&&W(t,v(e[i],o),o,s)}function St(e,t,n,r,o,s,i){let a=gt(n,t,r);o&&K(e,o)&&kt(e,o,a,s,i);let c=j(a,o,s);return o?W(e,c,o,i):c}function Tn(e){return S(e)}function Oe(e){return e.trim().toLowerCase().split(/\s+/u).filter(t=>t.length>0).join(" ")}function Nn(e,t){let n=Oe(t);if(n.length===0)return[];let r=C(n);return e.flags.filter(o=>C(Oe(o.target_command))===r).flatMap(o=>[...o.flags])}function Ot(e,t,n,r){let o=O(e),[s,i]=n;throw new m(`Options '${s}' and '${i}' both set ${o} for extension command '${r}' with different values.`,p.USAGE,{code:"extension_option_spelling_conflict",required:`Pass ${o} once, under the handler key '${t}'.`,why:`'${s}' and '${i}' are spellings of the same declared flag, and pm refuses to choose between two different values.`,nextSteps:[`Remove '${s}' or '${i}' and pass one value as '${t}'.`,`Run pm contracts --command ${r} --flags-only --json to read each flag's sdk_option key.`]})}function Cn(e,t,n,r={}){if(t.length===0)return e;let o=t.map(l=>l.repeatable===!0&&l.list!==!0?{...l,list:!0}:l),s=$t(o),i=Nt(e,s,n),a=new Set([...s.long.values()].map(({handlerKey:l})=>l)),c=Object.create(null),d=Object.create(null);for(let[l,u]of Object.entries(i))a.has(l)?c[l]=u:u===void 0||r.undeclaredKeys==="pass"||It(l)?d[l]=u:ct(l,xt(l),n,lt(o,{}));return Fe(c,o,n),Object.assign(d,De(c,o,Re(c,s),n))}function Re(e,t){let n=new Set([...t.long.values()].map(({handlerKey:s})=>s)),r=Object.entries(e).filter(([s])=>n.has(s)).flatMap(([s,i])=>(Array.isArray(i)?i.flat(1/0):[i]).map(a=>({consumed:1,key:s,value:a,attached:!0}))),o=Object.create(null);return Object.defineProperty(o,$e,{value:r}),o}function Fe(e,t,n){for(let r of t){let o=S(r);if(o===null)continue;let s=O(r),i=e[o],a=Object.hasOwn(e,o);r.enabled===!1&&a&&dt(s,n);let c=a&&(r.list!==!0||yt(r,i));r.required===!0&&r.enabled!==!1&&!c&&ut(r,o,s,n),r.list!==!0&&Array.isArray(i)&&Et(s,n)}}function Et(e,t){throw new m(`Option '${e}' for extension command '${t}' takes one value; received an array.`,p.USAGE,{code:"extension_flag_value_invalid",flag:e,required:`Pass one value for ${e}, or ask the package to declare it with list: true or repeatable: true.`,why:"The flag is not declared list or repeatable, so pm refuses an array before the extension handler runs instead of handing it a value of the wrong shape.",nextSteps:[`Run pm contracts --command ${t} --flags-only --json to read each flag's value contract.`]})}var Ee=new Set([...[...Q].flatMap(e=>{let t=e.replace(/^--/u,"");return[t,...t.startsWith("no-")?[t.slice(3)]:[]].flatMap(n=>[w(n),n.replaceAll("-","_")])}),"force","subcommand","inputResponses","requestState"]);function It(e){return Ee.has(e)||Ee.has(w(e.replace(/^-{1,2}/u,"")))}function xt(e){return`--${e.replace(/^-+/u,"").replace(/([a-z0-9])([A-Z])/gu,"$1-$2").replaceAll("_","-").toLowerCase()}`}function $t(e){let t={long:new Map,short:new Map},n=(r,o,s)=>{o.length>0&&!r.has(o)&&r.set(o,s)};for(let r of e){let o=S(r);if(o===null)continue;let s={handlerKey:o,definition:r};n(t.long,o,s);let i=typeof r.short=="string"?r.short.trim():"";i.startsWith("-")&&!i.startsWith("--")&&n(t.short,i.slice(1),s)}return t}function q(e,t){return e.long.get(t)??e.short.get(t.replace(/^-(?!-)/u,""))??e.long.get(w(t.replace(/^-{1,2}/u,"")))}function At(e,t,n,r){let o=/^(?:--)?no-(.+)$/u.exec(t)?.[1];if(o===void 0||q(e,t)!==void 0)return{spelling:t,value:n};let s=q(e,o);return s===void 0||Ae(s.definition)!=="boolean"?{spelling:t,value:n}:(s.definition.list===!0||s.definition.repeatable===!0)&&Array.isArray(n)?{spelling:o,value:n.flat(1/0).map(i=>Ie(t,s.definition,i,r))}:s.definition.list===!0&&n!==void 0?{spelling:o,value:Ie(t,s.definition,n,r)}:{spelling:o,value:n===void 0?n:N(t,s.definition,n,r)}}function Ie(e,t,n,r){let o=s=>s.trim().length===0?s:String(N(e,t,s.trim(),r));return n==null?n:typeof n!="string"?N(e,t,n,r):n.trim().length===0?n:t.repeatable===!0||!n.includes(",")?N(e,t,n,r):n.split(",").map(o).join(",")}function N(e,t,n,r){let o=Ne(n);return typeof o=="boolean"?!o:Tt(e,t,n,r)}function Tt(e,t,n,r){let o=O(t);throw new m(`Option '${e}' for extension command '${r}' negates ${o} and expects true, false, 1, or 0; received ${JSON.stringify(n)}.`,p.USAGE,{code:"extension_flag_value_invalid",flag:o,required:`Pass ${o} as true or false, or '${e}' as true.`,why:`'${e}' is the negated spelling of the boolean ${o}, so only a boolean value can be inverted before the extension handler runs.`,nextSteps:[`Run pm contracts --command ${r} --flags-only --json to read each flag's value contract.`]})}function Nt(e,t,n){let r=Object.create(null),o=new Map;for(let[s,i]of Object.entries(e)){let{spelling:a,value:c}=At(t,s,i,n),d=q(t,a);if(d===void 0)r[a]=c;else if(c!==void 0){let l=o.get(d.handlerKey);l===void 0?(o.set(d.handlerKey,a),r[d.handlerKey]=c):it(xe(d.definition,d.handlerKey,r[d.handlerKey],t,n),xe(d.definition,d.handlerKey,c,t,n))||Ot(d.definition,d.handlerKey,[l,a],n)}}return r}function xe(e,t,n,r,o){let s={[t]:n};return Fe(s,[e],o),De(s,[e],Re(s,r),o)[t]}export{Pt as a,qt as b,jt as c,zt as d,Kt as e,ge as f,Wt as g,Bt as h,b as i,R as j,Me as k,Xt as l,Gt as m,Pe as n,Yt as o,qe as p,en as q,je as r,A as s,T as t,be as u,on as v,hn as w,gn as x,_n as y,On as z,Tn as A,Nn as B,Cn as C};
26
+ //# sourceMappingURL=chunk-DZMP3VYQ.js.map