@unbrained/pm-cli 2026.8.6 → 2026.8.7

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 (209) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +30 -0
  3. package/dist/cli/main.js +4 -2
  4. package/dist/cli/register-operations.js +11 -2
  5. package/dist/cli/stats-analytics-json.d.ts +9 -0
  6. package/dist/cli/stats-analytics-json.js +69 -0
  7. package/dist/cli-bundle/bundle-manifest.json +397 -397
  8. package/dist/cli-bundle/chunks/append-7BXBFDGD.js +2 -0
  9. package/dist/cli-bundle/chunks/{chunk-TPKDJ5WL.js → chunk-2AXF3VSK.js} +2 -2
  10. package/dist/cli-bundle/chunks/{chunk-R6RKEYYW.js → chunk-2XS43CCV.js} +2 -2
  11. package/dist/cli-bundle/chunks/{chunk-T45OHXDW.js → chunk-3A6KWB72.js} +2 -2
  12. package/dist/cli-bundle/chunks/chunk-3ISTDB42.js +8 -0
  13. package/dist/cli-bundle/chunks/{chunk-SXECIECW.js → chunk-4MTI7XOV.js} +2 -2
  14. package/dist/cli-bundle/chunks/{chunk-MCS73BKB.js → chunk-6BX5UDCN.js} +2 -2
  15. package/dist/cli-bundle/chunks/{chunk-A3XQ7VPU.js → chunk-6QPO7KLR.js} +2 -2
  16. package/dist/cli-bundle/chunks/{chunk-BP6EMEDP.js → chunk-7MXHZHSQ.js} +2 -2
  17. package/dist/cli-bundle/chunks/{chunk-GU3TSEHD.js → chunk-7ZPMJW4U.js} +2 -2
  18. package/dist/cli-bundle/chunks/{chunk-343QETLI.js → chunk-AGYNSNCI.js} +2 -2
  19. package/dist/cli-bundle/chunks/chunk-B4H7FEFH.js +5 -0
  20. package/dist/cli-bundle/chunks/{chunk-CA3BURYF.js → chunk-B4KLBBMN.js} +2 -2
  21. package/dist/cli-bundle/chunks/{chunk-3ZJRFYY2.js → chunk-CALJHNBL.js} +12 -12
  22. package/dist/cli-bundle/chunks/{chunk-M357ZCOR.js → chunk-CFIGP5LY.js} +2 -2
  23. package/dist/cli-bundle/chunks/{chunk-SVV3DQES.js → chunk-CS6MRHG7.js} +2 -2
  24. package/dist/cli-bundle/chunks/{chunk-DWOAOZHZ.js → chunk-CUGNQQKH.js} +2 -2
  25. package/dist/cli-bundle/chunks/chunk-D4FPS43D.js +164 -0
  26. package/dist/cli-bundle/chunks/{chunk-L6LGKJX3.js → chunk-H5Y5YE6A.js} +2 -2
  27. package/dist/cli-bundle/chunks/{chunk-5PBP2ZP3.js → chunk-H5Y6UV6E.js} +2 -2
  28. package/dist/cli-bundle/chunks/{chunk-QJ7C3JIW.js → chunk-H7KGWPDF.js} +2 -2
  29. package/dist/cli-bundle/chunks/{chunk-D7I3TUGV.js → chunk-HFSD77TQ.js} +2 -2
  30. package/dist/cli-bundle/chunks/{chunk-AOBDLU4T.js → chunk-HX2GTA6L.js} +2 -2
  31. package/dist/cli-bundle/chunks/{chunk-4AVFKHHC.js → chunk-J2IEKAVR.js} +2 -2
  32. package/dist/cli-bundle/chunks/{chunk-OXY3SJ3N.js → chunk-K44PYFXH.js} +2 -2
  33. package/dist/cli-bundle/chunks/{chunk-M4VEE3FK.js → chunk-K4KGEEBT.js} +2 -2
  34. package/dist/cli-bundle/chunks/chunk-KFLK5TRH.js +21 -0
  35. package/dist/cli-bundle/chunks/{chunk-FDBRXV25.js → chunk-KL6IEBV2.js} +2 -2
  36. package/dist/cli-bundle/chunks/{chunk-JQ4NZ5EB.js → chunk-KWQZDZSS.js} +2 -2
  37. package/dist/cli-bundle/chunks/{chunk-UVVXHGYS.js → chunk-KZ4X3DGU.js} +2 -2
  38. package/dist/cli-bundle/chunks/chunk-LD77HJMQ.js +13 -0
  39. package/dist/cli-bundle/chunks/{chunk-AYRUGRNS.js → chunk-ME2JJ4LA.js} +2 -2
  40. package/dist/cli-bundle/chunks/chunk-NFLJ3FHD.js +2 -0
  41. package/dist/cli-bundle/chunks/{chunk-MDTH7SAE.js → chunk-NG6OXIBR.js} +8 -8
  42. package/dist/cli-bundle/chunks/{chunk-R6LSRGPS.js → chunk-NYIGHWQY.js} +2 -2
  43. package/dist/cli-bundle/chunks/{chunk-3KFVGGRE.js → chunk-NZ75GNSA.js} +2 -2
  44. package/dist/cli-bundle/chunks/{chunk-Q3VOP62W.js → chunk-PCJWJNC2.js} +2 -2
  45. package/dist/cli-bundle/chunks/{chunk-C3YABSJK.js → chunk-PD3225AM.js} +2 -2
  46. package/dist/cli-bundle/chunks/{chunk-JFZIS6JF.js → chunk-PDEGKG7P.js} +2 -2
  47. package/dist/cli-bundle/chunks/chunk-PIE5HBNA.js +2 -0
  48. package/dist/cli-bundle/chunks/{chunk-SD3YXU2U.js → chunk-PW2H7YJR.js} +20 -20
  49. package/dist/cli-bundle/chunks/{chunk-PECV7L5T.js → chunk-TPKN3S7S.js} +2 -2
  50. package/dist/cli-bundle/chunks/{chunk-F4NREH3G.js → chunk-TPXAXTCO.js} +2 -2
  51. package/dist/cli-bundle/chunks/chunk-UFWUJO4V.js +2 -0
  52. package/dist/cli-bundle/chunks/{chunk-WSI5KZQJ.js → chunk-UQLZQVFW.js} +2 -2
  53. package/dist/cli-bundle/chunks/{chunk-4OVGQW22.js → chunk-VT3Z5G7D.js} +2 -2
  54. package/dist/cli-bundle/chunks/{chunk-RUAU5OSH.js → chunk-WOD3WWUN.js} +2 -2
  55. package/dist/cli-bundle/chunks/{chunk-DQGJ2RWT.js → chunk-WSJEIGJF.js} +2 -2
  56. package/dist/cli-bundle/chunks/{chunk-RAFUN7IX.js → chunk-WYNUU7ZW.js} +49 -46
  57. package/dist/cli-bundle/chunks/{chunk-5ZKQPA44.js → chunk-YGPNCCXZ.js} +2 -2
  58. package/dist/cli-bundle/chunks/close-CMY3BAUG.js +2 -0
  59. package/dist/cli-bundle/chunks/close-many-SA4XZCTK.js +2 -0
  60. package/dist/cli-bundle/chunks/comments-EZ556ZD3.js +2 -0
  61. package/dist/cli-bundle/chunks/copy-ZSGPA52X.js +2 -0
  62. package/dist/cli-bundle/chunks/{create-TG67IVFI.js → create-I5DVV4YG.js} +2 -2
  63. package/dist/cli-bundle/chunks/delete-RL3JACSW.js +2 -0
  64. package/dist/cli-bundle/chunks/{deps-AJUGP2OH.js → deps-S7UBCECS.js} +2 -2
  65. package/dist/cli-bundle/chunks/{docs-QOCLDRKJ.js → docs-ZZNVBBYO.js} +2 -2
  66. package/dist/cli-bundle/chunks/{files-3ST5TY64.js → files-27C337VT.js} +2 -2
  67. package/dist/cli-bundle/chunks/focus-5Z2SG7LU.js +2 -0
  68. package/dist/cli-bundle/chunks/{history-compact-7BJFML4S.js → history-compact-HJQK67CZ.js} +2 -2
  69. package/dist/cli-bundle/chunks/{history-redact-WJN3HYXR.js → history-redact-PWC6PDWA.js} +2 -2
  70. package/dist/cli-bundle/chunks/{history-repair-XDNZUB7F.js → history-repair-N3CY4WBF.js} +2 -2
  71. package/dist/cli-bundle/chunks/{learnings-SZMUPVNA.js → learnings-4FH23XDT.js} +2 -2
  72. package/dist/cli-bundle/chunks/{profile-KL53JIAC.js → profile-5Y5XXH5N.js} +2 -2
  73. package/dist/cli-bundle/chunks/{register-list-query-QH7ONPKU.js → register-list-query-FJZCJ67O.js} +2 -2
  74. package/dist/cli-bundle/chunks/{register-mutation-OCRQNZK4.js → register-mutation-YGYPW3BL.js} +3 -3
  75. package/dist/cli-bundle/chunks/register-operations-WMDSUMQF.js +2 -0
  76. package/dist/cli-bundle/chunks/{register-setup-QWBQ6HBS.js → register-setup-DL7FFABC.js} +2 -2
  77. package/dist/cli-bundle/chunks/restore-6KYBV5BY.js +2 -0
  78. package/dist/cli-bundle/chunks/{schema-QJ27OTRV.js → schema-EQGKBYXJ.js} +2 -2
  79. package/dist/cli-bundle/chunks/update-QVTYOD6I.js +2 -0
  80. package/dist/cli-bundle/chunks/update-many-DJSBU525.js +2 -0
  81. package/dist/cli-bundle/focused-chunks/{chunk-MBBMTDD3.js → chunk-2ECLECMK.js} +3 -3
  82. package/dist/cli-bundle/focused-chunks/{chunk-CL3NB7VW.js → chunk-3K4XV2BF.js} +2 -2
  83. package/dist/cli-bundle/focused-chunks/{chunk-ME4XVOBJ.js → chunk-4EX25PXM.js} +2 -2
  84. package/dist/cli-bundle/focused-chunks/chunk-4VJQTS3P.js +2 -0
  85. package/dist/cli-bundle/focused-chunks/chunk-73JUDYXT.js +2 -0
  86. package/dist/cli-bundle/focused-chunks/{chunk-GSW2Y7VZ.js → chunk-CIXVQPB7.js} +2 -2
  87. package/dist/cli-bundle/focused-chunks/{chunk-7YTZ7A4E.js → chunk-DLTS3IHM.js} +2 -2
  88. package/dist/cli-bundle/focused-chunks/{chunk-YHDCGUIW.js → chunk-DQ6FKGL3.js} +10 -10
  89. package/dist/cli-bundle/focused-chunks/{chunk-YLPZHWX7.js → chunk-HNL6IFGS.js} +2 -2
  90. package/dist/cli-bundle/focused-chunks/chunk-JLG2C4EQ.js +2 -0
  91. package/dist/cli-bundle/focused-chunks/{chunk-6KDHXURF.js → chunk-MHMTKV5V.js} +2 -2
  92. package/dist/cli-bundle/focused-chunks/{chunk-GEYU23YS.js → chunk-MOTJFQ3F.js} +22 -22
  93. package/dist/cli-bundle/focused-chunks/{chunk-EYO4F74Z.js → chunk-NBJKQP4S.js} +2 -2
  94. package/dist/cli-bundle/focused-chunks/{chunk-XNVXIQ4B.js → chunk-QHRTT7WT.js} +2 -2
  95. package/dist/cli-bundle/focused-chunks/{chunk-27DK4A5O.js → chunk-R2LEMEV5.js} +2 -2
  96. package/dist/cli-bundle/focused-chunks/{chunk-4JC3AOGS.js → chunk-RPNYG5MO.js} +2 -2
  97. package/dist/cli-bundle/focused-chunks/{chunk-EAXXF2HW.js → chunk-RW5IYD4J.js} +2 -2
  98. package/dist/cli-bundle/focused-chunks/{chunk-TQMFQYXR.js → chunk-TIKDBG4D.js} +16 -16
  99. package/dist/cli-bundle/focused-chunks/{chunk-N7QN3NE6.js → chunk-VZFU2R4M.js} +2 -2
  100. package/dist/cli-bundle/focused-chunks/{chunk-GIERI4YU.js → chunk-YZEZAPJK.js} +2 -2
  101. package/dist/cli-bundle/focused-chunks/chunk-ZJIMJHDB.js +2 -0
  102. package/dist/cli-bundle/main.js +2 -2
  103. package/dist/cli-bundle/sdk-authoring.js +1 -1
  104. package/dist/cli-bundle/sdk-contracts.js +1 -1
  105. package/dist/cli-bundle/sdk-core.js +29 -28
  106. package/dist/cli-bundle/sdk-governance.js +1 -1
  107. package/dist/cli-bundle/sdk-graph.js +1 -1
  108. package/dist/cli-bundle/sdk-merge.js +1 -1
  109. package/dist/cli-bundle/sdk-query.js +1 -1
  110. package/dist/cli-bundle/sdk-runtime.js +1 -1
  111. package/dist/cli-bundle/sdk-testing.js +1 -1
  112. package/dist/cli-bundle/sdk.js +1 -1
  113. package/dist/core/extensions/reserved-host-flags.js +3 -2
  114. package/dist/core/history/workspace-history.d.ts +22 -2
  115. package/dist/core/history/workspace-history.js +60 -36
  116. package/dist/core/output/output.d.ts +2 -0
  117. package/dist/core/output/output.js +3 -2
  118. package/dist/core/shared/command-types.d.ts +2 -0
  119. package/dist/core/shared/command-types.js +2 -2
  120. package/dist/mcp/tool-definitions.js +6 -2
  121. package/dist/sdk/author-attribution.js +23 -7
  122. package/dist/sdk/cli-bootstrap.d.ts +2 -0
  123. package/dist/sdk/cli-bootstrap.js +7 -2
  124. package/dist/sdk/cli-contracts/completeness.js +51 -4
  125. package/dist/sdk/cli-contracts/flag-contracts.js +3 -2
  126. package/dist/sdk/cli-contracts/registration-helpers.js +3 -2
  127. package/dist/sdk/cli-contracts/runtime-contracts.js +14 -8
  128. package/dist/sdk/cli-contracts/tool-parameter-tables.js +116 -10
  129. package/dist/sdk/cli-contracts/tool-schema.js +18 -2
  130. package/dist/sdk/cli-program.js +3 -2
  131. package/dist/sdk/completion.js +5 -2
  132. package/dist/sdk/contracts.d.ts +1 -0
  133. package/dist/sdk/contracts.js +2 -2
  134. package/dist/sdk/core.d.ts +3 -1
  135. package/dist/sdk/core.js +4 -3
  136. package/dist/sdk/extension.js +9 -11
  137. package/dist/sdk/generated-error-code-catalog.js +112 -2
  138. package/dist/sdk/history-analytics.d.ts +141 -0
  139. package/dist/sdk/history-analytics.js +283 -0
  140. package/dist/sdk/improvement-ledger-validation.d.ts +3 -0
  141. package/dist/sdk/improvement-ledger-validation.js +63 -0
  142. package/dist/sdk/improvement-ledger.d.ts +139 -0
  143. package/dist/sdk/improvement-ledger.js +261 -0
  144. package/dist/sdk/index.d.ts +6 -2
  145. package/dist/sdk/index.js +8 -4
  146. package/dist/sdk/lifecycle/plan.js +6 -3
  147. package/dist/sdk/merge/install.js +10 -2
  148. package/dist/sdk/read-output-budget.js +24 -22
  149. package/dist/sdk/read-output-contracts.d.ts +10 -2
  150. package/dist/sdk/read-output-contracts.js +124 -65
  151. package/dist/sdk/read-output-rows.d.ts +29 -0
  152. package/dist/sdk/read-output-rows.js +100 -0
  153. package/dist/sdk/read-output-session.d.ts +69 -0
  154. package/dist/sdk/read-output-session.js +200 -0
  155. package/dist/sdk/runtime-input.d.ts +2 -0
  156. package/dist/sdk/runtime-input.js +14 -2
  157. package/dist/sdk/runtime-primitives.d.ts +1 -1
  158. package/dist/sdk/runtime-primitives.js +3 -3
  159. package/dist/sdk/runtime-stats-options.d.ts +9 -0
  160. package/dist/sdk/runtime-stats-options.js +38 -0
  161. package/dist/sdk/runtime.d.ts +1 -0
  162. package/dist/sdk/runtime.js +6 -27
  163. package/dist/sdk/stats.d.ts +40 -0
  164. package/dist/sdk/stats.js +112 -29
  165. package/docs/IMPROVEMENT_ANALYTICS.md +103 -0
  166. package/docs/OUTPUT_PROJECTION_CONTRACTS.md +5 -5
  167. package/docs/README.md +1 -0
  168. package/docs/READ_OUTPUT_CONTRACTS.md +60 -1
  169. package/marketplace.json +2 -2
  170. package/package.json +3 -3
  171. package/packages/pm-beads/package.json +1 -1
  172. package/packages/pm-calendar/package.json +1 -1
  173. package/packages/pm-command-kit/package.json +1 -1
  174. package/packages/pm-digital-twin/package.json +1 -1
  175. package/packages/pm-governance-audit/package.json +1 -1
  176. package/packages/pm-guide-shell/package.json +1 -1
  177. package/packages/pm-kanban/package.json +1 -1
  178. package/packages/pm-lifecycle-hooks/package.json +1 -1
  179. package/packages/pm-linked-test-adapters/package.json +1 -1
  180. package/packages/pm-search-advanced/package.json +1 -1
  181. package/packages/pm-templates/package.json +1 -1
  182. package/packages/pm-todos/package.json +1 -1
  183. package/packages/pm-vcs/package.json +1 -1
  184. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  185. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  186. package/sdk/public-surface.json +374 -821
  187. package/dist/cli-bundle/chunks/append-XAJ5Z4XS.js +0 -2
  188. package/dist/cli-bundle/chunks/chunk-AJE3AHPD.js +0 -8
  189. package/dist/cli-bundle/chunks/chunk-E7BFPLUZ.js +0 -5
  190. package/dist/cli-bundle/chunks/chunk-HS7OVAUN.js +0 -164
  191. package/dist/cli-bundle/chunks/chunk-SV3YQ4RY.js +0 -2
  192. package/dist/cli-bundle/chunks/chunk-V663653R.js +0 -20
  193. package/dist/cli-bundle/chunks/chunk-XPOQQJTX.js +0 -13
  194. package/dist/cli-bundle/chunks/chunk-YCCDXBNU.js +0 -2
  195. package/dist/cli-bundle/chunks/chunk-ZFBWCKYF.js +0 -2
  196. package/dist/cli-bundle/chunks/close-DI66JMSB.js +0 -2
  197. package/dist/cli-bundle/chunks/close-many-VFKT6U3O.js +0 -2
  198. package/dist/cli-bundle/chunks/comments-E73HIEZJ.js +0 -2
  199. package/dist/cli-bundle/chunks/copy-WBYVLCPC.js +0 -2
  200. package/dist/cli-bundle/chunks/delete-6XKUVVQN.js +0 -2
  201. package/dist/cli-bundle/chunks/focus-R2AWS63Y.js +0 -2
  202. package/dist/cli-bundle/chunks/register-operations-HIBJXRGB.js +0 -2
  203. package/dist/cli-bundle/chunks/restore-FXA5QPM7.js +0 -2
  204. package/dist/cli-bundle/chunks/update-7GBO4SXG.js +0 -2
  205. package/dist/cli-bundle/chunks/update-many-VF6ZKQUO.js +0 -2
  206. package/dist/cli-bundle/focused-chunks/chunk-74CWP3A4.js +0 -2
  207. package/dist/cli-bundle/focused-chunks/chunk-7AZDTGPA.js +0 -2
  208. package/dist/cli-bundle/focused-chunks/chunk-LKQXXO62.js +0 -2
  209. package/dist/cli-bundle/focused-chunks/chunk-QL5H3AQH.js +0 -2
