@unbrained/pm-cli 2026.9.18 → 2026.9.19
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 +20 -0
- package/dist/cli/invocation-profile.d.ts +26 -0
- package/dist/cli/invocation-profile.js +3 -0
- package/dist/cli-bundle/bundle-manifest.json +148 -148
- package/dist/cli-bundle/chunks/{chunk-GRFRKHFC.js → chunk-7CN53F4S.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-X2EVS624.js → chunk-AACGU5IA.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-AOD5WE6U.js → chunk-CCLWCESZ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-WD7BQXA7.js → chunk-J7NP7QLW.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-T4J2X3RK.js → chunk-K4VAU4HU.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-KHN4NMKT.js +238 -0
- package/dist/cli-bundle/chunks/{chunk-CA5DRNGA.js → chunk-KYG2QKNY.js} +28 -28
- package/dist/cli-bundle/chunks/{chunk-WUDF7HWM.js → chunk-OQS2Y6VN.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-XFGWFVR3.js → chunk-QA4GUEKJ.js} +20 -20
- package/dist/cli-bundle/chunks/chunk-QTHR3LXF.js +20 -0
- package/dist/cli-bundle/chunks/{chunk-FZZVWWQP.js → chunk-RVMDPIGD.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-Y2OK7IAD.js → chunk-WASMH647.js} +2 -2
- package/dist/cli-bundle/chunks/{register-list-query-43EQISX7.js → register-list-query-RMZNHSII.js} +2 -2
- package/dist/cli-bundle/chunks/{register-mutation-TSZNAKEU.js → register-mutation-HJGSGX3H.js} +2 -2
- package/dist/cli-bundle/chunks/{register-operations-KFZIKATY.js → register-operations-LBEMFUMM.js} +2 -2
- package/dist/cli-bundle/chunks/{register-setup-KTJ4ZE65.js → register-setup-MU557JAA.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-QVVOXVYI.js → chunk-5SZ4JSPZ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-PNCUNPSA.js → chunk-7Y7PAC56.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-YJYSFWSW.js → chunk-ARK4FIO4.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-C6SH62BX.js → chunk-CJ4QA4RW.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-ZDX2BCOT.js → chunk-I32L3FWW.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-GEFWBVPQ.js → chunk-I4WDON3K.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-246P5AK7.js → chunk-IKPR4VVN.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-J3GN4SQT.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-LG3SYXBX.js → chunk-OOZHQFBF.js} +9 -9
- package/dist/cli-bundle/focused-chunks/{chunk-BVOQRMHF.js → chunk-P4BA7OX7.js} +27 -26
- package/dist/cli-bundle/focused-chunks/{chunk-7D6M45AN.js → chunk-QL4MO5M2.js} +9 -9
- package/dist/cli-bundle/focused-chunks/chunk-TDHVROGL.js +3 -0
- package/dist/cli-bundle/focused-chunks/chunk-V3YMNAO7.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-YDFEWXXZ.js +59 -0
- package/dist/cli-bundle/focused-chunks/{chunk-MMX7BQLH.js → chunk-ZDBKYZFE.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-7UZHYT5B.js → chunk-ZI2YBJFH.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 +2 -2
- 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 +41 -41
- 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 +8 -8
- package/dist/cli.js +1 -1
- package/dist/core/checkpoint/mutation-checkpoint.d.ts +1 -1
- package/dist/core/checkpoint/mutation-checkpoint.js +2 -2
- package/dist/core/fs/atomic-create.d.ts +7 -0
- package/dist/core/fs/atomic-create.js +2 -0
- package/dist/core/history/history.js +1 -1
- package/dist/core/schema/runtime-schema.d.ts +1 -1
- package/dist/core/schema/runtime-schema.js +2 -2
- package/dist/core/session/session-state.js +1 -1
- package/dist/core/store/settings-concurrency.d.ts +7 -0
- package/dist/core/store/settings-concurrency.js +2 -0
- package/dist/core/store/settings.d.ts +8 -1
- package/dist/core/store/settings.js +3 -2
- package/dist/sdk/cli-contracts/flag-contracts.js +1 -1
- package/dist/sdk/contracts.d.ts +1 -0
- package/dist/sdk/contracts.js +1 -1
- package/dist/sdk/extension/install-runtime.d.ts +1 -1
- package/dist/sdk/extension/install-runtime.js +2 -2
- package/dist/sdk/governance/health.js +1 -1
- package/dist/sdk/governance/provenance-health.d.ts +27 -0
- package/dist/sdk/governance/provenance-health.js +1 -1
- package/dist/sdk/graph/index.d.ts +1 -0
- package/dist/sdk/graph/index.js +1 -1
- package/dist/sdk/graph/query-contracts.d.ts +18 -0
- package/dist/sdk/graph/query-contracts.js +2 -0
- package/dist/sdk/graph/run.d.ts +2 -0
- package/dist/sdk/graph/run.js +1 -1
- package/dist/sdk/graph/traversal.js +1 -1
- package/dist/sdk/lifecycle-policy.js +1 -1
- package/dist/sdk/public-surface.json +1 -1
- package/docs/MCP_OPTION_CONFORMANCE.md +41 -0
- package/docs/OUTPUT_PROJECTION_CONTRACTS.md +18 -2
- package/docs/PERFORMANCE.md +37 -0
- package/docs/SDK_AGENT_SESSION_CONTEXT.md +28 -4
- package/docs/SDK_LIFECYCLE.md +16 -2
- package/docs/WORKSPACE_CONCURRENCY.md +67 -0
- package/marketplace.json +2 -2
- package/package.json +2 -2
- 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/dist/cli-bundle/chunks/chunk-CI2JCBN2.js +0 -237
- package/dist/cli-bundle/chunks/chunk-IPR2ICDO.js +0 -20
- package/dist/cli-bundle/focused-chunks/chunk-HRANNGHM.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-LI6IGGB3.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-QKG7JD34.js +0 -3
- package/dist/cli-bundle/focused-chunks/chunk-QYQFBJXD.js +0 -59
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as yc,b as Ze,c as cn,d as wc,e as vc,h as kc}from"./chunk-X2EVS624.js";import{J as ko,L as Ec,M as Fc,O as Mc,Q as Lc,R as Dc,a as It,b as lo,d as Me,e as hc,j as gc,p as vo}from"./chunk-WD7BQXA7.js";import{$ as so,Ac as Tc,Bc as xc,Bd as Eo,Cc as Oc,Cd as Ao,Eb as Et,Ec as $c,Ed as Gc,F as vt,Fb as _o,Fc as Pc,G as g,H as la,Hb as mc,I as da,Jc as So,K as Z,L as ma,Ld as qc,M as Jt,Ma as nc,Mb as ho,Md as zc,N as pa,Na as ao,O as to,P as Xt,Pa as oc,Q as no,Qa as rc,Qc as Nc,R as Oe,Ra as co,Rc as jc,S as ua,T as oo,Tc as Uc,U as V,V as ro,W as G,X as fa,Y as _a,Z as io,_ as ha,bb as rn,cc as ke,dc as go,ec as pc,fc as uc,gc as Xe,ha as ga,hc as fc,ib as ic,ic as _c,id as Io,ja as Za,jb as sn,jc as yo,kb as sc,kc as bo,lc as wo,ma as Qa,mb as Ye,na as ec,nb as ac,ob as mo,pb as an,rb as Je,sa as St,tc as Le,vb as cc,vc as bc,wb as lc,xb as dc,yc as Rc,zc as Cc}from"./chunk-CA5DRNGA.js";import{$ as La,A as Zt,B as va,C as Pe,D as ka,E as Qt,F as Sa,G as en,Ga,M as Ia,P as Ea,Qa as tn,R as Aa,S as Ra,T as Ca,U as Ta,Ua as Sc,V as xa,W as Oa,X as $a,Xa as Ic,Y as Pa,Z as Fa,_ as Ma,aa as Da,b as ra,ba as Na,ca as ja,da as Ua,q as ya,w as ba,y as $e,z as wa,za as kt}from"./chunk-XFGWFVR3.js";import{Ac as po,Ia as qa,Ja as za,Ka as Ha,Na as Wa,Oa as Va,Ob as me,Pa as Ba,Qa as Ka,Sa as Fe,Ta as Ya,U as aa,Ua as Ja,Uc as uo,Xa as nn,Za as Xa,Zc as fo,ad as Ac,bb as ve,cb as tc,d as na,db as on,f as oa,s as ia,t as sa,za as ca}from"./chunk-IPR2ICDO.js";import{$b as ai,$d as ft,$j as P,A as Kr,Aa as On,Ac as Ut,Ad as vi,Ag as Ui,Aj as ts,Ak as fs,An as js,B as Yr,Bd as Re,Bk as _s,Bm as As,Cc as li,Ck as wt,Dd as ki,Dk as hs,Dn as Us,E as Jr,Ed as Si,Ek as Bt,Fk as gs,Fm as Rs,Gd as Gt,Gk as Xn,Hh as Hi,Hk as Zn,Hn as Gs,Ic as di,Id as Ii,Ik as ys,Il as vs,In as qs,Jd as Ei,Ji as Ke,Jn as zs,Kb as Dt,Kc as Dn,Kd as Ai,Kh as Be,Km as Cs,Kn as Hs,Lc as Nn,Le as $i,Lf as Mi,Lm as Ts,Ln as Ws,Mc as jn,Me as Pi,Nc as Un,Ne as Fi,Nm as xs,Nn as Vs,O as p,Oc as Gn,Of as Li,Oh as Wi,Oj as ns,On as Bs,Pb as ze,Pc as qn,Pi as Bn,Pn as Ks,Q as m,Qa as $n,Qc as zn,Qi as Kn,Qm as Os,Qn as Ys,Ra as Pn,Rc as $,Rf as Di,Rn as Js,S as Xr,Sa as Fn,Sd as We,Sn as Xs,T as ye,Ta as Mn,Td as Ce,Ud as Ri,Vb as ti,Vd as Ci,Vj as os,Vn as Zs,Wb as ni,Wc as mi,Wd as Te,Wi as Vi,Wn as Yt,Xb as oi,Xc as pi,Xd as Ti,Xj as rs,Xn as Qs,Yb as ri,Yj as is,Yn as ea,Z as xn,Zb as ii,Zd as H,_b as si,_c as z,_i as Bi,_j as ss,ab as F,ae as xi,ak as de,ao as we,ba as S,bb as Lt,bf as Vn,bk as be,bo as A,cd as ui,cf as C,cg as Ht,cj as Ki,dd as fi,de as Oi,df as te,ec as pt,ek as yt,en as $s,f as oe,fa as Zr,fc as ci,fj as le,h as Cn,ha as Qr,hk as Vt,hn as Ps,ia as $t,ib as E,id as He,ij as Yi,im as ks,in as Fs,j as Hr,ja as Pt,jj as Ji,ka as Ft,ke as xe,ki as ht,kk as bt,la as Mt,lb as mt,lh as Gi,li as gt,lj as Wt,lk as as,ll as Qn,mb as Ln,md as _i,me as Ve,nd as hi,nj as Xi,nk as Yn,nl as eo,o as ge,ob as Ae,of as W,oh as qi,p as qe,pf as zt,pk as Jn,po as ta,q as Tn,qa as ce,qd as ut,qe as qt,qn as Ms,r as ae,rd as gi,re as _t,rm as Ss,s as re,sd as yi,se as Wn,sn as Ls,t as lt,td as bi,tk as cs,tm as Is,u as Wr,ud as wi,uj as Zi,uk as ls,um as Kt,vk as ds,vm as Es,wg as Ni,wk as ms,xa as ei,xg as ji,xj as R,xk as ps,xl as bs,y as Vr,ya as dt,yc as Nt,yj as Qi,yl as ws,yn as Ds,z as Br,zc as jt,zd as Hn,zh as zi,zj as es,zk as us,zn as Ns}from"./chunk-CI2JCBN2.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]="cde4f476-6821-53be-b70e-62794fa2ae52")}catch{}})();var Fg=Wr,Mg=Vr,Lg=Yr,Dg=Br,Ng=Kr;function Hc(e,t,n,o){let r=e.flag.slice(2).replace(/[-_]([a-z])/gu,(s,a)=>a.toUpperCase()),i=n.has(r);return{long:t,...o?{short:o}:{},description:e.description??`Standard pm ${e.flag} option.`,...e.required===!0?{required:!0}:{},...e.list===!0?{list:!0}:{},...e.repeatable===!0?{repeatable:!0}:{},value_type:i?"string":"boolean",...i?{value_name:e.value_name??"value"}:{}}}function Wc(e,t=[]){let n=new Set(t.flatMap(r=>r.keys)),o=[];for(let r of Ss(e.map(i=>({...i})))){o.push(Hc(r,r.flag,n,r.short));for(let i of r.aliases??[])o.push(Hc(r,i,n))}return o}var jg=Wc(Kt,bs),lm=Wc(Yt,ws);import{AsyncLocalStorage as Kh}from"node:async_hooks";(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]="176b4ac2-2c47-50d6-beee-62e1d3dc9281")}catch{}})();function Vc(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function dm(e){return e.brief===!0?"brief":typeof e.fields=="string"&&e.fields.trim().length>0||Array.isArray(e.fields)&&e.fields.length>0?"fields":e.compact===!0?"compact":"full"}function Ro(e,t){let n=dm(t),o=n==="brief"?n:Vc(e.projection)&&typeof e.projection.mode=="string"?e.projection.mode:n;return{...e,query_summary:{filters:Vc(e.filters)?e.filters:{},projection: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]="3046466c-614c-5e2b-a156-df96fba8c483")}catch{}})();async function Bc(e,t){let n=E(t??process.cwd(),e),o=await R(n);return yt(n,o.item_format,F(o,null).type_to_folder,void 0,o.schema)}(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]="f6e02611-4b44-5aa3-b762-9fd984aa12bc")}catch{}})();var mm=["invalid_envelope","source_incomplete","source_unchecked","filtered_corpus","terminal_items_excluded","strict_read_unproven","page_incomplete","count_mismatch","projection_incomplete","field_omission","omission_receipt_missing","omission_receipt_invalid","read_output_missing","read_output_invalid","read_output_dimensions_incomplete","budget_compaction","budget_omission","session_projection","invalid_item_id","duplicate_item_id"],ln=class extends Error{receipt;constructor(t){super(`Complete-list certification failed: ${t.map(n=>n.code).join(", ")}.`),this.name="PmCompleteListValidationError",this.receipt={contract_version:1,contract:"complete_list",findings:t,recovery:{suggested_retry:"pm list --all --output-include full --strict-read --no-truncate --output-budget unbounded --output-limit unbounded --json",sdk:"await client.listAllComplete()"}}}};function Co(e={}){return{excludeTerminal:!1,full:!0,...e.includeBody===void 0?{}:{includeBody:e.includeBody},noTruncate:!0,outputBudget:"unbounded",outputLimit:"unbounded",strictRead:!0}}function pe(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function M(e,t,n,o){t&&e.push({code:n,message:o})}function pm(e,t){let n=pe(e.completeness)?e.completeness:{};M(t,n.status==="partial","source_incomplete","The source scan reported unreadable tracker artifacts."),M(t,n.status!=="complete"&&n.status!=="partial","source_unchecked","The source scan did not prove completeness.");let o=n.unreadable_item_count,r=n.unreadable_directory_count;M(t,n.status==="complete"&&(o!==0||r!==0)&&Number.isSafeInteger(o)&&Number.isSafeInteger(r),"source_incomplete","The source scan reports unreadable tracker artifacts despite a complete status."),M(t,n.status==="complete"&&(!Number.isSafeInteger(o)||!Number.isSafeInteger(r)||Number(o)<0||Number(r)<0),"source_unchecked","The source scan did not report safe non-negative unreadable counts.");let i=pe(e.filters)?e.filters:{},s=pe(i.runtime_filters)?i.runtime_filters:{},a=new Set(["exclude_terminal","include_body","no_truncate","runtime_filters","status","strict_read"]);return M(t,i.status!=="all"||Object.keys(s).length>0||Object.keys(i).some(c=>!a.has(c)),"filtered_corpus","The list did not explicitly select every lifecycle status."),M(t,i.exclude_terminal===!0,"terminal_items_excluded","Terminal lifecycle states were explicitly excluded."),M(t,i.strict_read!==!0,"strict_read_unproven","The result does not echo strict source-read enforcement."),i}function um(e,t,n){M(n,e.has_more!==!1||e.next_cursor!==null||e.truncated!==!1||e.applied_limit!==void 0||t.no_truncate!==!0,"page_incomplete","Pagination or a row ceiling may have withheld items."),M(n,e.count!==e.items.length||e.total!==e.items.length,"count_mismatch","Envelope counts do not equal the returned item count.");let o=pe(e.projection)?e.projection:{};M(n,o.mode!=="full"||o.fields!==null,"projection_incomplete","The result is not the full metadata projection.");let r=pe(e.omission_receipt)?e.omission_receipt:void 0;M(n,r===void 0,"omission_receipt_missing","The result carries no field-omission receipt."),M(n,r!==void 0&&(r.has_omissions!==!1||r.omitted_field_group_count!==0||!Number.isSafeInteger(r.omitted_field_group_count)||!Array.isArray(r.omitted_field_groups)||r.omitted_field_groups.length!==0),"omission_receipt_invalid","The field-omission receipt is malformed or contradicts its no-omission claim."),M(n,r?.has_omissions===!0,"field_omission","The omission receipt reports withheld field groups.")}function fm(e){return e.contract_version!==1||e.command!=="list"||e.within_budget!==!0||e.strings_compacted!==!1||e.rows_compacted!==!1||e.result_omitted!==!1}function _m(e){if(!Array.isArray(e.requested_dimensions))return!1;let t=new Set(e.requested_dimensions);return["include","amount","cost"].every(n=>t.has(n))}function hm(e,t){let n=pe(e.read_output)?e.read_output:void 0;M(t,n===void 0,"read_output_missing","The result carries no universal read-output receipt."),M(t,n!==void 0&&fm(n),"read_output_invalid","The universal read-output receipt does not prove an intact list result."),M(t,n!==void 0&&!_m(n),"read_output_dimensions_incomplete","The universal read-output receipt does not prove full, unbounded include, amount, and cost dimensions."),M(t,n?.strings_compacted===!0||n?.rows_compacted===!0||e.output_budget_truncation!==void 0,"budget_compaction","Universal output shaping compacted the result.");let o=pe(e.output_budget_exceeded)?e.output_budget_exceeded:void 0;M(t,n?.result_omitted===!0||o?.omitted_result===!0,"budget_omission","Universal output shaping omitted the useful result."),M(t,e.read_session!==void 0,"session_projection","A cross-call read session can suppress previously served facts.")}function gm(e,t){let n=e.map(o=>pe(o)&&typeof o.id=="string"?o.id.trim():"");M(t,n.some(o=>o.length===0),"invalid_item_id","Every full item row must carry a non-empty string id."),M(t,new Set(n).size!==n.length,"duplicate_item_id","Every item id must occur exactly once.")}function Kc(e){if(!pe(e)||!Array.isArray(e.items))return{ok:!1,findings:[{code:mm[0],message:"The result must be an object with an items array."}]};let t=e,n=[],o=pm(t,n);return um(t,o,n),hm(t,n),gm(t.items,n),{ok:n.length===0,findings:n}}function dn(e){let t=Kc(e);if(!t.ok)throw new ln(t.findings);let n=e;return{...n,complete_list:{contract_version:1,item_count:n.items.length,unique_item_id_count:new Set(n.items.map(o=>o.id)).size,terminal_items_included:!0,source_complete:!0,full_projection:!0,no_omissions:!0,unbounded:!0}}}function ym(e){dn(e)}import Zc 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]="0c84b11c-502f-5c33-a757-5757402357b4")}catch{}})();function Yc(e){return e.map(t=>({key:t.key,optionName:xi(t),metadataKey:t.metadata_key,type:t.type,commands:[...t.commands],repeatable:t.repeatable,requiredOnCreate:t.required_on_create,...t.description?{description:t.description}:{}}))}function Jc(e){return e.map(t=>({command:t.command,action:t.action,arguments:t.arguments.map(n=>({name:n.name,required:n.required===!0,variadic:n.variadic===!0,description:n.description})),description:t.description,tier:t.tier??"standard",family:t.family??"extensions"}))}(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]="e8137f8b-745a-5ef5-9e7e-14b7d032c1ea")}catch{}})();var bm=50,Se=new Map;function To(){Se.clear()}function Xc(e,t){let n=Se.get(e);if(n!==void 0)return n;if(Se.size>=bm){let r=Se.keys().next().value;Se.delete(r)}let o=t().catch(r=>{throw Se.get(e)===o&&Se.delete(e),r});return Se.set(e,o),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]="b841f903-6276-5067-842f-6a6bff114cec")}catch{}})();function wm(e,t,n){return JSON.stringify([Zc.resolve(e),Zc.resolve(n??process.cwd()),t.extensions.enabled,t.extensions.disabled,t.extensions.policy])}async function vm(e,t,n){let o=wm(e,t,n);return Xc(o,()=>Sm(e,t,n))}async function km(e,t={}){let n=await R(e),o=t.extensionRegistrations??(t.noExtensions===!0?null:await vm(e,n,t.cwd)),r=F(n,o),i=H(n.schema),s=ft(n.schema);return{types:[...r.types],statuses:i.definitions.map(a=>a.id),openStatus:i.open_status,closeStatus:i.close_status,canceledStatus:i.canceled_status,fields:Yc(s.definitions),extensionCommands:Jc(o?.commands??[])}}async function Sm(e,t,n){let o=await Nt({pmRoot:e,settings:t,cwd:n??process.cwd(),noExtensions:!1}),r=await Ut(o);try{return r.registrations}finally{try{await jt(o,r)}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]="0c7a926a-46a2-560c-ae95-33b92b8c820e")}catch{}})();var Im={"list-all":{action:"list",options:{excludeTerminal:!1}},"list-draft":{action:"list",options:{status:"draft",excludeTerminal:!1}},"list-open":{action:"list",options:{status:"open",excludeTerminal:!1}},"list-in-progress":{action:"list",options:{status:"in_progress",excludeTerminal:!1}},"list-blocked":{action:"list",options:{status:"blocked",excludeTerminal:!1}},"list-closed":{action:"list",options:{status:"closed",excludeTerminal:!1}},"list-canceled":{action:"list",options:{status:"canceled",excludeTerminal:!1}}};function Qc(e){return Object.fromEntries(Ni.map(t=>[`${e}-${t}`,{action:e,options:{[t==="adopt-all"?"adoptAll":t]:!0,...e==="package"?{vocabulary:"package"}:{}}}]))}var xo={ctx:{action:"context"},...Im,...Qc("extension"),...Qc("package"),...Object.fromEntries(ji.map(e=>[`package-${e}`,{action: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]="9133d39d-b2fb-5f99-8fd3-87a7d2f8df6d")}catch{}})();var el="PmCliError";function Em(e){if(!Number.isFinite(e))throw new TypeError("createPmCliExpectedError options.exitCode must be a finite number");let t=Math.trunc(e);if(t<=p.SUCCESS)throw new TypeError("createPmCliExpectedError options.exitCode must be a positive exit code");return t}function Am(e,t={}){if(typeof e!="string"||e.trim().length===0)throw new TypeError("createPmCliExpectedError message must be a non-empty string");let n=new m(e,Em(t.exitCode??p.USAGE),t.context??{});return"cause"in t&&Object.defineProperty(n,"cause",{value:t.cause,enumerable:!1,configurable:!0,writable:!0}),n}function Oo(e){if(!(e instanceof Error)||e.name!==el)return!1;let t=e;return typeof t.exitCode=="number"&&Number.isFinite(t.exitCode)}import{constants as At}from"node:fs";import{lstat as tl,mkdir as Po,open as nl}from"node:fs/promises";import ue 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]="e57a9bca-1190-5ffd-bb7d-d76a22fc9e57")}catch{}})();function $o(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship event ${t} must be non-empty`);return e.trim()}function Fo(e,t){let n=t.require(e.kind),o=n.direction==="undirected"?[e.source,e.target].sort().join("\0"):`${e.source}\0${e.target}`;return`${n.kind}\0${o}`}function Rm(e){return Object.freeze({...e,...e.payload===void 0?{}:{payload:Object.freeze(structuredClone(e.payload))}})}function Cm(e,t,n,o){let r=n.require(e.kind),i=o.outgoingOne.get(`${r.kind}\0${e.source}`);if(i!==void 0&&i!==t)throw new TypeError(`Relationship outgoing cardinality exceeded for ${r.kind}`);let s=o.incomingOne.get(`${r.kind}\0${e.target}`);if(s!==void 0&&s!==t)throw new TypeError(`Relationship incoming cardinality exceeded for ${r.kind}`);let a=Fo(e,n),c=o.identities.get(a);if(c!==void 0&&c!==t)throw new TypeError(`Relationship edge already active: ${a}`)}function Tm(e){let t=new Map;for(let n of e)n.action==="remove"?t.delete(n.relationshipId):t.set(n.relationshipId,n.edge);return t}function xm(e,t,n){if(e.expectedVersion!==void 0&&e.expectedVersion!==t)throw new TypeError(`Relationship event version conflict: expected ${e.expectedVersion}, current ${t}`);let o=$o(e.eventId,"eventId");if(n.has(o))throw new TypeError(`Relationship event already exists: ${o}`);if(e.action!=="add"&&e.action!=="remove"&&e.action!=="supersede")throw new TypeError(`Unknown relationship event action: ${e.action}`);if(!Number.isFinite(Date.parse(e.timestamp)))throw new TypeError("Relationship event timestamp must be valid");return{eventId:o,relationshipId:$o(e.relationshipId,"relationshipId"),author:$o(e.author,"author"),timestamp:new Date(e.timestamp).toISOString()}}function Om(e,t,n,o,r,i){let s=n.has(t);if(e.action==="add"&&s)throw new TypeError(`Relationship is already active: ${t}`);if(e.action!=="add"&&!s)throw new TypeError(`Relationship is not active: ${t}`);if(e.action==="remove")return;if(!e.edge)throw new TypeError(`Relationship ${e.action} event requires an edge`);let a=typeof e.edge.source=="string"?e.edge.source.trim():"",c=typeof e.edge.target=="string"?e.edge.target.trim():"";if(!o.has(a)||!o.has(c))throw new TypeError(`Relationship endpoint not found: ${a} -> ${c}`);let l=new ze([a,c],[e.edge],r).edges()[0];return Cm(l,t,r,i),Rm(l)}var Rt=class{#t;#n;#o=[];#i=new Set;#e=new Map;#r={identities:new Map,outgoingOne:new Map,incomingOne:new Map};constructor(t,n={}){this.#t=new Set([...t].filter(o=>typeof o=="string").map(o=>o.trim()).filter(Boolean)),this.#n=n.registry??Dt()}get version(){return this.#o.length}events(){return Object.freeze([...this.#o])}*stream(t={}){let n=t.fromVersion??1,o=t.toVersion??this.version,r=t.batchSize??100;if(!Number.isInteger(n)||n<1)throw new TypeError("Relationship event stream fromVersion must be positive");if(!Number.isInteger(o)||o<0||o>this.version)throw new TypeError(`Relationship event stream toVersion out of range: ${o}`);if(!Number.isInteger(r)||r<1)throw new TypeError("Relationship event stream batchSize must be positive");if(n>o+1)throw new TypeError("Relationship event stream fromVersion exceeds the selected prefix");for(let i=n-1;i<o;i+=r)yield Object.freeze(this.#o.slice(i,Math.min(i+r,o)))}project(t,n,o={}){if(typeof n!="function")throw new TypeError("Relationship event projection requires a reducer");let r=t,i=0,s;for(let a of this.stream({...o,batchSize:256}))for(let c of a)r=n(r,c),i+=1,s=c;return Object.freeze({state:r,version:s?.sequence??Math.max(0,(o.fromVersion??1)-1),processed:i,...s===void 0?{}:{asOf:s.timestamp}})}#s(t,n){let o=this.#n.require(n.kind);this.#r.identities.set(Fo(n,this.#n),t),o.outgoing==="one"&&this.#r.outgoingOne.set(`${o.kind}\0${n.source}`,t),o.incoming==="one"&&this.#r.incomingOne.set(`${o.kind}\0${n.target}`,t)}#a(t){let n=this.#n.require(t.kind);this.#r.identities.delete(Fo(t,this.#n)),n.outgoing==="one"&&this.#r.outgoingOne.delete(`${n.kind}\0${t.source}`),n.incoming==="one"&&this.#r.incomingOne.delete(`${n.kind}\0${t.target}`)}append(t){let n=xm(t,this.version,this.#i),o=this.#e.get(n.relationshipId),r=Om(t,n.relationshipId,this.#e,this.#t,this.#n,this.#r),i=Object.freeze({eventId:n.eventId,relationshipId:n.relationshipId,action:t.action,...r===void 0?{}:{edge:r},author:n.author,timestamp:n.timestamp,...t.reason?.trim()?{reason:t.reason.trim()}:{},sequence:this.version+1});return this.#o.push(i),this.#i.add(n.eventId),o&&this.#a(o),t.action==="remove"?this.#e.delete(n.relationshipId):(this.#e.set(n.relationshipId,r),this.#s(n.relationshipId,r)),i}snapshot(t={}){if(t.atVersion!==void 0&&t.atTimestamp!==void 0)throw new TypeError("Relationship snapshot accepts one target");let n;if(t.atTimestamp!==void 0){let i=Date.parse(t.atTimestamp);if(!Number.isFinite(i))throw new TypeError("Relationship snapshot timestamp must be valid");n=this.#o.filter(s=>Date.parse(s.timestamp)<=i)}else{let i=t.atVersion??this.version;if(!Number.isInteger(i)||i<0||i>this.version)throw new TypeError(`Relationship snapshot version out of range: ${i}`);n=this.#o.slice(0,i)}let o=Tm(n),r=new ze(this.#t,o.values(),this.#n);return Object.freeze({version:n.at(-1)?.sequence??0,...n.at(-1)?{asOf:n.at(-1).timestamp}:{},edges:r.edges(),graph:r})}page(t){if(!Number.isInteger(t.limit)||t.limit<1)throw new TypeError("Relationship event page limit must be positive");let n=Mi("relationship-events",{order:"append-sequence"}),o=t.cursor===void 0?this.version:Number(Li(t.cursor,n).snapshot);if(!Number.isSafeInteger(o)||o<0||o>this.version)throw new TypeError("Relationship event cursor snapshot version is invalid");let r=Di(this.#o.slice(0,o),{cursor:t.cursor,fingerprint:n,limit:t.limit,readId:i=>i.eventId,snapshot:String(o)});return{version:o,events:r.rows,hasMore:r.has_more,...r.next_cursor?{nextCursor:r.next_cursor}:{}}}},$m="relationship-event-store",ol=At.O_NOFOLLOW;function mn(e){return te(e,$m,30,`relationship-store:${process.pid}`,!1,!1,3e3)}async function De(e,t="relationships/events.jsonl"){let n=ue.resolve(e),o=ue.resolve(n,t),r=ue.relative(n,o);if(r.length===0)throw new TypeError("Relationship event path must name a file within the tracker root");if(r===".."||r.startsWith(`..${ue.sep}`)||ue.isAbsolute(r))throw new TypeError("Relationship event path must stay within the tracker root");if(await Po(n,{recursive:!0}),(await tl(n)).isSymbolicLink())throw new TypeError("Relationship event tracker root must not be a symbolic link");let s=n;for(let a of r.split(ue.sep)){s=ue.join(s,a);try{if((await tl(s)).isSymbolicLink())throw new TypeError("Relationship event path must not contain symbolic links")}catch(c){if(Tn(c))break;throw c}}return o}async function pn(e,t,n){let o=new Rt(t,{registry:n}),r,i;try{i=await nl(e,At.O_RDONLY|ol),r=await i.readFile("utf8")}catch(a){if(Tn(a))return{log:o,raw:""};throw a}finally{await i?.close()}let s=r.split(`
|
|
1
|
+
import{a as yc,b as Ze,c as cn,d as wc,e as vc,h as kc}from"./chunk-AACGU5IA.js";import{J as ko,L as Ec,M as Fc,O as Mc,Q as Lc,R as Dc,a as It,b as lo,d as Me,e as hc,j as gc,p as vo}from"./chunk-J7NP7QLW.js";import{$ as so,Ac as Tc,Bc as xc,Bd as Eo,Cc as Oc,Cd as Ao,Eb as Et,Ec as $c,Ed as Gc,F as vt,Fb as _o,Fc as Pc,G as g,H as la,Hb as mc,I as da,Jc as So,K as Z,L as ma,Ld as qc,M as Jt,Ma as nc,Mb as ho,Md as zc,N as pa,Na as ao,O as to,P as Xt,Pa as oc,Q as no,Qa as rc,Qc as Nc,R as Oe,Ra as co,Rc as jc,S as ua,T as oo,Tc as Uc,U as V,V as ro,W as G,X as fa,Y as _a,Z as io,_ as ha,bb as rn,cc as ke,dc as go,ec as pc,fc as uc,gc as Xe,ha as ga,hc as fc,ib as ic,ic as _c,id as Io,ja as Za,jb as sn,jc as yo,kb as sc,kc as bo,lc as wo,ma as Qa,mb as Ye,na as ec,nb as ac,ob as mo,pb as an,rb as Je,sa as St,tc as Le,vb as cc,vc as bc,wb as lc,xb as dc,yc as Rc,zc as Cc}from"./chunk-KYG2QKNY.js";import{$ as La,A as Zt,B as va,C as Pe,D as ka,E as Qt,F as Sa,G as en,Ga,M as Ia,P as Ea,Qa as tn,R as Aa,S as Ra,T as Ca,U as Ta,Ua as Sc,V as xa,W as Oa,X as $a,Xa as Ic,Y as Pa,Z as Fa,_ as Ma,aa as Da,b as ra,ba as Na,ca as ja,da as Ua,q as ya,w as ba,y as $e,z as wa,za as kt}from"./chunk-QA4GUEKJ.js";import{Ac as po,Ia as qa,Ja as za,Ka as Ha,Na as Wa,Oa as Va,Ob as me,Pa as Ba,Qa as Ka,Sa as Fe,Ta as Ya,U as aa,Ua as Ja,Uc as uo,Xa as nn,Za as Xa,Zc as fo,ad as Ac,bb as ve,cb as tc,d as na,db as on,f as oa,s as ia,t as sa,za as ca}from"./chunk-QTHR3LXF.js";import{$b as ai,$d as ft,$j as P,A as Kr,Aa as On,Ac as Ut,Ad as vi,Ag as Ui,Aj as ts,Ak as fs,An as Ns,B as Yr,Bd as Re,Bk as _s,Bn as js,Cc as li,Ck as wt,Cm as As,Dd as ki,Dk as hs,E as Jr,Ed as Si,Ek as Bt,En as Us,Fk as gs,Gd as Gt,Ge as te,Gk as Xn,Gm as Rs,Hh as Hi,Hk as Zn,Ic as di,Id as Ii,Ik as ys,Il as vs,In as Gs,Jd as Ei,Ji as Ke,Jn as qs,Kb as Dt,Kc as Dn,Kd as Ai,Kh as Be,Kn as zs,Lc as Nn,Lf as Mi,Lm as Cs,Ln as Hs,Mc as jn,Me as $i,Mm as Ts,Mn as Ws,Nc as Un,Ne as Pi,O as p,Oc as Gn,Oe as Fi,Of as Li,Oh as Wi,Oj as ns,Om as xs,On as Vs,Pb as ze,Pc as qn,Pi as Bn,Pn as Bs,Q as m,Qa as $n,Qc as zn,Qi as Kn,Qn as Ks,Ra as Pn,Rc as $,Rf as Di,Rm as Os,Rn as Ys,S as Xr,Sa as Fn,Sd as We,Sn as Js,T as ye,Ta as Mn,Td as Ce,Tn as Xs,Ud as Ri,Vb as ti,Vd as Ci,Vj as os,Wb as ni,Wc as mi,Wd as Te,Wi as Vi,Wn as Zs,Xb as oi,Xc as pi,Xd as Ti,Xj as rs,Xn as Yt,Yb as ri,Yj as is,Yn as Qs,Z as xn,Zb as ii,Zd as H,Zn as ea,_b as si,_c as z,_i as Bi,_j as ss,ab as F,ae as xi,ak as de,ba as S,bb as Lt,bk as be,bo as we,cd as ui,cf as Vn,cg as Ht,cj as Ki,co as A,dd as fi,de as Oi,df as C,ec as pt,ek as yt,f as oe,fa as Zr,fc as ci,fj as le,fn as $s,h as Cn,ha as Qr,hk as Vt,ia as $t,ib as E,id as He,ij as Yi,im as ks,in as Ps,j as Hr,ja as Pt,jj as Ji,jn as Fs,ka as Ft,ke as xe,ki as ht,kk as bt,la as Mt,lb as mt,lh as Gi,li as gt,lj as Wt,lk as as,ll as Qn,mb as Ln,md as _i,me as Ve,nd as hi,nj as Xi,nk as Yn,nl as eo,o as ge,ob as Ae,of as W,oh as qi,p as qe,pf as zt,pk as Jn,q as Tn,qa as ce,qd as ut,qe as qt,qo as ta,r as ae,rd as gi,re as _t,rn as Ms,s as re,sd as yi,se as Wn,sm as Ss,t as lt,td as bi,tk as cs,tn as Ls,u as Wr,ud as wi,uj as Zi,uk as ls,um as Is,vk as ds,vm as Kt,wg as Ni,wk as ms,wm as Es,xa as ei,xg as ji,xj as R,xk as ps,xl as bs,y as Vr,ya as dt,yc as Nt,yj as Qi,yl as ws,z as Br,zc as jt,zd as Hn,zh as zi,zj as es,zk as us,zn as Ds}from"./chunk-KHN4NMKT.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]="cde4f476-6821-53be-b70e-62794fa2ae52")}catch{}})();var Fg=Wr,Mg=Vr,Lg=Yr,Dg=Br,Ng=Kr;function Hc(e,t,n,o){let r=e.flag.slice(2).replace(/[-_]([a-z])/gu,(s,a)=>a.toUpperCase()),i=n.has(r);return{long:t,...o?{short:o}:{},description:e.description??`Standard pm ${e.flag} option.`,...e.required===!0?{required:!0}:{},...e.list===!0?{list:!0}:{},...e.repeatable===!0?{repeatable:!0}:{},value_type:i?"string":"boolean",...i?{value_name:e.value_name??"value"}:{}}}function Wc(e,t=[]){let n=new Set(t.flatMap(r=>r.keys)),o=[];for(let r of Ss(e.map(i=>({...i})))){o.push(Hc(r,r.flag,n,r.short));for(let i of r.aliases??[])o.push(Hc(r,i,n))}return o}var jg=Wc(Kt,bs),lm=Wc(Yt,ws);import{AsyncLocalStorage as Kh}from"node:async_hooks";(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]="176b4ac2-2c47-50d6-beee-62e1d3dc9281")}catch{}})();function Vc(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function dm(e){return e.brief===!0?"brief":typeof e.fields=="string"&&e.fields.trim().length>0||Array.isArray(e.fields)&&e.fields.length>0?"fields":e.compact===!0?"compact":"full"}function Ro(e,t){let n=dm(t),o=n==="brief"?n:Vc(e.projection)&&typeof e.projection.mode=="string"?e.projection.mode:n;return{...e,query_summary:{filters:Vc(e.filters)?e.filters:{},projection: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]="3046466c-614c-5e2b-a156-df96fba8c483")}catch{}})();async function Bc(e,t){let n=E(t??process.cwd(),e),o=await R(n);return yt(n,o.item_format,F(o,null).type_to_folder,void 0,o.schema)}(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]="f6e02611-4b44-5aa3-b762-9fd984aa12bc")}catch{}})();var mm=["invalid_envelope","source_incomplete","source_unchecked","filtered_corpus","terminal_items_excluded","strict_read_unproven","page_incomplete","count_mismatch","projection_incomplete","field_omission","omission_receipt_missing","omission_receipt_invalid","read_output_missing","read_output_invalid","read_output_dimensions_incomplete","budget_compaction","budget_omission","session_projection","invalid_item_id","duplicate_item_id"],ln=class extends Error{receipt;constructor(t){super(`Complete-list certification failed: ${t.map(n=>n.code).join(", ")}.`),this.name="PmCompleteListValidationError",this.receipt={contract_version:1,contract:"complete_list",findings:t,recovery:{suggested_retry:"pm list --all --output-include full --strict-read --no-truncate --output-budget unbounded --output-limit unbounded --json",sdk:"await client.listAllComplete()"}}}};function Co(e={}){return{excludeTerminal:!1,full:!0,...e.includeBody===void 0?{}:{includeBody:e.includeBody},noTruncate:!0,outputBudget:"unbounded",outputLimit:"unbounded",strictRead:!0}}function pe(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function M(e,t,n,o){t&&e.push({code:n,message:o})}function pm(e,t){let n=pe(e.completeness)?e.completeness:{};M(t,n.status==="partial","source_incomplete","The source scan reported unreadable tracker artifacts."),M(t,n.status!=="complete"&&n.status!=="partial","source_unchecked","The source scan did not prove completeness.");let o=n.unreadable_item_count,r=n.unreadable_directory_count;M(t,n.status==="complete"&&(o!==0||r!==0)&&Number.isSafeInteger(o)&&Number.isSafeInteger(r),"source_incomplete","The source scan reports unreadable tracker artifacts despite a complete status."),M(t,n.status==="complete"&&(!Number.isSafeInteger(o)||!Number.isSafeInteger(r)||Number(o)<0||Number(r)<0),"source_unchecked","The source scan did not report safe non-negative unreadable counts.");let i=pe(e.filters)?e.filters:{},s=pe(i.runtime_filters)?i.runtime_filters:{},a=new Set(["exclude_terminal","include_body","no_truncate","runtime_filters","status","strict_read"]);return M(t,i.status!=="all"||Object.keys(s).length>0||Object.keys(i).some(c=>!a.has(c)),"filtered_corpus","The list did not explicitly select every lifecycle status."),M(t,i.exclude_terminal===!0,"terminal_items_excluded","Terminal lifecycle states were explicitly excluded."),M(t,i.strict_read!==!0,"strict_read_unproven","The result does not echo strict source-read enforcement."),i}function um(e,t,n){M(n,e.has_more!==!1||e.next_cursor!==null||e.truncated!==!1||e.applied_limit!==void 0||t.no_truncate!==!0,"page_incomplete","Pagination or a row ceiling may have withheld items."),M(n,e.count!==e.items.length||e.total!==e.items.length,"count_mismatch","Envelope counts do not equal the returned item count.");let o=pe(e.projection)?e.projection:{};M(n,o.mode!=="full"||o.fields!==null,"projection_incomplete","The result is not the full metadata projection.");let r=pe(e.omission_receipt)?e.omission_receipt:void 0;M(n,r===void 0,"omission_receipt_missing","The result carries no field-omission receipt."),M(n,r!==void 0&&(r.has_omissions!==!1||r.omitted_field_group_count!==0||!Number.isSafeInteger(r.omitted_field_group_count)||!Array.isArray(r.omitted_field_groups)||r.omitted_field_groups.length!==0),"omission_receipt_invalid","The field-omission receipt is malformed or contradicts its no-omission claim."),M(n,r?.has_omissions===!0,"field_omission","The omission receipt reports withheld field groups.")}function fm(e){return e.contract_version!==1||e.command!=="list"||e.within_budget!==!0||e.strings_compacted!==!1||e.rows_compacted!==!1||e.result_omitted!==!1}function _m(e){if(!Array.isArray(e.requested_dimensions))return!1;let t=new Set(e.requested_dimensions);return["include","amount","cost"].every(n=>t.has(n))}function hm(e,t){let n=pe(e.read_output)?e.read_output:void 0;M(t,n===void 0,"read_output_missing","The result carries no universal read-output receipt."),M(t,n!==void 0&&fm(n),"read_output_invalid","The universal read-output receipt does not prove an intact list result."),M(t,n!==void 0&&!_m(n),"read_output_dimensions_incomplete","The universal read-output receipt does not prove full, unbounded include, amount, and cost dimensions."),M(t,n?.strings_compacted===!0||n?.rows_compacted===!0||e.output_budget_truncation!==void 0,"budget_compaction","Universal output shaping compacted the result.");let o=pe(e.output_budget_exceeded)?e.output_budget_exceeded:void 0;M(t,n?.result_omitted===!0||o?.omitted_result===!0,"budget_omission","Universal output shaping omitted the useful result."),M(t,e.read_session!==void 0,"session_projection","A cross-call read session can suppress previously served facts.")}function gm(e,t){let n=e.map(o=>pe(o)&&typeof o.id=="string"?o.id.trim():"");M(t,n.some(o=>o.length===0),"invalid_item_id","Every full item row must carry a non-empty string id."),M(t,new Set(n).size!==n.length,"duplicate_item_id","Every item id must occur exactly once.")}function Kc(e){if(!pe(e)||!Array.isArray(e.items))return{ok:!1,findings:[{code:mm[0],message:"The result must be an object with an items array."}]};let t=e,n=[],o=pm(t,n);return um(t,o,n),hm(t,n),gm(t.items,n),{ok:n.length===0,findings:n}}function dn(e){let t=Kc(e);if(!t.ok)throw new ln(t.findings);let n=e;return{...n,complete_list:{contract_version:1,item_count:n.items.length,unique_item_id_count:new Set(n.items.map(o=>o.id)).size,terminal_items_included:!0,source_complete:!0,full_projection:!0,no_omissions:!0,unbounded:!0}}}function ym(e){dn(e)}import Zc 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]="0c84b11c-502f-5c33-a757-5757402357b4")}catch{}})();function Yc(e){return e.map(t=>({key:t.key,optionName:xi(t),metadataKey:t.metadata_key,type:t.type,commands:[...t.commands],repeatable:t.repeatable,requiredOnCreate:t.required_on_create,...t.description?{description:t.description}:{}}))}function Jc(e){return e.map(t=>({command:t.command,action:t.action,arguments:t.arguments.map(n=>({name:n.name,required:n.required===!0,variadic:n.variadic===!0,description:n.description})),description:t.description,tier:t.tier??"standard",family:t.family??"extensions"}))}(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]="e8137f8b-745a-5ef5-9e7e-14b7d032c1ea")}catch{}})();var bm=50,Se=new Map;function To(){Se.clear()}function Xc(e,t){let n=Se.get(e);if(n!==void 0)return n;if(Se.size>=bm){let r=Se.keys().next().value;Se.delete(r)}let o=t().catch(r=>{throw Se.get(e)===o&&Se.delete(e),r});return Se.set(e,o),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]="b841f903-6276-5067-842f-6a6bff114cec")}catch{}})();function wm(e,t,n){return JSON.stringify([Zc.resolve(e),Zc.resolve(n??process.cwd()),t.extensions.enabled,t.extensions.disabled,t.extensions.policy])}async function vm(e,t,n){let o=wm(e,t,n);return Xc(o,()=>Sm(e,t,n))}async function km(e,t={}){let n=await R(e),o=t.extensionRegistrations??(t.noExtensions===!0?null:await vm(e,n,t.cwd)),r=F(n,o),i=H(n.schema),s=ft(n.schema);return{types:[...r.types],statuses:i.definitions.map(a=>a.id),openStatus:i.open_status,closeStatus:i.close_status,canceledStatus:i.canceled_status,fields:Yc(s.definitions),extensionCommands:Jc(o?.commands??[])}}async function Sm(e,t,n){let o=await Nt({pmRoot:e,settings:t,cwd:n??process.cwd(),noExtensions:!1}),r=await Ut(o);try{return r.registrations}finally{try{await jt(o,r)}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]="0c7a926a-46a2-560c-ae95-33b92b8c820e")}catch{}})();var Im={"list-all":{action:"list",options:{excludeTerminal:!1}},"list-draft":{action:"list",options:{status:"draft",excludeTerminal:!1}},"list-open":{action:"list",options:{status:"open",excludeTerminal:!1}},"list-in-progress":{action:"list",options:{status:"in_progress",excludeTerminal:!1}},"list-blocked":{action:"list",options:{status:"blocked",excludeTerminal:!1}},"list-closed":{action:"list",options:{status:"closed",excludeTerminal:!1}},"list-canceled":{action:"list",options:{status:"canceled",excludeTerminal:!1}}};function Qc(e){return Object.fromEntries(Ni.map(t=>[`${e}-${t}`,{action:e,options:{[t==="adopt-all"?"adoptAll":t]:!0,...e==="package"?{vocabulary:"package"}:{}}}]))}var xo={ctx:{action:"context"},...Im,...Qc("extension"),...Qc("package"),...Object.fromEntries(ji.map(e=>[`package-${e}`,{action: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]="9133d39d-b2fb-5f99-8fd3-87a7d2f8df6d")}catch{}})();var el="PmCliError";function Em(e){if(!Number.isFinite(e))throw new TypeError("createPmCliExpectedError options.exitCode must be a finite number");let t=Math.trunc(e);if(t<=p.SUCCESS)throw new TypeError("createPmCliExpectedError options.exitCode must be a positive exit code");return t}function Am(e,t={}){if(typeof e!="string"||e.trim().length===0)throw new TypeError("createPmCliExpectedError message must be a non-empty string");let n=new m(e,Em(t.exitCode??p.USAGE),t.context??{});return"cause"in t&&Object.defineProperty(n,"cause",{value:t.cause,enumerable:!1,configurable:!0,writable:!0}),n}function Oo(e){if(!(e instanceof Error)||e.name!==el)return!1;let t=e;return typeof t.exitCode=="number"&&Number.isFinite(t.exitCode)}import{constants as At}from"node:fs";import{lstat as tl,mkdir as Po,open as nl}from"node:fs/promises";import ue 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]="e57a9bca-1190-5ffd-bb7d-d76a22fc9e57")}catch{}})();function $o(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship event ${t} must be non-empty`);return e.trim()}function Fo(e,t){let n=t.require(e.kind),o=n.direction==="undirected"?[e.source,e.target].sort().join("\0"):`${e.source}\0${e.target}`;return`${n.kind}\0${o}`}function Rm(e){return Object.freeze({...e,...e.payload===void 0?{}:{payload:Object.freeze(structuredClone(e.payload))}})}function Cm(e,t,n,o){let r=n.require(e.kind),i=o.outgoingOne.get(`${r.kind}\0${e.source}`);if(i!==void 0&&i!==t)throw new TypeError(`Relationship outgoing cardinality exceeded for ${r.kind}`);let s=o.incomingOne.get(`${r.kind}\0${e.target}`);if(s!==void 0&&s!==t)throw new TypeError(`Relationship incoming cardinality exceeded for ${r.kind}`);let a=Fo(e,n),c=o.identities.get(a);if(c!==void 0&&c!==t)throw new TypeError(`Relationship edge already active: ${a}`)}function Tm(e){let t=new Map;for(let n of e)n.action==="remove"?t.delete(n.relationshipId):t.set(n.relationshipId,n.edge);return t}function xm(e,t,n){if(e.expectedVersion!==void 0&&e.expectedVersion!==t)throw new TypeError(`Relationship event version conflict: expected ${e.expectedVersion}, current ${t}`);let o=$o(e.eventId,"eventId");if(n.has(o))throw new TypeError(`Relationship event already exists: ${o}`);if(e.action!=="add"&&e.action!=="remove"&&e.action!=="supersede")throw new TypeError(`Unknown relationship event action: ${e.action}`);if(!Number.isFinite(Date.parse(e.timestamp)))throw new TypeError("Relationship event timestamp must be valid");return{eventId:o,relationshipId:$o(e.relationshipId,"relationshipId"),author:$o(e.author,"author"),timestamp:new Date(e.timestamp).toISOString()}}function Om(e,t,n,o,r,i){let s=n.has(t);if(e.action==="add"&&s)throw new TypeError(`Relationship is already active: ${t}`);if(e.action!=="add"&&!s)throw new TypeError(`Relationship is not active: ${t}`);if(e.action==="remove")return;if(!e.edge)throw new TypeError(`Relationship ${e.action} event requires an edge`);let a=typeof e.edge.source=="string"?e.edge.source.trim():"",c=typeof e.edge.target=="string"?e.edge.target.trim():"";if(!o.has(a)||!o.has(c))throw new TypeError(`Relationship endpoint not found: ${a} -> ${c}`);let l=new ze([a,c],[e.edge],r).edges()[0];return Cm(l,t,r,i),Rm(l)}var Rt=class{#t;#n;#o=[];#i=new Set;#e=new Map;#r={identities:new Map,outgoingOne:new Map,incomingOne:new Map};constructor(t,n={}){this.#t=new Set([...t].filter(o=>typeof o=="string").map(o=>o.trim()).filter(Boolean)),this.#n=n.registry??Dt()}get version(){return this.#o.length}events(){return Object.freeze([...this.#o])}*stream(t={}){let n=t.fromVersion??1,o=t.toVersion??this.version,r=t.batchSize??100;if(!Number.isInteger(n)||n<1)throw new TypeError("Relationship event stream fromVersion must be positive");if(!Number.isInteger(o)||o<0||o>this.version)throw new TypeError(`Relationship event stream toVersion out of range: ${o}`);if(!Number.isInteger(r)||r<1)throw new TypeError("Relationship event stream batchSize must be positive");if(n>o+1)throw new TypeError("Relationship event stream fromVersion exceeds the selected prefix");for(let i=n-1;i<o;i+=r)yield Object.freeze(this.#o.slice(i,Math.min(i+r,o)))}project(t,n,o={}){if(typeof n!="function")throw new TypeError("Relationship event projection requires a reducer");let r=t,i=0,s;for(let a of this.stream({...o,batchSize:256}))for(let c of a)r=n(r,c),i+=1,s=c;return Object.freeze({state:r,version:s?.sequence??Math.max(0,(o.fromVersion??1)-1),processed:i,...s===void 0?{}:{asOf:s.timestamp}})}#s(t,n){let o=this.#n.require(n.kind);this.#r.identities.set(Fo(n,this.#n),t),o.outgoing==="one"&&this.#r.outgoingOne.set(`${o.kind}\0${n.source}`,t),o.incoming==="one"&&this.#r.incomingOne.set(`${o.kind}\0${n.target}`,t)}#a(t){let n=this.#n.require(t.kind);this.#r.identities.delete(Fo(t,this.#n)),n.outgoing==="one"&&this.#r.outgoingOne.delete(`${n.kind}\0${t.source}`),n.incoming==="one"&&this.#r.incomingOne.delete(`${n.kind}\0${t.target}`)}append(t){let n=xm(t,this.version,this.#i),o=this.#e.get(n.relationshipId),r=Om(t,n.relationshipId,this.#e,this.#t,this.#n,this.#r),i=Object.freeze({eventId:n.eventId,relationshipId:n.relationshipId,action:t.action,...r===void 0?{}:{edge:r},author:n.author,timestamp:n.timestamp,...t.reason?.trim()?{reason:t.reason.trim()}:{},sequence:this.version+1});return this.#o.push(i),this.#i.add(n.eventId),o&&this.#a(o),t.action==="remove"?this.#e.delete(n.relationshipId):(this.#e.set(n.relationshipId,r),this.#s(n.relationshipId,r)),i}snapshot(t={}){if(t.atVersion!==void 0&&t.atTimestamp!==void 0)throw new TypeError("Relationship snapshot accepts one target");let n;if(t.atTimestamp!==void 0){let i=Date.parse(t.atTimestamp);if(!Number.isFinite(i))throw new TypeError("Relationship snapshot timestamp must be valid");n=this.#o.filter(s=>Date.parse(s.timestamp)<=i)}else{let i=t.atVersion??this.version;if(!Number.isInteger(i)||i<0||i>this.version)throw new TypeError(`Relationship snapshot version out of range: ${i}`);n=this.#o.slice(0,i)}let o=Tm(n),r=new ze(this.#t,o.values(),this.#n);return Object.freeze({version:n.at(-1)?.sequence??0,...n.at(-1)?{asOf:n.at(-1).timestamp}:{},edges:r.edges(),graph:r})}page(t){if(!Number.isInteger(t.limit)||t.limit<1)throw new TypeError("Relationship event page limit must be positive");let n=Mi("relationship-events",{order:"append-sequence"}),o=t.cursor===void 0?this.version:Number(Li(t.cursor,n).snapshot);if(!Number.isSafeInteger(o)||o<0||o>this.version)throw new TypeError("Relationship event cursor snapshot version is invalid");let r=Di(this.#o.slice(0,o),{cursor:t.cursor,fingerprint:n,limit:t.limit,readId:i=>i.eventId,snapshot:String(o)});return{version:o,events:r.rows,hasMore:r.has_more,...r.next_cursor?{nextCursor:r.next_cursor}:{}}}},$m="relationship-event-store",ol=At.O_NOFOLLOW;function mn(e){return te(e,$m,30,`relationship-store:${process.pid}`,!1,!1,3e3)}async function De(e,t="relationships/events.jsonl"){let n=ue.resolve(e),o=ue.resolve(n,t),r=ue.relative(n,o);if(r.length===0)throw new TypeError("Relationship event path must name a file within the tracker root");if(r===".."||r.startsWith(`..${ue.sep}`)||ue.isAbsolute(r))throw new TypeError("Relationship event path must stay within the tracker root");if(await Po(n,{recursive:!0}),(await tl(n)).isSymbolicLink())throw new TypeError("Relationship event tracker root must not be a symbolic link");let s=n;for(let a of r.split(ue.sep)){s=ue.join(s,a);try{if((await tl(s)).isSymbolicLink())throw new TypeError("Relationship event path must not contain symbolic links")}catch(c){if(Tn(c))break;throw c}}return o}async function pn(e,t,n){let o=new Rt(t,{registry:n}),r,i;try{i=await nl(e,At.O_RDONLY|ol),r=await i.readFile("utf8")}catch(a){if(Tn(a))return{log:o,raw:""};throw a}finally{await i?.close()}let s=r.split(`
|
|
2
2
|
`);for(let a=0;a<s.length;a+=1){let c=s[a].trim();if(!c)continue;let l;try{l=JSON.parse(c)}catch{throw new TypeError(`Invalid relationship event JSONL at line ${a+1}`)}if(l.sequence!==o.version+1)throw new TypeError(`Invalid relationship event sequence at line ${a+1}`);o.append({eventId:l.eventId,relationshipId:l.relationshipId,action:l.action,...l.edge===void 0?{}:{edge:l.edge},author:l.author,timestamp:l.timestamp,...l.reason===void 0?{}:{reason:l.reason},expectedVersion:o.version})}return{log:o,raw:r}}function Pm(e,t,n,o){let r=Date.parse(t.timestamp),i;return t.action!=="remove"&&t.edge!==void 0&&(i=new ze(n,[t.edge],o).edges()[0]),e.eventId===t.eventId.trim()&&e.relationshipId===t.relationshipId.trim()&&e.action===t.action&&e.author===t.author.trim()&&Number.isFinite(r)&&e.timestamp===new Date(r).toISOString()&&e.reason===(t.reason?.trim()||void 0)&&pt(e.edge)===pt(i)}var un=class e{#t;#n;#o;#i;#e;constructor(t,n,o,r){this.#t=t.pmRoot,this.#n=n,this.#o=t.registry,this.#i=o,this.#e=r}static async open(t){let n=Object.freeze([...t.nodes]),o=await De(t.pmRoot,t.relativePath),r=await mn(t.pmRoot);try{await De(t.pmRoot,o);let{log:i}=await pn(o,n,t.registry);return new e(t,n,o,i)}finally{await r()}}get path(){return this.#i}async currentVersion(){return this.#e=await this.#r(),this.#e.version}async append(t){let n=await mn(this.#t);try{let o=await De(this.#t,this.#i),{log:r}=await pn(o,this.#n,this.#o),i=r.append(t);await Po(ue.dirname(o),{recursive:!0}),await De(this.#t,o);let s=await nl(o,At.O_APPEND|At.O_CREAT|At.O_WRONLY|ol);try{await s.appendFile(`${JSON.stringify(i)}
|
|
3
3
|
`,"utf8")}finally{await s.close()}return this.#e=r,i}finally{await n()}}async appendBatch(t,n={}){let o=await mn(this.#t);try{let r=await De(this.#t,this.#i),{log:i,raw:s}=await pn(r,this.#n,this.#o),a=i.version,c=new Map(i.events().map(d=>[d.eventId,d])),l=[],u=[];for(let d of t){let f=d.eventId.trim(),h=c.get(f);if(h!==void 0){if(n.existingEventPolicy==="skip_identical"&&Pm(h,d,this.#n,this.#o)){u.push(h.eventId);continue}if(n.existingEventPolicy==="skip_identical")throw new TypeError(`Relationship event id collision with different content: ${f}`)}let w=i.append(d);c.set(w.eventId,w),l.push(w)}if(l.length>0){let d=s.length===0||s.endsWith(`
|
|
4
4
|
`)?s:`${s}
|
|
@@ -2244,4 +2244,4 @@ end`}var vh={bash:'Add to ~/.bashrc or ~/.bash_profile: eval "$(pm completion ba
|
|
|
2244
2244
|
`);N(e.progressEnabled,"writing keyword artifacts"),await re(t,`${JSON.stringify(e.manifest,null,2)}
|
|
2245
2245
|
`),await re(n,`${r}
|
|
2246
2246
|
`);let i=[];if(e.mode!=="keyword")try{N(e.progressEnabled,"writing vectorization status ledger"),await ys(e.pmRoot,e.vectorizationLedgerEntries,e.vectorizationEmbeddingMetadata)}catch(s){i.push(`search_vectorization_status_ledger_write_failed:${s instanceof Error?s.message:String(s)}`)}return i}async function Bh(e,t){let n=Ah(e.mode),o=Eh(e),r=e.full===!0;N(o,`start mode=${n}`);let i=E(process.cwd(),t.path);await P(i);let s=es(await R(i)).settings,a=null;try{a=await te(i,ts,s.locks.ttl_seconds,C(void 0,"pm-reindex"),!1,s.governance.force_required_for_stale_lock,s.locks.wait_ms)}catch(c){throw c instanceof m&&c.exitCode===p.CONFLICT?new m("Another pm reindex run is already active for this project. Wait for it to finish before starting a new keyword, semantic, or hybrid reindex.",p.CONFLICT,{code:"reindex_already_running",type:"urn:pm-cli:error:reindex_already_running",why:"Semantic reindex can be expensive and duplicate runs compete for the same local embedding model and vector store.",nextSteps:["Check active pm reindex processes before starting another reindex.","Rerun with --progress when you need non-interactive visibility."]}):c}try{let c=Th(s),l=xh(s),u=Lh({requestedMode:n,pmRoot:i,settings:s,extensionEmbedding:c,extensionVectorAdapter:l}),d=n;N(o,"loading item corpus");let f=await Dh({pmRoot:i,settings:s}),h=f.warnings,{documentCandidates:w,metadataDocuments:k}=f;N(o,`loaded_items=${k.length}`);let y=S(),v=Mh(d,y,k),_=Ot.join(i,Nr),I=Ot.join(i,jr),x=d==="keyword"?await Gr(i,w,s.schema,h):k,L=[],q={},O=null,K=Fh(d);if(d==="keyword"&&await Nh({pmRoot:i,settings:s,forceFullSemantic:r,extensionEmbedding:c,reindexWarnings:h}),d!=="keyword"){let ne=await Wh({pmRoot:i,settings:s,requestedMode:n,activeEmbeddingProvider:u.activeEmbeddingProvider,activeVectorStore:u.activeVectorStore,extensionEmbedding:c,extensionVectorAdapter:l,documentCandidates:w,metadataDocuments:k,documentsForKeywordArtifacts:x,forceFullSemantic:r,reindexWarnings:h,semanticWarnings:L,semanticSummary:K,progressEnabled:o});x=ne.documentsForKeywordArtifacts,q=ne.vectorizationLedgerEntries,O=ne.vectorizationEmbeddingMetadata}let T=await Vh({pmRoot:i,mode:d,manifest:v,documentsForKeywordArtifacts:x,settings:s,vectorizationLedgerEntries:q,vectorizationEmbeddingMetadata:O,progressEnabled:o}),ee=[...await z({path:_,scope:"project",op:"reindex:manifest"}),...await z({path:I,scope:"project",op:"reindex:embeddings"}),...await ui({mode:d,total_items:k.length})];return N(o,"done"),{ok:!0,mode:d,total_items:k.length,semantic:K,artifacts:{manifest:Nr,embeddings:jr},warnings:[...h,...L,...T,...ee],generated_at:y}}finally{await a?.()}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="2a537d27-e794-5aa6-946f-4b2a3102b0ab")}catch{}})();var om=Symbol("pm.active-extension-host-context");function X(e){return{fullChangedFields:!0,options:e}}var b=class e{defaults;constructor(t={}){this.defaults={...t.pmRoot===void 0?{}:{path:t.pmRoot},...t.cwd===void 0?{}:{cwd:t.cwd},...t.author===void 0?{}:{author:t.author},...t.noExtensions===void 0?{}:{noExtensions:t.noExtensions}}}static forActiveExtensionHost(t){let n=new e({...t,noExtensions:!0});return n.defaults[om]=!0,n}run(t,n={}){return Zh({...this.defaults,...n,action:t})}runTyped(t,n={}){return this.run(t,n)}context(t={}){return this.runTyped("context",{options:t})}listAllItemMetadataLight(){return Bc(this.defaults.path,this.defaults.cwd)}list(t={}){return this.runTyped("list",{options:t})}async listAllComplete(t={}){return dn(await this.list(Co(t)))}search(t,n={}){return this.runTyped("search",{query:t,options:n})}get(t,n={}){return this.runTyped("get",{id:t,options:n})}next(t={}){return this.runTyped("next",{options:t})}aggregate(t={}){return this.runTyped("aggregate",{options:t})}stats(t={}){return this.runTyped("stats",{options:t})}duplicates(t={}){return this.runTyped("duplicates",{options:t})}comments(t,n={}){return this.runTyped("comments",{id:t,options:n})}notes(t,n={}){return this.runTyped("notes",{id:t,options:n})}learnings(t,n={}){return this.runTyped("learnings",{id:t,options:n})}files(t,n={}){return this.runTyped("files",{id:t,options:n})}filesDiscover(t,n={}){return this.runTyped("files-discover",{id:t,options:n})}filesLookup(t){return this.runTyped("files-lookup",{options:t})}docs(t,n={}){return this.runTyped("docs",{id:t,options:n})}deps(t,n={}){return this.runTyped("deps",{id:t,options:n})}graph(t,n={},o={}){return this.runTyped("graph",{subcommand:t,...n,options:o})}append(t,n,o={}){return this.runTyped("append",{id:t,...X(vt(o,{body:n}))})}init(t,n={}){return this.runTyped("init",{...t===void 0?{}:{prefix:t},options:n})}config(t,n,o,r,i={}){return this.runTyped("config",{scope:t,configAction:n,...o===void 0?{}:{key:o},...r===void 0?{}:{value:r},options:i})}schema(t,n={}){return this.runTyped("schema",{options:{...n,subcommand:t}})}workflowPolicy(t,n,o={}){return this.runTyped("schema",{name:n,options:{...o,subcommand:t}})}schemaList(){return this.runTyped("schema",{options:{subcommand:"list"}})}schemaShow(t){return this.runTyped("schema",{name:t,options:{subcommand:"show"}})}schemaAddType(t,n={}){return this.runTyped("schema",{name:t,options:{...n,subcommand:"add-type"}})}schemaRemoveType(t,n={}){return this.runTyped("schema",{name:t,options:{...n,subcommand:"remove-type"}})}schemaAddStatus(t,n={}){return this.runTyped("schema",{name:t,options:{...n,subcommand:"add-status"}})}schemaRemoveStatus(t,n={}){return this.runTyped("schema",{name:t,options:{...n,subcommand:"remove-status"}})}schemaAddField(t,n={}){return this.runTyped("schema",{name:t,options:{...n,subcommand:"add-field"}})}schemaRemoveField(t,n={}){return this.runTyped("schema",{name:t,options:{...n,subcommand:"remove-field"}})}schemaListFields(){return this.runTyped("schema",{options:{subcommand:"list-fields"}})}schemaShowField(t){return this.runTyped("schema",{name:t,options:{subcommand:"show-field"}})}schemaApplyPreset(t,n={}){return this.runTyped("schema",{typePreset:t,options:{...n,subcommand:"apply-preset"}})}schemaInferTypes(t={}){return this.runTyped("schema",{options:{...t,subcommand:"add-type",infer:!0}})}schemaRenameType(t,n,o){return this.runTyped("schema",{name:t,options:{...o,subcommand:"rename-type",to:n}})}schemaRenameField(t,n,o,r){return this.runTyped("schema",{name:t,options:{...o,subcommand:"rename-field",to:n,...r?{fieldTypeScope:r}:{}}})}schemaRemapStatus(t,n,o){return this.runTyped("schema",{name:t,options:{...o,subcommand:"remap-status",to:n}})}schemaShowStatus(t){return this.runTyped("schema",{name:t,options:{subcommand:"show-status"}})}profile(t,n={}){return this.runTyped("profile",{options:{...n,subcommand:t}})}profileList(){return this.runTyped("profile",{options:{subcommand:"list"}})}profileShow(t){return this.runTyped("profile",{name:t,options:{subcommand:"show"}})}profileApply(t,n={}){return this.runTyped("profile",{name:t,options:{...n,subcommand:"apply"}})}profileLint(t){return this.runTyped("profile",{name:t,options:{subcommand:"lint"}})}validate(t={}){return this.runTyped("validate",{options:t})}health(t={}){return this.runTyped("health",{options:t})}gc(t={}){return this.runTyped("gc",{options:t})}assurance(t){return this.runTyped("assurance",{options:{...t,subcommand:t.action}})}historyRedact(t,n){return this.runTyped("history-redact",{id:t,options:n})}historyRepair(t,n={}){return this.runTyped("history-repair",{id:t,options:n})}historyRepairAll(t={}){return this.runTyped("history-repair",{options:{...t,all:!0}})}historyAttest(t={}){return this.runTyped("history-attest",{options:t})}historyCompact(t,n={}){return this.runTyped("history-compact",{id:t,options:n})}historyCompactBulk(t){return this.runTyped("history-compact",{options:t})}historyAuthorAcknowledge(t){return this.runTyped("history-author-acknowledge",{historyEvent:(t.events??[]).map(n=>`${n.item_id}:${String(n.line)}`),allActionable:t.all_actionable===!0,dryRun:t.dry_run===!0,planFingerprint:t.plan_fingerprint,limit:t.coordinate_limit,attributedAuthor:t.attributed_author,reviewer:t.reviewer,reason:t.reason})}plan(t,n,o={},r,i){return this.runTyped("plan",{...n===void 0?{}:{id:n},...r===void 0?{}:{stepRef:r},...i===void 0?{}:{reorderTo:i},options:vt(o,{subcommand:t})})}planCreate(t){return this.plan("create",void 0,t)}planShow(t,n={}){return this.plan("show",t,n)}planAddStep(t,n){return this.plan("add-step",t,n)}planUpdateStep(t,n,o){return this.plan("update-step",t,o,n)}planCompleteStep(t,n,o={}){return this.plan("complete-step",t,o,n)}planBlockStep(t,n,o){return this.plan("block-step",t,o,n)}planReorderStep(t,n,o,r={}){return this.plan("reorder-step",t,r,n,o)}planRemoveStep(t,n,o={}){return this.plan("remove-step",t,o,n)}planLink(t,n,o){return this.plan("link",t,o,n)}planUnlink(t,n,o){return this.plan("unlink",t,o,n)}planDecision(t,n){return this.plan("decision",t,n)}planDiscovery(t,n){return this.plan("discovery",t,n)}planValidation(t,n){return this.plan("validation",t,n)}planResume(t,n){return this.plan("resume",t,n)}planApprove(t,n={}){return this.plan("approve",t,n)}planMaterialize(t,n){return this.plan("materialize",t,n)}create(t={}){return this.runTyped("create",X(t))}update(t,n={}){return this.runTyped("update",{id:t,...X(n)})}reopen(t,n,o={}){return this.runTyped("item-reopen",{id:t,reason:n,fullChangedFields:!0,options:o})}close(t,n,o={}){return this.runTyped("close",{id:t,reason:n,...X(o)})}claim(t,n={}){return this.runTyped("claim",{id:t,...X(n)})}claimNext(t={}){return this.runTyped("claim",{next:!0,...X(t)})}release(t,n={}){return this.runTyped("release",{id:t,...X(n)})}copy(t,n={}){return this.runTyped("copy",{id:t,...X(n)})}delete(t,n={}){return this.runTyped("delete",{id:t,...X(n)})}restore(t,n,o={}){return this.runTyped("restore",{fullChangedFields:!0,id:t,options:{...o,target:n}})}focus(t,n={}){return this.runTyped("focus",{...t===void 0?{}:{id:t},...X(n)})}startTask(t,n={}){return this.runTyped("start-task",{id:t,...X(n)})}pauseTask(t,n={}){return this.runTyped("pause-task",{id:t,...X(n)})}closeTask(t,n,o={}){return this.runTyped("close-task",{id:t,reason:n,...X(o)})}extension(t,n={}){return this.runTyped("extension",{...t===void 0?{}:{target:t},options:n})}extensionList(t={}){return this.extension("list",t)}extensionActivate(t,n={}){return this.runTyped("extension-activate",{target:t,options:n})}extensionDeactivate(t,n={}){return this.runTyped("extension-deactivate",{target:t,options:n})}package(t,n={}){return this.runTyped("package",{...t===void 0?{}:{target:t},options:{...n,vocabulary:"package"}})}packageList(t={}){return this.package("list",t)}packageInstall(t,n={}){return this.runTyped("package-install",{target:t,options:n})}packageUninstall(t,n={}){return this.runTyped("package-uninstall",{target:t,options:n})}packageDoctor(t={}){return this.runTyped("package-doctor",{options:t})}packageManage(t,n={}){return this.runTyped("package-manage",{...t===void 0?{}:{target:t},options:n})}packageDescribe(t,n={}){return this.runTyped("package-describe",{...t===void 0?{}:{target:t},options:n})}packageReload(t={}){return this.runTyped("package-reload",{options:t})}packageCatalog(t={}){return this.runTyped("package-catalog",{options:t})}packageActivate(t,n={}){return this.runTyped("package-activate",{target:t,options:n})}packageDeactivate(t,n={}){return this.runTyped("package-deactivate",{target:t,options:n})}packageMigrate(t={}){return this.package(void 0,{...t,migrate:!0})}upgrade(t,n={}){return this.runTyped("upgrade",{...t===void 0?{}:{target:t},options:n})}};function uA(e={},t={}){return new b(t).context(e)}function fA(e={},t={}){return new b(t).list(e)}function _A(e={},t={}){return new b(t).listAllComplete(e)}function hA(e,t={},n={}){return new b(n).search(e,t)}function gA(e,t={},n={}){return new b(n).get(e,t)}function yA(e={},t={}){return new b(t).next(e)}function bA(e={},t={}){return new b(t).aggregate(e)}function wA(e={},t={}){return new b(t).stats(e)}function vA(e={},t={}){return new b(t).duplicates(e)}function kA(e,t={},n={}){return new b(n).comments(e,t)}function SA(e,t={},n={}){return new b(n).notes(e,t)}function IA(e,t={},n={}){return new b(n).learnings(e,t)}function EA(e,t={},n={}){return new b(n).files(e,t)}function AA(e,t={},n={}){return new b(n).filesDiscover(e,t)}function RA(e,t={}){return new b(t).filesLookup(e)}function CA(e,t={},n={}){return new b(n).docs(e,t)}function TA(e,t={},n={}){return new b(n).deps(e,t)}function xA(e,t={},n={},o={}){return new b(o).graph(e,t,n)}function OA(e,t,n={},o={}){return new b(o).append(e,t,n)}function $A(e,t={},n={}){return new b(n).init(e,t)}function PA(e,t,n,o,r={},i={}){return new b(i).config(e,t,n,o,r)}function FA(e,t={},n={}){return new b(n).schema(e,t)}function MA(e={}){return new b(e).schemaList()}function LA(e,t={}){return new b(t).schemaShow(e)}function DA(e,t={},n={}){return new b(n).schemaAddType(e,t)}function NA(e,t={},n={}){return new b(n).schemaRemoveType(e,t)}function jA(e,t={},n={}){return new b(n).schemaAddStatus(e,t)}function UA(e,t={},n={}){return new b(n).schemaRemoveStatus(e,t)}function GA(e,t={},n={}){return new b(n).schemaAddField(e,t)}function qA(e,t={},n={}){return new b(n).schemaRemoveField(e,t)}function zA(e={}){return new b(e).schemaListFields()}function HA(e,t={}){return new b(t).schemaShowField(e)}function WA(e,t={},n={}){return new b(n).schemaApplyPreset(e,t)}function VA(e={},t={}){return new b(t).schemaInferTypes(e)}function BA(e,t,n,o={}){return new b(o).schemaRenameType(e,t,n)}function KA(e,t,n,o,r={}){return new b(r).schemaRenameField(e,t,n,o)}function YA(e,t,n,o={}){return new b(o).schemaRemapStatus(e,t,n)}function JA(e,t={}){return new b(t).schemaShowStatus(e)}function XA(e,t={},n={}){return new b(n).profile(e,t)}function ZA(e={}){return new b(e).profileList()}function QA(e,t={}){return new b(t).profileShow(e)}function eR(e,t={},n={}){return new b(n).profileApply(e,t)}function tR(e,t={}){return new b(t).profileLint(e)}function nR(e={},t={}){return new b(t).validate(e)}function oR(e={},t={}){return new b(t).health(e)}function rR(e={},t={}){return new b(t).gc(e)}function iR(e,t,n={}){return new b(n).historyRedact(e,t)}function sR(e,t={},n={}){return new b(n).historyRepair(e,t)}function aR(e={},t={}){return new b(t).historyRepairAll(e)}function cR(e,t={},n={}){return new b(n).historyCompact(e,t)}function lR(e,t={}){return new b(t).historyCompactBulk(e)}function dR(e={},t={}){return new b(t).create(e)}function mR(e,t={},n={}){return new b(n).update(e,t)}function pR(e,t,n={},o={}){return new b(o).reopen(e,t,n)}function uR(e,t,n={},o={}){return new b(o).close(e,t,n)}function fR(e,t={},n={}){return new b(n).claim(e,t)}function _R(e={},t={}){return new b(t).claimNext(e)}function hR(e,t={},n={}){return new b(n).release(e,t)}function gR(e,t={},n={}){return new b(n).copy(e,t)}function yR(e,t={},n={}){return new b(n).delete(e,t)}function bR(e,t,n={},o={}){return new b(o).restore(e,t,n)}function wR(e,t={},n={}){return new b(n).focus(e,t)}function vR(e,t={},n={}){return new b(n).startTask(e,t)}function kR(e,t={},n={}){return new b(n).pauseTask(e,t)}function SR(e,t,n={},o={}){return new b(o).closeTask(e,t,n)}function IR(e,t={},n={}){return new b(n).extension(e,t)}function ER(e={},t={}){return new b(t).extensionList(e)}function AR(e,t={},n={}){return new b(n).extensionActivate(e,t)}function RR(e,t={},n={}){return new b(n).extensionDeactivate(e,t)}function CR(e,t={},n={}){return new b(n).package(e,t)}function TR(e={},t={}){return new b(t).packageList(e)}function xR(e,t={},n={}){return new b(n).packageInstall(e,t)}function OR(e,t={},n={}){return new b(n).packageUninstall(e,t)}function $R(e={},t={}){return new b(t).packageDoctor(e)}function PR(e,t={},n={}){return new b(n).packageManage(e,t)}function FR(e,t={},n={}){return new b(n).packageDescribe(e,t)}function MR(e={},t={}){return new b(t).packageReload(e)}function LR(e={},t={}){return new b(t).packageCatalog(e)}function DR(e,t={},n={}){return new b(n).packageActivate(e,t)}function NR(e,t={},n={}){return new b(n).packageDeactivate(e,t)}function jR(e,t={},n={}){return new b(n).upgrade(e,t)}async function UR(e,t={}){let n=typeof e=="string"?{...t,pmRoot:e}:e??t,o={json:!0,quiet:n.quiet??!0,noExtensions:n.noExtensions??!1,noPager:!0,profile:n.profile??!1,path:n.pmRoot};return Io(n,o)}function se(e,t){let n=g(e,t);if(!n)throw new m(`Missing required argument: ${t}`,64);return n}var tm=li(),rm=new Kh;function An(){Dn(ti()),Nn(ni()),jn(oi()),Un(ri()),Gn(ii()),qn(si()),zn(ai())}async function im(e,t,n,o){return di(()=>t===void 0?tm.read(()=>nm(e,n,o)):tm.write(()=>Jh(t,()=>nm(e,n,o))))}async function GR(e,t){let n=e.cwd,o=n??process.cwd();return im(Jt({path:e.path,noExtensions:e.noExtensions}),n,o,()=>rm.run(!0,t))}async function nm(e,t,n){let o=E(t,e.path);if(e.noExtensions)return An(),Do({pmRoot:o},()=>n(null));if(!await ge(mt(o)))return An(),n(null);let r=null,i;try{let s=await R(o),a=await Nt({pmRoot:o,settings:s,cwd:t,noExtensions:!1}),c=await Ut({...a,loaded:a.loaded});i={loadResult:a,activationResult:c},Dn(c.hooks),Nn(c.commands),jn(c.parsers),Un(c.preflight),Gn(c.services),qn(c.renderers),zn(c.registrations),r={registrations:c.registrations,commands:c.commands,pmRoot:o,packages:a.loaded}}catch(s){An(),console.error("[pm-sdk] extension activation failed; continuing without active extensions:",s)}try{return await Do({pmRoot:o,packages:r?.packages},()=>n(r))}finally{An(),i&&await jt(i.loadResult,i.activationResult).catch(()=>{})}}async function Yh(e,t,n,o,r){if(!r)throw new m(`Unsupported native pm action: ${e}`,p.USAGE);let i=Oe(e),a=r.registrations.commands.find(l=>Oe(l.action)===i)?.command??r.commands.handlers.find(l=>Oe(l.command)===i)?.command;if(!a)throw new m(`Unsupported native pm action: ${e}`,p.USAGE);let c=await fi({command:oo(a),args:V(n.args??t.args),options:ro(t,n),global:o,pm_root:r.pmRoot,sdk:rl(r.pmRoot,b.forActiveExtensionHost({pmRoot:r.pmRoot,author:typeof o.author=="string"&&o.author.trim()?o.author.trim():"pm-extension"}))});if(!c.handled){let l=c.warnings.length>0?` (${c.warnings.join(", ")})`:"";throw new m(`Unsupported native pm action: ${e}${l}`,p.USAGE)}return c.result}async function Jh(e,t){let n=process.cwd();process.chdir(e);try{return await t()}finally{process.chdir(n)}}function Xh(e){let t=se(e,"action"),n=Oe(t),o=ct(xo,n),r=o?.action??n,i={...e,action:r};return o?.options!==void 0&&(i.options={...o.options,...xn(e.options)}),r==="package"&&(i.options={...xn(i.options),vocabulary:"package"}),{action:r,args:i}}async function Zh(e){let t=Xh(e),n=Jt(t.args),o=ua(t.action),r=g(t.args,"cwd"),i=r??process.cwd();t.action==="init"&&(n[Sc]=i),(t.action!=="init"||n.path!==void 0||(process.env.PM_PATH?.trim().length??0)>0)&&(n.path=E(i,n.path));try{return t.action==="history-attest"?await qr(t.action,t.args,n,null):e[om]===!0||rm.getStore()===!0?await qr(t.action,t.args,n,null):await im(n,r,i,s=>qr(t.action,t.args,n,s))}finally{o&&To()}}function ct(e,t){return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0}function Rn(e){return g(e.args,"target")??g(e.options,"target")}function U(e,t=e.options){return e.id??se(t,"id")}async function Qh(e){let t=Be("list",e.options);return t.compact===void 0&&t.brief===void 0&&t.full===void 0&&t.fields===void 0&&t.includeBody===void 0&&(t.compact=!0),Ro(await me(g(e.args,"status")??g(t,"status"),t,e.global),t)}async function eg(e){let t=se(e.args,"query"),n=Be("search",e.options,[t]);return n.compact===void 0&&n.full===void 0&&n.fields===void 0&&(n.compact=!0),Ro(await ko(t,n,e.global),n)}async function tg(e){let{changedFields:t,idOnly:n,runnerOptions:o}=G(e.args,e.options);return W(await ke(o,e.global),{changedFields:t,compactEnvelope:t==="compact"&&!n,idOnly:n})}async function ng(e){let{changedFields:t,idOnly:n,runnerOptions:o}=G(e.args,e.options),r={...o,...o.title===void 0&&typeof e.args.title=="string"?{title:e.args.title}:{},...o.message===void 0&&typeof e.args.message=="string"?{message:e.args.message}:{}};return W(await tr(U(e,r),r,e.global),{changedFields:t,compactEnvelope:t==="compact"&&!n,idOnly:n})}async function og(e){let{changedFields:t,idOnly:n,runnerOptions:o}=G(e.args,e.options);return W(await Xe(U(e,o),o,e.global),{changedFields:t,compactEnvelope:t==="compact"&&!n,idOnly:n})}function rg(e){let t=sn(e.options);return t.add===void 0&&t.stdin===void 0&&t.file===void 0&&t.edit===void 0&&t.delete===void 0&&(t.includeMeta=!0,t.limit===void 0&&t.fullHistory!==!0&&(t.limit="20")),ul(U(e),t,e.global)}function sm(e,t){return rc(Ed(e.options,t,Z),e.global)}function ig(e){let t=V(e.options.lookupPath);if(t&&t.length>0)return sm(e,t);let n=U(e);return e.options.discover===!0?co(n,no(e.options),e.global):oc(n,Xt(e.options),e.global)}function sg(e){return Gc({subcommand:g(e.args,"subcommand")??g(e.options,"subcommand"),limit:ma(e.args,e.options)},e.global)}function ag(e){let t={...e.options};return t.brief===void 0&&t.summary===void 0&&t.full===void 0&&(t.summary=!0),St(e.global,t)}function cg(e){let t=g(e.args,"configAction")??g(e.options,"configAction")??g(e.options,"action");if(t===void 0)throw new m("Missing required argument: configAction",64);let n=g(e.args,"value")??g(e.options,"value"),o=g(e.options,"policy")!==void 0&&n!==void 0?{...e.options,value:n}:e.options;return kc(g(e.args,"scope")??g(e.options,"scope")??"project",t,g(e.args,"key")??g(e.options,"key"),o,e.global,g(e.options,"policy")===void 0?n:void 0)}function lg(e){let t=e.options;return sa(ia(t),e.global)}function dg(e,t){if(typeof e=="number"){if(!Number.isFinite(e)||!Number.isInteger(e))throw new m(`${t} must be a finite integer.`,64);return e}if(typeof e=="string"&&e.trim().length>0){let n=e.trim();if(!/^[+-]?\d+(?:st|nd|rd|th)?$/i.test(n))throw new m(`${t} must be a finite integer.`,64);let o=Number.parseInt(n,10);if(!Number.isInteger(o))throw new m(`${t} must be a finite integer.`,64);return o}}function mg(e){let t=g(e.args,"subcommand")??se(e.options,"subcommand"),n=e.options;return Pl({subcommand:t,id:typeof e.id=="string"?e.id:typeof n.id=="string"?n.id:void 0,stepRef:pg(e),reorderTo:dg(n.reorderTo??e.args.reorderTo,"plan reorderTo"),options:e.options,global:e.global})}function pg(e){return typeof e.options.stepRef=="string"?e.options.stepRef:typeof e.args.stepRef=="string"?e.args.stepRef:void 0}function ug(e){let t=g(e.args,"subcommand")??se(e.options,"subcommand"),n=e.args.alias??e.options.alias;return{ctx:e,subcommand:t.trim().toLowerCase(),name:g(e.args,"name")??g(e.options,"name"),author:g(e.args,"author")??g(e.options,"author"),force:e.args.force===!0||e.options.force===!0,aliases:n===void 0?void 0:V(n)}}function fg(e){let{ctx:t,subcommand:n,name:o,author:r,force:i}=e,a=ct({list:()=>$a(t.global),show:()=>Pa(o,t.global),"show-status":()=>Fa(o,t.global),"list-fields":()=>Da(t.global),"show-field":()=>Na(o,t.global),"remove-type":()=>Ca(o,{author:r,force:i},t.global),"remove-field":()=>La(o,{author:r,force:i},t.global),"remove-status":()=>Oa(o,{author:r,force:i},t.global),"apply-preset":()=>ja(g(t.args,"typePreset")??g(t.options,"typePreset"),{author:r,force:i},t.global)},n);return a?a():null}function _g(e){let{ctx:t,name:n,author:o,force:r,aliases:i}=e,s=t.args.commands??t.options.commands,a=t.args.requiredTypes??t.options.requiredTypes;return Ma(n,{type:g(t.args,"fieldType")??g(t.options,"fieldType"),commands:s===void 0?void 0:V(s),description:g(t.args,"description")??g(t.options,"description"),cliFlag:g(t.args,"cliFlag")??g(t.options,"cliFlag"),alias:i,required:t.args.required===!0||t.options.required===!0,requiredOnCreate:t.args.requiredOnCreate===!0||t.options.requiredOnCreate===!0,allowUnset:!(t.args.allowUnset===!1||t.options.allowUnset===!1),requiredTypes:a===void 0?void 0:V(a),author:o,force:r},t.global)}function hg(e){let{ctx:t,name:n,author:o,force:r,aliases:i}=e,s=t.args.role??t.options.role;return xa(n,{role:s===void 0?void 0:V(s),alias:i,description:g(t.args,"description")??g(t.options,"description"),order:Z(t.args.order??t.options.order,"schema add-status order"),author:o,force:r},t.global)}function gg(e){let{ctx:t,name:n,author:o,force:r,aliases:i}=e;return Ra(n,{description:g(t.args,"description")??g(t.options,"description"),defaultStatus:g(t.args,"defaultStatus")??g(t.args,"default_status")??g(t.options,"defaultStatus")??g(t.options,"default_status"),folder:g(t.args,"folder")??g(t.options,"folder"),alias:i,author:o,force:r},t.global)}function yg(e){let{ctx:t,subcommand:n,name:o,author:r,force:i}=e,s=g(t.args,"to")??se(t.options,"to"),a=g(t.args,"migrationId")??g(t.args,"migration_id")??g(t.options,"migrationId")??g(t.options,"migration_id"),c=g(t.args,"fieldTypeScope")??g(t.options,"fieldTypeScope")??g(t.args,"type")??g(t.options,"type"),l=n==="rename-type"?{kind:"rename-type",from:o??"",to:s}:n==="rename-field"?{kind:"rename-field",from:o??"",to:s,...c===void 0?{}:{type:c}}:{kind:"remap-status",from:o??"",to:s};return Ea(l,{migrationId:a,dryRun:t.args.dryRun===!0||t.options.dryRun===!0,author:r,force:i},t.global)}function bg(e){let t=ug(e),n=Ht.find(r=>r===t.subcommand);if(n)return Ia(n,t.name,{definition:e.args.definition??e.options.definition,policy:g(e.args,"policy")??g(e.options,"policy"),message:g(e.args,"message")??g(e.options,"message"),author:t.author,dryRun:e.args.dryRun===!0||e.options.dryRun===!0},e.global);let o=fg(t);if(o!==null)return o;if(["rename-type","rename-field","remap-status"].includes(t.subcommand))return yg(t);if(t.subcommand==="add-field")return _g(t);if(t.subcommand==="add-status")return hg(t);if(t.subcommand==="add-type")return e.args.infer===!0||e.options.infer===!0?Ua({minCount:Z(e.args.minCount??e.options.minCount,"schema infer minCount"),apply:e.args.apply===!0||e.options.apply===!0,author:t.author,force:t.force},e.global):gg(t);throw ce({command_path:"schema",token:t.subcommand,allowed:Aa,exit_code:64})}function wg(e){let t=g(e.args,"subcommand")??se(e.options,"subcommand"),n=t.trim().toLowerCase(),o=g(e.args,"name")??g(e.options,"name"),i=ct({list:()=>_d(),show:()=>hd(o),lint:()=>gd(o),apply:()=>yd(o,{dryRun:e.args.dryRun===!0||e.options.dryRun===!0,author:g(e.args,"author")??g(e.options,"author"),force:e.args.force===!0||e.options.force===!0},e.global)},n);if(!i)throw ce({command_path:"profile",token:t,allowed:fd,exit_code:64});return i()}async function vg(e){let{changedFields:t,idOnly:n,runnerOptions:o}=G(e.args,e.options);return W(await cl(U(e,o),o,e.global),{changedFields:t,compactEnvelope:t==="compact"&&!n,idOnly:n})}async function kg(e){let{changedFields:t,runnerOptions:n}=G(e.args,e.options);return W(await wl(so(n),e.global),{changedFields:t})}async function Sg(e){let{changedFields:t,runnerOptions:n}=G(e.args,e.options),o=g(e.args,"reason"),r=o!==void 0&&n.reason===void 0?{...n,reason:o}:{...n};return e.force&&r.force===void 0&&(r.force=!0),W(await pl(io(r),e.global),{changedFields:t})}async function Ig(e){let{changedFields:t,idOnly:n,runnerOptions:o}=G(e.args,e.options),r=g(o,"target")??se(e.args,"target");return W(await Me(U(e,o),r,o,e.global),{changedFields:t,compactEnvelope:t==="compact"&&!n,idOnly:n})}function Eg(e){let t={...e.args,...e.options};return ca(se(t,"subcommand"),g(t,"id")??e.id,g(t,"target"),_a(t),e.global)}function Ag(e){return ga(E(process.cwd(),e.global.path),{...e.args,...e.options})}var am={init:e=>Ic(g(e.args,"prefix"),e.global,e.options),context:e=>uo(Be("context",e.options),e.global),next:e=>fo(Be("next",e.options),e.global),eval:Wl,events:Vl,merge:Bl,workspace:Kl,meet:gn,event:gn,remind:gn,list:Qh,get:e=>{let t=U(e);return vo(t,e.global,Be("get",e.options,[t]))},search:eg,duplicates:e=>{let t=typeof e.options.status=="string"?[e.options.status]:V(e.options.status);return Ao(e.global,{exhaustive:e.options.exhaustive===!0,...t.length===0?{}:{status:t},since:g(e.options,"since"),threshold:typeof e.options.threshold=="number"?e.options.threshold:void 0,limit:e.options.limit==="default"?void 0:Z(e.options.limit,"limit")})},create:tg,copy:ng,focus:e=>or(e.id,{clear:e.options.clear===!0||e.args.clear===!0},e.global),update:og,"item-reopen":Id,restore:Ig,claim:vd,release:Sd,"start-task":e=>je(e,"start_task"),"pause-task":e=>je(e,"pause_task"),"close-task":e=>je(e,"close_task"),close:kd,comments:rg,notes:e=>_l(U(e),sn(e.options),e.global),learnings:e=>fl(U(e),sn(e.options),e.global),files:ig,docs:e=>nc(U(e),Xt(e.options),e.global),test:e=>qc(U(e),e.options,e.global),"test-all":e=>zc(e.options,e.global),telemetry:sg,validate:e=>rn(e.options,e.global,{runUpdate:(t,n,o)=>Xe(t,n,o)}),health:ag,assurance:e=>ic(e.args,e.options,e.global),contracts:e=>Io(e.options,e.global),config:cg,activity:lg,aggregate:e=>lo(e.options,e.global),extension:e=>tn(Rn(e),e.options,e.global),package:e=>tn(Rn(e),e.options,e.global),install:e=>tn(Rn(e),{...e.options,install:!0},e.global),upgrade:e=>yc(Rn(e),e.options,e.global),delete:e=>nr(U(e),e.options,e.global),deps:e=>aa(U(e),e.options,e.global),graph:Eg,"files-discover":e=>co(U(e),e.options,e.global),"files-lookup":e=>sm(e,V(e.options.paths)),history:e=>hc(U(e),e.options,e.global),"history-redact":e=>Fc(U(e),e.options,e.global),"history-repair":bd,"history-compact":wd,"history-attest":e=>gc(e.options,e.global),"history-author-acknowledge":Ag,plan:mg,schema:bg,profile:wg,stats:e=>Eo(e.global,Ad(e.options)),append:vg,"update-many":kg,"close-many":Sg,gc:e=>bc(e.global,e.options)};function qR(e=Ui){return e.map(t=>{let n=Oe(t),o=ct(xo,n),r=o?.action??n,i=ct(am,r)!==void 0;return{action:t,resolved_action:r,covered:i,route:i?o?"alias":"native":"missing"}})}async function qr(e,t,n,o){let r=to(t,e);Gi(e,r),qi(e,r);let i={action:e,args:t,options:r,id:g(t,"id"),force:t.force===!0||r.force===!0,global:n,activeExtensions:o},s=ct(am,e),a=s?await s(i):await Yh(e,t,r,n,o);if(e==="history-attest")return a;{r.resolvedOutputFormat="json";let c=Wi(e,r,a);return await il(E(process.cwd(),n.path),c),c}}var Rg={closeManyOptionsFromFlat:io,extensionOptionsFromArgs:ro,globalOptions:Jt,mutationListOptions:fa,normalizeActionName:Oe,normalizeCommandPath:oo,normalizeMcpUpdateOptions:ha,normalizeMcpOptionsArrays:pa,optionsWithAuthor:to,readRequiredString:se,readScalarString:la,readScalarStringAllowBlank:da,readStringArray:V,updateManyOptionsFromFlat:so,withAddNoteOption:Xt,withFilesDiscoveryOptions:no,withMutationCompaction:G};(process.env.NODE_ENV==="test"||process.env.VITEST!==void 0||process.env.VITEST_WORKER_ID!==void 0)&&(globalThis.__pmCliActionRunnerTestHooks=Rg);export{el as a,Am as b,Oo as c,Rt as d,un as e,rl as f,Fg as g,Mg as h,Lg as i,Dg as j,Ng as k,Wc as l,jg as m,lm as n,mm as o,ln as p,Co as q,Kc as r,dn as s,ym as t,To as u,km as v,Lo as w,sl as x,Dm as y,jm as z,Um as A,Do as B,cl as C,pl as D,ul as E,fl as F,_l as G,wl as H,Kp as I,vl as J,Bo as K,Pl as L,tr as M,nr as N,or as O,Ml as P,Ll as Q,jl as R,ql as S,zl as T,Hl as U,nt as V,ir as W,cf as X,Ow as Y,$w as Z,cr as _,Jl as $,Kw as aa,Yw as ba,Zl as ca,td as da,fv as ea,Ef as fa,_r as ga,Rf as ha,Cf as ia,fd as ja,_d as ka,hd as la,gd as ma,yd as na,jv as oa,Uv as pa,Gv as qa,qv as ra,hr as sa,Uf as ta,Gf as ua,qf as va,j as wa,zf as xa,Hf as ya,Wf as za,Vf as Aa,br as Ba,Rd as Ca,rt as Da,yr as Ea,Cd as Fa,Bf as Ga,Td as Ha,Kf as Ia,Yf as Ja,Jf as Ka,Xf as La,Zf as Ma,i_ as Na,Pd as Oa,s_ as Pa,u_ as Qa,w_ as Ra,k_ as Sa,kh as Ta,Bh as Ua,b as Va,uA as Wa,fA as Xa,_A as Ya,hA as Za,gA as _a,yA as $a,bA as ab,wA as bb,vA as cb,kA as db,SA as eb,IA as fb,EA as gb,AA as hb,RA as ib,CA as jb,TA as kb,xA as lb,OA as mb,$A as nb,PA as ob,FA as pb,MA as qb,LA as rb,DA as sb,NA as tb,jA as ub,UA as vb,GA as wb,qA as xb,zA as yb,HA as zb,WA as Ab,VA as Bb,BA as Cb,KA as Db,YA as Eb,JA as Fb,XA as Gb,ZA as Hb,QA as Ib,eR as Jb,tR as Kb,nR as Lb,oR as Mb,rR as Nb,iR as Ob,sR as Pb,aR as Qb,cR as Rb,lR as Sb,dR as Tb,mR as Ub,pR as Vb,uR as Wb,fR as Xb,_R as Yb,hR as Zb,gR as _b,yR as $b,bR as ac,wR as bc,vR as cc,kR as dc,SR as ec,IR as fc,ER as gc,AR as hc,RR as ic,CR as jc,TR as kc,xR as lc,OR as mc,$R as nc,PR as oc,FR as pc,MR as qc,LR as rc,DR as sc,NR as tc,jR as uc,UR as vc,se as wc,GR as xc,Zh as yc,qR as zc};
|
|
2247
|
-
//# sourceMappingURL=chunk-
|
|
2247
|
+
//# sourceMappingURL=chunk-K4VAU4HU.js.map
|