@unbrained/pm-cli 2026.8.25 → 2026.8.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 (206) hide show
  1. package/.agents/skills/HARNESS_COMPATIBILITY.md +32 -0
  2. package/.agents/skills/README.md +47 -0
  3. package/.agents/skills/pm-developer/SKILL.md +117 -0
  4. package/.agents/skills/pm-developer/references/COMMAND_PLAYBOOK.md +49 -0
  5. package/.agents/skills/pm-developer/references/GRAPH_AND_RELATIONSHIPS.md +91 -0
  6. package/.agents/skills/pm-developer/references/MULTI_AGENT_MERGE.md +72 -0
  7. package/.agents/skills/pm-developer/references/PROMPTS.md +17 -0
  8. package/.agents/skills/pm-developer/references/SCRIPTING_COMPOSITION.md +82 -0
  9. package/.agents/skills/pm-developer/references/TOKEN_BUDGETS.md +85 -0
  10. package/.agents/skills/pm-extensions/SKILL.md +106 -0
  11. package/.agents/skills/pm-extensions/references/AUTHORING.md +95 -0
  12. package/.agents/skills/pm-extensions/references/LIFECYCLE.md +40 -0
  13. package/.agents/skills/pm-extensions/references/TROUBLESHOOTING.md +25 -0
  14. package/.agents/skills/pm-sdk/SKILL.md +107 -0
  15. package/.agents/skills/pm-sdk/references/DOMAIN_MODELING.md +78 -0
  16. package/.agents/skills/pm-sdk/references/INTEGRATION_CHECKLIST.md +31 -0
  17. package/.agents/skills/pm-sdk/references/PROMPTS.md +13 -0
  18. package/.agents/skills/pm-sdk/references/SURFACE_MAP.md +82 -0
  19. package/.agents/skills/pm-user/SKILL.md +111 -0
  20. package/.agents/skills/pm-user/references/BACKLOG_SHAPING.md +105 -0
  21. package/.agents/skills/pm-user/references/PROMPTS.md +17 -0
  22. package/.agents/skills/pm-user/references/WORKFLOWS.md +35 -0
  23. package/.claude-plugin/marketplace.json +2 -2
  24. package/CHANGELOG.md +58 -3
  25. package/README.md +8 -5
  26. package/dist/cli/commander-usage.js +11 -7
  27. package/dist/cli/error-guidance.js +3 -3
  28. package/dist/cli/help-content.d.ts +2 -0
  29. package/dist/cli/help-content.js +53 -17
  30. package/dist/cli/help-json-payload.d.ts +8 -2
  31. package/dist/cli/help-json-payload.js +46 -12
  32. package/dist/cli/main.js +52 -74
  33. package/dist/cli/register-annotations.js +27 -21
  34. package/dist/cli/register-setup.js +98 -57
  35. package/dist/cli-bundle/bundle-manifest.json +156 -156
  36. package/dist/cli-bundle/chunks/chunk-3OO3W6FW.js +202 -0
  37. package/dist/cli-bundle/chunks/chunk-52EKTW6V.js +3 -0
  38. package/dist/cli-bundle/chunks/{chunk-QLUORNIB.js → chunk-CVBBGWW5.js} +62 -44
  39. package/dist/cli-bundle/chunks/chunk-MFNTKMTI.js +13 -0
  40. package/dist/cli-bundle/chunks/chunk-OS27HHBN.js +35 -0
  41. package/dist/cli-bundle/chunks/chunk-QTO7USTH.js +2 -0
  42. package/dist/cli-bundle/chunks/{chunk-5I5RWIJC.js → chunk-R4ETAOJC.js} +2 -2
  43. package/dist/cli-bundle/chunks/{chunk-OWHNAR2B.js → chunk-SH6P7FXI.js} +2 -2
  44. package/dist/cli-bundle/chunks/chunk-SHMDY36D.js +8 -0
  45. package/dist/cli-bundle/chunks/{chunk-244MI4GS.js → chunk-SKXLJIEK.js} +60 -60
  46. package/dist/cli-bundle/chunks/chunk-TNX6HC54.js +3 -0
  47. package/dist/cli-bundle/chunks/{register-list-query-XVN2ZLI7.js → register-list-query-EUWM6VII.js} +2 -2
  48. package/dist/cli-bundle/chunks/{register-mutation-QCKAEGIJ.js → register-mutation-FD4HSAVU.js} +4 -4
  49. package/dist/cli-bundle/chunks/{register-operations-SDEAXE7E.js → register-operations-HRMNFEC3.js} +2 -2
  50. package/dist/cli-bundle/chunks/register-setup-33GNICLX.js +2 -0
  51. package/dist/cli-bundle/focused-chunks/{chunk-IBZZZGK3.js → chunk-2AGZ5BRT.js} +2 -2
  52. package/dist/cli-bundle/focused-chunks/chunk-4BR5UU52.js +50 -0
  53. package/dist/cli-bundle/focused-chunks/{chunk-OHIHZ7HS.js → chunk-6GCRSLPG.js} +2 -2
  54. package/dist/cli-bundle/focused-chunks/{chunk-OVJL6NZE.js → chunk-AD6ULRAF.js} +4 -4
  55. package/dist/cli-bundle/focused-chunks/{chunk-7YCDTCBC.js → chunk-AQ5IYEZZ.js} +2 -2
  56. package/dist/cli-bundle/focused-chunks/{chunk-YO3ZF3FI.js → chunk-EKX37ZHA.js} +2 -2
  57. package/dist/cli-bundle/focused-chunks/{chunk-N7W67YIG.js → chunk-FC2AXLB5.js} +2 -2
  58. package/dist/cli-bundle/focused-chunks/{chunk-H5JZEIQV.js → chunk-HC7ODMH3.js} +2 -2
  59. package/dist/cli-bundle/focused-chunks/{chunk-NOOZGIXP.js → chunk-HVQ22RC4.js} +2 -2
  60. package/dist/cli-bundle/focused-chunks/{chunk-A644DUFQ.js → chunk-MEASX544.js} +2 -2
  61. package/dist/cli-bundle/focused-chunks/{chunk-RAFKLNZX.js → chunk-MXTYGECH.js} +2 -2
  62. package/dist/cli-bundle/focused-chunks/{chunk-2UIWOP3O.js → chunk-SUBSWYW3.js} +2 -2
  63. package/dist/cli-bundle/focused-chunks/{chunk-VXWATRFL.js → chunk-XDPYBQCF.js} +9 -9
  64. package/dist/cli-bundle/focused-chunks/{chunk-XUQPEKRN.js → chunk-Y3JJXRVK.js} +2 -2
  65. package/dist/cli-bundle/focused-chunks/{chunk-GQR3WH3F.js → chunk-Y5A7SJJ7.js} +2 -2
  66. package/dist/cli-bundle/focused-chunks/chunk-YHWHX6YY.js +2 -0
  67. package/dist/cli-bundle/focused-chunks/{chunk-ONYQCALA.js → chunk-YVVZ3LQ6.js} +6 -6
  68. package/dist/cli-bundle/focused-chunks/chunk-Z2USIBR2.js +5 -0
  69. package/dist/cli-bundle/main.js +15 -14
  70. package/dist/cli-bundle/sdk-authoring.js +1 -1
  71. package/dist/cli-bundle/sdk-contracts.js +2 -2
  72. package/dist/cli-bundle/sdk-core.js +31 -31
  73. package/dist/cli-bundle/sdk-governance.js +1 -1
  74. package/dist/cli-bundle/sdk-graph.js +1 -1
  75. package/dist/cli-bundle/sdk-merge.js +31 -31
  76. package/dist/cli-bundle/sdk-query.js +1 -1
  77. package/dist/cli-bundle/sdk-runtime.js +1 -1
  78. package/dist/cli-bundle/sdk-testing.js +1 -1
  79. package/dist/cli-bundle/sdk.js +32 -6
  80. package/dist/core/extensions/manifest-schema.d.ts +20 -0
  81. package/dist/core/extensions/manifest-schema.js +28 -10
  82. package/dist/core/governance/issue-codes.d.ts +11 -2
  83. package/dist/core/governance/issue-codes.js +29 -10
  84. package/dist/core/item/item-format.js +3 -3
  85. package/dist/core/store/item-store.js +12 -5
  86. package/dist/mcp/http-server.d.ts +60 -0
  87. package/dist/mcp/http-server.js +451 -0
  88. package/dist/mcp/legacy-adapter.d.ts +50 -0
  89. package/dist/mcp/legacy-adapter.js +64 -0
  90. package/dist/mcp/server.d.ts +42 -9
  91. package/dist/mcp/server.js +572 -59
  92. package/dist/mcp/tool-definitions.d.ts +2 -0
  93. package/dist/mcp/tool-definitions.js +2 -2
  94. package/dist/sdk/agent/closed-domain-contracts.d.ts +1 -1
  95. package/dist/sdk/agent/closed-domain-contracts.js +24 -2
  96. package/dist/sdk/agent/refusal-closure-census.d.ts +6 -2
  97. package/dist/sdk/agent/refusal-closure-census.js +16 -8
  98. package/dist/sdk/agent-capability-contracts.js +6 -2
  99. package/dist/sdk/cli-bootstrap.js +3 -2
  100. package/dist/sdk/cli-contracts/command-aliases.js +15 -2
  101. package/dist/sdk/cli-contracts/enum-contracts.d.ts +4 -1
  102. package/dist/sdk/cli-contracts/enum-contracts.js +7 -2
  103. package/dist/sdk/cli-contracts/flag-contracts.js +9 -5
  104. package/dist/sdk/cli-contracts/grammar-contracts.d.ts +3 -3
  105. package/dist/sdk/cli-contracts/grammar-contracts.js +24 -17
  106. package/dist/sdk/cli-contracts/runtime-contracts.js +13 -11
  107. package/dist/sdk/cli-contracts/tool-schema.js +18 -15
  108. package/dist/sdk/cli-contracts.d.ts +1 -1
  109. package/dist/sdk/cli-contracts.js +3 -3
  110. package/dist/sdk/cli-program.js +3 -2
  111. package/dist/sdk/completion.js +40 -13
  112. package/dist/sdk/compose.d.ts +4 -1
  113. package/dist/sdk/compose.js +23 -36
  114. package/dist/sdk/extension/author-manifest.d.ts +22 -0
  115. package/dist/sdk/extension/author-manifest.js +93 -0
  116. package/dist/sdk/extension.js +6 -3
  117. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +20 -5
  118. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +18 -3
  119. package/dist/sdk/governance/health.js +7 -2
  120. package/dist/sdk/governance/upgrade.d.ts +2 -0
  121. package/dist/sdk/governance/upgrade.js +30 -8
  122. package/dist/sdk/governance/validate.js +8 -6
  123. package/dist/sdk/guide-topics.js +6 -6
  124. package/dist/sdk/index.d.ts +10 -2
  125. package/dist/sdk/index.js +11 -3
  126. package/dist/sdk/mcp/apps.d.ts +70 -0
  127. package/dist/sdk/mcp/apps.js +154 -0
  128. package/dist/sdk/mcp/authorization.d.ts +134 -0
  129. package/dist/sdk/mcp/authorization.js +405 -0
  130. package/dist/sdk/mcp/interactions.d.ts +118 -0
  131. package/dist/sdk/mcp/interactions.js +337 -0
  132. package/dist/sdk/mcp/protocol.d.ts +142 -0
  133. package/dist/sdk/mcp/protocol.js +174 -0
  134. package/dist/sdk/mcp/skills.d.ts +127 -0
  135. package/dist/sdk/mcp/skills.js +390 -0
  136. package/dist/sdk/mcp/subscriptions.d.ts +65 -0
  137. package/dist/sdk/mcp/subscriptions.js +212 -0
  138. package/dist/sdk/mcp/tasks.d.ts +107 -0
  139. package/dist/sdk/mcp/tasks.js +431 -0
  140. package/dist/sdk/mcp/transport.d.ts +30 -0
  141. package/dist/sdk/mcp/transport.js +261 -0
  142. package/dist/sdk/merge/receipts.d.ts +16 -0
  143. package/dist/sdk/merge/receipts.js +9 -8
  144. package/dist/sdk/read-output-contracts.js +16 -3
  145. package/dist/sdk/runtime-action-aliases.js +7 -3
  146. package/dist/sdk/runtime-input.js +12 -4
  147. package/dist/sdk/runtime-primitives.d.ts +2 -2
  148. package/dist/sdk/runtime-primitives.js +4 -4
  149. package/dist/sdk/test/execution.d.ts +6 -0
  150. package/dist/sdk/test/execution.js +32 -3
  151. package/docs/AGENT_PROVENANCE_ADR.md +6 -4
  152. package/docs/AGENT_RUNTIME_PRIMITIVES.md +6 -5
  153. package/docs/CLAUDE_CODE_PLUGIN.md +12 -5
  154. package/docs/CLI_GRAMMAR.md +7 -1
  155. package/docs/COMMANDS.md +2 -2
  156. package/docs/DIAGNOSTIC_OUTPUT_CONTRACTS.md +8 -0
  157. package/docs/EXTENSIONS.md +36 -36
  158. package/docs/MCP_2026_07_28.md +160 -0
  159. package/docs/MCP_2026_07_28_CONFORMANCE.md +30 -0
  160. package/docs/MCP_REMOTE_TRANSPORT_SECURITY.md +180 -0
  161. package/docs/MCP_SKILLS_AND_APPS.md +107 -0
  162. package/docs/QUICKSTART.md +15 -15
  163. package/docs/README.md +5 -0
  164. package/docs/RELEASING.md +12 -3
  165. package/docs/SDK.md +22 -1
  166. package/docs/SDK_AGENT_SESSION_CONTEXT.md +18 -13
  167. package/docs/SDK_CONTEXT_INTEGRITY.md +6 -0
  168. package/docs/SDK_EVIDENCE_TRACEABILITY.md +9 -1
  169. package/docs/SDK_MCP_INTERACTIONS.md +227 -0
  170. package/docs/TESTING.md +4 -0
  171. package/docs/generated/AGENT_CAPABILITY_ROUTING.md +1 -1
  172. package/docs/generated/REFUSAL_CLOSURE_CENSUS.md +13 -11
  173. package/marketplace.json +2 -2
  174. package/package.json +15 -11
  175. package/packages/pm-beads/README.md +12 -6
  176. package/packages/pm-beads/docs/MIGRATION.md +53 -0
  177. package/packages/pm-beads/extensions/beads/index.ts +8 -0
  178. package/packages/pm-beads/extensions/beads/runtime.ts +671 -112
  179. package/packages/pm-beads/package.json +1 -1
  180. package/packages/pm-calendar/package.json +1 -1
  181. package/packages/pm-command-kit/package.json +1 -1
  182. package/packages/pm-digital-twin/package.json +1 -1
  183. package/packages/pm-governance-audit/package.json +1 -1
  184. package/packages/pm-guide-shell/package.json +1 -1
  185. package/packages/pm-kanban/package.json +1 -1
  186. package/packages/pm-lifecycle-hooks/package.json +1 -1
  187. package/packages/pm-linked-test-adapters/package.json +1 -1
  188. package/packages/pm-search-advanced/package.json +1 -1
  189. package/packages/pm-templates/package.json +1 -1
  190. package/packages/pm-todos/package.json +1 -1
  191. package/packages/pm-vcs/package.json +1 -1
  192. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  193. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  194. package/scripts/finalize-build.mjs +1 -0
  195. package/sdk/public-surface.json +902 -54
  196. package/dist/cli-bundle/chunks/chunk-2F3LUFMW.js +0 -8
  197. package/dist/cli-bundle/chunks/chunk-65MHLHAA.js +0 -2
  198. package/dist/cli-bundle/chunks/chunk-6C7GIMIL.js +0 -13
  199. package/dist/cli-bundle/chunks/chunk-QKGMHGEI.js +0 -202
  200. package/dist/cli-bundle/chunks/chunk-T2ENPRXF.js +0 -3
  201. package/dist/cli-bundle/chunks/chunk-TPQIBSL2.js +0 -3
  202. package/dist/cli-bundle/chunks/chunk-YQMYF3YD.js +0 -35
  203. package/dist/cli-bundle/chunks/register-setup-LXVBRCJ3.js +0 -2
  204. package/dist/cli-bundle/focused-chunks/chunk-42S3GGZ7.js +0 -50
  205. package/dist/cli-bundle/focused-chunks/chunk-7I23XGWO.js +0 -2
  206. package/dist/cli-bundle/focused-chunks/chunk-LMKG3DFE.js +0 -5
