@unbrained/pm-cli 2026.10.30 → 2026.11.1
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.
- package/.agents/skills/pm-user/references/ECOSYSTEM_PLANNING.md +1 -1
- package/.claude-plugin/marketplace.json +1 -1
- package/AGENTS.md +3 -3
- package/CHANGELOG.md +41 -0
- package/README.md +1 -1
- package/dist/cli/commander-usage.js +2 -2
- package/dist/cli/error-guidance.d.ts +45 -5
- package/dist/cli/error-guidance.js +5 -3
- package/dist/cli/extension-command-help.d.ts +1 -0
- package/dist/cli/extension-command-help.js +2 -2
- package/dist/cli/main.d.ts +1 -5
- package/dist/cli/main.js +5 -5
- package/dist/cli/migration-gates.d.ts +1 -1
- package/dist/cli/migration-gates.js +1 -1
- package/dist/cli/preflight-warnings.d.ts +11 -0
- package/dist/cli/preflight-warnings.js +4 -0
- package/dist/cli/register-mutation.js +2 -2
- package/dist/cli/register-operations.d.ts +3 -3
- package/dist/cli/register-operations.js +1 -1
- package/dist/cli-bundle/bundle-manifest.json +1 -1
- package/dist/cli-bundle/chunks/chunk-2GK2IVU5.js +8 -0
- package/dist/cli-bundle/chunks/chunk-5KW4WUAK.js +6 -0
- package/dist/cli-bundle/chunks/chunk-5WVE7XBS.js +114 -0
- package/dist/cli-bundle/chunks/chunk-6PKWKVS6.js +8 -0
- package/dist/cli-bundle/chunks/chunk-E74BORFX.js +128 -0
- package/dist/cli-bundle/chunks/chunk-F3ECOBKA.js +2 -0
- package/dist/cli-bundle/chunks/chunk-ICT6E4IW.js +2 -0
- package/dist/cli-bundle/chunks/chunk-MP2DQJH2.js +3 -0
- package/dist/cli-bundle/chunks/{chunk-LWW4F4G2.js → chunk-MRUA2Z43.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-UUQX3PFD.js → chunk-MTRIGD7M.js} +76 -76
- package/dist/cli-bundle/chunks/{chunk-S2U7ECUJ.js → chunk-N45IXPCA.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-MVL27TAH.js → chunk-NILQ2ZMV.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-GRABKNFL.js → chunk-O56O7NIE.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-O6TFUV6M.js +31 -0
- package/dist/cli-bundle/chunks/{chunk-TH5KPAN4.js → chunk-SBVX5CMV.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-Y6NC3X3E.js → chunk-TMPO4CTZ.js} +3 -3
- package/dist/cli-bundle/chunks/chunk-TYERATXH.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-EHBGHX55.js → chunk-UEEG47TU.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-UUN3WNMQ.js +20 -0
- package/dist/cli-bundle/chunks/chunk-WFBYKDB2.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-RZQNFHXO.js → chunk-WX25MU4N.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-4BQD5SW2.js → chunk-Y7CKVU56.js} +30 -30
- package/dist/cli-bundle/chunks/{indexed-receipt-blobs-LHLE7PSG.js → indexed-receipt-blobs-KGMJVFH2.js} +2 -2
- package/dist/cli-bundle/chunks/item-transaction-Q5S5YLEJ.js +2 -0
- package/dist/cli-bundle/chunks/{mutation-admission-TRGAVS7N.js → mutation-admission-BOOCJPCU.js} +2 -2
- package/dist/cli-bundle/chunks/{register-list-query-BH4F6M7Z.js → register-list-query-23OX36Q3.js} +3 -3
- package/dist/cli-bundle/chunks/register-mutation-JPJ5YNDX.js +20 -0
- package/dist/cli-bundle/chunks/register-operations-IGR7ERY5.js +2 -0
- package/dist/cli-bundle/chunks/{register-setup-QPWSVHFZ.js → register-setup-BMIFKZZP.js} +2 -2
- package/dist/cli-bundle/chunks/{settlement-hook-MN3Y7LVX.js → settlement-hook-YWSWFOZY.js} +2 -2
- package/dist/cli-bundle/chunks/{stage-RTB6RAAO.js → stage-ON7CYYPM.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-POJPJX64.js → chunk-2Y77HWIX.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-SAT7IAEB.js → chunk-3NYWMUX3.js} +3 -3
- package/dist/cli-bundle/focused-chunks/chunk-3Z53POXU.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-5TWS5KOM.js +26 -0
- package/dist/cli-bundle/focused-chunks/chunk-5WCQFH6D.js +12 -0
- package/dist/cli-bundle/focused-chunks/{chunk-S23ZUASN.js → chunk-6GMYW42K.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-YQUZL2CK.js → chunk-6OKPYCLU.js} +5 -5
- package/dist/cli-bundle/focused-chunks/chunk-7WJDRZOR.js +22 -0
- package/dist/cli-bundle/focused-chunks/{chunk-3SRX77ES.js → chunk-AL7SOFUL.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-CIQ6YWCW.js +26 -0
- package/dist/cli-bundle/focused-chunks/{chunk-RKPUQDWF.js → chunk-DFUTCKUF.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-RYEZSZJ7.js → chunk-GE755ODZ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-JCR32IAO.js +91 -0
- package/dist/cli-bundle/focused-chunks/{chunk-BPE6JTKL.js → chunk-JLXGRDTG.js} +3 -3
- package/dist/cli-bundle/focused-chunks/chunk-LVA76N27.js +6 -0
- package/dist/cli-bundle/focused-chunks/{chunk-YU7QOYYV.js → chunk-M22TI7LP.js} +3 -3
- package/dist/cli-bundle/focused-chunks/chunk-PAT6QF63.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-VFWCSQAG.js → chunk-RPUDOJVB.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-SXZM4PSS.js +44 -0
- package/dist/cli-bundle/focused-chunks/chunk-UQIBGLDR.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-RGQEJFXO.js → chunk-VFQAZLKO.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-BCIUAEWX.js → chunk-VS2ZFPXD.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-FRFNGMAK.js → chunk-WX2RVS2Y.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-Z7GIVH6B.js +3 -0
- package/dist/cli-bundle/focused-chunks/{indexed-receipt-blobs-VK2363JB.js → indexed-receipt-blobs-KHWT44EK.js} +2 -2
- package/dist/cli-bundle/focused-chunks/item-transaction-7VLPA2SU.js +2 -0
- package/dist/cli-bundle/focused-chunks/{mutation-admission-7VUODEPJ.js → mutation-admission-2DH27R5Y.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{settlement-hook-OK6A7PG2.js → settlement-hook-SJV52ZTV.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{stage-S5RP5SZH.js → stage-FYOBWQA7.js} +2 -2
- package/dist/cli-bundle/main.js +26 -22
- package/dist/cli-bundle/sdk-authoring.js +1 -1
- package/dist/cli-bundle/sdk-contracts.js +4 -4
- package/dist/cli-bundle/sdk-core.js +1 -1
- package/dist/cli-bundle/sdk-governance.js +1 -1
- package/dist/cli-bundle/sdk-graph.js +1 -1
- package/dist/cli-bundle/sdk-merge.js +57 -57
- package/dist/cli-bundle/sdk-query.js +1 -1
- package/dist/cli-bundle/sdk-runtime.js +1 -1
- package/dist/cli-bundle/sdk-testing.js +1 -1
- package/dist/cli-bundle/sdk.js +11 -11
- package/dist/core/config/nested-settings.js +1 -1
- package/dist/core/extensions/extension-hook-runtime.js +1 -1
- package/dist/core/extensions/extension-types.d.ts +4 -0
- package/dist/core/extensions/extension-types.js +1 -1
- package/dist/core/extensions/loader.js +1 -1
- package/dist/core/lock/lock.js +4 -4
- package/dist/core/output/mutation-projection.js +1 -1
- package/dist/core/output/output.js +3 -3
- package/dist/core/schema/fields-file.js +1 -1
- package/dist/core/sentry/helpers.d.ts +6 -0
- package/dist/core/sentry/helpers.js +1 -1
- package/dist/core/sentry/instrument.d.ts +1 -1
- package/dist/core/sentry/instrument.js +1 -1
- package/dist/core/shared/constants.js +1 -1
- package/dist/core/shared/errors.d.ts +6 -0
- package/dist/core/shared/errors.js +1 -1
- package/dist/core/shared/output-unicode.d.ts +10 -0
- package/dist/core/shared/output-unicode.js +2 -0
- package/dist/core/store/settings-validator.d.ts +1 -0
- package/dist/core/store/settings-validator.js +1 -1
- package/dist/core/store/settings.js +1 -1
- package/dist/core/telemetry/policy.d.ts +8 -0
- package/dist/core/telemetry/policy.js +1 -1
- package/dist/core/telemetry/runtime.js +3 -3
- package/dist/sdk/agent/command-recovery.d.ts +15 -0
- package/dist/sdk/agent/command-recovery.js +1 -1
- package/dist/sdk/cli-bootstrap.js +1 -1
- package/dist/sdk/cli-contracts/agent-output-contracts.d.ts +28 -0
- package/dist/sdk/cli-contracts/agent-output-contracts.js +2 -2
- package/dist/sdk/cli-contracts/commander-mutation-options.js +1 -1
- package/dist/sdk/cli-contracts/flag-contracts.d.ts +2 -0
- package/dist/sdk/cli-contracts/flag-contracts.js +1 -1
- package/dist/sdk/cli-contracts/grammar-contracts.js +1 -1
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +1 -1
- package/dist/sdk/cli-contracts/tool-schema.js +1 -1
- package/dist/sdk/cli-contracts.d.ts +1 -1
- package/dist/sdk/cli-contracts.js +1 -1
- package/dist/sdk/completion/fish.js +4 -4
- package/dist/sdk/completion/zsh.js +3 -3
- package/dist/sdk/config.d.ts +1 -0
- package/dist/sdk/config.js +1 -1
- package/dist/sdk/context-intent-contracts.d.ts +17 -0
- package/dist/sdk/context-intent-contracts.js +1 -1
- package/dist/sdk/core.d.ts +2 -1
- package/dist/sdk/core.js +1 -1
- package/dist/sdk/error-runtime.d.ts +9 -0
- package/dist/sdk/error-runtime.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1 -1
- package/dist/sdk/generated/generated-error-code-catalog-part-2.js +1 -1
- package/dist/sdk/index.d.ts +3 -3
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/init-agent-guidance.js +2 -2
- package/dist/sdk/lifecycle/claim.d.ts +27 -0
- package/dist/sdk/lifecycle/claim.js +1 -1
- package/dist/sdk/lifecycle/close.js +1 -1
- package/dist/sdk/lifecycle/create.js +1 -1
- package/dist/sdk/lifecycle/mcp-actions.d.ts +1 -1
- package/dist/sdk/lifecycle/mcp-actions.js +1 -1
- package/dist/sdk/lifecycle/plan.d.ts +2 -3
- package/dist/sdk/lifecycle/plan.js +1 -1
- package/dist/sdk/lifecycle/repeated-terminal-state.d.ts +45 -0
- package/dist/sdk/lifecycle/repeated-terminal-state.js +2 -0
- package/dist/sdk/lifecycle/shared-unset-fields.d.ts +9 -0
- package/dist/sdk/lifecycle/shared-unset-fields.js +1 -1
- package/dist/sdk/lifecycle/task-composition.js +1 -1
- package/dist/sdk/lifecycle/update-many.d.ts +0 -1
- package/dist/sdk/lifecycle/update-many.js +1 -1
- package/dist/sdk/lifecycle/update.d.ts +29 -1
- package/dist/sdk/lifecycle/update.js +2 -2
- package/dist/sdk/output/list-envelope.d.ts +8 -0
- package/dist/sdk/output/list-envelope.js +1 -1
- package/dist/sdk/output/table-rows.d.ts +7 -1
- package/dist/sdk/output/table-rows.js +1 -1
- package/dist/sdk/output.d.ts +2 -1
- package/dist/sdk/output.js +2 -2
- package/dist/sdk/ownership-source.d.ts +18 -0
- package/dist/sdk/ownership-source.js +1 -1
- package/dist/sdk/public-surface.json +1 -1
- package/dist/sdk/query/context.js +2 -2
- package/dist/sdk/query/get.d.ts +1 -1
- package/dist/sdk/query/get.js +1 -1
- package/dist/sdk/query/next-ranking-policy.d.ts +35 -0
- package/dist/sdk/query/next-ranking-policy.js +2 -0
- package/dist/sdk/query/next.d.ts +12 -2
- package/dist/sdk/query/next.js +2 -2
- package/dist/sdk/query/projection-contracts.d.ts +4 -0
- package/dist/sdk/query/projection-contracts.js +1 -1
- package/dist/sdk/read-output/surfaces.d.ts +27 -0
- package/dist/sdk/read-output/surfaces.js +2 -0
- package/dist/sdk/read-output-contracts.js +1 -1
- package/dist/sdk/runtime/actions.js +1 -1
- package/dist/sdk/runtime-input.js +1 -1
- package/dist/sdk/runtime-primitives.d.ts +1 -0
- package/dist/sdk/runtime-primitives.js +1 -1
- package/dist/sdk/runtime-public-contracts.d.ts +2 -0
- package/dist/sdk/runtime.d.ts +2 -2
- package/dist/sdk/runtime.js +1 -1
- package/dist/sdk/start-task-status.d.ts +1 -1
- package/dist/sdk/start-task-status.js +1 -1
- package/dist/sdk/test/execution-receipts.d.ts +25 -0
- package/dist/sdk/test/execution-receipts.js +2 -2
- package/dist/sdk/test/execution.d.ts +5 -0
- package/dist/sdk/test/execution.js +2 -2
- package/dist/types.d.ts +2 -0
- package/dist/types.js +1 -1
- package/docs/AGENT_GUIDE.md +4 -4
- package/docs/AGENT_OUTPUT_ENCODINGS.md +12 -0
- package/docs/AGENT_UX_CONTRACTS.md +2 -1
- package/docs/COMMANDS.md +59 -5
- package/docs/COMMAND_NAMESPACES.md +1 -1
- package/docs/CONFIGURATION.md +48 -1
- package/docs/DEVELOPMENT_DEPENDENCY_SECURITY.md +26 -0
- package/docs/LIFECYCLE_COMMANDS.md +19 -4
- package/docs/PACKED_FIRST_RUN.md +2 -1
- package/docs/READ_OUTPUT_CONTRACTS.md +24 -6
- package/docs/SDK.md +82 -3
- package/docs/SDK_ACTION_CONFORMANCE.md +21 -0
- package/docs/TESTING.md +38 -2
- package/docs/agent-task-token-baseline.json +1 -1
- package/docs/agent-task-transcripts.json +1 -1
- package/marketplace.json +1 -1
- package/package.json +1 -1
- package/packages/pm-beads/package.json +1 -1
- package/packages/pm-calendar/extensions/calendar/index.ts +1 -0
- package/packages/pm-calendar/package.json +1 -1
- package/packages/pm-command-kit/package.json +1 -1
- package/packages/pm-digital-twin/package.json +1 -1
- package/packages/pm-governance-audit/package.json +1 -1
- package/packages/pm-guide-shell/package.json +1 -1
- package/packages/pm-kanban/package.json +1 -1
- package/packages/pm-lifecycle-hooks/package.json +1 -1
- package/packages/pm-linked-test-adapters/package.json +1 -1
- package/packages/pm-search-advanced/package.json +1 -1
- package/packages/pm-templates/package.json +1 -1
- package/packages/pm-todos/package.json +1 -1
- package/packages/pm-vcs/package.json +1 -1
- package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
- package/plugins/pm-claude/package.json +1 -1
- package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
- package/plugins/pm-codex/package.json +1 -1
- package/plugins/pm-codex/plugin.json +1 -1
- package/runtime-dependencies.json +1 -1
- package/dist/cli-bundle/chunks/chunk-34MP7WKK.js +0 -6
- package/dist/cli-bundle/chunks/chunk-3KMYHYJV.js +0 -2
- package/dist/cli-bundle/chunks/chunk-42BHHNTL.js +0 -128
- package/dist/cli-bundle/chunks/chunk-I5O3XZOA.js +0 -2
- package/dist/cli-bundle/chunks/chunk-LEIVUGDH.js +0 -8
- package/dist/cli-bundle/chunks/chunk-OH7WPD42.js +0 -114
- package/dist/cli-bundle/chunks/chunk-OOD2A7AF.js +0 -20
- package/dist/cli-bundle/chunks/chunk-Q5V7P6NM.js +0 -2
- package/dist/cli-bundle/chunks/chunk-QLPFYBXN.js +0 -2
- package/dist/cli-bundle/chunks/chunk-SA5NYLPE.js +0 -8
- package/dist/cli-bundle/chunks/chunk-VHLAVTJN.js +0 -31
- package/dist/cli-bundle/chunks/chunk-XAOVJG52.js +0 -3
- package/dist/cli-bundle/chunks/chunk-XPQ4RTSF.js +0 -2
- package/dist/cli-bundle/chunks/item-transaction-WIOBZW4E.js +0 -2
- package/dist/cli-bundle/chunks/register-mutation-5V2NANIS.js +0 -20
- package/dist/cli-bundle/chunks/register-operations-XSFRMUFX.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-2V6NMNYN.js +0 -26
- package/dist/cli-bundle/focused-chunks/chunk-ASHGXMX4.js +0 -3
- package/dist/cli-bundle/focused-chunks/chunk-CKBN2D42.js +0 -12
- package/dist/cli-bundle/focused-chunks/chunk-I642DXOT.js +0 -22
- package/dist/cli-bundle/focused-chunks/chunk-K7DKG5HM.js +0 -91
- package/dist/cli-bundle/focused-chunks/chunk-NMQBXU7N.js +0 -44
- package/dist/cli-bundle/focused-chunks/chunk-PGM3ENGZ.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-QFNV4JTA.js +0 -6
- package/dist/cli-bundle/focused-chunks/chunk-QVJCQMZY.js +0 -26
- package/dist/cli-bundle/focused-chunks/chunk-R2TPPPVU.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-VJVJ2ZX2.js +0 -2
- package/dist/cli-bundle/focused-chunks/item-transaction-ZFDKJIP7.js +0 -2
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{Da as ce,ka as le}from"./chunk-4BQD5SW2.js";import{He as se,Pc as ie,_c as k,gd as R,xd as oe}from"./chunk-42BHHNTL.js";import{A as X,Aa as x,Ai as ae,Cd as te,Ci as w,Oc as O,Tf as re,ha as I,lg as ne,pa as P,qa as J,tc as ee,xa as b,za as Z}from"./chunk-OH7WPD42.js";import{A as s,C as l,E as G}from"./chunk-RZQNFHXO.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]="544840da-22f5-5734-81ec-e12c5612545c")}catch{}})();var Ue=/^[a-z0-9]+(?:-[a-z0-9]+)*$/u;function _e(e){let t=e?.trim();if(!t||t==="__proto__"||t.length>128)throw new Error("A legacy author must contain 1-128 characters.");return t}function ze(e){let t=e?.trim().toLowerCase();if(!t||!Ue.test(t))throw new Error("A canonical harness must be a lowercase dash-separated namespace.");return t}function je(e){return Object.fromEntries(Object.entries(e).sort(([t],[r])=>t.localeCompare(r)))}function Fe(e,t){let r=new Set;for(let n of(e??[]).slice(0,1e4)){let i=n.trim().slice(0,128);i.length===0||i.startsWith("harness:")||Object.hasOwn(t,i)||r.add(i)}return r.size}function Me(e,t){let r=_e(t.legacy_author),n=ze(t.canonical_harness);if(r===n||r===`harness:${n}`||r.startsWith("harness:"))throw new Error(`The legacy author "${r}" is already canonical and must not be aliased.`);return e[r]===n?!1:(e[r]=n,!0)}function Ve(e,t){if(t.operation==="add")return Me(e,t);if(t.operation==="remove"){let n=_e(t.legacy_author);return Object.hasOwn(e,n)?(delete e[n],!0):!1}if(t.operation==="clear"){let n=Object.keys(e).length>0;for(let i of Object.keys(e))delete e[i];return n}let r=t.operation;throw new Error(`Unsupported vocabulary operation: ${String(r)}`)}function T(e){return{version:e?.version??1,alias_count:Object.keys(e?.aliases??{}).length}}function de(e,t){let r=e?.version??1,n={...e?.aliases},i=Ve(n,t),a={version:i?r+1:r,aliases:je(n)};return{vocabulary:a,preview:{operation:t.operation,changed:i,version_before:r,version_after:a.version,alias_count:Object.keys(a.aliases).length,residual_author_count:Fe(t.observed_authors,a.aliases)}}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="78e92b9c-f3da-594e-8158-00409222308f")}catch{}})();var ue=new Set(["item_format"]),fe=new Set(["definition_of_done","metadata_required_fields","lifecycle_stale_blocker_reason_patterns","lifecycle_closure_like_blocked_reason_patterns","lifecycle_closure_like_resolution_patterns","lifecycle_closure_like_actual_result_patterns"]),Ke=new Set(["history_missing_stream_policy","sprint_release_format_policy","parent_reference_policy","metadata_validation_profile","governance_preset","governance_ownership_enforcement","governance_create_mode_default","governance_close_validation_default","governance_require_close_reason","governance_create_default_type","governance_workflow_enforcement","governance_parent_reference_policy","governance_metadata_validation_profile","governance_force_required_for_stale_lock","test_result_tracking","untrusted_linked_test_execution","telemetry_tracking","agent_identity_vocabulary"]),Ye=new Set(["governance_require_close_reason","governance_force_required_for_stale_lock","test_result_tracking","untrusted_linked_test_execution","telemetry_tracking"]),Be={off:"disabled",on:"enabled",true:"enabled",false:"disabled",enabled:"enabled",disabled:"disabled"};function We(e){let t=e.trim().toLowerCase().replaceAll("-","_");if(ue.has(t)||fe.has(t)||Ke.has(t)||t==="context")return t}function He(e){let t=e.trim().toLowerCase();return Be[t]??e}function ge(e,t){let r=We(e);return r===void 0?{routable:!1,reason:`Unknown config key "${e}" cannot route a positional value.`}:r==="context"?{routable:!1,reason:"Config set context does not accept a positional value. Use --default-depth, --activity-limit, --stale-threshold-days, or --section-<name> flags."}:ue.has(r)?{routable:!0,flag:"format",value:t}:fe.has(r)?{routable:!0,flag:"criterion",values:[t]}:{routable:!0,flag:"policy",value:Ye.has(r)?He(t):t}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="d681ddfe-ad15-527b-90de-bfbe341c6a86")}catch{}})();var C=[{key:"search_provider",path:"search.provider",kind:"string",summary:"Search embedding provider name (e.g. openai, ollama, or an extension provider)."},{key:"search_default_mode",path:"search.default_mode",kind:"string",choices:["auto","keyword","semantic","hybrid"],summary:"Mode a bare pm search runs in: auto (hybrid when semantic search is explicitly configured and runnable, else keyword), or a pinned keyword, semantic, or hybrid."},{key:"search_mutation_refresh_policy",path:"search.mutation_refresh_policy",kind:"string",choices:["cache_only","semantic_configured","semantic_auto"],summary:"Mutation-time search refresh policy: cache_only, semantic_configured, or semantic_auto."},{key:"search_query_expansion_enabled",path:"search.query_expansion.enabled",kind:"boolean",summary:"Enable or disable query expansion for semantic/hybrid search."},{key:"search_query_expansion_provider",path:"search.query_expansion.provider",kind:"string",summary:"Query expansion provider name (built-in openai/ollama or extension provider)."},{key:"search_rerank_enabled",path:"search.rerank.enabled",kind:"boolean",summary:"Enable or disable post-retrieval reranking for hybrid search."},{key:"search_rerank_model",path:"search.rerank.model",kind:"string",summary:"Rerank model name override used by built-in providers."},{key:"search_rerank_top_k",path:"search.rerank.top_k",kind:"integer",min:1,summary:"Number of top hybrid candidates to rerank when rerank is enabled."},{key:"search_embedding_model",path:"search.embedding_model",kind:"string",summary:"Default embedding model name (overrides provider-specific model when set)."},{key:"search_embedding_corpus_max_characters",path:"search.embedding_corpus_max_characters",kind:"integer",min:1,summary:"Maximum semantic corpus characters per item before truncation."},{key:"search_embedding_batch_size",path:"search.embedding_batch_size",kind:"integer",min:1,summary:"Number of items embedded per request batch."},{key:"search_embedding_timeout_ms",path:"search.embedding_timeout_ms",kind:"integer",min:1,summary:"Per-request embedding timeout in milliseconds."},{key:"search_score_threshold",path:"search.score_threshold",kind:"number",summary:"Minimum score for a hit to be returned (0 keeps all matches)."},{key:"search_hybrid_semantic_weight",path:"search.hybrid_semantic_weight",kind:"ratio",summary:"Hybrid mode semantic weight in [0, 1] (1-weight goes to keyword)."},{key:"search_max_results",path:"search.max_results",kind:"integer",min:1,summary:"Default upper bound on search hits when --limit is not supplied."},{key:"search_bm25_k1",path:"search.bm25.k1",kind:"number",min:0,summary:"Offline BM25 term-frequency saturation (k1); higher saturates repeated terms slower (default 1.2)."},{key:"search_bm25_b",path:"search.bm25.b",kind:"ratio",summary:"Offline BM25 document-length normalization (b) in [0, 1]; 0 disables, 1 fully normalizes (default 0.75)."},{key:"openai_base_url",path:"providers.openai.base_url",kind:"string",summary:"OpenAI-compatible API base URL (LM Studio/vLLM also use this)."},{key:"openai_api_key",path:"providers.openai.api_key",kind:"string",summary:"OpenAI-compatible API key."},{key:"openai_model",path:"providers.openai.model",kind:"string",summary:"OpenAI-compatible embedding model name."},{key:"ollama_base_url",path:"providers.ollama.base_url",kind:"string",summary:"Ollama API base URL (typically http://localhost:11434)."},{key:"ollama_model",path:"providers.ollama.model",kind:"string",summary:"Ollama embedding model name (e.g. nomic-embed-text)."},{key:"vector_store_adapter",path:"vector_store.adapter",kind:"string",summary:"Vector store adapter name (lancedb, qdrant, or an extension adapter)."},{key:"vector_store_collection_name",path:"vector_store.collection_name",kind:"string",non_empty:!0,summary:"Vector collection/table name shared by Qdrant and LanceDB adapters."},{key:"qdrant_url",path:"vector_store.qdrant.url",kind:"string",summary:"Qdrant HTTP API URL."},{key:"qdrant_api_key",path:"vector_store.qdrant.api_key",kind:"string",summary:"Qdrant API key (empty if running unauthenticated)."},{key:"lancedb_path",path:"vector_store.lancedb.path",kind:"string",summary:"LanceDB storage path (relative to pm root or absolute)."},{key:"id_prefix",path:"id_prefix",kind:"string",non_empty:!0,summary:'Prefix for generated item IDs (e.g. "pm" produces pm-xxxx).'},{key:"author_default",path:"author_default",kind:"string",non_empty:!0,summary:"Default author recorded on mutations when --author is not supplied."},{key:"agent_identity_probes_enabled",path:"agent_identity.probes_enabled",kind:"boolean",summary:"Allow privacy-bounded local harness provenance probes; no network or subprocess access is permitted."},{key:"mutation_guard_require_attributed_author",path:"mutation_guard.require_attributed_author",kind:"boolean",summary:"Reject mutations whose effective author resolves to unknown."},{key:"mutation_guard_secret_guard",path:"mutation_guard.secret_guard",kind:"string",choices:["off","advise","block"],summary:"Detect credential-shaped mutation content: off, advise, or block."},{key:"mutation_guard_stale_in_progress_hours",path:"mutation_guard.stale_in_progress_hours",kind:"integer",min:1,summary:"Age threshold for unclaimed in-progress work surfaced by health."},{key:"governance_duplicate_detection_mode",path:"governance.duplicate_detection_mode",kind:"string",choices:["off","advisory","strict"],summary:"Create/copy duplicate governance: off, advisory, or strict explicit-bypass enforcement."},{key:"governance_duplicate_detection_threshold",path:"governance.duplicate_detection_threshold",kind:"ratio",summary:"Minimum shared similarity score in [0, 1] for create/copy duplicate governance."},{key:"governance_duplicate_detection_limit",path:"governance.duplicate_detection_limit",kind:"integer",min:0,max:20,summary:"Maximum likely duplicates returned by create/copy governance (0-20)."},{key:"output_default_format",path:"output.default_format",kind:"string",choices:["toon","json"],summary:"Default output format for commands that support it: toon or json."},{key:"ux_deprecation_hints",path:"ux.deprecation_hints",kind:"boolean",summary:"Emit one stderr migration hint for deprecated command aliases."},{key:"locks_ttl_seconds",path:"locks.ttl_seconds",kind:"integer",min:1,summary:"Claim/lock time-to-live in seconds before a stale lock can be reclaimed."},{key:"locks_wait_ms",path:"locks.wait_ms",kind:"integer",min:0,summary:"Wait budget in milliseconds before a contended lock fails with lock_conflict; item-store mutations, restore and the hierarchy lock treat it as a no-progress window that each observed owner handoff restarts (120 s total cap), other locks as a fixed total; 0 fails fast. PM_LOCK_WAIT_MS overrides per invocation."},{key:"ids_token_length",path:"ids.token_length",kind:"integer",min:4,max:12,summary:"Random base36 token length for newly minted item ids (4-12, default 4). Raise it to shrink cross-branch id collision odds in concurrent multi-agent workflows (pm-pibw)."},{key:"checkpoints_retention_days",path:"checkpoints.retention_days",kind:"integer",min:1,summary:"Age in days above which pm gc --scope checkpoints prunes bulk-mutation rollback checkpoints."},{key:"schema_unknown_field_policy",path:"schema.unknown_field_policy",kind:"string",choices:["allow","warn","reject"],summary:"How item I/O handles metadata keys not in the field registry: allow, warn, or reject."},{key:"history_compact_policy_enabled",path:"history.compact_policy.enabled",kind:"boolean",summary:"Enable the history-compaction advisory: pm health warns on over-threshold streams."},{key:"history_compact_policy_max_entries",path:"history.compact_policy.max_entries",kind:"integer",min:1,summary:"Entry count above which a history stream is flagged (and the default pm history-compact --all-over threshold)."},{key:"history_compact_policy_trigger",path:"history.compact_policy.trigger",kind:"string",choices:["health_warn","auto"],summary:"History-compaction policy intent: health_warn (advisory only) or auto (scheduled sweeps expected)."}],Qe=new Map(C.flatMap(e=>[[e.key,e],[e.path.toLowerCase().replaceAll("-","_"),e]]));function me(e){if(typeof e!="string")return;let t=e.trim().toLowerCase().replaceAll("-","_");if(t.length!==0)return Qe.get(t)}function Xe(e,t){let r=t.trim().toLowerCase();return r==="true"||r==="1"||r==="yes"||r==="on"?{ok:!0,parsed:{descriptor:e,value:!0}}:r==="false"||r==="0"||r==="no"||r==="off"?{ok:!0,parsed:{descriptor:e,value:!1}}:{ok:!1,error:{message:`Config set ${e.key} requires a boolean value (true|false), got "${t}"`}}}function Je(e,t,r){return e.non_empty===!0&&r.length===0?{ok:!1,error:{message:`Config set ${e.key} requires a non-empty value`}}:e.choices&&!e.choices.includes(r)?{ok:!1,error:{message:`Config set ${e.key} must be one of ${e.choices.join("|")}, got "${t}"`}}:{ok:!0,parsed:{descriptor:e,value:r}}}function Ze(e,t,r){if(r.length===0)return{ok:!1,error:{message:`Config set ${e.key} requires a non-empty value`}};let n=Number(r);return Number.isFinite(n)?{ok:!0,value:n}:{ok:!1,error:{message:`Config set ${e.key} requires a finite number, got "${t}"`}}}function xe(e,t,r){return!Number.isInteger(r)||r<0?{ok:!1,error:{message:`Config set ${e.key} requires a non-negative integer, got "${t}"`}}:e.min!==void 0&&r<e.min?{ok:!1,error:{message:`Config set ${e.key} requires an integer >= ${e.min}, got "${t}" (the runtime silently ignores 0 here and falls back to the default)`}}:e.max!==void 0&&r>e.max?{ok:!1,error:{message:`Config set ${e.key} requires an integer <= ${e.max}, got "${t}"`}}:{ok:!0,parsed:{descriptor:e,value:r}}}function et(e,t,r){return r<0||r>1?{ok:!1,error:{message:`Config set ${e.key} requires a number in [0, 1], got "${t}"`}}:{ok:!0,parsed:{descriptor:e,value:r}}}function tt(e,t,r){return e.min!==void 0&&r<e.min?{ok:!1,error:{message:`Config set ${e.key} requires a number >= ${e.min}, got "${t}"`}}:{ok:!0,parsed:{descriptor:e,value:r}}}function pe(e,t){if(typeof t!="string")return{ok:!1,error:{message:`Config set ${e.key} requires a string value`}};let r=t.trim();if(e.kind==="boolean")return Xe(e,t);if(e.kind==="string")return Je(e,t,r);let n=Ze(e,t,r);return n.ok?e.kind==="integer"?xe(e,t,n.value):e.kind==="ratio"?et(e,t,n.value):tt(e,t,n.value):{ok:!1,error:n.error}}function N(e,t){let r=t.path.split("."),n=e;for(let i of r){if(typeof n!="object"||n===null)return null;let a=Object.getOwnPropertyDescriptor(n,i);if(!a||!Object.hasOwn(a,"value"))return null;n=a.value}return typeof n=="string"||typeof n=="number"||typeof n=="boolean"?n:null}function ye(e,t,r){let n=t.path.split(".");if(n.some(o=>o.length===0||["__proto__","constructor","prototype"].includes(o)))throw new Error("Unsafe settings path");let i=e;for(let o=0;o<n.length-1;o+=1){let d=n[o],c=Object.getOwnPropertyDescriptor(i,d)?.value;if(typeof c!="object"||c===null||Array.isArray(c)){let _={};Object.defineProperty(i,d,{value:_,writable:!0,enumerable:!0,configurable:!0}),i=_}else i=c}let a=n[n.length-1];return Object.getOwnPropertyDescriptor(i,a)?.value===r?!1:(Object.defineProperty(i,a,{value:r,writable:!0,enumerable:!0,configurable:!0}),!0)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="d9b6f2ba-2c5e-52ea-891d-53124601fb89")}catch{}})();var he=["project","global"],p={definition_of_done:["definition-of-done","definition_of_done"],item_format:["item-format","item_format"],history_missing_stream_policy:["history-missing-stream-policy","history_missing_stream_policy"],sprint_release_format_policy:["sprint-release-format-policy","sprint_release_format_policy"],parent_reference_policy:["parent-reference-policy","parent_reference_policy"],metadata_validation_profile:["metadata-validation-profile","metadata_validation_profile"],metadata_required_fields:["metadata-required-fields","metadata_required_fields"],lifecycle_stale_blocker_reason_patterns:["lifecycle-stale-blocker-reason-patterns","lifecycle_stale_blocker_reason_patterns"],lifecycle_closure_like_blocked_reason_patterns:["lifecycle-closure-like-blocked-reason-patterns","lifecycle_closure_like_blocked_reason_patterns"],lifecycle_closure_like_resolution_patterns:["lifecycle-closure-like-resolution-patterns","lifecycle_closure_like_resolution_patterns"],lifecycle_closure_like_actual_result_patterns:["lifecycle-closure-like-actual-result-patterns","lifecycle_closure_like_actual_result_patterns"],governance_preset:["governance-preset","governance_preset"],governance_ownership_enforcement:["governance-ownership-enforcement","governance_ownership_enforcement"],governance_create_mode_default:["governance-create-mode-default","governance_create_mode_default"],governance_close_validation_default:["governance-close-validation-default","governance_close_validation_default"],governance_require_close_reason:["governance-require-close-reason","governance_require_close_reason"],governance_create_default_type:["governance-create-default-type","governance_create_default_type"],governance_workflow_enforcement:["governance-workflow-enforcement","governance_workflow_enforcement"],governance_parent_reference_policy:["governance-parent-reference-policy","governance_parent_reference_policy"],governance_metadata_validation_profile:["governance-metadata-validation-profile","governance_metadata_validation_profile"],governance_force_required_for_stale_lock:["governance-force-required-for-stale-lock","governance_force_required_for_stale_lock"],test_result_tracking:["test-result-tracking","test_result_tracking"],untrusted_linked_test_execution:["untrusted-linked-test-execution","untrusted_linked_test_execution"],telemetry_tracking:["telemetry-tracking","telemetry_tracking"],agent_identity_vocabulary:["agent-identity-vocabulary","agent_identity_vocabulary"],context:["context"]},rt=Object.keys(p).map(e=>p[e][0]),nt=Object.fromEntries(Object.keys(p).flatMap(e=>p[e].map(t=>[t,e]))),at={definition_of_done:"Definition of Done criteria list.",item_format:"Default item file format.",history_missing_stream_policy:"Missing history stream handling policy.",sprint_release_format_policy:"Sprint/release format validation policy.",parent_reference_policy:"Parent reference validation policy.",metadata_validation_profile:"Validate metadata profile policy (core|strict|custom).",metadata_required_fields:"Validate custom metadata required-fields list.",lifecycle_stale_blocker_reason_patterns:"Validate lifecycle stale-blocker reason substring patterns (criteria list).",lifecycle_closure_like_blocked_reason_patterns:"Validate lifecycle closure-like blocked_reason substring patterns (criteria list).",lifecycle_closure_like_resolution_patterns:"Validate lifecycle closure-like resolution substring patterns (criteria list).",lifecycle_closure_like_actual_result_patterns:"Validate lifecycle closure-like actual_result substring patterns (criteria list).",governance_preset:"Governance preset policy (minimal|default|strict|custom).",governance_ownership_enforcement:"Governance ownership enforcement policy (none|warn|strict).",governance_create_mode_default:"Governance default create mode (progressive|strict).",governance_close_validation_default:"Governance default close validation mode (off|warn|strict).",governance_require_close_reason:"Governance close-reason requirement policy (enabled|disabled).",governance_create_default_type:"Governance default item type for `pm create` when --type is omitted.",governance_workflow_enforcement:"Governance per-type transition enforcement mode (off|warn|strict).",governance_parent_reference_policy:"Governance parent reference policy (warn|strict_error).",governance_metadata_validation_profile:"Governance metadata validation profile (core|strict|custom).",governance_force_required_for_stale_lock:"Governance stale-lock force policy (enabled|disabled).",test_result_tracking:"Item-level linked test result persistence policy.",untrusted_linked_test_execution:"Permit an explicit per-run override for commands not trusted by this clone.",telemetry_tracking:"Telemetry usage reporting policy.",agent_identity_vocabulary:"Versioned exact legacy-author interpretation vocabulary (summary only).",context:"Context command settings (depth, section toggles, limits)."},it=["lifecycle_stale_blocker_reason_patterns","lifecycle_closure_like_blocked_reason_patterns","lifecycle_closure_like_resolution_patterns","lifecycle_closure_like_actual_result_patterns"],ot=new Set(["metadata_required_fields",...it]),st=new Set(["test_result_tracking","untrusted_linked_test_execution","telemetry_tracking"]),lt=new Set(["governance_require_close_reason","governance_force_required_for_stale_lock"]),ct=new Set(["governance_ownership_enforcement","governance_create_mode_default","governance_close_validation_default"]),_t=new Set(["governance_parent_reference_policy","governance_metadata_validation_profile","governance_workflow_enforcement"]),dt=new Set(["governance_preset","governance_create_default_type"]),be=e=>ot.has(e),ut=e=>ct.has(e),ft=e=>_t.has(e),gt=e=>dt.has(e);function $(e){return e==="definition_of_done"||be(e)}function ke(e){if(he.includes(e))return e;throw new l(`Invalid config scope "${e}". Allowed: ${he.join(", ")}`,s.USAGE)}function Ce(e){if(e==="get"||e==="set"||e==="list"||e==="export")return e;throw ie({command_path:"config",token:e.trim()||"<empty>",allowed:["export","get","list","set"],token_kind:"action"})}function Ee(e){let t=nt[e];if(t)return t;let r=C.map(n=>n.key).join(", ");throw new l(`Invalid config key "${e}". Supported: ${rt.join(", ")} (underscore variants also accepted). Nested leaf settings: ${r}.`,s.USAGE)}function Ae(e,t){let r=[...new Set((e??[]).map(n=>n.trim()).filter(n=>n.length>0))].sort((n,i)=>n.localeCompare(i));if(t){if(r.length>0)throw new l("Config set definition-of-done cannot combine --clear-criteria with --criterion values",s.USAGE);return[]}if(r.length===0)throw new l("Config set definition-of-done requires at least one non-empty --criterion value (or --clear-criteria to clear)",s.USAGE);return r}function Se(e){let t=e?.trim().toLowerCase();if(t==="toon")return"toon";throw t==="json_markdown"?new l("Config set item-format no longer accepts json_markdown. Markdown item files are legacy read/migration input only.",s.USAGE):new l("Config set item-format requires --format toon",s.USAGE)}function z(e){let t=e?.trim().toLowerCase().replaceAll("-","_");if(t==="auto_create"||t==="strict_error")return t;throw new l("Config set history-missing-stream-policy requires --policy with one of: auto_create, strict_error",s.USAGE)}function qe(e){return j(e,"test-result-tracking")}function j(e,t){let r=e?.trim().toLowerCase().replaceAll("-","_");if(r==="enabled"||r==="disabled")return r;throw new l(`Config set ${t} requires --policy with one of: enabled, disabled`,s.USAGE)}function F(e){let t=e?.trim().toLowerCase().replaceAll("-","_");if(t==="enabled"||t==="disabled")return t;throw new l("Config set telemetry-tracking requires --policy with one of: enabled, disabled",s.USAGE)}function E(e){let t=e?.trim().toLowerCase().replaceAll("-","_");if(t==="core"||t==="strict"||t==="custom")return t;throw new l("Config set metadata-validation-profile requires --policy with one of: core, strict, custom",s.USAGE)}function M(e){let t=e?.trim().toLowerCase().replaceAll("-","_");if(t==="minimal"||t==="default"||t==="strict"||t==="custom")return t;throw new l("Config set governance-preset requires --policy with one of: minimal, default, strict, custom",s.USAGE)}function V(e){let t=e?.trim().toLowerCase().replaceAll("-","_");if(t==="none"||t==="warn"||t==="strict")return t;throw new l("Config set governance-ownership-enforcement requires --policy with one of: none, warn, strict",s.USAGE)}function K(e){let t=e?.trim().toLowerCase().replaceAll("-","_");if(t==="progressive"||t==="strict")return t;throw new l("Config set governance-create-mode-default requires --policy with one of: progressive, strict",s.USAGE)}function Y(e){let t=e?.trim().toLowerCase().replaceAll("-","_");if(t==="off"||t==="warn"||t==="strict")return t;if(t==="none"||t==="disabled")return"off";throw new l("Config set governance-close-validation-default requires --policy with one of: off, warn, strict",s.USAGE)}function B(e){let t=typeof e=="string"?e.trim().toLowerCase().replaceAll("-","_"):void 0;if(t==="off"||t==="warn"||t==="strict")return t;if(t==="none"||t==="disabled")return"off";throw new l("Config set governance-workflow-enforcement requires one of: off, warn, strict",s.USAGE)}function W(e){let t=e?.trim().toLowerCase().replaceAll("-","_");if(t==="enabled"||t==="disabled")return t;throw new l("Config set governance-force-required-for-stale-lock requires --policy with one of: enabled, disabled",s.USAGE)}function H(e){let t=e?.trim().toLowerCase().replaceAll("-","_");if(t==="enabled"||t==="disabled")return t;throw new l("Config set governance-require-close-reason requires --policy with one of: enabled, disabled",s.USAGE)}var mt={test_result_tracking:"test-result-tracking",untrusted_linked_test_execution:"untrusted-linked-test-execution"};function D(e,t){let r=mt[e];if(r)return j(t,r);switch(e){case"history_missing_stream_policy":return z(t);case"sprint_release_format_policy":return R(t);case"parent_reference_policy":case"governance_parent_reference_policy":return k(t);case"metadata_validation_profile":case"governance_metadata_validation_profile":return E(t);case"governance_preset":return M(t);case"governance_ownership_enforcement":return V(t);case"governance_create_mode_default":return K(t);case"governance_close_validation_default":return Y(t);case"governance_require_close_reason":return H(t);case"governance_workflow_enforcement":return B(t);case"governance_force_required_for_stale_lock":return W(t);case"telemetry_tracking":return F(t);default:return t.trim().toLowerCase().replaceAll("-","_")}}var ve={author:"author",acceptance_criteria:"acceptance_criteria","acceptance-criteria":"acceptance_criteria",estimated_minutes:"estimated_minutes","estimated-minutes":"estimated_minutes",estimate:"estimated_minutes",close_reason:"close_reason","close-reason":"close_reason",reviewer:"reviewer",risk:"risk",confidence:"confidence",sprint:"sprint",release:"release"},pt=["author","acceptance_criteria","estimated_minutes","close_reason","reviewer","risk","confidence","sprint","release"];function Ge(e,t){let r=[...new Set((e??[]).map(a=>a.trim()).filter(a=>a.length>0))];if(t){if(r.length>0)throw new l("Config set metadata-required-fields cannot combine --clear-criteria with --criterion values",s.USAGE);return[]}if(r.length===0)throw new l("Config set metadata-required-fields requires at least one --criterion value (or --clear-criteria to clear)",s.USAGE);let n=r.map(a=>a.toLowerCase().replaceAll("-","_")),i=n.filter(a=>ve[a]===void 0);if(i.length>0)throw new l(`Config set metadata-required-fields received unsupported values: ${i.join(", ")}. Supported values: ${pt.join(", ")}`,s.USAGE);return[...new Set(n.map(a=>ve[a]))].sort((a,o)=>a.localeCompare(o))}function yt(e,t,r){let n=[...new Set((t??[]).map(i=>i.trim().toLowerCase()).filter(i=>i.length>0))].sort((i,a)=>i.localeCompare(a));if(r){if(n.length>0)throw new l(`Config set ${p[e][0]} cannot combine --clear-criteria with --criterion values`,s.USAGE);return[]}if(n.length===0)throw new l(`Config set ${p[e][0]} requires at least one --criterion value (or --clear-criteria to clear)`,s.USAGE);return n}function Ie(e){return[...new Set(e)].sort((t,r)=>t.localeCompare(r))}function ht(e,t){if(e==="list"||e==="export"){if(typeof t=="string"&&t.trim().length>0)throw new l(`Config action "${e}" does not accept <key>`,s.USAGE);return}if(typeof t!="string"||t.trim().length===0)throw new l(`Config action "${e}" requires <key>`,s.USAGE);return Ee(t)}function Pe(e){if(!e)throw new l("Config action requires <key>",s.USAGE)}var vt={definition_of_done:e=>[...e.workflow.definition_of_done],item_format:e=>e.item_format,history_missing_stream_policy:e=>e.history.missing_stream,sprint_release_format_policy:e=>e.validation.sprint_release_format,parent_reference_policy:e=>e.validation.parent_reference,metadata_validation_profile:e=>e.validation.metadata_profile,metadata_required_fields:e=>[...e.validation.metadata_required_fields],lifecycle_stale_blocker_reason_patterns:e=>[...e.validation.lifecycle_stale_blocker_reason_patterns],lifecycle_closure_like_blocked_reason_patterns:e=>[...e.validation.lifecycle_closure_like_blocked_reason_patterns],lifecycle_closure_like_resolution_patterns:e=>[...e.validation.lifecycle_closure_like_resolution_patterns],lifecycle_closure_like_actual_result_patterns:e=>[...e.validation.lifecycle_closure_like_actual_result_patterns],governance_preset:e=>e.governance.preset,governance_ownership_enforcement:e=>e.governance.ownership_enforcement,governance_create_mode_default:e=>e.governance.create_mode_default,governance_close_validation_default:e=>e.governance.close_validation_default,governance_require_close_reason:e=>e.governance.require_close_reason?"enabled":"disabled",governance_create_default_type:e=>e.governance.create_default_type??"",governance_workflow_enforcement:e=>e.governance.workflow_enforcement??"off",governance_parent_reference_policy:e=>e.governance.parent_reference,governance_metadata_validation_profile:e=>e.governance.metadata_profile,governance_force_required_for_stale_lock:e=>e.governance.force_required_for_stale_lock?"enabled":"disabled",test_result_tracking:e=>e.testing.record_results_to_items?"enabled":"disabled",untrusted_linked_test_execution:e=>e.testing.allow_untrusted_linked_tests?"enabled":"disabled",telemetry_tracking:e=>e.telemetry.enabled?"enabled":"disabled",agent_identity_vocabulary:e=>T(e.agent_identity?.identity_vocabulary),context:e=>({default_depth:e.context.default_depth,activity_limit:e.context.activity_limit,stale_threshold_days:e.context.stale_threshold_days,sections:{...e.context.sections}})};function Q(e,t){return vt[t](e)}function g(e,t){return t.length===0?e:{...e,warnings:t}}async function wt(e,t){let r=process.cwd(),n=e==="project"?b(r,t.path):Z(r),i=x(n);return e==="project"&&await re(n),{pmRoot:n,settingsPath:i}}function bt(e){if(e===void 0)return;let t=e.trim().toLowerCase();if(t==="true"||t==="enabled"||t==="on"||t==="1")return!0;if(t==="false"||t==="disabled"||t==="off"||t==="0")return!1;throw new l(`Context section toggle must be true|false|enabled|disabled, got "${e}"`,s.USAGE)}function we(e,t){let r=e.trim(),n=Number(r);if(/^\d+$/u.test(r)&&Number.isSafeInteger(n)&&n>0)return n;throw new l(`Context ${t} must be a positive integer`,s.USAGE)}async function kt(e,t,r,n,i){let a=!1,o=e.context;if(t.defaultDepth!==void 0){let c=t.defaultDepth.trim().toLowerCase();if(!I.includes(c))throw new l(`Context --default-depth must be one of ${I.join("|")}`,s.USAGE);o.default_depth!==c&&(o.default_depth=c,a=!0)}if(t.activityLimit!==void 0){let c=we(t.activityLimit,"--activity-limit");o.activity_limit!==c&&(o.activity_limit=c,a=!0)}if(t.staleThresholdDays!==void 0){let c=we(t.staleThresholdDays,"--stale-threshold-days");o.stale_threshold_days!==c&&(o.stale_threshold_days=c,a=!0)}let d=[["hierarchy",t.sectionHierarchy],["activity",t.sectionActivity],["progress",t.sectionProgress],["blockers",t.sectionBlockers],["files",t.sectionFiles],["workload",t.sectionWorkload],["staleness",t.sectionStaleness],["tests",t.sectionTests]];for(let[c,_]of d){let m=bt(_);if(m!==void 0){let y=c;o.sections[y]!==m&&(o.sections[y]=m,a=!0)}}return a&&await w(r.pmRoot,e,"config:set:context"),g({scope:n,key:"context",context_settings:{default_depth:o.default_depth,activity_limit:o.activity_limit,stale_threshold_days:o.stale_threshold_days,sections:{...o.sections}},settings_path:r.settingsPath,changed:a},i)}function Ct(e,t,r){if(r.value!==void 0&&r.value!==t)throw new l(`Config set ${e} received both positional value "${t}" and --value "${r.value}". Pass only one.`,s.USAGE);return{...r,value:t}}function Oe(e,t,r,n,i,a){if(i===void 0)return a;if(e!=="set")throw new l(`Config action "${e}" does not accept a positional value. Only "set" takes <value>.`,s.USAGE);if(typeof t!="string"||t.trim().length===0)throw new l('Config action "set" requires <key> before a positional <value>.',s.USAGE);if(n)return Ct(t,i,a);Pe(r);let o=ge(r,i);if(!o.routable)throw new l(o.reason,s.USAGE);if(o.flag==="criterion"){if(a.criterion!==void 0&&a.criterion.length>0)throw new l(`Config set ${t} received both positional value "${i}" and --criterion. Pass criteria via --criterion only when supplying more than one value.`,s.USAGE);return{...a,criterion:o.values}}if(o.flag==="format")return{...a,format:o.value};if(a.policy!==void 0&&D(r,a.policy)!==D(r,o.value))throw new l(`Config set ${t} received both positional value "${i}" and --policy "${a.policy}". Pass only one.`,s.USAGE);return{...a,policy:o.value}}function Et(e){let t=Object.keys(p).map(n=>({key:n,aliases:p[n],value_kind:n==="context"||n==="agent_identity_vocabulary"?"object":$(n)?"string_array":"enum",set_flags:n==="context"?["--default-depth","--activity-limit","--stale-threshold-days","--section-<name>"]:n==="agent_identity_vocabulary"?["--policy","--value","--criterion"]:$(n)?["--criterion","--clear-criteria"]:n==="item_format"?["--format"]:["--policy"],summary:at[n],value:Q(e.settings,n)})),r=C.map(n=>({key:n.key,canonical_key:n.key.replaceAll("_","-"),path:n.path,kind:n.kind,value:N(e.settings,n),summary:n.summary,...n.choices?{choices:[...n.choices]}:{},...n.min===void 0?{}:{min:n.min},...n.max===void 0?{}:{max:n.max}}));return g({scope:e.scope,keys:t,nested_settings:r,count:t.length,settings_path:e.target.settingsPath,changed:!1},e.warnings)}function At(e){let t=Object.fromEntries(Object.keys(p).map(r=>[r,Q(e.settings,r)]));return g({scope:e.scope,values:t,settings_path:e.target.settingsPath,changed:!1},e.warnings)}function St(e,t){let r=Q(e.settings,t),n={scope:e.scope,key:t,settings_path:e.target.settingsPath,changed:!1};return t==="item_format"?g({...n,format:e.settings.item_format,has_explicit_item_format:e.metadata.has_explicit_item_format},e.warnings):t==="context"?g({...n,context_settings:r},e.warnings):t==="agent_identity_vocabulary"?g({...n,identity_vocabulary:r},e.warnings):Array.isArray(r)?g({...n,criteria:r},e.warnings):g({...n,policy:r},e.warnings)}async function qt(e,t,r,n){if(t==="get"){let d=N(e.settings,r);return g({scope:e.scope,key:r.key,nested_setting:{key:r.key,path:r.path,kind:r.kind,value:d},settings_path:e.target.settingsPath,changed:!1},e.warnings)}let i=n.value;if(typeof i!="string")throw new l(`Config set ${r.key} requires a value. Pass it positionally (\`pm config ${e.scope} set ${r.key} <value>\`) or via --value.`,s.USAGE);let a=pe(r,i);if(!a.ok)throw new l(a.error.message,s.USAGE);let o=ye(e.settings,r,a.parsed.value);return o&&await w(e.target.pmRoot,e.settings,`config:set:${r.path}`),g({scope:e.scope,key:r.key,nested_setting:{key:r.key,path:r.path,kind:r.kind,value:a.parsed.value},settings_path:e.target.settingsPath,changed:o},e.warnings)}async function u(e,t,r){t&&await w(e.target.pmRoot,e.settings,r)}function L(e,t,r){return e!==r||t!==r}function f(e,t,r,n){return g({scope:e.scope,key:t,policy:r,settings_path:e.target.settingsPath,changed:n},e.warnings)}function U(e,t,r,n){return g({scope:e.scope,key:t,criteria:r,settings_path:e.target.settingsPath,changed:n},e.warnings)}async function Gt(e,t){let r=Se(t.format),n=e.settings.item_format!==r||!e.metadata.has_explicit_item_format,i;if(n){let a=P(e.settings,O()),o=await se(e.target.pmRoot,r,"config:set:item_format:migrate",a.type_to_folder,e.settings.schema);i={target_format:o.target_format,scanned:o.scanned,migrated:o.migrated,removed:o.removed,warnings:o.warnings},e.settings.item_format=r,await w(e.target.pmRoot,e.settings,"config:set:item_format")}return g({scope:e.scope,key:"item_format",format:e.settings.item_format,has_explicit_item_format:!0,migration:i,settings_path:e.target.settingsPath,changed:n},e.warnings)}async function It(e,t,r){if(t==="history_missing_stream_policy"){let a=z(r.policy),o=e.settings.history.missing_stream!==a;return e.settings.history.missing_stream=a,await u(e,o,"config:set:history_missing_stream_policy"),f(e,t,e.settings.history.missing_stream,o)}if(t==="sprint_release_format_policy"){let a=R(r.policy),o=e.settings.validation.sprint_release_format!==a;return e.settings.validation.sprint_release_format=a,await u(e,o,"config:set:sprint_release_format_policy"),f(e,t,e.settings.validation.sprint_release_format,o)}if(t==="parent_reference_policy"){let a=k(r.policy),o=e.settings.validation.parent_reference!==a||e.settings.governance.preset!=="custom"||e.settings.governance.parent_reference!==a;return e.settings.validation.parent_reference=a,e.settings.governance.preset="custom",e.settings.governance.parent_reference=a,await u(e,o,"config:set:parent_reference_policy"),f(e,t,e.settings.validation.parent_reference,o)}let n=E(r.policy),i=e.settings.validation.metadata_profile!==n||e.settings.governance.preset!=="custom"||e.settings.governance.metadata_profile!==n;return e.settings.validation.metadata_profile=n,e.settings.governance.preset="custom",e.settings.governance.metadata_profile=n,await u(e,i,"config:set:metadata_validation_profile"),f(e,t,e.settings.validation.metadata_profile,i)}async function Pt(e,t,r){if(t==="metadata_required_fields"){let o=Ge(r.criterion,r.clearCriteria),d=o.length!==e.settings.validation.metadata_required_fields.length||o.some((c,_)=>c!==e.settings.validation.metadata_required_fields[_]);return e.settings.validation.metadata_required_fields=o,await u(e,d,"config:set:metadata_required_fields"),U(e,t,[...e.settings.validation.metadata_required_fields],d)}let n={lifecycle_stale_blocker_reason_patterns:e.settings.validation.lifecycle_stale_blocker_reason_patterns,lifecycle_closure_like_blocked_reason_patterns:e.settings.validation.lifecycle_closure_like_blocked_reason_patterns,lifecycle_closure_like_resolution_patterns:e.settings.validation.lifecycle_closure_like_resolution_patterns,lifecycle_closure_like_actual_result_patterns:e.settings.validation.lifecycle_closure_like_actual_result_patterns}[t],i=yt(t,r.criterion,r.clearCriteria),a=i.length!==n.length||i.some((o,d)=>o!==n[d]);return n.splice(0,n.length,...i),await u(e,a,`config:set:${t}`),U(e,t,[...n],a)}async function Ot(e,t,r){if(t==="governance_preset"){let c=M(r.policy),_=e.settings.governance.preset!==c;return e.settings.governance.preset=c,await u(e,_,"config:set:governance_preset"),f(e,t,e.settings.governance.preset,_)}let n=typeof r.policy=="string",i=n?r.policy.trim():"";if(n&&i.length===0){let c=e.settings.governance.create_default_type!==void 0;return delete e.settings.governance.create_default_type,await u(e,c,"config:set:governance_create_default_type"),f(e,t,e.settings.governance.create_default_type??"",c)}if(i.length===0)throw new l('Config set governance-create-default-type requires an item type value (or an empty value "" to clear it)',s.USAGE);let a=P(e.settings,O()),o=J(i,a);if(!o)throw new l(oe(i,a.types,ne(e.target.pmRoot,e.settings.schema)),s.USAGE);let d=e.settings.governance.create_default_type!==o;return e.settings.governance.create_default_type=o,await u(e,d,"config:set:governance_create_default_type"),f(e,t,e.settings.governance.create_default_type,d)}async function Rt(e,t,r){if(t==="governance_ownership_enforcement"){let a=V(r.policy),o=e.settings.governance.preset!=="custom"||e.settings.governance.ownership_enforcement!==a;return e.settings.governance.preset="custom",e.settings.governance.ownership_enforcement=a,await u(e,o,"config:set:governance_ownership_enforcement"),f(e,t,e.settings.governance.ownership_enforcement,o)}if(t==="governance_create_mode_default"){let a=K(r.policy),o=e.settings.governance.preset!=="custom"||e.settings.governance.create_mode_default!==a;return e.settings.governance.preset="custom",e.settings.governance.create_mode_default=a,await u(e,o,"config:set:governance_create_mode_default"),f(e,t,e.settings.governance.create_mode_default,o)}let n=Y(r.policy),i=e.settings.governance.preset!=="custom"||e.settings.governance.close_validation_default!==n;return e.settings.governance.preset="custom",e.settings.governance.close_validation_default=n,await u(e,i,"config:set:governance_close_validation_default"),f(e,t,e.settings.governance.close_validation_default,i)}async function Tt(e,t,r){if(t==="governance_parent_reference_policy"){let a=k(r.policy),o=e.settings.governance.preset!=="custom"||L(e.settings.governance.parent_reference,e.settings.validation.parent_reference,a);return e.settings.governance.preset="custom",e.settings.governance.parent_reference=a,e.settings.validation.parent_reference=a,await u(e,o,"config:set:governance_parent_reference_policy"),f(e,t,e.settings.governance.parent_reference,o)}if(t==="governance_metadata_validation_profile"){let a=E(r.policy),o=e.settings.governance.preset!=="custom"||L(e.settings.governance.metadata_profile,e.settings.validation.metadata_profile,a);return e.settings.governance.preset="custom",e.settings.governance.metadata_profile=a,e.settings.validation.metadata_profile=a,await u(e,o,"config:set:governance_metadata_validation_profile"),f(e,t,e.settings.governance.metadata_profile,o)}let n=B(r.policy),i=(e.settings.governance.workflow_enforcement??"off")!==n;return e.settings.governance.workflow_enforcement=n,await u(e,i,"config:set:governance_workflow_enforcement"),f(e,t,e.settings.governance.workflow_enforcement,i)}async function Nt(e,t,r){if(t==="governance_require_close_reason"){let a=H(r.policy)==="enabled",o=e.settings.governance.require_close_reason!==a;return e.settings.governance.require_close_reason=a,await u(e,o,"config:set:governance_require_close_reason"),f(e,t,e.settings.governance.require_close_reason?"enabled":"disabled",o)}let n=W(r.policy)==="enabled",i=e.settings.governance.preset!=="custom"||e.settings.governance.force_required_for_stale_lock!==n;return e.settings.governance.preset="custom",e.settings.governance.force_required_for_stale_lock=n,await u(e,i,"config:set:governance_force_required_for_stale_lock"),f(e,t,e.settings.governance.force_required_for_stale_lock?"enabled":"disabled",i)}async function $t(e,t,r){if(t==="test_result_tracking"){let a=qe(r.policy)==="enabled",o=e.settings.testing.record_results_to_items!==a;return e.settings.testing.record_results_to_items=a,await u(e,o,"config:set:test_result_tracking"),f(e,t,e.settings.testing.record_results_to_items?"enabled":"disabled",o)}if(t==="untrusted_linked_test_execution"){let a=j(r.policy,"untrusted-linked-test-execution")==="enabled",o=e.settings.testing.allow_untrusted_linked_tests!==a;return e.settings.testing.allow_untrusted_linked_tests=a,await u(e,o,"config:set:untrusted_linked_test_execution"),f(e,t,e.settings.testing.allow_untrusted_linked_tests?"enabled":"disabled",o)}let n=F(r.policy)==="enabled",i=e.settings.telemetry.enabled!==n||!e.settings.telemetry.first_run_prompt_completed;return e.settings.telemetry.enabled=n,e.settings.telemetry.first_run_prompt_completed=!0,await u(e,i,"config:set:telemetry_tracking"),f(e,t,e.settings.telemetry.enabled?"enabled":"disabled",i)}async function Dt(e,t,r){let n=Ae(r.criterion,r.clearCriteria),i=n.length!==e.settings.workflow.definition_of_done.length||n.some((a,o)=>a!==e.settings.workflow.definition_of_done[o]);return e.settings.workflow.definition_of_done=n,await u(e,i,"config:set:definition_of_done"),U(e,t,[...e.settings.workflow.definition_of_done],i)}function Lt(e){let t=e?.trim().toLowerCase().replaceAll("_","-"),r=t?.startsWith("preview-")===!0,n=r?t.slice(8):t;if(n==="add"||n==="remove"||n==="clear")return{operation:n,dryRun:r};throw new l("Config set agent-identity-vocabulary requires --policy add|remove|clear|preview-add|preview-remove|preview-clear",s.USAGE)}function Ut(e,t){if(e==="add"){let r=t?.lastIndexOf("=")??-1;if(r<=0||r===t.length-1)throw new l('Config set agent-identity-vocabulary --policy add requires --value "<legacy-author>=<canonical-harness>"',s.USAGE);return{legacy_author:t.slice(0,r),canonical_harness:t.slice(r+1)}}if(e==="remove"){if(t===void 0)throw new l("Config set agent-identity-vocabulary --policy remove requires --value <legacy-author>",s.USAGE);return{legacy_author:t}}if(t!==void 0)throw new l("Config set agent-identity-vocabulary --policy clear does not accept --value",s.USAGE);return{}}async function zt(e,t){let{operation:r,dryRun:n}=Lt(t.policy),i=Ut(r,t.value),a;try{a=de(e.settings.agent_identity?.identity_vocabulary,{operation:r,...i,observed_authors:t.criterion})}catch(o){throw new l(o.message,s.USAGE)}return a.preview.changed&&!n&&(e.settings.agent_identity={...e.settings.agent_identity,identity_vocabulary:a.vocabulary},await u(e,!0,`config:set:agent_identity.identity_vocabulary:${r}:v${a.preview.version_after}`)),g({scope:e.scope,key:"agent_identity_vocabulary",identity_vocabulary:T(n?e.settings.agent_identity?.identity_vocabulary:a.vocabulary),vocabulary_mutation:a.preview,settings_path:e.target.settingsPath,changed:a.preview.changed&&!n},e.warnings)}async function jt(e,t,r){if(r.clearCriteria===!0&&!$(t))throw new l("--clear-criteria is only supported with config set criteria-list keys",s.USAGE);return t==="item_format"?Gt(e,r):t==="context"?kt(e.settings,r,e.target,e.scope,e.warnings):t==="agent_identity_vocabulary"?zt(e,r):t==="definition_of_done"?Dt(e,t,r):be(t)?Pt(e,t,r):st.has(t)?$t(e,t,r):lt.has(t)?Nt(e,t,r):ut(t)?Rt(e,t,r):ft(t)?Tt(e,t,r):gt(t)?Ot(e,t,r):It(e,t,r)}async function Cr(e,t,r,n,i,a){let o=ke(e),d=Ce(t),c=d==="get"||d==="set"?me(r):void 0,_=c?void 0:ht(d,r),m=Oe(d,r,_,c,a,n),y=await wt(o,i),{settings:h,metadata:De,warnings:Le}=await ae(y.pmRoot),v={scope:o,target:y,settings:h,metadata:De,warnings:Ie(Le)};return c?qt(v,d,c,m):d==="list"?Et(v):d==="export"?At(v):(Pe(_),d==="get"?St(v,_):jt(v,_,m))}var Er={hasGovernanceValidationMirrorChange:L,applyPositionalValue:Oe,normalizeAction:Ce,normalizeCriteria:Ae,normalizeGovernanceCloseValidationDefault:Y,normalizeGovernanceCreateModeDefault:K,normalizeGovernanceForceRequiredForStaleLockPolicy:W,normalizeGovernanceOwnershipEnforcement:V,normalizeGovernancePreset:M,normalizeGovernanceRequireCloseReasonPolicy:H,normalizeGovernanceWorkflowEnforcement:B,normalizeHistoryMissingStreamPolicy:z,normalizeItemFormat:Se,normalizeKey:Ee,normalizeMetadataRequiredFields:Ge,normalizePolicyForConflict:D,normalizeScope:ke,normalizeTelemetryTrackingPolicy:F,normalizeTestResultTrackingPolicy:qe,normalizeValidateMetadataProfile:E,normalizeWarnings:Ie};import{execFile as Ft}from"node:child_process";import Mt from"node:path";import{promisify as Vt}from"node:util";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="7fe99df0-8454-5667-9205-0b861ba212d1")}catch{}})();var Kt=Vt(Ft),Te="@unbrained/pm-cli",Yt="latest",Bt={global:["--global"],project:[]};function Re(e){let t=e.project===!0||e.local===!0||e.scope==="project",r=e.global===!0||e.scope==="global";if(t&&r)throw new l('Options "--project/--local" and "--global" are mutually exclusive.',s.USAGE);return r?"global":"project"}function S(e){return e.trim().toLowerCase()}function Ne(e,t){let r=S(t);return[e.name,e.directory,e.source.input,e.source.location,e.source.package,e.source.repository,e.source.owner&&e.source.repo?`${e.source.owner}/${e.source.repo}`:void 0].some(n=>typeof n=="string"&&S(n)===r)}function Wt(e,t){let r=b(process.cwd(),t.path),n=ee(r,process.cwd());return{selected_root:e==="global"?n.global:n.project}}async function Ht(e,t,r){try{let n=await Kt(e,t,{cwd:r?.cwd,encoding:"utf8"});return{stdout:n.stdout,stderr:n.stderr}}catch(n){let i=typeof n=="object"&&n!==null&&"stderr"in n?String(n.stderr??""):"",a=i.trim().length>0?i.trim():n instanceof Error?n.message:String(n);throw new l(`Command failed: ${e} ${t.join(" ")}
|
|
2
|
-
${a}`,s.GENERIC_FAILURE)}}function q(e){return typeof e.tag=="string"&&e.tag.trim().length>0?e.tag.trim():Yt}function A(e){return typeof e.packageName=="string"&&e.packageName.trim().length>0?e.packageName.trim():Te}async function Qt(e,t){let r=e.commandRunner??Ht,n=A(e),i=q(e),a=`${n}@${i}`,o=["npm","install","-g",a];e.repair===!0&&o.push("--force");let d=X(import.meta.url,["../../.."]),c={requested:!0,status:"planned",package:n,target:a,command:o,before_version:d,...n===Te?{migration_guidance:["Calendar scheduling commands are package-owned. If calendar is absent, run pm package install calendar --project; use pm calendar meet, pm calendar event, or pm calendar remind."]}:{},repair:e.repair===!0};if(t)return c;try{await r(o[0],o.slice(1));let _=await r("pm",["--version"]);return{...c,status:"updated",after_version:_.stdout.trim()||void 0}}catch(_){return{...c,status:"failed",error:_ instanceof Error?_.message:String(_)}}}function Xt(e){return Mt.isAbsolute(e)||e.startsWith(".")||e.startsWith("..")||e.startsWith("file:")}function Jt(e,t){if(e.kind==="npm"){let r=e.input.startsWith("npm:")?e.input.slice(4).trim():e.input.trim();return!Xt(r)&&e.package&&e.package.trim().length>0?`npm:${e.package.trim()}@${t}`:e.input.startsWith("npm:")?e.input:`npm:${e.input}`}return e.input}async function Zt(e,t){let r=Jt(e,t);return e.kind!=="local"||await G(r)?r:await G(e.location)?e.location:r}function xt(e,t,r,n){let i=["pm","package","install",t,r==="global"?"--global":"--project"];return e.kind==="github"&&n&&n.trim().length>0&&i.push("--ref",n.trim()),i}async function $e(e,t){let r=Wt(e,t);return(await le(r.selected_root)).state.entries.filter(n=>n.scope===e)}async function er(e,t,r){let n=await $e(e,t);return n.find(i=>Ne(i,r.name))??n.find(i=>S(i.directory)===S(r.directory))}async function tr(e,t,r,n,i){let a=q(t),o=await Zt(e.source,a),d=xt(e.source,o,n,e.source.ref),c={name:e.name,directory:e.directory,scope:n,source:e.source,status:"planned",command:d,previous_version:e.manifest_version};if(i)return c;try{await ce(o,{install:!0,project:n==="project",global:n==="global",ref:e.source.kind==="github"?e.source.ref:void 0},r);let _=await er(n,r,e);return{...c,status:"updated",installed_version:_?.manifest_version}}catch(_){return{...c,status:"failed",error:_ instanceof Error?_.message:String(_)}}}function rr(e,t,r,n){let i=[r?e.status:void 0,...t.map(a=>a.status)].filter(a=>typeof a=="string");return{requested_cli:r,requested_packages:n,planned:i.filter(a=>a==="planned").length,updated:i.filter(a=>a==="updated").length,skipped:i.filter(a=>a==="skipped").length,failed:i.filter(a=>a==="failed").length}}async function Rr(e,t,r){let n=typeof e=="string"&&e.trim().length>0?e.trim():void 0;if(t.cliOnly===!0&&t.packagesOnly===!0){let h=["package","upgrade",...n?[n]:[],"--packages-only","--dry-run",...Bt[Re(t)]];throw new l('Options "--cli-only" and "--packages-only" are mutually exclusive.',s.USAGE,{code:"package_upgrade_modes_mutually_exclusive",recovery:{suggested_retry:te(h),suggested_retry_args:h}})}let i=Re(t),a=t.dryRun===!0;if(t.cliOnly===!0&&n)throw new l('A package target cannot be used with "--cli-only".',s.USAGE);let o=!(t.packagesOnly===!0||n),d=t.cliOnly!==!0,c=o?await Qt(t,a):{requested:!1,status:"skipped",package:A(t),target:`${A(t)}@${q(t)}`,command:["npm","install","-g",`${A(t)}@${q(t)}`],repair:t.repair===!0,reason:"not_requested"},_=d?await $e(i,r):[];if(n&&(_=_.filter(h=>Ne(h,n)),_.length===0))throw new l(`Managed package "${n}" was not found in ${i} scope.`,s.NOT_FOUND);let m=[];for(let h of _)m.push(await tr(h,t,r,i,a));let y=rr(c,m,o,d);return{ok:y.failed===0,action:"upgrade",dry_run:a,scope:i,target:n,cli:c,packages:m,summary:y}}export{me as a,pe as b,N as c,ye as d,T as e,de as f,Cr as g,Er as h,Rr as i};
|
|
3
|
-
//# sourceMappingURL=chunk-XAOVJG52.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{Bf as O,Gf as Y,Jc as C,Se as S,Te as z,Ue as G,Vc as k,Ve as b,We as V,Xe as $,ag as q,bf as A,bg as K,df as N,dg as H,ec as h,fd as j,ff as E,rc as U,sc as x,uc as P,vc as B}from"./chunk-42BHHNTL.js";import{M as y}from"./chunk-OH7WPD42.js";import{A as c,C as p}from"./chunk-RZQNFHXO.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]="39aa8f48-11f9-528b-b5a2-ff4272a6b644")}catch{}})();var se={create:'client.create({ type: "Task", title: "Example", createMode: "progressive" })',update:'client.update(id, { estimatedMinutes: "45", force: false })',append:'client.append(id, "Body text")',reopen:'client.reopen(id, "The work recurred", { expectedResult: "Verified recovery" })'};function T(e,t,r){let i=`${e} ${t} must be ${r}.`;throw new p(i,c.USAGE,{code:"invalid_argument_value",reason:"invalid_mutation_option_value",field:t,changed:!1,required:i,examples:[se[e]]})}function R(e,t,r){typeof e!="string"&&T(t,r,"a string")}function w(e,t){(e===null||typeof e!="object"||Array.isArray(e))&&T(t,"options","an object")}function W(e,t){(e==="append"||e==="update")&&t.id!==void 0&&R(t.id,e,"id"),e==="item-reopen"&&(t.id!==void 0&&R(t.id,"reopen","id"),t.reason!==void 0&&R(t.reason,"reopen","reason"),t.options!==void 0&&le(t.options))}function xe(e){w(e,"append");for(let t of["body","author","message"])e[t]!==void 0&&R(e[t],"append",t);e.force!==void 0&&typeof e.force!="boolean"&&T("append","force","a boolean")}function le(e){w(e,"reopen");for(let t of Y["item-reopen"].optional){let r=e[t];r!==void 0&&(y(Reflect.get(O,t)).type==="boolean"?typeof r!="boolean"&&T("reopen",t,"a boolean"):R(r,"reopen",t))}}function ue(e,t){return e?t?"a string or string array":"a string array":"a string"}function de(e,t,r,i,a,o){r===void 0||typeof r=="string"&&(!a||o)||i==="priority"&&typeof r=="number"&&Number.isFinite(r)||a&&Array.isArray(r)&&Array.from(r).every(n=>typeof n=="string")||T(e,t,ue(a,o))}function fe(e,t,r){let i=e==="create"?N:E;for(let{param:a}of[...i,...A,{param:"force"}]){if(y(Reflect.get(O,a)).type!=="boolean")continue;let o=r.find(n=>n.keys.includes(a))?.keys??[a];for(let n of o)t[n]!==void 0&&typeof t[n]!="boolean"&&T(e,n,"a boolean")}}function D(e,t,r=!0,i=!1){let a=e==="create"?S:b;for(let{target:o,keys:n,repeatable:s}of a)if(y(Reflect.get(O,o)).type!=="boolean")for(let d of n){let f=i&&d!==o,ae=s===!0&&(o!=="acceptanceCriteria"||f);de(e,d,t[d],o,ae,r||f)}fe(e,t,a)}function Be(e,t){w(t,e);let r=U(t);return D(e,r,!1,h(r)),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]="c360e866-97c3-588b-89b8-683b40783178")}catch{}})();var ce=Symbol("pm.mcp-mutation-transport"),pe=new Set(["create","update","append"]),M={create:{parameters:N,aliases:S,strings:z,repeatables:G},update:{parameters:E,aliases:b,strings:V,repeatables:$}},me=new Set(["activity","aggregate","context","contracts","deps","files-discover","files-lookup","get","graph","health","history","history-attest","list","next","search","stats","telemetry","validate"]);function v(e){return ce in e}function I(e,t){return v(e)?x(t):P(e,t)}function et(e,t,r=[]){let i=P(e,{...e,...t});for(let a of r)Reflect.deleteProperty(i,a);return i}function l(e,t){let r=e[t];return typeof r=="string"&&r.trim().length>0?r:void 0}function u(e,t){let r=e[t];return typeof r=="string"?r.trim().length>0?r:void 0:typeof r=="number"&&Number.isFinite(r)?String(r):void 0}function tt(e,t){let r=e[t];return typeof r=="string"?r:typeof r=="number"&&Number.isFinite(r)?String(r):void 0}function m(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function rt(e,t){if(typeof e=="number"){if(!Number.isInteger(e))throw new p(`${t} must be a finite integer.`,c.USAGE);return e}if(typeof e=="string"&&e.trim().length>0){let r=Number(e);if(!Number.isInteger(r))throw new p(`${t} must be a finite integer.`,c.USAGE);return r}}function nt(e,t){return typeof e.limit=="number"&&Number.isFinite(e.limit)?e.limit:typeof t.limit=="number"&&Number.isFinite(t.limit)?t.limit:l(e,"limit")??l(t,"limit")}function it(e){let t=l(e,"outputFormat");return{json:!0,quiet:!0,author:l(e,"author"),path:l(e,"path"),noExtensions:e.noExtensions===!0||e.no_extensions===!0,noPager:!0,outputInclude:l(e,"outputInclude"),outputLimit:u(e,"outputLimit"),outputBudget:u(e,"outputBudget"),outputSession:l(e,"outputSession"),outputCursor:l(e,"outputCursor"),outputFormat:t==="json"||t==="toon"?t:void 0}}var X=new Set(["tags","blockedBy","blocked_by","skills","fields"]),Q=new Set(["comment","note","learning","reminder","event","dep","depRemove","dep_remove","file","doc","test","unset","addGlob","add_glob","migrate","envSet","env_set","envClear","env_clear"]),ye=new Set([...Q].filter(e=>e!=="file")),Ae=new Set(["files","files-discover","docs","test","test-all"]),Z=new Set(["comments","notes","learnings"]);function Oe(e,t){if(!(!Z.has(e)||!Object.prototype.hasOwnProperty.call(t,"file")))throw new p(`MCP ${e} does not accept options.file. Pass annotation text in options.add instead.`,c.USAGE,{code:"mcp_annotation_file_unavailable",required:"Pass annotation text as JSON data; MCP annotation actions cannot read server-local files."})}var Te=new Set(["claim","release","start-task","pause-task","close-task"]),ee={history:["order"],"history-attest":["verify","output","hashAlgorithm"],list:["status","type","tag","priority","limit","offset"],search:["mode","status","type","tag","priority","limit"],create:["title","type","status","description","body","priority","tags","parent","createMode","create_mode","allowMissingParent","allowDuplicate","inheritFocus"],update:["parent","allowMissingParent","completedAt"],copy:["allowDuplicate"],close:["duplicateOf","completedAt","releaseAssignment"],claim:["start","next","ifAvailable"],release:["pause","handoff"],comments:["ifAbsent"],notes:["ifAbsent"],learnings:["ifAbsent"],extension:["dryRun","offline"],package:["dryRun","offline"],install:["dryRun"],upgrade:["scope","dryRun","cliOnly","packagesOnly","repair","tag","packageName"],append:["body"]},te=["outputInclude","outputLimit","outputBudget","outputFormat","outputSession","outputCursor"];function re(e,t=""){let r={},i=Ae.has(t),a=t==="files"||t==="files-discover"||t==="docs",o=Z.has(t)?ye:Q;for(let[n,s]of Object.entries(e)){if(Array.isArray(s)&&X.has(n)){r[n]=s.join(",");continue}if(n==="note"&&a){r[n]=s;continue}if(typeof s=="string"&&o.has(n)){r[n]=[s];continue}if(typeof s=="string"&&i&&(n==="add"||n==="remove")){r[n]=[s];continue}r[n]=s}return Object.assign(r,Object.fromEntries(Object.getOwnPropertySymbols(e).map(n=>[n,Reflect.get(e,n)]))),r}function _e(e,t,r){let i=l(e,"author");return i!==void 0?i:r!==void 0&&Te.has(r)?l(e,"assignee")??l(t,"assignee"):void 0}function he(e,t){return t!==void 0&&e.author===void 0?{...e,author:t}:e}function Re(e,t,r){let i={},a=M[e],o=new Set([...a.parameters.map(({param:n})=>n),...A.map(({param:n})=>n),...ee[e],...te,"force"]);for(let n of o){let s=a.aliases.find(d=>d.keys.includes(n))?.keys??[n];t[n]===void 0||s.some(d=>r[d]!==void 0)||(i[n]=t[n])}return i}function _(e,t){throw new p(`Invalid MCP ${e} value for "${t}". No changes were made.`,c.USAGE,{code:"invalid_argument_value",reason:"invalid_mutation_option_value",changed:!1,field:t,required:`Provide valid ${e} field values and an options object; inspect the pm_${e} input schema for supported types.`})}function ve(e,t,r){let i=M[e],a=[...i.parameters,...A,{param:"force"}];for(let{param:o}of a){if(y(O[o]).type!=="boolean")continue;let n=(i.aliases.find(s=>s.keys.includes(o))?.keys??[o]).find(s=>r[s]!==void 0&&typeof r[s]!="boolean");n!==void 0&&_(e,n)}for(let o of["idOnly","fullChangedFields"])t[o]!==void 0&&typeof t[o]!="boolean"&&_(e,o)}function Ce(e,t,r){t.options!==void 0&&!m(t.options)&&_(e,"options"),ve(e,t,r);for(let n of X){let s=r[n];Array.isArray(s)&&s.some(d=>typeof d!="string")&&_(e,n)}let i=oe(r,e),a=M[e];for(let{keys:n,target:s}of a.strings)n.some(d=>r[d]!==void 0)&&i[s]===void 0&&_(e,s);let o=a.repeatables.flatMap(({keys:n})=>n).find(n=>{let s=r[n];return s!==void 0&&typeof s!="string"&&(!Array.isArray(s)||s.some(d=>typeof d!="string"))});return o!==void 0&&_(e,o),i}function Se(e,t,r,i){let a=(t==="create"||t==="update")&&v(e),o={...a?Re(t,e,i):r,...i};return(t==="create"||t==="update")&&!a&&D(t,o,!0,m(e.options)&&h(e.options)),a?Ce(t,e,o):re(o,t)}function be(e,t){return!pe.has(e??"")||h(t)?t:j(t)}function ot(e,t){W(t,e);let r=m(e.options)?e.options:void 0,i=y(e.options),a={},o=f=>{i[f]!==void 0||e[f]===void 0||(a[f]=e[f])};for(let f of ee[t??""]??[])o(f);for(let f of te)o(f);t!==void 0&&v(e)&&Oe(t,i);let n=Se(e,t,a,i);if(t==="history-attest"&&v(e)&&(n.output!==void 0||typeof n.verify=="string"))throw new p("MCP history attest does not accept server-local proof paths. Export the returned JSON bundle and pass that JSON object as verify.",c.USAGE);let s=v(e)?e:r??e,d=I(s,he(n,_e(e,n,t)));return be(t,d)}function at(e){if(e.addNote===void 0)return e;let t={...e};return t.note===void 0&&typeof t.addNote=="string"&&(t.note=t.addNote),delete t.addNote,t}function st(e){let t={...e};return t.discoveryNote!==void 0&&t.note===void 0&&typeof t.discoveryNote=="string"&&(t.note=t.discoveryNote),delete t.discover,delete t.discoveryNote,t}function Ne(e){let t=[],r=!0;for(let i of e.trim().toLowerCase()){if(i>="a"&&i<="z"||i>="0"&&i<="9"){t.push(i),r=!1;continue}r||(t.push("-"),r=!0)}return t.at(-1)==="-"&&t.pop(),t.join("")}function lt(e){return!me.has(Ne(e))}function ut(e){return e.trim().toLowerCase().split(/\s+/).filter(Boolean).join(" ")}function Ee(e){return Array.isArray(e)?e.map(t=>String(t)).filter(t=>t.length>0):[]}function dt(e,t){let r=new Set(["action","args","author","cwd","fullChangedFields","id","options","path","query","reason","target"]),i={};for(let[o,n]of Object.entries(e))r.has(o)||(i[o]=n);let a={...i,...t};return delete a.args,delete a.author,a}function ft(e,t){let r=I(t??{},{...t});return{changedFields:e.fullChangedFields===!0?"full":"compact",idOnly:e.idOnly===!0,runnerOptions:r}}function F(e){return{type:u(e,"filterType"),tag:u(e,"filterTag"),priority:u(e,"filterPriority"),deadlineBefore:u(e,"filterDeadlineBefore"),deadlineAfter:u(e,"filterDeadlineAfter"),updatedAfter:u(e,"filterUpdatedAfter"),updatedBefore:u(e,"filterUpdatedBefore"),createdAfter:u(e,"filterCreatedAfter"),createdBefore:u(e,"filterCreatedBefore"),ids:k(e.ids),assignee:u(e,"filterAssignee"),assigneeFilter:u(e,"filterAssigneeFilter")??u(e,"filterAssignee_filter"),parent:u(e,"filterParent"),sprint:u(e,"filterSprint"),release:u(e,"filterRelease"),limit:u(e,"limit"),offset:u(e,"offset")}}function L(e){if(typeof e=="string"&&e.trim().length>0)return e;if(Array.isArray(e))return Ee(e)}function g(e){if(typeof e=="number"&&Number.isFinite(e)||typeof e=="string"&&e.trim().length>0)return e}function ct(e){let t=L(e.kind),r=L(e.exemptIsolate),i=L(e.exemptIsolateType);return{...t===void 0?{}:{kind:t},maxDepth:g(e.maxDepth),limit:g(e.limit),after:l(e,"after"),direction:l(e,"direction"),maxPaths:g(e.maxPaths),sample:g(e.sample),...r===void 0?{}:{exemptIsolate:r},...i===void 0?{}:{exemptIsolateType:i},saveBaseline:e.saveBaseline===!0,rebuild:e.rebuild===!0,clear:e.clear===!0,summary:e.summary===!0,...e.full===!0?{full:!0}:{}}}function ne(e){let t=H(e);return e.ids!==void 0&&(t.ids=k(e.ids)),t}function pt(e){return{status:l(e,"filterStatus"),list:m(e.list)?ne(e.list):F(e),reason:l(e,"reason"),completedAt:l(e,"completedAt")??l(e,"completed_at"),resolution:l(e,"resolution"),expectedResult:l(e,"expectedResult")??l(e,"expected_result")??l(e,"expected"),actualResult:l(e,"actualResult")??l(e,"actual_result")??l(e,"actual"),validateClose:l(e,"validateClose")??l(e,"validate_close"),author:l(e,"author"),message:l(e,"message"),force:e.force===!0?!0:void 0,dryRun:e.dryRun===!0||e.dry_run===!0?!0:void 0,rollback:C(e.rollback),checkpoint:e.checkpoint===!1||e.noCheckpoint===!0||e.no_checkpoint===!0?!1:void 0}}var ge=new Set(["filterStatus","filterType","filterTag","filterPriority","filterDeadlineBefore","filterDeadlineAfter","filterUpdatedAfter","filterUpdatedBefore","filterCreatedAfter","filterCreatedBefore","filterAssignee","filterAssigneeFilter","filterAssignee_filter","filterParent","filterSprint","filterRelease","ids","list","update","limit","offset","dryRun","dry_run","rollback","checkpoint","noCheckpoint","no_checkpoint"]);function J(e){let t={};for(let[r,i]of Object.entries(e))ge.has(r)||(t[r]=i);return ie(t)}function ie(e){return oe(e,"update")}function oe(e,t){let r=re(e,t),i=M[t],a=new Set([...i.parameters,...A].filter(({booleanish:o})=>o===!0).map(({param:o})=>o));for(let{keys:o}of i.repeatables)for(let n of o)typeof r[n]=="string"&&(r[n]=[r[n]]);for(let o of i.strings)for(let n of o.keys){let s=r[n];(typeof s=="number"&&Number.isFinite(s)||s===!1&&a.has(n))&&(r[n]=String(s))}return t==="create"?{...q(r,{requireType:!1})}:K(r)}function mt(e){if(m(e.list)||m(e.update)){let t=m(e.update)?e.update:J(e),r=I(e,ie(t));return{status:u(e,"filterStatus"),list:m(e.list)?ne(e.list):F(e),update:B(t,r),dryRun:e.dryRun===!0||e.dry_run===!0?!0:void 0,rollback:C(e.rollback),checkpoint:e.checkpoint===!1||e.noCheckpoint===!0||e.no_checkpoint===!0?!1:void 0}}return{status:u(e,"filterStatus"),list:F(e),update:I(e,J(e)),dryRun:e.dryRun===!0||e.dry_run===!0?!0:void 0,rollback:C(e.rollback),checkpoint:e.checkpoint===!1||e.noCheckpoint===!0||e.no_checkpoint===!0?!1:void 0}}export{R as a,w as b,xe as c,le as d,Be as e,v as f,et as g,l as h,u as i,tt as j,m as k,rt as l,nt as m,it as n,ee as o,re as p,ot as q,at as r,st as s,Ne as t,lt as u,ut as v,Ee as w,dt as x,ft as y,F as z,ct as A,pt as B,ie as C,mt as D};
|
|
2
|
-
//# sourceMappingURL=chunk-XPQ4RTSF.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{i as a,j as b,k as c,l as d,m as e,n as f,o as g,p as h,q as i,r as j}from"./chunk-Q5V7P6NM.js";import"./chunk-3KMYHYJV.js";import"./chunk-UUQX3PFD.js";import"./chunk-XAOVJG52.js";import"./chunk-34MP7WKK.js";import"./chunk-VHLAVTJN.js";import"./chunk-XPQ4RTSF.js";import"./chunk-4BQD5SW2.js";import"./chunk-OOD2A7AF.js";import"./chunk-I5O3XZOA.js";import"./chunk-42BHHNTL.js";import"./chunk-SPPHDVZE.js";import"./chunk-LWW4F4G2.js";import"./chunk-LEIVUGDH.js";import"./chunk-IB7UB5TE.js";import"./chunk-OH7WPD42.js";import"./chunk-TH5KPAN4.js";import"./chunk-VS565KBX.js";import"./chunk-RZQNFHXO.js";import"./chunk-XAWE4EAK.js";export{h as _testOnlyItemTransaction,j as abandonItemTransaction,f as buildItemCompletionMutations,g as commitItemCompletion,e as commitItemMutations,b as listUpsertKeyCandidates,c as loadGuardedRuntimeSchema,d as previewItemMutations,i as readItemTransaction,a as resolveTransactionSchema};
|
|
2
|
-
//# sourceMappingURL=item-transaction-WIOBZW4E.js.map
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import{a as xt}from"./chunk-GRABKNFL.js";import{a as Ct}from"./chunk-MVL27TAH.js";import"./chunk-DEZPZOQ7.js";import{a as Dt,b as It}from"./chunk-S2U7ECUJ.js";import{c as se,g as wt,l as St,m as At,n as kt,o as _t}from"./chunk-Q5V7P6NM.js";import{a as be}from"./chunk-3KMYHYJV.js";import{$ as Qt,C as vt,D as ht,E as bt,V as Jt,W as Kt,X as Wt,Y as Xt,Z as Yt,_ as Zt,aa as eo,ba as to,ca as ne,da as re,ea as le,r as it,s as ct,t as pt,u as ut,v as oe,w as ie,x as ae,y as ft,z as gt}from"./chunk-UUQX3PFD.js";import"./chunk-XAOVJG52.js";import"./chunk-34MP7WKK.js";import{$a as st,Hc as yt,Qa as nt,Ya as rt,Zb as te,_a as lt,ab as dt,tc as mt,ya as ot}from"./chunk-VHLAVTJN.js";import"./chunk-XPQ4RTSF.js";import{$ as We,A as U,D as Ce,E as De,F as Ie,G as Re,H as Te,J as Ee,K as Oe,L as Me,M as Fe,N as Pe,O as Ne,P as Le,Q as $e,R as He,S as Ue,T as Ge,U as Be,V as je,W as qe,X as Ve,Y as ze,Z as Je,_ as Ke,aa as Xe,ba as Ye,ca as Ze,da as Qe,ea as et,fa as tt}from"./chunk-4BQD5SW2.js";import{oa as at,vb as ee}from"./chunk-OOD2A7AF.js";import"./chunk-I5O3XZOA.js";import{$f as H,Ef as _e,Fe as W,Pc as R,Qf as O,Se as X,Uf as y,Ve as ke,Wc as J,Xf as c,Yf as l,Zc as K,Zf as w,_f as M,ag as Y,bg as Z,cg as xe,dc as Se,ed as _,ng as b,sc as z,tc as Ae,zc as D}from"./chunk-42BHHNTL.js";import"./chunk-SPPHDVZE.js";import"./chunk-LWW4F4G2.js";import{o as Q}from"./chunk-LEIVUGDH.js";import"./chunk-IB7UB5TE.js";import{Bi as E,Cd as q,Mf as h,N as ge,Pf as f,Qf as v,Sa as he,ga as ve,jb as j,qg as we,qh as V,xa as C}from"./chunk-OH7WPD42.js";import"./chunk-TH5KPAN4.js";import"./chunk-VS565KBX.js";import{A as p,C as u}from"./chunk-RZQNFHXO.js";import{a as ye}from"./chunk-XAWE4EAK.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="48b9050b-3290-55d6-82cc-b9d14cc33186")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="1249a9e6-fd70-5a0b-a457-3ef260c78c39")}catch{}})();function Rt(e,t,o){return pt(e,_(t),o)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="e599b2e9-fc63-5982-b7cf-ae208c127f62")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="fd8685dd-856f-51b2-9bfa-f1df88acb070")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="e972ba26-a7b8-5e91-9e63-21416be686eb")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="34816863-a748-527d-8885-777812365ec7")}catch{}})();function Tt(e,t){return mt(_(e),t)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="f27f4c13-4b15-5536-bc5a-b1f263fab5db")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="529dd34d-5a81-504f-9641-28093d41d247")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="6e6bec6b-9415-5f41-87e8-2d1248fba748")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="fd91be06-efd5-5b43-895a-e47a1c144333")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="5760feb1-435b-5b0e-b4ed-c22f6a955bed")}catch{}})();var F={};ye(F,{PROFILE_SUBCOMMANDS:()=>Jt,formatProfileApplyHuman:()=>to,formatProfileLintHuman:()=>eo,formatProfileListHuman:()=>Zt,formatProfileShowHuman:()=>Qt,runProfileApply:()=>Yt,runProfileLint:()=>Xt,runProfileList:()=>Kt,runProfileShow:()=>Wt});(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="2d367793-8aa5-5a00-8c8c-60512a27f62a")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="711dc797-d43c-5ab5-962b-51d88b08614c")}catch{}})();function Et(e,t){let o=_(e.update);return ht({...e,update:o},t)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="12792dbc-d8ac-50aa-8ebd-bc68a70fa195")}catch{}})();async function de(e){typeof e.description=="string"&&e.description.trim()==="-"&&(e.description=await D().resolveValue(e.description,"--description")??"")}import{readFile as oo}from"node:fs/promises";import io from"node:path";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="6154c844-0615-5c2a-ac12-48cb73783d53")}catch{}})();async function ao(e,t,o,i){let a=y(i),r=o.expectedResult??o.expected,n=await ft(e,t,{status:typeof o.status=="string"?o.status:void 0,expectedResult:typeof r=="string"?r:void 0,author:typeof o.author=="string"?o.author:a.author,message:typeof o.message=="string"?o.message:void 0,force:o.force===!0},a);await b(a,n),f(n,a)}async function no(e,t){let o=typeof e.from=="string"?e.from.trim():"";if(o.length>0&&o!=="-"){if(t.getOptionValueSource("stdinJson")==="cli")throw new u("pm item mutate cannot combine --from <path> with explicit --stdin-json. Select one input source.",p.USAGE);try{return await oo(io.resolve(process.cwd(),o),"utf8")}catch(i){throw new u(`pm item mutate could not read --from ${o}: ${be(i)}`,p.USAGE,{code:"mutation_document_unreadable",required:"Pass a readable JSON, JSON Lines, or envelope document path, or `-` for stdin.",why:"The whole document must be available before any tracker write begins."})}}return await D().resolveValue("-","--stdin-json")??""}async function ro(e,t){let o=y(t),i=await no(e,t);if(i.trim().length===0)throw new u("pm item mutate requires a non-empty JSON batch on stdin or via --from <path>.",p.USAGE);if(e.transactionId!==void 0&&(typeof e.transactionId!="string"||e.transactionId.trim().length===0))throw new u("pm item mutate requires --transaction-id <value> to be non-empty when provided.",p.USAGE);let a=C(process.cwd(),o.path),r=await E(a),n=await It({pmRoot:a,input:i,settings:r,...typeof e.transactionId=="string"?{transactionId:e.transactionId}:{},...typeof e.upsertKey=="string"?{upsertKey:e.upsertKey}:{}}),{mutations:s,references:d,rows:m}=n,g=n.transaction_id,S={transaction_id:g,transaction_id_source:n.transaction_id_source,...n.upsert_key===void 0?{}:{upsert_key:n.upsert_key}},A=se(e),I=V(typeof e.author=="string"?e.author:o.author,r.author_default);if(e.dryRun===!0){let T=await Dt({pmRoot:a,author:I,plan:n});f({...S,dry_run:!0,validation:T.validation,mutation_count:s.length,mutations:s,references:d,rows:T.rows},o);return}let $=await At({pmRoot:a,transactionId:g,author:I,mutations:s,...A});f({...$,...S,mutation_count:s.length,references:d,rows:m},o)}function lo(e,t){return typeof e=="string"&&e.trim().length>0?e.trim():typeof t=="string"?t.trim():""}async function so(e,t,o,i){let a=y(i),r=typeof o.transactionId=="string"?o.transactionId.trim():"";if(r.length===0)throw new u("pm item complete requires --transaction-id <value>.",p.USAGE);let n=lo(t,o.reason);if(n.length===0)throw new u("pm item complete requires a close reason.",p.USAGE);let s=Object.fromEntries(["file","doc","test","comment","note","learning"].filter(k=>o[k]!==void 0).map(k=>[k,o[k]])),d=o.force===!0,{lockTtlSeconds:m,lockWaitMs:g}=se(o),S={...typeof o.resolution=="string"?{resolution:o.resolution}:{},...typeof o.expectedResult=="string"?{expectedResult:o.expectedResult}:{},...typeof o.actualResult=="string"?{actualResult:o.actualResult}:{},...typeof o.completedAt=="string"?{completedAt:o.completedAt}:{},...typeof o.validateClose=="string"?{validateClose:o.validateClose}:{},...d?{force:!0}:{}},A={id:e,reason:n,...Object.keys(s).length===0?{}:{evidence:s},...Object.keys(S).length===0?{}:{closeOptions:S},...d?{releaseOptions:{force:!0}}:{}},I=C(process.cwd(),a.path),$=V(typeof o.author=="string"?o.author:a.author,(await E(I)).author_default);if(o.dryRun===!0){let k=kt(A),zt=await St({pmRoot:I,transactionId:r,author:$,mutations:k});f({transaction_id:r,dry_run:!0,validation:zt,mutation_count:k.length,mutations:k},a);return}let T=await _t({pmRoot:I,transactionId:r,author:$,...A,lockTtlSeconds:m,lockWaitMs:g});f({...T,mutation_count:Object.keys(T.results).length},a)}function Ot(e){let t=e.commands.find(o=>o.name()==="item")??e.command("item").description("Run item lifecycle operations.");t.command("reopen <id> <reason>").option("--status <value>","Active target status: open or in_progress").option("--expected-result <value>","Current active planning expectation; otherwise the receipt offers recovery").option("--expected <value>","Alias for --expected-result").option("--message <value>","Human-readable recurrence history message").option("--force","Override ownership or stale-lock conflicts").option("--author <value>","Mutation author").description("Reopen terminal work with recurrence evidence.").action(ao),t.command("mutate").option("--transaction-id <value>","Stable idempotency key used to resume an interrupted batch; derived from the document when omitted").option("--stdin-json","Read the JSON mutation array from stdin",!0).option("--from <path>","Read the JSON, JSON Lines, or envelope document from a file (- for stdin)").option("--upsert-key <field>","Update the existing item whose field matches instead of creating a duplicate").option("--dry-run","Validate and preview the batch without writing").option("--create-compensation <mode>","Created-item compensation policy: close or delete","close").option("--lock-ttl-seconds <n>","Workspace transaction lock lifetime in seconds").option("--lock-wait-ms <n>","Maximum time to wait for the workspace transaction lock").option("--author <value>","Mutation author").description("Apply SDK-backed mutations atomically.").action(ro),t.command("complete <id> [reason]").requiredOption("--transaction-id <value>","Stable idempotency key for the composed completion").option("--reason <value>","Close reason when omitted positionally").option("--file <value>","Linked file evidence",c).option("--doc <value>","Linked documentation evidence",c).option("--test <value>","Linked test evidence",c).option("--comment <value>","Evidence comment",c).option("--note <value>","Completion note",c).option("--learning <value>","Durable completion learning",c).option("--resolution <value>","Structured resolution evidence").option("--expected-result <value>","Expected result evidence").option("--actual-result <value>","Actual result evidence").option("--completed-at <value>","Actual completion time").option("--validate-close <mode>","Close validation: off, warn, or strict").option("--lock-ttl-seconds <n>","Workspace transaction lock lifetime in seconds").option("--lock-wait-ms <n>","Maximum time to wait for the workspace transaction lock").option("--dry-run","Validate and preview completion without writing").option("--force","Override lifecycle and ownership conflicts").option("--author <value>","Completion author").description("Close with evidence and release the claim.").action(so)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="458845bd-2d07-59d5-b322-6ab634fcefa9")}catch{}})();async function co(e,t){let o=y(t),i=Array.isArray(e.event)?e.event:[],a=await ot(C(process.cwd(),o.path),{historyEvent:i,allActionable:e.allActionable===!0,dryRun:e.dryRun===!0,planFingerprint:l(e,"planFingerprint"),limit:e.limit,attributedAuthor:l(e,"attributedAuthor"),reviewer:l(e,"reviewer"),reason:l(e,"reason")});f(a,o)}function Mt(e){e.command("history-author-acknowledge").option("--event <item-id:line>","Unknown-author event coordinate (repeatable)",c).option("--all-actionable","Select all actionable events").option("--dry-run","Preview a deterministic source-bound plan").option("--plan-fingerprint <sha256>","Apply the exact fingerprint returned by --dry-run").option("--limit <n>","Maximum coordinate rows returned in the plan").option("--attributed-author <value>","Reviewed principal attribution").option("--reviewer <value>","Disposition reviewer").option("--reason <value>","Review evidence").description("Append audited dispositions for immutable unknown-author events.").action(co)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="1308ca6f-9404-5fda-9726-f72364c45d02")}catch{}})();function Ft(e){let t=_(e.options);return vt({...e,options:t})}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="e2514244-d31d-5ee4-b037-b9101f9a24e1")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="10a4ed4d-39d3-5b7b-87b1-4a6f95f0f2ab")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="796e71dc-4693-50da-bbb8-57b19ff0af95")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="e464e0e0-01a2-56c9-a05d-9b1b9dd6a6ee")}catch{}})();function ce(e,t,o,i){if(t.trim().toLowerCase()!=="add"||!o?.trim())return;let a=l(i,"add")??l(i,"text")??l(i,"note")??l(i,"body")??l(i,"comment"),r=l(i,"file"),n=[e,o.trim()];a!==void 0?n.push("--add",a):i.stdin===!0?n.push("--stdin"):r!==void 0?n.push("--file",r):n.push("--add","-");let s=q(n),d=q([e,o.trim(),"--add","-"]);throw new u(`The positional token "add" was parsed as the item id, while "${o.trim()}" was parsed as annotation text. ${e} does not use an add subcommand.`,p.USAGE,{code:"annotation_transposed_subcommand",reason:"noun_verb_object_transposition",required:`Place the item id immediately after ${e}, then use --add for annotation text.`,examples:[...new Set([s,d])],recovery:{attempted_command:`pm ${e} add ${o.trim()}`,normalized_args:[e,"add",o.trim()],parsed_positionals:[{role:"transposed_subcommand",value:"add"},{role:"item_id",value:o.trim()}],suggested_retry:s}})}function Pt(e,t,o){let i=o.flatMap(a=>{let r=l(t,a);return r===void 0?[]:[{alias:a,value:r}]});if([...new Set(i.map(({value:a})=>a))].length>1)throw new u(`Specify ${e} text with one alias or the same value across aliases: ${i.map(({alias:a})=>`--${a}`).join(", ")}`,p.USAGE,{code:"annotation_alias_conflict"});return i[0]?.value}function po(e,t){let o=typeof t.edit=="number"?t.edit:void 0,i=typeof t.delete=="number"?t.delete:void 0,a=Pt("comment",t,["add","text","body","comment"]),r=typeof e=="string"?e:void 0,n=t.stdin===!0,s=l(t,"file");if(+(a!==void 0)+ +(r!==void 0)+Number(n)+ +(s!==void 0)>1)throw a!==void 0&&r!==void 0&&!n&&s===void 0?new u("Specify comment text either as positional [text] or with --add, not both",p.USAGE):new u("Specify comment text with exactly one source: positional [text], --add, --stdin, or --file",p.USAGE);let d=a??r;return{add:d,readFromStdin:n,readFromFile:s,editIndex:o,deleteIndex:i,isMutation:typeof d=="string"||n||s!==void 0||o!==void 0||i!==void 0}}function Nt(e,t,o){let i=Pt(e,o,e==="note"?["add","text","note"]:["add","text"]),a=typeof t=="string"?t:void 0;if(i!==void 0&&a!==void 0)throw new u(`Specify ${e} text either as positional [text] or with --add, not both`,p.USAGE);let r=i??a,n=e==="note"?l(o,"addJson"):void 0,s=o.stdin===!0,d=l(o,"file"),m=typeof o.edit=="number"?o.edit:void 0,g=typeof o.delete=="number"?o.delete:void 0;return{add:r,addJson:n,readFromStdin:s,readFromFile:d,editIndex:m,deleteIndex:g,isMutation:typeof r=="string"||n!==void 0||s||d!==void 0||m!==void 0||g!==void 0}}async function uo(e,t,o,i){let a=y(i),r=Date.now();ce("comments",e,t,o);let n=po(t,o),s=await it(e,{add:n.add,stdin:n.readFromStdin,file:n.readFromFile,edit:n.editIndex,delete:n.deleteIndex,limit:l(o,"limit"),fullHistory:o.fullHistory===!0,ifAbsent:o.ifAbsent===!0,author:l(o,"author"),message:l(o,"message"),ownershipAppendBypass:o.ownershipAppendBypass===!0,force:!!o.force},a);n.isMutation&&s.changed!==!1&&await b(a,s),pe("comments",s,a,r)}async function mo(e,t,o,i){let a=y(i),r=Date.now();ce("notes",e,t,o);let n=Nt("note",t,o),s=await bt(e,{add:n.add,addJson:n.addJson,stdin:n.readFromStdin,file:n.readFromFile,edit:n.editIndex,delete:n.deleteIndex,limit:l(o,"limit"),since:l(o,"since"),eventType:l(o,"eventType"),includeMeta:o.includeMeta===!0,fullHistory:o.fullHistory===!0,ifAbsent:o.ifAbsent===!0,author:l(o,"author"),message:l(o,"message"),ownershipAppendBypass:o.ownershipAppendBypass===!0,force:!!o.force},a);n.isMutation&&s.changed!==!1&&await b(a,s),pe("notes",s,a,r)}async function fo(e,t,o,i){let a=y(i),r=Date.now();ce("learnings",e,t,o);let n=Nt("learning",t,o),s=await ct(e,{add:n.add,stdin:n.readFromStdin,file:n.readFromFile,edit:n.editIndex,delete:n.deleteIndex,limit:l(o,"limit"),fullHistory:o.fullHistory===!0,ifAbsent:o.ifAbsent===!0,author:l(o,"author"),message:l(o,"message"),ownershipAppendBypass:o.ownershipAppendBypass===!0,force:!!o.force},a);n.isMutation&&s.changed!==!1&&await b(a,s),pe("learnings",s,a,r)}function pe(e,t,o,i){f(t,o),o.profile&&v(`profile:command=${e} took_ms=${Date.now()-i}`)}function Lt(e,t){let o=e.command("comments").argument("<id>","Item id").argument("[text]","Optional comment text shorthand (equivalent to --add)").option("--add <text>","Append comment text; use text=<value> for structured input or - for stdin").option("--stdin","Read comment text from stdin (supports multiline markdown)").option("--file <path>","Read comment text from a file or stdin (-)").option("--edit <index>","Replace one comment using positional text, --add, --stdin, or --file",t("--edit")).option("--delete <index>","Delete the comment at 1-based <index>",t("--delete")).option("--limit <n>","Return only latest n comments").option("--full-history","Return complete comment history instead of a bounded mutation receipt").option("--if-absent","Append only when resolved author and text are absent").option("--author [value]","Comment author; defaults to PM_AUTHOR or settings").option("--message <value>","History message").option("--force","Force ownership override").description("List, add, edit, or delete comments for an item.").action(uo);w(o,"--body <text>","Alias for --add",!1),w(o,"--text <text>","Alias for --add",!1),w(o,"--comment <text>","Alias for --add",!1);let i=e.command("notes").argument("<id>","Item id").argument("[text]","Optional note text shorthand for --add").option("--add <text>","Add a text note (- reads stdin)").option("--note <text>","Alias for --add").option("--add-json <json>","Append a JSON event").option("--stdin","Read note text from stdin").option("--file <path>","Read note from file or stdin (-)").option("--edit <index>","Replace a 1-based note using the selected text input",t("--edit")).option("--delete <index>","Delete the note at 1-based <index>",t("--delete")).option("--limit <n>","Return only latest n notes").option("--since <timestamp>","Filter JSON events from this ISO time").option("--event-type <value>","Filter JSON events by top-level type").option("--include-meta","Include count and truncation metadata").option("--full-history","Return complete note history instead of a bounded receipt").option("--if-absent","Append only when resolved author and text are absent").option("--author [value]","Author; defaults to PM_AUTHOR/settings").option("--message <value>","History message").option("--force","Force ownership override").description("Manage merge-safe text notes and JSON context events.").action(mo);w(i,"--text <text>","Alias for --add",!1);let a=e.command("learnings").argument("<id>","Item id").argument("[text]","Optional learning text shorthand for --add").option("--add <text>","Append learning text; use text=<value> or - for stdin").option("--stdin","Read learning text from stdin").option("--file <path>","Read learning text from a file or stdin (-)").option("--edit <index>","Replace one learning using positional text, --add, --stdin, or --file",t("--edit")).option("--delete <index>","Delete the learning at 1-based <index>",t("--delete")).option("--limit <n>","Return only latest n learnings").option("--full-history","Return complete learning history instead of a bounded receipt").option("--if-absent","Append only when resolved author and text are absent").option("--author [value]","Learning author (optional; falls back to PM_AUTHOR/settings)").option("--message <value>","History message").option("--force","Force ownership override").description("List, add, edit, or delete learnings for an item.").action(fo);w(a,"--text <text>","Alias for --add",!1)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="d861c49e-6054-54af-a733-069cd9238f8a")}catch{}})();function ue(e,t){return o=>{let i=Number(o);if(!Number.isInteger(i)||i<t)throw new u(`${e} must be an integer greater than or equal to ${t}.`,p.USAGE);return i}}async function yo(e,t,o){let i=y(o);if(t.scope!==void 0&&t.scope!=="project"&&t.scope!=="global")throw new u("--scope must be either project or global.",p.USAGE);let a=await st({paths:e,scope:t.scope,limit:typeof t.limit=="number"?t.limit:void 0,offset:typeof t.offset=="number"?t.offset:void 0,noTruncate:t.noTruncate===!0,strictRead:t.strictRead===!0,explain:t.explain===!0,lineRange:typeof t.lines=="string"?rt(t.lines):void 0,decisionDepth:typeof t.decisionDepth=="number"?t.decisionDepth:void 0},i);f(a,i)}function $t(e){e.command("lookup").argument("<paths...>","Project-relative or absolute source paths").option("--scope <scope>","Restrict links to project or global scope").option("--limit <n>","Maximum referencing items to return",ue("--limit",1)).option("--offset <n>","Number of referencing items to skip",ue("--offset",0)).option("--no-truncate","Return every referencing item").option("--strict-read","Fail when any authoritative item cannot be read").option("--explain","Include ranked source-to-work rationale").option("--lines <start:end>","Attribute an inclusive source line range").option("--decision-depth <n>","Maximum governing-decision relationship depth",ue("--decision-depth",1)).description("Find and explain pm items that govern requested source paths.").action(yo)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="016842ad-f6e8-56a4-9b9f-f4eaf4c1be71")}catch{}})();var go=["add-","apply-","list-","remove-","show-"],vo=new Set(["field","fields","help","status","statuses","type","types"]);function me(e){let t=e.trim(),o=t.toLowerCase();return o.length===0?!1:t[0]===o[0]||vo.has(o)||go.some(i=>o.startsWith(i))}function G(e){if(e!=null){if(typeof e=="number"){if(!Number.isInteger(e))throw new u("--order must be a finite integer.",p.USAGE);return e}if(typeof e=="string"){if(e.trim().length===0)return;let t=Number(e);if(!Number.isInteger(t))throw new u("--order must be a finite integer.",p.USAGE);return t}throw new u("--order must be a finite integer.",p.USAGE)}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="7f9ea812-e170-5c91-a646-88286797d97d")}catch{}})();function P(e){if(Array.isArray(e))return e;if(typeof e=="string")return[e]}var N={};ye(N,{SCHEMA_SUBCOMMANDS:()=>Ie,_testOnlySchemaCommand:()=>tt,formatSchemaAddFieldHuman:()=>We,formatSchemaAddStatusHuman:()=>qe,formatSchemaAddTypeHuman:()=>Be,formatSchemaApplyPresetHuman:()=>Qe,formatSchemaEvolutionMigrationHuman:()=>De,formatSchemaInferTypesHuman:()=>et,formatSchemaListFieldsHuman:()=>Ye,formatSchemaListHuman:()=>ze,formatSchemaRemoveFieldHuman:()=>Xe,formatSchemaRemoveStatusHuman:()=>Ve,formatSchemaRemoveTypeHuman:()=>je,formatSchemaShowFieldHuman:()=>Ze,formatSchemaShowHuman:()=>Je,formatSchemaShowStatusHuman:()=>Ke,runSchemaAddField:()=>Ne,runSchemaAddStatus:()=>Ee,runSchemaAddType:()=>Re,runSchemaApplyPreset:()=>Ue,runSchemaEvolutionMigration:()=>Ce,runSchemaInferTypes:()=>Ge,runSchemaList:()=>Me,runSchemaListFields:()=>$e,runSchemaRemoveField:()=>Le,runSchemaRemoveStatus:()=>Oe,runSchemaRemoveType:()=>Te,runSchemaShow:()=>Fe,runSchemaShowField:()=>He,runSchemaShowStatus:()=>Pe,runWorkflowPolicyAction:()=>U});(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="a4b4d693-ba4c-529a-a5d4-8f6c874830ad")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="f3dbaad8-f73e-5d14-aeaa-aaf077a944f6")}catch{}})();function ho(e,t){let o=t.normalizedSubcommand;return o!=="rename-type"&&o!=="rename-field"&&o!=="remap-status"?null:e.runSchemaEvolutionMigration({kind:o,from:t.typeName,to:l(t.options,"to"),...o==="rename-field"&&typeof t.options.type=="string"?{type:t.options.type}:{}},{migrationId:l(t.options,"migrationId")??l(t.options,"migration_id"),dryRun:t.options.dryRun===!0,author:t.author,force:t.force},t.globalOptions)}function bo(e,t){let{normalizedSubcommand:o,typeName:i,globalOptions:a,author:r,force:n}=t;switch(o){case"list":return e.runSchemaList(a);case"show":return e.runSchemaShow(i,a);case"show-status":return e.runSchemaShowStatus(i,a);case"list-fields":return e.runSchemaListFields(a);case"show-field":return e.runSchemaShowField(i,a);case"remove-type":return e.runSchemaRemoveType(i,{author:r,force:n},a);case"remove-field":return e.runSchemaRemoveField(i,{author:r,force:n},a);case"remove-status":return e.runSchemaRemoveStatus(i,{author:r,force:n},a);case"apply-preset":return e.runSchemaApplyPreset(i,{author:r,force:n},a);default:return null}}async function wo(e,t){let{normalizedSubcommand:o,typeName:i,options:a,globalOptions:r}=t,{author:n,force:s,description:d}=t,m=ho(e,t);if(m)return m;let g=bo(e,t);if(g)return g;switch(o){case"add-field":return e.runSchemaAddField(i,{type:typeof a.type=="string"?a.type:void 0,commands:t.commands,description:d,cliFlag:typeof a.cliFlag=="string"?a.cliFlag:void 0,alias:t.aliases,required:!!a.required,requiredOnCreate:!!a.requiredOnCreate,allowUnset:a.allowUnset!==!1,requiredTypes:t.requiredTypes,author:n,force:s},r);case"add-status":return e.runSchemaAddStatus(i,{role:t.roles,alias:t.aliases,description:d,order:t.order,author:n,force:s},r);default:return a.infer===!0?e.runSchemaInferTypes({minCount:t.minCount,apply:!!a.apply,author:n,force:s},r):e.runSchemaAddType(i,{description:d,defaultStatus:t.defaultStatus,folder:typeof a.folder=="string"?a.folder:void 0,alias:t.aliases,author:n,force:s},r)}}function So(e,t){if("migration_id"in t){h(`${e.formatSchemaEvolutionMigrationHuman(t)}
|
|
2
|
-
`);return}switch(t.action){case"list":h(`${e.formatSchemaListHuman(t)}
|
|
3
|
-
`);return;case"show":h(`${e.formatSchemaShowHuman(t)}
|
|
4
|
-
`);return;case"show-status":h(`${e.formatSchemaShowStatusHuman(t)}
|
|
5
|
-
`);return;case"list-fields":h(`${e.formatSchemaListFieldsHuman(t)}
|
|
6
|
-
`);return;case"show-field":h(`${e.formatSchemaShowFieldHuman(t)}
|
|
7
|
-
`);return;case"remove-type":h(`${e.formatSchemaRemoveTypeHuman(t)}
|
|
8
|
-
`);break;case"remove-field":h(`${e.formatSchemaRemoveFieldHuman(t)}
|
|
9
|
-
`);break;case"apply-preset":h(`${e.formatSchemaApplyPresetHuman(t)}
|
|
10
|
-
`);break;case"infer-types":h(`${e.formatSchemaInferTypesHuman(t)}
|
|
11
|
-
`);break;case"add-field":h(`${e.formatSchemaAddFieldHuman(t)}
|
|
12
|
-
`);break;case"add-status":h(`${e.formatSchemaAddStatusHuman(t)}
|
|
13
|
-
`);break;case"remove-status":h(`${e.formatSchemaRemoveStatusHuman(t)}
|
|
14
|
-
`);break;default:h(`${e.formatSchemaAddTypeHuman(t)}
|
|
15
|
-
`);break}t.warnings.length>0&&v(`schema ${t.action} warnings: ${H(t.warnings)}`)}function Ht(e){if(Array.isArray(e))return e.flatMap(t=>t.split(",")).map(t=>t.trim()).filter(t=>t.length>0)}async function Ao(e,t,o,i){let a=y(i),r=Date.now(),{SCHEMA_SUBCOMMANDS:n}=N,s=(e??"").trim().toLowerCase(),d=t;if(ko(s,n),!n.includes(s)&&d===void 0&&!me(e)&&(d=e,s="add-type"),!n.includes(s))throw R({command_path:"schema",token:s,allowed:n});let m=he.find(g=>g===s);if(Se(s,o.dryRun===!0),m)f(await U(m,t,{definition:o.definition,policy:l(o,"policy"),message:l(o,"message"),author:l(o,"author"),dryRun:o.dryRun===!0},a),a);else{let g=await wo(N,{normalizedSubcommand:s,typeName:d,options:o,aliases:P(o.alias),roles:P(o.role),commands:Ht(o.commands),requiredTypes:Ht(o.requiredTypes),defaultStatus:l(o,"defaultStatus")??l(o,"default_status"),order:G(o.order),minCount:G(o.minCount),author:l(o,"author"),force:!!o.force,description:l(o,"description"),globalOptions:a});a.json===!0||a.defaultOutputFormat==="json"?f(g,a):a.quiet||So(N,g)}a.profile&&v(`profile:command=schema took_ms=${Date.now()-r}`)}function ko(e,t){if(!e)throw new u(`pm schema requires a subcommand. Allowed: ${t.join(", ")}`,p.USAGE,{code:"missing_required_argument",examples:["pm schema list","pm schema show Task","pm schema show-status open",'pm schema add-type Spike --description "Time-boxed investigation" --default-status open',"pm schema remove-type Spike","pm schema add-status review --role active --alias in_review","pm schema remove-status review","pm schema add-field severity_level --type string --commands create,update","pm schema list-fields","pm schema apply-preset agile","pm schema add-type --infer --min-count 10","pm schema rename-type Spike --to Experiment --migration-id spike-v2 --dry-run","pm schema rename-field severity --to impact --migration-id severity-v2","pm schema remap-status review --to verifying --migration-id review-v2"]})}function Ut(e){let t=e.command("schema").option("--definition <json>","Policy or proposed fields JSON").option("--policy <id>","Policy id for policy-approve").option("--message <text>","Audit rationale for a policy mutation").argument("[subcommand]","Required; schema verb (list/show, add/remove, rename/remap, policy-*), or custom type shorthand").argument("[name]","Definition/source name or item id; policy-mode: advise|refuse").option("--description <text>","Type, status, or field description").option("--default-status <status>","Default status for this type").option("--folder <dir>","Storage folder for items of this custom type").option("--alias <name>","Alias for the custom type, status, or field flag (repeatable, csv-friendly)",c).option("--role <value>","Lifecycle role for a custom status (repeatable): draft, active, blocked, terminal, terminal_done, terminal_canceled, default_open, default_close, default_cancel",c).option("--order <n>","Display/sort order for a custom status").optionsGroup("Field options (add-field):").option("--type <type>","Value type for a custom field (add-field): string, number, boolean, string_array, array, object").option("--commands <list>","Field commands (repeatable/csv): create, update, update_many, list, search, calendar, context",c).option("--cli-flag <flag>","Override the auto-derived CLI flag for a custom field (add-field)").option("--required","Mark a custom field as always required (add-field)").option("--required-on-create","Mark a custom field as required at create time (add-field)").option("--no-allow-unset","Disallow clearing a custom field via --unset (add-field)").option("--required-types <list>","Restrict a custom field's requirement to specific item types (add-field; repeatable, comma-friendly)",c).optionsGroup("Type inference and migration options:").option("--infer","Infer custom item types from title-prefix conventions (add-type; preview unless --apply)").option("--min-count <n>","Minimum items sharing a prefix for add-type --infer (default 10)").option("--apply","Register inferred types (add-type --infer); without it the command previews only").option("--to <name>","Target definition name for rename/remap migrations").option("--migration-id <id>","Stable idempotency key for a resumable schema migration").option("--dry-run","Preview rename/remap migrations and workflow-policy actions without writes").option("--author <value>","Mutation author").option("--force","Force ownership/lock override").description("Manage types, statuses, fields, presets, and workflow policies.");w(t,"--default_status <status>","Alias for --default-status",!1),w(t,"--migration_id <id>","Alias for --migration-id",!1),t.action(Ao)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="648325fa-04f5-5fd5-bad1-161cb0fdb790")}catch{}})();var _o=new Set(ge.map(e=>e.toLowerCase())),xo=new Set(_e.map(e=>e==="estimate"?"estimatedMinutes":e));async function Co(e,t,o,i,a){switch(t){case"list":return e.runProfileList();case"show":return e.runProfileShow(o);case"lint":return e.runProfileLint(o);default:return e.runProfileApply(o,{dryRun:i.dryRun===!0,author:typeof i.author=="string"?i.author:void 0,force:i.force===!0},a)}}function Do(e,t){switch(t.action){case"list":h(`${e.formatProfileListHuman(t)}
|
|
16
|
-
`);return;case"show":h(`${e.formatProfileShowHuman(t)}
|
|
17
|
-
`);return;case"lint":h(`${e.formatProfileLintHuman(t)}
|
|
18
|
-
`);return;default:h(`${e.formatProfileApplyHuman(t)}
|
|
19
|
-
`),t.warnings.length>0&&v(`profile apply warnings: ${H(t.warnings)}`);break}}function Io(e){return t=>{let o=Number(t);if(!Number.isInteger(o)||o<1)throw new u(`${e} must be a positive integer (1-based index).`,p.USAGE);return o}}function Gt(e,t){e.option("--filter-has-notes",`Select only items that have notes before ${t}`).option("--filter-no-notes",`Select only items that have no notes before ${t}`).option("--filter-has-learnings",`Select only items that have learnings before ${t}`).option("--filter-no-learnings",`Select only items that have no learnings before ${t}`).option("--filter-has-files",`Select only items that have linked files before ${t}`).option("--filter-no-files",`Select only items that have no linked files before ${t}`).option("--filter-has-docs",`Select only items that have linked docs before ${t}`).option("--filter-no-docs",`Select only items that have no linked docs before ${t}`).option("--filter-has-tests",`Select only items that have linked tests before ${t}`).option("--filter-no-tests",`Select only items that have no linked tests before ${t}`).option("--filter-has-comments",`Select only items that have comments before ${t}`).option("--filter-no-comments",`Select only items that have no comments before ${t}`).option("--filter-has-deps",`Select only items that have dependencies before ${t}`).option("--filter-no-deps",`Select only items that have no dependencies before ${t}`).option("--filter-has-body",`Select only items that have a non-empty body before ${t}`).option("--filter-empty-body",`Select only items with an empty body before ${t}`).option("--filter-has-linked-command",`Select only items whose linked tests carry a runnable command before ${t}`).option("--filter-no-linked-command",`Select only items whose linked tests carry no runnable command before ${t}`).option("--filter-reviewer-missing",`Select only items missing reviewer before ${t}`).option("--filter-risk-missing",`Select only items missing risk before ${t}`).option("--filter-confidence-missing",`Select only items missing confidence before ${t}`).option("--filter-sprint-missing",`Select only items missing sprint before ${t}`).option("--filter-release-missing",`Select only items missing release before ${t}`)}var Ro=[["filterHasNotes","filterNoNotes","--filter-has-notes","--filter-no-notes"],["filterHasLearnings","filterNoLearnings","--filter-has-learnings","--filter-no-learnings"],["filterHasFiles","filterNoFiles","--filter-has-files","--filter-no-files"],["filterHasDocs","filterNoDocs","--filter-has-docs","--filter-no-docs"],["filterHasTests","filterNoTests","--filter-has-tests","--filter-no-tests"],["filterHasComments","filterNoComments","--filter-has-comments","--filter-no-comments"],["filterHasDeps","filterNoDeps","--filter-has-deps","--filter-no-deps"],["filterHasBody","filterEmptyBody","--filter-has-body","--filter-empty-body"],["filterHasLinkedCommand","filterNoLinkedCommand","--filter-has-linked-command","--filter-no-linked-command"]];function Bt(e){let t=o=>e[o]===!0?!0:void 0;for(let[o,i,a,r]of Ro)if(e[o]===!0&&e[i]===!0)throw new u(`Cannot combine ${a} with ${r} for the same field.`,p.USAGE);return{filterReviewerMissing:t("filterReviewerMissing"),filterRiskMissing:t("filterRiskMissing"),filterConfidenceMissing:t("filterConfidenceMissing"),filterSprintMissing:t("filterSprintMissing"),filterReleaseMissing:t("filterReleaseMissing"),hasNotes:t("filterHasNotes"),hasLearnings:t("filterHasLearnings"),hasFiles:t("filterHasFiles"),hasDocs:t("filterHasDocs"),hasTests:t("filterHasTests"),hasComments:t("filterHasComments"),hasDeps:t("filterHasDeps"),hasBody:t("filterHasBody"),hasLinkedCommand:t("filterHasLinkedCommand"),noNotes:t("filterNoNotes"),noLearnings:t("filterNoLearnings"),noFiles:t("filterNoFiles"),noDocs:t("filterNoDocs"),noTests:t("filterNoTests"),noComments:t("filterNoComments"),noDeps:t("filterNoDeps"),emptyBody:t("filterEmptyBody"),noLinkedCommand:t("filterNoLinkedCommand")}}function fe(e,t){for(let o of t){let i=[],a=e.args,r=n=>(e.args!==a&&(i.length=0,a=e.args),i.push(n),i);o.required?e.requiredOption(o.option,o.description):o.repeatable?e.option(o.option,o.description,r):e.option(o.option,o.description);for(let n of o.aliasOptions??[])W(o.option,n.option)?w(e,n.option,n.description,o.repeatable===!0,o.repeatable?r:void 0):o.repeatable?e.option(n.option,n.description,r):e.option(n.option,n.description)}}function To(e){let t=o=>typeof e[o]=="string"?e[o]:void 0;return{type:t("filterType"),tag:t("filterTag"),priority:t("filterPriority"),deadlineBefore:t("filterDeadlineBefore"),deadlineAfter:t("filterDeadlineAfter"),updatedAfter:t("filterUpdatedAfter"),updatedBefore:t("filterUpdatedBefore"),createdAfter:t("filterCreatedAfter"),createdBefore:t("filterCreatedBefore"),ids:t("ids"),assignee:t("filterAssignee"),assigneeFilter:t("filterAssigneeFilter")??t("filterAssignee_filter"),parent:t("filterParent"),sprint:t("filterSprint"),release:t("filterRelease"),filterAcMissing:e.filterAcMissing===!0?!0:void 0,filterEstimatesMissing:e.filterEstimatesMissing===!0||e.filterEstimateMissing===!0?!0:void 0,filterResolutionMissing:e.filterResolutionMissing===!0?!0:void 0,filterMetadataMissing:e.filterMetadataMissing===!0?!0:void 0,...Bt(e),limit:t("limit"),offset:t("offset"),includeBody:!0}}function L(...e){for(let t of e)if(typeof t=="string")return t}function Eo(e,t,o){if(!(e!=="many"||t!==void 0||o.title!==void 0||o.type!==void 0))throw new u("pm create many is not a command; bulk creation is pm item mutate.",p.USAGE,{code:"bulk_create_route",required:"Pipe a JSON array, JSON Lines, or {schema_version, mutations} document to pm item mutate, or pass --from <path>.",why:"pm item mutate commits every record in one workspace transaction with a replay-safe transaction id, so an interrupted or repeated import never duplicates items.",nextSteps:["pm item mutate --from items.jsonl --dry-run --json","pm item mutate --from items.jsonl --upsert-key external_id --json","pm guide lifecycle"],examples:["pm item mutate --from items.jsonl --json",`printf '%s\\n' '{"title":"First","type":"Task"}' '{"title":"Second","type":"Task"}' | pm item mutate --json`]})}function Oo(e,t,o){return typeof t=="string"&&t.length>0?{positionalType:e,positionalTitle:t}:typeof e!="string"||e.length===0?{positionalType:void 0,positionalTitle:void 0}:typeof o.title=="string"&&o.title.trim().length>0&&o.type===void 0?{positionalType:e,positionalTitle:void 0}:{positionalType:void 0,positionalTitle:e}}function Mo(e,t,o){if(e!==void 0||typeof t!="string"||t.length===0||o.title!==void 0||o.type!==void 0||!_o.has(t.trim().toLowerCase()))return;let i=t.trim();throw new u(`pm create needs a title \u2014 "${i}" looks like an item type, not a title. Use either: pm create ${i} "<title>" or pm create "<title>" --type ${i}.`,p.USAGE,{code:"create_positional_type_without_title",why:'Without this guard the single positional is used as the title and the type defaults to Task \u2014 so the command would silently create a Task literally titled "'+i+'".',examples:[`pm create ${i} "Wire up SSO for the agent harness"`,`pm create "Wire up SSO for the agent harness" --type ${i}`],nextSteps:[`Re-run with both type and title: pm create ${i} "<title>"`]})}var Fo=["body","bodyFile","description","dep","depRemove","comment","note","learning","file","test","doc","reminder","event","typeOption","field","ids"];function B(e){let t=Fo.flatMap(o=>{let i=e[o],a=typeof i=="string"&&i.trim()==="-"?1:Array.isArray(i)?i.filter(n=>typeof n=="string"&&n.trim()==="-").length:0,r=`--${o.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`)}`;return Array.from({length:a},()=>r)});if(e.stdinJson===!0&&t.unshift("--stdin-json"),t.length>1)throw new u(`Only one option may consume stdin per command invocation. Found: ${t.join(", ")}.`,p.USAGE)}function jt(e,t,o){let i=[];t&&i.push("body"),o&&i.push("description"),Ae(e,i)}function qt(e,t){return!t&&typeof e.description=="string"&&e.description.trim()==="-"}async function Vt(e,t,o,i){let a=await E(C(process.cwd(),i.path));return wt(e,t,o,we(a.schema).definitions)}async function Po(e,t,o,i){let a=y(i),r=Date.now();B(o);let n=o.stdinJson===!0;if(n){let A=await D().resolveValue("-","--stdin-json");o=await Vt(A??"","create",o,a)}Eo(e,t,o);let s=Oo(e,t,o);Mo(s.positionalType,s.positionalTitle,o),typeof s.positionalType=="string"&&s.positionalType.length>0&&o.type===void 0&&(o.type=s.positionalType),typeof s.positionalTitle=="string"&&s.positionalTitle.length>0&&o.title===void 0&&(o.title=s.positionalTitle);let d=qt(o,n);n||await de(o);let m=typeof o.bodyFile=="string";m&&(o.body=await K(String(o.bodyFile),o.body!==void 0?String(o.body):void 0),delete o.bodyFile);let g=Y(o,{requireType:!1});jt(g,m,d),n&&z(g);let S=await Tt(g,a);await b(a,S),f(S,a),a.profile&&v(`profile:command=create took_ms=${Date.now()-r}`)}function No(e){return{type:l(e,"filterType"),tag:l(e,"filterTag"),priority:l(e,"filterPriority"),deadlineBefore:l(e,"filterDeadlineBefore"),deadlineAfter:l(e,"filterDeadlineAfter"),updatedAfter:l(e,"filterUpdatedAfter"),updatedBefore:l(e,"filterUpdatedBefore"),createdAfter:l(e,"filterCreatedAfter"),createdBefore:l(e,"filterCreatedBefore"),ids:l(e,"ids"),assignee:l(e,"filterAssignee"),assigneeFilter:L(e.filterAssigneeFilter,e.filterAssignee_filter),parent:l(e,"filterParent"),sprint:l(e,"filterSprint"),release:l(e,"filterRelease"),...Bt(e),limit:l(e,"limit"),offset:l(e,"offset")}}async function Lo(e,t){let o=y(t),i=Date.now();B(e),e.ids=await J(l(e,"ids"));let a=await ut({status:l(e,"filterStatus"),list:No(e),reason:l(e,"reason"),completedAt:l(e,"completedAt"),resolution:l(e,"resolution"),expectedResult:L(e.expectedResult,e.expected_result,e.expected),actualResult:L(e.actualResult,e.actual_result,e.actual),validateClose:e.validateClose===!0?"warn":l(e,"validateClose"),author:l(e,"author"),message:l(e,"message"),force:!!e.force,dryRun:e.dryRun===!0?!0:void 0,rollback:l(e,"rollback"),checkpoint:e.checkpoint===!1?!1:void 0},o);await b(o,a),f(a,o),o.profile&&v(`profile:command=close-many took_ms=${Date.now()-i}`)}async function $o(e,t){let o=y(t),i=Date.now();B(e),e.ids=await J(l(e,"ids"));let a=await Et({status:l(e,"filterStatus"),list:To(e),update:Z(xe(e)),dryRun:e.dryRun===!0?!0:void 0,rollback:l(e,"rollback"),checkpoint:e.checkpoint===!1?!1:void 0},o);await b(o,a),f(await O("update-many",[],e,o,a),o),o.profile&&v(`profile:command=update-many took_ms=${Date.now()-i}`)}async function Ho(e,t,o,i){let a=y(i),r=Date.now(),n=typeof o.reason=="string"&&o.reason.trim().length>0&&o.reason||typeof o.closeReason=="string"&&o.closeReason.trim().length>0&&o.closeReason||void 0,s=typeof t=="string"&&t.length>0?t:n,d=await(o.releaseAssignment===!0?yt:te)(e,s,{author:l(o,"author"),message:l(o,"message"),validateClose:o.validateClose===!0?"warn":l(o,"validateClose"),force:!!o.force,duplicateOf:l(o,"duplicateOf"),completedAt:l(o,"completedAt"),resolution:l(o,"resolution"),expectedResult:L(o.expectedResult,o.expected_result,o.expected),actualResult:L(o.actualResult,o.actual_result,o.actual)},a);await b(a,d),f(d,a),a.profile&&v(`profile:command=close took_ms=${Date.now()-r}`)}function Uo(e){let t={...e},o=[["blocked_by","blockedBy"],["resume_context","resumeContext"],["from_search","fromSearch"],["step_title","stepTitle"],["step_body","stepBody"],["step_owner","stepOwner"],["step_status","stepStatus"],["step_evidence","stepEvidence"],["step_blocked_reason","stepBlockedReason"],["step_replacement","stepReplacement"],["depends_on","dependsOn"],["link_kind","linkKind"],["link_note","linkNote"],["promote_to_item_dep","promoteToItemDep"],["allow_multiple_active","allowMultipleActive"],["decision_text","decisionText"],["decision_rationale","decisionRationale"],["decision_evidence","decisionEvidence"],["discovery_text","discoveryText"],["validation_text","validationText"],["validation_command","validationCommand"],["validation_expected","validationExpected"],["materialize_type","materializeType"],["materialize_parent","materializeParent"],["materialize_tags","materializeTags"]];for(let[a,r]of o)t[a]!==void 0&&t[r]===void 0&&(t[r]=t[a]);let i=Y(t,{requireType:!1});return i.blockedBy=t.blockedBy,i}function Go(e,t){if(!e)throw new u(`pm plan requires a subcommand. Allowed: ${t.join(", ")}`,p.USAGE,{code:"missing_required_argument",examples:['pm plan create --title "Refactor lock retry"',"pm plan show pm-a1b2 --depth standard",'pm plan add-step pm-a1b2 --step-title "Read lock.ts"']});if(!t.includes(e))throw R({command_path:"plan",token:e,allowed:t,examples:e==="list"||e==="ls"?["pm list --type Plan","pm list --all --type Plan"]:void 0,retry_command:e==="list"||e==="ls"?"pm list --type Plan":void 0})}function Bo(e,t){if(e!=="reorder-step"||typeof t!="string")return;let o=Number.parseInt(t,10);if(!Number.isFinite(o))throw new u(`reorder-step requires an integer new order, got "${t}"`,p.USAGE);return o}async function jo(e,t,o,i,a,r){let n=y(r),s=Date.now(),d=(e??"").trim().toLowerCase();Go(d,gt);let m=Uo(a),g=Bo(d,i),S=d==="create"&&typeof t=="string"&&t.length>0&&m.title===void 0?void 0:t;S===void 0&&typeof t=="string"&&t.length>0&&(m.title=t);let A=await Ft({subcommand:d,id:S,stepRef:o,reorderTo:g,options:m,global:n});await b(n,A),f(A,n),n.profile&&v(`profile:command=plan took_ms=${Date.now()-s}`)}async function qo(e,t,o){if(e!==void 0)throw new u("merge reconcile takes no positional arguments.",p.USAGE);let i=await le({dryRun:t.dryRun===!0,force:t.force===!0,stage:t.stage===!0,message:typeof t.message=="string"?t.message:void 0,author:o.author},o);f(i,o),i.ok||(process.exitCode=p.GENERIC_FAILURE)}async function Vo(e,t,o,i,a,r){if(e===void 0||t===void 0||o===void 0||i===void 0)throw new u("merge driver requires <artifact> <base> <ours> <theirs> (git supplies %O %A %B). Example: pm merge driver history %O %A %B",p.USAGE);let n=await re({artifact:e,basePath:t,oursPath:o,theirsPath:i,outputPath:typeof a.output=="string"?a.output:void 0,itemPath:typeof a.itemPath=="string"?a.itemPath:void 0,prefer:typeof a.prefer=="string"?a.prefer:void 0},r);f(n,r),n.ok||(process.exitCode=p.GENERIC_FAILURE)}async function zo(e,t,o,i,a,r,n){let s=y(n),d=Date.now();switch(e.trim().toLowerCase()){case"install":{if(t!==void 0)throw new u("merge install takes no positional arguments.",p.USAGE);let m=await Q({dryRun:r.dryRun===!0,preCommitHook:r.preCommitHook===!0},s);f(m,s);break}case"reconcile":await qo(t,r,s);break;case"report":{if(t!==void 0)throw new u("merge report takes no positional arguments.",p.USAGE);let m=await ee({includeReconciled:r.includeReconciled===!0});f(m,s),m.ok||(process.exitCode=p.GENERIC_FAILURE);break}case"driver":await Vo(t,o,i,a,r,s);break;default:throw R({command_path:"merge",token:e,allowed:j,display_name:"merge"})}s.profile&&v(`profile:command=merge took_ms=${Date.now()-d}`)}async function Jo(e,t,o){let i=y(o),a=Date.now(),r=await oe(e,{title:l(t,"title"),author:l(t,"author"),message:l(t,"message"),allowDuplicate:t.allowDuplicate===!0},i);await b(i,r),f(r,i),i.profile&&v(`profile:command=copy took_ms=${Date.now()-a}`)}async function Ko(e,t,o){let i=y(o),a=Date.now(),r=await ae(e,{clear:t.clear===!0},i);f(r,i),i.profile&&v(`profile:command=focus took_ms=${Date.now()-a}`)}async function Wo(e,t,o){let i=y(o),a=Date.now();B(t);let r=t.stdinJson===!0;if(r){let g=await D().resolveValue("-","--stdin-json");t=await Vt(g??"","update",t,i)}let n=qt(t,r);r||await de(t);let s=typeof t.bodyFile=="string";s&&(t.body=await K(String(t.bodyFile),t.body!==void 0?String(t.body):void 0),delete t.bodyFile);let d=Z(t);jt(d,s,n),r&&z(d);let m=await Ct(e,d,i);await b(i,m),f(await O("update",[e],t,i,m),i),i.profile&&v(`profile:command=update took_ms=${Date.now()-a}`)}async function Xo(e,t,o){let i=y(o),a=Date.now(),r=await ie(e,{author:l(t,"author"),message:l(t,"message"),force:!!t.force,dryRun:t.dryRun===!0},i);r.dry_run!==!0&&await b(i,r),f(r,i),i.profile&&v(`profile:command=delete took_ms=${Date.now()-a}`)}function Yo(e,t){let o=l(t,"body"),i=l(t,"text"),a=typeof e=="string"?e:void 0;if([o,i,a].filter(n=>n!==void 0).length>1)throw new u("Specify append text with exactly one source: positional [text], --body, or --text",p.USAGE);let r=o??i??a;if(r===void 0)throw new u("Missing append text. Provide it as positional [text], --body <value>, or --text <value> (use - for stdin).",p.USAGE);return r}async function Zo(e,t,o,i){let a=y(i),r=Date.now(),n=await Rt(e,{body:Yo(t,o),author:l(o,"author"),message:l(o,"message"),force:!!o.force},a);await b(a,n),f(n,a),a.profile&&v(`profile:command=append took_ms=${Date.now()-r}`)}async function Qo(e,t,o,i){let a=y(i),r=Date.now(),{PROFILE_SUBCOMMANDS:n}=F,s=(e??"").trim().toLowerCase();if(!s)throw new u(`pm profile requires a subcommand. Allowed: ${n.join(", ")}`,p.USAGE,{code:"missing_required_argument",examples:["pm profile list","pm profile show agile","pm profile apply agile --dry-run","pm profile lint agile"]});if(!n.includes(s))throw R({command_path:"profile",token:s,allowed:n});let d=await Co(F,s,t,o,a);a.json===!0||a.defaultOutputFormat==="json"?f(d,a):a.quiet||Do(F,d),d.action==="lint"&&!d.ok&&(process.exitCode=p.GENERIC_FAILURE),a.profile&&v(`profile:command=profile took_ms=${Date.now()-r}`)}function x(e,t){return P(e[t])??[]}async function ei(e,t,o){let i=y(o),a=Date.now(),r=x(t,"add"),n=x(t,"addGlob"),s=x(t,"remove"),d=x(t,"migrate"),m=await lt(e,{add:r,addGlob:n,remove:s,migrate:d,note:l(t,"note"),list:!!t.list,appendStable:!!t.appendStable,validatePaths:!!t.validatePaths,author:l(t,"author"),message:l(t,"message"),force:!!t.force},i);(r.length>0||n.length>0||s.length>0||d.length>0)&&await b(i,m),f(await O("files",[e],t,i,m),i),i.profile&&v(`profile:command=files took_ms=${Date.now()-a}`)}async function ti(e,t,o){let i=y(o),a=Date.now(),r={...o.optsWithGlobals(),...t},n=await dt(e,{apply:!!r.apply,note:l(r,"note"),appendStable:!!r.appendStable,author:l(r,"author"),message:l(r,"message"),force:!!r.force},i);n.changed&&await b(i,n),f(n,i),i.profile&&v(`profile:command=files.discover took_ms=${Date.now()-a}`)}async function oi(e,t,o){let i=y(o),a=Date.now(),r=x(t,"add"),n=x(t,"addGlob"),s=x(t,"remove"),d=x(t,"migrate"),m=await nt(e,{add:r,addGlob:n,remove:s,migrate:d,note:l(t,"note"),list:!!t.list,validatePaths:!!t.validatePaths,author:l(t,"author"),message:l(t,"message"),force:!!t.force},i);(r.length>0||n.length>0||s.length>0||d.length>0)&&await b(i,m),f(await O("docs",[e],t,i,m),i),i.profile&&v(`profile:command=docs took_ms=${Date.now()-a}`)}async function ii(e,t,o){let i=y(o),a=Date.now(),r=await at(e,{format:t.format,maxDepth:l(t,"maxDepth"),collapse:t.collapse,summary:t.summary===!0,full:t.full===!0,nodeLimit:l(t,"nodeLimit"),edgeLimit:l(t,"edgeLimit"),tokenBudget:l(t,"tokenBudget"),cursor:l(t,"cursor"),direction:l(t,"direction"),...Array.isArray(t.kind)?{kind:t.kind}:{}},i);f(r,i),i.profile&&v(`profile:command=deps took_ms=${Date.now()-a}`)}function sn(e,t={}){let o=e.command("create").argument("[type-or-title]",'Title, or type followed by title (e.g. task "Fix bug")').argument("[title]","Title following an item type").description("Create a new project management item.");if(fe(o,X),o.option("--stdin-json","Item JSON from stdin; explicit flags override").option("--body-file <path>","Load body from a file or stdin (-); conflicts with --body").option("--clear-deps","Clear dependency entries").option("--clear-comments","Clear comments").option("--clear-notes","Clear notes").option("--clear-learnings","Clear learnings").option("--clear-files","Clear linked files").option("--clear-tests","Clear linked tests").option("--clear-docs","Clear linked docs").option("--clear-reminders","Clear reminders").option("--clear-events","Clear events").option("--clear-type-options","Clear type options").option("--allow-duplicate","Explicitly create even when strict similarity governance finds likely duplicates").option("--inherit-focus","Use saved focus as parent (CLI default; SDK/MCP opt in)",!0).option("--no-inherit-focus","Ignore saved focus; --unset parent also suppresses it").action(Po),t.targetCommandName==="create")return;e.command("copy").argument("<id>","Source item id").option("--title <value>","Optional title override for the copied item").option("--author <value>","Mutation author").option("--message <value>","History message").option("--allow-duplicate","Explicitly copy even when strict similarity governance finds likely duplicates").description("Copy an item into a new item id while resetting lifecycle fields.").action(Jo),e.command("focus").argument("[id]","Item id to focus (omit to show current focus)").option("--clear","Clear the focused item").description("Set/clear/show the session focused item that new items default --parent to.").action(Ko);let i=e.command("update").argument("<id>","Item id").description("Update item fields and metadata.");fe(i,ke),i.option("--stdin-json","Read a full item JSON document from stdin; explicit flags override document values").option("--body-file <path>","Load body from a file or stdin (-); conflicts with --body").option("--replace-deps","Atomically replace dependency entries with the provided --dep values").option("--replace-tests","Atomically replace linked test entries with the provided --test values").option("--replace-files","Atomically replace linked file entries with the provided --file values").option("--replace-docs","Atomically replace linked doc entries with the provided --doc values").option("--clear-deps","Clear dependency entries").option("--clear-comments","Clear comments").option("--clear-notes","Clear notes").option("--clear-learnings","Clear learnings").option("--clear-files","Clear linked files").option("--clear-tests","Clear linked tests").option("--clear-docs","Clear linked docs").option("--clear-reminders","Clear reminders").option("--clear-events","Clear events").option("--clear-type-options","Clear type options").option("--force","Force ownership override"),i.action(Wo),Ot(e);let a=e.command("update-many").description("Bulk-update matched items with dry-run plans and rollback checkpoints.").option("--filter-status <value>","Filter by status before applying updates").option("--filter-type <value>","Filter by item type before applying updates").option("--filter-tag <value>","Filter by tag before applying updates").option("--filter-priority <value>","Filter by priority before applying updates").option("--filter-deadline-before <value>","Filter by deadline upper bound before applying updates").option("--filter-deadline-after <value>","Filter by deadline lower bound before applying updates").option("--filter-updated-after <value>","Filter by updated_at lower bound before applying updates (ISO/relative)").option("--filter-updated-before <value>","Filter by updated_at upper bound before applying updates (ISO/relative)").option("--filter-created-after <value>","Filter by created_at lower bound before applying updates (ISO/relative)").option("--filter-created-before <value>","Filter by created_at upper bound before applying updates (ISO/relative)").option("--filter-assignee <value>","Filter by assignee before applying updates").option("--filter-assignee-filter <value>","Filter assignee presence: assigned|unassigned before applying updates").option("--filter-parent <value>","Filter by parent item ID before applying updates").option("--filter-sprint <value>","Filter by sprint before applying updates").option("--filter-release <value>","Filter by release before applying updates").option("--filter-ac-missing","Select only items missing acceptance_criteria (bulk backfill)").option("--filter-estimates-missing","Select only items missing estimated_minutes (bulk backfill)").option("--filter-resolution-missing","Select only terminal items missing resolution (bulk backfill)").option("--filter-metadata-missing","Select only items missing any tracked metadata (AC, estimate, or resolution)");Gt(a,"applying updates"),a.option("--ids <value>","Explicit ID allowlist: comma/newline text, - stdin, or @path file").option("--limit <n>","Limit matched item count before apply/preview").option("--offset <n>","Skip first n matched rows before apply/preview").option("--dry-run","Preview per-item diffs and checkpoint intent without mutating").option("--rollback <value>","Rollback a prior update-many checkpoint ID").option("--no-checkpoint","Disable checkpoint creation during apply mode").option("--title, -t <value>","Set title").option("--description, -d <value>","Set description").option("--body, -b <value>","Set body (allow empty string)").option("--status, -s <value>","Set status (use close command for closed)").option("--priority, -p <value>","Set priority").option("--type <value>","Set type").option("--tags <value>","Set comma-separated tags (replaces existing). Use --add-tags / --remove-tags to mutate additively.").option("--add-tags <value>","Add tags additively without replacing existing (repeatable; CSV accepted)",c).option("--remove-tags <value>","Remove tags from the existing list (repeatable; CSV accepted)",c).option("--deadline <value>","Set deadline (ISO/date string or relative)").option("--estimate, --estimated-minutes <value>","Set estimated minutes").option("--acceptance-criteria <value>","Set acceptance criteria").option("--ac <value>","Alias for --acceptance-criteria").option("--add-ac <value>","Add one semicolon-free acceptance criterion without replacing the existing list (repeatable)",c).option("--remove-ac <value>","Remove one semicolon-free acceptance criterion by exact text match (repeatable)",c).option("--definition-of-ready <value>","Set definition of ready").option("--order <value>","Set planning order/rank integer").option("--rank <value>","Alias for --order").option("--goal <value>","Set goal identifier").option("--objective <value>","Set objective identifier").option("--value <value>","Set business value summary").option("--impact <value>","Set business impact summary").option("--outcome <value>","Set expected outcome summary").option("--why-now <value>","Set why-now rationale").option("--assignee <value>","Set assignee").option("--parent <value>","Set parent item ID").option("--reviewer <value>","Set reviewer").option("--risk <value>","Set risk level").option("--confidence <value>","Set confidence level").option("--sprint <value>","Set sprint identifier").option("--release <value>","Set release identifier").option("--blocked-by <value>","Set blocked-by item ID or reason").option("--blocked-reason <value>","Set blocked reason").option("--unblock-note <value>","Set unblock rationale note").option("--reporter <value>","Set issue reporter").option("--severity <value>","Set issue severity").option("--environment <value>","Set issue environment context").option("--repro-steps <value>","Set issue reproduction steps").option("--resolution <value>","Set issue resolution summary").option("--expected-result <value>","Set issue expected behavior").option("--expected <value>","Short alias for --expected-result").option("--actual-result <value>","Set issue observed behavior").option("--actual <value>","Short alias for --actual-result").option("--affected-version <value>","Set affected version identifier").option("--fixed-version <value>","Set fixed version identifier").option("--component <value>","Set issue component ownership").option("--regression [value]","Set regression marker; bare flag means true, or pass true|false|1|0").option("--customer-impact <value>","Set customer impact summary").option("--dep <value>","Add dependency entry id=<id>,kind=<kind>,author=<author>,created_at=<timestamp>",c).option("--dep-remove <value>","Remove dependency entries by id/kind/author/timestamp signature",c).option("--replace-deps","Atomically replace dependency entries with provided --dep values").option("--replace-tests","Atomically replace linked tests with provided --test values").option("--replace-files","Atomically replace linked files with provided --file values").option("--replace-docs","Atomically replace linked docs with provided --doc values").option("--comment <value>","Add comment seed author=<value>,created_at=<iso|now>,text=<value>",c).option("--note <value>","Add note seed author=<value>,created_at=<iso|now>,text=<value>",c).option("--learning <value>","Add learning seed author=<value>,created_at=<iso|now>,text=<value>",c).option("--file <value>","Add linked file path=<value>,scope=<project|global>,note=<text>",c).option("--test <value>","Add linked test command=<value>,path=<value>,scope=<project|global>",c).option("--doc <value>","Add linked doc path=<value>,scope=<project|global>,note=<text>",c).option("--reminder <value>","Add reminder entry at=<iso|relative>|date=<iso|relative>,text=<text>|title=<text>",c).option("--event <value>","Add event entry start=<iso|relative>,end=<iso|relative>,recur_*",c).option("--type-option <value>","Set type options key=value (repeatable)",c).option("--unset <field>","Clear scalar metadata field by name (repeatable)",c).option("--clear-deps","Clear dependency entries").option("--clear-comments","Clear comments").option("--clear-notes","Clear notes").option("--clear-learnings","Clear learnings").option("--clear-files","Clear linked files").option("--clear-tests","Clear linked tests").option("--clear-docs","Clear linked docs").option("--clear-reminders","Clear reminders").option("--clear-events","Clear events").option("--clear-type-options","Clear type options").option("--author <value>","Mutation author").option("--message <value>","Mutation message").option("--force","Force ownership override"),M(a,[["--filter-assignee_filter <value>","Alias for --filter-assignee-filter"],["--estimated_minutes <value>","Alias for --estimated-minutes"],["--acceptance_criteria <value>","Alias for --acceptance-criteria"],["--definition_of_ready <value>","Alias for --definition-of-ready"],["--why_now <value>","Alias for --why-now"],["--blocked_by <value>","Alias for --blocked-by"],["--blocked_reason <value>","Alias for --blocked-reason"],["--unblock_note <value>","Alias for --unblock-note"],["--repro_steps <value>","Alias for --repro-steps"],["--expected_result <value>","Alias for --expected-result"],["--actual_result <value>","Alias for --actual-result"],["--affected_version <value>","Alias for --affected-version"],["--fixed_version <value>","Alias for --fixed-version"],["--customer_impact <value>","Alias for --customer-impact"],["--filter-estimate-missing","Alias for --filter-estimates-missing"]],!1),M(a,[["--dep_remove <value>","Alias for --dep-remove"],["--type_option <value>","Alias for --type-option"],["--add_tags <value>","Alias for --add-tags"],["--remove_tags <value>","Alias for --remove-tags"],["--add_ac <value>","Alias for --add-ac"],["--remove_ac <value>","Alias for --remove-ac"]],!0),a.action($o);let r=e.command("close").option("--release-assignment","Release ownership after closure").argument("<id>","Item id").argument("[text]","Close reason text (alias: --reason)").option("-r, --reason <value>","Close reason text (alias for positional <text>)").option("--close-reason <value>","Close reason text (alias for positional <text>)").option("--completed-at <value>","Actual completion timestamp (ISO or relative), distinct from tracker close time").option("-d, --duplicate-of <id>","Close as a duplicate of the canonical item id and auto-fill duplicate closure metadata").option("--author <value>","Mutation author").option("-m, --message <value>","History message").option("--validate-close [mode]",'Validate closure metadata before close: "off", "warn", or "strict" (default: settings governance preset)').option("--resolution <value>","Closure resolution summary (checked by --validate-close strict)").option("--expected-result <value>","Expected outcome for closure validation").option("--expected <value>","Short alias for --expected-result").option("--actual-result <value>","Observed outcome for closure validation").option("--actual <value>","Short alias for --actual-result").option("--force","Force ownership override").description("Close an item. Close reason requirement follows governance.require_close_reason.");w(r,"--expected_result <value>","Alias for --expected-result",!1),w(r,"--actual_result <value>","Alias for --actual-result",!1),r.action(Ho);let n=e.command("close-many").description("Bulk-close matched items with a shared reason and full runClose semantics (dry-run + rollback checkpoint).").option("--filter-status <value>","Filter by status before closing").option("--filter-type <value>","Filter by item type before closing").option("--filter-tag <value>","Filter by tag before closing").option("--filter-priority <value>","Filter by priority before closing").option("--filter-deadline-before <value>","Filter by deadline upper bound before closing").option("--filter-deadline-after <value>","Filter by deadline lower bound before closing").option("--filter-updated-after <value>","Filter by updated_at lower bound before closing (ISO/relative)").option("--filter-updated-before <value>","Filter by updated_at upper bound before closing (ISO/relative)").option("--filter-created-after <value>","Filter by created_at lower bound before closing (ISO/relative)").option("--filter-created-before <value>","Filter by created_at upper bound before closing (ISO/relative)").option("--filter-assignee <value>","Filter by assignee before closing").option("--filter-assignee-filter <value>","Filter assignee presence: assigned|unassigned before closing").option("--filter-parent <value>","Filter by parent item ID before closing").option("--filter-sprint <value>","Filter by sprint before closing").option("--filter-release <value>","Filter by release before closing");Gt(n,"closing"),n.option("--ids <value>","Explicit ID allowlist: comma/newline text, - stdin, or @path file").option("--limit <n>","Limit matched item count before apply/preview").option("--offset <n>","Skip first n matched rows before apply/preview").option("--reason <value>","Shared close reason applied to matched items (required when governance.require_close_reason is enabled)").option("--completed-at <value>","Actual completion timestamp (ISO or relative) applied to every matched item").option("--resolution <value>","Shared closure resolution applied to every matched item (closure-validation field)").option("--expected-result <value>","Shared expected-result note (closure-validation field)").option("--expected <value>","Short alias for --expected-result").option("--actual-result <value>","Shared actual-result note (closure-validation field)").option("--actual <value>","Short alias for --actual-result").option("--validate-close [mode]",'Validate closure metadata per item: "off", "warn", or "strict" (default: settings governance preset)').option("--author <value>","Mutation author").option("--message <value>","History message").option("--force","Re-close already-terminal matches and override ownership").option("--dry-run","Preview matched items + per-item skip/active-child plan without mutating").option("--rollback <value>","Rollback a prior close-many checkpoint ID").option("--no-checkpoint","Disable checkpoint creation during apply mode"),w(n,"--filter-assignee_filter <value>","Alias for --filter-assignee-filter",!1),w(n,"--expected_result <value>","Alias for --expected-result",!1),w(n,"--actual_result <value>","Alias for --actual-result",!1),n.action(Lo),e.command("delete").argument("<id>","Item id").option("--author <value>","Mutation author").option("--message <value>","History message").option("--force","Force ownership override").option("--dry-run","Preview the item file that would be deleted without mutating").description("Delete an item and record the change in history.").action(Xo),e.command("append").argument("<id>","Item id").argument("[text]","Body text; same as --body (- reads stdin)").option("--body <value>","Text to append to body (or - for stdin)").option("--text <value>","Alias for --body").option("--author <value>","Mutation author").option("--message <value>","Mutation message").option("--force","Force ownership override").description("Append text to an item's body. For concurrent writes, use pm notes.").action(Zo);let s=e.command("plan").description("Plan workflow: create, manage steps and dependencies, approve, and materialize.").argument("[subcommand]","Required; Plan subcommand: create|show|add-step|update-step|complete-step|block-step|reorder-step|remove-step|link|unlink|decision|discovery|validation|resume|approve|materialize").argument("[id]","Plan id (non-create); positional title for create").argument("[step]","Step reference: stable id (plan-step-001) or order integer").argument("[new-order]","New order integer for reorder-step").option("--title <value>","Plan title").option("--description <value>","Plan description").option("--scope <value>","Change or investigation scope").option("--parent <value>","Parent pm item id").option("--inherit-focus","Create under saved focus (CLI default)",!0).option("--no-inherit-focus","Create without saved focus").option("--related <value>","Related item ids (repeatable CSV)",c).option("--blocks <value>","Blocked item ids (repeatable CSV)",c).option("--blocked-by <value>","Blocking item ids (repeatable CSV)",c).option("--harness <value>","Plan harness provenance: codex|claude-code|cursor|generic").option("--mode <value>","Plan mode: draft|research|review|approved|executing|paused|completed|superseded").option("--resume-context <value>","Compact context summary for a future stateless agent").option("--tags <value>","Comma-separated tags").option("--priority <value>","Priority 0-4").option("--body <value>","Plan item body").option("--claim","Claim the plan on create for the author").option("--from-search <value>","Record the search query that led to plan creation").option("--template <value>","Seed plan steps from a built-in template: bug-investigation|feature-implementation|refactoring-sprint").option("--step-title <value>","Step title for add-step / update-step").option("--step <value>","Step title (repeatable on create: each --step appends an ordered step; elsewhere a single value aliases --step-title)",c).option("--step-body <value>","Step body text").option("--step-owner <value>","Step owner").option("--step-status <value>","Step status: pending|in_progress|completed|blocked|skipped|superseded").option("--step-evidence <value>","Step evidence text (used by update-step/complete-step)").option("--step-blocked-reason <value>","Step blocked reason (required when blocking)").option("--step-replacement <value>","Replacement reference for a superseded step").option("--depends-on <value>","Pm item ids the step depends on (repeatable, csv-friendly)",c).option("--link <value>","Pm item id to link (repeatable, csv-friendly)",c).option("--link-kind <value>",`Link kind: ${ve.join("|")}`).option("--link-note <value>","Optional note for the link").option("--promote-to-item-dep","Also add the linked id as a top-level item dependency when linking").option("--allow-multiple-active","Allow multiple steps to be in_progress at once").option("--file <value>","Step linked file path=<value>[,scope=project|global,note=<text>] (repeatable)",c).option("--test <value>","Step linked test command=<value>[,path=<value>,note=<text>] (repeatable)",c).option("--doc <value>","Step linked doc path=<value>[,scope=project|global,note=<text>] (repeatable)",c).option("--decision-text <value>","Decision log entry text").option("--decision <value>","Alias for --decision-text").option("--decision-rationale <value>","Decision log entry rationale").option("--decision-evidence <value>","Decision log entry evidence").option("--discovery-text <value>","Discovery log entry text").option("--discovery <value>","Alias for --discovery-text").option("--validation-text <value>","Validation log entry text").option("--validation <value>","Alias for --validation-text").option("--validation-command <value>","Validation log entry command").option("--validation-expected <value>","Validation log entry expected outcome").option("--depth <value>","Show depth: brief|standard|deep (default: brief)").option("--fields <value>","Comma-separated field projection for show output").option("--steps <value>","Comma-separated step ids/orders for materialize").option("--materialize-type <value>","Item type for materialized steps (default: Task)").option("--materialize-parent <value>","Parent item id for materialized children (default: the plan)").option("--materialize-tags <value>","Comma-separated tags for materialized children").option("--field <name=value>","Custom field value forwarded to every materialized child (repeatable)",c).option("--author <value>","Mutation author").option("--message <value>","Mutation message").option("--force","Force ownership override");fe(s,X.filter(m=>xo.has(m.target))),M(s,[["--resume_context <value>","Alias for --resume-context"],["--from_search <value>","Alias for --from-search"],["--step_title <value>","Alias for --step-title"],["--step_body <value>","Alias for --step-body"],["--step_owner <value>","Alias for --step-owner"],["--step_status <value>","Alias for --step-status"],["--step_evidence <value>","Alias for --step-evidence"],["--step_blocked_reason <value>","Alias for --step-blocked-reason"],["--step_replacement <value>","Alias for --step-replacement"],["--link_kind <value>","Alias for --link-kind"],["--link_note <value>","Alias for --link-note"],["--promote_to_item_dep","Alias for --promote-to-item-dep"],["--allow_multiple_active","Alias for --allow-multiple-active"],["--decision_text <value>","Alias for --decision-text"],["--decision_rationale <value>","Alias for --decision-rationale"],["--decision_evidence <value>","Alias for --decision-evidence"],["--discovery_text <value>","Alias for --discovery-text"],["--validation_text <value>","Alias for --validation-text"],["--validation_command <value>","Alias for --validation-command"],["--validation_expected <value>","Alias for --validation-expected"],["--materialize_type <value>","Alias for --materialize-type"],["--materialize_parent <value>","Alias for --materialize-parent"],["--materialize_tags <value>","Alias for --materialize-tags"]],!1),M(s,[["--blocked_by <value>","Alias for --blocked-by"],["--depends_on <value>","Alias for --depends-on"]],!0),s.action(jo),xt(e,!1),Mt(e),e.command("merge").argument("<subcommand>",`${j.join(" | ")}`).argument("[artifact]",`driver: ${ne.join(" | ")}`).argument("[base]","driver: ancestor file (%O)").argument("[ours]","driver: current file (%A)").argument("[theirs]","driver: incoming file (%B)").option("--dry-run","install/reconcile: preview").option("--pre-commit-hook","install: opt into merge settlement hook").option("--stage","reconcile: stage lossless audit evidence").option("--message <text>","reconcile: audit message").option("--force","reconcile: accept reviewed decisions").option("--include-reconciled","report: include settled receipts").option("--output <path>","driver: alternate output").option("--item-path <path>","driver: repository-relative path (%P)").option("--prefer <side>","driver: ours|theirs (default ours)").description("Manage tracker merges.").action(zo),Ut(e),e.command("profile").argument("[subcommand]","Required; Profile subcommand: list, show, apply, or lint").argument("[name]","Profile name for show/apply/lint: agile, ops, or research").option("--dry-run","Preview the apply diff without writing any files (apply)").option("--author <value>","Mutation author").option("--force","Force ownership/lock override").description("List, show, apply, and lint project profiles \u2014 archetype bundles of item types, statuses, fields, workflows, config, templates, and recommended packages.").action(Qo),Lt(e,Io);let d=e.command("files").description("Manage files linked to an item.");d.argument("<id>","Item id").option("--add <value>","Add linked file entry (CSV/markdown pairs or - for stdin)",c).option("--add-glob <value>","Add linked file entries from a glob (plain glob or pattern=<glob>,scope=<scope>,note=<text>; repeatable)",c).option("--remove <value>","Remove linked file by path only (path=<value>, path:<value>, plain path, or - for stdin); does not accept note=/scope= \u2014 record removal context with --message",c).option("--migrate <value>","Migrate linked file paths in-place (from=<prefix>,to=<prefix>; repeatable)",c).option("--note <value>","Note attached to every link added by --add/--add-glob in this invocation (embedded note= wins)").option("--list","List linked files without mutating").option("--append-stable","Preserve existing linked-file order and append new links without full-array resorting").option("--validate-paths","Validate linked file paths for existence and file shape").option("--author <value>","Mutation author").option("--message <value>","History message").option("--force","Force ownership override").action(ei),d.command("discover").argument("<id>","Item id").option("--apply","Add discovered missing files to the item").option("--note <value>","Note to attach to discovered file links").option("--append-stable","Preserve existing linked-file order and append discovered links without full-array resorting").option("--author <value>","Mutation author").option("--message <value>","History message").option("--force","Force ownership override").description("Discover existing file paths referenced in item text and optionally link missing files.").action(ti),$t(d),e.command("docs").argument("<id>","Item id").option("--add <value>","Add linked doc entry (CSV/markdown pairs or - for stdin)",c).option("--add-glob <value>","Add linked doc entries from a glob (plain glob or pattern=<glob>,scope=<scope>,note=<text>; repeatable)",c).option("--remove <value>","Remove linked doc by path only (path=<value>, path:<value>, plain path, or - for stdin); does not accept note=/scope= \u2014 record removal context with --message",c).option("--migrate <value>","Migrate linked doc paths in-place (from=<prefix>,to=<prefix>; repeatable)",c).option("--note <value>","Note attached to every link added by --add/--add-glob in this invocation (embedded note= wins)").option("--list","List linked docs without mutating").option("--validate-paths","Validate linked doc paths for existence and file shape").option("--author <value>","Mutation author").option("--message <value>","History message").option("--force","Force ownership override").description("Manage docs linked to an item.").action(oi),e.command("deps").argument("<id>","Item id").option("--format <value>","Output format (tree, graph, or context)","tree").option("--max-depth <value>","Maximum dependency traversal depth (0 keeps only the root)").option("--collapse <value>","Collapse mode (none or repeated)","none").option("--summary","Return counts only without full tree/graph payload").option("--full","Return the complete dependency row projection").option("--node-limit <value>","Maximum nodes in context output").option("--edge-limit <value>","Maximum edges and missing-reference rows in context output").option("--token-budget <value>","Maximum estimated tokens in context output").option("--cursor <value>","Continue an equivalent context query").option("--direction <value>","Context traversal direction (outgoing, incoming, or both)").option("--kind <value>","Restrict context traversal to registered relationship kinds (repeatable or comma-separated)",c).description("Show dependency relationships for an item.").action(ii)}export{me as looksLikeSchemaSubcommandTypo,Io as parsePositiveIntOption,G as parseSchemaOrderOption,fe as registerCommanderOptionContracts,sn as registerMutationCommands};
|
|
20
|
-
//# sourceMappingURL=register-mutation-5V2NANIS.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as ie}from"./chunk-MVL27TAH.js";import"./chunk-DEZPZOQ7.js";import{Cc as J,Dc as $,Ec as G,Ed as re,Fc as H,Gc as W,Hc as j,Jb as N,Jc as I,Kc as B,Lc as z,Mc as Y,Nc as K,Oc as X,Pb as U,Qc as Q,Rc as Z,Sb as q,Xa as F,ga as M,kd as ee,nd as te,pd as ae,rb as V,wd as ne,xd as oe,yd as C}from"./chunk-VHLAVTJN.js";import"./chunk-XPQ4RTSF.js";import"./chunk-4BQD5SW2.js";import"./chunk-OOD2A7AF.js";import"./chunk-I5O3XZOA.js";import{Of as O,Pc as _,Pf as P,Qf as L,Uf as c,Xf as f,Yf as i,Zf as g,ng as y}from"./chunk-42BHHNTL.js";import"./chunk-SPPHDVZE.js";import"./chunk-LWW4F4G2.js";import"./chunk-LEIVUGDH.js";import"./chunk-IB7UB5TE.js";import{Bi as A,Pf as l,Qf as u,Tc as x,k as T,l as E,qh as R,xa as v}from"./chunk-OH7WPD42.js";import"./chunk-TH5KPAN4.js";import"./chunk-VS565KBX.js";import{A as d,C as m}from"./chunk-RZQNFHXO.js";import"./chunk-XAWE4EAK.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="c3d9f24a-7089-5d60-ab12-93d03b86da80")}catch{}})();var se=new Map([["measurements","boolean"],["metric","string"],["measurementLimit","number"],["observe","string_array"],["direction","direction"],["measurementSource","string"],["measurementItem","string"],["measurementRevision","string"],["author","string"],["message","string"],["provenanceCoverage","boolean"],["fleetAttribution","boolean"],["since","string"],["eventLimit","number"],["minimumSample","number"]]),ke=new Set(["higher","lower","target"]),ve=[...se.keys()].sort((e,t)=>e.localeCompare(t)).join(", ");function xe(e,t){return e==="boolean"?typeof t=="boolean":e==="string"?typeof t=="string":e==="number"?typeof t=="number":e==="string_array"?Array.isArray(t)&&t.every(a=>typeof a=="string"):e==="direction"&&ke.has(t)}function le(e){if(e===void 0)return{};let t;try{t=JSON.parse(e)}catch(a){throw new m(`--analytics must be valid JSON: ${String(a)}`,d.USAGE)}if(t===null||typeof t!="object"||Array.isArray(t))throw new m("--analytics must be a JSON object.",d.USAGE);for(let[a,n]of Object.entries(t)){let o=se.get(a);if(!xe(o,n))throw new m(o===void 0?`Unknown --analytics field "${a}". Accepted fields: ${ve}.`:`--analytics field "${a}" must be ${o.replace("_"," ")}.`,d.USAGE)}return t}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="dcd8c925-34ee-5faa-9132-1be43961c749")}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]="29db968f-30ad-5f3c-bf95-e33be18614c6")}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]="524ade8e-33d6-5353-b01d-c7baddc956e8")}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]="02e10fe1-c111-5c09-8dbe-a67f2b97f0d0")}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]="3d4a8db3-8a53-50b4-a96c-1affff2207a3")}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]="d008ca8f-41bf-54fb-9b56-bc1d4af9f226")}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]="de197522-9007-5e21-8f9c-06cbf63707d1")}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]="a5e0162a-bbf1-50fe-8912-a820de155e90")}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]="9ee008b9-3751-5794-8d01-1f6d3123d6cd")}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]="b6fa277d-ccf2-5413-95d5-0790283203d5")}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]="2d59e10e-c85b-542a-8859-b20a08e809fa")}catch{}})();var ce=(e,t)=>N(e,t,{runUpdate:(a,n,o)=>ie(a,n,o)});(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="3952425a-adce-59dd-84b6-97ac571eaa73")}catch{}})();async function Ae(e,t,a,n,o){let r=c(o),s=e==="run",p=e==="verdicts",w=e==="presets"||e==="apply",k=e==="promote",h=await U({action:e,...s||p||w||k?{}:{kind:t},id:s||p||k?a??t:a,preset:w?a??t:void 0,definition:i(n,"definition"),trigger:i(n,"trigger"),tree:i(n,"tree"),gate:i(n,"gate"),limit:i(n,"limit"),dry_run:n.dryRun===!0,fullChangedFields:r.fullChangedFields,idOnly:r.idOnly,author:i(n,"author"),message:i(n,"message"),owner:i(n,"owner"),apply:n.apply===!0,enforcement:i(n,"enforcement")},r);l(h,r),typeof h=="object"&&h!==null&&"exit_code"in h&&h.exit_code===1&&(process.exitCode=1)}function de(e){e.command("assurance").argument("<action>","Action; inspect `pm contracts --command assurance`").argument("[kind]","Declaration kind or run gate id").argument("[id]","Declaration/gate id").description("Manage SDK-owned assurance contracts.").option("--definition <json>","Put declaration JSON").option("--trigger <value>","Gate trigger").option("--tree <value>","Revision identity").option("--gate <id>","Verdict gate filter").option("--limit <number>","Verdict limit").option("--dry-run","Evaluate without recording").option("--author <value>","Mutation author").option("--message <value>","Mutation rationale").option("--owner <item-id>","Preset/derivation owner").option("--apply","Persist derived proposals").option("--enforcement <level>","Promote to warn or block").action(Ae)}(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]="a623e4b3-0b19-53e5-9953-df71495e8d2c")}catch{}})();function _e(e,t){let a=e?.trim().toLowerCase(),n=t?.trim().toLowerCase();if(a===void 0||a.length===0)return n;if(a==="local-analytics")return n&&n.length>0?n:"status";if(n!==void 0&&n.length>0)throw _({command_path:"telemetry",token:`${e} ${t}`,allowed:["status","flush","stats","clear","local-analytics"],token_kind:"path",examples:["pm telemetry stats --limit 10","pm telemetry local-analytics status --json"]});return a}function Ie(e){return{addValues:Array.isArray(e.add)?e.add:[],addJsonValues:Array.isArray(e.addJson)?e.addJson:[],removeValues:Array.isArray(e.remove)?e.remove:[],removeIndexValues:Array.isArray(e.removeIndex)?e.removeIndex:[]}}function fe(e,t){if(e.background===!0){if(e.run!==!0)throw new m("--background requires --run",d.USAGE);if(e.acknowledgeLinkedTests===!0)throw new m("--background cannot be combined with --acknowledge-linked-tests; acknowledgement is a non-executing foreground operation",d.USAGE);if(e.update!==void 0||e.updateIndex!==void 0||e.setJson!==void 0||t.addValues.length>0||t.addJsonValues.length>0||t.removeValues.length>0||t.removeIndexValues.length>0)throw new m("--background does not support --add/--add-json/--remove/--remove-index or metadata edits; update linked tests first, then run in background",d.USAGE)}}async function Ce(e,t,a,n){let o=await C({kind:"test",commandArgs:O(e,{...t,add:n.addValues,addJson:n.addJsonValues,remove:n.removeValues,removeIndex:n.removeIndexValues}),targetId:e,author:typeof t.author=="string"?t.author:void 0,noExtensions:a.noExtensions===!0},a);l(o,a)}function De(e){return{update:typeof e.update=="string"?e.update:void 0,updateIndex:typeof e.updateIndex=="string"||typeof e.updateIndex=="number"?e.updateIndex:void 0,setJson:typeof e.setJson=="string"?e.setJson:void 0}}function D(e,t){return{add:t.addValues,addJson:t.addJsonValues,remove:t.removeValues,removeIndex:t.removeIndexValues,...De(e),list:!!e.list,run:!!e.run,match:typeof e.match=="string"?e.match:void 0,onlyIndex:typeof e.onlyIndex=="string"||typeof e.onlyIndex=="number"?e.onlyIndex:void 0,onlyLast:!!e.onlyLast,timeout:typeof e.timeout=="string"?e.timeout:void 0,progress:!!e.progress,envSet:Array.isArray(e.envSet)?e.envSet:[],envClear:Array.isArray(e.envClear)?e.envClear:[],sharedHostSafe:!!e.sharedHostSafe,pmContext:typeof e.pmContext=="string"?e.pmContext:void 0,overrideLinkedPmContext:!!e.overrideLinkedPmContext,workspaceContext:typeof e.workspaceContext=="string"?e.workspaceContext:void 0,overrideLinkedWorkspaceContext:!!e.overrideLinkedWorkspaceContext,allowUntrustedLinkedTests:!!e.allowUntrustedLinkedTests,acknowledgeLinkedTests:!!e.acknowledgeLinkedTests,failOnContextMismatch:!!e.failOnContextMismatch,failOnSkipped:!!e.failOnSkipped,failOnEmptyTestRun:!!e.failOnEmptyTestRun,requireAssertionsForPm:!!e.requireAssertionsForPm,checkContext:!!e.checkContext,autoPmContext:!!e.autoPmContext,author:typeof e.author=="string"?e.author:void 0,message:typeof e.message=="string"?e.message:void 0,force:!!e.force,measure:Array.isArray(e.measure)?e.measure:[],metricBelow:typeof e.metricBelow=="string"?e.metricBelow:void 0,metricDiff:typeof e.metricDiff=="string"?e.metricDiff:void 0}}var Nt={buildRunTestOptions:D,buildRunTestAllOptions:pe,runWorkspacePositionAction:ye,validateBackgroundTestOptions:fe};async function Se(e,t,a,n){let o=await ne(e,D(t,n),a);(t.update!==void 0||t.updateIndex!==void 0||t.setJson!==void 0||n.addValues.length>0||n.addJsonValues.length>0||n.removeValues.length>0||t.run===!0||n.removeIndexValues.length>0)&&await y(a,o),l(o,a),(o.run_results.some(r=>r.status==="failed"||r.status==="refused")||o.fail_on_skipped_triggered===!0)&&(process.exitCode=d.DEPENDENCY_FAILED)}async function Te(e,t,a){let n=c(a),o=Date.now(),r=Ie(t);t.background===!0&&ae(e,D(t,r),n,v(process.cwd(),n.path),!0),fe(t,r),t.background===!0?await Ce(e,t,n,r):await Se(e,t,n,r),n.profile&&u(`profile:command=test took_ms=${Date.now()-o}`)}function b(e){let t=i(e,"author"),a=i(e,"assignee");if(t!==void 0&&a!==void 0&&t!==a)throw new m("Lifecycle ownership received conflicting --author and --assignee values; use one actor value for both aliases.",d.USAGE,{code:"conflicting_lifecycle_owner",examples:["pm claim pm-123","pm claim pm-123 --start","pm release pm-123"]});return{author:t??a,message:i(e,"message")}}async function Ee(e,t){let a=c(t),n=Date.now();if(e.background===!0){let r=await C({kind:"test-all",commandArgs:P(e),statusFilter:i(e,"status"),noExtensions:a.noExtensions===!0},a);l(r,a),a.profile&&u(`profile:command=test-all took_ms=${Date.now()-n}`);return}let o=await oe(pe(e),a);await y(a,{ids:o.results.map(r=>r.id)}),l(o,a),(o.failed>0||o.fail_on_skipped_triggered===!0)&&(process.exitCode=d.DEPENDENCY_FAILED),a.profile&&u(`profile:command=test-all took_ms=${Date.now()-n}`)}function pe(e){return{status:i(e,"status"),limit:i(e,"limit"),offset:i(e,"offset"),timeout:i(e,"timeout"),progress:!!e.progress,envSet:Array.isArray(e.envSet)?e.envSet:[],envClear:Array.isArray(e.envClear)?e.envClear:[],sharedHostSafe:!!e.sharedHostSafe,pmContext:i(e,"pmContext"),overrideLinkedPmContext:!!e.overrideLinkedPmContext,workspaceContext:i(e,"workspaceContext"),overrideLinkedWorkspaceContext:!!e.overrideLinkedWorkspaceContext,allowUntrustedLinkedTests:!!e.allowUntrustedLinkedTests,failOnContextMismatch:!!e.failOnContextMismatch,failOnSkipped:!!e.failOnSkipped,failOnEmptyTestRun:!!e.failOnEmptyTestRun,requireAssertionsForPm:!!e.requireAssertionsForPm,checkContext:!!e.checkContext,autoPmContext:!!e.autoPmContext}}async function Re(e,t,a,n){let o=c(n),r=Date.now(),s=await te({subcommand:_e(e,t),limit:i(a,"limit")},o);l(s,o),o.profile&&u(`profile:command=telemetry took_ms=${Date.now()-r}`)}async function Oe(e,t){let a=c(t),n=Date.now(),o=le(i(e,"analytics")),r=await ee(a,{includeEmpty:e.includeEmpty===!0,storage:e.storage===!0,metadataCoverage:e.metadataCoverage===!0,byAssignee:e.byAssignee===!0,byTag:e.byTag===!0,byPriority:e.byPriority===!0,tagPrefix:i(e,"tagPrefix"),fieldUtilization:e.fieldUtilization===!0,...o});r.recorded_observations?.some(s=>s.changed)===!0&&await y(a,{ids:r.recorded_observations?.flatMap(s=>s.observation.item_id?[s.observation.item_id]:[])}),l(r,a),a.profile&&u(`profile:command=stats took_ms=${Date.now()-n}`)}async function Pe(e,t){let a=c(t),n=Date.now(),o=i(e,"threshold"),r=i(e,"limit"),s=await F(a,{...e.exhaustive===!0?{exhaustive:!0}:{},status:Array.isArray(e.status)&&e.status.length>0?e.status:void 0,since:i(e,"since"),...o===void 0?{}:{threshold:Number(o)},...r===void 0?{}:{limit:Number(r)}});l(s,a),a.profile&&u(`profile:command=duplicates took_ms=${Date.now()-n}`)}async function Le(e,t){let a=c(t),n=Date.now(),o=!!e.strictExit||!!e.failOnWarn,r=await V(a,{strictExit:o,strictDirectories:!!e.strictDirectories,requireMergeDrivers:!!e.requireMergeDrivers,checkOnly:!!e.checkOnly,checkTelemetry:!!e.checkTelemetry,noRefresh:!!e.noRefresh,refreshVectors:!!e.refreshVectors,verboseStaleItems:!!e.verboseStaleItems,verboseAuthorEvents:!!e.verboseAuthorEvents,brief:!!e.brief,summary:!!e.summary||o,skipVectors:!!e.skipVectors,skipIntegrity:!!e.skipIntegrity,skipDrift:!!e.skipDrift,full:!!e.full});l(r,a),o&&!r.ok&&(x({...r,exit_code:d.GENERIC_FAILURE,error_code:"health_findings",error_category:"validation",command_resolution:"health_findings",resolution_stage:"execute"}),process.exitCode=d.GENERIC_FAILURE),a.profile&&u(`profile:command=health took_ms=${Date.now()-n}`)}async function Me(e,t){let a=c(t),n=Date.now(),o=await ce({checkMetadata:!!e.checkMetadata,metadataProfile:i(e,"metadataProfile"),checkResolution:!!e.checkResolution,checkCompleteness:!!e.checkCompleteness,checkLifecycle:!!e.checkLifecycle,checkStaleBlockers:!!e.checkStaleBlockers,dependencyCycleSeverity:i(e,"dependencyCycleSeverity"),parentCycleSeverity:i(e,"parentCycleSeverity"),checkFiles:!!e.checkFiles,checkCommandReferences:!!e.checkCommandReferences,scanMode:i(e,"scanMode"),includePmInternals:!!e.includePmInternals,verboseFileLists:!!e.verboseFileLists,verboseDiagnostics:!!e.verboseDiagnostics,allAffectedIds:!!e.allAffectedIds,checkHistoryDrift:!!e.checkHistoryDrift,checkStorageIntegrity:!!e.checkStorageIntegrity,fixHints:!!e.fixHints,autoFix:!!e.autoFix,dryRun:!!e.dryRun,fixScope:Array.isArray(e.fixScope)?e.fixScope:void 0,pruneMissing:!!e.pruneMissing,counts:!!e.counts,full:!!e.full},a);l(o,a),(e.strictExit||e.failOnWarn)&&(o.has_warnings||!o.ok)&&(x({...o,exit_code:d.GENERIC_FAILURE,error_code:"validation_findings",error_category:"validation",command_resolution:"validation_findings",resolution_stage:"execute"}),process.exitCode=d.GENERIC_FAILURE),a.profile&&u(`profile:command=validate took_ms=${Date.now()-n}`)}async function Fe(e,t){let a=c(t),n=Date.now(),o=await q(a,{dryRun:e.dryRun===!0,scope:Array.isArray(e.scope)?e.scope:[]});l(o,a),a.profile&&u(`profile:command=gc took_ms=${Date.now()-n}`)}async function Ve(e,t,a,n){let o=c(n),r=v(process.cwd(),o.path),s=e.trim().toLowerCase();if(!I.some(p=>p===s))throw _({command_path:"workspace snapshot",token:e,allowed:I,display_name:"workspace snapshot",token_kind:"action",examples:["pm workspace snapshot create before-migration","pm workspace snapshot restore before-migration"]});if(s==="list"){l(await Y(r),o);return}if(s==="create"){l(await B(r,t===void 0?{}:{name:t}),o);return}if(t===void 0)throw new m(`pm workspace snapshot ${s} requires a snapshot name or fingerprint`,d.USAGE);if(s==="inspect"){l(await z(r,t),o);return}if(s==="restore"){if(a.dryRun===!0){l(await K(r,t),o);return}let p=await A(r);l(await X(r,t,{force:a.force===!0,author:R(i(a,"author"),p.author_default),message:i(a,"message"),lockTtlSeconds:p.locks.ttl_seconds,lockWaitMs:p.locks.wait_ms}),o);return}l(await Q(r,t),o)}async function ye(e,t){let a=c(t);l(await Z(a),a)}async function Ne(e,t){let a=c(t),n=Date.now(),o=await M({action:i(e,"action"),command:i(e,"command"),summary:!!e.summary,schemaOnly:!!e.schemaOnly,flagsOnly:!!e.flagsOnly,availabilityOnly:!!e.availabilityOnly,runtimeOnly:!!e.runtimeOnly||!!e.activeOnly,full:!!e.full},a);l(o,a),a.profile&&u(`profile:command=contracts took_ms=${Date.now()-n}`)}async function Ue(e,t,a){if(t.start===!0){ue(e,!1),await ge(e,t,a);return}let n=c(a),o=Date.now(),r={...b(t),ifAvailable:t.ifAvailable===!0,maxAttempts:t.maxAttempts};ue(e,t.next===!0);let s=t.next===!0?await $(!!t.force,n,r,{type:typeof t.type=="string"?t.type:void 0,tag:typeof t.tag=="string"?t.tag:void 0,priority:t.priority,assigneeFilter:typeof t.assigneeFilter=="string"?t.assigneeFilter:void 0,parent:typeof t.parent=="string"?t.parent:void 0,sprint:typeof t.sprint=="string"?t.sprint:void 0,release:typeof t.release=="string"?t.release:void 0,includeDecisions:t.includeDecisions===!0,includeGates:t.includeGates===!0,includeContainers:t.includeContainers===!0,tokenBudget:t.tokenBudget??t.token_budget,explainRanking:t.explainRanking===!0||t.explain_ranking===!0}):await J(e,!!t.force,n,r);await y(n,s),l(s,n),n.profile&&u(`profile:command=claim took_ms=${Date.now()-o}`)}function ue(e,t){if(!t&&!e)throw new m("Specify an item id or pass --next",d.USAGE);if(t&&e)throw new m("Specify either an item id or --next, not both",d.USAGE)}async function qe(e,t,a){if(t.pause===!0){await he(e,t,a);return}let n=c(a),o=Date.now(),r=await G(e,!!t.force,n,{...b(t),ownershipReleaseBypass:t.ownershipReleaseBypass===!0,handoff:t.handoff});await y(n,r),l(await L("release",[e],t,n,r),n),n.profile&&u(`profile:command=release took_ms=${Date.now()-o}`)}async function S(e){let t=c(e),a=T(e.name());!a||t.json||t.quiet||(await A(v(process.cwd(),t.path))).ux?.deprecation_hints&&u(E(a))}async function ge(e,t,a){await S(a);let n=c(a),o=Date.now(),r=await H(e,{...b(t),force:!!t.force,next:t.next===!0,ifAvailable:t.ifAvailable===!0},n);await y(n,r.update),l(r,n),n.profile&&u(`profile:command=start-task took_ms=${Date.now()-o}`)}async function he(e,t,a){await S(a);let n=c(a),o=Date.now(),r=await W(e,{...b(t),handoff:i(t,"handoff"),force:!!t.force},n);await y(n,r.release),l(r,n),n.profile&&u(`profile:command=pause-task took_ms=${Date.now()-o}`)}async function Je(e,t,a,n){await S(n);let o=c(n),r=Date.now(),s=await j(e,t,{...b(a),validateClose:i(a,"validateClose"),force:!!a.force},o);await y(o,s.release),l(s,o),o.profile&&u(`profile:command=close-task took_ms=${Date.now()-r}`)}function me(e){return e.option("--background","Run linked tests in managed background mode").option("--timeout <seconds>","Default run timeout in seconds (requires --run)").option("--progress","Emit stderr run progress (requires --run; automatic in TTY)").option("--env-set <value>","Set run environment (KEY=VALUE, repeatable)",f).option("--env-clear <value>","Clear run environment (NAME, repeatable)",f).option("--shared-host-safe","Apply additive shared-host-safe run defaults").option("--pm-context <mode>","PM test context: schema|tracker|auto|none (default: schema)").option("--override-linked-pm-context","Override stored context with --pm-context").option("--workspace-context <mode>","Source-workspace mode: source|isolated|snapshot (default: source)").option("--override-linked-workspace-context","Override stored context with --workspace-context").option("--allow-untrusted-linked-tests","Execute untrusted linked commands when project policy also permits it").option("--fail-on-context-mismatch","Fail linked PM commands when context item counts differ").option("--fail-on-skipped","Treat skipped linked tests as dependency failures").option("--fail-on-empty-test-run","Fail successful commands reporting zero executed tests").option("--require-assertions-for-pm","Require assertion metadata for linked PM command tests").option("--check-context","Check PM context before execution").option("--auto-pm-context","Route mismatched PM tracker reads through tracker context")}function Ut(e){de(e);let t=e.command("test").argument("<id>","Item id").option("--add <value>","Add verified isolated test (CSV/markdown or stdin)",f).option("--add-json <value>","Add verified isolated test (JSON object/array or stdin)",f).option("--remove <value>","Remove exact command/path (command=<value>, path=<value>, or stdin -)",f).option("--remove-index <n>","Remove 1-based --list position (repeatable)",f).option("--list","List linked tests without mutating").option("--update <value>","Edit exact command or path=<value>").option("--update-index <n>","Edit current 1-based --list position").option("--set-json <value>","Metadata patch; null clears optional fields").option("--run","Run linked test commands").option("--match <value>","Run matching command/path substring").option("--only-index <n>","Run 1-based --list position").option("--only-last","Run most recently added test");t.option("--acknowledge-linked-tests","Trust current commands in this clone without execution"),me(t).option("--measure <value>","Record name=value[,unit=...][,threshold=...]; requires --run",f).option("--metric-below <value>","Return evidence below name=value").option("--metric-diff <name>","Diff the latest two values").option("--author <value>","Mutation author").option("--message <value>","History message").option("--force","Force ownership override").description("Manage tests linked to an item and optionally run them.").action(Te);let a=e.command("test-all").description("Run linked tests across matching items.").option("--status <value>","Filter items by status before running tests").option("--limit <n>","Limit matching items before running linked tests").option("--offset <n>","Skip matching items before running linked tests");me(a).action(Ee),e.command("test-runs-worker",{hidden:!0}).argument("<runId>","Background run id").description("Internal background worker command.").action(async(k,h,be)=>{let we=c(be);await re(k,we)}),e.command("telemetry").argument("[namespace-or-subcommand]","Telemetry subcommand: status, flush, stats, clear (default: status)").argument("[subcommand]","Compatibility alias target for local-analytics: status, flush, stats, clear").option("--limit <n>","Maximum command groups returned by telemetry stats").description("Inspect and manage local telemetry queue/runtime state.").action(Re),e.command("duplicates").description("Find duplicate clusters across all statuses.").option("--status <value>","Statuses (repeatable or comma-separated)",f,[]).option("--since <value>","Created at or after this time").option("--threshold <value>","Minimum similarity (0-1)").option("--limit <n>","Maximum clusters").option("--exhaustive","Score all pairs within the safety bound").action(Pe),e.command("stats").description("Show project tracker statistics.").option("--include-empty","Restore zero-count registered item-type and lifecycle-status buckets").option("--storage","Include aggregate history-stream storage metrics (total streams/lines/bytes, largest + deepest streams, oldest/newest entries)").option("--metadata-coverage","Include metadata coverage % (acceptance_criteria, estimated_minutes, resolution, tags, parent) overall and by type").option("--by-assignee","Include a lifecycle-bucketed item breakdown grouped by assignee").option("--by-tag","Include a lifecycle-bucketed item breakdown grouped by tag").option("--by-priority","Include a lifecycle-bucketed item breakdown grouped by priority").option("--tag-prefix <value>","With --by-tag: only count tags starting with this prefix (e.g. domain:)").option("--field-utilization","Report content-field utilization rates (notes/learnings/files/docs/tests/comments/deps/body) for governance analysis").option("--analytics <json>","Improvement ledger/history analytics JSON").action(Oe),e.command("health").description("Show project tracker health checks.").option("--strict-directories","Treat optional item-type directories as required failures").option("--require-merge-drivers","Treat absent clone-local merge drivers as a required health failure").option("--check-only","Run read-only health diagnostics without refreshing vectors").option("--check-telemetry","Probe telemetry endpoint health and include network diagnostics").option("--no-refresh","Disable automatic vector refresh attempts during health checks").option("--refresh-vectors","Explicitly enable vector refresh attempts during health checks").option("--verbose-stale-items","Include full stale vectorization ID lists in health output").option("--verbose-author-events","Include every actionable unknown-author event coordinate for review or disposition").option("--brief","Emit compact health details for low-token agent checks").option("--summary","Emit one-line-style health status with check names and warning count").option("--skip-vectors","Skip vectorization check for a faster run").option("--skip-integrity","Skip item/history file integrity check for a faster run").option("--skip-drift","Skip history drift hash check for a faster run").option("--full","Run all checks including slow integrity, drift, and vectorization checks").option("--strict-exit","Return non-zero exit when health is not ok and default to actionable summary output; use --full for complete details").option("--fail-on-warn","Alias for --strict-exit").action(Le),e.command("validate").description("Validate metadata, lifecycle policies, files, command references, and history.").option("--check-metadata","Run metadata completeness checks").option("--metadata-profile <value>","Metadata profile (core|strict|custom)").option("--check-resolution","Run closed-item resolution metadata checks").option("--check-completeness","Check declarative lifecycle field requirements").option("--check-lifecycle","Run active-item lifecycle governance drift checks").option("--check-stale-blockers","Include stale blocker-pattern diagnostics in lifecycle checks").option("--dependency-cycle-severity <value>","Set dependency-cycle warning policy for lifecycle checks (off|warn|error)").option("--parent-cycle-severity <value>","Set parent-hierarchy cycle warning policy for lifecycle checks (off|warn|error)").option("--check-files","Run linked-file and orphaned-file checks").option("--check-command-references","Run linked-command PM-ID reference checks").option("--scan-mode <value>","Select file candidate scan mode for --check-files (default|tracked-all|tracked-all-strict)").option("--include-pm-internals","Include PM storage internals in tracked-all candidate scans").option("--verbose-file-lists","Include full file-path lists for validate --check-files details").option("--verbose-diagnostics","Include full diagnostic ID lists").option("--all-affected-ids","Emit complete missing_* affected-ID lists with no truncation (implied by --json)").option("--strict-exit","Return non-zero exit when validation warnings are present").option("--fail-on-warn","Alias for --strict-exit").option("--fix-hints","Add a machine-executable fix_hints[] of pm commands to each failing check's details").option("--auto-fix","Apply safe, deterministic field backfills").option("--dry-run","Preview planned --auto-fix/--prune-missing fixes without applying them").option("--fix-scope <scope>","Grant --auto-fix scopes (metadata, resolution, estimates, timestamps, lifecycle; comma-separated or repeatable). Default: metadata, resolution; other scopes require explicit opt-in",f).option("--prune-missing","Remove deleted-path file/doc links; preserves real files").option("--check-history-drift","Run item/history hash drift checks").option("--check-storage-integrity","Run the post-merge storage-integrity check (unreadable items, history conflict markers, resurrected deletes, unparseable config/schema)").option("--counts","Keep validation counts and totals while omitting per-item diagnostic arrays").option("--full","Return the complete validation diagnostic projection").action(Me),e.command("gc").option("--dry-run","Preview cleanup targets without deleting files; without this flag, pm gc deletes matched artifacts").option("--scope <value>","Limit cleanup to one or more scopes (comma-separated or repeatable): index, embeddings, runtime, locks, checkpoints, transactions",f).description("Delete optional cache artifacts by default (including expired lock debris) and show a summary.").action(Fe);let n=e.command("workspace").description("Inspect workspace state and snapshots.");n.command("position").description("Show merge and history readiness.").action(ye),n.command("snapshot").argument("<action>","Action: create, list, inspect, restore, delete").argument("[target]","Optional name for create; name or fingerprint otherwise").description("Manage content-addressed tracker snapshots.").option("--dry-run","Preview restore file, item, stream, and history-entry impact without mutating state").option("--force","Explicitly confirm a whole-workspace snapshot restore").option("--author <value>","Actor recorded on the restore audit event").option("--message <value>","Human-readable restore rationale").action(Ve),e.command("contracts").description("Show machine-readable command and schema contracts for agents.").option("--action <value>","Filter tool schema branches to a specific action").option("--command <value>","Scope contracts output to one CLI command (narrow-by-default)").option("--summary","Return one command+intent row per top-level command for cheap agent bootstrap").option("--schema-only","Return schema-focused output only").option("--flags-only","Return command flag contracts only").option("--availability-only","Return action availability surface only").option("--runtime-only","Include only actions invocable in the current runtime").option("--active-only","Alias for --runtime-only").option("--full","Include full schema and command-flag surfaces (large; default brief output omits heavy sections for unfiltered queries)").action(Ne);let o=e.command("claim").option("--start","Claim and start an explicit item").argument("[id]","Item id (omit with --next)").option("--author <value>","Mutation author").option("--message <value>","History message").option("--force","Force claim override").option("--if-available","Skip another author's claim (skipped=true)").option("--next","Atomically claim the next caller-available actionable item").option("--type <value>","Filter --next candidates by type").option("--tag <value>","Filter --next candidates by tag").option("--priority <value>","Filter --next candidates by priority").option("--assignee-filter <value>","Filter --next candidates: assigned|unassigned").option("--parent <id>","Scope --next candidates to a subtree").option("--sprint <value>","Filter --next candidates by sprint").option("--release <value>","Filter --next candidates by release").option("--max-attempts <n>","Bound the --next candidate walk (default 10; maximum 100)").option("--include-decisions","Allow --next to claim human-gated Decision items").option("--include-gates","Allow --next to claim outcome gates").option("--include-containers","Allow --next to claim containers with unfinished descendants").option("--token-budget <n>","Bound the estimated tokens used to rank --next candidates").option("--explain-ranking","Include ranking provenance for --next selection").description("Claim an item for active work.").action(Ue);g(o,"--assignee <value>","Alias for --author on lifecycle ownership commands"),g(o,"--token_budget <n>","Alias for --token-budget"),g(o,"--explain_ranking","Alias for --explain-ranking");let r=e.command("release").option("--pause","Use open status").option("--handoff <status>","Needs --message").argument("<id>","Item id").option("--author <value>","Author").option("--message <value>","Message").option("--force","Override ownership").description("Release ownership.").action(qe);g(r,"--assignee <value>","Alias for --author on lifecycle ownership commands");let s=e.command("start-task",{hidden:!0}).argument("<id>","Item id").option("--author <value>","Mutation author").option("--message <value>","History message").option("--force","Force ownership or terminal override when required").description("Lifecycle alias: claim an item and move it to in_progress.").action(ge);g(s,"--assignee <value>","Alias for --author on lifecycle ownership commands");let p=e.command("pause-task",{hidden:!0}).argument("<id>","Item id").option("--author <value>","Mutation author").option("--message <value>","History message").option("--force","Force ownership override when required").description("Lifecycle alias: move an item to open and release its claim.").action(he);g(p,"--assignee <value>","Alias for --author on lifecycle ownership commands");let w=e.command("close-task",{hidden:!0}).argument("<id>","Item id").argument("[reason]","Close reason text").option("--author <value>","Mutation author").option("--message <value>","History message").option("--validate-close <value>","Close-time validation mode: off|warn|strict").option("--force","Force ownership or terminal override when required").description("Lifecycle alias: close an item and release assignment metadata.").action(Je);g(w,"--assignee <value>","Alias for --author on lifecycle ownership commands")}export{Nt as _testOnlyRegisterOperations,Ut as registerOperationCommands,ue as requireClaimTarget};
|
|
2
|
-
//# sourceMappingURL=register-operations-XSFRMUFX.js.map
|