@unbrained/pm-cli 2026.8.14 → 2026.8.15

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 (145) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +25 -2
  3. package/dist/cli/commander-usage.js +17 -4
  4. package/dist/cli/error-guidance.d.ts +2 -0
  5. package/dist/cli/error-guidance.js +52 -25
  6. package/dist/cli/main.js +3 -2
  7. package/dist/cli/register-mutation.js +4 -2
  8. package/dist/cli/register-operations.js +5 -5
  9. package/dist/cli-bundle/bundle-manifest.json +150 -150
  10. package/dist/cli-bundle/chunks/{chunk-TXMEUUUY.js → chunk-24GAV7XL.js} +2 -2
  11. package/dist/cli-bundle/chunks/{chunk-TMJ7URWS.js → chunk-AIM6VT2N.js} +9 -9
  12. package/dist/cli-bundle/chunks/chunk-DSWDLTDR.js +197 -0
  13. package/dist/cli-bundle/chunks/{chunk-FIW4P64F.js → chunk-J42EGKDK.js} +2 -2
  14. package/dist/cli-bundle/chunks/chunk-KIEGUBYQ.js +2 -0
  15. package/dist/cli-bundle/chunks/{chunk-SBRKH6OR.js → chunk-KLKYLSDX.js} +2 -2
  16. package/dist/cli-bundle/chunks/{chunk-G5JUB66K.js → chunk-LJHOAVGI.js} +59 -59
  17. package/dist/cli-bundle/chunks/{chunk-BFALV3YP.js → chunk-MEM2ZS3O.js} +2 -2
  18. package/dist/cli-bundle/chunks/chunk-QHPCJWEJ.js +35 -0
  19. package/dist/cli-bundle/chunks/{chunk-XAVMOK6B.js → chunk-WLPDLNEZ.js} +2 -2
  20. package/dist/cli-bundle/chunks/{register-list-query-T3EHHNNV.js → register-list-query-CT3LFDDN.js} +2 -2
  21. package/dist/cli-bundle/chunks/{register-mutation-E27WCLSZ.js → register-mutation-NWEVA5YS.js} +3 -3
  22. package/dist/cli-bundle/chunks/register-operations-AHIAG5KM.js +2 -0
  23. package/dist/cli-bundle/chunks/{register-setup-3YXZ444E.js → register-setup-ZJZFVAKE.js} +2 -2
  24. package/dist/cli-bundle/focused-chunks/chunk-4X57RE4U.js +2 -0
  25. package/dist/cli-bundle/focused-chunks/{chunk-XDNAW5OI.js → chunk-6XKF3PGV.js} +2 -2
  26. package/dist/cli-bundle/focused-chunks/chunk-7NJ4QYQ2.js +2 -0
  27. package/dist/cli-bundle/focused-chunks/{chunk-WCVE2NIG.js → chunk-EXZA4257.js} +2 -2
  28. package/dist/cli-bundle/focused-chunks/chunk-ITAUHSO6.js +50 -0
  29. package/dist/cli-bundle/focused-chunks/{chunk-4DQ2YERC.js → chunk-KLVUMNXJ.js} +2 -2
  30. package/dist/cli-bundle/focused-chunks/{chunk-K7RWWOAG.js → chunk-KT5XMYSX.js} +2 -2
  31. package/dist/cli-bundle/focused-chunks/{chunk-PPFGQDSI.js → chunk-KTKH4IMG.js} +2 -2
  32. package/dist/cli-bundle/focused-chunks/chunk-M67F5AIN.js +8 -0
  33. package/dist/cli-bundle/focused-chunks/{chunk-KSEDUWVZ.js → chunk-NSPYTG6G.js} +2 -2
  34. package/dist/cli-bundle/focused-chunks/chunk-OKA6ELTL.js +2 -0
  35. package/dist/cli-bundle/focused-chunks/chunk-PUISBOPP.js +2 -0
  36. package/dist/cli-bundle/focused-chunks/chunk-QLNMCESQ.js +155 -0
  37. package/dist/cli-bundle/focused-chunks/{chunk-LZ4MV3RH.js → chunk-SLKC6QLJ.js} +2 -2
  38. package/dist/cli-bundle/focused-chunks/chunk-U65UC4G3.js +2 -0
  39. package/dist/cli-bundle/focused-chunks/{chunk-KFSZ3BP6.js → chunk-WTSER4WJ.js} +6 -6
  40. package/dist/cli-bundle/focused-chunks/{chunk-YOOI3UZX.js → chunk-ZMFXQ7VF.js} +2 -2
  41. package/dist/cli-bundle/main.js +13 -13
  42. package/dist/cli-bundle/sdk-authoring.js +1 -1
  43. package/dist/cli-bundle/sdk-contracts.js +1 -1
  44. package/dist/cli-bundle/sdk-core.js +32 -35
  45. package/dist/cli-bundle/sdk-governance.js +1 -1
  46. package/dist/cli-bundle/sdk-graph.js +1 -1
  47. package/dist/cli-bundle/sdk-merge.js +32 -31
  48. package/dist/cli-bundle/sdk-query.js +1 -1
  49. package/dist/cli-bundle/sdk-runtime.js +1 -1
  50. package/dist/cli-bundle/sdk-testing.js +1 -1
  51. package/dist/cli-bundle/sdk.js +2 -2
  52. package/dist/core/diagnostics/remediation.js +7 -2
  53. package/dist/core/extensions/reserved-host-flags.js +3 -2
  54. package/dist/core/history/replay.d.ts +14 -1
  55. package/dist/core/history/replay.js +45 -8
  56. package/dist/core/output/output.d.ts +2 -0
  57. package/dist/core/output/output.js +3 -2
  58. package/dist/core/shared/command-types.d.ts +2 -0
  59. package/dist/core/shared/command-types.js +2 -2
  60. package/dist/core/shared/errors.d.ts +12 -0
  61. package/dist/core/shared/errors.js +2 -2
  62. package/dist/mcp/tool-definitions.js +9 -5
  63. package/dist/sdk/agent/refusal-reachability.d.ts +61 -0
  64. package/dist/sdk/agent/refusal-reachability.js +91 -3
  65. package/dist/sdk/cli-bootstrap.d.ts +2 -0
  66. package/dist/sdk/cli-bootstrap.js +7 -2
  67. package/dist/sdk/cli-contracts/completeness.js +3 -2
  68. package/dist/sdk/cli-contracts/flag-contracts.js +3 -2
  69. package/dist/sdk/cli-contracts/registration-helpers.js +3 -2
  70. package/dist/sdk/cli-contracts/runtime-contracts.d.ts +5 -0
  71. package/dist/sdk/cli-contracts/runtime-contracts.js +23 -7
  72. package/dist/sdk/cli-contracts/tool-parameter-tables.js +15 -5
  73. package/dist/sdk/cli-contracts/tool-schema.js +10 -3
  74. package/dist/sdk/cli-program.js +3 -2
  75. package/dist/sdk/core.d.ts +2 -2
  76. package/dist/sdk/core.js +3 -3
  77. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +26 -2
  78. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +50 -26
  79. package/dist/sdk/governance/assurance-action.d.ts +7 -1
  80. package/dist/sdk/governance/assurance-action.js +7 -6
  81. package/dist/sdk/governance/assurance-mutation-error.d.ts +42 -1
  82. package/dist/sdk/governance/assurance-mutation-error.js +27 -3
  83. package/dist/sdk/governance/assurance-runtime.js +12 -11
  84. package/dist/sdk/governance/assurance.d.ts +9 -0
  85. package/dist/sdk/governance/assurance.js +80 -14
  86. package/dist/sdk/governance/extension-host-version.d.ts +25 -0
  87. package/dist/sdk/governance/extension-host-version.js +105 -0
  88. package/dist/sdk/governance/health.d.ts +32 -1
  89. package/dist/sdk/governance/health.js +119 -27
  90. package/dist/sdk/governance/provenance-health.d.ts +27 -0
  91. package/dist/sdk/governance/provenance-health.js +95 -3
  92. package/dist/sdk/governance/validate.js +7 -8
  93. package/dist/sdk/governance.d.ts +6 -0
  94. package/dist/sdk/governance.js +8 -2
  95. package/dist/sdk/history-repair.d.ts +13 -1
  96. package/dist/sdk/history-repair.js +62 -18
  97. package/dist/sdk/linked-artifacts.js +16 -5
  98. package/dist/sdk/pagination.d.ts +15 -0
  99. package/dist/sdk/pagination.js +9 -5
  100. package/dist/sdk/query/context.d.ts +5 -1
  101. package/dist/sdk/query/context.js +14 -5
  102. package/dist/sdk/read-output/continuation.d.ts +11 -0
  103. package/dist/sdk/read-output/continuation.js +132 -0
  104. package/dist/sdk/read-output-budget.d.ts +1 -1
  105. package/dist/sdk/read-output-budget.js +14 -10
  106. package/dist/sdk/read-output-contracts.d.ts +66 -2
  107. package/dist/sdk/read-output-contracts.js +183 -19
  108. package/dist/sdk/read-output-rows.d.ts +2 -0
  109. package/dist/sdk/read-output-rows.js +15 -2
  110. package/dist/sdk/runtime-input.js +4 -2
  111. package/docs/ASSURANCE.md +59 -2
  112. package/docs/COMMANDS.md +8 -2
  113. package/docs/READ_OUTPUT_CONTRACTS.md +49 -8
  114. package/docs/RELEASING.md +42 -5
  115. package/docs/SDK_CONTEXT_INTEGRITY.md +64 -2
  116. package/marketplace.json +2 -2
  117. package/package.json +3 -3
  118. package/packages/pm-beads/package.json +1 -1
  119. package/packages/pm-calendar/package.json +1 -1
  120. package/packages/pm-command-kit/package.json +1 -1
  121. package/packages/pm-digital-twin/package.json +1 -1
  122. package/packages/pm-governance-audit/package.json +1 -1
  123. package/packages/pm-guide-shell/package.json +1 -1
  124. package/packages/pm-kanban/package.json +1 -1
  125. package/packages/pm-lifecycle-hooks/package.json +1 -1
  126. package/packages/pm-linked-test-adapters/package.json +1 -1
  127. package/packages/pm-search-advanced/package.json +1 -1
  128. package/packages/pm-templates/package.json +1 -1
  129. package/packages/pm-todos/package.json +1 -1
  130. package/packages/pm-vcs/package.json +1 -1
  131. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  132. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  133. package/sdk/public-surface.json +1133 -187
  134. package/dist/cli-bundle/chunks/chunk-BBOFSVAK.js +0 -197
  135. package/dist/cli-bundle/chunks/chunk-YAMTJL6Y.js +0 -34
  136. package/dist/cli-bundle/chunks/chunk-YSVSMJ2B.js +0 -2
  137. package/dist/cli-bundle/chunks/register-operations-4R6I7CPY.js +0 -2
  138. package/dist/cli-bundle/focused-chunks/chunk-F43TT2QQ.js +0 -8
  139. package/dist/cli-bundle/focused-chunks/chunk-KYUQGTSB.js +0 -2
  140. package/dist/cli-bundle/focused-chunks/chunk-PGXJQLCT.js +0 -155
  141. package/dist/cli-bundle/focused-chunks/chunk-Q4YY3XNF.js +0 -2
  142. package/dist/cli-bundle/focused-chunks/chunk-QK753U3U.js +0 -46
  143. package/dist/cli-bundle/focused-chunks/chunk-QUMB2J27.js +0 -2
  144. package/dist/cli-bundle/focused-chunks/chunk-SM7MTG27.js +0 -2
  145. package/dist/cli-bundle/focused-chunks/chunk-ZM6TZVHC.js +0 -2