@@ -0,0 +1,3 @@
1
+ import{Ia as _e,na as ce}from"./chunk-SKXLJIEK.js";import{Ac as R,C as s,Ch as O,Dj as le,E as l,Fe as ae,Ha as G,Oa as I,Pa as x,Uh as ie,Wa as b,Ya as ee,Za as te,bi as oe,c as P,da as J,di as w,fc as re,ja as Z,ti as se,wh as k,yd as ne}from"./chunk-3OO3W6FW.js";import{execFile as Ue}from"node:child_process";import ze from"node:path";import{promisify as je}from"node:util";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="46439d77-bb74-5f36-9383-ac3362f41b3e")}catch{}})();var Fe=je(Ue),Me="@unbrained/pm-cli",Ve="latest",Ke={global:["--global"],project:[]};function de(e){let t=e.project===!0||e.local===!0||e.scope==="project",r=e.global===!0||e.scope==="global";if(t&&r)throw new l('Options "--project/--local" and "--global" are mutually exclusive.',s.USAGE);return r?"global":"project"}function E(e){return e.trim().toLowerCase()}function ue(e,t){let r=E(t);return[e.name,e.directory,e.source.input,e.source.location,e.source.package,e.source.repository,e.source.owner&&e.source.repo?`${e.source.owner}/${e.source.repo}`:void 0].some(i=>typeof i=="string"&&E(i)===r)}function Ye(e,t){let r=b(process.cwd(),t.path),n=re(r,process.cwd());return{selected_root:e==="global"?n.global:n.project}}async function Be(e,t,r){try{let n=await Fe(e,t,{cwd:r?.cwd,encoding:"utf8"});return{stdout:n.stdout,stderr:n.stderr}}catch(n){let i=typeof n=="object"&&n!==null&&"stderr"in n?String(n.stderr??""):"",a=i.trim().length>0?i.trim():n instanceof Error?n.message:String(n);throw new l(`Command failed: ${e} ${t.join(" ")}
2
+ ${a}`,s.GENERIC_FAILURE)}}async function We(){return Z(import.meta.url,["../../.."])}function A(e){return typeof e.tag=="string"&&e.tag.trim().length>0?e.tag.trim():Ve}function C(e){return typeof e.packageName=="string"&&e.packageName.trim().length>0?e.packageName.trim():Me}async function He(e,t){let r=e.commandRunner??Be,n=C(e),i=A(e),a=`${n}@${i}`,o=["npm","install","-g",a];e.repair===!0&&o.push("--force");let _=await We(),c={requested:!0,status:"planned",package:n,target:a,command:o,before_version:_,repair:e.repair===!0};if(t)return c;try{await r(o[0],o.slice(1));let d=await r("pm",["--version"]);return{...c,status:"updated",after_version:d.stdout.trim()||void 0}}catch(d){return{...c,status:"failed",error:d instanceof Error?d.message:String(d)}}}function Qe(e){return ze.isAbsolute(e)||e.startsWith(".")||e.startsWith("..")||e.startsWith("file:")}function Xe(e,t){if(e.kind==="npm"){let r=e.input.startsWith("npm:")?e.input.slice(4).trim():e.input.trim();return!Qe(r)&&e.package&&e.package.trim().length>0?`npm:${e.package.trim()}@${t}`:e.input.startsWith("npm:")?e.input:`npm:${e.input}`}return e.input}async function Je(e,t){let r=Xe(e,t);return e.kind!=="local"||await P(r)?r:await P(e.location)?e.location:r}function Ze(e,t,r,n){let i=["pm","package","install",t,r==="global"?"--global":"--project"];return e.kind==="github"&&n&&n.trim().length>0&&i.push("--ref",n.trim()),i}async function fe(e,t){let r=Ye(e,t);return(await ce(r.selected_root)).state.entries.filter(i=>i.scope===e)}async function xe(e,t,r){let n=await fe(e,t);return n.find(i=>ue(i,r.name))??n.find(i=>E(i.directory)===E(r.directory))}async function et(e,t,r,n,i){let a=A(t),o=await Je(e.source,a),_=Ze(e.source,o,n,e.source.ref),c={name:e.name,directory:e.directory,scope:n,source:e.source,status:"planned",command:_,previous_version:e.manifest_version};if(i)return c;try{await _e(o,{install:!0,project:n==="project",global:n==="global",ref:e.source.kind==="github"?e.source.ref:void 0},r);let d=await xe(n,r,e);return{...c,status:"updated",installed_version:d?.manifest_version}}catch(d){return{...c,status:"failed",error:d instanceof Error?d.message:String(d)}}}function tt(e,t,r,n){let i=[r?e.status:void 0,...t.map(a=>a.status)].filter(a=>typeof a=="string");return{requested_cli:r,requested_packages:n,planned:i.filter(a=>a==="planned").length,updated:i.filter(a=>a==="updated").length,skipped:i.filter(a=>a==="skipped").length,failed:i.filter(a=>a==="failed").length}}async function ur(e,t,r){let n=typeof e=="string"&&e.trim().length>0?e.trim():void 0;if(t.cliOnly===!0&&t.packagesOnly===!0){let h=["package","upgrade",...n?[n]:[],"--packages-only","--dry-run",...Ke[de(t)]];throw new l('Options "--cli-only" and "--packages-only" are mutually exclusive.',s.USAGE,{code:"package_upgrade_modes_mutually_exclusive",recovery:{suggested_retry:ae(h),suggested_retry_args:h}})}let i=de(t),a=t.dryRun===!0;if(t.cliOnly===!0&&n)throw new l('A package target cannot be used with "--cli-only".',s.USAGE);let o=!(t.packagesOnly===!0||n),_=t.cliOnly!==!0,c=o?await He(t,a):{requested:!1,status:"skipped",package:C(t),target:`${C(t)}@${A(t)}`,command:["npm","install","-g",`${C(t)}@${A(t)}`],repair:t.repair===!0,reason:"not_requested"},d=_?await fe(i,r):[];if(n&&(d=d.filter(h=>ue(h,n)),d.length===0))throw new l(`Managed package "${n}" was not found in ${i} scope.`,s.NOT_FOUND);let g=[];for(let h of d)g.push(await et(h,t,r,i,a));let y=tt(c,g,o,_);return{ok:y.failed===0,action:"upgrade",dry_run:a,scope:i,target:n,cli:c,packages:g,summary:y}}(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]="09703f32-9491-5d3a-9f90-f038d9982e17")}catch{}})();var rt=/^[a-z0-9]+(?:-[a-z0-9]+)*$/u,T=128,nt=1e4;function ge(e){let t=e?.trim();if(!t||t==="__proto__"||t.length>T)throw new Error(`A legacy author must contain 1-${T} characters.`);return t}function at(e){let t=e?.trim().toLowerCase();if(!t||!rt.test(t))throw new Error("A canonical harness must be a lowercase dash-separated namespace.");return t}function it(e){return Object.fromEntries(Object.entries(e).sort(([t],[r])=>t.localeCompare(r)))}function ot(e,t){let r=new Set;for(let n of(e??[]).slice(0,nt)){let i=n.trim().slice(0,T);i.length===0||i.startsWith("harness:")||Object.hasOwn(t,i)||r.add(i)}return r.size}function st(e,t){let r=ge(t.legacy_author),n=at(t.canonical_harness);if(r===n||r===`harness:${n}`||r.startsWith("harness:"))throw new Error(`The legacy author "${r}" is already canonical and must not be aliased.`);return e[r]===n?!1:(e[r]=n,!0)}function lt(e,t){if(t.operation==="add")return st(e,t);if(t.operation==="remove"){let n=ge(t.legacy_author);return Object.hasOwn(e,n)?(delete e[n],!0):!1}if(t.operation==="clear"){let n=Object.keys(e).length>0;for(let i of Object.keys(e))delete e[i];return n}let r=t.operation;throw new Error(`Unsupported vocabulary operation: ${String(r)}`)}function N(e){return{version:e?.version??1,alias_count:Object.keys(e?.aliases??{}).length}}function me(e,t){let r=e?.version??1,n={...e?.aliases},i=lt(n,t),a={version:i?r+1:r,aliases:it(n)};return{vocabulary:a,preview:{operation:t.operation,changed:i,version_before:r,version_after:a.version,alias_count:Object.keys(a.aliases).length,residual_author_count:ot(t.observed_authors,a.aliases)}}}(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]="77fa2822-1681-59d5-8388-037cf13c45dd")}catch{}})();var pe=new Set(["item_format"]),ye=new Set(["definition_of_done","metadata_required_fields","lifecycle_stale_blocker_reason_patterns","lifecycle_closure_like_blocked_reason_patterns","lifecycle_closure_like_resolution_patterns","lifecycle_closure_like_actual_result_patterns"]),ct=new Set(["history_missing_stream_policy","sprint_release_format_policy","parent_reference_policy","metadata_validation_profile","governance_preset","governance_ownership_enforcement","governance_create_mode_default","governance_close_validation_default","governance_require_close_reason","governance_create_default_type","governance_workflow_enforcement","governance_parent_reference_policy","governance_metadata_validation_profile","governance_force_required_for_stale_lock","test_result_tracking","untrusted_linked_test_execution","telemetry_tracking","agent_identity_vocabulary"]),_t=new Set(["governance_require_close_reason","governance_force_required_for_stale_lock","test_result_tracking","untrusted_linked_test_execution","telemetry_tracking"]),dt={off:"disabled",on:"enabled",true:"enabled",false:"disabled",enabled:"enabled",disabled:"disabled"};function ut(e){let t=e.trim().toLowerCase().replaceAll("-","_");if(pe.has(t)||ye.has(t)||ct.has(t)||t==="context")return t}function ft(e){let t=e.trim().toLowerCase();return dt[t]??e}function he(e,t){let r=ut(e);return r===void 0?{routable:!1,reason:`Unknown config key "${e}" cannot route a positional value.`}:r==="context"?{routable:!1,reason:"Config set context does not accept a positional value. Use --default-depth, --activity-limit, --stale-threshold-days, or --section-<name> flags."}:pe.has(r)?{routable:!0,flag:"format",value:t}:ye.has(r)?{routable:!0,flag:"criterion",values:[t]}:{routable:!0,flag:"policy",value:_t.has(r)?ft(t):t}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="4e50d57b-4502-5ce5-a6dd-0bdc8eba5af4")}catch{}})();var S=[{key:"search_provider",path:"search.provider",kind:"string",summary:"Search embedding provider name (e.g. openai, ollama, or an extension provider)."},{key:"search_mutation_refresh_policy",path:"search.mutation_refresh_policy",kind:"string",choices:["cache_only","semantic_configured","semantic_auto"],summary:"Mutation-time search refresh policy: cache_only, semantic_configured, or semantic_auto."},{key:"search_query_expansion_enabled",path:"search.query_expansion.enabled",kind:"boolean",summary:"Enable or disable query expansion for semantic/hybrid search."},{key:"search_query_expansion_provider",path:"search.query_expansion.provider",kind:"string",summary:"Query expansion provider name (built-in openai/ollama or extension provider)."},{key:"search_rerank_enabled",path:"search.rerank.enabled",kind:"boolean",summary:"Enable or disable post-retrieval reranking for hybrid search."},{key:"search_rerank_model",path:"search.rerank.model",kind:"string",summary:"Rerank model name override used by built-in providers."},{key:"search_rerank_top_k",path:"search.rerank.top_k",kind:"integer",min:1,summary:"Number of top hybrid candidates to rerank when rerank is enabled."},{key:"search_embedding_model",path:"search.embedding_model",kind:"string",summary:"Default embedding model name (overrides provider-specific model when set)."},{key:"search_embedding_corpus_max_characters",path:"search.embedding_corpus_max_characters",kind:"integer",min:1,summary:"Maximum semantic corpus characters per item before truncation."},{key:"search_embedding_batch_size",path:"search.embedding_batch_size",kind:"integer",min:1,summary:"Number of items embedded per request batch."},{key:"search_embedding_timeout_ms",path:"search.embedding_timeout_ms",kind:"integer",min:1,summary:"Per-request embedding timeout in milliseconds."},{key:"search_score_threshold",path:"search.score_threshold",kind:"number",summary:"Minimum score for a hit to be returned (0 keeps all matches)."},{key:"search_hybrid_semantic_weight",path:"search.hybrid_semantic_weight",kind:"ratio",summary:"Hybrid mode semantic weight in [0, 1] (1-weight goes to keyword)."},{key:"search_max_results",path:"search.max_results",kind:"integer",min:1,summary:"Default upper bound on search hits when --limit is not supplied."},{key:"search_bm25_k1",path:"search.bm25.k1",kind:"number",min:0,summary:"Offline BM25 term-frequency saturation (k1); higher saturates repeated terms slower (default 1.2)."},{key:"search_bm25_b",path:"search.bm25.b",kind:"ratio",summary:"Offline BM25 document-length normalization (b) in [0, 1]; 0 disables, 1 fully normalizes (default 0.75)."},{key:"openai_base_url",path:"providers.openai.base_url",kind:"string",summary:"OpenAI-compatible API base URL (LM Studio/vLLM also use this)."},{key:"openai_api_key",path:"providers.openai.api_key",kind:"string",summary:"OpenAI-compatible API key."},{key:"openai_model",path:"providers.openai.model",kind:"string",summary:"OpenAI-compatible embedding model name."},{key:"ollama_base_url",path:"providers.ollama.base_url",kind:"string",summary:"Ollama API base URL (typically http://localhost:11434)."},{key:"ollama_model",path:"providers.ollama.model",kind:"string",summary:"Ollama embedding model name (e.g. nomic-embed-text)."},{key:"vector_store_adapter",path:"vector_store.adapter",kind:"string",summary:"Vector store adapter name (lancedb, qdrant, or an extension adapter)."},{key:"vector_store_collection_name",path:"vector_store.collection_name",kind:"string",non_empty:!0,summary:"Vector collection/table name shared by Qdrant and LanceDB adapters."},{key:"qdrant_url",path:"vector_store.qdrant.url",kind:"string",summary:"Qdrant HTTP API URL."},{key:"qdrant_api_key",path:"vector_store.qdrant.api_key",kind:"string",summary:"Qdrant API key (empty if running unauthenticated)."},{key:"lancedb_path",path:"vector_store.lancedb.path",kind:"string",summary:"LanceDB storage path (relative to pm root or absolute)."},{key:"id_prefix",path:"id_prefix",kind:"string",non_empty:!0,summary:'Prefix for generated item IDs (e.g. "pm" produces pm-xxxx).'},{key:"author_default",path:"author_default",kind:"string",non_empty:!0,summary:"Default author recorded on mutations when --author is not supplied."},{key:"agent_identity_probes_enabled",path:"agent_identity.probes_enabled",kind:"boolean",summary:"Allow privacy-bounded local harness provenance probes; no network or subprocess access is permitted."},{key:"mutation_guard_require_attributed_author",path:"mutation_guard.require_attributed_author",kind:"boolean",summary:"Reject mutations whose effective author resolves to unknown."},{key:"mutation_guard_secret_guard",path:"mutation_guard.secret_guard",kind:"string",choices:["off","advise","block"],summary:"Detect credential-shaped mutation content: off, advise, or block."},{key:"mutation_guard_stale_in_progress_hours",path:"mutation_guard.stale_in_progress_hours",kind:"integer",min:1,summary:"Age threshold for unclaimed in-progress work surfaced by health."},{key:"governance_duplicate_detection_mode",path:"governance.duplicate_detection_mode",kind:"string",choices:["off","advisory","strict"],summary:"Create/copy duplicate governance: off, advisory, or strict explicit-bypass enforcement."},{key:"governance_duplicate_detection_threshold",path:"governance.duplicate_detection_threshold",kind:"ratio",summary:"Minimum shared similarity score in [0, 1] for create/copy duplicate governance."},{key:"governance_duplicate_detection_limit",path:"governance.duplicate_detection_limit",kind:"integer",min:0,max:20,summary:"Maximum likely duplicates returned by create/copy governance (0-20)."},{key:"output_default_format",path:"output.default_format",kind:"string",choices:["toon","json"],summary:"Default output format for commands that support it: toon or json."},{key:"ux_deprecation_hints",path:"ux.deprecation_hints",kind:"boolean",summary:"Emit one stderr migration hint for deprecated command aliases."},{key:"locks_ttl_seconds",path:"locks.ttl_seconds",kind:"integer",min:1,summary:"Claim/lock time-to-live in seconds before a stale lock can be reclaimed."},{key:"locks_wait_ms",path:"locks.wait_ms",kind:"integer",min:0,summary:"Bounded jittered wait in milliseconds before a contended item mutation fails with lock_conflict; 0 fails fast. PM_LOCK_WAIT_MS overrides per invocation."},{key:"ids_token_length",path:"ids.token_length",kind:"integer",min:4,max:12,summary:"Random base36 token length for newly minted item ids (4-12, default 4). Raise it to shrink cross-branch id collision odds in concurrent multi-agent workflows (pm-pibw)."},{key:"checkpoints_retention_days",path:"checkpoints.retention_days",kind:"integer",min:1,summary:"Age in days above which pm gc --scope checkpoints prunes bulk-mutation rollback checkpoints."},{key:"schema_unknown_field_policy",path:"schema.unknown_field_policy",kind:"string",choices:["allow","warn","reject"],summary:"How item I/O handles metadata keys not in the field registry: allow, warn, or reject."},{key:"history_compact_policy_enabled",path:"history.compact_policy.enabled",kind:"boolean",summary:"Enable the history-compaction advisory: pm health warns on over-threshold streams."},{key:"history_compact_policy_max_entries",path:"history.compact_policy.max_entries",kind:"integer",min:1,summary:"Entry count above which a history stream is flagged (and the default pm history-compact --all-over threshold)."},{key:"history_compact_policy_trigger",path:"history.compact_policy.trigger",kind:"string",choices:["health_warn","auto"],summary:"History-compaction policy intent: health_warn (advisory only) or auto (scheduled sweeps expected)."}],gt=new Map(S.flatMap(e=>[[e.key,e],[e.path.toLowerCase().replaceAll("-","_"),e]]));function ve(e){if(typeof e!="string")return;let t=e.trim().toLowerCase().replaceAll("-","_");if(t.length!==0)return gt.get(t)}function mt(e,t){let r=t.trim().toLowerCase();return r==="true"||r==="1"||r==="yes"||r==="on"?{ok:!0,parsed:{descriptor:e,value:!0}}:r==="false"||r==="0"||r==="no"||r==="off"?{ok:!0,parsed:{descriptor:e,value:!1}}:{ok:!1,error:{message:`Config set ${e.key} requires a boolean value (true|false), got "${t}"`}}}function pt(e,t,r){return e.non_empty===!0&&r.length===0?{ok:!1,error:{message:`Config set ${e.key} requires a non-empty value`}}:e.choices&&!e.choices.includes(r)?{ok:!1,error:{message:`Config set ${e.key} must be one of ${e.choices.join("|")}, got "${t}"`}}:{ok:!0,parsed:{descriptor:e,value:r}}}function yt(e,t,r){if(r.length===0)return{ok:!1,error:{message:`Config set ${e.key} requires a non-empty value`}};let n=Number(r);return Number.isFinite(n)?{ok:!0,value:n}:{ok:!1,error:{message:`Config set ${e.key} requires a finite number, got "${t}"`}}}function ht(e,t,r){return!Number.isInteger(r)||r<0?{ok:!1,error:{message:`Config set ${e.key} requires a non-negative integer, got "${t}"`}}:e.min!==void 0&&r<e.min?{ok:!1,error:{message:`Config set ${e.key} requires an integer >= ${e.min}, got "${t}" (the runtime silently ignores 0 here and falls back to the default)`}}:e.max!==void 0&&r>e.max?{ok:!1,error:{message:`Config set ${e.key} requires an integer <= ${e.max}, got "${t}"`}}:{ok:!0,parsed:{descriptor:e,value:r}}}function vt(e,t,r){return r<0||r>1?{ok:!1,error:{message:`Config set ${e.key} requires a number in [0, 1], got "${t}"`}}:{ok:!0,parsed:{descriptor:e,value:r}}}function wt(e,t,r){return e.min!==void 0&&r<e.min?{ok:!1,error:{message:`Config set ${e.key} requires a number >= ${e.min}, got "${t}"`}}:{ok:!0,parsed:{descriptor:e,value:r}}}function we(e,t){if(typeof t!="string")return{ok:!1,error:{message:`Config set ${e.key} requires a string value`}};let r=t.trim();if(e.kind==="boolean")return mt(e,t);if(e.kind==="string")return pt(e,t,r);let n=yt(e,t,r);return n.ok?e.kind==="integer"?ht(e,t,n.value):e.kind==="ratio"?vt(e,t,n.value):wt(e,t,n.value):{ok:!1,error:n.error}}function $(e,t){let r=t.path.split("."),n=e;for(let i of r){if(typeof n!="object"||n===null)return null;n=n[i]}return typeof n=="string"||typeof n=="number"||typeof n=="boolean"?n:null}function be(e,t,r){let n=t.path.split("."),i=e;for(let _=0;_<n.length-1;_+=1){let c=n[_],d=i[c];if(typeof d!="object"||d===null||Array.isArray(d)){let g={};i[c]=g,i=g}else i=d}let a=n[n.length-1];return i[a]===r?!1:(i[a]=r,!0)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="2f750f85-6c55-5f0f-b5c0-396764839d2a")}catch{}})();var ke=["project","global"],p={definition_of_done:["definition-of-done","definition_of_done"],item_format:["item-format","item_format"],history_missing_stream_policy:["history-missing-stream-policy","history_missing_stream_policy"],sprint_release_format_policy:["sprint-release-format-policy","sprint_release_format_policy"],parent_reference_policy:["parent-reference-policy","parent_reference_policy"],metadata_validation_profile:["metadata-validation-profile","metadata_validation_profile"],metadata_required_fields:["metadata-required-fields","metadata_required_fields"],lifecycle_stale_blocker_reason_patterns:["lifecycle-stale-blocker-reason-patterns","lifecycle_stale_blocker_reason_patterns"],lifecycle_closure_like_blocked_reason_patterns:["lifecycle-closure-like-blocked-reason-patterns","lifecycle_closure_like_blocked_reason_patterns"],lifecycle_closure_like_resolution_patterns:["lifecycle-closure-like-resolution-patterns","lifecycle_closure_like_resolution_patterns"],lifecycle_closure_like_actual_result_patterns:["lifecycle-closure-like-actual-result-patterns","lifecycle_closure_like_actual_result_patterns"],governance_preset:["governance-preset","governance_preset"],governance_ownership_enforcement:["governance-ownership-enforcement","governance_ownership_enforcement"],governance_create_mode_default:["governance-create-mode-default","governance_create_mode_default"],governance_close_validation_default:["governance-close-validation-default","governance_close_validation_default"],governance_require_close_reason:["governance-require-close-reason","governance_require_close_reason"],governance_create_default_type:["governance-create-default-type","governance_create_default_type"],governance_workflow_enforcement:["governance-workflow-enforcement","governance_workflow_enforcement"],governance_parent_reference_policy:["governance-parent-reference-policy","governance_parent_reference_policy"],governance_metadata_validation_profile:["governance-metadata-validation-profile","governance_metadata_validation_profile"],governance_force_required_for_stale_lock:["governance-force-required-for-stale-lock","governance_force_required_for_stale_lock"],test_result_tracking:["test-result-tracking","test_result_tracking"],untrusted_linked_test_execution:["untrusted-linked-test-execution","untrusted_linked_test_execution"],telemetry_tracking:["telemetry-tracking","telemetry_tracking"],agent_identity_vocabulary:["agent-identity-vocabulary","agent_identity_vocabulary"],context:["context"]},bt=Object.keys(p).map(e=>p[e][0]),kt=Object.fromEntries(Object.keys(p).flatMap(e=>p[e].map(t=>[t,e]))),Ct={definition_of_done:"Definition of Done criteria list.",item_format:"Default item file format.",history_missing_stream_policy:"Missing history stream handling policy.",sprint_release_format_policy:"Sprint/release format validation policy.",parent_reference_policy:"Parent reference validation policy.",metadata_validation_profile:"Validate metadata profile policy (core|strict|custom).",metadata_required_fields:"Validate custom metadata required-fields list.",lifecycle_stale_blocker_reason_patterns:"Validate lifecycle stale-blocker reason substring patterns (criteria list).",lifecycle_closure_like_blocked_reason_patterns:"Validate lifecycle closure-like blocked_reason substring patterns (criteria list).",lifecycle_closure_like_resolution_patterns:"Validate lifecycle closure-like resolution substring patterns (criteria list).",lifecycle_closure_like_actual_result_patterns:"Validate lifecycle closure-like actual_result substring patterns (criteria list).",governance_preset:"Governance preset policy (minimal|default|strict|custom).",governance_ownership_enforcement:"Governance ownership enforcement policy (none|warn|strict).",governance_create_mode_default:"Governance default create mode (progressive|strict).",governance_close_validation_default:"Governance default close validation mode (off|warn|strict).",governance_require_close_reason:"Governance close-reason requirement policy (enabled|disabled).",governance_create_default_type:"Governance default item type for `pm create` when --type is omitted.",governance_workflow_enforcement:"Governance per-type transition enforcement mode (off|warn|strict).",governance_parent_reference_policy:"Governance parent reference policy (warn|strict_error).",governance_metadata_validation_profile:"Governance metadata validation profile (core|strict|custom).",governance_force_required_for_stale_lock:"Governance stale-lock force policy (enabled|disabled).",test_result_tracking:"Item-level linked test result persistence policy.",untrusted_linked_test_execution:"Permit an explicit per-run override for commands not trusted by this clone.",telemetry_tracking:"Telemetry usage reporting policy.",agent_identity_vocabulary:"Versioned exact legacy-author interpretation vocabulary (summary only).",context:"Context command settings (depth, section toggles, limits)."},Et=["lifecycle_stale_blocker_reason_patterns","lifecycle_closure_like_blocked_reason_patterns","lifecycle_closure_like_resolution_patterns","lifecycle_closure_like_actual_result_patterns"],At=new Set(["metadata_required_fields",...Et]),St=new Set(["test_result_tracking","untrusted_linked_test_execution","telemetry_tracking"]),qt=new Set(["governance_require_close_reason","governance_force_required_for_stale_lock"]),Pt=new Set(["governance_ownership_enforcement","governance_create_mode_default","governance_close_validation_default"]),Gt=new Set(["governance_parent_reference_policy","governance_metadata_validation_profile","governance_workflow_enforcement"]),It=new Set(["governance_preset","governance_create_default_type"]),Ae=e=>At.has(e),Rt=e=>Pt.has(e),Ot=e=>Gt.has(e),Tt=e=>It.has(e);function L(e){return e==="definition_of_done"||Ae(e)}function Se(e){if(ke.includes(e))return e;throw new l(`Invalid config scope "${e}". Allowed: ${ke.join(", ")}`,s.USAGE)}function qe(e){if(e==="get"||e==="set"||e==="list"||e==="export")return e;throw J({command_path:"config",token:e.trim()||"<empty>",allowed:["export","get","list","set"],token_kind:"action"})}function Pe(e){let t=kt[e];if(t)return t;let r=S.map(n=>n.key).join(", ");throw new l(`Invalid config key "${e}". Supported: ${bt.join(", ")} (underscore variants also accepted). Nested leaf settings: ${r}.`,s.USAGE)}function Ge(e,t){let r=[...new Set((e??[]).map(n=>n.trim()).filter(n=>n.length>0))].sort((n,i)=>n.localeCompare(i));if(t){if(r.length>0)throw new l("Config set definition-of-done cannot combine --clear-criteria with --criterion values",s.USAGE);return[]}if(r.length===0)throw new l("Config set definition-of-done requires at least one non-empty --criterion value (or --clear-criteria to clear)",s.USAGE);return r}function Ie(e){let t=e?.trim().toLowerCase();if(t==="toon")return"toon";throw t==="json_markdown"?new l("Config set item-format no longer accepts json_markdown. Markdown item files are legacy read/migration input only.",s.USAGE):new l("Config set item-format requires --format toon",s.USAGE)}function j(e){let t=e?.trim().toLowerCase().replaceAll("-","_");if(t==="auto_create"||t==="strict_error")return t;throw new l("Config set history-missing-stream-policy requires --policy with one of: auto_create, strict_error",s.USAGE)}function Re(e){return F(e,"test-result-tracking")}function F(e,t){let r=e?.trim().toLowerCase().replaceAll("-","_");if(r==="enabled"||r==="disabled")return r;throw new l(`Config set ${t} requires --policy with one of: enabled, disabled`,s.USAGE)}function M(e){let t=e?.trim().toLowerCase().replaceAll("-","_");if(t==="enabled"||t==="disabled")return t;throw new l("Config set telemetry-tracking requires --policy with one of: enabled, disabled",s.USAGE)}function q(e){let t=e?.trim().toLowerCase().replaceAll("-","_");if(t==="core"||t==="strict"||t==="custom")return t;throw new l("Config set metadata-validation-profile requires --policy with one of: core, strict, custom",s.USAGE)}function V(e){let t=e?.trim().toLowerCase().replaceAll("-","_");if(t==="minimal"||t==="default"||t==="strict"||t==="custom")return t;throw new l("Config set governance-preset requires --policy with one of: minimal, default, strict, custom",s.USAGE)}function K(e){let t=e?.trim().toLowerCase().replaceAll("-","_");if(t==="none"||t==="warn"||t==="strict")return t;throw new l("Config set governance-ownership-enforcement requires --policy with one of: none, warn, strict",s.USAGE)}function Y(e){let t=e?.trim().toLowerCase().replaceAll("-","_");if(t==="progressive"||t==="strict")return t;throw new l("Config set governance-create-mode-default requires --policy with one of: progressive, strict",s.USAGE)}function B(e){let t=e?.trim().toLowerCase().replaceAll("-","_");if(t==="off"||t==="warn"||t==="strict")return t;if(t==="none"||t==="disabled")return"off";throw new l("Config set governance-close-validation-default requires --policy with one of: off, warn, strict",s.USAGE)}function W(e){let t=typeof e=="string"?e.trim().toLowerCase().replaceAll("-","_"):void 0;if(t==="off"||t==="warn"||t==="strict")return t;if(t==="none"||t==="disabled")return"off";throw new l("Config set governance-workflow-enforcement requires one of: off, warn, strict",s.USAGE)}function H(e){let t=e?.trim().toLowerCase().replaceAll("-","_");if(t==="enabled"||t==="disabled")return t;throw new l("Config set governance-force-required-for-stale-lock requires --policy with one of: enabled, disabled",s.USAGE)}function Q(e){let t=e?.trim().toLowerCase().replaceAll("-","_");if(t==="enabled"||t==="disabled")return t;throw new l("Config set governance-require-close-reason requires --policy with one of: enabled, disabled",s.USAGE)}var Nt={test_result_tracking:"test-result-tracking",untrusted_linked_test_execution:"untrusted-linked-test-execution"};function D(e,t){let r=Nt[e];if(r)return F(t,r);switch(e){case"history_missing_stream_policy":return j(t);case"sprint_release_format_policy":return O(t);case"parent_reference_policy":case"governance_parent_reference_policy":return k(t);case"metadata_validation_profile":case"governance_metadata_validation_profile":return q(t);case"governance_preset":return V(t);case"governance_ownership_enforcement":return K(t);case"governance_create_mode_default":return Y(t);case"governance_close_validation_default":return B(t);case"governance_require_close_reason":return Q(t);case"governance_workflow_enforcement":return W(t);case"governance_force_required_for_stale_lock":return H(t);case"telemetry_tracking":return M(t);default:return t.trim().toLowerCase().replaceAll("-","_")}}var Ce={author:"author",acceptance_criteria:"acceptance_criteria","acceptance-criteria":"acceptance_criteria",estimated_minutes:"estimated_minutes","estimated-minutes":"estimated_minutes",estimate:"estimated_minutes",close_reason:"close_reason","close-reason":"close_reason",reviewer:"reviewer",risk:"risk",confidence:"confidence",sprint:"sprint",release:"release"},$t=["author","acceptance_criteria","estimated_minutes","close_reason","reviewer","risk","confidence","sprint","release"];function Oe(e,t){let r=[...new Set((e??[]).map(a=>a.trim()).filter(a=>a.length>0))];if(t){if(r.length>0)throw new l("Config set metadata-required-fields cannot combine --clear-criteria with --criterion values",s.USAGE);return[]}if(r.length===0)throw new l("Config set metadata-required-fields requires at least one --criterion value (or --clear-criteria to clear)",s.USAGE);let n=r.map(a=>a.toLowerCase().replaceAll("-","_")),i=n.filter(a=>Ce[a]===void 0);if(i.length>0)throw new l(`Config set metadata-required-fields received unsupported values: ${i.join(", ")}. Supported values: ${$t.join(", ")}`,s.USAGE);return[...new Set(n.map(a=>Ce[a]))].sort((a,o)=>a.localeCompare(o))}function Lt(e,t,r){let n=[...new Set((t??[]).map(i=>i.trim().toLowerCase()).filter(i=>i.length>0))].sort((i,a)=>i.localeCompare(a));if(r){if(n.length>0)throw new l(`Config set ${p[e][0]} cannot combine --clear-criteria with --criterion values`,s.USAGE);return[]}if(n.length===0)throw new l(`Config set ${p[e][0]} requires at least one --criterion value (or --clear-criteria to clear)`,s.USAGE);return n}function Te(e){return[...new Set(e)].sort((t,r)=>t.localeCompare(r))}function Dt(e,t){if(e==="list"||e==="export"){if(typeof t=="string"&&t.trim().length>0)throw new l(`Config action "${e}" does not accept <key>`,s.USAGE);return}if(typeof t!="string"||t.trim().length===0)throw new l(`Config action "${e}" requires <key>`,s.USAGE);return Pe(t)}function Ne(e){if(!e)throw new l("Config action requires <key>",s.USAGE)}var Ut={definition_of_done:e=>[...e.workflow.definition_of_done],item_format:e=>e.item_format,history_missing_stream_policy:e=>e.history.missing_stream,sprint_release_format_policy:e=>e.validation.sprint_release_format,parent_reference_policy:e=>e.validation.parent_reference,metadata_validation_profile:e=>e.validation.metadata_profile,metadata_required_fields:e=>[...e.validation.metadata_required_fields],lifecycle_stale_blocker_reason_patterns:e=>[...e.validation.lifecycle_stale_blocker_reason_patterns],lifecycle_closure_like_blocked_reason_patterns:e=>[...e.validation.lifecycle_closure_like_blocked_reason_patterns],lifecycle_closure_like_resolution_patterns:e=>[...e.validation.lifecycle_closure_like_resolution_patterns],lifecycle_closure_like_actual_result_patterns:e=>[...e.validation.lifecycle_closure_like_actual_result_patterns],governance_preset:e=>e.governance.preset,governance_ownership_enforcement:e=>e.governance.ownership_enforcement,governance_create_mode_default:e=>e.governance.create_mode_default,governance_close_validation_default:e=>e.governance.close_validation_default,governance_require_close_reason:e=>e.governance.require_close_reason?"enabled":"disabled",governance_create_default_type:e=>e.governance.create_default_type??"",governance_workflow_enforcement:e=>e.governance.workflow_enforcement??"off",governance_parent_reference_policy:e=>e.governance.parent_reference,governance_metadata_validation_profile:e=>e.governance.metadata_profile,governance_force_required_for_stale_lock:e=>e.governance.force_required_for_stale_lock?"enabled":"disabled",test_result_tracking:e=>e.testing.record_results_to_items?"enabled":"disabled",untrusted_linked_test_execution:e=>e.testing.allow_untrusted_linked_tests?"enabled":"disabled",telemetry_tracking:e=>e.telemetry.enabled?"enabled":"disabled",agent_identity_vocabulary:e=>N(e.agent_identity?.identity_vocabulary),context:e=>({default_depth:e.context.default_depth,activity_limit:e.context.activity_limit,stale_threshold_days:e.context.stale_threshold_days,sections:{...e.context.sections}})};function X(e,t){return Ut[t](e)}function m(e,t){return t.length===0?e:{...e,warnings:t}}async function zt(e,t){let r=process.cwd(),n=e==="project"?b(r,t.path):ee(r),i=te(n);return e==="project"&&await se(n),{pmRoot:n,settingsPath:i}}function jt(e){if(e===void 0)return;let t=e.trim().toLowerCase();if(t==="true"||t==="enabled"||t==="on"||t==="1")return!0;if(t==="false"||t==="disabled"||t==="off"||t==="0")return!1;throw new l(`Context section toggle must be true|false|enabled|disabled, got "${e}"`,s.USAGE)}function Ee(e,t){let r=e.trim(),n=Number(r);if(/^\d+$/u.test(r)&&Number.isSafeInteger(n)&&n>0)return n;throw new l(`Context ${t} must be a positive integer`,s.USAGE)}async function Ft(e,t,r,n,i){let a=!1,o=e.context;if(t.defaultDepth!==void 0){let c=t.defaultDepth.trim().toLowerCase();if(!G.includes(c))throw new l(`Context --default-depth must be one of ${G.join("|")}`,s.USAGE);o.default_depth!==c&&(o.default_depth=c,a=!0)}if(t.activityLimit!==void 0){let c=Ee(t.activityLimit,"--activity-limit");o.activity_limit!==c&&(o.activity_limit=c,a=!0)}if(t.staleThresholdDays!==void 0){let c=Ee(t.staleThresholdDays,"--stale-threshold-days");o.stale_threshold_days!==c&&(o.stale_threshold_days=c,a=!0)}let _=[["hierarchy",t.sectionHierarchy],["activity",t.sectionActivity],["progress",t.sectionProgress],["blockers",t.sectionBlockers],["files",t.sectionFiles],["workload",t.sectionWorkload],["staleness",t.sectionStaleness],["tests",t.sectionTests]];for(let[c,d]of _){let g=jt(d);if(g!==void 0){let y=c;o.sections[y]!==g&&(o.sections[y]=g,a=!0)}}return a&&await w(r.pmRoot,e,"config:set:context"),m({scope:n,key:"context",context_settings:{default_depth:o.default_depth,activity_limit:o.activity_limit,stale_threshold_days:o.stale_threshold_days,sections:{...o.sections}},settings_path:r.settingsPath,changed:a},i)}function Mt(e,t,r){if(r.value!==void 0&&r.value!==t)throw new l(`Config set ${e} received both positional value "${t}" and --value "${r.value}". Pass only one.`,s.USAGE);return{...r,value:t}}function $e(e,t,r,n,i,a){if(i===void 0)return a;if(e!=="set")throw new l(`Config action "${e}" does not accept a positional value. Only "set" takes <value>.`,s.USAGE);if(typeof t!="string"||t.trim().length===0)throw new l('Config action "set" requires <key> before a positional <value>.',s.USAGE);if(n)return Mt(t,i,a);Ne(r);let o=he(r,i);if(!o.routable)throw new l(o.reason,s.USAGE);if(o.flag==="criterion"){if(a.criterion!==void 0&&a.criterion.length>0)throw new l(`Config set ${t} received both positional value "${i}" and --criterion. Pass criteria via --criterion only when supplying more than one value.`,s.USAGE);return{...a,criterion:o.values}}if(o.flag==="format")return{...a,format:o.value};if(a.policy!==void 0&&D(r,a.policy)!==D(r,o.value))throw new l(`Config set ${t} received both positional value "${i}" and --policy "${a.policy}". Pass only one.`,s.USAGE);return{...a,policy:o.value}}function Vt(e){let t=Object.keys(p).map(n=>({key:n,aliases:p[n],value_kind:n==="context"||n==="agent_identity_vocabulary"?"object":L(n)?"string_array":"enum",set_flags:n==="context"?["--default-depth","--activity-limit","--stale-threshold-days","--section-<name>"]:n==="agent_identity_vocabulary"?["--policy","--value","--criterion"]:L(n)?["--criterion","--clear-criteria"]:n==="item_format"?["--format"]:["--policy"],summary:Ct[n],value:X(e.settings,n)})),r=S.map(n=>({key:n.key,canonical_key:n.key.replaceAll("_","-"),path:n.path,kind:n.kind,value:$(e.settings,n),summary:n.summary,...n.choices?{choices:[...n.choices]}:{},...n.min===void 0?{}:{min:n.min},...n.max===void 0?{}:{max:n.max}}));return m({scope:e.scope,keys:t,nested_settings:r,count:t.length,settings_path:e.target.settingsPath,changed:!1},e.warnings)}function Kt(e){let t=Object.fromEntries(Object.keys(p).map(r=>[r,X(e.settings,r)]));return m({scope:e.scope,values:t,settings_path:e.target.settingsPath,changed:!1},e.warnings)}function Yt(e,t){let r=X(e.settings,t),n={scope:e.scope,key:t,settings_path:e.target.settingsPath,changed:!1};return t==="item_format"?m({...n,format:e.settings.item_format,has_explicit_item_format:e.metadata.has_explicit_item_format},e.warnings):t==="context"?m({...n,context_settings:r},e.warnings):t==="agent_identity_vocabulary"?m({...n,identity_vocabulary:r},e.warnings):Array.isArray(r)?m({...n,criteria:r},e.warnings):m({...n,policy:r},e.warnings)}async function Bt(e,t,r,n){if(t==="get"){let _=$(e.settings,r);return m({scope:e.scope,key:r.key,nested_setting:{key:r.key,path:r.path,kind:r.kind,value:_},settings_path:e.target.settingsPath,changed:!1},e.warnings)}let i=n.value;if(typeof i!="string")throw new l(`Config set ${r.key} requires a value. Pass it positionally (\`pm config ${e.scope} set ${r.key} <value>\`) or via --value.`,s.USAGE);let a=we(r,i);if(!a.ok)throw new l(a.error.message,s.USAGE);let o=be(e.settings,r,a.parsed.value);return o&&await w(e.target.pmRoot,e.settings,`config:set:${r.path}`),m({scope:e.scope,key:r.key,nested_setting:{key:r.key,path:r.path,kind:r.kind,value:a.parsed.value},settings_path:e.target.settingsPath,changed:o},e.warnings)}async function u(e,t,r){t&&await w(e.target.pmRoot,e.settings,r)}function U(e,t,r){return e!==r||t!==r}function f(e,t,r,n){return m({scope:e.scope,key:t,policy:r,settings_path:e.target.settingsPath,changed:n},e.warnings)}function z(e,t,r,n){return m({scope:e.scope,key:t,criteria:r,settings_path:e.target.settingsPath,changed:n},e.warnings)}async function Wt(e,t){let r=Ie(t.format),n=e.settings.item_format!==r||!e.metadata.has_explicit_item_format,i;if(n){let a=I(e.settings,R()),o=await le(e.target.pmRoot,r,"config:set:item_format:migrate",a.type_to_folder,e.settings.schema);i={target_format:o.target_format,scanned:o.scanned,migrated:o.migrated,removed:o.removed,warnings:o.warnings},e.settings.item_format=r,await w(e.target.pmRoot,e.settings,"config:set:item_format")}return m({scope:e.scope,key:"item_format",format:e.settings.item_format,has_explicit_item_format:!0,migration:i,settings_path:e.target.settingsPath,changed:n},e.warnings)}async function Ht(e,t,r){if(t==="history_missing_stream_policy"){let a=j(r.policy),o=e.settings.history.missing_stream!==a;return e.settings.history.missing_stream=a,await u(e,o,"config:set:history_missing_stream_policy"),f(e,t,e.settings.history.missing_stream,o)}if(t==="sprint_release_format_policy"){let a=O(r.policy),o=e.settings.validation.sprint_release_format!==a;return e.settings.validation.sprint_release_format=a,await u(e,o,"config:set:sprint_release_format_policy"),f(e,t,e.settings.validation.sprint_release_format,o)}if(t==="parent_reference_policy"){let a=k(r.policy),o=e.settings.validation.parent_reference!==a||e.settings.governance.preset!=="custom"||e.settings.governance.parent_reference!==a;return e.settings.validation.parent_reference=a,e.settings.governance.preset="custom",e.settings.governance.parent_reference=a,await u(e,o,"config:set:parent_reference_policy"),f(e,t,e.settings.validation.parent_reference,o)}let n=q(r.policy),i=e.settings.validation.metadata_profile!==n||e.settings.governance.preset!=="custom"||e.settings.governance.metadata_profile!==n;return e.settings.validation.metadata_profile=n,e.settings.governance.preset="custom",e.settings.governance.metadata_profile=n,await u(e,i,"config:set:metadata_validation_profile"),f(e,t,e.settings.validation.metadata_profile,i)}async function Qt(e,t,r){if(t==="metadata_required_fields"){let _=Oe(r.criterion,r.clearCriteria),c=_.length!==e.settings.validation.metadata_required_fields.length||_.some((d,g)=>d!==e.settings.validation.metadata_required_fields[g]);return e.settings.validation.metadata_required_fields=_,await u(e,c,"config:set:metadata_required_fields"),z(e,t,[...e.settings.validation.metadata_required_fields],c)}let i={lifecycle_stale_blocker_reason_patterns:e.settings.validation.lifecycle_stale_blocker_reason_patterns,lifecycle_closure_like_blocked_reason_patterns:e.settings.validation.lifecycle_closure_like_blocked_reason_patterns,lifecycle_closure_like_resolution_patterns:e.settings.validation.lifecycle_closure_like_resolution_patterns,lifecycle_closure_like_actual_result_patterns:e.settings.validation.lifecycle_closure_like_actual_result_patterns}[t],a=Lt(t,r.criterion,r.clearCriteria),o=a.length!==i.length||a.some((_,c)=>_!==i[c]);return i.splice(0,i.length,...a),await u(e,o,`config:set:${t}`),z(e,t,[...i],o)}async function Xt(e,t,r){if(t==="governance_preset"){let c=V(r.policy),d=e.settings.governance.preset!==c;return e.settings.governance.preset=c,await u(e,d,"config:set:governance_preset"),f(e,t,e.settings.governance.preset,d)}let n=typeof r.policy=="string",i=n?r.policy.trim():"";if(n&&i.length===0){let c=e.settings.governance.create_default_type!==void 0;return delete e.settings.governance.create_default_type,await u(e,c,"config:set:governance_create_default_type"),f(e,t,e.settings.governance.create_default_type??"",c)}if(i.length===0)throw new l('Config set governance-create-default-type requires an item type value (or an empty value "" to clear it)',s.USAGE);let a=I(e.settings,R()),o=x(i,a);if(!o)throw new l(ie(i,a.types,ne(e.target.pmRoot,e.settings.schema)),s.USAGE);let _=e.settings.governance.create_default_type!==o;return e.settings.governance.create_default_type=o,await u(e,_,"config:set:governance_create_default_type"),f(e,t,e.settings.governance.create_default_type,_)}async function Jt(e,t,r){if(t==="governance_ownership_enforcement"){let a=K(r.policy),o=e.settings.governance.preset!=="custom"||e.settings.governance.ownership_enforcement!==a;return e.settings.governance.preset="custom",e.settings.governance.ownership_enforcement=a,await u(e,o,"config:set:governance_ownership_enforcement"),f(e,t,e.settings.governance.ownership_enforcement,o)}if(t==="governance_create_mode_default"){let a=Y(r.policy),o=e.settings.governance.preset!=="custom"||e.settings.governance.create_mode_default!==a;return e.settings.governance.preset="custom",e.settings.governance.create_mode_default=a,await u(e,o,"config:set:governance_create_mode_default"),f(e,t,e.settings.governance.create_mode_default,o)}let n=B(r.policy),i=e.settings.governance.preset!=="custom"||e.settings.governance.close_validation_default!==n;return e.settings.governance.preset="custom",e.settings.governance.close_validation_default=n,await u(e,i,"config:set:governance_close_validation_default"),f(e,t,e.settings.governance.close_validation_default,i)}async function Zt(e,t,r){if(t==="governance_parent_reference_policy"){let a=k(r.policy),o=e.settings.governance.preset!=="custom"||U(e.settings.governance.parent_reference,e.settings.validation.parent_reference,a);return e.settings.governance.preset="custom",e.settings.governance.parent_reference=a,e.settings.validation.parent_reference=a,await u(e,o,"config:set:governance_parent_reference_policy"),f(e,t,e.settings.governance.parent_reference,o)}if(t==="governance_metadata_validation_profile"){let a=q(r.policy),o=e.settings.governance.preset!=="custom"||U(e.settings.governance.metadata_profile,e.settings.validation.metadata_profile,a);return e.settings.governance.preset="custom",e.settings.governance.metadata_profile=a,e.settings.validation.metadata_profile=a,await u(e,o,"config:set:governance_metadata_validation_profile"),f(e,t,e.settings.governance.metadata_profile,o)}let n=W(r.policy),i=(e.settings.governance.workflow_enforcement??"off")!==n;return e.settings.governance.workflow_enforcement=n,await u(e,i,"config:set:governance_workflow_enforcement"),f(e,t,e.settings.governance.workflow_enforcement,i)}async function xt(e,t,r){if(t==="governance_require_close_reason"){let _=Q(r.policy)==="enabled",c=e.settings.governance.require_close_reason!==_;return e.settings.governance.require_close_reason=_,await u(e,c,"config:set:governance_require_close_reason"),f(e,t,e.settings.governance.require_close_reason?"enabled":"disabled",c)}let i=H(r.policy)==="enabled",a=e.settings.governance.preset!=="custom"||e.settings.governance.force_required_for_stale_lock!==i;return e.settings.governance.preset="custom",e.settings.governance.force_required_for_stale_lock=i,await u(e,a,"config:set:governance_force_required_for_stale_lock"),f(e,t,e.settings.governance.force_required_for_stale_lock?"enabled":"disabled",a)}async function er(e,t,r){if(t==="test_result_tracking"){let _=Re(r.policy)==="enabled",c=e.settings.testing.record_results_to_items!==_;return e.settings.testing.record_results_to_items=_,await u(e,c,"config:set:test_result_tracking"),f(e,t,e.settings.testing.record_results_to_items?"enabled":"disabled",c)}if(t==="untrusted_linked_test_execution"){let _=F(r.policy,"untrusted-linked-test-execution")==="enabled",c=e.settings.testing.allow_untrusted_linked_tests!==_;return e.settings.testing.allow_untrusted_linked_tests=_,await u(e,c,"config:set:untrusted_linked_test_execution"),f(e,t,e.settings.testing.allow_untrusted_linked_tests?"enabled":"disabled",c)}let i=M(r.policy)==="enabled",a=e.settings.telemetry.enabled!==i||!e.settings.telemetry.first_run_prompt_completed;return e.settings.telemetry.enabled=i,e.settings.telemetry.first_run_prompt_completed=!0,await u(e,a,"config:set:telemetry_tracking"),f(e,t,e.settings.telemetry.enabled?"enabled":"disabled",a)}async function tr(e,t,r){let n=Ge(r.criterion,r.clearCriteria),i=n.length!==e.settings.workflow.definition_of_done.length||n.some((a,o)=>a!==e.settings.workflow.definition_of_done[o]);return e.settings.workflow.definition_of_done=n,await u(e,i,"config:set:definition_of_done"),z(e,t,[...e.settings.workflow.definition_of_done],i)}function rr(e){let t=e?.trim().toLowerCase().replaceAll("_","-"),r=t?.startsWith("preview-")===!0,n=r?t.slice(8):t;if(n==="add"||n==="remove"||n==="clear")return{operation:n,dryRun:r};throw new l("Config set agent-identity-vocabulary requires --policy add|remove|clear|preview-add|preview-remove|preview-clear",s.USAGE)}function nr(e,t){if(e==="add"){let r=t?.lastIndexOf("=")??-1;if(r<=0||r===t.length-1)throw new l('Config set agent-identity-vocabulary --policy add requires --value "<legacy-author>=<canonical-harness>"',s.USAGE);return{legacy_author:t.slice(0,r),canonical_harness:t.slice(r+1)}}if(e==="remove"){if(t===void 0)throw new l("Config set agent-identity-vocabulary --policy remove requires --value <legacy-author>",s.USAGE);return{legacy_author:t}}if(t!==void 0)throw new l("Config set agent-identity-vocabulary --policy clear does not accept --value",s.USAGE);return{}}async function ar(e,t){let{operation:r,dryRun:n}=rr(t.policy),i=nr(r,t.value),a;try{a=me(e.settings.agent_identity?.identity_vocabulary,{operation:r,...i,observed_authors:t.criterion})}catch(o){throw new l(o.message,s.USAGE)}return a.preview.changed&&!n&&(e.settings.agent_identity={...e.settings.agent_identity,identity_vocabulary:a.vocabulary},await u(e,!0,`config:set:agent_identity.identity_vocabulary:${r}:v${a.preview.version_after}`)),m({scope:e.scope,key:"agent_identity_vocabulary",identity_vocabulary:N(n?e.settings.agent_identity?.identity_vocabulary:a.vocabulary),vocabulary_mutation:a.preview,settings_path:e.target.settingsPath,changed:a.preview.changed&&!n},e.warnings)}async function ir(e,t,r){if(r.clearCriteria===!0&&!L(t))throw new l("--clear-criteria is only supported with config set criteria-list keys",s.USAGE);return t==="item_format"?Wt(e,r):t==="context"?Ft(e.settings,r,e.target,e.scope,e.warnings):t==="agent_identity_vocabulary"?ar(e,r):t==="definition_of_done"?tr(e,t,r):Ae(t)?Qt(e,t,r):St.has(t)?er(e,t,r):qt.has(t)?xt(e,t,r):Rt(t)?Jt(e,t,r):Ot(t)?Zt(e,t,r):Tt(t)?Xt(e,t,r):Ht(e,t,r)}async function Nr(e,t,r,n,i,a){let o=Se(e),_=qe(t),c=_==="get"||_==="set"?ve(r):void 0,d=c?void 0:Dt(_,r),g=$e(_,r,d,c,a,n),y=await zt(o,i),{settings:h,metadata:Le,warnings:De}=await oe(y.pmRoot),v={scope:o,target:y,settings:h,metadata:Le,warnings:Te(De)};return c?Bt(v,_,c,g):_==="list"?Vt(v):_==="export"?Kt(v):(Ne(d),_==="get"?Yt(v,d):ir(v,d,g))}var $r={hasGovernanceValidationMirrorChange:U,applyPositionalValue:$e,normalizeAction:qe,normalizeCriteria:Ge,normalizeGovernanceCloseValidationDefault:B,normalizeGovernanceCreateModeDefault:Y,normalizeGovernanceForceRequiredForStaleLockPolicy:H,normalizeGovernanceOwnershipEnforcement:K,normalizeGovernancePreset:V,normalizeGovernanceRequireCloseReasonPolicy:Q,normalizeGovernanceWorkflowEnforcement:W,normalizeHistoryMissingStreamPolicy:j,normalizeItemFormat:Ie,normalizeKey:Pe,normalizeMetadataRequiredFields:Oe,normalizePolicyForConflict:D,normalizeScope:Se,normalizeTelemetryTrackingPolicy:M,normalizeTestResultTrackingPolicy:Re,normalizeValidateMetadataProfile:q,normalizeWarnings:Te};export{ur as a,ve as b,we as c,$ as d,be as e,N as f,me as g,Nr as h,$r as i};
3
+ //# sourceMappingURL=chunk-TNX6HC54.js.map
@@ -1,4 +1,4 @@
1
- import{b,c as I,d as F}from"./chunk-TPQIBSL2.js";import{C as oe,E as ie,b as V,d as te,j as A,l as ne}from"./chunk-5I5RWIJC.js";import{B as T,Bc as ae,Ca as q,Cc as re,Dc as se,Za as J,fc as W,kb as Q,rc as K,tc as X,vc as Y,yc as Z,zc as ee}from"./chunk-6C7GIMIL.js";import"./chunk-WYRZZ5ZE.js";import{$m as P,C as u,Cc as k,Dg as v,E as p,Fg as y,Fh as E,Gg as f,Gh as C,Gm as h,Jm as s,Lm as l,Tm as L,Um as $,Vm as G,Wa as D,Wm as M,Xm as U,Ym as N,Zm as B,_m as z,ai as R,an as H,kf as O,lf as j,xg as S}from"./chunk-QKGMHGEI.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]="6ed80dad-480c-584f-9977-f0058fcfe5a3")}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]="bb98131e-c0d5-5055-8ad4-b0df3824cfbb")}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]="72332f20-83db-5566-b130-ad4c21267fa9")}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]="85050f31-1e96-5ae9-88a3-77ce4b042cca")}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]="ac3636d0-67b6-58f6-9f0a-a478f20b0ac5")}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]="d6123f68-21a1-5a33-ac06-4893ca6ba20d")}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]="b1affe9d-1c93-5641-be3b-c46a68b93e09")}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]="f76a3502-b942-530f-95f5-b37f4c365e3c")}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]="35fa89cf-806d-5d6a-ad6b-dad1dc3f1457")}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]="14619397-8d05-59fb-9744-f78532b98d26")}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]="102d4534-fb3a-57a3-91d1-db344492b812")}catch{}})();function fe(e,t){return!t||t.size===0?!0:e==="context"?t.has("context")||t.has("ctx"):t.has(e)}function le(e){if(e===void 0)return;if(typeof e!="string")throw new p("List --format must be one of csv|table|json|ndjson|toon",u.USAGE);let t=e.trim().toLowerCase();if(t==="csv"||t==="table"||t==="json"||t==="ndjson"||t==="toon")return t;throw new p("List --format must be one of csv|table|json|ndjson|toon",u.USAGE)}function _(e,t,n,i=!1){if(t===void 0)return n;if(typeof t!="string")throw new p(`${e} --format must be one of ${i?"json|ndjson|toon":"json|toon"}`,u.USAGE);let a=t.trim().toLowerCase();if(a!=="json"&&(a!=="ndjson"||!i)&&a!=="toon")throw new p(`${e} --format must be one of ${i?"json|ndjson|toon":"json|toon"}`,u.USAGE);if(n.json===!0&&a==="toon")throw new p(`${e} cannot combine --json with --format toon`,u.USAGE);return{...n,json:a==="json"||a==="ndjson"}}function me(e,t){J[t]==="brief"&&e.includeBody!==!0&&e.compact!==!0&&e.brief!==!0&&e.full!==!0&&e.fields===void 0&&(e.brief=!0)}function de(e){e.option("--has-notes","Show only items that have notes").option("--has-learnings","Show only items that have learnings").option("--has-files","Show only items that have linked files").option("--has-docs","Show only items that have linked docs").option("--has-tests","Show only items that have linked tests").option("--has-comments","Show only items that have comments").option("--has-deps","Show only items that have dependencies").option("--has-body","Show only items that have a non-empty body").option("--has-linked-command","Show only items whose linked tests carry a runnable command").option("--no-notes","Show only items that have no notes").option("--no-learnings","Show only items that have no learnings").option("--no-files","Show only items that have no linked files").option("--filter-files-missing","Alias for --no-files").option("--no-docs","Show only items that have no linked docs").option("--filter-docs-missing","Alias for --no-docs").option("--no-tests","Show only items that have no linked tests").option("--no-comments","Show only items that have no comments").option("--no-deps","Show only items that have no dependencies").option("--empty-body","Show only items with an empty body").option("--no-linked-command","Show only items whose linked tests carry no runnable command").option("--filter-reviewer-missing","Show only items missing reviewer").option("--filter-risk-missing","Show only items missing risk").option("--filter-confidence-missing","Show only items missing confidence").option("--filter-sprint-missing","Show only items missing sprint").option("--filter-release-missing","Show only items missing release")}var ye={draft:{name:"list-draft",dependencyBlocked:!1},open:{name:"list-open",dependencyBlocked:!1},in_progress:{name:"list-in-progress",dependencyBlocked:!1},blocked:{name:"list-blocked",dependencyBlocked:!0},closed:{name:"list-closed",dependencyBlocked:!1},canceled:{name:"list-canceled",dependencyBlocked:!1}};function he(e,t){let n=e.stream===!0,i=le(e.format),a=i==="csv"||i==="table",o=i==="json"||i==="ndjson"||i==="toon"?_("List",e.format,t,!0):t;if(n&&!o.json)throw new p("--stream requires --json output mode.",u.USAGE);if((a||i==="ndjson")&&n)throw new p("--format csv|table|ndjson cannot be combined with --stream.",u.USAGE);return{streamMode:n,listFormat:i,effectiveGlobal:o}}function ge(e,t,n){if(n.listFormat==="csv"||n.listFormat==="table"){k(t);let i=t.items,a=n.listFormat==="csv"?E(i):C(i);!n.effectiveGlobal.quiet&&a.length>0&&v(`${a}
1
+ import{b,c as I,d as F}from"./chunk-52EKTW6V.js";import{C as oe,E as ie,b as V,d as te,j as A,l as ne}from"./chunk-R4ETAOJC.js";import{B as T,Bc as ae,Ca as q,Cc as re,Dc as se,Za as J,fc as W,kb as Q,rc as K,tc as X,vc as Y,yc as Z,zc as ee}from"./chunk-MFNTKMTI.js";import"./chunk-WYRZZ5ZE.js";import{$m as B,C as u,Dc as k,E as p,Fg as v,Hg as y,Hh as E,Ig as f,Ih as C,Im as h,Lm as s,Nm as l,Vm as L,Wa as D,Wm as $,Xm as G,Ym as M,Zm as U,_m as N,an as z,bn as P,ci as R,cn as H,lf as O,mf as j,zg as S}from"./chunk-3OO3W6FW.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]="6ed80dad-480c-584f-9977-f0058fcfe5a3")}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]="bb98131e-c0d5-5055-8ad4-b0df3824cfbb")}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]="72332f20-83db-5566-b130-ad4c21267fa9")}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]="85050f31-1e96-5ae9-88a3-77ce4b042cca")}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]="ac3636d0-67b6-58f6-9f0a-a478f20b0ac5")}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]="d6123f68-21a1-5a33-ac06-4893ca6ba20d")}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]="b1affe9d-1c93-5641-be3b-c46a68b93e09")}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]="f76a3502-b942-530f-95f5-b37f4c365e3c")}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]="35fa89cf-806d-5d6a-ad6b-dad1dc3f1457")}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]="14619397-8d05-59fb-9744-f78532b98d26")}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]="102d4534-fb3a-57a3-91d1-db344492b812")}catch{}})();function fe(e,t){return!t||t.size===0?!0:e==="context"?t.has("context")||t.has("ctx"):t.has(e)}function le(e){if(e===void 0)return;if(typeof e!="string")throw new p("List --format must be one of csv|table|json|ndjson|toon",u.USAGE);let t=e.trim().toLowerCase();if(t==="csv"||t==="table"||t==="json"||t==="ndjson"||t==="toon")return t;throw new p("List --format must be one of csv|table|json|ndjson|toon",u.USAGE)}function _(e,t,n,i=!1){if(t===void 0)return n;if(typeof t!="string")throw new p(`${e} --format must be one of ${i?"json|ndjson|toon":"json|toon"}`,u.USAGE);let a=t.trim().toLowerCase();if(a!=="json"&&(a!=="ndjson"||!i)&&a!=="toon")throw new p(`${e} --format must be one of ${i?"json|ndjson|toon":"json|toon"}`,u.USAGE);if(n.json===!0&&a==="toon")throw new p(`${e} cannot combine --json with --format toon`,u.USAGE);return{...n,json:a==="json"||a==="ndjson"}}function me(e,t){J[t]==="brief"&&e.includeBody!==!0&&e.compact!==!0&&e.brief!==!0&&e.full!==!0&&e.fields===void 0&&(e.brief=!0)}function de(e){e.option("--has-notes","Show only items that have notes").option("--has-learnings","Show only items that have learnings").option("--has-files","Show only items that have linked files").option("--has-docs","Show only items that have linked docs").option("--has-tests","Show only items that have linked tests").option("--has-comments","Show only items that have comments").option("--has-deps","Show only items that have dependencies").option("--has-body","Show only items that have a non-empty body").option("--has-linked-command","Show only items whose linked tests carry a runnable command").option("--no-notes","Show only items that have no notes").option("--no-learnings","Show only items that have no learnings").option("--no-files","Show only items that have no linked files").option("--filter-files-missing","Alias for --no-files").option("--no-docs","Show only items that have no linked docs").option("--filter-docs-missing","Alias for --no-docs").option("--no-tests","Show only items that have no linked tests").option("--no-comments","Show only items that have no comments").option("--no-deps","Show only items that have no dependencies").option("--empty-body","Show only items with an empty body").option("--no-linked-command","Show only items whose linked tests carry no runnable command").option("--filter-reviewer-missing","Show only items missing reviewer").option("--filter-risk-missing","Show only items missing risk").option("--filter-confidence-missing","Show only items missing confidence").option("--filter-sprint-missing","Show only items missing sprint").option("--filter-release-missing","Show only items missing release")}var ye={draft:{name:"list-draft",dependencyBlocked:!1},open:{name:"list-open",dependencyBlocked:!1},in_progress:{name:"list-in-progress",dependencyBlocked:!1},blocked:{name:"list-blocked",dependencyBlocked:!0},closed:{name:"list-closed",dependencyBlocked:!1},canceled:{name:"list-canceled",dependencyBlocked:!1}};function he(e,t){let n=e.stream===!0,i=le(e.format),a=i==="csv"||i==="table",o=i==="json"||i==="ndjson"||i==="toon"?_("List",e.format,t,!0):t;if(n&&!o.json)throw new p("--stream requires --json output mode.",u.USAGE);if((a||i==="ndjson")&&n)throw new p("--format csv|table|ndjson cannot be combined with --stream.",u.USAGE);return{streamMode:n,listFormat:i,effectiveGlobal:o}}function ge(e,t,n){if(n.listFormat==="csv"||n.listFormat==="table"){k(t);let i=t.items,a=n.listFormat==="csv"?E(i):C(i);!n.effectiveGlobal.quiet&&a.length>0&&v(`${a}
2
2
  `)}else if(n.listFormat==="ndjson"){k(t);let i=I(t.items);!n.effectiveGlobal.quiet&&i.length>0&&v(`${i}
