@unbrained/pm-cli 2026.10.26 → 2026.10.27

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 (122) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/CHANGELOG.md +16 -1
  3. package/dist/cli/register-list-query.js +5 -5
  4. package/dist/cli-bundle/bundle-manifest.json +1 -1
  5. package/dist/cli-bundle/chunks/{chunk-MWCG25PO.js → chunk-2XUDAQK5.js} +2 -2
  6. package/dist/cli-bundle/chunks/{chunk-Y42DYMZX.js → chunk-32QK43XG.js} +2 -2
  7. package/dist/cli-bundle/chunks/{chunk-T7T4WLUY.js → chunk-34OQP43K.js} +3 -3
  8. package/dist/cli-bundle/chunks/{chunk-ZLVFUZI4.js → chunk-5PTMQBKJ.js} +30 -30
  9. package/dist/cli-bundle/chunks/{chunk-NGKTROAO.js → chunk-EKV5GP6P.js} +4 -4
  10. package/dist/cli-bundle/chunks/{chunk-OCDRHIVQ.js → chunk-F26MRQZY.js} +3 -3
  11. package/dist/cli-bundle/chunks/{chunk-XAIR53QZ.js → chunk-H434DKYU.js} +2 -2
  12. package/dist/cli-bundle/chunks/{chunk-TGOG5BFM.js → chunk-HIX2OMEZ.js} +2 -2
  13. package/dist/cli-bundle/chunks/{chunk-7UDQAINZ.js → chunk-NNIYQHYT.js} +2 -2
  14. package/dist/cli-bundle/chunks/chunk-O3LPT34G.js +20 -0
  15. package/dist/cli-bundle/chunks/{chunk-Z35XAHUN.js → chunk-OQOEBWHU.js} +2 -2
  16. package/dist/cli-bundle/chunks/{chunk-UF6EXZSP.js → chunk-Q55KZDNF.js} +2 -2
  17. package/dist/cli-bundle/chunks/{chunk-VS2IIV3F.js → chunk-QQYLNHZK.js} +5 -5
  18. package/dist/cli-bundle/chunks/chunk-SPPHDVZE.js +2 -0
  19. package/dist/cli-bundle/chunks/chunk-UHKN6TJM.js +114 -0
  20. package/dist/cli-bundle/chunks/{chunk-ZT64RDMF.js → chunk-X5TMR7KC.js} +2 -2
  21. package/dist/cli-bundle/chunks/{chunk-YJBIPNDL.js → chunk-XERBUA6A.js} +2 -2
  22. package/dist/cli-bundle/chunks/indexed-receipt-blobs-63WYG2PY.js +4 -0
  23. package/dist/cli-bundle/chunks/{mutation-admission-VTNV6JV2.js → mutation-admission-L3A6FSZ7.js} +2 -2
  24. package/dist/cli-bundle/chunks/{register-list-query-LZDWUZS4.js → register-list-query-YSQ7UTFI.js} +9 -9
  25. package/dist/cli-bundle/chunks/{register-mutation-M2A7PH42.js → register-mutation-6HRXYASW.js} +2 -2
  26. package/dist/cli-bundle/chunks/{register-operations-E7P2JTXM.js → register-operations-4O3YOYXF.js} +2 -2
  27. package/dist/cli-bundle/chunks/{register-setup-DOV7KGSH.js → register-setup-3WAXNDMY.js} +2 -2
  28. package/dist/cli-bundle/chunks/{settlement-hook-SVD6CO7U.js → settlement-hook-CRW6PVQK.js} +2 -2
  29. package/dist/cli-bundle/chunks/{stage-LYLEOAQB.js → stage-I46WD4EN.js} +2 -2
  30. package/dist/cli-bundle/focused-chunks/{chunk-WDWHUJQW.js → chunk-4TXZBGOR.js} +2 -2
  31. package/dist/cli-bundle/focused-chunks/chunk-EGN2HFRU.js +2 -0
  32. package/dist/cli-bundle/focused-chunks/{chunk-IF6C43IP.js → chunk-HWD63G54.js} +2 -2
  33. package/dist/cli-bundle/focused-chunks/{chunk-NE27VCU7.js → chunk-J67PFM3O.js} +2 -2
  34. package/dist/cli-bundle/focused-chunks/{chunk-PK5FJIVA.js → chunk-MVY6JDIH.js} +2 -2
  35. package/dist/cli-bundle/focused-chunks/{chunk-UP765R2V.js → chunk-R2MTHS2H.js} +2 -2
  36. package/dist/cli-bundle/focused-chunks/chunk-SM2KGD4J.js +79 -0
  37. package/dist/cli-bundle/focused-chunks/{chunk-226XKW3W.js → chunk-SYL73MEI.js} +3 -3
  38. package/dist/cli-bundle/focused-chunks/{chunk-CSCZYSNZ.js → chunk-TAFMNTA5.js} +2 -2
  39. package/dist/cli-bundle/focused-chunks/{chunk-I7H3XF25.js → chunk-TGUOEOKP.js} +2 -2
  40. package/dist/cli-bundle/focused-chunks/chunk-U4UBQBS7.js +2 -0
  41. package/dist/cli-bundle/focused-chunks/{chunk-D5YQ4KAE.js → chunk-WDKZB3V6.js} +2 -2
  42. package/dist/cli-bundle/focused-chunks/{chunk-KERJNFXY.js → chunk-XK3XMZM4.js} +2 -2
  43. package/dist/cli-bundle/focused-chunks/{chunk-ADSBGYLW.js → chunk-Y57A4ZDI.js} +55 -55
  44. package/dist/cli-bundle/focused-chunks/{chunk-BL77VCRB.js → chunk-YC6NCPLK.js} +2 -2
  45. package/dist/cli-bundle/focused-chunks/chunk-ZA6AEYIM.js +2 -0
  46. package/dist/cli-bundle/focused-chunks/{chunk-YTEC2EPM.js → chunk-ZH7GTEWL.js} +3 -3
  47. package/dist/cli-bundle/focused-chunks/indexed-receipt-blobs-GAFC52LQ.js +4 -0
  48. package/dist/cli-bundle/focused-chunks/{mutation-admission-L42E3U5U.js → mutation-admission-ENBFMV2X.js} +2 -2
  49. package/dist/cli-bundle/focused-chunks/{settlement-hook-3CADO4XZ.js → settlement-hook-PUYJJDFL.js} +2 -2
  50. package/dist/cli-bundle/focused-chunks/{stage-TUQHWU7N.js → stage-MAWZTM2H.js} +2 -2
  51. package/dist/cli-bundle/main.js +2 -2
  52. package/dist/cli-bundle/sdk-authoring.js +1 -1
  53. package/dist/cli-bundle/sdk-contracts.js +2 -2
  54. package/dist/cli-bundle/sdk-core.js +33 -33
  55. package/dist/cli-bundle/sdk-governance.js +1 -1
  56. package/dist/cli-bundle/sdk-graph.js +1 -1
  57. package/dist/cli-bundle/sdk-merge.js +57 -57
  58. package/dist/cli-bundle/sdk-query.js +1 -1
  59. package/dist/cli-bundle/sdk-runtime.js +1 -1
  60. package/dist/cli-bundle/sdk-testing.js +1 -1
  61. package/dist/cli-bundle/sdk.js +3 -3
  62. package/dist/core/history/event-index.d.ts +6 -0
  63. package/dist/core/history/event-index.js +7 -6
  64. package/dist/core/history/read.d.ts +3 -1
  65. package/dist/core/history/read.js +1 -1
  66. package/dist/mcp/tool-definitions.js +1 -1
  67. package/dist/sdk/cli-contracts/flag-contracts.js +1 -1
  68. package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +1 -1
  69. package/dist/sdk/cli-contracts/grammar-contracts.js +1 -1
  70. package/dist/sdk/cli-contracts/tool-parameter-tables.js +1 -1
  71. package/dist/sdk/cli-contracts/tool-schema.js +1 -1
  72. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1 -1
  73. package/dist/sdk/merge/indexed-receipt-blobs.d.ts +3 -1
  74. package/dist/sdk/merge/indexed-receipt-blobs.js +2 -2
  75. package/dist/sdk/merge/receipt-file-boundary.d.ts +2 -0
  76. package/dist/sdk/merge/receipt-file-boundary.js +1 -1
  77. package/dist/sdk/merge/receipts.js +2 -2
  78. package/dist/sdk/mutation-events.d.ts +6 -0
  79. package/dist/sdk/mutation-events.js +1 -1
  80. package/dist/sdk/public-surface.json +1 -1
  81. package/dist/sdk/runtime-extended-actions.js +1 -1
  82. package/dist/sdk/test/execution.js +2 -2
  83. package/dist/sdk/test/receipt-index-snapshot.d.ts +2 -0
  84. package/dist/sdk/test/receipt-index-snapshot.js +2 -0
  85. package/dist/sdk/test/workspace-snapshot.d.ts +1 -1
  86. package/dist/sdk/test/workspace-snapshot.js +1 -1
  87. package/docs/PERFORMANCE.md +21 -6
  88. package/docs/RELEASING.md +11 -0
  89. package/docs/SDK_CONTEXT_COORDINATION.md +35 -4
  90. package/docs/TESTING.md +14 -1
  91. package/docs/generated/FLAG_LEXICON_BUDGETS.md +2 -2
  92. package/docs/generated/REFUSAL_CLOSURE_CENSUS.md +4 -3
  93. package/marketplace.json +1 -1
  94. package/package.json +1 -1
  95. package/packages/pm-beads/package.json +1 -1
  96. package/packages/pm-calendar/package.json +1 -1
  97. package/packages/pm-command-kit/package.json +1 -1
  98. package/packages/pm-digital-twin/package.json +1 -1
  99. package/packages/pm-governance-audit/package.json +1 -1
  100. package/packages/pm-guide-shell/package.json +1 -1
  101. package/packages/pm-kanban/package.json +1 -1
  102. package/packages/pm-lifecycle-hooks/package.json +1 -1
  103. package/packages/pm-linked-test-adapters/package.json +1 -1
  104. package/packages/pm-search-advanced/package.json +1 -1
  105. package/packages/pm-templates/package.json +1 -1
  106. package/packages/pm-todos/package.json +1 -1
  107. package/packages/pm-vcs/package.json +1 -1
  108. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  109. package/plugins/pm-claude/package.json +1 -1
  110. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  111. package/plugins/pm-codex/package.json +1 -1
  112. package/plugins/pm-codex/plugin.json +1 -1
  113. package/runtime-dependencies.json +1 -1
  114. package/dist/cli-bundle/chunks/chunk-N6FTEILW.js +0 -20
  115. package/dist/cli-bundle/chunks/chunk-OUDR2HWR.js +0 -113
  116. package/dist/cli-bundle/chunks/chunk-RUKSEZE7.js +0 -2
  117. package/dist/cli-bundle/chunks/indexed-receipt-blobs-NWQIDTH7.js +0 -4
  118. package/dist/cli-bundle/focused-chunks/chunk-ABMNYWV6.js +0 -2
  119. package/dist/cli-bundle/focused-chunks/chunk-NFN2P4TW.js +0 -2
  120. package/dist/cli-bundle/focused-chunks/chunk-UHWTPOM4.js +0 -78
  121. package/dist/cli-bundle/focused-chunks/chunk-VVRXF4JO.js +0 -2
  122. package/dist/cli-bundle/focused-chunks/indexed-receipt-blobs-YFDNGHCM.js +0 -4