@@ -1,2 +1,2 @@
1
- import{a as R,f as O}from"./chunk-FIW4P64F.js";import{Aa as U,Ka as C,Oa as j,Qa as T,xa as I}from"./chunk-XAVMOK6B.js";import"./chunk-WYRZZ5ZE.js";import{Af as S,C as d,Cf as _,Df as y,E as b,rl as v,ul as E}from"./chunk-BBOFSVAK.js";import A from"node:fs/promises";import L from"node:path";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="054789eb-fabe-5042-8166-19961f30ebf1")}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]="3e4ba524-10cf-58e7-81ea-f48f30ca1250")}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]="defd826a-ac9b-54e4-b2a3-00d022090a10")}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]="4344c493-be53-584f-b25d-4b41bfee5079")}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]="08f5b31f-c756-577c-94e8-7b4268ba12ab")}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]="59c52ff5-9763-5244-bed3-146a547c3551")}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]="d498a64c-9680-52a9-981d-4ce86949784d")}catch{}})();var z={init:"init",install:"install",uninstall:"uninstall",explore:"explore",manage:"manage",describe:"describe",reload:"reload",doctor:"doctor",catalog:"catalog",adopt:"adopt","adopt-all":"adoptAll",activate:"activate",deactivate:"deactivate",migrate:"migrate"};function H(e){let t=e.capability,o=typeof t=="string"?[t]:Array.isArray(t)?t.filter(i=>typeof i=="string"):[],a=[...new Set(o.map(i=>i.trim().toLowerCase()).filter(i=>i.length>0))];if(a.length>1)throw new b(`Multiple scaffold capabilities cannot be combined yet: ${a.join(", ")}. Choose one capability per scaffold.`,d.USAGE);return a[0]}function G(e,t,o="extension"){let a={...e};t!==void 0&&(a[z[t]]=!0);let i=(...c)=>c.some(r=>a[r]===!0),n=(...c)=>{for(let r of c)if(typeof a[r]=="string")return a[r]};return{init:i("init"),scaffold:i("scaffold"),install:i("install"),uninstall:i("uninstall"),explore:i("explore","list"),manage:i("manage"),describe:i("describe"),markdown:i("markdown"),reload:i("reload"),doctor:i("doctor"),catalog:i("catalog"),adopt:i("adopt"),adoptAll:i("adoptAll","adopt_all","adopt-all"),activate:i("activate"),deactivate:i("deactivate"),migrate:i("migrate"),project:i("project"),local:i("local"),global:i("global"),gh:n("gh"),github:n("github"),ref:n("ref"),capability:H(e),declarative:i("declarative"),fields:n("fields"),detail:n("detail"),output:n("output"),trace:i("trace"),watch:i("watch"),runtimeProbe:i("runtimeProbe","runtime_probe","runtime-probe"),fixManagedState:i("fixManagedState","fix_managed_state","fix-managed-state"),isolated:i("isolated"),ignoreGlobal:i("ignoreGlobal","ignore_global","ignore-global"),strictExit:i("strictExit","strict_exit","strict-exit"),failOnWarn:i("failOnWarn","fail_on_warn","fail-on-warn"),dryRun:i("dryRun","dry_run","dry-run"),vocabulary:o}}async function N(e){let t=(await A.readdir(process.cwd())).filter(a=>!a.startsWith(".")).sort((a,i)=>a.localeCompare(i)),o=[...e].sort((a,i)=>a.localeCompare(i));return t.length===o.length&&t.every((a,i)=>a===o[i])}async function q(e){let t=(e??[]).map(o=>o.trim()).filter(o=>o.length>0);return t.length<=1?t.length===0?void 0:t:await N(t)?["*"]:t}function P(e,t,o){let a=e.markdown===!0;if(o!==void 0&&o==="")throw new b("--output requires a non-empty file path.",d.USAGE);if(o!==void 0&&!a)throw new b("--output is only supported with --markdown describe output.",d.USAGE);if(a){if(t.json)throw new b("Cannot combine --json with --markdown.",d.USAGE);if(e.describe!==!0)throw new b("--markdown is only supported by the describe action.",d.USAGE)}}async function B(e){let t=U(e.result.details,e.vocabulary);if(e.outputPath!==void 0){let o=L.resolve(e.outputPath);await A.mkdir(L.dirname(o),{recursive:!0}),await A.writeFile(o,t,"utf8")}if(!e.globalOptions.quiet){for(let o of e.result.warnings)y(`warning: ${o}`);e.outputPath===void 0&&S(t)}}function K(e,t){let o=!!t.strictExit||!!t.failOnWarn;if(e.action!=="doctor"||!o)return;let a=e.details!==null&&typeof e.details=="object"?e.details:{},i=a.summary!==null&&typeof a.summary=="object"?a.summary:null,n=i&&typeof i.status=="string"?i.status:void 0;(e.warnings.length>0||n!==void 0&&n!=="ok")&&(process.exitCode=d.GENERIC_FAILURE)}async function p(e,t,o,a,i="extension"){let n=v(o),c=Date.now(),r=G(t,a,i),s=(typeof r.output=="string"?r.output:void 0)?.trim();P(r,n,s);let m=await C(e,r,n);r.markdown===!0?await B({result:m,vocabulary:i,outputPath:s,globalOptions:n}):_(m,n),K(m,r),m.ok===!1&&(process.exitCode=d.GENERIC_FAILURE),n.profile&&y(`profile:command=extension took_ms=${Date.now()-c}`)}function V(e){return e.details!==null&&typeof e.details=="object"?e.details:{}}function X(e){return e instanceof b?{message:e.message,exit_code:e.exitCode,...e.context}:{message:e instanceof Error?e.message:String(e),exit_code:d.GENERIC_FAILURE}}async function F(e,t,o,a){let i=await q(e);if(i===void 0||i.length<=1){await p(i?.[0],t,o,"install",a);return}let n=v(o),c=Date.now(),r=G(t,"install",a);if(P(r,n,void 0),[r.gh,r.github].some(g=>typeof g=="string"&&g.trim().length>0))throw new b("Multiple install targets cannot be combined with --gh/--github. Install one GitHub source per command, or pass multiple explicit local, bundled, or npm: targets.",d.USAGE,{code:"multi_target_github_install_ambiguous",required:"Use exactly one positional target with --gh/--github, or omit --gh/--github when installing multiple targets.",examples:["pm install --gh owner/repo","pm install npm:pm-guide-shell pm-todos"]});let s=[],m=[],w=d.GENERIC_FAILURE;for(let g of i)try{let h=await C(g,r,n),f=V(h),x=Array.isArray(h.warnings)?h.warnings:[];m.push(...x);let D=h.ok===!0;s.push({target:g,ok:D,extension:f.extension,source:f.source,destination_path:f.destination_path,activated:f.activated,settings_changed:f.settings_changed,command_paths:f.command_paths,action_paths:f.action_paths,runtime_activation_status:f.runtime_activation_status,activation_diagnostics:f.activation_diagnostics,command_discovery:f.command_discovery,verification:f.verification,warnings:x,...D?{}:{error:{message:"Extension install returned ok=false without throwing an error.",exit_code:d.GENERIC_FAILURE,code:"extension_install_soft_failed"}}})}catch(h){let f=X(h),x=f.exit_code;typeof x=="number"&&w===d.GENERIC_FAILURE&&x!==d.GENERIC_FAILURE&&(w=x),s.push({target:g,ok:!1,error:f})}let k=s.filter(g=>g.ok!==!0).length,M={ok:k===0,action:"install",scope:r.global===!0?"global":"project",installed_count:s.length-k,failed_count:k,targets:s,warnings:[...new Set(m)].sort((g,h)=>g.localeCompare(h))};_(M,n),k>0&&(process.exitCode=w),n.profile&&y(`profile:command=extension took_ms=${Date.now()-c}`)}function Y(e){return e.option("--project","Use project extension scope (default)").option("--local","Alias for --project").option("--global","Use global extension scope")}function $(e){return e.option("--project","Use project package scope (default)").option("--local","Alias for --project").option("--global","Use global package scope")}function u(e,t){return t==="package"?$(e):Y(e)}function W(e,t){let o=t==="package"?"package":"extension",a=t==="package"?"packages":"extensions",i=t,n=e.command(i).argument("[target]",`${o[0].toUpperCase()}${o.slice(1)} source/name or scaffold target path (for --init/--scaffold)`).option("--init",`Generate a starter ${o} scaffold at target path`).option("--scaffold","Alias for --init").option("--capability <kind>",`Capability the --init starter targets (${I.join("|")}; default commands)`,E).option("--install",`Install ${o} from local path, bundled alias, npm: source, wildcard, or GitHub source`).option("--uninstall",`Uninstall an installed ${o}`).option("--explore",`List discovered ${a} in selected scope`).option("--list","Alias for --explore").option("--manage",`List managed ${a} with update-check metadata`).option("--describe",`Map every surface a loaded ${o} registers (optionally one by name)`).option("--markdown","Render describe output as a Markdown reference document (describe only)").option("--output <path>","Write describe Markdown to a file (requires --markdown)").option("--reload",`Reload ${a} with cache-busted module imports`).option("--watch","Use watch mode with --reload").option("--doctor",`Run consolidated ${o} diagnostics (summary/deep modes)`).option("--catalog",`List bundled first-party ${o} catalog metadata`).option("--adopt",`Adopt an existing unmanaged ${o} into managed metadata`).option("--adopt-all",`Adopt all unmanaged ${a} into managed metadata`).option("--activate",`Activate a ${o} in selected scope settings`).option("--deactivate",`Deactivate a ${o} in selected scope settings`).option("--project",`Use project ${o} scope (default)`).option("--local","Alias for --project").option("--global",`Use global ${o} scope`).option("--gh <github-source>","Install from GitHub shorthand source (owner/repo[/path])").option("--github <github-source>","Alias for --gh").option("--ref <ref>","Git ref/branch/tag for GitHub install sources").option("--detail <mode>",`${o[0].toUpperCase()}${o.slice(1)} diagnostics detail mode (summary|deep)`).option("--trace","Include actionable registration traces in doctor deep diagnostics").option("--runtime-probe","Opt-in runtime activation probe for manage output parity").option("--fix-managed-state",`Adopt unmanaged ${a} before diagnostics/update checks`).option("--isolated",`Run doctor against project-scope ${a} only, ignoring global registrations`).option("--ignore-global","Alias for --isolated").option("--strict-exit","Return non-zero exit when doctor warnings are present (ok=false)").option("--fail-on-warn","Alias for --strict-exit (doctor)").description(t==="package"?"Manage package lifecycle operations for project or global scope. Backward-compatible with extension packages.":"Manage extension lifecycle operations for project or global scope.").action(async(r,l,s)=>{await p(r,s.optsWithGlobals(),s,void 0,t)});t==="package"&&(n.alias("packages"),n.option("--declarative","Scaffold the composeExtension blueprint starter (any capability)"));let c=n.command("init").alias("scaffold").argument("<target>","Scaffold target directory path").option("--capability <kind>",`Capability the starter targets (${I.join("|")}; default commands)`,E).description(t==="package"?"Generate a starter package scaffold with package metadata, manifest, and entrypoint.":"Generate a starter extension scaffold with manifest and entrypoint.");t==="package"&&c.option("--declarative","Scaffold the composeExtension blueprint starter (any capability)"),u(c,t).action(async(r,l,s)=>{await p(r,s.optsWithGlobals(),s,"init",t)}),u(n.command("install").argument("[targets...]",`${o[0].toUpperCase()}${o.slice(1)} source (local path, bundled alias, npm: source, wildcard, or GitHub source)`).option("--gh <github-source>","Install from GitHub shorthand source (owner/repo[/path])").option("--github <github-source>","Alias for --gh").option("--ref <ref>","Git ref/branch/tag for GitHub install sources").description(`Install ${o} from local path, bundled alias, npm: source, wildcard, or GitHub source.`),t).action(async(r,l,s)=>{await F(r,s.optsWithGlobals(),s,t)}),u(n.command("uninstall").argument("<target>",`${o[0].toUpperCase()}${o.slice(1)} name`).description(`Uninstall an installed ${o}.`),t).action(async(r,l,s)=>{await p(r,s.optsWithGlobals(),s,"uninstall",t)}),u(n.command("explore").description(`List discovered ${a} in selected scope.`),t).action(async(r,l)=>{await p(void 0,l.optsWithGlobals(),l,"explore",t)}),u(n.command("manage").option("--runtime-probe","Opt-in runtime activation probe for manage output parity").option("--fix-managed-state",`Adopt unmanaged ${a} before diagnostics/update checks`).description(`List managed ${a} with update-check metadata.`),t).action(async(r,l)=>{await p(void 0,l.optsWithGlobals(),l,"manage",t)}),u(n.command("describe").argument("[target]",`${o[0].toUpperCase()}${o.slice(1)} name to describe (omit for every loaded ${o})`).option("--markdown","Render the surface map as a Markdown reference document instead of toon/json").option("--output <path>","Write Markdown output to a file (requires --markdown)").description(`Map every surface a loaded ${o} registers (commands, hooks, item types, providers, overrides, ...).`),t).action(async(r,l,s)=>{await p(r,s.optsWithGlobals(),s,"describe",t)}),u(n.command("reload").option("--watch","Use watch mode for repeated reload checks").description(`Reload ${a} with cache-busted module imports.`),t).action(async(r,l)=>{await p(void 0,l.optsWithGlobals(),l,"reload",t)}),u(n.command("doctor").option("--detail <mode>",`Detail mode for ${o} diagnostics (summary|deep)`).option("--trace","Include actionable registration traces in doctor deep diagnostics").option("--fix-managed-state",`Adopt unmanaged ${a} before diagnostics/update checks`).option("--isolated",`Run doctor against project-scope ${a} only, ignoring global registrations`).option("--ignore-global","Alias for --isolated").option("--strict-exit","Return non-zero exit when doctor warnings are present (ok=false)").option("--fail-on-warn","Alias for --strict-exit (doctor)").description(`Run consolidated ${o} diagnostics (summary/deep modes).`),t).action(async(r,l)=>{await p(void 0,l.optsWithGlobals(),l,"doctor",t)}),u(n.command("catalog").alias("list").option("--fields <value>","Render compact comma-separated catalog fields, for example: alias,installed,install_command").description(`List bundled first-party ${o} catalog metadata.`),t).action(async(r,l)=>{await p(void 0,l.optsWithGlobals(),l,"catalog",t)}),u(n.command("adopt").argument("<target>",`${o[0].toUpperCase()}${o.slice(1)} name`).option("--gh <owner/repo[/path]>",`GitHub provenance shorthand for adopted ${o}`).option("--github <owner/repo[/path]>","Alias for --gh").option("--ref <ref>","Git ref/branch/tag for GitHub shorthand source").description(`Adopt an existing unmanaged ${o} into managed metadata.`),t).action(async(r,l,s)=>{await p(r,s.optsWithGlobals(),s,"adopt",t)}),u(n.command("adopt-all").description(`Adopt all unmanaged ${a} into managed metadata.`),t).action(async(r,l)=>{await p(void 0,l.optsWithGlobals(),l,"adopt-all",t)}),u(n.command("migrate").option("--dry-run","Plan active migrations without invoking extension code").description(`Plan or apply active ${o} migrations with durable receipts.`),t).action(async(r,l)=>{await p(void 0,l.optsWithGlobals(),l,"migrate",t)}),u(n.command("activate").argument("<target>",`${o[0].toUpperCase()}${o.slice(1)} name`).description(`Activate a ${o} in selected scope settings.`),t).action(async(r,l,s)=>{await p(r,s.optsWithGlobals(),s,"activate",t)}),u(n.command("deactivate").argument("<target>",`${o[0].toUpperCase()}${o.slice(1)} name`).description(`Deactivate a ${o} in selected scope settings.`),t).action(async(r,l,s)=>{await p(r,s.optsWithGlobals(),s,"deactivate",t)})}async function J(e,t,o){let a=v(o),i=Date.now(),n=await T(e,a,{idPrefix:typeof t.idPrefix=="string"?t.idPrefix:void 0,preset:typeof t.preset=="string"?t.preset:void 0,defaults:t.defaults===!0||t.yes===!0,author:typeof t.author=="string"?t.author:void 0,agentGuidance:typeof t.agentGuidance=="string"?t.agentGuidance:void 0,typePreset:typeof t.typePreset=="string"?t.typePreset:void 0,withPackages:t.withPackages===!0,mergeFence:t.mergeFence!==!1,force:t.force===!0,workspace:typeof t.workspace=="string"?t.workspace:void 0}),r=t.verbose===!0||a.json===!0;_(r?n:j(n),a),a.profile&&y(`profile:command=init took_ms=${Date.now()-i}`)}function Q(e,t,o,a){let n=e!==void 0&&new Set(["get","set","list","export"]).has(e);return{resolvedScope:n?"project":e??"project",resolvedAction:n?e:t??"list",resolvedKey:n?t:o,resolvedValue:n?o:a}}function Z(e){return{criterion:Array.isArray(e.criterion)?e.criterion:[],format:typeof e.format=="string"?e.format:void 0,policy:typeof e.policy=="string"?e.policy:void 0,value:typeof e.value=="string"?e.value:void 0,clearCriteria:e.clearCriteria===!0,defaultDepth:typeof e.defaultDepth=="string"?e.defaultDepth:void 0,activityLimit:typeof e.activityLimit=="string"?e.activityLimit:void 0,staleThresholdDays:typeof e.staleThresholdDays=="string"?e.staleThresholdDays:void 0,sectionHierarchy:typeof e.sectionHierarchy=="string"?e.sectionHierarchy:void 0,sectionActivity:typeof e.sectionActivity=="string"?e.sectionActivity:void 0,sectionProgress:typeof e.sectionProgress=="string"?e.sectionProgress:void 0,sectionBlockers:typeof e.sectionBlockers=="string"?e.sectionBlockers:void 0,sectionFiles:typeof e.sectionFiles=="string"?e.sectionFiles:void 0,sectionWorkload:typeof e.sectionWorkload=="string"?e.sectionWorkload:void 0,sectionStaleness:typeof e.sectionStaleness=="string"?e.sectionStaleness:void 0,sectionTests:typeof e.sectionTests=="string"?e.sectionTests:void 0}}async function ee(e,t,o,a,i,n){let c=v(n),r=Date.now(),{resolvedScope:l,resolvedAction:s,resolvedKey:m,resolvedValue:w}=Q(e,t,o,a),k=await O(l,s,m,Z(i),c,typeof w=="string"?w:void 0);_(k,c),c.profile&&y(`profile:command=config took_ms=${Date.now()-r}`)}var ve={normalizeExtensionOptions:G};function Ee(e){e.command("init").argument("[prefix-or-path]","Optional id prefix, or path-like tracker target such as ./pm-sandbox").option("--prefix, --id-prefix <value>","Set the item ID prefix (alias for the positional prefix)").option("--preset <value>","Governance preset for new setups: minimal|default|strict").option("--defaults","Use non-interactive setup defaults without opening the wizard").option("-y, --yes","Alias for --defaults (non-interactive setup)").option("--author <value>","Set the default mutation author for this project").option("--agent-guidance <mode>","Agent guidance mode: ask|add|skip|status").option("--type-preset <name>","Register domain item types during init: agile|ops|research").option("--with-packages","Install all bundled first-party packages during initialization").option("--no-merge-fence","Skip automatic merge-driver installation for a fresh Git-backed tracker").option("--workspace <dir>","Initialize repository-local tracker storage at <dir>/.agents/pm").option("--force","Allow initializing tracker files directly in a directory that looks like a workspace root").option("--verbose","Include the full resolved settings tree in the output (default output is a concise summary)").description("Initialize pm storage and defaults for the current workspace or a path-like tracker target.").action(async(t,o,a)=>{await J(t,o,a)}),e.command("config").argument("[scope]","Config scope: project|global, or action shorthand list|export|get|set for project scope").argument("[action]","Config action: get|set|list|export").argument("[key]","Config key for get|set; use `pm config project list` for the complete typed inventory, including mutation-guard-* policies").argument("[value]",'Optional value for set: routed to the right typed flag by key (e.g. config set telemetry-tracking off, config set item-format toon, config set definition-of-done "Tests pass"). Equivalent to --policy/--format/--criterion. context keys still require --default-depth/--section-* flags.').option("--criterion <text>","Criteria value for definition-of-done, metadata-required-fields, or lifecycle pattern keys (repeatable for set)",E).option("--clear-criteria","Clear criteria-list keys for config set operations").option("--format <value>","Item format for item-format key: toon").option("--policy <value>","Policy key values: history-missing-stream-policy=auto_create|strict_error; sprint-release-format-policy=warn|strict_error; parent-reference-policy=warn|strict_error; governance-preset=minimal|default|strict|custom; governance-ownership-enforcement=none|warn|strict; governance-create-mode-default=progressive|strict; governance-close-validation-default=off|warn|strict; governance-require-close-reason=enabled|disabled; governance-parent-reference-policy=warn|strict_error; governance-metadata-validation-profile=core|strict|custom; governance-force-required-for-stale-lock=enabled|disabled; governance-duplicate-detection-mode=off|advisory|strict; test-result-tracking=enabled|disabled; telemetry-tracking=enabled|disabled").option("--value <value>","Typed nested setting value. Mutation guards: require-attributed-author=true|false, secret-guard=off|advise|block, stale-in-progress-hours=integer>=1. Kebab-case is preferred; underscore aliases remain accepted.").option("--default-depth <value>","Context default depth: brief|standard|deep").option("--activity-limit <n>","Context default activity limit").option("--stale-threshold-days <n>","Context staleness cutoff in days").option("--section-hierarchy <value>","Enable/disable context hierarchy section (true|false)").option("--section-activity <value>","Enable/disable context activity section (true|false)").option("--section-progress <value>","Enable/disable context progress section (true|false)").option("--section-blockers <value>","Enable/disable context blockers section (true|false)").option("--section-files <value>","Enable/disable context files section (true|false)").option("--section-workload <value>","Enable/disable context workload section (true|false)").option("--section-staleness <value>","Enable/disable context staleness section (true|false)").option("--section-tests <value>","Enable/disable context tests section (true|false)").description("Read or update pm settings for the current workspace or global profile.").action(async(t,o,a,i,n,c)=>{await ee(t,o,a,i,n,c)}),W(e,"extension"),W(e,"package"),$(e.command("install").argument("[targets...]","Package source (local path, bundled alias, npm: source, wildcard, or GitHub source)").option("--gh <github-source>","Install from GitHub shorthand source (owner/repo[/path])").option("--github <github-source>","Alias for --gh").option("--ref <ref>","Git ref/branch/tag for GitHub install sources").description("Install a pm package into the project package scope by default.")).action(async(t,o,a)=>{await F(t,a.optsWithGlobals(),a,"package")}),$(e.command("upgrade").argument("[target]","Optional managed package name/source to upgrade; omit to upgrade pm CLI and all managed packages").option("--dry-run","Plan CLI/package upgrades without running npm or reinstalling packages").option("--cli-only","Upgrade only the pm CLI/SDK npm package").option("--packages-only","Upgrade only managed pm packages").option("--repair","Force npm global reinstall when upgrading the pm CLI/SDK").option("--tag <value>","npm dist-tag/version for CLI and registry package upgrades").option("--package-name <value>","Override the CLI package name for self-upgrade testing").description("Upgrade the pm CLI/SDK and refresh managed installable pm packages.")).action(async(t,o,a)=>{let i=v(a),n=Date.now(),c=await R(t,a.opts(),i);_(c,i),c.ok||(process.exitCode=d.GENERIC_FAILURE),i.profile&&y(`profile:command=upgrade took_ms=${Date.now()-n}`)})}export{ve as _testOnlyRegisterSetup,Ee as registerSetupCommands};
2
- //# sourceMappingURL=register-setup-3YXZ444E.js.map
1
+ import{a as R,f as O}from"./chunk-J42EGKDK.js";import{Aa as U,Ka as C,Oa as j,Qa as T,xa as I}from"./chunk-WLPDLNEZ.js";import"./chunk-WYRZZ5ZE.js";import{C as d,E as b,Ef as S,Gf as _,Hf as y,wl as v,zl as E}from"./chunk-DSWDLTDR.js";import A from"node:fs/promises";import L from"node:path";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="054789eb-fabe-5042-8166-19961f30ebf1")}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]="3e4ba524-10cf-58e7-81ea-f48f30ca1250")}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]="defd826a-ac9b-54e4-b2a3-00d022090a10")}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]="4344c493-be53-584f-b25d-4b41bfee5079")}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]="08f5b31f-c756-577c-94e8-7b4268ba12ab")}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]="59c52ff5-9763-5244-bed3-146a547c3551")}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]="d498a64c-9680-52a9-981d-4ce86949784d")}catch{}})();var z={init:"init",install:"install",uninstall:"uninstall",explore:"explore",manage:"manage",describe:"describe",reload:"reload",doctor:"doctor",catalog:"catalog",adopt:"adopt","adopt-all":"adoptAll",activate:"activate",deactivate:"deactivate",migrate:"migrate"};function H(e){let t=e.capability,o=typeof t=="string"?[t]:Array.isArray(t)?t.filter(i=>typeof i=="string"):[],a=[...new Set(o.map(i=>i.trim().toLowerCase()).filter(i=>i.length>0))];if(a.length>1)throw new b(`Multiple scaffold capabilities cannot be combined yet: ${a.join(", ")}. Choose one capability per scaffold.`,d.USAGE);return a[0]}function G(e,t,o="extension"){let a={...e};t!==void 0&&(a[z[t]]=!0);let i=(...c)=>c.some(r=>a[r]===!0),n=(...c)=>{for(let r of c)if(typeof a[r]=="string")return a[r]};return{init:i("init"),scaffold:i("scaffold"),install:i("install"),uninstall:i("uninstall"),explore:i("explore","list"),manage:i("manage"),describe:i("describe"),markdown:i("markdown"),reload:i("reload"),doctor:i("doctor"),catalog:i("catalog"),adopt:i("adopt"),adoptAll:i("adoptAll","adopt_all","adopt-all"),activate:i("activate"),deactivate:i("deactivate"),migrate:i("migrate"),project:i("project"),local:i("local"),global:i("global"),gh:n("gh"),github:n("github"),ref:n("ref"),capability:H(e),declarative:i("declarative"),fields:n("fields"),detail:n("detail"),output:n("output"),trace:i("trace"),watch:i("watch"),runtimeProbe:i("runtimeProbe","runtime_probe","runtime-probe"),fixManagedState:i("fixManagedState","fix_managed_state","fix-managed-state"),isolated:i("isolated"),ignoreGlobal:i("ignoreGlobal","ignore_global","ignore-global"),strictExit:i("strictExit","strict_exit","strict-exit"),failOnWarn:i("failOnWarn","fail_on_warn","fail-on-warn"),dryRun:i("dryRun","dry_run","dry-run"),vocabulary:o}}async function N(e){let t=(await A.readdir(process.cwd())).filter(a=>!a.startsWith(".")).sort((a,i)=>a.localeCompare(i)),o=[...e].sort((a,i)=>a.localeCompare(i));return t.length===o.length&&t.every((a,i)=>a===o[i])}async function q(e){let t=(e??[]).map(o=>o.trim()).filter(o=>o.length>0);return t.length<=1?t.length===0?void 0:t:await N(t)?["*"]:t}function P(e,t,o){let a=e.markdown===!0;if(o!==void 0&&o==="")throw new b("--output requires a non-empty file path.",d.USAGE);if(o!==void 0&&!a)throw new b("--output is only supported with --markdown describe output.",d.USAGE);if(a){if(t.json)throw new b("Cannot combine --json with --markdown.",d.USAGE);if(e.describe!==!0)throw new b("--markdown is only supported by the describe action.",d.USAGE)}}async function B(e){let t=U(e.result.details,e.vocabulary);if(e.outputPath!==void 0){let o=L.resolve(e.outputPath);await A.mkdir(L.dirname(o),{recursive:!0}),await A.writeFile(o,t,"utf8")}if(!e.globalOptions.quiet){for(let o of e.result.warnings)y(`warning: ${o}`);e.outputPath===void 0&&S(t)}}function K(e,t){let o=!!t.strictExit||!!t.failOnWarn;if(e.action!=="doctor"||!o)return;let a=e.details!==null&&typeof e.details=="object"?e.details:{},i=a.summary!==null&&typeof a.summary=="object"?a.summary:null,n=i&&typeof i.status=="string"?i.status:void 0;(e.warnings.length>0||n!==void 0&&n!=="ok")&&(process.exitCode=d.GENERIC_FAILURE)}async function p(e,t,o,a,i="extension"){let n=v(o),c=Date.now(),r=G(t,a,i),s=(typeof r.output=="string"?r.output:void 0)?.trim();P(r,n,s);let m=await C(e,r,n);r.markdown===!0?await B({result:m,vocabulary:i,outputPath:s,globalOptions:n}):_(m,n),K(m,r),m.ok===!1&&(process.exitCode=d.GENERIC_FAILURE),n.profile&&y(`profile:command=extension took_ms=${Date.now()-c}`)}function V(e){return e.details!==null&&typeof e.details=="object"?e.details:{}}function X(e){return e instanceof b?{message:e.message,exit_code:e.exitCode,...e.context}:{message:e instanceof Error?e.message:String(e),exit_code:d.GENERIC_FAILURE}}async function F(e,t,o,a){let i=await q(e);if(i===void 0||i.length<=1){await p(i?.[0],t,o,"install",a);return}let n=v(o),c=Date.now(),r=G(t,"install",a);if(P(r,n,void 0),[r.gh,r.github].some(g=>typeof g=="string"&&g.trim().length>0))throw new b("Multiple install targets cannot be combined with --gh/--github. Install one GitHub source per command, or pass multiple explicit local, bundled, or npm: targets.",d.USAGE,{code:"multi_target_github_install_ambiguous",required:"Use exactly one positional target with --gh/--github, or omit --gh/--github when installing multiple targets.",examples:["pm install --gh owner/repo","pm install npm:pm-guide-shell pm-todos"]});let s=[],m=[],w=d.GENERIC_FAILURE;for(let g of i)try{let h=await C(g,r,n),f=V(h),x=Array.isArray(h.warnings)?h.warnings:[];m.push(...x);let D=h.ok===!0;s.push({target:g,ok:D,extension:f.extension,source:f.source,destination_path:f.destination_path,activated:f.activated,settings_changed:f.settings_changed,command_paths:f.command_paths,action_paths:f.action_paths,runtime_activation_status:f.runtime_activation_status,activation_diagnostics:f.activation_diagnostics,command_discovery:f.command_discovery,verification:f.verification,warnings:x,...D?{}:{error:{message:"Extension install returned ok=false without throwing an error.",exit_code:d.GENERIC_FAILURE,code:"extension_install_soft_failed"}}})}catch(h){let f=X(h),x=f.exit_code;typeof x=="number"&&w===d.GENERIC_FAILURE&&x!==d.GENERIC_FAILURE&&(w=x),s.push({target:g,ok:!1,error:f})}let k=s.filter(g=>g.ok!==!0).length,M={ok:k===0,action:"install",scope:r.global===!0?"global":"project",installed_count:s.length-k,failed_count:k,targets:s,warnings:[...new Set(m)].sort((g,h)=>g.localeCompare(h))};_(M,n),k>0&&(process.exitCode=w),n.profile&&y(`profile:command=extension took_ms=${Date.now()-c}`)}function Y(e){return e.option("--project","Use project extension scope (default)").option("--local","Alias for --project").option("--global","Use global extension scope")}function $(e){return e.option("--project","Use project package scope (default)").option("--local","Alias for --project").option("--global","Use global package scope")}function u(e,t){return t==="package"?$(e):Y(e)}function W(e,t){let o=t==="package"?"package":"extension",a=t==="package"?"packages":"extensions",i=t,n=e.command(i).argument("[target]",`${o[0].toUpperCase()}${o.slice(1)} source/name or scaffold target path (for --init/--scaffold)`).option("--init",`Generate a starter ${o} scaffold at target path`).option("--scaffold","Alias for --init").option("--capability <kind>",`Capability the --init starter targets (${I.join("|")}; default commands)`,E).option("--install",`Install ${o} from local path, bundled alias, npm: source, wildcard, or GitHub source`).option("--uninstall",`Uninstall an installed ${o}`).option("--explore",`List discovered ${a} in selected scope`).option("--list","Alias for --explore").option("--manage",`List managed ${a} with update-check metadata`).option("--describe",`Map every surface a loaded ${o} registers (optionally one by name)`).option("--markdown","Render describe output as a Markdown reference document (describe only)").option("--output <path>","Write describe Markdown to a file (requires --markdown)").option("--reload",`Reload ${a} with cache-busted module imports`).option("--watch","Use watch mode with --reload").option("--doctor",`Run consolidated ${o} diagnostics (summary/deep modes)`).option("--catalog",`List bundled first-party ${o} catalog metadata`).option("--adopt",`Adopt an existing unmanaged ${o} into managed metadata`).option("--adopt-all",`Adopt all unmanaged ${a} into managed metadata`).option("--activate",`Activate a ${o} in selected scope settings`).option("--deactivate",`Deactivate a ${o} in selected scope settings`).option("--project",`Use project ${o} scope (default)`).option("--local","Alias for --project").option("--global",`Use global ${o} scope`).option("--gh <github-source>","Install from GitHub shorthand source (owner/repo[/path])").option("--github <github-source>","Alias for --gh").option("--ref <ref>","Git ref/branch/tag for GitHub install sources").option("--detail <mode>",`${o[0].toUpperCase()}${o.slice(1)} diagnostics detail mode (summary|deep)`).option("--trace","Include actionable registration traces in doctor deep diagnostics").option("--runtime-probe","Opt-in runtime activation probe for manage output parity").option("--fix-managed-state",`Adopt unmanaged ${a} before diagnostics/update checks`).option("--isolated",`Run doctor against project-scope ${a} only, ignoring global registrations`).option("--ignore-global","Alias for --isolated").option("--strict-exit","Return non-zero exit when doctor warnings are present (ok=false)").option("--fail-on-warn","Alias for --strict-exit (doctor)").description(t==="package"?"Manage package lifecycle operations for project or global scope. Backward-compatible with extension packages.":"Manage extension lifecycle operations for project or global scope.").action(async(r,l,s)=>{await p(r,s.optsWithGlobals(),s,void 0,t)});t==="package"&&(n.alias("packages"),n.option("--declarative","Scaffold the composeExtension blueprint starter (any capability)"));let c=n.command("init").alias("scaffold").argument("<target>","Scaffold target directory path").option("--capability <kind>",`Capability the starter targets (${I.join("|")}; default commands)`,E).description(t==="package"?"Generate a starter package scaffold with package metadata, manifest, and entrypoint.":"Generate a starter extension scaffold with manifest and entrypoint.");t==="package"&&c.option("--declarative","Scaffold the composeExtension blueprint starter (any capability)"),u(c,t).action(async(r,l,s)=>{await p(r,s.optsWithGlobals(),s,"init",t)}),u(n.command("install").argument("[targets...]",`${o[0].toUpperCase()}${o.slice(1)} source (local path, bundled alias, npm: source, wildcard, or GitHub source)`).option("--gh <github-source>","Install from GitHub shorthand source (owner/repo[/path])").option("--github <github-source>","Alias for --gh").option("--ref <ref>","Git ref/branch/tag for GitHub install sources").description(`Install ${o} from local path, bundled alias, npm: source, wildcard, or GitHub source.`),t).action(async(r,l,s)=>{await F(r,s.optsWithGlobals(),s,t)}),u(n.command("uninstall").argument("<target>",`${o[0].toUpperCase()}${o.slice(1)} name`).description(`Uninstall an installed ${o}.`),t).action(async(r,l,s)=>{await p(r,s.optsWithGlobals(),s,"uninstall",t)}),u(n.command("explore").description(`List discovered ${a} in selected scope.`),t).action(async(r,l)=>{await p(void 0,l.optsWithGlobals(),l,"explore",t)}),u(n.command("manage").option("--runtime-probe","Opt-in runtime activation probe for manage output parity").option("--fix-managed-state",`Adopt unmanaged ${a} before diagnostics/update checks`).description(`List managed ${a} with update-check metadata.`),t).action(async(r,l)=>{await p(void 0,l.optsWithGlobals(),l,"manage",t)}),u(n.command("describe").argument("[target]",`${o[0].toUpperCase()}${o.slice(1)} name to describe (omit for every loaded ${o})`).option("--markdown","Render the surface map as a Markdown reference document instead of toon/json").option("--output <path>","Write Markdown output to a file (requires --markdown)").description(`Map every surface a loaded ${o} registers (commands, hooks, item types, providers, overrides, ...).`),t).action(async(r,l,s)=>{await p(r,s.optsWithGlobals(),s,"describe",t)}),u(n.command("reload").option("--watch","Use watch mode for repeated reload checks").description(`Reload ${a} with cache-busted module imports.`),t).action(async(r,l)=>{await p(void 0,l.optsWithGlobals(),l,"reload",t)}),u(n.command("doctor").option("--detail <mode>",`Detail mode for ${o} diagnostics (summary|deep)`).option("--trace","Include actionable registration traces in doctor deep diagnostics").option("--fix-managed-state",`Adopt unmanaged ${a} before diagnostics/update checks`).option("--isolated",`Run doctor against project-scope ${a} only, ignoring global registrations`).option("--ignore-global","Alias for --isolated").option("--strict-exit","Return non-zero exit when doctor warnings are present (ok=false)").option("--fail-on-warn","Alias for --strict-exit (doctor)").description(`Run consolidated ${o} diagnostics (summary/deep modes).`),t).action(async(r,l)=>{await p(void 0,l.optsWithGlobals(),l,"doctor",t)}),u(n.command("catalog").alias("list").option("--fields <value>","Render compact comma-separated catalog fields, for example: alias,installed,install_command").description(`List bundled first-party ${o} catalog metadata.`),t).action(async(r,l)=>{await p(void 0,l.optsWithGlobals(),l,"catalog",t)}),u(n.command("adopt").argument("<target>",`${o[0].toUpperCase()}${o.slice(1)} name`).option("--gh <owner/repo[/path]>",`GitHub provenance shorthand for adopted ${o}`).option("--github <owner/repo[/path]>","Alias for --gh").option("--ref <ref>","Git ref/branch/tag for GitHub shorthand source").description(`Adopt an existing unmanaged ${o} into managed metadata.`),t).action(async(r,l,s)=>{await p(r,s.optsWithGlobals(),s,"adopt",t)}),u(n.command("adopt-all").description(`Adopt all unmanaged ${a} into managed metadata.`),t).action(async(r,l)=>{await p(void 0,l.optsWithGlobals(),l,"adopt-all",t)}),u(n.command("migrate").option("--dry-run","Plan active migrations without invoking extension code").description(`Plan or apply active ${o} migrations with durable receipts.`),t).action(async(r,l)=>{await p(void 0,l.optsWithGlobals(),l,"migrate",t)}),u(n.command("activate").argument("<target>",`${o[0].toUpperCase()}${o.slice(1)} name`).description(`Activate a ${o} in selected scope settings.`),t).action(async(r,l,s)=>{await p(r,s.optsWithGlobals(),s,"activate",t)}),u(n.command("deactivate").argument("<target>",`${o[0].toUpperCase()}${o.slice(1)} name`).description(`Deactivate a ${o} in selected scope settings.`),t).action(async(r,l,s)=>{await p(r,s.optsWithGlobals(),s,"deactivate",t)})}async function J(e,t,o){let a=v(o),i=Date.now(),n=await T(e,a,{idPrefix:typeof t.idPrefix=="string"?t.idPrefix:void 0,preset:typeof t.preset=="string"?t.preset:void 0,defaults:t.defaults===!0||t.yes===!0,author:typeof t.author=="string"?t.author:void 0,agentGuidance:typeof t.agentGuidance=="string"?t.agentGuidance:void 0,typePreset:typeof t.typePreset=="string"?t.typePreset:void 0,withPackages:t.withPackages===!0,mergeFence:t.mergeFence!==!1,force:t.force===!0,workspace:typeof t.workspace=="string"?t.workspace:void 0}),r=t.verbose===!0||a.json===!0;_(r?n:j(n),a),a.profile&&y(`profile:command=init took_ms=${Date.now()-i}`)}function Q(e,t,o,a){let n=e!==void 0&&new Set(["get","set","list","export"]).has(e);return{resolvedScope:n?"project":e??"project",resolvedAction:n?e:t??"list",resolvedKey:n?t:o,resolvedValue:n?o:a}}function Z(e){return{criterion:Array.isArray(e.criterion)?e.criterion:[],format:typeof e.format=="string"?e.format:void 0,policy:typeof e.policy=="string"?e.policy:void 0,value:typeof e.value=="string"?e.value:void 0,clearCriteria:e.clearCriteria===!0,defaultDepth:typeof e.defaultDepth=="string"?e.defaultDepth:void 0,activityLimit:typeof e.activityLimit=="string"?e.activityLimit:void 0,staleThresholdDays:typeof e.staleThresholdDays=="string"?e.staleThresholdDays:void 0,sectionHierarchy:typeof e.sectionHierarchy=="string"?e.sectionHierarchy:void 0,sectionActivity:typeof e.sectionActivity=="string"?e.sectionActivity:void 0,sectionProgress:typeof e.sectionProgress=="string"?e.sectionProgress:void 0,sectionBlockers:typeof e.sectionBlockers=="string"?e.sectionBlockers:void 0,sectionFiles:typeof e.sectionFiles=="string"?e.sectionFiles:void 0,sectionWorkload:typeof e.sectionWorkload=="string"?e.sectionWorkload:void 0,sectionStaleness:typeof e.sectionStaleness=="string"?e.sectionStaleness:void 0,sectionTests:typeof e.sectionTests=="string"?e.sectionTests:void 0}}async function ee(e,t,o,a,i,n){let c=v(n),r=Date.now(),{resolvedScope:l,resolvedAction:s,resolvedKey:m,resolvedValue:w}=Q(e,t,o,a),k=await O(l,s,m,Z(i),c,typeof w=="string"?w:void 0);_(k,c),c.profile&&y(`profile:command=config took_ms=${Date.now()-r}`)}var ve={normalizeExtensionOptions:G};function Ee(e){e.command("init").argument("[prefix-or-path]","Optional id prefix, or path-like tracker target such as ./pm-sandbox").option("--prefix, --id-prefix <value>","Set the item ID prefix (alias for the positional prefix)").option("--preset <value>","Governance preset for new setups: minimal|default|strict").option("--defaults","Use non-interactive setup defaults without opening the wizard").option("-y, --yes","Alias for --defaults (non-interactive setup)").option("--author <value>","Set the default mutation author for this project").option("--agent-guidance <mode>","Agent guidance mode: ask|add|skip|status").option("--type-preset <name>","Register domain item types during init: agile|ops|research").option("--with-packages","Install all bundled first-party packages during initialization").option("--no-merge-fence","Skip automatic merge-driver installation for a fresh Git-backed tracker").option("--workspace <dir>","Initialize repository-local tracker storage at <dir>/.agents/pm").option("--force","Allow initializing tracker files directly in a directory that looks like a workspace root").option("--verbose","Include the full resolved settings tree in the output (default output is a concise summary)").description("Initialize pm storage and defaults for the current workspace or a path-like tracker target.").action(async(t,o,a)=>{await J(t,o,a)}),e.command("config").argument("[scope]","Config scope: project|global, or action shorthand list|export|get|set for project scope").argument("[action]","Config action: get|set|list|export").argument("[key]","Config key for get|set; use `pm config project list` for the complete typed inventory, including mutation-guard-* policies").argument("[value]",'Optional value for set: routed to the right typed flag by key (e.g. config set telemetry-tracking off, config set item-format toon, config set definition-of-done "Tests pass"). Equivalent to --policy/--format/--criterion. context keys still require --default-depth/--section-* flags.').option("--criterion <text>","Criteria value for definition-of-done, metadata-required-fields, or lifecycle pattern keys (repeatable for set)",E).option("--clear-criteria","Clear criteria-list keys for config set operations").option("--format <value>","Item format for item-format key: toon").option("--policy <value>","Policy key values: history-missing-stream-policy=auto_create|strict_error; sprint-release-format-policy=warn|strict_error; parent-reference-policy=warn|strict_error; governance-preset=minimal|default|strict|custom; governance-ownership-enforcement=none|warn|strict; governance-create-mode-default=progressive|strict; governance-close-validation-default=off|warn|strict; governance-require-close-reason=enabled|disabled; governance-parent-reference-policy=warn|strict_error; governance-metadata-validation-profile=core|strict|custom; governance-force-required-for-stale-lock=enabled|disabled; governance-duplicate-detection-mode=off|advisory|strict; test-result-tracking=enabled|disabled; telemetry-tracking=enabled|disabled").option("--value <value>","Typed nested setting value. Mutation guards: require-attributed-author=true|false, secret-guard=off|advise|block, stale-in-progress-hours=integer>=1. Kebab-case is preferred; underscore aliases remain accepted.").option("--default-depth <value>","Context default depth: brief|standard|deep").option("--activity-limit <n>","Context default activity limit").option("--stale-threshold-days <n>","Context staleness cutoff in days").option("--section-hierarchy <value>","Enable/disable context hierarchy section (true|false)").option("--section-activity <value>","Enable/disable context activity section (true|false)").option("--section-progress <value>","Enable/disable context progress section (true|false)").option("--section-blockers <value>","Enable/disable context blockers section (true|false)").option("--section-files <value>","Enable/disable context files section (true|false)").option("--section-workload <value>","Enable/disable context workload section (true|false)").option("--section-staleness <value>","Enable/disable context staleness section (true|false)").option("--section-tests <value>","Enable/disable context tests section (true|false)").description("Read or update pm settings for the current workspace or global profile.").action(async(t,o,a,i,n,c)=>{await ee(t,o,a,i,n,c)}),W(e,"extension"),W(e,"package"),$(e.command("install").argument("[targets...]","Package source (local path, bundled alias, npm: source, wildcard, or GitHub source)").option("--gh <github-source>","Install from GitHub shorthand source (owner/repo[/path])").option("--github <github-source>","Alias for --gh").option("--ref <ref>","Git ref/branch/tag for GitHub install sources").description("Install a pm package into the project package scope by default.")).action(async(t,o,a)=>{await F(t,a.optsWithGlobals(),a,"package")}),$(e.command("upgrade").argument("[target]","Optional managed package name/source to upgrade; omit to upgrade pm CLI and all managed packages").option("--dry-run","Plan CLI/package upgrades without running npm or reinstalling packages").option("--cli-only","Upgrade only the pm CLI/SDK npm package").option("--packages-only","Upgrade only managed pm packages").option("--repair","Force npm global reinstall when upgrading the pm CLI/SDK").option("--tag <value>","npm dist-tag/version for CLI and registry package upgrades").option("--package-name <value>","Override the CLI package name for self-upgrade testing").description("Upgrade the pm CLI/SDK and refresh managed installable pm packages.")).action(async(t,o,a)=>{let i=v(a),n=Date.now(),c=await R(t,a.opts(),i);_(c,i),c.ok||(process.exitCode=d.GENERIC_FAILURE),i.profile&&y(`profile:command=upgrade took_ms=${Date.now()-n}`)})}export{ve as _testOnlyRegisterSetup,Ee as registerSetupCommands};
2
+ //# sourceMappingURL=register-setup-ZJZFVAKE.js.map
@@ -0,0 +1,2 @@
1
+ import{Ia as P,a as C,b as w}from"./chunk-U65UC4G3.js";import{F as _,G as A,H as R,I as E,Ya as I,oa as h,va as S}from"./chunk-OKA6ELTL.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]="3b9b9ebe-8d98-5983-8257-b7b77c7e6194")}catch{}})();var Be=[{target:"status",keys:["status"]},{target:"type",keys:["type"]},{target:"tag",keys:["tag","tags"]},{target:"priority",keys:["priority"]},{target:"deadlineBefore",keys:["deadlineBefore"]},{target:"deadlineAfter",keys:["deadlineAfter"]},{target:"updatedAfter",keys:["updatedAfter"]},{target:"updatedBefore",keys:["updatedBefore"]},{target:"createdAfter",keys:["createdAfter"]},{target:"createdBefore",keys:["createdBefore"]},{target:"ids",keys:["ids"]},{target:"assignee",keys:["assignee"]},{target:"assigneeFilter",keys:["assigneeFilter","assignee_filter"]},{target:"parent",keys:["parent"]},{target:"sprint",keys:["sprint"]},{target:"release",keys:["release"]},{target:"limit",keys:["limit"]},{target:"offset",keys:["offset"]},{target:"after",keys:["after"]},{target:"fields",keys:["fields"]},{target:"sort",keys:["sort"]},{target:"order",keys:["order"]},{target:"treeDepth",keys:["treeDepth","tree_depth"]}],We=[{target:"mode",keys:["mode"]},{target:"matchMode",keys:["matchMode","match_mode"]},{target:"minScore",keys:["minScore","min_score"]},{target:"semanticWeight",keys:["semanticWeight","semantic_weight"]},{target:"status",keys:["status"]},{target:"type",keys:["type"]},{target:"tag",keys:["tag","tags"]},{target:"priority",keys:["priority"]},{target:"deadlineBefore",keys:["deadlineBefore"]},{target:"deadlineAfter",keys:["deadlineAfter"]},{target:"updatedAfter",keys:["updatedAfter"]},{target:"updatedBefore",keys:["updatedBefore"]},{target:"createdAfter",keys:["createdAfter"]},{target:"createdBefore",keys:["createdBefore"]},{target:"assignee",keys:["assignee"]},{target:"sprint",keys:["sprint"]},{target:"release",keys:["release"]},{target:"parent",keys:["parent"]},{target:"fields",keys:["fields"]},{target:"limit",keys:["limit"]},{target:"after",keys:["after"]}],Ue=[{target:"view",keys:["view"]},{target:"date",keys:["date"]},{target:"from",keys:["from"]},{target:"to",keys:["to"]},{target:"limit",keys:["limit"]},{target:"type",keys:["type"]},{target:"tag",keys:["tag"]},{target:"priority",keys:["priority"]},{target:"status",keys:["status"]},{target:"assignee",keys:["assignee"]},{target:"assigneeFilter",keys:["assigneeFilter","assignee_filter"]},{target:"sprint",keys:["sprint"]},{target:"release",keys:["release"]},{target:"include",keys:["include"]},{target:"recurrenceLookaheadDays",keys:["recurrenceLookaheadDays","recurrence_lookahead_days"]},{target:"recurrenceLookbackDays",keys:["recurrenceLookbackDays","recurrence_lookback_days"]},{target:"occurrenceLimit",keys:["occurrenceLimit","occurrence_limit"]},{target:"format",keys:["format"]}],He=[{target:"date",keys:["date"]},{target:"from",keys:["from"]},{target:"to",keys:["to"]},{target:"type",keys:["type"]},{target:"tag",keys:["tag"]},{target:"priority",keys:["priority"]},{target:"assignee",keys:["assignee"]},{target:"assigneeFilter",keys:["assigneeFilter","assignee_filter"]},{target:"sprint",keys:["sprint"]},{target:"release",keys:["release"]},{target:"parent",keys:["parent"]},{target:"limit",keys:["limit","maxItems","max_items"]},{target:"after",keys:["after"]},{target:"format",keys:["format"]},{target:"depth",keys:["depth"]},{target:"fields",keys:["fields"]},{target:"activityLimit",keys:["activityLimit","activity_limit"]},{target:"staleThreshold",keys:["staleThreshold","stale_threshold"]},{target:"tokenBudget",keys:["tokenBudget","token_budget"]}],ze=[{target:"type",keys:["type"]},{target:"tag",keys:["tag"]},{target:"priority",keys:["priority"]},{target:"assignee",keys:["assignee"]},{target:"assigneeFilter",keys:["assigneeFilter","assignee_filter"]},{target:"sprint",keys:["sprint"]},{target:"release",keys:["release"]},{target:"parent",keys:["parent"]},{target:"limit",keys:["limit"]},{target:"blockedLimit",keys:["blockedLimit","blocked_limit"]},{target:"format",keys:["format"]},{target:"tokenBudget",keys:["tokenBudget","token_budget"]}],Ge=[{target:"id",keys:["id"]},{target:"op",keys:["op"]},{target:"author",keys:["author"]},{target:"from",keys:["from"]},{target:"to",keys:["to"]},{target:"limit",keys:["limit"]}];function Ke(e,t){for(let a of t.keys){let r=e[a];if(typeof r=="string")return r}}function Ve(e,t){for(let a of t.keys)if(Object.hasOwn(e,a))return e[a]}function Ye(e,t){for(let a of t.keys){let r=e[a];if(Array.isArray(r))return r}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="e2028eff-b29e-5850-87b1-4a3e06f28964")}catch{}})();function o(e){return e.map(t=>({...t}))}var v=[{param:"status",flag:"--status"},{param:"type",flag:"--type"},{param:"tag",flag:"--tag"},{param:"priority",flag:"--priority"},{param:"deadlineBefore",flag:"--deadline-before"},{param:"deadlineAfter",flag:"--deadline-after"}],N=[{param:"updatedAfter",flag:"--updated-after"},{param:"updatedBefore",flag:"--updated-before"},{param:"createdAfter",flag:"--created-after"},{param:"createdBefore",flag:"--created-before"}],de=[{param:"today",flag:"--today",booleanish:!0},{param:"recent",flag:"--recent",booleanish:!0},...N],L=[{param:"assignee",flag:"--assignee"},{param:"assigneeFilter",flag:"--assignee-filter"},{param:"parent",flag:"--parent"},{param:"sprint",flag:"--sprint"},{param:"release",flag:"--release"}],ce=[{param:"assignee",flag:"--assignee"},{param:"sprint",flag:"--sprint"},{param:"release",flag:"--release"},{param:"parent",flag:"--parent"}],me=[...v,...L],M=[{param:"filterReviewerMissing",flag:"--filter-reviewer-missing"},{param:"filterRiskMissing",flag:"--filter-risk-missing"},{param:"filterConfidenceMissing",flag:"--filter-confidence-missing"},{param:"filterSprintMissing",flag:"--filter-sprint-missing"},{param:"filterReleaseMissing",flag:"--filter-release-missing"}],ue=[{param:"filterAcMissing",flag:"--filter-ac-missing"},{param:"filterEstimatesMissing",flag:"--filter-estimates-missing"},{param:"filterResolutionMissing",flag:"--filter-resolution-missing"},{param:"filterMetadataMissing",flag:"--filter-metadata-missing"}],q=[{param:"hasNotes",flag:"--has-notes"},{param:"noNotes",flag:"--no-notes"},{param:"hasLearnings",flag:"--has-learnings"},{param:"noLearnings",flag:"--no-learnings"},{param:"hasFiles",flag:"--has-files"},{param:"noFiles",flag:"--no-files"},{param:"filterFilesMissing",flag:"--filter-files-missing"},{param:"hasDocs",flag:"--has-docs"},{param:"noDocs",flag:"--no-docs"},{param:"filterDocsMissing",flag:"--filter-docs-missing"},{param:"hasTests",flag:"--has-tests"},{param:"noTests",flag:"--no-tests"},{param:"hasComments",flag:"--has-comments"},{param:"noComments",flag:"--no-comments"},{param:"hasDeps",flag:"--has-deps"},{param:"noDeps",flag:"--no-deps"},{param:"hasBody",flag:"--has-body"},{param:"emptyBody",flag:"--empty-body"},{param:"hasLinkedCommand",flag:"--has-linked-command"},{param:"noLinkedCommand",flag:"--no-linked-command"}],D=[{param:"for",flag:"--for"},{param:"tokenBudget",flag:"--token-budget"},...o(v),...o(de),{param:"ids",flag:"--ids"},...o(L),...o(ue),...o(M),...o(q),{param:"limit",flag:"--limit"},{param:"offset",flag:"--offset"},{param:"after",flag:"--after"},{param:"fields",flag:"--fields"},{param:"sort",flag:"--sort"},{param:"order",flag:"--order"},{param:"tree",flag:"--tree"},{param:"treeDepth",flag:"--tree-depth"}],F=[{param:"groupBy",flag:"--group-by"},{param:"sum",flag:"--sum"},{param:"avg",flag:"--avg"},...o(me)],j=[{param:"for",flag:"--for"},{param:"tokenBudget",flag:"--token-budget"},{param:"matchMode",flag:"--match-mode"},{param:"minScore",flag:"--min-score"},{param:"count",flag:"--count",booleanish:!0},{param:"semanticWeight",flag:"--semantic-weight"},...o(v),...o(N),...o(ce),...o(M),...o(q),{param:"fields",flag:"--fields"},{param:"limit",flag:"--limit"},{param:"after",flag:"--after"}],ye=[{param:"parent",flag:"--parent"},{param:"reviewer",flag:"--reviewer"},{param:"risk",flag:"--risk"},{param:"confidence",flag:"--confidence"},{param:"sprint",flag:"--sprint"},{param:"release",flag:"--release"},{param:"blockedBy",flag:"--blocked-by"},{param:"blockedReason",flag:"--blocked-reason"},{param:"unblockNote",flag:"--unblock-note"},{param:"reporter",flag:"--reporter"},{param:"severity",flag:"--severity"},{param:"environment",flag:"--environment"},{param:"reproSteps",flag:"--repro-steps"},{param:"resolution",flag:"--resolution"},{param:"expectedResult",flag:"--expected-result"},{param:"actualResult",flag:"--actual-result"},{param:"affectedVersion",flag:"--affected-version"},{param:"fixedVersion",flag:"--fixed-version"},{param:"component",flag:"--component"},{param:"regression",flag:"--regression",booleanish:!0},{param:"customerImpact",flag:"--customer-impact"},{param:"definitionOfReady",flag:"--definition-of-ready",allowEmpty:!0},{param:"order",flag:"--order"},{param:"rank",flag:"--rank"},{param:"goal",flag:"--goal"},{param:"objective",flag:"--objective"},{param:"value",flag:"--value"},{param:"impact",flag:"--impact"},{param:"outcome",flag:"--outcome"},{param:"whyNow",flag:"--why-now"}],x=o(ye),ge=[{param:"id",flag:"--id"},{param:"title",flag:"--title"},{param:"description",flag:"--description",allowEmpty:!0},{param:"type",flag:"--type"},{param:"template",flag:"--template"},{param:"createMode",flag:"--create-mode"},{param:"schedulePreset",flag:"--schedule-preset"},{param:"status",flag:"--status"},{param:"priority",flag:"--priority"},{param:"tags",flag:"--tags",allowEmpty:!0},{param:"addTags",flag:"--add-tags",repeatable:!0},{param:"body",flag:"--body",allowEmpty:!0},{param:"deadline",flag:"--deadline"},{param:"estimate",flag:"--estimate"},{param:"acceptanceCriteria",flag:"--acceptance-criteria",allowEmpty:!0},{param:"author",flag:"--author"},{param:"message",flag:"--message",allowEmpty:!0},{param:"assignee",flag:"--assignee"},{param:"allowMissingParent",flag:"--allow-missing-parent"},{param:"allowUnresolvedDeps",flag:"--allow-unresolved-deps"},{param:"allowDuplicate",flag:"--allow-duplicate",booleanish:!0},{param:"reminder",flag:"--reminder",repeatable:!0},{param:"event",flag:"--event",repeatable:!0},{param:"typeOption",flag:"--type-option",repeatable:!0},{param:"field",flag:"--field",repeatable:!0},{param:"dep",flag:"--dep",repeatable:!0},{param:"comment",flag:"--comment",repeatable:!0},{param:"note",flag:"--note",repeatable:!0},{param:"learning",flag:"--learning",repeatable:!0},{param:"linkedFile",flag:"--file",repeatable:!0},{param:"linkedTest",flag:"--test",repeatable:!0},{param:"doc",flag:"--doc",repeatable:!0},{param:"unset",flag:"--unset",repeatable:!0},{param:"clearDeps",flag:"--clear-deps"},{param:"clearComments",flag:"--clear-comments"},{param:"clearNotes",flag:"--clear-notes"},{param:"clearLearnings",flag:"--clear-learnings"},{param:"clearFiles",flag:"--clear-files"},{param:"clearTests",flag:"--clear-tests"},{param:"clearDocs",flag:"--clear-docs"},{param:"clearReminders",flag:"--clear-reminders"},{param:"clearEvents",flag:"--clear-events"},{param:"clearTypeOptions",flag:"--clear-type-options"}],B=o(ge),fe=[{param:"title",flag:"--title"},{param:"description",flag:"--description",allowEmpty:!0},{param:"body",flag:"--body",allowEmpty:!0},{param:"status",flag:"--status"},{param:"closeReason",flag:"--close-reason"},{param:"completedAt",flag:"--completed-at"},{param:"priority",flag:"--priority"},{param:"type",flag:"--type"},{param:"tags",flag:"--tags",allowEmpty:!0},{param:"addTags",flag:"--add-tags",repeatable:!0},{param:"removeTags",flag:"--remove-tags",repeatable:!0},{param:"deadline",flag:"--deadline"},{param:"estimate",flag:"--estimate"},{param:"acceptanceCriteria",flag:"--acceptance-criteria",allowEmpty:!0},{param:"addAc",flag:"--add-ac",repeatable:!0},{param:"removeAc",flag:"--remove-ac",repeatable:!0},{param:"author",flag:"--author"},{param:"message",flag:"--message",allowEmpty:!0},{param:"assignee",flag:"--assignee"},{param:"allowMissingParent",flag:"--allow-missing-parent"},{param:"allowUnresolvedDeps",flag:"--allow-unresolved-deps"},{param:"dep",flag:"--dep",repeatable:!0},{param:"depRemove",flag:"--dep-remove",repeatable:!0},{param:"replaceDeps",flag:"--replace-deps"},{param:"replaceTests",flag:"--replace-tests"},{param:"replaceFiles",flag:"--replace-files"},{param:"replaceDocs",flag:"--replace-docs"},{param:"comment",flag:"--comment",repeatable:!0},{param:"note",flag:"--note",repeatable:!0},{param:"learning",flag:"--learning",repeatable:!0},{param:"linkedFile",flag:"--file",repeatable:!0},{param:"linkedTest",flag:"--test",repeatable:!0},{param:"doc",flag:"--doc",repeatable:!0},{param:"reminder",flag:"--reminder",repeatable:!0},{param:"event",flag:"--event",repeatable:!0},{param:"typeOption",flag:"--type-option",repeatable:!0},{param:"field",flag:"--field",repeatable:!0},{param:"unset",flag:"--unset",repeatable:!0},{param:"clearDeps",flag:"--clear-deps"},{param:"clearComments",flag:"--clear-comments"},{param:"clearNotes",flag:"--clear-notes"},{param:"clearLearnings",flag:"--clear-learnings"},{param:"clearFiles",flag:"--clear-files"},{param:"clearTests",flag:"--clear-tests"},{param:"clearDocs",flag:"--clear-docs"},{param:"clearReminders",flag:"--clear-reminders"},{param:"clearEvents",flag:"--clear-events"},{param:"clearTypeOptions",flag:"--clear-type-options"}],W=o(fe),U=[{param:"filterStatus",flag:"--filter-status"},{param:"filterType",flag:"--filter-type"},{param:"filterTag",flag:"--filter-tag"},{param:"filterPriority",flag:"--filter-priority"},{param:"filterDeadlineBefore",flag:"--filter-deadline-before"},{param:"filterDeadlineAfter",flag:"--filter-deadline-after"},{param:"filterUpdatedAfter",flag:"--filter-updated-after"},{param:"filterUpdatedBefore",flag:"--filter-updated-before"},{param:"filterCreatedAfter",flag:"--filter-created-after"},{param:"filterCreatedBefore",flag:"--filter-created-before"},{param:"filterAssignee",flag:"--filter-assignee"},{param:"filterAssigneeFilter",flag:"--filter-assignee-filter"},{param:"filterParent",flag:"--filter-parent"},{param:"filterSprint",flag:"--filter-sprint"},{param:"filterRelease",flag:"--filter-release"},{param:"filterAcMissing",flag:"--filter-ac-missing"},{param:"filterEstimatesMissing",flag:"--filter-estimates-missing"},{param:"filterResolutionMissing",flag:"--filter-resolution-missing"},{param:"filterMetadataMissing",flag:"--filter-metadata-missing"},{param:"filterReviewerMissing",flag:"--filter-reviewer-missing"},{param:"filterRiskMissing",flag:"--filter-risk-missing"},{param:"filterConfidenceMissing",flag:"--filter-confidence-missing"},{param:"filterSprintMissing",flag:"--filter-sprint-missing"},{param:"filterReleaseMissing",flag:"--filter-release-missing"},{param:"filterHasNotes",flag:"--filter-has-notes"},{param:"filterNoNotes",flag:"--filter-no-notes"},{param:"filterHasLearnings",flag:"--filter-has-learnings"},{param:"filterNoLearnings",flag:"--filter-no-learnings"},{param:"filterHasFiles",flag:"--filter-has-files"},{param:"filterNoFiles",flag:"--filter-no-files"},{param:"filterHasDocs",flag:"--filter-has-docs"},{param:"filterNoDocs",flag:"--filter-no-docs"},{param:"filterHasTests",flag:"--filter-has-tests"},{param:"filterNoTests",flag:"--filter-no-tests"},{param:"filterHasComments",flag:"--filter-has-comments"},{param:"filterNoComments",flag:"--filter-no-comments"},{param:"filterHasDeps",flag:"--filter-has-deps"},{param:"filterNoDeps",flag:"--filter-no-deps"},{param:"filterHasBody",flag:"--filter-has-body"},{param:"filterEmptyBody",flag:"--filter-empty-body"},{param:"filterHasLinkedCommand",flag:"--filter-has-linked-command"},{param:"filterNoLinkedCommand",flag:"--filter-no-linked-command"},{param:"ids",flag:"--ids"},{param:"limit",flag:"--limit"},{param:"offset",flag:"--offset"}],H=o(U),z=o(U),Je=[{param:"view",flag:"--view"},{param:"date",flag:"--date"},{param:"from",flag:"--from"},{param:"to",flag:"--to"},{param:"type",flag:"--type"},{param:"tag",flag:"--tag"},{param:"priority",flag:"--priority"},{param:"status",flag:"--status"},{param:"assignee",flag:"--assignee"},{param:"assigneeFilter",flag:"--assignee-filter"},{param:"sprint",flag:"--sprint"},{param:"release",flag:"--release"},{param:"include",flag:"--include"},{param:"recurrenceLookaheadDays",flag:"--recurrence-lookahead-days"},{param:"recurrenceLookbackDays",flag:"--recurrence-lookback-days"},{param:"occurrenceLimit",flag:"--occurrence-limit"},{param:"limit",flag:"--limit"},{param:"after",flag:"--after"},{param:"format",flag:"--format"}],G=[{param:"id",flag:"--id"},{param:"op",flag:"--op"},{param:"author",flag:"--author"},{param:"from",flag:"--from"},{param:"to",flag:"--to"},{param:"limit",flag:"--limit"},{param:"unbounded",flag:"--unbounded"},{param:"compact",flag:"--compact"},{param:"raw",flag:"--raw"},{param:"full",flag:"--full"},{param:"provenance",flag:"--provenance"},{param:"provenanceSummary",flag:"--provenance-summary"},{param:"harness",flag:"--harness",repeatable:!0},{param:"agentInstance",flag:"--agent-instance",repeatable:!0},{param:"provenanceFilter",flag:"--provenance-filter",repeatable:!0}],K=[{param:"for",flag:"--for"},{param:"date",flag:"--date"},{param:"from",flag:"--from"},{param:"to",flag:"--to"},{param:"type",flag:"--type"},{param:"tag",flag:"--tag"},{param:"priority",flag:"--priority"},{param:"assignee",flag:"--assignee"},{param:"assigneeFilter",flag:"--assignee-filter"},{param:"sprint",flag:"--sprint"},{param:"release",flag:"--release"},{param:"parent",flag:"--parent"},{param:"limit",flag:"--limit"},{param:"after",flag:"--after"},{param:"format",flag:"--format"},{param:"depth",flag:"--depth"},{param:"fields",flag:"--fields"},{param:"section",flag:"--section",repeatable:!0},{param:"activityLimit",flag:"--activity-limit"},{param:"staleThreshold",flag:"--stale-threshold"},{param:"tokenBudget",flag:"--token-budget"},{param:"explainRanking",flag:"--explain-ranking"},{param:"noTags",flag:"--no-tags"},{param:"noExtensionHealth",flag:"--no-extension-health"}],Ze=[{param:"format",flag:"--format"},{param:"maxDepth",flag:"--max-depth"},{param:"collapse",flag:"--collapse"},{param:"summary",flag:"--summary"},{param:"nodeLimit",flag:"--node-limit"},{param:"edgeLimit",flag:"--edge-limit"},{param:"tokenBudget",flag:"--token-budget"},{param:"cursor",flag:"--cursor"},{param:"direction",flag:"--direction"},{param:"kind",flag:"--kind",repeatable:!0}],Xe=[{param:"kind",flag:"--kind",repeatable:!0},{param:"maxDepth",flag:"--max-depth"},{param:"limit",flag:"--limit"},{param:"after",flag:"--after"},{param:"direction",flag:"--direction"},{param:"maxPaths",flag:"--max-paths"},{param:"sample",flag:"--sample"},{param:"exemptIsolate",flag:"--exempt-isolate",repeatable:!0},{param:"exemptIsolateType",flag:"--exempt-isolate-type",repeatable:!0},{param:"saveBaseline",flag:"--save-baseline"},{param:"rebuild",flag:"--rebuild"},{param:"clear",flag:"--clear"},{param:"summary",flag:"--summary"}];(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]="19a97f60-3b6e-5653-a652-02aebaf5afdd")}catch{}})();var V={oneOf:[{type:"number"},{type:"array",items:{type:"string"}}]},Y={if:{required:["field"]}};Reflect.set(Y,"then",{oneOf:[{required:["equals"]},{required:["state"]}]});var $={oneOf:[{type:"object",additionalProperties:!1,required:["id","source"],properties:{id:{type:"string",minLength:1},description:{type:"string"},max_cost:{type:"number",minimum:0},source:{oneOf:[{type:"object",additionalProperties:!1,required:["kind"],allOf:[Y],properties:{kind:{const:"items"},statuses:{type:"array",items:{type:"string"}},types:{type:"array",items:{type:"string"}},tags:{type:"array",items:{type:"string"}},field:{type:"string"},equals:{type:["string","number","boolean","null"]},state:{enum:["present","missing"]}}},{type:"object",additionalProperties:!1,required:["kind","dependency_kind"],properties:{kind:{const:"dependency_kind"},dependency_kind:{type:"string",minLength:1}}},{type:"object",required:["kind","operation","field"],properties:{kind:{const:"graph"},operation:{type:"string",minLength:1},field:{type:"string",minLength:1},parameters:{type:"object"}},additionalProperties:!1},...["validate","health"].map(e=>({type:"object",required:["kind","check","field"],properties:{kind:{const:e},check:{type:"string",minLength:1},field:{type:"string",minLength:1}},additionalProperties:!1})),{type:"object",additionalProperties:!1,required:["kind"],properties:{kind:{const:"history"},op:{type:"string"},author:{type:"string"},harness:{type:"string"},model:{type:"string"}}},{type:"object",additionalProperties:!1,required:["kind","link","state"],properties:{kind:{const:"links"},link:{enum:["files","tests","docs"]},state:{enum:["present","missing"]}}},{type:"object",additionalProperties:!1,required:["kind","provider","key"],properties:{kind:{const:"provider"},provider:{type:"string",minLength:1},key:{type:"string",minLength:1},parameters:{type:"object"}}},{type:"object",additionalProperties:!1,required:["kind","expression"],properties:{kind:{const:"derived"},expression:{type:"object",minProperties:1}}}]}}},{type:"object",additionalProperties:!1,required:["id","measurement_id","owner_item_id","scope","enforcement","negative_control"],oneOf:[{required:["ceiling"]},{required:["floor"]},{required:["equals"]},{required:["zero"]},{required:["monotone_nondecreasing"]},{required:["monotone_nonincreasing"]},{required:["subset_of"]}],allOf:[{oneOf:[{not:{required:["lifetime"],properties:{lifetime:{const:"retire"}}}},{required:["lifetime","retire_reason"],properties:{lifetime:{const:"retire"},retire_reason:{type:"string",minLength:1}}}]}],properties:{id:{type:"string",minLength:1},measurement_id:{type:"string",minLength:1},owner_item_id:{type:"string",minLength:1},scope:{oneOf:[{type:"object",additionalProperties:!1,required:["kind"],properties:{kind:{enum:["all","active"]}}},{type:"object",additionalProperties:!1,required:["kind","measurement_id"],properties:{kind:{const:"filter"},measurement_id:{type:"string",minLength:1}}}]},ceiling:{type:"number"},floor:{type:"number"},equals:V,zero:{const:!0},monotone_nondecreasing:{type:"number"},monotone_nonincreasing:{type:"number"},subset_of:{type:"array",items:{type:"string"}},lifetime:{enum:["hold","retire"]},retire_reason:{type:"string",minLength:1},enforcement:{enum:["block","warn","observe"]},authorization_decision:{type:"string",minLength:1},negative_control:{type:"object",additionalProperties:!1,required:["cases"],properties:{cases:{type:"array",minItems:2,items:{type:"object",additionalProperties:!1,required:["observed","expected"],properties:{observed:V,expected:{enum:["pass","fail"]}}}}}}}},{type:"object",additionalProperties:!1,required:["id","assertion_ids","triggers"],properties:{id:{type:"string",minLength:1},description:{type:"string"},assertion_ids:{type:"array",minItems:1,items:{type:"string",minLength:1}},triggers:{type:"array",minItems:1,items:{enum:["pre-commit","pre-push","pre-merge","ci","pre-release","post-release","scheduled","on-claim","on-close"]}},provider_policy:{type:"object",additionalProperties:!1,required:["allowed_providers","triggers"],properties:{allowed_providers:{type:"array",items:{type:"string",minLength:1}},triggers:{type:"object",additionalProperties:{type:"object",additionalProperties:!1,required:["max_cost_class","allow_network"],properties:{max_cost_class:{enum:["low","medium","high"]},allow_network:{type:"boolean"}}}}}}}}]};(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]="ddb90f7e-f3ca-56d8-be75-13e238da306c")}catch{}})();var y={json:{type:"boolean",default:!0},quiet:{type:"boolean"},profile:{type:"boolean"},noExtensions:{type:"boolean"},noPager:{type:"boolean"},tokenAccounting:{type:"boolean"},outputInclude:{type:"string",minLength:1},outputLimit:{anyOf:[{type:"integer",minimum:1},{const:"unbounded"}]},outputBudget:{anyOf:[{type:"integer",minimum:1},{const:"unbounded"}]},outputFormat:{type:"string",enum:["json","toon"]},outputSession:{anyOf:[{type:"string",minLength:1},{type:"object",additionalProperties:!1,required:["version","id","token_budget","spent_tokens","seen_item_ids"],properties:{version:{const:1},id:{type:"string",pattern:"^[A-Za-z0-9][A-Za-z0-9._:-]{0,63}$"},token_budget:{type:"integer",minimum:256},spent_tokens:{type:"integer",minimum:0},seen_item_ids:{type:"array",maxItems:S,items:{type:"string",pattern:"^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"}}}}]},outputCursor:{type:"string",minLength:1},outputRowContract:{type:"boolean"},path:{type:"string"},pmExecutable:{type:"string"},timeoutMs:{type:"number"},id:{type:"string"},target:{type:"string"},snapshotAction:{type:"string",enum:["create","list","inspect","restore","delete"]},artifact:{type:"string",enum:["item","history","relationship","json"]},basePath:{type:"string"},oursPath:{type:"string"},theirsPath:{type:"string"},outputPath:{type:"string"},itemPath:{type:"string"},prefer:{type:"string",enum:["ours","theirs"]},includeReconciled:{type:"boolean"},lockTtlSeconds:{type:"number"},lockWaitMs:{type:"number"},capability:{type:"string",minLength:1},declarative:{type:"boolean"},output:{type:"string",minLength:1},markdown:{type:"boolean"},init:{type:"boolean"},install:{type:"boolean"},uninstall:{type:"boolean"},explore:{type:"boolean"},manage:{type:"boolean"},describe:{type:"boolean"},doctor:{type:"boolean"},catalog:{type:"boolean"},adopt:{type:"boolean"},adoptAll:{type:"boolean"},activate:{type:"boolean"},deactivate:{type:"boolean"},filterFilesMissing:{type:"boolean"},filterDocsMissing:{type:"boolean"},matchMode:{type:"string",enum:["all","any","phrase"]},minScore:{anyOf:[{type:"number"},{type:"string",pattern:"^\\d+(\\.\\d+)?$"}]},rank:{anyOf:[{type:"number"},{type:"string",pattern:"^-?\\d+$"}]},exemptIsolateType:{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}]},saveBaseline:{type:"boolean"},rebuild:{type:"boolean"},github:{type:"string"},ref:{type:"string"},query:{type:"string"},queries:{type:"string"},k:{anyOf:[{type:"number"},{type:"string"}]},failUnder:{anyOf:[{type:"number"},{type:"string"}]},for:{type:"string",minLength:1},keywords:{type:"string"},fields:{type:"string"},sort:{type:"string",enum:["priority","deadline","updated_at","created_at","title","parent"]},prefix:{type:"string"},idPrefix:{type:"string"},workspace:{type:"string"},preset:{type:"string",enum:["minimal","default","strict","custom"]},typePreset:{type:"string",enum:["agile","ops","research"]},defaults:{type:"boolean"},verbose:{type:"boolean"},agentGuidance:{type:"string",enum:["ask","add","skip","status"]},withPackages:{type:"boolean"},mergeFence:{type:"boolean"},scope:{type:"string",enum:["project","global"]},allOver:{type:"number"},minEntries:{type:"number"},closed:{type:"boolean"},allStreams:{type:"boolean"},contractAction:{type:"string"},command:{type:"string"},summary:{type:"boolean"},schemaOnly:{type:"boolean"},flagsOnly:{type:"boolean"},availabilityOnly:{type:"boolean"},runtimeOnly:{type:"boolean"},activeOnly:{type:"boolean"},eagerTags:{type:"boolean"},fullChangedFields:{type:"boolean"},provenance:{type:"boolean"},provenanceSummary:{type:"boolean"},agentInstance:{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}]},provenanceFilter:{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}]},idOnly:{type:"boolean"},allowMissingParent:{type:"boolean"},allowUnresolvedDeps:{type:"boolean"},allowDuplicate:{type:"boolean"},duplicateOf:{type:"string"},configAction:{type:"string",enum:["get","set","list","export"]},key:{type:"string"},title:{type:"string"},item:{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}]},start:{type:"string"},duration:{type:"string"},end:{type:"string"},location:{type:"string"},timezone:{type:"string"},allDay:{type:"boolean"},description:{type:"string"},type:{type:"string"},template:{type:"string"},createMode:{type:"string",enum:["strict","progressive"]},schedulePreset:{type:"string",enum:["lightweight"]},status:{type:"string"},since:{type:"string",format:"date-time"},threshold:{type:"number",minimum:0,maximum:1},filterStatus:{type:"string"},filterType:{type:"string"},filterTag:{type:"string"},filterPriority:{anyOf:[{type:"string"},{type:"number"}]},filterDeadlineBefore:{type:"string"},filterDeadlineAfter:{type:"string"},filterUpdatedAfter:{type:"string"},filterUpdatedBefore:{type:"string"},filterCreatedAfter:{type:"string"},filterCreatedBefore:{type:"string"},filterAssignee:{type:"string"},filterAssigneeFilter:{type:"string",enum:["assigned","unassigned"]},filterParent:{type:"string"},filterSprint:{type:"string"},filterRelease:{type:"string"},closeReason:{type:"string"},completedAt:{type:"string",format:"date-time"},reason:{type:"string"},priority:{anyOf:[{type:"string"},{type:"number"}]},tags:{type:"string"},addTags:{type:"array",items:{type:"string"}},removeTags:{type:"array",items:{type:"string"}},addAc:{type:"array",items:{type:"string"}},removeAc:{type:"array",items:{type:"string"}},body:{type:"string"},deadline:{type:"string"},estimate:{anyOf:[{type:"string"},{type:"number"}]},acceptanceCriteria:{type:"string"},author:{type:"string"},message:{type:"string"},owner:{type:"string"},enforcement:{type:"string"},assignee:{type:"string"},assigneeFilter:{type:"string",enum:["assigned","unassigned"]},parent:{type:"string"},reviewer:{type:"string"},attributedAuthor:{type:"string"},historyEvent:{type:"array",items:{type:"string"}},risk:{type:"string"},confidence:{anyOf:[{type:"string"},{type:"number"}]},sprint:{type:"string"},release:{type:"string"},blockedBy:{type:"string"},blockedReason:{type:"string"},unblockNote:{type:"string"},reporter:{type:"string"},severity:{type:"string"},environment:{type:"string"},reproSteps:{type:"string"},resolution:{type:"string"},expectedResult:{type:"string"},actualResult:{type:"string"},affectedVersion:{type:"string"},fixedVersion:{type:"string"},component:{type:"string"},regression:{anyOf:[{type:"boolean"},{type:"string"},{type:"number"}]},customerImpact:{type:"string"},definitionOfReady:{type:"string"},order:{anyOf:[{type:"string"},{type:"number"}]},goal:{type:"string"},objective:{type:"string"},value:{type:"string"},impact:{type:"string"},outcome:{type:"string"},whyNow:{type:"string"},mode:{type:"string",enum:["keyword","semantic","hybrid"]},semanticWeight:{anyOf:[{type:"string"},{type:"number"}]},op:{type:"string"},compact:{type:"boolean"},raw:{type:"boolean"},brief:{type:"boolean"},full:{type:"boolean"},includeEmpty:{type:"boolean"},view:{type:"string",enum:["agenda","day","week","month"]},date:{type:"string"},from:{type:"string"},before:{type:"string"},at:{type:"string"},to:{type:"string"},migrationId:{type:"string"},fieldTypeScope:{type:"string"},past:{type:"boolean"},fullPeriod:{type:"boolean"},include:{type:"string"},recurrenceLookaheadDays:{anyOf:[{type:"string"},{type:"number"}]},recurrenceLookbackDays:{anyOf:[{type:"string"},{type:"number"}]},occurrenceLimit:{anyOf:[{type:"string"},{type:"number"}]},includeLinked:{type:"boolean"},semantic:{type:"boolean"},hybrid:{type:"boolean"},titleExact:{type:"boolean"},phraseExact:{type:"boolean"},highlight:{type:"boolean"},includeBody:{type:"boolean"},noTruncate:{type:"boolean"},strictRead:{type:"boolean"},tag:{type:"string"},deadlineBefore:{type:"string"},deadlineAfter:{type:"string"},today:{type:"boolean"},recent:{type:"boolean"},updatedAfter:{type:"string"},updatedBefore:{type:"string"},createdAfter:{type:"string"},createdBefore:{type:"string"},filterAcMissing:{type:"boolean"},filterEstimatesMissing:{type:"boolean"},filterResolutionMissing:{type:"boolean"},filterMetadataMissing:{type:"boolean"},filterReviewerMissing:{type:"boolean"},filterRiskMissing:{type:"boolean"},filterConfidenceMissing:{type:"boolean"},filterSprintMissing:{type:"boolean"},filterReleaseMissing:{type:"boolean"},hasNotes:{type:"boolean"},noNotes:{type:"boolean"},hasLearnings:{type:"boolean"},noLearnings:{type:"boolean"},hasFiles:{type:"boolean"},noFiles:{type:"boolean"},hasDocs:{type:"boolean"},noDocs:{type:"boolean"},hasTests:{type:"boolean"},noTests:{type:"boolean"},hasComments:{type:"boolean"},noComments:{type:"boolean"},hasDeps:{type:"boolean"},noDeps:{type:"boolean"},hasBody:{type:"boolean"},emptyBody:{type:"boolean"},hasLinkedCommand:{type:"boolean"},noLinkedCommand:{type:"boolean"},filterHasNotes:{type:"boolean"},filterNoNotes:{type:"boolean"},filterHasLearnings:{type:"boolean"},filterNoLearnings:{type:"boolean"},filterHasFiles:{type:"boolean"},filterNoFiles:{type:"boolean"},filterHasDocs:{type:"boolean"},filterNoDocs:{type:"boolean"},filterHasTests:{type:"boolean"},filterNoTests:{type:"boolean"},filterHasComments:{type:"boolean"},filterNoComments:{type:"boolean"},filterHasDeps:{type:"boolean"},filterNoDeps:{type:"boolean"},filterHasBody:{type:"boolean"},filterEmptyBody:{type:"boolean"},filterHasLinkedCommand:{type:"boolean"},filterNoLinkedCommand:{type:"boolean"},ids:{type:"string"},limit:{anyOf:[{type:"string"},{type:"number"}]},blockedLimit:{anyOf:[{type:"string"},{type:"number"}]},readyOnly:{type:"boolean"},offset:{anyOf:[{type:"string"},{type:"number"}]},progress:{type:"boolean"},background:{type:"boolean"},runId:{type:"string"},stream:{anyOf:[{type:"boolean"},{type:"string",enum:["stdout","stderr","both","rows","ndjson","jsonl"]}]},tail:{anyOf:[{type:"string"},{type:"number"}]},addJson:{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}]},eventType:{type:"string"},includeMeta:{type:"boolean"},allActionable:{type:"boolean"},verboseAuthorEvents:{type:"boolean"},match:{type:"string"},onlyIndex:{anyOf:[{type:"string"},{type:"number"}]},removeIndex:{type:"array",items:{anyOf:[{type:"string"},{type:"number"}]}},onlyLast:{type:"boolean"},envSet:{type:"array",items:{type:"string"}},envClear:{type:"array",items:{type:"string"}},sharedHostSafe:{type:"boolean"},detail:{type:"string",enum:["summary","deep"]},trace:{type:"boolean"},reload:{type:"boolean"},watch:{type:"boolean"},runtimeProbe:{type:"boolean"},fixManagedState:{type:"boolean"},isolated:{type:"boolean"},ignoreGlobal:{type:"boolean"},pmContext:{type:"string",enum:["schema","tracker","auto"]},overrideLinkedPmContext:{type:"boolean"},failOnContextMismatch:{type:"boolean"},failOnSkipped:{type:"boolean"},failOnEmptyTestRun:{type:"boolean"},requireAssertionsForPm:{type:"boolean"},checkContext:{type:"boolean"},autoPmContext:{type:"boolean"},measure:{type:"array",items:{type:"string"}},metricBelow:{type:"string"},metricDiff:{type:"string"},diff:{type:"boolean"},storage:{type:"boolean"},metadataCoverage:{type:"boolean"},fieldUtilization:{type:"boolean"},byAssignee:{type:"boolean"},byTag:{type:"boolean"},byPriority:{type:"boolean"},tagPrefix:{type:"string"},measurements:{type:"boolean"},metric:{type:"string"},measurementLimit:{type:"integer",minimum:0,maximum:1e3},observe:{type:"array",items:{type:"string"}},improvementDirection:{type:"string",enum:["higher","lower","target"]},measurementSource:{type:"string"},measurementItem:{type:"string"},measurementRevision:{type:"string"},provenanceCoverage:{type:"boolean"},fleetAttribution:{type:"boolean"},eventLimit:{type:"integer",minimum:1,maximum:1e5},minimumSample:{type:"integer",minimum:1,maximum:1e4},verify:{type:"boolean"},literal:{type:"array",items:{type:"string"}},regex:{type:"array",items:{type:"string"}},replacement:{type:"string"},timeout:{anyOf:[{type:"string"},{type:"number"}]},validateClose:{type:"string",enum:["off","warn","strict"]},checkMetadata:{type:"boolean"},metadataProfile:{type:"string",enum:["core","strict","custom"]},checkResolution:{type:"boolean"},checkLifecycle:{type:"boolean"},checkStaleBlockers:{type:"boolean"},dependencyCycleSeverity:{type:"string",enum:["off","warn","error"]},parentCycleSeverity:{type:"string",enum:["off","warn","error"]},checkFiles:{type:"boolean"},checkStorageIntegrity:{type:"boolean"},strictDirectories:{type:"boolean"},requireMergeDrivers:{type:"boolean"},checkOnly:{type:"boolean"},checkTelemetry:{type:"boolean"},noRefresh:{type:"boolean"},refreshVectors:{type:"boolean"},verboseStaleItems:{type:"boolean"},skipVectors:{type:"boolean"},skipIntegrity:{type:"boolean"},skipDrift:{type:"boolean"},verboseDiagnostics:{type:"boolean"},allAffectedIds:{type:"boolean"},scanMode:{type:"string",enum:["default","tracked-all","tracked-all-strict"]},includePmInternals:{type:"boolean"},verboseFileLists:{type:"boolean"},strictExit:{type:"boolean"},failOnWarn:{type:"boolean"},fixHints:{type:"boolean"},autoFix:{type:"boolean"},fixScope:{type:"array",items:{type:"string",enum:["metadata","resolution","estimates","lifecycle"]}},pruneMissing:{type:"boolean"},checkHistoryDrift:{type:"boolean"},checkCommandReferences:{type:"boolean"},counts:{type:"boolean"},edit:{type:"integer",minimum:1},delete:{type:"integer",minimum:1},dryRun:{type:"boolean"},normalizeProvenance:{type:"boolean"},all:{type:"boolean"},clear:{type:"boolean"},cliOnly:{type:"boolean"},packagesOnly:{type:"boolean"},repair:{type:"boolean"},packageName:{type:"string"},rollback:{type:"string"},noCheckpoint:{type:"boolean"},force:{type:"boolean"},ifAvailable:{type:"boolean"},next:{type:"boolean"},maxAttempts:{anyOf:[{type:"integer",minimum:1,maximum:100},{type:"string",pattern:"^(?:[1-9]|[1-9][0-9]|100)$"}]},includeDecisions:{type:"boolean"},explainRanking:{type:"boolean"},noTags:{type:"boolean"},noExtensionHealth:{type:"boolean"},run:{type:"boolean"},count:{type:"boolean"},sum:{type:"string"},avg:{type:"string"},tree:{type:"boolean"},treeId:{type:"string",minLength:1},definition:{type:"object"},trigger:{type:"string",enum:["pre-commit","pre-push","pre-merge","ci","pre-release","post-release","scheduled","on-claim","on-close"]},gate:{type:"string",minLength:1},treeDepth:{anyOf:[{type:"string"},{type:"number"}]},includeUnparented:{type:"boolean"},gcScope:{type:"array",items:{type:"string",enum:["index","embeddings","runtime","locks"]}},maxDepth:{anyOf:[{type:"string"},{type:"number"}]},nodeLimit:{anyOf:[{type:"string"},{type:"integer",minimum:1}]},edgeLimit:{anyOf:[{type:"string"},{type:"integer",minimum:1}]},tokenBudget:{anyOf:[{type:"string"},{type:"integer",minimum:1}]},cursor:{type:"string"},direction:{type:"string",enum:["outgoing","incoming","both"]},kind:{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}]},after:{type:"string"},maxPaths:{anyOf:[{type:"string"},{type:"integer",minimum:1}]},sample:{anyOf:[{type:"string"},{type:"integer",minimum:1}]},exemptIsolate:{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}]},collapse:{type:"string",enum:["none","repeated"]},shell:{type:"string",enum:["bash","zsh","fish"]},stdin:{type:"boolean"},file:{type:"string"},preserveSourceIds:{type:"boolean"},folder:{type:"string"},subcommand:{type:"string"},name:{type:"string"},defaultStatus:{type:"string"},alias:{type:"array",items:{type:"string"}},role:{type:"array",items:{type:"string"}},fieldType:{type:"string",enum:["string","number","boolean","string_array"]},commands:{type:"array",items:{type:"string"}},cliFlag:{type:"string"},required:{type:"boolean"},requiredOnCreate:{type:"boolean"},allowUnset:{type:"boolean"},requiredTypes:{type:"array",items:{type:"string"}},infer:{type:"boolean"},minCount:{type:"number"},text:{type:"string"},add:{type:"array",items:{type:"string"}},addGlob:{type:"array",items:{type:"string"}},remove:{type:"array",items:{type:"string"}},migrate:{type:"array",items:{type:"string"}},discover:{type:"boolean"},apply:{type:"boolean"},discoveryNote:{type:"string"},lookupPath:{type:"array",items:{type:"string"}},explain:{type:"boolean"},lines:{type:"string",pattern:"^[1-9]\\d*:[1-9]\\d*$"},decisionDepth:{type:"integer",minimum:1,maximum:32},addNote:{type:"string"},list:{type:"boolean"},appendStable:{type:"boolean"},validatePaths:{type:"boolean"},dep:{type:"array",items:{type:"string"}},depRemove:{type:"array",items:{type:"string"}},replaceDeps:{type:"boolean"},replaceTests:{type:"boolean"},replaceFiles:{type:"boolean"},replaceDocs:{type:"boolean"},comment:{type:"array",items:{type:"string"}},note:{type:"array",items:{type:"string"}},learning:{type:"array",items:{type:"string"}},linkedFile:{type:"array",items:{type:"string"}},linkedTest:{type:"array",items:{type:"string"}},doc:{type:"array",items:{type:"string"}},reminder:{type:"array",items:{type:"string"}},event:{type:"array",items:{type:"string"}},typeOption:{type:"array",items:{type:"string"}},field:{type:"array",items:{type:"string"}},unset:{type:"array",items:{type:"string"}},clearDeps:{type:"boolean"},clearComments:{type:"boolean"},clearNotes:{type:"boolean"},clearLearnings:{type:"boolean"},clearFiles:{type:"boolean"},clearTests:{type:"boolean"},clearDocs:{type:"boolean"},clearReminders:{type:"boolean"},clearEvents:{type:"boolean"},clearTypeOptions:{type:"boolean"},criterion:{type:"array",items:{type:"string"}},clearCriteria:{type:"boolean"},groupBy:{type:"string"},completion:{type:"boolean"},format:{type:"string"},unbounded:{type:"boolean"},depth:{type:"string",enum:["brief","standard","deep","full"]},section:{type:"array",items:{type:"string",enum:["hierarchy","activity","progress","blockers","files","workload","staleness","tests"]}},activityLimit:{anyOf:[{type:"string"},{type:"number"}]},staleThreshold:{type:"string"},policy:{type:"string"}},J={assurance:{definition:$,kind:{type:"string",enum:["measurement","assertion","gate"]},subcommand:{type:"string",enum:["list","show","put","remove","run","verdicts","presets","apply","derive","promote"]},preset:{type:"string",enum:["software-delivery","research","agent-evaluation","operations"]},enforcement:{type:"string",enum:["warn","block"]},limit:{type:"integer",minimum:1,maximum:1e3}},activity:{harness:{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}]}},events:{since:{type:"string",minLength:1},type:{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}]},author:{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}]},item:{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}]},limit:{type:"integer",minimum:0,maximum:1e3},harness:{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}]}},history:{harness:{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}]}},remind:{at:{type:"string",minLength:1}}},he=["create","show","add-step","update-step","complete-step","block-step","reorder-step","remove-step","link","unlink","decision","discovery","validation","resume","approve","materialize"],O={subcommand:{type:"string",enum:[...he]},stepRef:{type:"string"},reorderTo:{anyOf:[{type:"string"},{type:"number"}]},scope:{type:"string"},harness:{type:"string",enum:[...R]},mode:{type:"string",enum:[..._]},resumeContext:{type:"string"},related:{type:"string"},blocks:{type:"string"},claim:{type:"boolean"},fromSearch:{type:"string"},stepTitle:{type:"string"},step:{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}]},stepBody:{type:"string"},stepOwner:{type:"string"},stepStatus:{type:"string",enum:[...A]},stepEvidence:{type:"string"},stepBlockedReason:{type:"string"},stepReplacement:{type:"string"},dependsOn:{type:"string"},link:{type:"string"},linkKind:{type:"string",enum:[...E]},linkNote:{type:"string"},promoteToItemDep:{type:"boolean"},allowMultipleActive:{type:"boolean"},file:{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}]},test:{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}]},doc:{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}]},decisionText:{type:"string"},decision:{type:"string"},decisionRationale:{type:"string"},decisionEvidence:{type:"string"},discoveryText:{type:"string"},discovery:{type:"string"},validationText:{type:"string"},validation:{type:"string"},validationCommand:{type:"string"},validationExpected:{type:"string"},steps:{type:"array",items:{type:"string"}},materializeType:{type:"string"},materializeParent:{type:"string"},materializeTags:{type:"string"},field:{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}]}},k={subcommand:{description:"Plan workflow operation to run.",examples:["create","show","add-step","approve"]},stepRef:{description:"Plan step id or order for step lifecycle subcommands.",examples:["plan-step-001","1"]},reorderTo:{description:"New integer order for reorder-step.",examples:[1,"2"]},scope:{description:"Short free-text scope statement describing what the Plan covers.",examples:["Release readiness audit","Search package migration"]},mode:{description:"Plan lifecycle mode.",examples:["draft","research","approved"]},step:{description:"Ordered initial step titles for create (string or array, never comma-split; stepTitle, when also set, becomes the first step). For step subcommands a single value aliases stepTitle.",examples:[["Read the code","Write the fix","Run the tests"]]},file:{description:"File link to attach while creating or materializing a Plan.",examples:["path=src/cli.ts,note=implementation surface"]},test:{description:"Test command link to attach while creating or materializing a Plan.",examples:["command=pnpm build,timeout_seconds=300"]},doc:{description:"Documentation link to attach while creating or materializing a Plan.",examples:["path=docs/SDK.md,note=public API reference"]}},m={action:{description:"Tool action to execute."},pmExecutable:{description:"Override the pm executable used by actions that invoke or verify an external CLI process.",examples:["pm","node dist/cli.js"]},force:{description:"Allow the selected action to override its supported ownership, terminal-state, or destructive-operation guard."},limit:{description:"Maximum number of rows returned by the selected action.",examples:[10,"25"]},text:{description:"Text payload used by append, comment, note, or learning mutations."},path:{description:"Optional PM data root override for this invocation.",examples:[".agents/pm"]},scope:{description:"Scope selector for commands that operate on project or global state. Linked files, docs, and tests default to project scope when omitted.",examples:["project","global"]},detail:{description:"Detail mode for commands that support concise and deep diagnostics.",examples:["summary","deep"]},trace:{description:"When true for extension-doctor, include actionable registration traces in deep diagnostics."},reload:{description:"When true for extension action payloads, trigger cache-busted extension module reload."},watch:{description:"When true for extension-reload/extension action payloads, enable watch mode semantics."},runtimeProbe:{description:"When true for extension-manage, run a doctor-like runtime activation probe for parity fields."},fixManagedState:{description:"When true for extension-manage/extension-doctor, adopt unmanaged extensions before diagnostics/update checks."},isolated:{description:"When true for extension-doctor/package-doctor, ignore global registrations for hermetic project diagnostics."},ignoreGlobal:{description:"Alias for isolated on extension-doctor/package-doctor action payloads."},target:{description:"Positional target argument for the selected action (ID, source, package source, or extension name).",examples:["pm-a1b2",".agents/pm/extensions/sample","sample-extension"]},capability:{description:"Starter capability selected by extension-init or package-init scaffolding.",examples:["commands","hooks","search","schema"]},declarative:{description:"Generate the package composeExtension declarative blueprint starter."},output:{description:"File path for commands that write generated output, such as package/extension describe Markdown references.",examples:["docs/pm-package-reference.md"]},markdown:{description:"Render the package or extension description as Markdown instead of structured output.",examples:[!0]},github:{description:"GitHub shorthand owner/repo[/path] source for package/extension install actions.",examples:["org/repo/extensions/sample"]},ref:{description:"Git ref/branch/tag used when installing from GitHub shorthand/URL sources.",examples:["main","v1.0.0"]},cliOnly:{description:"Restrict upgrade to the pm CLI/SDK npm package."},packagesOnly:{description:"Restrict upgrade to managed installable pm packages."},repair:{description:"Force npm global reinstall semantics when upgrading the pm CLI/SDK."},tag:{description:"npm version or dist-tag used for CLI and registry package upgrades.",examples:["latest","next","2026.5.11"]},today:{description:"When true for list actions, include only items updated since local midnight today."},recent:{description:"When true for list actions, include only items updated in the last seven days."},packageName:{description:"Override the pm CLI package name for self-upgrade automation and tests.",examples:["@unbrained/pm-cli"]},json:{description:"Emit machine-readable JSON output."},quiet:{description:"Suppress stdout payload output."},noExtensions:{description:"Disable extension loading for this invocation."},noPager:{description:"Disable pager integration for help and long output."},tokenAccounting:{description:"Request a bounded transport-level receipt for output emitted by a compatible CLI or MCP host."},outputInclude:{description:"Comma-separated fields or sections retained by any built-in read action.",examples:["id,title,status","summary,counts"]},outputLimit:{description:"Universal read row ceiling, or unbounded to disable the shared ceiling.",examples:[10,"unbounded"]},outputBudget:{description:"Universal estimated-token ceiling for a read result, or unbounded to disable the shared ceiling.",examples:[600,1200,"unbounded"]},outputFormat:{description:"Universal read-result encoding selector.",examples:["toon","json"]},outputSession:{description:"Caller-carried JSON session state that enforces a token ceiling across read calls and replaces repeated item facts with resolvable context references.",examples:[{version:1,id:"orientation",token_budget:4e3,spent_tokens:0,seen_item_ids:[]}]},outputCursor:{description:"Opaque continuation cursor returned when a declared row collection is compacted by the output budget."},outputRowContract:{description:"Include the row selector and TOON row-encoding contract on a read result."},profile:{description:"Emit deterministic timing diagnostics to stderr."},timeoutMs:{description:"Tool execution timeout in milliseconds.",examples:[12e4]},id:{description:"Item identifier for read or mutation actions.",examples:["pm-a1b2"]},treeId:{description:"Commit, tree, snapshot, or immutable workspace identity judged by an assurance gate.",examples:["0123456789abcdef","release-candidate-3"]},definition:{description:"Structured measurement, assertion, or gate declaration used by assurance put."},trigger:{description:"Lifecycle trigger used to evaluate an assurance gate.",examples:["ci","pre-release"]},gate:{description:"Stable assurance gate id used to filter durable verdict history.",examples:["release-readiness"]},owner:{description:"pm item that owns preset or observation-derived assurance assertions.",examples:["pm-a1b2"]},enforcement:{description:"Explicit next assurance enforcement level.",examples:["warn","block"]},runId:{description:"Background test run identifier.",examples:["tr-kq9x3f-93acde"]},title:{description:"Item title text."},description:{description:"Item description text."},type:{description:"Item type name from the active runtime type registry.",examples:["Task","Feature"]},subcommand:{description:"Subcommand selector for schema, profile, telemetry, and graph actions."},name:{description:"Custom definition name, schema migration source name, or profile name.",examples:["Spike","review","component"]},defaultStatus:{description:"Default status hint recorded for a custom item type.",examples:["open"]},alias:{description:"Aliases for the custom item type or status (repeatable).",examples:[["spike","research"]]},role:{description:"Lifecycle roles for a custom status (schema add-status): draft, active, blocked, terminal, terminal_done, terminal_canceled, default_open, default_close, default_cancel.",examples:[["active"],["terminal","terminal_done"]]},fieldType:{description:"Value type for a custom field (schema add-field): string, number, boolean, or string_array.",examples:["string","number","string_array"]},fieldTypeScope:{description:"Optional item type restricting which records participate in schema rename-field.",examples:["Issue","Feature"]},migrationId:{description:"Optional stable idempotency override used to persist and resume a schema migration plan; omitted values are derived from the workspace and normalized request.",examples:["severity-to-impact-v2"]},commands:{description:"Commands a custom field is wired onto (schema add-field): create, update, update_many, list, search, calendar, context.",examples:[["create","update"],["create","update","list"]]},cliFlag:{description:"Override the auto-derived CLI flag for a custom field (schema add-field).",examples:["--owner"]},required:{description:"Mark a custom field as always required (schema add-field)."},requiredOnCreate:{description:"Mark a custom field as required at create time (schema add-field)."},allowUnset:{description:"Whether a custom field may be cleared via --unset (schema add-field); defaults to true."},allowDuplicate:{description:"Explicitly proceed when strict similarity governance finds likely duplicate items."},allowUnresolvedDeps:{description:"Permit unresolved local dependency targets while returning dependency_target_unresolved warning receipts. Cross-workspace references should use source_kind=external instead.",examples:[!0]},requiredTypes:{description:"Restrict a custom field's requirement to specific item types (schema add-field).",examples:[["Bug"],["Story","Spike"]]},infer:{description:"Infer custom item types from title-prefix conventions (schema add-type); previews unless apply is true."},minCount:{description:"Minimum number of items sharing a title prefix for schema add-type inference (default 10).",examples:[10,25]},preset:{description:"Governance preset for initialization flows.",examples:["minimal","default","strict"]},idPrefix:{description:"Tracker item identifier prefix used by initialization; overrides the positional compatibility prefix.",examples:["pm","work"]},workspace:{description:"Workspace directory where initialization resolves or creates the tracker.",examples:[".","packages/app"]},typePreset:{description:"Domain item-type preset registered during initialization.",examples:["agile","ops","research"]},defaults:{description:"Use non-interactive setup defaults during initialization."},verbose:{description:"Include the full resolved settings tree in init output."},agentGuidance:{description:"Control AGENTS.md/CLAUDE.md guidance behavior during init: ask, add, skip, or status.",examples:["ask","add","skip","status"]},withPackages:{description:"Install all bundled first-party pm packages during initialization."},mergeFence:{description:"Install the repository merge-driver fence for a fresh Git-backed tracker; set false to opt out."},createMode:{description:"Create required-option policy mode.",examples:["strict","progressive"]},schedulePreset:{description:"Schedule-centric create preset for Reminder, Meeting, and Event types.",examples:["lightweight"]},status:{description:"Item status value. Statuses are project-configurable via .agents/pm/settings.json (schema block); the built-in defaults are draft, open, in_progress, blocked, closed, canceled. Custom statuses defined for the project are accepted \u2014 discover the active set with the pm_contracts tool (workspace.statuses) or `pm contracts`. Unknown statuses are rejected at runtime with a did-you-mean hint rather than blocked by a fixed schema enum.",examples:["open","in_progress"]},since:{description:"Inclusive ISO 8601 creation timestamp lower bound for duplicate discovery.",examples:["2026-01-01T00:00:00.000Z"]},threshold:{description:"Minimum duplicate similarity score from zero through one.",examples:[.85]},priority:{description:"Priority value in range 0..4.",examples:[0,1,"2"]},order:{description:"Planning order/rank value for create/update, or sort direction (asc|desc) for list-family sorting.",examples:[0,1,"2","asc","desc"]},sort:{description:"List-family sort field selector.",examples:["priority","deadline","updated_at","created_at","title","parent"]},tags:{description:"Comma-delimited tag list.",examples:["pm-cli,agent-ux"]},addTags:{description:"Tags to add to the existing list without replacing it. Each entry may be CSV or a JSON array.",examples:[["agent-ux"],["fix","security"]]},addAc:{description:"Acceptance criteria appended individually without replacing the existing list (one criterion per entry).",examples:[["error path covered by a regression test"]]},removeAc:{description:"Acceptance criteria removed individually by exact text match; the mutation fails atomically if any selector is unmatched (one criterion per entry).",examples:[["superseded manual QA step"]]},removeTags:{description:"Tags to remove from the existing list. Each entry may be CSV or a JSON array.",examples:[["stale"],["legacy","wontfix"]]},deadline:{description:"ISO/date timestamp or relative offset (+6h/+1d/+2w/+6m).",examples:["2026-04-01T00:00:00.000Z","+1d"]},reminder:{description:"Repeatable reminder seed entries at=<iso|relative>,text=<text>.",examples:[["at=+2d,text=Review PR"]]},event:{description:"Repeatable event seed entries start=<iso|relative> with end=<iso|relative> or duration=<relative|30min|PT30M>. Bare `m` remains months for backward compatibility.",examples:[["start=2026-07-01T10:00:00Z,duration=2h,title=planning"],["start=2026-07-01T10:00:00Z,duration=30min,title=standup"],["start=2026-07-01T10:00:00Z,duration=PT30M,title=window"]]},historyEvent:{description:"Unknown-author history target in <item-id>:<one-based-line> form.",examples:[["pm-example:4","pm-example:5"]]},estimate:{description:"Estimated effort in minutes.",examples:[60,"120"]},acceptanceCriteria:{description:"Complete acceptance-criteria text supplied while creating or replacing an item field."},author:{description:"Intentional mutation-author override. Agent harness identity is automatic when omitted."},attributedAuthor:{description:"Principal attributed to the immutable unknown-author history events after review.",examples:["reviewed-principal"]},message:{description:"History message for mutation audit trail."},assignee:{description:"Assignee identity."},assigneeFilter:{description:"Assignee presence selector for list, calendar, and context filters.",examples:["assigned","unassigned"]},parent:{description:"Parent item ID filter for hierarchical list queries.",examples:["pm-epic01"]},blockedLimit:{description:"Cap blocked rows returned by the next action (defaults to the ready --limit).",examples:["3"]},readyOnly:{description:"When true, the next action omits the blocked companion list."},unset:{description:"Repeatable list of item-metadata fields to clear explicitly during create/update mutations.",examples:[["deadline","assignee"],["close-reason"]]},clearDeps:{description:"When true, clear linked dependencies."},replaceDeps:{description:"When true for update, atomically replace dependencies with the supplied --dep values."},replaceTests:{description:"When true for update, atomically replace linked tests with the supplied --test values."},replaceFiles:{description:"When true for update, atomically replace linked files with the supplied --file values."},replaceDocs:{description:"When true for update, atomically replace linked docs with the supplied --doc values."},lookupPath:{description:"One or more source paths whose referencing pm items should be returned by files lookup.",examples:[["src/sdk/files.ts"],["README.md","docs/SDK.md"]]},explain:{description:"Include ranked linked-file, rationale, and governing-decision evidence for a files lookup."},lines:{description:"Inclusive start:end source-line range for Git contribution attribution; requires one lookup path.",examples:["10:24"]},decisionDepth:{description:"Maximum typed relationship depth searched for a governing Decision during files lookup.",examples:[8]},clearComments:{description:"When true, clear item comments."},clearNotes:{description:"When true, clear item notes."},clearLearnings:{description:"When true, clear item learnings."},clearFiles:{description:"When true, clear linked files."},clearTests:{description:"When true, clear linked tests."},clearDocs:{description:"When true, clear linked docs."},clearReminders:{description:"When true, clear reminders."},clearEvents:{description:"When true, clear events."},clearTypeOptions:{description:"When true, clear type option metadata."},clearCriteria:{description:"When true for config set criteria-list keys (definition-of-done, metadata-required-fields, lifecycle pattern lists), clear the criteria list."},mode:{description:"Mode selector for search and reindex (keyword|semantic|hybrid).",examples:["keyword","hybrid"]},semanticWeight:{description:"Per-query hybrid semantic weight override in [0,1] for search action; invalid values fall back to settings.",examples:[.2,"0.7"]},op:{description:"History operation filter for activity output.",examples:["create","update","close","update_ownership_bypass"]},fullPeriod:{description:"For day/week/month calendar views, include the full anchored period instead of clipping the start to now."},progress:{description:"Emit progress diagnostics to stderr for long-running operations."},background:{description:"Run linked tests in managed background mode."},addJson:{description:"JSON input: one structured context event for notes, or repeatable linked-test entries for test.",examples:[['{"command":"node scripts/run-tests.mjs test -- tests/unit/output.spec.ts","timeout_seconds":240}']]},eventType:{description:"For notes action, return structured context events whose top-level type matches this value."},includeMeta:{description:"Include structured-event counts for notes reads; filtered reads also include total, returned, limit, and has-more metadata."},allActionable:{description:"For history-author-acknowledge, select every currently actionable undispositioned event."},match:{description:"Run only linked tests whose command or path contains this case-insensitive substring.",examples:["output.spec.ts","coverage"]},onlyIndex:{description:"Run only the 1-based linked-test index from pm test <id> --list order.",examples:[1,"2"]},removeIndex:{description:"Remove linked tests by their 1-based positions from pm test <id> --list order; repeatable and lossless for commands containing commas or equals signs.",examples:[[1],["2","4"]]},onlyLast:{description:"Run only the most recently added linked-test entry."},envSet:{description:"Repeatable runtime environment KEY=VALUE overrides for linked-test execution.",examples:[["PORT=0","PLAYWRIGHT_HTML_OPEN=never"]]},envClear:{description:"Repeatable runtime environment variable names to clear before linked-test execution.",examples:[["PLAYWRIGHT_BASE_URL"]]},sharedHostSafe:{description:"Apply additive shared-host-safe runtime defaults during linked-test execution."},pmContext:{description:"PM linked-test context mode (schema keeps isolated tracker data; tracker seeds source tracker data; auto uses tracker for PM tracker-read linked commands).",examples:["schema","tracker","auto"]},overrideLinkedPmContext:{description:"Force run-level --pm-context to override per-linked-test pm_context_mode metadata for all linked-test entries."},failOnContextMismatch:{description:"Fail linked PM command runs when source and sandbox tracker item counts differ."},failOnSkipped:{description:"Treat skipped linked tests as dependency-failed policy violations."},failOnEmptyTestRun:{description:"Treat successful linked-test commands that report zero executed tests as failures."},requireAssertionsForPm:{description:"Require assertion metadata for linked PM command test entries during run execution."},checkContext:{description:"Run linked PM command context preflight diagnostics before command execution."},autoPmContext:{description:"Auto-remediate PM tracker-read linked commands by routing those entries through tracker context regardless of linked-test pm_context_mode overrides."},measure:{description:"Repeatable numeric run evidence in name=value[,unit=...][,threshold=...] form.",examples:[["coverage=100,unit=percent,threshold=100"]]},metricBelow:{description:"Return recorded evidence below a name=value threshold.",examples:["coverage=100"]},metricDiff:{description:"Compare the latest and previous values for one metric.",examples:["coverage"]},dryRun:{description:"Preview command effects without mutating storage artifacts."},normalizeProvenance:{description:"For history-repair: remove invalid legacy provenance observations and emit only aggregate privacy-safe repair evidence."},all:{description:"For history-repair action: scan every stream for drift and repair each drifted stream in one audited pass (mutually exclusive with id)."},clear:{description:"For focus action: clear the session focused item instead of setting it (mutually exclusive with id)."},gcScope:{description:"Repeatable gc scope selector values (index, embeddings, runtime, locks, checkpoints, transactions).",examples:[["index","embeddings"],["runtime"],["locks"],["checkpoints"]]},storage:{description:"For stats action: include aggregate history-stream storage metrics (total streams/lines/bytes, largest + deepest streams, oldest/newest entries) for compaction and storage planning."},fieldUtilization:{description:"For stats action: include a field_utilization block reporting present/total/percent for content fields (notes, learnings, files, docs, tests, comments, deps, body, linked_command) across all items so under-documented dimensions are visible at a glance."},measurements:{description:"For stats action: include the audited append-only improvement ledger and baseline-to-latest trends."},metric:{description:"Exact improvement metric name used to filter ledger reads.",examples:["quality.coverage.lines"]},measurementLimit:{description:"Maximum newest improvement observations returned by stats.",examples:[50]},observe:{description:"Repeatable audited observation in name=value[,unit=...][,threshold=...] form.",examples:[["quality.coverage.lines=100,unit=percent,threshold=100"]]},improvementDirection:{description:"Improvement direction for newly recorded observations.",examples:["higher","lower","target"]},measurementSource:{description:"Producing gate or instrument for a new observation.",examples:["pnpm coverage"]},measurementItem:{description:"Tracked item that owns an improvement observation.",examples:["pm-123abc"]},measurementRevision:{description:"Explicit source revision for a new observation.",examples:["0123456789abcdef"]},provenanceCoverage:{description:"For stats action: compare configured provenance descriptors with bounded immutable-history observations."},fleetAttribution:{description:"For stats action: derive observational throughput, rework, and defect-escape rates by harness, model, and author source."},eventLimit:{description:"Maximum immutable history events consumed by an analytics projection.",examples:[1e4]},minimumSample:{description:"Minimum denominator before analytics rates are reported.",examples:[5]},offset:{description:"Number of matching rows to skip before limit is applied.",examples:[0,50,"100"]},provenance:{description:"Return patch-free immutable author, harness, instance, and extensible provenance rows."},provenanceSummary:{description:"Include bounded observed, unavailable, legacy-missing, and unresolved-author counts."},agentInstance:{description:"Privacy-safe agent invocation fingerprint filter, supplied once or as a list.",examples:["a1b2c3d4",["a1b2c3d4","e5f6g7h8"]]},provenanceFilter:{description:"Exact extensible provenance predicate in dimension=value form, supplied once or as a list.",examples:["model=gpt-5.6-sol",["effort=xhigh","role=reviewer"]]},before:{description:"For history-compact, compact entries strictly before this boundary (version number or ISO timestamp). Single-id mode only.",examples:["5","2026-06-01T00:00:00.000Z"]},at:{description:"Read-only historical projection boundary as an item version or ISO timestamp.",examples:["3","2026-07-01T12:00:00.000Z"]},allOver:{description:"For history-compact bulk mode, compact every stream with more than N entries. When history.compact_policy is enabled and this is omitted, the policy's max_entries is used.",examples:[200,"500"]},minEntries:{description:"For history-compact bulk mode, skip streams with at most N entries as already-compact (default 3).",examples:[3,"10"]},closed:{description:"For history-compact bulk mode, compact only closed (terminal) items' history streams."},allStreams:{description:"For history-compact bulk mode, compact every history stream regardless of lifecycle state."},literal:{description:"Repeatable literal matcher used by history-redact to scrub exact string values.",examples:["[redacted_path_prefix]/private/path"]},regex:{description:"Repeatable regex matcher used by history-redact. Accepts either /pattern/flags or a raw pattern (global mode is auto-enabled).",examples:["/192\\\\.168\\\\.[0-9.]+/g","token=[A-Za-z0-9_-]+"]},replacement:{description:'Replacement text used by history-redact (defaults to "[redacted]").',examples:["[scrubbed_path]"]},validateClose:{description:'Close-time metadata validation mode ("off", "warn", or "strict").',examples:["off","warn","strict"]},checkMetadata:{description:"Run metadata completeness checks."},metadataProfile:{description:"Select metadata validation profile for --check-metadata.",examples:["core","strict","custom"]},checkResolution:{description:"Run closed-item resolution metadata checks."},checkLifecycle:{description:"Run active-item lifecycle governance drift checks."},checkStaleBlockers:{description:"Include stale blocker-pattern diagnostics in lifecycle checks."},dependencyCycleSeverity:{description:"Set dependency-cycle warning policy for lifecycle checks.",examples:["off","warn","error"]},parentCycleSeverity:{description:"Set parent-cycle warning policy for lifecycle checks.",examples:["off","warn","error"]},checkFiles:{description:"Run linked-file and orphaned-file checks."},checkStorageIntegrity:{description:"Run deep item, history, index, and vector storage integrity checks."},strictDirectories:{description:"Treat optional item-type directories as required health failures."},requireMergeDrivers:{description:"Treat never-installed clone-local semantic merge drivers as required health failures."},checkOnly:{description:"For health action, run read-only diagnostics without refreshing vectors."},checkTelemetry:{description:"For health action, probe telemetry endpoint health and include network diagnostics."},noRefresh:{description:"For health action, skip vector refresh while still running checks."},refreshVectors:{description:"For health action, explicitly refresh stale vectors."},verboseStaleItems:{description:"For health action, include full stale-item arrays in vectorization details."},verboseAuthorEvents:{description:"For health action, include every actionable unknown-author event coordinate."},skipVectors:{description:"For health action, skip vectorization checks for a faster diagnostic run."},skipIntegrity:{description:"For health action, skip item/history file integrity checks for a faster diagnostic run."},skipDrift:{description:"For health action, skip history drift hash checks for a faster diagnostic run."},scanMode:{description:"Select file candidate scan mode for --check-files.",examples:["default","tracked-all","tracked-all-strict"]},includePmInternals:{description:"Include PM storage internals in tracked-all candidate scans."},verboseFileLists:{description:"For validate action, include full file-path lists for --check-files details."},verboseDiagnostics:{description:"For validate action, include full diagnostic ID lists instead of compact summaries."},strictExit:{description:"Return non-zero exit when health/validate/extension-doctor warnings are present."},failOnWarn:{description:"Alias for strictExit in health/validate/extension-doctor action payloads."},fixHints:{description:"For validate action, add a machine-executable fix_hints[] of pm commands to each failing check's details."},autoFix:{description:"For validate action, apply the safe, deterministic subset of fix-hint remediations (field backfills) automatically; combine with dryRun to preview and fixScope to grant gated scopes."},fixScope:{description:"For validate action, grant --auto-fix scopes (metadata, resolution, estimates, lifecycle). Defaults to the safe scopes metadata and resolution; estimates (per-type default estimated_minutes backfill) and lifecycle must be named explicitly.",examples:[["estimates"],["lifecycle"],["metadata","resolution"]]},pruneMissing:{description:"For validate action, remove stale linked-file/doc LINKS whose paths classified as deleted (link removal only \u2014 never touches real files); honors dryRun."},checkHistoryDrift:{description:"Run item/history hash drift checks."},checkCommandReferences:{description:"Run linked-command PM-ID reference checks."},edit:{description:"For comments, notes, and learnings actions, replace the annotation at this 1-based index with supplied replacement text."},delete:{description:"For comments, notes, and learnings actions, delete the annotation at this 1-based index."},stdin:{description:"For comments, notes, and learnings actions, read annotation text from piped stdin (supports multiline markdown)."},file:{description:"CLI-only path to an input file for commands that read payload text; tool actions exclude host file access.",examples:["notes/comment.md"]},preserveSourceIds:{description:"Preserve explicit source IDs during Beads imports instead of normalizing to tracker prefix.",examples:[!0]},appendStable:{description:"When true for files action, preserve existing linked-file order and append new links without full-array resorting."},discover:{description:"When true for files action, use `pm files discover <id>` to scan item text for referenced file paths."},apply:{description:"Persist changes instead of returning a dry-run preview: for files discovery, add the missing discovered file links; for schema add-type --infer, register the inferred custom item types."},discoveryNote:{description:"Note attached to file links added by files discovery.",examples:["discovered from item text"]},addNote:{description:"Note attached to every link added by add/addGlob in this call (per-entry embedded note= wins; requires add or addGlob). Maps to the CLI --note flag on pm files/pm docs.",examples:["command wiring"]},list:{description:"When true, list command-specific entries without mutating state (for example linked paths for files/docs or topics for guide).",examples:[!0]},stream:{description:"Stream selector: test-runs logs accepts stdout|stderr|both; activity accepts boolean/rows|ndjson|jsonl for line-delimited output.",examples:["stderr","stdout","both","rows","ndjson","jsonl",!0]},tail:{description:"Number of lines to tail for background run logs.",examples:[100]},query:{description:"Search query text for search action."},for:{description:"Named context intent projection declared for the selected read action.",examples:["orient","inspect","triage","execute","discover"]},keywords:{description:"Alias for query in search action payloads."},includeLinked:{description:"Include readable linked docs/files/tests content in keyword and hybrid lexical scoring."},titleExact:{description:"For search action, require exact normalized title match for the full query string."},phraseExact:{description:"For search action, require exact normalized query phrase match in item text fields."},highlight:{description:"For search action, emit per-field matched-text snippets (wrapped in \xAB\u2026\xBB) on each hit. Off by default."},includeBody:{description:"When true for list-family actions, include item body text in projected rows."},noTruncate:{description:"When true for list-family actions, return every matched row, overriding any limit (surfaces total when rows were dropped)."},strictRead:{description:"When true for list-family actions, fail if any source item or item directory cannot be read."},compact:{description:"Render compact projection output for search and list-family actions."},raw:{description:"For activity, restore the compact per-event stream instead of the default item digest."},brief:{description:"Emit compact low-token output for commands that support terse projections or health details.",examples:[!0]},full:{description:"Enable command-specific full/detail output mode when supported, such as deep item reads for get or full payload mode for search/history."},includeEmpty:{description:"For stats, restore zero-count registered type and lifecycle-status buckets."},fields:{description:"Comma-separated projection fields for get, search, list-family, or context outputs. Valid field names are command-specific (e.g. score/matched_fields apply to search; context projects focus-row fields such as priority/deadline/completion_pct).",examples:["id,title,status,parent,type","id,title,score,matched_fields","id,title,priority,deadline"]},groupBy:{description:"Comma-separated aggregate grouping fields (supported: parent,type,priority,status,assignee,tags,sprint,release).",examples:["parent,type","type,status","priority,assignee","tags","sprint,release"]},count:{description:"Enable grouped count output for aggregate action."},completion:{description:"For aggregate action, add open/in_progress/closed/other counts and completion_pct per group."},sum:{description:"Numeric field to sum per aggregate group (count and null_count are still returned).",examples:["estimated_minutes","priority"]},avg:{description:"Numeric field to average per aggregate group (count and null_count are still returned).",examples:["estimated_minutes","priority"]},tree:{description:"When true for list/get actions, render recursive parent/child tree ordering."},treeDepth:{description:"Maximum recursion depth for tree output (0 keeps root rows only).",examples:[0,1,"2"]},includeUnparented:{description:"Include unparented rows when aggregate grouping includes parent."},maxDepth:{description:"Maximum dependency traversal depth for deps action (0 keeps only the root node).",examples:[0,1,"2"]},nodeLimit:{description:"Maximum related nodes returned by deps --format context.",examples:[10,"20"]},edgeLimit:{description:"Maximum related edges returned by deps --format context.",examples:[20,"40"]},tokenBudget:{description:"Maximum estimated output tokens for the command output.",examples:[600,"1200"]},cursor:{description:"Opaque continuation cursor returned by deps --format context."},direction:{description:'Graph-context traversal direction for deps action ("outgoing", "incoming", or "both").',examples:["both","incoming"]},kind:{description:"Registered relationship kinds narrowing deps --format context traversal (string, comma-separated, or array).",examples:["blocked_by",["parent","related"]]},after:{description:"Continuation cursor resuming a bounded listing or traversal after this previously returned id.",examples:["pm-x1y2"]},maxPaths:{description:"Maximum enumerated paths for graph paths queries.",examples:[5,"10"]},sample:{description:"Maximum evidence sample entries per graph audit finding.",examples:[10,"25"]},exemptIsolate:{description:"Item ids the graph audit treats as explicitly valid isolates (string, comma-separated, or array).",examples:["pm-x1y2",["pm-x1y2","pm-a3b4"]]},exemptIsolateType:{description:"Item types whose active isolates the graph audit treats as policy-valid (string, comma-separated, or array).",examples:["Reminder",["Reminder","Event"]]},saveBaseline:{description:"When true, persist the graph audit census as the change-since-baseline comparison point (audit only)."},rebuild:{description:"When true, rebuild and warm the durable graph index (graph index only)."},collapse:{description:'Dependency tree collapse mode for deps action ("none" or "repeated").',examples:["none","repeated"]},summary:{description:"When true, return the command's compact summary projection (deps counts, health rollup, or contracts command intents)."},shell:{description:"Shell target for completion generation.",examples:["bash"]},eagerTags:{description:"When true for completion, eagerly embed current tracker tags into generated scripts (legacy mode)."},contractAction:{description:"Filter contracts schema to one tool action.",examples:["create","update"]},command:{description:"Scope contracts output to one CLI command name; action/schema surfaces narrow by default.",examples:["create","search","list"]},schemaOnly:{description:"When true, contracts action returns schema-focused payloads (mutually exclusive with flagsOnly/availabilityOnly)."},flagsOnly:{description:"When true, contracts action returns only command flag surface payloads (mutually exclusive projection mode)."},availabilityOnly:{description:"When true, contracts action returns only action availability payloads (mutually exclusive projection mode)."},runtimeOnly:{description:"When true, contracts action only includes actions invocable in the current runtime."},activeOnly:{description:"Alias for runtimeOnly in contracts action payloads."},depth:{description:"Context depth level controlling how many sections are included (brief=focus+agenda, standard=+hierarchy/activity/progress/workload, deep=all sections, full=every section with no per-section row cap).",examples:["brief","standard","deep","full"]},section:{description:"Repeatable section selector for context; overrides --depth when provided.",examples:[["hierarchy","activity"],["blockers","files","staleness"]]},activityLimit:{description:"Maximum number of recent activity entries to include in context output.",examples:[5,10,"20"]},staleThreshold:{description:"Staleness cutoff in days for context staleness section (e.g. 7 or 7d).",examples:["7","14d","30"]}},Z={assurance:{subcommand:{description:"Assurance operation: list, show, put, remove, run, verdicts, presets, apply, derive, or promote.",examples:["list","run","derive","promote"]},kind:{description:"Assurance declaration kind for registry operations: measurement, assertion, or gate.",examples:["measurement","assertion","gate"]},id:{description:"Stable assurance declaration id or gate id, depending on subcommand.",examples:["active-issues","release-readiness"]},limit:{description:"Maximum number of newest assurance verdicts returned.",examples:[10,25]},preset:{description:"Built-in assurance project shape to preview or apply.",examples:["software-delivery","agent-evaluation"]}},update:{acceptanceCriteria:{description:"Complete acceptance-criteria replacement text. Use removeAc plus addAc together for an atomic one-entry repair that preserves unrelated criteria."}},"update-many":{acceptanceCriteria:{description:"Complete acceptance-criteria replacement text. Use removeAc plus addAc together for an atomic one-entry repair that preserves unrelated criteria."}},stats:{since:{description:"Inclusive ISO 8601 timestamp or negative duration lower bound for provenance and fleet analytics.",examples:["2026-08-01T00:00:00.000Z","-30d"]}},events:{since:{description:"Durable event cursor returned as next_cursor, or an inclusive event timestamp.",examples:["eyJmaW5nZXJwcmludCI6Ii4uLiJ9","2026-08-01T00:00:00.000Z"]},type:{description:"Mutation event type filter, supplied once or as a list.",examples:["create",["create","update"]]},author:{description:"Mutation author filter, supplied once or as a list.",examples:["agent-a",["agent-a","agent-b"]]},item:{description:"Tracked item id filter, supplied once or as a list.",examples:["pm-a1b2",["pm-a1b2","pm-c3d4"]]},limit:{description:"Maximum mutation events returned, from 0 through 1000.",examples:[0,100]}},remind:{at:{description:"Reminder time as an ISO 8601 timestamp or supported relative expression.",examples:["2026-08-02T09:00:00+02:00","tomorrow 09:00"]}},deps:{tokenBudget:{description:"Maximum estimated output tokens for deps --format context.",examples:[600,"1200"]}},comments:{full:{description:"Return the complete post-mutation comment history instead of the bounded mutation receipt projection."}},notes:{full:{description:"Return the complete post-mutation note history instead of the bounded mutation receipt projection."},since:{description:"Inclusive ISO 8601 creation timestamp lower bound for structured note event filtering.",examples:["2026-01-01T00:00:00.000Z"]}},learnings:{full:{description:"Return the complete post-mutation learning history instead of the bounded mutation receipt projection."}},next:{tag:{description:"Only recommend items carrying this exact tag.",examples:["sdk","release"]},tokenBudget:{description:"Maximum estimated output tokens for the recommendation context.",examples:[600,"1200"]}},claim:{tag:{description:"When claiming the next item, only consider work carrying this exact tag.",examples:["sdk","release"]},tokenBudget:{description:"Maximum estimated output tokens for the next-item context returned with the claim.",examples:[600,"1200"]}},close:{text:{description:"Backward-compatible alias for the item close reason when reason is not provided."}},"close-task":{text:{description:"Close reason used before releasing the item's active assignment."}},schema:{name:{description:"Custom item type name (add-type/remove-type/show), custom status id (show-status/add-status/remove-status), or custom field key (add-field/remove-field/show-field). Required for those subcommands.",examples:["Spike","review","component"]}},profile:{name:{description:"Profile name for show/apply/lint. Built-in profiles are agile, ops, and research; an active extension can contribute additional archetype names that resolve here too.",examples:["agile","ops","research"]}},graph:{subcommand:{description:"Graph query selector: ancestors|descendants|predecessors|successors|paths|impact|analyze|audit|communities|redundancy|dominators|slack|centrality|articulation|plan|index. Traversals, paths, impact, and dominators require id; paths also requires target; slack reports critical-path float, centrality ranks betweenness/closeness/degree, articulation reports cut points and bridges; plan derives dry-run remediation proposals from the governance audit; index reports, rebuilds, or clears the durable cross-process graph index.",examples:["successors","audit"]},clear:{description:"When true, delete the durable graph index (graph index only)."},id:{description:"Root item id for traversal, paths, impact, and dominators graph queries.",examples:["pm-x1y2"]},target:{description:"Target item id for graph paths queries.",examples:["pm-a3b4"]},direction:{description:'Edge orientation for graph paths/impact/dominators queries ("outgoing", "incoming", or "both"; default "both").',examples:["incoming"]},kind:{description:"Registered relationship kinds narrowing the graph query (string, comma-separated, or array).",examples:["blocked_by",["parent","related"]]},maxDepth:{description:"Maximum graph traversal depth (non-negative integer).",examples:[2,"4"]},after:{description:"Resume a hierarchy/ordering graph traversal after this previously returned node id.",examples:["pm-x1y2"]},limit:{description:"Maximum returned rows per bounded graph collection (traversal ids, impact rows, analyze/communities samples, redundancy rows, dominator bottlenecks).",examples:[10,"25"]},summary:{description:"When true, return counts-first graph envelopes without row collections."}}};(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]="aa58e280-0a39-5285-a451-811e60481661")}catch{}})();var be=["json","quiet","profile","noExtensions","noPager","tokenAccounting","path","pmExecutable","timeoutMs"],ve=["outputInclude","outputLimit","outputBudget","outputFormat","outputSession","outputCursor","outputRowContract"],xe=new Set(["action","cwd","options",...Object.keys(y).filter(e=>e!=="severity")]);function ct(e){let t=e.trim().toLowerCase(),a="";for(let r=0;r<t.length;r+=1){let i=t[r];if(i!=="-"&&i!=="_"){a+=i;continue}let n=r+1;for(;t[n]==="-"||t[n]==="_";)n+=1;let s=t[n];if(s!==void 0&&(s>="a"&&s<="z"||s>="0"&&s<="9")){a+=s.toUpperCase(),r=n;continue}a+=t.slice(r,n),r=n-1}return xe.has(a)?{field:e,property:a,owner:"mcp_tool_input",nested_path:`options.${a}`}:void 0}var Oe={create:["fullChangedFields","idOnly"],copy:["fullChangedFields","idOnly"],update:["fullChangedFields","idOnly"],close:["fullChangedFields","idOnly"],restore:["fullChangedFields","idOnly"],append:["fullChangedFields"],"update-many":["fullChangedFields"],"close-many":["fullChangedFields"],assurance:["fullChangedFields","idOnly"]},ke=["createMode","status","deadline","estimate","acceptanceCriteria","definitionOfReady","order","rank","goal","objective","value","impact","outcome","whyNow","assignee","reviewer","risk","confidence","sprint","release","blockedReason","unblockNote","reporter","severity","environment","reproSteps","resolution","expectedResult","actualResult","affectedVersion","fixedVersion","component","regression","customerImpact","comment","note","learning","reminder","event","typeOption"],mt=Object.freeze({"close-many":["list","expected_result","expected","actual_result","actual","validate_close","dry_run","checkpoint","no_checkpoint","filterAssignee_filter"],"update-many":["list","update","dry_run","checkpoint","no_checkpoint","filterAssignee_filter"],...Object.fromEntries(h.filter(e=>e==="install"||e==="extension"||e==="package"||e.startsWith("extension-")||e.startsWith("package-")).map(e=>[e,["project","local","global"]]))});function p(e){return C(e)}var Te=p([...B.map(e=>e.param),...x.map(e=>e.param),"assignee","closeReason","completedAt"]),ae=p([...W.map(e=>e.param),...x.map(e=>e.param),"force"]),_e=p([...H.map(e=>e.param),...ae.filter(e=>e!=="allowMissingParent"&&e!=="completedAt"),"dryRun","rollback","noCheckpoint"]),Ae=p([...z.map(e=>e.param),"reason","completedAt","resolution","expectedResult","actualResult","validateClose","dryRun","rollback","noCheckpoint","author","message","force"]),X=p([...K.map(e=>e.param),"past","section"]),Re=p([...G.map(e=>e.param),"stream"]),d=p([...D.map(e=>e.param),"includeBody","noTruncate","strictRead","compact","brief","full"]),c=[[{property:"today",schema:{const:!0}},{property:"recent",schema:{const:!0}}],[{property:"today",schema:{const:!0}},{property:"updatedAfter",schema:{type:"string",pattern:"\\S"}}],[{property:"recent",schema:{const:!0}},{property:"updatedAfter",schema:{type:"string",pattern:"\\S"}}]],Ee=[[{property:"summary",schema:{const:!0}},{property:"schemaOnly",schema:{const:!0}}],[{property:"summary",schema:{const:!0}},{property:"flagsOnly",schema:{const:!0}}],[{property:"summary",schema:{const:!0}},{property:"availabilityOnly",schema:{const:!0}}],[{property:"schemaOnly",schema:{const:!0}},{property:"flagsOnly",schema:{const:!0}}],[{property:"schemaOnly",schema:{const:!0}},{property:"availabilityOnly",schema:{const:!0}}],[{property:"flagsOnly",schema:{const:!0}},{property:"availabilityOnly",schema:{const:!0}}]],Ce=p([...F.map(e=>e.param),"count","completion","includeUnparented"]),we=p(["query","keywords","mode","semantic","hybrid","includeLinked","titleExact","phraseExact","highlight","compact","full",...j.map(e=>e.param)]),Q=p(["type","tag","priority","assignee","assigneeFilter","sprint","release","parent","limit","blockedLimit","readyOnly","format","includeDecisions","tokenBudget","explainRanking"]),l=["author","message","force"],Pe=["text","reason","closeReason","completedAt","duplicateOf","validateClose","resolution","expectedResult","actualResult"],g=["author","assignee","message","force"],Se=["target","scope","capability","declarative","github","ref","init","install","uninstall","explore","manage","describe","markdown","output","reload","doctor","catalog","list","adopt","adoptAll","activate","deactivate","runtimeProbe","fixManagedState","isolated","ignoreGlobal","detail","trace","watch","strictExit","failOnWarn"];function ee(e){return{[`${e}-init`]:{required:["target"],optional:["scope","capability",...e==="package"?["declarative"]:[]]},[`${e}-install`]:{optional:["target","github","scope","ref"],anyOfRequired:[["target"],["github"]]},[`${e}-uninstall`]:{required:["target"],optional:["scope"]},[`${e}-explore`]:{optional:["scope"]},[`${e}-manage`]:{optional:["scope","runtimeProbe","fixManagedState"]},[`${e}-describe`]:{optional:["target","scope","markdown","output"]},[`${e}-reload`]:{optional:["scope","watch"]},[`${e}-doctor`]:{optional:["scope","detail","trace","fixManagedState","isolated","ignoreGlobal","strictExit","failOnWarn"]},[`${e}-catalog`]:{optional:["scope","fields"]},[`${e}-adopt`]:{required:["target"],optional:["scope","github","ref"]},[`${e}-adopt-all`]:{optional:["scope"]},[`${e}-activate`]:{required:["target"],optional:["scope"]},[`${e}-deactivate`]:{required:["target"],optional:["scope"]},[e]:{optional:Se}}}var te={required:["title"],optional:["start","duration","end","location","timezone","allDay","parent","allowMissingParent","tags","priority","body","description","author","message"]},f={init:{optional:["prefix","idPrefix","workspace","preset","typePreset","defaults","author","agentGuidance","withPackages","mergeFence","force","verbose"]},config:{required:["scope","configAction"],optional:["key","value","criterion","clearCriteria","format","policy"]},...ee("extension"),...ee("package"),install:{optional:["target","github","scope","ref"],anyOfRequired:[["target"],["github"]]},upgrade:{optional:["target","scope","dryRun","cliOnly","packagesOnly","repair","tag","packageName"]},create:{required:["title","description","type","status","priority","message"],optional:Te},copy:{required:["id"],optional:["title","author","message","allowDuplicate"]},focus:{optional:["id","clear"],mutuallyExclusive:[["id","clear"]]},list:{optional:d,mutuallyExclusiveWhen:c},"list-all":{optional:d,mutuallyExclusiveWhen:c},"list-draft":{optional:d,mutuallyExclusiveWhen:c},"list-open":{optional:d,mutuallyExclusiveWhen:c},"list-in-progress":{optional:d,mutuallyExclusiveWhen:c},"list-blocked":{optional:d,mutuallyExclusiveWhen:c},"list-closed":{optional:d,mutuallyExclusiveWhen:c},"list-canceled":{optional:d,mutuallyExclusiveWhen:c},aggregate:{optional:Ce},guide:{optional:["list","format","depth"]},context:{optional:X},ctx:{optional:X},get:{required:["id"],optional:["for","tokenBudget","at","depth","full","fields","tree","treeDepth","format"]},search:{optional:we,anyOfRequired:[["query"],["keywords"]]},eval:{optional:["mode","k","failUnder","queries","format"]},events:{optional:["since","type","author","item","limit","full","provenance","provenanceSummary","harness","agentInstance","provenanceFilter"]},merge:{required:["subcommand"],optional:["dryRun","author","message","force","includeReconciled","artifact","basePath","oursPath","theirsPath","output","outputPath","itemPath","prefer"]},workspace:{required:["subcommand","snapshotAction"],optional:["name","target","dryRun","force","author","message","lockTtlSeconds","lockWaitMs"]},meet:te,event:te,remind:{required:["title"],optional:["at","text","parent","allowMissingParent","tags","priority","body","description","author","message"]},next:{optional:[...Q,"for"]},reindex:{optional:["mode","progress"]},history:{required:["id"],optional:["limit","compact","full","provenance","provenanceSummary","harness","agentInstance","provenanceFilter","diff","verify","field","strictExit","failOnWarn","format"]},"history-redact":{required:["id"],optional:["literal","regex","replacement","dryRun",...l],anyOfRequired:[["literal"],["regex"]]},"history-repair":{optional:["id","all","dryRun","normalizeProvenance",...l],oneOfRequired:[["id"],["all"]]},"history-author-acknowledge":{required:["attributedAuthor","reviewer","reason"],optional:["historyEvent","allActionable"],oneOfRequired:[["historyEvent"],["allActionable"]]},"history-compact":{optional:["id","before","ids","allOver","closed","allStreams","minEntries","dryRun",...l]},schema:{required:["subcommand"],optional:["name","description","defaultStatus","folder","alias","role","order","fieldType","commands","cliFlag","required","requiredOnCreate","allowUnset","requiredTypes","typePreset","infer","minCount","apply","to","migrationId","fieldTypeScope","dryRun","author","force"],conditionalRequired:[{property:"subcommand",value:"show",required:["name"]},{property:"subcommand",value:"show-status",required:["name"]},{property:"subcommand",value:"add-type",required:["name"]},{property:"subcommand",value:"remove-type",required:["name"]},{property:"subcommand",value:"add-status",required:["name"]},{property:"subcommand",value:"remove-status",required:["name"]},{property:"subcommand",value:"add-field",required:["name"]},{property:"subcommand",value:"remove-field",required:["name"]},{property:"subcommand",value:"show-field",required:["name"]},{property:"subcommand",value:"rename-type",required:["name","to"]},{property:"subcommand",value:"rename-field",required:["name","to"]},{property:"subcommand",value:"remap-status",required:["name","to"]},{property:"subcommand",value:"apply-preset",required:["typePreset"]}]},profile:{required:["subcommand"],optional:["name","dryRun","author","force"],conditionalRequired:[{property:"subcommand",value:"show",required:["name"]},{property:"subcommand",value:"apply",required:["name"]},{property:"subcommand",value:"lint",required:["name"]}]},plan:{required:["subcommand"],optional:["id","stepRef","reorderTo","title","description","template","scope","parent","related","blocks","blockedBy","harness","mode","resumeContext","tags","priority",...ke,"body","claim","fromSearch","stepTitle","step","stepBody","stepOwner","stepStatus","stepEvidence","stepBlockedReason","stepReplacement","dependsOn","link","linkKind","linkNote","promoteToItemDep","allowMultipleActive","file","test","doc","decisionText","decision","decisionRationale","decisionEvidence","discoveryText","discovery","validationText","validation","validationCommand","validationExpected","depth","fields","steps","materializeType","materializeParent","materializeTags","field",...l]},activity:{optional:Re},restore:{required:["id","target"],optional:l},update:{required:["id"],optional:ae,mutuallyExclusive:[["acceptanceCriteria","addAc"],["acceptanceCriteria","removeAc"]]},"update-many":{optional:_e,mutuallyExclusive:[["acceptanceCriteria","addAc"],["acceptanceCriteria","removeAc"]]},close:{required:["id"],optional:[...Pe,...l]},"close-many":{optional:Ae},delete:{required:["id"],optional:["dryRun",...l]},append:{required:["id","body"],optional:l},comments:{required:["id"],optional:["text","add","stdin","edit","delete","limit","full",...l]},notes:{required:["id"],optional:["text","add","addJson","stdin","edit","delete","limit","since","eventType","includeMeta","full",...l],mutuallyExclusive:[["addJson","add"],["addJson","stdin"],["addJson","file"],["addJson","edit"],["addJson","delete"]]},learnings:{required:["id"],optional:["text","add","stdin","edit","delete","limit","full",...l]},files:{required:[],optional:["id","add","addGlob","remove","migrate","list","addNote","discover","apply","discoveryNote","appendStable","validatePaths","lookupPath","scope","limit","offset","noTruncate","strictRead","explain","lines","decisionDepth",...l],anyOfRequired:[["id"],["lookupPath"]],dependentAnyOfRequired:[{property:"addNote",anyOfRequired:[["add"],["addGlob"]]}]},docs:{required:["id"],optional:["add","addGlob","remove","migrate","addNote","list","validatePaths",...l],dependentAnyOfRequired:[{property:"addNote",anyOfRequired:[["add"],["addGlob"]]}]},deps:{required:["id"],optional:["format","maxDepth","collapse","summary","full","nodeLimit","edgeLimit","tokenBudget","cursor","direction","kind"]},graph:{required:["subcommand"],optional:["id","target","kind","maxDepth","limit","after","direction","maxPaths","sample","exemptIsolate","exemptIsolateType","saveBaseline","rebuild","clear","summary","full"]},test:{required:["id"],optional:["add","addJson","remove","removeIndex","run","match","onlyIndex","onlyLast","background","timeout","progress","envSet","envClear","sharedHostSafe","pmContext","overrideLinkedPmContext","failOnContextMismatch","failOnSkipped","failOnEmptyTestRun","requireAssertionsForPm","checkContext","autoPmContext","measure","metricBelow","metricDiff",...l]},"test-all":{optional:["status","limit","offset","background","timeout","progress","envSet","envClear","sharedHostSafe","pmContext","overrideLinkedPmContext","failOnContextMismatch","failOnSkipped","failOnEmptyTestRun","requireAssertionsForPm","checkContext","autoPmContext"]},telemetry:{optional:["subcommand","limit"]},"test-runs-list":{optional:["status","limit"]},"test-runs-status":{required:["runId"]},"test-runs-logs":{required:["runId"],optional:["stream","tail"]},"test-runs-stop":{required:["runId"],optional:["force"]},"test-runs-resume":{required:["runId"],optional:["author"]},stats:{optional:["includeEmpty","storage","metadataCoverage","fieldUtilization","byAssignee","byTag","byPriority","tagPrefix","measurements","metric","measurementLimit","observe","improvementDirection","measurementSource","measurementItem","measurementRevision","author","message","provenanceCoverage","fleetAttribution","since","eventLimit","minimumSample"]},duplicates:{optional:["status","since","threshold","limit"]},health:{optional:["strictDirectories","requireMergeDrivers","strictExit","failOnWarn","checkOnly","checkTelemetry","noRefresh","refreshVectors","verboseStaleItems","verboseAuthorEvents","brief","summary","skipVectors","skipIntegrity","skipDrift","full"]},validate:{optional:["checkStorageIntegrity","checkMetadata","metadataProfile","checkResolution","checkLifecycle","checkStaleBlockers","dependencyCycleSeverity","parentCycleSeverity","checkFiles","scanMode","includePmInternals","verboseFileLists","verboseDiagnostics","allAffectedIds","strictExit","failOnWarn","fixHints","autoFix","dryRun","fixScope","pruneMissing","checkHistoryDrift","checkCommandReferences","counts","full"]},assurance:{required:["subcommand"],optional:["kind","id","definition","trigger","treeId","gate","limit","dryRun","author","message","preset","owner","apply","enforcement"],conditionalRequired:[{property:"subcommand",value:"list",required:["kind"]},{property:"subcommand",value:"show",required:["kind","id"]},{property:"subcommand",value:"put",required:["kind","id","definition"]},{property:"subcommand",value:"remove",required:["kind","id"]},{property:"subcommand",value:"run",required:["id","trigger"]},{property:"subcommand",value:"apply",required:["preset","owner"]},{property:"subcommand",value:"derive",required:["owner"]},{property:"subcommand",value:"promote",required:["id","enforcement"]}]},gc:{optional:["dryRun","gcScope"]},contracts:{optional:["contractAction","command","summary","schemaOnly","flagsOnly","availabilityOnly","runtimeOnly","activeOnly","full"],mutuallyExclusiveWhen:Ee},completion:{required:["shell"],optional:["eagerTags"]},claim:{optional:["id","next","ifAvailable","maxAttempts","includeDecisions",...Q,...g],oneOfRequired:[["id"],["next"]]},release:{required:["id"],optional:g},"start-task":{required:["id"],optional:g},"pause-task":{required:["id"],optional:g},"close-task":{required:["id"],optional:["text","validateClose",...g]}},ut=Object.freeze(Object.fromEntries(h.map(e=>[e,f[e]])));function re(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]/g," ").trim().replace(/^./,t=>t.toUpperCase()).concat(".")}function ie(e,t){let a=typeof t=="object"&&t!==null?{...t}:{},r=m[e];return{...a,description:r?.description??re(e),...r?.examples?{examples:r.examples}:{}}}function Ie(e,t){if(e==="plan"&&Object.prototype.hasOwnProperty.call(k,t))return k[t];let a=Z[e];return a&&Object.prototype.hasOwnProperty.call(a,t)?a[t]:m[t]}function ne(e,t,a){let r=typeof a=="object"&&a!==null?{...a}:{},i=Ie(e,t);return{...r,description:i?.description??re(t),...i?.examples?{examples:i.examples}:{}}}function Ne(e,t){let a=J[e];return a&&Object.prototype.hasOwnProperty.call(a,t)?a[t]:e==="plan"&&Object.prototype.hasOwnProperty.call(O,t)?O[t]:(e==="get"||e==="history"||e==="search")&&t==="format"?{type:"string",enum:["json","toon"]}:y[t]}function Le(e,t){let a={action:{const:e,description:m.action?.description??"Tool action to execute."}};for(let r of t){if(r==="action")continue;let i=Ne(e,r);i&&(a[r]=ne(e,r,i))}return a}function Me(e,t){let a=t.flat();return t.map(r=>{let i=a.filter(n=>!r.includes(n));return{required:[...r],...i.length>0?{not:{anyOf:i.map(n=>({required:[n]}))}}:{},...e==="history-repair"&&r.includes("all")?{properties:{all:{const:!0}}}:e==="claim"&&r.includes("next")?{properties:{next:{const:!0}}}:{}}})}function qe(e){let t=[];if(e.conditionalRequired&&e.conditionalRequired.length>0)for(let a of e.conditionalRequired)t.push({if:{properties:{[a.property]:{const:a.value}},required:[a.property]},then:{required:a.required}});if(e.dependentAnyOfRequired&&e.dependentAnyOfRequired.length>0)for(let a of e.dependentAnyOfRequired)t.push({if:{required:[a.property]},then:{anyOf:a.anyOfRequired.map(r=>({required:[...r]}))}});if(e.mutuallyExclusive&&e.mutuallyExclusive.length>0)for(let a of e.mutuallyExclusive)t.push({not:{required:p(a)}});if(e.mutuallyExclusiveWhen&&e.mutuallyExclusiveWhen.length>0)for(let a of e.mutuallyExclusiveWhen)t.push({not:{allOf:a.map(r=>({properties:{[r.property]:r.schema},required:[r.property]}))}});return t}function De(e){if(!Object.prototype.hasOwnProperty.call(f,e))return;let t=f[e],a=Oe[e]??[];return p(["action",...be,...I(e)!==void 0?ve:[],...a,...t.required??[],...t.optional??[]])}function T(e){let t=f[e],a=p(t.required??[]),r=De(e),i={type:"object",additionalProperties:!1,required:["action",...a],title:`pm action "${e}" parameters`,properties:Le(e,r)};t.anyOfRequired&&t.anyOfRequired.length>0&&(i.anyOf=t.anyOfRequired.map(s=>({required:[...s]}))),t.oneOfRequired&&t.oneOfRequired.length>0&&(i.oneOf=Me(e,t.oneOfRequired));let n=qe(t);return n.length>0&&(i.allOf=n),i}function yt(e,t={}){let a=T(e),r={...a.properties};delete r.action;let i=[...a.anyOf??[],...a.oneOf??[]],n=(t.required??a.required.map(String)).filter(u=>u==="action"?!1:t.required===void 0?!0:!i.some(b=>b.required?.map(String).includes(u))),s={type:"object",additionalProperties:t.additionalProperties??!0,properties:{...r,options:{type:"object",additionalProperties:!0,description:"Advanced command options forwarded to the selected pm action."},...t.properties},required:n};return a.anyOf!==void 0&&(s.anyOf=a.anyOf),a.oneOf!==void 0&&(s.oneOf=a.oneOf),a.allOf!==void 0&&(s.allOf=a.allOf),s}function oe(e){let t,a=()=>t??=e();return new Proxy({},{get:(r,i)=>a()[i],has:(r,i)=>i in a(),ownKeys:()=>Reflect.ownKeys(a()),getOwnPropertyDescriptor:(r,i)=>{let n=Reflect.getOwnPropertyDescriptor(a(),i);return n&&(n.configurable=!0),n}})}var se="4.7.0",Fe=se.split(".")[0],je="1.3.0",gt=oe(()=>({$schema:"https://json-schema.org/draft/2020-12/schema",$id:`https://schema.unbrained.dev/pm-cli/tool-parameters-v${Fe}.schema.json`,title:"pm-cli tool parameters (action-scoped strict schema)","x-schema-version":se,type:"object",oneOf:h.map(e=>T(e))}));function le(e,t){let a=ie(e,t);if(typeof a.type=="string")return a;let i=(Array.isArray(a.anyOf)?a.anyOf:[]).find(u=>typeof u.type=="string");if(i){let{anyOf:u,...b}=a;return{...i,...b}}let{anyOf:n,...s}=a;return{...s,type:"string"}}function pe(){let e={action:{type:"string",description:m.action?.description??"Tool action to execute."},options:{type:"object",additionalProperties:!0,description:"Advanced command options object forwarded to the selected pm action."}};for(let t of Object.keys(y).sort())e[t]=le(t,y[t]);return{title:"pm-cli tool parameters (provider-compatible flat schema)","x-schema-version":je,type:"object",additionalProperties:!1,required:["action"],properties:e}}var ft=oe(pe),ht={buildActionScopedToolSchema:T,buildProviderCompatibleToolSchema:pe,decorateActionScopedToolParameterDefinition:ne,decorateToolParameterDefinition:ie,toolActionSchemaContracts:f,toolParameterMetadata:m,toProviderCompatibleParameterDefinition:le,toUniqueFlagContracts:P,withFlagAliasMetadata:w};export{Be as a,We as b,Ue as c,He as d,ze as e,Ge as f,Ke as g,Ve as h,Ye as i,D as j,F as k,j as l,ye as m,x as n,ge as o,B as p,fe as q,W as r,U as s,H as t,z as u,Je as v,G as w,K as x,Ze as y,Xe as z,xe as A,ct as B,ke as C,Pe as D,ut as E,De as F,yt as G,se as H,Fe as I,je as J,gt as K,ft as L,ht as M};
2
+ //# sourceMappingURL=chunk-4X57RE4U.js.map
@@ -1,4 +1,4 @@
1
- import{$ as At,Ea as Ct,Ka as vt,V as R,Ya as se,Za as M,_ as It,_a as ae,db as ce,hb as Ue,ia as K,l as Pe,lb as Ve,na as ze,o as ie,oa as $e,ob as qe,pb as je,qa as Fe,rb as de}from"./chunk-PGXJQLCT.js";import{F as U,L as oe,N as Re,O as Me,P as ke,Q as St,Ra as Oe,U as g,W,X as V,Y as b,_ as xt,a as Le,p as F,r as G,s as S,t as T,v as ne}from"./chunk-K7RWWOAG.js";import{R as De,Y as f,Z as m,ba as Ne}from"./chunk-Q4YY3XNF.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]="b9581c92-5e8a-589d-9681-d4d014e6902b")}catch{}})();function en(e,t="--limit"){if(e===void 0)return;let r=Number(e);if(!Number.isFinite(r)||r<0)throw new m(`${t} must be a non-negative number`,f.USAGE);return Math.floor(r)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="7775a1f2-5167-5853-a2c5-a44d46f8e80e")}catch{}})();var tn=/\b(?:gh[pousr]_[A-Za-z0-9]{20,}|github_pat_[A-Za-z0-9_]{20,})\b/,rn=/\bnpm_[A-Za-z0-9]{36}\b/,nn=/\bxox[baprs]-(?=[A-Za-z0-9-]{20,80}\b)(?=[A-Za-z0-9-]*\d)[A-Za-z0-9-]{20,80}\b/,on=/-----BEGIN (?:[A-Z0-9]+ )?PRIVATE KEY-----/,sn=/\b(?:AKIA|ASIA)[A-Z0-9]{16}\b/,Lt=/\b(?:token|secret|password|passwd|api[_-]?key)\s*[:=]\s*["']?([A-Za-z0-9+/=_-]{24,})/gi,an=[{action:"append",history_scope:"item"},{action:"claim",history_scope:"item"},{action:"close",history_scope:"item"},{action:"close-many",history_scope:"item"},{action:"close-task",history_scope:"item"},{action:"comments",history_scope:"conditional"},{action:"config",history_scope:"conditional"},{action:"copy",history_scope:"item"},{action:"create",history_scope:"item"},{action:"delete",history_scope:"item"},{action:"deps",history_scope:"conditional"},{action:"discover",history_scope:"item"},{action:"docs",history_scope:"conditional"},{action:"files",history_scope:"conditional"},{action:"focus",history_scope:"conditional"},{action:"gc",history_scope:"conditional"},{action:"history-compact",history_scope:"history"},{action:"history-author-acknowledge",history_scope:"workspace"},{action:"history-redact",history_scope:"history"},{action:"history-repair",history_scope:"history"},{action:"init",history_scope:"workspace"},{action:"install",history_scope:"conditional"},{action:"learnings",history_scope:"conditional"},{action:"notes",history_scope:"conditional"},{action:"package",history_scope:"conditional"},{action:"pause-task",history_scope:"item"},{action:"plan",history_scope:"conditional"},{action:"profile",history_scope:"conditional"},{action:"release",history_scope:"item"},{action:"restore",history_scope:"item"},{action:"schema",history_scope:"conditional"},{action:"start-task",history_scope:"item"},{action:"templates",history_scope:"conditional"},{action:"test",history_scope:"conditional"},{action:"test-all",history_scope:"conditional"},{action:"update",history_scope:"item"},{action:"update-many",history_scope:"item"},{action:"upgrade",history_scope:"conditional"}],Ye=new Map(an.map(e=>[e.action,e]));function cn(e){let t=new Map;for(let n of e)t.set(n,(t.get(n)??0)+1);let r=0;for(let n of t.values()){let o=n/e.length;r-=o*Math.log2(o)}return r}function He(e,t="$",r=new WeakSet){return typeof e=="string"?[{path:t,value:e}]:typeof e!="object"||e===null?[]:r.has(e)?[]:(r.add(e),Array.isArray(e)?e.flatMap((n,o)=>He(n,`${t}[${o}]`,r)):Object.entries(e).flatMap(([n,o])=>He(o,`${t}.${n}`,r)))}function Dt(e){let t=[];for(let r of He(e)){tn.test(r.value)&&t.push({rule:"github_token",path:r.path}),rn.test(r.value)&&t.push({rule:"npm_token",path:r.path}),nn.test(r.value)&&t.push({rule:"slack_token",path:r.path}),on.test(r.value)&&t.push({rule:"private_key",path:r.path}),sn.test(r.value)&&t.push({rule:"aws_access_key",path:r.path}),Lt.lastIndex=0;for(let n of r.value.matchAll(Lt)){let o=n[1];if(cn(o)>=3.5){t.push({rule:"high_entropy_assignment",path:r.path});break}}}return t.filter((r,n,o)=>o.findIndex(i=>i.rule===r.rule&&i.path===r.path)===n)}function dn(e){let t=e.author.trim()||"unknown";if(e.settings.require_attributed_author&&t.toLowerCase()==="unknown")throw new m("Mutation author is required by workspace policy.",f.USAGE,{code:"mutation_author_required",required:"Pass --author <id>, set PM_AUTHOR, or configure author_default.",nextSteps:["Retry with --author <stable-agent-id>.","Set PM_AUTHOR for this agent session."]});if(e.settings.secret_guard==="off")return{author:t,findings:[],warnings:[],override_applied:!1};let r;try{r=Dt(e.payload)}catch{return{author:t,findings:[],warnings:["secret_guard_scan_failed_open"],override_applied:!1}}if(r.length===0)return{author:t,findings:r,warnings:[],override_applied:!1};let n=[...new Set(r.map(o=>o.rule))].sort().join(",");if(e.settings.secret_guard==="block"&&e.force!==!0)throw new m(`Mutation blocked by secret guard (${n}). No detected value was logged.`,f.CONFLICT,{code:"mutation_secret_guard_blocked",required:"Remove the credential-shaped content or retry with --force after explicit review.",nextSteps:["Replace the value with a secret-manager reference.","Use pm history-redact if equivalent content already entered history."],recovery:{recovery_mode:"compact",attempted_command:"pm <mutation> [REDACTED]",normalized_args:["[REDACTED]"],suggested_retry:"Remove credential-shaped content, then retry the mutation."}});return{author:t,findings:r,warnings:[`secret_guard_detected:${r.length}:rules=${n}`,...e.settings.secret_guard==="block"&&e.force===!0?["secret_guard_force_override"]:[]],override_applied:e.settings.secret_guard==="block"&&e.force===!0}}function ln(e){return Ye.has(e.trim().toLowerCase())}function un(){return[...Ye.keys()].sort((e,t)=>e.localeCompare(t))}function la(e){return Ye.get(e.trim().toLowerCase())}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="3ad30a32-0f83-5473-b0a3-349e271d8378")}catch{}})();function fn(e){return e.trim().toLowerCase().replace(/\s+/g," ")}function fa(e){return fn(e).split(/[^a-z0-9]+/).filter(t=>t.length>0)}function Q(e,t){if(e.length===0&&t.length===0)return 1;if(e.length===0||t.length===0)return 0;let r=new Set(e),n=new Set(t),o=0;for(let s of r)n.has(s)&&(o+=1);let i=new Set([...r,...n]).size;return o/i}(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]="dff9b113-2b29-5154-afbf-f191f2f556a6")}catch{}})();var mn=/\b[a-z][a-z0-9]*-\d+(?:-[a-z0-9]+)*\b/giu;function le(e){return e.trim().toLowerCase().replace(/\s+/g," ")}function J(e){return[...new Set(le(e).match(/[\p{L}\p{N}]+/gu)??[])]}function X(e){let t=le(e);return{normalized:t,tokens:J(t),issueCodes:[...new Set(t.match(mn)?.map(r=>r.toLowerCase())??[])]}}function ue(e,t){return fe(X(e),X(t))}function fe(e,t){if(e.normalized===t.normalized)return{score:1,reason:"exact_title"};let r=new Set(e.issueCodes);return t.issueCodes.some(n=>r.has(n))?{score:.99,reason:"issue_code"}:{score:Q(e.tokens,t.tokens),reason:"title_token_jaccard"}}import pn from"node:path";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="376bb9d2-e202-57e7-86c8-d70a7d3fa7ab")}catch{}})();function me(e){return(e??"in_progress").trim().toLowerCase().replaceAll("-","_")}function _n(e,t){return[e.updated_at,t].map(n=>({value:n,time:Date.parse(n??"")})).filter(n=>typeof n.value=="string"&&Number.isFinite(n.time)).sort((n,o)=>o.time-n.time)[0]?.value??e.updated_at}function Rt(e,t){let r=Math.max(1,Math.trunc(t.threshold_hours)),n=(t.now??new Date).getTime(),o=me(t.in_progress_status),i=[];for(let s of e){if(me(String(s.status))!==o||(s.assignee?.trim().length??0)>0)continue;let a=_n(s,t.last_history_activity?.(s)),c=Date.parse(a);if(!Number.isFinite(c))continue;let d=Math.max(0,Math.floor((n-c)/36e5));d>=r&&i.push({id:s.id,last_activity_at:a,age_hours:d})}return i.sort((s,a)=>a.age_hours-s.age_hours||s.id.localeCompare(a.id)),{threshold_hours:r,count:i.length,items:i,remediation:"Claim active work with `pm claim <id>` or return abandoned work to open with `pm update <id> --status open`."}}async function hn(e,t,r){let n=new Map;return await Promise.all(t.filter(o=>me(String(o.status))===me(r.in_progress_status)&&(o.assignee?.trim().length??0)===0).map(async o=>{let i;try{i=await Fe(pn.join(e,"history",`${o.id}.jsonl`),o.id)}catch{return}let s=i.map(a=>a.ts).filter(a=>Number.isFinite(Date.parse(a))).sort((a,c)=>Date.parse(c)-Date.parse(a))[0];s&&n.set(o.id,s)})),Rt(t,{...r,last_history_activity:o=>n.get(o.id)})}import{mkdir as gn,readFile as yn}from"node:fs/promises";import Mt from"node:path";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="71a8cd89-54fc-5f8a-b93b-9e4a79bb34b6")}catch{}})();function wn(e){let t=e.trim();if(!t)throw new m("--rollback requires a non-empty checkpoint ID",f.USAGE);if(!/^[a-zA-Z0-9._-]+$/.test(t))throw new m("--rollback checkpoint ID must match [a-zA-Z0-9._-]+",f.USAGE);return t}function En(e,t){let r=t.replace(/[-:.TZ]/g,"").slice(0,14),n=Math.random().toString(36).slice(2,8);return`${e}-${r}-${n}`}function kt(e,t){return Mt.join(e,"checkpoints",t)}function Nt(e,t,r){return Mt.join(kt(e,t),`${r}.json`)}async function bn(e,t,r,n){let o=kt(e,t);await gn(o,{recursive:!0});let i=Nt(e,t,r);return await T(i,`${JSON.stringify(n,null,2)}
1
+ import{$ as At,$a as ae,Ea as Ct,Ka as vt,V as R,Za as se,_ as It,_a as M,eb as ce,ia as K,ib as Ue,l as Pe,mb as Ve,na as ze,o as ie,oa as $e,pb as qe,qa as Fe,qb as je,sb as de}from"./chunk-QLNMCESQ.js";import{F as U,L as oe,N as Re,O as Me,P as ke,Q as St,Ra as Oe,U as g,W,X as V,Y as b,_ as xt,a as Le,p as F,r as G,s as S,t as T,v as ne}from"./chunk-KT5XMYSX.js";import{R as De,Y as f,Z as m,ba as Ne}from"./chunk-OKA6ELTL.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]="b9581c92-5e8a-589d-9681-d4d014e6902b")}catch{}})();function en(e,t="--limit"){if(e===void 0)return;let r=Number(e);if(!Number.isFinite(r)||r<0)throw new m(`${t} must be a non-negative number`,f.USAGE);return Math.floor(r)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="7775a1f2-5167-5853-a2c5-a44d46f8e80e")}catch{}})();var tn=/\b(?:gh[pousr]_[A-Za-z0-9]{20,}|github_pat_[A-Za-z0-9_]{20,})\b/,rn=/\bnpm_[A-Za-z0-9]{36}\b/,nn=/\bxox[baprs]-(?=[A-Za-z0-9-]{20,80}\b)(?=[A-Za-z0-9-]*\d)[A-Za-z0-9-]{20,80}\b/,on=/-----BEGIN (?:[A-Z0-9]+ )?PRIVATE KEY-----/,sn=/\b(?:AKIA|ASIA)[A-Z0-9]{16}\b/,Lt=/\b(?:token|secret|password|passwd|api[_-]?key)\s*[:=]\s*["']?([A-Za-z0-9+/=_-]{24,})/gi,an=[{action:"append",history_scope:"item"},{action:"claim",history_scope:"item"},{action:"close",history_scope:"item"},{action:"close-many",history_scope:"item"},{action:"close-task",history_scope:"item"},{action:"comments",history_scope:"conditional"},{action:"config",history_scope:"conditional"},{action:"copy",history_scope:"item"},{action:"create",history_scope:"item"},{action:"delete",history_scope:"item"},{action:"deps",history_scope:"conditional"},{action:"discover",history_scope:"item"},{action:"docs",history_scope:"conditional"},{action:"files",history_scope:"conditional"},{action:"focus",history_scope:"conditional"},{action:"gc",history_scope:"conditional"},{action:"history-compact",history_scope:"history"},{action:"history-author-acknowledge",history_scope:"workspace"},{action:"history-redact",history_scope:"history"},{action:"history-repair",history_scope:"history"},{action:"init",history_scope:"workspace"},{action:"install",history_scope:"conditional"},{action:"learnings",history_scope:"conditional"},{action:"notes",history_scope:"conditional"},{action:"package",history_scope:"conditional"},{action:"pause-task",history_scope:"item"},{action:"plan",history_scope:"conditional"},{action:"profile",history_scope:"conditional"},{action:"release",history_scope:"item"},{action:"restore",history_scope:"item"},{action:"schema",history_scope:"conditional"},{action:"start-task",history_scope:"item"},{action:"templates",history_scope:"conditional"},{action:"test",history_scope:"conditional"},{action:"test-all",history_scope:"conditional"},{action:"update",history_scope:"item"},{action:"update-many",history_scope:"item"},{action:"upgrade",history_scope:"conditional"}],Ye=new Map(an.map(e=>[e.action,e]));function cn(e){let t=new Map;for(let n of e)t.set(n,(t.get(n)??0)+1);let r=0;for(let n of t.values()){let o=n/e.length;r-=o*Math.log2(o)}return r}function He(e,t="$",r=new WeakSet){return typeof e=="string"?[{path:t,value:e}]:typeof e!="object"||e===null?[]:r.has(e)?[]:(r.add(e),Array.isArray(e)?e.flatMap((n,o)=>He(n,`${t}[${o}]`,r)):Object.entries(e).flatMap(([n,o])=>He(o,`${t}.${n}`,r)))}function Dt(e){let t=[];for(let r of He(e)){tn.test(r.value)&&t.push({rule:"github_token",path:r.path}),rn.test(r.value)&&t.push({rule:"npm_token",path:r.path}),nn.test(r.value)&&t.push({rule:"slack_token",path:r.path}),on.test(r.value)&&t.push({rule:"private_key",path:r.path}),sn.test(r.value)&&t.push({rule:"aws_access_key",path:r.path}),Lt.lastIndex=0;for(let n of r.value.matchAll(Lt)){let o=n[1];if(cn(o)>=3.5){t.push({rule:"high_entropy_assignment",path:r.path});break}}}return t.filter((r,n,o)=>o.findIndex(i=>i.rule===r.rule&&i.path===r.path)===n)}function dn(e){let t=e.author.trim()||"unknown";if(e.settings.require_attributed_author&&t.toLowerCase()==="unknown")throw new m("Mutation author is required by workspace policy.",f.USAGE,{code:"mutation_author_required",required:"Pass --author <id>, set PM_AUTHOR, or configure author_default.",nextSteps:["Retry with --author <stable-agent-id>.","Set PM_AUTHOR for this agent session."]});if(e.settings.secret_guard==="off")return{author:t,findings:[],warnings:[],override_applied:!1};let r;try{r=Dt(e.payload)}catch{return{author:t,findings:[],warnings:["secret_guard_scan_failed_open"],override_applied:!1}}if(r.length===0)return{author:t,findings:r,warnings:[],override_applied:!1};let n=[...new Set(r.map(o=>o.rule))].sort().join(",");if(e.settings.secret_guard==="block"&&e.force!==!0)throw new m(`Mutation blocked by secret guard (${n}). No detected value was logged.`,f.CONFLICT,{code:"mutation_secret_guard_blocked",required:"Remove the credential-shaped content or retry with --force after explicit review.",nextSteps:["Replace the value with a secret-manager reference.","Use pm history-redact if equivalent content already entered history."],recovery:{recovery_mode:"compact",attempted_command:"pm <mutation> [REDACTED]",normalized_args:["[REDACTED]"],suggested_retry:"Remove credential-shaped content, then retry the mutation."}});return{author:t,findings:r,warnings:[`secret_guard_detected:${r.length}:rules=${n}`,...e.settings.secret_guard==="block"&&e.force===!0?["secret_guard_force_override"]:[]],override_applied:e.settings.secret_guard==="block"&&e.force===!0}}function ln(e){return Ye.has(e.trim().toLowerCase())}function un(){return[...Ye.keys()].sort((e,t)=>e.localeCompare(t))}function la(e){return Ye.get(e.trim().toLowerCase())}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="3ad30a32-0f83-5473-b0a3-349e271d8378")}catch{}})();function fn(e){return e.trim().toLowerCase().replace(/\s+/g," ")}function fa(e){return fn(e).split(/[^a-z0-9]+/).filter(t=>t.length>0)}function Q(e,t){if(e.length===0&&t.length===0)return 1;if(e.length===0||t.length===0)return 0;let r=new Set(e),n=new Set(t),o=0;for(let s of r)n.has(s)&&(o+=1);let i=new Set([...r,...n]).size;return o/i}(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]="dff9b113-2b29-5154-afbf-f191f2f556a6")}catch{}})();var mn=/\b[a-z][a-z0-9]*-\d+(?:-[a-z0-9]+)*\b/giu;function le(e){return e.trim().toLowerCase().replace(/\s+/g," ")}function J(e){return[...new Set(le(e).match(/[\p{L}\p{N}]+/gu)??[])]}function X(e){let t=le(e);return{normalized:t,tokens:J(t),issueCodes:[...new Set(t.match(mn)?.map(r=>r.toLowerCase())??[])]}}function ue(e,t){return fe(X(e),X(t))}function fe(e,t){if(e.normalized===t.normalized)return{score:1,reason:"exact_title"};let r=new Set(e.issueCodes);return t.issueCodes.some(n=>r.has(n))?{score:.99,reason:"issue_code"}:{score:Q(e.tokens,t.tokens),reason:"title_token_jaccard"}}import pn from"node:path";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="376bb9d2-e202-57e7-86c8-d70a7d3fa7ab")}catch{}})();function me(e){return(e??"in_progress").trim().toLowerCase().replaceAll("-","_")}function _n(e,t){return[e.updated_at,t].map(n=>({value:n,time:Date.parse(n??"")})).filter(n=>typeof n.value=="string"&&Number.isFinite(n.time)).sort((n,o)=>o.time-n.time)[0]?.value??e.updated_at}function Rt(e,t){let r=Math.max(1,Math.trunc(t.threshold_hours)),n=(t.now??new Date).getTime(),o=me(t.in_progress_status),i=[];for(let s of e){if(me(String(s.status))!==o||(s.assignee?.trim().length??0)>0)continue;let a=_n(s,t.last_history_activity?.(s)),c=Date.parse(a);if(!Number.isFinite(c))continue;let d=Math.max(0,Math.floor((n-c)/36e5));d>=r&&i.push({id:s.id,last_activity_at:a,age_hours:d})}return i.sort((s,a)=>a.age_hours-s.age_hours||s.id.localeCompare(a.id)),{threshold_hours:r,count:i.length,items:i,remediation:"Claim active work with `pm claim <id>` or return abandoned work to open with `pm update <id> --status open`."}}async function hn(e,t,r){let n=new Map;return await Promise.all(t.filter(o=>me(String(o.status))===me(r.in_progress_status)&&(o.assignee?.trim().length??0)===0).map(async o=>{let i;try{i=await Fe(pn.join(e,"history",`${o.id}.jsonl`),o.id)}catch{return}let s=i.map(a=>a.ts).filter(a=>Number.isFinite(Date.parse(a))).sort((a,c)=>Date.parse(c)-Date.parse(a))[0];s&&n.set(o.id,s)})),Rt(t,{...r,last_history_activity:o=>n.get(o.id)})}import{mkdir as gn,readFile as yn}from"node:fs/promises";import Mt from"node:path";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="71a8cd89-54fc-5f8a-b93b-9e4a79bb34b6")}catch{}})();function wn(e){let t=e.trim();if(!t)throw new m("--rollback requires a non-empty checkpoint ID",f.USAGE);if(!/^[a-zA-Z0-9._-]+$/.test(t))throw new m("--rollback checkpoint ID must match [a-zA-Z0-9._-]+",f.USAGE);return t}function En(e,t){let r=t.replace(/[-:.TZ]/g,"").slice(0,14),n=Math.random().toString(36).slice(2,8);return`${e}-${r}-${n}`}function kt(e,t){return Mt.join(e,"checkpoints",t)}function Nt(e,t,r){return Mt.join(kt(e,t),`${r}.json`)}async function bn(e,t,r,n){let o=kt(e,t);await gn(o,{recursive:!0});let i=Nt(e,t,r);return await T(i,`${JSON.stringify(n,null,2)}
2
2
  `),i}function Tn(e,t){if(!Array.isArray(e.items))throw new m(`Checkpoint ${t} is missing items`,f.GENERIC_FAILURE);return e.items.map(r=>{if(!r||typeof r!="object")throw new m(`Checkpoint ${t} contains an invalid item entry`,f.GENERIC_FAILURE);let n=r;if(typeof n.id!="string"||n.id.trim().length===0)throw new m(`Checkpoint ${t} contains an item entry without ID`,f.GENERIC_FAILURE);if(typeof n.target_updated_at!="string"||n.target_updated_at.trim().length===0)throw new m(`Checkpoint ${t} contains an item entry without target_updated_at`,f.GENERIC_FAILURE);return{id:n.id.trim(),target_updated_at:n.target_updated_at.trim()}})}async function Sn(e,t,r,n){let o=wn(r),i=Nt(e,t,o);if(!await F(i))throw new m(`Checkpoint ${o} not found`,f.NOT_FOUND);let s=await yn(i,"utf8"),a;try{a=JSON.parse(s)}catch(l){throw new m(`Checkpoint ${o} contains invalid JSON: ${b(l)}`,f.GENERIC_FAILURE)}if(!a||typeof a!="object")throw new m(`Checkpoint ${o} is invalid`,f.GENERIC_FAILURE);let c=a;if(c.schema_version!==n)throw new m(`Checkpoint ${o} has unsupported schema version`,f.GENERIC_FAILURE);let d=Tn(c,o);return{record:c,items:d,path:i,id:typeof c.id=="string"?c.id:o,created_at:typeof c.created_at=="string"?c.created_at:R(),author:typeof c.author=="string"?c.author:"unknown"}}async function xn(e,t){let r=[],n=[];for(let o of e)try{let i=await t(o.id,o.target_updated_at);r.push({id:o.id,status:"restored",changed_fields:i.changed_fields,warnings:i.warnings}),n.push(o.id)}catch(i){r.push({id:o.id,status:"failed",error:b(i)})}return{rows:r,restored_ids:n,failed_count:r.filter(o=>o.status==="failed").length}}(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]="ab276268-7a98-5f97-b3f5-300dfd1b5ed5")}catch{}})();function k(e){if(typeof e!="string")return null;let t=e.trim().toLowerCase();return t.length>0?t:null}function va(e,t){let r=k(t);return!e||!r?null:[...e.assurance_providers??[]].reverse().find(n=>k(n.definition.id)===r)??null}function In(e,t){let r=k(t);return!e||!r?null:[...e.search_providers].reverse().find(o=>(k(o.runtime_definition?.name)??k(o.definition?.name))===r)??null}function An(e,t){let r=k(t);return!e||!r?null:[...e.vector_store_adapters].reverse().find(o=>(k(o.runtime_definition?.name)??k(o.definition?.name))===r)??null}(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]="19ff592c-0746-54e8-a304-2006f4845da2")}catch{}})();function Ot(e){return e.replaceAll("~1","/").replaceAll("~0","~")}function Be(e){if(e==="/body"||e.startsWith("/body/"))return"body";if(e==="/metadata"||e.startsWith("/metadata/")||e==="/front_matter"||e.startsWith("/front_matter/")){let r=e.replace(/^\/(?:metadata|front_matter)\/?/,"").split("/")[0];return r?Ot(r):"metadata"}let t=e.replace(/^\//,"").split("/")[0];return t?Ot(t):"root"}function pe(e,t){return t==="body"?e.body:t==="metadata"?e.metadata:t==="root"?e:e.metadata[t]}function Cn(e,t){let r=t?.windowStartIndex??0,n=t?.field;if(e.length===0||r>=e.length)return[];let o=Ct(),i=[];for(let s=0;s<e.length;s+=1){let a=e[s],c=o,d=vt(o,a.patch),l;d.ok?(l=d.document,o=l):l=c;let u=new Set;for(let p of a.patch)u.add(Be(p.path)),p.from!==void 0&&u.add(Be(p.from));let _=[...u].sort((p,h)=>p.localeCompare(h));if(s>=r)if(n!==void 0){if(!u.has(n))continue;let p={field:n,before:pe(c,n),after:pe(l,n)};i.push({index:s+1,ts:a.ts,op:a.op,author:a.author,patch_ops:a.patch.length,changed_fields:[n],changes:[p]})}else{let p=_.map(h=>({field:h,before:pe(c,h),after:pe(l,h)}));i.push({index:s+1,ts:a.ts,op:a.op,author:a.author,patch_ops:a.patch.length,changed_fields:_,changes:p})}}return i}(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]="7426082f-94a6-5b4e-9748-d3faab2fe1d4")}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]="4a376062-2e23-5991-80a5-27183909caf3")}catch{}})();var vn=new Set(["none","null","undefined"]);function $a(e){let t=e?.trim().toLowerCase().replaceAll("-","_");if(t==="warn"||t==="strict_error")return t;if(t==="strict")return"strict_error";throw new m("Config set parent-reference-policy requires --policy with one of: warn, strict_error (alias: strict)",f.USAGE)}function Ln(e){if(typeof e!="string")throw new m("--parent must be a string. Use --unset parent to clear this field.",f.USAGE);let t=e.trim();if(t.length===0)throw new m("--parent must not be empty. Use --parent none to unset.",f.USAGE);if(Pt(t))throw new m(`--parent must not use placeholder token "${t}". Use --unset parent to clear this field.`,f.USAGE);return t}function Pt(e){return vn.has(e.trim().toLowerCase())}function Dn(e,t){if(t==="strict_error")throw new m(`Parent item "${e}" was not found. Create it first or use --parent none.`,f.USAGE);return{warnings:[`validation_warning:parent_reference_missing:${e}`]}}function Rn(e,t,r){let n=ce(e,r),o=ce(t,r);if(n!==o)return;let i=t!==o||e!==n?` (normalized from parent "${t}" and item "${e}")`:"";throw new m(`Parent item "${o}" cannot be the same as item "${n}"${i}. Use --unset parent to clear this field.`,f.USAGE)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="d5003dd5-f208-5734-9711-dff935d8c851")}catch{}})();var q="-",zt=new Set(["actual_result","body","cmd","command","customer_impact","description","environment","expected_result","impact","location","message","note","outcome","repro_steps","resolution","text","title","unblock_note","value","why_now"]);function $t(e){let t=e.trim();if(t==="")return[];let n=(Pn(t)??t.split(",")).map(o=>o.trim()).filter(Boolean).map(o=>o.toLowerCase());return Array.from(new Set(n)).sort((o,i)=>o.localeCompare(i))}function Ft(e){if(!Array.isArray(e)||e.length===0)return[];let t=[];for(let r of e)if(typeof r=="string")for(let n of $t(r))t.push(n);return Array.from(new Set(t)).sort((r,n)=>r.localeCompare(n))}function Ut(e){return Array.isArray(e)?e.filter(t=>typeof t=="string").map(t=>t.trim().toLowerCase()).filter(Boolean):[]}function Mn(e){return typeof e!="string"?[]:e.split(";").map(t=>t.trim()).filter(Boolean)}function kn(e,t,r){let n=e.map(s=>s.trim()).filter(Boolean);for(let s of t??[]){let a=s.trim();if(a.includes(";"))throw new m('Acceptance criteria added with --add-ac cannot contain ";" because semicolons delimit stored criteria',f.USAGE,{code:"acceptance_criteria_semicolon_forbidden",required:"Pass one semicolon-free criterion per --add-ac value",why:"A semicolon inside one criterion would be re-read as multiple criteria",nextSteps:["Split the text into repeated --add-ac values, or replace the semicolon with punctuation that is not the storage delimiter"]});a.length>0&&!n.includes(a)&&n.push(a)}let o=[],i=n;for(let s of r??[]){let a=s.trim();if(a.length!==0){if(!i.includes(a)){o.push(a);continue}i=i.filter(c=>c!==a)}}return{criteria:i,unmatchedRemovals:o}}function Nn(e,t){let r=Ut(e);if(!t||t.length===0)return Array.from(new Set(r)).sort((o,i)=>o.localeCompare(i));let n=new Set(r);for(let o of Ft(t))n.add(o);return Array.from(n).sort((o,i)=>o.localeCompare(i))}function On(e,t){let r=Array.from(new Set(Ut(e))).sort((o,i)=>o.localeCompare(i));if(!t||t.length===0)return r;let n=new Set(Ft(t));return n.size===0?r:r.filter(o=>!n.has(o))}function Pn(e){if(!e.startsWith("["))return null;let t;try{t=JSON.parse(e)}catch{return null}return t.map(n=>typeof n=="string"||typeof n=="number"||typeof n=="boolean"?String(n):"").filter(n=>n.length>0)}function Ge(e){return e.replace(/\r\n/g,`