3
3
  `)}else n.streamMode?G(e,t,n.effectiveGlobal):y(t,n.effectiveGlobal)}async function ve(e){let t=h(e.actionCommand),n=e.aliasContract?{...t,command:e.aliasContract.canonical}:t,i=Date.now();e.aliasContract?.lifecycle==="deprecated"&&await R(D(process.cwd(),n.path)).then(pe=>pe.ux.deprecation_hints)&&f(j(e.aliasContract));let a=S("list",e.options),o=L(a),r=e.name,d=e.status,m=e.dependencyBlocked===!0,c=e.excludeTerminal===!0,g=o.status?.trim().toLowerCase(),x=e.name==="list"&&g!==void 0?ye[g]:void 0;e.name==="list"&&(e.options.all===!0||g==="all"?(r="list-all",c=!1,o.status=void 0):g!==void 0&&x!==void 0&&(r=x.name,d=g,m=x.dependencyBlocked,c=!1,o.status=void 0)),me(o,r),Object.assign(o,{projectionCommand:r}),c&&(o.excludeTerminal=!0),o.dependencyBlocked=m;let ce=he(a,n),ue=await Q(m?void 0:d,o,n);ge("list",ue,ce),n.profile&&f(`profile:command=list took_ms=${Date.now()-i}`)}function be(e,t){let{name:n,description:i,status:a,excludeTerminal:o,allowStatusFilter:r,dependencyBlocked:d,aliasContract:m}=t,c=e.command(n,{hidden:m?.hidden===!0}).description(i);r&&c.option("--status <value>","Filter by status (repeatable or comma-separated; matches any; all selects every status)",s),n==="list"&&c.option("--all","Include every lifecycle status"),c.option("--for <intent>",`Apply a declared context intent projection. ${b("list","--for")}`).option("--token-budget <n>","Override the selected intent's maximum estimated output tokens").option("--type <value>","Filter by item type (repeatable or comma-separated; matches any)",s).option("--tag <value>","Filter by tag (repeatable or comma-separated; matches any)",s).option("--priority <value>","Filter by priority (repeatable or comma-separated; matches any)",s).option("--deadline-before <value>","Filter by deadline upper bound (ISO/date string or relative)").option("--deadline-after <value>","Filter by deadline lower bound (ISO/date string or relative)").option("--today","Filter to items updated since local midnight today").option("--recent","Filter to items updated in the last 7 days").option("--updated-after <value>",'Filter by updated_at lower bound: ISO timestamp or signed relative (e.g. "-2h"/"-7d" for the past). "Changed since my last window" \u2192 --updated-after <ISO>').option("--updated-before <value>","Filter by updated_at upper bound: ISO timestamp or signed relative (-2h/+1d)").option("--created-after <value>","Filter by created_at lower bound: ISO timestamp or signed relative (-2h/+1d)").option("--created-before <value>","Filter by created_at upper bound: ISO timestamp or signed relative (-2h/+1d)").option("--ids <value>","Filter by explicit item IDs (comma-separated or repeatable)").option("--assignee <value>","Filter by assignee",s).option("--assignee-filter <value>","Filter assignee presence: assigned|unassigned").option("--parent <value>","Filter by parent item ID").option("--sprint <value>","Filter by sprint",s).option("--release <value>","Filter by release",s).option("--filter-ac-missing","Show only items missing acceptance_criteria").option("--filter-estimates-missing","Show only items missing estimated_minutes").option("--filter-resolution-missing","Show only terminal items missing resolution").option("--filter-metadata-missing","Show only items missing any tracked metadata (AC, estimate, or resolution)").option("--limit <n>","Limit returned item count").option("--offset <n>","Skip the first n matching rows before limit is applied").option("--after <cursor>","Continue after an opaque next_cursor from a previous list response").option("--no-truncate","Return every matched row after the explicit status and field filters").option("--include-body","Include item body in each returned list row").option("--strict-read","Fail closed if any item document or item directory cannot be read").option("--compact","Render compact list projection fields (mutually exclusive with --brief/--full/--fields)").option("--brief","Ultra-compact output: id, status, type, title only (agent-optimized, mutually exclusive with --compact/--full/--fields)").option("--full","Render full list projection fields (mutually exclusive with --compact/--brief/--fields)").option("--fields <value>",`Render custom comma-separated list fields (mutually exclusive with --compact/--brief/--full). ${b(n,"--fields")}`).option("--sort <value>","Sort field: priority|deadline|updated_at|created_at|title|parent (aliases: updated, created)").option("--order <value>","Sort order: asc|desc (requires --sort)").option("--tree","Render rows in parent/child tree order").option("--tree-depth <n>","Maximum recursion depth with --tree (0 keeps root rows only)").option("--format <value>","Output render mode: csv|table (human export) or json|ndjson|toon (machine output override)").option("--stream","Emit line-delimited JSON rows (requires --json)"),de(c),c.action(async(g,x)=>{await ve({name:n,status:a,excludeTerminal:o,dependencyBlocked:d,options:g,actionCommand:x,aliasContract:m})}),l(c,"--tags <value>","Alias for --tag"),l(c,"--assignee_filter <value>","Alias for --assignee-filter"),l(c,"--tree_depth <n>","Alias for --tree-depth"),l(c,"--token_budget <n>","Alias for --token-budget"),l(c,"--filter-estimate-missing","Alias for --filter-estimates-missing")}async function we(e,t){let n=h(t),i=Date.now(),a=await V($(e),n);y(a,n),n.profile&&f(`profile:command=aggregate took_ms=${Date.now()-i}`)}async function xe(e,t){let n=h(t),i=Date.now(),a=P(S("context",e)),o=await X(a,n),r=W(a,n);if(r==="markdown")n.quiet||v(`${K(o)}
