@unbrained/pm-cli 2026.8.24 → 2026.8.26
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 +46 -0
- package/dist/cli-bundle/bundle-manifest.json +149 -149
- package/dist/cli-bundle/chunks/chunk-E2GCFJSU.js +35 -0
- package/dist/cli-bundle/chunks/{chunk-TEQDR5KI.js → chunk-ES25LX3D.js} +62 -62
- package/dist/cli-bundle/chunks/{chunk-I5Q7QSZX.js → chunk-FRDWWB6R.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-X7WWQDYQ.js → chunk-ICQ3RVIY.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-YOLLRCLY.js → chunk-IV64RJVE.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-L22NP5MA.js → chunk-KBFP3E4E.js} +86 -86
- package/dist/cli-bundle/chunks/{chunk-AGUL3HUT.js → chunk-MVYLQ67M.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-DJNJBWAQ.js → chunk-S4U76VZF.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-IW72J5FW.js → chunk-UKBCRPA2.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-WRHJ3MB6.js +8 -0
- package/dist/cli-bundle/chunks/{chunk-ZAVCS2GH.js → chunk-ZNRLJ54C.js} +60 -60
- package/dist/cli-bundle/chunks/{register-list-query-37A4P6O4.js → register-list-query-EMCPMICY.js} +2 -2
- package/dist/cli-bundle/chunks/{register-mutation-TBJDHYIT.js → register-mutation-OJ67ABCB.js} +3 -3
- package/dist/cli-bundle/chunks/{register-operations-WRZNEBUM.js → register-operations-H2GLP7LT.js} +2 -2
- package/dist/cli-bundle/chunks/{register-setup-H4PDLACD.js → register-setup-GLZAHLVI.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-IMWTYKII.js → chunk-4K2II4TV.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-4XNH2HM7.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-GJR6YEMR.js → chunk-57XY346D.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-4WP7LNE3.js → chunk-66VGB23P.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-72T6JGAE.js +50 -0
- package/dist/cli-bundle/focused-chunks/{chunk-BFA6KKCI.js → chunk-7I23XGWO.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-6Z24ZMU3.js → chunk-7YCDTCBC.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-O4ZXNJMT.js → chunk-A644DUFQ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-FXDLT6FL.js +16 -0
- package/dist/cli-bundle/focused-chunks/{chunk-RASVBJX5.js → chunk-IBHXMFE7.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-LMKG3DFE.js +5 -0
- package/dist/cli-bundle/focused-chunks/{chunk-6MUTDXMP.js → chunk-LV5N3LK5.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-CWCN5RLO.js → chunk-MMXUPDDJ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-WZLSSGEU.js → chunk-OHIHZ7HS.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-P2E6LDAE.js +19 -0
- package/dist/cli-bundle/focused-chunks/{chunk-IZNRRCU3.js → chunk-TMJDFHVD.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-QBP5FSBX.js → chunk-UYBA57GY.js} +4 -4
- package/dist/cli-bundle/focused-chunks/{chunk-MNPECIRL.js → chunk-YO3ZF3FI.js} +2 -2
- package/dist/cli-bundle/main.js +2 -2
- 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 +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 -33
- 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 +7 -6
- package/dist/core/diagnostics/remediation.js +17 -2
- package/dist/core/extensions/manifest-schema.d.ts +20 -0
- package/dist/core/extensions/manifest-schema.js +28 -10
- package/dist/mcp/http-server.d.ts +60 -0
- package/dist/mcp/http-server.js +451 -0
- package/dist/mcp/legacy-adapter.d.ts +50 -0
- package/dist/mcp/legacy-adapter.js +64 -0
- package/dist/mcp/server.d.ts +42 -9
- package/dist/mcp/server.js +457 -58
- package/dist/sdk/agent/refusal-closure-census.d.ts +6 -2
- package/dist/sdk/agent/refusal-closure-census.js +16 -8
- package/dist/sdk/cli-contracts/runtime-contracts.d.ts +10 -0
- package/dist/sdk/cli-contracts/runtime-contracts.js +20 -3
- package/dist/sdk/compose.d.ts +4 -1
- package/dist/sdk/compose.js +23 -36
- package/dist/sdk/extension/author-manifest.d.ts +22 -0
- package/dist/sdk/extension/author-manifest.js +93 -0
- package/dist/sdk/extension.js +6 -3
- package/dist/sdk/generated/generated-error-code-catalog-part-1.js +67 -28
- package/dist/sdk/generated/generated-error-code-catalog-part-2.js +30 -3
- package/dist/sdk/governance/health.js +103 -11
- package/dist/sdk/governance/validate.js +15 -9
- package/dist/sdk/history-repair.d.ts +24 -0
- package/dist/sdk/history-repair.js +145 -4
- package/dist/sdk/index.d.ts +6 -0
- package/dist/sdk/index.js +8 -2
- package/dist/sdk/mcp/authorization.d.ts +134 -0
- package/dist/sdk/mcp/authorization.js +405 -0
- package/dist/sdk/mcp/interactions.d.ts +118 -0
- package/dist/sdk/mcp/interactions.js +337 -0
- package/dist/sdk/mcp/protocol.d.ts +142 -0
- package/dist/sdk/mcp/protocol.js +174 -0
- package/dist/sdk/mcp/subscriptions.d.ts +65 -0
- package/dist/sdk/mcp/subscriptions.js +212 -0
- package/dist/sdk/mcp/tasks.d.ts +107 -0
- package/dist/sdk/mcp/tasks.js +431 -0
- package/dist/sdk/mcp/transport.d.ts +30 -0
- package/dist/sdk/mcp/transport.js +261 -0
- package/dist/sdk/merge/driver.js +25 -4
- package/dist/sdk/merge/receipt-file-boundary.d.ts +21 -0
- package/dist/sdk/merge/receipt-file-boundary.js +47 -0
- package/dist/sdk/merge/receipts.d.ts +40 -1
- package/dist/sdk/merge/receipts.js +343 -36
- package/dist/sdk/merge/reconcile.js +117 -47
- package/dist/sdk/read-output/continuation.d.ts +15 -2
- package/dist/sdk/read-output/continuation.js +86 -6
- package/dist/sdk/read-output-contracts.d.ts +4 -1
- package/dist/sdk/read-output-contracts.js +9 -6
- package/dist/sdk/runtime-primitives.d.ts +1 -1
- package/dist/sdk/runtime-primitives.js +3 -3
- package/dist/sdk/test/execution.d.ts +6 -0
- package/dist/sdk/test/execution.js +32 -3
- package/docs/AGENT_PROVENANCE_ADR.md +6 -4
- package/docs/AGENT_RUNTIME_PRIMITIVES.md +6 -5
- package/docs/CLAUDE_CODE_PLUGIN.md +12 -5
- package/docs/DIAGNOSTIC_OUTPUT_CONTRACTS.md +8 -0
- package/docs/EXTENSIONS.md +3 -4
- package/docs/MCP_2026_07_28.md +138 -0
- package/docs/MCP_2026_07_28_CONFORMANCE.md +30 -0
- package/docs/MCP_REMOTE_TRANSPORT_SECURITY.md +180 -0
- package/docs/MERGE_SAFETY.md +34 -5
- package/docs/OUTPUT_PROJECTION_CONTRACTS.md +13 -1
- package/docs/README.md +4 -0
- package/docs/READ_OUTPUT_CONTRACTS.md +25 -2
- package/docs/RELEASING.md +3 -2
- package/docs/SDK.md +22 -1
- package/docs/SDK_AGENT_SESSION_CONTEXT.md +18 -13
- package/docs/SDK_MCP_INTERACTIONS.md +227 -0
- package/docs/TESTING.md +4 -0
- package/docs/generated/REFUSAL_CLOSURE_CENSUS.md +13 -8
- package/marketplace.json +2 -2
- package/package.json +7 -5
- 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/finalize-build.mjs +1 -0
- package/sdk/public-surface.json +762 -15
- package/dist/cli-bundle/chunks/chunk-MKE6MD2K.js +0 -36
- package/dist/cli-bundle/chunks/chunk-NXBFO63A.js +0 -8
- package/dist/cli-bundle/focused-chunks/chunk-FCTT4CZU.js +0 -5
- package/dist/cli-bundle/focused-chunks/chunk-Q63PSLO4.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-QV5UP27O.js +0 -51
- package/dist/cli-bundle/focused-chunks/chunk-RPRLENVA.js +0 -16
- package/dist/cli-bundle/focused-chunks/chunk-TOFVXBWA.js +0 -19
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{w as D,x as q}from"./chunk-
|
|
1
|
+
import{w as D,x as q}from"./chunk-LV5N3LK5.js";import{Mb as N,Sb as z,Ub as O,da as j}from"./chunk-57XY346D.js";import{fa as S,ka as m,t as b,v as k}from"./chunk-UYBA57GY.js";import{aa as _,ab as x,db as C,gb as L}from"./chunk-LMKG3DFE.js";import{constants as u}from"node:fs";import{lstat as M,mkdir as $,open as F}from"node:fs/promises";import h from"node:path";(function(){try{var i=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new i.Error().stack;e&&(i._sentryDebugIds=i._sentryDebugIds||{},i._sentryDebugIds[e]="bb5dfa6f-b60f-55f2-ae17-3dbcaaff1b47")}catch{}})();function E(i,e){if(typeof i!="string"||i.trim().length===0)throw new TypeError(`Relationship event ${e} must be non-empty`);return i.trim()}function I(i,e){let t=e.require(i.kind),n=t.direction==="undirected"?[i.source,i.target].sort().join("\0"):`${i.source}\0${i.target}`;return`${t.kind}\0${n}`}function H(i){return Object.freeze({...i,...i.payload===void 0?{}:{payload:Object.freeze(structuredClone(i.payload))}})}function J(i,e,t,n){let r=t.require(i.kind),o=n.outgoingOne.get(`${r.kind}\0${i.source}`);if(o!==void 0&&o!==e)throw new TypeError(`Relationship outgoing cardinality exceeded for ${r.kind}`);let s=n.incomingOne.get(`${r.kind}\0${i.target}`);if(s!==void 0&&s!==e)throw new TypeError(`Relationship incoming cardinality exceeded for ${r.kind}`);let c=I(i,t),d=n.identities.get(c);if(d!==void 0&&d!==e)throw new TypeError(`Relationship edge already active: ${c}`)}function K(i){let e=new Map;for(let t of i)t.action==="remove"?e.delete(t.relationshipId):e.set(t.relationshipId,t.edge);return e}function G(i,e,t){if(i.expectedVersion!==void 0&&i.expectedVersion!==e)throw new TypeError(`Relationship event version conflict: expected ${i.expectedVersion}, current ${e}`);let n=E(i.eventId,"eventId");if(t.has(n))throw new TypeError(`Relationship event already exists: ${n}`);if(i.action!=="add"&&i.action!=="remove"&&i.action!=="supersede")throw new TypeError(`Unknown relationship event action: ${i.action}`);if(!Number.isFinite(Date.parse(i.timestamp)))throw new TypeError("Relationship event timestamp must be valid");return{eventId:n,relationshipId:E(i.relationshipId,"relationshipId"),author:E(i.author,"author"),timestamp:new Date(i.timestamp).toISOString()}}function Q(i,e,t,n,r,o){let s=t.has(e);if(i.action==="add"&&s)throw new TypeError(`Relationship is already active: ${e}`);if(i.action!=="add"&&!s)throw new TypeError(`Relationship is not active: ${e}`);if(i.action==="remove")return;if(!i.edge)throw new TypeError(`Relationship ${i.action} event requires an edge`);let c=typeof i.edge.source=="string"?i.edge.source.trim():"",d=typeof i.edge.target=="string"?i.edge.target.trim():"";if(!n.has(c)||!n.has(d))throw new TypeError(`Relationship endpoint not found: ${c} -> ${d}`);let a=new m([c,d],[i.edge],r).edges()[0];return J(a,e,r,o),H(a)}var T=class{#t;#n;#i=[];#o=new Set;#e=new Map;#r={identities:new Map,outgoingOne:new Map,incomingOne:new Map};constructor(e,t={}){this.#t=new Set([...e].filter(n=>typeof n=="string").map(n=>n.trim()).filter(Boolean)),this.#n=t.registry??S()}get version(){return this.#i.length}events(){return Object.freeze([...this.#i])}*stream(e={}){let t=e.fromVersion??1,n=e.toVersion??this.version,r=e.batchSize??100;if(!Number.isInteger(t)||t<1)throw new TypeError("Relationship event stream fromVersion must be positive");if(!Number.isInteger(n)||n<0||n>this.version)throw new TypeError(`Relationship event stream toVersion out of range: ${n}`);if(!Number.isInteger(r)||r<1)throw new TypeError("Relationship event stream batchSize must be positive");if(t>n+1)throw new TypeError("Relationship event stream fromVersion exceeds the selected prefix");for(let o=t-1;o<n;o+=r)yield Object.freeze(this.#i.slice(o,Math.min(o+r,n)))}project(e,t,n={}){if(typeof t!="function")throw new TypeError("Relationship event projection requires a reducer");let r=e,o=0,s;for(let c of this.stream({...n,batchSize:256}))for(let d of c)r=t(r,d),o+=1,s=d;return Object.freeze({state:r,version:s?.sequence??Math.max(0,(n.fromVersion??1)-1),processed:o,...s===void 0?{}:{asOf:s.timestamp}})}#s(e,t){let n=this.#n.require(t.kind);this.#r.identities.set(I(t,this.#n),e),n.outgoing==="one"&&this.#r.outgoingOne.set(`${n.kind}\0${t.source}`,e),n.incoming==="one"&&this.#r.incomingOne.set(`${n.kind}\0${t.target}`,e)}#a(e){let t=this.#n.require(e.kind);this.#r.identities.delete(I(e,this.#n)),t.outgoing==="one"&&this.#r.outgoingOne.delete(`${t.kind}\0${e.source}`),t.incoming==="one"&&this.#r.incomingOne.delete(`${t.kind}\0${e.target}`)}append(e){let t=G(e,this.version,this.#o),n=this.#e.get(t.relationshipId),r=Q(e,t.relationshipId,this.#e,this.#t,this.#n,this.#r),o=Object.freeze({eventId:t.eventId,relationshipId:t.relationshipId,action:e.action,...r===void 0?{}:{edge:r},author:t.author,timestamp:t.timestamp,...e.reason?.trim()?{reason:e.reason.trim()}:{},sequence:this.version+1});return this.#i.push(o),this.#o.add(t.eventId),n&&this.#a(n),e.action==="remove"?this.#e.delete(t.relationshipId):(this.#e.set(t.relationshipId,r),this.#s(t.relationshipId,r)),o}snapshot(e={}){if(e.atVersion!==void 0&&e.atTimestamp!==void 0)throw new TypeError("Relationship snapshot accepts one target");let t;if(e.atTimestamp!==void 0){let o=Date.parse(e.atTimestamp);if(!Number.isFinite(o))throw new TypeError("Relationship snapshot timestamp must be valid");t=this.#i.filter(s=>Date.parse(s.timestamp)<=o)}else{let o=e.atVersion??this.version;if(!Number.isInteger(o)||o<0||o>this.version)throw new TypeError(`Relationship snapshot version out of range: ${o}`);t=this.#i.slice(0,o)}let n=K(t),r=new m(this.#t,n.values(),this.#n);return Object.freeze({version:t.at(-1)?.sequence??0,...t.at(-1)?{asOf:t.at(-1).timestamp}:{},edges:r.edges(),graph:r})}page(e){if(!Number.isInteger(e.limit)||e.limit<1)throw new TypeError("Relationship event page limit must be positive");let t=x("relationship-events",{order:"append-sequence"}),n=e.cursor===void 0?this.version:Number(C(e.cursor,t).snapshot);if(!Number.isSafeInteger(n)||n<0||n>this.version)throw new TypeError("Relationship event cursor snapshot version is invalid");let r=L(this.#i.slice(0,n),{cursor:e.cursor,fingerprint:t,limit:e.limit,readId:o=>o.eventId,snapshot:String(n)});return{version:n,events:r.rows,hasMore:r.has_more,...r.next_cursor?{nextCursor:r.next_cursor}:{}}}},Y="relationship-event-store",A=u.O_NOFOLLOW;function g(i){return j(i,Y,30,`relationship-store:${process.pid}`,!1,!1,3e3)}async function l(i,e="relationships/events.jsonl"){let t=h.resolve(i),n=h.resolve(t,e),r=h.relative(t,n);if(r.length===0)throw new TypeError("Relationship event path must name a file within the tracker root");if(r===".."||r.startsWith(`..${h.sep}`)||h.isAbsolute(r))throw new TypeError("Relationship event path must stay within the tracker root");if(await $(t,{recursive:!0}),(await M(t)).isSymbolicLink())throw new TypeError("Relationship event tracker root must not be a symbolic link");let s=t;for(let c of r.split(h.sep)){s=h.join(s,c);try{if((await M(s)).isSymbolicLink())throw new TypeError("Relationship event path must not contain symbolic links")}catch(d){if(b(d))break;throw d}}return n}async function w(i,e,t){let n=new T(e,{registry:t}),r,o;try{o=await F(i,u.O_RDONLY|A),r=await o.readFile("utf8")}catch(c){if(b(c))return{log:n,raw:""};throw c}finally{await o?.close()}let s=r.split(`
|
|
2
2
|
`);for(let c=0;c<s.length;c+=1){let d=s[c].trim();if(!d)continue;let a;try{a=JSON.parse(d)}catch{throw new TypeError(`Invalid relationship event JSONL at line ${c+1}`)}if(a.sequence!==n.version+1)throw new TypeError(`Invalid relationship event sequence at line ${c+1}`);n.append({eventId:a.eventId,relationshipId:a.relationshipId,action:a.action,...a.edge===void 0?{}:{edge:a.edge},author:a.author,timestamp:a.timestamp,...a.reason===void 0?{}:{reason:a.reason},expectedVersion:n.version})}return{log:n,raw:r}}function U(i,e,t,n){let r=Date.parse(e.timestamp),o;return e.action!=="remove"&&e.edge!==void 0&&(o=new m(t,[e.edge],n).edges()[0]),i.eventId===e.eventId.trim()&&i.relationshipId===e.relationshipId.trim()&&i.action===e.action&&i.author===e.author.trim()&&Number.isFinite(r)&&i.timestamp===new Date(r).toISOString()&&i.reason===(e.reason?.trim()||void 0)&&_(i.edge)===_(o)}var V=class i{#t;#n;#i;#o;#e;constructor(e,t,n,r){this.#t=e.pmRoot,this.#n=t,this.#i=e.registry,this.#o=n,this.#e=r}static async open(e){let t=Object.freeze([...e.nodes]),n=await l(e.pmRoot,e.relativePath),r=await g(e.pmRoot);try{await l(e.pmRoot,n);let{log:o}=await w(n,t,e.registry);return new i(e,t,n,o)}finally{await r()}}get path(){return this.#o}async currentVersion(){return this.#e=await this.#r(),this.#e.version}async append(e){let t=await g(this.#t);try{let n=await l(this.#t,this.#o),{log:r}=await w(n,this.#n,this.#i),o=r.append(e);await $(h.dirname(n),{recursive:!0}),await l(this.#t,n);let s=await F(n,u.O_APPEND|u.O_CREAT|u.O_WRONLY|A);try{await s.appendFile(`${JSON.stringify(o)}
|
|
3
3
|
`,"utf8")}finally{await s.close()}return this.#e=r,o}finally{await t()}}async appendBatch(e,t={}){let n=await g(this.#t);try{let r=await l(this.#t,this.#o),{log:o,raw:s}=await w(r,this.#n,this.#i),c=o.version,d=new Map(o.events().map(f=>[f.eventId,f])),a=[],R=[];for(let f of e){let p=f.eventId.trim(),y=d.get(p);if(y!==void 0){if(t.existingEventPolicy==="skip_identical"&&U(y,f,this.#n,this.#i)){R.push(y.eventId);continue}if(t.existingEventPolicy==="skip_identical")throw new TypeError(`Relationship event id collision with different content: ${p}`)}let v=o.append(f);d.set(v.eventId,v),a.push(v)}if(a.length>0){let f=s.length===0||s.endsWith(`
|
|
4
4
|
`)?s:`${s}
|
|
5
5
|
`;await $(h.dirname(r),{recursive:!0}),await l(this.#t,r),await k(r,`${f}${a.map(p=>JSON.stringify(p)).join(`
|
|
6
6
|
`)}
|
|
7
7
|
`)}return this.#e=o,Object.freeze({version_before:c,version_after:o.version,appended:Object.freeze(a),skipped_event_ids:Object.freeze(R)})}finally{await n()}}async snapshot(e={}){return this.#e=await this.#r(),this.#e.snapshot(e)}async page(e){return this.#e=await this.#r(),this.#e.page(e)}async*stream(e={}){this.#e=await this.#r(),yield*this.#e.stream(e)}async project(e,t,n={}){return this.#e=await this.#r(),this.#e.project(e,t,n)}async#r(){let e=await g(this.#t);try{let t=await l(this.#t,this.#o);return(await w(t,this.#n,this.#i)).log}finally{await e()}}};(function(){try{var i=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new i.Error().stack;e&&(i._sentryDebugIds=i._sentryDebugIds||{},i._sentryDebugIds[e]="94e8b95b-35fa-5fc7-843a-481497e09b54")}catch{}})();function P(i){return[...i].sort().join("\0")}function X(i,e,t){let n=i.successors.get(e);n?n.push(t):i.successors.set(e,[t]);let r=i.predecessors.get(t);r?r.push(e):i.predecessors.set(t,[e])}function W(i,e,t,n,r){let o=e.resolve(r);if(o?.ordering!==!0)return;let s=z(n),c=s===void 0?void 0:i.canonicalIds.get(s.toLowerCase());if(c===void 0)return;let d=(o.precedence??"source_before_target")==="source_before_target";X(i,d?t:c,d?c:t)}function Z(i,e){let t={successors:new Map,predecessors:new Map,canonicalIds:new Map},n=i.filter(r=>typeof r?.id=="string"&&r.id.trim().length>0);for(let r of n){let o=r.id.trim();t.canonicalIds.set(o.toLowerCase(),o)}for(let r of n){let o=r.id.trim();W(t,e,o,r.blocked_by,"blocked_by");for(let s of r.dependencies??[])typeof s!="object"||s===null||W(t,e,o,s.id,typeof s.kind=="string"?s.kind:"related")}for(let r of[t.successors,t.predecessors])for(let o of r.values())o.sort();return t}function ee(i,e){let t=new Set([e]),n=[e];for(;n.length>0;){let r=n.pop();for(let o of[i.successors,i.predecessors])for(let s of o.get(r)??[])t.has(s)||(t.add(s),n.push(s))}return t}function te(i,e){let t=new Map;for(let n of e){let r=(i.successors.get(n)??[]).filter(o=>e.has(o));r.length>0&&t.set(n,r)}return t}function B(i,e,t){let n=Z(i,e),r=n.canonicalIds.get(t.trim().toLowerCase());if(r===void 0)return{cycles:[],successors:new Map,canonical:t};let o=te(n,ee(n,r));return{cycles:D(o).filter(s=>s.includes(r)),successors:o,canonical:r}}function ne(i,e,t){let n=new Set(e),r=n.has(t)?t:e[0];if(i.get(r)?.includes(r))return[r,r];for(let o of i.get(r)??[]){if(!n.has(o))continue;let s=ie(i,n,r,o);if(s)return s}return[...e,e[0]]}function ie(i,e,t,n){let r=[[n]],o=new Set([t,n]);for(;r.length>0;){let s=r.shift(),c=s.at(-1);for(let d of i.get(c)??[]){if(d===t)return[t,...s,t];!e.has(d)||o.has(d)||(o.add(d),r.push([...s,d]))}}}function me(i,e,t){let n=N(),r=B(i,n,t),o=B(e,n,t),s=new Set(r.cycles.map(P)),c=new Set(O(i,void 0,n).map(a=>`${a.holder_id.toLowerCase()}\0${a.target_id.toLowerCase()}\0${a.dependency_kind}`));return[...O(e,void 0,n).filter(a=>a.holder_id.toLowerCase()===t.trim().toLowerCase()&&!c.has(`${a.holder_id.toLowerCase()}\0${a.target_id.toLowerCase()}\0${a.dependency_kind}`)).map(a=>`ordering_storage_contradiction_created:${q(a)}:remove_contradicting_dependency_row:run_pm_graph_audit`),...o.cycles.filter(a=>!s.has(P(a))).map(a=>`ordering_cycle_created:${ne(o.successors,a,o.canonical).join(" -> ")}:items_will_not_be_ready:run_pm_graph_audit`)]}export{T as a,V as b,me as c};
|
|
8
|
-
//# sourceMappingURL=chunk-
|
|
8
|
+
//# sourceMappingURL=chunk-IBHXMFE7.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
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]="ef5c8553-c206-5bb5-913a-85afb936f6d7")}catch{}})();var Q=["commands","renderers","hooks","schema","importers","search","parser","preflight","services"],lt=2,_t=Object.freeze({migration:"schema",validation:"schema"}),lo=Object.freeze({version:lt,capabilities:[...Q],legacy_aliases:{..._t}}),Ee=["off","warn","enforce"],Oe=["off","warn","enforce"],Ae=["none","restricted","strict"],_o=["block","warn"],Se=["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"],we=["output_format","error_format","help_format","lock_acquire","lock_release","history_append","item_store_write","item_store_delete","context_relevance","command_result"];function Te(){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]="64223a83-1287-57ac-915d-dbd5e375a6eb")}catch{}})();var ft=["Epic","Feature","Task","Chore","Issue","Decision","Event","Reminder","Milestone","Meeting","Plan"],po=ft,mo=["draft","open","in_progress","blocked","closed","canceled"],go=["draft","active","blocked","terminal","terminal_done","terminal_canceled","default_open","default_close","default_cancel"],yo=["string","number","boolean","string_array","array","object"],ho=["create","update","update_many","list","search","calendar","context"],bo=["allow","warn","reject"],Eo=["blocks","parent","child","parent_child","child_of","related","related_to","discovered_from","blocked_by","incident_from","epic","implements","recurs_from","supersedes","task","verifies"],Oo=["project","global"],Ao=["low","medium","high","critical"],So=["low","medium","high","critical"],wo=["low","medium","high"];var To=["minimal","default","strict","custom"],xo=["none","warn","strict"],ko=["progressive","strict"],Ro=["off","warn","strict"],Io=["off","warn","strict"];var No=["daily","weekly","monthly","yearly"],pt=["mon","tue","wed","thu","fri","sat","sun"];function Co(e){return pt.indexOf(e)}var vo=["draft","research","review","approved","executing","paused","completed","superseded"],Do=["pending","in_progress","completed","blocked","skipped","superseded"],Mo=["codex","claude-code","cursor","generic"],Uo=["related","blocks","blocked_by","depends_on","discovered_from","implements","recurs_from","verifies","supersedes"],Lo=["brief","standard","deep","full"],Po=["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 xe=["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"],mt=["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",...xe,"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"],gt=mt;(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]="4bb01c24-e203-5f9f-ba23-25888bd7f6ea")}catch{}})();var yt=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"]}]),ht=Object.freeze({draft_status:"draft",open_status:"open",in_progress_status:"in_progress",blocked_status:"blocked",close_status:"closed",canceled_status:"canceled"}),Bo=".agents/pm",Go="settings.json";var bt=["","epics","features","tasks","chores","issues","schema","history","search","extensions","locks"],Et=["decisions","events","reminders","milestones","meetings","plans"],$o=[...bt,...Et],zo={Epic:"epics",Feature:"features",Task:"tasks",Chore:"chores",Issue:"issues",Decision:"decisions",Event:"events",Reminder:"reminders",Milestone:"milestones",Meeting:"meetings",Plan:"plans"},Ot={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}},At=["no active blocker","ready for planned execution sequencing","work completed","work is closed"],H={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 ke(e){return e?[...e]:void 0}var qo={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:[...At],lifecycle_closure_like_blocked_reason_patterns:[...H.blocked_reason],lifecycle_closure_like_resolution_patterns:[...H.resolution],lifecycle_closure_like_actual_result_patterns:[...H.actual_result],estimate_defaults_by_type:{}},governance:{preset:"minimal",...Ot.minimal},workflow:{definition_of_done:[]},testing:{record_results_to_items:!1,allow_untrusted_linked_tests:!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:yt.map(e=>({...e,aliases:ke(e.aliases),roles:ke(e.roles)})),fields:[],workflow:{...ht},unknown_field_policy:"allow"},extensions:{enabled:[],disabled:[],policy:Te()},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:""}}},Ko={metadata:{},body:""},g={SUCCESS:0,GENERIC_FAILURE:1,USAGE:2,NOT_FOUND:3,CONFLICT:4,DEPENDENCY_FAILED:5,NO_EFFECT:6,PARTIAL_EFFECT:7},Yo=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]="922e2e27-1499-5466-98e4-322d0d742e40")}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 P=[...[["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"}))],Qo=Object.fromEntries(P.filter(e=>e.registration==="bootstrap").map(e=>[e.alias,e.canonical]));function Ho(e){let t=e.trim().toLowerCase();return P.find(n=>n.alias===t)}function Zo(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]="3935bae8-0a40-59ea-aca6-64e238d1f318")}catch{}})();var St=[...Q],wt=[...we],Tt=[...Ee],or=[...Oe],rr=[...Ae],xt=[...Se],j=["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"],ir=["ancestors","descendants","predecessors","successors","paths","impact","analyze","audit","communities","redundancy","dominators","slack","centrality","articulation","plan","index"],sr=["install","reconcile","report","driver"],kt=["init","install","uninstall","explore","manage","describe","reload","doctor","catalog","adopt","adopt-all","activate","deactivate"],Rt=["reopen"],Re={help:"Commander help rendering has no SDK operation result.",packages:"The plural package alias only renders package-oriented help."},F=Object.freeze(j.flatMap(e=>e in Re?[]:e==="extension"||e==="package"?[...kt.map(t=>`${e}-${t}`),e]:e==="item"?Rt.map(t=>`item-${t}`):[e])),It=Object.freeze(P.filter(e=>e.lifecycle==="deprecated"&&e.registration==="commander"&&F.includes(e.alias)).map(e=>e.alias)),ar=Object.freeze(F.filter(e=>!It.includes(e)));function cr(e=j,t=F,n=Re){let o=new Set(t),r=new Set(e);return{missing_cli_actions:e.filter(i=>!o.has(i)&&!t.some(s=>s.startsWith(`${i}-`))&&n[i]===void 0),waived_cli_actions:e.filter(i=>!o.has(i)&&!t.some(s=>s.startsWith(`${i}-`))&&n[i]!==void 0),stale_waivers:Object.keys(n).filter(i=>!r.has(i)||o.has(i)||t.some(s=>s.startsWith(`${i}-`)))}}function ur(e){return F.includes(e)}function dr(e){return St.includes(e)}function lr(e){return wt.includes(e)}function _r(e){return Tt.includes(e)}function fr(e){return xt.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 Nt=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 T(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Ie(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(!T(n))return;n=n[o]}return n}function Z(e,t,n){let o=t.split("."),r=(i,s)=>{if(s===o.length)return n;let a=o[s];if(Array.isArray(i)){let c=Number(a),l=[...i];return l[c]=r(i[c],s+1),l}let d=i;return{...d,[a]:r(d[a],s+1)}};return r(e,0)}function Ne(e,t,n){let o=k(e).find(i=>i.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 T(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 Ct(e){let t=e.row_contract;return T(t)&&Array.isArray(t.continuation_row_keys)?t.continuation_row_keys.filter(n=>typeof n=="string"&&n.trim().length>0):V(e)}function x(e){return V(e).flatMap(t=>{let n=Ie(e,t);return Array.isArray(n)||T(n)?[{path:t,value:n}]:[]})}function k(e){return Ct(e).flatMap(t=>{let n=Ie(e,t);return Array.isArray(n)||T(n)?[{path:t,value:n}]:[]})}function B(e){let t=x(e),n=new Set(t.map(r=>r.path)),o=(r,i)=>{if(Array.isArray(r)){n.has(i)||t.push({path:i,value:r}),r.forEach((s,a)=>o(s,`${i}.${a}`));return}if(T(r))for(let[s,a]of Object.entries(r))i.length===0&&Nt.has(s)||o(a,i.length===0?s:`${i}.${s}`)};return o(e,""),t}function G(e){return x(e).reduce((t,n)=>t+(Array.isArray(n.value)?n.value.length:Object.keys(n.value).length),0)}function C(e,t){let n=e;for(let o of x(n)){let r=Array.isArray(o.value)?o.value.map((i,s)=>t(i,o.path,s)):Object.fromEntries(Object.entries(o.value).map(([i,s],a)=>[i,t(s,o.path,a)]));n=Z(n,o.path,r)}return n}function Ce(e,t){let n=e,o=!1;for(let r of x(n)){let i=Array.isArray(r.value)?r.value:Object.entries(r.value);if(i.length<=t)continue;o=!0;let s=Array.isArray(r.value)?i.slice(0,t):Object.fromEntries(i.slice(0,t));n=Z(n,r.path,s)}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 ee=256,te=1e4,vt=/^[A-Za-z0-9][A-Za-z0-9._:-]{0,63}$/u,Dt=/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/u,Mt=new Set(["version","id","token_budget","spent_tokens","seen_item_ids"]),Ut=[{valid:e=>e.version===1,reason:"version must equal 1."},{valid:e=>typeof e.id=="string"&&vt.test(e.id),reason:"id must be 1-64 portable identifier characters."},{valid:e=>Number.isSafeInteger(e.token_budget)&&e.token_budget>=ee,reason:`token_budget must be a safe integer of at least ${ee}.`},{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<=te&&e.seen_item_ids.every(t=>typeof t=="string"&&Dt.test(t)),reason:`seen_item_ids must contain at most ${te} portable item identifiers.`}];function z(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function $(e){throw new p(`--output-session ${e}`,g.USAGE,{code:"invalid_read_output_session",field:"outputSession"})}function q(e){if(e===void 0)return;let t=e;if(typeof e=="string")try{t=JSON.parse(e)}catch{$("must be a valid JSON object.")}z(t)||$("must be a JSON object.");let n=Object.keys(t).filter(i=>!Mt.has(i));n.length>0&&$(`contains unknown field "${n.sort()[0]}".`);let o=Ut.find(i=>!i.valid(t));o!==void 0&&$(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 ve(e){if(z(e))return typeof e.id=="string"?e.id:typeof e.item_id=="string"?e.item_id:z(e.item)&&typeof e.item.id=="string"?e.item.id:void 0}function Lt(e){let t=new Set,n=0;for(let o of x(e)){let r=Array.isArray(o.value)?o.value:Object.values(o.value);for(let i of r){if(!z(i))continue;if(typeof i.context_ref=="string"){n+=1;continue}let s=ve(i);s!==void 0&&t.add(s)}}return{deliveredIds:t,suppressedRepeatCount:n}}function De(e,t){let n=new Set(t.seen_item_ids);return C(e,o=>{let r=ve(o);return r!==void 0&&n.has(r)?{id:r,context_ref:`session:${t.id}:${r}`}:o})}function ne(e,t){let{deliveredIds:n,suppressedRepeatCount:o}=Lt(e),r=new Set(t.seen_item_ids),i=[...n].filter(y=>!r.has(y)).sort(),s=i.slice(0,te-t.seen_item_ids.length),a=[...t.seen_item_ids,...s].sort(),d=i.length-s.length,c={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:a}},l={...e,read_session:c},u=y=>{c.spent_this_call_tokens=y,c.charged_this_call_tokens=Math.min(t.token_budget-t.spent_tokens,y),c.spent_total_tokens=Math.min(t.token_budget,t.spent_tokens+c.charged_this_call_tokens),c.remaining_tokens=Math.max(0,t.token_budget-c.spent_total_tokens),c.exhausted=c.remaining_tokens<ee,c.next_state.spent_tokens=c.spent_total_tokens},_=0,f=0;for(let y=0;y<8;y+=1){u(_);let b=Math.ceil(Buffer.byteLength(JSON.stringify(l),"utf8")/4);if(b===_)return l;f=Math.max(f,b),_=b}return u(f),l}function Me(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]="02a0bd0c-6ab0-5193-807b-00394a4712b7")}catch{}})();var Pt=8,jt=64,Ft=5,Vt=4,Ue=100;function re(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 o=Math.max(t+1,n),r=Math.ceil(o*Ft/Vt),i=Math.ceil(r/Ue)*Ue;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 ie(e){return Math.ceil(Buffer.byteLength(JSON.stringify(e),"utf8")/4)}function Bt(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function oe(e,t){return typeof e=="string"?e.length<=240?e:(t.compacted=!0,`${e.slice(0,240)}\u2026`):Array.isArray(e)?e.map(n=>oe(n,t)):Bt(e)?Object.fromEntries(Object.entries(e).map(([n,o])=>[n,oe(o,t)])):e}function A(e,t){let n=t.estimated_tokens;for(let o=0;o<Pt;o+=1){t.estimated_tokens=n;let r=ie(e);if(r===n)return;n=r}t.estimated_tokens=n}function Gt(e,t,n,o){for(let r=0;r<jt;r+=1){if(A(e,t),t.estimated_tokens<=n)return;let i=B(e).filter(a=>(Array.isArray(a.value)?a.value.length:Object.keys(a.value).length)>Math.max(1,o.get(a.path)??0)).map(a=>({collection:a,length:Array.isArray(a.value)?a.value.length:Object.keys(a.value).length})).sort((a,d)=>d.length-a.length||a.collection.path.localeCompare(d.collection.path))[0]?.collection;if(!i)return;let s=Math.max(1,o.get(i.path)??0);if(Array.isArray(i.value))i.value.splice(-Math.min(i.value.length-s,Math.max(1,Math.ceil(i.value.length/2))));else{let a=Object.keys(i.value);for(let d of a.slice(-Math.min(a.length-s,Math.max(1,Math.ceil(a.length/2)))))delete i.value[d]}t.rows_compacted=!0,t.compacted_row_paths=[...new Set([...t.compacted_row_paths??[],i.path])].sort((a,d)=>a.localeCompare(d)),e.has_more=!0,e.truncated=!0,typeof e.count=="number"&&(e.count=G(e))}}function Le(e,t,n,o=new Map){let r={compacted:!1},i=oe(e,r);return t.strings_compacted=r.compacted,i.read_output=t,Gt(i,t,n,o),A(i,t),i}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="1d338971-5a60-5b4e-b4c8-0705c8e8c98c")}catch{}})();var $t=["full","compact","brief","summary","counts"],Sr=["mutation","read","discovery","governance"],Pe=["error","warning","validation_summary","recovery_bundle"],zt=["full","omit_explanation","limit_collections","compact_recovery","action_only"],qt=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"]),Kt=new Set(["contracts","extension","help","install","package","packages","profile","upgrade"]),Yt=new Set(["gc","health","merge","stats","telemetry","test","test-all","validate"]),Xt={mutation:2e3,read:4e3,discovery:3e3,governance:6e3},Wt=3,Jt=2,Qt=192,Ht={error:{text:768,json:2e3},warning:{text:768,json:2e3},validation_summary:{text:1500,json:3e3},recovery_bundle:{text:768,json:2e3}},Zt=Pe.map(e=>({diagnostic_class:e,default_max_estimated_tokens_by_format:Ht[e],minimum_max_estimated_tokens:Qt,degradation_ladder:zt,corrective_action_paths:["required","recovery.suggested_retry","recovery.suggested_retry_args","recovery.next_best_command","next_steps[0]"],token_estimate:"ceil(utf8_bytes / 4)"})),en=new Map(Zt.map(e=>[e.diagnostic_class,e]));function tn(e){let[t=""]=e.trim().split(/\s+/u);return qt.has(t)?"mutation":Kt.has(t)?"discovery":Yt.has(t)?"governance":"read"}function je(e,t=tn(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=Xt[t];return nn({command:n,budget_class:t,default_max_estimated_tokens:o,default_max_estimated_tokens_by_format:{toon:o,json:Math.ceil(o*Wt/Jt)},degradation_ladder:$t,allows_unbounded_opt_out:!0,token_estimate:"ceil(utf8_bytes / 4)"})}function nn(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 on=j.map(e=>je(e)),rn=new Map(on.map(e=>[e.command,e]));function Fe(e,t={}){let n=e.trim().replace(/\s+/gu," "),[o]=n.split(" "),r=rn.get(o);return r?{...r,command:n}:t.generateFallback?je(n):null}function se(e){return Math.ceil(Math.max(0,e)/4)}function Ve(e){let t=en.get(e);if(t===void 0)throw new TypeError(`diagnosticClass must be one of: ${Pe.join(", ")}`);return t}function O(e){return se(Buffer.byteLength(JSON.stringify(e,null,2),"utf8"))}function sn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ae(e){if(!sn(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"]){let o=e[n];Array.isArray(o)?t[n]=n==="suggested_retry_args"?o:o.slice(0,3):o!==void 0&&(t[n]=o)}return Object.keys(t).length>0?t:void 0}function an(e,t){return typeof e!="string"||e.length<=t?e:`${e.slice(0,Math.max(1,t-3))}...`}function R(e,t){if(Buffer.byteLength(e,"utf8")<=t)return e;let n="...",o=Array.from(e),r=0,i=o.length;for(;r<i;){let s=Math.ceil((r+i)/2),a=`${o.slice(0,s).join("")}${n}`;Buffer.byteLength(a,"utf8")<=t?r=s:i=s-1}return`${o.slice(0,r).join("")}${n}`}function Be(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,o]of Object.entries(e))n!=="__proto__"&&!Object.hasOwn(t,n)&&(t[n]=o);return t}var cn=new Set(["limit_collections","compact_recovery","action_only"]),un=new Set(["compact_recovery","action_only"]);function dn(e){let t={code:typeof e.code=="string"?e.code:"diagnostic",required:an(e.required,160)??"Inspect the diagnostic code and retry with corrected input."},n=ae(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 ln(e,t){let n=structuredClone(e);if(t!=="full"&&(delete n.why,delete n.examples),cn.has(t))for(let[o,r]of Object.entries(n))Array.isArray(r)&&(n[o]=r.slice(0,3));if(un.has(t)){let o=ae(n.recovery);o?n.recovery=o:delete n.recovery}return t!=="action_only"?Be(n):dn(n)}function I(e,t){let n={...e,diagnostic_output:{...t,estimated_tokens:0}};for(let o=0;o<4;o+=1){let r=O(n),i=n.diagnostic_output;if(i.estimated_tokens===r)break;i.estimated_tokens=r}return n}function _n(e,t,n){let o=I(e,t);for(let i of["recovery","exit_code"])O(o)<=n||e[i]===void 0||(delete e[i],o=I(e,t));let r=40;for(;O(o)>n&&r>4;)r-=4,e.code=R(String(e.code),r),e.required=R(String(e.required),r),o=I(e,t);return o}function fn(e,t){let n=e.diagnostic_output,{estimated_tokens:o,...r}=n,i=r.omitted_fields.slice(0,8).map(u=>R(u,32)),s={...r,omitted_fields:i,...r.omitted_fields.length>i.length?{omitted_fields_overflow_count:r.omitted_fields.length-i.length}:{}},a=ae(e.recovery),d=a&&O(a)<=48?a:void 0,c={code:R(String(e.code),320),required:R(String(e.required),320),...d?{recovery:d}:{},...e.exit_code!==void 0?{exit_code:e.exit_code}:{}},l=I(c,s);for(;O(l)>t&&s.omitted_fields.length>0;)s.omitted_fields.pop(),s.omitted_fields_overflow_count=r.omitted_fields.length-s.omitted_fields.length,l=I(c,s);return l=_n(c,s,t),l}function wr(e,t={}){let n=e,o=t.diagnosticClass??"error",r=Ve(o),i=t.maxEstimatedTokens;if(i!==void 0&&(!Number.isSafeInteger(i)||i<r.minimum_max_estimated_tokens))throw new RangeError(`maxEstimatedTokens must be a safe integer >= ${r.minimum_max_estimated_tokens}`);let s=i??r.default_max_estimated_tokens_by_format.json,a=O(n),d=Object.keys(n);if(a<=s)return Be(structuredClone(n));let c;for(let[l,u]of r.degradation_ladder.entries()){let _=ln(n,u),f=d.filter(b=>!Object.hasOwn(_,b)),y=I(_,{diagnostic_class:o,format:"json",budget:s,budget_source:i===void 0?"default":"explicit",original_estimated_tokens:a,truncated:l>0,degradation_steps:r.degradation_ladder.slice(0,l+1),omitted_fields:f});if(c=y,O(y)<=s)break}return O(c)>s&&(c=fn(c,s)),c}function Tr(e,t,n={}){let o=n.diagnosticClass??"error",r=Ve(o),i=n.maxEstimatedTokens;if(i!==void 0&&(!Number.isSafeInteger(i)||i<r.minimum_max_estimated_tokens))throw new RangeError(`maxEstimatedTokens must be a safe integer >= ${r.minimum_max_estimated_tokens}`);let s=i??r.default_max_estimated_tokens_by_format.text,a=se(Buffer.byteLength(e,"utf8")),d=a>s,c=`What is required:
|
|
2
|
+
`,l=`
|
|
3
|
+
|
|
4
|
+
Diagnostic output exceeded its declared ${s}-token ceiling; rerun with structured JSON for the bounded recovery envelope.`,u=t.trim()||"Inspect the diagnostic code and retry with corrected input.",_=Math.max(1,s*4-Buffer.byteLength(`${c}${l}`,"utf8")),f=d?`${c}${R(u,_)}${l}`:e;return{output:f,diagnostic_output:{diagnostic_class:o,format:"text",budget:s,budget_source:i===void 0?"default":"explicit",original_estimated_tokens:a,estimated_tokens:se(Buffer.byteLength(f,"utf8")),truncated:d,degradation_steps:d?[...r.degradation_ladder]:["full"],omitted_fields:d?["explanation","collections"]:[]}}}import{createHash as oo}from"node:crypto";import pn 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 mn(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 gn(e){let t=Object.keys(e).sort(),n={};for(let o of t){let r=e[o];r!==void 0&&(n[o]=K(r))}return n}function K(e){let t=mn(e);if(t!==void 0)return t;if(Array.isArray(e))return e.map(o=>K(o));if(e instanceof Date)return e.toISOString();let n=e;if(typeof n.toJSON=="function"){let o=n.toJSON();if(o!==e)return K(o)}return gn(e)}function Y(e){return JSON.stringify(K(e))}function Ge(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 yn(e,t){if(e instanceof RegExp||t instanceof RegExp)return e instanceof RegExp&&t instanceof RegExp&&e.toString()===t.toString()}function hn(e,t){if(e instanceof Date||t instanceof Date)return e instanceof Date&&t instanceof Date&&e.getTime()===t.getTime()}function bn(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(!Ge(r,n,o,v))return!1;return!0}function En(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,i]of e.entries())if(!Ge([r,i],n,o,([a,d],[c,l])=>v(a,c)&&v(d,l)))return!1;return!0}function On(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)=>v(n,t[o]))}function An(e,t){let n=Object.keys(e).sort((r,i)=>r.localeCompare(i)),o=Object.keys(t).sort((r,i)=>r.localeCompare(i));if(n.length!==o.length)return!1;for(let r=0;r<n.length;r+=1){let i=n[r];if(i!==o[r]||!v(e[i],t[i]))return!1}return!0}var Sn=[yn,hn,bn,En,On];function v(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 Sn){let o=n(e,t);if(o!==void 0)return o}return An(e,t)}function Rr(e){return pn.createHash("sha256").update(e,"utf8").digest("hex")}function Ir(e,t){let n={};for(let r of t){let i=e[r];i!==void 0&&(n[r]=i)}let o=Object.keys(e).filter(r=>!t.includes(r)).sort((r,i)=>r.localeCompare(i));for(let r of o){let i=e[r];i!==void 0&&(n[r]=i)}return n}import{createHash as wn}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 ce=1,ze=4096,Tn=/^[A-Za-z0-9_-]+$/;function $e(e){return e.replace(/^--/u,"").replace(/[-_]([a-z0-9])/gu,(t,n)=>n.toUpperCase())}function Ur(e,t){let n=new Set;for(let o of t)if(o.cursor_semantics==="presentation"){n.add($e(o.flag));for(let r of o.aliases??[])n.add($e(r))}return Object.fromEntries(Object.entries(e).filter(([o])=>!n.has(o)))}function Lr(e,t){return wn("sha256").update(e).update("\0").update(Y(t)).digest("hex").slice(0,24)}function ue(e,t,n,o){return Buffer.from(JSON.stringify({version:ce,fingerprint:e,after_id:t,...n===void 0?{}:{after_index:n},...o===void 0?{}:{snapshot:o}})).toString("base64url")}function S(e){return new p(e,g.USAGE,{code:"invalid_query_cursor",nextSteps:["Repeat the original query without --after to obtain a fresh cursor."]})}function xn(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;let t=e;return t.version===ce&&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 de(e){if(typeof e!="string")throw S("Query cursor is malformed.");let t=e.trim();if(t.length===0||t.length>ze||!Tn.test(t))throw S("Query cursor is malformed.");let n;try{n=JSON.parse(Buffer.from(t,"base64url").toString("utf8"))}catch{throw S("Query cursor is malformed.")}if(!xn(n))throw S("Query cursor version or payload is unsupported.");return n}function le(e,t){let n=de(e);if(n.fingerprint!==t)throw S(`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 Pr(e,t){return le(e,t).after_id}function kn(e,t,n,o){if(t===void 0)return 0;let r=le(t,n),i=e.findIndex(s=>o(s)===r.after_id);if(i<0){if(r.after_index!==void 0)return Math.min(r.after_index,e.length);throw S(`Query cursor item ${r.after_id} is no longer present in this result set.`)}return i+1}function jr(e,t){if(t.cursor!==void 0&&le(t.cursor,t.fingerprint).snapshot!==t.snapshot)throw S("Query cursor does not match the requested snapshot.");let n=kn(e,t.cursor,t.fingerprint,t.readId),o=e.slice(n,n+t.limit),r=o.length>0&&n+o.length<e.length,i=o.at(-1);return{rows:o,has_more:r,...r&&i!==void 0?{next_cursor:ue(t.fingerprint,t.readId(i),n+o.length-1,t.snapshot)}:{}}}var Fr=Object.freeze({version:ce,max_length:ze});(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]="d084da05-c967-58f1-afe4-069f09838e6f")}catch{}})();var w=["include","amount","cost","encoding"],Ze=["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"],et=["canonical","legacy","intent","default"],D={include:"--output-include",amount:"--output-limit",cost:"--output-budget",encoding:"--output-format"},_e=Symbol.for("pm.readOutputInvocationProvenance"),Wr=Object.freeze(w.map(e=>D[e])),Jr=Object.freeze(["--output-session","--output-cursor","--output-row-contract"]),tt={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:{}},nt=new Set(["--collapse","--fields","--section"]),me=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 ge(e){return e.slice(2).replaceAll("-","_")}function Rn(e,t){let n=me[e];if(n!==void 0)return n;let o=t==="include"?nt.has(e)?"<csv>":ge(e):t==="amount"?"<n>":t==="cost"?"<tokens>":"<toon|json>";return`${e} is a compatibility alias; prefer ${D[t]} ${o}.`}function In(e){let t=tt[e],n=Object.freeze(Object.fromEntries(w.map(o=>[o,Object.freeze({dimension:o,canonical_option:D[o],applicable:!0,inapplicable_reason:null,legacy_aliases:Object.freeze((t[o]??[]).map(r=>Object.freeze({flag:r,semantics:me[r]===void 0?"replacement":"behavior_preserving",migration_hint:Rn(r,o),visibility:"hidden_alias"})))})])));return Object.freeze({command:e,dimensions:n,precedence:et,budget_retention_policy:e==="assurance"?"verdict_priority":"ordered_prefix",projection_modes:Object.freeze([...ye(e).keys()])})}var Nn=Object.freeze(Ze.map(In)),Cn=new Map(Nn.map(e=>[e.command,e]));function M(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],i=r.startsWith("list-")?"list":r==="ctx"?"context":r;return Ze.includes(i)?i:void 0}var vn=["outputInclude","output_include","outputLimit","output_limit","outputBudget","output_budget","outputFormat","output_format","outputSession","output_session","outputCursor","output_cursor","outputRowContract","output_row_contract"],Dn={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 Mn(e){return vn.some(t=>e[t]!==void 0)}var Un=[{keys:["outputInclude","output_include"],valid:e=>X(e)!==void 0,message:"--output-include requires at least one comma-separated field or section."},{keys:["outputLimit","output_limit"],valid:e=>e==="unbounded"||N(e)!==void 0,message:"--output-limit must be a positive integer or unbounded."},{keys:["outputBudget","output_budget"],valid:e=>e==="unbounded"||N(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=>(q(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 Qr(e,t){if(!Mn(t))return;let n=M(e,t);if(!n)throw new p(`Universal output controls apply only to read commands; ${e||"this command"} is not a read surface.`,g.USAGE);if((Dn[n]??[]).some(o=>t[o]!==void 0&&t[o]!==!1))throw new p(`Universal output controls cannot be combined with a ${n} mutation.`,g.USAGE);for(let o of Un){let r=o.keys.map(i=>t[i]).find(i=>i!==void 0);if(r!==void 0&&!o.valid(r))throw new p(o.message,g.USAGE)}}function ye(e){let t=M(e);return t?new Map((tt[t].include??[]).filter(n=>!nt.has(n)&&me[n]===void 0).map(n=>[ge(n),ot(n)])):new Map}function Ln(e,t,n){let o=X(t)??[],r=ye(e),i=[],s=[],a=n,d=a[_e],c=new Set(d?.canonical_include_modes??[]),l=new Set(d?.explicit_legacy_aliases??[]);for(let u of o){let _=r.get(u);if(_===void 0){i.push(u);continue}let f=`--${u.replaceAll("_","-")}`;it(rt(n,f))&&l.add(f),n[_]=!0,s.push(u),c.add(u)}return s.length>0&&(a[_e]={canonical_include_modes:[...c],explicit_legacy_aliases:[...l],...d?.cli_invocation_observed===!0?{cli_invocation_observed:!0}:{}}),{selectors:i,modes:s}}function Hr(e,t){let n=t.outputInclude??t.output_include;if(n===void 0)return;let{selectors:o,modes:r}=Ln(e,n,t);if(r.length===0)return;let i=o.length>0?o.join(","):void 0;t.outputInclude=i,Object.hasOwn(t,"output_include")&&(t.output_include=i)}function ot(e){return e.slice(2).replace(/-([a-z])/gu,(t,n)=>n.toUpperCase())}function rt(e,t){let n=ot(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 it(e){return e!==void 0&&e!==!1&&e!==null}function X(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 N(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 Pn(e,t,n,o){for(let r of e.legacy_aliases){if(o(r.flag))continue;let i=rt(t,r.flag),s={value:i,flag:r.flag};if(it(i)&&n(s))return s}}function qe(e,t){let n=X(e);if(n)return{source:"canonical",value:n};if(t)return{source:"legacy",value:X(t.value)??[ge(t.flag)]}}function Ke(e,t){if(e==="unbounded")return{source:"canonical",value:"unbounded"};let n=N(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=N(t.value);return o===void 0?void 0:{source:"legacy",value:o}}function Ye(e,t){if(e==="unbounded")return{source:"canonical",value:"unbounded"};let n=N(e);if(n!==void 0)return{source:"canonical",value:n};if(!t)return;let o=N(t.value);return o===void 0?void 0:{source:"legacy",value:o}}function Xe(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 jn(e,t,n){if(!e)return!1;let o=new Set(e.explicit_legacy_aliases);if(e.cli_invocation_observed===!0)return!o.has(n);let r=new Set(e.canonical_include_modes.map(i=>`--${i.replaceAll("_","-")}`));return t==="include"&&r.has(n)&&!o.has(n)}function Fn(e,t,n){return e.trim().toLowerCase().replaceAll(/\s+/gu," ").split(" ")[0]==="list-all"||t.amount?.flag==="--no-truncate"||t.include?.flag==="--full"||n?.canonical_include_modes.includes("full")===!0}function Vn(e,t){return w.flatMap(n=>e[n]?.source==="canonical"||n==="include"&&(t?.canonical_include_modes.length??0)>0?[D[n]]:[])}function st(e,t){let n=M(e,t);if(!n)return;let o=Cn.get(n),r=t[_e],i={include:m=>qe(void 0,m),amount:m=>Ke(void 0,m),cost:m=>Ye(void 0,m),encoding:m=>Xe(void 0,m)},s=Object.fromEntries(w.map(m=>[m,Pn(o.dimensions[m],t,E=>i[m](E)!==void 0,E=>jn(r,m,E))])),a=w.flatMap(m=>{let E=s[m];return E?[E.flag]:[]}),d=w.flatMap(m=>{let E=s[m];return E?[o.dimensions[m].legacy_aliases.find(dt=>dt.flag===E.flag).migration_hint]:[]}),c=Xe(t.outputFormat??t.output_format,s.encoding),l=qe(t.outputInclude??t.output_include,s.include),u=Ke(t.outputLimit??t.output_limit,s.amount),_=Ye(t.outputBudget??t.output_budget,s.cost),f=Fn(e,s,r),y=Fe(e,{generateFallback:!0}),b=c?.value==="json"||t.resolvedOutputFormat==="json"?"json":"toon",be=_??(f?{source:"intent",value:"unbounded"}:{source:"default",value:y.default_max_estimated_tokens_by_format[b]});return{command:n,include:l,amount:u,cost:be,encoding:c,canonical_options_used:Vn({include:l,amount:u,cost:be,encoding:c},r),legacy_aliases_used:a,migration_hints:d,precedence:et}}function h(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var he=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"]),Bn=["collection_counts","notes_count","tests_count"];function at(e,t){let n=new Set(t.map(o=>o.split(".")[0]));return Object.fromEntries(Object.entries(e).filter(([o])=>n.has(o)))}function Gn(e){let t=h(e.item)?e.item:{},n=[...new Set([...Object.keys(t),...Bn.filter(r=>Object.hasOwn(t,r))])].sort((r,i)=>r.localeCompare(i)),o=Object.keys(e).filter(r=>r!=="item"&&r!=="read_output"&&!he.has(r)).sort((r,i)=>r.localeCompare(i));return{item:t,itemFields:n,sections:o,valid:[...n,"item",...n.map(r=>`item.${r}`),...o]}}function $n(e,t){let n=Gn(e),o=t.filter(u=>!n.valid.includes(u));if(o.length>0)throw new p(`Unknown --output-include selector(s) for get: ${o.join(", ")}. Valid selectors: ${n.valid.join(", ")}.`,g.USAGE);let r=t.includes("item"),i=t.flatMap(u=>u.startsWith("item.")?[u.slice(5)]:n.itemFields.includes(u)?[u]:[]).filter((u,_,f)=>f.indexOf(u)===_);if(r&&i.length>0)throw new p("--output-include cannot mix a full item with projected item fields; use item or item.<field>, not both.",g.USAGE);let s=new Set(t.filter(u=>n.sections.includes(u))),a=Object.fromEntries(Object.entries(e).filter(([u])=>he.has(u)||s.has(u)));r?a.item=n.item:i.length>0&&(a.item=at(n.item,i));let d=[...r?[]:i.length>0?n.itemFields.filter(u=>!i.includes(u)).map(u=>({name:`item.${u}`,restore_with:`--output-include item.${u}`})):[{name:"item",restore_with:"--output-include item"}],...n.sections.filter(u=>!s.has(u)).map(u=>({name:u,restore_with:`--output-include ${u}`}))],l=[...h(a.omission_receipt)&&Array.isArray(a.omission_receipt.omitted_field_groups)?a.omission_receipt.omitted_field_groups:[],...d];return a.omission_receipt={has_omissions:l.length>0,omitted_field_group_count:l.length,omitted_field_groups:l},a}function We(e){let t=0;return C({...e},n=>(h(n)&&Object.keys(n).length>0&&(t+=1),n)),t}function zn(e,t,n,o){if(We(t)===0||We(n)>0)return;let r=[...ye(e).keys()],i=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.${i}`,g.USAGE)}function qn(e,t,n){if(e==="get")return $n(t,n);let o=V(t),r=n.flatMap(s=>o.flatMap(a=>s.startsWith(`${a}.`)?[s.slice(a.length+1)]:[])),i=n.some(s=>Object.hasOwn(t,s.split(".")[0])&&!o.some(a=>s.startsWith(`${a}.`)));if(o.length>0&&(!i||r.length>0)){let s={...t},a=r.length>0?r:n,d=C(s,c=>h(c)?at(c,a):c);return zn(e,t,d,a),d}return Object.fromEntries(Object.entries(t).filter(([s])=>n.some(a=>a.split(".")[0]===s)||he.has(s)))}function Kn(e,t){if(t==="unbounded")return e;let{result:n,truncated:o}=Ce(e,t);return o&&(n.has_more=!0,n.truncated=!0,typeof n.count=="number"&&(n.count=G(n)),n.applied_bound={kind:"output_limit",source:"explicit",value:t}),n}function Yn(e){return w.filter(t=>e[t]!==void 0&&e[t]?.source!=="default"||e.canonical_options_used.includes(D[t]))}function J(e,t,n){let o=ne(e,t);for(let r=0;r<8;r+=1){let i=n.estimated_tokens,s=o.read_session.spent_this_call_tokens;A(o,n),o=ne(o,t);let a=o.read_session.spent_this_call_tokens;if(n.estimated_tokens===i&&a===s)return o}return o}function Zr(e,t){if(!h(e.read_output))return e;let n=e.read_output,o=q(t.outputSession??t.output_session);return o===void 0?(A(e,n),e):J(e,o,n)}function Xn(e,t){if(e!=="validate")return t;let n=h(t.projection)?t.projection:void 0;if(!(Array.isArray(n?.declared_field_groups)?n.declared_field_groups:[]).some(u=>h(u)&&u.name==="diagnostic_rows"))return t;let r=[...new Set(B(t).map(({path:u})=>u).filter(u=>/^checks\.\d+\.details\./u.test(u)))],i=r.filter(u=>!r.some(_=>_!==u&&u.startsWith(`${_}.`)));if(i.length===0)return t;let s=h(t.row_contract)?t.row_contract:{},a=Array.isArray(s.row_keys)?s.row_keys.filter(u=>typeof u=="string"):[],d=Array.isArray(s.continuation_row_keys)?s.continuation_row_keys.filter(u=>typeof u=="string"):[],c=a.length>0?a:i,l=[...new Set(i)];return JSON.stringify(c)===JSON.stringify(a)&&JSON.stringify(l)===JSON.stringify(d)?t:{...t,row_contract:{...s,row_keys:c,continuation_row_keys:l,jq_selector:typeof s.jq_selector=="string"?s.jq_selector:".checks[].details"}}}function Wn(e,t,n,o){let r={...e};return t.include?.source==="canonical"&&(r=qn(t.command,r,t.include.value)),t.command==="assurance"&&(r=Qe(r)),r=He(r,t.command,o),t.amount?.source==="canonical"&&(r=Kn(r,t.amount.value)),n===void 0?r:De(r,n)}function Jn(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:Me(t)}]].sort((o,r)=>o.tokens-r.tokens)[0]}function ct(e){let t=e.canonical_options_used;return t&&t.length>0?{canonical_options_used:t}:{}}function Qn(e,t,n,o,r){let i={contract_version:1,command:e.command,requested_dimensions:t,...o.source==="default"?{budget_source:o.source,budget_tokens:o.tokens}:{},precedence:e.precedence,...ct(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:r}:{}},s={output_budget_exceeded:{omitted_result:!0,reason:"requested_budget_infeasible",restore_with:"Unbounded",recovery:{outputBudget:"unbounded"}},read_output:i},a=n===void 0?s:J(s,n,i);if(n===void 0&&A(a,i),n!==void 0&&i.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.",g.USAGE);return a}function Hn(e,t,n){if(t!==void 0)return!1;let o=e.canonical_options_used.length;return e.cost?.value==="unbounded"?o===(e.cost.source==="canonical"?1:0):e.cost?.source==="legacy"&&o===0?!0:o===0&&(e.cost===void 0||ie(n)<=e.cost.value)}function Zn(e,t,n,o,r,i,s){if(!n.rows_compacted)return;let a=t.amount?.value==="unbounded"?["amount"]:[],d=new Map(k(e).map(_=>[_.path,Array.isArray(_.value)?_.value.length:Object.keys(_.value).length])),c=[...s.entries()].flatMap(([_,f])=>{let y=d.get(_);if(y>=f.rows)return[];let b=f.baseOffset+y;return[{path:_,cursor:fe({command:t.command,path:_,offset:b,total_rows:f.totalRows,fingerprint:f.fingerprint}),retained_rows:y,remaining_rows:f.totalRows-b,total_rows:f.totalRows}]}),l=c[0],u=re({effective_budget_tokens:o.tokens,measured_result_tokens:i});l&&typeof e.next_cursor!="string"&&(e.next_cursor=l.cursor),e.continuation_kind=r?"producer_cursor":l?"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:c.length>0,recovery_budget_multiplier:l?1:u.recovery_budget_multiplier,continuations:c,restore_with:l?"Use recovery binding.":`Retry with --output-budget ${u.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 ${u.output_budget}`,sdk:{outputBudget:u.output_budget},mcp:{outputBudget:u.output_budget}}}}function eo(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 i;try{i=de(n)}catch{return!1}let s=i.after_index;if(s===void 0)return!1;let a=e.items.at(-1);if(Object.prototype.toString.call(a)!=="[object Object]")return!1;let d=Reflect.get(a,"id");if(typeof d!="string"||d.length===0)return!1;let c=o?s-(t-r):s+r;return c<0?!1:(e.next_cursor=ue(i.fingerprint,d,c,i.snapshot),typeof e.applied_limit=="number"&&(e.applied_limit=r),!0)}function to(e,t,n,o){let r=new Map(k(e).map(s=>{let a=Array.isArray(s.value)?s.value.length:Object.keys(s.value).length,d=n?.path===s.path;return[s.path,{rows:a,totalRows:d?n.total_rows:a,baseOffset:d?n.offset:0,fingerprint:d?n.fingerprint:W(s.path,s.value,t)}]})),i=typeof e.next_cursor=="string";return{collectionsBeforeBudget:r,originalItemCount:Array.isArray(e.items)?e.items.length:0,cursorContinuesExistingPage:i,cursorSource:i?e.next_cursor:o.after}}function no(e,t,n,o,r,i,s){let a=t.command==="assurance"&&Array.isArray(e.assertions)?e.assertions.filter(l=>h(l)&&l.verdict!=="pass").length:0,d=Le(e,n,o.tokens,a>0?new Map([["assertions",a]]):new Map),c=eo(d,i.originalItemCount,i.cursorSource,i.cursorContinuesExistingPage);return Zn(d,t,n,o,c,s,i.collectionsBeforeBudget),r!==void 0&&(d=J(d,r,n)),d}function ei(e,t,n){let o=st(e,t);if(!o)return n;let r=q(t.outputSession??t.output_session),i=t.outputCursor??t.output_cursor,s=typeof i=="string"?pe(i):void 0,a=Yn(o);if(s===void 0&&Hn(o,r,n))return n;let d=Xn(o.command,n),c=Jn(o,r),l=Wn(d,o,r,s),u=to(l,o.command,s,t),_={contract_version:1,command:o.command,requested_dimensions:a,...c?.source==="default"?{budget_source:c.source,budget_tokens:c.tokens}:{},precedence:o.precedence,...ct(o),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};if(l.read_output=_,l=r===void 0?l:J(l,r,_),A(l,_),c!==void 0&&_.estimated_tokens>c.tokens){let f=_.estimated_tokens;l=no(l,o,_,c,r,u,f)}return c!==void 0&&_.estimated_tokens>c.tokens?Qn(o,a,r,c,_.estimated_tokens):l}function ti(e){return h(e)&&h(e.output_budget_exceeded)&&e.output_budget_exceeded.omitted_result===!0&&e.output_budget_exceeded.reason==="requested_budget_infeasible"}function ni(e,t){let n=st(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]="9e63b4b0-09a5-50bf-9f56-5f239c75ffe5")}catch{}})();var ro=4096,io=Object.freeze(["queue_draining","queue_entries","queue_exists","queue_high_retry_entries","queue_invalid_rows","queue_max_attempts","queue_rows_total","queue_size_bytes","pending_otel_spans","last_attempted_flush_at","last_failed_flush_at","last_otel_attempt_at","last_otel_failure_at","last_otel_success_at","last_successful_flush_at"]),Je=Object.freeze({health:Object.freeze({version:3,paths:Object.freeze(["checks"]),ignored_detail_field_names_by_row:Object.freeze({telemetry:io}),guarantee:"nonvolatile_snapshot_and_stable_configuration"})});function L(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function U(e){return Array.isArray(e)?e.map(U):L(e)?Object.fromEntries(Object.entries(e).map(([t,n])=>[t,U(n)])):e}function ut(e,t){if(!L(e))return U(e);let n=typeof e.name=="string"?e.name:void 0,o=n!==void 0&&Object.hasOwn(t.ignored_detail_field_names_by_row,n)?t.ignored_detail_field_names_by_row[n]:void 0;return Object.fromEntries(Object.entries(e).map(([r,i])=>r!=="details"||!o||!L(i)?[r,U(i)]:[r,Object.fromEntries(Object.entries(i).filter(([s])=>!o.includes(s)).map(([s,a])=>[s,U(a)]))]))}function so(e,t){return Array.isArray(e)?e.map(n=>ut(n,t)):ut(e,t)}function W(e,t,n){let o=n?Je[n]:void 0,r=o?.paths.includes(e)===!0;return oo("sha256").update(Y({path:e,value:r?so(t,o):t,...r?{fingerprint_policy_version:o.version}:{}})).digest("base64url").slice(0,16)}function fe(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 pe(e){if(e.length>ro)throw new p("The read-output continuation cursor is malformed or unsupported.",g.USAGE,{code:"read_output_cursor_invalid"});let t;try{t=JSON.parse(Buffer.from(e,"base64url").toString("utf8"))}catch{t=null}if(!L(t)||t.v!==1||M(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.",g.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 Qe(e){if(!Array.isArray(e.assertions))return e;let t=n=>!L(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 He(e,t,n){if(!n)return e;if(n.command!==t)throw new p(`The read-output cursor belongs to ${n.command}, not ${t}.`,g.USAGE,{code:"read_output_cursor_command_mismatch"});let o=k(e).find(i=>i.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||W(n.path,o.value,t)!==n.fingerprint)throw new p("The read-output continuation no longer matches the declared row collection; restart the bounded read.",g.USAGE,{code:"read_output_cursor_stale"});return Ne(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 ao=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"}]),mi=new Set(ao.flatMap(e=>[e.flag,...e.aliases??[]]));export{Q as a,lt as b,_t as c,lo as d,Ee as e,Oe as f,Ae as g,_o as h,Se as i,we as j,Te as k,ft as l,po as m,mo as n,go as o,yo as p,ho as q,bo as r,Eo as s,Oo as t,Ao as u,So as v,wo as w,To as x,xo as y,ko as z,Ro as A,Io as B,No as C,pt as D,Co as E,vo as F,Do as G,Mo as H,Uo as I,Lo as J,Po as K,gt as L,yt as M,ht as N,Bo as O,Go as P,bt as Q,$o as R,zo as S,Ot as T,At as U,H as V,qo as W,Ko as X,g as Y,p as Z,ao as _,mi as $,Y as aa,v as ba,Rr as ca,Ir as da,P as ea,Qo as fa,Ho as ga,Zo as ha,St as ia,wt as ja,Tt as ka,or as la,rr as ma,xt as na,j as oa,ir as pa,sr as qa,kt as ra,Rt as sa,Re as ta,F as ua,It as va,ar as wa,cr as xa,ur as ya,dr as za,lr as Aa,_r as Ba,fr as Ca,te as Da,q as Ea,De as Fa,ne as Ga,Me as Ha,re as Ia,$t as Ja,Sr as Ka,Pe as La,zt as Ma,Zt as Na,tn as Oa,je as Pa,nn as Qa,on as Ra,Fe as Sa,se as Ta,Ve as Ua,wr as Va,Tr as Wa,Je as Xa,W as Ya,fe as Za,pe as _a,Ur as $a,Lr as ab,ue as bb,de as cb,le as db,Pr as eb,kn as fb,jr as gb,Fr as hb,w as ib,Ze as jb,Wr as kb,Jr as lb,Nn as mb,M as nb,Qr as ob,ye as pb,Ln as qb,Hr as rb,st as sb,Zr as tb,ei as ub,ti as vb,ni as wb};
|
|
5
|
+
//# sourceMappingURL=chunk-LMKG3DFE.js.map
|