@@ -1,2 +1,2 @@
1
- import{jb as h,lc as L,mb as I,uf as D}from"./chunk-HS7OVAUN.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="1b2f1ac3-82b3-58a2-9f40-2dd95ab1b2bc")}catch{}})();var x="global",E="external";function u(t){let e=t?.trim().toLowerCase();return e===x||e===E}function A(t){let e=t?.trim();if(e)return u(e)?x:e}function G(t,e,r){let o=t.trim();return u(r)?o:D(o,e)}(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="8368a519-4c09-540e-b0fb-f74cfdc1d7b2")}catch{}})();function y(t){if(typeof t!="string")return;let e=t.trim();if(!(!e||["none","null","n/a","na"].includes(e.toLowerCase())))return e}function b(t){let e=y(t);return e?.toLowerCase()==="no-active-blocker"?void 0:e}function v(){let t=h();for(let e of L()?.relationship_kinds??[])for(let r of e.definitions)t.register(r);return t}function k(t,e){let r=t.toLowerCase(),o=e.toLowerCase();return r!==o?r<o?-1:1:t!==e?t<e?-1:1:0}function z(t){let e=new Map;for(let r of t.dependencies??[]){if(typeof r!="object"||r===null)continue;let o=r,i=y(o.id);if(!i)continue;let c=typeof o.kind=="string"?o.kind:"related",l=`${c}\0${i.toLowerCase()}`,p=e.get(l);p?p.count+=1:e.set(l,{target_id:i,kind:c,count:1})}return e}function S(t,e=r=>r==="closed"||r==="canceled"){let r=[];for(let o of t)if(!(typeof o?.id!="string"||o.id.trim().length===0))for(let i of z(o).values())i.count<2||r.push({holder_id:o.id.trim(),target_id:i.target_id,kind:i.kind,occurrences:i.count,holder_status:o.status,legacy_terminal:e(o.status)});return r.sort((o,i)=>{let c=k(o.holder_id,i.holder_id);if(c!==0)return c;let l=k(o.target_id,i.target_id);return l!==0?l:k(o.kind,i.kind)})}function T(t,e=r=>r==="closed"||r==="canceled"){let r=t.filter(s=>typeof s?.id=="string"&&s.id.trim().length>0),o=new Set(r.map(s=>s.id.trim().toLowerCase())),i=new Map,c=(s,d,f,m)=>{let n=y(d);if(!n||o.has(n.toLowerCase()))return;let a={holder_id:s.id.trim(),target_id:n,kind:f,source:m,holder_status:s.status,legacy_terminal:e(s.status),no_active_blocker_sentinel:n.toLowerCase()==="no-active-blocker"};i.set(`${a.holder_id}::${a.target_id}::${a.kind}::${a.source}`,a)};for(let s of r){c(s,s.parent,"parent","parent"),c(s,s.blocked_by,"blocked_by","blocked_by");for(let d of s.dependencies??[]){if(typeof d!="object"||d===null)continue;let f=d;u(f.source_kind)||c(s,f.id,typeof f.kind=="string"?f.kind:"related","dependency")}}let l=[...i.values()].sort((s,d)=>s.holder_id.localeCompare(d.holder_id)||s.target_id.localeCompare(d.target_id)||s.kind.localeCompare(d.kind)||s.source.localeCompare(d.source)),p=l.filter(s=>s.legacy_terminal);return{active:l.filter(s=>!s.legacy_terminal),legacy_terminal:p,no_active_blocker_sentinels:l.filter(s=>s.no_active_blocker_sentinel)}}function $(t){let e=new Map;for(let r of[...t.active,...t.legacy_terminal]){if(r.no_active_blocker_sentinel)continue;let o=r.target_id.trim(),i=o.toLowerCase();e.has(i)||e.set(i,o)}return[...e.values()].sort((r,o)=>r.localeCompare(o))}function M(t){let e=new Map;for(let r of t)for(let o of r.dependencies??[]){if(typeof o!="object"||o===null||!u(o.source_kind))continue;let i=y(o.id);i&&!e.has(i.toLowerCase())&&e.set(i.toLowerCase(),i)}return[...e.values()].sort((r,o)=>r.localeCompare(o))}function W(t,e,r){let o=r??v(),i=t.filter(n=>typeof n?.id=="string"&&n.id.trim().length>0),c=new Map(i.map(n=>[n.id.trim().toLowerCase(),n.id.trim()])),l=T(i,e),p=$(l);for(let n of p)c.set(n.toLowerCase(),n);let s=M(i),d=new Set(c.keys()),f=new Map;for(let n of s){let a=n;for(;d.has(a.toLowerCase());)a=`external:${a}`;f.set(n.toLowerCase(),a),d.add(a.toLowerCase())}let m=i.map(n=>{let a=b(n.parent),C=b(n.blocked_by),R=(n.dependencies??[]).flatMap(_=>{if(typeof _!="object"||_===null)return[];let g=_,w=b(g.id);return w?[{id:u(g.source_kind)?f.get(w.toLowerCase()):c.get(w.toLowerCase()),kind:typeof g.kind=="string"?g.kind:"related"}]:[]});return{id:n.id.trim(),...a?{parent:c.get(a.toLowerCase())}:{},...C?{blocked_by:c.get(C.toLowerCase())}:{},dependencies:R}});return{graph:I.fromItems([...m,...p.map(n=>({id:n})),...s.map(n=>({id:f.get(n.toLowerCase())}))],o),details:[...i.map(n=>({id:n.id.trim(),title:n.title,status:n.status,...typeof n.type=="string"&&n.type.trim().length>0?{type:n.type.trim()}:{}})),...p.map(n=>({id:n,title:`[missing] ${n}`,status:"missing"})),...s.map(n=>({id:f.get(n.toLowerCase()),title:`[external] ${n}`,status:"external"}))],missingIdSet:new Set(p.map(n=>n.toLowerCase())),dangling:l,duplicateRows:S(i,e)}}export{x as a,E as b,u as c,A as d,G as e,b as f,v as g,S as h,T as i,$ as j,W as k};
2
- //# sourceMappingURL=chunk-PECV7L5T.js.map
1
+ import{Hf as D,jb as h,lc as L,mb as I}from"./chunk-D4FPS43D.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="1b2f1ac3-82b3-58a2-9f40-2dd95ab1b2bc")}catch{}})();var x="global",E="external";function u(t){let e=t?.trim().toLowerCase();return e===x||e===E}function A(t){let e=t?.trim();if(e)return u(e)?x:e}function G(t,e,r){let o=t.trim();return u(r)?o:D(o,e)}(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="8368a519-4c09-540e-b0fb-f74cfdc1d7b2")}catch{}})();function y(t){if(typeof t!="string")return;let e=t.trim();if(!(!e||["none","null","n/a","na"].includes(e.toLowerCase())))return e}function b(t){let e=y(t);return e?.toLowerCase()==="no-active-blocker"?void 0:e}function v(){let t=h();for(let e of L()?.relationship_kinds??[])for(let r of e.definitions)t.register(r);return t}function k(t,e){let r=t.toLowerCase(),o=e.toLowerCase();return r!==o?r<o?-1:1:t!==e?t<e?-1:1:0}function z(t){let e=new Map;for(let r of t.dependencies??[]){if(typeof r!="object"||r===null)continue;let o=r,i=y(o.id);if(!i)continue;let c=typeof o.kind=="string"?o.kind:"related",l=`${c}\0${i.toLowerCase()}`,p=e.get(l);p?p.count+=1:e.set(l,{target_id:i,kind:c,count:1})}return e}function S(t,e=r=>r==="closed"||r==="canceled"){let r=[];for(let o of t)if(!(typeof o?.id!="string"||o.id.trim().length===0))for(let i of z(o).values())i.count<2||r.push({holder_id:o.id.trim(),target_id:i.target_id,kind:i.kind,occurrences:i.count,holder_status:o.status,legacy_terminal:e(o.status)});return r.sort((o,i)=>{let c=k(o.holder_id,i.holder_id);if(c!==0)return c;let l=k(o.target_id,i.target_id);return l!==0?l:k(o.kind,i.kind)})}function T(t,e=r=>r==="closed"||r==="canceled"){let r=t.filter(s=>typeof s?.id=="string"&&s.id.trim().length>0),o=new Set(r.map(s=>s.id.trim().toLowerCase())),i=new Map,c=(s,d,f,m)=>{let n=y(d);if(!n||o.has(n.toLowerCase()))return;let a={holder_id:s.id.trim(),target_id:n,kind:f,source:m,holder_status:s.status,legacy_terminal:e(s.status),no_active_blocker_sentinel:n.toLowerCase()==="no-active-blocker"};i.set(`${a.holder_id}::${a.target_id}::${a.kind}::${a.source}`,a)};for(let s of r){c(s,s.parent,"parent","parent"),c(s,s.blocked_by,"blocked_by","blocked_by");for(let d of s.dependencies??[]){if(typeof d!="object"||d===null)continue;let f=d;u(f.source_kind)||c(s,f.id,typeof f.kind=="string"?f.kind:"related","dependency")}}let l=[...i.values()].sort((s,d)=>s.holder_id.localeCompare(d.holder_id)||s.target_id.localeCompare(d.target_id)||s.kind.localeCompare(d.kind)||s.source.localeCompare(d.source)),p=l.filter(s=>s.legacy_terminal);return{active:l.filter(s=>!s.legacy_terminal),legacy_terminal:p,no_active_blocker_sentinels:l.filter(s=>s.no_active_blocker_sentinel)}}function $(t){let e=new Map;for(let r of[...t.active,...t.legacy_terminal]){if(r.no_active_blocker_sentinel)continue;let o=r.target_id.trim(),i=o.toLowerCase();e.has(i)||e.set(i,o)}return[...e.values()].sort((r,o)=>r.localeCompare(o))}function M(t){let e=new Map;for(let r of t)for(let o of r.dependencies??[]){if(typeof o!="object"||o===null||!u(o.source_kind))continue;let i=y(o.id);i&&!e.has(i.toLowerCase())&&e.set(i.toLowerCase(),i)}return[...e.values()].sort((r,o)=>r.localeCompare(o))}function W(t,e,r){let o=r??v(),i=t.filter(n=>typeof n?.id=="string"&&n.id.trim().length>0),c=new Map(i.map(n=>[n.id.trim().toLowerCase(),n.id.trim()])),l=T(i,e),p=$(l);for(let n of p)c.set(n.toLowerCase(),n);let s=M(i),d=new Set(c.keys()),f=new Map;for(let n of s){let a=n;for(;d.has(a.toLowerCase());)a=`external:${a}`;f.set(n.toLowerCase(),a),d.add(a.toLowerCase())}let m=i.map(n=>{let a=b(n.parent),C=b(n.blocked_by),R=(n.dependencies??[]).flatMap(_=>{if(typeof _!="object"||_===null)return[];let g=_,w=b(g.id);return w?[{id:u(g.source_kind)?f.get(w.toLowerCase()):c.get(w.toLowerCase()),kind:typeof g.kind=="string"?g.kind:"related"}]:[]});return{id:n.id.trim(),...a?{parent:c.get(a.toLowerCase())}:{},...C?{blocked_by:c.get(C.toLowerCase())}:{},dependencies:R}});return{graph:I.fromItems([...m,...p.map(n=>({id:n})),...s.map(n=>({id:f.get(n.toLowerCase())}))],o),details:[...i.map(n=>({id:n.id.trim(),title:n.title,status:n.status,...typeof n.type=="string"&&n.type.trim().length>0?{type:n.type.trim()}:{}})),...p.map(n=>({id:n,title:`[missing] ${n}`,status:"missing"})),...s.map(n=>({id:f.get(n.toLowerCase()),title:`[external] ${n}`,status:"external"}))],missingIdSet:new Set(p.map(n=>n.toLowerCase())),dangling:l,duplicateRows:S(i,e)}}export{x as a,E as b,u as c,A as d,G as e,b as f,v as g,S as h,T as i,$ as j,W as k};
2
+ //# sourceMappingURL=chunk-TPKN3S7S.js.map
@@ -1,2 +1,2 @@
1
- import{g as re,i as de,k as A}from"./chunk-PECV7L5T.js";import{A as y,Af as ne,Bb as J,C as _,Da as X,Kd as Y,La as q,Lf as se,Mf as oe,Nc as V,Oa as H,Of as ie,Pe as C,Qd as $,Sd as Z,Se as N,Td as ee,Wd as te,b as z,cd as O,jb as v,lc as Q}from"./chunk-HS7OVAUN.js";import{createHash as Te}from"node:crypto";(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]="dea35fb9-9f9f-56ce-afc0-f4dc993012c3")}catch{}})();var be=64,xe=8;function Re(e,t){let s=(e.dependencies??[]).map(n=>{if(typeof n!="object"||n===null)return"";let o=n;return`${typeof o.kind=="string"?o.kind:"related"}:${typeof o.id=="string"?o.id:""}`}).sort().join(",");return[e.id,e.title,e.status,t(e.status)?"1":"0",typeof e.type=="string"?e.type.trim():"",e.parent??"",e.blocked_by??"",s].join("\0")}function ae(e,t=n=>n==="closed"||n==="canceled",s=v()){let n=e.filter(i=>typeof i?.id=="string"&&i.id.trim().length>0).map(i=>Re(i,t)).sort(),o=s.list().map(i=>J(i)).sort();return Te("sha256").update(n.join("")).update("").update(o.join("")).digest("hex")}function ce(e,t,s){let n=t??s;if(!Number.isInteger(n)||n<1)throw new TypeError(`Invalid ${e} bound: ${String(t)}`);return n}var M=class{#e=new Map;#t;#n;constructor(t={}){this.#t=ce("maxResultsPerWorkspace",t.maxResultsPerWorkspace,be),this.#n=ce("maxWorkspaces",t.maxWorkspaces,xe)}lookup(t,s,n){let o=this.#e.get(t),i=!0;(o===void 0||o.fingerprint!==s)&&(o={fingerprint:s,assembly:n(),results:new Map},i=!1,!this.#e.has(t)&&this.#e.size>=this.#n&&this.#e.delete(this.#e.keys().next().value)),this.#e.delete(t),this.#e.set(t,o);let d=o,r=this.#t;return{assembly:d.assembly,assemblyReused:i,fingerprint:s,memoize(c,f){let a=d.results.get(c);if(a!==void 0||d.results.has(c))return d.results.delete(c),d.results.set(c,a),{value:structuredClone(a),reused:!0};let l=f();return d.results.size>=r&&d.results.delete(d.results.keys().next().value),d.results.set(c,structuredClone(l)),{value:l,reused:!1}}}}clear(){this.#e.clear()}},ue=new M;function le(){return ue}function ut(){ue.clear()}(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]="31a800f7-1374-5e7c-ad23-ae3d8ebcebe0")}catch{}})();var Le=["prerequisite","dependent","ancestor","descendant","provenance","related"],Ce=new TextEncoder;function P(e,t,s){let n=e??t;if(!Number.isInteger(n)||n<1)throw new TypeError(`Relationship context ${s} must be positive`);return n}function S(e){return Math.max(1,Math.ceil(Ce.encode(JSON.stringify(e)).byteLength/4))}function U(e,t,s){let n=s.resolve(e.kind);if(n?.ordering){let i=(n.precedence??"source_before_target")==="source_before_target"?e.source:e.target;return t===i?"prerequisite":"dependent"}if(n?.hierarchy){let i=(n.hierarchyDirection??"source_parent")==="source_parent"?e.source:e.target;return t===i?"ancestor":"descendant"}return e.kind==="discovered_from"||e.kind==="incident_from"?"provenance":"related"}function Se(e,t,s,n){let o=e.filter(i=>i.source===t&&i.target===s||i.target===t&&i.source===s).map(i=>U(i,s,n));return[...new Set(o)].sort()}function De(e){return Le.find(t=>e.includes(t))}function Ie(e,t,s,n){let o=n.direction??"both",i=n.maxDepth??3;if(!Number.isInteger(i)||i<0)throw new TypeError("Relationship context maxDepth must be non-negative");let d=new Set([t]),r=[{id:t,distance:0}],c=[],f=0,a=!1;for(let l=0;l<r.length;l+=1){n.signal?.throwIfAborted();let u=r[l];if(u.distance>=i&&a)continue;let g=e.neighborEdges(u.id,{direction:o,kinds:n.kinds,signal:n.signal});if(f+=g.meta.inspectedEdges,u.distance>=i){g.value.some(m=>!d.has(m.id))&&(a=!0);continue}for(let{id:m,edge:p}of g.value){if(d.has(m))continue;d.add(m);let h={id:m,distance:u.distance+1,via:u.id,role:U(p,m,s)};c.push(h),r.push(h)}}return c.sort((l,u)=>l.distance-u.distance||l.id.localeCompare(u.id)),{rows:c,visitedNodes:r.length,inspectedEdges:f,depthTruncated:a}}function Be(e,t,s,n){let o={prerequisite:0,dependent:0,ancestor:0,descendant:0,provenance:0,related:0},i=e.neighborEdges(t,{direction:n.direction??"both",kinds:n.kinds,signal:n.signal}).value;for(let{id:d,edge:r}of i)o[U(r,d,s)]+=1;return{directEdges:o,directTotal:i.length,rootEdges:i.map(({edge:d})=>d)}}function Oe(e){let t=[],s=e.initialTokens;for(let n of e.candidates){if(t.length>=e.nodeLimit)break;let o=n.distance===1?Se(e.rootEdges,e.rootId,n.id,e.registry):[],i={...e.details.get(n.id)??{id:n.id},distance:n.distance,role:o.length>0?De(o):n.role,via:n.via,reasons:o.length>0?o:[`${n.role} via ${n.via} (depth ${n.distance})`]},d=S(i);if(s+d>e.tokenBudget)break;t.push(i),s+=d}if(e.candidates.length>0&&t.length===0)throw new TypeError("Relationship context tokenBudget cannot fit one node");return{nodes:t,usedTokens:s}}function $e(e){let t=e.options.kinds?new Set(e.options.kinds.map(i=>e.registry.require(i).kind)):void 0,s=e.graph.edges().filter(i=>{if(!e.included.has(i.source)||!e.included.has(i.target))return!1;if(t===void 0||t.has(i.kind))return!0;let d=e.registry.resolve(i.kind)?.inverse;return d!==void 0&&t.has(d)}),n=[],o=e.initialTokens;for(let i of s){if(n.length>=e.edgeLimit)break;let d=S(i);if(o+d>e.tokenBudget)break;n.push(i),o+=d}return{edges:n,usedTokens:o,candidateCount:s.length}}function fe(e,t,s,n={}){if(!e.nodes().includes(t))throw new TypeError(`Relationship node not found: ${t}`);let o=P(n.nodeLimit,20,"nodeLimit"),i=P(n.edgeLimit,40,"edgeLimit"),d=P(n.tokenBudget,1200,"tokenBudget"),r=n.registry??v(),c=new Map(s.map(T=>[T.id,T])),f=c.get(t)??{id:t},{evidence:a=[],...l}=f,u=[...a],g=Ie(e,t,r,n),{rootEdges:m,...p}=Be(e,t,r,n),h=Z("relationship-context",{rootId:t,direction:n.direction??"both",kinds:[...n.kinds??[]].sort(),maxDepth:n.maxDepth??3}),k=te(g.rows,n.cursor,h,({id:T})=>T),E=g.rows.slice(k),w=S(l)+S(u);if(w>d)throw new TypeError("Relationship context tokenBudget cannot fit root and evidence");let G=Oe({candidates:E,details:c,rootEdges:m,rootId:t,registry:r,nodeLimit:o,tokenBudget:d,initialTokens:w}),{nodes:R}=G,we=new Set([t,...R.map(({id:T})=>T)]),j=$e({graph:e,included:we,options:n,registry:r,edgeLimit:i,tokenBudget:d,initialTokens:G.usedTokens}),{edges:D,usedTokens:ve}=j,L=k+R.length,I=L<g.rows.length,W=R.at(-1),B=j.candidateCount-D.length,K=g.depthTruncated||I||B>0,Ee={rootId:t,...l.status===void 0?{}:{rootStatus:l.status},...p,discoveredNodes:g.rows.length,returnedNodes:R.length,returnedEdges:D.length,omittedNodes:g.rows.length-L,omittedEdges:B,evidenceCount:u.length,hasMore:I};return{root:l,summary:Ee,nodes:R,edges:D,evidence:u,meta:{exact:!0,truncated:K,completeness:K?"truncated":"complete",nodeLimit:o,edgeLimit:i,tokenBudget:d,usedTokens:ve,visitedNodes:g.visitedNodes,inspectedEdges:g.inspectedEdges,omittedNodes:g.rows.length-L,omittedEdges:B,...I&&W?{nextCursor:ee(h,W.id,L-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]="a3535267-c69a-5a44-bdf9-02925e02aaeb")}catch{}})();var Ne=["tree","graph","context"],Ae=["none","repeated"],Me=["outgoing","incoming","both"],Pe=32,Ue=200,Fe=400,Ge=16e3;function je(e){let t=e?.trim().toLowerCase()??"tree";if(Ne.includes(t))return t;throw new _(`Invalid --format value "${e}". Use "tree", "graph", or "context".`,y.USAGE)}function b(e,t){if(e===void 0)return;let s=typeof e=="number"?e:Number(e.trim());if(!Number.isInteger(s)||s<1)throw new _(`Invalid --${t} value "${e}". Use a positive integer.`,y.USAGE);return s}function pe(e){if(e===void 0)return;let t=typeof e=="number"?e:Number(e.trim());if(!Number.isInteger(t)||t<0)throw new _(`Invalid --max-depth value "${e}". Use a non-negative integer.`,y.USAGE);return t}function We(e){let t=e?.trim().toLowerCase()??"none";if(Ae.includes(t))return t;throw new _(`Invalid --collapse value "${e}". Use "none" or "repeated".`,y.USAGE)}function Ke(e){let t=e?.trim().toLowerCase()??"both";if(Me.includes(t))return t;throw new _(`Invalid --direction value "${e}". Use "outgoing", "incoming", or "both".`,y.USAGE)}function ze(e,t=v()){if(e===void 0)return;let s=(Array.isArray(e)?e:[e]).flatMap(o=>o.split(",")).map(o=>o.trim()).filter(o=>o.length>0);if(s.length===0)return;let n=new Set;for(let o of s){let i=t.resolve(o);if(!i){let d=t.list().map(r=>r.kind).join(", ");throw new _(`Invalid --kind value "${o}". Registered kinds: ${d}.`,y.USAGE)}n.add(i.kind)}return[...n].sort()}function Xe(e){if(!e||e.length===0)return[];let t=e.map(({id:n,kind:o})=>({id:n.trim(),kind:o.trim().toLowerCase()})).sort((n,o)=>{let i=n.kind.localeCompare(o.kind);return i!==0?i:n.id.localeCompare(o.id)}),s=new Map;for(let n of t){let o=`${n.kind.toLowerCase()}::${n.id.toLowerCase()}`;s.has(o)||s.set(o,{id:n.id,kind:n.kind})}return[...s.values()]}function qe(e){return{id:e.id,title:e.title,type:e.type,status:e.status,dependencies:Xe(e.dependencies)}}function He(e){return C(new TextEncoder().encode(JSON.stringify({...e,dependencies:void 0})).byteLength)}function Je(e,t,s,n,o,i,d,r,c){for(let f of t.dependencies){let a=Math.max(1,Math.ceil(JSON.stringify({from:e.id,to:f.id,kind:f.kind}).length/3));if(r.nodes>=r.nodeLimit){e.truncated=!0,r.reasons.add("node_limit");break}if(r.edges>=r.edgeLimit){e.truncated=!0,r.reasons.add("edge_limit");break}if(r.estimatedTokens+a>=r.tokenBudget){e.truncated=!0,r.reasons.add("token_budget");break}r.edges+=1,r.estimatedTokens+=a,e.dependencies.push(ge(f.id,s,n,o,i,d,r,c+1,f.kind))}}function Qe(e,t,s,n,o,i,d,r){return d.estimatedTokens>=d.tokenBudget&&t?.dependencies.length?(e.truncated=!0,d.reasons.add("token_budget"),!0):!t||e.cycle?!0:n!==void 0&&r>=n?(t.dependencies.length>0&&(e.truncated=!0,d.reasons.add("max_depth")),!0):o==="repeated"&&i.has(s)?(e.collapsed=!0,!0):!1}function ge(e,t,s,n,o,i,d,r=0,c){let f=e.trim().toLowerCase(),a=t.get(f),l={id:a?.id??e,title:a?.title,type:a?.type,status:a?.status,via:c,missing:!a,cycle:s.has(f),dependencies:[]};if(d.nodes+=1,d.estimatedTokens+=He(l),Qe(l,a,f,n,o,i,d,r))return l;o==="repeated"&&i.add(f);let u=new Set(s);return u.add(f),Je(l,a,t,u,n,o,i,d,r),l}function me(e,t){return!e||e.missing&&!t.missing?t:{...e,title:e.title??t.title,type:e.type??t.type,status:e.status??t.status}}function Ve(e){let t=new Map,s=new Map,n=[e];for(;n.length>0;){let r=n.pop();t.set(r.id,me(t.get(r.id),{id:r.id,title:r.title,type:r.type,status:r.status,missing:r.missing}));for(let c of r.dependencies){t.set(c.id,me(t.get(c.id),{id:c.id,title:c.title,type:c.type,status:c.status,missing:c.missing}));let f=c.via??"related",a=`${r.id}::${c.id}::${f}`;s.has(a)||s.set(a,{from:r.id,to:c.id,kind:f}),c.cycle||n.push(c)}}let o=[...t.values()].sort((r,c)=>r.id.localeCompare(c.id)),i=[...s.values()].sort((r,c)=>{let f=r.from.localeCompare(c.from);if(f!==0)return f;let a=r.to.localeCompare(c.to);return a!==0?a:r.kind.localeCompare(c.kind)}),d=o.filter(r=>r.missing).map(r=>r.id);return{root_id:e.id,nodes:o,edges:i,missing_ids:d}}function he(e,t,s){let n=new Set,o=new Set,i=new Set,d=new Set,r=[{id:e,depth:0}],c=0;for(;c<r.length;){let f=r[c++],a=f.id.trim().toLowerCase();n.add(a);let l=t.get(a);if(!l){i.add(a);continue}if(!(s!==void 0&&f.depth>=s)&&!d.has(a)){d.add(a);for(let u of l.dependencies)o.add(`${a}::${u.id.trim().toLowerCase()}::${u.kind}`),r.push({id:u.id,depth:f.depth+1})}}return{node_count:n.size,edge_count:o.size,edge_basis:"deduplicated_directed",missing_count:i.size}}function ke(e,t=v()){let s=pe(e.maxDepth),n=b(e.nodeLimit,"node-limit"),o=b(e.edgeLimit,"edge-limit"),i=b(e.tokenBudget,"token-budget"),d=ze(e.kind,t);return{direction:Ke(e.direction),...d===void 0?{}:{kinds:d},...s===void 0?{}:{maxDepth:s},...n===void 0?{}:{nodeLimit:n},...o===void 0?{}:{edgeLimit:o},...i===void 0?{}:{tokenBudget:i},...e.cursor?.trim()?{cursor:e.cursor.trim()}:{}}}function ye(e,t,s,n){return fe(e.graph,t,e.details.map(o=>o.id===t&&n.length>0?{...o,evidence:n}:o),s)}function Bt(e,t,s,n=[]){let o=A(t);return ye(o,e,ke(s,o.graph.registry()),n)}function F(e,t,s,n){for(let o of s.slice(0,n)){let i=o?.trim();i&&e.push(`${t}:${i}`)}}async function Ye(e,t,s,n){let o=await se(e,t,s.id_prefix,s.item_format,n);if(!o)return[];let{document:i}=await oe(o,{schema:s.schema}),d=i.metadata,r=d.files??[],c=d.tests??[],f=d.docs??[],a=[["files",r.length],["tests",c.length],["docs",f.length],["comments",(d.comments??[]).length],["notes",(d.notes??[]).length],["learnings",(d.learnings??[]).length]];if(a.every(([,u])=>u===0))return[];let l=[`linked:${a.map(([u,g])=>`${u}=${g}`).join(",")}`];return F(l,"file",r.map(u=>u.path),3),F(l,"test",c.map(u=>u.command??u.path),2),F(l,"doc",f.map(u=>u.path),2),l}function Ze(e){let{canonicalId:t,context:s,missingCount:n,missingReferences:o,referenceLimit:i,summaryOnly:d}=e;return{id:t,format:"context",node_count:s.nodes.length+1,edge_count:s.edges.length,edge_basis:"deduplicated_directed",missing_count:n,missing_scope:"traversal",missing_reference_count:o.length,...d?{}:{missing_references:o.slice(0,i),context:s}}}function et(e){let{row:t,missingReachableSet:s,packetIds:n,filteredKinds:o,registry:i}=e;if(t.no_active_blocker_sentinel||!s.has(t.target_id.trim().toLowerCase())||!n.has(t.holder_id))return!1;if(o===void 0)return!0;let d=i.resolve(t.kind);return d!==void 0&&(o.has(d.kind)||d.inverse!==void 0&&o.has(d.inverse))}function _e(e,t,s){let n;for(;;){let o=C(new TextEncoder().encode(N($("deps",e),t)).byteLength);if(o===n)return o;s(o),n=o}}function tt(e){return e instanceof TypeError&&e.message.startsWith("Relationship context tokenBudget cannot fit ")}function nt(e){try{return ye(e.assembly,e.canonicalId,{...e.contextOptions,...e.internalTokenBudget===void 0?{}:{tokenBudget:e.internalTokenBudget}},e.rootEvidence)}catch(t){if(e.smallestResult!==void 0&&tt(t))return e.smallestResult;throw t}}function st(e){let{assembly:t,canonicalId:s,contextOptions:n,rootEvidence:o,summaryOnly:i,outputFormat:d,missingCount:r,missingReferences:c}=e,a=n.edgeLimit??40,l=n.tokenBudget,u,g;for(;;){let m=nt({assembly:t,canonicalId:s,contextOptions:n,internalTokenBudget:l,rootEvidence:o,smallestResult:g});if("format"in m)return m;let p=m;u??=p.meta.tokenBudget,l??=u;let h=Ze({canonicalId:s,context:p,missingCount:r,missingReferences:c,referenceLimit:a,summaryOnly:i});if(g=h,i||(p.meta.tokenBudget=u,p.meta.usedTokens=_e(x(h,!1),d,w=>{p.meta.usedTokens=w}),p.meta.usedTokens<=u))return h;if(a>0){a-=1;continue}let k=l,E=k*u/p.meta.usedTokens;l=Math.min(k-1,Math.max(1,Math.floor(E*.9)))}}function ot(e){let{assembly:t,canonicalId:s,options:n,rootEvidence:o,summaryOnly:i,outputFormat:d}=e,r=ke(n,t.graph.registry()),c=t.graph.closure(s,{direction:r.direction,...r.kinds===void 0?{}:{kinds:r.kinds},maxDepth:r.maxDepth??3}),f=c.value.filter(p=>t.missingIdSet.has(p.toLowerCase())),a=new Set(f.map(p=>p.toLowerCase())),l=t.graph.registry(),u=r.kinds?new Set(r.kinds.map(p=>l.require(p).kind)):void 0,g=new Set([s,...c.value]),m=[...t.dangling.active,...t.dangling.legacy_terminal].filter(p=>et({row:p,missingReachableSet:a,packetIds:g,filteredKinds:u,registry:l}));return st({assembly:t,canonicalId:s,contextOptions:r,rootEvidence:o,summaryOnly:i,outputFormat:d,missingCount:f.length,missingReferences:m})}function it(e){let t=[e],s;for(;t.length>0;){let n=t.pop();n.dependencies.length>0&&(s=n,t.push(...n.dependencies))}return s?(s.dependencies.pop(),s.truncated=!0,!0):!1}function rt(e,t,s,n,o,i,d){let r=o??Pe,c=b(s.nodeLimit,"node-limit")??Ue,f=b(s.edgeLimit,"edge-limit")??Fe,a=b(s.tokenBudget,"token-budget")??Ge,l={nodeLimit:c,edgeLimit:f,tokenBudget:a,nodes:0,edges:0,estimatedTokens:0,reasons:new Set},u=ge(e,n,new Set,r,t==="graph"?"repeated":i,new Set,l),g=he(e,n,void 0),m;for(;;){let p=Ve(u),h=l.reasons.size===0?void 0:{reasons:[...l.reasons].sort(),limits:{max_depth:r,node_limit:c,edge_limit:f,token_budget:a},estimated_tokens:0,total_node_count:g.node_count,total_edge_count:g.edge_count,omitted_node_count:Math.max(0,g.node_count-p.nodes.length),omitted_edge_count:Math.max(0,g.edge_count-p.edges.length)},k={id:e,format:t,node_count:p.nodes.length,edge_count:p.edges.length,edge_basis:"deduplicated_directed",missing_count:p.missing_ids.length,...h?{truncation:h}:{}};if(m=t==="tree"?{...k,tree:u}:{...k,graph:p},(m.truncation===void 0?C(new TextEncoder().encode(N($("deps",x(m,!1)),d)).byteLength):_e(x(m,!1),d,w=>{m.truncation.estimated_tokens=w}))<=a)return m;if(!it(u))return l.reasons.add("token_budget"),m;l.reasons.add("token_budget")}}function x(e,t){let s={name:e.format==="tree"?"dependency_tree":e.format==="graph"?"dependency_graph":"relationship_context",restore_with:"--full"};return{...e,projection:{mode:t?"summary":"full",declared_field_groups:[s],included_field_groups:t?[]:[s.name]}}}async function Ot(e,t,s){let n=q(process.cwd(),s.path);if(!await z(H(n)))throw new _(`Tracker is not initialized at ${n}. Run pm init first.`,y.NOT_FOUND);let o=je(t.format),i=pe(t.maxDepth),d=We(t.collapse);Y(t.summary===!0,t.full===!0,"--summary");let r=t.summary===!0,c=await ne(n),f=X(c,Q()),a=await ie(n,c.item_format,f.type_to_folder,void 0,c.schema),l=V(c.schema),u=new Map(a.map(m=>[m.id.trim().toLowerCase(),qe(m)])),g=de(a,m=>O(m,l));for(let m of[...g.active,...g.legacy_terminal]){let p=u.get(m.holder_id.trim().toLowerCase()),h=m.kind.trim().toLowerCase();p&&!p.dependencies.some(k=>k.id.trim().toLowerCase()===m.target_id.trim().toLowerCase()&&k.kind===h)&&p.dependencies.push({id:m.target_id,kind:h})}if(!u.has(e.trim().toLowerCase()))throw new _(`Item ${e} not found`,y.NOT_FOUND);if(o==="context"){let m=u.get(e.trim().toLowerCase()).id,p=r?[]:await Ye(n,m,c,f.type_to_folder),h=w=>O(w,l),k=re(),E=le().lookup(n,ae(a,h,k),()=>A(a,h,k));return x(ot({assembly:E.assembly,canonicalId:m,options:t,rootEvidence:p,summaryOnly:r,outputFormat:s.json===!0?"json":"toon"}),r)}return r?x({id:e,format:o,...he(e,u,i)},!0):x(rt(e,o,t,u,i,d,s.json===!0?"json":"toon"),!1)}export{ae as a,M as b,le as c,ut as d,fe as e,Ne as f,Ae as g,Me as h,b as i,pe as j,Ke as k,ze as l,Bt as m,Ot as n};
2
- //# sourceMappingURL=chunk-F4NREH3G.js.map
1
+ import{g as re,i as de,k as A}from"./chunk-TPKN3S7S.js";import{$e as C,$f as ie,A as y,Bb as J,C as _,Da as X,Kd as Y,La as q,Nc as V,Nf as ne,Oa as H,Qd as $,Sd as Z,Td as ee,Wd as te,Yf as se,Zf as oe,b as z,cd as O,cf as N,jb as v,lc as Q}from"./chunk-D4FPS43D.js";import{createHash as Te}from"node:crypto";(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]="dea35fb9-9f9f-56ce-afc0-f4dc993012c3")}catch{}})();var be=64,xe=8;function Re(e,t){let s=(e.dependencies??[]).map(n=>{if(typeof n!="object"||n===null)return"";let o=n;return`${typeof o.kind=="string"?o.kind:"related"}:${typeof o.id=="string"?o.id:""}`}).sort().join(",");return[e.id,e.title,e.status,t(e.status)?"1":"0",typeof e.type=="string"?e.type.trim():"",e.parent??"",e.blocked_by??"",s].join("\0")}function ae(e,t=n=>n==="closed"||n==="canceled",s=v()){let n=e.filter(i=>typeof i?.id=="string"&&i.id.trim().length>0).map(i=>Re(i,t)).sort(),o=s.list().map(i=>J(i)).sort();return Te("sha256").update(n.join("")).update("").update(o.join("")).digest("hex")}function ce(e,t,s){let n=t??s;if(!Number.isInteger(n)||n<1)throw new TypeError(`Invalid ${e} bound: ${String(t)}`);return n}var M=class{#e=new Map;#t;#n;constructor(t={}){this.#t=ce("maxResultsPerWorkspace",t.maxResultsPerWorkspace,be),this.#n=ce("maxWorkspaces",t.maxWorkspaces,xe)}lookup(t,s,n){let o=this.#e.get(t),i=!0;(o===void 0||o.fingerprint!==s)&&(o={fingerprint:s,assembly:n(),results:new Map},i=!1,!this.#e.has(t)&&this.#e.size>=this.#n&&this.#e.delete(this.#e.keys().next().value)),this.#e.delete(t),this.#e.set(t,o);let d=o,r=this.#t;return{assembly:d.assembly,assemblyReused:i,fingerprint:s,memoize(c,f){let a=d.results.get(c);if(a!==void 0||d.results.has(c))return d.results.delete(c),d.results.set(c,a),{value:structuredClone(a),reused:!0};let l=f();return d.results.size>=r&&d.results.delete(d.results.keys().next().value),d.results.set(c,structuredClone(l)),{value:l,reused:!1}}}}clear(){this.#e.clear()}},ue=new M;function le(){return ue}function ut(){ue.clear()}(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]="31a800f7-1374-5e7c-ad23-ae3d8ebcebe0")}catch{}})();var Le=["prerequisite","dependent","ancestor","descendant","provenance","related"],Ce=new TextEncoder;function P(e,t,s){let n=e??t;if(!Number.isInteger(n)||n<1)throw new TypeError(`Relationship context ${s} must be positive`);return n}function S(e){return Math.max(1,Math.ceil(Ce.encode(JSON.stringify(e)).byteLength/4))}function U(e,t,s){let n=s.resolve(e.kind);if(n?.ordering){let i=(n.precedence??"source_before_target")==="source_before_target"?e.source:e.target;return t===i?"prerequisite":"dependent"}if(n?.hierarchy){let i=(n.hierarchyDirection??"source_parent")==="source_parent"?e.source:e.target;return t===i?"ancestor":"descendant"}return e.kind==="discovered_from"||e.kind==="incident_from"?"provenance":"related"}function Se(e,t,s,n){let o=e.filter(i=>i.source===t&&i.target===s||i.target===t&&i.source===s).map(i=>U(i,s,n));return[...new Set(o)].sort()}function De(e){return Le.find(t=>e.includes(t))}function Ie(e,t,s,n){let o=n.direction??"both",i=n.maxDepth??3;if(!Number.isInteger(i)||i<0)throw new TypeError("Relationship context maxDepth must be non-negative");let d=new Set([t]),r=[{id:t,distance:0}],c=[],f=0,a=!1;for(let l=0;l<r.length;l+=1){n.signal?.throwIfAborted();let u=r[l];if(u.distance>=i&&a)continue;let g=e.neighborEdges(u.id,{direction:o,kinds:n.kinds,signal:n.signal});if(f+=g.meta.inspectedEdges,u.distance>=i){g.value.some(m=>!d.has(m.id))&&(a=!0);continue}for(let{id:m,edge:p}of g.value){if(d.has(m))continue;d.add(m);let h={id:m,distance:u.distance+1,via:u.id,role:U(p,m,s)};c.push(h),r.push(h)}}return c.sort((l,u)=>l.distance-u.distance||l.id.localeCompare(u.id)),{rows:c,visitedNodes:r.length,inspectedEdges:f,depthTruncated:a}}function Be(e,t,s,n){let o={prerequisite:0,dependent:0,ancestor:0,descendant:0,provenance:0,related:0},i=e.neighborEdges(t,{direction:n.direction??"both",kinds:n.kinds,signal:n.signal}).value;for(let{id:d,edge:r}of i)o[U(r,d,s)]+=1;return{directEdges:o,directTotal:i.length,rootEdges:i.map(({edge:d})=>d)}}function Oe(e){let t=[],s=e.initialTokens;for(let n of e.candidates){if(t.length>=e.nodeLimit)break;let o=n.distance===1?Se(e.rootEdges,e.rootId,n.id,e.registry):[],i={...e.details.get(n.id)??{id:n.id},distance:n.distance,role:o.length>0?De(o):n.role,via:n.via,reasons:o.length>0?o:[`${n.role} via ${n.via} (depth ${n.distance})`]},d=S(i);if(s+d>e.tokenBudget)break;t.push(i),s+=d}if(e.candidates.length>0&&t.length===0)throw new TypeError("Relationship context tokenBudget cannot fit one node");return{nodes:t,usedTokens:s}}function $e(e){let t=e.options.kinds?new Set(e.options.kinds.map(i=>e.registry.require(i).kind)):void 0,s=e.graph.edges().filter(i=>{if(!e.included.has(i.source)||!e.included.has(i.target))return!1;if(t===void 0||t.has(i.kind))return!0;let d=e.registry.resolve(i.kind)?.inverse;return d!==void 0&&t.has(d)}),n=[],o=e.initialTokens;for(let i of s){if(n.length>=e.edgeLimit)break;let d=S(i);if(o+d>e.tokenBudget)break;n.push(i),o+=d}return{edges:n,usedTokens:o,candidateCount:s.length}}function fe(e,t,s,n={}){if(!e.nodes().includes(t))throw new TypeError(`Relationship node not found: ${t}`);let o=P(n.nodeLimit,20,"nodeLimit"),i=P(n.edgeLimit,40,"edgeLimit"),d=P(n.tokenBudget,1200,"tokenBudget"),r=n.registry??v(),c=new Map(s.map(T=>[T.id,T])),f=c.get(t)??{id:t},{evidence:a=[],...l}=f,u=[...a],g=Ie(e,t,r,n),{rootEdges:m,...p}=Be(e,t,r,n),h=Z("relationship-context",{rootId:t,direction:n.direction??"both",kinds:[...n.kinds??[]].sort(),maxDepth:n.maxDepth??3}),k=te(g.rows,n.cursor,h,({id:T})=>T),E=g.rows.slice(k),w=S(l)+S(u);if(w>d)throw new TypeError("Relationship context tokenBudget cannot fit root and evidence");let G=Oe({candidates:E,details:c,rootEdges:m,rootId:t,registry:r,nodeLimit:o,tokenBudget:d,initialTokens:w}),{nodes:R}=G,we=new Set([t,...R.map(({id:T})=>T)]),j=$e({graph:e,included:we,options:n,registry:r,edgeLimit:i,tokenBudget:d,initialTokens:G.usedTokens}),{edges:D,usedTokens:ve}=j,L=k+R.length,I=L<g.rows.length,W=R.at(-1),B=j.candidateCount-D.length,K=g.depthTruncated||I||B>0,Ee={rootId:t,...l.status===void 0?{}:{rootStatus:l.status},...p,discoveredNodes:g.rows.length,returnedNodes:R.length,returnedEdges:D.length,omittedNodes:g.rows.length-L,omittedEdges:B,evidenceCount:u.length,hasMore:I};return{root:l,summary:Ee,nodes:R,edges:D,evidence:u,meta:{exact:!0,truncated:K,completeness:K?"truncated":"complete",nodeLimit:o,edgeLimit:i,tokenBudget:d,usedTokens:ve,visitedNodes:g.visitedNodes,inspectedEdges:g.inspectedEdges,omittedNodes:g.rows.length-L,omittedEdges:B,...I&&W?{nextCursor:ee(h,W.id,L-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]="a3535267-c69a-5a44-bdf9-02925e02aaeb")}catch{}})();var Ne=["tree","graph","context"],Ae=["none","repeated"],Me=["outgoing","incoming","both"],Pe=32,Ue=200,Fe=400,Ge=16e3;function je(e){let t=e?.trim().toLowerCase()??"tree";if(Ne.includes(t))return t;throw new _(`Invalid --format value "${e}". Use "tree", "graph", or "context".`,y.USAGE)}function b(e,t){if(e===void 0)return;let s=typeof e=="number"?e:Number(e.trim());if(!Number.isInteger(s)||s<1)throw new _(`Invalid --${t} value "${e}". Use a positive integer.`,y.USAGE);return s}function pe(e){if(e===void 0)return;let t=typeof e=="number"?e:Number(e.trim());if(!Number.isInteger(t)||t<0)throw new _(`Invalid --max-depth value "${e}". Use a non-negative integer.`,y.USAGE);return t}function We(e){let t=e?.trim().toLowerCase()??"none";if(Ae.includes(t))return t;throw new _(`Invalid --collapse value "${e}". Use "none" or "repeated".`,y.USAGE)}function Ke(e){let t=e?.trim().toLowerCase()??"both";if(Me.includes(t))return t;throw new _(`Invalid --direction value "${e}". Use "outgoing", "incoming", or "both".`,y.USAGE)}function ze(e,t=v()){if(e===void 0)return;let s=(Array.isArray(e)?e:[e]).flatMap(o=>o.split(",")).map(o=>o.trim()).filter(o=>o.length>0);if(s.length===0)return;let n=new Set;for(let o of s){let i=t.resolve(o);if(!i){let d=t.list().map(r=>r.kind).join(", ");throw new _(`Invalid --kind value "${o}". Registered kinds: ${d}.`,y.USAGE)}n.add(i.kind)}return[...n].sort()}function Xe(e){if(!e||e.length===0)return[];let t=e.map(({id:n,kind:o})=>({id:n.trim(),kind:o.trim().toLowerCase()})).sort((n,o)=>{let i=n.kind.localeCompare(o.kind);return i!==0?i:n.id.localeCompare(o.id)}),s=new Map;for(let n of t){let o=`${n.kind.toLowerCase()}::${n.id.toLowerCase()}`;s.has(o)||s.set(o,{id:n.id,kind:n.kind})}return[...s.values()]}function qe(e){return{id:e.id,title:e.title,type:e.type,status:e.status,dependencies:Xe(e.dependencies)}}function He(e){return C(new TextEncoder().encode(JSON.stringify({...e,dependencies:void 0})).byteLength)}function Je(e,t,s,n,o,i,d,r,c){for(let f of t.dependencies){let a=Math.max(1,Math.ceil(JSON.stringify({from:e.id,to:f.id,kind:f.kind}).length/3));if(r.nodes>=r.nodeLimit){e.truncated=!0,r.reasons.add("node_limit");break}if(r.edges>=r.edgeLimit){e.truncated=!0,r.reasons.add("edge_limit");break}if(r.estimatedTokens+a>=r.tokenBudget){e.truncated=!0,r.reasons.add("token_budget");break}r.edges+=1,r.estimatedTokens+=a,e.dependencies.push(ge(f.id,s,n,o,i,d,r,c+1,f.kind))}}function Qe(e,t,s,n,o,i,d,r){return d.estimatedTokens>=d.tokenBudget&&t?.dependencies.length?(e.truncated=!0,d.reasons.add("token_budget"),!0):!t||e.cycle?!0:n!==void 0&&r>=n?(t.dependencies.length>0&&(e.truncated=!0,d.reasons.add("max_depth")),!0):o==="repeated"&&i.has(s)?(e.collapsed=!0,!0):!1}function ge(e,t,s,n,o,i,d,r=0,c){let f=e.trim().toLowerCase(),a=t.get(f),l={id:a?.id??e,title:a?.title,type:a?.type,status:a?.status,via:c,missing:!a,cycle:s.has(f),dependencies:[]};if(d.nodes+=1,d.estimatedTokens+=He(l),Qe(l,a,f,n,o,i,d,r))return l;o==="repeated"&&i.add(f);let u=new Set(s);return u.add(f),Je(l,a,t,u,n,o,i,d,r),l}function me(e,t){return!e||e.missing&&!t.missing?t:{...e,title:e.title??t.title,type:e.type??t.type,status:e.status??t.status}}function Ve(e){let t=new Map,s=new Map,n=[e];for(;n.length>0;){let r=n.pop();t.set(r.id,me(t.get(r.id),{id:r.id,title:r.title,type:r.type,status:r.status,missing:r.missing}));for(let c of r.dependencies){t.set(c.id,me(t.get(c.id),{id:c.id,title:c.title,type:c.type,status:c.status,missing:c.missing}));let f=c.via??"related",a=`${r.id}::${c.id}::${f}`;s.has(a)||s.set(a,{from:r.id,to:c.id,kind:f}),c.cycle||n.push(c)}}let o=[...t.values()].sort((r,c)=>r.id.localeCompare(c.id)),i=[...s.values()].sort((r,c)=>{let f=r.from.localeCompare(c.from);if(f!==0)return f;let a=r.to.localeCompare(c.to);return a!==0?a:r.kind.localeCompare(c.kind)}),d=o.filter(r=>r.missing).map(r=>r.id);return{root_id:e.id,nodes:o,edges:i,missing_ids:d}}function he(e,t,s){let n=new Set,o=new Set,i=new Set,d=new Set,r=[{id:e,depth:0}],c=0;for(;c<r.length;){let f=r[c++],a=f.id.trim().toLowerCase();n.add(a);let l=t.get(a);if(!l){i.add(a);continue}if(!(s!==void 0&&f.depth>=s)&&!d.has(a)){d.add(a);for(let u of l.dependencies)o.add(`${a}::${u.id.trim().toLowerCase()}::${u.kind}`),r.push({id:u.id,depth:f.depth+1})}}return{node_count:n.size,edge_count:o.size,edge_basis:"deduplicated_directed",missing_count:i.size}}function ke(e,t=v()){let s=pe(e.maxDepth),n=b(e.nodeLimit,"node-limit"),o=b(e.edgeLimit,"edge-limit"),i=b(e.tokenBudget,"token-budget"),d=ze(e.kind,t);return{direction:Ke(e.direction),...d===void 0?{}:{kinds:d},...s===void 0?{}:{maxDepth:s},...n===void 0?{}:{nodeLimit:n},...o===void 0?{}:{edgeLimit:o},...i===void 0?{}:{tokenBudget:i},...e.cursor?.trim()?{cursor:e.cursor.trim()}:{}}}function ye(e,t,s,n){return fe(e.graph,t,e.details.map(o=>o.id===t&&n.length>0?{...o,evidence:n}:o),s)}function Bt(e,t,s,n=[]){let o=A(t);return ye(o,e,ke(s,o.graph.registry()),n)}function F(e,t,s,n){for(let o of s.slice(0,n)){let i=o?.trim();i&&e.push(`${t}:${i}`)}}async function Ye(e,t,s,n){let o=await se(e,t,s.id_prefix,s.item_format,n);if(!o)return[];let{document:i}=await oe(o,{schema:s.schema}),d=i.metadata,r=d.files??[],c=d.tests??[],f=d.docs??[],a=[["files",r.length],["tests",c.length],["docs",f.length],["comments",(d.comments??[]).length],["notes",(d.notes??[]).length],["learnings",(d.learnings??[]).length]];if(a.every(([,u])=>u===0))return[];let l=[`linked:${a.map(([u,g])=>`${u}=${g}`).join(",")}`];return F(l,"file",r.map(u=>u.path),3),F(l,"test",c.map(u=>u.command??u.path),2),F(l,"doc",f.map(u=>u.path),2),l}function Ze(e){let{canonicalId:t,context:s,missingCount:n,missingReferences:o,referenceLimit:i,summaryOnly:d}=e;return{id:t,format:"context",node_count:s.nodes.length+1,edge_count:s.edges.length,edge_basis:"deduplicated_directed",missing_count:n,missing_scope:"traversal",missing_reference_count:o.length,...d?{}:{missing_references:o.slice(0,i),context:s}}}function et(e){let{row:t,missingReachableSet:s,packetIds:n,filteredKinds:o,registry:i}=e;if(t.no_active_blocker_sentinel||!s.has(t.target_id.trim().toLowerCase())||!n.has(t.holder_id))return!1;if(o===void 0)return!0;let d=i.resolve(t.kind);return d!==void 0&&(o.has(d.kind)||d.inverse!==void 0&&o.has(d.inverse))}function _e(e,t,s){let n;for(;;){let o=C(new TextEncoder().encode(N($("deps",e),t)).byteLength);if(o===n)return o;s(o),n=o}}function tt(e){return e instanceof TypeError&&e.message.startsWith("Relationship context tokenBudget cannot fit ")}function nt(e){try{return ye(e.assembly,e.canonicalId,{...e.contextOptions,...e.internalTokenBudget===void 0?{}:{tokenBudget:e.internalTokenBudget}},e.rootEvidence)}catch(t){if(e.smallestResult!==void 0&&tt(t))return e.smallestResult;throw t}}function st(e){let{assembly:t,canonicalId:s,contextOptions:n,rootEvidence:o,summaryOnly:i,outputFormat:d,missingCount:r,missingReferences:c}=e,a=n.edgeLimit??40,l=n.tokenBudget,u,g;for(;;){let m=nt({assembly:t,canonicalId:s,contextOptions:n,internalTokenBudget:l,rootEvidence:o,smallestResult:g});if("format"in m)return m;let p=m;u??=p.meta.tokenBudget,l??=u;let h=Ze({canonicalId:s,context:p,missingCount:r,missingReferences:c,referenceLimit:a,summaryOnly:i});if(g=h,i||(p.meta.tokenBudget=u,p.meta.usedTokens=_e(x(h,!1),d,w=>{p.meta.usedTokens=w}),p.meta.usedTokens<=u))return h;if(a>0){a-=1;continue}let k=l,E=k*u/p.meta.usedTokens;l=Math.min(k-1,Math.max(1,Math.floor(E*.9)))}}function ot(e){let{assembly:t,canonicalId:s,options:n,rootEvidence:o,summaryOnly:i,outputFormat:d}=e,r=ke(n,t.graph.registry()),c=t.graph.closure(s,{direction:r.direction,...r.kinds===void 0?{}:{kinds:r.kinds},maxDepth:r.maxDepth??3}),f=c.value.filter(p=>t.missingIdSet.has(p.toLowerCase())),a=new Set(f.map(p=>p.toLowerCase())),l=t.graph.registry(),u=r.kinds?new Set(r.kinds.map(p=>l.require(p).kind)):void 0,g=new Set([s,...c.value]),m=[...t.dangling.active,...t.dangling.legacy_terminal].filter(p=>et({row:p,missingReachableSet:a,packetIds:g,filteredKinds:u,registry:l}));return st({assembly:t,canonicalId:s,contextOptions:r,rootEvidence:o,summaryOnly:i,outputFormat:d,missingCount:f.length,missingReferences:m})}function it(e){let t=[e],s;for(;t.length>0;){let n=t.pop();n.dependencies.length>0&&(s=n,t.push(...n.dependencies))}return s?(s.dependencies.pop(),s.truncated=!0,!0):!1}function rt(e,t,s,n,o,i,d){let r=o??Pe,c=b(s.nodeLimit,"node-limit")??Ue,f=b(s.edgeLimit,"edge-limit")??Fe,a=b(s.tokenBudget,"token-budget")??Ge,l={nodeLimit:c,edgeLimit:f,tokenBudget:a,nodes:0,edges:0,estimatedTokens:0,reasons:new Set},u=ge(e,n,new Set,r,t==="graph"?"repeated":i,new Set,l),g=he(e,n,void 0),m;for(;;){let p=Ve(u),h=l.reasons.size===0?void 0:{reasons:[...l.reasons].sort(),limits:{max_depth:r,node_limit:c,edge_limit:f,token_budget:a},estimated_tokens:0,total_node_count:g.node_count,total_edge_count:g.edge_count,omitted_node_count:Math.max(0,g.node_count-p.nodes.length),omitted_edge_count:Math.max(0,g.edge_count-p.edges.length)},k={id:e,format:t,node_count:p.nodes.length,edge_count:p.edges.length,edge_basis:"deduplicated_directed",missing_count:p.missing_ids.length,...h?{truncation:h}:{}};if(m=t==="tree"?{...k,tree:u}:{...k,graph:p},(m.truncation===void 0?C(new TextEncoder().encode(N($("deps",x(m,!1)),d)).byteLength):_e(x(m,!1),d,w=>{m.truncation.estimated_tokens=w}))<=a)return m;if(!it(u))return l.reasons.add("token_budget"),m;l.reasons.add("token_budget")}}function x(e,t){let s={name:e.format==="tree"?"dependency_tree":e.format==="graph"?"dependency_graph":"relationship_context",restore_with:"--full"};return{...e,projection:{mode:t?"summary":"full",declared_field_groups:[s],included_field_groups:t?[]:[s.name]}}}async function Ot(e,t,s){let n=q(process.cwd(),s.path);if(!await z(H(n)))throw new _(`Tracker is not initialized at ${n}. Run pm init first.`,y.NOT_FOUND);let o=je(t.format),i=pe(t.maxDepth),d=We(t.collapse);Y(t.summary===!0,t.full===!0,"--summary");let r=t.summary===!0,c=await ne(n),f=X(c,Q()),a=await ie(n,c.item_format,f.type_to_folder,void 0,c.schema),l=V(c.schema),u=new Map(a.map(m=>[m.id.trim().toLowerCase(),qe(m)])),g=de(a,m=>O(m,l));for(let m of[...g.active,...g.legacy_terminal]){let p=u.get(m.holder_id.trim().toLowerCase()),h=m.kind.trim().toLowerCase();p&&!p.dependencies.some(k=>k.id.trim().toLowerCase()===m.target_id.trim().toLowerCase()&&k.kind===h)&&p.dependencies.push({id:m.target_id,kind:h})}if(!u.has(e.trim().toLowerCase()))throw new _(`Item ${e} not found`,y.NOT_FOUND);if(o==="context"){let m=u.get(e.trim().toLowerCase()).id,p=r?[]:await Ye(n,m,c,f.type_to_folder),h=w=>O(w,l),k=re(),E=le().lookup(n,ae(a,h,k),()=>A(a,h,k));return x(ot({assembly:E.assembly,canonicalId:m,options:t,rootEvidence:p,summaryOnly:r,outputFormat:s.json===!0?"json":"toon"}),r)}return r?x({id:e,format:o,...he(e,u,i)},!0):x(rt(e,o,t,u,i,d,s.json===!0?"json":"toon"),!1)}export{ae as a,M as b,le as c,ut as d,fe as e,Ne as f,Ae as g,Me as h,b as i,pe as j,Ke as k,ze as l,Bt as m,Ot as n};
2
+ //# sourceMappingURL=chunk-TPXAXTCO.js.map
@@ -0,0 +1,2 @@
1
+ import{a as _}from"./chunk-PIE5HBNA.js";import{Ia as I}from"./chunk-WOD3WWUN.js";import{A as d,C as g,bb as k,bf as E,ud as T,vd as m}from"./chunk-D4FPS43D.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]="d82065d1-488d-523e-9df2-a30056f29603")}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]="5810cf1d-fc9a-597b-a47e-a914009fadfa")}catch{}})();function he(e){return e instanceof g||e instanceof Error?e.message:"Unknown failure"}function V(e){if(typeof e!="object"||e===null||!("exitCode"in e))return;let t=e.exitCode;return typeof t=="number"&&Number.isFinite(t)?t:void 0}function N(e){let t=Math.trunc(e);return t>d.SUCCESS?t:d.GENERIC_FAILURE}function ge(e){return typeof e=="object"&&e!==null&&"code"in e&&typeof e.code=="string"&&e.code.startsWith("commander.")}function me(e,t){if(e instanceof Error)return e;let n=new Error(t),o=V(e);return o!==void 0&&(n.exitCode=N(o)),n}(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]="1c2ee12c-9a3e-57bc-8336-f6c558458802")}catch{}})();var p=new Set(["--pm-path","--path","--author","--output-include","--output-limit","--output-budget","--output-format","--output-session"]),P=new Set(["--output-include","--output-limit","--output-budget","--output-format","--output-session"]),A=e=>{let t=e.indexOf("=");return t>0&&p.has(e.slice(0,t))},w=(e,t)=>typeof t!="string"?!1:e==="--path"||e==="--pm-path"||!t.startsWith("-"),x=new Set(["--no-extensions","--no-pager","--json","--quiet","--lean","--token-accounting"]);function B(e,t,n){let o=e[t];if(x.has(o))return n.booleanFlags.add(o),1;let i=o.indexOf("="),s=i>0?o.slice(0,i):o;if(!p.has(s))return 1;let r=i>0?o.slice(i+1):void 0,a=r===void 0&&w(s,e[t+1]),u=r??(a?e[t+1]:void 0);return s==="--author"?n.author=u??"":typeof u=="string"&&u.length>0&&(P.has(s)?n.outputValues:n.pathValues).set(s,u),a?2:1}function D(e){let t={booleanFlags:new Set,outputValues:new Map,pathValues:new Map},n=0;for(;n<e.length&&e[n]!=="--";)n+=B(e,n,t);return{path:t.pathValues.get("--pm-path")??t.pathValues.get("--path"),noExtensions:t.booleanFlags.has("--no-extensions"),noPager:t.booleanFlags.has("--no-pager"),json:t.booleanFlags.has("--json"),quiet:t.booleanFlags.has("--quiet"),lean:t.booleanFlags.has("--lean"),tokenAccounting:t.booleanFlags.has("--token-accounting"),...t.outputValues.get("--output-include")===void 0?{}:{outputInclude:t.outputValues.get("--output-include")},...t.outputValues.get("--output-limit")===void 0?{}:{outputLimit:t.outputValues.get("--output-limit")},...t.outputValues.get("--output-budget")===void 0?{}:{outputBudget:t.outputValues.get("--output-budget")},...t.outputValues.get("--output-format")==="toon"||t.outputValues.get("--output-format")==="json"?{outputFormat:t.outputValues.get("--output-format")}:{},...t.outputValues.get("--output-session")===void 0?{}:{outputSession:t.outputValues.get("--output-session")},...t.author===""?{authorMissingValue:!0}:t.author!==void 0?{author:t.author}:{}}}function L(e){let t=[],n=0;for(;n<e.length;){let o=e[n];if(o==="--")break;if(x.has(o)||o==="--profile"||o==="--id-only"||o==="--full-changed-fields"||o==="--explain"){n+=1;continue}if(p.has(o)){n+=w(o,e[n+1])?2:1;continue}if(A(o)){n+=1;continue}t.push(o),n+=1}return t}function z(e){let t=L(e);if(t[0]?.trim().toLowerCase()==="help"){let s=[];for(let r=1;r<t.length;r+=1){let a=t[r];if(a.startsWith("-"))break;s.push(a.trim().toLowerCase())}return{requested:!0,commandPathTokens:s}}if(t.findIndex(s=>s==="--help"||s==="-h")<0)return{requested:!1,commandPathTokens:[]};let i=[];for(let s of t){if(s.startsWith("-"))break;i.push(s.trim().toLowerCase())}return{requested:!0,commandPathTokens:i}}function b(e){for(let t=0;t<e.length;t+=1){let n=e[t];if(n==="--")return;if(p.has(n)){t+=w(n,e[t+1])?1:0;continue}if(!(A(n)||x.has(n)||n==="--profile"||n==="--id-only"||n==="--explain")&&!n.startsWith("-"))return t}}function G(e){let t=b(e);return t===void 0?void 0:e[t].trim().toLowerCase()}function v(e,t){return t.noPager?!0:process.stdout.isTTY===!0?!1:z(e).requested}function xe(e){let t=["PAGER","MANPAGER","GIT_PAGER","LESS"],n=t.map(s=>process.env[s]),o=()=>{for(let[s,r]of t.entries()){let a=n[s];a===void 0?delete process.env[r]:process.env[r]=a}},i=D(e);return v(e,i)&&(process.env.PAGER="cat",process.env.MANPAGER="cat",process.env.GIT_PAGER="cat",(typeof process.env.LESS!="string"||process.env.LESS.trim().length===0)&&(process.env.LESS="FRX")),o}var $=new Set(["install","uninstall","explore","manage","doctor","adopt","adopt-all","activate","deactivate"]);function M(e){let t=b(e);if(t===void 0||e[t]!=="extension")return[...e];let n=e[t+1];if(!n||n.startsWith("-"))return[...e];if(!$.has(n))return[...e];if(e.includes("--help")||e.includes("-h"))return[...e];let o=`--${n}`;return e.includes(o)?[...e]:[...e.slice(0,t+1),o,...e.slice(t+2)]}var R=new Set(["pm","pm-cli"]);function W(e,t){let n=b(e);if(n===void 0)return e;let o=e[n];return R.has(o.trim().toLowerCase())?(t.push({from:o,to:[],reason:"executable_alias",confidence:"high"}),[...e.slice(0,n),...e.slice(n+1)]):e}function q(e,t){let n=b(e);if(n===void 0)return e;let o=e[n],i=_[o.trim().toLowerCase()];if(!i)return e;let s=[...e];return s[n]=i,t.push({from:o,to:[i],reason:"command_alias",confidence:"high"}),s}function y(e){return e.replace(/^--?/,"").replace(/_/g,"-").replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function C(e){return y(e).replace(/-/g,"")}function S(e,t,n){let o=e.get(t);if(o===void 0){e.set(t,n);return}o!==n&&e.set(t,null)}function U(e){let t=[],n=o=>{typeof o=="string"&&o.startsWith("--")&&t.push(o)};n(e.flag);for(let o of e.aliases??[])n(o);return t}function j(e,t){let n=t??I(e),o=new Map,i=new Map,s=new Map,r=new Set;for(let a of n){let u=U(a);if(u.length===0)continue;let l=`--${y(u[0])}`;for(let c of u)S(o,y(c),l),S(i,C(c),l);let f=C(l);s.has(l)||s.set(l,f),a.list===!0&&r.add(l)}return{canonicalByNormalized:o,canonicalByCompact:i,canonicalComparables:[...s.entries()].map(([a,u])=>({canonicalFlag:a,comparable:u})),listCanonicalFlags:r}}function F(e,t){let n=y(e),o=t.canonicalByNormalized.get(n);if(typeof o=="string")return{flag:o,reason:"flag_alias",confidence:"high"};let i=n.replace(/-/g,""),s=t.canonicalByCompact.get(i);if(typeof s=="string")return{flag:s,reason:"flag_alias",confidence:"high"};let r=i.length>=8?2:1,a=Number.POSITIVE_INFINITY,u,l=!1;for(let f of t.canonicalComparables){let c=k(i,f.comparable,r);if(c!==null){if(c<a){a=c,u=f.canonicalFlag,l=!1;continue}c===a&&u!==f.canonicalFlag&&(l=!0)}}return!u||l||!Number.isFinite(a)||a<=0?null:{flag:u,reason:"flag_typo",confidence:a>=2?"medium":"high"}}function ke(e){let t=[`${e}s`];return e.endsWith("y")&&e.length>1&&t.push(`${e.slice(0,-1)}ies`),t}function K(e,t=!1){if(t||e.includes("://"))return null;let n=e.match(/^([A-Za-z][A-Za-z0-9_-]{1,63})([:=])(.*)$/);if(!n)return null;let o=n[1],i=n[3];return i.length===0?null:{key:o,value:i}}function X(e,t,n=!1){if(n||!e.startsWith("--"))return{tokens:[e]};let o=e.indexOf("="),i=o>=0?e.slice(0,o):e,s=o>=0?e.slice(o+1):void 0,r=F(i,t);if(!r)return{tokens:[e]};let a=s===void 0?r.flag:`${r.flag}=${s}`;return a===e?{tokens:[e]}:{tokens:[a],event:{from:e,to:[a],reason:r.reason,confidence:r.confidence}}}function Y(e){let t=new Set,n=!1;for(let o=0;o<e.length;o+=1){if(n){t.add(o),n=!1;continue}let i=e[o];n=i==="--path"||i==="--pm-path"}return t}function J(e){if(!e.startsWith("--"))return null;let t=e.indexOf("=");return t<0?{flag:e}:{flag:e.slice(0,t),inlineValue:e.slice(t+1)}}function Z(e,t,n){n.push(e[t]);let o=e[t+1];return typeof o=="string"&&o!=="--"?(n.push(o),t+2):t+1}function H(e,t,n,o){if(n.inlineValue!==void 0)return{originalTokens:[e[t]],value:n.inlineValue,consumed:1};let i=[],s=t+1;for(;s<e.length&&e[s]!=="--"&&!e[s].startsWith("-")&&(i.length===0||o.has(n.flag));)i.push(e[s]),s+=1;let r=i.length===0?1:1+i.length;return{originalTokens:e.slice(t,t+r),value:i.length===0?void 0:i.join(","),consumed:r}}function Q(e,t,n,o){let i=e.get(n);if(i){i.values.push(o.value),i.occurrences+=1;return}e.set(n,{outputIndex:t.length,originalTokens:o.originalTokens,values:[o.value],occurrences:1}),t.push(null)}function ee(e,t){let n=[],o=[];for(let[i,s]of e){if(!(s.occurrences>=2||t.has(i)&&s.originalTokens.length>2)){o.push({outputIndex:s.outputIndex,tokens:s.originalTokens});continue}let a=`${i}=${s.values.join(",")}`;o.push({outputIndex:s.outputIndex,tokens:[a]}),n.push({from:`${i} (x${s.occurrences})`,to:[a],reason:"list_merge",confidence:"high"})}return{events:n,splices:o}}function te(e,t){t.sort((n,o)=>o.outputIndex-n.outputIndex);for(let n of t)e.splice(n.outputIndex,1,...n.tokens)}function ne(e,t,n=new Set,o=new Set){if(t.size===0)return{argv:[...e],events:[]};let i=[],s=new Map,r=0;for(;r<e.length;){let l=e[r];if(l==="--"){i.push(...e.slice(r));break}if(n.has(l)){r=Z(e,r,i);continue}let f=J(l);if(!f||!t.has(f.flag)){i.push(l),r+=1;continue}let c=H(e,r,f,o);if(c.value===void 0){i.push(l),r+=c.consumed;continue}Q(s,i,f.flag,{originalTokens:c.originalTokens,value:c.value}),r+=c.consumed}let{events:a,splices:u}=ee(s,o);return te(i,u),{argv:i,events:a}}var O=new Map([["--add",new Set(["command","cmd","path"])],["--remove",new Set(["command","path"])]]);function oe(e,t){if(e!=="test"||t.length<2)return!1;let n=t[t.length-1],o=t[t.length-2],i=O.get(o);return i!==void 0&&i.has(n)}function ie(e,t){return e==="search"||oe(e,t)}function se(e,t,n){if(t!=="test")return e;let o=[],i=0;for(;i<e.length;){let s=e[i];if(s==="--")return o.push(...e.slice(i)),o;let r=O.get(s),a=r?e[i+1]:void 0;if(!r||typeof a!="string"||!r.has(a)){o.push(s),i+=1;continue}let u=i+2;for(;u<e.length&&!e[u].startsWith("-");)u+=1;if(u-(i+2)!==1){o.push(s),i+=1;continue}let l=e[i+2],f=`${a}=${l}`;o.push(s,f),n.push({from:`${s} ${a} ${l}`,to:[s,f],reason:"bare_key_value",confidence:"high"}),i+=3}return o}function re(e,t,n,o){let i=[],s=Y(e);for(let r=0;r<e.length;r+=1){let a=e[r];if(a==="--"){i.push(...e.slice(r));break}let u=s.has(r),l=i[i.length-1];if(a.startsWith("--")){let c=X(a,t,u);i.push(...c.tokens),c.event&&o.push(c.event);continue}let f=K(a,u);if(f&&!(typeof l=="string"&&l.startsWith("-"))&&!ie(n,i)){let c=F(f.key,t);if(c){let h=[c.flag,f.value];i.push(...h),o.push({from:a,to:h,reason:"bare_key_value",confidence:c.confidence});continue}}i.push(a)}return i}function Te(e){let t=[],n=W(e,t),o=M(n);(o.length!==n.length||o.some((c,h)=>c!==n[h]))&&t.push({from:n.join(" "),to:[...o],reason:"legacy_extension_action",confidence:"high"});let i=q(o,t),s=G(i),r=ae(i),a=j(r??s),u=re(i,a,s,t),l=se(u,s,t),f=ne(l,a.listCanonicalFlags,p,s==="create"?new Set(["--tags"]):new Set);for(let c of f.events)t.push(c);return{argv:f.argv,commandName:s,trace:t}}function ae(e){let t=L(e),n=t[0]?.trim().toLowerCase(),o=t[1]?.trim().toLowerCase();return(n==="extension"||n==="package"||n==="packages")&&typeof o=="string"&&o.length>0&&!o.startsWith("-")?`${n} ${o}`:n}function Ee(e){for(let t=0;t<e.length;t+=1){let n=e[t];if(n==="--")break;if(n==="--type"){let o=e[t+1];if(typeof o=="string"&&o.trim().length>0)return o.trim();continue}if(n.startsWith("--type=")){let o=n.slice(7).trim();if(o.length>0)return o}}}(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]="8f7cca3d-9b19-53b4-a510-5290aaf75e12")}catch{}})();function Ae(e){if(e===void 0)return()=>{};let t=e.trim();if(t.length===0)throw new g("--author requires a non-empty value.",d.USAGE,{code:"missing_required_argument",nextSteps:["Pass an explicit author identifier with --author <id>."]});let n=T();m(t);let o=!1;return()=>{o||(o=!0,n===void 0?m(void 0):m(n))}}import{Command as ue}from"commander";(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]="a410d336-c332-56fc-9a5d-7841a2b3dfa5")}catch{}})();function Ve(e){return new ue().name("pm").description("Universal, flexible, extensible, agent-optimized project management CLI for any project or programming language.").version(e).showHelpAfterError(!1).allowExcessArguments(!1).allowUnknownOption(!1).configureOutput({writeOut:t=>{E(t)},writeErr:()=>{}}).option("--json","Output JSON instead of TOON; mutations emit a flat receipt with top-level id/status/changed_field_count while reads use documented entity or collection envelopes").option("--lean","Omit null and empty containers from JSON output").option("--token-accounting","Attach a bounded per-section token-cost receipt to command output").option("--output-include <fields>","Retain comma-separated fields or sections in read output").option("--output-limit <count>","Bound rows in read output").option("--output-budget <tokens>","Bound estimated tokens in read output").option("--output-format <toon|json>","Select the read-output encoding").option("--output-session <state>","Carry a JSON session budget and served-item ledger across read calls").option("--quiet","Suppress stdout output").option("--no-changed-fields","Omit the changed_fields array from mutation output (keeps changed_field_count)").option("--full-changed-fields","Restore the legacy full mutation envelope and changed_fields array").option("--id-only","Print only id and status for single-item mutation output").option("--pm-path <dir>","Explicit tracker storage path for this command (preferred over --path)").option("--path <dir>","Backward-compatible alias for --pm-path; this is the tracker storage path, not a workspace cwd").option("--no-extensions","Disable extension loading").option("--no-pager","Disable pager integration for help and long output").option("--explain","Render extended rationale and examples in help output").option("--profile","Print deterministic timing diagnostics").option("--author <id>","Override mutation author for this invocation").exitOverride()}export{he as a,V as b,N as c,ge as d,me as e,D as f,L as g,z as h,G as i,xe as j,M as k,ke as l,ne as m,se as n,Te as o,Ee as p,Ae as q,Ve as r};
2
+ //# sourceMappingURL=chunk-UFWUJO4V.js.map
@@ -1,4 +1,4 @@
1
- import{b as x,c as K,d as Ee,e as Se}from"./chunk-CHOQ2VAW.js";import{A as B,K as Te,r as E,s as _e,t as U,u as ke,v as S,w as ve,x as W,y as be}from"./chunk-3ZJRFYY2.js";import{m as he}from"./chunk-ZFBWCKYF.js";import{s as we}from"./chunk-SV3YQ4RY.js";import{a as A}from"./chunk-RSIC5OPE.js";import{c as h,f as ue,g as me,i as M}from"./chunk-UVVXHGYS.js";import{A as f,Af as z,Bf as ge,C as u,H as L,Hc as b,Ic as pe,Jc as de,Kc as T,La as P,Oa as D,R as _,aa as ce,b as I,c as w,lc as le,mf as fe,rf as $,uc as N,xf as ye,zd as j}from"./chunk-HS7OVAUN.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]="bed1d1d4-0c1d-59e5-8267-fbe800dfd83b")}catch{}})();var C=["agile","ops","research"],X={agile:{name:"agile",title:"Agile delivery",summary:"Story/Spike delivery with a review stage, story points, and acceptance ownership.",types:B.agile,statuses:[{id:"review",roles:["active"],aliases:["in-review"],description:"Work is implementation-complete and awaiting peer review."}],fields:[{key:"story_points",type:"number",commands:["create","update","list"],description:"Relative estimation size for a story or spike.",aliases:["points"]},{key:"acceptance_owner",type:"string",commands:["create","update","list"],description:"Stakeholder accountable for accepting the delivered story.",aliases:["acceptor"]}],workflows:[{type:"Story",allowed_transitions:[["open","in_progress"],["in_progress","review"],["review","in_progress"],["review","closed"],["in_progress","blocked"],["blocked","in_progress"]]}],config:[{key:"search_provider",value:"bm25",summary:"Offline BM25 lexical search works without an embedding service."},{key:"search_max_results",value:"20",summary:"Sprint-sized result cap for quick triage."}],templates:[{name:"story",options:{type:"Story",priority:"2",tags:"story",acceptanceCriteria:"Story delivers the stated user outcome with tests and docs updated.",body:`## As a
1
+ import{b as x,c as K,d as Ee,e as Se}from"./chunk-CHOQ2VAW.js";import{A as B,K as Te,r as E,s as _e,t as U,u as ke,v as S,w as ve,x as W,y as be}from"./chunk-CALJHNBL.js";import{m as he}from"./chunk-PIE5HBNA.js";import{s as we}from"./chunk-NFLJ3FHD.js";import{a as A}from"./chunk-RSIC5OPE.js";import{c as h,f as ue,g as me,i as M}from"./chunk-KZ4X3DGU.js";import{A as f,C as u,Ef as $,H as L,Hc as b,Ic as pe,Jc as de,Kc as T,Kf as ye,La as P,Nf as z,Oa as D,Of as ge,R as _,aa as ce,b as I,c as w,lc as le,uc as N,yf as fe,zd as j}from"./chunk-D4FPS43D.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]="bed1d1d4-0c1d-59e5-8267-fbe800dfd83b")}catch{}})();var C=["agile","ops","research"],X={agile:{name:"agile",title:"Agile delivery",summary:"Story/Spike delivery with a review stage, story points, and acceptance ownership.",types:B.agile,statuses:[{id:"review",roles:["active"],aliases:["in-review"],description:"Work is implementation-complete and awaiting peer review."}],fields:[{key:"story_points",type:"number",commands:["create","update","list"],description:"Relative estimation size for a story or spike.",aliases:["points"]},{key:"acceptance_owner",type:"string",commands:["create","update","list"],description:"Stakeholder accountable for accepting the delivered story.",aliases:["acceptor"]}],workflows:[{type:"Story",allowed_transitions:[["open","in_progress"],["in_progress","review"],["review","in_progress"],["review","closed"],["in_progress","blocked"],["blocked","in_progress"]]}],config:[{key:"search_provider",value:"bm25",summary:"Offline BM25 lexical search works without an embedding service."},{key:"search_max_results",value:"20",summary:"Sprint-sized result cap for quick triage."}],templates:[{name:"story",options:{type:"Story",priority:"2",tags:"story",acceptanceCriteria:"Story delivers the stated user outcome with tests and docs updated.",body:`## As a
2
2
 
3
3
  ## I want
4
4
 
@@ -52,4 +52,4 @@ import{b as x,c as K,d as Ee,e as Se}from"./chunk-CHOQ2VAW.js";import{A as B,K a
52
52
  `)}function jn(e){let t=e.source==="extension"?` [${e.package??"extension"}]`:"",n=e.warning_count+e.warnings.length,i=[e.ok?`Profile ${e.name}${t}: ok (${n} warning${n===1?"":"s"})`:`Profile ${e.name}${t}: ${e.error_count} error${e.error_count===1?"":"s"}, ${n} warning${n===1?"":"s"}`];for(let s of e.findings){let r=s.target!==void 0?` (${s.target})`:"";i.push(` ${s.severity} [${s.code}] ${s.dimension}${r}: ${s.message}`)}for(let s of e.warnings)i.push(` warning: ${s}`);return i.join(`
53
53
  `)}function Mn(e){let t=e.dry_run?"dry-run":e.applied?"applied":"no changes",n=[`Profile ${e.name} (${t})`];if(!e.changed)n.push(" already up to date");else for(let[i,s]of[["types",e.types],["statuses",e.statuses],["fields",e.fields],["workflows",e.workflows],["config",e.config],["templates",e.templates]]){let r=_t(i,s);r!==void 0&&n.push(r)}let o=e.packages.filter(i=>i.status==="recommended");o.length>0&&n.push(` recommended packages: ${o.map(i=>i.spec).join(", ")}`);for(let i of e.warnings)n.push(` warning: ${i}`);return n.join(`
54
54
  `)}export{C as a,X as b,qe as c,vt as d,bt as e,ee as f,Pe as g,jt as h,Mt as i,Ae as j,Oe as k,on as l,sn as m,We as n,rn as o,an as p,Cn as q,On as r,Rn as s,Fn as t,Ln as u,Dn as v,Nn as w,jn as x,Mn as y};
55
- //# sourceMappingURL=chunk-WSI5KZQJ.js.map
55
+ //# sourceMappingURL=chunk-UQLZQVFW.js.map
@@ -1,2 +1,2 @@
1
- import{af as g,gf as y}from"./chunk-HS7OVAUN.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="19ff592c-0746-54e8-a304-2006f4845da2")}catch{}})();function b(t){return t.replaceAll("~1","/").replaceAll("~0","~")}function w(t){if(t==="/body"||t.startsWith("/body/"))return"body";if(t==="/metadata"||t.startsWith("/metadata/")||t==="/front_matter"||t.startsWith("/front_matter/")){let r=t.replace(/^\/(?:metadata|front_matter)\/?/,"").split("/")[0];return r?b(r):"metadata"}let e=t.replace(/^\//,"").split("/")[0];return e?b(e):"root"}function i(t,e){return e==="body"?t.body:e==="metadata"?t.metadata:e==="root"?t:t.metadata[e]}function D(t,e){let r=e?.windowStartIndex??0,a=e?.field;if(t.length===0||r>=t.length)return[];let l=g(),u=[];for(let d=0;d<t.length;d+=1){let n=t[d],p=l,h=y(l,n.patch),s;h.ok?(s=h.document,l=s):s=p;let f=new Set;for(let o of n.patch)f.add(w(o.path)),o.from!==void 0&&f.add(w(o.from));let m=[...f].sort((o,c)=>o.localeCompare(c));if(d>=r)if(a!==void 0){if(!f.has(a))continue;let o={field:a,before:i(p,a),after:i(s,a)};u.push({index:d+1,ts:n.ts,op:n.op,author:n.author,patch_ops:n.patch.length,changed_fields:[a],changes:[o]})}else{let o=m.map(c=>({field:c,before:i(p,c),after:i(s,c)}));u.push({index:d+1,ts:n.ts,op:n.op,author:n.author,patch_ops:n.patch.length,changed_fields:m,changes:o})}}return u}export{w as a,D as b};
2
- //# sourceMappingURL=chunk-4OVGQW22.js.map
1
+ import{mf as g,sf as y}from"./chunk-D4FPS43D.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="19ff592c-0746-54e8-a304-2006f4845da2")}catch{}})();function b(t){return t.replaceAll("~1","/").replaceAll("~0","~")}function w(t){if(t==="/body"||t.startsWith("/body/"))return"body";if(t==="/metadata"||t.startsWith("/metadata/")||t==="/front_matter"||t.startsWith("/front_matter/")){let r=t.replace(/^\/(?:metadata|front_matter)\/?/,"").split("/")[0];return r?b(r):"metadata"}let e=t.replace(/^\//,"").split("/")[0];return e?b(e):"root"}function i(t,e){return e==="body"?t.body:e==="metadata"?t.metadata:e==="root"?t:t.metadata[e]}function D(t,e){let r=e?.windowStartIndex??0,a=e?.field;if(t.length===0||r>=t.length)return[];let l=g(),u=[];for(let d=0;d<t.length;d+=1){let n=t[d],p=l,h=y(l,n.patch),s;h.ok?(s=h.document,l=s):s=p;let f=new Set;for(let o of n.patch)f.add(w(o.path)),o.from!==void 0&&f.add(w(o.from));let m=[...f].sort((o,c)=>o.localeCompare(c));if(d>=r)if(a!==void 0){if(!f.has(a))continue;let o={field:a,before:i(p,a),after:i(s,a)};u.push({index:d+1,ts:n.ts,op:n.op,author:n.author,patch_ops:n.patch.length,changed_fields:[a],changes:[o]})}else{let o=m.map(c=>({field:c,before:i(p,c),after:i(s,c)}));u.push({index:d+1,ts:n.ts,op:n.op,author:n.author,patch_ops:n.patch.length,changed_fields:m,changes:o})}}return u}export{w as a,D as b};
2
+ //# sourceMappingURL=chunk-VT3Z5G7D.js.map
@@ -1,2 +1,2 @@
1
- import{db as u}from"./chunk-HS7OVAUN.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="f73e79d8-2a65-5a25-8c6f-ec9b06651634")}catch{}})();function i(a){return[...new Set(Array.from(a,e=>e.trim()).filter(e=>e.length>0))]}(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="01e8d488-ce63-54cc-848e-e7842a9d873d")}catch{}})();function n(a){return a.startsWith("--")?`--${a.slice(2).replaceAll("_","-")}`:a}function c(a){let e=new Map;for(let l of a){let t=n(l.flag),g=e.get(t)??new Set;l.flag!==t&&g.add(l.flag);for(let f of l.aliases??[])f!==t&&g.add(f);e.set(t,g)}return a.map(l=>{let t=n(l.flag);if(l.flag!==t)return l;let g=i([...l.aliases??[],...e.get(t)]).filter(f=>f!==t);return g.length===0?l:{...l,aliases:g}})}function ee(a){let e=c(a),l=new Set(e.map(t=>t.flag));return e.filter(t=>{let g=n(t.flag);return t.flag===g||!l.has(g)})}var d=u.map(a=>({flag:a.flag,...a.aliases?{aliases:[...a.aliases]}:{},...a.value_name?{value_name:a.value_name}:{}})),le=[...d,{flag:"--version"}],C=[{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"}],h=[{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"}],k=p([{flag:"--for",value_name:"intent"},{flag:"--token-budget",aliases:["--token_budget"]},{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:"--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"},...C,{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"])),G=[{flag:"--group-by",list:!0},{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}],F=[{flag:"--add",aliases:["--comment","--body"]},{flag:"--stdin"},{flag:"--file"},{flag:"--edit"},{flag:"--delete"},{flag:"--limit"},{flag:"--author"},{flag:"--message"},{flag:"--force"}];function p(a,e){return a.map(l=>e.has(l.flag)?{...l,cursor_semantics:"presentation"}:l)}var w=[{flag:"--add",aliases:["--note"]},{flag:"--add-json"},{flag:"--stdin"},{flag:"--file"},{flag:"--edit"},{flag:"--delete"},{flag:"--limit"},{flag:"--since"},{flag:"--event-type"},{flag:"--include-meta"},{flag:"--author"},{flag:"--message"},{flag:"--force"}],I=[{flag:"--add",aliases:["--learning"]},{flag:"--limit"},{flag:"--author"},{flag:"--message"},{flag:"--force"}],M=[{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:"--author"},{flag:"--message"},{flag:"--force"}],D=[{flag:"--add"},{flag:"--add-glob"},{flag:"--remove"},{flag:"--migrate"},{flag:"--note"},{flag:"--list"},{flag:"--validate-paths"},{flag:"--author"},{flag:"--message"},{flag:"--force"}],P=[{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"}],X=[{flag:"--dry-run"},{flag:"--output"},{flag:"--item-path"},{flag:"--prefer"}],U=[{flag:"--literal"},{flag:"--regex"},{flag:"--replacement"},{flag:"--dry-run"},{flag:"--author"},{flag:"--message"},{flag:"--force"}],j=[{flag:"--all"},{flag:"--dry-run"},{flag:"--author"},{flag:"--message"},{flag:"--force"}],H=[{flag:"--event",repeatable:!0},{flag:"--all-actionable"},{flag:"--attributed-author",aliases:["--attributed_author"]},{flag:"--reviewer"},{flag:"--reason"}],z=[{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"}],Y=[{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"},{flag:"--to"},{flag:"--migration-id",aliases:["--migration_id"]},{flag:"--dry-run"},{flag:"--author"},{flag:"--force"}],q=[{flag:"--dry-run"},{flag:"--author"},{flag:"--force"}],B=[{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"}],V=[{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"}],K=[{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"}],y=[{flag:"--init"},{flag:"--scaffold"},{flag:"--capability"},{flag:"--install"},{flag:"--uninstall"},{flag:"--explore"},{flag:"--list"},{flag:"--manage"},{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"}],s=[{flag:"--project"},{flag:"--local"},{flag:"--global"}],x=[...s,{flag:"--capability"}],m=[...y,{flag:"--declarative"}],W=[...x,{flag:"--declarative"}],$=[{flag:"--project"},{flag:"--local"},{flag:"--global"},{flag:"--gh"},{flag:"--github"},{flag:"--ref"}],J=s,Q=s,Z=[...s,{flag:"--markdown"},{flag:"--output"}],aa=s,ea=s,la=s,ta=[...s,{flag:"--dry-run"}],fa=[...s,{flag:"--runtime-probe"},{flag:"--fix-managed-state"}],ga=[...s,{flag:"--watch"}],sa=[...s,{flag:"--detail"},{flag:"--trace"},{flag:"--fix-managed-state"},{flag:"--isolated"},{flag:"--ignore-global"},{flag:"--strict-exit"},{flag:"--fail-on-warn"}],ra=[...s,{flag:"--fields",list:!0}],ia=[...s,{flag:"--gh"},{flag:"--github"},{flag:"--ref"}],oa=[{flag:"--project"},{flag:"--local"},{flag:"--global"},{flag:"--gh"},{flag:"--github"},{flag:"--ref"}],na=[{flag:"--dry-run"},{flag:"--cli-only"},{flag:"--packages-only"},{flag:"--project"},{flag:"--local"},{flag:"--global"},{flag:"--repair"},{flag:"--tag"},{flag:"--package-name"}],te=[{flag:"--mode"},{flag:"--progress"}],ca=[{flag:"--reason"},{flag:"--close-reason"},{flag:"--completed-at"},{flag:"--duplicate-of"},{flag:"--author"},{flag:"--message"},{flag:"--validate-close"},{flag:"--resolution"},{flag:"--expected-result",aliases:["--expected_result","--expected"]},{flag:"--actual-result",aliases:["--actual_result","--actual"]},{flag:"--force"}],da=[{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"},...h,{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"}],pa=[{flag:"--body",short:"-b"},{flag:"--author"},{flag:"--message"},{flag:"--force"}],ua=[{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:"--token-budget",aliases:["--token_budget"]},{flag:"--explain-ranking",aliases:["--explain_ranking"]}],ma=[{flag:"--author"},{flag:"--message"},{flag:"--force"}],_a=[{flag:"--dry-run"},{flag:"--author"},{flag:"--message"},{flag:"--force"}],Ta=[{flag:"--author",aliases:["--assignee"]},{flag:"--message"},{flag:"--force"}],Aa=[{flag:"--author",aliases:["--assignee"]},{flag:"--message"},{flag:"--force"}],Ca=[{flag:"--author",aliases:["--assignee"]},{flag:"--message"},{flag:"--force"}],ha=[{flag:"--author",aliases:["--assignee"]},{flag:"--message"},{flag:"--validate-close"},{flag:"--force"}],b=[{flag:"--parent"},{flag:"--allow-missing-parent"},{flag:"--tags"},{flag:"--priority"},{flag:"--body"},{flag:"--description"},{flag:"--author"},{flag:"--message"}],v=[{flag:"--start"},{flag:"--duration"},{flag:"--end"},{flag:"--location"},{flag:"--timezone"},{flag:"--all-day"},...b],ya=v,xa=[{flag:"--at"},{flag:"--text"},...b],ba=[{flag:"--add"},{flag:"--add-json"},{flag:"--remove"},{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:"--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},{flag:"--metric-below"},{flag:"--metric-diff"},{flag:"--author"},{flag:"--message"},{flag:"--force"}],va=[{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:"--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"}],Sa=[{flag:"--limit"}],Na=[{flag:"--status"},{flag:"--limit"},{flag:"--stream"},{flag:"--tail"},{flag:"--force"},{flag:"--author"}],Oa=[{flag:"--dry-run"},{flag:"--scope"}],La=[{flag:"--storage"},{flag:"--metadata-coverage"},{flag:"--field-utilization"},{flag:"--by-assignee"},{flag:"--by-tag"},{flag:"--by-priority"},{flag:"--tag-prefix"}],Ea=[{flag:"--status",repeatable:!0,list:!0},{flag:"--since"},{flag:"--threshold"},{flag:"--limit"}],Ra=[{flag:"--strict-directories"},{flag:"--require-merge-drivers"},{flag:"--strict-exit"},{flag:"--fail-on-warn"},{flag:"--check-only"},{flag:"--check-telemetry"},{flag:"--no-refresh"},{flag:"--refresh-vectors"},{flag:"--verbose-stale-items"},{flag:"--verbose-author-events"},{flag:"--brief"},{flag:"--summary"},{flag:"--skip-vectors"},{flag:"--skip-integrity"},{flag:"--skip-drift"},{flag:"--full"}],ka=[{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"}],S=[{flag:"--assignee"},{flag:"--parent"},{flag:"--allow-missing-parent"},{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"}],N=[{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"}],O=[{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"]}],_=[{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"},{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"},...S,...N,{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"},{flag:"--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"}],Ga=[{flag:"--transaction-id",value_name:"value"},{flag:"--stdin-json"},{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"}],Fa=[{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:"mode"},{flag:"--lock-ttl-seconds",value_name:"n"},{flag:"--lock-wait-ms",value_name:"n"},{flag:"--dry-run"},{flag:"--force"},{flag:"--author",value_name:"value"}],wa=[{flag:"--title"},{flag:"--author"},{flag:"--message"},{flag:"--allow-duplicate",value_type:"boolean"}],Ia=[{flag:"--clear"}],Ma=[{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"},...O,...S,{flag:"--fixed_version"},...N,{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"},{flag:"--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"}],Da=[{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"},...h,{flag:"--dry-run"},{flag:"--rollback"},{flag:"--no-checkpoint"},{short:"-t",flag:"--title"},{short:"-d",flag:"--description"},{short:"-b",flag:"--body"},...O,{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:"--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"}],T=[{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:"--format"}],Pa=[{flag:"--id"},{flag:"--op"},{flag:"--author"},{flag:"--from"},{flag:"--to"},{flag:"--limit"},{flag:"--unbounded"},{flag:"--compact"},{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:"--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"}],A=p([{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"])),Ua=[{flag:"--for",value_name:"intent"},{flag:"--token-budget",aliases:["--token_budget"]},{flag:"--depth"},{flag:"--full"},{flag:"--fields",list:!0},{flag:"--at"},{flag:"--tree"},{flag:"--tree-depth"},{flag:"--tree_depth"},{flag:"--format"}],ja=[{flag:"--list"},{flag:"--format"},{flag:"--depth"}],Ha=[{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}],za=[{flag:"--kind",list:!0},{flag:"--max-depth"},{flag:"--limit"},{flag:"--after"},{flag:"--direction"},{flag:"--max-paths"},{flag:"--sample"},{flag:"--exempt-isolate",list:!0},{flag:"--exempt-isolate-type",list:!0},{flag:"--save-baseline"},{flag:"--rebuild"},{flag:"--clear"},{flag:"--summary"},{flag:"--full"}],Ya=[{flag:"--mode"},{flag:"--k"},{flag:"--fail-under"},{flag:"--queries"},{flag:"--format"}],r=[{flag:"--dry-run"},{flag:"--force"},{flag:"--author"},{flag:"--message"}],qa=[{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"]}],Ba=p([{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"},...C],new Set(["--highlight","--compact","--full","--fields","--format","--limit","--token-budget","--after"])),Va=[{flag:"--action"},{flag:"--command"},{flag:"--summary"},{flag:"--schema-only"},{flag:"--flags-only"},{flag:"--availability-only"},{flag:"--runtime-only"},{flag:"--active-only"},{flag:"--full"}],Ka=[{flag:"--eager-tags"}];function Wa(a){let e=new Set,l=[];for(let t of a){let g=(t.aliases??[]).join(","),f=`${t.flag}|${t.short??""}|${g}`;e.has(f)||(e.add(f),l.push(t))}return l}function o(a){return c(Wa([...d,...a]))}var $a=["list","list-all","list-draft","list-open","list-in-progress","list-blocked","list-closed","list-canceled"],L=new Map([...$a.map(a=>[a,k]),["templates",_],["cal",T],["ctx",A],["test-runs-worker",Na],["init",V],["config",K],["extension",y],["package",m],["packages",m],["install",oa],["upgrade",na],["create",_],["item mutate",Ga],["item complete",Fa],["copy",wa],["focus",Ia],["aggregate",G],["calendar",T],["context",A],["get",Ua],["guide",ja],["search",Ba],["next",qa],["eval",Ya],["workspace",r],["workspace snapshot",r],["workspace snapshot create",r],["workspace snapshot list",r],["workspace snapshot inspect",r],["workspace snapshot restore",r],["workspace snapshot delete",r],["history",P],["history-redact",U],["history-repair",j],["history-author-acknowledge",H],["history-compact",z],["merge",X],["schema",Y],["profile",q],["plan",B],["activity",Pa],["events",Xa],["restore",ma],["update",Ma],["update-many",Da],["close",ca],["close-many",da],["delete",_a],["append",pa],["comments",F],["notes",w],["learnings",I],["files",M],["docs",D],["deps",Ha],["graph",za],["test",ba],["test-all",va],["telemetry",Sa],["health",Ra],["validate",ka],["gc",Oa],["stats",La],["duplicates",Ea],["contracts",Va],["completion",Ka],["claim",ua],["release",Ta],["start-task",Aa],["pause-task",Ca],["close-task",ha],["meet",v],["event",ya],["remind",xa]]),E=new Map([["install",$],["uninstall",J],["explore",Q],["manage",fa],["describe",Z],["reload",ga],["doctor",sa],["catalog",ra],["adopt",ia],["adopt-all",aa],["activate",ea],["deactivate",la],["migrate",ta]]);function R(a){return typeof a!="string"?"":a.trim().toLowerCase()}function fe(a){let e=R(a);if(L.has(e))return!0;let[l,t,...g]=e.split(/\s+/);return(l==="extension"||l==="package"||l==="packages")&&t!==void 0&&g.length===0&&(t==="init"||E.has(t))}function Ja(a,e){return e==="init"?a==="extension"?x:W:E.get(e)??[]}function ge(a){let e=R(a);if(e.length===0)return o([]);let[l,t,...g]=e.split(/\s+/);return(l==="extension"||l==="package"||l==="packages")&&t!==void 0&&g.length===0?o(Ja(l,t)):o(L.get(e)??[])}function se(a,e=!0){let t=c(a).flatMap(f=>[f.short,f.flag,...f.aliases??[]]).filter(f=>!!f),g=e?[...t,...d.flatMap(f=>[f.short,f.flag,...f.aliases??[]]).filter(f=>!!f)]:t;return i(g).join(" ")}export{i as a,c as b,ee as c,d,le as e,k as f,G as g,F as h,w as i,I as j,M as k,D as l,P as m,X as n,U as o,j as p,H as q,z as r,Y as s,q as t,B as u,V as v,K as w,y as x,s as y,x as z,m as A,W as B,$ as C,J as D,Q as E,Z as F,aa as G,ea as H,la as I,ta as J,fa as K,ga as L,sa as M,ra as N,ia as O,oa as P,na as Q,te as R,ca as S,da as T,pa as U,ua as V,ma as W,_a as X,Ta as Y,Aa as Z,Ca as _,ha as $,v as aa,ya as ba,xa as ca,ba as da,va as ea,Sa as fa,Na as ga,Oa as ha,La as ia,Ea as ja,Ra as ka,ka as la,_ as ma,Ga as na,Fa as oa,wa as pa,Ia as qa,Ma as ra,Da as sa,T as ta,Pa as ua,Xa as va,A as wa,Ua as xa,ja as ya,Ha as za,za as Aa,Ya as Ba,r as Ca,qa as Da,Ba as Ea,Va as Fa,Ka as Ga,fe as Ha,ge as Ia,se as Ja};
2
- //# sourceMappingURL=chunk-RUAU5OSH.js.map
1
+ import{db as u}from"./chunk-D4FPS43D.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="f73e79d8-2a65-5a25-8c6f-ec9b06651634")}catch{}})();function i(a){return[...new Set(Array.from(a,e=>e.trim()).filter(e=>e.length>0))]}(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="8de867f9-e4d7-5c05-bae5-c3845a2280b7")}catch{}})();function n(a){return a.startsWith("--")?`--${a.slice(2).replaceAll("_","-")}`:a}function c(a){let e=new Map;for(let l of a){let t=n(l.flag),g=e.get(t)??new Set;l.flag!==t&&g.add(l.flag);for(let f of l.aliases??[])f!==t&&g.add(f);e.set(t,g)}return a.map(l=>{let t=n(l.flag);if(l.flag!==t)return l;let g=i([...l.aliases??[],...e.get(t)]).filter(f=>f!==t);return g.length===0?l:{...l,aliases:g}})}function ee(a){let e=c(a),l=new Set(e.map(t=>t.flag));return e.filter(t=>{let g=n(t.flag);return t.flag===g||!l.has(g)})}var d=u.map(a=>({flag:a.flag,...a.aliases?{aliases:[...a.aliases]}:{},...a.value_name?{value_name:a.value_name}:{}})),le=[...d,{flag:"--version"}],C=[{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"}],h=[{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"}],k=p([{flag:"--for",value_name:"intent"},{flag:"--token-budget",aliases:["--token_budget"]},{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:"--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"},...C,{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"])),G=[{flag:"--group-by",list:!0},{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}],F=[{flag:"--add",aliases:["--comment","--body"]},{flag:"--stdin"},{flag:"--file"},{flag:"--edit"},{flag:"--delete"},{flag:"--limit"},{flag:"--author"},{flag:"--message"},{flag:"--force"}];function p(a,e){return a.map(l=>e.has(l.flag)?{...l,cursor_semantics:"presentation"}:l)}var w=[{flag:"--add",aliases:["--note"]},{flag:"--add-json"},{flag:"--stdin"},{flag:"--file"},{flag:"--edit"},{flag:"--delete"},{flag:"--limit"},{flag:"--since"},{flag:"--event-type"},{flag:"--include-meta"},{flag:"--author"},{flag:"--message"},{flag:"--force"}],I=[{flag:"--add",aliases:["--learning"]},{flag:"--limit"},{flag:"--author"},{flag:"--message"},{flag:"--force"}],M=[{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:"--author"},{flag:"--message"},{flag:"--force"}],D=[{flag:"--add"},{flag:"--add-glob"},{flag:"--remove"},{flag:"--migrate"},{flag:"--note"},{flag:"--list"},{flag:"--validate-paths"},{flag:"--author"},{flag:"--message"},{flag:"--force"}],P=[{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"}],X=[{flag:"--dry-run"},{flag:"--output"},{flag:"--item-path"},{flag:"--prefer"}],U=[{flag:"--literal"},{flag:"--regex"},{flag:"--replacement"},{flag:"--dry-run"},{flag:"--author"},{flag:"--message"},{flag:"--force"}],j=[{flag:"--all"},{flag:"--dry-run"},{flag:"--author"},{flag:"--message"},{flag:"--force"}],H=[{flag:"--event",repeatable:!0},{flag:"--all-actionable"},{flag:"--attributed-author",aliases:["--attributed_author"]},{flag:"--reviewer"},{flag:"--reason"}],z=[{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"}],Y=[{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"},{flag:"--to"},{flag:"--migration-id",aliases:["--migration_id"]},{flag:"--dry-run"},{flag:"--author"},{flag:"--force"}],q=[{flag:"--dry-run"},{flag:"--author"},{flag:"--force"}],B=[{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"}],V=[{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"}],K=[{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"}],y=[{flag:"--init"},{flag:"--scaffold"},{flag:"--capability"},{flag:"--install"},{flag:"--uninstall"},{flag:"--explore"},{flag:"--list"},{flag:"--manage"},{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"}],s=[{flag:"--project"},{flag:"--local"},{flag:"--global"}],x=[...s,{flag:"--capability"}],m=[...y,{flag:"--declarative"}],W=[...x,{flag:"--declarative"}],$=[{flag:"--project"},{flag:"--local"},{flag:"--global"},{flag:"--gh"},{flag:"--github"},{flag:"--ref"}],J=s,Q=s,Z=[...s,{flag:"--markdown"},{flag:"--output"}],aa=s,ea=s,la=s,ta=[...s,{flag:"--dry-run"}],fa=[...s,{flag:"--runtime-probe"},{flag:"--fix-managed-state"}],ga=[...s,{flag:"--watch"}],sa=[...s,{flag:"--detail"},{flag:"--trace"},{flag:"--fix-managed-state"},{flag:"--isolated"},{flag:"--ignore-global"},{flag:"--strict-exit"},{flag:"--fail-on-warn"}],ra=[...s,{flag:"--fields",list:!0}],ia=[...s,{flag:"--gh"},{flag:"--github"},{flag:"--ref"}],oa=[{flag:"--project"},{flag:"--local"},{flag:"--global"},{flag:"--gh"},{flag:"--github"},{flag:"--ref"}],na=[{flag:"--dry-run"},{flag:"--cli-only"},{flag:"--packages-only"},{flag:"--project"},{flag:"--local"},{flag:"--global"},{flag:"--repair"},{flag:"--tag"},{flag:"--package-name"}],te=[{flag:"--mode"},{flag:"--progress"}],ca=[{flag:"--reason"},{flag:"--close-reason"},{flag:"--completed-at"},{flag:"--duplicate-of"},{flag:"--author"},{flag:"--message"},{flag:"--validate-close"},{flag:"--resolution"},{flag:"--expected-result",aliases:["--expected_result","--expected"]},{flag:"--actual-result",aliases:["--actual_result","--actual"]},{flag:"--force"}],da=[{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"},...h,{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"}],pa=[{flag:"--body",short:"-b"},{flag:"--author"},{flag:"--message"},{flag:"--force"}],ua=[{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:"--token-budget",aliases:["--token_budget"]},{flag:"--explain-ranking",aliases:["--explain_ranking"]}],ma=[{flag:"--author"},{flag:"--message"},{flag:"--force"}],_a=[{flag:"--dry-run"},{flag:"--author"},{flag:"--message"},{flag:"--force"}],Ta=[{flag:"--author",aliases:["--assignee"]},{flag:"--message"},{flag:"--force"}],Aa=[{flag:"--author",aliases:["--assignee"]},{flag:"--message"},{flag:"--force"}],Ca=[{flag:"--author",aliases:["--assignee"]},{flag:"--message"},{flag:"--force"}],ha=[{flag:"--author",aliases:["--assignee"]},{flag:"--message"},{flag:"--validate-close"},{flag:"--force"}],b=[{flag:"--parent"},{flag:"--allow-missing-parent"},{flag:"--tags"},{flag:"--priority"},{flag:"--body"},{flag:"--description"},{flag:"--author"},{flag:"--message"}],v=[{flag:"--start"},{flag:"--duration"},{flag:"--end"},{flag:"--location"},{flag:"--timezone"},{flag:"--all-day"},...b],ya=v,xa=[{flag:"--at"},{flag:"--text"},...b],ba=[{flag:"--add"},{flag:"--add-json"},{flag:"--remove"},{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:"--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},{flag:"--metric-below"},{flag:"--metric-diff"},{flag:"--author"},{flag:"--message"},{flag:"--force"}],va=[{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:"--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"}],Sa=[{flag:"--limit"}],Na=[{flag:"--status"},{flag:"--limit"},{flag:"--stream"},{flag:"--tail"},{flag:"--force"},{flag:"--author"}],Oa=[{flag:"--dry-run"},{flag:"--scope"}],La=[{flag:"--storage"},{flag:"--metadata-coverage"},{flag:"--field-utilization"},{flag:"--by-assignee"},{flag:"--by-tag"},{flag:"--by-priority"},{flag:"--tag-prefix"},{flag:"--analytics"}],Ea=[{flag:"--status",repeatable:!0,list:!0},{flag:"--since"},{flag:"--threshold"},{flag:"--limit"}],Ra=[{flag:"--strict-directories"},{flag:"--require-merge-drivers"},{flag:"--strict-exit"},{flag:"--fail-on-warn"},{flag:"--check-only"},{flag:"--check-telemetry"},{flag:"--no-refresh"},{flag:"--refresh-vectors"},{flag:"--verbose-stale-items"},{flag:"--verbose-author-events"},{flag:"--brief"},{flag:"--summary"},{flag:"--skip-vectors"},{flag:"--skip-integrity"},{flag:"--skip-drift"},{flag:"--full"}],ka=[{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"}],S=[{flag:"--assignee"},{flag:"--parent"},{flag:"--allow-missing-parent"},{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"}],N=[{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"}],O=[{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"]}],_=[{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"},{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"},...S,...N,{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"},{flag:"--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"}],Ga=[{flag:"--transaction-id",value_name:"value"},{flag:"--stdin-json"},{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"}],Fa=[{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:"mode"},{flag:"--lock-ttl-seconds",value_name:"n"},{flag:"--lock-wait-ms",value_name:"n"},{flag:"--dry-run"},{flag:"--force"},{flag:"--author",value_name:"value"}],wa=[{flag:"--title"},{flag:"--author"},{flag:"--message"},{flag:"--allow-duplicate",value_type:"boolean"}],Ia=[{flag:"--clear"}],Ma=[{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"},...O,...S,{flag:"--fixed_version"},...N,{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"},{flag:"--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"}],Da=[{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"},...h,{flag:"--dry-run"},{flag:"--rollback"},{flag:"--no-checkpoint"},{short:"-t",flag:"--title"},{short:"-d",flag:"--description"},{short:"-b",flag:"--body"},...O,{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:"--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"}],T=[{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:"--format"}],Pa=[{flag:"--id"},{flag:"--op"},{flag:"--author"},{flag:"--from"},{flag:"--to"},{flag:"--limit"},{flag:"--unbounded"},{flag:"--compact"},{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:"--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"}],A=p([{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"])),Ua=[{flag:"--for",value_name:"intent"},{flag:"--token-budget",aliases:["--token_budget"]},{flag:"--depth"},{flag:"--full"},{flag:"--fields",list:!0},{flag:"--at"},{flag:"--tree"},{flag:"--tree-depth"},{flag:"--tree_depth"},{flag:"--format"}],ja=[{flag:"--list"},{flag:"--format"},{flag:"--depth"}],Ha=[{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}],za=[{flag:"--kind",list:!0},{flag:"--max-depth"},{flag:"--limit"},{flag:"--after"},{flag:"--direction"},{flag:"--max-paths"},{flag:"--sample"},{flag:"--exempt-isolate",list:!0},{flag:"--exempt-isolate-type",list:!0},{flag:"--save-baseline"},{flag:"--rebuild"},{flag:"--clear"},{flag:"--summary"},{flag:"--full"}],Ya=[{flag:"--mode"},{flag:"--k"},{flag:"--fail-under"},{flag:"--queries"},{flag:"--format"}],r=[{flag:"--dry-run"},{flag:"--force"},{flag:"--author"},{flag:"--message"}],qa=[{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"]}],Ba=p([{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"},...C],new Set(["--highlight","--compact","--full","--fields","--format","--limit","--token-budget","--after"])),Va=[{flag:"--action"},{flag:"--command"},{flag:"--summary"},{flag:"--schema-only"},{flag:"--flags-only"},{flag:"--availability-only"},{flag:"--runtime-only"},{flag:"--active-only"},{flag:"--full"}],Ka=[{flag:"--eager-tags"}];function Wa(a){let e=new Set,l=[];for(let t of a){let g=(t.aliases??[]).join(","),f=`${t.flag}|${t.short??""}|${g}`;e.has(f)||(e.add(f),l.push(t))}return l}function o(a){return c(Wa([...d,...a]))}var $a=["list","list-all","list-draft","list-open","list-in-progress","list-blocked","list-closed","list-canceled"],L=new Map([...$a.map(a=>[a,k]),["templates",_],["cal",T],["ctx",A],["test-runs-worker",Na],["init",V],["config",K],["extension",y],["package",m],["packages",m],["install",oa],["upgrade",na],["create",_],["item mutate",Ga],["item complete",Fa],["copy",wa],["focus",Ia],["aggregate",G],["calendar",T],["context",A],["get",Ua],["guide",ja],["search",Ba],["next",qa],["eval",Ya],["workspace",r],["workspace snapshot",r],["workspace snapshot create",r],["workspace snapshot list",r],["workspace snapshot inspect",r],["workspace snapshot restore",r],["workspace snapshot delete",r],["history",P],["history-redact",U],["history-repair",j],["history-author-acknowledge",H],["history-compact",z],["merge",X],["schema",Y],["profile",q],["plan",B],["activity",Pa],["events",Xa],["restore",ma],["update",Ma],["update-many",Da],["close",ca],["close-many",da],["delete",_a],["append",pa],["comments",F],["notes",w],["learnings",I],["files",M],["docs",D],["deps",Ha],["graph",za],["test",ba],["test-all",va],["telemetry",Sa],["health",Ra],["validate",ka],["gc",Oa],["stats",La],["duplicates",Ea],["contracts",Va],["completion",Ka],["claim",ua],["release",Ta],["start-task",Aa],["pause-task",Ca],["close-task",ha],["meet",v],["event",ya],["remind",xa]]),E=new Map([["install",$],["uninstall",J],["explore",Q],["manage",fa],["describe",Z],["reload",ga],["doctor",sa],["catalog",ra],["adopt",ia],["adopt-all",aa],["activate",ea],["deactivate",la],["migrate",ta]]);function R(a){return typeof a!="string"?"":a.trim().toLowerCase()}function fe(a){let e=R(a);if(L.has(e))return!0;let[l,t,...g]=e.split(/\s+/);return(l==="extension"||l==="package"||l==="packages")&&t!==void 0&&g.length===0&&(t==="init"||E.has(t))}function Ja(a,e){return e==="init"?a==="extension"?x:W:E.get(e)??[]}function ge(a){let e=R(a);if(e.length===0)return o([]);let[l,t,...g]=e.split(/\s+/);return(l==="extension"||l==="package"||l==="packages")&&t!==void 0&&g.length===0?o(Ja(l,t)):o(L.get(e)??[])}function se(a,e=!0){let t=c(a).flatMap(f=>[f.short,f.flag,...f.aliases??[]]).filter(f=>!!f),g=e?[...t,...d.flatMap(f=>[f.short,f.flag,...f.aliases??[]]).filter(f=>!!f)]:t;return i(g).join(" ")}export{i as a,c as b,ee as c,d,le as e,k as f,G as g,F as h,w as i,I as j,M as k,D as l,P as m,X as n,U as o,j as p,H as q,z as r,Y as s,q as t,B as u,V as v,K as w,y as x,s as y,x as z,m as A,W as B,$ as C,J as D,Q as E,Z as F,aa as G,ea as H,la as I,ta as J,fa as K,ga as L,sa as M,ra as N,ia as O,oa as P,na as Q,te as R,ca as S,da as T,pa as U,ua as V,ma as W,_a as X,Ta as Y,Aa as Z,Ca as _,ha as $,v as aa,ya as ba,xa as ca,ba as da,va as ea,Sa as fa,Na as ga,Oa as ha,La as ia,Ea as ja,Ra as ka,ka as la,_ as ma,Ga as na,Fa as oa,wa as pa,Ia as qa,Ma as ra,Da as sa,T as ta,Pa as ua,Xa as va,A as wa,Ua as xa,ja as ya,Ha as za,za as Aa,Ya as Ba,r as Ca,qa as Da,Ba as Ea,Va as Fa,Ka as Ga,fe as Ha,ge as Ia,se as Ja};
2
+ //# sourceMappingURL=chunk-WOD3WWUN.js.map
@@ -1,3 +1,3 @@
1
- import{a as B}from"./chunk-A6KGKEWT.js";import{f as m,g as j,h,i as q}from"./chunk-R6LSRGPS.js";import{A as l,Af as W,C as u,Cb as O,Da as G,La as K,Lf as z,Ma as F,Mf as V,Oa as U,Sf as Y,b as N,ha as E,lc as M,zd as $}from"./chunk-HS7OVAUN.js";import ct from"node:fs/promises";import f from"node:path";import dt from"fast-glob";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="2b9ba0a4-396f-5870-bc89-e7fc789bb49d")}catch{}})();var it=/^[a-z][a-z0-9+.-]+:\/\//i;function _(t){return it.test(t.trim())}(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="3fe80124-596b-591c-9f0d-fbbc129c6bb4")}catch{}})();var pt=["path","scope","note"],lt=["pattern","glob","path","scope","note"],ut=["path"],ft=["from","to"],mt=new Set(["note","scope"]);function Z(t){let e=t??"project";if(!E.includes(e))throw new u(`Invalid scope "${t}". Valid scopes: ${E.join(", ")} (default: project).`,l.USAGE);return e}function H(t){return t.startsWith("```")||t.includes(`
1
+ import{a as B}from"./chunk-A6KGKEWT.js";import{f as m,g as j,h,i as q}from"./chunk-NYIGHWQY.js";import{A as l,C as u,Cb as O,Da as G,La as K,Ma as F,Nf as W,Oa as U,Yf as z,Zf as V,b as N,dg as Y,ha as E,lc as M,zd as $}from"./chunk-D4FPS43D.js";import ct from"node:fs/promises";import f from"node:path";import dt from"fast-glob";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="2b9ba0a4-396f-5870-bc89-e7fc789bb49d")}catch{}})();var it=/^[a-z][a-z0-9+.-]+:\/\//i;function _(t){return it.test(t.trim())}(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="3fe80124-596b-591c-9f0d-fbbc129c6bb4")}catch{}})();var pt=["path","scope","note"],lt=["pattern","glob","path","scope","note"],ut=["path"],ft=["from","to"],mt=new Set(["note","scope"]);function Z(t){let e=t??"project";if(!E.includes(e))throw new u(`Invalid scope "${t}". Valid scopes: ${E.join(", ")} (default: project).`,l.USAGE);return e}function H(t){return t.startsWith("```")||t.includes(`
2
2
  `)||/^(?:[-*+]\s+)?(?:path|scope|note)\s*[:=]/i.test(t)?!0:j(t)}function ht(t){return t.flatMap(e=>{let o=e.trim();return o.length===0||H(o)||!o.includes(",")?[e]:B(o)})}function gt(t,e){return t?ht(t).map(o=>{let n=o.trim(),r=H(n)?m(o,"--add"):{path:n};if(h(r,"--add",pt),!r.path)throw new u(`--add requires path=<value> or a bare ${e} path`,l.USAGE);return{path:r.path,scope:Z(r.scope),note:r.note?.trim()||void 0}}):[]}function bt(t){return t?t.map(e=>{let o=e.trim();if(!o)throw new u("--add-glob requires a glob pattern value",l.USAGE);if(o.includes("=")||/^(?:[-*+]\s+)?(?:pattern|glob|path)\s*[:=]/i.test(o)||o.startsWith("```")){let n=m(o,"--add-glob");h(n,"--add-glob",lt);let r=n.pattern?.trim()||n.glob?.trim()||n.path?.trim();if(!r)throw new u("--add-glob key/value form requires pattern=<glob>",l.USAGE);return{pattern:r,scope:Z(n.scope),note:n.note?.trim()||void 0}}return{pattern:o,scope:"project"}}):[]}function vt(t){return t?t.map(e=>{let o=e.trim();if(!o)throw new u("--remove requires a path value",l.USAGE);if(o.includes("=")||/^(?:[-*+]\s+)?path\s*[:=]/i.test(o)||o.startsWith("```")){let n=m(o,"--remove"),r=Object.keys(n).filter(i=>mt.has(i.toLowerCase()));if(r.length>0)throw new u(`--remove identifies a linked artifact by path only and does not accept ${r.map(i=>`"${i}"`).join(", ")}. Pass just the path (path=<value>, path:<value>, or a bare path); record removal context with --message "<why removed>".`,l.USAGE);if(h(n,"--remove",ut),!n.path)throw new u("--remove key/value form requires path=<value>",l.USAGE);return n.path}return o}):[]}function At(t){return t?t.map(e=>{let o=m(e,"--migrate");h(o,"--migrate",ft);let n=o.from?.trim(),r=o.to?.trim();if(!n||!r)throw new u("--migrate requires from=<value> and to=<value>",l.USAGE);return{from:n,to:r}}):[]}function y(t,e){let o=t;for(let n of e)o.startsWith(n.from)&&(o=`${n.to}${o.slice(n.from.length)}`);return o}function x(t){return t.split(f.sep).join("/")}function k(t,e,o=process.cwd()){let n=t.trim();if(_(n))return n;if(f.isAbsolute(n)||/^[A-Za-z]:[\\/]/.test(n))return x(n.replaceAll("\\",f.sep));let r=f.relative(e,o);return r.startsWith(`..${f.sep}`)||r===".."||f.isAbsolute(r)?x(f.normalize(n)):x(f.relative(e,f.resolve(o,n)))}async function wt(t,e=process.cwd(),o=process.cwd()){let n=[];for(let r of t){let i=f.isAbsolute(r.pattern),s=await dt(r.pattern,{cwd:o,absolute:i,onlyFiles:!0,dot:!0,unique:!0,followSymbolicLinks:!0}),a=[...new Set(s.map(d=>k(d,e,o)))].sort((d,c)=>d.localeCompare(c));for(let d of a)n.push({path:d,scope:r.scope,note:r.note})}return n}function Et(t,e,o){if(e===void 0)return t;if(!o)throw new u("--note requires --add or --add-glob in the same invocation (the note annotates the links being added)",l.USAGE);let n=e.trim();return n.length===0?t:t.map(r=>r.note===void 0?{...r,note:n}:r)}function _t(t){return`${t.path}::${t.scope}`}function yt(t){return[...t].sort((e,o)=>{let n=e.path.localeCompare(o.path);return n!==0?n:e.scope.localeCompare(o.scope)})}function xt(t){return[...new Map(t.map(e=>[_t(e),e])).values()].map(e=>({...e,note:e.note?.trim()||void 0}))}async function kt(t,e=process.cwd()){let o=[...new Set(t)].sort((a,d)=>a.localeCompare(d)),n=[],r=[],i=[],s=[];for(let a of o){if(_(a)){s.push(a.trim());continue}let d=f.isAbsolute(a)?a:f.resolve(e,a);try{(await ct.stat(d)).isFile()?n.push(a):i.push(a)}catch(c){if(typeof c=="object"&&c!==null&&"code"in c&&c.code==="ENOENT"){r.push(a);continue}i.push(a)}}return{checked:o.length,existing_files:n,missing_paths:r,non_file_paths:i,remote_references:s}}function Rt(t,e,o,n){let r=0;for(let s=0;s<t.length;s+=1){let a=y(t[s].path,n);a!==t[s].path&&(t[s]={...t[s],path:a},r+=1)}return{adds:e.map(s=>{let a=y(s.path,n);return a!==s.path&&(r+=1),{...s,path:a}}),removes:o.map(s=>y(s,n)),count:r}}function St(t,e,o,n){for(let i of e)t.some(s=>s.path===i.path&&s.scope===i.scope)||t.push(i);if(o.length>0)for(let i=t.length-1;i>=0;i-=1)o.includes(t[i].path)&&t.splice(i,1);let r=xt(t);return n?r:yt(r)}async function X(t){let e=t.artifacts.map(o=>o.path);return{id:t.id,artifacts:t.artifacts,changed:t.changed,count:t.artifacts.length,migrations_applied:t.migrationsApplied&&t.migrationsApplied>0?t.migrationsApplied:void 0,validation:t.options.validatePaths?await kt(e,t.workspaceRoot):void 0}}async function Yt(t,e,o,n){let{metadataKey:r}=n,i=q(),s=K(process.cwd(),o.path),a=F(s),d=process.cwd();if(!await N(U(s)))throw new u(`Tracker is not initialized at ${s}. Run pm init first.`,l.NOT_FOUND);let c=await W(s),J=G(c,M()),Q=await i.resolveList(e.add,"--add"),tt=await i.resolveList(e.addGlob,"--add-glob"),et=await i.resolveList(e.remove,"--remove"),ot=await i.resolveList(e.migrate,"--migrate"),R=gt(Q,n.bareNoun).map(p=>({...p,path:k(p.path,a,d)})),S=bt(tt),nt=await wt(S,a,d),T=Et([...R,...nt],e.note,R.length>0||S.length>0),L=vt(et).map(p=>k(p,a,d)),I=At(ot);if(!(T.length>0||L.length>0||I.length>0)){let p=await z(s,t,c.id_prefix,c.item_format,J.type_to_folder);if(!p)throw new u(`Item ${t} not found`,l.NOT_FOUND);let v=(await V(p,{schema:c.schema})).document.metadata[r]??[];return X({id:p.id,artifacts:v,changed:!1,options:e,workspaceRoot:a})}let rt=$(e.author,c.author_default),g=await Y({pmRoot:s,settings:c,id:t,op:n.op,author:rt,message:e.message,force:e.force,skipNoop:!0,mutate(p){let b=p.metadata,v=b[r]??[],C=[...v],A=Rt(C,T,L,I),w=St(C,A.adds,A.removes,n.supportsAppendStable&&e.appendStable===!0);w.length>0?b[r]=w:delete b[r];let D=!O(v,w);return{changedFields:D?[r]:[],warnings:D&&A.count>0?[`path_migrations_applied:${A.count}`]:[]}}}),st=g.item[r]??[],P=g.warnings.find(p=>p.startsWith("path_migrations_applied:")),at=P?Number(P.slice(24)):0;return X({id:g.item.id,artifacts:st,changed:g.changedFields.includes(r),migrationsApplied:at,options:e,workspaceRoot:a})}function Bt(t,e){let o={};for(let[n,r]of Object.entries(t))o[n==="artifacts"?e:n]=r;return o}export{_ as a,Z as b,gt as c,bt as d,vt as e,At as f,y as g,x as h,wt as i,Et as j,_t as k,yt as l,xt as m,kt as n,Yt as o,Bt as p};
3
- //# sourceMappingURL=chunk-DQGJ2RWT.js.map
3
+ //# sourceMappingURL=chunk-WSJEIGJF.js.map