@@ -1,4 +1,4 @@
1
- import{E as Ze,F as et,f as pe}from"./chunk-NE27VCU7.js";import{$a as he,Ea as Bt,Ta as Gt,Ua as Qe,Va as Wt,Za as _e,_a as te,ca as Je,g as We,h as Ht,r as Ke,x as fe,xa as Yt,y as Xe}from"./chunk-UHWTPOM4.js";import{b as Vt}from"./chunk-B266DDBJ.js";import{$ as E,$b as qt,Aa as Ye,Ba as Ft,Dc as jt,Ga as Be,Ja as Ut,Kd as me,a as Ve,ba as Z,ca as K,da as b,fa as zt,ic as Ge,mc as le,qa as je,uc as ue,wd as M,ya as ee,za as He}from"./chunk-NLZUI234.js";import{B as G,D as W,E as T,H as v,J as de,s as qe,y as u,z as m}from"./chunk-KTXU5WU6.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]="b84fee06-5bbd-57f9-9643-f283d6c87afa")}catch{}})();function An(e,t="--limit"){if(e===void 0)return;let r=Number(e);if(!Number.isFinite(r)||r<0)throw new m(`${t} must be a non-negative number`,u.USAGE);return Math.floor(r)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="9b58b44d-819c-5115-b011-f9dfa8e2ab41")}catch{}})();var In=3e4,re=class extends Error{status;constructor(t,r){super(t),this.name="SearchHttpError",this.status=r}};function P(e,t,r=In){let n=e??r;if(!Number.isFinite(n)||n<=0)throw new Error(`${t} timeout must be a positive finite number`);return Math.floor(n)}function $(e,t){if(e)return e;if(typeof globalThis.fetch=="function")return globalThis.fetch.bind(globalThis);throw new Error(`${t} execution requires a fetch implementation`)}async function Cn(e){try{return(await e.text()).replaceAll(/\s+/g," ").trim()}catch(t){return`(failed to read response body: ${b(t)})`}}async function ge(e){let t=new AbortController,r=setTimeout(()=>{t.abort()},e.timeoutMs);try{let n;try{n=await e.fetcher(e.endpoint,{method:e.method,headers:e.headers,body:JSON.stringify(e.body),signal:t.signal})}catch(o){throw o instanceof Error&&o.name==="AbortError"?new Error(`${e.requestLabel} timed out after ${e.timeoutMs}ms`):new Error(`${e.requestLabel} execution failed: ${b(o)}`)}if(!n.ok){let o=await Cn(n),i=o.length>0?`: ${o}`:"";throw new re(`${e.requestLabel} failed with status ${n.status} ${n.statusText}${i}`,n.status)}try{return await n.json()}catch(o){throw new Error(`${e.responseLabel} JSON parse failed: ${b(o)}`)}}finally{clearTimeout(r)}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="8e3bb919-c8f9-50b5-8e41-b6719d17bd21")}catch{}})();function Xa(e,t){let r=E(e);if(!r)return"unconfigured";let n=E(t);return n&&n.toLowerCase()===r.toLowerCase()?"configured":"auto-detected"}function xn(e){let t=Z(e),r=t.toLowerCase();return r.endsWith("/embeddings")?t:r.endsWith("/v1")?`${t}/embeddings`:`${t}/v1/embeddings`}function Xt(e){let t=e.search?.embedding_model;return E(t)||null}function Rn(e){let t=E(e.providers?.openai?.base_url),r=E(e.providers?.openai?.model);if(!t||!r)return null;let n=Xt(e),o=E(e.providers?.openai?.api_key);return{name:"openai",base_url:t,model:n??r,...o?{api_key:o}:{}}}function kn(e){let t=E(e.providers?.ollama?.base_url),r=E(e.providers?.ollama?.model);if(!t||!r)return null;let n=Xt(e);return{name:"ollama",base_url:t,model:n??r}}function Jt(e){let t=(Array.isArray(e)?e:[e]).map(r=>r.trim()).filter(r=>r.length>0);if(t.length===0)throw new Error("Embedding input must include at least one non-empty string");return t}function Ln(e){let t=[],r=[],n=new Map;for(let o of e){let i=n.get(o);if(i===void 0){let s=t.length;t.push(o),n.set(o,s),r.push(s);continue}r.push(i)}return{uniqueInputs:t,originalToUniqueIndex:r}}function On(e){let t=e.map((r,n)=>({embedding:r.embedding,index:r.index,position:n}));if(t.some(r=>r.index!==void 0)){for(let r of t)if(!Number.isInteger(r.index))throw new TypeError(`OpenAI embedding response entry at position ${r.position} is missing a valid integer index`);return[...t].sort((r,n)=>{let o=r.index-n.index;return o!==0?o:r.position-n.position})}return t}function tt(e){let t=Rn(e),r=kn(e),n=[t,r].filter(s=>s!==null),o=E(e.search?.provider),i=o?o.toLowerCase():null;return{active:(i?n.find(s=>s.name===i):void 0)??n[0]??null,available:n}}function Kt(e){let t=Z(e.base_url);return e.name==="openai"?{provider:"openai",endpoint:xn(t),model:e.model}:{provider:"ollama",endpoint:`${t}/api/embed`,model:e.model}}function Dn(e,t){let r=Jt(t);return e.name==="openai"?{target:Kt(e),method:"POST",headers:{"content-type":"application/json",...e.api_key?{authorization:`Bearer ${e.api_key}`}:{}},body:{model:e.model,input:r.length===1?r[0]:r}}:{target:Kt(e),method:"POST",headers:{"content-type":"application/json"},body:{model:e.model,input:r}}}function Mn(e,t){if(e.name==="openai"){let o=t.data;if(!Array.isArray(o)||o.length===0)throw new Error("OpenAI embedding response must include a non-empty data array");return On(o).map((i,s)=>{let a=i.embedding;if(!K(a))throw new Error(`OpenAI embedding response entry at index ${s} is missing a numeric embedding vector`);return[...a]})}let r=t.embedding;if(K(r))return[[...r]];let n=t.embeddings;if(Array.isArray(n)&&n.length>0)return n.map((o,i)=>{if(!K(o))throw new Error(`Ollama embedding response entry at index ${i} is missing a numeric embedding vector`);return[...o]});throw new Error("Ollama embedding response must include embedding or embeddings vectors")}async function Qt(e,t,r={}){let n=P(r.timeout_ms,"Embedding request"),o=$(r.fetcher,"Embedding request"),i=Jt(t),s=Ln(i),a=Dn(e,s.uniqueInputs),c=await ge({endpoint:a.target.endpoint,method:a.method,headers:a.headers,body:a.body,timeoutMs:n,fetcher:o,requestLabel:"Embedding request",responseLabel:"Embedding response"}),d=Mn(e,c);if(d.length!==s.uniqueInputs.length)throw new Error(`Embedding response cardinality mismatch: expected ${s.uniqueInputs.length} vector(s), received ${d.length}`);return s.originalToUniqueIndex.map(l=>[...d[l]])}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="5c86afdf-6d8d-5851-82c1-ae5bcc9f0196")}catch{}})();var ye=["title","description","tags","status","type","priority","assignee","parent","goal","value","why_now","risk","confidence","estimated_minutes","acceptance_criteria","resolution","expected_result","actual_result","body","comments","notes","learnings","reminders","events","dependencies","plan"];function rt(e){let t=e?.search?.corpus_fields;if(!Array.isArray(t))return[...ye];let r=new Set(ye),n=Array.from(new Set(t.filter(o=>typeof o=="string").map(o=>o.trim()).filter(o=>o.length>0&&r.has(o))));return n.length>0?n:[...ye]}var Nn=8e3,Pn=3200,z="...[semantic corpus truncated]",$n="search_embedding_corpus_max_characters_invalid:using_provider_default";function x(e){return e.map(t=>t==null?"":String(t).trim()).filter(t=>t.length>0).join(" ")}function zn(e){return(e.reminders??[]).map(t=>x([t.at,t.text]))}function Fn(e){return(e.events??[]).map(t=>x([t.start_at,t.end_at,t.title,t.description,t.location,t.all_day===!0?"all day":void 0,t.timezone,t.recurrence?.freq,t.recurrence?.interval,t.recurrence?.count,t.recurrence?.until,t.recurrence?.by_weekday?.join(" "),t.recurrence?.by_month_day?.join(" "),t.recurrence?.exdates?.join(" ")]))}function Un(e,t){e.push(t.title,t.body,t.status,t.owner,t.evidence,t.blocked_reason,t.superseded_by);for(let r of t.linked_items??[])e.push(`${r.kind} ${r.id}`,r.note);for(let r of t.files??[])e.push(r.path,r.note);for(let r of t.tests??[])e.push(r.command,r.path,r.note);for(let r of t.docs??[])e.push(r.path,r.note)}function Vn(e,t){for(let r of t.plan_decisions??[])e.push(r.decision,r.rationale,r.evidence);for(let r of t.plan_discoveries??[])e.push(r.text);for(let r of t.plan_validation??[])e.push(r.text,r.command,r.expected)}function Za(e){let t=[];t.push(e.plan_mode,e.plan_scope,e.plan_harness,e.plan_resume_context);for(let r of e.plan_steps??[])Un(t,r);return Vn(t,e),t.filter(r=>typeof r=="string"&&r.length>0).join(" ")}function qn(e){let t=(e.plan_steps??[]).map(i=>x([i.order,i.id,i.title,i.body,i.status,i.owner,i.evidence,i.blocked_reason,i.superseded_by,(i.linked_items??[]).map(s=>x([s.kind,s.id,s.note])).join(" "),(i.files??[]).map(s=>x([s.path,s.note])).join(" "),(i.tests??[]).map(s=>x([s.command,s.path,s.note])).join(" "),(i.docs??[]).map(s=>x([s.path,s.note])).join(" ")])),r=(e.plan_decisions??[]).map(i=>x([i.decision,i.rationale,i.evidence,i.step_id])),n=(e.plan_discoveries??[]).map(i=>x([i.text,i.step_id])),o=(e.plan_validation??[]).map(i=>x([i.text,i.command,i.expected]));if([e.plan_mode,e.plan_scope,e.plan_harness,e.plan_resume_context,...t,...r,...n,...o].some(i=>i!==void 0))return{mode:e.plan_mode,scope:e.plan_scope,harness:e.plan_harness,resume_context:e.plan_resume_context,steps:t,decisions:r,discoveries:n,validation:o}}function C(e){return typeof e=="string"&&e.trim().length>0}var jn={title:e=>e.metadata.title,description:e=>e.metadata.description,tags:e=>e.metadata.tags,status:e=>e.metadata.status,type:e=>e.metadata.type,priority:e=>typeof e.metadata.priority=="number"?e.metadata.priority:void 0,assignee:e=>C(e.metadata.assignee)?e.metadata.assignee:void 0,parent:e=>C(e.metadata.parent)?e.metadata.parent:void 0,goal:e=>C(e.metadata.goal)?e.metadata.goal:void 0,value:e=>C(e.metadata.value)?e.metadata.value:void 0,why_now:e=>C(e.metadata.why_now)?e.metadata.why_now:void 0,risk:e=>C(e.metadata.risk)?e.metadata.risk:void 0,confidence:e=>e.metadata.confidence!==void 0&&e.metadata.confidence!==null?e.metadata.confidence:void 0,estimated_minutes:e=>typeof e.metadata.estimated_minutes=="number"?e.metadata.estimated_minutes:void 0,acceptance_criteria:e=>C(e.metadata.acceptance_criteria)?e.metadata.acceptance_criteria:void 0,resolution:e=>C(e.metadata.resolution)?e.metadata.resolution:void 0,expected_result:e=>C(e.metadata.expected_result)?e.metadata.expected_result:void 0,actual_result:e=>C(e.metadata.actual_result)?e.metadata.actual_result:void 0,body:e=>e.body,comments:e=>(e.metadata.comments??[]).map(t=>t.text),notes:e=>(e.metadata.notes??[]).map(t=>t.text),learnings:e=>(e.metadata.learnings??[]).map(t=>t.text),reminders:e=>zn(e.metadata),events:e=>Fn(e.metadata),dependencies:e=>(e.metadata.dependencies??[]).map(t=>({id:t.id,kind:t.kind})),plan:e=>qn(e.metadata)};function Zt(e,t={}){let r=t.fields??ye,n={};for(let o of r){let i=jn[o];if(!i)continue;let s=i(e);s!==void 0&&(n[o]=s)}return n}function Hn(e){return e?.trim().toLowerCase()==="ollama"?Pn:Nn}function X(e,t){let r=Hn(e),n=zt(t);return n!==null?{maxCharacters:n,warning:null}:{maxCharacters:r,warning:t==null?null:$n}}function nt(e,t={}){let r=JSON.stringify(Zt(e,{fields:t.fields})),n=X(t.providerName,t.maxCharacters).maxCharacters;if(r.length<=n)return r;if(n<=z.length)return z.slice(0,n);let o=Math.max(0,n-z.length);return`${r.slice(0,o)}${z}`}(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]="67bae1a1-19d1-50ea-816f-4b68e6bb69d9")}catch{}})();function Yn(e,t,r){let n=e.search.embedding_batch_size,o=e.search.embedding_timeout_ms,i=e.search.scanner_max_batch_retries,s=Number.isFinite(n)&&n>0?Math.max(1,Math.floor(n)):1,a=Number.isFinite(o)&&o>0?Math.max(1,Math.floor(o)):3e4,c=Number.isFinite(i)&&i>=0?Math.floor(i):0;return{batchSize:s,timeoutMs:a,maxRetries:c,maxRequestBytes:r,maxInputCharacters:t}}function Bn(e,t,r,n){let o=[],i=[],s=Buffer.byteLength(JSON.stringify({model:e.model,input:[]})),a=s;for(let c of t){let d=Buffer.byteLength(JSON.stringify(c.trim()));if(s+d>n)throw new RangeError(`Embedding input exceeds request byte ceiling ${n}; lower search.embedding_corpus_max_characters or raise maxRequestBytes`);let l=i.length>0?1:0;(i.length>=r||a+l+d>n)&&(o.push(i),i=[],a=s),a+=d+(i.length>0?1:0),i.push(c)}return o.push(i),o}function Gn(e,t){if(!Number.isFinite(t)||t<=0||e.length<=t)return e;let r=Math.max(0,t-z.length);return`${e.slice(0,r)}${z}`.slice(0,t)}function er(e){let t=b(e).toLowerCase();return t.includes("timed out")||t.includes("timeout")}function Wn(e,t,r,n,o,i){let s=`Embedding batch ${t} failed after ${o} attempt(s): ${b(i)}`,a=`provider=${e.name} model=${e.model} batch_size=${r} timeout_ms=${n}`;return er(i)?`${s} (${a}; guidance=check provider availability or lower search.embedding_batch_size, raise search.embedding_timeout_ms, or run keyword search while semantic indexing catches up)`:`${s} (${a})`}function Kn(e){return e instanceof re?e.status===413?"payload_too_large":null:er(e)?"timeout":null}async function ot(e,t,r,n,o,i,s){let a=null;for(let c=0;c<=o;c+=1)try{s.requests+=1;let d=await Qt(e,t,{timeout_ms:n});return c>0&&i.push(`search_embedding_batch_retry_succeeded:batch=${r}:attempt=${c+1}:size=${t.length}`),s.successful_batches+=1,s.batch_size_histogram[t.length]=(s.batch_size_histogram[t.length]??0)+1,d}catch(d){a=d;let l=Kn(d);if(l!==null&&t.length>1){s.split_batches+=1;let p=Math.ceil(t.length/2),_=t.slice(0,p),f=t.slice(p);return i.push(`search_embedding_batch_split_after_${l}:batch=${r}:size=${t.length}:parts=${_.length}|${f.length}`),[...await ot(e,_,`${r}.1`,n,o,i,s),...await ot(e,f,`${r}.2`,n,o,i,s)]}if(c<o){s.retries+=1;let p=Math.min(1e3*2**c,8e3);await new Promise(_=>setTimeout(_,p))}}throw new Error(Wn(e,r,t.length,n,o+1,a))}async function it(e,t,r,n={}){if(r.length===0)return{vectors:[],warnings:[]};let o=performance.now(),i=n.maxRequestBytes??262144;if(!Number.isSafeInteger(i)||i<=0)throw new RangeError("maxRequestBytes must be a positive safe integer");let s={provider:e.name,model:e.model,max_request_bytes:i,limit_source:n.maxRequestBytes===void 0?"default":"caller",planned_batches:0,requests:0,successful_batches:0,split_batches:0,retries:0,batch_size_histogram:{},elapsed_ms:0,inputs_per_second:0},a=[],c=X(e.name,t.search.embedding_corpus_max_characters);c.warning&&a.push(c.warning);let d=Yn(t,c.maxCharacters,i),l=0,p=r.map(h=>{if(h.trim().length===0)throw new TypeError("Embedding inputs must be non-empty strings");let y=Gn(h,d.maxInputCharacters);return y.length<h.length&&(l+=1),y});l>0&&a.push(`search_embedding_input_truncated:count=${l}:max_characters=${d.maxInputCharacters}`);let _=Bn(e,p,d.batchSize,d.maxRequestBytes);s.planned_batches=_.length;let f=[],g=0;for(let h=0;h<_.length;h+=1){let y=_[h];n.onProgress?.({batch_index:h+1,batch_total:_.length,batch_size:y.length,completed_inputs:g,total_inputs:p.length,phase:"start"}),f.push(...await ot(e,y,String(h+1),d.timeoutMs,d.maxRetries,a,s)),g+=y.length,n.onProgress?.({batch_index:h+1,batch_total:_.length,batch_size:y.length,completed_inputs:g,total_inputs:p.length,phase:"complete"})}return s.elapsed_ms=Math.max(1,performance.now()-o),s.inputs_per_second=r.length*1e3/s.elapsed_ms,{vectors:f,warnings:a,receipt:s}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="88eb8555-e098-5279-801e-3b76d0dd0eae")}catch{}})();var F=`[^\\s/\\\\<>"'\\x60()\\[\\]{},;?=:#*]+`,S="[/\\\\]+",Xn="[\\p{L}\\p{N}._@-]+",U=Xn+"(?:"+S+F+")*",Ee="(?:(?:home|users)"+S+U+"|root"+S+U+")",Jn="[/\\\\]"+Ee,Qn="[/\\\\]{2,}"+Ee,Zn="/?[a-z]:"+S+"users"+S+U,eo=F+"(?: +"+F+")*",st="(?:"+eo+S+")?users"+S+U,to="[/\\\\]{2,}"+F+S+st,ro="(?:[a-z]:|volume\\{[a-f0-9-]+\\}|"+F+")",rr="[/\\\\]{2}[?.]"+S+"(?:unc"+S+F+S+st+"|"+ro+S+"users"+S+U+")",no="file:(?:"+rr+"|(?:[/\\\\](?![/\\\\])|[/\\\\]{3,}|[/\\\\]{2}localhost"+S+")(?:"+Ee+"|[a-z]:"+S+"users"+S+U+")|[/\\\\]{2}(?:[a-z]:"+S+"users"+S+U+"|"+F+S+"(?:"+Ee+"|"+st+")))",oo=new RegExp("(?:^|[^\\p{L}\\p{N}_./\\\\~])(?:"+Jn+"|"+Zn+"|"+no+")|(?:^|[^\\p{L}\\p{N}_:./\\\\~])(?:"+Qn+"|"+to+"|"+rr+")","giu"),tr=4,io=/%[a-f0-9]{2}|\\(?:u[a-f0-9]{4}|x[a-f0-9]{2}|\/)/iu,so=new TextDecoder("utf-8");function ao(e){return e.replace(/(?:%[a-f0-9]{2})+/giu,t=>so.decode(Uint8Array.from(t.matchAll(/%([a-f0-9]{2})/giu),r=>Number.parseInt(r[1],16)))).replace(/%(?![a-f0-9]{2})[a-z0-9]{0,2}/giu,"\uFFFD")}function co(e){return e.replace(/\\+(?:u([a-f0-9]{4})|x([a-f0-9]{2})|(\/))?/giu,(t,r,n,o)=>{let i=r??n;return i===void 0?o??t:String.fromCharCode(Number.parseInt(i,16))})}function lo(e){return e.normalize("NFKC").replace(/[\p{Bidi_Control}\u200b-\u200f\u2060-\u206f\ufeff]/gu,"").replace(/[\u2215\u2044]/gu,"/").replace(/[\u043e\u041e]/gu,"o").replace(/[\u0455\u0405]/gu,"s")}function uo(e,t){for(let[r,n]of[["percent_decode",ao],["json_unescape",co],["unicode_fold",lo]]){let o=n(e);o!==e&&!t.includes(r)&&t.push(r),e=o}return e}function*mo(e,t,r){let n=e,o=[];for(let i=0;i<tr;i+=1){let s=n;if(n=uo(n,o),!r){t.lastIndex=0;for(let a of n.matchAll(t))r=!0,yield{index:0,normalizations:[...o]}}if(n===s)break;i===tr-1&&io.test(n)&&(yield{index:0,normalizations:[...o],normalization_incomplete:!0})}}function*fo(e,t){let r=0;for(let n of e.split(`
1
+ import{E as Ze,F as et,f as pe}from"./chunk-J67PFM3O.js";import{$a as he,Ea as Bt,Ta as Gt,Ua as Qe,Va as Wt,Za as _e,_a as te,ca as Je,g as We,h as Ht,r as Ke,x as fe,xa as Yt,y as Xe}from"./chunk-SM2KGD4J.js";import{b as Vt}from"./chunk-B266DDBJ.js";import{$ as E,$b as qt,Aa as Ye,Ba as Ft,Dc as jt,Ga as Be,Ja as Ut,Kd as me,a as Ve,ba as Z,ca as K,da as b,fa as zt,ic as Ge,mc as le,qa as je,uc as ue,wd as M,ya as ee,za as He}from"./chunk-NLZUI234.js";import{B as G,D as W,E as T,H as v,J as de,s as qe,y as u,z as m}from"./chunk-KTXU5WU6.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]="b84fee06-5bbd-57f9-9643-f283d6c87afa")}catch{}})();function An(e,t="--limit"){if(e===void 0)return;let r=Number(e);if(!Number.isFinite(r)||r<0)throw new m(`${t} must be a non-negative number`,u.USAGE);return Math.floor(r)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="9b58b44d-819c-5115-b011-f9dfa8e2ab41")}catch{}})();var In=3e4,re=class extends Error{status;constructor(t,r){super(t),this.name="SearchHttpError",this.status=r}};function P(e,t,r=In){let n=e??r;if(!Number.isFinite(n)||n<=0)throw new Error(`${t} timeout must be a positive finite number`);return Math.floor(n)}function $(e,t){if(e)return e;if(typeof globalThis.fetch=="function")return globalThis.fetch.bind(globalThis);throw new Error(`${t} execution requires a fetch implementation`)}async function Cn(e){try{return(await e.text()).replaceAll(/\s+/g," ").trim()}catch(t){return`(failed to read response body: ${b(t)})`}}async function ge(e){let t=new AbortController,r=setTimeout(()=>{t.abort()},e.timeoutMs);try{let n;try{n=await e.fetcher(e.endpoint,{method:e.method,headers:e.headers,body:JSON.stringify(e.body),signal:t.signal})}catch(o){throw o instanceof Error&&o.name==="AbortError"?new Error(`${e.requestLabel} timed out after ${e.timeoutMs}ms`):new Error(`${e.requestLabel} execution failed: ${b(o)}`)}if(!n.ok){let o=await Cn(n),i=o.length>0?`: ${o}`:"";throw new re(`${e.requestLabel} failed with status ${n.status} ${n.statusText}${i}`,n.status)}try{return await n.json()}catch(o){throw new Error(`${e.responseLabel} JSON parse failed: ${b(o)}`)}}finally{clearTimeout(r)}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="8e3bb919-c8f9-50b5-8e41-b6719d17bd21")}catch{}})();function Xa(e,t){let r=E(e);if(!r)return"unconfigured";let n=E(t);return n&&n.toLowerCase()===r.toLowerCase()?"configured":"auto-detected"}function xn(e){let t=Z(e),r=t.toLowerCase();return r.endsWith("/embeddings")?t:r.endsWith("/v1")?`${t}/embeddings`:`${t}/v1/embeddings`}function Xt(e){let t=e.search?.embedding_model;return E(t)||null}function Rn(e){let t=E(e.providers?.openai?.base_url),r=E(e.providers?.openai?.model);if(!t||!r)return null;let n=Xt(e),o=E(e.providers?.openai?.api_key);return{name:"openai",base_url:t,model:n??r,...o?{api_key:o}:{}}}function kn(e){let t=E(e.providers?.ollama?.base_url),r=E(e.providers?.ollama?.model);if(!t||!r)return null;let n=Xt(e);return{name:"ollama",base_url:t,model:n??r}}function Jt(e){let t=(Array.isArray(e)?e:[e]).map(r=>r.trim()).filter(r=>r.length>0);if(t.length===0)throw new Error("Embedding input must include at least one non-empty string");return t}function Ln(e){let t=[],r=[],n=new Map;for(let o of e){let i=n.get(o);if(i===void 0){let s=t.length;t.push(o),n.set(o,s),r.push(s);continue}r.push(i)}return{uniqueInputs:t,originalToUniqueIndex:r}}function On(e){let t=e.map((r,n)=>({embedding:r.embedding,index:r.index,position:n}));if(t.some(r=>r.index!==void 0)){for(let r of t)if(!Number.isInteger(r.index))throw new TypeError(`OpenAI embedding response entry at position ${r.position} is missing a valid integer index`);return[...t].sort((r,n)=>{let o=r.index-n.index;return o!==0?o:r.position-n.position})}return t}function tt(e){let t=Rn(e),r=kn(e),n=[t,r].filter(s=>s!==null),o=E(e.search?.provider),i=o?o.toLowerCase():null;return{active:(i?n.find(s=>s.name===i):void 0)??n[0]??null,available:n}}function Kt(e){let t=Z(e.base_url);return e.name==="openai"?{provider:"openai",endpoint:xn(t),model:e.model}:{provider:"ollama",endpoint:`${t}/api/embed`,model:e.model}}function Dn(e,t){let r=Jt(t);return e.name==="openai"?{target:Kt(e),method:"POST",headers:{"content-type":"application/json",...e.api_key?{authorization:`Bearer ${e.api_key}`}:{}},body:{model:e.model,input:r.length===1?r[0]:r}}:{target:Kt(e),method:"POST",headers:{"content-type":"application/json"},body:{model:e.model,input:r}}}function Mn(e,t){if(e.name==="openai"){let o=t.data;if(!Array.isArray(o)||o.length===0)throw new Error("OpenAI embedding response must include a non-empty data array");return On(o).map((i,s)=>{let a=i.embedding;if(!K(a))throw new Error(`OpenAI embedding response entry at index ${s} is missing a numeric embedding vector`);return[...a]})}let r=t.embedding;if(K(r))return[[...r]];let n=t.embeddings;if(Array.isArray(n)&&n.length>0)return n.map((o,i)=>{if(!K(o))throw new Error(`Ollama embedding response entry at index ${i} is missing a numeric embedding vector`);return[...o]});throw new Error("Ollama embedding response must include embedding or embeddings vectors")}async function Qt(e,t,r={}){let n=P(r.timeout_ms,"Embedding request"),o=$(r.fetcher,"Embedding request"),i=Jt(t),s=Ln(i),a=Dn(e,s.uniqueInputs),c=await ge({endpoint:a.target.endpoint,method:a.method,headers:a.headers,body:a.body,timeoutMs:n,fetcher:o,requestLabel:"Embedding request",responseLabel:"Embedding response"}),d=Mn(e,c);if(d.length!==s.uniqueInputs.length)throw new Error(`Embedding response cardinality mismatch: expected ${s.uniqueInputs.length} vector(s), received ${d.length}`);return s.originalToUniqueIndex.map(l=>[...d[l]])}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="5c86afdf-6d8d-5851-82c1-ae5bcc9f0196")}catch{}})();var ye=["title","description","tags","status","type","priority","assignee","parent","goal","value","why_now","risk","confidence","estimated_minutes","acceptance_criteria","resolution","expected_result","actual_result","body","comments","notes","learnings","reminders","events","dependencies","plan"];function rt(e){let t=e?.search?.corpus_fields;if(!Array.isArray(t))return[...ye];let r=new Set(ye),n=Array.from(new Set(t.filter(o=>typeof o=="string").map(o=>o.trim()).filter(o=>o.length>0&&r.has(o))));return n.length>0?n:[...ye]}var Nn=8e3,Pn=3200,z="...[semantic corpus truncated]",$n="search_embedding_corpus_max_characters_invalid:using_provider_default";function x(e){return e.map(t=>t==null?"":String(t).trim()).filter(t=>t.length>0).join(" ")}function zn(e){return(e.reminders??[]).map(t=>x([t.at,t.text]))}function Fn(e){return(e.events??[]).map(t=>x([t.start_at,t.end_at,t.title,t.description,t.location,t.all_day===!0?"all day":void 0,t.timezone,t.recurrence?.freq,t.recurrence?.interval,t.recurrence?.count,t.recurrence?.until,t.recurrence?.by_weekday?.join(" "),t.recurrence?.by_month_day?.join(" "),t.recurrence?.exdates?.join(" ")]))}function Un(e,t){e.push(t.title,t.body,t.status,t.owner,t.evidence,t.blocked_reason,t.superseded_by);for(let r of t.linked_items??[])e.push(`${r.kind} ${r.id}`,r.note);for(let r of t.files??[])e.push(r.path,r.note);for(let r of t.tests??[])e.push(r.command,r.path,r.note);for(let r of t.docs??[])e.push(r.path,r.note)}function Vn(e,t){for(let r of t.plan_decisions??[])e.push(r.decision,r.rationale,r.evidence);for(let r of t.plan_discoveries??[])e.push(r.text);for(let r of t.plan_validation??[])e.push(r.text,r.command,r.expected)}function Za(e){let t=[];t.push(e.plan_mode,e.plan_scope,e.plan_harness,e.plan_resume_context);for(let r of e.plan_steps??[])Un(t,r);return Vn(t,e),t.filter(r=>typeof r=="string"&&r.length>0).join(" ")}function qn(e){let t=(e.plan_steps??[]).map(i=>x([i.order,i.id,i.title,i.body,i.status,i.owner,i.evidence,i.blocked_reason,i.superseded_by,(i.linked_items??[]).map(s=>x([s.kind,s.id,s.note])).join(" "),(i.files??[]).map(s=>x([s.path,s.note])).join(" "),(i.tests??[]).map(s=>x([s.command,s.path,s.note])).join(" "),(i.docs??[]).map(s=>x([s.path,s.note])).join(" ")])),r=(e.plan_decisions??[]).map(i=>x([i.decision,i.rationale,i.evidence,i.step_id])),n=(e.plan_discoveries??[]).map(i=>x([i.text,i.step_id])),o=(e.plan_validation??[]).map(i=>x([i.text,i.command,i.expected]));if([e.plan_mode,e.plan_scope,e.plan_harness,e.plan_resume_context,...t,...r,...n,...o].some(i=>i!==void 0))return{mode:e.plan_mode,scope:e.plan_scope,harness:e.plan_harness,resume_context:e.plan_resume_context,steps:t,decisions:r,discoveries:n,validation:o}}function C(e){return typeof e=="string"&&e.trim().length>0}var jn={title:e=>e.metadata.title,description:e=>e.metadata.description,tags:e=>e.metadata.tags,status:e=>e.metadata.status,type:e=>e.metadata.type,priority:e=>typeof e.metadata.priority=="number"?e.metadata.priority:void 0,assignee:e=>C(e.metadata.assignee)?e.metadata.assignee:void 0,parent:e=>C(e.metadata.parent)?e.metadata.parent:void 0,goal:e=>C(e.metadata.goal)?e.metadata.goal:void 0,value:e=>C(e.metadata.value)?e.metadata.value:void 0,why_now:e=>C(e.metadata.why_now)?e.metadata.why_now:void 0,risk:e=>C(e.metadata.risk)?e.metadata.risk:void 0,confidence:e=>e.metadata.confidence!==void 0&&e.metadata.confidence!==null?e.metadata.confidence:void 0,estimated_minutes:e=>typeof e.metadata.estimated_minutes=="number"?e.metadata.estimated_minutes:void 0,acceptance_criteria:e=>C(e.metadata.acceptance_criteria)?e.metadata.acceptance_criteria:void 0,resolution:e=>C(e.metadata.resolution)?e.metadata.resolution:void 0,expected_result:e=>C(e.metadata.expected_result)?e.metadata.expected_result:void 0,actual_result:e=>C(e.metadata.actual_result)?e.metadata.actual_result:void 0,body:e=>e.body,comments:e=>(e.metadata.comments??[]).map(t=>t.text),notes:e=>(e.metadata.notes??[]).map(t=>t.text),learnings:e=>(e.metadata.learnings??[]).map(t=>t.text),reminders:e=>zn(e.metadata),events:e=>Fn(e.metadata),dependencies:e=>(e.metadata.dependencies??[]).map(t=>({id:t.id,kind:t.kind})),plan:e=>qn(e.metadata)};function Zt(e,t={}){let r=t.fields??ye,n={};for(let o of r){let i=jn[o];if(!i)continue;let s=i(e);s!==void 0&&(n[o]=s)}return n}function Hn(e){return e?.trim().toLowerCase()==="ollama"?Pn:Nn}function X(e,t){let r=Hn(e),n=zt(t);return n!==null?{maxCharacters:n,warning:null}:{maxCharacters:r,warning:t==null?null:$n}}function nt(e,t={}){let r=JSON.stringify(Zt(e,{fields:t.fields})),n=X(t.providerName,t.maxCharacters).maxCharacters;if(r.length<=n)return r;if(n<=z.length)return z.slice(0,n);let o=Math.max(0,n-z.length);return`${r.slice(0,o)}${z}`}(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]="67bae1a1-19d1-50ea-816f-4b68e6bb69d9")}catch{}})();function Yn(e,t,r){let n=e.search.embedding_batch_size,o=e.search.embedding_timeout_ms,i=e.search.scanner_max_batch_retries,s=Number.isFinite(n)&&n>0?Math.max(1,Math.floor(n)):1,a=Number.isFinite(o)&&o>0?Math.max(1,Math.floor(o)):3e4,c=Number.isFinite(i)&&i>=0?Math.floor(i):0;return{batchSize:s,timeoutMs:a,maxRetries:c,maxRequestBytes:r,maxInputCharacters:t}}function Bn(e,t,r,n){let o=[],i=[],s=Buffer.byteLength(JSON.stringify({model:e.model,input:[]})),a=s;for(let c of t){let d=Buffer.byteLength(JSON.stringify(c.trim()));if(s+d>n)throw new RangeError(`Embedding input exceeds request byte ceiling ${n}; lower search.embedding_corpus_max_characters or raise maxRequestBytes`);let l=i.length>0?1:0;(i.length>=r||a+l+d>n)&&(o.push(i),i=[],a=s),a+=d+(i.length>0?1:0),i.push(c)}return o.push(i),o}function Gn(e,t){if(!Number.isFinite(t)||t<=0||e.length<=t)return e;let r=Math.max(0,t-z.length);return`${e.slice(0,r)}${z}`.slice(0,t)}function er(e){let t=b(e).toLowerCase();return t.includes("timed out")||t.includes("timeout")}function Wn(e,t,r,n,o,i){let s=`Embedding batch ${t} failed after ${o} attempt(s): ${b(i)}`,a=`provider=${e.name} model=${e.model} batch_size=${r} timeout_ms=${n}`;return er(i)?`${s} (${a}; guidance=check provider availability or lower search.embedding_batch_size, raise search.embedding_timeout_ms, or run keyword search while semantic indexing catches up)`:`${s} (${a})`}function Kn(e){return e instanceof re?e.status===413?"payload_too_large":null:er(e)?"timeout":null}async function ot(e,t,r,n,o,i,s){let a=null;for(let c=0;c<=o;c+=1)try{s.requests+=1;let d=await Qt(e,t,{timeout_ms:n});return c>0&&i.push(`search_embedding_batch_retry_succeeded:batch=${r}:attempt=${c+1}:size=${t.length}`),s.successful_batches+=1,s.batch_size_histogram[t.length]=(s.batch_size_histogram[t.length]??0)+1,d}catch(d){a=d;let l=Kn(d);if(l!==null&&t.length>1){s.split_batches+=1;let p=Math.ceil(t.length/2),_=t.slice(0,p),f=t.slice(p);return i.push(`search_embedding_batch_split_after_${l}:batch=${r}:size=${t.length}:parts=${_.length}|${f.length}`),[...await ot(e,_,`${r}.1`,n,o,i,s),...await ot(e,f,`${r}.2`,n,o,i,s)]}if(c<o){s.retries+=1;let p=Math.min(1e3*2**c,8e3);await new Promise(_=>setTimeout(_,p))}}throw new Error(Wn(e,r,t.length,n,o+1,a))}async function it(e,t,r,n={}){if(r.length===0)return{vectors:[],warnings:[]};let o=performance.now(),i=n.maxRequestBytes??262144;if(!Number.isSafeInteger(i)||i<=0)throw new RangeError("maxRequestBytes must be a positive safe integer");let s={provider:e.name,model:e.model,max_request_bytes:i,limit_source:n.maxRequestBytes===void 0?"default":"caller",planned_batches:0,requests:0,successful_batches:0,split_batches:0,retries:0,batch_size_histogram:{},elapsed_ms:0,inputs_per_second:0},a=[],c=X(e.name,t.search.embedding_corpus_max_characters);c.warning&&a.push(c.warning);let d=Yn(t,c.maxCharacters,i),l=0,p=r.map(h=>{if(h.trim().length===0)throw new TypeError("Embedding inputs must be non-empty strings");let y=Gn(h,d.maxInputCharacters);return y.length<h.length&&(l+=1),y});l>0&&a.push(`search_embedding_input_truncated:count=${l}:max_characters=${d.maxInputCharacters}`);let _=Bn(e,p,d.batchSize,d.maxRequestBytes);s.planned_batches=_.length;let f=[],g=0;for(let h=0;h<_.length;h+=1){let y=_[h];n.onProgress?.({batch_index:h+1,batch_total:_.length,batch_size:y.length,completed_inputs:g,total_inputs:p.length,phase:"start"}),f.push(...await ot(e,y,String(h+1),d.timeoutMs,d.maxRetries,a,s)),g+=y.length,n.onProgress?.({batch_index:h+1,batch_total:_.length,batch_size:y.length,completed_inputs:g,total_inputs:p.length,phase:"complete"})}return s.elapsed_ms=Math.max(1,performance.now()-o),s.inputs_per_second=r.length*1e3/s.elapsed_ms,{vectors:f,warnings:a,receipt:s}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="88eb8555-e098-5279-801e-3b76d0dd0eae")}catch{}})();var F=`[^\\s/\\\\<>"'\\x60()\\[\\]{},;?=:#*]+`,S="[/\\\\]+",Xn="[\\p{L}\\p{N}._@-]+",U=Xn+"(?:"+S+F+")*",Ee="(?:(?:home|users)"+S+U+"|root"+S+U+")",Jn="[/\\\\]"+Ee,Qn="[/\\\\]{2,}"+Ee,Zn="/?[a-z]:"+S+"users"+S+U,eo=F+"(?: +"+F+")*",st="(?:"+eo+S+")?users"+S+U,to="[/\\\\]{2,}"+F+S+st,ro="(?:[a-z]:|volume\\{[a-f0-9-]+\\}|"+F+")",rr="[/\\\\]{2}[?.]"+S+"(?:unc"+S+F+S+st+"|"+ro+S+"users"+S+U+")",no="file:(?:"+rr+"|(?:[/\\\\](?![/\\\\])|[/\\\\]{3,}|[/\\\\]{2}localhost"+S+")(?:"+Ee+"|[a-z]:"+S+"users"+S+U+")|[/\\\\]{2}(?:[a-z]:"+S+"users"+S+U+"|"+F+S+"(?:"+Ee+"|"+st+")))",oo=new RegExp("(?:^|[^\\p{L}\\p{N}_./\\\\~])(?:"+Jn+"|"+Zn+"|"+no+")|(?:^|[^\\p{L}\\p{N}_:./\\\\~])(?:"+Qn+"|"+to+"|"+rr+")","giu"),tr=4,io=/%[a-f0-9]{2}|\\(?:u[a-f0-9]{4}|x[a-f0-9]{2}|\/)/iu,so=new TextDecoder("utf-8");function ao(e){return e.replace(/(?:%[a-f0-9]{2})+/giu,t=>so.decode(Uint8Array.from(t.matchAll(/%([a-f0-9]{2})/giu),r=>Number.parseInt(r[1],16)))).replace(/%(?![a-f0-9]{2})[a-z0-9]{0,2}/giu,"\uFFFD")}function co(e){return e.replace(/\\+(?:u([a-f0-9]{4})|x([a-f0-9]{2})|(\/))?/giu,(t,r,n,o)=>{let i=r??n;return i===void 0?o??t:String.fromCharCode(Number.parseInt(i,16))})}function lo(e){return e.normalize("NFKC").replace(/[\p{Bidi_Control}\u200b-\u200f\u2060-\u206f\ufeff]/gu,"").replace(/[\u2215\u2044]/gu,"/").replace(/[\u043e\u041e]/gu,"o").replace(/[\u0455\u0405]/gu,"s")}function uo(e,t){for(let[r,n]of[["percent_decode",ao],["json_unescape",co],["unicode_fold",lo]]){let o=n(e);o!==e&&!t.includes(r)&&t.push(r),e=o}return e}function*mo(e,t,r){let n=e,o=[];for(let i=0;i<tr;i+=1){let s=n;if(n=uo(n,o),!r){t.lastIndex=0;for(let a of n.matchAll(t))r=!0,yield{index:0,normalizations:[...o]}}if(n===s)break;i===tr-1&&io.test(n)&&(yield{index:0,normalizations:[...o],normalization_incomplete:!0})}}function*fo(e,t){let r=0;for(let n of e.split(`
2
2
  `)){t.lastIndex=0;let o=!1;for(let i of n.matchAll(t))o=!0,yield{index:r+i.index};for(let i of mo(n,t,o))yield{...i,index:r};r+=n.length+1}}var nr=[{name:"private-key",mutationRule:"private_key",regex:/-----BEGIN [A-Z0-9 ]*PRIVATE KEY-----/g},{name:"github-token",mutationRule:"github_token",regex:/\b(?:gh[opsru]_[A-Za-z0-9]{20,}|github_pat_[A-Za-z0-9_]{20,})\b/g},{name:"npm-token",mutationRule:"npm_token",regex:/\bnpm_[A-Za-z0-9]{20,}\b/g},{name:"aws-access-key",mutationRule:"aws_access_key",regex:/\b(?:AKIA|ASIA)[0-9A-Z]{16}\b/g},{name:"google-api-key",mutationRule:"google_api_key",regex:/\bAIza[0-9A-Za-z_-]{35}\b/g},{name:"slack-token",mutationRule:"slack_token",regex:/\bxox[baprs]-[A-Za-z0-9-]{10,}\b/g},{name:"anthropic-api-key",mutationRule:"anthropic_api_key",regex:/\bsk-ant-[A-Za-z0-9_-]{20,}\b/g},{name:"openai-api-key",mutationRule:"openai_api_key",regex:/\bsk-(?!ant-)[A-Za-z0-9_-]{20,}\b/g},{name:"gitlab-token",mutationRule:"gitlab_token",regex:/\bglpat-[A-Za-z0-9_.-]{20,}\b/g},{name:"jwt-like-token",mutationRule:"jwt_like_token",regex:/\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\b/g},{name:"npm-auth-token-assignment",mutationRule:"npm_auth_token_assignment",regex:/_authToken\s*=\s*\S+/g},{name:"sentry-user-token",mutationRule:"sentry_user_token",regex:/\bsntryu_[A-Za-z0-9]{20,}\b/g},{name:"sentry-org-token",mutationRule:"sentry_org_token",regex:/\bsntrys_[A-Za-z0-9_-]{20,}\b/g},{name:"private-ip",mutationRule:"private_ip",regex:/\b(?:10\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)|172\.(?:1[6-9]|2\d|3[01])\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)|192\.168\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d))\b/g},{name:"private-ssh-target",mutationRule:"private_ssh_target",regex:/\b(?:ssh|scp|rsync)\s+[A-Za-z0-9._-]+@(?:10\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)|172\.(?:1[6-9]|2\d|3[01])\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)|192\.168\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d))\b/g},{name:"sshpass-inline-password",mutationRule:"sshpass_inline_password",regex:/\bsshpass\s+-p\s+["'][^"']{6,}["']/g},{name:"password-assignment",mutationRule:"password_assignment",regex:/\b(?:password|passphrase)\s*[:=]\s*(?:(?!<|\$\{|\$\(|config\.auth\.password\s*(?:\|\|\s*(?:''|"")|\?\s*unescape\(encodeURIComponent\(config\.auth\.password\)\)\s*:\s*(?:''|""))(?=[ \t]*(?:\/\*(?:[^*]|\*(?!\/))*\*\/[ \t]*)*(?:;|$|\/\/[^\r\n\u2028\u2029]*(?:\r\n)?$)))[A-Za-z0-9!@#$%^&*._+\-=]{8,}|"(?!<|\$\{|\$\()[^"]{8,}"|'(?!<|\$\{|\$\()[^']{8,}')/gi},{name:"absolute-home-path",mutationRule:"absolute_home_path",regex:oo,excludeFiles:/^(?:tests\/|examples\/)/},{name:"user-at-private-host",mutationRule:"user_at_private_host",regex:/\b[A-Za-z0-9._-]+@(?:10\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)|172\.(?:1[6-9]|2\d|3[01])\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)|192\.168\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d))\b/g,excludeFiles:/^(?:tests\/|examples\/)/},{name:"high-entropy-assignment",mutationRule:"high_entropy_assignment",regex:/\b(?:token|secret|password|passwd|api[_-]?key)\s*[:=]\s*["']?([A-Za-z0-9+/=_-]{24,})/gi,mutationOnlyReason:"Generic assignments in source code are not credentials; preserve the existing mutation heuristic without treating source identifiers as secrets.",minimumEntropy:3.5}];function*or(e,t){if(e.mutationRule==="absolute_home_path"){yield*fo(t,e.regex);return}e.regex.lastIndex=0;for(let r of t.matchAll(e.regex))po(e,r)&&(yield{index:r.index})}function po(e,t){if(e.minimumEntropy===void 0)return!0;let r=t[1],n=new Map;for(let i of r)n.set(i,(n.get(i)??0)+1);let o=0;for(let i of n.values()){let s=i/r.length;o-=s*Math.log2(s)}return o>=e.minimumEntropy}(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]="d6059407-bf03-5ae8-8b01-e3e7c5b28030")}catch{}})();var _o=[{action:"append",history_scope:"item"},{action:"claim",history_scope:"item"},{action:"close",history_scope:"item"},{action:"close-many",history_scope:"item"},{action:"close-task",history_scope:"item"},{action:"comments",history_scope:"conditional"},{action:"config",history_scope:"conditional"},{action:"copy",history_scope:"item"},{action:"create",history_scope:"item"},{action:"delete",history_scope:"item"},{action:"deps",history_scope:"conditional"},{action:"discover",history_scope:"item"},{action:"docs",history_scope:"conditional"},{action:"files",history_scope:"conditional"},{action:"focus",history_scope:"conditional"},{action:"gc",history_scope:"conditional"},{action:"history-compact",history_scope:"history"},{action:"history-author-acknowledge",history_scope:"workspace"},{action:"history-redact",history_scope:"history"},{action:"history-repair",history_scope:"history"},{action:"init",history_scope:"workspace"},{action:"install",history_scope:"conditional"},{action:"learnings",history_scope:"conditional"},{action:"notes",history_scope:"conditional"},{action:"package",history_scope:"conditional"},{action:"pause-task",history_scope:"item"},{action:"plan",history_scope:"conditional"},{action:"profile",history_scope:"conditional"},{action:"release",history_scope:"item"},{action:"restore",history_scope:"item"},{action:"schema",history_scope:"conditional"},{action:"start-task",history_scope:"item"},{action:"templates",history_scope:"conditional"},{action:"test",history_scope:"conditional"},{action:"test-all",history_scope:"conditional"},{action:"update",history_scope:"item"},{action:"update-many",history_scope:"item"},{action:"upgrade",history_scope:"conditional"}],ct=new Map(_o.map(e=>[e.action,e]));function at(e,t="$",r=new WeakSet){return typeof e=="string"?[{path:t,value:e}]:typeof e!="object"||e===null?[]:r.has(e)?[]:(r.add(e),Array.isArray(e)?e.flatMap((n,o)=>at(n,`${t}[${o}]`,r)):Object.entries(e).flatMap(([n,o])=>at(o,`${t}.${n}`,r)))}function ho(e,t){let r=or(e,t),n=r.next().value;if(!n||e.mutationRule!=="absolute_home_path"||n.normalization_incomplete)return n;for(let o of r)if(o.normalization_incomplete)return{...n,normalizations:[...new Set([n.normalizations,o.normalizations].flatMap(i=>i??[]))],normalization_incomplete:!0};return n}function ir(e){let t=[];for(let r of at(e))for(let n of nr){let o=ho(n,r.value);if(o){let i={rule:n.mutationRule,path:r.path};o.normalizations&&(i.normalizations=o.normalizations),o.normalization_incomplete&&(i.normalization_incomplete=!0),t.push(i)}}return t.filter((r,n,o)=>o.findIndex(i=>i.rule===r.rule&&i.path===r.path)===n)}function go(e){let t=e.author.trim()||"unknown";if(e.settings.require_attributed_author&&t.toLowerCase()==="unknown")throw new m("Mutation author is required by workspace policy.",u.USAGE,{code:"mutation_author_required",required:"Pass --author <id>, set PM_AUTHOR, or configure author_default.",nextSteps:["Retry with --author <stable-agent-id>.","Set PM_AUTHOR for this agent session."]});if(e.settings.secret_guard==="off")return{author:t,findings:[],warnings:[],override_applied:!1};let r;try{r=ir(e.payload)}catch{return{author:t,findings:[],warnings:["secret_guard_scan_failed_open"],override_applied:!1}}if(r.length===0)return{author:t,findings:r,warnings:[],override_applied:!1};let n=[...new Set(r.map(o=>o.rule))].sort().join(",");if(e.settings.secret_guard==="block"&&e.force!==!0)throw new m(`Mutation blocked by secret guard (${n}). No detected value was logged.`,u.CONFLICT,{code:"mutation_secret_guard_blocked",required:"Remove the credential-shaped content or retry with --force after explicit review.",nextSteps:["Replace the value with a secret-manager reference.","Use pm history-redact if equivalent content already entered history."],recovery:{recovery_mode:"compact",attempted_command:"pm <mutation> [REDACTED]",normalized_args:["[REDACTED]"],suggested_retry:"Remove credential-shaped content, then retry the mutation."}});return{author:t,findings:r,warnings:[`secret_guard_detected:${r.length}:rules=${n}`,...e.settings.secret_guard==="block"&&e.force===!0?["secret_guard_force_override"]:[]],override_applied:e.settings.secret_guard==="block"&&e.force===!0}}function yo(e){return ct.has(e.trim().toLowerCase())}function Eo(){return[...ct.keys()].sort((e,t)=>e.localeCompare(t))}function lc(e){return ct.get(e.trim().toLowerCase())}(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]="5767332d-8094-55cd-96e9-47c5d20cd7df")}catch{}})();var wo=/\b([a-z][a-z0-9]*)-(\d+)(?:-[a-z0-9]+)*\b/giu,bo=/^(?:utf|iso|sha|tls|http|covid|match)$/iu;function dt(e){return e.trim().toLowerCase().replace(/\s+/g," ")}function ar(e){return[...new Set(dt(e).match(/[\p{L}\p{N}]+/gu)??[])]}function sr(e){let t=dt(e);return{normalized:t,tokens:ar(t),issueCodes:[...new Set([...e.matchAll(wo)].filter(r=>{let n=r[1],o=r.index,i=e.slice(o+r[0].length);return!bo.test(n)&&(n===n.toUpperCase()||n.length<=2||o===0&&/^\s*(?::|—|–|\])/u.test(i))}).map(r=>r[0].toLowerCase()))]}}function So(e,t){return To(sr(e),sr(t))}function To(e,t){if(e.normalized===t.normalized)return{score:1,reason:"exact_title"};let r=new Set(e.issueCodes);return t.issueCodes.some(n=>r.has(n))?{score:.99,reason:"issue_code"}:{score:ue(e.tokens,t.tokens),reason:"title_token_jaccard"}}import vo from"node:path";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="a7cd1d62-16fe-5e5b-b382-64335fc5e403")}catch{}})();function we(e){return(e??"in_progress").trim().toLowerCase().replaceAll("-","_")}function Ao(e,t){return[e.updated_at,t].map(r=>({value:r,time:Date.parse(r??"")})).filter(r=>typeof r.value=="string"&&Number.isFinite(r.time)).sort((r,n)=>n.time-r.time)[0]?.value??e.updated_at}function cr(e,t){let r=Math.max(1,Math.trunc(t.threshold_hours)),n=(t.now??new Date).getTime(),o=we(t.in_progress_status),i=[];for(let s of e){if(we(String(s.status))!==o||(s.assignee?.trim().length??0)>0)continue;let a=Ao(s,t.last_history_activity?.(s)),c=Date.parse(a);if(!Number.isFinite(c))continue;let d=Math.max(0,Math.floor((n-c)/36e5));d>=r&&i.push({id:s.id,last_activity_at:a,age_hours:d})}return i.sort((s,a)=>a.age_hours-s.age_hours||s.id.localeCompare(a.id)),{threshold_hours:r,count:i.length,items:i,remediation:"Claim active work with `pm claim <id>` or return abandoned work to open with `pm update <id> --status open`."}}async function Io(e,t,r){let n=new Map;return await Promise.all(t.filter(o=>we(String(o.status))===we(r.in_progress_status)&&(o.assignee?.trim().length??0)===0).map(async o=>{let i;try{i=await Je(vo.join(e,"history",`${o.id}.jsonl`),o.id)}catch{return}let s=i.map(a=>a.ts).filter(a=>Number.isFinite(Date.parse(a))).sort((a,c)=>Date.parse(c)-Date.parse(a))[0];s&&n.set(o.id,s)})),cr(t,{...r,last_history_activity:o=>n.get(o.id)})}(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]="42b217a3-31c0-561a-b7cb-b1a584b2edd5")}catch{}})();var Co=new Set(["rename-type","rename-field","remap-status",...Ut]);function xo(e,t){if(t&&!Co.has(e))throw new m(`schema ${e} does not support --dry-run. Preview is supported for rename-type, rename-field, remap-status and workflow-policy actions. Remove --dry-run only when you intend to apply changes.`,u.USAGE,{code:"invalid_argument_value",examples:["pm schema rename-type Spike --to Experiment --dry-run"]})}(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]="4ce8635f-ea61-5443-abfc-092219a82396")}catch{}})();var O="-",lr=new Set(["actual_result","body","cmd","command","customer_impact","description","environment","expected_result","impact","location","message","note","outcome","repro_steps","resolution","text","title","unblock_note","value","why_now"]);function ur(e,t){if(e.startsWith("```")||e.includes(`