3
3
  `)}function Vt(e){let t=Ge(e).trim();if(!t.startsWith("```"))return e;let r=t.split(`
4
4
  `);return r.length<2||r.at(-1)?.trim()!=="```"?e:r.slice(1,-1).join(`
@@ -15,4 +15,4 @@ ${i}`;continue}return null}return r}function qn(e,t){let r=Vt(e).trim();if(!r)th
15
15
  `)){let n=r.trim();if(n.length!==0)try{let o=JSON.parse(n);o&&typeof o=="object"&&typeof o.endpoint=="string"&&o.endpoint.trim().length>0&&"payload"in o&&typeof o.attempts=="number"&&Number.isFinite(o.attempts)&&((typeof o.id!="string"||o.id.length===0)&&(o.id=zs(o)),t.push(o))}catch{}}return t}function $s(e,t){if(typeof e.enqueued_at!="string"||e.enqueued_at.trim().length===0)return!1;let r=Date.parse(e.enqueued_at);return Number.isNaN(r)?!1:r<t}function Hr(e,t){let r=Ur(t),n=[],o=0;for(let i of e){if(JSON.stringify(i).length>xr||$s(i,r)||i.attempts>=Ir){o+=1;continue}n.push(i)}if(n.length>gr){let i=n.length-gr;return o+=i,{entries:n.slice(i),prunedCount:o}}return{entries:n,prunedCount:o}}async function Fs(e,t){let r=t.map(o=>JSON.stringify(o)).join(`
16
16
  `),n=r.length>0?`${r}
17
17
  `:"";for(let o=0;;o+=1)try{await T(yt(e),n);return}catch(i){let s=Ar[o];if(s===void 0||!Vr(i))throw i;await qr(s)}}async function Tr(e,t,r,n){return Et(async()=>{let o=await S(yt(e)),i=o===null?[]:jr(o),s=[];for(let c of i){if(r.has(c.id))continue;let d=n.get(c.id);s.push(d?{...c,attempts:d.attempts,next_attempt_after:d.next_attempt_after}:c)}let{entries:a}=Hr(s,t);return await Fs(e,a),a.length})}async function Us(e,t){let r=await S(yt(e));if(r===null||r.trim().length===0){await v(e,{pending_otel_spans:0});return}let n=jr(r),{entries:o,prunedCount:i}=Hr(n,t),s=o.filter(h=>Fr(h.next_attempt_after)).slice(0,ss);if(s.length===0){let h=i>0?await Tr(e,t,new Set,new Map):o.length;await v(e,{pending_otel_spans:h});return}let a=R(),c=new Set,d=new Map,l=0,u;await Promise.all(s.map(async h=>{try{let y=await Pr(h.endpoint,{"content-type":"application/json"},JSON.stringify(h.payload));if(y<200||y>=300)throw new Error(`local_otel_export_http_${y}`);c.add(h.id),l+=1}catch(y){u=y instanceof Error?_t(y.message,"redacted"):"local_otel_export_failed";let w=h.attempts+1;d.set(h.id,{attempts:w,next_attempt_after:$r(w)})}}));let _=await Tr(e,t,c,d),p={pending_otel_spans:_,last_otel_attempt_at:a};l>0&&(p.last_otel_success_at=a),u!==void 0?(p.last_otel_failure_at=a,p.last_otel_failure_error=u):_===0&&(p.last_otel_failure_at=void 0,p.last_otel_failure_error=void 0),await v(e,p)}async function Vs(e,t,r){try{await Ys(e,t,r)}catch{}try{await Us(e,r)}catch{}}async function qs(e,t=ps){try{let r=As(e),n=await es(r,{withFileTypes:!0}),o=Date.now()-Math.max(0,t);await Promise.all(n.filter(i=>i.isFile()&&/^\.events\.jsonl\.\d+\.\d+\.[a-f0-9]+\.tmp$/.test(i.name)).map(async i=>{let s=x.join(r,i.name);(await Sr(s)).mtimeMs<o&&await gt(s,{force:!0})}))}catch{}}async function Et(e){let t=Er.catch(()=>{}).then(e);return Er=t.catch(()=>{}),t}async function bt(e){let t=await S(Ce(e));return t===null||t.trim().length===0?[]:zr(t)}async function js(e,t,r){return Et(async()=>{let n=await bt(e),{entries:o}=wt(n,r),i=o.filter(s=>!t.has(s.event.event_id));return await Ae(e,i),i})}async function Hs(e,t,r,n){return Et(async()=>{let o=await bt(e),{entries:i}=wt(o,n),s=i.map(a=>{if(!t.has(a.event.event_id))return a;let c=a.attempts+1;return{...a,attempts:c,last_attempt_at:r,next_attempt_after:$r(c)}});return await Ae(e,s),s})}async function Ys(e,t,r){await qs(e);let n=t.trim();if(n.length===0)return;let o=await S(Ce(e));if(o===null||o.trim().length===0){await v(e,{endpoint:n,queue_entries:0});return}let i=zr(o);if(i.length===0){await v(e,{endpoint:n,queue_entries:0});return}let{entries:s,prunedCount:a}=wt(i,r);if(s.length===0){await Ae(e,[]),await v(e,{endpoint:n,queue_entries:0});return}let c=s.filter(p=>Os(p)).slice(0,cs);if(c.length===0){a>0&&await Ae(e,s),await v(e,{endpoint:n,queue_entries:s.length});return}let d=new Set(c.map(p=>p.event.event_id)),l=R(),u={"content-type":"application/json"},_=process.env.PM_TELEMETRY_INGEST_KEY?.trim();_&&(u["x-pm-telemetry-key"]=_);try{let p=await Pr(n,u,JSON.stringify({schema_version:as,events:c.map(h=>h.event)}));if(p<200||p>=300)throw new Error(`telemetry_flush_http_${p}`)}catch(p){let h=await Hs(e,d,l,r),y=p instanceof Error?_t(p.message,"redacted"):"telemetry_flush_failed";await v(e,{endpoint:n,queue_entries:h.length,last_attempted_flush_at:l,last_failed_flush_at:l,last_failed_flush_error:y});return}try{let p=await js(e,d,r);await v(e,{endpoint:n,queue_entries:p.length,last_attempted_flush_at:l,last_successful_flush_at:l,last_failed_flush_at:void 0,last_failed_flush_error:void 0})}catch(p){let h=p instanceof Error?_t(p.message,"redacted"):"telemetry_flush_failed",y=await bt(e).catch(()=>s);await v(e,{endpoint:n,queue_entries:y.length,last_attempted_flush_at:l,last_failed_flush_at:l,last_failed_flush_error:h})}}async function Bs(e){let t=Lr(e);await pt(x.dirname(t),{recursive:!0});try{return await pt(t),!0}catch(r){if(typeof r!="object"||r===null||!("code"in r)||r.code!=="EEXIST")throw r}try{let r=await Sr(t);return Date.now()-r.mtimeMs<_s?!1:(await gt(t,{recursive:!0,force:!0}),await pt(t),!0)}catch{return!1}}function Gs(e){try{Zi(e,{recursive:!0,force:!0})}catch{}}function Ws(e){Gs(Cs(e))}async function Ks(e,t,r){let n=await Bs(e);if(Ws(e),!!n)try{await Vs(e,t,r)}finally{try{await gt(Lr(e),{recursive:!0,force:!0})}catch{}}}async function sl(e=Re(process.cwd())){if(!ks())try{if(!(await M(e)).telemetry.enabled)return;let{endpoint:r,retentionDays:n}=await Ns(e);await Ks(e,r,n)}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]="a678b9f8-ba36-5127-877f-96bb4acc38c5")}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]="13c02696-29a7-598e-888a-3502fd88bfbe")}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]="a2fad90a-3575-5f3e-8cbe-ac380ac45591")}catch{}})();var Qs=3,Yr=20,Xs=.8,Js=100,Br=1e3,Gr=1e6;function Sp(e){return e===void 0?[]:[`likely_duplicates:${e.result.items.map(t=>t.id).join(",")}`]}function Wr(e){let t=e.limit??Qs,r=e.threshold??Xs;if(!Number.isSafeInteger(t)||t<0||t>Yr)throw new m(`Similarity limit must be an integer from 0 to ${Yr}.`,f.USAGE);if(!Number.isFinite(r)||r<0||r>1)throw new m("Similarity threshold must be a number from 0 to 1.",f.USAGE);return{limit:t,threshold:r}}function Zs(e){let t=e.limit??Js;if(!Number.isSafeInteger(t)||t<0||t>Br)throw new m(`Duplicate cluster limit must be an integer from 0 to ${Br}.`,f.USAGE);let r=e.since===void 0?void 0:new Date(e.since);if(r&&Number.isNaN(r.getTime()))throw new m("Duplicate cluster --since must be a valid ISO timestamp.",f.USAGE);return{limit:t,since:r}}async function ea(e,t){let r=oe(e.cwd??process.cwd(),e.pmRoot),n=await M(r),o=U(n),i=e.statuses?.map(u=>u.trim().toLowerCase()).filter(Boolean);if(e.statuses!==void 0&&i?.length===0)throw new m("Duplicate cluster statuses must include at least one lifecycle status or all.",f.USAGE);let s=Oe(n.schema),a=i?.map(u=>{if(u==="all")return u;let _=K(u,s);if(!_)throw new m(`Unknown duplicate-cluster status "${u}". Allowed: all, ${s.definitions.map(p=>p.id).join(", ")}.`,f.USAGE);return _}),c=a?.includes("all")===!0;if(c&&a?.some(u=>u!=="all"))throw new m('The "all" status cannot be combined with other statuses.',f.USAGE);let d=c?void 0:a,l=d?new Set(d):void 0;return{items:(await de(r,n.item_format,o.type_to_folder,void 0,n.schema)).filter(u=>(!l||l.has(u.status))&&(!t||new Date(u.created_at).getTime()>=t.getTime())).sort((u,_)=>u.id.localeCompare(_.id)).map(u=>({item:u,prepared:X(u.title)})),statuses:d}}function Kr(e,t=Gr){let r=new Set,n=[new Map,new Map,new Map];for(let[o,i]of e.entries()){let s=[[i.prepared.normalized],i.prepared.issueCodes,i.prepared.tokens];for(let[a,c]of s.entries())for(let d of c){let l=n[a].get(d)??[];for(let u of l)r.add(`${u}:${o}`);if(r.size>t)throw new m(`Duplicate sweep exceeded ${Gr} candidate pairs; narrow it with statuses or since.`,f.CONFLICT,{code:"duplicate_sweep_cost_limit",required:"Narrow the batch duplicate query until its deterministic candidate set fits the disclosed safety bound."});l.push(o),n[a].set(d,l)}}return r}var xp={buildDuplicateClusters:Xr,collectDuplicateCandidatePairs:Kr,createDuplicateUnionFind:Qr};function Qr(e){let t=Array.from({length:e},(n,o)=>o);return{parent:t,findRoot:n=>{let o=n;for(;t[o]!==o;)o=t[o];for(;t[n]!==n;){let i=t[n];t[n]=o,n=i}return o}}}function ta(e,t,r,n){let o=[];for(let i of t){let[s,a]=i.split(":").map(u=>Number.parseInt(u,10)),c=fe(e[s].prepared,e[a].prepared);if(c.score<r)continue;let d=n.findRoot(s),l=n.findRoot(a);d!==l&&(n.parent[l]=d),o.push({left_id:e[s].item.id,right_id:e[a].item.id,...c})}return o}function Xr(e,t,r,n){let o=new Map;for(let i of e.keys()){let s=r.findRoot(i),a=o.get(s)??[];a.push(i),o.set(s,a)}return[...o.values()].filter(i=>i.length>1).map(i=>{let s=new Set(i.map(c=>e[c].item.id)),a=t.filter(c=>s.has(c.left_id)&&s.has(c.right_id)).sort((c,d)=>d.score-c.score||c.left_id.localeCompare(d.left_id)||c.right_id.localeCompare(d.right_id));return{id:e[i[0]].item.id,items:i.map(c=>{let d=e[c].item;return{id:d.id,title:d.title,status:d.status,type:d.type}}),matches:a,max_score:a[0]?.score??0}}).sort((i,s)=>s.max_score-i.max_score||i.id.localeCompare(s.id)).slice(0,n)}function ra(e,t,r,n,o){return t.filter(i=>!r.has(i.id)).map(i=>({id:i.id,title:i.title,status:i.status,type:i.type,...ue(e,i.title)})).filter(i=>i.score>=n).sort((i,s)=>s.score-i.score||i.id.localeCompare(s.id)).slice(0,o)}async function na(e,t={}){let r=e.title.trim();if(r.length===0)throw new m("Similarity candidate title must not be empty.",f.USAGE);let{limit:n,threshold:o}=Wr(t),i=oe(t.cwd??process.cwd(),t.pmRoot),s=await M(i),a=U(s),c=await Ve(i,Object.values(a.type_to_folder)),d=J(r),l=c&&d.length>0?await Ue({pmRoot:i,expectedSourceCursor:c.source_cursor,query:d.map(p=>`"${p.replaceAll('"','""')}"`).join(" OR "),limit:Math.max(n*10,50)}):null,u=l===null?await de(i,s.item_format,a.type_to_folder,void 0,s.schema):l.items,_=ra(r,u,new Set(e.excludeIds??[]),o,n);return{items:_,count:_.length,threshold:o,source:l?"persistent_index":"metadata_fallback"}}async function Ip(e={}){let{threshold:t}=Wr({...e,limit:void 0}),{limit:r,since:n}=Zs(e),{items:o,statuses:i}=await ea(e,n),s=Kr(o),a=Qr(o.length),c=ta(o,s,t,a),d=Xr(o,c,a,r);return{clusters:d,count:d.length,threshold:t,source:"metadata_scan",filters:{statuses:i??null,since:e.since??null},cost:{item_count:o.length,candidate_pairs:s.size,scored_pairs:s.size}}}async function Ap(e,t){if(t.mode==="off")return;let r=await na(e,t);if(r.count===0)return;let n=t.mode==="strict"&&t.allowDuplicate===!0;if(t.mode==="strict"&&!n){let o=r.items.map(i=>`${i.id} (${i.status}): ${i.title}`).join("; ");throw new m(`Likely duplicate item(s) found: ${o}. Reuse the canonical item or pass --allow-duplicate with explicit intent.`,f.CONFLICT,{code:"likely_duplicate",required:"Reuse an existing item, or explicitly acknowledge the duplicate with --allow-duplicate.",recovery:{suggested_flags:["--allow-duplicate"]}})}return{mode:t.mode,bypassed:n,result:r}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="412fc2d2-daee-5d87-82ab-5411a1503087")}catch{}})();function Lp(e,t){let r=t??{};return e.filter(n=>r[n.id]!==n.updated_at).map(n=>n.id).sort((n,o)=>n.localeCompare(o))}export{En as a,bn as b,Sn as c,xn as d,va as e,In as f,An as g,Be as h,Cn as i,$a as j,Ln as k,Pt as l,Dn as m,Rn as n,$t as o,Mn as p,kn as q,Nn as r,On as s,qn as t,Yn as u,Bn as v,Wn as w,Kn as x,Qn as y,Zn as z,Wa as A,ro as B,ec as C,so as D,co as E,en as F,lo as G,uo as H,he as I,Oo as J,Tc as K,Ke as L,Jt as M,Qe as N,Go as O,Wo as P,Ic as Q,Zt as R,j as S,Je as T,et as U,ct as V,Pc as W,dt as X,Se as Y,sr as Z,xe as _,lt as $,ut as aa,ft as ba,mt as ca,fr as da,mr as ea,nd as fa,an as ga,Dt as ha,dn as ia,ln as ja,un as ka,la,fa as ma,Q as na,le as oa,J as pa,X as qa,ue as ra,fe as sa,Rt as ta,hn as ua,Hi as va,Gi as wa,Ki as xa,Qi as ya,as as za,Ir as Aa,Es as Ba,sl as Ca,Lp as Da,Sp as Ea,xp as Fa,na as Ga,Ip as Ha,Ap as Ia};
18
- //# sourceMappingURL=chunk-XDNAW5OI.js.map
18
+ //# sourceMappingURL=chunk-6XKF3PGV.js.map