4
4
  `);else if(r==="ndjson"){k(o);let d=I([...o.high_level,...o.low_level,...o.blocked_fallback]);!n.quiet&&d.length>0&&v(`${d}
@@ -8,4 +8,4 @@ import{b,c as I,d as F}from"./chunk-TPQIBSL2.js";import{C as oe,E as ie,b as V,d
8
8
  `);return}for await(let a of re({...e,intervalMs:i}))n||v(`${F(a.events,{count:a.count,has_more:a.has_more,next_cursor:a.next_cursor??null,source:a.source,heartbeat:a.count===0})}
9
9
  `)}function Oe(e){return e.cursor_mode==="row"?I(e.events):F(e.events,{count:e.count,has_more:e.has_more,next_cursor:e.next_cursor??null,source:e.source,...e.provenance_summary===void 0?{}:{provenance_summary:e.provenance_summary}})}async function je(e,t){let n=h(t),i=Date.now(),a=Fe(e,n.path);if(e.follow===!0){await De(a,e,n.quiet===!0);return}let o=await ae(a);if(k(o),n.json){y(o,n),n.profile&&f(`profile:command=events took_ms=${Date.now()-i}`);return}let r=Oe(o);!n.quiet&&r.length>0&&v(`${r}
10
10
  `),n.profile&&f(`profile:command=events took_ms=${Date.now()-i}`)}async function Ee(e,t){let n=h(t),i=Date.now();if([e.raw,e.compact,e.full,e.provenance].filter(d=>d===!0).length>1)throw new p("Activity projection options are mutually exclusive. Use --raw, --compact, --provenance, or --full.",u.USAGE);let a=z(e.stream);if(a&&!n.json)throw new p("--stream requires --json output mode.",u.USAGE);let o=B(e),r=await T(a&&e.full!==!0&&e.provenance!==!0?{...o,raw:!0,compact:!0}:o,n);a?M(r,o,n):y(r,n),n.profile&&f(`profile:command=activity took_ms=${Date.now()-i}`)}async function Ce(e,t,n,i,a){let o=h(a),r=Date.now(),d=await q(e,t,n,{...Array.isArray(i.kind)?{kind:i.kind}:{},maxDepth:typeof i.maxDepth=="string"?i.maxDepth:void 0,limit:typeof i.limit=="string"?i.limit:void 0,after:typeof i.after=="string"?i.after:void 0,direction:typeof i.direction=="string"?i.direction:void 0,maxPaths:typeof i.maxPaths=="string"?i.maxPaths:void 0,sample:typeof i.sample=="string"?i.sample:void 0,...Array.isArray(i.exemptIsolate)?{exemptIsolate:i.exemptIsolate}:{},...Array.isArray(i.exemptIsolateType)?{exemptIsolateType:i.exemptIsolateType}:{},saveBaseline:i.saveBaseline===!0,rebuild:i.rebuild===!0,clear:i.clear===!0,summary:i.summary===!0,full:i.full===!0},o);y(d,o),o.profile&&f(`profile:command=graph took_ms=${Date.now()-r}`)}function wt(e,t){let n=t?.commandFilter,i=o=>fe(o,n),a=[{name:"list",description:"List active items with optional lifecycle-status and project filters.",excludeTerminal:!0,allowStatusFilter:!0},{name:"list-all",description:"List all items with optional filters.",excludeTerminal:!1,allowStatusFilter:!0},{name:"list-draft",description:"List draft items with optional filters.",status:"draft"},{name:"list-open",description:"List open items with optional filters.",status:"open",excludeTerminal:!1,allowStatusFilter:!1},{name:"list-in-progress",description:"List in-progress items with optional filters.",status:"in_progress",excludeTerminal:!1,allowStatusFilter:!1},{name:"list-blocked",description:"List blocked items (blocked status or open blocked_by dependencies, matching pm next) with optional filters.",dependencyBlocked:!0,excludeTerminal:!1,allowStatusFilter:!1},{name:"list-closed",description:"List closed items with optional filters.",status:"closed"},{name:"list-canceled",description:"List canceled items with optional filters.",status:"canceled"}];for(let o of a)if(i(o.name)){let r=O(o.name);be(e,{...o,...r?.registration==="commander"?{aliasContract:r}:{}})}if(i("aggregate")){let o=e.command("aggregate").description("Aggregate grouped item counts for governance queries.").option("--group-by <value>","Comma-separated group-by fields (supported: parent,type,priority,status,assignee,tags,sprint,release)").option("--count","Return grouped counts (default behavior)").option("--completion","Add open/in_progress/closed/other counts and completion_pct per group").option("--sum <field>","Sum a numeric field per group").option("--avg <field>","Average a numeric field per group").option("--include-unparented","Include unparented rows when grouping by parent").option("--status <value>","Filter by item status").option("--type <value>","Filter by item type").option("--tag <value>","Filter by tag").option("--priority <value>","Filter by priority").option("--deadline-before <value>","Filter by deadline upper bound (ISO/date string or relative)").option("--deadline-after <value>","Filter by deadline lower bound (ISO/date string or relative)").option("--assignee <value>","Filter by assignee").option("--assignee-filter <value>","Filter assignee presence: assigned|unassigned").option("--parent <value>","Filter by parent item ID").option("--sprint <value>","Filter by sprint").option("--release <value>","Filter by release");l(o,"--include_unparented","Alias for --include-unparented"),l(o,"--assignee_filter <value>","Alias for --assignee-filter"),o.action(we)}if(i("context")){let o=e.command("context").alias("ctx").description("Show a token-efficient project context snapshot for next-work decisions.").option("--for <intent>",`Apply a declared context intent projection. ${b("context","--for")}`).option("--date <value>","Anchor date/time for agenda window calculations (ISO/date string or relative)").option("--from <value>","Agenda lower bound (ISO/date string or relative)").option("--to <value>","Agenda upper bound (ISO/date string or relative)").option("--past","Include past agenda entries in bounded windows").option("--type <value>","Filter by item type").option("--tag <value>","Filter by tag").option("--priority <value>","Filter by priority").option("--assignee <value>","Filter by assignee").option("--assignee-filter <value>","Filter assignee presence: assigned|unassigned").option("--sprint <value>","Filter by sprint").option("--release <value>","Filter by release").option("--parent <id>","Scope the snapshot to one item's subtree (the item plus all descendants)").option("--limit <n>","Limit focus and agenda rows per section").option("--after <cursor>","Continue ranked focus after a next_cursor from a previous context response").option("--format <value>","Context output format override: markdown|toon|json|ndjson").option("--depth <value>","Context depth: brief|standard|deep|full (full = every section, no per-section cap)").option("--section <value...>","Include specific sections (repeatable; overrides --depth)").option("--fields <value>","Project focus rows to a comma-separated field subset (e.g. id,title,priority)").option("--activity-limit <n>","Limit recent activity entries (default: settings or 10)").option("--stale-threshold <value>","Staleness cutoff in days (e.g. 7 or 7d; default: settings or 7)").option("--explain-ranking","Include the scorer model, per-signal contributions, and ranked candidate ids").option("--token-budget <n>","Maximum estimated tokens spent on ranked focus rows").option("--no-extension-health","Omit the installed extension health summary").option("--no-tags","Omit tag arrays from context focus rows");l(o,"--assignee_filter <value>","Alias for --assignee-filter"),l(o,"--max-items <n>","Alias for --limit"),l(o,"--explain_ranking","Alias for --explain-ranking"),l(o,"--token_budget <n>","Alias for --token-budget"),o.action(xe)}if(i("next")){let o=e.command("next").description("Recommend the next actionable (unblocked, ready) work item with rationale + blocked companion.").option("--for <intent>",`Apply a declared context intent projection. ${b("next","--for")}`).option("--type <value>","Filter candidate items by type").option("--tag <value>","Filter candidate items by tag").option("--priority <value>","Filter candidate items by priority").option("--assignee <value>","Filter candidate items by assignee").option("--assignee-filter <value>","Filter assignee presence: assigned|unassigned").option("--sprint <value>","Filter candidate items by sprint").option("--release <value>","Filter candidate items by release").option("--parent <id>","Scope to one item's subtree (the item plus all descendants)").option("--limit <n>","Limit ready rows (default: 5; non-positive falls back to default)").option("--blocked-limit <n>","Limit blocked rows (default: same as --limit)").option("--ready-only","Omit the blocked companion list").option("--include-decisions","Include human-gated Decision items in the claimable ready queue").option("--format <value>","Next output format override: markdown|toon|json").option("--explain-ranking","Include the scorer model, per-signal contributions, and ranked ready ids").option("--token-budget <n>","Maximum estimated tokens spent on the ranked ready queue");l(o,"--assignee_filter <value>","Alias for --assignee-filter"),l(o,"--blocked_limit <n>","Alias for --blocked-limit"),l(o,"--ready_only","Alias for --ready-only"),l(o,"--explain_ranking","Alias for --explain-ranking"),l(o,"--token_budget <n>","Alias for --token-budget"),o.action(ke)}if(i("search")){let o=e.command("search").argument("<keywords...>","Keyword query tokens").description("Search items with keyword, semantic, or hybrid retrieval. Inline field:value tokens (tag:/status:/type:/priority:) in the query are parsed as filters, e.g. 'auth tag:area:search status:open'.").option("--for <intent>",`Apply a declared context intent projection. ${b("search","--for")}`).option("--token-budget <n>","Override the selected intent's maximum estimated output tokens").option("--mode <value>","Search mode: keyword|semantic|hybrid (default: keyword)").option("--semantic","Shorthand for --mode semantic").option("--hybrid","Shorthand for --mode hybrid").option("--match-mode <value>","Token match mode: and|or|exact (default: or with all-terms ranking bonus; and = hard-require every token; exact = exact phrase)").option("--min-score <value>","Per-query minimum score threshold (finite number >= 0); overrides settings search.score_threshold for this query only").option("--count","Return only the count of matching items (post-filter/threshold, pre-limit); skips hit rows").option("--semantic-weight <value>","Override hybrid semantic weight for this query (0..1); invalid values fall back to settings").option("--include-linked","Include linked files, docs, and tests in the searchable corpus").option("--title-exact","Require exact normalized title match for the full query string").option("--phrase-exact","Require exact normalized phrase match in searchable text").option("--highlight","Emit per-field matched-text snippets (wrapped in \xAB\u2026\xBB) on each hit; off by default").option("--status <value>","Filter by status before query (all, open/closed/canceled aliases, or configured status id; CSV)").option("--type <value>","Filter by item type").option("--tag <value>","Filter by tag").option("--priority <value>","Filter by priority").option("--deadline-before <value>","Filter by deadline upper bound (ISO/date string or relative)").option("--deadline-after <value>","Filter by deadline lower bound (ISO/date string or relative)").option("--updated-after <value>",'Filter by updated_at lower bound: ISO timestamp or signed relative (e.g. "-2h"/"-7d" for the past)').option("--updated-before <value>","Filter by updated_at upper bound: ISO timestamp or signed relative (-2h/+1d)").option("--created-after <value>","Filter by created_at lower bound: ISO timestamp or signed relative (-2h/+1d)").option("--created-before <value>","Filter by created_at upper bound: ISO timestamp or signed relative (-2h/+1d)").option("--assignee <value>","Filter by assignee").option("--sprint <value>","Filter by sprint").option("--release <value>","Filter by release").option("--parent <value>","Filter by parent item ID").option("--compact","Render compact search hits (default; mutually exclusive with --full/--fields)").option("--full","Render full search hits with nested item payloads (mutually exclusive with --compact/--fields)").option("--fields <value>",`Render custom comma-separated search hit fields (mutually exclusive with --compact/--full). ${b("search","--fields")}`).option("--format <value>","Search output format override: json|ndjson|toon").option("--limit <n>","Limit returned item count").option("--after <cursor>","Continue after an opaque next_cursor from a previous search response");de(o),o.action(Se),l(o,"--tags <value>","Alias for --tag"),l(o,"--token_budget <n>","Alias for --token-budget")}if(i("eval")&&e.command("eval").description("Evaluate search relevance against a curated golden-query set: reports nDCG@k, MRR@k, precision@k, and recall@k per query plus the macro average. Use --fail-under as a CI gate.").option("--mode <value>","Default retrieval mode for queries without their own: keyword|semantic|hybrid (default: keyword)").option("--k <n>","Metric cutoff @k (positive integer; default: 10)").option("--fail-under <value>","Exit non-zero when aggregate nDCG@k falls below this threshold (0..1); CI gate").option("--queries <path>",`Query JSON (${ne}); default: search/eval-queries.json; errors show an example`).option("--format <value>","Eval output format override: json|toon").action(_e),i("get")){let o=e.command("get").argument("<id>","Item id").option("--for <intent>",`Apply a declared context intent projection. ${b("get","--for")}`).option("--token-budget <n>","Override the selected intent's maximum estimated output tokens").option("--depth <value>","Detail depth: brief|standard|deep|full (full aliases deep; default: standard)").option("--full","Explicit full item read; equivalent to --depth deep (mutually exclusive with --depth/--fields)").option("--fields <value>",`Render custom comma-separated item metadata fields. ${b("get","--fields")}`).option("--tree","Include descendants rooted at the requested item").option("--tree-depth <n>","Maximum subtree depth for --tree descendants").option("--at <version-or-timestamp>","Reconstruct a verified historical item state without mutating it").option("--format <value>","Get output format override: json|toon").description("Show item details by ID.").action(Ie);l(o,"--tree_depth <n>","Alias for --tree-depth"),l(o,"--token_budget <n>","Alias for --token-budget")}i("history")&&e.command("history").argument("<id>","Item id").option("--limit <n>","Return only the latest n history entries").option("--compact","Condensed output: show entry index, timestamp, op, author, patch count, and changed fields").option("--full","Show full history entries with JSON Patch payloads").option("--provenance","Show patch-free author, harness, instance, and extensible provenance").option("--provenance-summary","Include bounded provenance completeness counts").option("--harness <value>","Filter by recorded or vocabulary-resolved harness (repeatable)",s).option("--agent-instance <value>","Filter by privacy-safe agent instance (repeatable)",s).option("--provenance-filter <dimension=value>","Filter by an exact declared provenance value (repeatable)",s).option("--diff","Include per-entry field-level before/after value diffs computed by replaying the history chain").option("--field <name>","With --diff, show only entries that changed this field (implies --diff)").option("--verify","Verify hash chain and replay integrity for the full history stream").option("--strict-exit","With --verify, exit nonzero when verification fails (merge-safety gate parity with pm validate)").option("--fail-on-warn","Alias for --strict-exit").option("--format <value>","History output format override: json|toon").description("Show item history entries.").action(Ae),i("events")&&e.command("events").option("--since <cursor-or-timestamp>","Resume strictly after a durable cursor, or include events from an ISO timestamp").option("--type <value>","Filter by mutation operation (repeatable or comma-separated)",s).option("--author <value>","Filter by mutation author (repeatable or comma-separated)",s).option("--item <value>","Filter by item or workspace stream id (repeatable or comma-separated)",s).option("--limit <n>","Return at most 1,000 events (default: 100)").option("--cursor-mode <mode>","Cursor framing: batch emits one terminal trailer (default); row preserves one cursor per event").option("--full","Include each complete authoritative history entry").option("--provenance","Include patch-free author, harness, instance, and extensible provenance").option("--provenance-summary","Include bounded provenance completeness counts").option("--harness <value>","Filter by recorded or vocabulary-resolved harness (repeatable)",s).option("--agent-instance <value>","Filter by privacy-safe agent instance (repeatable)",s).option("--provenance-filter <dimension=value>","Filter by an exact declared provenance value (repeatable)",s).option("--follow","Continue emitting committed events as newline-delimited JSON").option("--interval-ms <n>","Empty-read delay while following (minimum: 10ms; default: 250ms)").description("Emit cursor-resumable committed mutation facts as newline-delimited JSON.").action(je),i("activity")&&e.command("activity").option("--id <value>","Filter by item ID").option("--op <value>","Filter by history operation").option("--author <value>","Filter by history author").option("--from <value>","Lower timestamp bound (ISO/date string or relative)").option("--to <value>","Upper timestamp bound (ISO/date string or relative)").option("--limit <n>","Return only the latest n activity entries").option("--unbounded","Explicitly return every matching activity entry (disables the default bound)").option("--compact","Condensed output: show only id, op, ts, author, msg per entry").option("--raw","Show the legacy compact per-event stream instead of the item digest").option("--full","Show full activity entries with JSON Patch payloads").option("--provenance","Show patch-free author, harness, instance, and extensible provenance").option("--provenance-summary","Include bounded provenance completeness counts").option("--harness <value>","Filter by recorded or vocabulary-resolved harness (repeatable)",s).option("--agent-instance <value>","Filter by privacy-safe agent instance (repeatable)",s).option("--provenance-filter <dimension=value>","Filter by an exact declared provenance value (repeatable)",s).option("--stream [mode]","Emit line-delimited JSON rows (requires --json). Optional mode: rows|ndjson|jsonl").description("Show recent activity across items.").action(Ee),i("graph")&&e.command("graph").argument("<subcommand>","Graph query (ancestors, descendants, predecessors, successors, paths, impact, analyze, audit, communities, redundancy, dominators, slack, centrality, articulation, plan, index)").argument("[id]","Root item id (traversals, paths, impact, and dominators)").argument("[target]","Target item id (paths only)").option("--kind <value>","Restrict traversal to registered relationship kinds (repeatable or comma-separated)",s).option("--max-depth <value>","Maximum traversal depth (non-negative integer)").option("--limit <value>","Maximum returned rows per bounded collection").option("--after <value>","Resume a traversal after this previously returned node id").option("--direction <value>","Edge orientation for paths/impact (outgoing, incoming, or both)").option("--max-paths <value>","Maximum enumerated paths (paths only)").option("--sample <value>","Maximum evidence sample entries per audit finding (audit only)").option("--exempt-isolate <value>","Item ids treated as explicitly valid isolates by the audit (repeatable or comma-separated)",s).option("--exempt-isolate-type <value>","Item types whose active isolates are policy-valid for the audit (repeatable or comma-separated)",s).option("--save-baseline","Persist the audit census as the change-since-baseline comparison point (audit only)").option("--rebuild","Rebuild and warm the durable graph index (index only)").option("--clear","Delete the durable graph index (index only)").option("--summary","Return counts-first envelopes without row collections").option("--full","Return the complete graph row projection").description("Bounded workspace relationship-graph queries, analytics, and governance audit.").action(Ce)}var xt={resolveReadCommandOutputFormat:_,parseListFormat:le};export{xt as _testOnlyRegisterListQuery,wt as registerListQueryCommands};
11
- //# sourceMappingURL=register-list-query-XVN2ZLI7.js.map
11
+ //# sourceMappingURL=register-list-query-EUWM6VII.js.map