3
3
  `))return!0;let r=t.map(n=>n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|");return new RegExp(`^(?:[-*+]\\s+)?(?:${r})\\s*[:=]`,"i").test(e)}function mr(e){let t=e.trim();if(t==="")return[];let r=(Do(t)??t.split(",")).map(n=>n.trim()).filter(Boolean).map(n=>n.toLowerCase());return Array.from(new Set(r)).sort((n,o)=>n.localeCompare(o))}function fr(e){if(!Array.isArray(e)||e.length===0)return[];let t=[];for(let r of e)if(typeof r=="string")for(let n of mr(r))t.push(n);return Array.from(new Set(t)).sort((r,n)=>r.localeCompare(n))}function pr(e){return Array.isArray(e)?e.filter(t=>typeof t=="string").map(t=>t.trim().toLowerCase()).filter(Boolean):[]}function Ro(e){return typeof e!="string"?[]:e.split(";").map(t=>t.trim()).filter(Boolean)}function ko(e,t,r){let n=e.map(s=>s.trim()).filter(Boolean);for(let s of t??[]){let a=s.trim();if(a.includes(";"))throw new m('Acceptance criteria added with --add-ac cannot contain ";" because semicolons delimit stored criteria',u.USAGE,{code:"acceptance_criteria_semicolon_forbidden",required:"Pass one semicolon-free criterion per --add-ac value",why:"A semicolon inside one criterion would be re-read as multiple criteria",nextSteps:["Split the text into repeated --add-ac values, or replace the semicolon with punctuation that is not the storage delimiter"]});a.length>0&&!n.includes(a)&&n.push(a)}let o=[],i=n;for(let s of r??[]){let a=s.trim();if(a.length!==0){if(!i.includes(a)){o.push(a);continue}i=i.filter(c=>c!==a)}}return{criteria:i,unmatchedRemovals:o}}function Lo(e,t){let r=pr(e);if(!t||t.length===0)return Array.from(new Set(r)).sort((o,i)=>o.localeCompare(i));let n=new Set(r);for(let o of fr(t))n.add(o);return Array.from(n).sort((o,i)=>o.localeCompare(i))}function Oo(e,t){let r=Array.from(new Set(pr(e))).sort((o,i)=>o.localeCompare(i));if(!t||t.length===0)return r;let n=new Set(fr(t));return n.size===0?r:r.filter(o=>!n.has(o))}function Do(e){if(!e.startsWith("["))return null;let t;try{t=JSON.parse(e)}catch{return null}return t.map(r=>typeof r=="string"||typeof r=="number"||typeof r=="boolean"?String(r):"").filter(r=>r.length>0)}function lt(e){return e.replace(/\r\n/g,`
