@unbrained/pm-cli 2026.8.18 → 2026.8.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +2 -2
- package/CHANGELOG.md +35 -2
- package/dist/cli/error-guidance.js +3 -2
- package/dist/cli/help-content.js +32 -13
- package/dist/cli/help-json-payload.d.ts +15 -0
- package/dist/cli/help-json-payload.js +101 -23
- package/dist/cli/main.js +6 -2
- package/dist/cli/register-list-query.js +18 -13
- package/dist/cli/register-mutation.js +8 -8
- package/dist/cli/register-operations.js +6 -6
- package/dist/cli/register-structured-mutation.d.ts +2 -0
- package/dist/cli/register-structured-mutation.js +29 -6
- package/dist/cli-bundle/bundle-manifest.json +151 -143
- package/dist/cli-bundle/chunks/{chunk-UYCLQVL2.js → chunk-2RDVGYWE.js} +12 -12
- package/dist/cli-bundle/chunks/{chunk-BSK2IN3C.js → chunk-4GB2LTOQ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-RZQTVMRQ.js → chunk-7BRF2BX2.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-BLVQHFSY.js +35 -0
- package/dist/cli-bundle/chunks/chunk-CU25EQVV.js +5 -0
- package/dist/cli-bundle/chunks/chunk-K3EN3LK2.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-YRGOLZA7.js → chunk-L4LGPBJU.js} +49 -49
- package/dist/cli-bundle/chunks/chunk-RS3IV2R6.js +197 -0
- package/dist/cli-bundle/chunks/chunk-TSMWLCHS.js +3 -0
- package/dist/cli-bundle/chunks/chunk-US2ZQW2M.js +77 -0
- package/dist/cli-bundle/chunks/{chunk-5UZZAJKR.js → chunk-XYDDWBZN.js} +2 -2
- package/dist/cli-bundle/chunks/register-list-query-JSAQCVOC.js +11 -0
- package/dist/cli-bundle/chunks/register-mutation-XJPAW63D.js +20 -0
- package/dist/cli-bundle/chunks/register-operations-DSOSB2XQ.js +2 -0
- package/dist/cli-bundle/chunks/{register-setup-PPPEF3SN.js → register-setup-QUR6QL2C.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-325UXIO7.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-5L7M4AI7.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-ODOVCP45.js → chunk-6AHG2YW7.js} +44 -44
- package/dist/cli-bundle/focused-chunks/chunk-AZBACT5T.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-TN4AE665.js → chunk-BLJCGGID.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-FUREQLQN.js +18 -0
- package/dist/cli-bundle/focused-chunks/{chunk-M62NO7EI.js → chunk-G3C5ERXG.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-K43KKAFS.js → chunk-GXWQBE3T.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-UI6AJ5TD.js → chunk-JWKEDZJI.js} +3 -3
- package/dist/cli-bundle/focused-chunks/chunk-KYZ6JGPL.js +155 -0
- package/dist/cli-bundle/focused-chunks/{chunk-EX6MKP2X.js → chunk-M32HFIQB.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-EUEGXZ2A.js → chunk-OM65KHGF.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-Q47EX4DI.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-V5XTGLK7.js → chunk-RIHDMCUM.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-T4ZFY7ZJ.js +16 -0
- package/dist/cli-bundle/focused-chunks/chunk-TDR5OGG3.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-UGSS4F5X.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-Z3PLWSGM.js +2 -0
- package/dist/cli-bundle/main.js +13 -13
- package/dist/cli-bundle/sdk-authoring.js +1 -1
- package/dist/cli-bundle/sdk-contracts.js +2 -1
- package/dist/cli-bundle/sdk-core.js +41 -41
- 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 +32 -32
- 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 +5 -4
- package/dist/core/output/mutation-projection.js +26 -2
- package/dist/core/shared/constants.d.ts +1 -5
- package/dist/core/shared/constants.js +3 -81
- package/dist/core/shared/errors.d.ts +2 -0
- package/dist/core/shared/errors.js +2 -2
- package/dist/core/shared/item-metadata-contract.d.ts +14 -0
- package/dist/core/shared/item-metadata-contract.js +90 -0
- package/dist/core/store/item-store.d.ts +60 -0
- package/dist/core/store/item-store.js +22 -5
- package/dist/sdk/agent/closed-domain-contracts.d.ts +25 -0
- package/dist/sdk/agent/closed-domain-contracts.js +140 -0
- package/dist/sdk/agent/refusal-closure.d.ts +53 -0
- package/dist/sdk/agent/refusal-closure.js +134 -0
- package/dist/sdk/agent/refusal-reachability.d.ts +27 -1
- package/dist/sdk/agent/refusal-reachability.js +26 -2
- package/dist/sdk/agent-capability-contracts.d.ts +13 -0
- package/dist/sdk/agent-capability-contracts.js +101 -9
- package/dist/sdk/cli-contracts/command-aliases.js +18 -2
- package/dist/sdk/cli-contracts/commander-mutation-options.js +30 -6
- package/dist/sdk/cli-contracts/commander-types.js +5 -4
- package/dist/sdk/cli-contracts/completeness.js +8 -2
- package/dist/sdk/cli-contracts/enum-contracts.d.ts +4 -2
- package/dist/sdk/cli-contracts/enum-contracts.js +16 -6
- package/dist/sdk/cli-contracts/flag-contracts.d.ts +7 -0
- package/dist/sdk/cli-contracts/flag-contracts.js +84 -8
- package/dist/sdk/cli-contracts/flag-lexicon-contracts.d.ts +72 -0
- package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +340 -0
- package/dist/sdk/cli-contracts/grammar-contracts.d.ts +83 -2
- package/dist/sdk/cli-contracts/grammar-contracts.js +618 -2
- package/dist/sdk/cli-contracts/runtime-contracts.d.ts +15 -4
- package/dist/sdk/cli-contracts/runtime-contracts.js +47 -13
- package/dist/sdk/cli-contracts/tool-option-contracts.d.ts +28 -1
- package/dist/sdk/cli-contracts/tool-option-contracts.js +38 -3
- package/dist/sdk/cli-contracts/tool-schema.js +7 -2
- package/dist/sdk/cli-contracts.d.ts +4 -3
- package/dist/sdk/cli-contracts.js +6 -5
- package/dist/sdk/context-intent-contracts.d.ts +2 -2
- package/dist/sdk/context-intent-contracts.js +22 -7
- package/dist/sdk/contracts.d.ts +3 -0
- package/dist/sdk/contracts.js +5 -2
- package/dist/sdk/core.d.ts +1 -1
- package/dist/sdk/core.js +3 -3
- package/dist/sdk/flag-invocation-contracts.d.ts +37 -0
- package/dist/sdk/flag-invocation-contracts.js +218 -9
- package/dist/sdk/generated/generated-error-code-catalog-part-1.js +206 -2
- package/dist/sdk/generated/generated-error-code-catalog-part-2.js +244 -40
- package/dist/sdk/index.d.ts +11 -7
- package/dist/sdk/index.js +10 -6
- package/dist/sdk/init-agent-guidance.d.ts +5 -3
- package/dist/sdk/init-agent-guidance.js +69 -9
- package/dist/sdk/lifecycle/mcp-actions.d.ts +18 -0
- package/dist/sdk/lifecycle/mcp-actions.js +52 -0
- package/dist/sdk/lifecycle/reopen.d.ts +44 -0
- package/dist/sdk/lifecycle/reopen.js +69 -0
- package/dist/sdk/lifecycle/update.d.ts +31 -0
- package/dist/sdk/lifecycle/update.js +95 -13
- package/dist/sdk/output-projection.d.ts +2 -0
- package/dist/sdk/output-projection.js +11 -5
- package/dist/sdk/query/get.d.ts +1 -1
- package/dist/sdk/query/get.js +34 -49
- package/dist/sdk/query/list.d.ts +7 -21
- package/dist/sdk/query/list.js +44 -44
- package/dist/sdk/query/projection-contracts.d.ts +33 -0
- package/dist/sdk/query/projection-contracts.js +185 -0
- package/dist/sdk/query/search-contracts.d.ts +3 -2
- package/dist/sdk/query/search-contracts.js +30 -85
- package/dist/sdk/query/search.d.ts +15 -0
- package/dist/sdk/query/search.js +32 -6
- package/dist/sdk/read-output/continuation.d.ts +1 -1
- package/dist/sdk/read-output/continuation.js +7 -24
- package/dist/sdk/read-output-contracts.js +55 -6
- package/dist/sdk/read-output-rows.d.ts +4 -0
- package/dist/sdk/read-output-rows.js +47 -18
- package/dist/sdk/runtime-primitives.d.ts +1 -1
- package/dist/sdk/runtime-primitives.js +3 -3
- package/dist/sdk/runtime.d.ts +6 -0
- package/dist/sdk/runtime.js +25 -17
- package/dist/sdk/similarity.d.ts +13 -0
- package/dist/sdk/similarity.js +32 -6
- package/dist/sdk/workspace-snapshot.d.ts +2 -0
- package/dist/sdk/workspace-snapshot.js +10 -2
- package/docs/COMMANDS.md +29 -5
- package/docs/OUTPUT_PROJECTION_CONTRACTS.md +11 -2
- package/docs/README.md +1 -0
- package/docs/READ_OUTPUT_CONTRACTS.md +10 -6
- package/docs/RECURRENCE_RECOVERY_CONTRACTS.md +114 -0
- package/docs/SDK.md +16 -2
- package/docs/SDK_CONTEXT_INTEGRITY.md +45 -0
- package/docs/TESTING.md +14 -1
- package/docs/generated/AGENT_COMMAND_SURFACE.md +78 -78
- package/docs/generated/FLAG_LEXICON_BUDGETS.md +76 -0
- package/docs/performance/sdk-entrypoint-import-costs.md +14 -21
- package/marketplace.json +2 -2
- package/package.json +9 -7
- package/packages/pm-beads/package.json +1 -1
- package/packages/pm-calendar/package.json +1 -1
- package/packages/pm-command-kit/package.json +1 -1
- package/packages/pm-digital-twin/package.json +1 -1
- package/packages/pm-governance-audit/package.json +1 -1
- package/packages/pm-guide-shell/package.json +1 -1
- package/packages/pm-kanban/package.json +1 -1
- package/packages/pm-lifecycle-hooks/package.json +1 -1
- package/packages/pm-linked-test-adapters/package.json +1 -1
- package/packages/pm-search-advanced/package.json +1 -1
- package/packages/pm-templates/package.json +1 -1
- package/packages/pm-todos/package.json +1 -1
- package/packages/pm-vcs/package.json +1 -1
- package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
- package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
- package/scripts/generate-agent-capability-surfaces.mjs +20 -14
- package/sdk/public-surface.json +950 -24
- package/dist/cli-bundle/chunks/chunk-ALDJGKAK.js +0 -2
- package/dist/cli-bundle/chunks/chunk-DY4DMUMC.js +0 -197
- package/dist/cli-bundle/chunks/chunk-GNFAFIJI.js +0 -77
- package/dist/cli-bundle/chunks/chunk-L5Q2CLPE.js +0 -35
- package/dist/cli-bundle/chunks/chunk-PVRUN5ZS.js +0 -5
- package/dist/cli-bundle/chunks/chunk-SARFF5H5.js +0 -3
- package/dist/cli-bundle/chunks/register-list-query-I23LALEE.js +0 -11
- package/dist/cli-bundle/chunks/register-mutation-6YGU3GPH.js +0 -20
- package/dist/cli-bundle/chunks/register-operations-4HTFC6J7.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-2PN4TJXH.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-3TKWMNKF.js +0 -18
- package/dist/cli-bundle/focused-chunks/chunk-5AF3ZBNB.js +0 -155
- package/dist/cli-bundle/focused-chunks/chunk-C5IW2NDA.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-RNDNMARJ.js +0 -16
- package/dist/cli-bundle/focused-chunks/chunk-TVV2DONO.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-WGHQVU6P.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-XYNBXTDQ.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-Z56ECT7I.js +0 -2
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{E as w,F as m,Ka as c}from"./chunk-
|
|
1
|
+
import{E as w,F as m,Ka as c}from"./chunk-JWKEDZJI.js";import{l as d}from"./chunk-Q47EX4DI.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]="989b570c-112e-5ee3-8731-ab34f215ba45")}catch{}})();var x=new Map(d.map(e=>[e.toLowerCase(),e])),$=/^[A-Za-z][A-Za-z0-9_-]*$/;function g(e,t){if(!$.test(e))throw new Error(`${t} "${e}" is not a valid identifier. Use a single letter-led token of letters, digits, hyphen, or underscore with no spaces or punctuation (e.g. "Spike" or "code-review").`)}function y(e){return x.get(e.trim().toLowerCase())}function T(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function I(e){return e.replace(/[\\"`$]/g,t=>`\\${t}`)}function b(e){let t=new Map;for(let o of e){let n=o.trim();if(n.length===0)continue;let i=n.toLowerCase();t.has(i)||t.set(i,n)}return[...t.values()].sort((o,n)=>o.localeCompare(n))}function k(e){let t=(e.name??"").trim();if(t.length===0)throw new Error("Type name must not be empty.");g(t,"Type name");let o=y(t);if(o)throw new Error(`Cannot redefine built-in item type "${o}". Built-in types are reserved: ${d.join(", ")}.`);let n=e.description?.trim(),i=e.defaultStatus?.trim(),a=e.folder?.trim(),r=a&&a.length>0?m(a):void 0,s=b(e.aliases??[]);for(let l of s){g(l,"Alias");let f=y(l);if(f)throw new Error(`Alias "${l}" collides with built-in item type "${f}". Built-in types are reserved: ${d.join(", ")}.`)}return{name:t,description:n&&n.length>0?n:void 0,defaultStatus:i&&i.length>0?i:void 0,folder:r,aliases:s}}function S(e,t){let o=e.name.toLowerCase(),n=new Map;for(let a of t.definitions){if(typeof a.name!="string")continue;let r=a.name.trim();if(!(r.length===0||r.toLowerCase()===o)){n.set(r.toLowerCase(),r);for(let s of T(a.aliases))s.trim().length>0&&n.set(s.trim().toLowerCase(),r)}}let i=n.get(o);if(i)throw new Error(`Type name "${e.name}" collides with an alias of existing item type "${i}".`);for(let a of e.aliases){let r=n.get(a.toLowerCase());if(r)throw new Error(`Alias "${a}" already maps to existing item type "${r}".`)}}function h(e,t){return typeof t=="string"&&t.trim().length>0?m(t).toLowerCase():w(e).toLowerCase()}function D(e,t,o){let n=e.name.toLowerCase(),i=h(e.name,e.folder),a=s=>{throw new Error(`Item type "${e.name}" would store items in folder "${i}", which already belongs to existing item type "${s}". Pass a distinct --folder to keep their storage separate.`)};for(let s of t.definitions){if(typeof s.name!="string")continue;let l=s.name.trim();l.length===0||l.toLowerCase()===n||h(l,s.folder)===i&&a(l)}let r=o?.get(i);r!==void 0&&r.toLowerCase()!==n&&a(r)}function j(e){if(e==null||e.trim().length===0)return{definitions:[]};let t;try{t=JSON.parse(e)}catch{throw new Error("schema/types.json contains invalid JSON.")}return{definitions:L(t)}}function L(e){let t=C(e);if(!t)return[];let o=[];for(let n of t){if(typeof n!="object"||n===null||Array.isArray(n))continue;let i=n;typeof i.name!="string"||i.name.trim().length===0||o.push(i)}return o}function C(e){if(Array.isArray(e))return e;if(typeof e!="object"||e===null)return;let t=e;if(Array.isArray(t.definitions))return t.definitions;if(typeof t.item_types=="object"&&t.item_types!==null){let o=t.item_types;if(Array.isArray(o.definitions))return o.definitions}}function F(e,t){let o=t.name.toLowerCase(),n=e.definitions.slice(),i=n.findIndex(l=>typeof l.name=="string"&&l.name.trim().toLowerCase()===o),a=i>=0?n[i]:void 0,r=b([...T(a?.aliases),...t.aliases]),s={...a,name:t.name};return t.folder!==void 0&&(s.folder=t.folder),r.length>0?s.aliases=r:s.aliases!==void 0&&delete s.aliases,A(s,"description",t.description),A(s,"default_status",t.defaultStatus),i>=0?n[i]=s:n.push(s),n.sort((l,f)=>l.name.localeCompare(f.name)),{file:{definitions:n},definition:s,replaced:i>=0,...a&&typeof a.name=="string"?{previousName:a.name}:{}}}function M(e,t){let o=(t??"").trim();if(o.length===0)throw new Error("Type name must not be empty.");let n=y(o);if(n)throw new Error(`Cannot remove built-in item type "${n}". Built-in types are reserved: ${d.join(", ")}.`);let i=o.toLowerCase(),a=e.definitions.slice(),r=a.findIndex(l=>typeof l.name=="string"&&l.name.trim().toLowerCase()===i);if(r<0)return{file:{definitions:a},removed:!1};let[s]=a.splice(r,1);return{file:{definitions:a},removed:!0,definition:s}}function A(e,t,o){let n=e;o!==void 0&&(n[t]=o)}function z(e){return`${JSON.stringify({definitions:e.definitions},null,2)}
|
|
2
2
|
`}function v(e,t){let o=e.trim().length>0?e.trim():e,n=t?.trim()||".agents/pm/schema/types.json";return`To register a custom type, run: pm schema add-type "${I(o)}" (writes ${n}).`}function O(e,t,o){return`Invalid type value "${e}". Allowed: ${t.join(", ")}. ${v(e,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]="c4e316a0-823d-5722-9e15-6d741ae44f1b")}catch{}})();function _(e){return typeof e=="string"?e.trim().toLowerCase():""}function u(e,t){let o=c(e);return o.length===0?"":t?.alias_to_id?.get(o)??o}function P(e){let t=Array.isArray(e?.type_workflows)?e.type_workflows:[],o=new Map;for(let n of t){let i=_(n?.type);if(i.length===0||!Array.isArray(n?.allowed_transitions))continue;let a=n.allowed_transitions,r=o.get(i)??{pairs:[],denyAll:!1};a.length===0&&(r.denyAll=!0);for(let s of a){if(!Array.isArray(s)||s.length!==2)continue;let l=c(s[0]),f=c(s[1]);l.length===0||f.length===0||r.pairs.some(p=>p[0]===l&&p[1]===f)||r.pairs.push([l,f])}o.set(i,r)}return[...o.entries()].filter(([,n])=>n.pairs.length>0||n.denyAll).map(([n,i])=>({type:n,allowed_transitions:i.pairs})).sort((n,i)=>n.type.localeCompare(i.type))}function U(e){let t=_(e.typeName),o=e.typeWorkflows.find(r=>r.type===t);if(!o)return{allowed:!0,hasRule:!1,allowedTransitions:[]};let n=u(e.fromStatus,e.statusRegistry),i=u(e.toStatus,e.statusRegistry);return n.length>0&&n===i?{allowed:!0,hasRule:!0,allowedTransitions:o.allowed_transitions}:{allowed:o.allowed_transitions.some(r=>{let s=u(r[0],e.statusRegistry),l=u(r[1],e.statusRegistry);return s===n&&l===i}),hasRule:!0,allowedTransitions:o.allowed_transitions}}function J(e){return e.length===0?"(no transitions allowed)":e.map(t=>`${t[0]} -> ${t[1]}`).join(", ")}export{y as a,I as b,k as c,S as d,D as e,j as f,F as g,M as h,z as i,O as j,P as k,U as l,J as m};
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
3
|
+
//# sourceMappingURL=chunk-M32HFIQB.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{c as x}from"./chunk-
|
|
1
|
+
import{c as x}from"./chunk-M32HFIQB.js";import{Ka as a,Ma as w,q as m,x as T}from"./chunk-JWKEDZJI.js";import{L as v,Y as f,Z as u,o as _,p as b,q as E}from"./chunk-Q47EX4DI.js";import C from"node:fs/promises";import p 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]="6fc24a7c-a359-51fd-a432-4c8037d10e9e")}catch{}})();var z=["extensions","docs","examples","assets","prompts"],R=Object.freeze({extensions:Object.freeze([".agents/pm/extensions","extensions",".custom/pm-extensions",".custom/pm-extension"]),docs:Object.freeze(["docs","documentation"]),examples:Object.freeze(["examples","docs/examples"]),assets:Object.freeze(["assets",".agents/pm/assets"]),prompts:Object.freeze(["prompts",".agents/pm/prompts"])});function q(e){return z.includes(e)}function G(e,t){if(t==null)return[];let r=Array.isArray(t)?t:[t],n=[];for(let i of r){if(typeof i!="string"||i.trim().length===0)throw new u(`Package manifest field pm.${e} must contain string paths.`,f.USAGE);n.push(i.trim())}return[...new Set(n)].sort((i,o)=>i.localeCompare(o))}function J(e){if(e==null)return{};if(typeof e!="object"||Array.isArray(e))throw new u("Package manifest field pm must be an object.",f.USAGE);let t={},r=e;for(let[n,i]of Object.entries(r)){if(!q(n))continue;let o=G(n,i);o.length>0&&(t[n]=o)}return t}function c(e,t){let r=e[t];return typeof r=="string"&&r.trim().length>0?r.trim():void 0}function S(e){if(!Array.isArray(e))return;let t=e.map(r=>typeof r=="string"?r.trim():"").filter(r=>r.length>0);return t.length>0?[...new Set(t)].sort((r,n)=>r.localeCompare(n)):void 0}function I(e){if(typeof e=="string"&&e.trim().length>0)return e.trim();if(typeof e=="object"&&e!==null&&!Array.isArray(e)){let t=e.url;return typeof t=="string"&&t.trim().length>0?t.trim():void 0}}function K(e){if(typeof e!="object"||e===null||Array.isArray(e))return;let t=e,r={docs:c(t,"docs"),npm:c(t,"npm"),repository:c(t,"repository"),report:c(t,"report")};return Object.values(r).some(n=>typeof n=="string")?r:void 0}function V(e){if(typeof e!="object"||e===null||Array.isArray(e))return;let t=e,r={image:c(t,"image"),video:c(t,"video")};return Object.values(r).some(n=>typeof n=="string")?r:void 0}function Y(e){if(typeof e!="object"||e===null||Array.isArray(e))return;let t=e,r={display_name:c(t,"display_name")??c(t,"displayName"),category:c(t,"category"),summary:c(t,"summary"),links:K(t.links),media:V(t.media),tags:S(t.tags)};return Object.values(r).some(n=>n!==void 0)?r:void 0}async function B(e){let t=p.join(e,"package.json");if(!await m(t))return{source:"convention",resources:{}};let r;try{r=JSON.parse(await C.readFile(t,"utf8"))}catch(d){throw new u(`Failed to parse package manifest at "${t}": ${String(d)}`,f.USAGE)}if(typeof r!="object"||r===null||Array.isArray(r))throw new u(`Package manifest at "${t}" must be a JSON object.`,f.USAGE);let n=r,i=n.pm,o=i!=null,s=typeof i=="object"&&i!==null&&!Array.isArray(i)?i:{};return{source:o?"pm":"convention",package_json_path:t,package_name:typeof n.name=="string"?n.name:void 0,package_version:typeof n.version=="string"?n.version:void 0,package_private:n.private===!0,package_description:typeof n.description=="string"?n.description:void 0,package_keywords:S(n.keywords),package_homepage:typeof n.homepage=="string"?n.homepage:void 0,package_repository_url:I(n.repository),package_bugs_url:I(n.bugs),aliases:S(s.aliases),resources:J(i),catalog:Y(s.catalog)}}async function j(e){if(!await m(e))return[];let t=await C.readdir(e,{withFileTypes:!0}),r=[];for(let n of t){if(!n.isDirectory())continue;let i=p.join(e,n.name);await m(p.join(i,"manifest.json"))&&r.push(i)}return r.sort((n,i)=>n.localeCompare(i))}async function _e(e){if(await m(p.join(e,"manifest.json")))return[e];let r=(await B(e)).resources.extensions??[],n=new Set;for(let i of r){if(i.includes("*")||i.startsWith("!"))throw new u(`Package extension entry "${i}" uses a glob/exclusion pattern. pm package installs currently require concrete extension paths or directories.`,f.USAGE);let o=p.resolve(e,i);if(!T(e,o))throw new u(`Package extension entry "${i}" resolves outside package root.`,f.USAGE);if(await m(p.join(o,"manifest.json"))){n.add(o);continue}for(let s of await j(o))n.add(s)}if(r.length===0)for(let i of R.extensions)for(let o of await j(p.join(e,i)))n.add(o);return[...n].sort((i,o)=>i.localeCompare(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]="48c3e62a-8085-5215-a692-4c03792022ce")}catch{}})();var D=1,A=6,$=[["commands","Commands"],["command_overrides","Command overrides"],["flag_commands","Flag commands"],["item_types","Item types"],["item_fields","Item fields"],["migrations","Migrations"],["profiles","Profiles"],["importers","Importers"],["exporters","Exporters"],["search_providers","Search providers"],["vector_store_adapters","Vector store adapters"],["assurance_providers","Assurance measurement providers"],["hooks","Lifecycle hooks"],["parser_overrides","Parser overrides"],["service_overrides","Service overrides"],["renderer_overrides","Renderer overrides"]];function k(e){return"#".repeat(e)}function F(e){if(!e.includes("`"))return`\`${e}\``;let t=0,r=0;for(let o of e)r=o==="`"?r+1:0,t=Math.max(t,r);let n="`".repeat(t+1),i=e.startsWith("`")||e.endsWith("`")?" ":"";return`${n}${i}${e}${i}${n}`}function W(e){return e.length===0?"Capabilities: _none registered_":`Capabilities: ${e.map(F).join(", ")}`}function H(e,t,r){let n=[`${k(t)} ${e}`,""];return r.length===0?(n.push("_None._",""),n):(n.push(...r.map(i=>`- ${F(i)}`),""),n)}function X(e,t,r){return e===0&&!r?[]:[`${k(t)} Preflight overrides`,"",e>0?`- ${e} registered (this surface carries no per-entry identifier)`:"_None._",""]}function Ee(e,t={}){let r=t.headingLevel??2;if(!Number.isInteger(r)||r<D||r>A)throw new RangeError(`headingLevel must be an integer in [${D}, ${A}], received ${String(t.headingLevel)}`);let n=Math.min(r+1,A),i=t.includeEmpty===!0,o=t.title??"Extension surfaces",s=[`${k(r)} ${o}`,""];(i||e.capabilities.length>0)&&s.push(W(e.capabilities),"");for(let[l,y]of $){let g=e[l]??[];g.length===0&&!i||s.push(...H(y,n,g))}return s.push(...X(e.preflight_overrides,n,i)),!(e.preflight_overrides>0||$.some(([l])=>(e[l]?.length??0)>0))&&!i&&s.push("_This extension registers no surfaces._",""),`${s.join(`
|
|
2
2
|
`).trimEnd()}
|
|
3
3
|
`}(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]="e3f016bb-8add-5765-bb1a-a7b22423f8d1")}catch{}})();var Q=["agile","ops","research"],Z={agile:[{name:"Story",description:"User-facing outcome or capability slice expressed from a stakeholder perspective.",defaultStatus:"open",folder:"stories",aliases:["user-story"]},{name:"Spike",description:"Time-boxed investigation used to reduce uncertainty before implementation.",defaultStatus:"open",folder:"spikes",aliases:["research-spike"]}],ops:[{name:"Incident",description:"Operational disruption, degradation, or support escalation with recovery tracking.",defaultStatus:"open",folder:"incidents",aliases:["outage"]},{name:"Runbook",description:"Repeatable operational procedure, diagnostic path, or response playbook.",defaultStatus:"open",folder:"runbooks",aliases:["playbook"]}],research:[{name:"Experiment",description:"Validated-learning activity with hypothesis, method, and outcome tracking.",defaultStatus:"open",folder:"experiments",aliases:["study"]},{name:"Hypothesis",description:"Testable claim or assumption that should be supported, rejected, or refined.",defaultStatus:"open",folder:"hypotheses",aliases:["assumption"]}]};function ke(e){if(e===void 0)return;let t=e.trim().toLowerCase().replaceAll("-","_");if(t.length===0)throw new Error("Type preset name must not be empty.");if(t==="agile"||t==="ops"||t==="research")return t;throw new Error(`Invalid type preset "${e}". Allowed: ${Q.join(", ")}.`)}function ve(e){return Z[e].map(t=>x(t))}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="2b5a573e-1e36-58b9-b93b-4a4088f71e9a")}catch{}})();var ee=new Set(b),te=new Set(E),N=new Set([...v.filter(e=>e!=="severity"),"id","title","type","status","priority","tags","assignee","parent","description","body","created_at","updated_at","closed_at","completed_at","author","deadline","estimate","sprint","release","risk","confidence","reviewer","resolution","expected","actual"]),ne=["create","update"];function P(e){if(typeof e!="string")return"";let t=e.trim().toLowerCase().replaceAll(/[\s_]+/g,"-");return t.startsWith("--")?t.slice(2):t}function O(e){return e.replaceAll("_","-")}function re(e,t){let r=new Set;for(let n of e){let i=P(n);i.length>0&&i!==t&&r.add(i)}return[...r].sort((n,i)=>n.localeCompare(i))}function ie(e){let t=new Set;for(let r of e??[]){let n=r.trim();n.length>0&&t.add(n)}return[...t].sort((r,n)=>r.localeCompare(n))}function oe(e){let t=new Set,r=[];for(let n of e??[]){let i=n.trim().toLowerCase();if(i.length!==0){if(!te.has(i))throw new Error(`Invalid field command "${n}". Allowed: ${E.join(", ")}.`);t.has(i)||(t.add(i),r.push(i))}}return e===void 0||r.length===0?[...ne]:r}function je(e){let t=a(e.key);if(t.length===0)throw new Error("Field key must not be empty.");if(N.has(t))throw new Error(`Cannot define custom field "${t}": custom schema field "${t}" collides with built-in item metadata "${t}". Rename the custom field with a project-specific prefix. Reserved fields: ${[...N].sort((g,U)=>g.localeCompare(U)).join(", ")}.`);let r=typeof e.type=="string"&&e.type.trim().length>0?e.type.trim().toLowerCase():"string";if(!ee.has(r))throw new Error(`Invalid field type "${e.type}". Allowed: ${b.join(", ")}.`);let n=r,i=oe(e.commands),o=P(e.cliFlag),s=o.length>0&&o!==O(t)?o:void 0,d=s??O(t),l=re(e.aliases??[],d),y=e.description?.trim();return{key:t,type:n,commands:i,description:y&&y.length>0?y:void 0,cliFlag:s,cliAliases:l,required:e.required===!0,requiredOnCreate:e.requiredOnCreate===!0,allowUnset:e.allowUnset!==!1,requiredTypes:ie(e.requiredTypes)}}function se(e){if(Array.isArray(e))return e;if(typeof e!="object"||e===null)return;let t=e;if(Array.isArray(t.fields))return t.fields;if(Array.isArray(t.definitions))return t.definitions}function ae(e){let t=se(e);if(!t)return[];let r=[];for(let n of t){if(typeof n!="object"||n===null||Array.isArray(n))continue;let i=n;typeof i.key!="string"||i.key.trim().length===0||r.push(i)}return r}function Ce(e){if(e==null||e.trim().length===0)return{fields:[]};let t;try{t=JSON.parse(e)}catch{throw new Error("schema/fields.json contains invalid JSON.")}return{fields:ae(t)}}function De(e){return`${JSON.stringify({fields:e.fields},null,2)}
|
|
4
4
|
`}function $e(e,t){let r=e.fields.find(s=>a(s.key)===t.key),n=r!==void 0,i=e.fields.filter(s=>a(s.key)!==t.key),o={...r,key:t.key,type:t.type,commands:[...t.commands]};return L(o,"description",t.description),L(o,"cli_flag",t.cliFlag),t.cliAliases.length>0?o.cli_aliases=[...t.cliAliases]:delete o.cli_aliases,M(o,"required",t.required),M(o,"required_on_create",t.requiredOnCreate),t.allowUnset===!1?o.allow_unset=!1:delete o.allow_unset,t.requiredTypes.length>0?o.required_types=[...t.requiredTypes]:delete o.required_types,i.push(o),i.sort((s,d)=>a(s.key).localeCompare(a(d.key))),{file:{fields:i},definition:o,replaced:n}}function Fe(e,t){let r=a(t);if(r.length===0)throw new Error("Field key must not be empty.");let n=[],i=e.fields.filter(o=>a(o.key)===r?(n.push(o),!1):!0);return n.length===0?{file:{fields:i},removed:!1}:{file:{fields:i},removed:!0,definition:n[0]}}function L(e,t,r){let n=e;r!==void 0&&r.length>0?n[t]=r:delete n[t]}function M(e,t,r){let n=e;r?n[t]=!0:delete n[t]}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="3eac0218-43c9-5bd2-8eaf-589d02d2c8ad")}catch{}})();var de=new Set(_),h=new Set(w.map(e=>a(e.id)).filter(e=>e.length>0));function le(e){let t=new Set;for(let r of e){let n=a(r);n.length>0&&t.add(n)}return[...t].sort((r,n)=>r.localeCompare(n))}function Ue(e){let t=a(e.id);if(t.length===0)throw new Error("Status id must not be empty.");if(h.has(t))throw new Error(`Cannot add-status the built-in status "${t}". Built-in statuses are reserved: ${[...h].join(", ")}.`);let r;if(e.roles!==void 0){r=[];let s=new Set;for(let d of e.roles){let l=typeof d=="string"?d.trim().toLowerCase():"";if(l.length!==0){if(!de.has(l))throw new Error(`Invalid status role "${d}". Allowed roles: ${_.join(", ")}.`);s.has(l)||(s.add(l),r.push(l))}}}let n=e.aliases===void 0?void 0:le(e.aliases).filter(s=>s!==t),i=e.description?.trim(),o=typeof e.order=="number"&&Number.isFinite(e.order)?Math.trunc(e.order):void 0;return{id:t,roles:r,aliases:n,description:i&&i.length>0?i:void 0,order:o}}function ce(e){if(Array.isArray(e))return e;if(typeof e!="object"||e===null)return;let t=e;if(Array.isArray(t.statuses))return t.statuses;if(Array.isArray(t.definitions))return t.definitions}function fe(e){let t=ce(e);if(!t)return[];let r=[];for(let n of t){if(typeof n!="object"||n===null||Array.isArray(n))continue;let i=n;typeof i.id!="string"||i.id.trim().length===0||r.push(i)}return r}function ze(e){if(e==null||e.trim().length===0)return{statuses:[]};let t;try{t=JSON.parse(e)}catch{throw new Error("schema/statuses.json contains invalid JSON.")}return{statuses:fe(t)}}function Re(e){return`${JSON.stringify({statuses:e.statuses},null,2)}
|
|
5
5
|
`}function qe(e,t,r){let n=e.statuses.slice(),i=n.findIndex(d=>a(d.id)===t.id),o=i>=0?n[i]:r,s={...o,id:t.id};return t.roles!==void 0&&(t.roles.length>0?s.roles=[...t.roles]:s.roles!==void 0&&delete s.roles),t.aliases!==void 0&&(t.aliases.length>0?s.aliases=[...t.aliases]:s.aliases!==void 0&&delete s.aliases),t.description!==void 0&&(s.description=t.description),t.order!==void 0&&(s.order=t.order),i>=0?n[i]=s:n.push(s),{file:{statuses:n},definition:s,replaced:o!==void 0}}function Ge(e,t){let r=a(t);if(r.length===0)throw new Error("Status id must not be empty.");if(h.has(r))throw new Error(`Cannot remove built-in status "${r}". Built-in statuses are reserved: ${[...h].join(", ")}.`);let n=e.statuses.slice(),i=n.findIndex(s=>a(s.id)===r);if(i<0)return{file:{statuses:n},removed:!1};let[o]=n.splice(i,1);return{file:{statuses:n},removed:!0,definition:o}}function Je(e,t){let r=[e.id,...e.aliases??[]];for(let n of r){let i=a(n);if(i.length===0)continue;let o=t.get(i);if(o!==void 0&&o!==e.id)throw new Error(`Status token "${i}" already belongs to status "${o}". Choose a different id/alias to avoid shadowing it.`)}}export{z as a,R as b,B as c,_e as d,Q as e,Z as f,ke as g,ve as h,je as i,Ce as j,De as k,$e as l,Fe as m,h as n,Ue as o,ze as p,Re as q,qe as r,Ge as s,Je as t,Ee as u};
|
|
6
|
-
//# sourceMappingURL=chunk-
|
|
6
|
+
//# sourceMappingURL=chunk-OM65KHGF.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
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]="a54549aa-2f6c-5092-a3eb-5b36ee698ea4")}catch{}})();var G=["commands","renderers","hooks","schema","importers","search","parser","preflight","services"],$e=2,Ye=Object.freeze({migration:"schema",validation:"schema"}),wn=Object.freeze({version:$e,capabilities:[...G],legacy_aliases:{...Ye}}),ae=["off","warn","enforce"],ce=["off","warn","enforce"],ue=["none","restricted","strict"],Tn=["block","warn"],de=["commands.override","commands.handler","hooks.beforecommand","hooks.beforemutation","hooks.aftercommand","hooks.onwrite","hooks.onread","hooks.onindex","schema.flags","schema.itemfields","schema.itemtypes","schema.relationshipkinds","schema.migrations","schema.profiles","parser.override","preflight.override","services.override","renderers.override","importers.importer","importers.exporter","search.provider","search.vectorstore","services.assuranceprovider"],le=["output_format","error_format","help_format","lock_acquire","lock_release","history_append","item_store_write","item_store_delete","context_relevance","command_result"];function fe(){return{mode:"off",trust_mode:"off",require_provenance:!1,trusted_extensions:[],default_sandbox_profile:"none",allowed_extensions:[],blocked_extensions:[],allowed_capabilities:[],blocked_capabilities:[],allowed_surfaces:[],blocked_surfaces:[],allowed_commands:[],blocked_commands:[],allowed_actions:[],blocked_actions:[],allowed_services:[],blocked_services:[],extension_overrides:[]}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="f6ab5bae-53b3-5feb-b89f-46e64afe7058")}catch{}})();var Xe=["Epic","Feature","Task","Chore","Issue","Decision","Event","Reminder","Milestone","Meeting","Plan"],Rn=Xe,xn=["draft","open","in_progress","blocked","closed","canceled"],In=["draft","active","blocked","terminal","terminal_done","terminal_canceled","default_open","default_close","default_cancel"],Nn=["string","number","boolean","string_array","array","object"],Cn=["create","update","update_many","list","search","calendar","context"],vn=["allow","warn","reject"],Dn=["blocks","parent","child","parent_child","child_of","related","related_to","discovered_from","blocked_by","incident_from","epic","implements","recurs_from","supersedes","task","verifies"],Mn=["project","global"],Un=["low","medium","high","critical"],Ln=["low","medium","high","critical"],Pn=["low","medium","high"];var jn=["minimal","default","strict","custom"],Vn=["none","warn","strict"],Fn=["progressive","strict"],Bn=["off","warn","strict"],Gn=["off","warn","strict"];var Kn=["daily","weekly","monthly","yearly"],qe=["mon","tue","wed","thu","fri","sat","sun"];function zn(e){return qe.indexOf(e)}var $n=["draft","research","review","approved","executing","paused","completed","superseded"],Yn=["pending","in_progress","completed","blocked","skipped","superseded"],Xn=["codex","claude-code","cursor","generic"],qn=["related","blocks","blocked_by","depends_on","discovered_from","implements","recurs_from","verifies","supersedes"],Wn=["brief","standard","deep","full"],Qn=["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]="27c5eac3-4580-5f6f-8ae9-b04d0281766d")}catch{}})();var _e=["goal","objective","value","impact","outcome","why_now","parent","reviewer","risk","confidence","sprint","release","blocked_by","blocked_reason","unblock_note","reporter","severity","environment","repro_steps","resolution","expected_result","actual_result"],We=["id","title","description","type","pm_format_version","source_type","type_options","status","priority","tags","created_at","updated_at","deadline","reminders","events","closed_at","completed_at","assignee","claim_principal","source_owner","author","estimated_minutes","acceptance_criteria","design","external_ref","definition_of_ready","order",..._e,"affected_version","fixed_version","component","regression","customer_impact","dependencies","comments","notes","learnings","files","tests","test_runs","docs","close_reason","duplicate_of","plan_mode","plan_scope","plan_harness","plan_resume_context","plan_validation","plan_decisions","plan_discoveries","plan_steps"],Qe=We;(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]="70cce114-b8a7-5770-ae42-eec473515709")}catch{}})();var Je=Object.freeze([{id:"draft",roles:["draft"]},{id:"open",roles:["active","default_open"]},{id:"in_progress",aliases:["in-progress"],roles:["active"]},{id:"blocked",roles:["blocked"]},{id:"closed",roles:["terminal","terminal_done","default_close"]},{id:"canceled",aliases:["cancelled"],roles:["terminal","terminal_canceled","default_cancel"]}]),He=Object.freeze({draft_status:"draft",open_status:"open",in_progress_status:"in_progress",blocked_status:"blocked",close_status:"closed",canceled_status:"canceled"}),eo=".agents/pm",to="settings.json";var Ze=["","epics","features","tasks","chores","issues","schema","history","search","extensions","locks"],et=["decisions","events","reminders","milestones","meetings","plans"],no=[...Ze,...et],oo={Epic:"epics",Feature:"features",Task:"tasks",Chore:"chores",Issue:"issues",Decision:"decisions",Event:"events",Reminder:"reminders",Milestone:"milestones",Meeting:"meetings",Plan:"plans"},tt={minimal:{ownership_enforcement:"none",create_mode_default:"progressive",close_validation_default:"off",require_close_reason:!0,parent_reference:"strict_error",metadata_profile:"core",force_required_for_stale_lock:!1,duplicate_detection_mode:"off",duplicate_detection_threshold:.8,duplicate_detection_limit:3},default:{ownership_enforcement:"warn",create_mode_default:"progressive",close_validation_default:"warn",require_close_reason:!0,parent_reference:"strict_error",metadata_profile:"core",force_required_for_stale_lock:!0,duplicate_detection_mode:"strict",duplicate_detection_threshold:.8,duplicate_detection_limit:3},strict:{ownership_enforcement:"strict",create_mode_default:"strict",close_validation_default:"strict",require_close_reason:!0,parent_reference:"strict_error",metadata_profile:"strict",force_required_for_stale_lock:!0,duplicate_detection_mode:"strict",duplicate_detection_threshold:.8,duplicate_detection_limit:3}},nt=["no active blocker","ready for planned execution sequencing","work completed","work is closed"],K={blocked_reason:["no active blocker because work is closed","work is closed"],resolution:["closed with implementation evidence","closed with verification evidence","work completed and recorded","work is closed"],actual_result:["closed and recorded","work completed","work completed and recorded"]};function pe(e){return e?[...e]:void 0}var ro={version:1,id_prefix:"pm-",ids:{token_length:4},author_default:"",agent_identity:{probes_enabled:!0,identity_vocabulary:{version:1,aliases:{}},harness_signals:[]},mutation_guard:{require_attributed_author:!1,secret_guard:"advise",stale_in_progress_hours:72},item_format:"toon",locks:{ttl_seconds:1800,wait_ms:3e3},checkpoints:{retention_days:14},output:{default_format:"toon"},ux:{deprecation_hints:!0},history:{missing_stream:"auto_create",compact_policy:{enabled:!1,max_entries:500,trigger:"health_warn"}},validation:{sprint_release_format:"warn",parent_reference:"warn",metadata_profile:"core",metadata_required_fields:[],lifecycle_stale_blocker_reason_patterns:[...nt],lifecycle_closure_like_blocked_reason_patterns:[...K.blocked_reason],lifecycle_closure_like_resolution_patterns:[...K.resolution],lifecycle_closure_like_actual_result_patterns:[...K.actual_result],estimate_defaults_by_type:{}},governance:{preset:"minimal",...tt.minimal},workflow:{definition_of_done:[]},testing:{record_results_to_items:!1},telemetry:{enabled:!0,first_run_prompt_completed:!1,capture_level:"redacted",endpoint:"https://pm-cli.unbrained.dev/v1/events",installation_id:"",retention_days:365},agent_guidance:{prompt_completed:!1,declined:!1,declined_at:"",template_version:1,last_checked_files:[]},item_types:{definitions:[]},schema:{version:1,files:{types:"schema/types.json",statuses:"schema/statuses.json",fields:"schema/fields.json",workflows:"schema/workflows.json"},statuses:Je.map(e=>({...e,aliases:pe(e.aliases),roles:pe(e.roles)})),fields:[],workflow:{...He},unknown_field_policy:"allow"},extensions:{enabled:[],disabled:[],policy:fe()},search:{score_threshold:0,hybrid_semantic_weight:.7,max_results:50,embedding_model:"",embedding_batch_size:32,embedding_timeout_ms:3e4,scanner_max_batch_retries:3,provider:"",mutation_refresh_policy:"semantic_configured",query_expansion:{enabled:!1,provider:""},rerank:{enabled:!1,model:"",top_k:20}},providers:{openai:{base_url:"",api_key:"",model:""},ollama:{base_url:"",model:""}},context:{default_depth:"brief",activity_limit:10,stale_threshold_days:7,sections:{hierarchy:!0,activity:!0,progress:!0,recently_created:!0,unparented:!0,blockers:!0,files:!0,workload:!0,staleness:!0,tests:!0}},vector_store:{adapter:"",collection_name:"pm_items",qdrant:{url:"",api_key:""},lancedb:{path:""}}},so={metadata:{},body:""},m={SUCCESS:0,GENERIC_FAILURE:1,USAGE:2,NOT_FOUND:3,CONFLICT:4,DEPENDENCY_FAILED:5,NO_EFFECT:6,PARTIAL_EFFECT:7},io=Object.freeze({unknown_command:"usage",unknown_option:"usage",missing_required_option:"usage",missing_required_argument:"usage",invalid_command_usage:"usage",linked_test_value_not_quoted:"usage",invalid_argument_value:"validation",health_findings:"validation",validation_findings:"validation",close_through_update:"validation",no_update_fields:"validation",unsupported_update_option:"validation",tracker_not_initialized:"validation",item_not_found:"validation",ownership_conflict:"conflict",lock_conflict:"conflict",terminal_state_conflict:"conflict",dependency_failed:"runtime",init_gitignore_unwritable:"runtime",merge_git_config_unwritable:"runtime",command_failed:"runtime",unknown_error:"runtime"});(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="a19ff5c0-2c4d-5576-a551-cab35276fdc3")}catch{}})();var p=class extends Error{exitCode;code;context;constructor(t,n,o={}){super(t),this.name="PmCliError",this.exitCode=n,this.context=o,this.code=o.code}};(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="9afc5057-afcd-5d6c-a4c1-c2883640fc50")}catch{}})();var I=[...[["fetch","get"],["read","get"],["show","get"],["view","get"],["comment","comments"],["note","notes"],["learning","learnings"]].map(([e,t])=>({alias:e,canonical:t,canonical_argv:[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","packages catalog"],["packages scaffold","packages 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"}))],lo=Object.fromEntries(I.filter(e=>e.registration==="bootstrap").map(e=>[e.alias,e.canonical]));function fo(e){let t=e.trim().toLowerCase();return I.find(n=>n.alias===t)}function _o(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]="8b8b6b8e-5061-5da4-a369-eca379c0090b")}catch{}})();var ot=[...G],rt=[...le],st=[...ae],yo=[...ce],ho=[...ue],it=[...de],N=["init","config","extension","package","packages","install","upgrade","create","item","copy","focus","list","list-all","list-draft","list-open","list-in-progress","list-blocked","list-closed","list-canceled","aggregate","context","ctx","get","graph","search","duplicates","eval","next","history","events","history-redact","history-repair","history-compact","history-author-acknowledge","merge","schema","profile","activity","restore","update","update-many","close","close-many","delete","append","comments","notes","learnings","files","docs","deps","plan","test","test-all","telemetry","stats","health","validate","assurance","gc","workspace","contracts","claim","release","start-task","pause-task","close-task","meet","event","remind","help"],Eo=["ancestors","descendants","predecessors","successors","paths","impact","analyze","audit","communities","redundancy","dominators","slack","centrality","articulation","plan","index"],at=["init","install","uninstall","explore","manage","describe","reload","doctor","catalog","adopt","adopt-all","activate","deactivate"],ct=["reopen"],me={help:"Commander help rendering has no SDK operation result.",packages:"The plural package alias only renders package-oriented help."},C=Object.freeze(N.flatMap(e=>e in me?[]:e==="extension"||e==="package"?[...at.map(t=>`${e}-${t}`),e]:e==="item"?ct.map(t=>`item-${t}`):[e])),ut=Object.freeze(I.filter(e=>e.lifecycle==="deprecated"&&e.registration==="commander"&&C.includes(e.alias)).map(e=>e.alias)),bo=Object.freeze(C.filter(e=>!ut.includes(e)));function Oo(e=N,t=C,n=me){let o=new Set(t),r=new Set(e);return{missing_cli_actions:e.filter(s=>!o.has(s)&&!t.some(a=>a.startsWith(`${s}-`))&&n[s]===void 0),waived_cli_actions:e.filter(s=>!o.has(s)&&!t.some(a=>a.startsWith(`${s}-`))&&n[s]!==void 0),stale_waivers:Object.keys(n).filter(s=>!r.has(s)||o.has(s)||t.some(a=>a.startsWith(`${s}-`)))}}function Ao(e){return C.includes(e)}function So(e){return ot.includes(e)}function wo(e){return rt.includes(e)}function To(e){return st.includes(e)}function ko(e){return it.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]="810d42b5-98f4-57a7-bdd9-2dfa1b2b1c03")}catch{}})();var dt=new Set(["applied_bound","completeness","budget_retention_policy","continuation_contract","continuation_kind","continuation_path","filters","omission_receipt","output_budget_truncation","projection","read_output","read_session","row_contract","sorting"]);function b(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function ge(e,t){let n=e;for(let o of t.split("."))if(Array.isArray(n)){if(!/^\d+$/u.test(o))return;n=n[Number(o)]}else{if(!b(n))return;n=n[o]}return n}function z(e,t,n){let o=t.split("."),r=(s,a)=>{if(a===o.length)return n;let i=o[a];if(Array.isArray(s)){let u=Number(i),l=[...s];return l[u]=r(s[u],a+1),l}let d=s;return{...d,[i]:r(d[i],a+1)}};return r(e,0)}function ye(e,t,n){let o=A(e).find(s=>s.path===t);if(!o)return e;let r=Array.isArray(o.value)?o.value.slice(n):Object.fromEntries(Object.entries(o.value).slice(n));return z(e,t,r)}function v(e){let t=e.row_contract;return b(t)&&Array.isArray(t.row_keys)?t.row_keys.filter(n=>typeof n=="string"&&n.trim().length>0):Object.entries(e).filter(([,n])=>Array.isArray(n)).map(([n])=>n)}function lt(e){let t=e.row_contract;return b(t)&&Array.isArray(t.continuation_row_keys)?t.continuation_row_keys.filter(n=>typeof n=="string"&&n.trim().length>0):v(e)}function O(e){return v(e).flatMap(t=>{let n=ge(e,t);return Array.isArray(n)||b(n)?[{path:t,value:n}]:[]})}function A(e){return lt(e).flatMap(t=>{let n=ge(e,t);return Array.isArray(n)||b(n)?[{path:t,value:n}]:[]})}function D(e){let t=O(e),n=new Set(t.map(r=>r.path)),o=(r,s)=>{if(Array.isArray(r)){n.has(s)||t.push({path:s,value:r}),r.forEach((a,i)=>o(a,`${s}.${i}`));return}if(b(r))for(let[a,i]of Object.entries(r))s.length===0&&dt.has(a)||o(i,s.length===0?a:`${s}.${a}`)};return o(e,""),t}function M(e){return O(e).reduce((t,n)=>t+(Array.isArray(n.value)?n.value.length:Object.keys(n.value).length),0)}function T(e,t){let n=e;for(let o of O(n)){let r=Array.isArray(o.value)?o.value.map((s,a)=>t(s,o.path,a)):Object.fromEntries(Object.entries(o.value).map(([s,a],i)=>[s,t(a,o.path,i)]));n=z(n,o.path,r)}return n}function he(e,t){let n=e,o=!1;for(let r of O(n)){let s=Array.isArray(r.value)?r.value:Object.entries(r.value);if(s.length<=t)continue;o=!0;let a=Array.isArray(r.value)?s.slice(0,t):Object.fromEntries(s.slice(0,t));n=z(n,r.path,a)}return{result:n,truncated:o}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="642f6dec-c0b2-5377-a401-dfa4f8ef6a2a")}catch{}})();var $=256,Y=1e4,ft=/^[A-Za-z0-9][A-Za-z0-9._:-]{0,63}$/u,_t=/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/u,pt=new Set(["version","id","token_budget","spent_tokens","seen_item_ids"]),mt=[{valid:e=>e.version===1,reason:"version must equal 1."},{valid:e=>typeof e.id=="string"&&ft.test(e.id),reason:"id must be 1-64 portable identifier characters."},{valid:e=>Number.isSafeInteger(e.token_budget)&&e.token_budget>=$,reason:`token_budget must be a safe integer of at least ${$}.`},{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<=Y&&e.seen_item_ids.every(t=>typeof t=="string"&&_t.test(t)),reason:`seen_item_ids must contain at most ${Y} portable item identifiers.`}];function L(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function U(e){throw new p(`--output-session ${e}`,m.USAGE,{code:"invalid_read_output_session",field:"outputSession"})}function P(e){if(e===void 0)return;let t=e;if(typeof e=="string")try{t=JSON.parse(e)}catch{U("must be a valid JSON object.")}L(t)||U("must be a JSON object.");let n=Object.keys(t).filter(s=>!pt.has(s));n.length>0&&U(`contains unknown field "${n.sort()[0]}".`);let o=mt.find(s=>!s.valid(t));o!==void 0&&U(o.reason);let r=[...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:r}}function Ee(e){if(L(e))return typeof e.id=="string"?e.id:typeof e.item_id=="string"?e.item_id:L(e.item)&&typeof e.item.id=="string"?e.item.id:void 0}function gt(e){let t=new Set,n=0;for(let o of O(e)){let r=Array.isArray(o.value)?o.value:Object.values(o.value);for(let s of r){if(!L(s))continue;if(typeof s.context_ref=="string"){n+=1;continue}let a=Ee(s);a!==void 0&&t.add(a)}}return{deliveredIds:t,suppressedRepeatCount:n}}function be(e,t){let n=new Set(t.seen_item_ids);return T(e,o=>{let r=Ee(o);return r!==void 0&&n.has(r)?{id:r,context_ref:`session:${t.id}:${r}`}:o})}function X(e,t){let{deliveredIds:n,suppressedRepeatCount:o}=gt(e),r=new Set(t.seen_item_ids),s=[...n].filter(g=>!r.has(g)).sort(),a=s.slice(0,Y-t.seen_item_ids.length),i=[...t.seen_item_ids,...a].sort(),d=s.length-a.length,u={contract_version:1,id:t.id,measurement_scope:"complete_read_envelope",estimator:"ceil(utf8_bytes / 4)",token_budget:t.token_budget,spent_before_tokens:t.spent_tokens,spent_this_call_tokens:0,charged_this_call_tokens:0,spent_total_tokens:t.spent_tokens,remaining_tokens:t.token_budget-t.spent_tokens,exhausted:!1,seen_before_count:t.seen_item_ids.length,new_item_count:n.size,...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:i}},l={...e,read_session:u},c=g=>{u.spent_this_call_tokens=g,u.charged_this_call_tokens=Math.min(t.token_budget-t.spent_tokens,g),u.spent_total_tokens=Math.min(t.token_budget,t.spent_tokens+u.charged_this_call_tokens),u.remaining_tokens=Math.max(0,t.token_budget-u.spent_total_tokens),u.exhausted=u.remaining_tokens<$,u.next_state.spent_tokens=u.spent_total_tokens},_=0,f=0;for(let g=0;g<8;g+=1){c(_);let x=Math.ceil(Buffer.byteLength(JSON.stringify(l),"utf8")/4);if(x===_)return l;f=Math.max(f,x),_=x}return c(f),l}function Oe(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]="23b3a820-f205-506b-9507-dbd60087f62e")}catch{}})();var yt=["full","compact","brief","summary","counts"],Mo=["mutation","read","discovery","governance"],ht=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"]),Et=new Set(["contracts","extension","help","install","package","packages","profile","upgrade"]),bt=new Set(["gc","health","merge","stats","telemetry","test","test-all","validate"]),Ot={mutation:2e3,read:4e3,discovery:3e3,governance:6e3},At=3,St=2;function wt(e){let[t=""]=e.trim().split(/\s+/u);return ht.has(t)?"mutation":Et.has(t)?"discovery":bt.has(t)?"governance":"read"}function Ae(e,t=wt(e)){let n=e.trim().replace(/\s+/gu," ");if(n.length===0)throw new TypeError("command must be a non-empty command path");let o=Ot[t];return Tt({command:n,budget_class:t,default_max_estimated_tokens:o,default_max_estimated_tokens_by_format:{toon:o,json:Math.ceil(o*At/St)},degradation_ladder:yt,allows_unbounded_opt_out:!0,token_estimate:"ceil(utf8_bytes / 4)"})}function Tt(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 kt=N.map(e=>Ae(e)),Rt=new Map(kt.map(e=>[e.command,e]));function Se(e,t={}){let n=e.trim().replace(/\s+/gu," "),[o]=n.split(" "),r=Rt.get(o);return r?{...r,command:n}:t.generateFallback?Ae(n):null}function Uo(e){return Math.ceil(Math.max(0,e)/4)}import{createHash as On}from"node:crypto";import xt from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="83232698-197a-5aef-be7c-aa37f3c56822")}catch{}})();function It(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 Nt(e){let t=Object.keys(e).sort(),n={};for(let o of t){let r=e[o];r!==void 0&&(n[o]=j(r))}return n}function j(e){let t=It(e);if(t!==void 0)return t;if(Array.isArray(e))return e.map(o=>j(o));if(e instanceof Date)return e.toISOString();let n=e;if(typeof n.toJSON=="function"){let o=n.toJSON();if(o!==e)return j(o)}return Nt(e)}function V(e){return JSON.stringify(j(e))}function we(e,t,n,o){for(let r=0;r<t.length;r+=1)if(!n.has(r)&&o(e,t[r]))return n.add(r),!0;return!1}function Ct(e,t){if(e instanceof RegExp||t instanceof RegExp)return e instanceof RegExp&&t instanceof RegExp&&e.toString()===t.toString()}function vt(e,t){if(e instanceof Date||t instanceof Date)return e instanceof Date&&t instanceof Date&&e.getTime()===t.getTime()}function Dt(e,t){if(!(e instanceof Set||t instanceof Set))return;if(!(e instanceof Set&&t instanceof Set)||e.size!==t.size)return!1;let n=[...t],o=new Set;for(let r of e)if(!we(r,n,o,k))return!1;return!0}function Mt(e,t){if(!(e instanceof Map||t instanceof Map))return;if(!(e instanceof Map&&t instanceof Map)||e.size!==t.size)return!1;let n=[...t.entries()],o=new Set;for(let[r,s]of e.entries())if(!we([r,s],n,o,([i,d],[u,l])=>k(i,u)&&k(d,l)))return!1;return!0}function Ut(e,t){if(Array.isArray(e)||Array.isArray(t))return!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length?!1:e.every((n,o)=>k(n,t[o]))}function Lt(e,t){let n=Object.keys(e).sort((r,s)=>r.localeCompare(s)),o=Object.keys(t).sort((r,s)=>r.localeCompare(s));if(n.length!==o.length)return!1;for(let r=0;r<n.length;r+=1){let s=n[r];if(s!==o[r]||!k(e[s],t[s]))return!1}return!0}var Pt=[Ct,vt,Dt,Mt,Ut];function k(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 Pt){let o=n(e,t);if(o!==void 0)return o}return Lt(e,t)}function jo(e){return xt.createHash("sha256").update(e,"utf8").digest("hex")}function Vo(e,t){let n={};for(let r of t){let s=e[r];s!==void 0&&(n[r]=s)}let o=Object.keys(e).filter(r=>!t.includes(r)).sort((r,s)=>r.localeCompare(s));for(let r of o){let s=e[r];s!==void 0&&(n[r]=s)}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]="737ac274-c165-5d1a-8b8e-cb5d57a81c46")}catch{}})();var jt=8,Vt=64;function W(e){return Math.ceil(Buffer.byteLength(JSON.stringify(e),"utf8")/4)}function Ft(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function q(e,t){return typeof e=="string"?e.length<=240?e:(t.compacted=!0,`${e.slice(0,240)}\u2026`):Array.isArray(e)?e.map(n=>q(n,t)):Ft(e)?Object.fromEntries(Object.entries(e).map(([n,o])=>[n,q(o,t)])):e}function h(e,t){let n=t.estimated_tokens;for(let o=0;o<jt;o+=1){t.estimated_tokens=n;let r=W(e);if(r===n)return;n=r}t.estimated_tokens=n}function Bt(e,t,n,o){for(let r=0;r<Vt;r+=1){if(h(e,t),t.estimated_tokens<=n)return;let s=D(e).filter(i=>(Array.isArray(i.value)?i.value.length:Object.keys(i.value).length)>Math.max(1,o.get(i.path)??0)).map(i=>({collection:i,length:Array.isArray(i.value)?i.value.length:Object.keys(i.value).length})).sort((i,d)=>d.length-i.length||i.collection.path.localeCompare(d.collection.path))[0]?.collection;if(!s)return;let a=Math.max(1,o.get(s.path)??0);if(Array.isArray(s.value))s.value.splice(-Math.min(s.value.length-a,Math.max(1,Math.ceil(s.value.length/2))));else{let i=Object.keys(s.value);for(let d of i.slice(-Math.min(i.length-a,Math.max(1,Math.ceil(i.length/2)))))delete s.value[d]}t.rows_compacted=!0,t.compacted_row_paths=[...new Set([...t.compacted_row_paths??[],s.path])].sort((i,d)=>i.localeCompare(d)),e.has_more=!0,e.truncated=!0,typeof e.count=="number"&&(e.count=M(e))}}function Te(e,t,n,o=new Map){let r={compacted:!1},s=q(e,r);return t.strings_compacted=r.compacted,s.read_output=t,Bt(s,t,n,o),h(s,t),s}import{createHash as Gt}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]="d3329fac-693d-566c-a30a-43f8fb37938f")}catch{}})();var Q=1,Re=4096,Kt=/^[A-Za-z0-9_-]+$/;function ke(e){return e.replace(/^--/u,"").replace(/[-_]([a-z0-9])/gu,(t,n)=>n.toUpperCase())}function Xo(e,t){let n=new Set;for(let o of t)if(o.cursor_semantics==="presentation"){n.add(ke(o.flag));for(let r of o.aliases??[])n.add(ke(r))}return Object.fromEntries(Object.entries(e).filter(([o])=>!n.has(o)))}function qo(e,t){return Gt("sha256").update(e).update("\0").update(V(t)).digest("hex").slice(0,24)}function J(e,t,n,o){return Buffer.from(JSON.stringify({version:Q,fingerprint:e,after_id:t,...n===void 0?{}:{after_index:n},...o===void 0?{}:{snapshot:o}})).toString("base64url")}function E(e){return new p(e,m.USAGE,{code:"invalid_query_cursor",nextSteps:["Repeat the original query without --after to obtain a fresh cursor."]})}function zt(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;let t=e;return t.version===Q&&typeof t.fingerprint=="string"&&typeof t.after_id=="string"&&t.after_id.length>0&&(t.after_index===void 0||Number.isSafeInteger(t.after_index)&&t.after_index>=0)&&(t.snapshot===void 0||typeof t.snapshot=="string"&&t.snapshot.length>0)}function H(e){if(typeof e!="string")throw E("Query cursor is malformed.");let t=e.trim();if(t.length===0||t.length>Re||!Kt.test(t))throw E("Query cursor is malformed.");let n;try{n=JSON.parse(Buffer.from(t,"base64url").toString("utf8"))}catch{throw E("Query cursor is malformed.")}if(!zt(n))throw E("Query cursor version or payload is unsupported.");return n}function Z(e,t){let n=H(e);if(n.fingerprint!==t)throw E(`Query cursor does not match the current filters, sort, or query (${n.fingerprint} != ${t}).`);return{after_id:n.after_id,...n.after_index===void 0?{}:{after_index:n.after_index},...n.snapshot===void 0?{}:{snapshot:n.snapshot}}}function Wo(e,t){return Z(e,t).after_id}function $t(e,t,n,o){if(t===void 0)return 0;let r=Z(t,n),s=e.findIndex(a=>o(a)===r.after_id);if(s<0){if(r.after_index!==void 0)return Math.min(r.after_index,e.length);throw E(`Query cursor item ${r.after_id} is no longer present in this result set.`)}return s+1}function Qo(e,t){if(t.cursor!==void 0&&Z(t.cursor,t.fingerprint).snapshot!==t.snapshot)throw E("Query cursor does not match the requested snapshot.");let n=$t(e,t.cursor,t.fingerprint,t.readId),o=e.slice(n,n+t.limit),r=o.length>0&&n+o.length<e.length,s=o.at(-1);return{rows:o,has_more:r,...r&&s!==void 0?{next_cursor:J(t.fingerprint,t.readId(s),n+o.length-1,t.snapshot)}:{}}}var Jo=Object.freeze({version:Q,max_length:Re});(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]="b3c001df-9891-5cf7-990b-8d9da7b51801")}catch{}})();var S=["include","amount","cost","encoding"],Ue=["list","context","search","get","next","health","deps","graph","history","activity","validate","events","contracts","comments","notes","files","docs","stats","aggregate","package-catalog","package-manage","comments-audit","assurance"],Le=["canonical","legacy","intent","default"],oe={include:"--output-include",amount:"--output-limit",cost:"--output-budget",encoding:"--output-format"},ar=Object.freeze(S.map(e=>oe[e])),cr=Object.freeze(["--output-session","--output-cursor","--output-row-contract"]),Pe={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:{},"package-catalog":{},"package-manage":{},"comments-audit":{},assurance:{}},je=new Set(["--collapse","--fields","--section"]),re=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.","--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 se(e){return e.slice(2).replaceAll("-","_")}function Yt(e,t){let n=re[e];if(n!==void 0)return n;let o=t==="include"?je.has(e)?"<csv>":se(e):t==="amount"?"<n>":t==="cost"?"<tokens>":"<toon|json>";return`${e} is a compatibility alias; prefer ${oe[t]} ${o}.`}function Xt(e){let t=Pe[e],n=Object.freeze(Object.fromEntries(S.map(o=>[o,Object.freeze({dimension:o,canonical_option:oe[o],applicable:!0,inapplicable_reason:null,legacy_aliases:Object.freeze((t[o]??[]).map(r=>Object.freeze({flag:r,semantics:re[r]===void 0?"replacement":"behavior_preserving",migration_hint:Yt(r,o),visibility:"hidden_alias"})))})])));return Object.freeze({command:e,dimensions:n,precedence:Le,budget_retention_policy:e==="assurance"?"verdict_priority":"ordered_prefix"})}var qt=Object.freeze(Ue.map(Xt)),Wt=new Map(qt.map(e=>[e.command,e]));function R(e,t={}){let n=e.trim().toLowerCase().replaceAll(/\s+/gu," "),r=n==="package catalog"||n==="packages catalog"||n==="package-catalog"||(n==="package"||n==="packages"||n==="extension")&&(t.catalog===!0||t.target==="catalog"||t.action==="catalog")?"package-catalog":n==="package manage"||n==="package-manage"?"package-manage":n.split(" ")[0],s=r.startsWith("list-")?"list":r==="ctx"?"context":r;return Ue.includes(s)?s:void 0}var Qt=["outputInclude","output_include","outputLimit","output_limit","outputBudget","output_budget","outputFormat","output_format","outputSession","output_session","outputCursor","output_cursor","outputRowContract","output_row_contract"],Jt={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 Ht(e){return Qt.some(t=>e[t]!==void 0)}var Zt=[{keys:["outputInclude","output_include"],valid:e=>F(e)!==void 0,message:"--output-include requires at least one comma-separated field or section."},{keys:["outputLimit","output_limit"],valid:e=>e==="unbounded"||w(e)!==void 0,message:"--output-limit must be a positive integer or unbounded."},{keys:["outputBudget","output_budget"],valid:e=>e==="unbounded"||w(e)!==void 0,message:"--output-budget must be a positive integer or unbounded."},{keys:["outputFormat","output_format"],valid:e=>e==="toon"||e==="json",message:"--output-format must be toon or json."},{keys:["outputSession","output_session"],valid:e=>(P(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 ur(e,t){if(!Ht(t))return;let n=R(e,t);if(!n)throw new p(`Universal output controls apply only to read commands; ${e||"this command"} is not a read surface.`,m.USAGE);if((Jt[n]??[]).some(o=>t[o]!==void 0&&t[o]!==!1))throw new p(`Universal output controls cannot be combined with a ${n} mutation.`,m.USAGE);for(let o of Zt){let r=o.keys.map(s=>t[s]).find(s=>s!==void 0);if(r!==void 0&&!o.valid(r))throw new p(o.message,m.USAGE)}}function Ve(e){let t=R(e);return t?new Map((Pe[t].include??[]).filter(n=>!je.has(n)&&re[n]===void 0).map(n=>[se(n),Fe(n)])):new Map}function en(e,t,n){let o=F(t)??[],r=Ve(e),s=[],a=[];for(let i of o){let d=r.get(i);if(d===void 0){s.push(i);continue}n[d]=!0,a.push(i)}return{selectors:s,modes:a}}function dr(e,t){let n=t.outputInclude??t.output_include;if(n===void 0)return;let{selectors:o,modes:r}=en(e,n,t);if(r.length===0)return;let s=o.length>0?o.join(","):void 0;t.outputInclude=s,Object.hasOwn(t,"output_include")&&(t.output_include=s)}function Fe(e){return e.slice(2).replace(/-([a-z])/gu,(t,n)=>n.toUpperCase())}function tn(e,t){let n=Fe(t);if(Object.hasOwn(e,n))return e[n];let o=t.slice(2).replaceAll("-","_");if(Object.hasOwn(e,o))return e[o];if(t==="--no-truncate"&&e.truncate===!1)return!0}function nn(e){return e!==void 0&&e!==!1&&e!==null}function F(e){let n=(Array.isArray(e)?e:[e]).flatMap(o=>typeof o=="string"?o.split(","):[]).map(o=>o.trim()).filter(Boolean);return n.length>0?[...new Set(n)]:void 0}function w(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 on(e,t,n){for(let o of e.legacy_aliases){let r=tn(t,o.flag),s={value:r,flag:o.flag};if(nn(r)&&n(s))return s}}function xe(e,t){let n=F(e);if(n)return{source:"canonical",value:n};if(t)return{source:"legacy",value:F(t.value)??[se(t.flag)]}}function Ie(e,t){if(e==="unbounded")return{source:"canonical",value:"unbounded"};let n=w(e);if(n!==void 0)return{source:"canonical",value:n};if(!t)return;if(t.flag==="--no-truncate"||t.flag==="--unbounded")return{source:"legacy",value:"unbounded"};let o=w(t.value);return o===void 0?void 0:{source:"legacy",value:o}}function Ne(e,t){if(e==="unbounded")return{source:"canonical",value:"unbounded"};let n=w(e);if(n!==void 0)return{source:"canonical",value:n};if(!t)return;let o=w(t.value);return o===void 0?void 0:{source:"legacy",value:o}}function Ce(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 Be(e,t){let n=R(e,t);if(!n)return;let o=Wt.get(n),r={include:f=>xe(void 0,f),amount:f=>Ie(void 0,f),cost:f=>Ne(void 0,f),encoding:f=>Ce(void 0,f)},s=Object.fromEntries(S.map(f=>[f,on(o.dimensions[f],t,g=>r[f](g)!==void 0)])),a=S.flatMap(f=>{let g=s[f];return g?[g.flag]:[]}),i=S.flatMap(f=>{let g=s[f];return g?[o.dimensions[f].legacy_aliases.find(ze=>ze.flag===g.flag).migration_hint]:[]}),d=Ce(t.outputFormat??t.output_format,s.encoding),u=Ne(t.outputBudget??t.output_budget,s.cost),l=e.trim().toLowerCase().replaceAll(/\s+/gu," ").split(" ")[0]==="list-all"||s.amount?.flag==="--no-truncate"||s.include?.flag==="--full",c=Se(e,{generateFallback:!0}),_=d?.value==="json"||t.resolvedOutputFormat==="json"?"json":"toon";return{command:n,include:xe(t.outputInclude??t.output_include,s.include),amount:Ie(t.outputLimit??t.output_limit,s.amount),cost:u??(l?{source:"intent",value:"unbounded"}:{source:"default",value:c.default_max_estimated_tokens_by_format[_]}),encoding:d,legacy_aliases_used:a,migration_hints:i,precedence:Le}}function y(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var ie=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"]),rn=["collection_counts","notes_count","tests_count"];function Ge(e,t){let n=new Set(t.map(o=>o.split(".")[0]));return Object.fromEntries(Object.entries(e).filter(([o])=>n.has(o)))}function sn(e){let t=y(e.item)?e.item:{},n=[...new Set([...Object.keys(t),...rn.filter(r=>Object.hasOwn(t,r))])].sort((r,s)=>r.localeCompare(s)),o=Object.keys(e).filter(r=>r!=="item"&&r!=="read_output"&&!ie.has(r)).sort((r,s)=>r.localeCompare(s));return{item:t,itemFields:n,sections:o,valid:[...n,"item",...n.map(r=>`item.${r}`),...o]}}function an(e,t){let n=sn(e),o=t.filter(c=>!n.valid.includes(c));if(o.length>0)throw new p(`Unknown --output-include selector(s) for get: ${o.join(", ")}. Valid selectors: ${n.valid.join(", ")}.`,m.USAGE);let r=t.includes("item"),s=t.flatMap(c=>c.startsWith("item.")?[c.slice(5)]:n.itemFields.includes(c)?[c]:[]).filter((c,_,f)=>f.indexOf(c)===_);if(r&&s.length>0)throw new p("--output-include cannot mix a full item with projected item fields; use item or item.<field>, not both.",m.USAGE);let a=new Set(t.filter(c=>n.sections.includes(c))),i=Object.fromEntries(Object.entries(e).filter(([c])=>ie.has(c)||a.has(c)));r?i.item=n.item:s.length>0&&(i.item=Ge(n.item,s));let d=[...r?[]:s.length>0?n.itemFields.filter(c=>!s.includes(c)).map(c=>({name:`item.${c}`,restore_with:`--output-include item.${c}`})):[{name:"item",restore_with:"--output-include item"}],...n.sections.filter(c=>!a.has(c)).map(c=>({name:c,restore_with:`--output-include ${c}`}))],l=[...y(i.omission_receipt)&&Array.isArray(i.omission_receipt.omitted_field_groups)?i.omission_receipt.omitted_field_groups:[],...d];return i.omission_receipt={has_omissions:l.length>0,omitted_field_group_count:l.length,omitted_field_groups:l},i}function ve(e){let t=0;return T({...e},n=>(y(n)&&Object.keys(n).length>0&&(t+=1),n)),t}function cn(e,t,n,o){if(ve(t)===0||ve(n)>0)return;let r=[...Ve(e).keys()],s=r.length>0?` Declared ${e} projection modes: ${r.join(", ")}.`:` The ${e} surface declares no projection modes; name row fields instead.`;throw new p(`Unknown --output-include selector(s) for ${e}: ${o.join(", ")}. No selector matched any returned row field.${s}`,m.USAGE)}function un(e,t,n){if(e==="get")return an(t,n);let o=v(t),r=n.flatMap(a=>o.flatMap(i=>a.startsWith(`${i}.`)?[a.slice(i.length+1)]:[])),s=n.some(a=>Object.hasOwn(t,a.split(".")[0])&&!o.some(i=>a.startsWith(`${i}.`)));if(o.length>0&&(!s||r.length>0)){let a={...t},i=r.length>0?r:n,d=T(a,u=>y(u)?Ge(u,i):u);return cn(e,t,d,i),d}return Object.fromEntries(Object.entries(t).filter(([a])=>n.some(i=>i.split(".")[0]===a)||ie.has(a)))}function dn(e,t){if(t==="unbounded")return e;let{result:n,truncated:o}=he(e,t);return o&&(n.has_more=!0,n.truncated=!0,typeof n.count=="number"&&(n.count=M(n)),n.applied_bound={kind:"output_limit",source:"explicit",value:t}),n}function ln(e){return S.filter(t=>e[t]!==void 0&&e[t]?.source!=="default")}function B(e,t,n){let o=X(e,t);for(let r=0;r<8;r+=1){let s=n.estimated_tokens,a=o.read_session.spent_this_call_tokens;h(o,n),o=X(o,t);let i=o.read_session.spent_this_call_tokens;if(n.estimated_tokens===s&&i===a)return o}return o}function lr(e,t){if(!y(e.read_output))return e;let n=e.read_output,o=P(t.outputSession??t.output_session);return o===void 0?(h(e,n),e):B(e,o,n)}function fn(e,t){if(e!=="validate")return t;let n=y(t.projection)?t.projection:void 0;if(!(Array.isArray(n?.declared_field_groups)?n.declared_field_groups:[]).some(c=>y(c)&&c.name==="diagnostic_rows"))return t;let r=[...new Set(D(t).map(({path:c})=>c).filter(c=>/^checks\.\d+\.details\./u.test(c)))],s=r.filter(c=>!r.some(_=>_!==c&&c.startsWith(`${_}.`)));if(s.length===0)return t;let a=y(t.row_contract)?t.row_contract:{},i=Array.isArray(a.row_keys)?a.row_keys.filter(c=>typeof c=="string"):[],d=Array.isArray(a.continuation_row_keys)?a.continuation_row_keys.filter(c=>typeof c=="string"):[],u=i.length>0?i:s,l=[...new Set(s)];return JSON.stringify(u)===JSON.stringify(i)&&JSON.stringify(l)===JSON.stringify(d)?t:{...t,row_contract:{...a,row_keys:u,continuation_row_keys:l,jq_selector:typeof a.jq_selector=="string"?a.jq_selector:".checks[].details"}}}function _n(e,t,n,o){let r={...e};return t.include?.source==="canonical"&&(r=un(t.command,r,t.include.value)),t.command==="assurance"&&(r=De(r)),r=Me(r,t.command,o),t.amount?.source==="canonical"&&(r=dn(r,t.amount.value)),n===void 0?r:be(r,n)}function pn(e,t){return[...e.cost!==void 0&&e.cost.value!=="unbounded"&&(e.cost.source==="canonical"||e.cost.source==="default")?[{source:e.cost.source,tokens:e.cost.value}]:[],...t===void 0?[]:[{source:"session",tokens:Oe(t)}]].sort((o,r)=>o.tokens-r.tokens)[0]}function mn(e,t,n,o,r){let s={contract_version:1,command:e.command,requested_dimensions:t,...o.source==="default"?{budget_source:o.source,budget_tokens:o.tokens}:{},precedence:e.precedence,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:r}:{}},a={output_budget_exceeded:{omitted_result:!0,reason:"requested_budget_infeasible",restore_with:"Unbounded",recovery:{outputBudget:"unbounded"}},read_output:s},i=n===void 0?a:B(a,n,s);if(n===void 0&&h(i,s),n!==void 0&&s.estimated_tokens>o.tokens)throw new p("The remaining output-session budget cannot fit its mandatory receipts; start a new session with a larger token_budget.",m.USAGE);return i}function gn(e,t,n,o){if(n!==void 0)return!1;let r=t.filter(s=>e[s]?.source==="canonical").length;return e.cost?.value==="unbounded"?r===(e.cost.source==="canonical"?1:0):e.cost?.source==="legacy"&&r===0?!0:r===0&&(e.cost===void 0||W(o)<=e.cost.value)}function yn(e,t,n,o,r,s){if(!n.rows_compacted)return;let a=t.amount?.value==="unbounded"?["amount"]:[],i=new Map(A(e).map(l=>[l.path,Array.isArray(l.value)?l.value.length:Object.keys(l.value).length])),d=[...s.entries()].flatMap(([l,c])=>{let _=i.get(l);if(_>=c.rows)return[];let f=c.baseOffset+_;return[{path:l,cursor:te({command:t.command,path:l,offset:f,total_rows:c.totalRows,fingerprint:c.fingerprint}),retained_rows:_,remaining_rows:c.totalRows-f,total_rows:c.totalRows}]}),u=d[0];u&&typeof e.next_cursor!="string"&&(e.next_cursor=u.cursor),e.continuation_kind=r?"producer_cursor":u?"output_cursor":"none",e.output_budget_truncation={reason:"output_budget_reached",budget_source:o.source,budget_tokens:o.tokens,overridden_dimensions:a,compacted_row_paths:n.compacted_row_paths,continuation_cursor_rebased:r,continuation_available:d.length>0,recovery_budget_multiplier:1,continuations:d,restore_with:u?"Use recovery binding.":"Increase --output-budget because no declared row collection can be continued.",recovery:u?{cursor:u.cursor,cli:"--output-cursor",sdk:"outputCursor",mcp:"outputCursor"}:{cli:"--output-budget 1200",sdk:{outputBudget:1200},mcp:{outputBudget:1200}}}}function hn(e,t,n,o){if(typeof n!="string"||!Array.isArray(e.items))return!1;let r=e.items.length;if(r===0||r>=t)return!1;let s;try{s=H(n)}catch{return!1}let a=s.after_index;if(a===void 0)return!1;let i=e.items.at(-1);if(Object.prototype.toString.call(i)!=="[object Object]")return!1;let d=Reflect.get(i,"id");if(typeof d!="string"||d.length===0)return!1;let u=o?a-(t-r):a+r;return u<0?!1:(e.next_cursor=J(s.fingerprint,d,u,s.snapshot),typeof e.applied_limit=="number"&&(e.applied_limit=r),!0)}function En(e,t,n){let o=new Map(A(e).map(s=>{let a=Array.isArray(s.value)?s.value.length:Object.keys(s.value).length,i=t?.path===s.path;return[s.path,{rows:a,totalRows:i?t.total_rows:a,baseOffset:i?t.offset:0,fingerprint:i?t.fingerprint:ee(s.path,s.value)}]})),r=typeof e.next_cursor=="string";return{collectionsBeforeBudget:o,originalItemCount:Array.isArray(e.items)?e.items.length:0,cursorContinuesExistingPage:r,cursorSource:r?e.next_cursor:n.after}}function bn(e,t,n,o,r,s){let a=t.command==="assurance"&&Array.isArray(e.assertions)?e.assertions.filter(u=>y(u)&&u.verdict!=="pass").length:0,i=Te(e,n,o.tokens,a>0?new Map([["assertions",a]]):new Map),d=hn(i,s.originalItemCount,s.cursorSource,s.cursorContinuesExistingPage);return yn(i,t,n,o,d,s.collectionsBeforeBudget),r!==void 0&&(i=B(i,r,n)),i}function fr(e,t,n){let o=Be(e,t);if(!o)return n;let r=P(t.outputSession??t.output_session),s=t.outputCursor??t.output_cursor,a=typeof s=="string"?ne(s):void 0,i=ln(o);if(a===void 0&&gn(o,i,r,n))return n;let d=fn(o.command,n),u=pn(o,r),l=_n(d,o,r,a),c=En(l,a,t),_={contract_version:1,command:o.command,requested_dimensions:i,...u?.source==="default"?{budget_source:u.source,budget_tokens:u.tokens}:{},precedence:o.precedence,legacy_aliases_used:o.legacy_aliases_used,migration_hints:o.migration_hints,estimated_tokens:0,within_budget:!0,strings_compacted:!1,rows_compacted:!1,result_omitted:!1};return l.read_output=_,l=r===void 0?l:B(l,r,_),h(l,_),u!==void 0&&_.estimated_tokens>u.tokens&&(l=bn(l,o,_,u,r,c)),u!==void 0&&_.estimated_tokens>u.tokens?mn(o,i,r,u,_.estimated_tokens):l}function _r(e){return y(e)&&y(e.output_budget_exceeded)&&e.output_budget_exceeded.omitted_result===!0&&e.output_budget_exceeded.reason==="requested_budget_infeasible"}function pr(e,t){let n=Be(e,t)?.encoding;return n?.value==="json"||n?.value==="toon"?n.value:void 0}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="1c73c31e-6246-5730-8c8a-d3ba7c9ec112")}catch{}})();var An=4096;function Ke(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function ee(e,t){return On("sha256").update(V({path:e,value:t})).digest("base64url").slice(0,16)}function te(e){return Buffer.from(JSON.stringify({v:1,c:e.command,p:e.path,o:e.offset,n:e.total_rows,f:e.fingerprint}),"utf8").toString("base64url")}function ne(e){if(e.length>An)throw new p("The read-output continuation cursor is malformed or unsupported.",m.USAGE,{code:"read_output_cursor_invalid"});let t;try{t=JSON.parse(Buffer.from(e,"base64url").toString("utf8"))}catch{t=null}if(!Ke(t)||t.v!==1||R(String(t.c??""))!==t.c||typeof t.p!="string"||t.p.length===0||!Number.isSafeInteger(t.o)||t.o<0||!Number.isSafeInteger(t.n)||t.n<1||typeof t.f!="string"||t.f.length===0)throw new p("The read-output continuation cursor is malformed or unsupported.",m.USAGE,{code:"read_output_cursor_invalid"});return{version:1,command:t.c,path:t.p,offset:t.o,total_rows:t.n,fingerprint:t.f}}function De(e){if(!Array.isArray(e.assertions))return e;let t=n=>!Ke(n)||n.verdict==="pass"?4:n.verdict==="retired"?3:n.enforcement==="block"?0:n.enforcement==="warn"?1:2;return{...e,assertions:e.assertions.map((n,o)=>({row:n,index:o})).sort((n,o)=>t(n.row)-t(o.row)||n.index-o.index).map(({row:n})=>n),budget_retention_policy:"verdict_priority"}}function Me(e,t,n){if(!n)return e;if(n.command!==t)throw new p(`The read-output cursor belongs to ${n.command}, not ${t}.`,m.USAGE,{code:"read_output_cursor_command_mismatch"});let o=A(e).find(s=>s.path===n.path),r=o?Array.isArray(o.value)?o.value.length:Object.keys(o.value).length:0;if(!o||r!==n.total_rows||n.offset>r||ee(n.path,o.value)!==n.fingerprint)throw new p("The read-output continuation no longer matches the declared row collection; restart the bounded read.",m.USAGE,{code:"read_output_cursor_stale"});return ye(e,n.path,n.offset)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="f6e82c93-54e8-53a7-94df-10a573aae933")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="08ee7e43-8811-57ed-8bfe-0345ee5d3308")}catch{}})();var Sn=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"}]),kr=new Set(Sn.flatMap(e=>[e.flag,...e.aliases??[]]));export{G as a,$e as b,Ye as c,wn as d,ae as e,ce as f,ue as g,Tn as h,de as i,le as j,fe as k,Xe as l,Rn as m,xn as n,In as o,Nn as p,Cn as q,vn as r,Dn as s,Mn as t,Un as u,Ln as v,Pn as w,jn as x,Vn as y,Fn as z,Bn as A,Gn as B,Kn as C,qe as D,zn as E,$n as F,Yn as G,Xn as H,qn as I,Wn as J,Qn as K,Qe as L,Je as M,He as N,eo as O,to as P,Ze as Q,no as R,oo as S,tt as T,nt as U,K as V,ro as W,so as X,m as Y,p as Z,Sn as _,kr as $,V as aa,k as ba,jo as ca,Vo as da,I as ea,lo as fa,fo as ga,_o as ha,ot as ia,rt as ja,st as ka,yo as la,ho as ma,it as na,N as oa,Eo as pa,at as qa,ct as ra,me as sa,C as ta,ut as ua,bo as va,Oo as wa,Ao as xa,So as ya,wo as za,To as Aa,ko as Ba,Y as Ca,P as Da,be as Ea,X as Fa,Oe as Ga,yt as Ha,Mo as Ia,wt as Ja,Ae as Ka,Tt as La,kt as Ma,Se as Na,Uo as Oa,te as Pa,ne as Qa,Xo as Ra,qo as Sa,J as Ta,H as Ua,Z as Va,Wo as Wa,$t as Xa,Qo as Ya,Jo as Za,S as _a,Ue as $a,ar as ab,cr as bb,qt as cb,R as db,ur as eb,Ve as fb,en as gb,dr as hb,Be as ib,lr as jb,fr as kb,_r as lb,pr as mb};
|
|
2
|
+
//# sourceMappingURL=chunk-Q47EX4DI.js.map
|