@unbrained/pm-cli 2026.10.23 → 2026.10.25
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 +1 -1
- package/CHANGELOG.md +41 -0
- package/dist/cli/error-guidance.js +2 -2
- package/dist/cli/extension-command-help.js +2 -2
- package/dist/cli/register-history-activity.js +1 -1
- package/dist/cli-bundle/bundle-manifest.json +1 -1
- package/dist/cli-bundle/chunks/{chunk-R7KWBFM2.js → chunk-3CYXE6BV.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-444VPGQT.js +20 -0
- package/dist/cli-bundle/chunks/{chunk-5V4HU6GK.js → chunk-4GD6QOP6.js} +21 -21
- package/dist/cli-bundle/chunks/{chunk-5DKCD4KV.js → chunk-5ZPT67NJ.js} +35 -34
- package/dist/cli-bundle/chunks/{chunk-KY34HTT2.js → chunk-7C3GCLOO.js} +29 -29
- package/dist/cli-bundle/chunks/{chunk-MTRYEVZR.js → chunk-7T3H24HN.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-REXCO5AG.js → chunk-EYCVAAIP.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-2UX2TAN2.js → chunk-FNZT4BTE.js} +60 -56
- package/dist/cli-bundle/chunks/chunk-HMJSFWHK.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-ZDVTXLA6.js → chunk-LNKPH2DD.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-HDKY2YX3.js → chunk-MVJGGCGQ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-3S5FLCG7.js → chunk-O3ZTGRIH.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-ZEI3DC5E.js → chunk-RD6UW3MW.js} +3 -3
- package/dist/cli-bundle/chunks/chunk-RLXK2S7P.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-F76ZUP73.js → chunk-RQKDANP7.js} +42 -42
- package/dist/cli-bundle/chunks/chunk-TLMXSYJA.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-AAX7CNL7.js → chunk-UI3FD3DW.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-ZMJF5HQW.js → chunk-VAEB6IUQ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-ZNDYAZZ6.js → chunk-XYLBOXSH.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-AXGFNNI3.js → chunk-YCCGZHOR.js} +2 -2
- package/dist/cli-bundle/chunks/{indexed-receipt-blobs-XANVELIV.js → indexed-receipt-blobs-47I6KKDO.js} +2 -2
- package/dist/cli-bundle/chunks/{mutation-admission-P6LOBNLO.js → mutation-admission-747C6IUR.js} +2 -2
- package/dist/cli-bundle/chunks/{register-list-query-JOB65KDN.js → register-list-query-COST6KRV.js} +3 -3
- package/dist/cli-bundle/chunks/{register-mutation-QMNIN3RJ.js → register-mutation-JZVVJUHY.js} +2 -2
- package/dist/cli-bundle/chunks/register-operations-S4LKLUBJ.js +2 -0
- package/dist/cli-bundle/chunks/{register-setup-GNKWL3VL.js → register-setup-3ITZXPOL.js} +2 -2
- package/dist/cli-bundle/chunks/{settlement-hook-YUVCO65H.js → settlement-hook-5IVCF6ZY.js} +2 -2
- package/dist/cli-bundle/chunks/stage-3UUIYROS.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-DWQMYLFM.js → chunk-22727JYL.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-4MNUQCGR.js → chunk-3FM75SBJ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-ZHMF34DT.js → chunk-3M5FZCMC.js} +53 -53
- package/dist/cli-bundle/focused-chunks/{chunk-BUZ2Z4P3.js → chunk-46KDJH3K.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-5LBZR6YW.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-EDXTOAXP.js → chunk-74KC7FUQ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-77NU7NPN.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-MLET6I3I.js → chunk-7DEZT4JN.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-NSMZY6IK.js → chunk-B5JOVH5F.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-HMYDUEQK.js +8 -0
- package/dist/cli-bundle/focused-chunks/chunk-IVLIUPVV.js +12 -0
- package/dist/cli-bundle/focused-chunks/chunk-KIIGME23.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-P7DPS5M4.js → chunk-LWJ2X75I.js} +24 -24
- package/dist/cli-bundle/focused-chunks/{chunk-6GTZ24YV.js → chunk-MT5TYMEU.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-OMXMYTEX.js → chunk-NC5HUGHU.js} +3 -3
- package/dist/cli-bundle/focused-chunks/chunk-NI5SG2M2.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-QH5KMIYZ.js +91 -0
- package/dist/cli-bundle/focused-chunks/{chunk-UNTCCJPL.js → chunk-U6HXIF6G.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-CGL36F6I.js → chunk-URWYYJ7K.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-I2USTQNQ.js → chunk-W7MCCFYV.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-WMPDY5ZU.js +21 -0
- package/dist/cli-bundle/focused-chunks/{chunk-R536272H.js → chunk-Y4JHHY24.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-KI5YFKNN.js → chunk-ZYCOMRFT.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{indexed-receipt-blobs-FVOA3XMI.js → indexed-receipt-blobs-YCLN2ZZG.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{mutation-admission-HTFAIHJL.js → mutation-admission-BQBQXILV.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{settlement-hook-2VXEB6PP.js → settlement-hook-XVS6P2XI.js} +2 -2
- package/dist/cli-bundle/focused-chunks/stage-VSIL4MTZ.js +2 -0
- package/dist/cli-bundle/main.js +21 -21
- package/dist/cli-bundle/sdk-authoring.js +1 -1
- package/dist/cli-bundle/sdk-contracts.js +2 -2
- package/dist/cli-bundle/sdk-core.js +24 -24
- 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 +51 -52
- 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 +9 -9
- package/dist/core/checkpoint/mutation-checkpoint.d.ts +6 -3
- package/dist/core/checkpoint/mutation-checkpoint.js +2 -2
- package/dist/core/checkpoint/mutation-context.d.ts +10 -0
- package/dist/core/checkpoint/mutation-context.js +2 -0
- package/dist/core/diagnostics/remediation.js +1 -1
- package/dist/core/shared/errors.d.ts +13 -0
- package/dist/core/shared/errors.js +1 -1
- package/dist/core/store/item-store.js +1 -1
- package/dist/core/store/settings.js +2 -2
- package/dist/sdk/agent/command-recovery.d.ts +1 -0
- package/dist/sdk/agent/command-recovery.js +1 -1
- package/dist/sdk/agent/linked-resource-recovery.d.ts +13 -0
- package/dist/sdk/agent/linked-resource-recovery.js +2 -0
- package/dist/sdk/cli-contracts/commander-types.js +1 -1
- package/dist/sdk/cli-contracts/flag-contracts.d.ts +2 -0
- package/dist/sdk/cli-contracts/flag-contracts.js +1 -1
- package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +1 -1
- package/dist/sdk/cli-contracts/grammar-contracts.js +1 -1
- package/dist/sdk/cli-contracts/registration-helpers.d.ts +2 -0
- package/dist/sdk/cli-contracts/registration-helpers.js +2 -2
- package/dist/sdk/cli-contracts/runtime-contracts.js +1 -1
- package/dist/sdk/cli-contracts/tool-option-contracts.js +1 -1
- package/dist/sdk/cli-contracts/typed-action-inputs.d.ts +3 -2
- package/dist/sdk/completion/fish.js +3 -1
- package/dist/sdk/completion/zsh.js +3 -1
- package/dist/sdk/core.d.ts +1 -1
- package/dist/sdk/core.js +1 -1
- package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1 -1
- package/dist/sdk/generated/generated-error-code-catalog-part-2.js +1 -1
- package/dist/sdk/governance/health-merge-evidence.d.ts +5 -0
- package/dist/sdk/governance/health-merge-evidence.js +1 -1
- package/dist/sdk/governance/health.js +1 -1
- package/dist/sdk/index.d.ts +2 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/lifecycle/checkpoint-rollback.d.ts +7 -0
- package/dist/sdk/lifecycle/checkpoint-rollback.js +2 -0
- package/dist/sdk/lifecycle/close-many.d.ts +1 -1
- package/dist/sdk/lifecycle/close-many.js +1 -1
- package/dist/sdk/lifecycle/update-many.d.ts +1 -1
- package/dist/sdk/lifecycle/update-many.js +1 -1
- package/dist/sdk/merge/history-scalar-rebase.d.ts +9 -0
- package/dist/sdk/merge/history-scalar-rebase.js +2 -0
- package/dist/sdk/merge/ignored-artifacts.d.ts +13 -0
- package/dist/sdk/merge/ignored-artifacts.js +2 -0
- package/dist/sdk/merge/stage.js +1 -1
- package/dist/sdk/merge/three-way.js +1 -1
- package/dist/sdk/public-surface.json +1 -1
- package/dist/sdk/query/activity.d.ts +14 -2
- package/dist/sdk/query/activity.js +1 -1
- package/dist/sdk/query/calendar.d.ts +16 -0
- package/dist/sdk/query/calendar.js +3 -3
- package/dist/sdk/query/context.d.ts +2 -1
- package/dist/sdk/query/context.js +2 -2
- package/dist/sdk/query/get.d.ts +2 -1
- package/dist/sdk/query/get.js +1 -1
- package/dist/sdk/query/list.d.ts +2 -1
- package/dist/sdk/query/list.js +1 -1
- package/dist/sdk/query/search/types.d.ts +2 -1
- package/dist/sdk/query/search-contracts.js +1 -1
- package/dist/sdk/query/window-pagination.d.ts +20 -0
- package/dist/sdk/query/window-pagination.js +2 -0
- package/dist/sdk/query.d.ts +1 -0
- package/dist/sdk/query.js +1 -1
- package/dist/sdk/read-output-contracts.d.ts +10 -2
- package/dist/sdk/read-output-contracts.js +1 -1
- package/dist/sdk/runtime-input.js +1 -1
- package/dist/sdk/runtime-primitives.d.ts +1 -0
- package/dist/sdk/runtime-primitives.js +1 -1
- package/dist/sdk/runtime.d.ts +11 -11
- package/dist/sdk/runtime.js +1 -1
- package/dist/sdk/schema-migration.js +2 -2
- package/dist/sdk/templates.d.ts +7 -1
- package/dist/sdk/templates.js +2 -2
- package/dist/sdk/test/batch.js +2 -2
- package/dist/sdk/test/entry.d.ts +5 -1
- package/dist/sdk/test/entry.js +2 -1
- package/dist/sdk/test/execution.js +2 -2
- package/docs/COMMANDS.md +40 -3
- package/docs/EXTENSIONS.md +1 -1
- package/docs/MERGE_SAFETY.md +28 -0
- package/docs/READ_OUTPUT_CONTRACTS.md +15 -0
- package/docs/SDK.md +130 -6
- package/docs/TESTING.md +28 -0
- package/docs/generated/FLAG_LEXICON_BUDGETS.md +2 -2
- package/docs/generated/REFUSAL_CLOSURE_CENSUS.md +7 -3
- package/marketplace.json +1 -1
- package/package.json +1 -1
- package/packages/pm-beads/package.json +1 -1
- package/packages/pm-calendar/extensions/calendar/index.ts +6 -0
- package/packages/pm-calendar/package.json +1 -1
- package/packages/pm-command-kit/package.json +1 -1
- package/packages/pm-digital-twin/package.json +1 -1
- package/packages/pm-governance-audit/package.json +1 -1
- package/packages/pm-guide-shell/package.json +1 -1
- package/packages/pm-kanban/package.json +1 -1
- package/packages/pm-lifecycle-hooks/package.json +1 -1
- package/packages/pm-linked-test-adapters/package.json +1 -1
- package/packages/pm-search-advanced/package.json +1 -1
- package/packages/pm-templates/extensions/templates/runtime.ts +3 -1
- package/packages/pm-templates/package.json +1 -1
- package/packages/pm-todos/package.json +1 -1
- package/packages/pm-vcs/package.json +1 -1
- package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
- package/plugins/pm-claude/package.json +1 -1
- package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
- package/plugins/pm-codex/package.json +1 -1
- package/plugins/pm-codex/plugin.json +1 -1
- package/runtime-dependencies.json +1 -1
- package/dist/cli-bundle/chunks/chunk-2LTGJ5DL.js +0 -2
- package/dist/cli-bundle/chunks/chunk-MMVX5L32.js +0 -20
- package/dist/cli-bundle/chunks/chunk-QSY55FTA.js +0 -2
- package/dist/cli-bundle/chunks/register-operations-Z4VET3I7.js +0 -2
- package/dist/cli-bundle/chunks/stage-FW5OXCCR.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-BM652VCB.js +0 -8
- package/dist/cli-bundle/focused-chunks/chunk-FO4U3FIP.js +0 -91
- package/dist/cli-bundle/focused-chunks/chunk-GXKP56W7.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-JDN34LEZ.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-LEHGCPZ6.js +0 -12
- package/dist/cli-bundle/focused-chunks/chunk-XIZYJDYW.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-Z5LDTMZ3.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-ZR6ZKQUK.js +0 -20
- package/dist/cli-bundle/focused-chunks/stage-X3BUGEJT.js +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{B as kn,C as On,D as Ie,a as G,b as vn,c as so,e as Et,f as kt,g as Ot,h as ao,i as St,j as Ce,k as co,l as En,o as At,p as Ct,s as He,y,z as h}from"./chunk-BUZ2Z4P3.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]="628615ea-5be3-5753-a6c5-3eba8400a8da")}catch{}})();function It(e,t,n){if(e===t)return 0;if(Math.abs(e.length-t.length)>n)return null;let r=t.length+1,o=new Array(r),i=new Array(r),s=new Array(r);for(let c=0;c<r;c+=1)o[c]=0,i[c]=c;for(let c=1;c<=e.length;c+=1){s[0]=c;let d=s[0];for(let l=1;l<=t.length;l+=1){let m=e[c-1]===t[l-1]?0:1,u=i[l-1]+m,f=s[l-1]+1,p=i[l]+1,_=Math.min(u,f,p);c>1&&l>1&&e[c-1]===t[l-2]&&e[c-2]===t[l-1]&&(_=Math.min(_,o[l-2]+1)),s[l]=_,_<d&&(d=_)}if(d>n)return null;for(let l=0;l<r;l+=1)o[l]=i[l],i[l]=s[l]}let a=i[t.length];return a<=n?a:null}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="c05a5a9e-282c-5ca7-97dc-e48c8df7977e")}catch{}})();var gc=["Epic","Feature","Task","Chore","Issue","Decision","Event","Reminder","Milestone","Meeting","Plan"],lo=gc,Og=["draft","open","in_progress","blocked","closed","canceled"],Sg=["draft","active","blocked","terminal","terminal_done","terminal_canceled","default_open","default_close","default_cancel"],uo=["string","number","boolean","string_array","array","object"],Ag=["create","update","update_many","list","search","calendar","context"],Cg=["allow","warn","reject"],Ig=["blocks","parent","child","parent_child","child_of","related","related_to","discovered_from","blocked_by","incident_from","epic","implements","recurs_from","supersedes","task","verifies"],Tg=["project","global"],Rg=["low","medium","high","critical"],xg=["low","medium","high","critical"],Ng=["low","medium","high"];var Dg=["minimal","default","strict","custom"],Pg=["none","warn","strict"],$g=["progressive","strict"],Mg=["off","warn","strict"],Lg=["off","warn","strict"];var jg=["daily","weekly","monthly","yearly"],yc=["mon","tue","wed","thu","fri","sat","sun"];function Fg(e){return yc.indexOf(e)}var Ug=["draft","research","review","approved","executing","paused","completed","superseded"],zg=["pending","in_progress","completed","blocked","skipped","superseded"],qg=["codex","claude-code","cursor","generic"],Bg=["related","blocks","blocked_by","depends_on","discovered_from","implements","recurs_from","verifies","supersedes"],Vg=["brief","standard","deep","full"],Gg=["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]="67511565-01f8-58a6-ad06-45b5d0ce831b")}catch{}})();var hc=new Set(["name","version","entry","priority","description","author","capabilities","manifest_version","pm_min_version","pm_max_version","engines","trusted","provenance","sandbox_profile","permissions","activation","contributions","legacy_capability_aliases"]);function bc(e){return{unknownKeys:Object.keys(e).filter(t=>!hc.has(t)).sort((t,n)=>t>n?1:-1),missingVersionBounds:e.pm_min_version===void 0&&e.pm_max_version===void 0}}function wc(e){let t=bc(e),n=t.unknownKeys.map(r=>({code:"manifest_unknown_key",path:r,...r==="compatibility"?{suggested_key:"pm_min_version"}:{},message:r==="compatibility"?'Manifest key "compatibility" is ignored; declare the canonical pm_min_version and optional pm_max_version fields instead.':`Manifest key "${r}" is not part of the extension manifest contract and will be ignored.`}));return t.missingVersionBounds&&n.push({code:"no_version_bounds_declared",path:"$",suggested_key:"pm_min_version",message:"No canonical pm version bounds are declared; add pm_min_version so compatibility intent is explicit."}),{ok:n.length===0,findings:n}}function fo(e,t,n){return wc(n).findings.map(r=>r.code==="manifest_unknown_key"?`extension_manifest_unknown_key:${e}:${t.name}:key=${r.path}${r.suggested_key?`:suggested=${r.suggested_key}`:""}`:`extension_manifest_no_version_bounds:${e}:${t.name}:suggested=pm_min_version`)}(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]="2ea7934f-4751-5245-a5ba-492681aa3794")}catch{}})();var Sn=[{kind:"blocked_by",direction:"directed",traversal:"ordering",inverse:"blocks",ordering:!0,precedence:"target_before_source",hierarchy:!1,outgoing:"many",incoming:"many",lifecycle:"persistent",aliases:["depends_on"],compatibilityVersion:1,allowSelf:!1},{kind:"blocks",direction:"directed",traversal:"ordering",inverse:"blocked_by",ordering:!0,precedence:"source_before_target",hierarchy:!1,outgoing:"many",incoming:"many",lifecycle:"persistent",compatibilityVersion:1,allowSelf:!1},{kind:"parent",direction:"directed",traversal:"hierarchy",outcomeTraversal:"source_to_target",inverse:"child",ordering:!1,hierarchy:!0,hierarchyDirection:"target_parent",outgoing:"one",incoming:"many",lifecycle:"supersedable",aliases:["child_of","epic"],compatibilityVersion:1,allowSelf:!1},{kind:"child",direction:"directed",traversal:"hierarchy",outcomeTraversal:"target_to_source",inverse:"parent",ordering:!1,hierarchy:!0,hierarchyDirection:"source_parent",outgoing:"many",incoming:"one",lifecycle:"supersedable",aliases:["parent_child","task"],compatibilityVersion:1,allowSelf:!1},{kind:"related",direction:"undirected",traversal:"association",ordering:!1,hierarchy:!1,outgoing:"many",incoming:"many",lifecycle:"persistent",aliases:["related_to"],compatibilityVersion:1,allowSelf:!1},{kind:"discovered_from",direction:"directed",traversal:"semantic",outcomeTraversal:"source_to_target",ordering:!1,hierarchy:!1,outgoing:"many",incoming:"many",lifecycle:"persistent",compatibilityVersion:1,allowSelf:!1},{kind:"incident_from",direction:"directed",traversal:"semantic",outcomeTraversal:"source_to_target",ordering:!1,hierarchy:!1,outgoing:"many",incoming:"many",lifecycle:"persistent",compatibilityVersion:1,allowSelf:!1},{kind:"implements",direction:"directed",traversal:"semantic",outcomeTraversal:"source_to_target",ordering:!1,hierarchy:!1,outgoing:"many",incoming:"many",lifecycle:"persistent",compatibilityVersion:1,allowSelf:!1},{kind:"recurs_from",direction:"directed",traversal:"semantic",outcomeTraversal:"source_to_target",ordering:!1,temporalOrder:"source_after_target",hierarchy:!1,outgoing:"many",incoming:"many",lifecycle:"persistent",compatibilityVersion:1,allowSelf:!1},{kind:"verifies",direction:"directed",traversal:"semantic",outcomeTraversal:"source_to_target",ordering:!1,hierarchy:!1,outgoing:"many",incoming:"many",lifecycle:"persistent",compatibilityVersion:1,allowSelf:!1},{kind:"supersedes",direction:"directed",traversal:"semantic",outcomeTraversal:"both",ordering:!1,hierarchy:!1,outgoing:"many",incoming:"many",lifecycle:"supersedable",compatibilityVersion:1,allowSelf:!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]="418b3f7f-6350-5878-a362-3948de287baf")}catch{}})();function xt(e){return e.trim().toLowerCase().replaceAll("-","_")}function vc(e){if(e===void 0)return;let t=xt(e);if(!/^[a-z][a-z0-9_]*$/.test(t))throw new TypeError(`Invalid inverse relationship kind: ${e}`);return t}function Cn(e,t=new Set){if(e===null||typeof e!="object"||t.has(e))return e;if(t.add(e),Array.isArray(e)){for(let n of e)Cn(n,t);return Object.freeze(e)}for(let n of Object.values(e))Cn(n,t);return Object.freeze(e)}function Ec(e,t){if(e.precedence!==void 0&&e.precedence!=="source_before_target"&&e.precedence!=="target_before_source")throw new TypeError(`Invalid relationship precedence for ${t}`);if(!e.ordering&&e.precedence!==void 0)throw new TypeError(`Non-ordering relationship kind cannot declare precedence: ${t}`)}function kc(e,t){if(e.temporalOrder!==void 0&&e.temporalOrder!=="source_after_target")throw new TypeError(`Invalid relationship temporal order for ${t}`);if(e.direction!=="directed"&&e.temporalOrder!==void 0)throw new TypeError(`Undirected relationship kind cannot declare temporal order: ${t}`)}function Oc(e,t){if(e.hierarchyDirection!==void 0&&e.hierarchyDirection!=="source_parent"&&e.hierarchyDirection!=="target_parent")throw new TypeError(`Invalid relationship hierarchy direction for ${t}`);if(!e.hierarchy&&e.hierarchyDirection!==void 0)throw new TypeError(`Non-hierarchy relationship kind cannot declare hierarchy direction: ${t}`)}function Sc(e){if(typeof e!="object"||e===null)throw new TypeError("Relationship kind definition requires an object");if(typeof e.kind!="string")throw new TypeError("Relationship kind requires a string identifier");let t=xt(e.kind);if(!/^[a-z][a-z0-9_]*$/.test(t))throw new TypeError(`Invalid relationship kind: ${e.kind}`);if(!Number.isInteger(e.compatibilityVersion)||e.compatibilityVersion<1)throw new TypeError(`Invalid compatibility version for ${t}`);return t}function Ac(e,t){if(!["directed","undirected"].includes(e.direction))throw new TypeError(`Invalid relationship direction for ${t}`);if(typeof e.ordering!="boolean")throw new TypeError(`Invalid relationship ordering flag for ${t}`);if(![void 0,!0,!1].includes(e.hierarchy))throw new TypeError(`Invalid relationship hierarchy flag for ${t}`);if(!["one","many"].includes(e.outgoing))throw new TypeError(`Invalid outgoing relationship cardinality for ${t}`);if(!["one","many"].includes(e.incoming))throw new TypeError(`Invalid incoming relationship cardinality for ${t}`);if(!["persistent","supersedable","ephemeral"].includes(e.lifecycle))throw new TypeError(`Invalid relationship lifecycle for ${t}`);if(typeof e.allowSelf!="boolean")throw new TypeError(`Invalid relationship self-edge flag for ${t}`);if(e.traversal!==void 0&&!["hierarchy","ordering","semantic","association"].includes(e.traversal))throw new TypeError(`Invalid relationship traversal family for ${t}`);if(e.outcomeTraversal!==void 0&&!["source_to_target","target_to_source","both"].includes(e.outcomeTraversal))throw new TypeError(`Invalid outcome traversal for ${t}`);if(e.direction==="undirected"&&e.outcomeTraversal!==void 0&&e.outcomeTraversal!=="both")throw new TypeError(`Undirected relationship kind cannot declare directional outcome traversal: ${t}`)}function Cc(e,t){if(e.payloadSchema!==void 0&&(typeof e.payloadSchema!="object"||e.payloadSchema===null||Array.isArray(e.payloadSchema)))throw new TypeError(`Invalid relationship payload schema for ${t}`);if(e.aliases!==void 0&&(!Array.isArray(e.aliases)||e.aliases.some(n=>typeof n!="string")))throw new TypeError(`Invalid relationship aliases for ${t}`)}function Ic(e){return e.traversal?e.traversal:e.ordering?"ordering":e.hierarchy?"hierarchy":e.direction==="undirected"?"association":"semantic"}var In=class{#e=new Map;#n=new Map;constructor(t=Sn){for(let n of t)this.register(n)}register(t){let n=Sc(t);if(Ac(t,n),Cc(t,n),Ec(t,n),kc(t,n),Oc(t,n),this.#e.has(n)||this.#n.has(n))throw new TypeError(`Relationship kind already registered: ${n}`);let r=vc(t.inverse),o=[...new Set((t.aliases??[]).map(xt))].sort();for(let s of o){if(!/^[a-z][a-z0-9_]*$/.test(s))throw new TypeError(`Invalid relationship alias: ${s}`);if(s===n||this.#e.has(s)||this.#n.has(s))throw new TypeError(`Relationship alias already registered: ${s}`)}let i=Object.freeze({...t,kind:n,traversal:Ic(t),hierarchy:t.hierarchy??!1,hierarchyDirection:t.hierarchy?t.hierarchyDirection??"source_parent":void 0,inverse:r,aliases:Object.freeze(o),payloadSchema:t.payloadSchema?Cn(structuredClone(t.payloadSchema)):void 0});this.#e.set(n,i);for(let s of o)this.#n.set(s,n);return this}resolve(t){if(typeof t!="string")return;let n=xt(t);return this.#e.get(this.#n.get(n)??n)}require(t){let n=this.resolve(t);if(!n)throw new TypeError(`Unknown relationship kind: ${t}`);return n}list(){return Object.freeze([...this.#e.values()].sort((t,n)=>t.kind.localeCompare(n.kind)))}};function Tn(){return new In}var ue=Tn();function Jg(e){return ue.require(e).kind}function Qg(e){return ue.resolve(e)?.kind}function Zg(e,t=ue){return t.resolve(e)?.ordering===!0}function Tc(e,t,n,r=ue){let o=Ye(e),i=Ye(t);if(!o||!i)throw new TypeError("Relationship endpoint must not be empty");let s=r.require(n);if(o===i&&!s.allowSelf)throw new TypeError(`Self relationship is not allowed for ${s.kind}`);return s}function Tt(e,t){return e.source.localeCompare(t.source)||e.target.localeCompare(t.target)||e.kind.localeCompare(t.kind)}function Rc(e,t,n){let r=typeof e.source=="string"?e.source.trim():"",o=typeof e.target=="string"?e.target.trim():"";if(!t.has(r)||!t.has(o))throw new TypeError(`Relationship endpoint not found: ${r} -> ${o}`);let i=Tc(r,o,e.kind,n),s=Object.freeze({...e,source:r,target:o,kind:i.kind}),a=i.direction==="undirected"?[r,o].sort().join("\0"):`${r}\0${o}`;return{edge:s,identity:`${i.kind}\0${a}`}}function Rt(e,t,n){let r=e.get(t);r?r.push(n):e.set(t,[n])}function Ye(e){return typeof e=="string"?e.trim():""}function An(e,t){let n=Ye(e);return n&&t.has(n)?n:void 0}function xc(e,t,n){let r=[t],o=t;for(;o!==e;)o=n.get(o),r.push(o);return r.reverse()}var mo=class e{#e;#n;#o;#r;#s=new Map;#a=new Map;constructor(t,n,r=ue){this.#e=r,this.#n=new Set([...t].filter(i=>typeof i=="string").map(i=>i.trim()).filter(Boolean)),this.#o=Object.freeze([...this.#n].sort());let o=new Map;for(let i of n){let{edge:s,identity:a}=Rc(i,this.#n,r);o.set(a,s)}this.#r=Object.freeze([...o.values()].sort(Tt));for(let i of this.#r)Rt(this.#s,i.source,i),Rt(this.#a,i.target,i),r.require(i.kind).direction==="undirected"&&(Rt(this.#s,i.target,i),Rt(this.#a,i.source,i))}static fromItems(t,n=ue){let r=new Set(t.map(i=>Ye(i.id)).filter(Boolean)),o=[];for(let i of t){let s=Ye(i.id);if(!s)continue;let a=An(i.parent,r);a&&o.push({source:s,target:a,kind:"parent"});let c=An(i.blocked_by,r);c&&o.push({source:s,target:c,kind:"blocked_by"});for(let d of i.dependencies??[]){let l=An(d.id,r);l&&n.resolve(d.kind)&&o.push({source:s,target:l,kind:d.kind,createdAt:d.created_at,author:d.author})}}return new e(r,o,n)}edges(){return this.#r}incidentEdges(t){this.#i(t);let n=this.#s.get(t)??[],r=this.#a.get(t)??[];if(n.length===0)return Object.freeze([...r]);if(r.length===0)return Object.freeze([...n]);let o=[],i=0,s=0;for(;i<n.length||s<r.length;){let a=n[i],c=r[s],d=a===void 0?c:c===void 0||Tt(a,c)<=0?a:c;o.at(-1)!==d&&o.push(d),a===d&&(i+=1),c===d&&(s+=1)}return Object.freeze(o)}nodes(){return this.#o}hasNode(t){return this.#n.has(t)}registry(){return this.#e}#i(t){if(!this.#n.has(t))throw new TypeError(`Relationship node not found: ${t}`)}#c(t,n){if(!n)return!0;let r=this.#e.require(t.kind);return n.has(t.kind)||r.inverse!==void 0&&n.has(r.inverse)}#t(t,n,r){let o=[...n==="incoming"?[]:this.#s.get(t)??[],...n==="outgoing"?[]:this.#a.get(t)??[]];return[...new Set(o)].filter(i=>this.#c(i,r)).map(i=>({id:i.source===t?i.target:i.source,edge:i})).sort((i,s)=>i.id.localeCompare(s.id)||Tt(i.edge,s.edge))}adjacency(t,n={}){this.#i(t),n.signal?.throwIfAborted();let r=n.kinds?new Set(n.kinds.map(c=>this.#e.require(c).kind)):void 0,o=this.#t(t,n.direction??"outgoing",r),i=n.limit??Number.POSITIVE_INFINITY,s=[...new Set(o.map(c=>c.id))],a=s.slice(0,i);return{value:a,meta:{visitedNodes:1,inspectedEdges:o.length,truncated:a.length<s.length,nextCursor:a.at(-1)}}}neighborEdges(t,n={}){this.#i(t),n.signal?.throwIfAborted();let r=n.kinds?new Set(n.kinds.map(a=>this.#e.require(a).kind)):void 0,o=this.#t(t,n.direction??"outgoing",r),i=n.limit??Number.POSITIVE_INFINITY,s=o.slice(0,i);return{value:s,meta:{visitedNodes:1,inspectedEdges:o.length,truncated:s.length<o.length,nextCursor:s.at(-1)?.id}}}closure(t,n={}){this.#i(t);let r=n.kinds?new Set(n.kinds.map(f=>this.#e.require(f).kind)):void 0,o=n.direction??"outgoing",i=n.limit??Number.POSITIVE_INFINITY,s=n.maxDepth??Number.POSITIVE_INFINITY,a=new Set([t]),c=[],d=[{id:t,depth:0}],l=0,m=0,u=!1;e:for(let f=0;f<d.length;f+=1){n.signal?.throwIfAborted();let p=d[f];l+=1;let _=this.#t(p.id,o,r);if(m+=_.length,p.depth>=s){_.some(g=>!a.has(g.id))&&(u=!0);continue}for(let g of _)if(!a.has(g.id)){if(c.length>=i){u=!0;break e}a.add(g.id),c.push(g.id),d.push({id:g.id,depth:p.depth+1})}}return{value:c,meta:{visitedNodes:l,inspectedEdges:m,truncated:u,nextCursor:c.at(-1)}}}shortestPath(t,n,r={}){if(this.#i(t),this.#i(n),t===n)return{value:[t],meta:{visitedNodes:1,inspectedEdges:0,truncated:!1}};let o=r.kinds?new Set(r.kinds.map(f=>this.#e.require(f).kind)):void 0,i=r.direction??"outgoing",s=r.maxDepth??Number.POSITIVE_INFINITY,a=[{id:t,depth:0}],c=new Map,d=new Set([t]),l=0,m=0,u=!1;for(let f=0;f<a.length;f+=1){r.signal?.throwIfAborted();let p=a[f];l+=1;let _=this.#t(p.id,i,o);if(m+=_.length,p.depth>=s){_.some(g=>!d.has(g.id))&&(u=!0);continue}for(let g of _)if(!d.has(g.id)){if(c.set(g.id,p.id),g.id===n)return{value:xc(t,n,c),meta:{visitedNodes:l,inspectedEdges:m,truncated:!1}};d.add(g.id),a.push({id:g.id,depth:p.depth+1})}}return{value:[],meta:{visitedNodes:l,inspectedEdges:m,truncated:u}}}subgraph(t,n={}){let r=this.closure(t,n),o=[t,...r.value].sort(),i=new Set(o),s=n.kinds?new Set(n.kinds.map(c=>this.#e.require(c).kind)):void 0,a=new Set;for(let c of o)for(let d of this.#s.get(c)??[])i.has(d.source)&&i.has(d.target)&&this.#c(d,s)&&a.add(d);return{value:{nodes:o,edges:[...a].sort(Tt)},meta:r.meta}}};function ey(e,t,n=ue){return{source:e,target:t.id,kind:n.require(t.kind).kind,createdAt:t.created_at,author:t.author}}import{readFileSync as yd,readdirSync as _y,realpathSync as Oo,statSync as Ao}from"node:fs";import hd from"node:os";import v from"node:path";import Mc from"node:path";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="0ca7f52c-fb31-5cd9-b689-a918f4e61816")}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]="75f74db3-9547-5c78-8561-f371c016b90d")}catch{}})();function J(e){return[...new Set((e??[]).map(t=>t.trim()).filter(t=>t.length>0))].sort((t,n)=>t.localeCompare(n))}function Nc(e){let t=e.key.trim();if(t.length===0)return null;let n=J(e.aliases),r=e.description?.trim();return{key:t,values:J(e.values),required:e.required===!0?!0:void 0,aliases:n.length>0?n:void 0,description:r&&r.length>0?r:void 0}}var Dc=e=>e,_o=e=>{let t=e.trim().toLowerCase();return t==="create"||t==="update"?t:null};function Pc(e,t){let n=t(e.command);if(n===null)return null;let r=e.option.trim();return r.length===0?null:{command:n,option:r,required:e.required,visible:e.visible,enabled:e.enabled}}function $c(e,t){let n=new Map;for(let r of e??[]){let o=Pc(r,t);o&&n.set(`${o.command}:${o.option.toLowerCase()}`,o)}return[...n.values()].sort((r,o)=>r.command===o.command?r.option.localeCompare(o.option):r.command.localeCompare(o.command))}function po(e,t){return t?J(e):void 0}function Rn(e){let t=e?.trim();return t&&t.length>0?t:void 0}function xn(e){if(e===void 0||e==="agent"||e==="human"||e==="gate")return e;throw new Error("Item type execution_role must be agent, human, or gate.")}function go(e,t={}){let n=t.resolvePolicyCommand??Dc,r=e.name.trim();if(r.length===0)return null;let o=e.required_create_fields!==void 0,i=e.required_create_repeatables!==void 0,s=e.options!==void 0,a=e.command_option_policies!==void 0,c=J(e.aliases),d=(e.options??[]).map(m=>Nc(m)).filter(m=>m!==null).sort((m,u)=>m.key.localeCompare(u.key)),l=$c(e.command_option_policies,n);return{name:r,description:Rn(e.description),default_status:Rn(e.default_status),...e.execution_role===void 0?{}:{execution_role:xn(e.execution_role)},folder:Rn(e.folder),aliases:c.length>0?c:void 0,required_create_fields:po(e.required_create_fields,o),required_create_repeatables:po(e.required_create_repeatables,i),options:s?d:void 0,command_option_policies:a?l: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]="f40ddc8e-1dd5-5f26-b2ba-fbbac30a1781")}catch{}})();var Lc=Object.freeze({decision:"human",milestone:"gate"}),jc=["title","description","status","priority","tags","body","deadline","estimatedMinutes","acceptanceCriteria","author","message","assignee"],Fc=["dep","comment","note","learning","file","test","doc"],ho=["deadline","estimatedMinutes","acceptanceCriteria","definitionOfReady","order","goal","objective","value","impact","outcome","whyNow","assignee","parent","reviewer","risk","confidence","sprint","release","blockedBy","blockedReason","unblockNote","reporter","severity","environment","reproSteps","resolution","expectedResult","actualResult","affectedVersion","fixedVersion","component","regression","customerImpact"],Uc=["title","description","type","status","priority","tags","body",...ho,"author","message","dep","comment","note","learning","file","test","doc","reminder","event","typeOption","field"],zc=["title","description","body","status","closeReason","priority","type","tags",...ho,"author","message","comment","note","learning","file","test","doc","reminder","event","typeOption","field","ownershipMetadataBypass","ownershipDependencyBypass","force"],bo={"close-reason":"closeReason",close_reason:"closeReason","estimated-minutes":"estimatedMinutes",estimated_minutes:"estimatedMinutes",estimate:"estimatedMinutes","acceptance-criteria":"acceptanceCriteria",acceptance_criteria:"acceptanceCriteria",ac:"acceptanceCriteria","definition-of-ready":"definitionOfReady",definition_of_ready:"definitionOfReady",rank:"order","why-now":"whyNow",why_now:"whyNow","blocked-by":"blockedBy",blocked_by:"blockedBy","blocked-reason":"blockedReason",blocked_reason:"blockedReason","unblock-note":"unblockNote",unblock_note:"unblockNote","repro-steps":"reproSteps",repro_steps:"reproSteps","expected-result":"expectedResult",expected_result:"expectedResult","actual-result":"actualResult",actual_result:"actualResult","affected-version":"affectedVersion",affected_version:"affectedVersion","fixed-version":"fixedVersion",fixed_version:"fixedVersion","customer-impact":"customerImpact",customer_impact:"customerImpact","type-option":"typeOption",type_option:"typeOption",type_options:"typeOption"},qc={...bo},Bc={...bo},wo=[["deadline","--deadline"],["estimatedMinutes","--estimate/--estimated-minutes"],["acceptanceCriteria","--acceptance-criteria/--ac"],["definitionOfReady","--definition-of-ready"],["order","--order/--rank"],["goal","--goal"],["objective","--objective"],["value","--value"],["impact","--impact"],["outcome","--outcome"],["whyNow","--why-now"],["assignee","--assignee"],["parent","--parent"],["reviewer","--reviewer"],["risk","--risk"],["confidence","--confidence"],["sprint","--sprint"],["release","--release"],["blockedBy","--blocked-by"],["blockedReason","--blocked-reason"],["unblockNote","--unblock-note"],["reporter","--reporter"],["severity","--severity"],["environment","--environment"],["reproSteps","--repro-steps"],["resolution","--resolution"],["expectedResult","--expected-result"],["actualResult","--actual-result"],["affectedVersion","--affected-version"],["fixedVersion","--fixed-version"],["component","--component"],["regression","--regression"],["customerImpact","--customer-impact"]],vo=[["comment","--comment"],["note","--note"],["learning","--learning"],["file","--file"],["test","--test"],["doc","--doc"],["reminder","--reminder"],["event","--event"],["typeOption","--type-option"]];function Eo(e){return Object.fromEntries(e)}var Vc=Eo([["title","--title"],["description","--description"],["type","--type"],["status","--status"],["priority","--priority"],["tags","--tags"],["body","--body"],...wo,["author","--author"],["message","--message"],["dep","--dep"],...vo]),Gc=Eo([["title","--title"],["description","--description"],["body","--body"],["status","--status"],["closeReason","--close-reason"],["priority","--priority"],["type","--type"],["tags","--tags"],...wo,...vo,["author","--author"],["message","--message"],["force","--force"]]);function Wc(e){return e.trim().replace(/^--+/,"").toLowerCase()}function Kc(e){return e==="create"?Uc:zc}function Hc(e){return e==="create"?qc:Bc}function ko(e,t){let n=Wc(t);return n.length===0?void 0:Hc(e)[n]||Kc(e).find(r=>r.toLowerCase()===n)}function dy(e,t){return(e==="create"?Vc:Gc)[t]??`--${t.replace(/([A-Z])/g,"-$1").toLowerCase()}`}function Dn(e){let t=Xc(e);return t.length===0?"items":t.endsWith("s")?t:`${t}s`}function Yc(e){let t=e.trim(),n=t.replaceAll("\\","/").replace(/^\/+/,""),r=Mc.posix.normalize(n);if(t.includes("\0")||/^[A-Za-z]:/.test(r)||r==="."||r===".."||r.startsWith("../"))throw new Error(`Item type folder "${e}" must stay inside the pm tracker root.`);return r}function Xc(e){let t=e.trim().toLowerCase(),n="",r=!1;for(let o of t){let i=o.charCodeAt(0),s=i>=97&&i<=122,a=i>=48&&i<=57;if(s||a){r&&n.length>0&&(n+="-"),n+=o,r=!1;continue}n.length>0&&(r=!0)}return n}function Jc(e){return go(e,{resolvePolicyCommand:_o})}function Xe(e,t){let n=e[t];return Array.isArray(n)?n.filter(r=>typeof r=="string"):void 0}function Qc(e){if(typeof e!="object"||e===null||Array.isArray(e))return null;let t=e;return typeof t.key!="string"?null:{key:t.key,values:Xe(t,"values")??[],required:t.required===void 0?void 0:!!t.required,aliases:Xe(t,"aliases"),description:typeof t.description=="string"?t.description:void 0}}function Zc(e){if(typeof e!="object"||e===null||Array.isArray(e))return null;let t=e;if(typeof t.command!="string"||typeof t.option!="string")return null;let n=t.command.trim().toLowerCase();return n!=="create"&&n!=="update"?null:{command:n,option:t.option,required:t.required===void 0?void 0:!!t.required,visible:t.visible===void 0?void 0:!!t.visible,enabled:t.enabled===void 0?void 0:!!t.enabled}}function ed(e){if(Array.isArray(e.options))return e.options.map(t=>Qc(t)).filter(t=>t!==null)}function td(e){if(Array.isArray(e.command_option_policies))return e.command_option_policies.map(t=>Zc(t)).filter(t=>t!==null)}function nd(e){if(typeof e!="object"||e===null||Array.isArray(e))return null;let t=e,n=typeof t.name=="string"?t.name:"";if(n.trim().length===0)return null;let r=typeof t.folder=="string"?t.folder:void 0,o=typeof t.description=="string"?t.description:void 0,i=typeof t.default_status=="string"?t.default_status:void 0;return{name:n,description:o,default_status:i,execution_role:xn(t.execution_role),folder:r,aliases:Xe(t,"aliases"),required_create_fields:Xe(t,"required_create_fields"),required_create_repeatables:Xe(t,"required_create_repeatables"),options:ed(t),command_option_policies:td(t)}}function rd(e,t){return e.required_create_fields?J(e.required_create_fields):t?.required_create_fields??[]}function od(e,t){return e.required_create_repeatables?J(e.required_create_repeatables):t?.required_create_repeatables??[]}function id(e,t){return e.options?e.options:t?.options?[...t.options]:[]}function sd(e,t){return e.command_option_policies?e.command_option_policies:t?.command_option_policies?[...t.command_option_policies]:[]}function ad(e,t){let n=t?.name??e.name,r=e.description??t?.description,o=e.default_status??t?.default_status,i=Yc(e.folder??t?.folder??Dn(n)),s={name:n,execution_role:e.execution_role,folder:i,aliases:J([...t?.aliases??[],...e.aliases??[]]),required_create_fields:rd(e,t),required_create_repeatables:od(e,t),options:id(e,t),command_option_policies:sd(e,t)};return r&&(s.description=r),o&&(s.default_status=o),s}function yo(e,t){for(let n of e){let r=Jc(n);if(!r)continue;let o=r.name.toLowerCase(),i=t.get(o);t.set(o,ad({...r,execution_role:r.execution_role??i?.execution_role},i))}}function cd(e){if(!e)return[];let t=[];for(let n of e.item_types??[]){let r=n.types;if(Array.isArray(r))for(let o of r){let i=nd(o);i&&t.push(i)}}return t}function ly(e,t=null){let n=new Map;for(let c of lo)n.set(c.toLowerCase(),{name:c,execution_role:Lc[c.toLowerCase()]??"agent",folder:He[c],aliases:[],required_create_fields:[...jc],required_create_repeatables:[...Fc],options:[],command_option_policies:[]});yo(e.item_types?.definitions??[],n),yo(cd(t),n);let r=[...n.values()].sort((c,d)=>c.name.localeCompare(d.name)),o={},i={},s={};for(let c of r){o[c.name]=c,s[c.name]=c.folder,i[c.name.toLowerCase()]=c.name;for(let d of c.aliases)i[d.toLowerCase()]=c.name}let a=[...new Set(r.map(c=>c.folder))].sort((c,d)=>c.localeCompare(d));return{types:r.map(c=>c.name),folders:a,type_to_folder:s,by_type:o,alias_to_type:i}}function dd(e,t){if(e!==void 0)return t.alias_to_type[e.trim().toLowerCase()]}function ld(e,t){let n=dd(e,t);if(n)return t.by_type[n]}function ud(e,t,n,r){for(let o of r){let i=ko(n,o);if(i){e.required.add(i);continue}e.errors.push(`Unsupported base required option "${o}" for command "${n}" on type "${t.name}"`)}}function Nn(e,t,n){if(n){e.add(t);return}e.delete(t)}function fd(e,t,n,r){let o=ko(n,r.option);if(!o){e.errors.push(`Unsupported command_option_policies option "${r.option}" for command "${n}" on type "${t.name}"`);return}r.required!==void 0&&Nn(e.required,o,r.required),r.visible!==void 0&&Nn(e.hidden,o,!r.visible),r.enabled!==void 0&&Nn(e.disabled,o,!r.enabled)}function md(e,t,n){for(let r of t.command_option_policies)r.command===n&&fd(e,t,n,r)}function pd(e,t,n){for(let r of e.required)e.disabled.has(r)&&e.errors.push(`Option "${r}" cannot be both required and disabled for command "${n}" on type "${t.name}"`)}function uy(e,t,n){let r=[],o=new Set,i=new Set,s=new Set,a={required:o,hidden:i,disabled:s,errors:r};return ud(a,e,t,n),md(a,e,t),pd(a,e,t),{required:[...o],hidden:[...i].sort((c,d)=>c.localeCompare(d)),disabled:[...s].sort((c,d)=>c.localeCompare(d)),errors:r}}function _d(e){let t=new Map;for(let n of e.options){t.set(n.key.toLowerCase(),n);for(let r of n.aliases??[])t.set(r.toLowerCase(),n)}return t}function gd(e,t,n){let r=e.values;if(r.length===0)return t;let o=new Map(r.map(i=>[i.toLowerCase(),i])).get(t.toLowerCase());if(!o){n.push(`Invalid value "${t}" for type option "${e.key}". Allowed: ${r.join(", ")}`);return}return o}function fy(e,t,n){let r=ld(e,n);if(!r)return{normalized:void 0,errors:[`Unknown type "${e}"`]};let o=[],i=_d(r),s={};for(let[c,d]of Object.entries(t??{})){let l=c.trim(),m=d.trim();if(l.length===0){o.push("type option keys must not be empty");continue}if(m.length===0){o.push(`type option "${l}" must not be empty`);continue}let u=i.get(l.toLowerCase());if(!u){let p=r.options.map(_=>_.key).join(", ");o.push(r.options.length>0?`Unknown type option "${l}" for type "${r.name}". Allowed: ${p}`:`Type "${r.name}" does not define any configurable type options`);continue}let f=gd(u,m,o);f!==void 0&&(s[u.key]=f)}for(let c of r.options)c.required&&!(c.key in s)&&o.push(`Missing required type option "${c.key}" for type "${r.name}"`);let a=Object.keys(s).sort((c,d)=>c.localeCompare(d));return a.length===0?{normalized:void 0,errors:o}:{normalized:Object.fromEntries(a.map(c=>[c,s[c]])),errors: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]="7f4b8abe-997c-549c-9791-87c78506c8b5")}catch{}})();var bd={json_markdown:".md",toon:".toon"},wd={".md":"json_markdown",".toon":"toon"};var Ey=[".md",".toon"];function Nt(e){try{return Ao(e),!0}catch{return!1}}function vd(e){let t=v.resolve(e),n=[];for(;v.dirname(t)!==t;)try{return v.join(Oo(t),...n)}catch(r){if(!On(r))throw r;n.unshift(v.basename(t)),t=v.dirname(t)}return v.join(Oo(t),...n)}function Ed(e){try{return Ao(e),!0}catch(t){if(On(t))return!1;throw t}}function kd(e){try{let t=JSON.parse(yd(e,"utf8"));return typeof t!="object"||t===null||Array.isArray(t)?!1:"id_prefix"in t||"item_format"in t}catch{return!1}}function Od(e){let t=vd(e);for(;;){let n=v.join(t,At),r=v.join(n,Ct);if(Nt(r))return n;let o=v.join(t,Ct);if(Nt(o)&&kd(o))return t;if(Ed(v.join(t,".git")))return n;let i=v.dirname(t);if(i===t)return;t=i}}function Sd(e){return Od(e)??v.resolve(e,At)}function ky(e,t){let n=process.env.PM_PATH,r=t?.trim()||n?.trim();if(r){let o=v.resolve(e,r);if(!Nt(So(o))){let i=v.join(o,At);if(Nt(So(i)))return i}return o}return Sd(e)}function Oy(e){let t=v.resolve(e),n=v.dirname(t);return v.basename(t)==="pm"&&v.basename(n)===".agents"?v.dirname(n):t}function Co(e){let t=process.env.PM_GLOBAL_PATH?.trim(),n=t&&t.length>0?t:v.join(hd.homedir(),".pm-cli");return v.resolve(e,n)}function So(e){return v.join(e,Ct)}function Ad(e,t,n=He){let r=n[t]??Dn(t);return v.join(e,r)}function Sy(e,t,n,r="toon",o=He){return v.join(Ad(e,t,o),`${n}${bd[r]}`)}function Ay(e){let t=e.replaceAll("\\","/"),n=v.posix.extname(t).toLowerCase();return wd[n]??null}function Cy(e,t){if(!/^(?!\.{1,2}$)[^/\\:\0]+$/.test(t))throw new h("Invalid history item id: expected a single filename.",y.USAGE);return v.join(e,"history",`${t}.jsonl`)}function Pn(e,t){return v.join(e,"locks",`${t}.lock`)}function Iy(e){return v.join(e,"runtime")}import{createHash as Ro}from"node:crypto";import Cd 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]="77f9d61e-e78b-5b6a-a769-1ad6e5b91777")}catch{}})();function Id(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 Td(e){let t=Object.keys(e).sort(),n={};for(let r of t){let o=e[r];o!==void 0&&(n[r]=Dt(o))}return n}function Dt(e){let t=Id(e);if(t!==void 0)return t;if(Array.isArray(e))return e.map(r=>Dt(r));if(e instanceof Date)return e.toISOString();let n=e;if(typeof n.toJSON=="function"){let r=n.toJSON();if(r!==e)return Dt(r)}return Td(e)}function fe(e){return JSON.stringify(Dt(e))}function Io(e,t,n,r){for(let o=0;o<t.length;o+=1)if(!n.has(o)&&r(e,t[o]))return n.add(o),!0;return!1}function Rd(e,t){if(e instanceof RegExp||t instanceof RegExp)return e instanceof RegExp&&t instanceof RegExp&&e.toString()===t.toString()}function xd(e,t){if(e instanceof Date||t instanceof Date)return e instanceof Date&&t instanceof Date&&e.getTime()===t.getTime()}function Nd(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],r=new Set;for(let o of e)if(!Io(o,n,r,B))return!1;return!0}function Dd(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()],r=new Set;for(let[o,i]of e.entries())if(!Io([o,i],n,r,([s,a],[c,d])=>B(s,c)&&B(a,d)))return!1;return!0}function Pd(e,t){if(Array.isArray(e)||Array.isArray(t))return!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length?!1:e.every((n,r)=>B(n,t[r]))}function $d(e,t){let n=Object.keys(e).sort((o,i)=>o.localeCompare(i)),r=Object.keys(t).sort((o,i)=>o.localeCompare(i));if(n.length!==r.length)return!1;for(let o=0;o<n.length;o+=1){let i=n[o];if(i!==r[o]||!B(e[i],t[i]))return!1}return!0}var Md=[Rd,xd,Nd,Dd,Pd];function B(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 Md){let r=n(e,t);if(r!==void 0)return r}return $d(e,t)}function xy(e){return Cd.createHash("sha256").update(e,"utf8").digest("hex")}function Ny(e,t){let n={};for(let o of t){let i=e[o];i!==void 0&&(n[o]=i)}let r=Object.keys(e).filter(o=>!t.includes(o)).sort((o,i)=>o.localeCompare(i));for(let o of r){let i=e[o];i!==void 0&&(n[o]=i)}return 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]="f675993f-c483-5751-baed-d968b4fd24c0")}catch{}})();var Ld=["policies","policy-put","policy-remove","policy-mode","policy-check","policy-approve","policy-presets"],To=256,$n=64;function U(e){throw new h(`Invalid workflow policy: ${e}`,y.USAGE,{code:"workflow_policy_invalid",nextSteps:["Inspect pm schema policies and correct the declaration using pm schema policy-put."]})}function W(e,t,n){if(typeof e!="object"||e===null||Array.isArray(e))return U(`${n} must be an object`);let r=e;return Object.keys(r).some(o=>!t.includes(o))?U(`${n} contains an unknown key`):r}function me(e,t,n=128){return typeof e!="string"||!e.trim()||e.length>n?U(`${t} must be nonempty text of at most ${n} characters`):e.trim()}function Je(e,t){if(!Array.isArray(e)||e.length===0||e.length>$n)return U(`${t} requires 1-${$n} terms`);let n=e.map(r=>me(r,t));return t==="fields"&&n.some(r=>!/^[a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*){0,7}$/.test(r)||r.split(".").some(o=>["__proto__","constructor","prototype"].includes(o)))?U("fields must be safe metadata paths of at most eight segments"):[...new Set(n)]}function jd(e){let t=W(e,["kind","fields","authors","allowed"],"rule");return t.kind==="transition"?(W(t,["kind","allowed"],"transition rule"),!Array.isArray(t.allowed)||t.allowed.length>$n?U("transition.allowed must be a bounded array"):{kind:"transition",allowed:t.allowed.map(n=>!Array.isArray(n)||n.length!==2?U("transition pairs need two statuses"):[me(n[0],"from"),me(n[1],"to")])}):t.kind==="authors"?(W(t,["kind","authors"],"authors rule"),{kind:"authors",authors:Je(t.authors,"authors")}):t.kind==="require_fields"?(W(t,["kind","fields"],"require_fields rule"),{kind:"require_fields",fields:Je(t.fields,"fields")}):t.kind==="field_writers"||t.kind==="approval"?(W(t,["kind","fields","authors"],"field rule"),{kind:t.kind,fields:Je(t.fields,"fields"),authors:Je(t.authors,"authors")}):U("unknown rule kind")}function Fd(e){let t={},n=W(e,["types","tags","statuses","operations","parents","dependency"],"subject");for(let r of["types","tags","statuses","operations","parents"])n[r]!==void 0&&(t[r]=Je(n[r],r));if(n.dependency!==void 0){let r=W(n.dependency,["kind","id"],"dependency");t.dependency={kind:me(r.kind,"dependency kind"),...r.id===void 0?{}:{id:me(r.id,"dependency id")}}}return t}function Ud(e){let t=W(e,["id","description","subject","effect","rule"],"policy"),n=me(t.id,"id");return/^[a-zA-Z0-9][a-zA-Z0-9._-]*$/.test(n)?t.effect!==void 0&&(typeof t.effect!="string"||!["advise","warn","refuse"].includes(t.effect))?U("effect must be advise, warn, or refuse"):{id:n,rule:jd(t.rule),...t.subject===void 0?{}:{subject:Fd(t.subject)},...t.description===void 0?{}:{description:me(t.description,"description",500)},...t.effect===void 0?{}:{effect:t.effect}}:U("id must be a stable token")}function zd(e){let t=W(e,["version","enforcement","policies"],"document");if(t.version!==1)return U("unsupported version");if(t.enforcement!==void 0&&t.enforcement!=="advise"&&t.enforcement!=="refuse")return U("enforcement must be advise or refuse");if(!Array.isArray(t.policies)||t.policies.length>To)return U(`policies must contain at most ${To} declarations`);let n=t.policies.map(Ud);return new Set(n.map(r=>r.id)).size!==n.length?U("duplicate policy id"):{version:1,enforcement:t.enforcement??"advise",policies:n}}function Pt(e,t){let n=e;for(let r of t.split(".")){if(typeof n!="object"||n===null||!Object.hasOwn(n,r))return;n=n[r]}return n}function qd(e){return e==null?!1:typeof e=="string"?e.trim().length>0:typeof e=="number"?Number.isFinite(e):Array.isArray(e)?e.length>0:typeof e=="object"?Object.keys(e).length>0:!0}function xo(e){return Ro("sha256").update(fe(e)).digest("hex")}function Bd(e,t){let n=e.rule.kind==="approval"?e.rule.fields:[];return Ro("sha256").update(fe({id:t.id,fields:n.map(r=>[r,Pt(t,r)])})).digest("hex")}function Vd(e,t){return Array.isArray(t)&&t.some(n=>typeof n=="object"&&n!==null&&"kind"in n&&n.kind===e.kind&&(e.id===void 0||"id"in n&&n.id===e.id))}function Gd(e,t,n){return!(e.types&&!e.types.some(r=>r.toLowerCase()===String(t.type).toLowerCase())||e.statuses&&!e.statuses.includes(String(t.status))||e.operations&&!e.operations.includes(n)||e.parents&&!e.parents.includes(String(t.parent))||e.tags&&(!Array.isArray(t.tags)||!e.tags.some(r=>t.tags.includes(r)))||e.dependency&&!Vd(e.dependency,t.dependencies))}function Wd(e,t){if(t.completeness_only&&(e.rule.kind!=="require_fields"||e.subject?.operations!==void 0)||e.rule.kind==="approval"&&t.before===null)return!1;let n=e.subject??{},r=t.after?.status??t.before?.status;return[t.before,t.after].some(o=>o!==null&&Gd(n,{...o,status:r},t.operation))}function Kd(e,t,n,r){let o=["type","tags","parent","dependencies"].some(i=>!B(t.before?.[i],t.after?.[i]));return t.after&&(t.completeness_only||n||r||o)?e.filter(i=>!qd(Pt(t.after,i))):[]}function Hd(e,t,n,r){let o=t.after??t.before,i=Bd(e,o);return t.approvals?.some(s=>s.policy_fingerprint===r&&s.content_fingerprint===i&&s.author!==t.author&&n.includes(s.author))??!1}function Yd(e,t,n){let r=e.rule,o=t.before?.status!==t.after?.status,i="fields"in r&&r.fields.some(s=>!B(Pt(t.before,s),Pt(t.after,s)));switch(r.kind){case"require_fields":{let s=Kd(r.fields,t,o,i);return{satisfied:s.length===0,missing_fields:s,remediation:"Supply the declared required fields before this lifecycle transition."}}case"transition":return{satisfied:!o||r.allowed.some(([s,a])=>s===String(t.before?.status??"$create")&&a===String(t.after?.status??"$delete")),missing_fields:[],remediation:"Choose a declared allowed transition; inspect pm schema policies."};case"authors":return{satisfied:r.authors.includes(t.author),missing_fields:[],remediation:"Have a declared workflow actor perform this operation."};case"field_writers":return{satisfied:!i||r.authors.includes(t.author),missing_fields:[],remediation:"Have a declared field writer change the protected fields."};case"approval":return{satisfied:!o||Hd(e,t,r.authors,n),missing_fields:[],remediation:`Record an independent approval with pm schema policy-approve <item-id> --policy ${e.id} after preparing the reviewed fields.`}}}function No(e,t,n){let r=e.policies.filter(o=>Wd(o,t)).map(o=>{let i=o.effect??"advise",s=n(o);return{policy_id:o.id,policy_fingerprint:s,rule:o.rule.kind,effect:i==="refuse"&&e.enforcement!=="refuse"?"warn":i,...Yd(o,t,s)}});return{allowed:!r.some(o=>!o.satisfied&&o.effect==="refuse"),decisions:r,warnings:r.filter(o=>!o.satisfied).map(o=>`workflow_policy:${o.effect}:${o.policy_id}:${o.rule}`)}}function jy(e,t){return No(e,t,xo)}function Fy(e){let t=zd(e),n=new Map(t.policies.map(r=>[r,xo(r)]));return r=>No(t,r,o=>n.get(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]="451b262c-a9b6-5f1c-b397-2686a5fd953a")}catch{}})();var Xd=[["history-redact","history redact"],["history-repair","history repair"],["history-compact","history compact"],["activity","history activity"],["restore","history restore"]].map(([e,t])=>({alias:e,canonical:t,canonical_argv:t.split(" "),lifecycle:"permanent",hidden:!0,registration:"commander",owner:"pm-tqel"})),Jd=[...["next","focus"].map(e=>({alias:e,canonical:`context ${e}`,owner:"pm-kcs4"})),...["stats","health","validate","gc","telemetry","eval","test-all"].map(e=>({alias:e,canonical:`ops ${e}`,owner:"pm-6apl"})),...["normalize","reindex"].map(e=>({alias:e,canonical:`ops ${e}`,owner:"pm-3i9q8g"})),{alias:"events",canonical:"history events",owner:"pm-3i9q8g"}].map(e=>({...e,canonical_argv:e.canonical.split(" "),lifecycle:"permanent",hidden:!0,registration:"bootstrap"})),Qd=[["update-many","update many"],["close-many","close many"],["delete","close delete"]].map(([e,t])=>({alias:e,canonical:t,canonical_argv:t.split(" "),lifecycle:"permanent",hidden:!0,registration:"bootstrap",owner:"pm-ik19"})),Zd=[...Jd,...Qd,...["init","config","schema","profile"].map(e=>({alias:e,canonical:`workspace ${e}`,canonical_argv:["workspace",e],lifecycle:"permanent",hidden:!0,registration:"bootstrap",owner:"pm-npr3"})),...[...["comments","notes","learnings","files","docs","deps","append","test"].map(e=>[e,`item ${e}`,"pm-yql1"]),["test-runs-worker","item test worker","pm-lp4j"],...["statuses","tags","types"].map(e=>[`completion-${e}`,`completion ${e}`,"pm-szdc"]),["history-author-acknowledge","history acknowledge","pm-djyvbk"],["copy","item copy","pm-m6g87m"],["merge","workspace merge","pm-m6g87m"],["duplicates","item duplicates","pm-fmy9ih"],["dedupe-audit","item duplicates audit","pm-fmy9ih"],["dedupe-merge","item duplicates merge","pm-fmy9ih"],["comments-audit","item audit-comments","pm-fmy9ih"],["search-advanced","search advanced","pm-wfskfn"],...["meet","event","remind"].map(e=>[e,`calendar ${e}`,"pm-o3fh"])].map(([e,t,n])=>({alias:e,canonical:t,canonical_argv:t.split(" "),lifecycle:"permanent",hidden:!0,registration:"bootstrap",owner:n}))],Mn=[{alias:"history-attest",canonical:"history attest",canonical_argv:["history","attest"],lifecycle:"permanent",hidden:!0,registration:"commander",owner:"pm-3z0k"},...Xd,...Zd,...["discover","lookup"].map(e=>({alias:`files ${e}`,canonical:`item files ${e}`,canonical_argv:["item","files",e],lifecycle:"permanent",hidden:!0,registration:"bootstrap",owner:"pm-yql1"}))];function zy(e){let t;for(let n of Mn)n.canonical_argv.length<=(t?.canonical_argv.length??0)||n.canonical_argv.every((r,o)=>r===(o===0&&e[o]==="ctx"?"context":e[o]))&&(t=n);return t}function el(e){let t=e.trim().replace(/\s+/gu," ");return Mn.find(n=>n.canonical===t.replace(/^ctx /u,"context "))?.alias??t}function Qe(e){return el(e)}var $t=[...Mn,...[["ctx","context"],["packages","package"]].map(([e,t])=>({alias:e,canonical:t,canonical_argv:[t],lifecycle:"permanent",hidden:!1,registration:"commander",owner:"pm-pbyu"})),...[["start-task","claim","--start"],["pause-task","release","--pause"],["close-task","close","--release-assignment"]].map(([e,t,n])=>({alias:e,canonical:t,canonical_argv:[t,n],lifecycle:"deprecated",hidden:!0,registration:"commander",owner:"pm-eq4x"})),{alias:"tests",canonical:"item test",canonical_argv:["item","test"],lifecycle:"permanent",hidden:!1,registration:"bootstrap",owner:"pm-u4t9gp"},...[["fetch","get"],["read","get"],["show","get"],["view","get"],["comment","comments"],["note","notes"],["learning","learnings"]].map(([e,t])=>({alias:e,canonical:["comments","notes","learnings"].includes(t)?`item ${t}`:t,canonical_argv:["comments","notes","learnings"].includes(t)?["item",t]:[t],lifecycle:"permanent",hidden:!1,registration:"bootstrap",owner:"pm-pbyu"})),...[["extension list","extension catalog"],["extension scaffold","extension init"],["package list","package catalog"],["package scaffold","package init"],["packages list","package catalog"],["packages scaffold","package init"]].map(([e,t])=>({alias:e,canonical:t,canonical_argv:t.split(" "),lifecycle:"permanent",hidden:!1,registration:"commander",owner:"pm-ya7x55"})),{alias:"list-all",canonical:"list",canonical_argv:["list","--all"],lifecycle:"deprecated",hidden:!0,registration:"commander",owner:"pm-pfqi"},...[["list-draft","draft"],["list-open","open"],["list-in-progress","in_progress"],["list-blocked","blocked"],["list-closed","closed"],["list-canceled","canceled"]].map(([e,t])=>({alias:e,canonical:"list",canonical_argv:["list","--status",t],lifecycle:"deprecated",hidden:!0,registration:"commander",owner:"pm-pfqi"})),...[["extension","package"],["install","package install"],["upgrade","package upgrade"]].map(([e,t])=>({alias:e,canonical:t,canonical_argv:t.split(" "),lifecycle:"deprecated",hidden:!0,registration:"commander",owner:"pm-tnud"}))],qy=Object.fromEntries($t.filter(e=>e.registration==="bootstrap").map(e=>[e.alias,e.canonical]));function By(e){let t=e.trim().toLowerCase();return $t.find(n=>n.alias===t)}function Vy(e){return`Deprecated command \`${e.alias}\`; use \`pm ${e.canonical_argv.join(" ")}\`.`}(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]="432226a6-9df4-5de6-b9af-5c06ec2eed66")}catch{}})();var tl=[...G],nl=[...Ce],rl=[...Et],Yy=[...kt],Xy=[...Ot],ol=[...St],Mt=["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-attest","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","assurance","gc","workspace","contracts","claim","release","start-task","pause-task","close-task","meet","event","remind","help"],Jy=["ancestors","descendants","predecessors","successors","paths","impact","analyze","audit","communities","redundancy","dominators","slack","centrality","articulation","plan","index"],Qy=["install","reconcile","report","driver"],il=["init","install","uninstall","explore","manage","describe","reload","doctor","catalog","adopt","adopt-all","activate","deactivate"],sl=["upgrade"],al=["reopen"],Do={help:"Commander help rendering has no SDK operation result.",packages:"The plural package alias only renders package-oriented help."},Te=Object.freeze(Mt.flatMap(e=>e in Do?[]:e==="extension"||e==="package"?[...il.map(t=>`${e}-${t}`),...e==="package"?sl.map(t=>`package-${t}`):[],e]:e==="item"?al.map(t=>`item-${t}`):[e])),cl=Object.freeze($t.filter(e=>e.lifecycle==="deprecated"&&e.registration==="commander"&&Te.includes(e.alias)).map(e=>e.alias)),Zy=Object.freeze(Te.filter(e=>!cl.includes(e)));function eh(e=Mt,t=Te,n=Do){let r=new Set(t),o=new Set(e);return{missing_cli_actions:e.filter(i=>!r.has(i)&&!t.some(s=>s.startsWith(`${i}-`))&&n[i]===void 0),waived_cli_actions:e.filter(i=>!r.has(i)&&!t.some(s=>s.startsWith(`${i}-`))&&n[i]!==void 0),stale_waivers:Object.keys(n).filter(i=>!o.has(i)||r.has(i)||t.some(s=>s.startsWith(`${i}-`)))}}function th(e){return Te.includes(e)}function nh(e){return tl.includes(e)}function rh(e){return nl.includes(e)}function oh(e){return rl.includes(e)}function ih(e){return ol.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]="53865a81-4c96-51e2-a378-ae0e2781a50f")}catch{}})();var Lt={include:"--output-include",amount:"--output-limit",cost:"--output-budget",encoding:"--output-format"},jt=Object.freeze(["--output-session","--output-cursor","--output-row-contract"]),Re=["list","context","search","get","next","health","deps","graph","history","activity","validate","events","contracts","comments","notes","files","docs","stats","aggregate","duplicates","package-catalog","package-manage","comments-audit","assurance"];(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]="f8657910-1392-5fae-afda-614b96dc8320")}catch{}})();function S(e){return e.trim().toLowerCase().split(/\s+/).filter(t=>t.length>0).join(" ")}function dl(){return{json:!1,quiet:!1,noExtensions:!1,profile:!1}}function Po(e){return e?P(e):{}}function $o(e){return e?P(e):dl()}function P(e){return structuredClone(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]="615b4955-a30d-5d45-a86d-4bcf7bd9bd7a")}catch{}})();var ll=new Set(["commands","command_overrides","command_handlers","flag_commands","parser_overrides"]),ul=["commands","command_overrides","command_handlers","hooks","flag_commands","item_types","item_fields","relationship_kinds","migrations","profiles","importers","exporters","search_providers","vector_store_adapters","assurance_providers","parser_overrides","service_overrides","renderer_overrides"];function fl(e,t){for(let n of ul){let r=e[n];if(r===void 0)continue;if(!Array.isArray(r)||r.some(i=>typeof i!="string"))return!1;let o=r.map(i=>ll.has(n)?S(i):i.trim()).filter(i=>i.length>0);t[n]=[...new Set(o)].sort((i,s)=>i.localeCompare(s))}return!0}function ml(e){if(!Array.isArray(e))return null;let t=[];for(let n of e){if(typeof n!="object"||n===null)return null;let r=n;if(r.format!=="json"&&r.format!=="toon"||!Array.isArray(r.commands)||r.commands.some(o=>typeof o!="string")||typeof r.result_discriminator!="boolean")return null;t.push({format:r.format,commands:[...new Set(r.commands.map(o=>S(o)))].sort((o,i)=>o.localeCompare(i)),result_discriminator:r.result_discriminator})}return t.sort((n,r)=>n.format.localeCompare(r.format))}function pl(e){if(!Array.isArray(e))return null;let t=[];for(let n of e){if(typeof n!="object"||n===null)return null;let r=n.commands;if(!Array.isArray(r)||r.some(o=>typeof o!="string"))return null;t.push({commands:[...new Set(r.map(o=>S(o)))].filter(o=>o.length>0).sort((o,i)=>o.localeCompare(i))})}return t}function Ft(e){if(e==null)return;if(typeof e!="object"||Array.isArray(e))return null;let t=e;if(t.schema_version!==1)return null;let n={schema_version:1};if(!fl(t,n))return null;let r=t.preflight_overrides;if(r!==void 0&&(!Number.isInteger(r)||r<0))return null;typeof r=="number"&&(n.preflight_overrides=r);let o=t.renderer_ownership;if(o!==void 0){let s=ml(o);if(s===null)return null;n.renderer_ownership=s}let i=t.preflight_ownership;if(i!==void 0){let s=pl(i);if(s===null)return null;n.preflight_ownership=s}return n}function lh(e){return{schema_version:1,commands:e.commands,command_overrides:e.command_overrides,command_handlers:e.command_handlers,hooks:e.hooks,flag_commands:e.flag_commands,item_types:e.item_types,item_fields:e.item_fields,...e.relationship_kinds?{relationship_kinds:e.relationship_kinds}:{},migrations:e.migrations,profiles:e.profiles,importers:e.importers,exporters:e.exporters,search_providers:e.search_providers,vector_store_adapters:e.vector_store_adapters,...e.assurance_providers?{assurance_providers:e.assurance_providers}:{},parser_overrides:e.parser_overrides,service_overrides:e.service_overrides,renderer_overrides:e.renderer_overrides,...e.renderer_ownership?{renderer_ownership:e.renderer_ownership}:{},preflight_overrides:e.preflight_overrides,...e.preflight_ownership?{preflight_ownership:e.preflight_ownership}:{}}}(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]="c24357cc-5dad-5cd7-aa89-cddd2945aab7")}catch{}})();var _l=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:"--output-cursor",value_name:"cursor"},{flag:"--output-row-contract"},{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"}]),Ln=new Set(_l.flatMap(e=>[e.flag,...e.aliases??[]]));(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="896ebde0-4ca1-50ed-bb8e-2a8c2d978d94")}catch{}})();var Mo=/^(--[a-z0-9][a-z0-9_-]*)(?:[ =](<[^<>]+>|\[[^[\]]+\]))?$/;function jn(e){if(typeof e!="string")return null;let t=Mo.exec(e.trim());if(!t)return null;let n=t[2];return{name:t[1],valueName:n?n.slice(1,-1):null,optional:n?.startsWith("[")??!1}}function ph(e){let t=jn(e);return t?t.name:typeof e=="string"&&e.trim()||null}function gl(e){if(typeof e!="string")return null;let t=e.trim(),n=t.split(/[ =]/,1)[0];return Ln.has(n)?"host_owned_flag_collision":Mo.test(t)?null:"malformed_long_flag"}function Lo(e,t){let n=[e,t].find(i=>typeof i=="string"&&Ln.has(i.trim().split(/[ =]/,1)[0]));if(typeof n=="string")return{token:n.trim().split(/[ =]/,1)[0],failure:"host_owned_flag_collision"};if(typeof e!="string")return null;let r=e.trim(),o=gl(r);return o===null?null:{token:r,failure:o}}function jo(e,t){return t==="host_owned_flag_collision"?`cannot shadow host-owned global flag "${e}"; read it from context.global instead`:`long flag "${e}" must start with a double-dash name such as "--my-flag" or "--my-flag <value>"`}(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]="5c3049c3-1d5a-5e7e-a070-35340737a6ab")}catch{}})();var Fo=Object.freeze({string:"string",number:"number",int:"number",integer:"number",float:"number",boolean:"boolean",bool:"boolean"});function Ut(e){if(typeof e!="string")return null;let t=e.trim().toLowerCase();return Object.hasOwn(Fo,t)?Fo[t]:null}function yl(e,t,n){return!!(e.value_name?.trim()||t||n||e.required===!0||e.list===!0||e.repeatable===!0)}function hl(e){return(e.value_type?.trim()||e.type?.trim())?.toLowerCase()}function yh(e){let t=hl(e),n=Ut(t),r=jn(e.long),o=e.value_name?.trim()||null,i=!(n==="boolean"&&t!=="bool")&&yl(e,r?.valueName,t),s=r?.valueName?r.optional:t==="bool";return{value_type:n,value_arity:i?s?"optional":"required":"none",value_name:i?o??r?.valueName??"value":null}}function Uo(e){let t=[],n=r=>{if(Array.isArray(r)){for(let o of r)n(o);return}if(typeof r=="string"){for(let o of r.split(",")){let i=o.trim();i.length>0&&t.push(i)}return}r!=null&&t.push(r)};return n(e),t}function zo(e,t){return t==="string"?!0:t==="number"?typeof e=="number"?Number.isFinite(e):typeof e=="string"&&e.trim().length>0&&Number.isFinite(Number(e)):typeof e=="boolean"?!0:typeof e=="string"&&["true","false","1","0"].includes(e.trim().toLowerCase())}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="7359c10a-4c56-57ea-8254-fc26b19e5c84")}catch{}})();function Ze(e){return[...new Set(e.map(t=>t.trim()).filter(t=>t.length>0))].sort((t,n)=>t.localeCompare(n))}function Q(e){return G.includes(e)}function qo(e){let t=e.trim().toLowerCase();return Q(t)?t:null}function Bo(e){return e.filter(t=>!Q(t))}function Fn(e){let t=e.trim().toLowerCase();return t.length===0?null:so[t]??null}function Vo(e){let t=Ze([...e].map(i=>i.toLowerCase())),n=[],r=[];for(let i of t){let s=Fn(i);if(s){n.push(s),r.push({alias:i,target:s});continue}n.push(i)}let o=[...new Map(r.map(i=>[`${i.alias}>${i.target}`,i])).values()].sort((i,s)=>i.alias.localeCompare(s.alias));return{capabilities:Ze(n),legacy_aliases:o}}function bl(e){let t=e.trim().toLowerCase();if(t.length===0)return null;let n=Fn(t);if(n)return n;let r=Math.max(1,Math.floor(t.length*.34)),o=null,i=Number.POSITIVE_INFINITY;for(let s of G){let a=It(t,s,r);a!==null&&a<i&&(i=a,o=s)}return o}function Go(e,t,n){let r=G.join(","),o=bl(n)??"none";return`extension_capability_unknown:${e}:${t}:${n}:allowed=${r}:suggested=${o}`}function Wo(e,t,n){let r=n.map(o=>`${o.alias}>${o.target}`).join(",");return`extension_capability_legacy_alias:${e}:${t}:aliases=${r}`}function wl(e){let t=/^extension_capability_unknown:(global|project):([^:]+):([^:]+):allowed=([^:]+):suggested=([^:]+)$/.exec(e.trim());if(!t)return null;let[,n,r,o,i,s]=t,a=n,c=i.split(",").map(m=>m.trim()).filter(m=>m.length>0),d=Fn(o),l=(s==="none"?void 0:s)??d??void 0;return{layer:a,name:r,capability:o,allowed_capabilities:c,capability_contract_version:vn,suggested_capability:l,suggestion_source:l?d===l?"legacy_alias":"nearest_match":void 0,legacy_alias_target:d??void 0}}function vl(e){let t=/^extension_capability_legacy_alias:(global|project):([^:]+):aliases=(.+)$/.exec(e.trim());if(!t)return[];let[,n,r,o]=t,i=n,s=[...G],a=[];for(let c of o.split(",")){let[d,l]=c.split(">"),m=d?.trim(),u=l?.trim().toLowerCase();!m||!u||!Q(u)||a.push({layer:i,name:r,capability:m,allowed_capabilities:s,capability_contract_version:vn,suggested_capability:u,suggestion_source:"legacy_alias",legacy_alias_target:u})}return a}(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]="d8844150-afb4-5f2e-a005-4cfb8482660c")}catch{}})();var El={commands:["registerCommand","command override","command handler"],renderers:["registerRenderer"],hooks:["hooks.beforeCommand","hooks.beforeMutation","hooks.afterCommand","hooks.onWrite","hooks.onRead","hooks.onIndex"],schema:["registerFlags","registerItemFields","registerItemTypes","registerRelationshipKinds","registerMigration","registerProfile"],importers:["registerImporter","registerExporter"],search:["registerSearchProvider","registerVectorStoreAdapter"],parser:["registerParser"],preflight:["registerPreflight"],services:["registerService","registerAssuranceMeasurementProvider"]},Ko=":";function Ho(e,t){return`${e}${Ko}${Un(t)}`}function kl(e){return e.slice(e.indexOf(Ko)+1)}function Un(e){return e.trim().toLowerCase()}function Ol(e){if(!Array.isArray(e))return[];let t=new Set;for(let n of e){let r=qo(n);r!==null&&t.add(r)}return[...t].sort((n,r)=>n.localeCompare(r))}function Yo(e){let t=new Map,n=(l,m)=>{for(let u of l){let f=Ho(u.layer,u.name),p=t.get(f);p===void 0&&(p=new Set,t.set(f,p)),p.add(m)}},{registrations:r,commands:o,parsers:i,preflight:s,services:a,renderers:c,hooks:d}=e;return n(r.commands,"commands"),n(o.overrides,"commands"),n(o.handlers,"commands"),n(r.flags,"schema"),n(r.item_fields,"schema"),n(r.item_types,"schema"),n(r.relationship_kinds??[],"schema"),n(r.migrations,"schema"),n(r.profiles,"schema"),n(r.importers,"importers"),n(r.exporters,"importers"),n(r.search_providers,"search"),n(r.vector_store_adapters,"search"),n(i.overrides,"parser"),n(s.overrides,"preflight"),n(a.overrides,"services"),n(r.assurance_providers??[],"services"),n(c.overrides,"renderers"),n(d.beforeCommand,"hooks"),n(d.beforeMutation,"hooks"),n(d.afterCommand,"hooks"),n(d.onWrite,"hooks"),n(d.onRead,"hooks"),n(d.onIndex,"hooks"),t}function Sl(e,t={}){let n=Yo(e),r=new Set;t.extensionName!==void 0&&r.add(Un(t.extensionName));for(let i of t.extensionNames??[])r.add(Un(i));let o=new Set;for(let[i,s]of n)if(!(r.size>0&&!r.has(kl(i))))for(let a of s)o.add(a);return[...o].sort((i,s)=>i.localeCompare(s))}function Al(e,t){let n=Yo(t),r=[];for(let o of e){let i=Ol(o.capabilities);if(i.length===0)continue;let s=n.get(Ho(o.layer,o.name))??new Set,a=[...s].sort((d,l)=>d.localeCompare(l)),c=i.filter(d=>!s.has(d));r.push({layer:o.layer,name:o.name,declared:i,used:a,unused:c})}return r}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="4a7b042c-7fb8-57a5-8f94-de44f82d7589")}catch{}})();function Cl(e){return e.trim().toLowerCase().replace(/\s+/g," ")}function Z(e,t){let n=e.slice(0,t),r=n.charCodeAt(n.length-1),o=e.charCodeAt(n.length);return r>=55296&&r<=56319&&o>=56320&&o<=57343?n.slice(0,-1):n}function Oh(e){return Cl(e).split(/[^a-z0-9]+/).filter(t=>t.length>0)}function Sh(e,t){if(e.length===0&&t.length===0)return 1;if(e.length===0||t.length===0)return 0;let n=new Set(e),r=new Set(t),o=0;for(let s of n)r.has(s)&&(o+=1);let i=new Set([...n,...r]).size;return o/i}import{stripVTControlCharacters as Il}from"node:util";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="1a14ce9e-1074-5434-9646-dd5e25e34814")}catch{}})();var Tl=["full","compact","brief","summary","counts"],xh=["mutation","read","discovery","governance"],Jo=["error","warning","validation_summary","recovery_bundle"],Rl=["full","omit_explanation","limit_collections","compact_recovery","action_only"],xl=new Set(["append","claim","close","close-many","close-task","comments","config","copy","create","delete","docs","event","files","focus","history-author-acknowledge","history-compact","history-redact","history-repair","init","item","learnings","meet","notes","pause-task","release","remind","restore","schema","start-task","update","update-many"]),Nl=new Set(["contracts","extension","help","install","package","packages","profile","upgrade"]),Dl=new Set(["gc","health","merge","stats","telemetry","test","test-all","validate"]),Pl={mutation:2e3,read:4e3,discovery:3e3,governance:6e3},$l=3,Ml=2,Ll=192,jl={error:{text:768,json:2e3},warning:{text:768,json:2e3},validation_summary:{text:1500,json:3e3},recovery_bundle:{text:768,json:2e3}},Fl=Jo.map(e=>({diagnostic_class:e,default_max_estimated_tokens_by_format:jl[e],minimum_max_estimated_tokens:Ll,degradation_ladder:Rl,corrective_action_paths:["required","recovery.suggested_retry","recovery.suggested_retry_args","recovery.next_best_command","next_steps[0]"],token_estimate:"ceil(utf8_bytes / 4)"})),Ul=new Map(Fl.map(e=>[e.diagnostic_class,e]));function zl(e){let[t=""]=Qe(e).split(/\s+/u);return xl.has(t)?"mutation":Nl.has(t)?"discovery":Dl.has(t)?"governance":"read"}function Qo(e,t=zl(e)){let n=e.trim().replace(/\s+/gu," ");if(n.length===0)throw new TypeError("command must be a non-empty command path");let r=Pl[t];return ql({command:n,budget_class:t,default_max_estimated_tokens:r,default_max_estimated_tokens_by_format:{toon:r,json:Math.ceil(r*$l/Ml)},degradation_ladder:Tl,allows_unbounded_opt_out:!0,token_estimate:"ceil(utf8_bytes / 4)"})}function ql(e){if(!Number.isSafeInteger(e.default_max_estimated_tokens)||e.default_max_estimated_tokens<=0)throw new RangeError("default_max_estimated_tokens must be a positive safe integer");for(let[t,n]of Object.entries(e.default_max_estimated_tokens_by_format))if(!Number.isSafeInteger(n)||n<=0)throw new RangeError(`default_max_estimated_tokens_by_format.${t} must be a positive safe integer`);return e}var Bl=Mt.map(e=>Qo(e)),Vl=new Map(Bl.map(e=>[e.command,e]));function Zo(e,t={}){let n=e.trim().replace(/\s+/gu," "),[r]=Qe(n).split(" "),o=Vl.get(r);return o?{...o,command:n}:t.generateFallback?Qo(n):null}function _e(e){return Math.ceil(Math.max(0,e)/4)}function ei(e){let t=Ul.get(e);if(t===void 0)throw new TypeError(`diagnosticClass must be one of: ${Jo.join(", ")}`);return t}function ee(e){return _e(Buffer.byteLength(JSON.stringify(e,null,2),"utf8"))}function Gl(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function zn(e){if(!Gl(e))return;let t={};for(let n of["suggested_retry","suggested_retry_args","next_best_command","allowed_values","candidate_commands","missing","missing_required_fields","option_scope","retry_after_ms","waited_ms","owner_handoffs"]){let r=e[n];Array.isArray(r)?t[n]=n==="suggested_retry_args"?r:r.slice(0,3):r!==void 0&&(t[n]=r)}return Object.keys(t).length>0?t:void 0}function Wl(e,t){return typeof e!="string"||e.length<=t?e:`${Z(e,Math.max(1,t-3))}...`}function pe(e,t){if(Buffer.byteLength(e,"utf8")<=t)return e;let n="...",r=Array.from(e),o=0,i=r.length;for(;o<i;){let s=Math.ceil((o+i)/2),a=`${r.slice(0,s).join("")}${n}`;Buffer.byteLength(a,"utf8")<=t?o=s:i=s-1}return`${r.slice(0,o).join("")}${n}`}function ti(e){let t={};for(let n of["code","required","recovery","next_steps","exit_code","type","title","detail","why","examples"])Object.hasOwn(e,n)&&e[n]!==void 0&&(t[n]=e[n]);for(let[n,r]of Object.entries(e))n!=="__proto__"&&!Object.hasOwn(t,n)&&(t[n]=r);return t}var Kl=new Set(["limit_collections","compact_recovery","action_only"]),Hl=new Set(["compact_recovery","action_only"]);function Yl(e){let t={code:typeof e.code=="string"?e.code:"diagnostic",required:Wl(e.required,160)??"Inspect the diagnostic code and retry with corrected input."},n=zn(e.recovery);return n!==void 0?t.recovery=n:Array.isArray(e.next_steps)&&(t.next_steps=e.next_steps.slice(0,1)),e.exit_code!==void 0&&(t.exit_code=e.exit_code),e.type!==void 0&&(t.type=e.type),t}function Xl(e,t){let n=structuredClone(e);if(t!=="full"&&(delete n.why,delete n.examples),Kl.has(t))for(let[r,o]of Object.entries(n))Array.isArray(o)&&(n[r]=o.slice(0,3));if(Hl.has(t)){let r=zn(n.recovery);r?n.recovery=r:delete n.recovery}return t!=="action_only"?ti(n):Yl(n)}function xe(e,t){let n={...e,diagnostic_output:{...t,estimated_tokens:0}};for(let r=0;r<4;r+=1){let o=ee(n),i=n.diagnostic_output;if(i.estimated_tokens===o)break;i.estimated_tokens=o}return n}function Jl(e,t,n){let r=xe(e,t);for(let i of["recovery","exit_code"])ee(r)<=n||e[i]===void 0||(delete e[i],r=xe(e,t));let o=40;for(;ee(r)>n&&o>4;)o-=4,e.code=pe(String(e.code),o),e.required=pe(String(e.required),o),r=xe(e,t);return r}function Ql(e,t){let n=e.diagnostic_output,{estimated_tokens:r,...o}=n,i=o.omitted_fields.slice(0,8).map(m=>pe(m,32)),s={...o,omitted_fields:i,...o.omitted_fields.length>i.length?{omitted_fields_overflow_count:o.omitted_fields.length-i.length}:{}},a=zn(e.recovery),c=a&&ee(a)<=48?a:void 0,d={code:pe(String(e.code),320),required:pe(String(e.required),320),...c?{recovery:c}:{},...e.exit_code!==void 0?{exit_code:e.exit_code}:{}},l=xe(d,s);for(;ee(l)>t&&s.omitted_fields.length>0;)s.omitted_fields.pop(),s.omitted_fields_overflow_count=o.omitted_fields.length-s.omitted_fields.length,l=xe(d,s);return l=Jl(d,s,t),l}function Nh(e,t={}){let n=e,r=t.diagnosticClass??"error",o=ei(r),i=t.maxEstimatedTokens;if(i!==void 0&&(!Number.isSafeInteger(i)||i<o.minimum_max_estimated_tokens))throw new RangeError(`maxEstimatedTokens must be a safe integer >= ${o.minimum_max_estimated_tokens}`);let s=i??o.default_max_estimated_tokens_by_format.json,a=ee(n),c=Object.keys(n);if(a<=s)return ti(structuredClone(n));let d;for(let[l,m]of o.degradation_ladder.entries()){let u=Xl(n,m),f=c.filter(_=>!Object.hasOwn(u,_)),p=xe(u,{diagnostic_class:r,format:"json",budget:s,budget_source:i===void 0?"default":"explicit",original_estimated_tokens:a,truncated:l>0,degradation_steps:o.degradation_ladder.slice(0,l+1),omitted_fields:f});if(d=p,ee(p)<=s)break}return ee(d)>s&&(d=Ql(d,s)),d}function Xo(e){return Il(e).replace(/\r\n/gu,`
|
|
1
|
+
import{B as kn,C as On,D as Ie,a as G,b as vn,c as so,e as Et,f as kt,g as Ot,h as ao,i as St,j as Ce,k as co,l as En,o as At,p as Ct,s as He,y,z as h}from"./chunk-46KDJH3K.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]="628615ea-5be3-5753-a6c5-3eba8400a8da")}catch{}})();function It(e,t,n){if(e===t)return 0;if(Math.abs(e.length-t.length)>n)return null;let r=t.length+1,o=new Array(r),i=new Array(r),s=new Array(r);for(let c=0;c<r;c+=1)o[c]=0,i[c]=c;for(let c=1;c<=e.length;c+=1){s[0]=c;let d=s[0];for(let l=1;l<=t.length;l+=1){let m=e[c-1]===t[l-1]?0:1,u=i[l-1]+m,f=s[l-1]+1,p=i[l]+1,_=Math.min(u,f,p);c>1&&l>1&&e[c-1]===t[l-2]&&e[c-2]===t[l-1]&&(_=Math.min(_,o[l-2]+1)),s[l]=_,_<d&&(d=_)}if(d>n)return null;for(let l=0;l<r;l+=1)o[l]=i[l],i[l]=s[l]}let a=i[t.length];return a<=n?a:null}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="c05a5a9e-282c-5ca7-97dc-e48c8df7977e")}catch{}})();var gc=["Epic","Feature","Task","Chore","Issue","Decision","Event","Reminder","Milestone","Meeting","Plan"],lo=gc,Og=["draft","open","in_progress","blocked","closed","canceled"],Sg=["draft","active","blocked","terminal","terminal_done","terminal_canceled","default_open","default_close","default_cancel"],uo=["string","number","boolean","string_array","array","object"],Ag=["create","update","update_many","list","search","calendar","context"],Cg=["allow","warn","reject"],Ig=["blocks","parent","child","parent_child","child_of","related","related_to","discovered_from","blocked_by","incident_from","epic","implements","recurs_from","supersedes","task","verifies"],Tg=["project","global"],Rg=["low","medium","high","critical"],xg=["low","medium","high","critical"],Ng=["low","medium","high"];var Dg=["minimal","default","strict","custom"],Pg=["none","warn","strict"],$g=["progressive","strict"],Mg=["off","warn","strict"],Lg=["off","warn","strict"];var jg=["daily","weekly","monthly","yearly"],yc=["mon","tue","wed","thu","fri","sat","sun"];function Fg(e){return yc.indexOf(e)}var Ug=["draft","research","review","approved","executing","paused","completed","superseded"],zg=["pending","in_progress","completed","blocked","skipped","superseded"],qg=["codex","claude-code","cursor","generic"],Bg=["related","blocks","blocked_by","depends_on","discovered_from","implements","recurs_from","verifies","supersedes"],Vg=["brief","standard","deep","full"],Gg=["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]="67511565-01f8-58a6-ad06-45b5d0ce831b")}catch{}})();var hc=new Set(["name","version","entry","priority","description","author","capabilities","manifest_version","pm_min_version","pm_max_version","engines","trusted","provenance","sandbox_profile","permissions","activation","contributions","legacy_capability_aliases"]);function bc(e){return{unknownKeys:Object.keys(e).filter(t=>!hc.has(t)).sort((t,n)=>t>n?1:-1),missingVersionBounds:e.pm_min_version===void 0&&e.pm_max_version===void 0}}function wc(e){let t=bc(e),n=t.unknownKeys.map(r=>({code:"manifest_unknown_key",path:r,...r==="compatibility"?{suggested_key:"pm_min_version"}:{},message:r==="compatibility"?'Manifest key "compatibility" is ignored; declare the canonical pm_min_version and optional pm_max_version fields instead.':`Manifest key "${r}" is not part of the extension manifest contract and will be ignored.`}));return t.missingVersionBounds&&n.push({code:"no_version_bounds_declared",path:"$",suggested_key:"pm_min_version",message:"No canonical pm version bounds are declared; add pm_min_version so compatibility intent is explicit."}),{ok:n.length===0,findings:n}}function fo(e,t,n){return wc(n).findings.map(r=>r.code==="manifest_unknown_key"?`extension_manifest_unknown_key:${e}:${t.name}:key=${r.path}${r.suggested_key?`:suggested=${r.suggested_key}`:""}`:`extension_manifest_no_version_bounds:${e}:${t.name}:suggested=pm_min_version`)}(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]="2ea7934f-4751-5245-a5ba-492681aa3794")}catch{}})();var Sn=[{kind:"blocked_by",direction:"directed",traversal:"ordering",inverse:"blocks",ordering:!0,precedence:"target_before_source",hierarchy:!1,outgoing:"many",incoming:"many",lifecycle:"persistent",aliases:["depends_on"],compatibilityVersion:1,allowSelf:!1},{kind:"blocks",direction:"directed",traversal:"ordering",inverse:"blocked_by",ordering:!0,precedence:"source_before_target",hierarchy:!1,outgoing:"many",incoming:"many",lifecycle:"persistent",compatibilityVersion:1,allowSelf:!1},{kind:"parent",direction:"directed",traversal:"hierarchy",outcomeTraversal:"source_to_target",inverse:"child",ordering:!1,hierarchy:!0,hierarchyDirection:"target_parent",outgoing:"one",incoming:"many",lifecycle:"supersedable",aliases:["child_of","epic"],compatibilityVersion:1,allowSelf:!1},{kind:"child",direction:"directed",traversal:"hierarchy",outcomeTraversal:"target_to_source",inverse:"parent",ordering:!1,hierarchy:!0,hierarchyDirection:"source_parent",outgoing:"many",incoming:"one",lifecycle:"supersedable",aliases:["parent_child","task"],compatibilityVersion:1,allowSelf:!1},{kind:"related",direction:"undirected",traversal:"association",ordering:!1,hierarchy:!1,outgoing:"many",incoming:"many",lifecycle:"persistent",aliases:["related_to"],compatibilityVersion:1,allowSelf:!1},{kind:"discovered_from",direction:"directed",traversal:"semantic",outcomeTraversal:"source_to_target",ordering:!1,hierarchy:!1,outgoing:"many",incoming:"many",lifecycle:"persistent",compatibilityVersion:1,allowSelf:!1},{kind:"incident_from",direction:"directed",traversal:"semantic",outcomeTraversal:"source_to_target",ordering:!1,hierarchy:!1,outgoing:"many",incoming:"many",lifecycle:"persistent",compatibilityVersion:1,allowSelf:!1},{kind:"implements",direction:"directed",traversal:"semantic",outcomeTraversal:"source_to_target",ordering:!1,hierarchy:!1,outgoing:"many",incoming:"many",lifecycle:"persistent",compatibilityVersion:1,allowSelf:!1},{kind:"recurs_from",direction:"directed",traversal:"semantic",outcomeTraversal:"source_to_target",ordering:!1,temporalOrder:"source_after_target",hierarchy:!1,outgoing:"many",incoming:"many",lifecycle:"persistent",compatibilityVersion:1,allowSelf:!1},{kind:"verifies",direction:"directed",traversal:"semantic",outcomeTraversal:"source_to_target",ordering:!1,hierarchy:!1,outgoing:"many",incoming:"many",lifecycle:"persistent",compatibilityVersion:1,allowSelf:!1},{kind:"supersedes",direction:"directed",traversal:"semantic",outcomeTraversal:"both",ordering:!1,hierarchy:!1,outgoing:"many",incoming:"many",lifecycle:"supersedable",compatibilityVersion:1,allowSelf:!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]="418b3f7f-6350-5878-a362-3948de287baf")}catch{}})();function xt(e){return e.trim().toLowerCase().replaceAll("-","_")}function vc(e){if(e===void 0)return;let t=xt(e);if(!/^[a-z][a-z0-9_]*$/.test(t))throw new TypeError(`Invalid inverse relationship kind: ${e}`);return t}function Cn(e,t=new Set){if(e===null||typeof e!="object"||t.has(e))return e;if(t.add(e),Array.isArray(e)){for(let n of e)Cn(n,t);return Object.freeze(e)}for(let n of Object.values(e))Cn(n,t);return Object.freeze(e)}function Ec(e,t){if(e.precedence!==void 0&&e.precedence!=="source_before_target"&&e.precedence!=="target_before_source")throw new TypeError(`Invalid relationship precedence for ${t}`);if(!e.ordering&&e.precedence!==void 0)throw new TypeError(`Non-ordering relationship kind cannot declare precedence: ${t}`)}function kc(e,t){if(e.temporalOrder!==void 0&&e.temporalOrder!=="source_after_target")throw new TypeError(`Invalid relationship temporal order for ${t}`);if(e.direction!=="directed"&&e.temporalOrder!==void 0)throw new TypeError(`Undirected relationship kind cannot declare temporal order: ${t}`)}function Oc(e,t){if(e.hierarchyDirection!==void 0&&e.hierarchyDirection!=="source_parent"&&e.hierarchyDirection!=="target_parent")throw new TypeError(`Invalid relationship hierarchy direction for ${t}`);if(!e.hierarchy&&e.hierarchyDirection!==void 0)throw new TypeError(`Non-hierarchy relationship kind cannot declare hierarchy direction: ${t}`)}function Sc(e){if(typeof e!="object"||e===null)throw new TypeError("Relationship kind definition requires an object");if(typeof e.kind!="string")throw new TypeError("Relationship kind requires a string identifier");let t=xt(e.kind);if(!/^[a-z][a-z0-9_]*$/.test(t))throw new TypeError(`Invalid relationship kind: ${e.kind}`);if(!Number.isInteger(e.compatibilityVersion)||e.compatibilityVersion<1)throw new TypeError(`Invalid compatibility version for ${t}`);return t}function Ac(e,t){if(!["directed","undirected"].includes(e.direction))throw new TypeError(`Invalid relationship direction for ${t}`);if(typeof e.ordering!="boolean")throw new TypeError(`Invalid relationship ordering flag for ${t}`);if(![void 0,!0,!1].includes(e.hierarchy))throw new TypeError(`Invalid relationship hierarchy flag for ${t}`);if(!["one","many"].includes(e.outgoing))throw new TypeError(`Invalid outgoing relationship cardinality for ${t}`);if(!["one","many"].includes(e.incoming))throw new TypeError(`Invalid incoming relationship cardinality for ${t}`);if(!["persistent","supersedable","ephemeral"].includes(e.lifecycle))throw new TypeError(`Invalid relationship lifecycle for ${t}`);if(typeof e.allowSelf!="boolean")throw new TypeError(`Invalid relationship self-edge flag for ${t}`);if(e.traversal!==void 0&&!["hierarchy","ordering","semantic","association"].includes(e.traversal))throw new TypeError(`Invalid relationship traversal family for ${t}`);if(e.outcomeTraversal!==void 0&&!["source_to_target","target_to_source","both"].includes(e.outcomeTraversal))throw new TypeError(`Invalid outcome traversal for ${t}`);if(e.direction==="undirected"&&e.outcomeTraversal!==void 0&&e.outcomeTraversal!=="both")throw new TypeError(`Undirected relationship kind cannot declare directional outcome traversal: ${t}`)}function Cc(e,t){if(e.payloadSchema!==void 0&&(typeof e.payloadSchema!="object"||e.payloadSchema===null||Array.isArray(e.payloadSchema)))throw new TypeError(`Invalid relationship payload schema for ${t}`);if(e.aliases!==void 0&&(!Array.isArray(e.aliases)||e.aliases.some(n=>typeof n!="string")))throw new TypeError(`Invalid relationship aliases for ${t}`)}function Ic(e){return e.traversal?e.traversal:e.ordering?"ordering":e.hierarchy?"hierarchy":e.direction==="undirected"?"association":"semantic"}var In=class{#e=new Map;#n=new Map;constructor(t=Sn){for(let n of t)this.register(n)}register(t){let n=Sc(t);if(Ac(t,n),Cc(t,n),Ec(t,n),kc(t,n),Oc(t,n),this.#e.has(n)||this.#n.has(n))throw new TypeError(`Relationship kind already registered: ${n}`);let r=vc(t.inverse),o=[...new Set((t.aliases??[]).map(xt))].sort();for(let s of o){if(!/^[a-z][a-z0-9_]*$/.test(s))throw new TypeError(`Invalid relationship alias: ${s}`);if(s===n||this.#e.has(s)||this.#n.has(s))throw new TypeError(`Relationship alias already registered: ${s}`)}let i=Object.freeze({...t,kind:n,traversal:Ic(t),hierarchy:t.hierarchy??!1,hierarchyDirection:t.hierarchy?t.hierarchyDirection??"source_parent":void 0,inverse:r,aliases:Object.freeze(o),payloadSchema:t.payloadSchema?Cn(structuredClone(t.payloadSchema)):void 0});this.#e.set(n,i);for(let s of o)this.#n.set(s,n);return this}resolve(t){if(typeof t!="string")return;let n=xt(t);return this.#e.get(this.#n.get(n)??n)}require(t){let n=this.resolve(t);if(!n)throw new TypeError(`Unknown relationship kind: ${t}`);return n}list(){return Object.freeze([...this.#e.values()].sort((t,n)=>t.kind.localeCompare(n.kind)))}};function Tn(){return new In}var ue=Tn();function Jg(e){return ue.require(e).kind}function Qg(e){return ue.resolve(e)?.kind}function Zg(e,t=ue){return t.resolve(e)?.ordering===!0}function Tc(e,t,n,r=ue){let o=Ye(e),i=Ye(t);if(!o||!i)throw new TypeError("Relationship endpoint must not be empty");let s=r.require(n);if(o===i&&!s.allowSelf)throw new TypeError(`Self relationship is not allowed for ${s.kind}`);return s}function Tt(e,t){return e.source.localeCompare(t.source)||e.target.localeCompare(t.target)||e.kind.localeCompare(t.kind)}function Rc(e,t,n){let r=typeof e.source=="string"?e.source.trim():"",o=typeof e.target=="string"?e.target.trim():"";if(!t.has(r)||!t.has(o))throw new TypeError(`Relationship endpoint not found: ${r} -> ${o}`);let i=Tc(r,o,e.kind,n),s=Object.freeze({...e,source:r,target:o,kind:i.kind}),a=i.direction==="undirected"?[r,o].sort().join("\0"):`${r}\0${o}`;return{edge:s,identity:`${i.kind}\0${a}`}}function Rt(e,t,n){let r=e.get(t);r?r.push(n):e.set(t,[n])}function Ye(e){return typeof e=="string"?e.trim():""}function An(e,t){let n=Ye(e);return n&&t.has(n)?n:void 0}function xc(e,t,n){let r=[t],o=t;for(;o!==e;)o=n.get(o),r.push(o);return r.reverse()}var mo=class e{#e;#n;#o;#r;#s=new Map;#a=new Map;constructor(t,n,r=ue){this.#e=r,this.#n=new Set([...t].filter(i=>typeof i=="string").map(i=>i.trim()).filter(Boolean)),this.#o=Object.freeze([...this.#n].sort());let o=new Map;for(let i of n){let{edge:s,identity:a}=Rc(i,this.#n,r);o.set(a,s)}this.#r=Object.freeze([...o.values()].sort(Tt));for(let i of this.#r)Rt(this.#s,i.source,i),Rt(this.#a,i.target,i),r.require(i.kind).direction==="undirected"&&(Rt(this.#s,i.target,i),Rt(this.#a,i.source,i))}static fromItems(t,n=ue){let r=new Set(t.map(i=>Ye(i.id)).filter(Boolean)),o=[];for(let i of t){let s=Ye(i.id);if(!s)continue;let a=An(i.parent,r);a&&o.push({source:s,target:a,kind:"parent"});let c=An(i.blocked_by,r);c&&o.push({source:s,target:c,kind:"blocked_by"});for(let d of i.dependencies??[]){let l=An(d.id,r);l&&n.resolve(d.kind)&&o.push({source:s,target:l,kind:d.kind,createdAt:d.created_at,author:d.author})}}return new e(r,o,n)}edges(){return this.#r}incidentEdges(t){this.#i(t);let n=this.#s.get(t)??[],r=this.#a.get(t)??[];if(n.length===0)return Object.freeze([...r]);if(r.length===0)return Object.freeze([...n]);let o=[],i=0,s=0;for(;i<n.length||s<r.length;){let a=n[i],c=r[s],d=a===void 0?c:c===void 0||Tt(a,c)<=0?a:c;o.at(-1)!==d&&o.push(d),a===d&&(i+=1),c===d&&(s+=1)}return Object.freeze(o)}nodes(){return this.#o}hasNode(t){return this.#n.has(t)}registry(){return this.#e}#i(t){if(!this.#n.has(t))throw new TypeError(`Relationship node not found: ${t}`)}#c(t,n){if(!n)return!0;let r=this.#e.require(t.kind);return n.has(t.kind)||r.inverse!==void 0&&n.has(r.inverse)}#t(t,n,r){let o=[...n==="incoming"?[]:this.#s.get(t)??[],...n==="outgoing"?[]:this.#a.get(t)??[]];return[...new Set(o)].filter(i=>this.#c(i,r)).map(i=>({id:i.source===t?i.target:i.source,edge:i})).sort((i,s)=>i.id.localeCompare(s.id)||Tt(i.edge,s.edge))}adjacency(t,n={}){this.#i(t),n.signal?.throwIfAborted();let r=n.kinds?new Set(n.kinds.map(c=>this.#e.require(c).kind)):void 0,o=this.#t(t,n.direction??"outgoing",r),i=n.limit??Number.POSITIVE_INFINITY,s=[...new Set(o.map(c=>c.id))],a=s.slice(0,i);return{value:a,meta:{visitedNodes:1,inspectedEdges:o.length,truncated:a.length<s.length,nextCursor:a.at(-1)}}}neighborEdges(t,n={}){this.#i(t),n.signal?.throwIfAborted();let r=n.kinds?new Set(n.kinds.map(a=>this.#e.require(a).kind)):void 0,o=this.#t(t,n.direction??"outgoing",r),i=n.limit??Number.POSITIVE_INFINITY,s=o.slice(0,i);return{value:s,meta:{visitedNodes:1,inspectedEdges:o.length,truncated:s.length<o.length,nextCursor:s.at(-1)?.id}}}closure(t,n={}){this.#i(t);let r=n.kinds?new Set(n.kinds.map(f=>this.#e.require(f).kind)):void 0,o=n.direction??"outgoing",i=n.limit??Number.POSITIVE_INFINITY,s=n.maxDepth??Number.POSITIVE_INFINITY,a=new Set([t]),c=[],d=[{id:t,depth:0}],l=0,m=0,u=!1;e:for(let f=0;f<d.length;f+=1){n.signal?.throwIfAborted();let p=d[f];l+=1;let _=this.#t(p.id,o,r);if(m+=_.length,p.depth>=s){_.some(g=>!a.has(g.id))&&(u=!0);continue}for(let g of _)if(!a.has(g.id)){if(c.length>=i){u=!0;break e}a.add(g.id),c.push(g.id),d.push({id:g.id,depth:p.depth+1})}}return{value:c,meta:{visitedNodes:l,inspectedEdges:m,truncated:u,nextCursor:c.at(-1)}}}shortestPath(t,n,r={}){if(this.#i(t),this.#i(n),t===n)return{value:[t],meta:{visitedNodes:1,inspectedEdges:0,truncated:!1}};let o=r.kinds?new Set(r.kinds.map(f=>this.#e.require(f).kind)):void 0,i=r.direction??"outgoing",s=r.maxDepth??Number.POSITIVE_INFINITY,a=[{id:t,depth:0}],c=new Map,d=new Set([t]),l=0,m=0,u=!1;for(let f=0;f<a.length;f+=1){r.signal?.throwIfAborted();let p=a[f];l+=1;let _=this.#t(p.id,i,o);if(m+=_.length,p.depth>=s){_.some(g=>!d.has(g.id))&&(u=!0);continue}for(let g of _)if(!d.has(g.id)){if(c.set(g.id,p.id),g.id===n)return{value:xc(t,n,c),meta:{visitedNodes:l,inspectedEdges:m,truncated:!1}};d.add(g.id),a.push({id:g.id,depth:p.depth+1})}}return{value:[],meta:{visitedNodes:l,inspectedEdges:m,truncated:u}}}subgraph(t,n={}){let r=this.closure(t,n),o=[t,...r.value].sort(),i=new Set(o),s=n.kinds?new Set(n.kinds.map(c=>this.#e.require(c).kind)):void 0,a=new Set;for(let c of o)for(let d of this.#s.get(c)??[])i.has(d.source)&&i.has(d.target)&&this.#c(d,s)&&a.add(d);return{value:{nodes:o,edges:[...a].sort(Tt)},meta:r.meta}}};function ey(e,t,n=ue){return{source:e,target:t.id,kind:n.require(t.kind).kind,createdAt:t.created_at,author:t.author}}import{readFileSync as yd,readdirSync as _y,realpathSync as Oo,statSync as Ao}from"node:fs";import hd from"node:os";import v from"node:path";import Mc from"node:path";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="0ca7f52c-fb31-5cd9-b689-a918f4e61816")}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]="75f74db3-9547-5c78-8561-f371c016b90d")}catch{}})();function J(e){return[...new Set((e??[]).map(t=>t.trim()).filter(t=>t.length>0))].sort((t,n)=>t.localeCompare(n))}function Nc(e){let t=e.key.trim();if(t.length===0)return null;let n=J(e.aliases),r=e.description?.trim();return{key:t,values:J(e.values),required:e.required===!0?!0:void 0,aliases:n.length>0?n:void 0,description:r&&r.length>0?r:void 0}}var Dc=e=>e,_o=e=>{let t=e.trim().toLowerCase();return t==="create"||t==="update"?t:null};function Pc(e,t){let n=t(e.command);if(n===null)return null;let r=e.option.trim();return r.length===0?null:{command:n,option:r,required:e.required,visible:e.visible,enabled:e.enabled}}function $c(e,t){let n=new Map;for(let r of e??[]){let o=Pc(r,t);o&&n.set(`${o.command}:${o.option.toLowerCase()}`,o)}return[...n.values()].sort((r,o)=>r.command===o.command?r.option.localeCompare(o.option):r.command.localeCompare(o.command))}function po(e,t){return t?J(e):void 0}function Rn(e){let t=e?.trim();return t&&t.length>0?t:void 0}function xn(e){if(e===void 0||e==="agent"||e==="human"||e==="gate")return e;throw new Error("Item type execution_role must be agent, human, or gate.")}function go(e,t={}){let n=t.resolvePolicyCommand??Dc,r=e.name.trim();if(r.length===0)return null;let o=e.required_create_fields!==void 0,i=e.required_create_repeatables!==void 0,s=e.options!==void 0,a=e.command_option_policies!==void 0,c=J(e.aliases),d=(e.options??[]).map(m=>Nc(m)).filter(m=>m!==null).sort((m,u)=>m.key.localeCompare(u.key)),l=$c(e.command_option_policies,n);return{name:r,description:Rn(e.description),default_status:Rn(e.default_status),...e.execution_role===void 0?{}:{execution_role:xn(e.execution_role)},folder:Rn(e.folder),aliases:c.length>0?c:void 0,required_create_fields:po(e.required_create_fields,o),required_create_repeatables:po(e.required_create_repeatables,i),options:s?d:void 0,command_option_policies:a?l: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]="f40ddc8e-1dd5-5f26-b2ba-fbbac30a1781")}catch{}})();var Lc=Object.freeze({decision:"human",milestone:"gate"}),jc=["title","description","status","priority","tags","body","deadline","estimatedMinutes","acceptanceCriteria","author","message","assignee"],Fc=["dep","comment","note","learning","file","test","doc"],ho=["deadline","estimatedMinutes","acceptanceCriteria","definitionOfReady","order","goal","objective","value","impact","outcome","whyNow","assignee","parent","reviewer","risk","confidence","sprint","release","blockedBy","blockedReason","unblockNote","reporter","severity","environment","reproSteps","resolution","expectedResult","actualResult","affectedVersion","fixedVersion","component","regression","customerImpact"],Uc=["title","description","type","status","priority","tags","body",...ho,"author","message","dep","comment","note","learning","file","test","doc","reminder","event","typeOption","field"],zc=["title","description","body","status","closeReason","priority","type","tags",...ho,"author","message","comment","note","learning","file","test","doc","reminder","event","typeOption","field","ownershipMetadataBypass","ownershipDependencyBypass","force"],bo={"close-reason":"closeReason",close_reason:"closeReason","estimated-minutes":"estimatedMinutes",estimated_minutes:"estimatedMinutes",estimate:"estimatedMinutes","acceptance-criteria":"acceptanceCriteria",acceptance_criteria:"acceptanceCriteria",ac:"acceptanceCriteria","definition-of-ready":"definitionOfReady",definition_of_ready:"definitionOfReady",rank:"order","why-now":"whyNow",why_now:"whyNow","blocked-by":"blockedBy",blocked_by:"blockedBy","blocked-reason":"blockedReason",blocked_reason:"blockedReason","unblock-note":"unblockNote",unblock_note:"unblockNote","repro-steps":"reproSteps",repro_steps:"reproSteps","expected-result":"expectedResult",expected_result:"expectedResult","actual-result":"actualResult",actual_result:"actualResult","affected-version":"affectedVersion",affected_version:"affectedVersion","fixed-version":"fixedVersion",fixed_version:"fixedVersion","customer-impact":"customerImpact",customer_impact:"customerImpact","type-option":"typeOption",type_option:"typeOption",type_options:"typeOption"},qc={...bo},Bc={...bo},wo=[["deadline","--deadline"],["estimatedMinutes","--estimate/--estimated-minutes"],["acceptanceCriteria","--acceptance-criteria/--ac"],["definitionOfReady","--definition-of-ready"],["order","--order/--rank"],["goal","--goal"],["objective","--objective"],["value","--value"],["impact","--impact"],["outcome","--outcome"],["whyNow","--why-now"],["assignee","--assignee"],["parent","--parent"],["reviewer","--reviewer"],["risk","--risk"],["confidence","--confidence"],["sprint","--sprint"],["release","--release"],["blockedBy","--blocked-by"],["blockedReason","--blocked-reason"],["unblockNote","--unblock-note"],["reporter","--reporter"],["severity","--severity"],["environment","--environment"],["reproSteps","--repro-steps"],["resolution","--resolution"],["expectedResult","--expected-result"],["actualResult","--actual-result"],["affectedVersion","--affected-version"],["fixedVersion","--fixed-version"],["component","--component"],["regression","--regression"],["customerImpact","--customer-impact"]],vo=[["comment","--comment"],["note","--note"],["learning","--learning"],["file","--file"],["test","--test"],["doc","--doc"],["reminder","--reminder"],["event","--event"],["typeOption","--type-option"]];function Eo(e){return Object.fromEntries(e)}var Vc=Eo([["title","--title"],["description","--description"],["type","--type"],["status","--status"],["priority","--priority"],["tags","--tags"],["body","--body"],...wo,["author","--author"],["message","--message"],["dep","--dep"],...vo]),Gc=Eo([["title","--title"],["description","--description"],["body","--body"],["status","--status"],["closeReason","--close-reason"],["priority","--priority"],["type","--type"],["tags","--tags"],...wo,...vo,["author","--author"],["message","--message"],["force","--force"]]);function Wc(e){return e.trim().replace(/^--+/,"").toLowerCase()}function Kc(e){return e==="create"?Uc:zc}function Hc(e){return e==="create"?qc:Bc}function ko(e,t){let n=Wc(t);return n.length===0?void 0:Hc(e)[n]||Kc(e).find(r=>r.toLowerCase()===n)}function dy(e,t){return(e==="create"?Vc:Gc)[t]??`--${t.replace(/([A-Z])/g,"-$1").toLowerCase()}`}function Dn(e){let t=Xc(e);return t.length===0?"items":t.endsWith("s")?t:`${t}s`}function Yc(e){let t=e.trim(),n=t.replaceAll("\\","/").replace(/^\/+/,""),r=Mc.posix.normalize(n);if(t.includes("\0")||/^[A-Za-z]:/.test(r)||r==="."||r===".."||r.startsWith("../"))throw new Error(`Item type folder "${e}" must stay inside the pm tracker root.`);return r}function Xc(e){let t=e.trim().toLowerCase(),n="",r=!1;for(let o of t){let i=o.charCodeAt(0),s=i>=97&&i<=122,a=i>=48&&i<=57;if(s||a){r&&n.length>0&&(n+="-"),n+=o,r=!1;continue}n.length>0&&(r=!0)}return n}function Jc(e){return go(e,{resolvePolicyCommand:_o})}function Xe(e,t){let n=e[t];return Array.isArray(n)?n.filter(r=>typeof r=="string"):void 0}function Qc(e){if(typeof e!="object"||e===null||Array.isArray(e))return null;let t=e;return typeof t.key!="string"?null:{key:t.key,values:Xe(t,"values")??[],required:t.required===void 0?void 0:!!t.required,aliases:Xe(t,"aliases"),description:typeof t.description=="string"?t.description:void 0}}function Zc(e){if(typeof e!="object"||e===null||Array.isArray(e))return null;let t=e;if(typeof t.command!="string"||typeof t.option!="string")return null;let n=t.command.trim().toLowerCase();return n!=="create"&&n!=="update"?null:{command:n,option:t.option,required:t.required===void 0?void 0:!!t.required,visible:t.visible===void 0?void 0:!!t.visible,enabled:t.enabled===void 0?void 0:!!t.enabled}}function ed(e){if(Array.isArray(e.options))return e.options.map(t=>Qc(t)).filter(t=>t!==null)}function td(e){if(Array.isArray(e.command_option_policies))return e.command_option_policies.map(t=>Zc(t)).filter(t=>t!==null)}function nd(e){if(typeof e!="object"||e===null||Array.isArray(e))return null;let t=e,n=typeof t.name=="string"?t.name:"";if(n.trim().length===0)return null;let r=typeof t.folder=="string"?t.folder:void 0,o=typeof t.description=="string"?t.description:void 0,i=typeof t.default_status=="string"?t.default_status:void 0;return{name:n,description:o,default_status:i,execution_role:xn(t.execution_role),folder:r,aliases:Xe(t,"aliases"),required_create_fields:Xe(t,"required_create_fields"),required_create_repeatables:Xe(t,"required_create_repeatables"),options:ed(t),command_option_policies:td(t)}}function rd(e,t){return e.required_create_fields?J(e.required_create_fields):t?.required_create_fields??[]}function od(e,t){return e.required_create_repeatables?J(e.required_create_repeatables):t?.required_create_repeatables??[]}function id(e,t){return e.options?e.options:t?.options?[...t.options]:[]}function sd(e,t){return e.command_option_policies?e.command_option_policies:t?.command_option_policies?[...t.command_option_policies]:[]}function ad(e,t){let n=t?.name??e.name,r=e.description??t?.description,o=e.default_status??t?.default_status,i=Yc(e.folder??t?.folder??Dn(n)),s={name:n,execution_role:e.execution_role,folder:i,aliases:J([...t?.aliases??[],...e.aliases??[]]),required_create_fields:rd(e,t),required_create_repeatables:od(e,t),options:id(e,t),command_option_policies:sd(e,t)};return r&&(s.description=r),o&&(s.default_status=o),s}function yo(e,t){for(let n of e){let r=Jc(n);if(!r)continue;let o=r.name.toLowerCase(),i=t.get(o);t.set(o,ad({...r,execution_role:r.execution_role??i?.execution_role},i))}}function cd(e){if(!e)return[];let t=[];for(let n of e.item_types??[]){let r=n.types;if(Array.isArray(r))for(let o of r){let i=nd(o);i&&t.push(i)}}return t}function ly(e,t=null){let n=new Map;for(let c of lo)n.set(c.toLowerCase(),{name:c,execution_role:Lc[c.toLowerCase()]??"agent",folder:He[c],aliases:[],required_create_fields:[...jc],required_create_repeatables:[...Fc],options:[],command_option_policies:[]});yo(e.item_types?.definitions??[],n),yo(cd(t),n);let r=[...n.values()].sort((c,d)=>c.name.localeCompare(d.name)),o={},i={},s={};for(let c of r){o[c.name]=c,s[c.name]=c.folder,i[c.name.toLowerCase()]=c.name;for(let d of c.aliases)i[d.toLowerCase()]=c.name}let a=[...new Set(r.map(c=>c.folder))].sort((c,d)=>c.localeCompare(d));return{types:r.map(c=>c.name),folders:a,type_to_folder:s,by_type:o,alias_to_type:i}}function dd(e,t){if(e!==void 0)return t.alias_to_type[e.trim().toLowerCase()]}function ld(e,t){let n=dd(e,t);if(n)return t.by_type[n]}function ud(e,t,n,r){for(let o of r){let i=ko(n,o);if(i){e.required.add(i);continue}e.errors.push(`Unsupported base required option "${o}" for command "${n}" on type "${t.name}"`)}}function Nn(e,t,n){if(n){e.add(t);return}e.delete(t)}function fd(e,t,n,r){let o=ko(n,r.option);if(!o){e.errors.push(`Unsupported command_option_policies option "${r.option}" for command "${n}" on type "${t.name}"`);return}r.required!==void 0&&Nn(e.required,o,r.required),r.visible!==void 0&&Nn(e.hidden,o,!r.visible),r.enabled!==void 0&&Nn(e.disabled,o,!r.enabled)}function md(e,t,n){for(let r of t.command_option_policies)r.command===n&&fd(e,t,n,r)}function pd(e,t,n){for(let r of e.required)e.disabled.has(r)&&e.errors.push(`Option "${r}" cannot be both required and disabled for command "${n}" on type "${t.name}"`)}function uy(e,t,n){let r=[],o=new Set,i=new Set,s=new Set,a={required:o,hidden:i,disabled:s,errors:r};return ud(a,e,t,n),md(a,e,t),pd(a,e,t),{required:[...o],hidden:[...i].sort((c,d)=>c.localeCompare(d)),disabled:[...s].sort((c,d)=>c.localeCompare(d)),errors:r}}function _d(e){let t=new Map;for(let n of e.options){t.set(n.key.toLowerCase(),n);for(let r of n.aliases??[])t.set(r.toLowerCase(),n)}return t}function gd(e,t,n){let r=e.values;if(r.length===0)return t;let o=new Map(r.map(i=>[i.toLowerCase(),i])).get(t.toLowerCase());if(!o){n.push(`Invalid value "${t}" for type option "${e.key}". Allowed: ${r.join(", ")}`);return}return o}function fy(e,t,n){let r=ld(e,n);if(!r)return{normalized:void 0,errors:[`Unknown type "${e}"`]};let o=[],i=_d(r),s={};for(let[c,d]of Object.entries(t??{})){let l=c.trim(),m=d.trim();if(l.length===0){o.push("type option keys must not be empty");continue}if(m.length===0){o.push(`type option "${l}" must not be empty`);continue}let u=i.get(l.toLowerCase());if(!u){let p=r.options.map(_=>_.key).join(", ");o.push(r.options.length>0?`Unknown type option "${l}" for type "${r.name}". Allowed: ${p}`:`Type "${r.name}" does not define any configurable type options`);continue}let f=gd(u,m,o);f!==void 0&&(s[u.key]=f)}for(let c of r.options)c.required&&!(c.key in s)&&o.push(`Missing required type option "${c.key}" for type "${r.name}"`);let a=Object.keys(s).sort((c,d)=>c.localeCompare(d));return a.length===0?{normalized:void 0,errors:o}:{normalized:Object.fromEntries(a.map(c=>[c,s[c]])),errors: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]="7f4b8abe-997c-549c-9791-87c78506c8b5")}catch{}})();var bd={json_markdown:".md",toon:".toon"},wd={".md":"json_markdown",".toon":"toon"};var Ey=[".md",".toon"];function Nt(e){try{return Ao(e),!0}catch{return!1}}function vd(e){let t=v.resolve(e),n=[];for(;v.dirname(t)!==t;)try{return v.join(Oo(t),...n)}catch(r){if(!On(r))throw r;n.unshift(v.basename(t)),t=v.dirname(t)}return v.join(Oo(t),...n)}function Ed(e){try{return Ao(e),!0}catch(t){if(On(t))return!1;throw t}}function kd(e){try{let t=JSON.parse(yd(e,"utf8"));return typeof t!="object"||t===null||Array.isArray(t)?!1:"id_prefix"in t||"item_format"in t}catch{return!1}}function Od(e){let t=vd(e);for(;;){let n=v.join(t,At),r=v.join(n,Ct);if(Nt(r))return n;let o=v.join(t,Ct);if(Nt(o)&&kd(o))return t;if(Ed(v.join(t,".git")))return n;let i=v.dirname(t);if(i===t)return;t=i}}function Sd(e){return Od(e)??v.resolve(e,At)}function ky(e,t){let n=process.env.PM_PATH,r=t?.trim()||n?.trim();if(r){let o=v.resolve(e,r);if(!Nt(So(o))){let i=v.join(o,At);if(Nt(So(i)))return i}return o}return Sd(e)}function Oy(e){let t=v.resolve(e),n=v.dirname(t);return v.basename(t)==="pm"&&v.basename(n)===".agents"?v.dirname(n):t}function Co(e){let t=process.env.PM_GLOBAL_PATH?.trim(),n=t&&t.length>0?t:v.join(hd.homedir(),".pm-cli");return v.resolve(e,n)}function So(e){return v.join(e,Ct)}function Ad(e,t,n=He){let r=n[t]??Dn(t);return v.join(e,r)}function Sy(e,t,n,r="toon",o=He){return v.join(Ad(e,t,o),`${n}${bd[r]}`)}function Ay(e){let t=e.replaceAll("\\","/"),n=v.posix.extname(t).toLowerCase();return wd[n]??null}function Cy(e,t){if(!/^(?!\.{1,2}$)[^/\\:\0]+$/.test(t))throw new h("Invalid history item id: expected a single filename.",y.USAGE);return v.join(e,"history",`${t}.jsonl`)}function Pn(e,t){return v.join(e,"locks",`${t}.lock`)}function Iy(e){return v.join(e,"runtime")}import{createHash as Ro}from"node:crypto";import Cd 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]="77f9d61e-e78b-5b6a-a769-1ad6e5b91777")}catch{}})();function Id(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 Td(e){let t=Object.keys(e).sort(),n={};for(let r of t){let o=e[r];o!==void 0&&(n[r]=Dt(o))}return n}function Dt(e){let t=Id(e);if(t!==void 0)return t;if(Array.isArray(e))return e.map(r=>Dt(r));if(e instanceof Date)return e.toISOString();let n=e;if(typeof n.toJSON=="function"){let r=n.toJSON();if(r!==e)return Dt(r)}return Td(e)}function fe(e){return JSON.stringify(Dt(e))}function Io(e,t,n,r){for(let o=0;o<t.length;o+=1)if(!n.has(o)&&r(e,t[o]))return n.add(o),!0;return!1}function Rd(e,t){if(e instanceof RegExp||t instanceof RegExp)return e instanceof RegExp&&t instanceof RegExp&&e.toString()===t.toString()}function xd(e,t){if(e instanceof Date||t instanceof Date)return e instanceof Date&&t instanceof Date&&e.getTime()===t.getTime()}function Nd(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],r=new Set;for(let o of e)if(!Io(o,n,r,B))return!1;return!0}function Dd(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()],r=new Set;for(let[o,i]of e.entries())if(!Io([o,i],n,r,([s,a],[c,d])=>B(s,c)&&B(a,d)))return!1;return!0}function Pd(e,t){if(Array.isArray(e)||Array.isArray(t))return!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length?!1:e.every((n,r)=>B(n,t[r]))}function $d(e,t){let n=Object.keys(e).sort((o,i)=>o.localeCompare(i)),r=Object.keys(t).sort((o,i)=>o.localeCompare(i));if(n.length!==r.length)return!1;for(let o=0;o<n.length;o+=1){let i=n[o];if(i!==r[o]||!B(e[i],t[i]))return!1}return!0}var Md=[Rd,xd,Nd,Dd,Pd];function B(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 Md){let r=n(e,t);if(r!==void 0)return r}return $d(e,t)}function xy(e){return Cd.createHash("sha256").update(e,"utf8").digest("hex")}function Ny(e,t){let n={};for(let o of t){let i=e[o];i!==void 0&&(n[o]=i)}let r=Object.keys(e).filter(o=>!t.includes(o)).sort((o,i)=>o.localeCompare(i));for(let o of r){let i=e[o];i!==void 0&&(n[o]=i)}return 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]="f675993f-c483-5751-baed-d968b4fd24c0")}catch{}})();var Ld=["policies","policy-put","policy-remove","policy-mode","policy-check","policy-approve","policy-presets"],To=256,$n=64;function U(e){throw new h(`Invalid workflow policy: ${e}`,y.USAGE,{code:"workflow_policy_invalid",nextSteps:["Inspect pm schema policies and correct the declaration using pm schema policy-put."]})}function W(e,t,n){if(typeof e!="object"||e===null||Array.isArray(e))return U(`${n} must be an object`);let r=e;return Object.keys(r).some(o=>!t.includes(o))?U(`${n} contains an unknown key`):r}function me(e,t,n=128){return typeof e!="string"||!e.trim()||e.length>n?U(`${t} must be nonempty text of at most ${n} characters`):e.trim()}function Je(e,t){if(!Array.isArray(e)||e.length===0||e.length>$n)return U(`${t} requires 1-${$n} terms`);let n=e.map(r=>me(r,t));return t==="fields"&&n.some(r=>!/^[a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*){0,7}$/.test(r)||r.split(".").some(o=>["__proto__","constructor","prototype"].includes(o)))?U("fields must be safe metadata paths of at most eight segments"):[...new Set(n)]}function jd(e){let t=W(e,["kind","fields","authors","allowed"],"rule");return t.kind==="transition"?(W(t,["kind","allowed"],"transition rule"),!Array.isArray(t.allowed)||t.allowed.length>$n?U("transition.allowed must be a bounded array"):{kind:"transition",allowed:t.allowed.map(n=>!Array.isArray(n)||n.length!==2?U("transition pairs need two statuses"):[me(n[0],"from"),me(n[1],"to")])}):t.kind==="authors"?(W(t,["kind","authors"],"authors rule"),{kind:"authors",authors:Je(t.authors,"authors")}):t.kind==="require_fields"?(W(t,["kind","fields"],"require_fields rule"),{kind:"require_fields",fields:Je(t.fields,"fields")}):t.kind==="field_writers"||t.kind==="approval"?(W(t,["kind","fields","authors"],"field rule"),{kind:t.kind,fields:Je(t.fields,"fields"),authors:Je(t.authors,"authors")}):U("unknown rule kind")}function Fd(e){let t={},n=W(e,["types","tags","statuses","operations","parents","dependency"],"subject");for(let r of["types","tags","statuses","operations","parents"])n[r]!==void 0&&(t[r]=Je(n[r],r));if(n.dependency!==void 0){let r=W(n.dependency,["kind","id"],"dependency");t.dependency={kind:me(r.kind,"dependency kind"),...r.id===void 0?{}:{id:me(r.id,"dependency id")}}}return t}function Ud(e){let t=W(e,["id","description","subject","effect","rule"],"policy"),n=me(t.id,"id");return/^[a-zA-Z0-9][a-zA-Z0-9._-]*$/.test(n)?t.effect!==void 0&&(typeof t.effect!="string"||!["advise","warn","refuse"].includes(t.effect))?U("effect must be advise, warn, or refuse"):{id:n,rule:jd(t.rule),...t.subject===void 0?{}:{subject:Fd(t.subject)},...t.description===void 0?{}:{description:me(t.description,"description",500)},...t.effect===void 0?{}:{effect:t.effect}}:U("id must be a stable token")}function zd(e){let t=W(e,["version","enforcement","policies"],"document");if(t.version!==1)return U("unsupported version");if(t.enforcement!==void 0&&t.enforcement!=="advise"&&t.enforcement!=="refuse")return U("enforcement must be advise or refuse");if(!Array.isArray(t.policies)||t.policies.length>To)return U(`policies must contain at most ${To} declarations`);let n=t.policies.map(Ud);return new Set(n.map(r=>r.id)).size!==n.length?U("duplicate policy id"):{version:1,enforcement:t.enforcement??"advise",policies:n}}function Pt(e,t){let n=e;for(let r of t.split(".")){if(typeof n!="object"||n===null||!Object.hasOwn(n,r))return;n=n[r]}return n}function qd(e){return e==null?!1:typeof e=="string"?e.trim().length>0:typeof e=="number"?Number.isFinite(e):Array.isArray(e)?e.length>0:typeof e=="object"?Object.keys(e).length>0:!0}function xo(e){return Ro("sha256").update(fe(e)).digest("hex")}function Bd(e,t){let n=e.rule.kind==="approval"?e.rule.fields:[];return Ro("sha256").update(fe({id:t.id,fields:n.map(r=>[r,Pt(t,r)])})).digest("hex")}function Vd(e,t){return Array.isArray(t)&&t.some(n=>typeof n=="object"&&n!==null&&"kind"in n&&n.kind===e.kind&&(e.id===void 0||"id"in n&&n.id===e.id))}function Gd(e,t,n){return!(e.types&&!e.types.some(r=>r.toLowerCase()===String(t.type).toLowerCase())||e.statuses&&!e.statuses.includes(String(t.status))||e.operations&&!e.operations.includes(n)||e.parents&&!e.parents.includes(String(t.parent))||e.tags&&(!Array.isArray(t.tags)||!e.tags.some(r=>t.tags.includes(r)))||e.dependency&&!Vd(e.dependency,t.dependencies))}function Wd(e,t){if(t.completeness_only&&(e.rule.kind!=="require_fields"||e.subject?.operations!==void 0)||e.rule.kind==="approval"&&t.before===null)return!1;let n=e.subject??{},r=t.after?.status??t.before?.status;return[t.before,t.after].some(o=>o!==null&&Gd(n,{...o,status:r},t.operation))}function Kd(e,t,n,r){let o=["type","tags","parent","dependencies"].some(i=>!B(t.before?.[i],t.after?.[i]));return t.after&&(t.completeness_only||n||r||o)?e.filter(i=>!qd(Pt(t.after,i))):[]}function Hd(e,t,n,r){let o=t.after??t.before,i=Bd(e,o);return t.approvals?.some(s=>s.policy_fingerprint===r&&s.content_fingerprint===i&&s.author!==t.author&&n.includes(s.author))??!1}function Yd(e,t,n){let r=e.rule,o=t.before?.status!==t.after?.status,i="fields"in r&&r.fields.some(s=>!B(Pt(t.before,s),Pt(t.after,s)));switch(r.kind){case"require_fields":{let s=Kd(r.fields,t,o,i);return{satisfied:s.length===0,missing_fields:s,remediation:"Supply the declared required fields before this lifecycle transition."}}case"transition":return{satisfied:!o||r.allowed.some(([s,a])=>s===String(t.before?.status??"$create")&&a===String(t.after?.status??"$delete")),missing_fields:[],remediation:"Choose a declared allowed transition; inspect pm schema policies."};case"authors":return{satisfied:r.authors.includes(t.author),missing_fields:[],remediation:"Have a declared workflow actor perform this operation."};case"field_writers":return{satisfied:!i||r.authors.includes(t.author),missing_fields:[],remediation:"Have a declared field writer change the protected fields."};case"approval":return{satisfied:!o||Hd(e,t,r.authors,n),missing_fields:[],remediation:`Record an independent approval with pm schema policy-approve <item-id> --policy ${e.id} after preparing the reviewed fields.`}}}function No(e,t,n){let r=e.policies.filter(o=>Wd(o,t)).map(o=>{let i=o.effect??"advise",s=n(o);return{policy_id:o.id,policy_fingerprint:s,rule:o.rule.kind,effect:i==="refuse"&&e.enforcement!=="refuse"?"warn":i,...Yd(o,t,s)}});return{allowed:!r.some(o=>!o.satisfied&&o.effect==="refuse"),decisions:r,warnings:r.filter(o=>!o.satisfied).map(o=>`workflow_policy:${o.effect}:${o.policy_id}:${o.rule}`)}}function jy(e,t){return No(e,t,xo)}function Fy(e){let t=zd(e),n=new Map(t.policies.map(r=>[r,xo(r)]));return r=>No(t,r,o=>n.get(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]="451b262c-a9b6-5f1c-b397-2686a5fd953a")}catch{}})();var Xd=[["history-redact","history redact"],["history-repair","history repair"],["history-compact","history compact"],["activity","history activity"],["restore","history restore"]].map(([e,t])=>({alias:e,canonical:t,canonical_argv:t.split(" "),lifecycle:"permanent",hidden:!0,registration:"commander",owner:"pm-tqel"})),Jd=[...["next","focus"].map(e=>({alias:e,canonical:`context ${e}`,owner:"pm-kcs4"})),...["stats","health","validate","gc","telemetry","eval","test-all"].map(e=>({alias:e,canonical:`ops ${e}`,owner:"pm-6apl"})),...["normalize","reindex"].map(e=>({alias:e,canonical:`ops ${e}`,owner:"pm-3i9q8g"})),{alias:"events",canonical:"history events",owner:"pm-3i9q8g"}].map(e=>({...e,canonical_argv:e.canonical.split(" "),lifecycle:"permanent",hidden:!0,registration:"bootstrap"})),Qd=[["update-many","update many"],["close-many","close many"],["delete","close delete"]].map(([e,t])=>({alias:e,canonical:t,canonical_argv:t.split(" "),lifecycle:"permanent",hidden:!0,registration:"bootstrap",owner:"pm-ik19"})),Zd=[...Jd,...Qd,...["init","config","schema","profile"].map(e=>({alias:e,canonical:`workspace ${e}`,canonical_argv:["workspace",e],lifecycle:"permanent",hidden:!0,registration:"bootstrap",owner:"pm-npr3"})),...[...["comments","notes","learnings","files","docs","deps","append","test"].map(e=>[e,`item ${e}`,"pm-yql1"]),["test-runs-worker","item test worker","pm-lp4j"],...["statuses","tags","types"].map(e=>[`completion-${e}`,`completion ${e}`,"pm-szdc"]),["history-author-acknowledge","history acknowledge","pm-djyvbk"],["copy","item copy","pm-m6g87m"],["merge","workspace merge","pm-m6g87m"],["duplicates","item duplicates","pm-fmy9ih"],["dedupe-audit","item duplicates audit","pm-fmy9ih"],["dedupe-merge","item duplicates merge","pm-fmy9ih"],["comments-audit","item audit-comments","pm-fmy9ih"],["search-advanced","search advanced","pm-wfskfn"],...["meet","event","remind"].map(e=>[e,`calendar ${e}`,"pm-o3fh"])].map(([e,t,n])=>({alias:e,canonical:t,canonical_argv:t.split(" "),lifecycle:"permanent",hidden:!0,registration:"bootstrap",owner:n}))],Mn=[{alias:"history-attest",canonical:"history attest",canonical_argv:["history","attest"],lifecycle:"permanent",hidden:!0,registration:"commander",owner:"pm-3z0k"},...Xd,...Zd,...["discover","lookup"].map(e=>({alias:`files ${e}`,canonical:`item files ${e}`,canonical_argv:["item","files",e],lifecycle:"permanent",hidden:!0,registration:"bootstrap",owner:"pm-yql1"}))];function zy(e){let t;for(let n of Mn)n.canonical_argv.length<=(t?.canonical_argv.length??0)||n.canonical_argv.every((r,o)=>r===(o===0&&e[o]==="ctx"?"context":e[o]))&&(t=n);return t}function el(e){let t=e.trim().replace(/\s+/gu," ");return Mn.find(n=>n.canonical===t.replace(/^ctx /u,"context "))?.alias??t}function Qe(e){return el(e)}var $t=[...Mn,...[["ctx","context"],["packages","package"]].map(([e,t])=>({alias:e,canonical:t,canonical_argv:[t],lifecycle:"permanent",hidden:!1,registration:"commander",owner:"pm-pbyu"})),...[["start-task","claim","--start"],["pause-task","release","--pause"],["close-task","close","--release-assignment"]].map(([e,t,n])=>({alias:e,canonical:t,canonical_argv:[t,n],lifecycle:"deprecated",hidden:!0,registration:"commander",owner:"pm-eq4x"})),{alias:"tests",canonical:"item test",canonical_argv:["item","test"],lifecycle:"permanent",hidden:!1,registration:"bootstrap",owner:"pm-u4t9gp"},...[["fetch","get"],["read","get"],["show","get"],["view","get"],["comment","comments"],["note","notes"],["learning","learnings"]].map(([e,t])=>({alias:e,canonical:["comments","notes","learnings"].includes(t)?`item ${t}`:t,canonical_argv:["comments","notes","learnings"].includes(t)?["item",t]:[t],lifecycle:"permanent",hidden:!1,registration:"bootstrap",owner:"pm-pbyu"})),...[["extension list","extension catalog"],["extension scaffold","extension init"],["package list","package catalog"],["package scaffold","package init"],["packages list","package catalog"],["packages scaffold","package init"]].map(([e,t])=>({alias:e,canonical:t,canonical_argv:t.split(" "),lifecycle:"permanent",hidden:!1,registration:"commander",owner:"pm-ya7x55"})),{alias:"list-all",canonical:"list",canonical_argv:["list","--all"],lifecycle:"deprecated",hidden:!0,registration:"commander",owner:"pm-pfqi"},...[["list-draft","draft"],["list-open","open"],["list-in-progress","in_progress"],["list-blocked","blocked"],["list-closed","closed"],["list-canceled","canceled"]].map(([e,t])=>({alias:e,canonical:"list",canonical_argv:["list","--status",t],lifecycle:"deprecated",hidden:!0,registration:"commander",owner:"pm-pfqi"})),...[["extension","package"],["install","package install"],["upgrade","package upgrade"]].map(([e,t])=>({alias:e,canonical:t,canonical_argv:t.split(" "),lifecycle:"deprecated",hidden:!0,registration:"commander",owner:"pm-tnud"}))],qy=Object.fromEntries($t.filter(e=>e.registration==="bootstrap").map(e=>[e.alias,e.canonical]));function By(e){let t=e.trim().toLowerCase();return $t.find(n=>n.alias===t)}function Vy(e){return`Deprecated command \`${e.alias}\`; use \`pm ${e.canonical_argv.join(" ")}\`.`}(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]="432226a6-9df4-5de6-b9af-5c06ec2eed66")}catch{}})();var tl=[...G],nl=[...Ce],rl=[...Et],Yy=[...kt],Xy=[...Ot],ol=[...St],Mt=["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-attest","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","assurance","gc","workspace","contracts","claim","release","start-task","pause-task","close-task","meet","event","remind","help"],Jy=["ancestors","descendants","predecessors","successors","paths","impact","analyze","audit","communities","redundancy","dominators","slack","centrality","articulation","plan","index"],Qy=["install","reconcile","report","driver"],il=["init","install","uninstall","explore","manage","describe","reload","doctor","catalog","adopt","adopt-all","activate","deactivate"],sl=["upgrade"],al=["reopen"],Do={help:"Commander help rendering has no SDK operation result.",packages:"The plural package alias only renders package-oriented help."},Te=Object.freeze(Mt.flatMap(e=>e in Do?[]:e==="extension"||e==="package"?[...il.map(t=>`${e}-${t}`),...e==="package"?sl.map(t=>`package-${t}`):[],e]:e==="item"?al.map(t=>`item-${t}`):[e])),cl=Object.freeze($t.filter(e=>e.lifecycle==="deprecated"&&e.registration==="commander"&&Te.includes(e.alias)).map(e=>e.alias)),Zy=Object.freeze(Te.filter(e=>!cl.includes(e)));function eh(e=Mt,t=Te,n=Do){let r=new Set(t),o=new Set(e);return{missing_cli_actions:e.filter(i=>!r.has(i)&&!t.some(s=>s.startsWith(`${i}-`))&&n[i]===void 0),waived_cli_actions:e.filter(i=>!r.has(i)&&!t.some(s=>s.startsWith(`${i}-`))&&n[i]!==void 0),stale_waivers:Object.keys(n).filter(i=>!o.has(i)||r.has(i)||t.some(s=>s.startsWith(`${i}-`)))}}function th(e){return Te.includes(e)}function nh(e){return tl.includes(e)}function rh(e){return nl.includes(e)}function oh(e){return rl.includes(e)}function ih(e){return ol.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]="53865a81-4c96-51e2-a378-ae0e2781a50f")}catch{}})();var Lt={include:"--output-include",amount:"--output-limit",cost:"--output-budget",encoding:"--output-format"},jt=Object.freeze(["--output-session","--output-cursor","--output-row-contract"]),Re=["list","context","search","get","next","health","deps","graph","history","activity","validate","events","contracts","comments","notes","files","docs","stats","aggregate","duplicates","package-catalog","package-manage","comments-audit","assurance"];(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]="f8657910-1392-5fae-afda-614b96dc8320")}catch{}})();function S(e){return e.trim().toLowerCase().split(/\s+/).filter(t=>t.length>0).join(" ")}function dl(){return{json:!1,quiet:!1,noExtensions:!1,profile:!1}}function Po(e){return e?P(e):{}}function $o(e){return e?P(e):dl()}function P(e){return structuredClone(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]="615b4955-a30d-5d45-a86d-4bcf7bd9bd7a")}catch{}})();var ll=new Set(["commands","command_overrides","command_handlers","flag_commands","parser_overrides"]),ul=["commands","command_overrides","command_handlers","hooks","flag_commands","item_types","item_fields","relationship_kinds","migrations","profiles","importers","exporters","search_providers","vector_store_adapters","assurance_providers","parser_overrides","service_overrides","renderer_overrides"];function fl(e,t){for(let n of ul){let r=e[n];if(r===void 0)continue;if(!Array.isArray(r)||r.some(i=>typeof i!="string"))return!1;let o=r.map(i=>ll.has(n)?S(i):i.trim()).filter(i=>i.length>0);t[n]=[...new Set(o)].sort((i,s)=>i.localeCompare(s))}return!0}function ml(e){if(!Array.isArray(e))return null;let t=[];for(let n of e){if(typeof n!="object"||n===null)return null;let r=n;if(r.format!=="json"&&r.format!=="toon"||!Array.isArray(r.commands)||r.commands.some(o=>typeof o!="string")||typeof r.result_discriminator!="boolean")return null;t.push({format:r.format,commands:[...new Set(r.commands.map(o=>S(o)))].sort((o,i)=>o.localeCompare(i)),result_discriminator:r.result_discriminator})}return t.sort((n,r)=>n.format.localeCompare(r.format))}function pl(e){if(!Array.isArray(e))return null;let t=[];for(let n of e){if(typeof n!="object"||n===null)return null;let r=n.commands;if(!Array.isArray(r)||r.some(o=>typeof o!="string"))return null;t.push({commands:[...new Set(r.map(o=>S(o)))].filter(o=>o.length>0).sort((o,i)=>o.localeCompare(i))})}return t}function Ft(e){if(e==null)return;if(typeof e!="object"||Array.isArray(e))return null;let t=e;if(t.schema_version!==1)return null;let n={schema_version:1};if(!fl(t,n))return null;let r=t.preflight_overrides;if(r!==void 0&&(!Number.isInteger(r)||r<0))return null;typeof r=="number"&&(n.preflight_overrides=r);let o=t.renderer_ownership;if(o!==void 0){let s=ml(o);if(s===null)return null;n.renderer_ownership=s}let i=t.preflight_ownership;if(i!==void 0){let s=pl(i);if(s===null)return null;n.preflight_ownership=s}return n}function lh(e){return{schema_version:1,commands:e.commands,command_overrides:e.command_overrides,command_handlers:e.command_handlers,hooks:e.hooks,flag_commands:e.flag_commands,item_types:e.item_types,item_fields:e.item_fields,...e.relationship_kinds?{relationship_kinds:e.relationship_kinds}:{},migrations:e.migrations,profiles:e.profiles,importers:e.importers,exporters:e.exporters,search_providers:e.search_providers,vector_store_adapters:e.vector_store_adapters,...e.assurance_providers?{assurance_providers:e.assurance_providers}:{},parser_overrides:e.parser_overrides,service_overrides:e.service_overrides,renderer_overrides:e.renderer_overrides,...e.renderer_ownership?{renderer_ownership:e.renderer_ownership}:{},preflight_overrides:e.preflight_overrides,...e.preflight_ownership?{preflight_ownership:e.preflight_ownership}:{}}}(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]="c24357cc-5dad-5cd7-aa89-cddd2945aab7")}catch{}})();var _l=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:"--output-cursor",value_name:"cursor"},{flag:"--output-row-contract"},{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"}]),Ln=new Set(_l.flatMap(e=>[e.flag,...e.aliases??[]]));(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="896ebde0-4ca1-50ed-bb8e-2a8c2d978d94")}catch{}})();var Mo=/^(--[a-z0-9][a-z0-9_-]*)(?:[ =](<[^<>]+>|\[[^[\]]+\]))?$/;function jn(e){if(typeof e!="string")return null;let t=Mo.exec(e.trim());if(!t)return null;let n=t[2];return{name:t[1],valueName:n?n.slice(1,-1):null,optional:n?.startsWith("[")??!1}}function ph(e){let t=jn(e);return t?t.name:typeof e=="string"&&e.trim()||null}function gl(e){if(typeof e!="string")return null;let t=e.trim(),n=t.split(/[ =]/,1)[0];return Ln.has(n)?"host_owned_flag_collision":Mo.test(t)?null:"malformed_long_flag"}function Lo(e,t){let n=[e,t].find(i=>typeof i=="string"&&Ln.has(i.trim().split(/[ =]/,1)[0]));if(typeof n=="string")return{token:n.trim().split(/[ =]/,1)[0],failure:"host_owned_flag_collision"};if(typeof e!="string")return null;let r=e.trim(),o=gl(r);return o===null?null:{token:r,failure:o}}function jo(e,t){return t==="host_owned_flag_collision"?`cannot shadow host-owned global flag "${e}"; read it from context.global instead`:`long flag "${e}" must start with a double-dash name such as "--my-flag" or "--my-flag <value>"`}(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]="5c3049c3-1d5a-5e7e-a070-35340737a6ab")}catch{}})();var Fo=Object.freeze({string:"string",number:"number",int:"number",integer:"number",float:"number",boolean:"boolean",bool:"boolean"});function Ut(e){if(typeof e!="string")return null;let t=e.trim().toLowerCase();return Object.hasOwn(Fo,t)?Fo[t]:null}function yl(e,t,n){return!!(e.value_name?.trim()||t||n||e.required===!0||e.list===!0||e.repeatable===!0)}function hl(e){return(e.value_type?.trim()||e.type?.trim())?.toLowerCase()}function yh(e){let t=hl(e),n=Ut(t),r=jn(e.long),o=e.value_name?.trim()||null,i=!(n==="boolean"&&t!=="bool")&&yl(e,r?.valueName,t),s=r?.valueName?r.optional:t==="bool";return{value_type:n,value_arity:i?s?"optional":"required":"none",value_name:i?o??r?.valueName??"value":null}}function Uo(e){let t=[],n=r=>{if(Array.isArray(r)){for(let o of r)n(o);return}if(typeof r=="string"){for(let o of r.split(",")){let i=o.trim();i.length>0&&t.push(i)}return}r!=null&&t.push(r)};return n(e),t}function zo(e,t){return t==="string"?!0:t==="number"?typeof e=="number"?Number.isFinite(e):typeof e=="string"&&e.trim().length>0&&Number.isFinite(Number(e)):typeof e=="boolean"?!0:typeof e=="string"&&["true","false","1","0"].includes(e.trim().toLowerCase())}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="7359c10a-4c56-57ea-8254-fc26b19e5c84")}catch{}})();function Ze(e){return[...new Set(e.map(t=>t.trim()).filter(t=>t.length>0))].sort((t,n)=>t.localeCompare(n))}function Q(e){return G.includes(e)}function qo(e){let t=e.trim().toLowerCase();return Q(t)?t:null}function Bo(e){return e.filter(t=>!Q(t))}function Fn(e){let t=e.trim().toLowerCase();return t.length===0?null:so[t]??null}function Vo(e){let t=Ze([...e].map(i=>i.toLowerCase())),n=[],r=[];for(let i of t){let s=Fn(i);if(s){n.push(s),r.push({alias:i,target:s});continue}n.push(i)}let o=[...new Map(r.map(i=>[`${i.alias}>${i.target}`,i])).values()].sort((i,s)=>i.alias.localeCompare(s.alias));return{capabilities:Ze(n),legacy_aliases:o}}function bl(e){let t=e.trim().toLowerCase();if(t.length===0)return null;let n=Fn(t);if(n)return n;let r=Math.max(1,Math.floor(t.length*.34)),o=null,i=Number.POSITIVE_INFINITY;for(let s of G){let a=It(t,s,r);a!==null&&a<i&&(i=a,o=s)}return o}function Go(e,t,n){let r=G.join(","),o=bl(n)??"none";return`extension_capability_unknown:${e}:${t}:${n}:allowed=${r}:suggested=${o}`}function Wo(e,t,n){let r=n.map(o=>`${o.alias}>${o.target}`).join(",");return`extension_capability_legacy_alias:${e}:${t}:aliases=${r}`}function wl(e){let t=/^extension_capability_unknown:(global|project):([^:]+):([^:]+):allowed=([^:]+):suggested=([^:]+)$/.exec(e.trim());if(!t)return null;let[,n,r,o,i,s]=t,a=n,c=i.split(",").map(m=>m.trim()).filter(m=>m.length>0),d=Fn(o),l=(s==="none"?void 0:s)??d??void 0;return{layer:a,name:r,capability:o,allowed_capabilities:c,capability_contract_version:vn,suggested_capability:l,suggestion_source:l?d===l?"legacy_alias":"nearest_match":void 0,legacy_alias_target:d??void 0}}function vl(e){let t=/^extension_capability_legacy_alias:(global|project):([^:]+):aliases=(.+)$/.exec(e.trim());if(!t)return[];let[,n,r,o]=t,i=n,s=[...G],a=[];for(let c of o.split(",")){let[d,l]=c.split(">"),m=d?.trim(),u=l?.trim().toLowerCase();!m||!u||!Q(u)||a.push({layer:i,name:r,capability:m,allowed_capabilities:s,capability_contract_version:vn,suggested_capability:u,suggestion_source:"legacy_alias",legacy_alias_target:u})}return a}(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]="d8844150-afb4-5f2e-a005-4cfb8482660c")}catch{}})();var El={commands:["registerCommand","command override","command handler"],renderers:["registerRenderer"],hooks:["hooks.beforeCommand","hooks.beforeMutation","hooks.afterCommand","hooks.onWrite","hooks.onRead","hooks.onIndex"],schema:["registerFlags","registerItemFields","registerItemTypes","registerRelationshipKinds","registerMigration","registerProfile"],importers:["registerImporter","registerExporter"],search:["registerSearchProvider","registerVectorStoreAdapter"],parser:["registerParser"],preflight:["registerPreflight"],services:["registerService","registerAssuranceMeasurementProvider"]},Ko=":";function Ho(e,t){return`${e}${Ko}${Un(t)}`}function kl(e){return e.slice(e.indexOf(Ko)+1)}function Un(e){return e.trim().toLowerCase()}function Ol(e){if(!Array.isArray(e))return[];let t=new Set;for(let n of e){let r=qo(n);r!==null&&t.add(r)}return[...t].sort((n,r)=>n.localeCompare(r))}function Yo(e){let t=new Map,n=(l,m)=>{for(let u of l){let f=Ho(u.layer,u.name),p=t.get(f);p===void 0&&(p=new Set,t.set(f,p)),p.add(m)}},{registrations:r,commands:o,parsers:i,preflight:s,services:a,renderers:c,hooks:d}=e;return n(r.commands,"commands"),n(o.overrides,"commands"),n(o.handlers,"commands"),n(r.flags,"schema"),n(r.item_fields,"schema"),n(r.item_types,"schema"),n(r.relationship_kinds??[],"schema"),n(r.migrations,"schema"),n(r.profiles,"schema"),n(r.importers,"importers"),n(r.exporters,"importers"),n(r.search_providers,"search"),n(r.vector_store_adapters,"search"),n(i.overrides,"parser"),n(s.overrides,"preflight"),n(a.overrides,"services"),n(r.assurance_providers??[],"services"),n(c.overrides,"renderers"),n(d.beforeCommand,"hooks"),n(d.beforeMutation,"hooks"),n(d.afterCommand,"hooks"),n(d.onWrite,"hooks"),n(d.onRead,"hooks"),n(d.onIndex,"hooks"),t}function Sl(e,t={}){let n=Yo(e),r=new Set;t.extensionName!==void 0&&r.add(Un(t.extensionName));for(let i of t.extensionNames??[])r.add(Un(i));let o=new Set;for(let[i,s]of n)if(!(r.size>0&&!r.has(kl(i))))for(let a of s)o.add(a);return[...o].sort((i,s)=>i.localeCompare(s))}function Al(e,t){let n=Yo(t),r=[];for(let o of e){let i=Ol(o.capabilities);if(i.length===0)continue;let s=n.get(Ho(o.layer,o.name))??new Set,a=[...s].sort((d,l)=>d.localeCompare(l)),c=i.filter(d=>!s.has(d));r.push({layer:o.layer,name:o.name,declared:i,used:a,unused:c})}return r}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="4a7b042c-7fb8-57a5-8f94-de44f82d7589")}catch{}})();function Cl(e){return e.trim().toLowerCase().replace(/\s+/g," ")}function Z(e,t){let n=e.slice(0,t),r=n.charCodeAt(n.length-1),o=e.charCodeAt(n.length);return r>=55296&&r<=56319&&o>=56320&&o<=57343?n.slice(0,-1):n}function Oh(e){return Cl(e).split(/[^a-z0-9]+/).filter(t=>t.length>0)}function Sh(e,t){if(e.length===0&&t.length===0)return 1;if(e.length===0||t.length===0)return 0;let n=new Set(e),r=new Set(t),o=0;for(let s of n)r.has(s)&&(o+=1);let i=new Set([...n,...r]).size;return o/i}import{stripVTControlCharacters as Il}from"node:util";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="1a14ce9e-1074-5434-9646-dd5e25e34814")}catch{}})();var Tl=["full","compact","brief","summary","counts"],xh=["mutation","read","discovery","governance"],Jo=["error","warning","validation_summary","recovery_bundle"],Rl=["full","omit_explanation","limit_collections","compact_recovery","action_only"],xl=new Set(["append","claim","close","close-many","close-task","comments","config","copy","create","delete","docs","event","files","focus","history-author-acknowledge","history-compact","history-redact","history-repair","init","item","learnings","meet","notes","pause-task","release","remind","restore","schema","start-task","update","update-many"]),Nl=new Set(["contracts","extension","help","install","package","packages","profile","upgrade"]),Dl=new Set(["gc","health","merge","stats","telemetry","test","test-all","validate"]),Pl={mutation:2e3,read:4e3,discovery:3e3,governance:6e3},$l=3,Ml=2,Ll=192,jl={error:{text:768,json:2e3},warning:{text:768,json:2e3},validation_summary:{text:1500,json:3e3},recovery_bundle:{text:768,json:2e3}},Fl=Jo.map(e=>({diagnostic_class:e,default_max_estimated_tokens_by_format:jl[e],minimum_max_estimated_tokens:Ll,degradation_ladder:Rl,corrective_action_paths:["required","recovery.suggested_retry","recovery.suggested_retry_args","recovery.next_best_command","next_steps[0]"],token_estimate:"ceil(utf8_bytes / 4)"})),Ul=new Map(Fl.map(e=>[e.diagnostic_class,e]));function zl(e){let[t=""]=Qe(e).split(/\s+/u);return xl.has(t)?"mutation":Nl.has(t)?"discovery":Dl.has(t)?"governance":"read"}function Qo(e,t=zl(e)){let n=e.trim().replace(/\s+/gu," ");if(n.length===0)throw new TypeError("command must be a non-empty command path");let r=Pl[t];return ql({command:n,budget_class:t,default_max_estimated_tokens:r,default_max_estimated_tokens_by_format:{toon:r,json:Math.ceil(r*$l/Ml)},degradation_ladder:Tl,allows_unbounded_opt_out:!0,token_estimate:"ceil(utf8_bytes / 4)"})}function ql(e){if(!Number.isSafeInteger(e.default_max_estimated_tokens)||e.default_max_estimated_tokens<=0)throw new RangeError("default_max_estimated_tokens must be a positive safe integer");for(let[t,n]of Object.entries(e.default_max_estimated_tokens_by_format))if(!Number.isSafeInteger(n)||n<=0)throw new RangeError(`default_max_estimated_tokens_by_format.${t} must be a positive safe integer`);return e}var Bl=Mt.map(e=>Qo(e)),Vl=new Map(Bl.map(e=>[e.command,e]));function Zo(e,t={}){let n=e.trim().replace(/\s+/gu," "),[r]=Qe(n).split(" "),o=Vl.get(r);return o?{...o,command:n}:t.generateFallback?Qo(n):null}function _e(e){return Math.ceil(Math.max(0,e)/4)}function ei(e){let t=Ul.get(e);if(t===void 0)throw new TypeError(`diagnosticClass must be one of: ${Jo.join(", ")}`);return t}function ee(e){return _e(Buffer.byteLength(JSON.stringify(e,null,2),"utf8"))}function Gl(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function zn(e){if(!Gl(e))return;let t={};for(let n of["suggested_retry","suggested_retry_args","next_best_command","allowed_values","candidate_commands","missing","missing_required_fields","option_scope","retry_after_ms","waited_ms","owner_handoffs"]){let r=e[n];Array.isArray(r)?t[n]=n==="suggested_retry_args"?r:r.slice(0,3):r!==void 0&&(t[n]=r)}return Object.keys(t).length>0?t:void 0}function Wl(e,t){return typeof e!="string"||e.length<=t?e:`${Z(e,Math.max(1,t-3))}...`}function pe(e,t){if(Buffer.byteLength(e,"utf8")<=t)return e;let n="...",r=Array.from(e),o=0,i=r.length;for(;o<i;){let s=Math.ceil((o+i)/2),a=`${r.slice(0,s).join("")}${n}`;Buffer.byteLength(a,"utf8")<=t?o=s:i=s-1}return`${r.slice(0,o).join("")}${n}`}function ti(e){let t={};for(let n of["code","required","recovery","next_steps","exit_code","type","title","detail","why","examples"])Object.hasOwn(e,n)&&e[n]!==void 0&&(t[n]=e[n]);for(let[n,r]of Object.entries(e))n!=="__proto__"&&!Object.hasOwn(t,n)&&(t[n]=r);return t}var Kl=new Set(["limit_collections","compact_recovery","action_only"]),Hl=new Set(["compact_recovery","action_only"]);function Yl(e){let t={code:typeof e.code=="string"?e.code:"diagnostic",required:Wl(e.required,160)??"Inspect the diagnostic code and retry with corrected input."},n=zn(e.recovery);return n!==void 0?t.recovery=n:Array.isArray(e.next_steps)&&(t.next_steps=e.next_steps.slice(0,1)),e.exit_code!==void 0&&(t.exit_code=e.exit_code),e.type!==void 0&&(t.type=e.type),t}function Xl(e,t){let n=structuredClone(e);if(t!=="full"&&(delete n.why,delete n.examples),Kl.has(t))for(let[r,o]of Object.entries(n))Array.isArray(o)&&(n[r]=o.slice(0,3));if(Hl.has(t)){let r=zn(n.recovery);r?n.recovery=r:delete n.recovery}return t!=="action_only"?ti(n):Yl(n)}function xe(e,t){let n={...e,diagnostic_output:{...t,estimated_tokens:0}};for(let r=0;r<4;r+=1){let o=ee(n),i=n.diagnostic_output;if(i.estimated_tokens===o)break;i.estimated_tokens=o}return n}function Jl(e,t,n){let r=xe(e,t);for(let i of["recovery","exit_code"])ee(r)<=n||e[i]===void 0||(delete e[i],r=xe(e,t));let o=40;for(;ee(r)>n&&o>4;)o-=4,e.code=pe(String(e.code),o),e.required=pe(String(e.required),o),r=xe(e,t);return r}function Ql(e,t){let n=e.diagnostic_output,{estimated_tokens:r,...o}=n,i=o.omitted_fields.slice(0,8).map(m=>pe(m,32)),s={...o,omitted_fields:i,...o.omitted_fields.length>i.length?{omitted_fields_overflow_count:o.omitted_fields.length-i.length}:{}},a=zn(e.recovery),c=a&&ee(a)<=48?a:void 0,d={code:pe(String(e.code),320),required:pe(String(e.required),320),...c?{recovery:c}:{},...e.exit_code!==void 0?{exit_code:e.exit_code}:{}},l=xe(d,s);for(;ee(l)>t&&s.omitted_fields.length>0;)s.omitted_fields.pop(),s.omitted_fields_overflow_count=o.omitted_fields.length-s.omitted_fields.length,l=xe(d,s);return l=Jl(d,s,t),l}function Nh(e,t={}){let n=e,r=t.diagnosticClass??"error",o=ei(r),i=t.maxEstimatedTokens;if(i!==void 0&&(!Number.isSafeInteger(i)||i<o.minimum_max_estimated_tokens))throw new RangeError(`maxEstimatedTokens must be a safe integer >= ${o.minimum_max_estimated_tokens}`);let s=i??o.default_max_estimated_tokens_by_format.json,a=ee(n),c=Object.keys(n);if(a<=s)return ti(structuredClone(n));let d;for(let[l,m]of o.degradation_ladder.entries()){let u=Xl(n,m),f=c.filter(_=>!Object.hasOwn(u,_)),p=xe(u,{diagnostic_class:r,format:"json",budget:s,budget_source:i===void 0?"default":"explicit",original_estimated_tokens:a,truncated:l>0,degradation_steps:o.degradation_ladder.slice(0,l+1),omitted_fields:f});if(d=p,ee(p)<=s)break}return ee(d)>s&&(d=Ql(d,s)),d}function Xo(e){return Il(e).replace(/\r\n/gu,`
|
|
2
2
|
`).replace(/[^\P{Cc}\n]/gu," ")}function Dh(e,t,n={}){let r=n.diagnosticClass??"error",o=ei(r),i=n.maxEstimatedTokens;if(i!==void 0&&(!Number.isSafeInteger(i)||i<o.minimum_max_estimated_tokens))throw new RangeError(`maxEstimatedTokens must be a safe integer >= ${o.minimum_max_estimated_tokens}`);let s=i??o.default_max_estimated_tokens_by_format.text,a=Xo(e),c=_e(Buffer.byteLength(a,"utf8")),d=c>s,l=`What is required:
|
|
3
3
|
`,m=`
|
|
4
4
|
|
|
@@ -22,5 +22,5 @@ ${za(t,n+1)}`}function P_(e,t,n){let r=e.map(o=>gn(o,t,n||t.preserveRowFacts&&j(
|
|
|
22
22
|
`:`${za(r,0)}
|
|
23
23
|
`}function Mk(e){let t=Os("error_format",{message:e}),n=t.handled&&typeof t.result=="string"?t.result:e;R_(n.endsWith(`
|
|
24
24
|
`)?n:`${n}
|
|
25
|
-
`)}(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]="13e57322-501d-5927-8254-f6196854d434")}catch{}})();var F_=8,U_=64,z_=5,q_=4,Ba=100;function Va(e,t,n){if(e!=="get"||!Yr(n.item)||["fields","outputInclude","output_include","outputCursor","output_cursor"].some(c=>t[c]!==void 0)||t.full===!0||t.tree===!0||t.depth!==void 0&&t.depth!=="standard")return;let r=n.item,o=["linked","claim_state","schedule"],i=o.filter(c=>Object.hasOwn(n,c)),s=Object.fromEntries(Object.entries(n).filter(([c])=>!o.includes(c)));s.item=Object.fromEntries(Object.entries(r).filter(([c])=>c!=="body")),Object.hasOwn(r,"body")&&i.push("body");let a=[...Yr(n.omission_receipt)&&Array.isArray(n.omission_receipt.omitted_field_groups)?n.omission_receipt.omitted_field_groups:[],...i.map(c=>({name:c,restore_with:`--fields ${c}`}))];return s.omission_receipt={has_omissions:a.length>0,omitted_field_group_count:a.length,omitted_field_groups:a},s}function Jr(e){let t=Math.trunc(e.effective_budget_tokens),n=Math.trunc(e.measured_result_tokens);if(!Number.isSafeInteger(t)||t<=0||!Number.isSafeInteger(n)||n<=0)return{output_budget:"unbounded",recovery_budget_multiplier:null,rule_version:"v1"};let r=Math.max(t+1,n),o=Math.ceil(r*z_/q_),i=Math.ceil(o/Ba)*Ba;return Number.isSafeInteger(i)?{output_budget:i,recovery_budget_multiplier:i/t,rule_version:"v1"}:{output_budget:"unbounded",recovery_budget_multiplier:null,rule_version:"v1"}}function We(e,t,n=!1){let r=Object.getOwnPropertyDescriptor(e,"row_contract");r&&(n||r.enumerable===!1)&&Object.defineProperty(t,"row_contract",{...r,enumerable:!1})}function ht(e,t){let n=t===void 0?JSON.stringify(e):qa(e,t);return Math.ceil(Buffer.byteLength(n,"utf8")/4)}function Yr(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Xr(e,t,n=!1){return typeof e=="string"?n||e.length<=240?e:(t.compacted=!0,`${Z(e,240)}\u2026`):Array.isArray(e)?e.map(r=>Xr(r,t,n)):Yr(e)?Object.fromEntries(Object.entries(e).map(([r,o])=>[r,Xr(o,t,n||r==="focus_row_states")])):e}function le(e,t,n){let r=t.estimated_tokens;for(let o=0;o<F_;o+=1){t.estimated_tokens=r;let i=ht(e,n);if(i===r)return;r=i}t.estimated_tokens=r}function B_(e,t){return lt(e).filter(n=>(Array.isArray(n.value)?n.value.length:Object.keys(n.value).length)>Math.max(1,t.get(n.path)??0)).map(n=>({collection:n,length:Array.isArray(n.value)?n.value.length:Object.keys(n.value).length})).sort((n,r)=>r.length-n.length||n.collection.path.localeCompare(r.collection.path))[0]?.collection}function V_(e,t,n,r,o,i){for(let s=0;s<U_;s+=1){if(i?.(e),le(e,t,o),t.estimated_tokens<=n)return;let a=B_(e,r);if(!a)return;let c=Math.max(1,r.get(a.path)??0),d=Array.isArray(a.value)?[...a.value]:Object.entries(a.value),l=p=>{if(Array.isArray(a.value)){a.value.length=p;for(let _=0;_<p;_+=1)a.value[_]=d[_]}else{for(let _ of Object.keys(a.value))delete a.value[_];Object.defineProperties(a.value,Object.getOwnPropertyDescriptors(Object.fromEntries(d.slice(0,p))))}typeof e.count=="number"&&(e.count=en(e)),a.path==="items"&&(e.applied_limit=p),i?.(e),le(e,t,o)};t.rows_compacted=!0,t.compacted_row_paths=[...new Set([...t.compacted_row_paths??[],a.path])].sort((p,_)=>p.localeCompare(_)),e.has_more=!0,e.truncated=!0;let m=c,u=d.length-1,f=c;for(;m<=u;){let p=Math.floor((m+u)/2);l(p),t.estimated_tokens<=n?(f=p,m=p+1):u=p-1}l(f)}}function Ga(e,t,n,r=new Map,o,i,s=!1){let a={compacted:!1},c=Object.fromEntries(Object.entries(e).map(([d,l])=>[d,Xr(l,a,s&&d==="diff")]));return We(e,c),t.strings_compacted=a.compacted,c.read_output=t,V_(c,t,n,r,o,i),le(c,t,o),c}(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]="37a4f41e-7c66-5b8f-8c10-8aef5b75a55e")}catch{}})();function Wk(e){return typeof e=="object"&&e!==null&&"id"in e&&typeof e.id=="string"&&"context_ref"in e&&typeof e.context_ref=="string"&&e.context_ref.startsWith("session:")&&e.context_ref.endsWith(`:${e.id}`)}var Qr=256,Zr=1e4,G_=/^[A-Za-z0-9][A-Za-z0-9._:-]{0,63}$/u,Wa=/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/u,W_=new Set(["version","id","token_budget","spent_tokens","seen_item_ids"]),K_=[{valid:e=>e.version===1,reason:"version must equal 1."},{valid:e=>typeof e.id=="string"&&G_.test(e.id),reason:"id must be 1-64 portable identifier characters."},{valid:e=>Number.isSafeInteger(e.token_budget)&&e.token_budget>=Qr,reason:`token_budget must be a safe integer of at least ${Qr}.`},{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<=Zr&&e.seen_item_ids.every(t=>typeof t=="string"&&Wa.test(t)),reason:`seen_item_ids must contain at most ${Zr} portable item identifiers.`}];function hn(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function yn(e){throw new h(`--output-session ${e}`,y.USAGE,{code:"invalid_read_output_session",field:"outputSession"})}function bn(e){if(e===void 0)return;let t=e;if(typeof e=="string")try{t=JSON.parse(e)}catch{yn("must be a valid JSON object.")}hn(t)||yn("must be a JSON object.");let n=Object.keys(t).filter(i=>!W_.has(i));n.length>0&&yn(`contains unknown field "${n.sort()[0]}".`);let r=K_.find(i=>!i.valid(t));r!==void 0&&yn(r.reason);let o=[...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:o}}function Ka(e){if(hn(e))return typeof e.id=="string"?e.id:typeof e.item_id=="string"?e.item_id:hn(e.item)&&typeof e.item.id=="string"?e.item.id:void 0}function H_(e){let t=new Set,n=0,r=ie(e),o=new Set(r.map(({path:s})=>s)),i=Object.entries(e).flatMap(([s,a])=>Array.isArray(a)&&!o.has(s)?[{path:s,value:a}]:[]);for(let s of[...r,...i]){let a=Array.isArray(s.value)?s.value:Object.values(s.value);for(let c of a){if(!hn(c))continue;if(typeof c.context_ref=="string"){n+=1;continue}let d=Ka(c);d!==void 0&&Wa.test(d)&&t.add(d)}}return{deliveredIds:t,suppressedRepeatCount:n}}function Ha(e,t){let n=new Set(t.seen_item_ids);return ut(e,r=>{let o=Ka(r);return o!==void 0&&n.has(o)?{id:o,context_ref:`session:${t.id}:${o}`}:r})}function eo(e,t,n){let{deliveredIds:r,suppressedRepeatCount:o}=H_(e),i=new Set(t.seen_item_ids),s=[...r].filter(_=>!i.has(_)).sort(),a=s.slice(0,Zr-t.seen_item_ids.length),c=[...t.seen_item_ids,...a].sort(),d=s.length-a.length,l={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:r.size,...d===0?{}:{seen_item_overflow_count:d},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:c}},m={...e,read_session:l},u=_=>{l.spent_this_call_tokens=_,l.charged_this_call_tokens=Math.min(t.token_budget-t.spent_tokens,_),l.spent_total_tokens=Math.min(t.token_budget,t.spent_tokens+l.charged_this_call_tokens),l.remaining_tokens=Math.max(0,t.token_budget-l.spent_total_tokens),l.exhausted=l.remaining_tokens<Qr,l.next_state.spent_tokens=l.spent_total_tokens},f=0,p=0;for(let _=0;_<8;_+=1){u(f);let g=ht(m,n);if(g===f)return m;p=Math.max(p,g),f=g}return u(p),m}function Ya(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]="1cc0fcb7-2aaa-5233-bdfd-4b4d0fb3e9c1")}catch{}})();var bt=Symbol.for("pm.readOutputInvocationProvenance");function Hk(e,t){return Reflect.set(e,bt,{canonical_include_modes:[...t],explicit_legacy_aliases:[],sdk_invocation_observed:!0}),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]="46bfc647-3c37-5357-8cd5-96dd3d21d737")}catch{}})();var Se=["include","amount","cost","encoding"],tc=["canonical","legacy","intent","default"],vt=Lt,u0=Object.freeze(Se.map(e=>vt[e])),f0=jt,nc={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"]},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"]},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:{},duplicates:{amount:["--limit"]},"package-catalog":{},"package-manage":{},"comments-audit":{},assurance:{}},rc=new Set(["--collapse","--fields","--section"]),to=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.","--collapse":"--collapse retains dependency grouping semantics; --output-include does not replace it.","--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.","--no-truncate":"--no-truncate is a compatibility alias; prefer --output-limit unbounded --output-budget unbounded.","--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.","--unbounded":"--unbounded is a compatibility alias; prefer --output-limit unbounded."});function no(e){return e.slice(2).replaceAll("-","_")}function Y_(e,t){let n=to[e];if(n!==void 0)return n;let r=t==="include"?rc.has(e)?"<csv>":no(e):t==="amount"?"<n>":t==="cost"?"<tokens>":"<toon|json>";return`${e} is a compatibility alias; prefer ${vt[t]} ${r}.`}function oc(e){let t=nc[e]??{},n=Object.freeze(Object.fromEntries(Se.map(r=>[r,Object.freeze({dimension:r,canonical_option:vt[r],applicable:!0,inapplicable_reason:null,legacy_aliases:Object.freeze((t[r]??[]).map(o=>Object.freeze({flag:o,semantics:to[o]===void 0?"replacement":"behavior_preserving",migration_hint:Y_(o,r),visibility:"hidden_alias"})))})])));return Object.freeze({command:e,dimensions:n,precedence:tc,budget_retention_policy:e==="assurance"?"verdict_priority":"ordered_prefix",projection_modes:Object.freeze([...sc(e).keys()])})}var X_=Object.freeze(Re.map(oc)),J_=new Map(X_.map(e=>[e.command,e]));function Fe(e,t={}){let n=Qe(e.trim().toLowerCase()),r=br(n);return r!==void 0?r.read_output===void 0?void 0:`extension:${r.command}`:Q_(n,t)}function Q_(e,t){let n=e==="package catalog"||e==="packages catalog"||e==="package-catalog"||(e==="package"||e==="packages"||e==="extension")&&(t.catalog===!0||t.target==="catalog"||t.action==="catalog")?"package-catalog":e==="package manage"||e==="package-manage"?"package-manage":e.split(" ")[0],r=n.startsWith("list-")?"list":n==="ctx"?"context":n;return Re.includes(r)?r:void 0}var Z_=["outputInclude","output_include","outputLimit","output_limit","outputBudget","output_budget","outputFormat","output_format","outputSession","output_session","outputCursor","output_cursor","outputRowContract","output_row_contract"],eg={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"],"package-catalog":["activate","adopt","adoptAll","deactivate","doctor","init","install","manage","migrate","reload","scaffold","uninstall"]};function tg(e){return Z_.some(t=>t!=="outputFormat"&&t!=="output_format"&&e[t]!==void 0)}var ng=[{keys:["outputInclude","output_include"],valid:e=>wt(e)!==void 0,message:"--output-include requires at least one comma-separated field or section."},{keys:["outputLimit","output_limit"],valid:e=>e==="unbounded"||Ke(e)!==void 0,message:"--output-limit must be a positive integer or unbounded."},{keys:["outputBudget","output_budget"],valid:e=>e==="unbounded"||Ke(e)!==void 0,message:"--output-budget must be a positive integer or unbounded."},{keys:["outputSession","output_session"],valid:e=>(bn(e),!0),message:"--output-session must be a valid session-state object."},{keys:["outputCursor","output_cursor"],valid:e=>typeof e=="string"&&e.trim().length>0,message:"--output-cursor requires a non-empty continuation cursor."}];function m0(e,t){let n=t.outputFormat??t.output_format;if(n!==void 0&&n!=="json"&&n!=="toon")throw new h("--output-format must be toon or json.",y.USAGE);if(!tg(t))return;let r=Fe(e,t);if(!r)throw new h(`Universal output controls apply only to read commands; ${e||"this command"} is not a read surface.`,y.USAGE);if((eg[r]??[]).some(o=>t[o]!==void 0&&t[o]!==!1))throw new h(`Universal output controls cannot be combined with a ${r} mutation.`,y.USAGE);for(let o of ng){let i=o.keys.map(s=>t[s]).find(s=>s!==void 0);if(i!==void 0&&!o.valid(i))throw new h(o.message,y.USAGE)}}function ic(e){let t=Fe(e);return t?sc(t):new Map}function sc(e){return new Map((nc[e]?.include??[]).filter(t=>!rc.has(t)&&to[t]===void 0).map(t=>[no(t),ac(t)]))}function rg(e,t,n){let r=wt(t)??[],o=ic(e),i=[],s=[],a=n,c=a[bt],d=new Set(c?.canonical_include_modes??[]),l=new Set(c?.explicit_legacy_aliases??[]);for(let f of r){let p=o.get(f);if(p===void 0){i.push(f);continue}let _=`--${f.replaceAll("_","-")}`;oo(ro(n,_))&&l.add(_),n[p]=!0,s.push(f),d.add(f)}let m=Fe(e)==="get"?i.filter(f=>f!=="item"):[],u=m.length>0;return u&&(n.fields=[...new Set([...wt(n.fields)??[],...m])].join(","),d.add("fields")),(s.length>0||u)&&(a[bt]={canonical_include_modes:[...d],explicit_legacy_aliases:[...l],...c?.cli_invocation_observed===!0?{cli_invocation_observed:!0}:{}}),{selectors:i,modes:s}}function p0(e,t){let n=t.outputInclude??t.output_include;if(n===void 0)return;let{selectors:r,modes:o}=rg(e,n,t);if(o.length===0)return;let i=r.length>0?r.join(","):void 0;t.outputInclude=i,Object.hasOwn(t,"output_include")&&(t.output_include=i)}function ac(e){return e.slice(2).replace(/-([a-z])/gu,(t,n)=>n.toUpperCase())}function ro(e,t){let n=ac(t);if(Object.hasOwn(e,n))return e[n];let r=t.slice(2).replaceAll("-","_");if(Object.hasOwn(e,r))return e[r];if(t==="--no-truncate"&&e.truncate===!1)return!0}function oo(e){return e!==void 0&&e!==!1&&e!==null}function wt(e){let t=(Array.isArray(e)?e:[e]).flatMap(n=>typeof n=="string"?n.split(","):[]).map(n=>n.trim()).filter(Boolean);return t.length>0?[...new Set(t)]:void 0}function Ke(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 og(e,t,n,r){for(let o of e.legacy_aliases){if(r(o.flag))continue;let i=ro(t,o.flag),s={value:i,flag:o.flag};if(oo(i)&&n(s))return s}}function Xa(e,t){let n=wt(e);if(n)return{source:"canonical",value:n};if(t)return{source:"legacy",value:wt(t.value)??[no(t.flag)]}}function Ja(e,t){if(e==="unbounded")return{source:"canonical",value:"unbounded"};let n=Ke(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 r=Ke(t.value);return r===void 0?void 0:{source:"legacy",value:r}}function Qa(e,t){if(e==="unbounded")return{source:"canonical",value:"unbounded"};let n=Ke(e);if(n!==void 0)return{source:"canonical",value:n};if(!t)return;let r=Ke(t.value);return r===void 0?void 0:{source:"legacy",value:r}}function Za(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 cc(e,t,n){if(!e)return!1;let r=new Set(e.explicit_legacy_aliases);if(e.cli_invocation_observed===!0||e.sdk_invocation_observed===!0)return!r.has(n);let o=new Set(e.canonical_include_modes.map(i=>`--${i.replaceAll("_","-")}`));return t==="include"&&o.has(n)&&!r.has(n)}function ig(e,t,n,r){return e.trim().toLowerCase().replaceAll(/\s+/gu," ").split(" ")[0]==="list-all"||oo(ro(r,"--no-truncate"))&&!cc(n,"amount","--no-truncate")||t.amount?.flag==="--no-truncate"||t.include?.flag==="--full"||n?.canonical_include_modes.includes("full")===!0}function sg(e,t){return Se.flatMap(n=>e[n]?.source==="canonical"||n==="include"&&(t?.canonical_include_modes.length??0)>0?[vt[n]]:[])}function dc(e,t){let n=Fe(e,t);if(!n)return;let r=J_.get(n)??oc(n),o=t[bt],i={include:b=>Xa(void 0,b),amount:b=>Ja(void 0,b),cost:b=>Qa(void 0,b),encoding:b=>Za(void 0,b)},s=Object.fromEntries(Se.map(b=>[b,og(r.dimensions[b],t,k=>i[b](k)!==void 0,k=>cc(o,b,k))])),a=Se.flatMap(b=>{let k=s[b];return k?[k.flag]:[]}),c=Se.flatMap(b=>{let k=s[b];return k?[r.dimensions[b].legacy_aliases.find(F=>F.flag===k.flag).migration_hint]:[]}),d=Za(t.outputFormat??t.output_format,s.encoding),l=Xa(t.outputInclude??t.output_include,s.include),m=Ja(t.outputLimit??t.output_limit,s.amount),u=Qa(t.outputBudget??t.output_budget,s.cost),f=ig(e,s,o,t),p=Zo(e,{generateFallback:!0}),_=d?.value==="json"||t.resolvedOutputFormat==="json"?"json":"toon",g=u??(f?{source:"intent",value:"unbounded"}:{source:"default",value:p.default_max_estimated_tokens_by_format[_]});return{command:n,include:l,amount:m,cost:g,encoding:d,canonical_options_used:sg({include:l,amount:m,cost:g,encoding:d},o),legacy_aliases_used:a,migration_hints:c,precedence:tc}}function D(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var io=new Set(["applied_bound","applied_limit","completeness","continuation_kind","continuation_path","continuation_contract","count","filters","has_more","next_cursor","now","omission_receipt","projection","budget_retention_policy","row_contract","sorting","total","truncated"]),ag=["collection_counts","notes_count","tests_count"];function lc(e,t){let n=new Set(t.map(r=>r.split(".")[0]));return Object.fromEntries(Object.entries(e).filter(([r])=>n.has(r)))}function cg(e){let t=D(e.item)?e.item:{},n=[...new Set([...Object.keys(t),...ag.filter(o=>Object.hasOwn(t,o))])].sort((o,i)=>o.localeCompare(i)),r=Object.keys(e).filter(o=>o!=="item"&&o!=="read_output"&&!io.has(o)).sort((o,i)=>o.localeCompare(i));return{item:t,itemFields:n,sections:r,valid:[...n,"item",...n.map(o=>`item.${o}`),...r]}}function dg(e,t){let n=cg(e),r=t.filter(l=>!n.valid.includes(l));if(r.length>0)throw new h(`Unknown --output-include selector(s) for get: ${r.join(", ")}. Valid selectors: ${n.valid.join(", ")}.`,y.USAGE);let o=t.includes("item"),i=t.flatMap(l=>l.startsWith("item.")?[l.slice(5)]:n.itemFields.includes(l)?[l]:[]).filter((l,m,u)=>u.indexOf(l)===m);if(o&&i.length>0)throw new h("--output-include cannot mix a full item with projected item fields; use item or item.<field>, not both.",y.USAGE);let s=new Set(t.filter(l=>n.sections.includes(l))),a=Object.fromEntries(Object.entries(e).filter(([l])=>io.has(l)||s.has(l)));o?a.item=n.item:i.length>0&&(a.item=lc(n.item,i));let c=[...o?[]:i.length>0?n.itemFields.filter(l=>!i.includes(l)).map(l=>({name:`item.${l}`,restore_with:`--output-include item.${l}`})):[{name:"item",restore_with:"--output-include item"}],...n.sections.filter(l=>!s.has(l)).map(l=>({name:l,restore_with:`--output-include ${l}`}))],d=[...D(a.omission_receipt)&&Array.isArray(a.omission_receipt.omitted_field_groups)?a.omission_receipt.omitted_field_groups:[],...c];return a.omission_receipt={has_omissions:d.length>0,omitted_field_group_count:d.length,omitted_field_groups:d},a}function ec(e){let t=0;return ut({...e},n=>(D(n)&&Object.keys(n).length>0&&(t+=1),n)),t}function lg(e,t,n,r){if(ec(t)===0||ec(n)>0)return;let o=[...ic(e).keys()],i=o.length>0?` Declared ${e} projection modes: ${o.join(", ")}.`:` The ${e} surface declares no projection modes; name row fields instead.`;throw new h(`Unknown --output-include selector(s) for ${e}: ${r.join(", ")}. No selector matched any returned row field.${i}`,y.USAGE)}function ug(e,t,n){if(e==="get")return dg(t,n);let r=Zt(t),o=n.flatMap(s=>r.flatMap(a=>s.startsWith(`${a}.`)?[s.slice(a.length+1)]:[])),i=n.some(s=>Object.hasOwn(t,s.split(".")[0])&&!r.some(a=>s.startsWith(`${a}.`)));if(r.length>0&&(!i||o.length>0)){let s={...t},a=o.length>0?o:n,c=ut(s,d=>D(d)?lc(d,a):d);return lg(e,t,c,a),c}return Object.fromEntries(Object.entries(t).filter(([s])=>n.some(a=>a.split(".")[0]===s)||io.has(s)))}function fg(e,t){if(t==="unbounded")return e;let{result:n,truncated:r}=Bs(e,t);if(!r)return n;if(n.has_more=!0,n.truncated=!0,typeof n.count=="number"){let o=D(n.projection)?n.projection.row_key:void 0;n.count=typeof o=="string"&&Array.isArray(n[o])?n[o].length:en(n)}return n.applied_bound={kind:"output_limit",source:"explicit",value:t},n}function mg(e){return Se.filter(t=>e[t]!==void 0&&e[t]?.source!=="default"||e.canonical_options_used.includes(vt[t]))}function uc(e){let t=e.resolvedOutputFormat??e.outputFormat??e.output_format??e.format;return t==="json"||t==="toon"?t:void 0}function wn(e,t,n,r){let o=eo(e,t,r);We(e,o);for(let i=0;i<8;i+=1){let s=n.estimated_tokens,a=o.read_session.spent_this_call_tokens;le(o,n,r);let c=o;o=eo(o,t,r),We(c,o);let d=o.read_session.spent_this_call_tokens;if(n.estimated_tokens===s&&d===a)return o}return o}function qr(e,t){if(!D(e.read_output))return e;let n=uc(t),r=e.read_output,o=bn(t.outputSession??t.output_session);return o===void 0?(le(e,r,n),e):wn(e,o,r,n)}function pg(e,t){if(e!=="validate")return t;let n=D(t.projection)?t.projection:void 0;if(!(Array.isArray(n?.declared_field_groups)?n.declared_field_groups:[]).some(l=>D(l)&&l.name==="diagnostic_rows"))return t;let r=[...new Set(lt(t).map(({path:l})=>l).filter(l=>/^checks\.\d+\.details\./u.test(l)))],o=r.filter(l=>!r.some(m=>m!==l&&l.startsWith(`${m}.`)));if(o.length===0)return t;let i=D(t.row_contract)?t.row_contract:{},s=Array.isArray(i.row_keys)?i.row_keys.filter(l=>typeof l=="string"):[],a=Array.isArray(i.continuation_row_keys)?i.continuation_row_keys.filter(l=>typeof l=="string"):[],c=s.length>0?s:o,d=[...new Set(o)];return JSON.stringify(c)===JSON.stringify(s)&&JSON.stringify(d)===JSON.stringify(a)?t:{...t,row_contract:{...i,row_keys:c,continuation_row_keys:d,jq_selector:typeof i.jq_selector=="string"?i.jq_selector:".checks[].details"}}}function _g(e,t,n,r,o){let i={...e};if(t.include?.source==="canonical"&&(i=ug(t.command,i,t.include.value)),t.command==="assurance"&&(i=Ks(i)),ft(i,e),i=Hs(i,t.command,r),t.command==="history"&&r){let c=["compact_history","provenance_history","history","diff"];if(i=Object.fromEntries(Object.entries(i).filter(([d])=>!c.includes(d)||d===r.path)),D(i.projection)&&(i.projection={...i.projection,row_key:r.path}),D(i.row_contract)){let d=i.row_contract;i.row_contract={...d,row_keys:[r.path],...Array.isArray(d.continuation_row_keys)?{continuation_row_keys:[r.path]}:{}}}i.count=Object.keys(i[r.path]).length}let s=e.count_only===!0?{...i,count_only:!0,count:e.count}:i,a=vg(i,e,t.command,r,o);return t.amount?.source==="canonical"&&(i=fg(i,t.amount.value),a.cursorContinuesExistingPage&&_c(i,a.originalItems,a.cursorSource,!0,a.originalItemOffset)),ft(i,s),{projected:n===void 0?i:Ha(i,n),continuationState:a}}function gg(e,t){return[...e.cost!==void 0&&e.cost.value!=="unbounded"&&(e.cost.source==="canonical"||e.cost.source==="default"||e.command==="context"&&e.cost.source==="legacy")?[{source:e.cost.source,tokens:e.cost.value}]:[],...t===void 0?[]:[{source:"session",tokens:Ya(t)}]].sort((n,r)=>n.tokens-r.tokens)[0]}function fc(e){let t=e.canonical_options_used;return t&&t.length>0?{canonical_options_used:t}:{}}function mc(e,t){return D(e.context_intent)&&e.context_intent.command==="context"&&e.context_intent.token_budget===t&&e.context_intent.within_budget===!0}function pc(e,t={}){return e?.source==="default"||e?.source==="legacy"&&!mc(t,e.tokens)?{budget_source:e.source,budget_tokens:e.tokens}:{}}function yg(e,t,n,r,o,i){let s={contract_version:1,command:e.command,requested_dimensions:t,...pc(r),precedence:e.precedence,...fc(e),legacy_aliases_used:[],migration_hints:[],estimated_tokens:0,within_budget:!1,strings_compacted:!1,rows_compacted:!1,result_omitted:!0,...n===void 0?{omitted_result_estimated_tokens:o}:{}},a={output_budget_exceeded:{omitted_result:!0,reason:"requested_budget_infeasible",restore_with:"Unbounded",recovery:{outputBudget:"unbounded"}},read_output:s},c=n===void 0?a:wn(a,n,s,i);if(n===void 0&&le(c,s,i),n!==void 0&&s.estimated_tokens>r.tokens)throw new h("The remaining output-session budget cannot fit its mandatory receipts; start a new session with a larger token_budget.",y.USAGE);return c}function hg(e,t,n){return e.command==="context"&&e.cost?.source==="legacy"&&!mc(n,e.cost.value)||t.outputRowContract===!0||t.output_row_contract===!0||e.canonical_options_used.includes("--output-include")||e.command==="list"&&e.canonical_options_used.length>0&&e.include?.value.includes("full")===!0}function bg(e,t,n,r,o){if(t!==void 0||hg(e,o,n))return!1;if(e.amount?.source==="canonical"&&e.amount.value!=="unbounded"){let i=e.amount.value;if(ie(n).some(({value:s})=>(Array.isArray(s)?s.length:Object.keys(s).length)>i))return!1}return e.cost===void 0||e.cost.value==="unbounded"||e.cost.source==="legacy"&&e.command!=="context"||ht(o.outputRowContract===!1?Object.fromEntries(Object.entries(n).filter(([i])=>i!=="row_contract")):n,r)<=e.cost.value}function wg(e,t,n,r,o,i,s){if(!n.rows_compacted)return;let a=t.amount?.value==="unbounded"?["amount"]:[],c=new Map(je(e).map(p=>[p.path,Array.isArray(p.value)?p.value.length:Object.keys(p.value).length])),d=[...s.entries()].flatMap(([p,_])=>{let g=c.get(p);if(g>=_.rows)return[];let b=_.baseOffset+g;return[{path:p,cursor:Er({command:t.command,path:p,offset:b,total_rows:_.totalRows,fingerprint:_.fingerprint}),retained_rows:g,remaining_rows:_.totalRows-b,total_rows:_.totalRows}]}),l=d[0],m=l?"; page --output-cursor":"",u=r.source==="session"?`Truncated by the remaining ${r.tokens}-token session budget; start a new output session with a larger token_budget${m}.`:`${r.tokens}-token: raise --output-budget${m}`;n.migration_hints=[u,...t.migration_hints];let f=Jr({effective_budget_tokens:r.tokens,measured_result_tokens:i});l&&!o&&(typeof e.next_cursor!="string"||e.continuation_kind==="output_cursor")&&(e.next_cursor=l.cursor),e.continuation_kind=o?"producer_cursor":l?"output_cursor":"none",e.output_budget_truncation={reason:"output_budget_reached",budget_source:r.source,budget_tokens:r.tokens,overridden_dimensions:a,compacted_row_paths:n.compacted_row_paths,continuation_cursor_rebased:o,continuation_available:d.length>0,recovery_budget_multiplier:l?1:f.recovery_budget_multiplier,continuations:d,restore_with:l?"recovery":`Retry with --output-budget ${f.output_budget} because no declared row collection can be continued.`,recovery:l?{cursor:l.cursor,cli:"--output-cursor",sdk:"outputCursor",mcp:"outputCursor"}:{cli:`--output-budget ${f.output_budget}`,sdk:{outputBudget:f.output_budget},mcp:{outputBudget:f.output_budget}}}}function _c(e,t,n,r,o){if(typeof n!="string"||!Array.isArray(e.items))return!1;let i=e.items.length,s=t.length;if(i===0||i>=s)return!1;let a;try{a=Sr(n)}catch{return!1}let c=a.after_index;if(c===void 0)return!1;let d=t[i-1];if(Object.prototype.toString.call(d)!=="[object Object]")return!1;let l=Reflect.get(d,"id");if(typeof l!="string"||l.length===0)return!1;let m=r?c-(s-i):c+o+i;return m<0?!1:(e.next_cursor=gt(a.fingerprint,l,m,a.snapshot),!0)}function vg(e,t,n,r,o){let i=new Map(je(e).map(c=>{let d=Array.isArray(c.value)?c.value.length:Object.keys(c.value).length,l=r?.path===c.path;return[c.path,{rows:d,totalRows:l?r.total_rows:d,baseOffset:l?r.offset:0,fingerprint:l?r.fingerprint:tn(c.path,c.value,n)}]})),s=typeof e.next_cursor=="string",a=r?.path==="items"?r.offset:0;return{collectionsBeforeBudget:i,originalItems:Array.isArray(t.items)?a>0?t.items.slice(a):t.items:[],originalItemOffset:a,cursorContinuesExistingPage:s,cursorSource:s?e.next_cursor:o.after}}function Eg(e,t,n,r,o,i,s,a,c,d){let l={...t,count_only:n},m=r.command==="assurance"&&Array.isArray(e.assertions)?e.assertions.filter(f=>D(f)&&f.verdict!=="pass").length:0,u=new Map;if(m>0&&u.set("assertions",m),r.command==="history"&&Array.isArray(e.diff))for(let f of lt(e))f.path.startsWith("diff.")&&u.set(f.path,Object.keys(f.value).length);return Ga(e,o,i.tokens,u,d,f=>{ft(f,l);let p=_c(f,a.originalItems,a.cursorSource,a.cursorContinuesExistingPage,a.originalItemOffset);if(wg(f,r,o,i,p,c,a.collectionsBeforeBudget),r.command==="history"&&D(f.projection)){f.has_more=typeof f.next_cursor=="string"||f.applied_bound?.kind==="output_limit";let _=f.projection.row_key;typeof _=="string"&&Array.isArray(f[_])&&(f.count=f[_].length)}s!==void 0&&Object.assign(f,wn(f,s,o,d))},r.command==="history"&&Array.isArray(e.diff))}function Ca(e,t,n){let r=dc(e,t);if(!r)return n;let o=uc(t),i=bn(t.outputSession??t.output_session),s=t.outputCursor??t.output_cursor,a=typeof s=="string"?_t(s):void 0,c=mg(r),d=pg(r.command,n);if(a===void 0&&bg(r,i,d,o,t))return d;let l=gg(r,i),m=_g(d,r,i,a,t),u=m.projected;We(u,u,t.outputRowContract===!1);let f={contract_version:1,command:r.command,requested_dimensions:c,...pc(l,u),precedence:r.precedence,...fc(r),legacy_aliases_used:r.legacy_aliases_used,migration_hints:r.migration_hints,estimated_tokens:0,within_budget:!0,strings_compacted:!1,rows_compacted:!1,result_omitted:!1};if(u.read_output=f,u=i===void 0?u:wn(u,i,f,o),le(u,f,o),l!==void 0&&f.estimated_tokens>l.tokens){let p=Va(r.command,t,u);p!==void 0&&(f.applied_depth="brief",f.degradation_reason="output_budget_reached",We(u,p),u=qr(p,t)),f.estimated_tokens>l.tokens&&(u=Eg(u,u,d.count_only===!0,r,f,l,i,m.continuationState,f.estimated_tokens,o))}return l!==void 0&&f.estimated_tokens>l.tokens?yg(r,c,i,l,f.estimated_tokens,o):u}function k_(e){return D(e)&&D(e.output_budget_exceeded)&&e.output_budget_exceeded.omitted_result===!0&&e.output_budget_exceeded.reason==="requested_budget_infeasible"}function O_(e,t){let n=t.outputFormat??t.output_format;if(n==="json"||n==="toon")return n;let r=dc(e,t)?.encoding;return r?.value==="json"||r?.value==="toon"?r.value:void 0}export{It as a,qo as b,Fn as c,wl as d,vl as e,S as f,gc as g,lo as h,Og as i,Sg as j,uo as k,Ag as l,Cg as m,Ig as n,Tg as o,Rg as p,xg as q,Ng as r,Dg as s,Pg as t,$g as u,Mg as v,Lg as w,jg as x,yc as y,Fg as z,Ug as A,zg as B,qg as C,Bg as D,Vg as E,Gg as F,Di as G,_l as H,ph as I,Lo as J,jo as K,Xi as L,Ji as M,bc as N,wc as O,Sn as P,In as Q,Tn as R,Jg as S,Qg as T,Zg as U,Tc as V,mo as W,ey as X,qn as Y,Gn as Z,zh as _,ou as $,Bh as aa,Vh as ba,Gh as ca,ii as da,si as ea,Wh as fa,Kh as ga,Hh as ha,Yh as ia,go as ja,Lc as ka,ho as la,ko as ma,dy as na,Dn as oa,Yc as pa,ly as qa,dd as ra,ld as sa,uy as ta,fy as ua,Ey as va,ky as wa,Oy as xa,Co as ya,So as za,Sy as Aa,Ay as Ba,Cy as Ca,Pn as Da,Iy as Ea,fe as Fa,B as Ga,xy as Ha,Ny as Ia,Ld as Ja,To as Ka,$n as La,Ud as Ma,zd as Na,Pt as Oa,xo as Pa,Bd as Qa,Wd as Ra,jy as Sa,Fy as Ta,Xd as Ua,Jd as Va,Qd as Wa,Zd as Xa,Mn as Ya,zy as Za,el as _a,Qe as $a,$t as ab,qy as bb,By as cb,Vy as db,tl as eb,nl as fb,rl as gb,Yy as hb,Xy as ib,ol as jb,Mt as kb,Jy as lb,Qy as mb,il as nb,sl as ob,al as pb,Do as qb,Te as rb,cl as sb,Zy as tb,eh as ub,th as vb,nh as wb,rh as xb,oh as yb,ih as zb,Re as Ab,Ft as Bb,lh as Cb,qt as Db,Yn as Eb,Xn as Fb,Jn as Gb,Qn as Hb,Zn as Ib,er as Jb,rr as Kb,Ti as Lb,yh as Mb,nf as Nb,of as Ob,sf as Pb,pf as Qb,Pw as Rb,$w as Sb,Mw as Tb,Xs as Ub,zw as Vb,Df as Wb,El as Xb,Un as Yb,Sl as Zb,Al as _b,Kw as $b,zf as ac,Hw as bc,Yw as cc,Xw as dc,Jw as ec,Qw as fc,Zw as gc,ev as hc,ws as ic,qf as jc,tv as kc,nv as lc,vs as mc,rv as nc,Es as oc,ov as pc,iv as qc,sv as rc,Ht as sc,Oh as tc,Sh as uc,Ms as vc,pv as wc,_v as xc,gv as yc,Ls as zc,js as Ac,Av as Bc,Us as Cc,Jt as Dc,Tl as Ec,xh as Fc,Jo as Gc,Rl as Hc,Fl as Ic,zl as Jc,Qo as Kc,ql as Lc,Bl as Mc,Zo as Nc,_e as Oc,ei as Pc,Nh as Qc,Dh as Rc,Nv as Sc,ft as Tc,bt as Uc,Hk as Vc,Se as Wc,u0 as Xc,f0 as Yc,X_ as Zc,Fe as _c,m0 as $c,ic as ad,rg as bd,p0 as cd,dc as dd,qr as ed,Ca as fd,k_ as gd,O_ as hd,Ws as id,tn as jd,Er as kd,_t as ld,Kv as md,Hv as nd,gt as od,Sr as pd,Ar as qd,Yv as rd,Dm as sd,Xv as td,Jv as ud,nE as vd,Tr as wd,cE as xd,Bm as yd,dE as zd,Ue as Ad,lE as Bd,uE as Cd,Nr as Dd,Dr as Ed,Pr as Fd,TE as Gd,vp as Hd,an as Id,Cp as Jd,ya as Kd,Tp as Ld,Y as Md,T as Nd,zE as Od,un as Pd,Up as Qd,qE as Rd,BE as Sd,zp as Td,VE as Ud,GE as Vd,WE as Wd,Ia as Xd,Gp as Yd,ok as Zd,Kp as _d,Ra as $d,ik as ae,Na as be,Yp as ce,Zp as de,o_ as ee,f_ as fe,uk as ge,_n as he,fk as ie,mk as je,pk as ke,_k as le,gk as me,yk as ne,R_ as oe,qa as pe,Mk as qe,Jr as re,ht as se,Wk as te,Zr as ue,bn as ve,Ha as we,eo as xe,Ya as ye};
|
|
26
|
-
//# sourceMappingURL=chunk-
|
|
25
|
+
`)}(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]="13e57322-501d-5927-8254-f6196854d434")}catch{}})();var F_=8,U_=64,z_=5,q_=4,Ba=100;function Va(e,t,n){if(e!=="get"||!Yr(n.item)||["fields","outputInclude","output_include","outputCursor","output_cursor"].some(c=>t[c]!==void 0)||t.full===!0||t.tree===!0||t.depth!==void 0&&t.depth!=="standard")return;let r=n.item,o=["linked","claim_state","schedule"],i=o.filter(c=>Object.hasOwn(n,c)),s=Object.fromEntries(Object.entries(n).filter(([c])=>!o.includes(c)));s.item=Object.fromEntries(Object.entries(r).filter(([c])=>c!=="body")),Object.hasOwn(r,"body")&&i.push("body");let a=[...Yr(n.omission_receipt)&&Array.isArray(n.omission_receipt.omitted_field_groups)?n.omission_receipt.omitted_field_groups:[],...i.map(c=>({name:c,restore_with:`--fields ${c}`}))];return s.omission_receipt={has_omissions:a.length>0,omitted_field_group_count:a.length,omitted_field_groups:a},s}function Jr(e){let t=Math.trunc(e.effective_budget_tokens),n=Math.trunc(e.measured_result_tokens);if(!Number.isSafeInteger(t)||t<=0||!Number.isSafeInteger(n)||n<=0)return{output_budget:"unbounded",recovery_budget_multiplier:null,rule_version:"v1"};let r=Math.max(t+1,n),o=Math.ceil(r*z_/q_),i=Math.ceil(o/Ba)*Ba;return Number.isSafeInteger(i)?{output_budget:i,recovery_budget_multiplier:i/t,rule_version:"v1"}:{output_budget:"unbounded",recovery_budget_multiplier:null,rule_version:"v1"}}function We(e,t,n=!1){let r=Object.getOwnPropertyDescriptor(e,"row_contract");r&&(n||r.enumerable===!1)&&Object.defineProperty(t,"row_contract",{...r,enumerable:!1})}function ht(e,t){let n=t===void 0?JSON.stringify(e):qa(e,t);return Math.ceil(Buffer.byteLength(n,"utf8")/4)}function Yr(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Xr(e,t,n=!1){return typeof e=="string"?n||e.length<=240?e:(t.compacted=!0,`${Z(e,240)}\u2026`):Array.isArray(e)?e.map(r=>Xr(r,t,n)):Yr(e)?Object.fromEntries(Object.entries(e).map(([r,o])=>[r,Xr(o,t,n||r==="focus_row_states")])):e}function le(e,t,n){let r=t.estimated_tokens;for(let o=0;o<F_;o+=1){t.estimated_tokens=r;let i=ht(e,n);if(i===r)return;r=i}t.estimated_tokens=r}function B_(e,t){return lt(e).filter(n=>(Array.isArray(n.value)?n.value.length:Object.keys(n.value).length)>Math.max(1,t.get(n.path)??0)).map(n=>({collection:n,length:Array.isArray(n.value)?n.value.length:Object.keys(n.value).length})).sort((n,r)=>r.length-n.length||n.collection.path.localeCompare(r.collection.path))[0]?.collection}function V_(e,t,n,r,o,i){for(let s=0;s<U_;s+=1){if(i?.(e),le(e,t,o),t.estimated_tokens<=n)return;let a=B_(e,r);if(!a)return;let c=Math.max(1,r.get(a.path)??0),d=Array.isArray(a.value)?[...a.value]:Object.entries(a.value),l=p=>{if(Array.isArray(a.value)){a.value.length=p;for(let _=0;_<p;_+=1)a.value[_]=d[_]}else{for(let _ of Object.keys(a.value))delete a.value[_];Object.defineProperties(a.value,Object.getOwnPropertyDescriptors(Object.fromEntries(d.slice(0,p))))}typeof e.count=="number"&&(e.count=en(e)),a.path==="items"&&(e.applied_limit=p),i?.(e),le(e,t,o)};t.rows_compacted=!0,t.compacted_row_paths=[...new Set([...t.compacted_row_paths??[],a.path])].sort((p,_)=>p.localeCompare(_)),e.has_more=!0,e.truncated=!0;let m=c,u=d.length-1,f=c;for(;m<=u;){let p=Math.floor((m+u)/2);l(p),t.estimated_tokens<=n?(f=p,m=p+1):u=p-1}l(f)}}function Ga(e,t,n,r=new Map,o,i,s=!1){let a={compacted:!1},c=Object.fromEntries(Object.entries(e).map(([d,l])=>[d,Xr(l,a,s&&d==="diff")]));return We(e,c),t.strings_compacted=a.compacted,c.read_output=t,V_(c,t,n,r,o,i),le(c,t,o),c}(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]="37a4f41e-7c66-5b8f-8c10-8aef5b75a55e")}catch{}})();function Wk(e){return typeof e=="object"&&e!==null&&"id"in e&&typeof e.id=="string"&&"context_ref"in e&&typeof e.context_ref=="string"&&e.context_ref.startsWith("session:")&&e.context_ref.endsWith(`:${e.id}`)}var Qr=256,Zr=1e4,G_=/^[A-Za-z0-9][A-Za-z0-9._:-]{0,63}$/u,Wa=/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/u,W_=new Set(["version","id","token_budget","spent_tokens","seen_item_ids"]),K_=[{valid:e=>e.version===1,reason:"version must equal 1."},{valid:e=>typeof e.id=="string"&&G_.test(e.id),reason:"id must be 1-64 portable identifier characters."},{valid:e=>Number.isSafeInteger(e.token_budget)&&e.token_budget>=Qr,reason:`token_budget must be a safe integer of at least ${Qr}.`},{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<=Zr&&e.seen_item_ids.every(t=>typeof t=="string"&&Wa.test(t)),reason:`seen_item_ids must contain at most ${Zr} portable item identifiers.`}];function hn(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function yn(e){throw new h(`--output-session ${e}`,y.USAGE,{code:"invalid_read_output_session",field:"outputSession"})}function bn(e){if(e===void 0)return;let t=e;if(typeof e=="string")try{t=JSON.parse(e)}catch{yn("must be a valid JSON object.")}hn(t)||yn("must be a JSON object.");let n=Object.keys(t).filter(i=>!W_.has(i));n.length>0&&yn(`contains unknown field "${n.sort()[0]}".`);let r=K_.find(i=>!i.valid(t));r!==void 0&&yn(r.reason);let o=[...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:o}}function Ka(e){if(hn(e))return typeof e.id=="string"?e.id:typeof e.item_id=="string"?e.item_id:hn(e.item)&&typeof e.item.id=="string"?e.item.id:void 0}function H_(e){let t=new Set,n=0,r=ie(e),o=new Set(r.map(({path:s})=>s)),i=Object.entries(e).flatMap(([s,a])=>Array.isArray(a)&&!o.has(s)?[{path:s,value:a}]:[]);for(let s of[...r,...i]){let a=Array.isArray(s.value)?s.value:Object.values(s.value);for(let c of a){if(!hn(c))continue;if(typeof c.context_ref=="string"){n+=1;continue}let d=Ka(c);d!==void 0&&Wa.test(d)&&t.add(d)}}return{deliveredIds:t,suppressedRepeatCount:n}}function Ha(e,t){let n=new Set(t.seen_item_ids);return ut(e,r=>{let o=Ka(r);return o!==void 0&&n.has(o)?{id:o,context_ref:`session:${t.id}:${o}`}:r})}function eo(e,t,n){let{deliveredIds:r,suppressedRepeatCount:o}=H_(e),i=new Set(t.seen_item_ids),s=[...r].filter(_=>!i.has(_)).sort(),a=s.slice(0,Zr-t.seen_item_ids.length),c=[...t.seen_item_ids,...a].sort(),d=s.length-a.length,l={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:r.size,...d===0?{}:{seen_item_overflow_count:d},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:c}},m={...e,read_session:l},u=_=>{l.spent_this_call_tokens=_,l.charged_this_call_tokens=Math.min(t.token_budget-t.spent_tokens,_),l.spent_total_tokens=Math.min(t.token_budget,t.spent_tokens+l.charged_this_call_tokens),l.remaining_tokens=Math.max(0,t.token_budget-l.spent_total_tokens),l.exhausted=l.remaining_tokens<Qr,l.next_state.spent_tokens=l.spent_total_tokens},f=0,p=0;for(let _=0;_<8;_+=1){u(f);let g=ht(m,n);if(g===f)return m;p=Math.max(p,g),f=g}return u(p),m}function Ya(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]="1cc0fcb7-2aaa-5233-bdfd-4b4d0fb3e9c1")}catch{}})();var bt=Symbol.for("pm.readOutputInvocationProvenance");function Hk(e,t){return Reflect.set(e,bt,{canonical_include_modes:[...t],explicit_legacy_aliases:[],sdk_invocation_observed:!0}),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]="a829643f-ca94-51b0-a6ae-27583cd95b3d")}catch{}})();var Se=["include","amount","cost","encoding"],tc=["canonical","legacy","intent","default"],vt=Lt,u0=Object.freeze(Se.map(e=>vt[e])),f0=jt,nc={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"]},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","--after"],encoding:["--stream"]},validate:{include:["--counts","--full"]},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:{},duplicates:{amount:["--limit"]},"package-catalog":{},"package-manage":{},"comments-audit":{},assurance:{}},rc=new Set(["--collapse","--fields","--section"]),to=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.","--collapse":"--collapse retains dependency grouping semantics; --output-include does not replace it.","--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.","--no-truncate":"--no-truncate is a compatibility alias; prefer --output-limit unbounded --output-budget unbounded.","--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.","--unbounded":"--unbounded is a compatibility alias; prefer --output-limit unbounded."});function no(e){return e.slice(2).replaceAll("-","_")}function Y_(e,t){let n=to[e];if(n!==void 0)return n;let r=t==="include"?rc.has(e)?"<csv>":no(e):t==="amount"?"<n>":t==="cost"?"<tokens>":"<toon|json>";return`${e} is a compatibility alias; prefer ${vt[t]} ${r}.`}function oc(e){let t=nc[e]??{},n=Object.freeze(Object.fromEntries(Se.map(r=>[r,Object.freeze({dimension:r,canonical_option:vt[r],applicable:!0,inapplicable_reason:null,legacy_aliases:Object.freeze((t[r]??[]).map(o=>Object.freeze({flag:o,semantics:to[o]===void 0?"replacement":"behavior_preserving",migration_hint:Y_(o,r),visibility:"hidden_alias"})))})])));return Object.freeze({command:e,dimensions:n,precedence:tc,budget_retention_policy:e==="assurance"?"verdict_priority":"ordered_prefix",projection_modes:Object.freeze([...sc(e).keys()])})}var X_=Object.freeze(Re.map(oc)),J_=new Map(X_.map(e=>[e.command,e]));function Fe(e,t={}){let n=Qe(e.trim().toLowerCase()),r=br(n);return r!==void 0?r.read_output===void 0?void 0:`extension:${r.command}`:Q_(n,t)}function Q_(e,t){let n=e==="package catalog"||e==="packages catalog"||e==="package-catalog"||(e==="package"||e==="packages"||e==="extension")&&(t.catalog===!0||t.target==="catalog"||t.action==="catalog")?"package-catalog":e==="package manage"||e==="package-manage"?"package-manage":e.split(" ")[0],r=n.startsWith("list-")?"list":n==="ctx"?"context":n;return Re.includes(r)?r:void 0}var Z_=["outputInclude","output_include","outputLimit","output_limit","outputBudget","output_budget","outputFormat","output_format","outputSession","output_session","outputCursor","output_cursor","outputRowContract","output_row_contract"],eg={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"],"package-catalog":["activate","adopt","adoptAll","deactivate","doctor","init","install","manage","migrate","reload","scaffold","uninstall"]};function tg(e){return Z_.some(t=>t!=="outputFormat"&&t!=="output_format"&&e[t]!==void 0)}var ng=[{keys:["outputInclude","output_include"],valid:e=>wt(e)!==void 0,message:"--output-include requires at least one comma-separated field or section."},{keys:["outputLimit","output_limit"],valid:e=>e==="unbounded"||Ke(e)!==void 0,message:"--output-limit must be a positive integer or unbounded."},{keys:["outputBudget","output_budget"],valid:e=>e==="unbounded"||Ke(e)!==void 0,message:"--output-budget must be a positive integer or unbounded."},{keys:["outputSession","output_session"],valid:e=>(bn(e),!0),message:"--output-session must be a valid session-state object."},{keys:["outputCursor","output_cursor"],valid:e=>typeof e=="string"&&e.trim().length>0,message:"--output-cursor requires a non-empty continuation cursor."}];function m0(e,t){let n=t.outputFormat??t.output_format;if(n!==void 0&&n!=="json"&&n!=="toon")throw new h("--output-format must be toon or json.",y.USAGE);if(!tg(t))return;let r=Fe(e,t);if(!r)throw new h(`Universal output controls apply only to read commands; ${e||"this command"} is not a read surface.`,y.USAGE);if((eg[r]??[]).some(o=>t[o]!==void 0&&t[o]!==!1))throw new h(`Universal output controls cannot be combined with a ${r} mutation.`,y.USAGE);for(let o of ng){let i=o.keys.map(s=>t[s]).find(s=>s!==void 0);if(i!==void 0&&!o.valid(i))throw new h(o.message,y.USAGE)}}function ic(e){let t=Fe(e);return t?sc(t):new Map}function sc(e){return new Map((nc[e]?.include??[]).filter(t=>!rc.has(t)&&to[t]===void 0).map(t=>[no(t),ac(t)]))}function rg(e,t,n){let r=wt(t)??[],o=ic(e),i=[],s=[],a=n,c=a[bt],d=new Set(c?.canonical_include_modes??[]),l=new Set(c?.explicit_legacy_aliases??[]);for(let f of r){let p=o.get(f);if(p===void 0){i.push(f);continue}let _=`--${f.replaceAll("_","-")}`;oo(ro(n,_))&&l.add(_),n[p]=!0,s.push(f),d.add(f)}let m=Fe(e)==="get"?i.filter(f=>f!=="item"):[],u=m.length>0;return u&&(n.fields=[...new Set([...wt(n.fields)??[],...m])].join(","),d.add("fields")),(s.length>0||u)&&(a[bt]={canonical_include_modes:[...d],explicit_legacy_aliases:[...l],...c?.cli_invocation_observed===!0?{cli_invocation_observed:!0}:{}}),{selectors:i,modes:s}}function p0(e,t){let n=t.outputInclude??t.output_include;if(n===void 0)return;let{selectors:r,modes:o}=rg(e,n,t);if(o.length===0)return;let i=r.length>0?r.join(","):void 0;t.outputInclude=i,Object.hasOwn(t,"output_include")&&(t.output_include=i)}function ac(e){return e.slice(2).replace(/-([a-z])/gu,(t,n)=>n.toUpperCase())}function ro(e,t){let n=ac(t);if(Object.hasOwn(e,n))return e[n];let r=t.slice(2).replaceAll("-","_");if(Object.hasOwn(e,r))return e[r];if(t==="--no-truncate"&&e.truncate===!1)return!0}function oo(e){return e!==void 0&&e!==!1&&e!==null}function wt(e){let t=(Array.isArray(e)?e:[e]).flatMap(n=>typeof n=="string"?n.split(","):[]).map(n=>n.trim()).filter(Boolean);return t.length>0?[...new Set(t)]:void 0}function Ke(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 og(e,t,n,r){for(let o of e.legacy_aliases){if(r(o.flag))continue;let i=ro(t,o.flag),s={value:i,flag:o.flag};if(oo(i)&&n(s))return s}}function Xa(e,t){let n=wt(e);if(n)return{source:"canonical",value:n};if(t)return{source:"legacy",value:wt(t.value)??[no(t.flag)]}}function Ja(e,t){if(e==="unbounded")return{source:"canonical",value:"unbounded"};let n=Ke(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 r=Ke(t.value);return r===void 0?void 0:{source:"legacy",value:r}}function Qa(e,t){if(e==="unbounded")return{source:"canonical",value:"unbounded"};let n=Ke(e);if(n!==void 0)return{source:"canonical",value:n};if(!t)return;let r=Ke(t.value);return r===void 0?void 0:{source:"legacy",value:r}}function Za(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 cc(e,t,n){if(!e)return!1;let r=new Set(e.explicit_legacy_aliases);if(e.cli_invocation_observed===!0||e.sdk_invocation_observed===!0)return!r.has(n);let o=new Set(e.canonical_include_modes.map(i=>`--${i.replaceAll("_","-")}`));return t==="include"&&o.has(n)&&!r.has(n)}function ig(e,t,n,r){return e.trim().toLowerCase().replaceAll(/\s+/gu," ").split(" ")[0]==="list-all"||oo(ro(r,"--no-truncate"))&&!cc(n,"amount","--no-truncate")||t.amount?.flag==="--no-truncate"||t.include?.flag==="--full"||n?.canonical_include_modes.includes("full")===!0}function sg(e,t){return Se.flatMap(n=>e[n]?.source==="canonical"||n==="include"&&(t?.canonical_include_modes.length??0)>0?[vt[n]]:[])}function dc(e,t){let n=Fe(e,t);if(!n)return;let r=J_.get(n)??oc(n),o=t[bt],i={include:b=>Xa(void 0,b),amount:b=>Ja(void 0,b),cost:b=>Qa(void 0,b),encoding:b=>Za(void 0,b)},s=Object.fromEntries(Se.map(b=>[b,og(r.dimensions[b],t,k=>i[b](k)!==void 0,k=>cc(o,b,k))])),a=Se.flatMap(b=>{let k=s[b];return k?[k.flag]:[]}),c=Se.flatMap(b=>{let k=s[b];return k?[r.dimensions[b].legacy_aliases.find(F=>F.flag===k.flag).migration_hint]:[]}),d=Za(t.outputFormat??t.output_format,s.encoding),l=Xa(t.outputInclude??t.output_include,s.include),m=Ja(t.outputLimit??t.output_limit,s.amount),u=Qa(t.outputBudget??t.output_budget,s.cost),f=ig(e,s,o,t),p=Zo(e,{generateFallback:!0}),_=d?.value==="json"||t.resolvedOutputFormat==="json"?"json":"toon",g=u??(f?{source:"intent",value:"unbounded"}:{source:"default",value:p.default_max_estimated_tokens_by_format[_]});return{command:n,include:l,amount:m,cost:g,encoding:d,canonical_options_used:sg({include:l,amount:m,cost:g,encoding:d},o),legacy_aliases_used:a,migration_hints:c,precedence:tc}}function D(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var io=new Set(["applied_bound","applied_limit","completeness","continuation_kind","continuation_path","continuation_contract","count","filters","has_more","next_cursor","now","omission_receipt","projection","budget_retention_policy","row_contract","sorting","total","truncated"]),ag=["collection_counts","notes_count","tests_count"];function lc(e,t){let n=new Set(t.map(r=>r.split(".")[0]));return Object.fromEntries(Object.entries(e).filter(([r])=>n.has(r)))}function cg(e){let t=D(e.item)?e.item:{},n=[...new Set([...Object.keys(t),...ag.filter(o=>Object.hasOwn(t,o))])].sort((o,i)=>o.localeCompare(i)),r=Object.keys(e).filter(o=>o!=="item"&&o!=="read_output"&&!io.has(o)).sort((o,i)=>o.localeCompare(i));return{item:t,itemFields:n,sections:r,valid:[...n,"item",...n.map(o=>`item.${o}`),...r]}}function dg(e,t){let n=cg(e),r=t.filter(l=>!n.valid.includes(l));if(r.length>0)throw new h(`Unknown --output-include selector(s) for get: ${r.join(", ")}. Valid selectors: ${n.valid.join(", ")}.`,y.USAGE);let o=t.includes("item"),i=t.flatMap(l=>l.startsWith("item.")?[l.slice(5)]:n.itemFields.includes(l)?[l]:[]).filter((l,m,u)=>u.indexOf(l)===m);if(o&&i.length>0)throw new h("--output-include cannot mix a full item with projected item fields; use item or item.<field>, not both.",y.USAGE);let s=new Set(t.filter(l=>n.sections.includes(l))),a=Object.fromEntries(Object.entries(e).filter(([l])=>io.has(l)||s.has(l)));o?a.item=n.item:i.length>0&&(a.item=lc(n.item,i));let c=[...o?[]:i.length>0?n.itemFields.filter(l=>!i.includes(l)).map(l=>({name:`item.${l}`,restore_with:`--output-include item.${l}`})):[{name:"item",restore_with:"--output-include item"}],...n.sections.filter(l=>!s.has(l)).map(l=>({name:l,restore_with:`--output-include ${l}`}))],d=[...D(a.omission_receipt)&&Array.isArray(a.omission_receipt.omitted_field_groups)?a.omission_receipt.omitted_field_groups:[],...c];return a.omission_receipt={has_omissions:d.length>0,omitted_field_group_count:d.length,omitted_field_groups:d},a}function ec(e){let t=0;return ut({...e},n=>(D(n)&&Object.keys(n).length>0&&(t+=1),n)),t}function lg(e,t,n,r){if(ec(t)===0||ec(n)>0)return;let o=[...ic(e).keys()],i=o.length>0?` Declared ${e} projection modes: ${o.join(", ")}.`:` The ${e} surface declares no projection modes; name row fields instead.`;throw new h(`Unknown --output-include selector(s) for ${e}: ${r.join(", ")}. No selector matched any returned row field.${i}`,y.USAGE)}function ug(e,t,n){if(e==="get")return dg(t,n);let r=Zt(t),o=n.flatMap(s=>r.flatMap(a=>s.startsWith(`${a}.`)?[s.slice(a.length+1)]:[])),i=n.some(s=>Object.hasOwn(t,s.split(".")[0])&&!r.some(a=>s.startsWith(`${a}.`)));if(r.length>0&&(!i||o.length>0)){let s={...t},a=o.length>0?o:n,c=ut(s,d=>D(d)?lc(d,a):d);return lg(e,t,c,a),c}return Object.fromEntries(Object.entries(t).filter(([s])=>n.some(a=>a.split(".")[0]===s)||io.has(s)))}function fg(e,t){if(t==="unbounded")return e;let{result:n,truncated:r}=Bs(e,t);if(!r)return n;if(n.has_more=!0,n.truncated=!0,typeof n.count=="number"){let o=D(n.projection)?n.projection.row_key:void 0;n.count=typeof o=="string"&&Array.isArray(n[o])?n[o].length:en(n)}return n.applied_bound={kind:"output_limit",source:"explicit",value:t},n}function mg(e){return Se.filter(t=>e[t]!==void 0&&e[t]?.source!=="default"||e.canonical_options_used.includes(vt[t]))}function uc(e){let t=e.resolvedOutputFormat??e.outputFormat??e.output_format??e.format;return t==="json"||t==="toon"?t:void 0}function wn(e,t,n,r){let o=eo(e,t,r);We(e,o);for(let i=0;i<8;i+=1){let s=n.estimated_tokens,a=o.read_session.spent_this_call_tokens;le(o,n,r);let c=o;o=eo(o,t,r),We(c,o);let d=o.read_session.spent_this_call_tokens;if(n.estimated_tokens===s&&d===a)return o}return o}function qr(e,t){if(!D(e.read_output))return e;let n=uc(t),r=e.read_output,o=bn(t.outputSession??t.output_session);return o===void 0?(le(e,r,n),e):wn(e,o,r,n)}function pg(e,t){if(e!=="validate")return t;let n=D(t.projection)?t.projection:void 0;if(!(Array.isArray(n?.declared_field_groups)?n.declared_field_groups:[]).some(l=>D(l)&&l.name==="diagnostic_rows"))return t;let r=[...new Set(lt(t).map(({path:l})=>l).filter(l=>/^checks\.\d+\.details\./u.test(l)))],o=r.filter(l=>!r.some(m=>m!==l&&l.startsWith(`${m}.`)));if(o.length===0)return t;let i=D(t.row_contract)?t.row_contract:{},s=Array.isArray(i.row_keys)?i.row_keys.filter(l=>typeof l=="string"):[],a=Array.isArray(i.continuation_row_keys)?i.continuation_row_keys.filter(l=>typeof l=="string"):[],c=s.length>0?s:o,d=[...new Set(o)];return JSON.stringify(c)===JSON.stringify(s)&&JSON.stringify(d)===JSON.stringify(a)?t:{...t,row_contract:{...i,row_keys:c,continuation_row_keys:d,jq_selector:typeof i.jq_selector=="string"?i.jq_selector:".checks[].details"}}}function _g(e,t,n,r,o){let i={...e};if(t.include?.source==="canonical"&&(i=ug(t.command,i,t.include.value)),t.command==="assurance"&&(i=Ks(i)),ft(i,e),i=Hs(i,t.command,r),t.command==="history"&&r){let c=["compact_history","provenance_history","history","diff"];if(i=Object.fromEntries(Object.entries(i).filter(([d])=>!c.includes(d)||d===r.path)),D(i.projection)&&(i.projection={...i.projection,row_key:r.path}),D(i.row_contract)){let d=i.row_contract;i.row_contract={...d,row_keys:[r.path],...Array.isArray(d.continuation_row_keys)?{continuation_row_keys:[r.path]}:{}}}i.count=Object.keys(i[r.path]).length}let s=e.count_only===!0?{...i,count_only:!0,count:e.count}:i,a=vg(i,e,t.command,r,o);return t.amount?.source==="canonical"&&(i=fg(i,t.amount.value),a.cursorContinuesExistingPage&&_c(i,a.originalItems,a.cursorSource,!0,a.originalItemOffset)),ft(i,s),{projected:n===void 0?i:Ha(i,n),continuationState:a}}function gg(e,t){return[...e.cost!==void 0&&e.cost.value!=="unbounded"&&(e.cost.source==="canonical"||e.cost.source==="default"||e.command==="context"&&e.cost.source==="legacy")?[{source:e.cost.source,tokens:e.cost.value}]:[],...t===void 0?[]:[{source:"session",tokens:Ya(t)}]].sort((n,r)=>n.tokens-r.tokens)[0]}function fc(e){let t=e.canonical_options_used;return t&&t.length>0?{canonical_options_used:t}:{}}function mc(e,t){return D(e.context_intent)&&e.context_intent.command==="context"&&e.context_intent.token_budget===t&&e.context_intent.within_budget===!0}function pc(e,t={}){return e?.source==="default"||e?.source==="legacy"&&!mc(t,e.tokens)?{budget_source:e.source,budget_tokens:e.tokens}:{}}function yg(e,t,n,r,o,i){let s={contract_version:1,command:e.command,requested_dimensions:t,...pc(r),precedence:e.precedence,...fc(e),legacy_aliases_used:[],migration_hints:[],estimated_tokens:0,within_budget:!1,strings_compacted:!1,rows_compacted:!1,result_omitted:!0,...n===void 0?{omitted_result_estimated_tokens:o}:{}},a={output_budget_exceeded:{omitted_result:!0,reason:"requested_budget_infeasible",restore_with:"Unbounded",recovery:{outputBudget:"unbounded"}},read_output:s},c=n===void 0?a:wn(a,n,s,i);if(n===void 0&&le(c,s,i),n!==void 0&&s.estimated_tokens>r.tokens)throw new h("The remaining output-session budget cannot fit its mandatory receipts; start a new session with a larger token_budget.",y.USAGE);return c}function hg(e,t,n){return e.command==="context"&&e.cost?.source==="legacy"&&!mc(n,e.cost.value)||t.outputRowContract===!0||t.output_row_contract===!0||e.canonical_options_used.includes("--output-include")||e.command==="list"&&e.canonical_options_used.length>0&&e.include?.value.includes("full")===!0}function bg(e,t,n,r,o){if(t!==void 0||hg(e,o,n))return!1;if(e.amount?.source==="canonical"&&e.amount.value!=="unbounded"){let i=e.amount.value;if(ie(n).some(({value:s})=>(Array.isArray(s)?s.length:Object.keys(s).length)>i))return!1}return e.cost===void 0||e.cost.value==="unbounded"||e.cost.source==="legacy"&&e.command!=="context"||ht(o.outputRowContract===!1?Object.fromEntries(Object.entries(n).filter(([i])=>i!=="row_contract")):n,r)<=e.cost.value}function wg(e,t,n,r,o,i,s){if(!n.rows_compacted)return;let a=t.amount?.value==="unbounded"?["amount"]:[],c=new Map(je(e).map(p=>[p.path,Array.isArray(p.value)?p.value.length:Object.keys(p.value).length])),d=[...s.entries()].flatMap(([p,_])=>{let g=c.get(p);if(g>=_.rows)return[];let b=_.baseOffset+g;return[{path:p,cursor:Er({command:t.command,path:p,offset:b,total_rows:_.totalRows,fingerprint:_.fingerprint}),retained_rows:g,remaining_rows:_.totalRows-b,total_rows:_.totalRows}]}),l=d[0],m=l?"; page --output-cursor":"",u=r.source==="session"?`Truncated by the remaining ${r.tokens}-token session budget; start a new output session with a larger token_budget${m}.`:`${r.tokens}-token: raise --output-budget${m}`;n.migration_hints=[u,...t.migration_hints];let f=Jr({effective_budget_tokens:r.tokens,measured_result_tokens:i});l&&!o&&(typeof e.next_cursor!="string"||e.continuation_kind==="output_cursor")&&(e.next_cursor=l.cursor),e.continuation_kind=o?"producer_cursor":l?"output_cursor":"none",e.output_budget_truncation={reason:"output_budget_reached",budget_source:r.source,budget_tokens:r.tokens,overridden_dimensions:a,compacted_row_paths:n.compacted_row_paths,continuation_cursor_rebased:o,continuation_available:d.length>0,recovery_budget_multiplier:l?1:f.recovery_budget_multiplier,continuations:d,restore_with:l?"recovery":`Retry with --output-budget ${f.output_budget} because no declared row collection can be continued.`,recovery:l?{cursor:l.cursor,cli:"--output-cursor",sdk:"outputCursor",mcp:"outputCursor"}:{cli:`--output-budget ${f.output_budget}`,sdk:{outputBudget:f.output_budget},mcp:{outputBudget:f.output_budget}}}}function _c(e,t,n,r,o){if(typeof n!="string"||!Array.isArray(e.items))return!1;let i=e.items.length,s=t.length;if(i===0||i>=s)return!1;let a;try{a=Sr(n)}catch{return!1}let c=a.after_index;if(c===void 0)return!1;let d=t[i-1];if(Object.prototype.toString.call(d)!=="[object Object]")return!1;let l=Reflect.get(d,"id");if(typeof l!="string"||l.length===0)return!1;let m=r?c-(s-i):c+o+i;return m<0?!1:(e.next_cursor=gt(a.fingerprint,l,m,a.snapshot),!0)}function vg(e,t,n,r,o){let i=new Map(je(e).map(c=>{let d=Array.isArray(c.value)?c.value.length:Object.keys(c.value).length,l=r?.path===c.path;return[c.path,{rows:d,totalRows:l?r.total_rows:d,baseOffset:l?r.offset:0,fingerprint:l?r.fingerprint:tn(c.path,c.value,n)}]})),s=typeof e.next_cursor=="string",a=r?.path==="items"?r.offset:0;return{collectionsBeforeBudget:i,originalItems:Array.isArray(t.items)?a>0?t.items.slice(a):t.items:[],originalItemOffset:a,cursorContinuesExistingPage:s,cursorSource:s?e.next_cursor:o.after}}function Eg(e,t,n,r,o,i,s,a,c,d){let l={...t,count_only:n},m=r.command==="assurance"&&Array.isArray(e.assertions)?e.assertions.filter(f=>D(f)&&f.verdict!=="pass").length:0,u=new Map;if(m>0&&u.set("assertions",m),r.command==="history"&&Array.isArray(e.diff))for(let f of lt(e))f.path.startsWith("diff.")&&u.set(f.path,Object.keys(f.value).length);return Ga(e,o,i.tokens,u,d,f=>{ft(f,l);let p=_c(f,a.originalItems,a.cursorSource,a.cursorContinuesExistingPage,a.originalItemOffset);if(wg(f,r,o,i,p,c,a.collectionsBeforeBudget),r.command==="history"&&D(f.projection)){f.has_more=typeof f.next_cursor=="string"||f.applied_bound?.kind==="output_limit";let _=f.projection.row_key;typeof _=="string"&&Array.isArray(f[_])&&(f.count=f[_].length)}s!==void 0&&Object.assign(f,wn(f,s,o,d))},r.command==="history"&&Array.isArray(e.diff))}function Ca(e,t,n){let r=dc(e,t);if(!r)return n;let o=uc(t),i=bn(t.outputSession??t.output_session),s=t.outputCursor??t.output_cursor,a=typeof s=="string"?_t(s):void 0,c=mg(r),d=pg(r.command,n);if(a===void 0&&bg(r,i,d,o,t))return d;let l=gg(r,i),m=_g(d,r,i,a,t),u=m.projected;We(u,u,t.outputRowContract===!1);let f={contract_version:1,command:r.command,requested_dimensions:c,...pc(l,u),precedence:r.precedence,...fc(r),legacy_aliases_used:r.legacy_aliases_used,migration_hints:r.migration_hints,estimated_tokens:0,within_budget:!0,strings_compacted:!1,rows_compacted:!1,result_omitted:!1};if(u.read_output=f,u=i===void 0?u:wn(u,i,f,o),le(u,f,o),l!==void 0&&f.estimated_tokens>l.tokens){let p=Va(r.command,t,u);p!==void 0&&(f.applied_depth="brief",f.degradation_reason="output_budget_reached",We(u,p),u=qr(p,t)),f.estimated_tokens>l.tokens&&(u=Eg(u,u,d.count_only===!0,r,f,l,i,m.continuationState,f.estimated_tokens,o))}return l!==void 0&&f.estimated_tokens>l.tokens?yg(r,c,i,l,f.estimated_tokens,o):u}function k_(e){return D(e)&&D(e.output_budget_exceeded)&&e.output_budget_exceeded.omitted_result===!0&&e.output_budget_exceeded.reason==="requested_budget_infeasible"}function O_(e,t){let n=t.outputFormat??t.output_format;if(n==="json"||n==="toon")return n;let r=dc(e,t)?.encoding;return r?.value==="json"||r?.value==="toon"?r.value:void 0}export{It as a,qo as b,Fn as c,wl as d,vl as e,S as f,gc as g,lo as h,Og as i,Sg as j,uo as k,Ag as l,Cg as m,Ig as n,Tg as o,Rg as p,xg as q,Ng as r,Dg as s,Pg as t,$g as u,Mg as v,Lg as w,jg as x,yc as y,Fg as z,Ug as A,zg as B,qg as C,Bg as D,Vg as E,Gg as F,Di as G,_l as H,ph as I,Lo as J,jo as K,Xi as L,Ji as M,bc as N,wc as O,Sn as P,In as Q,Tn as R,Jg as S,Qg as T,Zg as U,Tc as V,mo as W,ey as X,qn as Y,Gn as Z,zh as _,ou as $,Bh as aa,Vh as ba,Gh as ca,ii as da,si as ea,Wh as fa,Kh as ga,Hh as ha,Yh as ia,go as ja,Lc as ka,ho as la,ko as ma,dy as na,Dn as oa,Yc as pa,ly as qa,dd as ra,ld as sa,uy as ta,fy as ua,Ey as va,ky as wa,Oy as xa,Co as ya,So as za,Sy as Aa,Ay as Ba,Cy as Ca,Pn as Da,Iy as Ea,fe as Fa,B as Ga,xy as Ha,Ny as Ia,Ld as Ja,To as Ka,$n as La,Ud as Ma,zd as Na,Pt as Oa,xo as Pa,Bd as Qa,Wd as Ra,jy as Sa,Fy as Ta,Xd as Ua,Jd as Va,Qd as Wa,Zd as Xa,Mn as Ya,zy as Za,el as _a,Qe as $a,$t as ab,qy as bb,By as cb,Vy as db,tl as eb,nl as fb,rl as gb,Yy as hb,Xy as ib,ol as jb,Mt as kb,Jy as lb,Qy as mb,il as nb,sl as ob,al as pb,Do as qb,Te as rb,cl as sb,Zy as tb,eh as ub,th as vb,nh as wb,rh as xb,oh as yb,ih as zb,Re as Ab,Ft as Bb,lh as Cb,qt as Db,Yn as Eb,Xn as Fb,Jn as Gb,Qn as Hb,Zn as Ib,er as Jb,rr as Kb,Ti as Lb,yh as Mb,nf as Nb,of as Ob,sf as Pb,pf as Qb,Pw as Rb,$w as Sb,Mw as Tb,Xs as Ub,zw as Vb,Df as Wb,El as Xb,Un as Yb,Sl as Zb,Al as _b,Kw as $b,zf as ac,Hw as bc,Yw as cc,Xw as dc,Jw as ec,Qw as fc,Zw as gc,ev as hc,ws as ic,qf as jc,tv as kc,nv as lc,vs as mc,rv as nc,Es as oc,ov as pc,iv as qc,sv as rc,Ht as sc,Oh as tc,Sh as uc,Ms as vc,pv as wc,_v as xc,gv as yc,Ls as zc,js as Ac,Av as Bc,Us as Cc,Jt as Dc,Tl as Ec,xh as Fc,Jo as Gc,Rl as Hc,Fl as Ic,zl as Jc,Qo as Kc,ql as Lc,Bl as Mc,Zo as Nc,_e as Oc,ei as Pc,Nh as Qc,Dh as Rc,Nv as Sc,ft as Tc,bt as Uc,Hk as Vc,Se as Wc,u0 as Xc,f0 as Yc,X_ as Zc,Fe as _c,m0 as $c,ic as ad,rg as bd,p0 as cd,dc as dd,qr as ed,Ca as fd,k_ as gd,O_ as hd,Ws as id,tn as jd,Er as kd,_t as ld,Kv as md,Hv as nd,gt as od,Sr as pd,Ar as qd,Yv as rd,Dm as sd,Xv as td,Jv as ud,nE as vd,Tr as wd,cE as xd,Bm as yd,dE as zd,Ue as Ad,lE as Bd,uE as Cd,Nr as Dd,Dr as Ed,Pr as Fd,TE as Gd,vp as Hd,an as Id,Cp as Jd,ya as Kd,Tp as Ld,Y as Md,T as Nd,zE as Od,un as Pd,Up as Qd,qE as Rd,BE as Sd,zp as Td,VE as Ud,GE as Vd,WE as Wd,Ia as Xd,Gp as Yd,ok as Zd,Kp as _d,Ra as $d,ik as ae,Na as be,Yp as ce,Zp as de,o_ as ee,f_ as fe,uk as ge,_n as he,fk as ie,mk as je,pk as ke,_k as le,gk as me,yk as ne,R_ as oe,qa as pe,Mk as qe,Jr as re,ht as se,Wk as te,Zr as ue,bn as ve,Ha as we,eo as xe,Ya as ye};
|
|
26
|
+
//# sourceMappingURL=chunk-NC5HUGHU.js.map
|