4
4
  `)}function _r(e){let t=lt(e).trim();if(!t.startsWith("```"))return e;let r=t.split(`
@@ -19,4 +19,4 @@ ${i}`;continue}return null}return r}function gr(e,t){let r=_r(e).trim();if(!r)th
19
19
  `)){let n=r.trim();if(n.length!==0)try{let o=JSON.parse(n);o&&typeof o=="object"&&typeof o.endpoint=="string"&&o.endpoint.trim().length>0&&"payload"in o&&typeof o.attempts=="number"&&Number.isFinite(o.attempts)&&((typeof o.id!="string"||o.id.length===0)&&(o.id=La(o)),t.push(o))}catch{}}return t}function Oa(e,t){if(typeof e.enqueued_at!="string"||e.enqueued_at.trim().length===0)return!1;let r=Date.parse(e.enqueued_at);return Number.isNaN(r)?!1:r<t}function Pt(e,t){let r=En(t),n=[],o=0;for(let i of e){if(JSON.stringify(i).length>rn||Oa(i,r)||i.attempts>=nn){o+=1;continue}n.push(i)}if(n.length>Kr){let i=n.length-Kr;return o+=i,{entries:n.slice(i),prunedCount:o}}return{entries:n,prunedCount:o}}async function Da(e,t){let r=t.map(o=>JSON.stringify(o)).join(`
20
20
  `),n=r.length>0?`${r}
21
21
  `:"";for(let o=0;;o+=1)try{await v($e(e),n,{createParentDirectories:!H(process.env[j])});return}catch(i){let s=on[o];if(s===void 0||!bn(i))throw i;await Sn(s)}}async function Zr(e,t,r,n){return ce(async()=>{let o=await T($e(e)),i=o===null?[]:Nt(o),s=[];for(let c of i){if(r.has(c.id))continue;let d=n.get(c.id);s.push(d?{...c,attempts:d.attempts,next_attempt_after:d.next_attempt_after}:c)}let{entries:a}=Pt(s,t);return await Da(e,a),a.length},e)}async function Ma(e,t){let r=await T($e(e));if(r===null||r.trim().length===0){await k(e,{pending_otel_spans:0});return}let n=Nt(r),{entries:o,prunedCount:i}=Pt(n,t),s=o.filter(g=>Mt(g.next_attempt_after)).slice(0,na);if(s.length===0){let g=i>0?await Zr(e,t,new Set,new Map):o.length;await k(e,{pending_otel_spans:g});return}let a=M(),c=new Set,d=new Map,l=0,p;await Promise.all(s.map(async g=>{try{let h=await _n(g.endpoint,{"content-type":"application/json"},JSON.stringify(g.payload));if(h<200||h>=300)throw new Error(`local_otel_export_http_${h}`);c.add(g.id),l+=1}catch(h){p=h instanceof Error?Lt(h.message,"redacted"):"local_otel_export_failed";let y=g.attempts+1;d.set(g.id,{attempts:y,next_attempt_after:gn(y)})}}));let _=await Zr(e,t,c,d),f={pending_otel_spans:_,last_otel_attempt_at:a};l>0&&(f.last_otel_success_at=a),p!==void 0?(f.last_otel_failure_at=a,f.last_otel_failure_error=p):_===0&&(f.last_otel_failure_at=void 0,f.last_otel_failure_error=void 0),await k(e,f)}async function Na(e,t,r){try{await za(e,t,r)}catch{}try{await Ma(e,r)}catch{}}async function Pa(e,t=ua){try{let r=ba(e),n=await Js(r,{withFileTypes:!0}),o=Date.now()-Math.max(0,t);await Promise.all(n.filter(i=>i.isFile()&&/^\.events\.jsonl\.\d+\.\d+\.[a-f0-9]+\.tmp$/.test(i.name)).map(async i=>{let s=I.join(r,i.name);(await tn(s)).mtimeMs<o&&await Dt(s,{force:!0})}))}catch{}}async function ce(e,t=ee(process.cwd()),r=5e3){let n=Jr.catch(()=>{}).then(()=>qt(async()=>{let o=await me(t,"telemetry-queue",60,"telemetry",!1,!1,r,{createParentDirectories:!H(process.env[j])});try{return Gt(t),await e()}finally{await o()}}));return Jr=n.catch(()=>{}),n}async function Fe(e){let t=await T(Pe(e));return t===null||t.trim().length===0?[]:hn(t)}async function kt(e,t,r){return ce(async()=>{let n=await Fe(e),{entries:o}=ze(n,r),i=o.filter(s=>!t.has(s.event.event_id));return await wn(e,i),i},e)}async function $a(e,t,r,n){return ce(async()=>{let o=await Fe(e),{entries:i}=ze(o,n),s=i.map(a=>{if(!t.has(a.event.event_id))return a;let c=a.attempts+1;return{...a,attempts:c,last_attempt_at:r,next_attempt_after:gn(c)}});return await wn(e,s),s},e)}async function za(e,t,r){await Pa(e);let n=t.trim();if(n.length===0)return;let o=await T(Pe(e));if(o===null||o.trim().length===0){await k(e,{endpoint:n,queue_entries:0});return}let i=hn(o);if(i.length===0){await k(e,{endpoint:n,queue_entries:0});return}let{entries:s,prunedCount:a}=ze(i,r);if(s.length===0){let f=await kt(e,new Set,r);await k(e,{endpoint:n,queue_entries:f.length});return}let c=s.filter(f=>yn(f)).slice(0,ia);if(c.length===0){let f=a>0?await kt(e,new Set,r):s;await k(e,{endpoint:n,queue_entries:f.length});return}let d=new Set(c.map(f=>f.event.event_id)),l=M(),p={"content-type":"application/json"},_=process.env.PM_TELEMETRY_INGEST_KEY?.trim();_&&(p["x-pm-telemetry-key"]=_);try{let f=await _n(n,p,JSON.stringify({schema_version:oa,events:c.map(g=>g.event)}));if(f<200||f>=300)throw new Error(`telemetry_flush_http_${f}`)}catch(f){let g=await $a(e,d,l,r),h=f instanceof Error?Lt(f.message,"redacted"):"telemetry_flush_failed";await k(e,{endpoint:n,queue_entries:g.length,last_attempted_flush_at:l,last_failed_flush_at:l,last_failed_flush_error:h});return}try{let f=await kt(e,d,r);await k(e,{endpoint:n,queue_entries:f.length,last_attempted_flush_at:l,last_successful_flush_at:l,last_failed_flush_at:void 0,last_failed_flush_error:void 0})}catch(f){let g=f instanceof Error?Lt(f.message,"redacted"):"telemetry_flush_failed",h=await Fe(e).catch(()=>s);await k(e,{endpoint:n,queue_entries:h.length,last_attempted_flush_at:l,last_failed_flush_at:l,last_failed_flush_error:g})}}async function Fa(e){let t=cn(e);H(process.env[j])||await Rt(I.dirname(t),{recursive:!0});try{return await Rt(t),!0}catch(r){if(typeof r!="object"||r===null||!("code"in r)||r.code!=="EEXIST")throw r}try{let r=await tn(t);return Date.now()-r.mtimeMs<ma?!1:(await Dt(t,{recursive:!0,force:!0}),await Rt(t),!0)}catch{return!1}}function Ua(e){try{Xs(e,{recursive:!0,force:!0})}catch{}}function Va(e){Ua(Sa(e))}async function qa(e,t,r){let n=await Fa(e);if(Va(e),!n)return!1;try{await Na(e,t,r)}finally{try{await Dt(cn(e),{recursive:!0,force:!0})}catch{}}return!0}async function en(e,t){let r=new Set;try{let{entries:n}=ze(await Fe(e),t);for(let o of n.filter(yn))r.add(`event:${o.event.event_id}`)}catch{}try{let n=await T($e(e));if(n!==null)for(let o of Pt(Nt(n),t).entries)Mt(o.next_attempt_after)&&r.add(`span:${o.id}`)}catch{}return r}async function qu(e=ee(process.cwd())){if(!ae().telemetry_disabled)try{await Qe(e,async()=>{let t=H(process.env[j]),r=!0;for(;r;){if(!(await te(e)).telemetry.enabled)return;let n=await ce(()=>Ra(e),e);if(!n)return;let o=t?await en(e,n.retentionDays):new Set;if(!await qa(e,n.endpoint,n.retentionDays)||!t)return;let i=await en(e,n.retentionDays);r=i.size>0&&(i.size!==o.size||[...i].some(s=>!o.has(s)))}},()=>H(process.env[j]))}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]="71950155-4b15-5dc0-8cf8-b980fb12cb4d")}catch{}})();export{Zc as a,ri as b,oi as c,si as d,ai as e,xo as f,ur as g,mr as h,Ro as i,ko as j,Lo as k,Oo as l,gr as m,Uo as n,vc as o,Vo as p,yr as q,jo as r,Ho as s,Ac as t,Yo as u,be as v,Ic as w,Se as x,Go as y,Wo as z,Oc as A,Er as B,Dc as C,Te as D,Mc as E,ei as F,td as G,ci as H,di as I,mt as J,ui as K,ft as L,mi as M,hd as N,pi as O,vr as P,_i as Q,hi as R,Ei as S,Td as T,Si as U,Rd as V,Ii as W,xi as X,An as Y,Ri as Z,ki as _,Ie as $,Zi as aa,Xa as ba,tt as ca,Qt as da,rt as ea,zn as fa,Fn as ga,Za as ha,Zt as ia,X as ja,nt as ka,it as la,St as ma,Qd as na,Tt as oa,Le as pa,Pr as qa,Oe as ra,vt as sa,At as ta,It as ua,Ct as va,qr as wa,jr as xa,El as ya,Me as za,ae as Aa,_o as Ba,ir as Ca,go as Da,yo as Ea,Eo as Fa,lc as Ga,dt as Ha,ar as Ia,sr as Ja,So as Ka,To as La,cr as Ma,Io as Na,Us as Oa,Hs as Pa,Bs as Qa,Gs as Ra,oa as Sa,nn as Ta,ce as Ua,qu as Va};
