@unbrained/pm-cli 2026.8.8 → 2026.8.10
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/.claude-plugin/marketplace.json +2 -2
- package/CHANGELOG.md +59 -0
- package/dist/cli/commander-usage.js +17 -12
- package/dist/cli/help-json-payload.js +51 -16
- package/dist/cli/main.js +7 -6
- package/dist/cli-bundle/bundle-manifest.json +162 -162
- package/dist/cli-bundle/chunks/chunk-2QYH4QMI.js +30 -0
- package/dist/cli-bundle/chunks/{chunk-2ZMXX3Q6.js → chunk-EBO7OUUE.js} +70 -70
- package/dist/cli-bundle/chunks/{chunk-NUXRRNAB.js → chunk-ETML5C6H.js} +48 -48
- package/dist/cli-bundle/chunks/chunk-JUDU4RO4.js +194 -0
- package/dist/cli-bundle/chunks/chunk-JZSNADRR.js +5 -0
- package/dist/cli-bundle/chunks/chunk-MENWVGJW.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-ALDHXLPS.js → chunk-S4EITGLA.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-TIGKWVLA.js +13 -0
- package/dist/cli-bundle/chunks/{chunk-CBLA33YK.js → chunk-TRWXF476.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-TSLDTJLQ.js +2 -0
- package/dist/cli-bundle/chunks/{register-list-query-WFZAMJHZ.js → register-list-query-OJ6ZXKV4.js} +2 -2
- package/dist/cli-bundle/chunks/{register-mutation-SOKKOTHQ.js → register-mutation-DKI7QC7O.js} +2 -2
- package/dist/cli-bundle/chunks/register-operations-P5OGMT6I.js +2 -0
- package/dist/cli-bundle/chunks/{register-setup-2HL5ZHMK.js → register-setup-S3KT2LTH.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-ANTMGYLI.js → chunk-2COZ67XT.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-2EXI2DKR.js +4 -0
- package/dist/cli-bundle/focused-chunks/{chunk-YSAHYUXX.js → chunk-34SX654S.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-36FTZ2NT.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-3CQECMKR.js +16 -0
- package/dist/cli-bundle/focused-chunks/chunk-75774JWP.js +6 -0
- package/dist/cli-bundle/focused-chunks/chunk-7UN6BHHO.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-TCSAPH33.js → chunk-CHIBMEZR.js} +6 -6
- package/dist/cli-bundle/focused-chunks/chunk-DZGAHZZV.js +3 -0
- package/dist/cli-bundle/focused-chunks/chunk-FF4MNAYB.js +153 -0
- package/dist/cli-bundle/focused-chunks/chunk-GHTN2ILR.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-I4YM2I7S.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-IMDTEN7K.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-IW43E4XL.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-JMVA4HKR.js +5 -0
- package/dist/cli-bundle/focused-chunks/{chunk-PL2EYDJK.js → chunk-KR5RVXLQ.js} +31 -29
- package/dist/cli-bundle/focused-chunks/chunk-KSNJG4KI.js +16 -0
- package/dist/cli-bundle/focused-chunks/chunk-M6RPIXKC.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-MXYSIQ56.js +18 -0
- package/dist/cli-bundle/focused-chunks/chunk-RIIN5V4N.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-RKWSCYYN.js +2 -0
- package/dist/cli-bundle/main.js +13 -13
- package/dist/cli-bundle/sdk-authoring.js +1 -1
- package/dist/cli-bundle/sdk-contracts.js +1 -1
- package/dist/cli-bundle/sdk-core.js +38 -38
- 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 +1 -1
- 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 +2 -2
- package/dist/core/diagnostics/remediation.js +19 -9
- package/dist/core/fs/fs-utils.d.ts +10 -0
- package/dist/core/fs/fs-utils.js +16 -4
- package/dist/core/history/history.js +13 -4
- package/dist/core/item/actionability.d.ts +7 -1
- package/dist/core/item/actionability.js +71 -15
- package/dist/core/item/item-format.js +3 -32
- package/dist/core/schema/fields-file.d.ts +1 -2
- package/dist/core/schema/fields-file.js +4 -11
- package/dist/core/schema/runtime-schema.js +3 -10
- package/dist/core/schema/status-defs-file.d.ts +1 -2
- package/dist/core/schema/status-defs-file.js +4 -32
- package/dist/core/schema/status-token.d.ts +2 -0
- package/dist/core/schema/status-token.js +32 -0
- package/dist/core/schema/type-workflows.d.ts +1 -2
- package/dist/core/schema/type-workflows.js +4 -11
- package/dist/core/shared/author.d.ts +25 -0
- package/dist/core/shared/author.js +128 -10
- package/dist/core/shared/errors.d.ts +4 -0
- package/dist/core/shared/errors.js +2 -2
- package/dist/core/shared/text-normalization.d.ts +1 -1
- package/dist/core/shared/text-normalization.js +2 -2
- package/dist/sdk/actionability.d.ts +1 -1
- package/dist/sdk/actionability.js +3 -3
- package/dist/sdk/agent/command-recovery.d.ts +4 -0
- package/dist/sdk/agent/command-recovery.js +52 -0
- package/dist/sdk/agent/command-suggestions.d.ts +4 -0
- package/dist/sdk/agent/command-suggestions.js +67 -0
- package/dist/sdk/agent/create-option-policy.d.ts +12 -0
- package/dist/sdk/agent/create-option-policy.js +32 -0
- package/dist/sdk/agent/item-addressing.d.ts +19 -0
- package/dist/sdk/agent/item-addressing.js +208 -0
- package/dist/sdk/cli-bootstrap.d.ts +1 -1
- package/dist/sdk/cli-bootstrap.js +20 -5
- package/dist/sdk/cli-contracts/commander-mutation-options.js +16 -4
- package/dist/sdk/cli-contracts/flag-contracts.js +62 -21
- package/dist/sdk/cli-contracts/registration-helpers.js +10 -2
- package/dist/sdk/cli-contracts/runtime-contracts.d.ts +8 -0
- package/dist/sdk/cli-contracts/runtime-contracts.js +20 -3
- package/dist/sdk/cli-contracts/tool-option-contracts.d.ts +6 -0
- package/dist/sdk/cli-contracts/tool-option-contracts.js +4 -2
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +19 -4
- package/dist/sdk/cli-contracts/tool-schema.js +17 -4
- package/dist/sdk/context-intent-runtime.js +8 -5
- package/dist/sdk/context-signal-store.d.ts +34 -0
- package/dist/sdk/context-signal-store.js +24 -2
- package/dist/sdk/core-governance.d.ts +1 -1
- package/dist/sdk/core-governance.js +3 -3
- package/dist/sdk/dependencies.d.ts +2 -0
- package/dist/sdk/dependencies.js +7 -6
- package/dist/sdk/dependency-flag-validation.d.ts +15 -1
- package/dist/sdk/dependency-flag-validation.js +54 -2
- package/dist/sdk/extension/bundled-catalog.js +19 -6
- package/dist/sdk/generated-error-code-catalog.js +110 -2
- package/dist/sdk/governance/health.js +38 -12
- package/dist/sdk/governance/provenance-health.d.ts +39 -0
- package/dist/sdk/governance/provenance-health.js +185 -0
- package/dist/sdk/governance/validate-item-reader.d.ts +13 -0
- package/dist/sdk/governance/validate-item-reader.js +18 -0
- package/dist/sdk/governance/validate.d.ts +2 -2
- package/dist/sdk/governance/validate.js +25 -11
- package/dist/sdk/governance.d.ts +1 -0
- package/dist/sdk/governance.js +3 -2
- package/dist/sdk/graph/assembly.d.ts +4 -0
- package/dist/sdk/graph/assembly.js +22 -2
- package/dist/sdk/graph/run.d.ts +2 -0
- package/dist/sdk/graph/run.js +3 -2
- package/dist/sdk/index.d.ts +4 -0
- package/dist/sdk/index.js +6 -2
- package/dist/sdk/lifecycle/close.js +27 -19
- package/dist/sdk/lifecycle/create.d.ts +2 -0
- package/dist/sdk/lifecycle/create.js +66 -19
- package/dist/sdk/lifecycle/plan.js +6 -3
- package/dist/sdk/lifecycle/update-many.js +39 -27
- package/dist/sdk/lifecycle/update.d.ts +6 -1
- package/dist/sdk/lifecycle/update.js +51 -28
- package/dist/sdk/merge/driver.d.ts +2 -1
- package/dist/sdk/merge/driver.js +7 -4
- package/dist/sdk/merge/index.d.ts +1 -1
- package/dist/sdk/merge/index.js +3 -3
- package/dist/sdk/merge/install.d.ts +4 -0
- package/dist/sdk/merge/install.js +29 -17
- package/dist/sdk/merge/receipts.d.ts +17 -1
- package/dist/sdk/merge/receipts.js +112 -20
- package/dist/sdk/merge/reconcile.js +21 -4
- package/dist/sdk/merge/three-way.d.ts +6 -2
- package/dist/sdk/merge/three-way.js +24 -10
- package/dist/sdk/output-projection.js +24 -4
- package/dist/sdk/query/context.d.ts +2 -0
- package/dist/sdk/query/context.js +7 -4
- package/dist/sdk/query/get.d.ts +11 -0
- package/dist/sdk/query/get.js +37 -3
- package/dist/sdk/query/light-metadata.d.ts +3 -0
- package/dist/sdk/query/light-metadata.js +19 -0
- package/dist/sdk/read-output-contracts.d.ts +1 -1
- package/dist/sdk/read-output-contracts.js +23 -4
- package/dist/sdk/relationship-kinds/contract.d.ts +48 -0
- package/dist/sdk/relationship-kinds/contract.js +22 -0
- package/dist/sdk/relationships.d.ts +6 -41
- package/dist/sdk/relationships.js +12 -126
- package/dist/sdk/runtime-primitives.d.ts +1 -1
- package/dist/sdk/runtime-primitives.js +3 -3
- package/dist/sdk/runtime.d.ts +4 -1
- package/dist/sdk/runtime.js +8 -3
- package/dist/sdk/schema-migration.js +7 -9
- package/dist/sdk/similarity-scoring.d.ts +1 -2
- package/dist/sdk/similarity-scoring.js +4 -16
- package/dist/sdk/similarity.d.ts +5 -0
- package/dist/sdk/similarity.js +40 -10
- package/dist/sdk/structured-mutations.js +5 -2
- package/dist/sdk/test/linked-command-detection.d.ts +2 -7
- package/dist/sdk/test/linked-command-detection.js +22 -9
- package/dist/sdk/workspace-snapshot.d.ts +4 -0
- package/dist/sdk/workspace-snapshot.js +24 -11
- package/docs/AGENT_GUIDE.md +5 -2
- package/docs/COMMANDS.md +27 -6
- package/docs/DEPENDENCY_KIND_CONTRACT.md +29 -0
- package/docs/ITEM_READ_PROJECTIONS.md +26 -0
- package/docs/MERGE_SAFETY.md +17 -8
- package/docs/README.md +2 -5
- package/docs/READ_OUTPUT_CONTRACTS.md +2 -2
- package/docs/RELATIONSHIP_GRAPH.md +1 -1
- package/docs/SDK.md +33 -8
- package/docs/SDK_AGENT_SESSION_CONTEXT.md +36 -2
- package/docs/SDK_CONTEXT.md +97 -0
- package/docs/SDK_CONTEXT_INTEGRITY.md +33 -3
- package/docs/SENTRY_CONTRACT_EPOCHS.md +20 -0
- package/docs/agent-task-token-baseline.json +2 -2
- package/marketplace.json +2 -2
- package/package.json +5 -4
- package/packages/pm-beads/package.json +1 -1
- 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-codex/.codex-plugin/plugin.json +1 -1
- package/sdk/public-surface.json +415 -43
- package/dist/cli-bundle/chunks/chunk-GKA54IJM.js +0 -5
- package/dist/cli-bundle/chunks/chunk-KRY7SRUO.js +0 -2
- package/dist/cli-bundle/chunks/chunk-MNJ4NNSY.js +0 -26
- package/dist/cli-bundle/chunks/chunk-OJPCFDDY.js +0 -13
- package/dist/cli-bundle/chunks/chunk-PFSD3DAN.js +0 -194
- package/dist/cli-bundle/chunks/chunk-SQ7QZFQ6.js +0 -2
- package/dist/cli-bundle/chunks/register-operations-5XQETS6E.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-54EU2UVO.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-5FLBTZJQ.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-5GJ57YKN.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-CMDS3KYT.js +0 -14
- package/dist/cli-bundle/focused-chunks/chunk-DMKOMTTY.js +0 -6
- package/dist/cli-bundle/focused-chunks/chunk-F5B3HBEZ.js +0 -5
- package/dist/cli-bundle/focused-chunks/chunk-FI6DWU2M.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-FNOKJG6N.js +0 -16
- package/dist/cli-bundle/focused-chunks/chunk-FPDYXZBK.js +0 -4
- package/dist/cli-bundle/focused-chunks/chunk-GWI6YIKJ.js +0 -3
- package/dist/cli-bundle/focused-chunks/chunk-HCUC62AB.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-HGNKPSCB.js +0 -153
- package/dist/cli-bundle/focused-chunks/chunk-IAS7PMLG.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-SM2PJGP3.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-U646T7Z6.js +0 -18
- package/dist/cli-bundle/focused-chunks/chunk-YKPE4PPY.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-ZOLDTUU7.js +0 -2
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{A as d,C as g,cb as k,cf as E,mi as _,vd as T,wd as m,yk as I}from"./chunk-PFSD3DAN.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="d82065d1-488d-523e-9df2-a30056f29603")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="5810cf1d-fc9a-597b-a47e-a914009fadfa")}catch{}})();function he(e){return e instanceof g||e instanceof Error?e.message:"Unknown failure"}function V(e){if(typeof e!="object"||e===null||!("exitCode"in e))return;let t=e.exitCode;return typeof t=="number"&&Number.isFinite(t)?t:void 0}function N(e){let t=Math.trunc(e);return t>d.SUCCESS?t:d.GENERIC_FAILURE}function ge(e){return typeof e=="object"&&e!==null&&"code"in e&&typeof e.code=="string"&&e.code.startsWith("commander.")}function me(e,t){if(e instanceof Error)return e;let n=new Error(t),o=V(e);return o!==void 0&&(n.exitCode=N(o)),n}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="1c2ee12c-9a3e-57bc-8336-f6c558458802")}catch{}})();var p=new Set(["--pm-path","--path","--author","--output-include","--output-limit","--output-budget","--output-format","--output-session"]),P=new Set(["--output-include","--output-limit","--output-budget","--output-format","--output-session"]),A=e=>{let t=e.indexOf("=");return t>0&&p.has(e.slice(0,t))},w=(e,t)=>typeof t!="string"?!1:e==="--path"||e==="--pm-path"||!t.startsWith("-"),x=new Set(["--no-extensions","--no-pager","--json","--quiet","--lean","--token-accounting"]);function B(e,t,n){let o=e[t];if(x.has(o))return n.booleanFlags.add(o),1;let i=o.indexOf("="),s=i>0?o.slice(0,i):o;if(!p.has(s))return 1;let r=i>0?o.slice(i+1):void 0,a=r===void 0&&w(s,e[t+1]),u=r??(a?e[t+1]:void 0);return s==="--author"?n.author=u??"":typeof u=="string"&&u.length>0&&(P.has(s)?n.outputValues:n.pathValues).set(s,u),a?2:1}function D(e){let t={booleanFlags:new Set,outputValues:new Map,pathValues:new Map},n=0;for(;n<e.length&&e[n]!=="--";)n+=B(e,n,t);return{path:t.pathValues.get("--pm-path")??t.pathValues.get("--path"),noExtensions:t.booleanFlags.has("--no-extensions"),noPager:t.booleanFlags.has("--no-pager"),json:t.booleanFlags.has("--json"),quiet:t.booleanFlags.has("--quiet"),lean:t.booleanFlags.has("--lean"),tokenAccounting:t.booleanFlags.has("--token-accounting"),...t.outputValues.get("--output-include")===void 0?{}:{outputInclude:t.outputValues.get("--output-include")},...t.outputValues.get("--output-limit")===void 0?{}:{outputLimit:t.outputValues.get("--output-limit")},...t.outputValues.get("--output-budget")===void 0?{}:{outputBudget:t.outputValues.get("--output-budget")},...t.outputValues.get("--output-format")==="toon"||t.outputValues.get("--output-format")==="json"?{outputFormat:t.outputValues.get("--output-format")}:{},...t.outputValues.get("--output-session")===void 0?{}:{outputSession:t.outputValues.get("--output-session")},...t.author===""?{authorMissingValue:!0}:t.author!==void 0?{author:t.author}:{}}}function L(e){let t=[],n=0;for(;n<e.length;){let o=e[n];if(o==="--")break;if(x.has(o)||o==="--profile"||o==="--id-only"||o==="--full-changed-fields"||o==="--explain"){n+=1;continue}if(p.has(o)){n+=w(o,e[n+1])?2:1;continue}if(A(o)){n+=1;continue}t.push(o),n+=1}return t}function z(e){let t=L(e);if(t[0]?.trim().toLowerCase()==="help"){let s=[];for(let r=1;r<t.length;r+=1){let a=t[r];if(a.startsWith("-"))break;s.push(a.trim().toLowerCase())}return{requested:!0,commandPathTokens:s}}if(t.findIndex(s=>s==="--help"||s==="-h")<0)return{requested:!1,commandPathTokens:[]};let i=[];for(let s of t){if(s.startsWith("-"))break;i.push(s.trim().toLowerCase())}return{requested:!0,commandPathTokens:i}}function b(e){for(let t=0;t<e.length;t+=1){let n=e[t];if(n==="--")return;if(p.has(n)){t+=w(n,e[t+1])?1:0;continue}if(!(A(n)||x.has(n)||n==="--profile"||n==="--id-only"||n==="--explain")&&!n.startsWith("-"))return t}}function G(e){let t=b(e);return t===void 0?void 0:e[t].trim().toLowerCase()}function v(e,t){return t.noPager?!0:process.stdout.isTTY===!0?!1:z(e).requested}function xe(e){let t=["PAGER","MANPAGER","GIT_PAGER","LESS"],n=t.map(s=>process.env[s]),o=()=>{for(let[s,r]of t.entries()){let a=n[s];a===void 0?delete process.env[r]:process.env[r]=a}},i=D(e);return v(e,i)&&(process.env.PAGER="cat",process.env.MANPAGER="cat",process.env.GIT_PAGER="cat",(typeof process.env.LESS!="string"||process.env.LESS.trim().length===0)&&(process.env.LESS="FRX")),o}var $=new Set(["install","uninstall","explore","manage","doctor","adopt","adopt-all","activate","deactivate"]);function M(e){let t=b(e);if(t===void 0||e[t]!=="extension")return[...e];let n=e[t+1];if(!n||n.startsWith("-"))return[...e];if(!$.has(n))return[...e];if(e.includes("--help")||e.includes("-h"))return[...e];let o=`--${n}`;return e.includes(o)?[...e]:[...e.slice(0,t+1),o,...e.slice(t+2)]}var R=new Set(["pm","pm-cli"]);function W(e,t){let n=b(e);if(n===void 0)return e;let o=e[n];return R.has(o.trim().toLowerCase())?(t.push({from:o,to:[],reason:"executable_alias",confidence:"high"}),[...e.slice(0,n),...e.slice(n+1)]):e}function q(e,t){let n=b(e);if(n===void 0)return e;let o=e[n],i=_[o.trim().toLowerCase()];if(!i)return e;let s=[...e];return s[n]=i,t.push({from:o,to:[i],reason:"command_alias",confidence:"high"}),s}function y(e){return e.replace(/^--?/,"").replace(/_/g,"-").replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function C(e){return y(e).replace(/-/g,"")}function S(e,t,n){let o=e.get(t);if(o===void 0){e.set(t,n);return}o!==n&&e.set(t,null)}function U(e){let t=[],n=o=>{typeof o=="string"&&o.startsWith("--")&&t.push(o)};n(e.flag);for(let o of e.aliases??[])n(o);return t}function j(e,t){let n=t??I(e),o=new Map,i=new Map,s=new Map,r=new Set;for(let a of n){let u=U(a);if(u.length===0)continue;let l=`--${y(u[0])}`;for(let c of u)S(o,y(c),l),S(i,C(c),l);let f=C(l);s.has(l)||s.set(l,f),a.list===!0&&r.add(l)}return{canonicalByNormalized:o,canonicalByCompact:i,canonicalComparables:[...s.entries()].map(([a,u])=>({canonicalFlag:a,comparable:u})),listCanonicalFlags:r}}function F(e,t){let n=y(e),o=t.canonicalByNormalized.get(n);if(typeof o=="string")return{flag:o,reason:"flag_alias",confidence:"high"};let i=n.replace(/-/g,""),s=t.canonicalByCompact.get(i);if(typeof s=="string")return{flag:s,reason:"flag_alias",confidence:"high"};let r=i.length>=8?2:1,a=Number.POSITIVE_INFINITY,u,l=!1;for(let f of t.canonicalComparables){let c=k(i,f.comparable,r);if(c!==null){if(c<a){a=c,u=f.canonicalFlag,l=!1;continue}c===a&&u!==f.canonicalFlag&&(l=!0)}}return!u||l||!Number.isFinite(a)||a<=0?null:{flag:u,reason:"flag_typo",confidence:a>=2?"medium":"high"}}function ke(e){let t=[`${e}s`];return e.endsWith("y")&&e.length>1&&t.push(`${e.slice(0,-1)}ies`),t}function K(e,t=!1){if(t||e.includes("://"))return null;let n=e.match(/^([A-Za-z][A-Za-z0-9_-]{1,63})([:=])(.*)$/);if(!n)return null;let o=n[1],i=n[3];return i.length===0?null:{key:o,value:i}}function X(e,t,n=!1){if(n||!e.startsWith("--"))return{tokens:[e]};let o=e.indexOf("="),i=o>=0?e.slice(0,o):e,s=o>=0?e.slice(o+1):void 0,r=F(i,t);if(!r)return{tokens:[e]};let a=s===void 0?r.flag:`${r.flag}=${s}`;return a===e?{tokens:[e]}:{tokens:[a],event:{from:e,to:[a],reason:r.reason,confidence:r.confidence}}}function Y(e){let t=new Set,n=!1;for(let o=0;o<e.length;o+=1){if(n){t.add(o),n=!1;continue}let i=e[o];n=i==="--path"||i==="--pm-path"}return t}function J(e){if(!e.startsWith("--"))return null;let t=e.indexOf("=");return t<0?{flag:e}:{flag:e.slice(0,t),inlineValue:e.slice(t+1)}}function Z(e,t,n){n.push(e[t]);let o=e[t+1];return typeof o=="string"&&o!=="--"?(n.push(o),t+2):t+1}function H(e,t,n,o){if(n.inlineValue!==void 0)return{originalTokens:[e[t]],value:n.inlineValue,consumed:1};let i=[],s=t+1;for(;s<e.length&&e[s]!=="--"&&!e[s].startsWith("-")&&(i.length===0||o.has(n.flag));)i.push(e[s]),s+=1;let r=i.length===0?1:1+i.length;return{originalTokens:e.slice(t,t+r),value:i.length===0?void 0:i.join(","),consumed:r}}function Q(e,t,n,o){let i=e.get(n);if(i){i.values.push(o.value),i.occurrences+=1;return}e.set(n,{outputIndex:t.length,originalTokens:o.originalTokens,values:[o.value],occurrences:1}),t.push(null)}function ee(e,t){let n=[],o=[];for(let[i,s]of e){if(!(s.occurrences>=2||t.has(i)&&s.originalTokens.length>2)){o.push({outputIndex:s.outputIndex,tokens:s.originalTokens});continue}let a=`${i}=${s.values.join(",")}`;o.push({outputIndex:s.outputIndex,tokens:[a]}),n.push({from:`${i} (x${s.occurrences})`,to:[a],reason:"list_merge",confidence:"high"})}return{events:n,splices:o}}function te(e,t){t.sort((n,o)=>o.outputIndex-n.outputIndex);for(let n of t)e.splice(n.outputIndex,1,...n.tokens)}function ne(e,t,n=new Set,o=new Set){if(t.size===0)return{argv:[...e],events:[]};let i=[],s=new Map,r=0;for(;r<e.length;){let l=e[r];if(l==="--"){i.push(...e.slice(r));break}if(n.has(l)){r=Z(e,r,i);continue}let f=J(l);if(!f||!t.has(f.flag)){i.push(l),r+=1;continue}let c=H(e,r,f,o);if(c.value===void 0){i.push(l),r+=c.consumed;continue}Q(s,i,f.flag,{originalTokens:c.originalTokens,value:c.value}),r+=c.consumed}let{events:a,splices:u}=ee(s,o);return te(i,u),{argv:i,events:a}}var O=new Map([["--add",new Set(["command","cmd","path"])],["--remove",new Set(["command","path"])]]);function oe(e,t){if(e!=="test"||t.length<2)return!1;let n=t[t.length-1],o=t[t.length-2],i=O.get(o);return i!==void 0&&i.has(n)}function ie(e,t){return e==="search"||oe(e,t)}function se(e,t,n){if(t!=="test")return e;let o=[],i=0;for(;i<e.length;){let s=e[i];if(s==="--")return o.push(...e.slice(i)),o;let r=O.get(s),a=r?e[i+1]:void 0;if(!r||typeof a!="string"||!r.has(a)){o.push(s),i+=1;continue}let u=i+2;for(;u<e.length&&!e[u].startsWith("-");)u+=1;if(u-(i+2)!==1){o.push(s),i+=1;continue}let l=e[i+2],f=`${a}=${l}`;o.push(s,f),n.push({from:`${s} ${a} ${l}`,to:[s,f],reason:"bare_key_value",confidence:"high"}),i+=3}return o}function re(e,t,n,o){let i=[],s=Y(e);for(let r=0;r<e.length;r+=1){let a=e[r];if(a==="--"){i.push(...e.slice(r));break}let u=s.has(r),l=i[i.length-1];if(a.startsWith("--")){let c=X(a,t,u);i.push(...c.tokens),c.event&&o.push(c.event);continue}let f=K(a,u);if(f&&!(typeof l=="string"&&l.startsWith("-"))&&!ie(n,i)){let c=F(f.key,t);if(c){let h=[c.flag,f.value];i.push(...h),o.push({from:a,to:h,reason:"bare_key_value",confidence:c.confidence});continue}}i.push(a)}return i}function Te(e){let t=[],n=W(e,t),o=M(n);(o.length!==n.length||o.some((c,h)=>c!==n[h]))&&t.push({from:n.join(" "),to:[...o],reason:"legacy_extension_action",confidence:"high"});let i=q(o,t),s=G(i),r=ae(i),a=j(r??s),u=re(i,a,s,t),l=se(u,s,t),f=ne(l,a.listCanonicalFlags,p,s==="create"?new Set(["--tags"]):new Set);for(let c of f.events)t.push(c);return{argv:f.argv,commandName:s,trace:t}}function ae(e){let t=L(e),n=t[0]?.trim().toLowerCase(),o=t[1]?.trim().toLowerCase();return(n==="extension"||n==="package"||n==="packages")&&typeof o=="string"&&o.length>0&&!o.startsWith("-")?`${n} ${o}`:n}function Ee(e){for(let t=0;t<e.length;t+=1){let n=e[t];if(n==="--")break;if(n==="--type"){let o=e[t+1];if(typeof o=="string"&&o.trim().length>0)return o.trim();continue}if(n.startsWith("--type=")){let o=n.slice(7).trim();if(o.length>0)return o}}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="8f7cca3d-9b19-53b4-a510-5290aaf75e12")}catch{}})();function Ae(e){if(e===void 0)return()=>{};let t=e.trim();if(t.length===0)throw new g("--author requires a non-empty value.",d.USAGE,{code:"missing_required_argument",nextSteps:["Pass an explicit author identifier with --author <id>."]});let n=T();m(t);let o=!1;return()=>{o||(o=!0,n===void 0?m(void 0):m(n))}}import{Command as ue}from"commander";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="a410d336-c332-56fc-9a5d-7841a2b3dfa5")}catch{}})();function Ve(e){return new ue().name("pm").description("Universal, flexible, extensible, agent-optimized project management CLI for any project or programming language.").version(e).showHelpAfterError(!1).allowExcessArguments(!1).allowUnknownOption(!1).configureOutput({writeOut:t=>{E(t)},writeErr:()=>{}}).option("--json","Output JSON instead of TOON; mutations emit a flat receipt with top-level id/status/changed_field_count while reads use documented entity or collection envelopes").option("--lean","Omit null and empty containers from JSON output").option("--token-accounting","Attach a bounded per-section token-cost receipt to command output").option("--output-include <fields>","Retain comma-separated fields or sections in read output").option("--output-limit <count>","Bound rows in read output").option("--output-budget <tokens>","Bound estimated tokens in read output").option("--output-format <toon|json>","Select the read-output encoding").option("--output-session <state>","Carry a JSON session budget and served-item ledger across read calls").option("--quiet","Suppress stdout output").option("--no-changed-fields","Omit the changed_fields array from mutation output (keeps changed_field_count)").option("--full-changed-fields","Restore the legacy full mutation envelope and changed_fields array").option("--id-only","Print only id and status for single-item mutation output").option("--pm-path <dir>","Explicit tracker storage path for this command (preferred over --path)").option("--path <dir>","Backward-compatible alias for --pm-path; this is the tracker storage path, not a workspace cwd").option("--no-extensions","Disable extension loading").option("--no-pager","Disable pager integration for help and long output").option("--explain","Render extended rationale and examples in help output").option("--profile","Print deterministic timing diagnostics").option("--author <id>","Override mutation author for this invocation").exitOverride()}export{he as a,V as b,N as c,ge as d,me as e,D as f,L as g,z as h,G as i,xe as j,M as k,ke as l,ne as m,se as n,Te as o,Ee as p,Ae as q,Ve as r};
|
|
2
|
-
//# sourceMappingURL=chunk-SQ7QZFQ6.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import"./chunk-QWRRFYK3.js";import{Ga as $,Nb as K,W as x,Y as M,db as N,dc as X,eb as U,ec as Q,fb as H,gb as q,gc as Z,k as B,l as O,lb as G,m as S,mb as J,mc as ee,nb as z,nc as te,ob as j,oc as ne,pb as W,pc as E,rb as Y,t as P,vc as ae}from"./chunk-MNJ4NNSY.js";import"./chunk-NUXRRNAB.js";import"./chunk-OJPCFDDY.js";import"./chunk-WYRZZ5ZE.js";import{A as c,Ad as T,C as y,Fg as D,Mk as F,Na as _,Qc as C,Qk as d,Tk as b,Uk as l,Vk as w,Xk as L,Yk as V,ef as s,ff as u,ll as f,oc as I}from"./chunk-PFSD3DAN.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]="13159f49-7756-58b8-ac32-7ddd571e7d09")}catch{}})();var oe=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"]]),ce=new Set(["higher","lower","target"]),de=[...oe.keys()].sort((e,t)=>e.localeCompare(t)).join(", ");function ue(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(n=>typeof n=="string"):e==="direction"&&ce.has(t)}function ie(e){if(e===void 0)return{};let t;try{t=JSON.parse(e)}catch(n){throw new y(`--analytics must be valid JSON: ${String(n)}`,c.USAGE)}if(t===null||typeof t!="object"||Array.isArray(t))throw new y("--analytics must be a JSON object.",c.USAGE);for(let[n,a]of Object.entries(t)){let o=oe.get(n);if(!ue(o,a))throw new y(o===void 0?`Unknown --analytics field "${n}". Accepted fields: ${de}.`:`--analytics field "${n}" must be ${o.replace("_"," ")}.`,c.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]="eee25545-a7e9-54be-abc0-dbccc9b41e74")}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]="b0095f00-00bd-5b28-933c-b63a1711a73d")}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]="99355d20-090b-503e-8079-b858291938e3")}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]="35276f20-abc5-54e2-8251-35971f1fcb4f")}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]="8fa4af33-ba9f-5a19-a359-c64143287b5d")}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]="52c4154e-2761-5230-942c-6ac5e83a830c")}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]="c3fceb32-e0b9-5690-8653-4c699f865c0f")}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]="1e42a508-5568-522f-843d-61febc0bad27")}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]="43769e60-ed80-521d-9375-c28ee5b0ac06")}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]="3f1deb3b-e341-533a-a349-eca48f347600")}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]="91a42861-f8cb-575b-8596-53870f6275c6")}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]="c85956ff-383f-5482-96a9-0ef38949859c")}catch{}})();var re=(e,t)=>N(e,t,{runUpdate:(n,a,o)=>x(n,a,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]="4856ec1e-7841-5ad0-95e3-6e3057ed999c")}catch{}})();function me(e,t){let n=e?.trim().toLowerCase(),a=t?.trim().toLowerCase();if(n===void 0||n.length===0)return a;if(n==="local-analytics")return a&&a.length>0?a:"status";if(a!==void 0&&a.length>0)throw new y(`Unknown pm telemetry path "${e} ${t}". Use "pm telemetry ${e}" or legacy alias "pm telemetry local-analytics ${a}".`,c.USAGE,{code:"unknown_subcommand",examples:["pm telemetry status","pm telemetry flush","pm telemetry stats --limit 10","pm telemetry clear","pm telemetry local-analytics status --json"]});return n}function fe(e){return{addValues:Array.isArray(e.add)?e.add:[],addJsonValues:Array.isArray(e.addJson)?e.addJson:[],removeValues:Array.isArray(e.remove)?e.remove:[]}}function pe(e,t){if(e.background===!0){if(e.run!==!0)throw new y("--background requires --run",c.USAGE);if(t.addValues.length>0||t.addJsonValues.length>0||t.removeValues.length>0)throw new y("--background does not support --add/--add-json/--remove; update linked tests first, then run in background",c.USAGE)}}async function ye(e,t,n,a){let o=await E({kind:"test",commandArgs:L(e,{...t,add:a.addValues,addJson:a.addJsonValues,remove:a.removeValues}),targetId:e,author:typeof t.author=="string"?t.author:void 0,noExtensions:n.noExtensions===!0},n);s(o,n)}function ge(e,t){return{add:t.addValues,addJson:t.addJsonValues,remove:t.removeValues,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,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}}async function he(e,t,n,a){let o=await ee(e,ge(t,a),n);(a.addValues.length>0||a.addJsonValues.length>0||a.removeValues.length>0||t.run===!0)&&await f(n,o),s(o,n),(o.run_results.some(i=>i.status==="failed")||o.fail_on_skipped_triggered===!0)&&(process.exitCode=c.DEPENDENCY_FAILED)}async function be(e,t,n){let a=d(n),o=Date.now(),i=fe(t);pe(t,i),t.background===!0?await ye(e,t,a,i):await he(e,t,a,i),a.profile&&u(`profile:command=test took_ms=${Date.now()-o}`)}function A(e){let t=l(e,"author"),n=l(e,"assignee");if(t!==void 0&&n!==void 0&&t!==n)throw new y("Lifecycle ownership received conflicting --author and --assignee values; use one actor value for both aliases.",c.USAGE,{code:"conflicting_lifecycle_owner",examples:["pm claim pm-123","pm start-task pm-123","pm release pm-123"]});return{author:t??n,message:l(e,"message")}}async function we(e,t){let n=d(t),a=Date.now();if(e.background===!0){let r=await E({kind:"test-all",commandArgs:V(e),statusFilter:l(e,"status"),noExtensions:n.noExtensions===!0},n);s(r,n),n.profile&&u(`profile:command=test-all took_ms=${Date.now()-a}`);return}let i=await te({status:l(e,"status"),limit:l(e,"limit"),offset:l(e,"offset"),timeout:l(e,"timeout"),progress:!!e.progress,envSet:Array.isArray(e.envSet)?e.envSet:[],envClear:Array.isArray(e.envClear)?e.envClear:[],sharedHostSafe:!!e.sharedHostSafe,pmContext:l(e,"pmContext"),overrideLinkedPmContext:!!e.overrideLinkedPmContext,failOnContextMismatch:!!e.failOnContextMismatch,failOnSkipped:!!e.failOnSkipped,failOnEmptyTestRun:!!e.failOnEmptyTestRun,requireAssertionsForPm:!!e.requireAssertionsForPm,checkContext:!!e.checkContext,autoPmContext:!!e.autoPmContext},n);await f(n,{ids:i.results.map(r=>r.id)}),s(i,n),(i.failed>0||i.fail_on_skipped_triggered===!0)&&(process.exitCode=c.DEPENDENCY_FAILED),n.profile&&u(`profile:command=test-all took_ms=${Date.now()-a}`)}async function ke(e,t,n,a){let o=d(a),i=Date.now(),r=await Z({subcommand:me(e,t),limit:l(n,"limit")},o);s(r,o),o.profile&&u(`profile:command=telemetry took_ms=${Date.now()-i}`)}async function ve(e,t){let n=d(t),a=Date.now(),o=ie(l(e,"analytics")),i=await X(n,{storage:e.storage===!0,metadataCoverage:e.metadataCoverage===!0,byAssignee:e.byAssignee===!0,byTag:e.byTag===!0,byPriority:e.byPriority===!0,tagPrefix:l(e,"tagPrefix"),fieldUtilization:e.fieldUtilization===!0,...o});i.recorded_observations?.some(r=>r.changed)===!0&&await f(n,{ids:i.recorded_observations?.flatMap(r=>r.observation.item_id?[r.observation.item_id]:[])}),s(i,n),n.profile&&u(`profile:command=stats took_ms=${Date.now()-a}`)}async function xe(e,t){let n=d(t),a=Date.now(),o=l(e,"threshold"),i=l(e,"limit"),r=await Q(n,{status:Array.isArray(e.status)&&e.status.length>0?e.status:void 0,since:l(e,"since"),...o===void 0?{}:{threshold:Number(o)},...i===void 0?{}:{limit:Number(i)}});s(r,n),n.profile&&u(`profile:command=duplicates took_ms=${Date.now()-a}`)}async function Ae(e,t){let n=d(t),a=Date.now(),o=await $(n,{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,skipVectors:!!e.skipVectors,skipIntegrity:!!e.skipIntegrity,skipDrift:!!e.skipDrift,full:!!e.full});s(o,n),(e.strictExit||e.failOnWarn)&&!o.ok&&(I({...o,exit_code:c.GENERIC_FAILURE,error_code:"health_findings",error_category:"validation",command_resolution:"health_findings",resolution_stage:"execute"}),process.exitCode=c.GENERIC_FAILURE),n.profile&&u(`profile:command=health took_ms=${Date.now()-a}`)}async function _e(e,t){let n=d(t),a=Date.now(),o=await re({checkMetadata:!!e.checkMetadata,metadataProfile:l(e,"metadataProfile"),checkResolution:!!e.checkResolution,checkLifecycle:!!e.checkLifecycle,checkStaleBlockers:!!e.checkStaleBlockers,dependencyCycleSeverity:l(e,"dependencyCycleSeverity"),parentCycleSeverity:l(e,"parentCycleSeverity"),checkFiles:!!e.checkFiles,checkCommandReferences:!!e.checkCommandReferences,scanMode:l(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},n);s(o,n),(e.strictExit||e.failOnWarn)&&(o.has_warnings||!o.ok)&&(I({...o,exit_code:c.GENERIC_FAILURE,error_code:"validation_findings",error_category:"validation",command_resolution:"validation_findings",resolution_stage:"execute"}),process.exitCode=c.GENERIC_FAILURE),n.profile&&u(`profile:command=validate took_ms=${Date.now()-a}`)}async function De(e,t){let n=d(t),a=Date.now(),o=await M(n,{dryRun:e.dryRun===!0,scope:Array.isArray(e.scope)?e.scope:[]});s(o,n),n.profile&&u(`profile:command=gc took_ms=${Date.now()-a}`)}async function Se(e,t,n,a){let o=d(a),i=_(process.cwd(),o.path),r=e.trim().toLowerCase();if(!["create","list","inspect","restore","delete"].includes(r))throw new y(`Unknown workspace snapshot action "${e}". Use create, list, inspect, restore, or delete.`,c.USAGE,{code:"unknown_subcommand",examples:["pm workspace snapshot create before-migration","pm workspace snapshot list","pm workspace snapshot restore before-migration"]});if(r==="list"){s(await z(i),o);return}if(r==="create"){s(await G(i,t===void 0?{}:{name:t}),o);return}if(t===void 0)throw new y(`pm workspace snapshot ${r} requires a snapshot name or fingerprint`,c.USAGE);if(r==="inspect"){s(await J(i,t),o);return}if(r==="restore"){if(n.dryRun===!0){s(await j(i,t),o);return}let m=await D(i);s(await W(i,t,{force:n.force===!0,author:T(l(n,"author"),m.author_default),message:l(n,"message"),lockTtlSeconds:m.locks.ttl_seconds,lockWaitMs:m.locks.wait_ms}),o);return}s(await Y(i,t),o)}async function Ie(e,t){let n=d(t),a=Date.now(),o=await K({action:l(e,"action"),command:l(e,"command"),summary:!!e.summary,schemaOnly:!!e.schemaOnly,flagsOnly:!!e.flagsOnly,availabilityOnly:!!e.availabilityOnly,runtimeOnly:!!e.runtimeOnly||!!e.activeOnly,full:!!e.full},n);s(o,n),n.profile&&u(`profile:command=contracts took_ms=${Date.now()-a}`)}async function Ce(e,t,n){let a=d(n),o=Date.now(),i={...A(t),ifAvailable:t.ifAvailable===!0,maxAttempts:t.maxAttempts};Be(e,t.next===!0);let r=t.next===!0?await O(!!t.force,a,i,{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,tokenBudget:t.tokenBudget??t.token_budget,explainRanking:t.explainRanking===!0||t.explain_ranking===!0}):await B(e,!!t.force,a,i);await f(a,r),s(r,a),a.profile&&u(`profile:command=claim took_ms=${Date.now()-o}`)}function Be(e,t){if(!t&&!e)throw new y("Specify an item id or pass --next",c.USAGE);if(t&&e)throw new y("Specify either an item id or --next, not both",c.USAGE)}async function Ee(e,t,n){let a=d(n),o=Date.now(),i=await S(e,!!t.force,a,{...A(t),ownershipReleaseBypass:t.ownershipReleaseBypass===!0});await f(a,i),s(await F("release",[e],t,a,i),a),a.profile&&u(`profile:command=release took_ms=${Date.now()-o}`)}async function Re(e,t,n){let a=d(n),o=Date.now(),i=_(process.cwd(),a.path),r=await D(i),m=C(r.schema),h=ne(m),g=!!t.force,k=A(t),v=await B(e,g,a,k);await f(a,v);let R=await x(e,{...k,status:h,force:g},a);await f(a,R),s({id:e,action:"start_task",claim:v,update:R},a),a.profile&&u(`profile:command=start-task took_ms=${Date.now()-o}`)}async function Te(e,t,n){let a=d(n),o=Date.now(),i=_(process.cwd(),a.path),r=await D(i),m=C(r.schema),h=!!t.force,g=A(t),k=await x(e,{...g,status:m.open_status,force:h},a);await f(a,k);let v=await S(e,h,a,g);await f(a,v),s({id:e,action:"pause_task",update:k,release:v},a),a.profile&&u(`profile:command=pause-task took_ms=${Date.now()-o}`)}async function Oe(e,t,n,a){let o=d(a),i=Date.now(),r=!!n.force,m=A(n),h=await P(e,t,{...m,validateClose:l(n,"validateClose"),force:r},o);await f(o,h);let g=await S(e,r,o,m);await f(o,g),s({id:e,action:"close_task",close:h,release:g},o),o.profile&&u(`profile:command=close-task took_ms=${Date.now()-i}`)}function se(e){return e.option("--background","Run linked tests in managed background mode").option("--timeout <seconds>","Default run timeout in seconds").option("--progress","Emit linked-test progress to stderr (always shown in TTY, opt-in for non-TTY)").option("--env-set <value>","Set environment variable(s) for linked-test runs (KEY=VALUE, repeatable)",b).option("--env-clear <value>","Clear environment variable(s) for linked-test runs (NAME, repeatable)",b).option("--shared-host-safe","Apply additive shared-host-safe runtime defaults for linked-test runs").option("--pm-context <mode>","PM linked-test context mode: schema|tracker|auto (default: schema)").option("--override-linked-pm-context","Force run-level --pm-context to override per-linked-test pm_context_mode metadata").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","Treat successful linked-test commands that report zero executed tests as failures").option("--require-assertions-for-pm","Require assertion metadata for linked PM command tests").option("--check-context","Preflight linked PM command context diagnostics before executing commands").option("--auto-pm-context","Auto-remediate PM tracker-read context mismatches by routing those linked commands through tracker context")}function Ct(e){let t=e.command("test").argument("<id>","Item id").option("--add <value>","Add linked test entry (CSV/markdown pairs or - for stdin)",b).option("--add-json <value>","Add linked test entry from JSON object/array (or - for stdin)",b).option("--remove <value>","Remove linked test entry by command/path (command=<value>, path=<value>, markdown pairs, plain value, or - for stdin)",b).option("--list","List linked tests without mutating").option("--run","Run linked test commands").option("--match <value>","Run only linked tests whose command/path contains this substring").option("--only-index <n>","Run only the 1-based linked-test index from --list order").option("--only-last","Run only the most recently added linked test");se(t).option("--measure <value>","Record name=value[,unit=...][,threshold=...] evidence; repeatable",b).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(be);let n=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");se(n).action(we),e.command("test-runs-worker",{hidden:!0}).argument("<runId>","Background run id").description("Internal background worker command.").action(async(h,g,k)=>{let v=d(k);await ae(h,v)}),e.command("telemetry").argument("[namespaceOrSubcommand]","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(ke),e.command("duplicates").description("Find existing duplicate clusters across all statuses without creating an item.").option("--status <value>","Lifecycle status to include (repeatable or comma-separated)",b,[]).option("--since <value>","Only inspect items created at or after this time").option("--threshold <value>","Minimum similarity score from 0 through 1").option("--limit <n>","Maximum duplicate clusters to return").action(xe),e.command("stats").description("Show project tracker statistics.").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(ve),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 (advisory telemetry warnings are excluded; see warnings[])").option("--fail-on-warn","Alias for --strict-exit").action(Ae),e.command("validate").description("Run standalone metadata, resolution, lifecycle, files, linked-command reference, and history drift validation checks.").option("--check-metadata","Run metadata completeness checks").option("--metadata-profile <value>","Select metadata validation profile for --check-metadata (core|strict|custom)").option("--check-resolution","Run closed-item resolution metadata checks").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 validate diagnostic ID lists instead of compact summaries").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 the safe, deterministic subset of fix-hint remediations (field backfills) automatically").option("--dry-run","Preview planned --auto-fix/--prune-missing fixes without applying them").option("--fix-scope <scope>","Grant --auto-fix scopes (metadata, resolution, lifecycle; comma-separated or repeatable). Default: metadata, resolution; lifecycle must be named explicitly",b).option("--prune-missing","Remove stale linked-file/doc LINKS whose paths classified as deleted (never touches 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(_e),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",b).description("Delete optional cache artifacts by default (including expired lock debris) and show a summary.").action(De),e.command("workspace").description("Manage portable workspace-level SDK primitives.").command("snapshot").argument("<action>","Snapshot action: create, list, inspect, restore, delete").argument("[target]","Optional name for create; name or fingerprint otherwise").description("Create, inspect, list, restore, or delete 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(Se),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(Ie);let a=e.command("claim").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 silently when the item is already claimed by another author (returns 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("--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(Ce);w(a,"--assignee <value>","Alias for --author on lifecycle ownership commands"),w(a,"--token_budget <n>","Alias for --token-budget"),w(a,"--explain_ranking","Alias for --explain-ranking");let o=e.command("release").argument("<id>","Item id").option("--author <value>","Mutation author").option("--message <value>","History message").option("--force","Force release override").description("Release an item's active claim.").action(Ee);w(o,"--assignee <value>","Alias for --author on lifecycle ownership commands");let i=e.command("start-task").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(Re);w(i,"--assignee <value>","Alias for --author on lifecycle ownership commands");let r=e.command("pause-task").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(Te);w(r,"--assignee <value>","Alias for --author on lifecycle ownership commands");let m=e.command("close-task").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(Oe);w(m,"--assignee <value>","Alias for --author on lifecycle ownership commands"),Pe(e)}function p(e){return typeof e=="string"?e:void 0}function le(e){return{parent:p(e.parent),allowMissingParent:e.allowMissingParent===!0?!0:void 0,tags:p(e.tags),priority:p(e.priority),body:p(e.body),description:p(e.description),author:p(e.author),message:p(e.message)}}function Pe(e){for(let{name:t,describe:n}of[{name:"meet",describe:"Shortcut: create a Meeting with a start time and duration."},{name:"event",describe:"Shortcut: create an Event with a start time and duration."}])e.command(t).argument("<title>","Item title").option("--start <when>","Start time (ISO, 'now', or relative like +1h/+2d); defaults to now").option("--duration <span>","Duration from start (relative like 1h/2d); defaults to 1h when --end is omitted").option("--end <when>","End time (ISO or relative); overrides --duration").option("--location <value>","Location").option("--timezone <value>","IANA timezone (for example America/New_York)").option("--all-day","Mark as an all-day event").option("--parent <id>","Parent item id").option("--allow-missing-parent","Permit a parent id that does not exist yet").option("--tags <list>","Comma-separated tags").option("--priority <value>","Priority").option("--body <text>","Body/markdown content").option("--description <text>","Short description").option("--author <value>","Mutation author").option("--message <value>","History message").description(n).action(async(a,o,i)=>{let r=d(i),m=Date.now(),g=await(t==="meet"?U:H)(a,{...le(o),start:p(o.start),duration:p(o.duration),end:p(o.end),location:p(o.location),timezone:p(o.timezone),allDay:o.allDay===!0?!0:void 0},r);await f(r,g),s(g,r),r.profile&&u(`profile:command=${t} took_ms=${Date.now()-m}`)});e.command("remind").argument("<title>","Item title").option("--at <when>","Reminder time (ISO, 'now', or relative like +2d); defaults to +1d").option("--text <value>","Reminder text; defaults to the title").option("--parent <id>","Parent item id").option("--allow-missing-parent","Permit a parent id that does not exist yet").option("--tags <list>","Comma-separated tags").option("--priority <value>","Priority").option("--body <text>","Body/markdown content").option("--description <text>","Short description").option("--author <value>","Mutation author").option("--message <value>","History message").description("Shortcut: create a Reminder from a single point in time.").action(async(t,n,a)=>{let o=d(a),i=Date.now(),r=await q(t,{...le(n),at:p(n.at),text:p(n.text)},o);await f(o,r),s(r,o),o.profile&&u(`profile:command=remind took_ms=${Date.now()-i}`)})}export{Ct as registerOperationCommands,Be as requireClaimTarget};
|
|
2
|
-
//# sourceMappingURL=register-operations-5XQETS6E.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
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]="50ad61f1-6719-541c-b4e0-4a88468725cf")}catch{}})();var N=["commands","renderers","hooks","schema","importers","search","parser","preflight","services"],fe=2,pe=Object.freeze({migration:"schema",validation:"schema"}),yt=Object.freeze({version:fe,capabilities:[...N],legacy_aliases:{...pe}}),P=["off","warn","enforce"],j=["off","warn","enforce"],V=["none","restricted","strict"],ht=["block","warn"],F=["commands.override","commands.handler","hooks.beforecommand","hooks.beforemutation","hooks.aftercommand","hooks.onwrite","hooks.onread","hooks.onindex","schema.flags","schema.itemfields","schema.itemtypes","schema.relationshipkinds","schema.migrations","schema.profiles","parser.override","preflight.override","services.override","renderers.override","importers.importer","importers.exporter","search.provider","search.vectorstore"],K=["output_format","error_format","help_format","lock_acquire","lock_release","history_append","item_store_write","item_store_delete","context_relevance","command_result"];function B(){return{mode:"off",trust_mode:"off",require_provenance:!1,trusted_extensions:[],default_sandbox_profile:"none",allowed_extensions:[],blocked_extensions:[],allowed_capabilities:[],blocked_capabilities:[],allowed_surfaces:[],blocked_surfaces:[],allowed_commands:[],blocked_commands:[],allowed_actions:[],blocked_actions:[],allowed_services:[],blocked_services:[],extension_overrides:[]}}(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]="2a2072c1-f4a7-579e-ac11-4c75758d76d3")}catch{}})();var me=["Epic","Feature","Task","Chore","Issue","Decision","Event","Reminder","Milestone","Meeting","Plan"],St=me,At=["draft","open","in_progress","blocked","closed","canceled"],Tt=["draft","active","blocked","terminal","terminal_done","terminal_canceled","default_open","default_close","default_cancel"],Nt=["string","number","boolean","string_array","array","object"],It=["create","update","update_many","list","search","calendar","context"],kt=["allow","warn","reject"],wt=["blocks","parent","child","parent_child","child_of","related","related_to","discovered_from","blocked_by","incident_from","epic","implements","supersedes","task","verifies"],Rt=["project","global"],xt=["low","medium","high","critical"],vt=["low","medium","high","critical"],Ct=["low","medium","high"];var Dt=["minimal","default","strict","custom"],Lt=["none","warn","strict"],Mt=["progressive","strict"],Ut=["off","warn","strict"],Pt=["off","warn","strict"];var jt=["daily","weekly","monthly","yearly"],ge=["mon","tue","wed","thu","fri","sat","sun"];function Vt(e){return ge.indexOf(e)}var Ft=["draft","research","review","approved","executing","paused","completed","superseded"],Kt=["pending","in_progress","completed","blocked","skipped","superseded"],Bt=["codex","claude-code","cursor","generic"],Gt=["related","blocks","blocked_by","depends_on","discovered_from","implements","verifies","supersedes"],Xt=["brief","standard","deep","full"],Yt=["hierarchy","activity","progress","recently_created","unparented","blockers","files","workload","staleness","tests"];(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]="36b908f0-ea19-5adc-8ccd-320ad3c3b1fe")}catch{}})();var Ee=Object.freeze([{id:"draft",roles:["draft"]},{id:"open",roles:["active","default_open"]},{id:"in_progress",aliases:["in-progress"],roles:["active"]},{id:"blocked",roles:["blocked"]},{id:"closed",roles:["terminal","terminal_done","default_close"]},{id:"canceled",aliases:["cancelled"],roles:["terminal","terminal_canceled","default_cancel"]}]),be=Object.freeze({draft_status:"draft",open_status:"open",in_progress_status:"in_progress",blocked_status:"blocked",close_status:"closed",canceled_status:"canceled"}),Wt=".agents/pm",$t="settings.json";var ye=["","epics","features","tasks","chores","issues","schema","history","search","extensions","locks"],he=["decisions","events","reminders","milestones","meetings","plans"],Ht=[...ye,...he],Jt={Epic:"epics",Feature:"features",Task:"tasks",Chore:"chores",Issue:"issues",Decision:"decisions",Event:"events",Reminder:"reminders",Milestone:"milestones",Meeting:"meetings",Plan:"plans"},Oe=["goal","objective","value","impact","outcome","why_now","parent","reviewer","risk","confidence","sprint","release","blocked_by","blocked_reason","unblock_note","reporter","severity","environment","repro_steps","resolution","expected_result","actual_result"],Zt=["id","title","description","type","pm_format_version","source_type","type_options","status","priority","tags","created_at","updated_at","deadline","reminders","events","closed_at","completed_at","assignee","claim_principal","source_owner","author","estimated_minutes","acceptance_criteria","design","external_ref","definition_of_ready","order",...Oe,"affected_version","fixed_version","component","regression","customer_impact","dependencies","comments","notes","learnings","files","tests","test_runs","docs","close_reason","duplicate_of","plan_mode","plan_scope","plan_harness","plan_resume_context","plan_validation","plan_decisions","plan_discoveries","plan_steps"],Se={minimal:{ownership_enforcement:"none",create_mode_default:"progressive",close_validation_default:"off",require_close_reason:!0,parent_reference:"strict_error",metadata_profile:"core",force_required_for_stale_lock:!1,duplicate_detection_mode:"off",duplicate_detection_threshold:.8,duplicate_detection_limit:3},default:{ownership_enforcement:"warn",create_mode_default:"progressive",close_validation_default:"warn",require_close_reason:!0,parent_reference:"strict_error",metadata_profile:"core",force_required_for_stale_lock:!0,duplicate_detection_mode:"strict",duplicate_detection_threshold:.8,duplicate_detection_limit:3},strict:{ownership_enforcement:"strict",create_mode_default:"strict",close_validation_default:"strict",require_close_reason:!0,parent_reference:"strict_error",metadata_profile:"strict",force_required_for_stale_lock:!0,duplicate_detection_mode:"strict",duplicate_detection_threshold:.8,duplicate_detection_limit:3}},Ae=["no active blocker","ready for planned execution sequencing","work completed","work is closed"],I={blocked_reason:["no active blocker because work is closed","work is closed"],resolution:["closed with implementation evidence","closed with verification evidence","work completed and recorded","work is closed"],actual_result:["closed and recorded","work completed","work completed and recorded"]};function G(e){return e?[...e]:void 0}var Qt={version:1,id_prefix:"pm-",ids:{token_length:4},author_default:"",agent_identity:{probes_enabled:!0,identity_vocabulary:{version:1,aliases:{}},harness_signals:[]},mutation_guard:{require_attributed_author:!1,secret_guard:"advise",stale_in_progress_hours:72},item_format:"toon",locks:{ttl_seconds:1800,wait_ms:3e3},checkpoints:{retention_days:14},output:{default_format:"toon"},history:{missing_stream:"auto_create",compact_policy:{enabled:!1,max_entries:500,trigger:"health_warn"}},validation:{sprint_release_format:"warn",parent_reference:"warn",metadata_profile:"core",metadata_required_fields:[],lifecycle_stale_blocker_reason_patterns:[...Ae],lifecycle_closure_like_blocked_reason_patterns:[...I.blocked_reason],lifecycle_closure_like_resolution_patterns:[...I.resolution],lifecycle_closure_like_actual_result_patterns:[...I.actual_result],estimate_defaults_by_type:{}},governance:{preset:"minimal",...Se.minimal},workflow:{definition_of_done:[]},testing:{record_results_to_items:!1},telemetry:{enabled:!0,first_run_prompt_completed:!1,capture_level:"redacted",endpoint:"https://pm-cli.unbrained.dev/v1/events",installation_id:"",retention_days:365},agent_guidance:{prompt_completed:!1,declined:!1,declined_at:"",template_version:1,last_checked_files:[]},item_types:{definitions:[]},schema:{version:1,files:{types:"schema/types.json",statuses:"schema/statuses.json",fields:"schema/fields.json",workflows:"schema/workflows.json"},statuses:Ee.map(e=>({...e,aliases:G(e.aliases),roles:G(e.roles)})),fields:[],workflow:{...be},unknown_field_policy:"allow"},extensions:{enabled:[],disabled:[],policy:B()},search:{score_threshold:0,hybrid_semantic_weight:.7,max_results:50,embedding_model:"",embedding_batch_size:32,embedding_timeout_ms:3e4,scanner_max_batch_retries:3,provider:"",mutation_refresh_policy:"semantic_configured",query_expansion:{enabled:!1,provider:""},rerank:{enabled:!1,model:"",top_k:20}},providers:{openai:{base_url:"",api_key:"",model:""},ollama:{base_url:"",model:""}},context:{default_depth:"brief",activity_limit:10,stale_threshold_days:7,sections:{hierarchy:!0,activity:!0,progress:!0,recently_created:!0,unparented:!0,blockers:!0,files:!0,workload:!0,staleness:!0,tests:!0}},vector_store:{adapter:"",collection_name:"pm_items",qdrant:{url:"",api_key:""},lancedb:{path:""}}},en={metadata:{},body:""},f={SUCCESS:0,GENERIC_FAILURE:1,USAGE:2,NOT_FOUND:3,CONFLICT:4,DEPENDENCY_FAILED:5,NO_EFFECT:6,PARTIAL_EFFECT:7},tn=Object.freeze({unknown_command:"usage",unknown_option:"usage",missing_required_option:"usage",missing_required_argument:"usage",invalid_command_usage:"usage",linked_test_value_not_quoted:"usage",invalid_argument_value:"validation",health_findings:"validation",validation_findings:"validation",close_through_update:"validation",no_update_fields:"validation",unsupported_update_option:"validation",tracker_not_initialized:"validation",item_not_found:"validation",ownership_conflict:"conflict",lock_conflict:"conflict",terminal_state_conflict:"conflict",dependency_failed:"runtime",init_gitignore_unwritable:"runtime",merge_git_config_unwritable:"runtime",command_failed:"runtime",unknown_error:"runtime"});(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]="c2c9251e-86bf-5a92-acdb-581e59d269d8")}catch{}})();var _=class extends Error{exitCode;code;context;constructor(t,n,o={}){super(t),this.name="PmCliError",this.exitCode=n,this.context=o,this.code=o.code}};(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]="15daa637-4d30-5794-bdb5-87585d443cd3")}catch{}})();var Te=[...N],Ne=[...K],Ie=[...P],rn=[...j],an=[...V],ke=[...F],X=["init","config","extension","package","packages","install","upgrade","create","item","copy","focus","list","list-all","list-draft","list-open","list-in-progress","list-blocked","list-closed","list-canceled","aggregate","context","ctx","get","graph","search","duplicates","eval","next","history","events","history-redact","history-repair","history-compact","history-author-acknowledge","merge","schema","profile","activity","restore","update","update-many","close","close-many","delete","append","comments","notes","learnings","files","docs","deps","plan","test","test-all","telemetry","stats","health","validate","gc","workspace","contracts","claim","release","start-task","pause-task","close-task","meet","event","remind","help"],cn=["ancestors","descendants","predecessors","successors","paths","impact","analyze","audit","communities","redundancy","dominators","slack","centrality","articulation","plan","index"],we=["init","install","uninstall","explore","manage","describe","reload","doctor","catalog","adopt","adopt-all","activate","deactivate"],Y={help:"Commander help rendering has no SDK operation result.",item:"The item namespace only groups lifecycle subcommands already exposed as actions.",packages:"The plural package alias only renders package-oriented help."},z=Object.freeze(X.flatMap(e=>e in Y?[]:e==="extension"||e==="package"?[...we.map(t=>`${e}-${t}`),e]:[e]));function dn(e=X,t=z,n=Y){let o=new Set(t),s=new Set(e);return{missing_cli_actions:e.filter(r=>!o.has(r)&&n[r]===void 0),waived_cli_actions:e.filter(r=>!o.has(r)&&n[r]!==void 0),stale_waivers:Object.keys(n).filter(r=>!s.has(r)||o.has(r))}}function un(e){return z.includes(e)}function ln(e){return Te.includes(e)}function _n(e){return Ne.includes(e)}function fn(e){return Ie.includes(e)}function pn(e){return ke.includes(e)}(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]="ae6fbd4a-6c4e-5639-93ac-f107a336e95b")}catch{}})();function k(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Re(e,t){let n=e;for(let o of t.split(".")){if(!k(n))return;n=n[o]}return n}function q(e,t,n){let o=t.split("."),s={...e},r=e,i=s;for(let a of o.slice(0,-1)){let c=r[a],u={...c};i[a]=u,r=c,i=u}return i[o.at(-1)]=n,s}function w(e){let t=e.row_contract;return k(t)&&Array.isArray(t.row_keys)?t.row_keys.filter(n=>typeof n=="string"&&n.trim().length>0):Object.entries(e).filter(([,n])=>Array.isArray(n)).map(([n])=>n)}function p(e){return w(e).flatMap(t=>{let n=Re(e,t);return Array.isArray(n)||k(n)?[{path:t,value:n}]:[]})}function h(e){return p(e).reduce((t,n)=>t+(Array.isArray(n.value)?n.value.length:Object.keys(n.value).length),0)}function O(e,t){let n=e;for(let o of p(n)){let s=Array.isArray(o.value)?o.value.map((r,i)=>t(r,o.path,i)):Object.fromEntries(Object.entries(o.value).map(([r,i],a)=>[r,t(i,o.path,a)]));n=q(n,o.path,s)}return n}function W(e,t){let n=e,o=!1;for(let s of p(n)){let r=Array.isArray(s.value)?s.value:Object.entries(s.value);if(r.length<=t)continue;o=!0;let i=Array.isArray(s.value)?r.slice(0,t):Object.fromEntries(r.slice(0,t));n=q(n,s.path,i)}return{result:n,truncated: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]="04ad0d11-1fb7-5eb4-8ff0-d81a7090c4ff")}catch{}})();var R=256,$=1e4,xe=/^[A-Za-z0-9][A-Za-z0-9._:-]{0,63}$/u,ve=/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/u,Ce=new Set(["version","id","token_budget","spent_tokens","seen_item_ids"]),De=[{valid:e=>e.version===1,reason:"version must equal 1."},{valid:e=>typeof e.id=="string"&&xe.test(e.id),reason:"id must be 1-64 portable identifier characters."},{valid:e=>Number.isSafeInteger(e.token_budget)&&e.token_budget>=R,reason:`token_budget must be a safe integer of at least ${R}.`},{valid:e=>Number.isSafeInteger(e.spent_tokens)&&e.spent_tokens>=0&&e.spent_tokens<=e.token_budget,reason:"spent_tokens must be a non-negative safe integer no larger than token_budget."},{valid:e=>Array.isArray(e.seen_item_ids)&&e.seen_item_ids.length<=$&&e.seen_item_ids.every(t=>typeof t=="string"&&ve.test(t)),reason:`seen_item_ids must contain at most ${$} portable item identifiers.`}];function A(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function S(e){throw new _(`--output-session ${e}`,f.USAGE,{code:"invalid_read_output_session",field:"outputSession"})}function x(e){if(e===void 0)return;let t=e;if(typeof e=="string")try{t=JSON.parse(e)}catch{S("must be a valid JSON object.")}A(t)||S("must be a JSON object.");let n=Object.keys(t).filter(r=>!Ce.has(r));n.length>0&&S(`contains unknown field "${n.sort()[0]}".`);let o=De.find(r=>!r.valid(t));o!==void 0&&S(o.reason);let s=[...new Set(t.seen_item_ids)].sort();return{version:1,id:t.id,token_budget:t.token_budget,spent_tokens:t.spent_tokens,seen_item_ids:s}}function H(e){if(A(e))return typeof e.id=="string"?e.id:typeof e.item_id=="string"?e.item_id:A(e.item)&&typeof e.item.id=="string"?e.item.id:void 0}function Le(e){let t=new Set,n=0;for(let o of p(e)){let s=Array.isArray(o.value)?o.value:Object.values(o.value);for(let r of s){if(!A(r))continue;if(typeof r.context_ref=="string"){n+=1;continue}let i=H(r);i!==void 0&&t.add(i)}}return{deliveredIds:t,suppressedRepeatCount:n}}function J(e,t){let n=new Set(t.seen_item_ids);return O(e,o=>{let s=H(o);return s!==void 0&&n.has(s)?{id:s,context_ref:`session:${t.id}:${s}`}:o})}function v(e,t){let{deliveredIds:n,suppressedRepeatCount:o}=Le(e),s=[...new Set([...t.seen_item_ids,...n])].sort(),r={contract_version:1,id:t.id,measurement_scope:"complete_read_envelope",estimator:"ceil(utf8_bytes / 4)",token_budget:t.token_budget,spent_before_tokens:t.spent_tokens,spent_this_call_tokens:0,charged_this_call_tokens:0,spent_total_tokens:t.spent_tokens,remaining_tokens:t.token_budget-t.spent_tokens,exhausted:!1,seen_before_count:t.seen_item_ids.length,new_item_count:n.size,suppressed_repeat_count:o,reference_format:"session:<session-id>:<item-id>",restore_reference_with:"pm get <item-id> --brief",next_state:{version:1,id:t.id,token_budget:t.token_budget,spent_tokens:t.spent_tokens,seen_item_ids:s}},i={...e,read_session:r},a=l=>{r.spent_this_call_tokens=l,r.charged_this_call_tokens=Math.min(t.token_budget-t.spent_tokens,l),r.spent_total_tokens=Math.min(t.token_budget,t.spent_tokens+r.charged_this_call_tokens),r.remaining_tokens=Math.max(0,t.token_budget-r.spent_total_tokens),r.exhausted=r.remaining_tokens<R,r.next_state.spent_tokens=r.spent_total_tokens},c=0,u=0;for(let l=0;l<8;l+=1){a(c);let d=Math.ceil(Buffer.byteLength(JSON.stringify(i),"utf8")/4);if(d===c)return i;u=Math.max(u,d),c=d}return a(u),i}function Z(e){return Math.max(0,e.token_budget-e.spent_tokens)}(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]="1726fdce-dc71-5707-ae75-b588691e813d")}catch{}})();var Me=8,Ue=64;function Pe(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function C(e,t){return typeof e=="string"?e.length<=240?e:(t.compacted=!0,`${e.slice(0,240)}\u2026`):Array.isArray(e)?e.map(n=>C(n,t)):Pe(e)?Object.fromEntries(Object.entries(e).map(([n,o])=>[n,C(o,t)])):e}function m(e,t){let n=t.estimated_tokens;for(let o=0;o<Me;o+=1){t.estimated_tokens=n;let s=Math.ceil(Buffer.byteLength(JSON.stringify(e),"utf8")/4);if(s===n)return;n=s}t.estimated_tokens=n}function je(e,t,n){for(let o=0;o<Ue;o+=1){if(m(e,t),t.estimated_tokens<=n)return;let s=p(e).filter(r=>(Array.isArray(r.value)?r.value.length:Object.keys(r.value).length)>1).map(r=>({collection:r,length:Array.isArray(r.value)?r.value.length:Object.keys(r.value).length})).sort((r,i)=>i.length-r.length||r.collection.path.localeCompare(i.collection.path))[0]?.collection;if(!s)return;if(Array.isArray(s.value))s.value.splice(-Math.max(1,Math.ceil(s.value.length/2)));else{let r=Object.keys(s.value);for(let i of r.slice(-Math.max(1,Math.ceil(r.length/2))))delete s.value[i]}t.rows_compacted=!0,e.has_more=!0,e.truncated=!0,typeof e.count=="number"&&(e.count=h(e))}}function Q(e,t,n){let o={compacted:!1},s=C(e,o);return t.strings_compacted=o.compacted,s.read_output=t,je(s,t,n),m(s,t),s}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="27f3a09b-9b90-5c85-9e41-21cfed5dc0ce")}catch{}})();var g=["include","amount","cost","encoding"],se=["list","context","search","get","next","health","deps","graph","history","activity","validate","events","contracts","comments","notes","files","docs","stats","aggregate"],re=["canonical","legacy","intent","default"],M={include:"--output-include",amount:"--output-limit",cost:"--output-budget",encoding:"--output-format"},wn=Object.freeze(g.map(e=>M[e])),Rn=Object.freeze(["--output-session"]),Ve={list:{include:["--brief","--compact","--fields","--full"],amount:["--after","--limit","--no-truncate"],cost:["--token-budget"],encoding:["--format","--stream"]},context:{include:["--fields","--section"],amount:["--after","--depth","--limit"],cost:["--token-budget"],encoding:["--format"]},search:{include:["--compact","--fields","--full"],amount:["--after","--limit"],cost:["--token-budget"],encoding:["--format"]},get:{include:["--fields","--full"],amount:["--depth"],cost:["--token-budget"],encoding:["--format"]},next:{amount:["--blocked-limit","--limit"],cost:["--token-budget"],encoding:["--format"]},health:{include:["--brief","--check-only","--full","--summary","--verbose"]},deps:{include:["--collapse","--full","--summary"],amount:["--edge-limit","--max-depth","--node-limit"],cost:["--token-budget"],encoding:["--format"]},graph:{include:["--full","--summary"],amount:["--after","--limit","--max-depth","--max-paths"]},history:{include:["--compact","--full"],amount:["--limit"],encoding:["--format"]},activity:{include:["--compact","--full"],amount:["--limit","--unbounded"],encoding:["--stream"]},validate:{include:["--counts","--full","--verbose"]},events:{include:["--full"],amount:["--limit"],encoding:["--follow"]},contracts:{include:["--full","--summary"]},comments:{amount:["--limit"]},notes:{amount:["--limit"]},files:{amount:["--limit","--no-truncate","--offset"]},docs:{},stats:{},aggregate:{}},Fe=new Set(["--fields","--section"]),Ke=Object.freeze({"--after":"--after retains cursor-position semantics; use --output-limit <n> separately to bound returned rows.","--check-only":"--check-only retains health side-effect semantics; --output-include does not suppress vector refresh.","--depth":"--depth retains traversal or detail-depth semantics; --output-limit does not replace it.","--follow":"--follow retains event-tail semantics; --output-format does not enable following.","--max-depth":"--max-depth retains graph traversal-depth semantics; --output-limit does not replace it.","--max-paths":"--max-paths retains graph path-search semantics; use --output-limit separately to bound returned rows.","--offset":"--offset retains positional pagination semantics; use --output-limit separately to bound returned rows.","--stream":"--stream retains command streaming semantics; --output-format selects only static result encoding."});function ie(e){return e.slice(2).replaceAll("-","_")}function Be(e,t){let n=Ke[e];if(n!==void 0)return n;let o=t==="include"?Fe.has(e)?"<csv>":ie(e):t==="amount"?"<n>":t==="cost"?"<tokens>":"<toon|json>";return`${e} is a compatibility alias; prefer ${M[t]} ${o}.`}function Ge(e){let t=Ve[e],n=Object.freeze(Object.fromEntries(g.map(o=>[o,Object.freeze({dimension:o,canonical_option:M[o],applicable:!0,inapplicable_reason:null,legacy_aliases:Object.freeze((t[o]??[]).map(s=>Object.freeze({flag:s,migration_hint:Be(s,o),visibility:"hidden_alias"})))})])));return Object.freeze({command:e,dimensions:n,precedence:re})}var Xe=Object.freeze(se.map(Ge)),Ye=new Map(Xe.map(e=>[e.command,e]));function ae(e){let t=e.trim().toLowerCase().split(/\s+/u)[0],n=t.startsWith("list-")?"list":t==="ctx"?"context":t;return se.includes(n)?n:void 0}var ze=["outputInclude","output_include","outputLimit","output_limit","outputBudget","output_budget","outputFormat","output_format","outputSession","output_session"],qe={comments:["add","body","stdin","file","edit","delete"],notes:["add","addJson","stdin","file","edit","delete"],files:["add","addGlob","remove","migrate","apply","note"],docs:["add","addGlob","remove","migrate","note"]};function We(e){return ze.some(t=>e[t]!==void 0)}var $e=[{keys:["outputInclude","output_include"],valid:e=>D(e)!==void 0,message:"--output-include requires at least one comma-separated field or section."},{keys:["outputLimit","output_limit"],valid:e=>e==="unbounded"||E(e)!==void 0,message:"--output-limit must be a positive integer or unbounded."},{keys:["outputBudget","output_budget"],valid:e=>E(e)!==void 0,message:"--output-budget must be a positive integer."},{keys:["outputFormat","output_format"],valid:e=>e==="toon"||e==="json",message:"--output-format must be toon or json."},{keys:["outputSession","output_session"],valid:e=>(x(e),!0),message:"--output-session must be a valid session-state object."}];function xn(e,t){if(!We(t))return;let n=ae(e);if(!n)throw new _(`Universal output controls apply only to read commands; ${e||"this command"} is not a read surface.`,f.USAGE);if((qe[n]??[]).some(o=>t[o]!==void 0&&t[o]!==!1))throw new _(`Universal output controls cannot be combined with a ${n} mutation.`,f.USAGE);for(let o of $e){let s=o.keys.map(r=>t[r]).find(r=>r!==void 0);if(s!==void 0&&!o.valid(s))throw new _(o.message,f.USAGE)}}function He(e){return e.slice(2).replace(/-([a-z])/gu,(t,n)=>n.toUpperCase())}function Je(e,t){let n=He(t);if(Object.hasOwn(e,n))return e[n];let o=t.slice(2).replaceAll("-","_");if(Object.hasOwn(e,o))return e[o];if(t==="--no-truncate"&&e.truncate===!1)return!0}function Ze(e){return e!==void 0&&e!==!1&&e!==null}function D(e){let n=(Array.isArray(e)?e:[e]).flatMap(o=>typeof o=="string"?o.split(","):[]).map(o=>o.trim()).filter(Boolean);return n.length>0?[...new Set(n)]:void 0}function E(e){let t=typeof e=="number"?e:typeof e=="string"&&/^\d+$/u.test(e.trim())?Number(e):Number.NaN;return Number.isSafeInteger(t)&&t>0?t:void 0}function Qe(e,t,n){for(let o of e.legacy_aliases){let s=Je(t,o.flag),r={value:s,flag:o.flag};if(Ze(s)&&n(r))return r}}function ee(e,t){let n=D(e);if(n)return{source:"canonical",value:n};if(t)return{source:"legacy",value:D(t.value)??[ie(t.flag)]}}function te(e,t){if(e==="unbounded")return{source:"canonical",value:"unbounded"};let n=E(e);if(n!==void 0)return{source:"canonical",value:n};if(!t)return;if(t.flag==="--no-truncate"||t.flag==="--unbounded")return{source:"legacy",value:"unbounded"};let o=E(t.value);return o===void 0?void 0:{source:"legacy",value:o}}function ne(e,t){let n=E(e);if(n!==void 0)return{source:"canonical",value:n};if(!t)return;let o=E(t.value);return o===void 0?void 0:{source:"legacy",value:o}}function oe(e,t){if(e==="json"||e==="toon")return{source:"canonical",value:e};if(t)return t.flag==="--stream"||t.flag==="--follow"?{source:"legacy",value:"stream"}:t.value==="json"||t.value==="toon"?{source:"legacy",value:t.value}:void 0}function ce(e,t){let n=ae(e);if(!n)return;let o=Ye.get(n),s={include:c=>ee(void 0,c),amount:c=>te(void 0,c),cost:c=>ne(void 0,c),encoding:c=>oe(void 0,c)},r=Object.fromEntries(g.map(c=>[c,Qe(o.dimensions[c],t,u=>s[c](u)!==void 0)])),i=g.flatMap(c=>{let u=r[c];return u?[u.flag]:[]}),a=g.flatMap(c=>{let u=r[c];return u?[o.dimensions[c].legacy_aliases.find(d=>d.flag===u.flag).migration_hint]:[]});return{command:n,include:ee(t.outputInclude??t.output_include,r.include),amount:te(t.outputLimit??t.output_limit,r.amount),cost:ne(t.outputBudget??t.output_budget,r.cost),encoding:oe(t.outputFormat??t.output_format,r.encoding),legacy_aliases_used:i,migration_hints:a,precedence:re}}function b(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var U=new Set(["applied_bound","applied_limit","completeness","continuation_contract","count","filters","has_more","next_cursor","now","omission_receipt","projection","row_contract","sorting","total","truncated"]);function de(e,t){let n=new Set(t.map(o=>o.split(".")[0]));return Object.fromEntries(Object.entries(e).filter(([o])=>n.has(o)))}function et(e){let t=b(e.item)?e.item:{},n=Object.keys(t).sort((s,r)=>s.localeCompare(r)),o=Object.keys(e).filter(s=>s!=="item"&&s!=="read_output"&&!U.has(s)).sort((s,r)=>s.localeCompare(r));return{item:t,itemFields:n,sections:o,valid:[...n,"item",...n.map(s=>`item.${s}`),...o]}}function tt(e,t){let n=et(e),o=t.filter(d=>!n.valid.includes(d));if(o.length>0)throw new _(`Unknown --output-include selector(s) for get: ${o.join(", ")}. Valid selectors: ${n.valid.join(", ")}.`,f.USAGE);let s=t.includes("item"),r=t.flatMap(d=>d.startsWith("item.")?[d.slice(5)]:n.itemFields.includes(d)?[d]:[]).filter((d,le,_e)=>_e.indexOf(d)===le);if(s&&r.length>0)throw new _("--output-include cannot mix a full item with projected item fields; use item or item.<field>, not both.",f.USAGE);let i=new Set(t.filter(d=>n.sections.includes(d))),a=Object.fromEntries(Object.entries(e).filter(([d])=>U.has(d)||i.has(d)));s?a.item=n.item:r.length>0&&(a.item=de(n.item,r));let c=[...s?[]:r.length>0?n.itemFields.filter(d=>!r.includes(d)).map(d=>({name:`item.${d}`,restore_with:`--output-include item.${d}`})):[{name:"item",restore_with:"--output-include item"}],...n.sections.filter(d=>!i.has(d)).map(d=>({name:d,restore_with:`--output-include ${d}`}))],l=[...b(a.omission_receipt)&&Array.isArray(a.omission_receipt.omitted_field_groups)?a.omission_receipt.omitted_field_groups:[],...c];return a.omission_receipt={has_omissions:l.length>0,omitted_field_group_count:l.length,omitted_field_groups:l},a}function nt(e,t,n){if(e==="get")return tt(t,n);let o=w(t),s=n.flatMap(i=>o.flatMap(a=>i.startsWith(`${a}.`)?[i.slice(a.length+1)]:[])),r=n.some(i=>Object.hasOwn(t,i.split(".")[0])&&!o.some(a=>i.startsWith(`${a}.`)));if(o.length>0&&(!r||s.length>0)){let i={...t};return O(i,a=>b(a)?de(a,s.length>0?s:n):a)}return Object.fromEntries(Object.entries(t).filter(([i])=>n.some(a=>a.split(".")[0]===i)||U.has(i)))}function ot(e,t){if(t==="unbounded")return e;let{result:n,truncated:o}=W(e,t);return o&&(n.has_more=!0,n.truncated=!0,typeof n.count=="number"&&(n.count=h(n)),n.applied_bound={kind:"output_limit",source:"explicit",value:t}),n}function st(e){return g.filter(t=>e[t]!==void 0)}function L(e,t,n){let o=v(e,t);for(let s=0;s<8;s+=1){let r=n.estimated_tokens,i=o.read_session.spent_this_call_tokens;m(o,n),o=v(o,t);let a=o.read_session.spent_this_call_tokens;if(n.estimated_tokens===r&&a===i)return o}return o}function rt(e,t,n){let o={...e};return t.include?.source==="canonical"&&(o=nt(t.command,o,t.include.value)),t.amount?.source==="canonical"&&(o=ot(o,t.amount.value)),n===void 0?o:J(o,n)}function it(e,t){let n=[...e.cost?.source==="canonical"?[e.cost.value]:[],...t===void 0?[]:[Z(t)]];return n.length===0?void 0:Math.min(...n)}function at(e,t,n,o){let s={contract_version:1,command:e.command,requested_dimensions:t,precedence:e.precedence,legacy_aliases_used:[],migration_hints:[],estimated_tokens:0,within_budget:!1,strings_compacted:!1,rows_compacted:!1,result_omitted:!0},r={output_budget_exceeded:{omitted_result:!0,reason:"requested_budget_infeasible",restore_with:"Increase --output-budget or narrow the read."},read_output:s},i=n===void 0?r:L(r,n,s);if(n===void 0&&m(i,s),n!==void 0&&s.estimated_tokens>o)throw new _("The remaining output-session budget cannot fit its mandatory receipts; start a new session with a larger token_budget.",f.USAGE);return i}function vn(e,t,n){let o=ce(e,t);if(!o)return n;let s=x(t.outputSession??t.output_session),r=st(o);if(r.filter(l=>o[l]?.source==="canonical").length===0&&s===void 0)return n;let a=rt(n,o,s),c={contract_version:1,command:o.command,requested_dimensions:r,precedence:o.precedence,legacy_aliases_used:o.legacy_aliases_used,migration_hints:o.migration_hints,estimated_tokens:0,within_budget:!0,strings_compacted:!1,rows_compacted:!1,result_omitted:!1};a.read_output=c,a=s===void 0?a:L(a,s,c),m(a,c);let u=it(o,s);return u!==void 0&&c.estimated_tokens>u&&(a=Q(a,c,u),s!==void 0&&(a=L(a,s,c))),u!==void 0&&c.estimated_tokens>u?at(o,r,s,u):a}function Cn(e){return b(e)&&b(e.output_budget_exceeded)&&e.output_budget_exceeded.omitted_result===!0&&e.output_budget_exceeded.reason==="requested_budget_infeasible"}function Dn(e,t){let n=ce(e,t)?.encoding;return n?.value==="json"||n?.value==="toon"?n.value:void 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]="f6e82c93-54e8-53a7-94df-10a573aae933")}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]="47bfb287-bdd9-5984-9db4-cb996845d98c")}catch{}})();var ct=Object.freeze([{flag:"--json"},{flag:"--lean"},{flag:"--token-accounting"},{flag:"--output-include",value_name:"fields"},{flag:"--output-limit",value_name:"count"},{flag:"--output-budget",value_name:"tokens"},{flag:"--output-format",value_name:"toon|json"},{flag:"--output-session",value_name:"state"},{flag:"--quiet"},{flag:"--no-changed-fields"},{flag:"--full-changed-fields"},{flag:"--id-only"},{flag:"--pm-path",aliases:["--path"]},{flag:"--no-extensions"},{flag:"--no-pager"},{flag:"--profile"},{flag:"--help"},{flag:"--author",value_name:"id"}]),Pn=new Set(ct.flatMap(e=>[e.flag,...e.aliases??[]]));import dt from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="83232698-197a-5aef-be7c-aa37f3c56822")}catch{}})();function ut(e){if(e===null)return null;if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e;if(typeof e=="bigint")return e.toString();if(e===void 0)return"undefined";if(typeof e=="symbol")return e.toString();if(typeof e=="function")return`[function:${e.name||"anonymous"}]`}function lt(e){let t=Object.keys(e).sort(),n={};for(let o of t){let s=e[o];s!==void 0&&(n[o]=T(s))}return n}function T(e){let t=ut(e);if(t!==void 0)return t;if(Array.isArray(e))return e.map(o=>T(o));if(e instanceof Date)return e.toISOString();let n=e;if(typeof n.toJSON=="function"){let o=n.toJSON();if(o!==e)return T(o)}return lt(e)}function Fn(e){return JSON.stringify(T(e))}function ue(e,t,n,o){for(let s=0;s<t.length;s+=1)if(!n.has(s)&&o(e,t[s]))return n.add(s),!0;return!1}function _t(e,t){if(e instanceof RegExp||t instanceof RegExp)return e instanceof RegExp&&t instanceof RegExp&&e.toString()===t.toString()}function ft(e,t){if(e instanceof Date||t instanceof Date)return e instanceof Date&&t instanceof Date&&e.getTime()===t.getTime()}function pt(e,t){if(!(e instanceof Set||t instanceof Set))return;if(!(e instanceof Set&&t instanceof Set)||e.size!==t.size)return!1;let n=[...t],o=new Set;for(let s of e)if(!ue(s,n,o,y))return!1;return!0}function mt(e,t){if(!(e instanceof Map||t instanceof Map))return;if(!(e instanceof Map&&t instanceof Map)||e.size!==t.size)return!1;let n=[...t.entries()],o=new Set;for(let[s,r]of e.entries())if(!ue([s,r],n,o,([a,c],[u,l])=>y(a,u)&&y(c,l)))return!1;return!0}function gt(e,t){if(Array.isArray(e)||Array.isArray(t))return!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length?!1:e.every((n,o)=>y(n,t[o]))}function Et(e,t){let n=Object.keys(e).sort((s,r)=>s.localeCompare(r)),o=Object.keys(t).sort((s,r)=>s.localeCompare(r));if(n.length!==o.length)return!1;for(let s=0;s<n.length;s+=1){let r=n[s];if(r!==o[s]||!y(e[r],t[r]))return!1}return!0}var bt=[_t,ft,pt,mt,gt];function y(e,t){if(Object.is(e,t))return!0;if(e===null||t===null||typeof e!="object"||typeof t!="object")return!1;for(let n of bt){let o=n(e,t);if(o!==void 0)return o}return Et(e,t)}function Kn(e){return dt.createHash("sha256").update(e,"utf8").digest("hex")}function Bn(e,t){let n={};for(let s of t){let r=e[s];r!==void 0&&(n[s]=r)}let o=Object.keys(e).filter(s=>!t.includes(s)).sort((s,r)=>s.localeCompare(r));for(let s of o){let r=e[s];r!==void 0&&(n[s]=r)}return n}export{N as a,fe as b,pe as c,yt as d,P as e,j as f,V as g,ht as h,F as i,K as j,B as k,me as l,St as m,At as n,Tt as o,Nt as p,It as q,kt as r,wt as s,Rt as t,xt as u,vt as v,Ct as w,Dt as x,Lt as y,Mt as z,Ut as A,Pt as B,jt as C,ge as D,Vt as E,Ft as F,Kt as G,Bt as H,Gt as I,Xt as J,Yt as K,Ee as L,be as M,Wt as N,$t as O,ye as P,Ht as Q,Jt as R,Zt as S,Se as T,Ae as U,I as V,Qt as W,en as X,f as Y,_ as Z,ct as _,Pn as $,Fn as aa,y as ba,Kn as ca,Bn as da,Te as ea,Ne as fa,Ie as ga,rn as ha,an as ia,ke as ja,X as ka,cn as la,we as ma,Y as na,z as oa,dn as pa,un as qa,ln as ra,_n as sa,fn as ta,pn as ua,$ as va,x as wa,J as xa,v as ya,Z as za,g as Aa,se as Ba,wn as Ca,Rn as Da,Xe as Ea,ae as Fa,xn as Ga,ce as Ha,vn as Ia,Cn as Ja,Dn as Ka};
|
|
2
|
-
//# sourceMappingURL=chunk-54EU2UVO.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{$ as u,aa as p}from"./chunk-HGNKPSCB.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]="bf429f76-9722-5e34-a5f0-6ced8d1ed667")}catch{}})();var D="blocked_by",B="no-active-blocker";function d(e){return e.trim().toLowerCase()}function b(e){let t=new Set,n=typeof e.blocked_by=="string"?e.blocked_by.trim():"";n.length>0&&n.toLowerCase()!==B&&t.add(n);for(let o of e.dependencies??[])o.kind===D&&typeof o.id=="string"&&o.id.trim().length>0&&o.id.trim().toLowerCase()!==B&&t.add(o.id.trim());return[...t].sort((o,c)=>o.localeCompare(c))}function k(e,t,n){return b(e).map(o=>{let c=t.get(d(o));return c?{id:o,title:c.title,status:c.status,resolved:p(c.status,n)}:{id:o,title:null,status:null,resolved:!1}})}function C(e,t){let n=new Map(e.map(s=>[d(s.id),s])),o=new Set([...I(t),...t.blocked_statuses]),c=new Set;for(let s of e){let l=u(s.status,t);if(!o.has(l))continue;(t.blocked_statuses.has(l)||k(s,n,t).some(a=>!a.resolved))&&c.add(d(s.id))}return c}function I(e){return e.active_statuses.size>0?e.active_statuses:new Set([e.open_status])}function E(e,t,n){let o=[d(e)],c=new Set;for(;o.length>0;){let s=o.pop();if(!c.has(s)){c.add(s);for(let l of t.get(s)??[]){if(!p(l.status,n))return!0;o.push(d(l.id))}}}return!1}function T(e){let t=new Map,n=new Map,o=new Map;for(let c of e){t.set(d(c.id),c);let s=typeof c.parent=="string"?c.parent.trim():"";if(s.length>0){let l=d(s),i=n.get(l)??[];i.push(c),n.set(l,i)}for(let l of b(c)){let i=d(l),a=o.get(i)??[];a.push(c.id),o.set(i,a)}}return{itemsById:t,childrenByParent:n,blockedByReverse:o}}function x(e,t,n){let{itemsById:o,childrenByParent:c,blockedByReverse:s}=T(t),l=new Set([...I(n),...n.blocked_statuses]),i=new Set(t.filter(r=>!p(r.status,n)).map(r=>d(r.id))),a=[],y=[],m=0,h=0;for(let r of e){if(!l.has(u(r.status,n)))continue;if(m+=1,E(r.id,c,n)){h+=1;continue}let w=k(r,o,n).filter(f=>!f.resolved),v=(s.get(d(r.id))??[]).filter(f=>i.has(d(f))).sort((f,S)=>f.localeCompare(S)),_={item:r,open_blockers:w,unblocks:v},g=n.blocked_statuses.has(u(r.status,n));w.length===0&&!g?a.push(_):y.push(_)}return{ready:a,blocked:y,active_count:m,container_count:h}}(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]="9184e723-8269-5e45-8c6a-52fd02da60e6")}catch{}})();export{b as a,k as b,C as c,x as d};
|
|
2
|
-
//# sourceMappingURL=chunk-5FLBTZJQ.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{pa as g,qa as S,sa as b,ta as D}from"./chunk-U646T7Z6.js";import{La as I,Va as _,Za as w,db as h}from"./chunk-HGNKPSCB.js";import{D as p,J as y}from"./chunk-FPDYXZBK.js";import{Y as u,Z as m}from"./chunk-54EU2UVO.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]="13c02696-29a7-598e-888a-3502fd88bfbe")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="078456b8-ed61-5c47-afc7-7553833934e1")}catch{}})();var k=3,x=20,U=.8,N=100,M=1e3,A=1e6;function oe(e){return e===void 0?[]:[`likely_duplicates:${e.result.items.map(t=>t.id).join(",")}`]}function R(e){let t=e.limit??k,r=e.threshold??U;if(!Number.isSafeInteger(t)||t<0||t>x)throw new m(`Similarity limit must be an integer from 0 to ${x}.`,u.USAGE);if(!Number.isFinite(r)||r<0||r>1)throw new m("Similarity threshold must be a number from 0 to 1.",u.USAGE);return{limit:t,threshold:r}}function O(e){let t=e.limit??N;if(!Number.isSafeInteger(t)||t<0||t>M)throw new m(`Duplicate cluster limit must be an integer from 0 to ${M}.`,u.USAGE);let r=e.since===void 0?void 0:new Date(e.since);if(r&&Number.isNaN(r.getTime()))throw new m("Duplicate cluster --since must be a valid ISO timestamp.",u.USAGE);return{limit:t,since:r}}async function $(e,t){let r=y(e.cwd??process.cwd(),e.pmRoot),a=await I(r),n=p(a),i=e.statuses?new Set(e.statuses.map(o=>o.trim()).filter(Boolean)):void 0;return(await h(r,a.item_format,n.type_to_folder,void 0,a.schema)).filter(o=>(!i||i.has(o.status))&&(!t||new Date(o.created_at).getTime()>=t.getTime())).sort((o,d)=>o.id.localeCompare(d.id)).map(o=>({item:o,prepared:S(o.title)}))}function E(e,t=A){let r=new Set,a=[new Map,new Map,new Map];for(let[n,i]of e.entries()){let o=[[i.prepared.normalized],i.prepared.issueCodes,i.prepared.tokens];for(let[d,s]of o.entries())for(let c of s){let l=a[d].get(c)??[];for(let f of l)r.add(`${f}:${n}`);if(r.size>t)throw new m(`Duplicate sweep exceeded ${A} candidate pairs; narrow it with statuses or since.`,u.CONFLICT,{code:"duplicate_sweep_cost_limit",required:"Narrow the batch duplicate query until its deterministic candidate set fits the disclosed safety bound."});l.push(n),a[d].set(c,l)}}return r}var se={buildDuplicateClusters:L,collectDuplicateCandidatePairs:E,createDuplicateUnionFind:C};function C(e){let t=Array.from({length:e},(a,n)=>n);return{parent:t,findRoot:a=>{let n=a;for(;t[n]!==n;)n=t[n];for(;t[a]!==a;){let i=t[a];t[a]=n,a=i}return n}}}function q(e,t,r,a){let n=[];for(let i of t){let[o,d]=i.split(":").map(f=>Number.parseInt(f,10)),s=D(e[o].prepared,e[d].prepared);if(s.score<r)continue;let c=a.findRoot(o),l=a.findRoot(d);c!==l&&(a.parent[l]=c),n.push({left_id:e[o].item.id,right_id:e[d].item.id,...s})}return n}function L(e,t,r,a){let n=new Map;for(let i of e.keys()){let o=r.findRoot(i),d=n.get(o)??[];d.push(i),n.set(o,d)}return[...n.values()].filter(i=>i.length>1).map(i=>{let o=new Set(i.map(s=>e[s].item.id)),d=t.filter(s=>o.has(s.left_id)&&o.has(s.right_id)).sort((s,c)=>c.score-s.score||s.left_id.localeCompare(c.left_id)||s.right_id.localeCompare(c.right_id));return{id:e[i[0]].item.id,items:i.map(s=>{let c=e[s].item;return{id:c.id,title:c.title,status:c.status,type:c.type}}),matches:d,max_score:d[0]?.score??0}}).sort((i,o)=>o.max_score-i.max_score||i.id.localeCompare(o.id)).slice(0,a)}function F(e,t,r,a,n){return t.filter(i=>!r.has(i.id)).map(i=>({id:i.id,title:i.title,status:i.status,type:i.type,...b(e,i.title)})).filter(i=>i.score>=a).sort((i,o)=>o.score-i.score||i.id.localeCompare(o.id)).slice(0,n)}async function P(e,t={}){let r=e.title.trim();if(r.length===0)throw new m("Similarity candidate title must not be empty.",u.USAGE);let{limit:a,threshold:n}=R(t),i=y(t.cwd??process.cwd(),t.pmRoot),o=await I(i),d=p(o),s=await w(i,Object.values(d.type_to_folder)),c=g(r),l=s&&c.length>0?await _({pmRoot:i,expectedSourceCursor:s.source_cursor,query:c.map(v=>`"${v.replaceAll('"','""')}"`).join(" OR "),limit:Math.max(a*10,50)}):null,f=l===null?await h(i,o.item_format,d.type_to_folder,void 0,o.schema):l.items,T=F(r,f,new Set(e.excludeIds??[]),n,a);return{items:T,count:T.length,threshold:n,source:l?"persistent_index":"metadata_fallback"}}async function de(e={}){let{threshold:t}=R({...e,limit:void 0}),{limit:r,since:a}=O(e),n=await $(e,a),i=E(n),o=C(n.length),d=q(n,i,t,o),s=L(n,d,o,r);return{clusters:s,count:s.length,threshold:t,source:"metadata_scan",cost:{item_count:n.length,candidate_pairs:i.size,scored_pairs:i.size}}}async function ce(e,t){if(t.mode==="off")return;let r=await P(e,t);if(r.count===0)return;let a=t.mode==="strict"&&t.allowDuplicate===!0;if(t.mode==="strict"&&!a){let n=r.items.map(i=>`${i.id} (${i.status}): ${i.title}`).join("; ");throw new m(`Likely duplicate item(s) found: ${n}. Reuse the canonical item or pass --allow-duplicate with explicit intent.`,u.CONFLICT,{code:"likely_duplicate",required:"Reuse an existing item, or explicitly acknowledge the duplicate with --allow-duplicate.",recovery:{suggested_flags:["--allow-duplicate"]}})}return{mode:t.mode,bypassed:a,result:r}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="412fc2d2-daee-5d87-82ab-5411a1503087")}catch{}})();function me(e,t){let r=t??{};return e.filter(a=>r[a.id]!==a.updated_at).map(a=>a.id).sort((a,n)=>a.localeCompare(n))}export{oe as a,se as b,P as c,de as d,ce as e,me as f};
|
|
2
|
-
//# sourceMappingURL=chunk-5GJ57YKN.js.map
|