@unbrained/pm-cli 2026.10.25 → 2026.10.26

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 (175) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/CHANGELOG.md +28 -0
  3. package/dist/cli/error-guidance.d.ts +5 -0
  4. package/dist/cli/error-guidance.js +2 -2
  5. package/dist/cli/register-mutation.js +2 -2
  6. package/dist/cli-bundle/bundle-manifest.json +1 -1
  7. package/dist/cli-bundle/chunks/{chunk-O3ZTGRIH.js → chunk-25MTQAHX.js} +2 -2
  8. package/dist/cli-bundle/chunks/{chunk-TLMXSYJA.js → chunk-57YPOOED.js} +2 -2
  9. package/dist/cli-bundle/chunks/{chunk-4GD6QOP6.js → chunk-7UDQAINZ.js} +3 -3
  10. package/dist/cli-bundle/chunks/{chunk-LNKPH2DD.js → chunk-ER7RLJW5.js} +2 -2
  11. package/dist/cli-bundle/chunks/{chunk-YCCGZHOR.js → chunk-MWCG25PO.js} +2 -2
  12. package/dist/cli-bundle/chunks/{chunk-444VPGQT.js → chunk-N6FTEILW.js} +5 -5
  13. package/dist/cli-bundle/chunks/{chunk-FNZT4BTE.js → chunk-NGKTROAO.js} +86 -86
  14. package/dist/cli-bundle/chunks/chunk-OCDRHIVQ.js +6 -0
  15. package/dist/cli-bundle/chunks/{chunk-3CYXE6BV.js → chunk-ONC4BBQP.js} +2 -2
  16. package/dist/cli-bundle/chunks/{chunk-RQKDANP7.js → chunk-OUDR2HWR.js} +3 -3
  17. package/dist/cli-bundle/chunks/{chunk-RD6UW3MW.js → chunk-T7T4WLUY.js} +3 -3
  18. package/dist/cli-bundle/chunks/{chunk-MVJGGCGQ.js → chunk-TGOG5BFM.js} +2 -2
  19. package/dist/cli-bundle/chunks/chunk-UF6EXZSP.js +2 -0
  20. package/dist/cli-bundle/chunks/chunk-VS2IIV3F.js +128 -0
  21. package/dist/cli-bundle/chunks/chunk-XAIR53QZ.js +2 -0
  22. package/dist/cli-bundle/chunks/{chunk-VAEB6IUQ.js → chunk-Y42DYMZX.js} +2 -2
  23. package/dist/cli-bundle/chunks/{chunk-EYCVAAIP.js → chunk-YJBIPNDL.js} +2 -2
  24. package/dist/cli-bundle/chunks/{chunk-UI3FD3DW.js → chunk-Z35XAHUN.js} +2 -2
  25. package/dist/cli-bundle/chunks/{chunk-7C3GCLOO.js → chunk-ZLVFUZI4.js} +27 -27
  26. package/dist/cli-bundle/chunks/{chunk-7T3H24HN.js → chunk-ZT64RDMF.js} +2 -2
  27. package/dist/cli-bundle/chunks/{indexed-receipt-blobs-47I6KKDO.js → indexed-receipt-blobs-NWQIDTH7.js} +2 -2
  28. package/dist/cli-bundle/chunks/{mutation-admission-747C6IUR.js → mutation-admission-VTNV6JV2.js} +2 -2
  29. package/dist/cli-bundle/chunks/{register-list-query-COST6KRV.js → register-list-query-LZDWUZS4.js} +2 -2
  30. package/dist/cli-bundle/chunks/register-mutation-M2A7PH42.js +20 -0
  31. package/dist/cli-bundle/chunks/{register-operations-S4LKLUBJ.js → register-operations-E7P2JTXM.js} +2 -2
  32. package/dist/cli-bundle/chunks/{register-setup-3ITZXPOL.js → register-setup-DOV7KGSH.js} +2 -2
  33. package/dist/cli-bundle/chunks/{settlement-hook-5IVCF6ZY.js → settlement-hook-SVD6CO7U.js} +2 -2
  34. package/dist/cli-bundle/chunks/{stage-3UUIYROS.js → stage-LYLEOAQB.js} +2 -2
  35. package/dist/cli-bundle/focused-chunks/{chunk-HMYDUEQK.js → chunk-226XKW3W.js} +3 -3
  36. package/dist/cli-bundle/focused-chunks/chunk-ABMNYWV6.js +2 -0
  37. package/dist/cli-bundle/focused-chunks/{chunk-3M5FZCMC.js → chunk-ADSBGYLW.js} +8 -8
  38. package/dist/cli-bundle/focused-chunks/{chunk-22727JYL.js → chunk-B266DDBJ.js} +2 -2
  39. package/dist/cli-bundle/focused-chunks/{chunk-Y4JHHY24.js → chunk-BH7RE2ZY.js} +2 -2
  40. package/dist/cli-bundle/focused-chunks/chunk-BL77VCRB.js +22 -0
  41. package/dist/cli-bundle/focused-chunks/{chunk-77NU7NPN.js → chunk-CSCZYSNZ.js} +2 -2
  42. package/dist/cli-bundle/focused-chunks/{chunk-URWYYJ7K.js → chunk-D5YQ4KAE.js} +2 -2
  43. package/dist/cli-bundle/focused-chunks/{chunk-ZYCOMRFT.js → chunk-E5C24MCV.js} +2 -2
  44. package/dist/cli-bundle/focused-chunks/{chunk-74KC7FUQ.js → chunk-I7H3XF25.js} +2 -2
  45. package/dist/cli-bundle/focused-chunks/chunk-IF6C43IP.js +2 -0
  46. package/dist/cli-bundle/focused-chunks/chunk-KERJNFXY.js +2 -0
  47. package/dist/cli-bundle/focused-chunks/{chunk-46KDJH3K.js → chunk-KTXU5WU6.js} +2 -2
  48. package/dist/cli-bundle/focused-chunks/chunk-NE27VCU7.js +91 -0
  49. package/dist/cli-bundle/focused-chunks/{chunk-NI5SG2M2.js → chunk-NFN2P4TW.js} +2 -2
  50. package/dist/cli-bundle/focused-chunks/{chunk-NC5HUGHU.js → chunk-NLZUI234.js} +4 -4
  51. package/dist/cli-bundle/focused-chunks/chunk-PK5FJIVA.js +12 -0
  52. package/dist/cli-bundle/focused-chunks/{chunk-LWJ2X75I.js → chunk-UHWTPOM4.js} +2 -2
  53. package/dist/cli-bundle/focused-chunks/{chunk-B5JOVH5F.js → chunk-UP765R2V.js} +2 -2
  54. package/dist/cli-bundle/focused-chunks/{chunk-U6HXIF6G.js → chunk-WDWHUJQW.js} +2 -2
  55. package/dist/cli-bundle/focused-chunks/{chunk-7DEZT4JN.js → chunk-YQKLKRMW.js} +2 -2
  56. package/dist/cli-bundle/focused-chunks/chunk-YTEC2EPM.js +3 -0
  57. package/dist/cli-bundle/focused-chunks/{chunk-3FM75SBJ.js → chunk-YW5GHQN2.js} +2 -2
  58. package/dist/cli-bundle/focused-chunks/{indexed-receipt-blobs-YCLN2ZZG.js → indexed-receipt-blobs-YFDNGHCM.js} +2 -2
  59. package/dist/cli-bundle/focused-chunks/{mutation-admission-BQBQXILV.js → mutation-admission-L42E3U5U.js} +2 -2
  60. package/dist/cli-bundle/focused-chunks/{settlement-hook-XVS6P2XI.js → settlement-hook-3CADO4XZ.js} +2 -2
  61. package/dist/cli-bundle/focused-chunks/{stage-VSIL4MTZ.js → stage-TUQHWU7N.js} +2 -2
  62. package/dist/cli-bundle/main.js +4 -4
  63. package/dist/cli-bundle/sdk-authoring.js +1 -1
  64. package/dist/cli-bundle/sdk-contracts.js +2 -2
  65. package/dist/cli-bundle/sdk-core.js +23 -23
  66. package/dist/cli-bundle/sdk-governance.js +1 -1
  67. package/dist/cli-bundle/sdk-graph.js +1 -1
  68. package/dist/cli-bundle/sdk-merge.js +57 -57
  69. package/dist/cli-bundle/sdk-query.js +1 -1
  70. package/dist/cli-bundle/sdk-runtime.js +1 -1
  71. package/dist/cli-bundle/sdk-testing.js +1 -1
  72. package/dist/cli-bundle/sdk.js +9 -9
  73. package/dist/core/extensions/extension-types.d.ts +3 -0
  74. package/dist/core/extensions/extension-types.js +1 -1
  75. package/dist/core/output/mutation-projection.js +1 -1
  76. package/dist/core/policy/workflow-policy-store.js +1 -1
  77. package/dist/core/shared/errors.d.ts +9 -0
  78. package/dist/core/shared/errors.js +1 -1
  79. package/dist/core/shared/secret-rules.d.ts +17 -0
  80. package/dist/core/shared/secret-rules.js +2 -1
  81. package/dist/core/store/item-mutation-precondition.d.ts +8 -0
  82. package/dist/core/store/item-mutation-precondition.js +1 -1
  83. package/dist/core/store/item-store.js +1 -1
  84. package/dist/sdk/cli-contracts/commander-mutation-options.js +1 -1
  85. package/dist/sdk/cli-contracts/completeness.js +1 -1
  86. package/dist/sdk/cli-contracts/flag-contracts.js +1 -1
  87. package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +1 -1
  88. package/dist/sdk/cli-contracts/registration-helpers.d.ts +1 -1
  89. package/dist/sdk/cli-contracts/registration-helpers.js +1 -1
  90. package/dist/sdk/cli-contracts/tool-option-contracts.d.ts +4 -0
  91. package/dist/sdk/cli-contracts/tool-option-contracts.js +1 -1
  92. package/dist/sdk/cli-contracts/tool-parameter-tables.js +1 -1
  93. package/dist/sdk/cli-contracts/tool-schema.d.ts +2 -2
  94. package/dist/sdk/cli-contracts/tool-schema.js +1 -1
  95. package/dist/sdk/context-signal-store.js +2 -2
  96. package/dist/sdk/core.d.ts +1 -1
  97. package/dist/sdk/core.js +1 -1
  98. package/dist/sdk/extension-command-context.js +2 -2
  99. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +1 -1
  100. package/dist/sdk/index.d.ts +2 -1
  101. package/dist/sdk/index.js +1 -1
  102. package/dist/sdk/item-transaction.js +1 -1
  103. package/dist/sdk/lifecycle/close-many.d.ts +3 -0
  104. package/dist/sdk/lifecycle/close-many.js +1 -1
  105. package/dist/sdk/lifecycle/close.d.ts +3 -1
  106. package/dist/sdk/lifecycle/close.js +1 -1
  107. package/dist/sdk/lifecycle/create.d.ts +2 -0
  108. package/dist/sdk/lifecycle/create.js +1 -1
  109. package/dist/sdk/lifecycle/plan.d.ts +2 -0
  110. package/dist/sdk/lifecycle/plan.js +1 -1
  111. package/dist/sdk/lifecycle/restore.js +1 -1
  112. package/dist/sdk/lifecycle-policy.d.ts +11 -0
  113. package/dist/sdk/lifecycle-policy.js +1 -1
  114. package/dist/sdk/mutation-guard.d.ts +6 -1
  115. package/dist/sdk/mutation-guard.js +1 -1
  116. package/dist/sdk/output/fit-envelope.d.ts +98 -0
  117. package/dist/sdk/output/fit-envelope.js +2 -0
  118. package/dist/sdk/public-surface.json +1 -1
  119. package/dist/sdk/query.d.ts +1 -0
  120. package/dist/sdk/query.js +1 -1
  121. package/dist/sdk/read-output-session.d.ts +1 -1
  122. package/dist/sdk/read-output-session.js +1 -1
  123. package/dist/sdk/runtime-input.js +1 -1
  124. package/dist/sdk/runtime-primitives.d.ts +1 -1
  125. package/dist/sdk/runtime-primitives.js +1 -1
  126. package/dist/sdk/runtime.d.ts +2 -2
  127. package/dist/sdk/runtime.js +1 -1
  128. package/dist/sdk/scheduling-shortcuts.d.ts +2 -0
  129. package/dist/sdk/scheduling-shortcuts.js +1 -1
  130. package/dist/sdk/workspace-transaction.d.ts +3 -1
  131. package/dist/sdk/workspace-transaction.js +2 -2
  132. package/docs/COMMANDS.md +2 -1
  133. package/docs/MUTATION_INTEGRITY.md +33 -0
  134. package/docs/QUALITY_EVIDENCE.md +9 -0
  135. package/docs/READ_OUTPUT_CONTRACTS.md +55 -1
  136. package/docs/SDK.md +88 -6
  137. package/docs/WORKFLOW_POLICIES.md +14 -1
  138. package/docs/agent-task-token-baseline.json +1 -1
  139. package/docs/agent-task-transcripts.json +1 -1
  140. package/docs/generated/FLAG_LEXICON_BUDGETS.md +2 -2
  141. package/docs/generated/REFUSAL_CLOSURE_CENSUS.md +4 -3
  142. package/marketplace.json +1 -1
  143. package/package.json +1 -1
  144. package/packages/pm-beads/package.json +1 -1
  145. package/packages/pm-calendar/extensions/calendar/shortcuts.ts +2 -2
  146. package/packages/pm-calendar/package.json +1 -1
  147. package/packages/pm-command-kit/package.json +1 -1
  148. package/packages/pm-digital-twin/package.json +1 -1
  149. package/packages/pm-governance-audit/package.json +1 -1
  150. package/packages/pm-guide-shell/package.json +1 -1
  151. package/packages/pm-kanban/package.json +1 -1
  152. package/packages/pm-lifecycle-hooks/package.json +1 -1
  153. package/packages/pm-linked-test-adapters/package.json +1 -1
  154. package/packages/pm-search-advanced/package.json +1 -1
  155. package/packages/pm-templates/package.json +1 -1
  156. package/packages/pm-todos/package.json +1 -1
  157. package/packages/pm-vcs/package.json +1 -1
  158. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  159. package/plugins/pm-claude/package.json +1 -1
  160. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  161. package/plugins/pm-codex/package.json +1 -1
  162. package/plugins/pm-codex/plugin.json +1 -1
  163. package/runtime-dependencies.json +1 -1
  164. package/dist/cli-bundle/chunks/chunk-5ZPT67NJ.js +0 -127
  165. package/dist/cli-bundle/chunks/chunk-HMJSFWHK.js +0 -2
  166. package/dist/cli-bundle/chunks/chunk-RLXK2S7P.js +0 -2
  167. package/dist/cli-bundle/chunks/chunk-XYLBOXSH.js +0 -6
  168. package/dist/cli-bundle/chunks/register-mutation-JZVVJUHY.js +0 -20
  169. package/dist/cli-bundle/focused-chunks/chunk-5LBZR6YW.js +0 -2
  170. package/dist/cli-bundle/focused-chunks/chunk-IVLIUPVV.js +0 -12
  171. package/dist/cli-bundle/focused-chunks/chunk-KIIGME23.js +0 -2
  172. package/dist/cli-bundle/focused-chunks/chunk-MT5TYMEU.js +0 -3
  173. package/dist/cli-bundle/focused-chunks/chunk-QH5KMIYZ.js +0 -91
  174. package/dist/cli-bundle/focused-chunks/chunk-W7MCCFYV.js +0 -2
  175. package/dist/cli-bundle/focused-chunks/chunk-WMPDY5ZU.js +0 -21