22
- //# sourceMappingURL=chunk-BL77VCRB.js.map
22
+ //# sourceMappingURL=chunk-YC6NCPLK.js.map
@@ -0,0 +1,2 @@
1
+ import{a as T}from"./chunk-AK2CI2GI.js";import{$a as C,H as D,Ua as $,Xa as U,cb as z}from"./chunk-NLZUI234.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="b4ece3e2-a6f1-57a8-b793-9073aa5ef200")}catch{}})();var F=["item","list","context","search","graph","history","workspace","package","ops","plan","contracts","help"],ue=["acknowledge","activate","add","adopt","adopt-all","catalog","compact","complete","create","deactivate","delete","describe","doctor","edit","explore","import","init","inspect","install","list","manage","migrate","mutate","read","redact","reload","remove","reopen","repair","restore","run","show","uninstall","upgrade","verify"];function s(e,a,l,t={}){return{name:e,required:l,variadic:t.variadic===!0,value_kind:a,polymorphic:t.polymorphic===!0}}function j(e){let a=e.replaceAll("-"," ");return`${a.charAt(0).toUpperCase()}${a.slice(1)}`}var g=s("id","item_id",!0),y=s("id","item_id",!1),A=s("text","string",!1),k=s("plan-id","item_id",!0),X=s("step","string",!0),_e=["--acceptance-criteria","--actual-result","--affected-version","--assignee","--blocked-by","--blocked-reason","--blocks","--body","--claim","--comment","--component","--confidence","--create-mode","--customer-impact","--deadline","--definition-of-ready","--description","--doc","--environment","--estimate","--event","--expected-result","--fixed-version","--file","--from-search","--goal","--harness","--impact","--learning","--message","--mode","--note","--objective","--order","--outcome","--parent","--priority","--rank","--related","--release","--reminder","--reporter","--repro-steps","--resolution","--resume-context","--reviewer","--risk","--scope","--severity","--sprint","--status","--step","--step-blocked-reason","--step-body","--step-evidence","--step-owner","--step-replacement","--step-status","--step-title","--tags","--template","--test","--title","--type-option","--unblock-note","--value","--why-now"],E=["--allow-multiple-active","--depends-on","--file","--force","--message","--step-blocked-reason","--step-body","--step-evidence","--step-owner","--step-status","--step-title","--test"],ve={"update-step":"Update one declared Plan step.","complete-step":"Complete one declared Plan step.","block-step":"Block one declared Plan step.","remove-step":"Remove one declared Plan step.",link:"Link one dependency to a declared Plan step.",unlink:"Unlink one dependency from a declared Plan step."},h=[{command:"plan create",parent:"plan",action:"create",slots:[s("title","string",!1,{polymorphic:!0})],accepted_flags:_e,description:"Create a Plan item and optionally seed its ordered steps.",example:'pm plan create --title "Refactor lock retry"'},{command:"plan show",parent:"plan",action:"show",slots:[k],accepted_flags:["--depth","--fields"],description:"Read one Plan item with a bounded plan projection.",example:"pm plan show pm-a1b2 --depth standard"},{command:"plan add-step",parent:"plan",action:"add-step",slots:[k],accepted_flags:E,description:"Append one ordered step to a Plan item.",example:'pm plan add-step pm-a1b2 --step-title "Run tests"'},...Object.entries(ve).map(([e,a])=>({command:`plan ${e}`,parent:"plan",action:e,slots:[k,X],accepted_flags:E,description:a,example:`pm plan ${e} pm-a1b2 plan-step-001`})),{command:"plan reorder-step",parent:"plan",action:"reorder-step",slots:[k,X,s("new-order","integer",!0)],accepted_flags:["--force","--message"],description:"Move one Plan step to a declared integer order.",example:"pm plan reorder-step pm-a1b2 plan-step-001 2"},...["decision","discovery","validation","resume","approve","materialize"].map(e=>({command:`plan ${e}`,parent:"plan",action:e,slots:[k],accepted_flags:E,description:`${j(e)} for one Plan item.`,example:`pm plan ${e} pm-a1b2`})),...["list","show","put","remove"].map(e=>({command:`assurance ${e}`,parent:"assurance",action:e,slots:[s("kind","string",!0),...e==="list"?[]:[s("id","string",!0)]],accepted_flags:e==="put"?["--author","--definition","--message"]:e==="remove"?["--author","--message"]:[],description:`${j(e)} assurance declarations by kind.`,example:e==="list"?"pm assurance list measurement":`pm assurance ${e} measurement example-id`})),{command:"assurance run",parent:"assurance",action:"run",slots:[s("gate-id","string",!0)],accepted_flags:["--dry-run","--trigger","--tree"],description:"Evaluate one assurance gate for a lifecycle trigger.",example:"pm assurance run tracker-context-quality --trigger ci --dry-run"},{command:"assurance verdicts",parent:"assurance",action:"verdicts",slots:[s("gate-id","string",!1)],accepted_flags:["--gate","--limit"],description:"List bounded assurance verdict history.",example:"pm assurance verdicts --limit 20"},...["presets","apply"].map(e=>({command:`assurance ${e}`,parent:"assurance",action:e,slots:[s("preset","string",e==="apply")],accepted_flags:["--author","--message","--owner"],description:e==="apply"?"Apply one assurance adoption preset.":"List available assurance adoption presets.",example:e==="apply"?"pm assurance apply software-delivery --owner <pm-item-id>":"pm assurance presets"})),{command:"assurance derive",parent:"assurance",action:"derive",slots:[],accepted_flags:["--apply","--author","--message","--owner"],description:"Derive assurance proposals from current project context.",example:"pm assurance derive --owner pm-a1b2"},{command:"assurance promote",parent:"assurance",action:"promote",slots:[s("assertion-id","string",!0)],accepted_flags:["--author","--enforcement","--message"],description:"Promote one assertion into a warning or blocking gate.",example:"pm assurance promote assertion-id --enforcement warn"},{command:"assurance risk",parent:"assurance",action:"risk",slots:[],accepted_flags:["--definition"],description:"Analyze bounded defect-recurrence risk for a proposed change.",example:`pm assurance risk --definition '{"policy":{"version":1,"evidence_epoch":"2026-01-01T00:00:00.000Z","families":[]},"change":{"files":[]}}'`},{command:"assurance lineages",parent:"assurance",action:"lineages",slots:[],accepted_flags:["--definition"],description:"Measure all recorded recurrence lineages with bounded evidence rows.",example:`pm assurance lineages --definition '{"policy":{"version":1,"evidence_epoch":"2026-01-01T00:00:00.000Z","families":[]}}'`},{command:"workspace position",parent:"workspace",action:"position",slots:[],accepted_flags:[],description:"Read bounded merge-fence, receipt, history-drift, and next-action readiness.",example:"pm workspace position"},{command:"workspace snapshot create",parent:"workspace snapshot",action:"create",slots:[s("name","string",!1)],accepted_flags:[],description:"Capture authoritative tracker state as an immutable snapshot.",example:"pm workspace snapshot create before-migration"},{command:"workspace snapshot list",parent:"workspace snapshot",action:"list",slots:[],accepted_flags:[],description:"List immutable workspace snapshots and named references.",example:"pm workspace snapshot list"},{command:"workspace snapshot inspect",parent:"workspace snapshot",action:"inspect",slots:[s("target","string",!0)],accepted_flags:[],description:"Inspect one workspace snapshot target.",example:"pm workspace snapshot inspect before-migration"},{command:"workspace snapshot restore",parent:"workspace snapshot",action:"restore",slots:[s("target","string",!0)],accepted_flags:["--author","--dry-run","--force","--message"],description:"Restore an immutable workspace snapshot with explicit recovery controls.",example:"pm workspace snapshot restore before-migration --dry-run"},{command:"workspace snapshot delete",parent:"workspace snapshot",action:"delete",slots:[s("target","string",!0)],accepted_flags:[],description:"Delete one workspace snapshot target.",example:"pm workspace snapshot delete before-migration"}],he=[...h].sort((e,a)=>a.command.length-e.command.length),Y=new Map([["append",[g,A]],["assurance",[s("action","action",!0),s("kind","string",!1),s("id","string",!1)]],["beads import",[s("file","string",!1)]],["cal",[s("view","string",!1,{polymorphic:!0})]],["calendar",[s("view","string",!1,{polymorphic:!0})]],["changelog export",[s("file","string",!1)]],["changelog milestone create",[s("name","string",!0)]],["claim",[y]],["close",[g,A]],["close-task",[g,s("reason","string",!1)]],["comments",[g,A]],["completion",[s("shell","string",!1)]],["config",[s("scope","string",!1,{polymorphic:!0}),s("action","action",!1),s("key","string",!1),s("value","string",!1,{polymorphic:!0})]],["copy",[g]],["create",[s("type-or-title","string",!1,{polymorphic:!0}),s("title","string",!1)]],["delete",[g]],["deps",[g]],["docs",[g]],["event",[s("title","string",!0)]],["files",[g]],["files discover",[g]],["files lookup",[s("paths","string",!0,{variadic:!0})]],["focus",[y]],["get",[g]],["graph",[s("subcommand","action",!0),y,s("target","item_id",!1)]],["guide",[s("topic","string",!1)]],["history",[g]],["history-compact",[y]],["history-redact",[g]],["history-repair",[y]],["init",[s("prefix-or-path","string",!1,{polymorphic:!0})]],["item complete",[g,s("reason","string",!1)]],["item reopen",[g,s("reason","string",!0)]],["learnings",[g,A]],["meet",[s("title","string",!0)]],["merge",[s("subcommand","action",!0),s("artifact","string",!1),s("base","string",!1),s("ours","string",!1),s("theirs","string",!1)]],["notes",[g,A]],["package",[s("target","string",!1,{polymorphic:!0})]],["package list",[]],["package inventory",[s("name","string",!1)]],["package scaffold",[s("target","string",!0)]],["package upgrade",[s("target","string",!1)]],["packages",[s("target","string",!1,{polymorphic:!0})]],["packages list",[]],["packages inventory",[s("name","string",!1)]],["packages scaffold",[s("target","string",!0)]],["packages upgrade",[s("target","string",!1)]],["pause-task",[g]],["plan",[s("subcommand","action",!0),s("id","item_id",!1,{polymorphic:!0}),s("step","string",!1),s("new-order","integer",!1)]],["profile",[s("subcommand","action",!0),s("name","string",!1)]],["release",[g]],["remind",[s("title","string",!0)]],["restore",[g,s("target","string",!0)]],["schema",[s("subcommand","action",!0),s("name","string",!1)]],["search-advanced",[s("keywords","string",!0,{variadic:!0})]],["search",[s("keywords","string",!0,{variadic:!0})]],["start-task",[g]],["templates save",[s("name","string",!0)]],["templates show",[s("name","string",!0)]],["telemetry",[s("namespace-or-subcommand","action",!1,{polymorphic:!0}),s("subcommand","action",!1)]],["test",[g]],["test-runs-worker",[s("runId","string",!0)]],["update",[g]],["workspace snapshot",[s("action","action",!0),s("target","string",!1)]],...["activate","adopt","deactivate","init","uninstall"].flatMap(e=>["extension","package","packages"].map(a=>[`${a} ${e}`,[s("target","string",!0)]])),...["describe"].flatMap(e=>["extension","package","packages"].map(a=>[`${a} ${e}`,[s("target","string",!1)]])),...["install"].flatMap(e=>["extension","package","packages"].map(a=>[`${a} ${e}`,[s("targets","string",!1,{variadic:!0})]])),["vcs abandon",[g]],["vcs create",[s("title","string",!0)]],["vcs merge",[g]],["vcs propose",[g]],["vcs ref-create",[s("name","string",!0)]],["vcs show",[g]]]);function v(e){return e.trim().toLowerCase().replace(/\s+/gu," ")}function Ka(e){let a=v(e),l=R.find(i=>i.command===a);if(l)return l;let t=z(a)?.canonical;if(t)return R.find(i=>i.command===t)}function Te(e){let a=v(e);return he.find(l=>l.command===a||a.startsWith(`${l.command} `))}function Va(e){return`Applicable flags: ${e.length>0?e.join(", "):"none"}.`}function n(e,a,l,t,i){return i.map(f=>({command:f,noun:e,target:a,disposition:l,owner:t}))}var N=[...n("item","item","target_noun","pm-pbyu",["item","item complete","item mutate","item reopen"]),...n("item","item","consolidation","pm-yql1",["append","close-many","close-task","comments","copy","delete","deps","docs","files","learnings","notes","pause-task","start-task","test","update-many"]),...["claim","close","create","get","release","update"].map(e=>({command:e,noun:"item",target:e,disposition:"keep_as_is",owner:"pm-pbyu",reason:"Permanent high-frequency item operations retain concise root spellings under the accepted hot-path grammar policy."})),...n("item","item files","target_noun","pm-yql1",["files discover","files lookup","item files discover","item files lookup"]),...n("item","item test worker","consolidation","pm-lp4j",["test-runs-worker"]),...n("list","list","target_noun","pm-pfqi",["list"]),...n("list","list --group-by","consolidation","pm-xkgq",["aggregate"]),...n("context","context","target_noun","pm-pbyu",["context"]),...n("context","context","consolidation","pm-kcs4",["ctx","focus","next"]),...n("context","context next","consolidation","pm-kcs4",["ctx next"]),...n("context","context focus","consolidation","pm-kcs4",["ctx focus"]),...n("search","search","target_noun","pm-pbyu",["search"]),...n("search","search","package_owned","package:search-advanced",["reindex","search-advanced"]),...n("item","item duplicates","consolidation","pm-fmy9ih",["duplicates"]),...n("item","item duplicates","package_owned","pm-fmy9ih",["dedupe-audit","dedupe-merge","comments-audit"]),...n("graph","graph","target_noun","pm-pbyu",["graph"]),...n("history","history","target_noun","pm-pbyu",["history"]),...n("history","history attest","target_noun","pm-3z0k",["history attest"]),...n("history","history attest","consolidation","pm-3z0k",["history-attest"]),...$.flatMap(({alias:e,canonical:a})=>[...n("history",a,"target_noun","pm-tqel",[a]),...n("history",a,"consolidation","pm-tqel",[e])]),...n("history","history","consolidation","pm-tqel",["events","merge"]),...n("history","history acknowledge","consolidation","pm-djyvbk",["history-author-acknowledge"]),...n("history","history","package_owned","package:builtin-vcs-exemplar",["vcs abandon","vcs create","vcs log","vcs merge","vcs propose","vcs ref-create","vcs show"]),...n("workspace","workspace","target_noun","pm-pbyu",["workspace","workspace position","workspace snapshot","workspace snapshot create","workspace snapshot delete","workspace snapshot inspect","workspace snapshot list","workspace snapshot restore"]),...n("workspace","workspace init","consolidation","pm-npr3",["init"]),...n("package","package","target_noun","pm-pbyu",["package","package activate","package adopt","package adopt-all","package catalog","package deactivate","package describe","package doctor","package explore","package init","package install","package inventory","package list","package manage","package migrate","package reload","package scaffold","package uninstall","package upgrade"]),...n("package","package","consolidation","pm-tnud",["extension activate","extension adopt","extension adopt-all","extension catalog","extension deactivate","extension describe","extension doctor","extension explore","extension init","extension install","extension manage","extension migrate","extension reload","extension uninstall","packages","packages activate","packages adopt","packages adopt-all","packages catalog","packages deactivate","packages describe","packages doctor","packages explore","packages init","packages install","packages inventory","packages list","packages manage","packages migrate","packages reload","packages scaffold","packages uninstall","packages upgrade"]),...n("package","package","package_owned","package:beads",["beads import"]),...n("package","package","package_owned","package:pm-changelog",["changelog audit","changelog contracts","changelog export","changelog generate","changelog milestone create","changelog upgrades"]),...n("package","package calendar","package_owned","pm-o3fh",["cal","calendar","event","meet","remind"]),...n("ops","ops","target_noun","pm-6apl",["ops"]),...n("ops","ops normalize","package_owned","package:pm-governance-audit",["normalize"]),...n("ops","ops","consolidation","pm-6apl",["eval","gc","health","stats","telemetry","test-all","validate"]),...n("workspace","workspace","consolidation","pm-npr3",["config","profile","schema"]),...["assurance",...h.filter(({parent:e})=>e==="assurance").map(({command:e})=>e)].map(e=>({command:e,noun:"ops",target:e,disposition:"keep_as_is",owner:"pm-djyvbk",reason:"Assurance manages durable measurement, assertion, gate, and verdict data; retain its established domain surface independently of operational diagnostics."})),...n("plan","plan","target_noun","pm-pbyu",["plan"]),...n("plan","plan","target_noun","pm-2tan",h.filter(({parent:e})=>e==="plan").map(({command:e})=>e)),...n("contracts","contracts","target_noun","pm-pbyu",["contracts"]),...n("help","help","target_noun","pm-pbyu",["help"]),...n("workspace","templates","package_owned","package:builtin-templates",["templates","templates list","templates save","templates show"]),...n("help","help","package_owned","package:builtin-guide-shell",["completion","completion-statuses","completion-tags","completion-types","guide"])].flatMap(e=>{let a=U.find(t=>t.alias===e.command);if(!a)return[e];let l=F.find(t=>t===a.canonical_argv[0])??e.noun;return[{...e,noun:l,target:a.canonical,owner:a.owner},{...e,command:a.canonical,noun:l,target:a.canonical,owner:a.owner,disposition:e.disposition==="package_owned"?"package_owned":"target_noun"}]}),R=[...new Set(N.map(({command:e})=>e))].map(e=>({command:e,slots:Te(e)?.slots??Y.get(C(e))??[]})),w={nouns:F,shared_verbs:ue,scope_before_verb:!0,visible_top_level_ceiling:69,ceiling_raise_requires_pm_item:!0,positional_shape_budget:21};function q(e,a){let l=new Set(a);return[...new Set(e)].filter(t=>!l.has(t)).map(t=>({code:"positional_signature_mismatch",command:t,detail:`Positional signature ${t} has no destination declaration.`}))}function ye(e){return e.map(({required:a,variadic:l,value_kind:t,polymorphic:i})=>`${a?"r":"o"}:${l?"v":"s"}:${t}:${i?"p":"m"}`).join("|")}function S(e){return e.map(({name:a,required:l,variadic:t,value_kind:i,polymorphic:f})=>`${a}:${l?"r":"o"}:${t?"v":"s"}:${i}:${f?"p":"m"}`).join("|")}function H(e,a){let l=new Map;for(let{command:t}of e){let i=v(t);l.set(i,(l.get(i)??0)+1)}return[...l.entries()].filter(([,t])=>t>1).map(([t,i])=>({code:"positional_signature_mismatch",command:t,detail:`${i} ${a} positional signatures exist for ${t}; exactly one is required.`}))}function Wa(e,a={}){let l=a.declared??R,t=a.positionalShapeBudget??w.positional_shape_budget,i=new Map(l.map(o=>[v(o.command),o])),f=new Map(e.map(o=>[v(o.command),o])),c=[...H(l,"declared"),...H(e,"observed"),...a.declared===void 0?[...q(Y.keys(),N.map(({command:o})=>o)),...q(h.map(({command:o})=>o),N.map(({command:o})=>o))]:[]];for(let o of i.values()){let d=v(o.command),r=f.get(d);r?S(r.slots)!==S(o.slots)&&c.push({code:"positional_signature_mismatch",command:o.command,detail:`Observed positional signature for ${o.command} differs from its declared SDK contract: observed=${S(r.slots)||"<none>"}; declared=${S(o.slots)||"<none>"}.`}):c.push({code:"missing_observed_signature",command:o.command,detail:`No observed positional signature exists for ${o.command}.`})}for(let o of f.values())i.has(v(o.command))||c.push({code:"stale_observed_signature",command:o.command,detail:`Observed positional signature ${o.command} has no declaration.`});let p=new Set(l.map(({slots:o})=>ye(o))).size;return p>t&&c.push({code:"positional_shape_budget_exceeded",command:"*",detail:`Distinct positional shape count ${p} exceeds budget ${t}.`}),c.sort((o,d)=>o.command!==d.command?o.command.localeCompare(d.command):o.code.localeCompare(d.code)),{ok:c.length===0,declared_command_count:l.length,observed_command_count:e.length,positional_shape_count:p,positional_shape_budget:t,findings:c}}function Ae(e,a,l){return e.flatMap(t=>{let i=a.get(t)??[];if(i.length===0){let c=t.indexOf(" "),p=c===-1?t:t.slice(0,c);return[{code:"missing_destination",spelling:t,message:`Command \`${t}\` has no destination census row.`,nearest_target:l.has(p)?p:`ops ${t}`}]}let f=i.length>1?[{code:"duplicate_destination",spelling:t,message:`Command \`${t}\` has ${i.length} destination rows.`,nearest_target:i[0].target}]:[];return i.reduce((c,p)=>(p.disposition==="keep_as_is"&&(p.reason?.trim().length??0)===0&&c.push({code:"missing_destination",spelling:t,message:`Command \`${t}\` is kept as-is without a documented reason.`,nearest_target:p.target}),l.has(p.noun)||c.push({code:"unknown_noun",spelling:t,message:`Command \`${t}\` names undeclared noun \`${p.noun}\`.`,nearest_target:p.target}),c),f)})}function ke(e,a){return a.filter(l=>l.disposition!=="package_owned"&&!e.has(l.command)).map(l=>({code:"stale_destination",spelling:l.command,message:`Destination row \`${l.command}\` is absent from live contracts.`,nearest_target:l.target}))}function be(e,a){return e.filter(l=>!a.has(l.canonical)).map(l=>({code:"alias_target_missing",spelling:l.alias,message:`Alias \`${l.alias}\` targets missing canonical command \`${l.canonical}\`.`,nearest_target:l.canonical_argv.join(" ")}))}function Za(e,a=[],l=N){let t=[...new Set(e.map(r=>r.trim()))].filter(r=>r.length>0).sort((r,u)=>r.localeCompare(u)),i=new Set(t),f=new Set(F),c=new Map;for(let r of l){let u=c.get(r.command)??[];u.push(r),c.set(r.command,u)}let p=[...Ae(t,c,f),...ke(i,l),...be(a.filter(r=>i.has(r.alias)||!(c.get(r.canonical)??[]).some(u=>u.disposition==="package_owned")),i)],o=new Set(a.filter(r=>r.hidden).map(r=>r.alias)),d=new Set(t.filter(r=>!r.includes(" ")&&!o.has(r)&&!(c.get(r)??[]).some(u=>u.disposition==="package_owned"))).size;return d>w.visible_top_level_ceiling&&p.push({code:"visible_surface_ceiling_exceeded",spelling:String(d),message:`Visible non-package top-level command count ${d} exceeds ceiling ${w.visible_top_level_ceiling}.`,nearest_target:"Declare the noun placement and tracked waiver before raising the ceiling."}),{ok:p.length===0,command_count:t.length,destination_count:l.length,hidden_alias_count:a.filter(r=>r.hidden).length,visible_top_level_count:d,visible_top_level_ceiling:w.visible_top_level_ceiling,findings:p}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="4e1e3ef4-cdf3-5d4c-88fe-d23f6fc171d1")}catch{}})();function b(e){return[...new Set(Array.from(e,a=>a.trim()).filter(a=>a.length>0))]}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="a7a8b207-a2eb-5861-9727-c46ecaf1b551")}catch{}})();function x(e){return e.startsWith("--")?`--${e.slice(2).replaceAll("_","-")}`:e}function G(e){let a=new Map;for(let l of e){let t=x(l.flag),i=a.get(t)??new Set;l.flag!==t&&i.add(l.flag);for(let f of l.aliases??[])f!==t&&i.add(f);a.set(t,i)}return e.map(l=>{let t=x(l.flag);if(l.flag!==t)return l;let i=b([...l.aliases??[],...a.get(t)]).filter(f=>f!==t);return i.length===0?l:{...l,aliases:i}})}function il(e){let a=G(e),l=new Set(a.map(t=>t.flag));return a.filter(t=>{let i=x(t.flag);return t.flag===i||!l.has(i)})}var P=D.map(e=>({flag:e.flag,reservation_scope:"inherited",...e.aliases?{aliases:[...e.aliases]}:{},...e.value_name?{value_name:e.value_name}:{}})),nl=[...P,{flag:"--version",value_type:"boolean",reservation_scope:"root_only"},{flag:"--all",value_type:"boolean",reservation_scope:"root_only",description:"Expand root help to every command."},{flag:"--explain",value_type:"boolean",reservation_scope:"root_only",description:"Expand root help with command guidance."}],J=[{flag:"--filter-reviewer-missing"},{flag:"--filter-risk-missing"},{flag:"--filter-confidence-missing"},{flag:"--filter-sprint-missing"},{flag:"--filter-release-missing"},{flag:"--has-notes"},{flag:"--no-notes"},{flag:"--has-learnings"},{flag:"--no-learnings"},{flag:"--has-files"},{flag:"--no-files"},{flag:"--filter-files-missing"},{flag:"--has-docs"},{flag:"--no-docs"},{flag:"--filter-docs-missing"},{flag:"--has-tests"},{flag:"--no-tests"},{flag:"--has-comments"},{flag:"--no-comments"},{flag:"--has-deps"},{flag:"--no-deps"},{flag:"--has-body"},{flag:"--empty-body"},{flag:"--has-linked-command"},{flag:"--no-linked-command"}],ee=[{flag:"--filter-reviewer-missing"},{flag:"--filter-risk-missing"},{flag:"--filter-confidence-missing"},{flag:"--filter-sprint-missing"},{flag:"--filter-release-missing"},{flag:"--filter-has-notes"},{flag:"--filter-no-notes"},{flag:"--filter-has-learnings"},{flag:"--filter-no-learnings"},{flag:"--filter-has-files"},{flag:"--filter-no-files"},{flag:"--filter-has-docs"},{flag:"--filter-no-docs"},{flag:"--filter-has-tests"},{flag:"--filter-no-tests"},{flag:"--filter-has-comments"},{flag:"--filter-no-comments"},{flag:"--filter-has-deps"},{flag:"--filter-no-deps"},{flag:"--filter-has-body"},{flag:"--filter-empty-body"},{flag:"--filter-has-linked-command"},{flag:"--filter-no-linked-command"},{flag:"--ids",list:!0},{flag:"--limit"},{flag:"--offset"}],I=M([{flag:"--for",value_name:"intent"},{flag:"--token-budget",aliases:["--token_budget"]},{flag:"--status",list:!0},{flag:"--all",value_type:"boolean"},{flag:"--type",list:!0},{flag:"--tag",aliases:["--tags"],list:!0},{flag:"--priority",list:!0},{flag:"--deadline-before"},{flag:"--deadline-after"},{flag:"--today"},{flag:"--recent"},{flag:"--updated-after"},{flag:"--updated-before"},{flag:"--created-after"},{flag:"--created-before"},{flag:"--ids",list:!0},{flag:"--assignee",list:!0},{flag:"--assignee-filter"},{flag:"--assignee_filter"},{flag:"--parent"},{flag:"--sprint",list:!0},{flag:"--release",list:!0},{flag:"--filter-ac-missing"},{flag:"--filter-estimates-missing",aliases:["--filter-estimate-missing"]},{flag:"--filter-resolution-missing"},{flag:"--filter-metadata-missing"},...J,{flag:"--limit"},{flag:"--offset"},{flag:"--after"},{flag:"--no-truncate"},{flag:"--compact"},{flag:"--brief"},{flag:"--full"},{flag:"--fields",list:!0},{flag:"--sort"},{flag:"--order"},{flag:"--tree"},{flag:"--tree-depth"},{flag:"--tree_depth"},{flag:"--include-body"},{flag:"--strict-read"},{flag:"--format"},{flag:"--stream"}],new Set(["--limit","--token-budget","--offset","--after","--no-truncate","--compact","--brief","--full","--fields","--include-body","--strict-read"])),Ce=[{flag:"--group-by",list:!0},{flag:"--set-mode"},{flag:"--limit"},{flag:"--after"},{flag:"--count"},{flag:"--completion"},{flag:"--sum"},{flag:"--avg"},{flag:"--include-unparented"},{flag:"--include_unparented"},{flag:"--status",list:!0},{flag:"--type",list:!0},{flag:"--tag",list:!0},{flag:"--priority",list:!0},{flag:"--deadline-before"},{flag:"--deadline-after"},{flag:"--assignee",list:!0},{flag:"--assignee-filter"},{flag:"--assignee_filter"},{flag:"--parent"},{flag:"--sprint",list:!0},{flag:"--release",list:!0}],Se=[{flag:"--id",value_name:"item-id"},{flag:"--add",aliases:["--comment","--body","--text"]},{flag:"--stdin"},{flag:"--file"},{flag:"--edit"},{flag:"--delete"},{flag:"--limit"},{flag:"--full-history"},{flag:"--if-absent",value_type:"boolean"},{flag:"--author"},{flag:"--message"},{flag:"--force"}];function M(e,a){return e.map(l=>a.has(l.flag)?{...l,cursor_semantics:"presentation"}:l)}var we=[{flag:"--id",value_name:"item-id"},{flag:"--add",aliases:["--note","--text"]},{flag:"--add-json"},{flag:"--stdin"},{flag:"--file"},{flag:"--edit"},{flag:"--delete"},{flag:"--limit"},{flag:"--since"},{flag:"--event-type"},{flag:"--include-meta"},{flag:"--full-history"},{flag:"--if-absent",value_type:"boolean"},{flag:"--author"},{flag:"--message"},{flag:"--force"}],Ne=[{flag:"--id",value_name:"item-id"},{flag:"--add",aliases:["--learning","--text"]},{flag:"--stdin"},{flag:"--file"},{flag:"--edit"},{flag:"--delete"},{flag:"--limit"},{flag:"--full-history"},{flag:"--if-absent",value_type:"boolean"},{flag:"--author"},{flag:"--message"},{flag:"--force"}],Oe=[{flag:"--id",value_name:"item-id"},{flag:"--add"},{flag:"--add-glob"},{flag:"--remove"},{flag:"--migrate"},{flag:"--note"},{flag:"--list"},{flag:"--append-stable"},{flag:"--validate-paths"},{flag:"--scope"},{flag:"--limit"},{flag:"--offset"},{flag:"--no-truncate"},{flag:"--strict-read"},{flag:"--explain"},{flag:"--lines",value_name:"start:end"},{flag:"--decision-depth",value_name:"n",value_type:"number"},{flag:"--author"},{flag:"--message"},{flag:"--force"}],xe=[{flag:"--id",value_name:"item-id"},{flag:"--add"},{flag:"--add-glob"},{flag:"--remove"},{flag:"--migrate"},{flag:"--note"},{flag:"--list"},{flag:"--validate-paths"},{flag:"--author"},{flag:"--message"},{flag:"--force"}],Le=[{flag:"--id",value_name:"item-id"},{flag:"--limit"},{flag:"--compact"},{flag:"--full"},{flag:"--provenance"},{flag:"--provenance-summary"},{flag:"--harness",repeatable:!0},{flag:"--agent-instance",repeatable:!0},{flag:"--provenance-filter",repeatable:!0},{flag:"--diff"},{flag:"--field"},{flag:"--verify"},{flag:"--strict-exit"},{flag:"--fail-on-warn"},{flag:"--format"}],Ee=[{flag:"--dry-run"},{flag:"--pre-commit-hook",value_type:"boolean"},{flag:"--stage",value_type:"boolean"},{flag:"--message"},{flag:"--force"},{flag:"--include-reconciled"},{flag:"--output"},{flag:"--item-path"},{flag:"--prefer"}],Re=[{flag:"--id",value_name:"item-id"},{flag:"--literal"},{flag:"--regex"},{flag:"--replacement"},{flag:"--dry-run"},{flag:"--author"},{flag:"--message"},{flag:"--force"}],Fe=[{flag:"--id",value_name:"item-id"},{flag:"--all"},{flag:"--dry-run"},{flag:"--normalize-provenance"},{flag:"--salvage-tail",value_type:"boolean"},{flag:"--author"},{flag:"--message"},{flag:"--force"}],Ie=[{flag:"--event",repeatable:!0},{flag:"--all-actionable"},{flag:"--dry-run"},{flag:"--plan-fingerprint"},{flag:"--limit",value_type:"number"},{flag:"--attributed-author",aliases:["--attributed_author"]},{flag:"--reviewer"},{flag:"--reason"}],Ge=[{flag:"--id",value_name:"item-id"},{flag:"--before"},{flag:"--ids",list:!0},{flag:"--all-over",value_type:"number"},{flag:"--closed"},{flag:"--all-streams"},{flag:"--min-entries",value_type:"number"},{flag:"--dry-run"},{flag:"--author"},{flag:"--message"},{flag:"--force"}],Pe=[{flag:"--verify",value_name:"file",value_type:"string"},{flag:"--output",value_name:"file",value_type:"string"},{flag:"--hash-algorithm",value_name:"name",value_type:"string"}],Me=[{flag:"--definition",value_name:"json"},{flag:"--policy",value_name:"id"},{flag:"--message",value_name:"value"},{flag:"--description"},{flag:"--default-status",aliases:["--default_status"]},{flag:"--folder"},{flag:"--alias"},{flag:"--role"},{flag:"--order"},{flag:"--type"},{flag:"--commands"},{flag:"--cli-flag"},{flag:"--required"},{flag:"--required-on-create"},{flag:"--no-allow-unset"},{flag:"--required-types"},{flag:"--infer"},{flag:"--min-count"},{flag:"--apply",value_type:"boolean"},{flag:"--to"},{flag:"--migration-id",aliases:["--migration_id"]},{flag:"--dry-run"},{flag:"--author"},{flag:"--force"}],De=[{flag:"--dry-run"},{flag:"--author"},{flag:"--force"}],ae=[{flag:"--title"},{flag:"--description"},{flag:"--scope"},{flag:"--parent"},{flag:"--inherit-focus",value_type:"boolean",default:!0},{flag:"--no-inherit-focus",value_type:"boolean"},{flag:"--related"},{flag:"--blocks"},{flag:"--blocked-by",aliases:["--blocked_by"]},{flag:"--harness"},{flag:"--mode"},{flag:"--resume-context",aliases:["--resume_context"]},{flag:"--tags",aliases:["--tag"],list:!0},{flag:"--priority"},{flag:"--status",short:"-s"},{flag:"--create-mode",aliases:["--create_mode"]},{flag:"--deadline"},{flag:"--estimate",aliases:["--estimated-minutes","--estimated_minutes"]},{flag:"--acceptance-criteria",aliases:["--acceptance_criteria","--ac"],repeatable:!0},{flag:"--definition-of-ready",aliases:["--definition_of_ready"]},{flag:"--order"},{flag:"--rank"},{flag:"--goal"},{flag:"--objective"},{flag:"--value"},{flag:"--impact"},{flag:"--outcome"},{flag:"--why-now",aliases:["--why_now"]},{flag:"--assignee"},{flag:"--reviewer"},{flag:"--risk"},{flag:"--confidence"},{flag:"--sprint"},{flag:"--release"},{flag:"--blocked-reason",aliases:["--blocked_reason"]},{flag:"--unblock-note",aliases:["--unblock_note"]},{flag:"--reporter"},{flag:"--severity"},{flag:"--environment"},{flag:"--repro-steps",aliases:["--repro_steps"]},{flag:"--resolution"},{flag:"--expected-result",aliases:["--expected_result","--expected"]},{flag:"--actual-result",aliases:["--actual_result","--actual"]},{flag:"--affected-version",aliases:["--affected_version"]},{flag:"--fixed-version",aliases:["--fixed_version"]},{flag:"--component"},{flag:"--regression"},{flag:"--customer-impact",aliases:["--customer_impact"]},{flag:"--comment",repeatable:!0},{flag:"--note",repeatable:!0},{flag:"--learning",repeatable:!0},{flag:"--reminder",repeatable:!0},{flag:"--event",repeatable:!0},{flag:"--type-option",aliases:["--type_option"],repeatable:!0},{flag:"--body"},{flag:"--claim"},{flag:"--from-search",aliases:["--from_search"]},{flag:"--template"},{flag:"--step-title",aliases:["--step_title"]},{flag:"--step"},{flag:"--step-body",aliases:["--step_body"]},{flag:"--step-owner",aliases:["--step_owner"]},{flag:"--step-status",aliases:["--step_status"]},{flag:"--step-evidence",aliases:["--step_evidence"]},{flag:"--step-blocked-reason",aliases:["--step_blocked_reason"]},{flag:"--step-replacement",aliases:["--step_replacement"]},{flag:"--depends-on",aliases:["--depends_on"]},{flag:"--link"},{flag:"--link-kind",aliases:["--link_kind"]},{flag:"--link-note",aliases:["--link_note"]},{flag:"--promote-to-item-dep",aliases:["--promote_to_item_dep"]},{flag:"--allow-multiple-active",aliases:["--allow_multiple_active"]},{flag:"--file"},{flag:"--test"},{flag:"--doc"},{flag:"--decision-text",aliases:["--decision_text","--decision"]},{flag:"--decision-rationale",aliases:["--decision_rationale"]},{flag:"--decision-evidence",aliases:["--decision_evidence"]},{flag:"--discovery-text",aliases:["--discovery_text","--discovery"]},{flag:"--validation-text",aliases:["--validation_text","--validation"]},{flag:"--validation-command",aliases:["--validation_command"]},{flag:"--validation-expected",aliases:["--validation_expected"]},{flag:"--depth"},{flag:"--field"},{flag:"--fields",list:!0},{flag:"--steps"},{flag:"--materialize-type",aliases:["--materialize_type"]},{flag:"--materialize-parent",aliases:["--materialize_parent"]},{flag:"--materialize-tags",aliases:["--materialize_tags"]},{flag:"--author"},{flag:"--message"},{flag:"--force"}],$e=[{flag:"--id-prefix",aliases:["--prefix"]},{flag:"--preset"},{flag:"--type-preset"},{flag:"--defaults",short:"-y",aliases:["--yes"]},{flag:"--author"},{flag:"--agent-guidance"},{flag:"--with-packages"},{flag:"--no-merge-fence"},{flag:"--workspace"},{flag:"--force"},{flag:"--verbose"}],Ue=[{flag:"--value",value_name:"value"},{flag:"--criterion"},{flag:"--clear-criteria"},{flag:"--format"},{flag:"--policy"},{flag:"--default-depth"},{flag:"--activity-limit"},{flag:"--stale-threshold-days"},{flag:"--section-hierarchy"},{flag:"--section-activity"},{flag:"--section-progress"},{flag:"--section-blockers"},{flag:"--section-files"},{flag:"--section-workload"},{flag:"--section-staleness"},{flag:"--section-tests"}],le=[{flag:"--dry-run"},{flag:"--init"},{flag:"--scaffold"},{flag:"--capability"},{flag:"--install"},{flag:"--uninstall"},{flag:"--explore"},{flag:"--list"},{flag:"--manage"},{flag:"--offline",value_type:"boolean"},{flag:"--describe"},{flag:"--markdown"},{flag:"--output"},{flag:"--reload"},{flag:"--watch"},{flag:"--doctor"},{flag:"--catalog"},{flag:"--adopt"},{flag:"--adopt-all"},{flag:"--activate"},{flag:"--deactivate"},{flag:"--project"},{flag:"--local"},{flag:"--global"},{flag:"--gh"},{flag:"--github"},{flag:"--ref"},{flag:"--detail"},{flag:"--trace"},{flag:"--runtime-probe"},{flag:"--fix-managed-state"},{flag:"--isolated"},{flag:"--ignore-global"},{flag:"--strict-exit"},{flag:"--fail-on-warn"}],m=[{flag:"--project"},{flag:"--local"},{flag:"--global"}],te=[...m,{flag:"--capability"}],B=[...le,{flag:"--declarative"}],ze=[...te,{flag:"--declarative"}],je=[{flag:"--dry-run"},{flag:"--project"},{flag:"--local"},{flag:"--global"},{flag:"--gh"},{flag:"--github"},{flag:"--ref"}],Xe=m,qe=m,He=[...m,{flag:"--markdown"},{flag:"--output"}],Ye=m,Be=m,Ke=m,Ve=[...m,{flag:"--dry-run"}],We=[...m,{flag:"--offline",value_type:"boolean"},{flag:"--runtime-probe"},{flag:"--fix-managed-state"}],Ze=[...m,{flag:"--watch"}],Qe=[...m,{flag:"--detail"},{flag:"--trace"},{flag:"--fix-managed-state"},{flag:"--isolated"},{flag:"--ignore-global"},{flag:"--strict-exit"},{flag:"--fail-on-warn"}],K=[...m,{flag:"--fields",list:!0}],Je=[...m,{flag:"--gh"},{flag:"--github"},{flag:"--ref"}],ea=[{flag:"--dry-run"},{flag:"--project"},{flag:"--local"},{flag:"--global"},{flag:"--gh"},{flag:"--github"},{flag:"--ref"}],se=[{flag:"--dry-run"},{flag:"--cli-only"},{flag:"--packages-only"},{flag:"--project"},{flag:"--local"},{flag:"--global"},{flag:"--repair"},{flag:"--tag"},{flag:"--package-name"}],ol=[{flag:"--mode"},{flag:"--progress"}],aa=[{flag:"--release-assignment",value_type:"boolean"},{flag:"--id",value_name:"item-id"},{flag:"--reason",value_name:"value"},{flag:"--close-reason",value_name:"value"},{flag:"--completed-at",value_name:"value"},{flag:"--duplicate-of",value_name:"value"},{flag:"--author",value_name:"value"},{flag:"--message",value_name:"value"},{flag:"--validate-close",value_name:"off|warn|strict"},{flag:"--resolution",value_name:"value"},{flag:"--expected-result",aliases:["--expected_result","--expected"],value_name:"value"},{flag:"--actual-result",aliases:["--actual_result","--actual"],value_name:"value"},{flag:"--force",value_type:"boolean"}],la=[{flag:"--filter-status",list:!0},{flag:"--filter-type"},{flag:"--filter-tag"},{flag:"--filter-priority"},{flag:"--filter-deadline-before"},{flag:"--filter-deadline-after"},{flag:"--filter-updated-after"},{flag:"--filter-updated-before"},{flag:"--filter-created-after"},{flag:"--filter-created-before"},{flag:"--filter-assignee"},{flag:"--filter-assignee-filter"},{flag:"--filter-assignee_filter"},{flag:"--filter-parent"},{flag:"--filter-sprint"},{flag:"--filter-release"},...ee,{flag:"--reason"},{flag:"--completed-at"},{flag:"--resolution"},{flag:"--expected-result",aliases:["--expected_result","--expected"]},{flag:"--actual-result",aliases:["--actual_result","--actual"]},{flag:"--validate-close"},{flag:"--author"},{flag:"--message"},{flag:"--force"},{flag:"--dry-run"},{flag:"--rollback"},{flag:"--no-checkpoint"}],ta=[{flag:"--id",value_name:"item-id"},{flag:"--body",short:"-b"},{flag:"--text"},{flag:"--author"},{flag:"--message"},{flag:"--force"}],sa=[{flag:"--start",value_type:"boolean"},{flag:"--id",value_name:"item-id"},{flag:"--author",aliases:["--assignee"]},{flag:"--message"},{flag:"--force"},{flag:"--if-available"},{flag:"--next"},{flag:"--type"},{flag:"--tag"},{flag:"--priority"},{flag:"--assignee-filter"},{flag:"--parent"},{flag:"--sprint"},{flag:"--release"},{flag:"--max-attempts"},{flag:"--include-decisions"},{flag:"--include-gates"},{flag:"--include-containers"},{flag:"--token-budget",aliases:["--token_budget"]},{flag:"--explain-ranking",aliases:["--explain_ranking"]}],ia=[{flag:"--id",value_name:"item-id"},{flag:"--author"},{flag:"--message"},{flag:"--force"}],na=[{flag:"--id",value_name:"item-id"},{flag:"--dry-run"},{flag:"--author"},{flag:"--message"},{flag:"--force"}],oa=[{flag:"--pause",value_type:"boolean"},{flag:"--handoff",value_name:"status"},{flag:"--id",value_name:"item-id"},{flag:"--author",aliases:["--assignee"]},{flag:"--message"},{flag:"--force"}],ra=[{flag:"--id",value_name:"item-id"},{flag:"--author",aliases:["--assignee"]},{flag:"--message"},{flag:"--force"}],ga=[{flag:"--id",value_name:"item-id"},{flag:"--author",aliases:["--assignee"]},{flag:"--message"},{flag:"--force"}],fa=[{flag:"--id",value_name:"item-id"},{flag:"--author",aliases:["--assignee"]},{flag:"--message"},{flag:"--validate-close",value_name:"off|warn|strict"},{flag:"--force"}],ie=[{flag:"--parent"},{flag:"--allow-missing-parent"},{flag:"--tags"},{flag:"--priority"},{flag:"--body"},{flag:"--description"},{flag:"--author"},{flag:"--message"}],ne=[{flag:"--start"},{flag:"--duration"},{flag:"--end"},{flag:"--location"},{flag:"--timezone"},{flag:"--all-day"},...ie],ca=ne,pa=[{flag:"--at"},{flag:"--text"},...ie],da=[{flag:"--list"},{flag:"--id",value_name:"item-id"},{flag:"--add"},{flag:"--add-json"},{flag:"--remove"},{flag:"--remove-index",repeatable:!0},{flag:"--update"},{flag:"--update-index"},{flag:"--set-json"},{flag:"--run"},{flag:"--match"},{flag:"--only-index"},{flag:"--only-last"},{flag:"--background"},{flag:"--timeout"},{flag:"--progress"},{flag:"--env-set"},{flag:"--env-clear"},{flag:"--shared-host-safe"},{flag:"--pm-context"},{flag:"--override-linked-pm-context"},{flag:"--workspace-context"},{flag:"--override-linked-workspace-context"},{flag:"--allow-untrusted-linked-tests"},{flag:"--acknowledge-linked-tests"},{flag:"--fail-on-context-mismatch"},{flag:"--fail-on-skipped"},{flag:"--fail-on-empty-test-run"},{flag:"--require-assertions-for-pm"},{flag:"--check-context"},{flag:"--auto-pm-context"},{flag:"--measure",list:!0,description:"Record numeric measurement evidence; requires --run and an executed linked command."},{flag:"--metric-below"},{flag:"--metric-diff"},{flag:"--author"},{flag:"--message"},{flag:"--force"}],ma=[{flag:"--status"},{flag:"--limit"},{flag:"--offset"},{flag:"--background"},{flag:"--timeout"},{flag:"--progress"},{flag:"--env-set"},{flag:"--env-clear"},{flag:"--shared-host-safe"},{flag:"--pm-context"},{flag:"--override-linked-pm-context"},{flag:"--workspace-context"},{flag:"--override-linked-workspace-context"},{flag:"--allow-untrusted-linked-tests"},{flag:"--fail-on-context-mismatch"},{flag:"--fail-on-skipped"},{flag:"--fail-on-empty-test-run"},{flag:"--require-assertions-for-pm"},{flag:"--check-context"},{flag:"--auto-pm-context"}],ua=[{flag:"--limit"}],rl=[{flag:"--status"},{flag:"--limit"},{flag:"--stream"},{flag:"--tail"},{flag:"--force"},{flag:"--author"}],_a=[{flag:"--dry-run"},{flag:"--scope"}],va=[{flag:"--include-empty"},{flag:"--storage"},{flag:"--metadata-coverage"},{flag:"--field-utilization"},{flag:"--by-assignee"},{flag:"--by-tag"},{flag:"--by-priority"},{flag:"--tag-prefix"},{flag:"--analytics"}],ha=[{flag:"--exhaustive",value_type:"boolean"},{flag:"--status",repeatable:!0,list:!0},{flag:"--since"},{flag:"--threshold"},{flag:"--limit"}],Ta=[{flag:"--strict-directories"},{flag:"--require-merge-drivers"},{flag:"--strict-exit"},{flag:"--fail-on-warn"},{flag:"--check-only"},{flag:"--check-telemetry"},{flag:"--no-refresh"},{flag:"--refresh-vectors"},{flag:"--verbose-stale-items"},{flag:"--verbose-author-events"},{flag:"--brief"},{flag:"--summary"},{flag:"--skip-vectors"},{flag:"--skip-integrity"},{flag:"--skip-drift"},{flag:"--full"}],ya=[{flag:"--check-completeness",value_type:"boolean"},{flag:"--check-metadata"},{flag:"--metadata-profile"},{flag:"--check-resolution"},{flag:"--check-lifecycle"},{flag:"--check-stale-blockers"},{flag:"--dependency-cycle-severity"},{flag:"--parent-cycle-severity"},{flag:"--check-files"},{flag:"--scan-mode"},{flag:"--include-pm-internals"},{flag:"--verbose-file-lists"},{flag:"--verbose-diagnostics"},{flag:"--all-affected-ids"},{flag:"--strict-exit"},{flag:"--fail-on-warn"},{flag:"--fix-hints"},{flag:"--auto-fix"},{flag:"--dry-run"},{flag:"--fix-scope"},{flag:"--prune-missing"},{flag:"--check-history-drift"},{flag:"--check-command-references"},{flag:"--check-storage-integrity"},{flag:"--counts"},{flag:"--full"}],oe=[{flag:"--definition",value_name:"json"},{flag:"--trigger",value_name:"value"},{flag:"--tree",value_name:"value"},{flag:"--gate",value_name:"id"},{flag:"--limit",value_name:"number"},{flag:"--dry-run"},{flag:"--author",value_name:"value"},{flag:"--message",value_name:"value"},{flag:"--owner",value_name:"item-id"},{flag:"--apply",value_type:"boolean"},{flag:"--enforcement",value_name:"level"}],re=[{flag:"--assignee"},{flag:"--parent"},{flag:"--allow-missing-parent"},{flag:"--allow-unresolved-deps"},{flag:"--reviewer"},{flag:"--risk"},{flag:"--confidence"},{flag:"--sprint"},{flag:"--release"},{flag:"--blocked-by"},{flag:"--blocked-reason"},{flag:"--unblock-note"},{flag:"--reporter"},{flag:"--severity"},{flag:"--environment"},{flag:"--repro-steps"},{flag:"--resolution"},{flag:"--expected-result"},{flag:"--actual-result"},{flag:"--affected-version"},{flag:"--fixed-version"}],ge=[{flag:"--component"},{flag:"--regression"},{flag:"--customer-impact"},{flag:"--customer_impact"},{flag:"--definition-of-ready"},{flag:"--definition_of_ready"},{flag:"--order"},{flag:"--rank"},{flag:"--goal"},{flag:"--objective"},{flag:"--value"},{flag:"--impact"},{flag:"--outcome"},{flag:"--why-now"},{flag:"--why_now"}],fe=[{short:"-p",flag:"--priority"},{flag:"--type"},{flag:"--tags",aliases:["--tag"],list:!0},{flag:"--add-tags",aliases:["--add_tags"]},{flag:"--remove-tags",aliases:["--remove_tags"]},{flag:"--deadline"},{flag:"--estimate"},{flag:"--estimated-minutes"},{flag:"--estimated_minutes"},{flag:"--acceptance-criteria"},{flag:"--acceptance_criteria"},{flag:"--ac"},{flag:"--add-ac",aliases:["--add_ac"]},{flag:"--remove-ac",aliases:["--remove_ac"]}],V=[{flag:"--inherit-focus",value_type:"boolean",default:!0},{flag:"--no-inherit-focus",value_type:"boolean"},{flag:"--stdin-json"},{short:"-t",flag:"--title"},{flag:"--id"},{short:"-d",flag:"--description"},{flag:"--type"},{flag:"--template"},{flag:"--create-mode"},{flag:"--create_mode"},{flag:"--schedule-preset"},{flag:"--schedule_preset"},{short:"-s",flag:"--status"},{flag:"--close-reason"},{flag:"--close_reason"},{flag:"--completed-at"},{flag:"--completed_at"},{short:"-p",flag:"--priority"},{flag:"--tags",aliases:["--tag"],list:!0},{flag:"--add-tags",aliases:["--add_tags"]},{short:"-b",flag:"--body",value_name:"value"},{flag:"--body-file"},{flag:"--deadline"},{flag:"--estimate"},{flag:"--estimated-minutes"},{flag:"--estimated_minutes"},{flag:"--acceptance-criteria"},{flag:"--acceptance_criteria"},{flag:"--ac"},{flag:"--author"},{flag:"--message"},...re,...ge,{flag:"--blocked_by"},{flag:"--blocked_reason"},{flag:"--unblock_note"},{flag:"--repro_steps"},{flag:"--expected_result"},{flag:"--actual_result"},{flag:"--expected"},{flag:"--actual"},{flag:"--affected_version"},{flag:"--fixed_version"},{flag:"--dep"},{flag:"--type-option"},{flag:"--type_option"},{flag:"--field"},{flag:"--reminder"},{flag:"--event"},{flag:"--comment"},{flag:"--note"},{flag:"--learning"},{flag:"--file",aliases:["--linked-file"]},{flag:"--test",aliases:["--linked-test"]},{flag:"--doc"},{flag:"--unset"},{flag:"--clear-deps"},{flag:"--clear-comments"},{flag:"--clear-notes"},{flag:"--clear-learnings"},{flag:"--clear-files"},{flag:"--clear-tests"},{flag:"--clear-docs"},{flag:"--clear-reminders"},{flag:"--clear-events"},{flag:"--clear-type-options"},{flag:"--allow-duplicate",value_type:"boolean"}],Aa=[{flag:"--transaction-id",value_name:"value"},{flag:"--stdin-json"},{flag:"--from",value_name:"path"},{flag:"--upsert-key",value_name:"field"},{flag:"--dry-run"},{flag:"--create-compensation",value_name:"mode"},{flag:"--lock-ttl-seconds",value_name:"n"},{flag:"--lock-wait-ms",value_name:"n"},{flag:"--author",value_name:"value"}],ka=[{flag:"--id",value_name:"item-id"},{flag:"--transaction-id",value_name:"value",required:!0},{flag:"--reason",value_name:"value"},{flag:"--file",value_name:"value",repeatable:!0},{flag:"--doc",value_name:"value",repeatable:!0},{flag:"--test",value_name:"value",repeatable:!0},{flag:"--comment",value_name:"value",repeatable:!0},{flag:"--note",value_name:"value",repeatable:!0},{flag:"--learning",value_name:"value",repeatable:!0},{flag:"--resolution",value_name:"value"},{flag:"--expected-result",value_name:"value"},{flag:"--actual-result",value_name:"value"},{flag:"--completed-at",value_name:"value"},{flag:"--validate-close",value_name:"off|warn|strict"},{flag:"--lock-ttl-seconds",value_name:"n"},{flag:"--lock-wait-ms",value_name:"n"},{flag:"--dry-run"},{flag:"--force"},{flag:"--author",value_name:"value"}],ba=[{flag:"--id",value_name:"item-id"},{flag:"--status",value_name:"open|in_progress"},{flag:"--expected-result",value_name:"value",aliases:["--expected"]},{flag:"--message",value_name:"value"},{flag:"--force"},{flag:"--author",value_name:"value"}],Ca=[{flag:"--id",value_name:"item-id"},{flag:"--title",value_name:"value"},{flag:"--author",value_name:"value"},{flag:"--message",value_name:"value"},{flag:"--allow-duplicate",value_type:"boolean"}],Sa=[{flag:"--id",value_name:"item-id"},{flag:"--clear"}],wa=[{flag:"--id",value_name:"item-id"},{flag:"--stdin-json"},{short:"-t",flag:"--title"},{short:"-d",flag:"--description"},{short:"-b",flag:"--body"},{flag:"--body-file"},{short:"-s",flag:"--status"},{flag:"--close-reason"},{flag:"--close_reason"},{flag:"--completed-at"},...fe,...re,{flag:"--fixed_version"},...ge,{flag:"--author"},{flag:"--message"},{flag:"--blocked_by"},{flag:"--blocked_reason"},{flag:"--unblock_note"},{flag:"--repro_steps"},{flag:"--expected_result"},{flag:"--actual_result"},{flag:"--expected"},{flag:"--actual"},{flag:"--affected_version"},{flag:"--dep"},{flag:"--dep-remove"},{flag:"--dep_remove"},{flag:"--replace-deps"},{flag:"--replace-tests"},{flag:"--replace-files"},{flag:"--replace-docs"},{flag:"--comment"},{flag:"--note"},{flag:"--learning"},{flag:"--file",aliases:["--linked-file"]},{flag:"--test",aliases:["--linked-test"]},{flag:"--doc"},{flag:"--reminder"},{flag:"--event"},{flag:"--type-option"},{flag:"--type_option"},{flag:"--field"},{flag:"--unset"},{flag:"--clear-deps"},{flag:"--clear-comments"},{flag:"--clear-notes"},{flag:"--clear-learnings"},{flag:"--clear-files"},{flag:"--clear-tests"},{flag:"--clear-docs"},{flag:"--clear-reminders"},{flag:"--clear-events"},{flag:"--clear-type-options"},{flag:"--force"}],Na=[{flag:"--status",short:"-s"},{flag:"--assignee"},{flag:"--parent"},{flag:"--blocked-by",aliases:["--blocked_by"]},{flag:"--blocked-reason",aliases:["--blocked_reason"]},{flag:"--unblock-note",aliases:["--unblock_note"]},{flag:"--filter-status",list:!0},{flag:"--filter-type",list:!0},{flag:"--filter-tag",list:!0},{flag:"--filter-priority",list:!0},{flag:"--filter-deadline-before"},{flag:"--filter-deadline-after"},{flag:"--filter-updated-after"},{flag:"--filter-updated-before"},{flag:"--filter-created-after"},{flag:"--filter-created-before"},{flag:"--filter-assignee",list:!0},{flag:"--filter-assignee-filter"},{flag:"--filter-assignee_filter"},{flag:"--filter-parent"},{flag:"--filter-sprint",list:!0},{flag:"--filter-release",list:!0},{flag:"--filter-ac-missing"},{flag:"--filter-estimates-missing",aliases:["--filter-estimate-missing"]},{flag:"--filter-resolution-missing"},{flag:"--filter-metadata-missing"},...ee,{flag:"--dry-run"},{flag:"--rollback"},{flag:"--no-checkpoint"},{short:"-t",flag:"--title"},{short:"-d",flag:"--description"},{short:"-b",flag:"--body"},...fe,{flag:"--definition-of-ready"},{flag:"--definition_of_ready"},{flag:"--order"},{flag:"--rank"},{flag:"--goal"},{flag:"--objective"},{flag:"--value"},{flag:"--impact"},{flag:"--outcome"},{flag:"--why-now"},{flag:"--why_now"},{flag:"--reviewer"},{flag:"--risk"},{flag:"--confidence"},{flag:"--sprint"},{flag:"--release"},{flag:"--reporter"},{flag:"--severity"},{flag:"--environment"},{flag:"--repro-steps"},{flag:"--repro_steps"},{flag:"--resolution"},{flag:"--expected-result"},{flag:"--expected_result"},{flag:"--expected"},{flag:"--actual-result"},{flag:"--actual_result"},{flag:"--actual"},{flag:"--affected-version"},{flag:"--affected_version"},{flag:"--fixed-version"},{flag:"--fixed_version"},{flag:"--component"},{flag:"--regression"},{flag:"--customer-impact"},{flag:"--customer_impact"},{flag:"--allow-unresolved-deps"},{flag:"--dep"},{flag:"--dep-remove"},{flag:"--dep_remove"},{flag:"--replace-deps"},{flag:"--replace-tests"},{flag:"--replace-files"},{flag:"--replace-docs"},{flag:"--comment"},{flag:"--note"},{flag:"--learning"},{flag:"--file"},{flag:"--test"},{flag:"--doc"},{flag:"--reminder"},{flag:"--event"},{flag:"--type-option"},{flag:"--type_option"},{flag:"--unset"},{flag:"--clear-deps"},{flag:"--clear-comments"},{flag:"--clear-notes"},{flag:"--clear-learnings"},{flag:"--clear-files"},{flag:"--clear-tests"},{flag:"--clear-docs"},{flag:"--clear-reminders"},{flag:"--clear-events"},{flag:"--clear-type-options"},{flag:"--author"},{flag:"--message"},{flag:"--force"}],W=[{flag:"--view"},{flag:"--date"},{flag:"--from"},{flag:"--to"},{flag:"--past"},{flag:"--full-period"},{flag:"--full_period"},{flag:"--type"},{flag:"--tag"},{flag:"--priority"},{flag:"--status"},{flag:"--assignee"},{flag:"--assignee-filter"},{flag:"--assignee_filter"},{flag:"--sprint"},{flag:"--release"},{flag:"--include"},{flag:"--recurrence-lookahead-days"},{flag:"--recurrence-lookback-days"},{flag:"--occurrence-limit"},{flag:"--limit"},{flag:"--after",cursor_semantics:"presentation"},{flag:"--format"}],Oa=[{flag:"--id"},{flag:"--op"},{flag:"--author"},{flag:"--from"},{flag:"--to"},{flag:"--limit"},{flag:"--after",cursor_semantics:"presentation"},{flag:"--unbounded"},{flag:"--compact"},{flag:"--raw"},{flag:"--full"},{flag:"--provenance"},{flag:"--provenance-summary"},{flag:"--harness",repeatable:!0},{flag:"--agent-instance",repeatable:!0},{flag:"--provenance-filter",repeatable:!0},{flag:"--stream"}],xa=[{flag:"--verify"},{flag:"--since"},{flag:"--type",repeatable:!0},{flag:"--author",repeatable:!0},{flag:"--item",repeatable:!0},{flag:"--limit",value_type:"number"},{flag:"--cursor-mode",value_name:"batch|row"},{flag:"--full"},{flag:"--provenance"},{flag:"--provenance-summary"},{flag:"--harness",repeatable:!0},{flag:"--agent-instance",repeatable:!0},{flag:"--provenance-filter",repeatable:!0},{flag:"--follow"},{flag:"--interval-ms",value_type:"number"}],Z=M([{flag:"--for",value_name:"intent"},{flag:"--date"},{flag:"--from"},{flag:"--to"},{flag:"--past"},{flag:"--type"},{flag:"--tag"},{flag:"--priority"},{flag:"--assignee"},{flag:"--assignee-filter"},{flag:"--assignee_filter"},{flag:"--sprint"},{flag:"--release"},{flag:"--parent"},{flag:"--limit",aliases:["--max-items"]},{flag:"--after"},{flag:"--format"},{flag:"--depth"},{flag:"--fields",list:!0},{flag:"--section"},{flag:"--activity-limit"},{flag:"--stale-threshold"},{flag:"--explain-ranking"},{flag:"--explain_ranking"},{flag:"--token-budget",aliases:["--token_budget"]},{flag:"--no-extension-health"},{flag:"--no-tags"}],new Set(["--limit","--after","--format","--fields","--section","--activity-limit","--stale-threshold","--explain-ranking","--explain_ranking","--no-extension-health","--no-tags"])),La=[{flag:"--id",value_name:"item-id"},{flag:"--for",value_name:"intent"},{flag:"--token-budget",aliases:["--token_budget"]},{flag:"--depth"},{flag:"--full",value_type:"boolean"},{flag:"--fields",list:!0},{flag:"--at"},{flag:"--tree"},{flag:"--tree-depth"},{flag:"--tree_depth"},{flag:"--format"}],Ea=[{flag:"--list"},{flag:"--format"},{flag:"--depth"}],Ra=[{flag:"--id",value_name:"item-id"},{flag:"--format"},{flag:"--max-depth"},{flag:"--collapse"},{flag:"--summary"},{flag:"--full"},{flag:"--node-limit"},{flag:"--edge-limit"},{flag:"--token-budget"},{flag:"--cursor"},{flag:"--direction"},{flag:"--kind",list:!0}],Fa=[{flag:"--kind",list:!0},{flag:"--max-depth",description:`Maximum traversal depth; paths default to ${T.path_depth}.`},{flag:"--limit",description:`Maximum rows per collection; default ${T.rows}. Use --full to remove the row cap.`},{flag:"--after"},{flag:"--direction"},{flag:"--max-paths",description:`Maximum enumerated paths; default ${T.paths}.`},{flag:"--sample",description:`Maximum evidence examples per audit finding; default ${T.samples}.`},{flag:"--exempt-isolate",list:!0},{flag:"--exempt-isolate-type",list:!0},{flag:"--save-baseline"},{flag:"--rebuild"},{flag:"--clear"},{flag:"--summary"},{flag:"--full"}],Ia=[{flag:"--mode"},{flag:"--k"},{flag:"--fail-under"},{flag:"--queries"},{flag:"--format"}],_=[{flag:"--dry-run"},{flag:"--force"},{flag:"--author"},{flag:"--message"}],ce=[],Ga=[{flag:"--include-decisions"},{flag:"--include-gates"},{flag:"--include-containers"},{flag:"--for",value_name:"intent"},{flag:"--type"},{flag:"--tag"},{flag:"--priority"},{flag:"--assignee"},{flag:"--assignee-filter"},{flag:"--assignee_filter"},{flag:"--sprint"},{flag:"--release"},{flag:"--parent"},{flag:"--limit"},{flag:"--blocked-limit"},{flag:"--blocked_limit"},{flag:"--ready-only"},{flag:"--ready_only"},{flag:"--format"},{flag:"--explain-ranking"},{flag:"--explain_ranking"},{flag:"--token-budget",aliases:["--token_budget"]}],Pa=M([{flag:"--for",value_name:"intent"},{flag:"--token-budget",aliases:["--token_budget"]},{flag:"--mode"},{flag:"--semantic"},{flag:"--hybrid"},{flag:"--match-mode"},{flag:"--min-score"},{flag:"--count"},{flag:"--semantic-weight"},{flag:"--include-linked"},{flag:"--title-exact"},{flag:"--phrase-exact"},{flag:"--highlight"},{flag:"--compact"},{flag:"--full"},{flag:"--fields",list:!0},{flag:"--format"},{flag:"--limit"},{flag:"--after"},{flag:"--status",list:!0},{flag:"--type",list:!0},{flag:"--tag",aliases:["--tags"],list:!0},{flag:"--priority",list:!0},{flag:"--deadline-before"},{flag:"--deadline-after"},{flag:"--updated-after"},{flag:"--updated-before"},{flag:"--created-after"},{flag:"--created-before"},{flag:"--assignee",list:!0},{flag:"--sprint",list:!0},{flag:"--release",list:!0},{flag:"--parent"},...J],new Set(["--highlight","--compact","--full","--fields","--format","--limit","--token-budget","--after"])),Ma=[{flag:"--action"},{flag:"--command"},{flag:"--summary"},{flag:"--schema-only"},{flag:"--flags-only"},{flag:"--availability-only"},{flag:"--runtime-only"},{flag:"--active-only"},{flag:"--full"}],Da=[{flag:"--eager-tags"}];function gl(e){let a=new Set,l=[];for(let t of e){let i=(t.aliases??[]).join(","),f=`${t.flag}|${t.short??""}|${i}`;a.has(f)||(a.add(f),l.push(t))}return l}function O(e,a=!1){let l=new Map;for(let t of[...P,...e]){let i=x(t.flag),f=l.get(i),{aliases:c,...p}=t,o=b([...c??[],...t.flag===i?[]:[t.flag]]).filter(u=>u!==i),d={...p,flag:i,...o.length>0?{aliases:o}:{}},r=b([...f?.aliases??[],...d.aliases??[]]);l.set(i,f===void 0?d:{...f,...d,...r.length>0?{aliases:r}:{}})}if(a&&e.length>0&&!l.has("--format")){let t=l.get("--output-format");l.set("--output-format",{...t,aliases:[...t.aliases??[],"--format"]})}return G([...l.values()])}var $a=["list-draft","list-open","list-in-progress","list-blocked","list-closed","list-canceled"],Ua=I.filter(e=>e.flag!=="--status"&&e.flag!=="--all");function L(e){let a=new Map;for(let l of e)for(let t of[l.flag,...l.aliases??[]]){let i=a.get(t)??[];i.push(l),a.set(t,i)}return a}var za=L(ae),ja=L(oe),Xa=new Map([["assurance",ja],["plan",za],["workspace",L(ce)],["workspace snapshot",L(_)]]);function qa(e=h){return e.map(({command:a,parent:l,accepted_flags:t})=>{let i=Xa.get(l);if(!i)throw new Error(`Positional action ${a} has no flag-contract index for ${l}.`);let f=t.map(c=>{let p=i.get(c)??[];if(p.length!==1)throw new Error(`Positional action ${a} accepted flag ${c} does not resolve to exactly one ${l} flag contract.`);return p[0]});return[a,f]})}var Ha=qa(),pe=new Map([["list",I],["list-all",I],...$a.map(e=>[e,Ua]),["templates",V],["cal",W],["ctx",Z],["test-runs-worker",[]],["init",$e],["config",Ue],["extension",le],["package",B],["packages",B],["install",ea],["upgrade",se],["create",V],["item",[]],["item mutate",Aa],["item complete",ka],["item reopen",ba],["copy",Ca],["focus",Sa],["aggregate",Ce],["calendar",W],["context",Z],["get",La],["guide",Ea],["search",Pa],["next",Ga],["eval",Ia],["workspace",_],["workspace position",ce],["workspace snapshot",_],["workspace snapshot create",_],["workspace snapshot list",_],["workspace snapshot inspect",_],["workspace snapshot restore",_],["workspace snapshot delete",_],["history",Le],["history-redact",Re],["history-repair",Fe],["history-author-acknowledge",Ie],["history-compact",Ge],["history-attest",Pe],["merge",Ee],["schema",Me],["profile",De],["plan",ae],["activity",Oa],["events",xa],["restore",ia],["update",wa],["update-many",Na],["close",aa],["close-many",la],["delete",na],["append",ta],["comments",Se],["notes",we],["learnings",Ne],["files",Oe],["docs",xe],["deps",Ra],["graph",Fa],["test",da],["test-all",ma],["telemetry",ua],["health",Ta],["assurance",oe],...Ha,["validate",ya],["gc",_a],["stats",va],["duplicates",ha],["contracts",Ma],["completion",Da],["claim",sa],["release",oa],["start-task",ra],["pause-task",ga],["close-task",fa],["meet",ne],["event",ca],["remind",pa]]),de=new Map([["install",je],["uninstall",Xe],["explore",qe],["manage",We],["describe",He],["reload",Ze],["doctor",Qe],["catalog",K],["list",K],["adopt",Je],["adopt-all",Ye],["activate",Be],["deactivate",Ke],["migrate",Ve]]);function me(e){return typeof e!="string"?"":C(e.trim().toLowerCase())}function Q(e){let a=me(e);if(pe.has(a))return!0;let[l,t,...i]=a.split(/\s+/);return(l==="extension"||l==="package"||l==="packages")&&t!==void 0&&i.length===0&&(t==="init"||t==="scaffold"||de.has(t))}function Ya(e,a){return a==="init"||a==="scaffold"?e==="extension"?te:ze:de.get(a)??[]}function fl(e){let a=me(e);if(a.length===0)return O([]);let[l,t,...i]=a.split(/\s+/);if((l==="extension"||l==="package"||l==="packages")&&t!==void 0&&i.length===0)return(l==="package"||l==="packages")&&t==="upgrade"?O(se,!0):O(Ya(l,t),Q(a));let f=pe.get(a)??[];return O(f,Q(a))}function cl(e,a=!0){let l=G(e).flatMap(i=>[i.short,i.flag,...i.aliases??[]]).filter(i=>!!i),t=a?[...l,...P.flatMap(i=>[i.short,i.flag,...i.aliases??[]]).filter(i=>!!i)]:l;return b(t).join(" ")}export{b as a,F as b,ue as c,h as d,Ka as e,Te as f,Va as g,N as h,R as i,w as j,q as k,ye as l,S as m,Wa as n,Za as o,G as p,il as q,P as r,nl as s,I as t,Ce as u,Se as v,we as w,Ne as x,Oe as y,xe as z,Le as A,Ee as B,Re as C,Fe as D,Ie as E,Ge as F,Pe as G,Me as H,De as I,ae as J,$e as K,Ue as L,le as M,m as N,te as O,B as P,ze as Q,je as R,Xe as S,qe as T,He as U,Ye as V,Be as W,Ke as X,Ve as Y,We as Z,Ze as _,Qe as $,K as aa,Je as ba,ea as ca,se as da,ol as ea,aa as fa,la as ga,ta as ha,sa as ia,ia as ja,na as ka,oa as la,ra as ma,ga as na,fa as oa,ne as pa,ca as qa,pa as ra,da as sa,ma as ta,ua,rl as va,_a as wa,va as xa,ha as ya,Ta as za,ya as Aa,oe as Ba,V as Ca,Aa as Da,ka as Ea,ba as Fa,Ca as Ga,Sa as Ha,wa as Ia,Na as Ja,W as Ka,Oa as La,xa as Ma,Z as Na,La as Oa,Ea as Pa,Ra as Qa,Fa as Ra,Ia as Sa,_ as Ta,Ga as Ua,Pa as Va,Ma as Wa,Da as Xa,gl as Ya,qa as Za,Ha as _a,Q as $a,fl as ab,cl as bb};
2
+ //# sourceMappingURL=chunk-ZA6AEYIM.js.map