@@ -1,20 +0,0 @@
1
- import{a as wt}from"./chunk-YCCGZHOR.js";import"./chunk-SGFQQXFD.js";import"./chunk-DEZPZOQ7.js";import{b as le,f as St,k as At,l as kt,m as _t,n as xt,p as Ct,q as Dt}from"./chunk-HMJSFWHK.js";import{a as he}from"./chunk-O3ZTGRIH.js";import{$ as Xt,A as vt,B as ht,C as bt,T as Bt,U as jt,V as qt,W as Vt,X as zt,Y as Jt,Z as Kt,_ as Wt,aa as ae,ba as ne,ca as re,p as ot,q as dt,r as ct,s as pt,t as te,u as oe,v as ie,w as ft,x as gt}from"./chunk-FNZT4BTE.js";import"./chunk-MVJGGCGQ.js";import"./chunk-XYLBOXSH.js";import{$a as lt,Hc as yt,Qa as at,Ya as nt,Zb as ee,_a as rt,ab as st,tc as ut,ya as tt,yc as mt}from"./chunk-7C3GCLOO.js";import"./chunk-RLXK2S7P.js";import{$ as Ye,A as xe,B as Ce,C as De,D as Ie,E as Re,G as Te,H as Ee,I as Oe,J as Fe,K as Me,L as Pe,M as Ne,N as $e,O as He,P as Le,Q as Ue,R as Ge,S as Be,T as je,U as qe,V as Ve,W as ze,X as Je,Y as Ke,Z as We,_ as Xe,aa as Ze,ba as Qe,ca as et,x as L}from"./chunk-4GD6QOP6.js";import{sa as it,zb as Q}from"./chunk-444VPGQT.js";import"./chunk-4D25HF3V.js";import{Jf as E,Kc as I,Le as W,Nf as y,Oe as Ae,Qf as c,Rc as z,Rf as l,Sf as w,Tf as O,Uc as J,Uf as H,Vf as X,Wf as Y,Xf as _e,cc as we,gg as b,nc as V,oc as Se,uc as C,xf as ke,ye as K}from"./chunk-5ZPT67NJ.js";import"./chunk-RUKSEZE7.js";import"./chunk-TLMXSYJA.js";import{o as Z}from"./chunk-RD6UW3MW.js";import"./chunk-IB7UB5TE.js";import{Cd as j,Kf as h,N as ye,Nf as f,Of as v,Sa as ve,ga as ge,jb as B,og as be,oh as q,xa as x,zi as T}from"./chunk-RQKDANP7.js";import"./chunk-LNKPH2DD.js";import"./chunk-VS565KBX.js";import{A as p,C as u}from"./chunk-3CYXE6BV.js";import{a as fe}from"./chunk-XAWE4EAK.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]="48b9050b-3290-55d6-82cc-b9d14cc33186")}catch{}})();(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]="f111051f-3880-5ff0-9138-5166cd8a93a9")}catch{}})();(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]="e599b2e9-fc63-5982-b7cf-ae208c127f62")}catch{}})();(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]="fd8685dd-856f-51b2-9bfa-f1df88acb070")}catch{}})();(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]="e972ba26-a7b8-5e91-9e63-21416be686eb")}catch{}})();(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]="a310e747-0cd7-5dff-b8a0-29d3c4ded9f3")}catch{}})();(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]="f27f4c13-4b15-5536-bc5a-b1f263fab5db")}catch{}})();(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]="529dd34d-5a81-504f-9641-28093d41d247")}catch{}})();(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]="6e6bec6b-9415-5f41-87e8-2d1248fba748")}catch{}})();(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]="fd91be06-efd5-5b43-895a-e47a1c144333")}catch{}})();(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]="5760feb1-435b-5b0e-b4ed-c22f6a955bed")}catch{}})();var F={};fe(F,{PROFILE_SUBCOMMANDS:()=>Bt,formatProfileApplyHuman:()=>Xt,formatProfileLintHuman:()=>Wt,formatProfileListHuman:()=>Jt,formatProfileShowHuman:()=>Kt,runProfileApply:()=>zt,runProfileLint:()=>Vt,runProfileList:()=>jt,runProfileShow:()=>qt});(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]="2d367793-8aa5-5a00-8c8c-60512a27f62a")}catch{}})();(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]="e8448334-e87d-5984-9e89-04e506e0a2a7")}catch{}})();(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]="12792dbc-d8ac-50aa-8ebd-bc68a70fa195")}catch{}})();async function se(e){typeof e.description=="string"&&e.description.trim()==="-"&&(e.description=await C().resolveValue(e.description,"--description")??"")}import{readFile as Yt}from"node:fs/promises";import Zt from"node:path";(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]="6154c844-0615-5c2a-ac12-48cb73783d53")}catch{}})();async function Qt(e,t,o,i){let a=y(i),r=o.expectedResult??o.expected,n=await ft(e,t,{status:typeof o.status=="string"?o.status:void 0,expectedResult:typeof r=="string"?r:void 0,author:typeof o.author=="string"?o.author:a.author,message:typeof o.message=="string"?o.message:void 0,force:o.force===!0},a);await b(a,n),f(n,a)}async function eo(e,t){let o=typeof e.from=="string"?e.from.trim():"";if(o.length>0&&o!=="-"){if(t.getOptionValueSource("stdinJson")==="cli")throw new u("pm item mutate cannot combine --from <path> with explicit --stdin-json. Select one input source.",p.USAGE);try{return await Yt(Zt.resolve(process.cwd(),o),"utf8")}catch(i){throw new u(`pm item mutate could not read --from ${o}: ${he(i)}`,p.USAGE,{code:"mutation_document_unreadable",required:"Pass a readable JSON, JSON Lines, or envelope document path, or `-` for stdin.",why:"The whole document must be available before any tracker write begins."})}}return await C().resolveValue("-","--stdin-json")??""}async function to(e,t){let o=y(t),i=await eo(e,t);if(i.trim().length===0)throw new u("pm item mutate requires a non-empty JSON batch on stdin or via --from <path>.",p.USAGE);if(e.transactionId!==void 0&&(typeof e.transactionId!="string"||e.transactionId.trim().length===0))throw new u("pm item mutate requires --transaction-id <value> to be non-empty when provided.",p.USAGE);let a=x(process.cwd(),o.path),r=await T(a),n=await Dt({pmRoot:a,input:i,settings:r,...typeof e.transactionId=="string"?{transactionId:e.transactionId}:{},...typeof e.upsertKey=="string"?{upsertKey:e.upsertKey}:{}}),{mutations:s,references:d,rows:m}=n,g=n.transaction_id,S={transaction_id:g,transaction_id_source:n.transaction_id_source,...n.upsert_key===void 0?{}:{upsert_key:n.upsert_key}},A=le(e),D=q(typeof e.author=="string"?e.author:o.author,r.author_default);if(e.dryRun===!0){let R=await Ct({pmRoot:a,author:D,plan:n});f({...S,dry_run:!0,validation:R.validation,mutation_count:s.length,mutations:s,references:d,rows:R.rows},o);return}let $=await kt({pmRoot:a,transactionId:g,author:D,mutations:s,...A});f({...$,...S,mutation_count:s.length,references:d,rows:m},o)}function oo(e,t){return typeof e=="string"&&e.trim().length>0?e.trim():typeof t=="string"?t.trim():""}async function io(e,t,o,i){let a=y(i),r=typeof o.transactionId=="string"?o.transactionId.trim():"";if(r.length===0)throw new u("pm item complete requires --transaction-id <value>.",p.USAGE);let n=oo(t,o.reason);if(n.length===0)throw new u("pm item complete requires a close reason.",p.USAGE);let s=Object.fromEntries(["file","doc","test","comment","note","learning"].filter(k=>o[k]!==void 0).map(k=>[k,o[k]])),d=o.force===!0,{lockTtlSeconds:m,lockWaitMs:g}=le(o),S={...typeof o.resolution=="string"?{resolution:o.resolution}:{},...typeof o.expectedResult=="string"?{expectedResult:o.expectedResult}:{},...typeof o.actualResult=="string"?{actualResult:o.actualResult}:{},...typeof o.completedAt=="string"?{completedAt:o.completedAt}:{},...typeof o.validateClose=="string"?{validateClose:o.validateClose}:{},...d?{force:!0}:{}},A={id:e,reason:n,...Object.keys(s).length===0?{}:{evidence:s},...Object.keys(S).length===0?{}:{closeOptions:S},...d?{releaseOptions:{force:!0}}:{}},D=x(process.cwd(),a.path),$=q(typeof o.author=="string"?o.author:a.author,(await T(D)).author_default);if(o.dryRun===!0){let k=_t(A),Gt=await At({pmRoot:D,transactionId:r,author:$,mutations:k});f({transaction_id:r,dry_run:!0,validation:Gt,mutation_count:k.length,mutations:k},a);return}let R=await xt({pmRoot:D,transactionId:r,author:$,...A,lockTtlSeconds:m,lockWaitMs:g});f({...R,mutation_count:Object.keys(R.results).length},a)}function It(e){let t=e.commands.find(o=>o.name()==="item")??e.command("item").description("Run item lifecycle operations.");t.command("reopen <id> <reason>").option("--status <value>","Active target status: open or in_progress").option("--expected-result <value>","Current active planning expectation; otherwise the receipt offers recovery").option("--expected <value>","Alias for --expected-result").option("--message <value>","Human-readable recurrence history message").option("--force","Override ownership or stale-lock conflicts").option("--author <value>","Mutation author").description("Reopen terminal work with recurrence evidence.").action(Qt),t.command("mutate").option("--transaction-id <value>","Stable idempotency key used to resume an interrupted batch; derived from the document when omitted").option("--stdin-json","Read the JSON mutation array from stdin",!0).option("--from <path>","Read the JSON, JSON Lines, or envelope document from a file (- for stdin)").option("--upsert-key <field>","Update the existing item whose field matches instead of creating a duplicate").option("--dry-run","Validate and preview the batch without writing").option("--create-compensation <mode>","Created-item compensation policy: close or delete","close").option("--lock-ttl-seconds <n>","Workspace transaction lock lifetime in seconds").option("--lock-wait-ms <n>","Maximum time to wait for the workspace transaction lock").option("--author <value>","Mutation author").description("Apply SDK-backed mutations atomically.").action(to),t.command("complete <id> [reason]").requiredOption("--transaction-id <value>","Stable idempotency key for the composed completion").option("--reason <value>","Close reason when omitted positionally").option("--file <value>","Linked file evidence",c).option("--doc <value>","Linked documentation evidence",c).option("--test <value>","Linked test evidence",c).option("--comment <value>","Evidence comment",c).option("--note <value>","Completion note",c).option("--learning <value>","Durable completion learning",c).option("--resolution <value>","Structured resolution evidence").option("--expected-result <value>","Expected result evidence").option("--actual-result <value>","Actual result evidence").option("--completed-at <value>","Actual completion time").option("--validate-close <mode>","Close validation: off, warn, or strict").option("--lock-ttl-seconds <n>","Workspace transaction lock lifetime in seconds").option("--lock-wait-ms <n>","Maximum time to wait for the workspace transaction lock").option("--dry-run","Validate and preview completion without writing").option("--force","Override lifecycle and ownership conflicts").option("--author <value>","Completion author").description("Close with evidence and release the claim.").action(io)}(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]="458845bd-2d07-59d5-b322-6ab634fcefa9")}catch{}})();async function ao(e,t){let o=y(t),i=Array.isArray(e.event)?e.event:[],a=await tt(x(process.cwd(),o.path),{historyEvent:i,allActionable:e.allActionable===!0,dryRun:e.dryRun===!0,planFingerprint:l(e,"planFingerprint"),limit:e.limit,attributedAuthor:l(e,"attributedAuthor"),reviewer:l(e,"reviewer"),reason:l(e,"reason")});f(a,o)}function Rt(e){e.command("history-author-acknowledge").option("--event <item-id:line>","Unknown-author event coordinate (repeatable)",c).option("--all-actionable","Select all actionable events").option("--dry-run","Preview a deterministic source-bound plan").option("--plan-fingerprint <sha256>","Apply the exact fingerprint returned by --dry-run").option("--limit <n>","Maximum coordinate rows returned in the plan").option("--attributed-author <value>","Reviewed principal attribution").option("--reviewer <value>","Disposition reviewer").option("--reason <value>","Review evidence").description("Append audited dispositions for immutable unknown-author events.").action(ao)}(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]="53ca90df-8382-5cc2-8906-8491afe5101a")}catch{}})();(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]="e2514244-d31d-5ee4-b037-b9101f9a24e1")}catch{}})();(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]="10a4ed4d-39d3-5b7b-87b1-4a6f95f0f2ab")}catch{}})();(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]="796e71dc-4693-50da-bbb8-57b19ff0af95")}catch{}})();(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]="e464e0e0-01a2-56c9-a05d-9b1b9dd6a6ee")}catch{}})();function de(e,t,o,i){if(t.trim().toLowerCase()!=="add"||!o?.trim())return;let a=l(i,"add")??l(i,"text")??l(i,"note")??l(i,"body")??l(i,"comment"),r=l(i,"file"),n=[e,o.trim()];a!==void 0?n.push("--add",a):i.stdin===!0?n.push("--stdin"):r!==void 0?n.push("--file",r):n.push("--add","-");let s=j(n),d=j([e,o.trim(),"--add","-"]);throw new u(`The positional token "add" was parsed as the item id, while "${o.trim()}" was parsed as annotation text. ${e} does not use an add subcommand.`,p.USAGE,{code:"annotation_transposed_subcommand",reason:"noun_verb_object_transposition",required:`Place the item id immediately after ${e}, then use --add for annotation text.`,examples:[...new Set([s,d])],recovery:{attempted_command:`pm ${e} add ${o.trim()}`,normalized_args:[e,"add",o.trim()],parsed_positionals:[{role:"transposed_subcommand",value:"add"},{role:"item_id",value:o.trim()}],suggested_retry:s}})}function Tt(e,t,o){let i=o.flatMap(a=>{let r=l(t,a);return r===void 0?[]:[{alias:a,value:r}]});if([...new Set(i.map(({value:a})=>a))].length>1)throw new u(`Specify ${e} text with one alias or the same value across aliases: ${i.map(({alias:a})=>`--${a}`).join(", ")}`,p.USAGE,{code:"annotation_alias_conflict"});return i[0]?.value}function no(e,t){let o=typeof t.edit=="number"?t.edit:void 0,i=typeof t.delete=="number"?t.delete:void 0,a=Tt("comment",t,["add","text","body","comment"]),r=typeof e=="string"?e:void 0,n=t.stdin===!0,s=l(t,"file");if(+(a!==void 0)+ +(r!==void 0)+Number(n)+ +(s!==void 0)>1)throw a!==void 0&&r!==void 0&&!n&&s===void 0?new u("Specify comment text either as positional [text] or with --add, not both",p.USAGE):new u("Specify comment text with exactly one source: positional [text], --add, --stdin, or --file",p.USAGE);let d=a??r;return{add:d,readFromStdin:n,readFromFile:s,editIndex:o,deleteIndex:i,isMutation:typeof d=="string"||n||s!==void 0||o!==void 0||i!==void 0}}function Et(e,t,o){let i=Tt(e,o,e==="note"?["add","text","note"]:["add","text"]),a=typeof t=="string"?t:void 0;if(i!==void 0&&a!==void 0)throw new u(`Specify ${e} text either as positional [text] or with --add, not both`,p.USAGE);let r=i??a,n=e==="note"?l(o,"addJson"):void 0,s=o.stdin===!0,d=l(o,"file"),m=typeof o.edit=="number"?o.edit:void 0,g=typeof o.delete=="number"?o.delete:void 0;return{add:r,addJson:n,readFromStdin:s,readFromFile:d,editIndex:m,deleteIndex:g,isMutation:typeof r=="string"||n!==void 0||s||d!==void 0||m!==void 0||g!==void 0}}async function ro(e,t,o,i){let a=y(i),r=Date.now();de("comments",e,t,o);let n=no(t,o),s=await ot(e,{add:n.add,stdin:n.readFromStdin,file:n.readFromFile,edit:n.editIndex,delete:n.deleteIndex,limit:l(o,"limit"),fullHistory:o.fullHistory===!0,ifAbsent:o.ifAbsent===!0,author:l(o,"author"),message:l(o,"message"),ownershipAppendBypass:o.ownershipAppendBypass===!0,force:!!o.force},a);n.isMutation&&s.changed!==!1&&await b(a,s),ce("comments",s,a,r)}async function lo(e,t,o,i){let a=y(i),r=Date.now();de("notes",e,t,o);let n=Et("note",t,o),s=await bt(e,{add:n.add,addJson:n.addJson,stdin:n.readFromStdin,file:n.readFromFile,edit:n.editIndex,delete:n.deleteIndex,limit:l(o,"limit"),since:l(o,"since"),eventType:l(o,"eventType"),includeMeta:o.includeMeta===!0,fullHistory:o.fullHistory===!0,ifAbsent:o.ifAbsent===!0,author:l(o,"author"),message:l(o,"message"),ownershipAppendBypass:o.ownershipAppendBypass===!0,force:!!o.force},a);n.isMutation&&s.changed!==!1&&await b(a,s),ce("notes",s,a,r)}async function so(e,t,o,i){let a=y(i),r=Date.now();de("learnings",e,t,o);let n=Et("learning",t,o),s=await dt(e,{add:n.add,stdin:n.readFromStdin,file:n.readFromFile,edit:n.editIndex,delete:n.deleteIndex,limit:l(o,"limit"),fullHistory:o.fullHistory===!0,ifAbsent:o.ifAbsent===!0,author:l(o,"author"),message:l(o,"message"),ownershipAppendBypass:o.ownershipAppendBypass===!0,force:!!o.force},a);n.isMutation&&s.changed!==!1&&await b(a,s),ce("learnings",s,a,r)}function ce(e,t,o,i){f(t,o),o.profile&&v(`profile:command=${e} took_ms=${Date.now()-i}`)}function Ot(e,t){let o=e.command("comments").argument("<id>","Item id").argument("[text]","Optional comment text shorthand (equivalent to --add)").option("--add <text>","Append comment text; use text=<value> for structured input or - for stdin").option("--stdin","Read comment text from stdin (supports multiline markdown)").option("--file <path>","Read comment text from a file or stdin (-)").option("--edit <index>","Replace one comment using positional text, --add, --stdin, or --file",t("--edit")).option("--delete <index>","Delete the comment at 1-based <index>",t("--delete")).option("--limit <n>","Return only latest n comments").option("--full-history","Return complete comment history instead of a bounded mutation receipt").option("--if-absent","Append only when resolved author and text are absent").option("--author [value]","Comment author; defaults to PM_AUTHOR or settings").option("--message <value>","History message").option("--force","Force ownership override").description("List, add, edit, or delete comments for an item.").action(ro);w(o,"--body <text>","Alias for --add",!1),w(o,"--text <text>","Alias for --add",!1),w(o,"--comment <text>","Alias for --add",!1);let i=e.command("notes").argument("<id>","Item id").argument("[text]","Optional note text shorthand for --add").option("--add <text>","Add a text note (- reads stdin)").option("--note <text>","Alias for --add").option("--add-json <json>","Append a JSON event").option("--stdin","Read note text from stdin").option("--file <path>","Read note from file or stdin (-)").option("--edit <index>","Replace a 1-based note using the selected text input",t("--edit")).option("--delete <index>","Delete the note at 1-based <index>",t("--delete")).option("--limit <n>","Return only latest n notes").option("--since <timestamp>","Filter JSON events from this ISO time").option("--event-type <value>","Filter JSON events by top-level type").option("--include-meta","Include count and truncation metadata").option("--full-history","Return complete note history instead of a bounded receipt").option("--if-absent","Append only when resolved author and text are absent").option("--author [value]","Author; defaults to PM_AUTHOR/settings").option("--message <value>","History message").option("--force","Force ownership override").description("Manage merge-safe text notes and JSON context events.").action(lo);w(i,"--text <text>","Alias for --add",!1);let a=e.command("learnings").argument("<id>","Item id").argument("[text]","Optional learning text shorthand for --add").option("--add <text>","Append learning text; use text=<value> or - for stdin").option("--stdin","Read learning text from stdin").option("--file <path>","Read learning text from a file or stdin (-)").option("--edit <index>","Replace one learning using positional text, --add, --stdin, or --file",t("--edit")).option("--delete <index>","Delete the learning at 1-based <index>",t("--delete")).option("--limit <n>","Return only latest n learnings").option("--full-history","Return complete learning history instead of a bounded receipt").option("--if-absent","Append only when resolved author and text are absent").option("--author [value]","Learning author (optional; falls back to PM_AUTHOR/settings)").option("--message <value>","History message").option("--force","Force ownership override").description("List, add, edit, or delete learnings for an item.").action(so);w(a,"--text <text>","Alias for --add",!1)}(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]="d861c49e-6054-54af-a733-069cd9238f8a")}catch{}})();function pe(e,t){return o=>{let i=Number(o);if(!Number.isInteger(i)||i<t)throw new u(`${e} must be an integer greater than or equal to ${t}.`,p.USAGE);return i}}async function co(e,t,o){let i=y(o);if(t.scope!==void 0&&t.scope!=="project"&&t.scope!=="global")throw new u("--scope must be either project or global.",p.USAGE);let a=await lt({paths:e,scope:t.scope,limit:typeof t.limit=="number"?t.limit:void 0,offset:typeof t.offset=="number"?t.offset:void 0,noTruncate:t.noTruncate===!0,strictRead:t.strictRead===!0,explain:t.explain===!0,lineRange:typeof t.lines=="string"?nt(t.lines):void 0,decisionDepth:typeof t.decisionDepth=="number"?t.decisionDepth:void 0},i);f(a,i)}function Ft(e){e.command("lookup").argument("<paths...>","Project-relative or absolute source paths").option("--scope <scope>","Restrict links to project or global scope").option("--limit <n>","Maximum referencing items to return",pe("--limit",1)).option("--offset <n>","Number of referencing items to skip",pe("--offset",0)).option("--no-truncate","Return every referencing item").option("--strict-read","Fail when any authoritative item cannot be read").option("--explain","Include ranked source-to-work rationale").option("--lines <start:end>","Attribute an inclusive source line range").option("--decision-depth <n>","Maximum governing-decision relationship depth",pe("--decision-depth",1)).description("Find and explain pm items that govern requested source paths.").action(co)}(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]="016842ad-f6e8-56a4-9b9f-f4eaf4c1be71")}catch{}})();var po=["add-","apply-","list-","remove-","show-"],uo=new Set(["field","fields","help","status","statuses","type","types"]);function ue(e){let t=e.trim(),o=t.toLowerCase();return o.length===0?!1:t[0]===o[0]||uo.has(o)||po.some(i=>o.startsWith(i))}function U(e){if(e!=null){if(typeof e=="number"){if(!Number.isInteger(e))throw new u("--order must be a finite integer.",p.USAGE);return e}if(typeof e=="string"){if(e.trim().length===0)return;let t=Number(e);if(!Number.isInteger(t))throw new u("--order must be a finite integer.",p.USAGE);return t}throw new u("--order must be a finite integer.",p.USAGE)}}(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]="7f9ea812-e170-5c91-a646-88286797d97d")}catch{}})();function M(e){if(Array.isArray(e))return e;if(typeof e=="string")return[e]}var P={};fe(P,{SCHEMA_SUBCOMMANDS:()=>De,_testOnlySchemaCommand:()=>et,formatSchemaAddFieldHuman:()=>Ke,formatSchemaAddStatusHuman:()=>je,formatSchemaAddTypeHuman:()=>Ge,formatSchemaApplyPresetHuman:()=>Ze,formatSchemaEvolutionMigrationHuman:()=>Ce,formatSchemaInferTypesHuman:()=>Qe,formatSchemaListFieldsHuman:()=>Xe,formatSchemaListHuman:()=>Ve,formatSchemaRemoveFieldHuman:()=>We,formatSchemaRemoveStatusHuman:()=>qe,formatSchemaRemoveTypeHuman:()=>Be,formatSchemaShowFieldHuman:()=>Ye,formatSchemaShowHuman:()=>ze,formatSchemaShowStatusHuman:()=>Je,runSchemaAddField:()=>Pe,runSchemaAddStatus:()=>Te,runSchemaAddType:()=>Ie,runSchemaApplyPreset:()=>Le,runSchemaEvolutionMigration:()=>xe,runSchemaInferTypes:()=>Ue,runSchemaList:()=>Oe,runSchemaListFields:()=>$e,runSchemaRemoveField:()=>Ne,runSchemaRemoveStatus:()=>Ee,runSchemaRemoveType:()=>Re,runSchemaShow:()=>Fe,runSchemaShowField:()=>He,runSchemaShowStatus:()=>Me,runWorkflowPolicyAction:()=>L});(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]="a4b4d693-ba4c-529a-a5d4-8f6c874830ad")}catch{}})();(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]="f3dbaad8-f73e-5d14-aeaa-aaf077a944f6")}catch{}})();function mo(e,t){let o=t.normalizedSubcommand;return o!=="rename-type"&&o!=="rename-field"&&o!=="remap-status"?null:e.runSchemaEvolutionMigration({kind:o,from:t.typeName,to:l(t.options,"to"),...o==="rename-field"&&typeof t.options.type=="string"?{type:t.options.type}:{}},{migrationId:l(t.options,"migrationId")??l(t.options,"migration_id"),dryRun:t.options.dryRun===!0,author:t.author,force:t.force},t.globalOptions)}function fo(e,t){let{normalizedSubcommand:o,typeName:i,globalOptions:a,author:r,force:n}=t;switch(o){case"list":return e.runSchemaList(a);case"show":return e.runSchemaShow(i,a);case"show-status":return e.runSchemaShowStatus(i,a);case"list-fields":return e.runSchemaListFields(a);case"show-field":return e.runSchemaShowField(i,a);case"remove-type":return e.runSchemaRemoveType(i,{author:r,force:n},a);case"remove-field":return e.runSchemaRemoveField(i,{author:r,force:n},a);case"remove-status":return e.runSchemaRemoveStatus(i,{author:r,force:n},a);case"apply-preset":return e.runSchemaApplyPreset(i,{author:r,force:n},a);default:return null}}async function yo(e,t){let{normalizedSubcommand:o,typeName:i,options:a,globalOptions:r}=t,{author:n,force:s,description:d}=t,m=mo(e,t);if(m)return m;let g=fo(e,t);if(g)return g;switch(o){case"add-field":return e.runSchemaAddField(i,{type:typeof a.type=="string"?a.type:void 0,commands:t.commands,description:d,cliFlag:typeof a.cliFlag=="string"?a.cliFlag:void 0,alias:t.aliases,required:!!a.required,requiredOnCreate:!!a.requiredOnCreate,allowUnset:a.allowUnset!==!1,requiredTypes:t.requiredTypes,author:n,force:s},r);case"add-status":return e.runSchemaAddStatus(i,{role:t.roles,alias:t.aliases,description:d,order:t.order,author:n,force:s},r);default:return a.infer===!0?e.runSchemaInferTypes({minCount:t.minCount,apply:!!a.apply,author:n,force:s},r):e.runSchemaAddType(i,{description:d,defaultStatus:t.defaultStatus,folder:typeof a.folder=="string"?a.folder:void 0,alias:t.aliases,author:n,force:s},r)}}function go(e,t){if("migration_id"in t){h(`${e.formatSchemaEvolutionMigrationHuman(t)}
2
- `);return}switch(t.action){case"list":h(`${e.formatSchemaListHuman(t)}
3
- `);return;case"show":h(`${e.formatSchemaShowHuman(t)}
4
- `);return;case"show-status":h(`${e.formatSchemaShowStatusHuman(t)}
5
- `);return;case"list-fields":h(`${e.formatSchemaListFieldsHuman(t)}
6
- `);return;case"show-field":h(`${e.formatSchemaShowFieldHuman(t)}
7
- `);return;case"remove-type":h(`${e.formatSchemaRemoveTypeHuman(t)}
8
- `);break;case"remove-field":h(`${e.formatSchemaRemoveFieldHuman(t)}
9
- `);break;case"apply-preset":h(`${e.formatSchemaApplyPresetHuman(t)}
10
- `);break;case"infer-types":h(`${e.formatSchemaInferTypesHuman(t)}
11
- `);break;case"add-field":h(`${e.formatSchemaAddFieldHuman(t)}
12
- `);break;case"add-status":h(`${e.formatSchemaAddStatusHuman(t)}
13
- `);break;case"remove-status":h(`${e.formatSchemaRemoveStatusHuman(t)}
14
- `);break;default:h(`${e.formatSchemaAddTypeHuman(t)}
15
- `);break}t.warnings.length>0&&v(`schema ${t.action} warnings: ${H(t.warnings)}`)}function Mt(e){if(Array.isArray(e))return e.flatMap(t=>t.split(",")).map(t=>t.trim()).filter(t=>t.length>0)}async function vo(e,t,o,i){let a=y(i),r=Date.now(),{SCHEMA_SUBCOMMANDS:n}=P,s=(e??"").trim().toLowerCase(),d=t;if(ho(s,n),!n.includes(s)&&d===void 0&&!ue(e)&&(d=e,s="add-type"),!n.includes(s))throw I({command_path:"schema",token:s,allowed:n});let m=ve.find(g=>g===s);if(we(s,o.dryRun===!0),m)f(await L(m,t,{definition:o.definition,policy:l(o,"policy"),message:l(o,"message"),author:l(o,"author"),dryRun:o.dryRun===!0},a),a);else{let g=await yo(P,{normalizedSubcommand:s,typeName:d,options:o,aliases:M(o.alias),roles:M(o.role),commands:Mt(o.commands),requiredTypes:Mt(o.requiredTypes),defaultStatus:l(o,"defaultStatus")??l(o,"default_status"),order:U(o.order),minCount:U(o.minCount),author:l(o,"author"),force:!!o.force,description:l(o,"description"),globalOptions:a});a.json===!0||a.defaultOutputFormat==="json"?f(g,a):a.quiet||go(P,g)}a.profile&&v(`profile:command=schema took_ms=${Date.now()-r}`)}function ho(e,t){if(!e)throw new u(`pm schema requires a subcommand. Allowed: ${t.join(", ")}`,p.USAGE,{code:"missing_required_argument",examples:["pm schema list","pm schema show Task","pm schema show-status open",'pm schema add-type Spike --description "Time-boxed investigation" --default-status open',"pm schema remove-type Spike","pm schema add-status review --role active --alias in_review","pm schema remove-status review","pm schema add-field severity_level --type string --commands create,update","pm schema list-fields","pm schema apply-preset agile","pm schema add-type --infer --min-count 10","pm schema rename-type Spike --to Experiment --migration-id spike-v2 --dry-run","pm schema rename-field severity --to impact --migration-id severity-v2","pm schema remap-status review --to verifying --migration-id review-v2"]})}function Pt(e){let t=e.command("schema").option("--definition <json>","Policy or proposed fields JSON").option("--policy <id>","Policy id for policy-approve").option("--message <text>","Audit rationale for a policy mutation").argument("[subcommand]","Required; schema verb (list/show, add/remove, rename/remap, policy-*), or custom type shorthand").argument("[name]","Definition/source name or item id; policy-mode: advise|refuse").option("--description <text>","Type, status, or field description").option("--default-status <status>","Default status for this type").option("--folder <dir>","Storage folder for items of this custom type").option("--alias <name>","Alias for the custom type, status, or field flag (repeatable, csv-friendly)",c).option("--role <value>","Lifecycle role for a custom status (repeatable): draft, active, blocked, terminal, terminal_done, terminal_canceled, default_open, default_close, default_cancel",c).option("--order <n>","Display/sort order for a custom status").optionsGroup("Field options (add-field):").option("--type <type>","Value type for a custom field (add-field): string, number, boolean, string_array, array, object").option("--commands <list>","Field commands (repeatable/csv): create, update, update_many, list, search, calendar, context",c).option("--cli-flag <flag>","Override the auto-derived CLI flag for a custom field (add-field)").option("--required","Mark a custom field as always required (add-field)").option("--required-on-create","Mark a custom field as required at create time (add-field)").option("--no-allow-unset","Disallow clearing a custom field via --unset (add-field)").option("--required-types <list>","Restrict a custom field's requirement to specific item types (add-field; repeatable, comma-friendly)",c).optionsGroup("Type inference and migration options:").option("--infer","Infer custom item types from title-prefix conventions (add-type; preview unless --apply)").option("--min-count <n>","Minimum items sharing a prefix for add-type --infer (default 10)").option("--apply","Register inferred types (add-type --infer); without it the command previews only").option("--to <name>","Target definition name for rename/remap migrations").option("--migration-id <id>","Stable idempotency key for a resumable schema migration").option("--dry-run","Preview rename/remap migrations and workflow-policy actions without writes").option("--author <value>","Mutation author").option("--force","Force ownership/lock override").description("Manage types, statuses, fields, presets, and workflow policies.");w(t,"--default_status <status>","Alias for --default-status",!1),w(t,"--migration_id <id>","Alias for --migration-id",!1),t.action(vo)}(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]="9d4b7326-d103-505a-8bf1-6a2e3d176c1b")}catch{}})();var bo=new Set(ye.map(e=>e.toLowerCase())),wo=new Set(ke.map(e=>e==="estimate"?"estimatedMinutes":e));async function So(e,t,o,i,a){switch(t){case"list":return e.runProfileList();case"show":return e.runProfileShow(o);case"lint":return e.runProfileLint(o);default:return e.runProfileApply(o,{dryRun:i.dryRun===!0,author:typeof i.author=="string"?i.author:void 0,force:i.force===!0},a)}}function Ao(e,t){switch(t.action){case"list":h(`${e.formatProfileListHuman(t)}
16
- `);return;case"show":h(`${e.formatProfileShowHuman(t)}
17
- `);return;case"lint":h(`${e.formatProfileLintHuman(t)}
18
- `);return;default:h(`${e.formatProfileApplyHuman(t)}
19
- `),t.warnings.length>0&&v(`profile apply warnings: ${H(t.warnings)}`);break}}function ko(e){return t=>{let o=Number(t);if(!Number.isInteger(o)||o<1)throw new u(`${e} must be a positive integer (1-based index).`,p.USAGE);return o}}function Nt(e,t){e.option("--filter-has-notes",`Select only items that have notes before ${t}`).option("--filter-no-notes",`Select only items that have no notes before ${t}`).option("--filter-has-learnings",`Select only items that have learnings before ${t}`).option("--filter-no-learnings",`Select only items that have no learnings before ${t}`).option("--filter-has-files",`Select only items that have linked files before ${t}`).option("--filter-no-files",`Select only items that have no linked files before ${t}`).option("--filter-has-docs",`Select only items that have linked docs before ${t}`).option("--filter-no-docs",`Select only items that have no linked docs before ${t}`).option("--filter-has-tests",`Select only items that have linked tests before ${t}`).option("--filter-no-tests",`Select only items that have no linked tests before ${t}`).option("--filter-has-comments",`Select only items that have comments before ${t}`).option("--filter-no-comments",`Select only items that have no comments before ${t}`).option("--filter-has-deps",`Select only items that have dependencies before ${t}`).option("--filter-no-deps",`Select only items that have no dependencies before ${t}`).option("--filter-has-body",`Select only items that have a non-empty body before ${t}`).option("--filter-empty-body",`Select only items with an empty body before ${t}`).option("--filter-has-linked-command",`Select only items whose linked tests carry a runnable command before ${t}`).option("--filter-no-linked-command",`Select only items whose linked tests carry no runnable command before ${t}`).option("--filter-reviewer-missing",`Select only items missing reviewer before ${t}`).option("--filter-risk-missing",`Select only items missing risk before ${t}`).option("--filter-confidence-missing",`Select only items missing confidence before ${t}`).option("--filter-sprint-missing",`Select only items missing sprint before ${t}`).option("--filter-release-missing",`Select only items missing release before ${t}`)}var _o=[["filterHasNotes","filterNoNotes","--filter-has-notes","--filter-no-notes"],["filterHasLearnings","filterNoLearnings","--filter-has-learnings","--filter-no-learnings"],["filterHasFiles","filterNoFiles","--filter-has-files","--filter-no-files"],["filterHasDocs","filterNoDocs","--filter-has-docs","--filter-no-docs"],["filterHasTests","filterNoTests","--filter-has-tests","--filter-no-tests"],["filterHasComments","filterNoComments","--filter-has-comments","--filter-no-comments"],["filterHasDeps","filterNoDeps","--filter-has-deps","--filter-no-deps"],["filterHasBody","filterEmptyBody","--filter-has-body","--filter-empty-body"],["filterHasLinkedCommand","filterNoLinkedCommand","--filter-has-linked-command","--filter-no-linked-command"]];function $t(e){let t=o=>e[o]===!0?!0:void 0;for(let[o,i,a,r]of _o)if(e[o]===!0&&e[i]===!0)throw new u(`Cannot combine ${a} with ${r} for the same field.`,p.USAGE);return{filterReviewerMissing:t("filterReviewerMissing"),filterRiskMissing:t("filterRiskMissing"),filterConfidenceMissing:t("filterConfidenceMissing"),filterSprintMissing:t("filterSprintMissing"),filterReleaseMissing:t("filterReleaseMissing"),hasNotes:t("filterHasNotes"),hasLearnings:t("filterHasLearnings"),hasFiles:t("filterHasFiles"),hasDocs:t("filterHasDocs"),hasTests:t("filterHasTests"),hasComments:t("filterHasComments"),hasDeps:t("filterHasDeps"),hasBody:t("filterHasBody"),hasLinkedCommand:t("filterHasLinkedCommand"),noNotes:t("filterNoNotes"),noLearnings:t("filterNoLearnings"),noFiles:t("filterNoFiles"),noDocs:t("filterNoDocs"),noTests:t("filterNoTests"),noComments:t("filterNoComments"),noDeps:t("filterNoDeps"),emptyBody:t("filterEmptyBody"),noLinkedCommand:t("filterNoLinkedCommand")}}function me(e,t){for(let o of t){let i=[],a=e.args,r=n=>(e.args!==a&&(i.length=0,a=e.args),i.push(n),i);o.required?e.requiredOption(o.option,o.description):o.repeatable?e.option(o.option,o.description,r):e.option(o.option,o.description);for(let n of o.aliasOptions??[])K(o.option,n.option)?w(e,n.option,n.description,o.repeatable===!0,o.repeatable?r:void 0):o.repeatable?e.option(n.option,n.description,r):e.option(n.option,n.description)}}function xo(e){let t=o=>typeof e[o]=="string"?e[o]:void 0;return{type:t("filterType"),tag:t("filterTag"),priority:t("filterPriority"),deadlineBefore:t("filterDeadlineBefore"),deadlineAfter:t("filterDeadlineAfter"),updatedAfter:t("filterUpdatedAfter"),updatedBefore:t("filterUpdatedBefore"),createdAfter:t("filterCreatedAfter"),createdBefore:t("filterCreatedBefore"),ids:t("ids"),assignee:t("filterAssignee"),assigneeFilter:t("filterAssigneeFilter")??t("filterAssignee_filter"),parent:t("filterParent"),sprint:t("filterSprint"),release:t("filterRelease"),filterAcMissing:e.filterAcMissing===!0?!0:void 0,filterEstimatesMissing:e.filterEstimatesMissing===!0||e.filterEstimateMissing===!0?!0:void 0,filterResolutionMissing:e.filterResolutionMissing===!0?!0:void 0,filterMetadataMissing:e.filterMetadataMissing===!0?!0:void 0,...$t(e),limit:t("limit"),offset:t("offset"),includeBody:!0}}function N(...e){for(let t of e)if(typeof t=="string")return t}function Co(e,t,o){if(!(e!=="many"||t!==void 0||o.title!==void 0||o.type!==void 0))throw new u("pm create many is not a command; bulk creation is pm item mutate.",p.USAGE,{code:"bulk_create_route",required:"Pipe a JSON array, JSON Lines, or {schema_version, mutations} document to pm item mutate, or pass --from <path>.",why:"pm item mutate commits every record in one workspace transaction with a replay-safe transaction id, so an interrupted or repeated import never duplicates items.",nextSteps:["pm item mutate --from items.jsonl --dry-run --json","pm item mutate --from items.jsonl --upsert-key external_id --json","pm guide lifecycle"],examples:["pm item mutate --from items.jsonl --json",`printf '%s\\n' '{"title":"First","type":"Task"}' '{"title":"Second","type":"Task"}' | pm item mutate --json`]})}function Do(e,t,o){return typeof t=="string"&&t.length>0?{positionalType:e,positionalTitle:t}:typeof e!="string"||e.length===0?{positionalType:void 0,positionalTitle:void 0}:typeof o.title=="string"&&o.title.trim().length>0&&o.type===void 0?{positionalType:e,positionalTitle:void 0}:{positionalType:void 0,positionalTitle:e}}function Io(e,t,o){if(e!==void 0||typeof t!="string"||t.length===0||o.title!==void 0||o.type!==void 0||!bo.has(t.trim().toLowerCase()))return;let i=t.trim();throw new u(`pm create needs a title \u2014 "${i}" looks like an item type, not a title. Use either: pm create ${i} "<title>" or pm create "<title>" --type ${i}.`,p.USAGE,{code:"create_positional_type_without_title",why:'Without this guard the single positional is used as the title and the type defaults to Task \u2014 so the command would silently create a Task literally titled "'+i+'".',examples:[`pm create ${i} "Wire up SSO for the agent harness"`,`pm create "Wire up SSO for the agent harness" --type ${i}`],nextSteps:[`Re-run with both type and title: pm create ${i} "<title>"`]})}var Ro=["body","bodyFile","description","dep","depRemove","comment","note","learning","file","test","doc","reminder","event","typeOption","field","ids"];function G(e){let t=Ro.flatMap(o=>{let i=e[o],a=typeof i=="string"&&i.trim()==="-"?1:Array.isArray(i)?i.filter(n=>typeof n=="string"&&n.trim()==="-").length:0,r=`--${o.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`)}`;return Array.from({length:a},()=>r)});if(e.stdinJson===!0&&t.unshift("--stdin-json"),t.length>1)throw new u(`Only one option may consume stdin per command invocation. Found: ${t.join(", ")}.`,p.USAGE)}function Ht(e,t,o){let i=[];t&&i.push("body"),o&&i.push("description"),Se(e,i)}function Lt(e,t){return!t&&typeof e.description=="string"&&e.description.trim()==="-"}async function Ut(e,t,o,i){let a=await T(x(process.cwd(),i.path));return St(e,t,o,be(a.schema).definitions)}async function To(e,t,o,i){let a=y(i),r=Date.now();G(o);let n=o.stdinJson===!0;if(n){let A=await C().resolveValue("-","--stdin-json");o=await Ut(A??"","create",o,a)}Co(e,t,o);let s=Do(e,t,o);Io(s.positionalType,s.positionalTitle,o),typeof s.positionalType=="string"&&s.positionalType.length>0&&o.type===void 0&&(o.type=s.positionalType),typeof s.positionalTitle=="string"&&s.positionalTitle.length>0&&o.title===void 0&&(o.title=s.positionalTitle);let d=Lt(o,n);n||await se(o);let m=typeof o.bodyFile=="string";m&&(o.body=await J(String(o.bodyFile),o.body!==void 0?String(o.body):void 0),delete o.bodyFile);let g=X(o,{requireType:!1});Ht(g,m,d),n&&V(g);let S=await ut(g,a);await b(a,S),f(S,a),a.profile&&v(`profile:command=create took_ms=${Date.now()-r}`)}function Eo(e){return{type:l(e,"filterType"),tag:l(e,"filterTag"),priority:l(e,"filterPriority"),deadlineBefore:l(e,"filterDeadlineBefore"),deadlineAfter:l(e,"filterDeadlineAfter"),updatedAfter:l(e,"filterUpdatedAfter"),updatedBefore:l(e,"filterUpdatedBefore"),createdAfter:l(e,"filterCreatedAfter"),createdBefore:l(e,"filterCreatedBefore"),ids:l(e,"ids"),assignee:l(e,"filterAssignee"),assigneeFilter:N(e.filterAssigneeFilter,e.filterAssignee_filter),parent:l(e,"filterParent"),sprint:l(e,"filterSprint"),release:l(e,"filterRelease"),...$t(e),limit:l(e,"limit"),offset:l(e,"offset")}}async function Oo(e,t){let o=y(t),i=Date.now();G(e),e.ids=await z(l(e,"ids"));let a=await pt({status:l(e,"filterStatus"),list:Eo(e),reason:l(e,"reason"),completedAt:l(e,"completedAt"),resolution:l(e,"resolution"),expectedResult:N(e.expectedResult,e.expected_result,e.expected),actualResult:N(e.actualResult,e.actual_result,e.actual),validateClose:e.validateClose===!0?"warn":l(e,"validateClose"),author:l(e,"author"),message:l(e,"message"),force:!!e.force,dryRun:e.dryRun===!0?!0:void 0,rollback:l(e,"rollback"),checkpoint:e.checkpoint===!1?!1:void 0},o);await b(o,a),f(a,o),o.profile&&v(`profile:command=close-many took_ms=${Date.now()-i}`)}async function Fo(e,t){let o=y(t),i=Date.now();G(e),e.ids=await z(l(e,"ids"));let a=await ht({status:l(e,"filterStatus"),list:xo(e),update:Y(_e(e)),dryRun:e.dryRun===!0?!0:void 0,rollback:l(e,"rollback"),checkpoint:e.checkpoint===!1?!1:void 0},o);await b(o,a),f(await E("update-many",[],e,o,a),o),o.profile&&v(`profile:command=update-many took_ms=${Date.now()-i}`)}async function Mo(e,t,o,i){let a=y(i),r=Date.now(),n=typeof o.reason=="string"&&o.reason.trim().length>0&&o.reason||typeof o.closeReason=="string"&&o.closeReason.trim().length>0&&o.closeReason||void 0,s=typeof t=="string"&&t.length>0?t:n,d=await(o.releaseAssignment===!0?yt:ee)(e,s,{author:l(o,"author"),message:l(o,"message"),validateClose:o.validateClose===!0?"warn":l(o,"validateClose"),force:!!o.force,duplicateOf:l(o,"duplicateOf"),completedAt:l(o,"completedAt"),resolution:l(o,"resolution"),expectedResult:N(o.expectedResult,o.expected_result,o.expected),actualResult:N(o.actualResult,o.actual_result,o.actual)},a);await b(a,d),f(d,a),a.profile&&v(`profile:command=close took_ms=${Date.now()-r}`)}function Po(e){let t={...e},o=[["blocked_by","blockedBy"],["resume_context","resumeContext"],["from_search","fromSearch"],["step_title","stepTitle"],["step_body","stepBody"],["step_owner","stepOwner"],["step_status","stepStatus"],["step_evidence","stepEvidence"],["step_blocked_reason","stepBlockedReason"],["step_replacement","stepReplacement"],["depends_on","dependsOn"],["link_kind","linkKind"],["link_note","linkNote"],["promote_to_item_dep","promoteToItemDep"],["allow_multiple_active","allowMultipleActive"],["decision_text","decisionText"],["decision_rationale","decisionRationale"],["decision_evidence","decisionEvidence"],["discovery_text","discoveryText"],["validation_text","validationText"],["validation_command","validationCommand"],["validation_expected","validationExpected"],["materialize_type","materializeType"],["materialize_parent","materializeParent"],["materialize_tags","materializeTags"]];for(let[a,r]of o)t[a]!==void 0&&t[r]===void 0&&(t[r]=t[a]);let i=X(t,{requireType:!1});return i.blockedBy=t.blockedBy,i}function No(e,t){if(!e)throw new u(`pm plan requires a subcommand. Allowed: ${t.join(", ")}`,p.USAGE,{code:"missing_required_argument",examples:['pm plan create --title "Refactor lock retry"',"pm plan show pm-a1b2 --depth standard",'pm plan add-step pm-a1b2 --step-title "Read lock.ts"']});if(!t.includes(e))throw I({command_path:"plan",token:e,allowed:t,examples:e==="list"||e==="ls"?["pm list --type Plan","pm list --all --type Plan"]:void 0,retry_command:e==="list"||e==="ls"?"pm list --type Plan":void 0})}function $o(e,t){if(e!=="reorder-step"||typeof t!="string")return;let o=Number.parseInt(t,10);if(!Number.isFinite(o))throw new u(`reorder-step requires an integer new order, got "${t}"`,p.USAGE);return o}async function Ho(e,t,o,i,a,r){let n=y(r),s=Date.now(),d=(e??"").trim().toLowerCase();No(d,gt);let m=Po(a),g=$o(d,i),S=d==="create"&&typeof t=="string"&&t.length>0&&m.title===void 0?void 0:t;S===void 0&&typeof t=="string"&&t.length>0&&(m.title=t);let A=await vt({subcommand:d,id:S,stepRef:o,reorderTo:g,options:m,global:n});await b(n,A),f(A,n),n.profile&&v(`profile:command=plan took_ms=${Date.now()-s}`)}async function Lo(e,t,o){if(e!==void 0)throw new u("merge reconcile takes no positional arguments.",p.USAGE);let i=await re({dryRun:t.dryRun===!0,force:t.force===!0,stage:t.stage===!0,message:typeof t.message=="string"?t.message:void 0,author:o.author},o);f(i,o),i.ok||(process.exitCode=p.GENERIC_FAILURE)}async function Uo(e,t,o,i,a,r){if(e===void 0||t===void 0||o===void 0||i===void 0)throw new u("merge driver requires <artifact> <base> <ours> <theirs> (git supplies %O %A %B). Example: pm merge driver history %O %A %B",p.USAGE);let n=await ne({artifact:e,basePath:t,oursPath:o,theirsPath:i,outputPath:typeof a.output=="string"?a.output:void 0,itemPath:typeof a.itemPath=="string"?a.itemPath:void 0,prefer:typeof a.prefer=="string"?a.prefer:void 0},r);f(n,r),n.ok||(process.exitCode=p.GENERIC_FAILURE)}async function Go(e,t,o,i,a,r,n){let s=y(n),d=Date.now();switch(e.trim().toLowerCase()){case"install":{if(t!==void 0)throw new u("merge install takes no positional arguments.",p.USAGE);let m=await Z({dryRun:r.dryRun===!0,preCommitHook:r.preCommitHook===!0},s);f(m,s);break}case"reconcile":await Lo(t,r,s);break;case"report":{if(t!==void 0)throw new u("merge report takes no positional arguments.",p.USAGE);let m=await Q({includeReconciled:r.includeReconciled===!0});f(m,s),m.ok||(process.exitCode=p.GENERIC_FAILURE);break}case"driver":await Uo(t,o,i,a,r,s);break;default:throw I({command_path:"merge",token:e,allowed:B,display_name:"merge"})}s.profile&&v(`profile:command=merge took_ms=${Date.now()-d}`)}async function Bo(e,t,o){let i=y(o),a=Date.now(),r=await te(e,{title:l(t,"title"),author:l(t,"author"),message:l(t,"message"),allowDuplicate:t.allowDuplicate===!0},i);await b(i,r),f(r,i),i.profile&&v(`profile:command=copy took_ms=${Date.now()-a}`)}async function jo(e,t,o){let i=y(o),a=Date.now(),r=await ie(e,{clear:t.clear===!0},i);f(r,i),i.profile&&v(`profile:command=focus took_ms=${Date.now()-a}`)}async function qo(e,t,o){let i=y(o),a=Date.now();G(t);let r=t.stdinJson===!0;if(r){let g=await C().resolveValue("-","--stdin-json");t=await Ut(g??"","update",t,i)}let n=Lt(t,r);r||await se(t);let s=typeof t.bodyFile=="string";s&&(t.body=await J(String(t.bodyFile),t.body!==void 0?String(t.body):void 0),delete t.bodyFile);let d=Y(t);Ht(d,s,n),r&&V(d);let m=await mt(e,d,i);await b(i,m),f(await E("update",[e],t,i,m),i),i.profile&&v(`profile:command=update took_ms=${Date.now()-a}`)}async function Vo(e,t,o){let i=y(o),a=Date.now(),r=await oe(e,{author:l(t,"author"),message:l(t,"message"),force:!!t.force,dryRun:t.dryRun===!0},i);r.dry_run!==!0&&await b(i,r),f(r,i),i.profile&&v(`profile:command=delete took_ms=${Date.now()-a}`)}function zo(e,t){let o=l(t,"body"),i=l(t,"text"),a=typeof e=="string"?e:void 0;if([o,i,a].filter(n=>n!==void 0).length>1)throw new u("Specify append text with exactly one source: positional [text], --body, or --text",p.USAGE);let r=o??i??a;if(r===void 0)throw new u("Missing append text. Provide it as positional [text], --body <value>, or --text <value> (use - for stdin).",p.USAGE);return r}async function Jo(e,t,o,i){let a=y(i),r=Date.now(),n=await ct(e,{body:zo(t,o),author:l(o,"author"),message:l(o,"message"),force:!!o.force},a);await b(a,n),f(n,a),a.profile&&v(`profile:command=append took_ms=${Date.now()-r}`)}async function Ko(e,t,o,i){let a=y(i),r=Date.now(),{PROFILE_SUBCOMMANDS:n}=F,s=(e??"").trim().toLowerCase();if(!s)throw new u(`pm profile requires a subcommand. Allowed: ${n.join(", ")}`,p.USAGE,{code:"missing_required_argument",examples:["pm profile list","pm profile show agile","pm profile apply agile --dry-run","pm profile lint agile"]});if(!n.includes(s))throw I({command_path:"profile",token:s,allowed:n});let d=await So(F,s,t,o,a);a.json===!0||a.defaultOutputFormat==="json"?f(d,a):a.quiet||Ao(F,d),d.action==="lint"&&!d.ok&&(process.exitCode=p.GENERIC_FAILURE),a.profile&&v(`profile:command=profile took_ms=${Date.now()-r}`)}function _(e,t){return M(e[t])??[]}async function Wo(e,t,o){let i=y(o),a=Date.now(),r=_(t,"add"),n=_(t,"addGlob"),s=_(t,"remove"),d=_(t,"migrate"),m=await rt(e,{add:r,addGlob:n,remove:s,migrate:d,note:l(t,"note"),list:!!t.list,appendStable:!!t.appendStable,validatePaths:!!t.validatePaths,author:l(t,"author"),message:l(t,"message"),force:!!t.force},i);(r.length>0||n.length>0||s.length>0||d.length>0)&&await b(i,m),f(await E("files",[e],t,i,m),i),i.profile&&v(`profile:command=files took_ms=${Date.now()-a}`)}async function Xo(e,t,o){let i=y(o),a=Date.now(),r={...o.optsWithGlobals(),...t},n=await st(e,{apply:!!r.apply,note:l(r,"note"),appendStable:!!r.appendStable,author:l(r,"author"),message:l(r,"message"),force:!!r.force},i);n.changed&&await b(i,n),f(n,i),i.profile&&v(`profile:command=files.discover took_ms=${Date.now()-a}`)}async function Yo(e,t,o){let i=y(o),a=Date.now(),r=_(t,"add"),n=_(t,"addGlob"),s=_(t,"remove"),d=_(t,"migrate"),m=await at(e,{add:r,addGlob:n,remove:s,migrate:d,note:l(t,"note"),list:!!t.list,validatePaths:!!t.validatePaths,author:l(t,"author"),message:l(t,"message"),force:!!t.force},i);(r.length>0||n.length>0||s.length>0||d.length>0)&&await b(i,m),f(await E("docs",[e],t,i,m),i),i.profile&&v(`profile:command=docs took_ms=${Date.now()-a}`)}async function Zo(e,t,o){let i=y(o),a=Date.now(),r=await it(e,{format:t.format,maxDepth:l(t,"maxDepth"),collapse:t.collapse,summary:t.summary===!0,full:t.full===!0,nodeLimit:l(t,"nodeLimit"),edgeLimit:l(t,"edgeLimit"),tokenBudget:l(t,"tokenBudget"),cursor:l(t,"cursor"),direction:l(t,"direction"),...Array.isArray(t.kind)?{kind:t.kind}:{}},i);f(r,i),i.profile&&v(`profile:command=deps took_ms=${Date.now()-a}`)}function Ka(e,t={}){let o=e.command("create").argument("[type-or-title]",'Item title, or item type when a title follows (e.g. `pm create task "Fix bug"`)').argument("[title]","Item title when the first argument is an item type").description("Create a new project management item.");if(me(o,W),o.option("--stdin-json","Read a full item JSON document from stdin; explicit flags override document values").option("--body-file <path>","Load body from a file or stdin (-); conflicts with --body").option("--clear-deps","Clear dependency entries").option("--clear-comments","Clear comments").option("--clear-notes","Clear notes").option("--clear-learnings","Clear learnings").option("--clear-files","Clear linked files").option("--clear-tests","Clear linked tests").option("--clear-docs","Clear linked docs").option("--clear-reminders","Clear reminders").option("--clear-events","Clear events").option("--clear-type-options","Clear type options").option("--allow-duplicate","Explicitly create even when strict similarity governance finds likely duplicates").action(To),t.targetCommandName==="create")return;e.command("copy").argument("<id>","Source item id").option("--title <value>","Optional title override for the copied item").option("--author <value>","Mutation author").option("--message <value>","History message").option("--allow-duplicate","Explicitly copy even when strict similarity governance finds likely duplicates").description("Copy an item into a new item id while resetting lifecycle fields.").action(Bo),e.command("focus").argument("[id]","Item id to focus (omit to show current focus)").option("--clear","Clear the focused item").description("Set/clear/show the session focused item that new items default --parent to.").action(jo);let i=e.command("update").argument("<id>","Item id").description("Update item fields and metadata.");me(i,Ae),i.option("--stdin-json","Read a full item JSON document from stdin; explicit flags override document values").option("--body-file <path>","Load body from a file or stdin (-); conflicts with --body").option("--replace-deps","Atomically replace dependency entries with the provided --dep values").option("--replace-tests","Atomically replace linked test entries with the provided --test values").option("--replace-files","Atomically replace linked file entries with the provided --file values").option("--replace-docs","Atomically replace linked doc entries with the provided --doc values").option("--clear-deps","Clear dependency entries").option("--clear-comments","Clear comments").option("--clear-notes","Clear notes").option("--clear-learnings","Clear learnings").option("--clear-files","Clear linked files").option("--clear-tests","Clear linked tests").option("--clear-docs","Clear linked docs").option("--clear-reminders","Clear reminders").option("--clear-events","Clear events").option("--clear-type-options","Clear type options").option("--force","Force ownership override"),i.action(qo),It(e);let a=e.command("update-many").description("Bulk-update matched items with dry-run plans and rollback checkpoints.").option("--filter-status <value>","Filter by status before applying updates").option("--filter-type <value>","Filter by item type before applying updates").option("--filter-tag <value>","Filter by tag before applying updates").option("--filter-priority <value>","Filter by priority before applying updates").option("--filter-deadline-before <value>","Filter by deadline upper bound before applying updates").option("--filter-deadline-after <value>","Filter by deadline lower bound before applying updates").option("--filter-updated-after <value>","Filter by updated_at lower bound before applying updates (ISO/relative)").option("--filter-updated-before <value>","Filter by updated_at upper bound before applying updates (ISO/relative)").option("--filter-created-after <value>","Filter by created_at lower bound before applying updates (ISO/relative)").option("--filter-created-before <value>","Filter by created_at upper bound before applying updates (ISO/relative)").option("--filter-assignee <value>","Filter by assignee before applying updates").option("--filter-assignee-filter <value>","Filter assignee presence: assigned|unassigned before applying updates").option("--filter-parent <value>","Filter by parent item ID before applying updates").option("--filter-sprint <value>","Filter by sprint before applying updates").option("--filter-release <value>","Filter by release before applying updates").option("--filter-ac-missing","Select only items missing acceptance_criteria (bulk backfill)").option("--filter-estimates-missing","Select only items missing estimated_minutes (bulk backfill)").option("--filter-resolution-missing","Select only terminal items missing resolution (bulk backfill)").option("--filter-metadata-missing","Select only items missing any tracked metadata (AC, estimate, or resolution)");Nt(a,"applying updates"),a.option("--ids <value>","Explicit ID allowlist: comma/newline text, - stdin, or @path file").option("--limit <n>","Limit matched item count before apply/preview").option("--offset <n>","Skip first n matched rows before apply/preview").option("--dry-run","Preview per-item diffs and checkpoint intent without mutating").option("--rollback <value>","Rollback a prior update-many checkpoint ID").option("--no-checkpoint","Disable checkpoint creation during apply mode").option("--title, -t <value>","Set title").option("--description, -d <value>","Set description").option("--body, -b <value>","Set body (allow empty string)").option("--status, -s <value>","Set status (use close command for closed)").option("--priority, -p <value>","Set priority").option("--type <value>","Set type").option("--tags <value>","Set comma-separated tags (replaces existing). Use --add-tags / --remove-tags to mutate additively.").option("--add-tags <value>","Add tags additively without replacing existing (repeatable; CSV accepted)",c).option("--remove-tags <value>","Remove tags from the existing list (repeatable; CSV accepted)",c).option("--deadline <value>","Set deadline (ISO/date string or relative)").option("--estimate, --estimated-minutes <value>","Set estimated minutes").option("--acceptance-criteria <value>","Set acceptance criteria").option("--ac <value>","Alias for --acceptance-criteria").option("--add-ac <value>","Add one semicolon-free acceptance criterion without replacing the existing list (repeatable)",c).option("--remove-ac <value>","Remove one semicolon-free acceptance criterion by exact text match (repeatable)",c).option("--definition-of-ready <value>","Set definition of ready").option("--order <value>","Set planning order/rank integer").option("--rank <value>","Alias for --order").option("--goal <value>","Set goal identifier").option("--objective <value>","Set objective identifier").option("--value <value>","Set business value summary").option("--impact <value>","Set business impact summary").option("--outcome <value>","Set expected outcome summary").option("--why-now <value>","Set why-now rationale").option("--assignee <value>","Set assignee").option("--parent <value>","Set parent item ID").option("--reviewer <value>","Set reviewer").option("--risk <value>","Set risk level").option("--confidence <value>","Set confidence level").option("--sprint <value>","Set sprint identifier").option("--release <value>","Set release identifier").option("--blocked-by <value>","Set blocked-by item ID or reason").option("--blocked-reason <value>","Set blocked reason").option("--unblock-note <value>","Set unblock rationale note").option("--reporter <value>","Set issue reporter").option("--severity <value>","Set issue severity").option("--environment <value>","Set issue environment context").option("--repro-steps <value>","Set issue reproduction steps").option("--resolution <value>","Set issue resolution summary").option("--expected-result <value>","Set issue expected behavior").option("--expected <value>","Short alias for --expected-result").option("--actual-result <value>","Set issue observed behavior").option("--actual <value>","Short alias for --actual-result").option("--affected-version <value>","Set affected version identifier").option("--fixed-version <value>","Set fixed version identifier").option("--component <value>","Set issue component ownership").option("--regression [value]","Set regression marker; bare flag means true, or pass true|false|1|0").option("--customer-impact <value>","Set customer impact summary").option("--dep <value>","Add dependency entry id=<id>,kind=<kind>,author=<author>,created_at=<timestamp>",c).option("--dep-remove <value>","Remove dependency entries by id/kind/author/timestamp signature",c).option("--replace-deps","Atomically replace dependency entries with provided --dep values").option("--replace-tests","Atomically replace linked tests with provided --test values").option("--replace-files","Atomically replace linked files with provided --file values").option("--replace-docs","Atomically replace linked docs with provided --doc values").option("--comment <value>","Add comment seed author=<value>,created_at=<iso|now>,text=<value>",c).option("--note <value>","Add note seed author=<value>,created_at=<iso|now>,text=<value>",c).option("--learning <value>","Add learning seed author=<value>,created_at=<iso|now>,text=<value>",c).option("--file <value>","Add linked file path=<value>,scope=<project|global>,note=<text>",c).option("--test <value>","Add linked test command=<value>,path=<value>,scope=<project|global>",c).option("--doc <value>","Add linked doc path=<value>,scope=<project|global>,note=<text>",c).option("--reminder <value>","Add reminder entry at=<iso|relative>|date=<iso|relative>,text=<text>|title=<text>",c).option("--event <value>","Add event entry start=<iso|relative>,end=<iso|relative>,recur_*",c).option("--type-option <value>","Set type options key=value (repeatable)",c).option("--unset <field>","Clear scalar metadata field by name (repeatable)",c).option("--clear-deps","Clear dependency entries").option("--clear-comments","Clear comments").option("--clear-notes","Clear notes").option("--clear-learnings","Clear learnings").option("--clear-files","Clear linked files").option("--clear-tests","Clear linked tests").option("--clear-docs","Clear linked docs").option("--clear-reminders","Clear reminders").option("--clear-events","Clear events").option("--clear-type-options","Clear type options").option("--author <value>","Mutation author").option("--message <value>","Mutation message").option("--force","Force ownership override"),O(a,[["--filter-assignee_filter <value>","Alias for --filter-assignee-filter"],["--estimated_minutes <value>","Alias for --estimated-minutes"],["--acceptance_criteria <value>","Alias for --acceptance-criteria"],["--definition_of_ready <value>","Alias for --definition-of-ready"],["--why_now <value>","Alias for --why-now"],["--blocked_by <value>","Alias for --blocked-by"],["--blocked_reason <value>","Alias for --blocked-reason"],["--unblock_note <value>","Alias for --unblock-note"],["--repro_steps <value>","Alias for --repro-steps"],["--expected_result <value>","Alias for --expected-result"],["--actual_result <value>","Alias for --actual-result"],["--affected_version <value>","Alias for --affected-version"],["--fixed_version <value>","Alias for --fixed-version"],["--customer_impact <value>","Alias for --customer-impact"],["--filter-estimate-missing","Alias for --filter-estimates-missing"]],!1),O(a,[["--dep_remove <value>","Alias for --dep-remove"],["--type_option <value>","Alias for --type-option"],["--add_tags <value>","Alias for --add-tags"],["--remove_tags <value>","Alias for --remove-tags"],["--add_ac <value>","Alias for --add-ac"],["--remove_ac <value>","Alias for --remove-ac"]],!0),a.action(Fo);let r=e.command("close").option("--release-assignment","Release ownership after closure").argument("<id>","Item id").argument("[text]","Close reason text (alias: --reason)").option("-r, --reason <value>","Close reason text (alias for positional <text>)").option("--close-reason <value>","Close reason text (alias for positional <text>)").option("--completed-at <value>","Actual completion timestamp (ISO or relative), distinct from tracker close time").option("-d, --duplicate-of <id>","Close as a duplicate of the canonical item id and auto-fill duplicate closure metadata").option("--author <value>","Mutation author").option("-m, --message <value>","History message").option("--validate-close [mode]",'Validate closure metadata before close: "off", "warn", or "strict" (default: settings governance preset)').option("--resolution <value>","Closure resolution summary (checked by --validate-close strict)").option("--expected-result <value>","Expected outcome for closure validation").option("--expected <value>","Short alias for --expected-result").option("--actual-result <value>","Observed outcome for closure validation").option("--actual <value>","Short alias for --actual-result").option("--force","Force ownership override").description("Close an item. Close reason requirement follows governance.require_close_reason.");w(r,"--expected_result <value>","Alias for --expected-result",!1),w(r,"--actual_result <value>","Alias for --actual-result",!1),r.action(Mo);let n=e.command("close-many").description("Bulk-close matched items with a shared reason and full runClose semantics (dry-run + rollback checkpoint).").option("--filter-status <value>","Filter by status before closing").option("--filter-type <value>","Filter by item type before closing").option("--filter-tag <value>","Filter by tag before closing").option("--filter-priority <value>","Filter by priority before closing").option("--filter-deadline-before <value>","Filter by deadline upper bound before closing").option("--filter-deadline-after <value>","Filter by deadline lower bound before closing").option("--filter-updated-after <value>","Filter by updated_at lower bound before closing (ISO/relative)").option("--filter-updated-before <value>","Filter by updated_at upper bound before closing (ISO/relative)").option("--filter-created-after <value>","Filter by created_at lower bound before closing (ISO/relative)").option("--filter-created-before <value>","Filter by created_at upper bound before closing (ISO/relative)").option("--filter-assignee <value>","Filter by assignee before closing").option("--filter-assignee-filter <value>","Filter assignee presence: assigned|unassigned before closing").option("--filter-parent <value>","Filter by parent item ID before closing").option("--filter-sprint <value>","Filter by sprint before closing").option("--filter-release <value>","Filter by release before closing");Nt(n,"closing"),n.option("--ids <value>","Explicit ID allowlist: comma/newline text, - stdin, or @path file").option("--limit <n>","Limit matched item count before apply/preview").option("--offset <n>","Skip first n matched rows before apply/preview").option("--reason <value>","Shared close reason applied to matched items (required when governance.require_close_reason is enabled)").option("--completed-at <value>","Actual completion timestamp (ISO or relative) applied to every matched item").option("--resolution <value>","Shared closure resolution applied to every matched item (closure-validation field)").option("--expected-result <value>","Shared expected-result note (closure-validation field)").option("--expected <value>","Short alias for --expected-result").option("--actual-result <value>","Shared actual-result note (closure-validation field)").option("--actual <value>","Short alias for --actual-result").option("--validate-close [mode]",'Validate closure metadata per item: "off", "warn", or "strict" (default: settings governance preset)').option("--author <value>","Mutation author").option("--message <value>","History message").option("--force","Re-close already-terminal matches and override ownership").option("--dry-run","Preview matched items + per-item skip/active-child plan without mutating").option("--rollback <value>","Rollback a prior close-many checkpoint ID").option("--no-checkpoint","Disable checkpoint creation during apply mode"),w(n,"--filter-assignee_filter <value>","Alias for --filter-assignee-filter",!1),w(n,"--expected_result <value>","Alias for --expected-result",!1),w(n,"--actual_result <value>","Alias for --actual-result",!1),n.action(Oo),e.command("delete").argument("<id>","Item id").option("--author <value>","Mutation author").option("--message <value>","History message").option("--force","Force ownership override").option("--dry-run","Preview the item file that would be deleted without mutating").description("Delete an item and record the change in history.").action(Vo),e.command("append").argument("<id>","Item id").argument("[text]","Body text; same as --body (- reads stdin)").option("--body <value>","Text to append to body (or - for stdin)").option("--text <value>","Alias for --body").option("--author <value>","Mutation author").option("--message <value>","Mutation message").option("--force","Force ownership override").description("Append text to an item's body. For concurrent writes, use pm notes.").action(Jo);let s=e.command("plan").description("Agent-optimized Plan item workflow: create, manage steps, link dependencies, approve, and materialize.").argument("[subcommand]","Required; Plan subcommand: create|show|add-step|update-step|complete-step|block-step|reorder-step|remove-step|link|unlink|decision|discovery|validation|resume|approve|materialize").argument("[id]","Plan id (required for non-create subcommands); for create this may be the positional title").argument("[step]","Step reference: stable id (plan-step-001) or order integer").argument("[new-order]","New order integer for reorder-step").option("--title <value>","Plan title").option("--description <value>","Plan description").option("--scope <value>","Short scope statement of the target change or investigation").option("--parent <value>","Parent pm item id").option("--related <value>","Related pm item ids (repeatable, csv-friendly)",c).option("--blocks <value>","Pm item ids this plan blocks (repeatable, csv-friendly)",c).option("--blocked-by <value>","Pm item ids that block this plan (repeatable, csv-friendly)",c).option("--harness <value>","Plan harness provenance: codex|claude-code|cursor|generic").option("--mode <value>","Plan mode: draft|research|review|approved|executing|paused|completed|superseded").option("--resume-context <value>","Compact context summary for a future stateless agent").option("--tags <value>","Comma-separated tags").option("--priority <value>","Priority 0-4").option("--body <value>","Plan item body").option("--claim","Claim the plan on create for the author").option("--from-search <value>","Record the search query that led to plan creation").option("--template <value>","Seed plan steps from a built-in template: bug-investigation|feature-implementation|refactoring-sprint").option("--step-title <value>","Step title for add-step / update-step").option("--step <value>","Step title (repeatable on create: each --step appends an ordered step; elsewhere a single value aliases --step-title)",c).option("--step-body <value>","Step body text").option("--step-owner <value>","Step owner").option("--step-status <value>","Step status: pending|in_progress|completed|blocked|skipped|superseded").option("--step-evidence <value>","Step evidence text (used by update-step/complete-step)").option("--step-blocked-reason <value>","Step blocked reason (required when blocking)").option("--step-replacement <value>","Replacement reference for a superseded step").option("--depends-on <value>","Pm item ids the step depends on (repeatable, csv-friendly)",c).option("--link <value>","Pm item id to link (repeatable, csv-friendly)",c).option("--link-kind <value>",`Link kind: ${ge.join("|")}`).option("--link-note <value>","Optional note for the link").option("--promote-to-item-dep","Also add the linked id as a top-level item dependency when linking").option("--allow-multiple-active","Allow multiple steps to be in_progress at once").option("--file <value>","Step linked file path=<value>[,scope=project|global,note=<text>] (repeatable)",c).option("--test <value>","Step linked test command=<value>[,path=<value>,note=<text>] (repeatable)",c).option("--doc <value>","Step linked doc path=<value>[,scope=project|global,note=<text>] (repeatable)",c).option("--decision-text <value>","Decision log entry text").option("--decision <value>","Alias for --decision-text").option("--decision-rationale <value>","Decision log entry rationale").option("--decision-evidence <value>","Decision log entry evidence").option("--discovery-text <value>","Discovery log entry text").option("--discovery <value>","Alias for --discovery-text").option("--validation-text <value>","Validation log entry text").option("--validation <value>","Alias for --validation-text").option("--validation-command <value>","Validation log entry command").option("--validation-expected <value>","Validation log entry expected outcome").option("--depth <value>","Show depth: brief|standard|deep (default: brief)").option("--fields <value>","Comma-separated field projection for show output").option("--steps <value>","Comma-separated step ids/orders for materialize").option("--materialize-type <value>","Item type for materialized steps (default: Task)").option("--materialize-parent <value>","Parent item id for materialized children (default: the plan)").option("--materialize-tags <value>","Comma-separated tags for materialized children").option("--field <name=value>","Custom field value forwarded to every materialized child (repeatable)",c).option("--author <value>","Mutation author").option("--message <value>","Mutation message").option("--force","Force ownership override");me(s,W.filter(m=>wo.has(m.target))),O(s,[["--resume_context <value>","Alias for --resume-context"],["--from_search <value>","Alias for --from-search"],["--step_title <value>","Alias for --step-title"],["--step_body <value>","Alias for --step-body"],["--step_owner <value>","Alias for --step-owner"],["--step_status <value>","Alias for --step-status"],["--step_evidence <value>","Alias for --step-evidence"],["--step_blocked_reason <value>","Alias for --step-blocked-reason"],["--step_replacement <value>","Alias for --step-replacement"],["--link_kind <value>","Alias for --link-kind"],["--link_note <value>","Alias for --link-note"],["--promote_to_item_dep","Alias for --promote-to-item-dep"],["--allow_multiple_active","Alias for --allow-multiple-active"],["--decision_text <value>","Alias for --decision-text"],["--decision_rationale <value>","Alias for --decision-rationale"],["--decision_evidence <value>","Alias for --decision-evidence"],["--discovery_text <value>","Alias for --discovery-text"],["--validation_text <value>","Alias for --validation-text"],["--validation_command <value>","Alias for --validation-command"],["--validation_expected <value>","Alias for --validation-expected"],["--materialize_type <value>","Alias for --materialize-type"],["--materialize_parent <value>","Alias for --materialize-parent"],["--materialize_tags <value>","Alias for --materialize-tags"]],!1),O(s,[["--blocked_by <value>","Alias for --blocked-by"],["--depends_on <value>","Alias for --depends-on"]],!0),s.action(Ho),wt(e,!1),Rt(e),e.command("merge").argument("<subcommand>",`${B.join(" | ")}`).argument("[artifact]",`driver: ${ae.join(" | ")}`).argument("[base]","driver: ancestor file (%O)").argument("[ours]","driver: current file (%A)").argument("[theirs]","driver: incoming file (%B)").option("--dry-run","install/reconcile: preview").option("--pre-commit-hook","install: opt into merge settlement hook").option("--stage","reconcile: stage lossless audit evidence").option("--message <text>","reconcile: audit message").option("--force","reconcile: accept reviewed decisions").option("--include-reconciled","report: include settled receipts").option("--output <path>","driver: alternate output").option("--item-path <path>","driver: repository-relative path (%P)").option("--prefer <side>","driver: ours|theirs (default ours)").description("Manage tracker merges.").action(Go),Pt(e),e.command("profile").argument("[subcommand]","Required; Profile subcommand: list, show, apply, or lint").argument("[name]","Profile name for show/apply/lint: agile, ops, or research").option("--dry-run","Preview the apply diff without writing any files (apply)").option("--author <value>","Mutation author").option("--force","Force ownership/lock override").description("List, show, apply, and lint project profiles \u2014 archetype bundles of item types, statuses, fields, workflows, config, templates, and recommended packages.").action(Ko),Ot(e,ko);let d=e.command("files").description("Manage files linked to an item.");d.argument("<id>","Item id").option("--add <value>","Add linked file entry (CSV/markdown pairs or - for stdin)",c).option("--add-glob <value>","Add linked file entries from a glob (plain glob or pattern=<glob>,scope=<scope>,note=<text>; repeatable)",c).option("--remove <value>","Remove linked file by path only (path=<value>, path:<value>, plain path, or - for stdin); does not accept note=/scope= \u2014 record removal context with --message",c).option("--migrate <value>","Migrate linked file paths in-place (from=<prefix>,to=<prefix>; repeatable)",c).option("--note <value>","Note attached to every link added by --add/--add-glob in this invocation (embedded note= wins)").option("--list","List linked files without mutating").option("--append-stable","Preserve existing linked-file order and append new links without full-array resorting").option("--validate-paths","Validate linked file paths for existence and file shape").option("--author <value>","Mutation author").option("--message <value>","History message").option("--force","Force ownership override").action(Wo),d.command("discover").argument("<id>","Item id").option("--apply","Add discovered missing files to the item").option("--note <value>","Note to attach to discovered file links").option("--append-stable","Preserve existing linked-file order and append discovered links without full-array resorting").option("--author <value>","Mutation author").option("--message <value>","History message").option("--force","Force ownership override").description("Discover existing file paths referenced in item text and optionally link missing files.").action(Xo),Ft(d),e.command("docs").argument("<id>","Item id").option("--add <value>","Add linked doc entry (CSV/markdown pairs or - for stdin)",c).option("--add-glob <value>","Add linked doc entries from a glob (plain glob or pattern=<glob>,scope=<scope>,note=<text>; repeatable)",c).option("--remove <value>","Remove linked doc by path only (path=<value>, path:<value>, plain path, or - for stdin); does not accept note=/scope= \u2014 record removal context with --message",c).option("--migrate <value>","Migrate linked doc paths in-place (from=<prefix>,to=<prefix>; repeatable)",c).option("--note <value>","Note attached to every link added by --add/--add-glob in this invocation (embedded note= wins)").option("--list","List linked docs without mutating").option("--validate-paths","Validate linked doc paths for existence and file shape").option("--author <value>","Mutation author").option("--message <value>","History message").option("--force","Force ownership override").description("Manage docs linked to an item.").action(Yo),e.command("deps").argument("<id>","Item id").option("--format <value>","Output format (tree, graph, or context)","tree").option("--max-depth <value>","Maximum dependency traversal depth (0 keeps only the root)").option("--collapse <value>","Collapse mode (none or repeated)","none").option("--summary","Return counts only without full tree/graph payload").option("--full","Return the complete dependency row projection").option("--node-limit <value>","Maximum nodes in context output").option("--edge-limit <value>","Maximum edges and missing-reference rows in context output").option("--token-budget <value>","Maximum estimated tokens in context output").option("--cursor <value>","Continue an equivalent context query").option("--direction <value>","Context traversal direction (outgoing, incoming, or both)").option("--kind <value>","Restrict context traversal to registered relationship kinds (repeatable or comma-separated)",c).description("Show dependency relationships for an item.").action(Zo)}export{ue as looksLikeSchemaSubcommandTypo,ko as parsePositiveIntOption,U as parseSchemaOrderOption,me as registerCommanderOptionContracts,Ka as registerMutationCommands};
20
- //# sourceMappingURL=register-mutation-JZVVJUHY.js.map
@@ -1,2 +0,0 @@
1
- import{a as T}from"./chunk-AK2CI2GI.js";import{$a as b,H as D,Ua as $,Xa as U,cb as z}from"./chunk-NC5HUGHU.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]="bb1fec82-ce00-5b6f-8191-1b988d369e92")}catch{}})();var F=["item","list","context","search","graph","history","workspace","package","ops","plan","contracts","help"],ue=["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 j(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),X=s("step","string",!0),_e=["--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"],E=["--allow-multiple-active","--depends-on","--file","--force","--message","--step-blocked-reason","--step-body","--step-evidence","--step-owner","--step-status","--step-title","--test"],ve={"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:_e,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:E,description:"Append one ordered step to a Plan item.",example:'pm plan add-step pm-a1b2 --step-title "Run tests"'},...Object.entries(ve).map(([e,a])=>({command:`plan ${e}`,parent:"plan",action:e,slots:[k,X],accepted_flags:E,description:a,example:`pm plan ${e} pm-a1b2 plan-step-001`})),{command:"plan reorder-step",parent:"plan",action:"reorder-step",slots:[k,X,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:E,description:`${j(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:`${j(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"}],he=[...h].sort((e,a)=>a.command.length-e.command.length),Y=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 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 Ka(e){let a=v(e),l=R.find(i=>i.command===a);if(l)return l;let t=z(a)?.canonical;if(t)return R.find(i=>i.command===t)}function Te(e){let a=v(e);return he.find(l=>l.command===a||a.startsWith(`${l.command} `))}function Va(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 N=[...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"]),...$.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 export","changelog generate","changelog milestone create"]),...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=U.find(t=>t.alias===e.command);if(!a)return[e];let l=F.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"}]}),R=[...new Set(N.map(({command:e})=>e))].map(e=>({command:e,slots:Te(e)?.slots??Y.get(b(e))??[]})),w={nouns:F,shared_verbs:ue,scope_before_verb:!0,visible_top_level_ceiling:69,ceiling_raise_requires_pm_item:!0,positional_shape_budget:21};function q(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 ye(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 H(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 Wa(e,a={}){let l=a.declared??R,t=a.positionalShapeBudget??w.positional_shape_budget,i=new Map(l.map(o=>[v(o.command),o])),f=new Map(e.map(o=>[v(o.command),o])),c=[...H(l,"declared"),...H(e,"observed"),...a.declared===void 0?[...q(Y.keys(),N.map(({command:o})=>o)),...q(h.map(({command:o})=>o),N.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})=>ye(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 Ae(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 ke(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 Ce(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 Za(e,a=[],l=N){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(F),c=new Map;for(let r of l){let u=c.get(r.command)??[];u.push(r),c.set(r.command,u)}let p=[...Ae(t,c,f),...ke(i,l),...Ce(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>w.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 ${w.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:w.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 C(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]="aca45ea2-8020-5367-bd9a-a368d5a30707")}catch{}})();function x(e){return e.startsWith("--")?`--${e.slice(2).replaceAll("_","-")}`:e}function G(e){let a=new Map;for(let l of e){let t=x(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=x(l.flag);if(l.flag!==t)return l;let i=C([...l.aliases??[],...a.get(t)]).filter(f=>f!==t);return i.length===0?l:{...l,aliases:i}})}function il(e){let a=G(e),l=new Set(a.map(t=>t.flag));return a.filter(t=>{let i=x(t.flag);return t.flag===i||!l.has(i)})}var P=D.map(e=>({flag:e.flag,reservation_scope:"inherited",...e.aliases?{aliases:[...e.aliases]}:{},...e.value_name?{value_name:e.value_name}:{}})),nl=[...P,{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."}],J=[{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"}],ee=[{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"}],I=M([{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"},...J,{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"])),be=[{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}],Se=[{flag:"--id",value_name:"item-id"},{flag:"--add",aliases:["--comment","--body","--text"]},{flag:"--stdin"},{flag:"--file"},{flag:"--edit"},{flag:"--delete"},{flag:"--limit"},{flag:"--full-history"},{flag:"--if-absent",value_type:"boolean"},{flag:"--author"},{flag:"--message"},{flag:"--force"}];function M(e,a){return e.map(l=>a.has(l.flag)?{...l,cursor_semantics:"presentation"}:l)}var we=[{flag:"--id",value_name:"item-id"},{flag:"--add",aliases:["--note","--text"]},{flag:"--add-json"},{flag:"--stdin"},{flag:"--file"},{flag:"--edit"},{flag:"--delete"},{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"}],Ne=[{flag:"--id",value_name:"item-id"},{flag:"--add",aliases:["--learning","--text"]},{flag:"--stdin"},{flag:"--file"},{flag:"--edit"},{flag:"--delete"},{flag:"--limit"},{flag:"--full-history"},{flag:"--if-absent",value_type:"boolean"},{flag:"--author"},{flag:"--message"},{flag:"--force"}],Oe=[{flag:"--id",value_name:"item-id"},{flag:"--add"},{flag:"--add-glob"},{flag:"--remove"},{flag:"--migrate"},{flag:"--note"},{flag:"--list"},{flag:"--append-stable"},{flag:"--validate-paths"},{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"}],xe=[{flag:"--id",value_name:"item-id"},{flag:"--add"},{flag:"--add-glob"},{flag:"--remove"},{flag:"--migrate"},{flag:"--note"},{flag:"--list"},{flag:"--validate-paths"},{flag:"--author"},{flag:"--message"},{flag:"--force"}],Le=[{flag:"--id",value_name:"item-id"},{flag:"--limit"},{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"}],Ee=[{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"}],Re=[{flag:"--id",value_name:"item-id"},{flag:"--literal"},{flag:"--regex"},{flag:"--replacement"},{flag:"--dry-run"},{flag:"--author"},{flag:"--message"},{flag:"--force"}],Fe=[{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"}],Ie=[{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"}],Ge=[{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"}],Pe=[{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"}],Me=[{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"}],De=[{flag:"--dry-run"},{flag:"--author"},{flag:"--force"}],ae=[{flag:"--title"},{flag:"--description"},{flag:"--scope"},{flag:"--parent"},{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"},{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"}],$e=[{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"}],Ue=[{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"}],le=[{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"}],te=[...m,{flag:"--capability"}],B=[...le,{flag:"--declarative"}],ze=[...te,{flag:"--declarative"}],je=[{flag:"--dry-run"},{flag:"--project"},{flag:"--local"},{flag:"--global"},{flag:"--gh"},{flag:"--github"},{flag:"--ref"}],Xe=m,qe=m,He=[...m,{flag:"--markdown"},{flag:"--output"}],Ye=m,Be=m,Ke=m,Ve=[...m,{flag:"--dry-run"}],We=[...m,{flag:"--offline",value_type:"boolean"},{flag:"--runtime-probe"},{flag:"--fix-managed-state"}],Ze=[...m,{flag:"--watch"}],Qe=[...m,{flag:"--detail"},{flag:"--trace"},{flag:"--fix-managed-state"},{flag:"--isolated"},{flag:"--ignore-global"},{flag:"--strict-exit"},{flag:"--fail-on-warn"}],K=[...m,{flag:"--fields",list:!0}],Je=[...m,{flag:"--gh"},{flag:"--github"},{flag:"--ref"}],ea=[{flag:"--dry-run"},{flag:"--project"},{flag:"--local"},{flag:"--global"},{flag:"--gh"},{flag:"--github"},{flag:"--ref"}],se=[{flag:"--dry-run"},{flag:"--cli-only"},{flag:"--packages-only"},{flag:"--project"},{flag:"--local"},{flag:"--global"},{flag:"--repair"},{flag:"--tag"},{flag:"--package-name"}],ol=[{flag:"--mode"},{flag:"--progress"}],aa=[{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"}],la=[{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"},...ee,{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"}],ta=[{flag:"--id",value_name:"item-id"},{flag:"--body",short:"-b"},{flag:"--text"},{flag:"--author"},{flag:"--message"},{flag:"--force"}],sa=[{flag:"--start",value_type:"boolean"},{flag:"--id",value_name:"item-id"},{flag:"--author",aliases:["--assignee"]},{flag:"--message"},{flag:"--force"},{flag:"--if-available"},{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"]}],ia=[{flag:"--id",value_name:"item-id"},{flag:"--author"},{flag:"--message"},{flag:"--force"}],na=[{flag:"--id",value_name:"item-id"},{flag:"--dry-run"},{flag:"--author"},{flag:"--message"},{flag:"--force"}],oa=[{flag:"--pause",value_type:"boolean"},{flag:"--handoff",value_name:"status"},{flag:"--id",value_name:"item-id"},{flag:"--author",aliases:["--assignee"]},{flag:"--message"},{flag:"--force"}],ra=[{flag:"--id",value_name:"item-id"},{flag:"--author",aliases:["--assignee"]},{flag:"--message"},{flag:"--force"}],ga=[{flag:"--id",value_name:"item-id"},{flag:"--author",aliases:["--assignee"]},{flag:"--message"},{flag:"--force"}],fa=[{flag:"--id",value_name:"item-id"},{flag:"--author",aliases:["--assignee"]},{flag:"--message"},{flag:"--validate-close",value_name:"off|warn|strict"},{flag:"--force"}],ie=[{flag:"--parent"},{flag:"--allow-missing-parent"},{flag:"--tags"},{flag:"--priority"},{flag:"--body"},{flag:"--description"},{flag:"--author"},{flag:"--message"}],ne=[{flag:"--start"},{flag:"--duration"},{flag:"--end"},{flag:"--location"},{flag:"--timezone"},{flag:"--all-day"},...ie],ca=ne,pa=[{flag:"--at"},{flag:"--text"},...ie],da=[{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:"--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:"--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"}],ma=[{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:"--auto-pm-context"}],ua=[{flag:"--limit"}],rl=[{flag:"--status"},{flag:"--limit"},{flag:"--stream"},{flag:"--tail"},{flag:"--force"},{flag:"--author"}],_a=[{flag:"--dry-run"},{flag:"--scope"}],va=[{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"}],ha=[{flag:"--exhaustive",value_type:"boolean"},{flag:"--status",repeatable:!0,list:!0},{flag:"--since"},{flag:"--threshold"},{flag:"--limit"}],Ta=[{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"}],ya=[{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"}],oe=[{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"}],re=[{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"}],ge=[{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"}],fe=[{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"]}],V=[{flag:"--stdin-json"},{short:"-t",flag:"--title"},{flag:"--id"},{short:"-d",flag:"--description"},{flag:"--type"},{flag:"--template"},{flag:"--create-mode"},{flag:"--create_mode"},{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"},...re,...ge,{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"},{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"}],Aa=[{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"}],ka=[{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"}],Ca=[{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"}],ba=[{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"}],Sa=[{flag:"--id",value_name:"item-id"},{flag:"--clear"}],wa=[{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"},...fe,...re,{flag:"--fixed_version"},...ge,{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"},{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"}],Na=[{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"},...ee,{flag:"--dry-run"},{flag:"--rollback"},{flag:"--no-checkpoint"},{short:"-t",flag:"--title"},{short:"-d",flag:"--description"},{short:"-b",flag:"--body"},...fe,{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"},{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"}],W=[{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"}],Oa=[{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"}],xa=[{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"}],Z=M([{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"},{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"])),La=[{flag:"--id",value_name:"item-id"},{flag:"--for",value_name:"intent"},{flag:"--token-budget",aliases:["--token_budget"]},{flag:"--depth"},{flag:"--full",value_type:"boolean"},{flag:"--fields",list:!0},{flag:"--at"},{flag:"--tree"},{flag:"--tree-depth"},{flag:"--tree_depth"},{flag:"--format"}],Ea=[{flag:"--list"},{flag:"--format"},{flag:"--depth"}],Ra=[{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}],Fa=[{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"}],Ia=[{flag:"--mode"},{flag:"--k"},{flag:"--fail-under"},{flag:"--queries"},{flag:"--format"}],_=[{flag:"--dry-run"},{flag:"--force"},{flag:"--author"},{flag:"--message"}],ce=[],Ga=[{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"]}],Pa=M([{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"},...J],new Set(["--highlight","--compact","--full","--fields","--format","--limit","--token-budget","--after"])),Ma=[{flag:"--action"},{flag:"--command"},{flag:"--summary"},{flag:"--schema-only"},{flag:"--flags-only"},{flag:"--availability-only"},{flag:"--runtime-only"},{flag:"--active-only"},{flag:"--full"}],Da=[{flag:"--eager-tags"}];function gl(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[...P,...e]){let i=x(t.flag),f=l.get(i),{aliases:c,...p}=t,o=C([...c??[],...t.flag===i?[]:[t.flag]]).filter(u=>u!==i),d={...p,flag:i,...o.length>0?{aliases:o}:{}},r=C([...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 G([...l.values()])}var $a=["list-draft","list-open","list-in-progress","list-blocked","list-closed","list-canceled"],Ua=I.filter(e=>e.flag!=="--status"&&e.flag!=="--all");function L(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 za=L(ae),ja=L(oe),Xa=new Map([["assurance",ja],["plan",za],["workspace",L(ce)],["workspace snapshot",L(_)]]);function qa(e=h){return e.map(({command:a,parent:l,accepted_flags:t})=>{let i=Xa.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 Ha=qa(),pe=new Map([["list",I],["list-all",I],...$a.map(e=>[e,Ua]),["templates",V],["cal",W],["ctx",Z],["test-runs-worker",[]],["init",$e],["config",Ue],["extension",le],["package",B],["packages",B],["install",ea],["upgrade",se],["create",V],["item",[]],["item mutate",Aa],["item complete",ka],["item reopen",Ca],["copy",ba],["focus",Sa],["aggregate",be],["calendar",W],["context",Z],["get",La],["guide",Ea],["search",Pa],["next",Ga],["eval",Ia],["workspace",_],["workspace position",ce],["workspace snapshot",_],["workspace snapshot create",_],["workspace snapshot list",_],["workspace snapshot inspect",_],["workspace snapshot restore",_],["workspace snapshot delete",_],["history",Le],["history-redact",Re],["history-repair",Fe],["history-author-acknowledge",Ie],["history-compact",Ge],["history-attest",Pe],["merge",Ee],["schema",Me],["profile",De],["plan",ae],["activity",Oa],["events",xa],["restore",ia],["update",wa],["update-many",Na],["close",aa],["close-many",la],["delete",na],["append",ta],["comments",Se],["notes",we],["learnings",Ne],["files",Oe],["docs",xe],["deps",Ra],["graph",Fa],["test",da],["test-all",ma],["telemetry",ua],["health",Ta],["assurance",oe],...Ha,["validate",ya],["gc",_a],["stats",va],["duplicates",ha],["contracts",Ma],["completion",Da],["claim",sa],["release",oa],["start-task",ra],["pause-task",ga],["close-task",fa],["meet",ne],["event",ca],["remind",pa]]),de=new Map([["install",je],["uninstall",Xe],["explore",qe],["manage",We],["describe",He],["reload",Ze],["doctor",Qe],["catalog",K],["list",K],["adopt",Je],["adopt-all",Ye],["activate",Be],["deactivate",Ke],["migrate",Ve]]);function me(e){return typeof e!="string"?"":b(e.trim().toLowerCase())}function Q(e){let a=me(e);if(pe.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"||de.has(t))}function Ya(e,a){return a==="init"||a==="scaffold"?e==="extension"?te:ze:de.get(a)??[]}function fl(e){let a=me(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(se,!0):O(Ya(l,t),Q(a));let f=pe.get(a)??[];return O(f,Q(a))}function cl(e,a=!0){let l=G(e).flatMap(i=>[i.short,i.flag,...i.aliases??[]]).filter(i=>!!i),t=a?[...l,...P.flatMap(i=>[i.short,i.flag,...i.aliases??[]]).filter(i=>!!i)]:l;return C(t).join(" ")}export{C as a,F as b,ue as c,h as d,Ka as e,Te as f,Va as g,N as h,R as i,w as j,q as k,ye as l,S as m,Wa as n,Za as o,G as p,il as q,P as r,nl as s,I as t,be as u,Se as v,we as w,Ne as x,Oe as y,xe as z,Le as A,Ee as B,Re as C,Fe as D,Ie as E,Ge as F,Pe as G,Me as H,De as I,ae as J,$e as K,Ue as L,le as M,m as N,te as O,B as P,ze as Q,je as R,Xe as S,qe as T,He as U,Ye as V,Be as W,Ke as X,Ve as Y,We as Z,Ze as _,Qe as $,K as aa,Je as ba,ea as ca,se as da,ol as ea,aa as fa,la as ga,ta as ha,sa as ia,ia as ja,na as ka,oa as la,ra as ma,ga as na,fa as oa,ne as pa,ca as qa,pa as ra,da as sa,ma as ta,ua,rl as va,_a as wa,va as xa,ha as ya,Ta as za,ya as Aa,oe as Ba,V as Ca,Aa as Da,ka as Ea,Ca as Fa,ba as Ga,Sa as Ha,wa as Ia,Na as Ja,W as Ka,Oa as La,xa as Ma,Z as Na,La as Oa,Ea as Pa,Ra as Qa,Fa as Ra,Ia as Sa,_ as Ta,Ga as Ua,Pa as Va,Ma as Wa,Da as Xa,gl as Ya,qa as Za,Ha as _a,Q as $a,fl as ab,cl as bb};
2
- //# sourceMappingURL=chunk-5LBZR6YW.js.map