@unbrained/pm-cli 2026.9.3 → 2026.9.4
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 +27 -0
- package/dist/cli-bundle/bundle-manifest.json +146 -146
- package/dist/cli-bundle/chunks/{chunk-E5RBBCXO.js → chunk-6XSKPNCF.js} +75 -75
- package/dist/cli-bundle/chunks/chunk-A24WAVE6.js +8 -0
- package/dist/cli-bundle/chunks/{chunk-DKGP3QLE.js → chunk-HI6BHPCU.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-Y4PJ6HPK.js → chunk-I2AS367G.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-IEHHE6GA.js → chunk-OGBVU67G.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-EDPIS7EB.js → chunk-RI4XNOYS.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-TXW6VL33.js +38 -0
- package/dist/cli-bundle/chunks/{chunk-LENC656S.js → chunk-V72UV7QS.js} +76 -79
- package/dist/cli-bundle/chunks/chunk-VGLHECAP.js +9 -0
- package/dist/cli-bundle/chunks/{chunk-34HASX3S.js → chunk-X6CMGV6L.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-UPPM2FOZ.js → chunk-YW4QK2G7.js} +2 -2
- package/dist/cli-bundle/chunks/{register-list-query-W2ZTOMKP.js → register-list-query-Z5YYSJJG.js} +2 -2
- package/dist/cli-bundle/chunks/{register-mutation-RVND5NCG.js → register-mutation-ELSP6I4I.js} +2 -2
- package/dist/cli-bundle/chunks/{register-operations-TTROIVC4.js → register-operations-OH7R3ZT4.js} +2 -2
- package/dist/cli-bundle/chunks/{register-setup-D3ZFHY3L.js → register-setup-E2AE72QG.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-Q45NHPF2.js → chunk-25UJBH4M.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-4HJFY4MB.js → chunk-3646BZ4W.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-TXE4TSHM.js → chunk-4YRAVI43.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-M5M6SVHS.js → chunk-53IHPICX.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-5P4HVOWG.js +176 -0
- package/dist/cli-bundle/focused-chunks/chunk-636VVQ7F.js +54 -0
- package/dist/cli-bundle/focused-chunks/{chunk-D7KXFBXV.js → chunk-6PWPQKDN.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-S27XMBIN.js → chunk-7N2TV7WZ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-5RFXUPN5.js → chunk-AJR3OP2E.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-KZ2NB3ET.js → chunk-B3A6MJYE.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-BWKHEIVF.js → chunk-BFDDJ2T2.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-4WR46RMG.js → chunk-BHUIRZWQ.js} +8 -8
- package/dist/cli-bundle/focused-chunks/{chunk-4RRHC3S4.js → chunk-JADHHPY6.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-GT7MXDLW.js → chunk-MHKUIPJW.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-NBMJD6MK.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-NSKBLHVI.js +20 -0
- package/dist/cli-bundle/focused-chunks/{chunk-OL5EH6I3.js → chunk-P2GOAOQN.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-UCLO3XDU.js → chunk-YARWJM2B.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 +1 -1
- package/dist/cli-bundle/sdk-core.js +28 -31
- 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 +42 -37
- 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 +10 -10
- package/dist/core/diagnostics/remediation.js +4 -4
- package/dist/core/history/history.d.ts +37 -1
- package/dist/core/history/history.js +278 -58
- package/dist/core/history/replay.js +68 -34
- package/dist/core/lock/lock.d.ts +10 -0
- package/dist/core/lock/lock.js +42 -3
- package/dist/core/shared/author.d.ts +3 -1
- package/dist/core/shared/author.js +111 -23
- package/dist/sdk/environment/agent-environment.d.ts +296 -0
- package/dist/sdk/environment/agent-environment.js +467 -0
- package/dist/sdk/environment/project-runtime-compatibility.d.ts +19 -1
- package/dist/sdk/environment/project-runtime-compatibility.js +118 -21
- package/dist/sdk/generated/generated-error-code-catalog-part-1.js +14 -2
- package/dist/sdk/generated/generated-error-code-catalog-part-2.js +14 -14
- package/dist/sdk/governance/health.js +13 -44
- package/dist/sdk/governance/merge-receipt-history.d.ts +62 -0
- package/dist/sdk/governance/merge-receipt-history.js +207 -0
- package/dist/sdk/governance/provenance-health.js +9 -3
- package/dist/sdk/history-compact.js +14 -5
- package/dist/sdk/history-redact.js +58 -23
- package/dist/sdk/history-repair.js +16 -6
- package/dist/sdk/index.d.ts +2 -0
- package/dist/sdk/index.js +4 -2
- package/dist/sdk/merge/driver.d.ts +3 -1
- package/dist/sdk/merge/driver.js +9 -9
- package/dist/sdk/merge/index.d.ts +1 -1
- package/dist/sdk/merge/index.js +3 -3
- package/dist/sdk/merge/receipts.d.ts +17 -6
- package/dist/sdk/merge/receipts.js +246 -75
- package/dist/sdk/merge/reconcile.d.ts +9 -7
- package/dist/sdk/merge/reconcile.js +175 -12
- package/dist/sdk/merge/three-way.d.ts +22 -2
- package/dist/sdk/merge/three-way.js +92 -25
- package/dist/sdk/runtime-primitives.d.ts +2 -2
- package/dist/sdk/runtime-primitives.js +4 -4
- package/dist/types.d.ts +25 -0
- package/dist/types.js +2 -2
- package/docs/AGENT_ENVIRONMENTS.md +47 -0
- package/docs/AGENT_PROVENANCE_ADR.md +17 -2
- package/docs/CONTEXT_INTEGRITY_CONTRACTS.md +38 -1
- package/docs/MERGE_SAFETY.md +119 -23
- package/docs/README.md +1 -0
- package/docs/SDK_CONTEXT_EVIDENCE_CONTRACTS.md +24 -2
- package/docs/SDK_RUNTIME_BOUNDARIES.md +17 -1
- package/docs/examples/sdk-agent-environment/README.md +14 -0
- package/docs/examples/sdk-agent-environment/package.json +8 -0
- package/docs/examples/sdk-agent-environment/run-agent-environment.mjs +154 -0
- package/docs/generated/REFUSAL_CLOSURE_CENSUS.md +4 -3
- 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/sdk/public-surface.json +534 -24
- package/dist/cli-bundle/chunks/chunk-AY324UJ5.js +0 -9
- package/dist/cli-bundle/chunks/chunk-L7B7343B.js +0 -8
- package/dist/cli-bundle/chunks/chunk-LISESA7W.js +0 -35
- package/dist/cli-bundle/focused-chunks/chunk-3ZBI35HU.js +0 -176
- package/dist/cli-bundle/focused-chunks/chunk-GHCZ3YFR.js +0 -20
- package/dist/cli-bundle/focused-chunks/chunk-KBLZRU62.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-QKHCSUGJ.js +0 -51
package/dist/cli-bundle/sdk.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{A as NI,B as hh,C as gh,D as LI,E as DI,a as Qi,b as es,c as ts,d as rs,e as AI,f as xI,g as Yt,h as ih,i as sh,j as ah,l as ch,m as dh,n as uh,o as lh,p as ph,q as fh,r as mh,s as _h,t as OI,u as RI,v as II,w as PI,x as MI,y as kI,z as vI}from"./chunks/chunk-EDPIS7EB.js";import{A as SP,B as EP,C as wP,D as AP,E as xP,F as OP,G as RP,H as IP,I as PP,J as MP,K as kP,L as vP,M as NP,N as LP,O as DP,P as $P,Q as FP,R as GP,S as UP,T as jP,U as BP,V as qP,W as zP,X as VP,Y as HP,a as YI,b as JI,c as ZI,d as QI,e as eP,f as tP,g as rP,h as nP,i as oP,j as iP,k as sP,l as aP,m as cP,n as dP,o as uP,p as lP,q as pP,r as fP,s as mP,t as _P,u as hP,v as gP,w as yP,x as bP,y as TP,z as CP}from"./chunks/chunk-L7B7343B.js";import{a as $I,b as FI,c as GI,d as UI}from"./chunks/chunk-UPPM2FOZ.js";import{a as jI,b as BI,c as qI,d as zI,e as VI,f as HI,g as KI,h as WI,i as XI}from"./chunks/chunk-34HASX3S.js";import{$ as Ft,$a as Xt,$b as w_,A as _A,Aa as Hf,Ab as Jm,Ac as J_,B as Xu,Ba as Kf,Bb as Zm,Bc as Z_,C as Ul,Ca as Wf,Cb as Qm,Cc as Q_,D as jl,Da as Xf,Db as e_,Dc as eh,E as Bl,Ea as Yf,Eb as t_,Ec as th,F as ql,Fa as Jf,Fb as r_,Fc as rh,G as zl,Ga as Zf,Gb as n_,Gc as nh,H as fp,Ha as Qf,Hb as o_,Hc as oh,I as Fe,Ia as em,Ib as i_,J as mp,Ja as tm,Jb as s_,K as _p,Ka as rm,Kb as a_,L as hp,La as nm,Lb as c_,M as gp,Ma as om,Mb as d_,N as yp,Na as im,Nb as u_,O as bp,Oa as sm,Ob as l_,P as BR,Pa as am,Pb as p_,Q as qR,Qa as cm,Qb as f_,R as zR,Ra as dm,Rb as m_,S as VR,Sa as um,Sb as __,T as HR,Ta as lm,Tb as h_,U as KR,Ua as pm,Ub as g_,V as WR,Va as fm,Vb as y_,W as XR,Wa as mm,Wb as b_,X as YR,Xa as _m,Xb as T_,Y as Lt,Ya as hm,Yb as C_,Z as Dt,Za as gm,Zb as S_,_ as $t,_a as ym,_b as E_,a as Ic,aa as Gt,ab as ae,ac as A_,b as Pc,ba as Ut,bb as xm,bc as x_,c as Mc,ca as jt,cb as Om,cc as O_,d as Bw,da as Bt,db as Rm,dc as R_,e as qw,ea as qt,eb as Im,ec as I_,f as vc,fa as zt,fb as Pm,fc as P_,g as Yw,ga as Vt,gb as Mm,gc as M_,h as Jw,ha as Xp,hb as km,hc as k_,i as Zw,ia as Yp,ib as vm,ic as v_,j as Qw,ja as Jp,jb as Nm,jc as N_,k as eA,ka as Zp,kb as Lm,kc as L_,l as tA,la as Qp,lb as Dm,lc as D_,m as rA,ma as Ge,mb as $m,mc as $_,n as nA,na as ef,nb as Fm,nc as F_,o as oA,oa as tf,ob as Gm,oc as G_,p as iA,pa as rf,pb as Um,pc as U_,q as sA,qa as nf,qb as jm,qc as j_,r as aA,ra as of,rb as Bm,rc as B_,s as cA,sa as sf,sb as qm,sc as q_,t as dA,ta as af,tb as zm,tc as z_,u as Fc,ua as cf,ub as Vm,uc as V_,v as uA,va as cI,vb as Hm,vc as H_,w as lA,wa as dI,wb as Km,wc as K_,x as pA,xa as uI,xb as Wm,xc as W_,y as fA,ya as lI,yb as Xm,yc as X_,z as mA,za as pI,zb as Ym,zc as Y_}from"./chunks/chunk-LENC656S.js";import{a as Nt,f as OR,g as RR,h as Sp,i as Ep}from"./chunks/chunk-Y4PJ6HPK.js";import{A as UR,B as jR,C as Np,D as Lp,E as Dp,b as Wu,c as SO,d as hR,e as TR,f as CR,g as SR,h as ER,i as wR,j as Tp,k as AR,l as Pp,m as Mp,n as kp,o as vp,p as IR,q as PR,r as MR,s as kR,t as vR,u as NR,v as LR,w as DR,x as $R,y as FR,z as GR}from"./chunks/chunk-IEHHE6GA.js";import{$a as Fu,$b as gR,$d as Tm,A as ZA,Aa as pu,Ab as tl,Ac as xR,Ad as Cf,B as QA,Ba as Gx,Bb as rl,Bc as Cp,Bd as Sf,C as ex,Ca as fu,Cb as nl,Cc as $p,Cd as Ef,D as tx,Da as mu,Db as ol,Dc as Fp,Dd as wf,E as px,Ea as _u,Eb as il,Ec as Gp,Ed as Af,Fa as hu,Fb as Nl,Fc as rI,Fd as xf,Ga as gu,Gb as Ll,Gc as nI,Gd as Of,Ha as yu,Hb as Dl,Hc as oI,Hd as Rf,Ia as bu,Ib as $l,Ic as Up,Id as If,J as Nd,Ja as Tu,Jb as iR,Jc as jp,Jd as Pf,Ka as Cu,Kb as sR,Kc as Bp,Kd as Mf,La as Su,Lb as aR,Lc as qp,Ld as kf,Ma as Eu,Mb as cR,Mc as zp,Md as vf,Na as wu,Nb as dR,Nc as Vp,Nd as Nf,Oa as Au,Ob as Fl,Oc as Hp,Od as Lf,Pa as xu,Pb as Gl,Pc as Kp,Pd as wI,Qa as Ou,Qb as uR,Qc as Wp,Qd as Df,Ra as Ru,Rb as lR,Rc as iI,Rd as $f,Sa as Iu,Sb as pR,Sc as sI,Sd as Ff,Ta as Pu,Tb as $e,Tc as aI,Td as Gf,Ua as Mu,Ub as fR,Uc as df,Ud as Uf,Va as ku,Vb as vt,Vc as fI,Vd as jf,Wa as vu,Wb as mR,Wc as Ht,Wd as Bf,Xa as Nu,Xb as _R,Xc as mI,Xd as qf,Ya as Lu,Yc as Ue,Yd as zf,Za as Du,Zb as Vl,Zc as Y,Zd as Vf,_a as $u,_b as Hl,_c as uf,_d as bm,a as xA,aa as fx,ab as Gu,ac as Kl,ae as Cm,b as OA,ba as mx,bb as Uu,bc as Wl,bd as je,be as Sm,c as RA,ca as Ld,cb as ju,cc as Xl,cd as lf,ce as Em,d as IA,da as Dd,db as Bu,dc as Yl,dd as pf,de as wm,e as PA,ea as $d,eb as qu,ec as Jl,ee as Am,f as MA,fa as Fd,fb as zu,fc as Zl,fd as se,g as kA,ga as Gd,gb as Vu,gc as Ql,gd as ff,h as vA,ha as Ud,hb as Hu,hc as ep,hd as mf,i as NA,ia as jd,ib as Ux,ic as tp,id as _f,j as LA,ja as wx,jb as jx,jc as rp,jd as hf,k as DA,ka as Ax,kb as Bx,kc as np,kd as _I,l as $A,la as xx,lb as qx,lc as op,ld as hI,m as FA,ma as Ox,mb as zx,mc as ip,md as gI,n as GA,nb as Vx,nc as sp,nd as yI,o as UA,oa as Rx,ob as Hx,oc as ap,od as bI,p as jA,pa as Ix,pb as Kx,pc as cp,pd as Kt,q as BA,qa as Px,qb as Wx,qc as dp,qd as TI,r as qA,ra as Mx,rb as Xx,rc as up,rd as CI,s as zA,sa as kx,sb as Yx,sc as yR,sd as Wt,t as VA,ta as vx,tb as Jx,tc as bR,td as SI,u as HA,ua as Nx,ub as Yu,uc as lp,ud as EI,v as KA,va as Lx,vb as Ju,w as WA,wa as Dx,wb as Zu,wd as gf,x as XA,xa as $x,xb as Qu,xd as yf,y as YA,ya as Fx,yb as el,yc as pp,yd as bf,z as JA,za as lu,zd as Tf}from"./chunks/chunk-LISESA7W.js";import{Ba as ou,Ca as iu,Da as su,Ea as au,Fa as cu,H as Yd,Ha as du,I as Jd,Ia as uu,J as Zd,Ja as wp,K as Qd,Ka as Ap,L as xt,La as xp,Na as Op,Oa as Rp,Pa as Ip,a as Ww,b as Xw,c as Nc,d as Lc,f as Dc,g as $c,h as _x,i as hx,j as gx,k as yx,l as bx,m as Tx,n as Cx,o as Sx,oa as Ot,p as Bd,pa as Rt,q as qd,qa as It,r as zd,ra as Pt,s as Vd,sa as eu,t as Hd,u as Ex,ua as tu,v as Kd,va as ru,w as Wd,wa as nu,x as Xd}from"./chunks/chunk-DKGP3QLE.js";import{$ as lx,$a as dO,$b as pl,Aa as Od,Ab as PO,Ac as oR,B as Gc,Ba as Rd,Bb as MO,Bc as JR,C as rx,Ca as Id,Cb as kO,Cc as ZR,D as nx,Da as Pd,Db as vO,Dc as QR,E as ox,Ea as Md,Eb as NO,Ec as eI,F as ix,Fa as kd,Fb as LO,Fc as tI,G as sx,Ga as vd,Gb as DO,H as ax,Hb as $O,I as cx,Ia as Zx,Ib as FO,J as dx,Ja as Qx,Jb as GO,K as ux,Ka as eO,Kb as UO,L as Uc,La as tO,Lb as jO,M as jc,Ma as rO,Mb as BO,N as Bc,Na as nO,Nb as qO,O as qc,Oa as oO,Ob as zO,P as zc,Pa as iO,Pb as VO,Q as Vc,Qa as sO,Qb as HO,R as Hc,Ra as aO,Rb as KO,S as Kc,Sa as cO,Sb as WO,T as Wc,Tb as XO,U as Xc,Ub as YO,V as Yc,Vb as JO,W as De,Wb as ZO,X as Jc,Xb as QO,Y as Zc,Yb as eR,Z as Qc,Zb as ul,_ as ed,_b as ll,a as vw,aa as td,ab as uO,ac as fl,b as Nw,ba as rd,bb as lO,bc as ml,c as Lw,ca as nd,cb as pO,cc as _l,d as Dw,da as od,db as fO,dc as Mt,e as $w,ea as id,eb as mO,ec as hl,fa as sd,fc as gl,ga as ad,gc as yl,h as Fw,ha as cd,hb as _O,hc as bl,i as Gw,ia as dd,ib as hO,ic as Tl,j as kc,ja as ud,jb as gO,jc as Cl,k as Uw,ka as ld,kb as yO,kc as Sl,l as jw,la as pd,lb as bO,lc as El,m as zw,ma as fd,mb as TO,mc as wl,n as Vw,na as md,nb as CO,nc as Al,o as Hw,oa as _d,ob as Ku,oc as xl,p as Kw,pa as hd,pb as sl,pc as Ol,q as hA,qa as gd,qb as al,qc as Rl,r as gA,ra as yd,rb as cl,rc as Il,s as yA,sa as bd,sb as dl,sc as Pl,t as bA,ta as Td,tb as EO,tc as Ml,u as TA,ua as Cd,ub as wO,uc as kt,v as CA,va as Sd,vb as AO,vc as kl,w as SA,wa as Ed,wb as xO,wc as tR,x as EA,xa as wd,xb as OO,xc as rR,y as wA,ya as Ad,yb as RO,yc as nR,z as AA,za as xd,zb as IO,zc as vl}from"./chunks/chunk-AY324UJ5.js";import{$ as Ob,$a as $n,$d as co,$e as OC,$f as fi,$g as US,$h as lE,$k as Ds,$l as Da,Ab as Zb,Ac as gT,Ae as mC,Af as Bo,Ag as mS,Ah as eE,Ai as AE,Aj as aw,Ak as Es,Al as da,Am as dc,B as hb,Bc as zn,Bd as tC,Be as Pe,Bf as qo,Bg as _S,Bh as tE,Bi as Ct,Bj as cw,Bk as ws,Bl as ua,Bm as uc,C as F,Cc as yT,Ce as _C,Cf as zo,Cg as hS,Ch as Ti,Ci as xE,Cj as dw,Ck as As,Cl as la,Cm as lc,D as gb,Dc as bT,Dd as Wn,De as Oo,Df as Me,Dg as gS,Dh as Ci,Di as OE,Dj as uw,Dk as xs,Dl as pa,Dm as pc,E as b,Ec as TT,Ed as rC,Ee as Ro,Ef as ke,Eg as yS,Eh as Si,Ei as RE,Ej as Gi,Ek as Os,El as fa,Em as fc,Fc as CT,Fd as Xn,Fe as Io,Ff as Vo,Fg as bS,Fh as Ei,Fi as IE,Fj as Ui,Fk as Rs,Fl as ma,Fm as mc,G as yb,Gc as ST,Ge as Po,Gf as Ho,Gg as TS,Gh as wi,Gj as ji,Gk as Is,Gl as _a,Gm as _c,H as bb,Hc as ET,Hd as nC,Hf as Ko,Hg as CS,Hh as Ai,Hi as PE,Hj as Bi,Hk as Ps,Hl as ha,Hm as hc,Ic as wT,Id as oC,If as Wo,Ig as SS,Ih as xi,Ii as ME,Ij as qi,Ik as Ms,Il as ga,Jc as AT,Jd as iC,Jf as Xo,Jg as ES,Jh as Oi,Ji as kE,Jj as zi,Jk as ks,Jl as ya,Jm as Le,K as Tb,Ka as Gb,Kc as Vn,Kd as Yn,Kf as Yo,Kg as wS,Kh as Ri,Ki as vE,Kk as vs,Kl as ba,Km as X,La as Ub,Lb as Qb,Lc as xT,Ld as Jn,Lf as Jo,Lg as AS,Lh as rE,Li as vi,Lj as Vi,Lk as Ns,Ll as Ta,Lm as gc,Ma as jb,Mb as Gn,Mc as Hn,Md as Zn,Me as Mo,Mf as Zo,Mg as xS,Mi as Ni,Mj as Hi,Mk as Ls,Ml as Ca,Mm as yc,N as Cb,Nb as Un,Nd as Qn,Ne as ko,Nf as Qo,Ng as OS,Nh as Ii,Ni as Li,Nj as Ki,Nk as Sw,Nl as Sa,Nm as bc,O as ht,Ob as eT,Oc as OT,Od as eo,Oe as vo,Of as ei,Og as RS,Oh as Pi,Oi as Di,Oj as Wi,Ok as Ew,Ol as Ea,Om as Tc,Pa as vn,Pb as tT,Pc as RT,Pd as to,Pf as ti,Pg as IS,Ph as Mi,Pi as $i,Pj as Xi,Pk as ve,Pl as wa,Pm as Cc,Q as gt,Qa as Bb,Qb as ie,Qc as IT,Qd as ro,Qe as hC,Qf as ri,Qg as PS,Qi as Fi,Qj as Yi,Qk as ww,Ql as Aa,Qm as Sc,R as wn,Ra as qb,Rb as rT,Rc as PT,Rd as sC,Re as gC,Rf as ni,Rg as MS,Rh as nE,Ri as NE,Rj as Ji,Rk as Aw,Rl as xa,Rm as Ec,S as An,Sa as zb,Sc as MT,Sd as aC,Se as yC,Sf as oi,Sg as kS,Sh as oE,Sj as Zi,Sk as xw,Sl as Oa,Sm as wc,T as yt,Ta as Vb,Tb as nT,Tc as Tt,Te as bC,Tf as ii,Tg as vS,Th as iE,Ti as LE,Tj as lw,Tk as wt,Tl as Ra,Tm as Ac,Uc as kT,Ud as no,Ue as TC,Uf as si,Ug as NS,Uh as sE,Ui as DE,Uj as pw,Uk as Ne,Ul as Ia,Um as xc,V as Sb,Va as Nn,Vb as oT,Vc as vT,Vd as oo,Ve as CC,Vf as ai,Vg as LS,Vh as aE,Vi as $E,Vj as fw,Vk as Ow,Vl as Pa,Vm as Oc,Wa as Ln,Wc as NT,Wd as cC,We as SC,Wf as ci,Wg as DS,Wj as mw,Wk as Rw,Wl as Ma,Wm as Rc,X as Eb,Xa as Re,Xd as io,Xe as EC,Xf as di,Xg as $S,Xh as cE,Xi as FE,Xj as _w,Xk as Iw,Xl as ka,Xm as At,Y as wb,Ya as Hb,Yc as LT,Yd as so,Ye as wC,Yf as ui,Yg as FS,Yj as hw,Yk as Pw,Yl as va,Z as Ab,Zc as DT,Zd as dC,Ze as AC,Zf as li,Zh as dE,Zj as gw,Zk as Mw,Zl as Na,_ as xb,_a as Dn,_d as ao,_e as xC,_f as pi,_g as GS,_h as uE,_i as GE,_j as yw,_k as kw,_l as La,aa as Rb,ad as Kn,ae as uo,af as RC,ag as mi,ai as pE,aj as UE,al as $s,am as $a,ba as Ib,bb as Fn,bd as $T,be as lo,bf as IC,bg as _i,bi as fE,bl as Fs,bm as Fa,c as Cn,ca as Pb,cd as FT,cf as PC,cg as hi,ch as jS,ck as Et,cl as Gs,cm as Ga,d as _t,da as Mb,dd as GT,df as MC,dg as gi,dh as BS,dk as bw,dl as Us,dm as Ua,e as oe,ea as kb,ed as UT,ef as kC,eg as HC,eh as qS,ej as jE,ek as Tw,el as js,em as ja,f as Sn,fd as jT,ff as vC,fg as KC,fh as zS,fj as BE,fk as Cw,fl as Bs,fm as Ba,g as Oe,ga as vb,gc as iT,gd as BT,gf as NC,gg as WC,gj as qE,gk as ns,gl as qs,gm as qa,h as En,ha as Nb,hc as sT,he as uC,hf as LC,hg as XC,hh as VS,hj as zE,hk as os,hl as zs,hm as za,ia as Lb,ic as aT,id as qT,ie as lC,if as DC,ig as YC,ih as yi,ij as VE,ik as is,il as Vs,im as Va,j as ub,ja as Db,jd as zT,je as pC,jf as $C,jg as JC,jh as bi,jk as ss,jl as Hs,jm as Ha,k as lb,ka as $b,kc as cT,kd as VT,ke as po,kf as FC,kg as ZC,kj as HE,kk as as,kl as Ks,km as Ka,l as pb,la as Fb,lc as dT,ld as HT,le as fo,lf as GC,lg as QC,lj as KE,lk as cs,ll as Ws,lm as Wa,ma as xn,me as mo,mf as UC,mg as eS,mi as mE,mj as WE,mk as ds,ml as Xs,mm as Xa,na as On,nc as uT,nd as KT,ne as _o,nf as jC,ng as tS,ni as _E,nj as XE,nk as us,nl as Ys,nm as Ya,oa as Rn,oc as jn,od as WT,oe as ho,of as BC,og as rS,oh as HS,oi as hE,oj as YE,ok as ls,ol as Js,om as Ja,pe as go,pf as qC,pg as nS,ph as KS,pi as gE,pj as JE,pk as ps,pl as Zs,pm as Za,qc as Bn,qd as XT,qe as yo,qf as zC,qg as oS,qh as WS,qi as yE,qj as ZE,qk as fs,ql as Qs,qm as Qa,rc as qn,rd as YT,re as bo,rf as VC,rg as iS,rh as XS,ri as bE,rj as QE,rk as ms,rl as ea,rm as ec,s as fb,sa as In,sb as Kb,sd as JT,se as To,sf as No,sg as sS,sj as ew,sk as _s,sl as ta,sm as tc,tb as Ie,td as ZT,te as Co,tf as Lo,tg as aS,th as YS,tj as tw,tk as hs,tl as ra,tm as rc,u as mb,ua as Pn,ub as bt,uc as lT,ud as QT,ue as So,uf as Do,ug as cS,uh as JS,ui as TE,uj as St,uk as gs,ul as na,um as nc,va as Mn,vb as Wb,vc as pT,vd as eC,ve as Eo,vf as $o,vg as dS,vi as CE,vj as rw,vk as ys,vl as oa,vm as oc,wa as kn,wb as Xb,wc as fT,we as wo,wf as Fo,wg as uS,wi as ki,wj as nw,wk as bs,wl as ia,wm as ic,x as _b,xb as Yb,xc as mT,xe as Ao,xf as Go,xg as lS,xi as SE,xj as ow,xk as Ts,xl as sa,xm as sc,yb as Jb,yc as _T,ye as xo,yf as Uo,yg as pS,yh as ZS,yi as EE,yj as iw,yk as Cs,yl as aa,ym as ac,zb as G,zc as hT,ze as fC,zf as jo,zg as fS,zh as QS,zi as wE,zj as sw,zk as Ss,zl as ca,zm as cc}from"./chunks/chunk-E5RBBCXO.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]="0ec82581-c626-544c-9deb-ec5e810fd7e9")}catch{}})();var U="2026-07-28",KP=["2025-11-25","2025-06-18"],Be=[U],f={headerMismatch:-32020,missingRequiredClientCapability:-32021,unsupportedProtocolVersion:-32022,invalidParams:-32602},O={clientCapabilities:"io.modelcontextprotocol/clientCapabilities",clientInfo:"io.modelcontextprotocol/clientInfo",protocolVersion:"io.modelcontextprotocol/protocolVersion",serverInfo:"io.modelcontextprotocol/serverInfo"},l=class extends Error{code;data;constructor(t,r,n={}){super(t),this.name="PmMcpProtocolError",this.code=r,this.data=n}};function _(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function yh(e){if(e===void 0)return;if(!_(e))throw new l("Invalid MCP clientInfo metadata",f.invalidParams,{field:O.clientInfo,expected:"object"});let t=typeof e.name=="string"?e.name.trim():"",r=typeof e.version=="string"?e.version.trim():"";if(t.length===0||r.length===0)throw new l("Invalid MCP clientInfo metadata",f.invalidParams,{field:O.clientInfo,required:["name","version"]});let n={name:t.slice(0,128),version:r.slice(0,128)};return typeof e.description=="string"&&e.description.trim()&&(n.description=e.description.trim().slice(0,1024)),typeof e.websiteUrl=="string"&&e.websiteUrl.trim()&&(n.websiteUrl=e.websiteUrl.trim().slice(0,2048)),n}function qe(e){let t=_(e)?e._meta:void 0;if(!_(t))throw new l("Missing required MCP request metadata",f.invalidParams,{required:[O.protocolVersion,O.clientCapabilities]});let r=t[O.protocolVersion];if(typeof r!="string"||!Be.includes(r))throw new l("Unsupported protocol version",f.unsupportedProtocolVersion,{supported:[...Be],requested:typeof r=="string"?r:null});let n=t[O.clientCapabilities];if(!_(n))throw new l("Invalid MCP client capabilities metadata",f.invalidParams,{field:O.clientCapabilities,expected:"object"});let o=yh(t[O.clientInfo]);return{protocolVersion:U,clientCapabilities:n,...o?{clientInfo:o}:{}}}function WP(e,t){if(t!==e.protocolVersion)throw new l("MCP protocol header does not match request metadata",f.headerMismatch,{header:t??null,metadata:e.protocolVersion})}function XP(e,t){let r=t.filter(n=>!Object.prototype.hasOwnProperty.call(e.clientCapabilities,n));if(r.length>0)throw new l("Missing required client capability",f.missingRequiredClientCapability,{requiredCapabilities:Object.fromEntries(r.map(n=>[n,{}]))})}function YP(e,t){let r=e.clientCapabilities.extensions;return _(r)&&_(r[t])}function ze(e,t){let r=_(e._meta)?e._meta:{};return{...e,_meta:{...r,[O.serverInfo]:{...t}}}}function bh(e,t){return ze({...e,resultType:"complete"},t)}function JP(e){let t=e.ttlMs??6e4;if(!Number.isFinite(t)||t<0)throw new l("Invalid MCP discovery cache TTL",f.invalidParams,{ttlMs:t});return bh({supportedVersions:[...Be],capabilities:structuredClone(e.capabilities),ttlMs:t,cacheScope:"public",...e.instructions?{instructions:e.instructions}:{}},e.serverInfo)}function ZP(e,t){if(_(e)&&typeof e.resultType=="string")return e.resultType;if(t==="legacy")return"complete";throw new l("Modern MCP result is missing resultType",f.invalidParams,{required:"resultType"})}import{createHash as Qt,createHmac as er,timingSafeEqual as Th}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]="469f704b-12eb-524d-bcc8-fb8f9f1775f2")}catch{}})();var Ch=["elicitation/create","roots/list","sampling/createMessage"],Jt=class extends Error{inputRequests;requestState;constructor(t){super("MCP operation requires additional input"),this.name="PmMcpInputRequiredError",this.inputRequests=t.inputRequests,this.requestState=t.requestState}},tr=/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/u,ce=32,He=64*1024,de=16*1024,Ve={maxBytes:256*1024,maxDepth:32,maxNodes:4096};function Sh(e){return e==="elicitation/create"?"elicitation":e==="sampling/createMessage"?"sampling":"roots"}function ue(e,t,r){let n;try{n=JSON.stringify(e)}catch{throw new l(`Invalid ${r}: value is not JSON serializable`,f.invalidParams,{field:r})}if(Buffer.byteLength(n,"utf8")>t)throw new l(`Invalid ${r}: payload exceeds the protocol bound`,f.invalidParams,{field:r,maximumBytes:t})}function Ke(e,t){if(!_(e))throw new l("Invalid MCP inputRequests",f.invalidParams,{field:"inputRequests",expected:"object"});let r=Object.entries(e);if(r.length===0||r.length>ce)throw new l("Invalid MCP inputRequests count",f.invalidParams,{minimum:1,maximum:ce,observed:r.length});let n={};for(let[o,i]of r){if(!tr.test(o)||!_(i))throw new l("Invalid MCP input request entry",f.invalidParams,{field:`inputRequests.${o}`});let s=i.method;if(typeof s!="string"||!Ch.includes(s))throw new l("Unsupported MCP input request method",f.invalidParams,{field:`inputRequests.${o}.method`,method:s??null});let a=Sh(s);if(!Object.prototype.hasOwnProperty.call(t.clientCapabilities,a))throw new l("Missing required client capability",f.missingRequiredClientCapability,{requiredCapabilities:{[a]:{}}});if(!_(i.params))throw new l("Invalid MCP input request parameters",f.invalidParams,{field:`inputRequests.${o}.params`,expected:"object"});n[o]={method:s,params:structuredClone(i.params)}}return ue(n,He,"inputRequests"),n}function rr(e){if(!_(e))throw new l("Invalid MCP inputResponses",f.invalidParams,{field:"inputResponses",expected:"object"});let t=Object.entries(e);if(t.length>ce)throw new l("Invalid MCP inputResponses count",f.invalidParams,{maximum:ce,observed:t.length});let r={};for(let[n,o]of t){if(!tr.test(n)||!_(o))throw new l("Invalid MCP input response entry",f.invalidParams,{field:`inputResponses.${n}`});r[n]=structuredClone(o)}return ue(r,He,"inputResponses"),r}function rM(e){let t=e.requestState?.trim();if(t&&Buffer.byteLength(t,"utf8")>de)throw new l("Invalid MCP requestState: payload exceeds the protocol bound",f.invalidParams,{field:"requestState",maximumBytes:de});let r=e.inputRequests===void 0?void 0:Ke(e.inputRequests,e.requestContext);if(r===void 0&&!t)throw new l("InputRequiredResult requires inputRequests or requestState",f.invalidParams,{requiredAnyOf:["inputRequests","requestState"]});return{resultType:"input_required",...r?{inputRequests:r}:{},...t?{requestState:t}:{},_meta:{[O.serverInfo]:{...e.serverInfo}}}}function nr(e){let t=Buffer.from(e);if(t.byteLength<32)throw new l("MCP requestState signing key must contain at least 32 bytes",f.invalidParams,{minimumBytes:32});return t}function nM(e,t){if(!Number.isSafeInteger(e.expiresAt)||e.expiresAt<=0||e.method.trim().length===0||e.parameterDigest.trim().length===0||e.principal.trim().length===0)throw new l("Invalid MCP requestState payload",f.invalidParams);let r=Buffer.from(JSON.stringify({version:1,...e}),"utf8");if(r.byteLength>de/2)throw new l("MCP requestState payload exceeds the protocol bound",f.invalidParams,{maximumBytes:de/2});let n=r.toString("base64url"),o=er("sha256",nr(t)).update(n).digest("base64url");return`${n}.${o}`}function Eh(e){if(!_(e)||e.version!==1)throw new l("Invalid MCP requestState payload",f.invalidParams,{field:"requestState"});let{expiresAt:t,method:r,parameterDigest:n,principal:o,state:i}=e;if(typeof t!="number"||!Number.isSafeInteger(t))throw new l("Invalid MCP requestState payload",f.invalidParams,{field:"requestState"});if(typeof r!="string"||typeof n!="string"||typeof o!="string")throw new l("Invalid MCP requestState payload",f.invalidParams,{field:"requestState"});return{expiresAt:t,method:r,parameterDigest:n,principal:o,state:i}}function oM(e,t,r){let[n,o,i]=e.split(".");if(!n||!o||i!==void 0)throw new l("Invalid MCP requestState encoding",f.invalidParams,{field:"requestState"});let s=Buffer.from(o,"base64url"),a=er("sha256",nr(t)).update(n).digest();if(s.byteLength!==a.byteLength||!Th(s,a))throw new l("Invalid MCP requestState signature",f.invalidParams,{field:"requestState"});let c;try{c=JSON.parse(Buffer.from(n,"base64url").toString("utf8"))}catch{c=null}let d=Eh(c),{expiresAt:u,method:p,parameterDigest:m,principal:y}=d;if(u<(r.nowMs??Date.now()))throw new l("Expired MCP requestState",f.invalidParams,{field:"requestState",expiredAt:u});if(p!==r.method||m!==r.parameterDigest||y!==r.principal)throw new l("MCP requestState binding mismatch",f.invalidParams,{field:"requestState"});return d}function iM(e){return ue(e,He,"request parameters"),Qt("sha256").update(JSON.stringify(e)).digest("hex")}var Zt=class{#e=new Set;#t;constructor(t=4096){if(!Number.isSafeInteger(t)||t<1)throw new l("Invalid MCP replay guard capacity",f.invalidParams,{maximumEntries:t});this.#t=t}consume(t){let r=Qt("sha256").update(t).digest("hex");if(this.#e.has(r))throw new l("MCP requestState replay detected",f.invalidParams,{field:"requestState"});if(this.#e.size>=this.#t){let n=this.#e.values().next().value;this.#e.delete(n)}this.#e.add(r)}};function wh(e){if(!Number.isSafeInteger(e.ttlMs)||e.ttlMs<0||e.cacheScope!=="public"&&e.cacheScope!=="private")throw new l("Invalid MCP cache policy",f.invalidParams,{ttlMs:e.ttlMs,cacheScope:e.cacheScope});return{ttlMs:e.ttlMs,cacheScope:e.cacheScope}}function sM(e,t){return{...e,...wh(t)}}function Ah(e){return e.replaceAll("~1","/").replaceAll("~0","~")}function xh(e,t){if(t==="#")return e;if(!t.startsWith("#/"))return;let r=e;for(let n of t.slice(2).split("/").map(Ah)){if(!_(r)&&!Array.isArray(r)||!Object.prototype.hasOwnProperty.call(r,n))return;r=r[n]}return r}function Oh(e){let t=e.maxBytes??Ve.maxBytes,r=e.maxDepth??Ve.maxDepth,n=e.maxNodes??Ve.maxNodes;if(!Number.isSafeInteger(t)||t<2)throw new l("Invalid MCP JSON Schema work bounds",f.invalidParams);if(!Number.isSafeInteger(r)||r<1)throw new l("Invalid MCP JSON Schema work bounds",f.invalidParams);if(!Number.isSafeInteger(n)||n<1)throw new l("Invalid MCP JSON Schema work bounds",f.invalidParams);return{maximumBytes:t,maximumDepth:r,maximumNodes:n}}function Rh(e,t){let r=Array.isArray(e.value)?e.value:_(e.value)?Object.values(e.value):[];for(let n of r)t.push({value:n,depth:e.depth+1})}function Ih(e,t){if(!_(t)||typeof t.$ref!="string")return;let r=t.$ref;if(r.startsWith("#")&&xh(e,r)===void 0)throw new l("MCP JSON Schema contains an unresolved local reference",f.invalidParams,{reference:r})}function aM(e,t={}){let{maximumBytes:r,maximumDepth:n,maximumNodes:o}=Oh(t);if(typeof e!="boolean"&&!_(e))throw new l("Invalid MCP JSON Schema root",f.invalidParams,{expected:"object or boolean"});ue(e,r,"JSON Schema");let i=[{value:e,depth:0}],s=0;for(;i.length>0;){let a=i.pop();if(s+=1,s>o||a.depth>n)throw new l("MCP JSON Schema exceeds validation work bounds",f.invalidParams,{maximumDepth:n,maximumNodes:o});Ih(e,a.value),Rh(a,i)}return structuredClone(e)}import{randomUUID as Ph}from"node:crypto";import{readFile as Mh}from"node:fs/promises";import or 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]="1774674f-4d33-5a24-9d97-522c55b861c0")}catch{}})();var _M="io.modelcontextprotocol/tasks",kh=["working","input_required","completed","failed","cancelled"],vh=/^mcp-task-[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/iu,Nh=3600*1e3,Lh=1e3,pe=1024,Dh=30,$h=2e3;function We(e){return new l(e,f.invalidParams,{code:"mcp_task_not_found_or_not_authorized"})}function le(e){let t=e.trim();if(!vh.test(t))throw We("Unknown MCP task");return t}function ir(e,t){if(typeof e!="string"||!Number.isFinite(Date.parse(e)))throw new l("Corrupt MCP task record",f.invalidParams,{field:t});return e}function sr(e){if(!_(e)||typeof e.code!="number"||!Number.isFinite(e.code)||typeof e.message!="string")throw new l("Corrupt MCP task error",f.invalidParams);return{code:e.code,message:e.message.slice(0,pe),..._(e.data)?{data:structuredClone(e.data)}:{}}}function Fh(e){if(!kh.includes(e))throw new l("Corrupt MCP task record",f.invalidParams);return e}function Gh(e){if(typeof e!="string"||e.length===0)throw new l("Corrupt MCP task record",f.invalidParams);return e}function Uh(e){if(typeof e!="number"||!Number.isSafeInteger(e)||e<1)throw new l("Corrupt MCP task record",f.invalidParams);return e}function jh(e){if(e!==null&&(typeof e!="number"||!Number.isSafeInteger(e)||e<0))throw new l("Corrupt MCP task record",f.invalidParams);return e}function Bh(e){if(e!==void 0){if(typeof e!="number"||!Number.isSafeInteger(e)||e<0)throw new l("Corrupt MCP task record",f.invalidParams);return e}}function qh(e){if(!Array.isArray(e)||e.some(t=>typeof t!="string"))throw new l("Corrupt MCP task record",f.invalidParams);return[...e]}function zh(e){if(!_(e)||e.version!==1)throw new l("Corrupt MCP task record",f.invalidParams);let t=typeof e.taskId=="string"?le(e.taskId):"",r=Fh(e.status),n=Gh(e.principal),o=Uh(e.workerPid),i=jh(e.ttlMs),s=Bh(e.pollIntervalMs),a={version:1,taskId:t,status:r,principal:n,workerPid:o,createdAt:ir(e.createdAt,"createdAt"),lastUpdatedAt:ir(e.lastUpdatedAt,"lastUpdatedAt"),ttlMs:i,consumedInputKeys:qh(e.consumedInputKeys),...typeof e.statusMessage=="string"?{statusMessage:e.statusMessage.slice(0,pe)}:{},...typeof s=="number"?{pollIntervalMs:s}:{}};if(_(e.inputRequests)&&(a.inputRequests=structuredClone(e.inputRequests)),_(e.inputResponses)&&(a.inputResponses=structuredClone(e.inputResponses)),_(e.result)&&(a.result=structuredClone(e.result)),e.error!==void 0&&(a.error=sr(e.error)),a.status==="input_required"&&!a.inputRequests||a.status==="completed"&&!a.result||a.status==="failed"&&!a.error)throw new l("Corrupt MCP task status payload",f.invalidParams,{status:a.status});return a}function j(e){let t={taskId:e.taskId,status:e.status,createdAt:e.createdAt,lastUpdatedAt:e.lastUpdatedAt,ttlMs:e.ttlMs,...e.statusMessage?{statusMessage:e.statusMessage}:{},...e.pollIntervalMs===void 0?{}:{pollIntervalMs:e.pollIntervalMs}};return e.status==="input_required"?{...t,status:"input_required",inputRequests:structuredClone(e.inputRequests)}:e.status==="completed"?{...t,status:"completed",result:structuredClone(e.result)}:e.status==="failed"?{...t,status:"failed",error:structuredClone(e.error)}:e.status==="cancelled"?{...t,status:"cancelled"}:{...t,status:"working"}}function J(e){return e==="completed"||e==="failed"||e==="cancelled"}function Vh(e){try{return process.kill(e,0),!0}catch(t){return!(typeof t=="object"&&t!==null&&"code"in t&&t.code==="ESRCH")}}var Xe=class{#e;#t;#r;#n;#i;constructor(t){this.#e=or.resolve(t.pmRoot),this.#t=t.owner?.trim()||"pm-mcp",this.#r=t.now??(()=>new Date),this.#n=t.taskIdFactory??(()=>`mcp-task-${Ph()}`),this.#i=t.workerPid??process.pid}#s(t){return or.join(this.#e,"runtime","mcp-tasks","records",`${le(t)}.json`)}async#c(t){try{return zh(JSON.parse(await Mh(this.#s(t),"utf8")))}catch(r){throw oe(r)||r instanceof SyntaxError?We("Unknown MCP task"):r}}async#a(t){await Oe(this.#s(t.taskId),`${JSON.stringify(t,null,2)}
|
|
2
|
-
`)}async#o(t,r,n){let o=le(t),i=await Pe(this.#e,o,Dh,this.#t,!1,!1,$h);try{let s=await this.#c(o);if(s.principal!==r)throw We("Unknown MCP task");let a=n(s);return await this.#a(a),a}finally{await i()}}async create(t){let r=le(this.#n()),n=t.principal.trim(),o=t.ttlMs===void 0?Nh:t.ttlMs,i=t.pollIntervalMs??Lh;if(n.length===0||o!==null&&(!Number.isSafeInteger(o)||o<0)||!Number.isSafeInteger(i)||i<0)throw new l("Invalid MCP task creation options",f.invalidParams);let s=this.#r().toISOString(),a={version:1,taskId:r,status:"working",createdAt:s,lastUpdatedAt:s,ttlMs:o,pollIntervalMs:i,principal:n,workerPid:this.#i,consumedInputKeys:[],...t.statusMessage?.trim()?{statusMessage:t.statusMessage.trim().slice(0,pe)}:{}};return await this.#a(a),{...j(a),resultType:"task"}}async get(t,r){return j(await this.#o(t,r,n=>{if(J(n.status))return n;let o=this.#r().getTime(),i=n.ttlMs!==null&&Date.parse(n.createdAt)+n.ttlMs<=o,s=n.workerPid!==this.#i&&!Vh(n.workerPid);return!i&&!s?n:{...n,status:"failed",statusMessage:i?"Task retention expired before completion.":"Task worker ended before recording a terminal result.",lastUpdatedAt:this.#r().toISOString(),error:{code:-32603,message:i?"MCP task expired":"MCP task worker unavailable after restart",data:{recoverable:!1,createNewTask:!0}},inputRequests:void 0}}))}async requireInput(t){let r=Ke(t.inputRequests,t.requestContext);return j(await this.#o(t.taskId,t.principal,n=>{if(J(n.status))return n;let o=Object.keys(r).filter(i=>n.consumedInputKeys.includes(i));if(o.length>0)throw new l("MCP task input request keys must be unique for the task lifetime",f.invalidParams,{reused:o});return{...n,status:"input_required",statusMessage:t.statusMessage?.trim().slice(0,pe),lastUpdatedAt:this.#r().toISOString(),inputRequests:r}}))}async update(t,r,n){let o=rr(n),i=[],s=[];return await this.#o(t,r,a=>{if(a.status!=="input_required"||!a.inputRequests)return a;let c={...a.inputRequests},d=a.inputResponses?{...a.inputResponses}:{};for(let[u,p]of Object.entries(o))Object.prototype.hasOwnProperty.call(c,u)&&(d[u]=p,delete c[u],i.push(u));return s=Object.keys(c).sort(),i.length===0?a:{...a,status:s.length===0?"working":"input_required",lastUpdatedAt:this.#r().toISOString(),inputRequests:s.length===0?void 0:c,inputResponses:d,consumedInputKeys:[...new Set([...a.consumedInputKeys,...i])].sort()}}),{acceptedKeys:i.sort(),remainingKeys:s}}async takeInputResponses(t,r){let n={};return await this.#o(t,r,o=>(n=structuredClone(o.inputResponses??{}),Object.keys(n).length===0?o:{...o,inputResponses:void 0})),n}async complete(t,r,n){return j(await this.#o(t,r,o=>J(o.status)?o:{...o,status:"completed",statusMessage:"Task completed.",lastUpdatedAt:this.#r().toISOString(),result:structuredClone(n),inputRequests:void 0,error:void 0}))}async fail(t,r,n){let o=sr(n);return j(await this.#o(t,r,i=>J(i.status)?i:{...i,status:"failed",statusMessage:o.message,lastUpdatedAt:this.#r().toISOString(),error:o,inputRequests:void 0,result:void 0}))}async cancel(t,r){return j(await this.#o(t,r,n=>J(n.status)?n:{...n,status:"cancelled",statusMessage:"Task cancelled by the client.",lastUpdatedAt:this.#r().toISOString(),inputRequests:void 0,result:void 0,error:void 0}))}};function hM(e){return new Xe(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]="cb791784-bde2-5b1d-b5df-038282816043")}catch{}})();var fe="io.modelcontextprotocol/subscriptionId",ar=256,cr=2048,Hh=5e3;function Kh(e,t){return new Promise((r,n)=>{let o=setTimeout(()=>n(new Error("MCP subscription sink write timed out")),Hh);o.unref(),Promise.resolve().then(()=>e(t)).then(()=>{clearTimeout(o),r()},i=>{clearTimeout(o),n(i instanceof Error?i:new Error(String(i)))})})}function Ye(e,t){if(e!==void 0){if(typeof e!="boolean")throw new l("Invalid MCP subscription filter",f.invalidParams,{field:`notifications.${t}`,expected:"boolean"});return e||void 0}}function Wh(e){if(!_(e))throw new l("Invalid MCP subscription filter",f.invalidParams,{field:"notifications",expected:"object"});let t=Ye(e.toolsListChanged,"toolsListChanged"),r=Ye(e.promptsListChanged,"promptsListChanged"),n=Ye(e.resourcesListChanged,"resourcesListChanged"),o;if(e.resourceSubscriptions!==void 0){if(!Array.isArray(e.resourceSubscriptions)||e.resourceSubscriptions.length>ar)throw new l("Invalid MCP resource subscriptions",f.invalidParams,{field:"notifications.resourceSubscriptions",maximum:ar});let i=new Set;for(let s of e.resourceSubscriptions){if(typeof s!="string"||s.trim().length===0||Buffer.byteLength(s,"utf8")>cr)throw new l("Invalid MCP resource subscription URI",f.invalidParams,{field:"notifications.resourceSubscriptions",maximumBytes:cr});i.add(s)}i.size>0&&(o=[...i].sort())}return{...t?{toolsListChanged:t}:{},...r?{promptsListChanged:r}:{},...n?{resourcesListChanged:n}:{},...o?{resourceSubscriptions:o}:{}}}function Xh(e,t){return{...e.toolsListChanged&&t.tools?.listChanged?{toolsListChanged:!0}:{},...e.promptsListChanged&&t.prompts?.listChanged?{promptsListChanged:!0}:{},...e.resourcesListChanged&&t.resources?.listChanged?{resourcesListChanged:!0}:{},...e.resourceSubscriptions&&t.resources?.subscribe?{resourceSubscriptions:[...e.resourceSubscriptions]}:{}}}var dr=class{#e;#t=new Map;#r;constructor(t){this.#e=structuredClone(t.capabilities),this.#r={...t.serverInfo}}get size(){return this.#t.size}async open(t){if(this.#t.has(t.id))throw new l("MCP subscription id is already active",f.invalidParams,{subscriptionId:t.id});let r=Xh(Wh(t.notifications),this.#e),n={filter:r,sink:t.sink,writeQueue:Promise.resolve()};this.#t.set(t.id,n);try{await this.#n(t.id,n,{jsonrpc:"2.0",method:"notifications/subscriptions/acknowledged",params:{_meta:{[fe]:t.id},notifications:structuredClone(r)}},!0)}catch(o){throw this.#t.delete(t.id),o}return structuredClone(r)}async emitListChanged(t){let r=`${t}ListChanged`,n=`notifications/${t}/list_changed`,o=[];for(let[i,s]of this.#t)s.filter[r]===!0&&o.push(this.#n(i,s,{jsonrpc:"2.0",method:n,params:{_meta:{[fe]:i}}}));return(await Promise.all(o)).filter(Boolean).length}async emitResourceUpdated(t){let r=[];for(let[n,o]of this.#t)o.filter.resourceSubscriptions?.includes(t)&&r.push(this.#n(n,o,{jsonrpc:"2.0",method:"notifications/resources/updated",params:{_meta:{[fe]:n},uri:t}}));return(await Promise.all(r)).filter(Boolean).length}async#n(t,r,n,o=!1){let i=r.writeQueue.then(async()=>{if(this.#t.get(t)!==r)return!1;try{return await Kh(r.sink,n),!0}catch(s){if(this.#t.get(t)===r&&this.#t.delete(t),o)throw s;return!1}});return r.writeQueue=i.then(()=>{},()=>{}),i}close(t){if(this.#t.delete(t))return{...ze({resultType:"complete",_meta:{[fe]:t}},this.#r)}}closeAll(){let t=[];for(let r of this.#t.keys()){let n=this.close(r);t.push({id:r,result:n})}return t}};(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="5ffe7128-0fbb-59af-89ef-74d5d799a00d")}catch{}})();var ur=/^=\?base64\?([A-Za-z0-9+/]*={0,2})\?=$/u,Yh=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/u,lr=/^[\t\x20-\x7E]*$/u,pr=new Set(["prompts/get","resources/read","tools/call"]);function Jh(e){let t=new Map;for(let[r,n]of Object.entries(e)){if(n===void 0)continue;let o=typeof n=="string"?n:n.join(", ");t.set(r.toLowerCase(),o)}return t}function A(e,t){throw new l(e,f.headerMismatch,{header:t})}function fr(e){let t=typeof e=="boolean"?String(e).toLowerCase():String(e);return t.length>0&&t.trim()===t&&lr.test(t)&&!ur.test(t)?t:`=?base64?${Buffer.from(t,"utf8").toString("base64")}?=`}function mr(e,t){let r=ur.exec(e);if(r){let n=r[1],o=Buffer.from(n,"base64");return o.toString("base64")!==n||o.length===0?A("Malformed MCP Base64 header value",t):o.toString("utf8")}return e.length===0||e.trim()!==e||!lr.test(e)?A("Malformed MCP header value",t):e}function me(e){return Array.isArray(e)?e.some(me):_(e)?Object.prototype.hasOwnProperty.call(e,"x-mcp-header")||Object.values(e).some(me):!1}function Zh(e,t,r){let n=e["x-mcp-header"];if(n===void 0)return;let o=e.type;if(typeof n!="string"||!Yh.test(n)||!["boolean","integer","string"].includes(String(o))||r.has(n.toLowerCase()))throw new l("Invalid MCP x-mcp-header annotation",f.invalidParams,{field:t.join("."),annotation:n});return r.add(n.toLowerCase()),{name:n,path:t,type:o}}function _r(e){if(!_(e))throw new l("Invalid MCP tool schema",f.invalidParams,{field:"inputSchema",expected:"object"});let t=[],r=new Set,n=(o,i)=>{let s=o.properties;if(s!==void 0){if(!_(s))throw new l("Invalid MCP tool schema properties",f.invalidParams,{field:"inputSchema.properties"});for(let[a,c]of Object.entries(s)){if(!_(c))continue;let d=[...i,a],u=Zh(c,d,r);u&&t.push(u);for(let[p,m]of Object.entries(c))if(p!=="properties"&&p!=="x-mcp-header"&&me(m))throw new l("MCP x-mcp-header is not statically reachable",f.invalidParams,{field:d.join("."),keyword:p});n(c,d)}}};for(let[o,i]of Object.entries(e))if(o!=="properties"&&me(i))throw new l("MCP x-mcp-header is not statically reachable",f.invalidParams,{field:"inputSchema",keyword:o});return n(e,[]),t}function hr(e,t){let r=e;for(let n of t){if(!_(r))return;r=r[n]}return r}function gr(e,t){let r=e==="resources/read"?t.uri:t.name;return typeof r=="string"?r:void 0}function Qh(e,t){let r=_(e.arguments)?e.arguments:{},n={};for(let o of _r(t)){let i=hr(r,o.path);if(i==null)continue;if(!(o.type==="integer"&&typeof i=="number"&&Number.isSafeInteger(i)||o.type==="boolean"&&typeof i=="boolean"||o.type==="string"&&typeof i=="string"))throw new l("Invalid MCP custom header argument",f.invalidParams,{field:o.path.join("."),expected:o.type});n[`Mcp-Param-${o.name}`]=fr(i)}return n}function CM(e){let t=_(e.request.params)?e.request.params:void 0,r=qe(t),n=e.request.method;if(typeof n!="string"||n.length===0)return A("Missing MCP request method","Mcp-Method");let o={Accept:"application/json, text/event-stream","Content-Type":"application/json","MCP-Protocol-Version":r.protocolVersion,"Mcp-Method":n},i=gr(n,t);if(pr.has(n)){if(i===void 0)return A("Missing MCP request name","Mcp-Name");o["Mcp-Name"]=fr(i)}return n==="tools/call"&&e.toolSchema!==void 0&&Object.assign(o,Qh(t,e.toolSchema)),o}function eg(e,t){let r=t.method;(typeof r!="string"||r.length===0)&&A("Missing MCP request method","Mcp-Method");let n=_(t.params)?t.params:void 0,o=qe(n).protocolVersion;if(e.get("mcp-protocol-version")!==o&&A("MCP protocol header does not match request metadata","MCP-Protocol-Version"),e.get("mcp-method")!==r&&A("MCP method header does not match request body","Mcp-Method"),pr.has(r)){let i=e.get("mcp-name"),s=gr(r,n);(i===void 0||s===void 0||mr(i,"Mcp-Name")!==s)&&A("MCP name header does not match request body","Mcp-Name")}e.has("last-event-id")&&A("MCP SSE resumability is not supported","Last-Event-ID")}function tg(e,t,r){return e.type==="integer"?typeof t=="number"&&Number.isSafeInteger(t)&&Number(r)===t:e.type==="boolean"?typeof t=="boolean"&&r===String(t):typeof t=="string"&&r===t}function rg(e){let t=_(e.params.arguments)?e.params.arguments:{};for(let r of _r(e.toolSchema)){let n=hr(t,r.path),o=`Mcp-Param-${r.name}`,i=e.headers.get(o.toLowerCase());if(n==null){i!==void 0&&A("Unexpected MCP parameter header",o);continue}i===void 0&&A("Missing MCP parameter header",o),tg(r,n,mr(i,o))||A("MCP parameter header does not match request body",o)}}function SM(e){let t=Jh(e.headers),r=typeof e.request.method=="string"?e.request.method:"";eg(t,e.request),!(r!=="tools/call"||e.toolSchema===void 0)&&rg({headers:t,params:e.request.params,toolSchema:e.toolSchema})}var EM=U;import{AsyncLocalStorage as ng}from"node:async_hooks";import{createHash as yr,timingSafeEqual as og}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]="a9aefc86-a8ce-5ecf-bb54-e5fa3ea277c7")}catch{}})();var g=class extends Error{httpStatus;challenge;constructor(t,r,n){super(t),this.name="PmMcpAuthorizationError",this.httpStatus=r,this.challenge=n}},ig=/^00-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})$/u,sg=/^[a-z][a-z0-9_*/-]{0,255}$/u,ag=/^(?:[a-z0-9][a-z0-9_*/-]{0,240})@[a-z][a-z0-9_*/-]{0,13}$/u,cg=/^[\x20-\x2B\x2D-\x3C\x3E-\x7E]{0,255}[\x21-\x2B\x2D-\x3C\x3E-\x7E]$/u,Tr=/^[\x21\x23-\x5B\x5D-\x7E]+$/u,Cr=/^[A-Za-z0-9!#$%&'*+.^_`|~-]+$/u,dg=/^[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]*$/u,ug=/%(?![0-9A-Fa-f]{2})/u,lg=512,pg=32,fg=180,mg=8192,_g=8192,Sr=new ng;function w(e,t,r=!1){if(new RegExp("\\p{Cc}","u").test(e))throw new g(`Invalid ${t}`,401);let n;try{n=new URL(e)}catch{throw new g(`Invalid ${t}`,401)}let o=n.hostname==="127.0.0.1"||n.hostname==="localhost";if(n.hash.length>0||n.protocol!=="https:"&&!(r&&o&&n.protocol==="http:"))throw new g(`Invalid ${t}`,401);return n}function hg(e,t){let r=t.toLowerCase();for(let[n,o]of Object.entries(e))if(!(n.toLowerCase()!==r||o===void 0))return typeof o=="string"?o:o.join(", ")}function RM(e){let t=w(e.resource,"protected resource URI",!0).href.replace(/\/$/u,"");if(e.authorizationServers.length===0)throw new g("Protected resource metadata requires an authorization server",401);let r=e.authorizationServers.map(o=>w(o,"authorization server issuer").href.replace(/\/$/u,"")),n=[...new Set(e.scopes??[])];if(n.some(o=>!Tr.test(o)))throw new g("Invalid authorization scope",401);return{resource:t,authorization_servers:r,...n.length>0?{scopes_supported:n.sort()}:{}}}function IM(e){let t=w(e,"authorization server issuer"),r=t.pathname.replace(/^\/+|\/+$/gu,""),n=t.origin;return r?[`${n}/.well-known/oauth-authorization-server/${r}`,`${n}/.well-known/openid-configuration/${r}`,`${n}/${r}/.well-known/openid-configuration`]:[`${n}/.well-known/oauth-authorization-server`,`${n}/.well-known/openid-configuration`]}function PM(e,t){if(!_(e)||typeof e.issuer!="string")throw new g("Invalid authorization server metadata",401);let r=w(t,"expected issuer").href.replace(/\/$/u,"");if(w(e.issuer,"metadata issuer").href.replace(/\/$/u,"")!==r)throw new g("Authorization server issuer mismatch",401);if(!Array.isArray(e.code_challenge_methods_supported)||!e.code_challenge_methods_supported.includes("S256"))throw new g("Authorization server does not support required S256 PKCE",401);let o=d=>{let u=e[d];if(typeof u!="string")throw new g(`Authorization server metadata requires ${d}`,401);return w(u,d).href},i=d=>{let u=e[d];return typeof u=="string"?w(u,d).href:void 0},s=o("authorization_endpoint"),a=o("token_endpoint"),c=i("registration_endpoint");return{issuer:r,authorization_endpoint:s,token_endpoint:a,code_challenge_methods_supported:[...new Set(e.code_challenge_methods_supported.filter(d=>typeof d=="string"))],...e.client_id_metadata_document_supported===!0?{client_id_metadata_document_supported:!0}:{},...c?{registration_endpoint:c}:{}}}function MM(e){return e.hasPreRegisteredClient?"pre_registered":e.metadata.client_id_metadata_document_supported?"client_id_metadata_document":e.metadata.registration_endpoint?"dynamic":"user_supplied"}function kM(e){if(e.responseIssuer===void 0){if(e.issuerParameterSupported)throw new g("Authorization response omitted the advertised issuer",401);return}if(e.responseIssuer!==e.expectedIssuer)throw new g("Authorization response issuer mismatch",401)}function vM(e,t){let r=w(t,"client metadata document URL");if(r.pathname==="/"||!_(e)||e.client_id!==r.href||typeof e.client_name!="string"||e.client_name.trim().length===0||!Array.isArray(e.redirect_uris)||e.redirect_uris.length===0)throw new g("Invalid Client ID Metadata Document",401);for(let n of e.redirect_uris){if(typeof n!="string")throw new g("Invalid client redirect URI",401);w(n,"client redirect URI",!0)}return structuredClone(e)}function NM(e){if(e.redirectUris.length===0||e.clientName.trim().length===0)throw new g("Invalid dynamic client registration metadata",401);let t=e.redirectUris.map(r=>w(r,"redirect URI",!0).href);return{application_type:e.applicationType,client_name:e.clientName.trim().slice(0,128),redirect_uris:t,grant_types:["authorization_code","refresh_token"],response_types:["code"],token_endpoint_auth_method:"none"}}var br=class{#e=new Map;set(t,r){let n=w(t,"credential issuer").href;this.#e.set(n,structuredClone(r))}get(t){let r=w(t,"credential issuer").href,n=this.#e.get(r);return n?structuredClone(n):void 0}delete(t){let r=w(t,"credential issuer").href;return this.#e.delete(r)}};function gg(e){let t=e.traceparent,r=e.tracestate;if(t!==void 0){let n=typeof t=="string"?ig.exec(t):null;if(!n)throw new g("Invalid MCP traceparent",403);let o=n[1],i=n[2];if(/^0+$/u.test(o)||/^0+$/u.test(i))throw new g("Invalid MCP traceparent",403)}if(r!==void 0&&(typeof r!="string"||!bg(r)))throw new g("Invalid MCP tracestate",403);return{...typeof t=="string"?{traceparent:t}:{},...typeof r=="string"?{tracestate:r}:{}}}function k(e){return e.replace(/^[ \t]*|[ \t]*$/gu,"")}function yg(e){return sg.test(e)||ag.test(e)}function bg(e){if(Buffer.byteLength(e,"utf8")>lg)return!1;let t=e.split(",");if(t.length>pg)return!1;let r=new Set;for(let n of t){let o=k(n);if(o.length===0)continue;let i=o.indexOf("="),s=i>0?o.slice(0,i):"",a=i>0?o.slice(i+1):"";if(!yg(s)||!cg.test(a)||r.has(s))return!1;r.add(s)}return!0}function Er(e){return dg.test(e)&&!ug.test(e)}function Tg(e){let t=k(e),r=t.indexOf("="),n=k(r>=0?t.slice(0,r):t),o=r>=0?k(t.slice(r+1)):void 0;return Cr.test(n)&&(o===void 0||Er(o))}function Cg(e){let t=k(e),r=t.split(";"),n=r[0],o=r.slice(1),i=n.indexOf("="),s=k(i>0?n.slice(0,i):""),a=i>0?k(n.slice(i+1)):"";if(!(!Cr.test(s)||!Er(a)||!o.every(Tg)))return{key:s,serialized:t}}function Sg(e,t){if(e===void 0)return;if(typeof e!="string"||Buffer.byteLength(e,"utf8")>mg)throw new g("Invalid MCP baggage",403);let r=new Set(t),n=e.split(",");if(n.length>fg)throw new g("Invalid MCP baggage",403);let o=[];for(let i of n){let s=Cg(i);if(!s)throw new g("Invalid MCP baggage",403);r.has(s.key)&&o.push(s.serialized)}return o.length>0?o.join(","):void 0}function LM(e,t={}){let r=_(e)&&_(e._meta)?e._meta:{},n=Sg(r.baggage,t.baggageAllowlist??[]);return{...gg(r),...n?{baggage:n}:{}}}function DM(e,t){return Sr.run(structuredClone(e),t)}function $M(){let e=Sr.getStore();return e?{...e}:void 0}async function FM(e){let t=w(e.policy.resourceMetadataUrl,"protected resource metadata URL",!0).href,r=[...new Set(e.policy.requiredScopes??[])];if(r.some(p=>!Tr.test(p)))throw new g("Invalid authorization scope",401);let n=`Bearer resource_metadata="${t}"`;if(new URL(e.requestUrl,e.policy.resource).searchParams.has("access_token"))throw new g("Access tokens must not appear in URI query parameters",401,n);let s=hg(e.headers,"authorization")?.match(/^Bearer ([^\s]+)$/iu);if(!s)throw new g("Missing or malformed bearer token",401,n);let a=s[1];if(Buffer.byteLength(a,"utf8")>_g)throw new g("Missing or malformed bearer token",401,n);let c;try{c=await e.policy.verifyAccessToken(a)}catch{throw new g("Invalid bearer token",401,n)}let d=Array.isArray(c.audience)?c.audience:[c.audience];if(c.issuer!==e.policy.issuer||!d.includes(e.policy.resource))throw new g("Bearer token issuer or audience mismatch",401,n);let u=r.filter(p=>!c.scopes.includes(p));if(u.length>0)throw new g("Bearer token has insufficient scope",403,`${n}, scope="${u.join(" ")}"`);return{...c,audience:[...d],scopes:[...c.scopes]}}function GM(e){let t=yr("sha256").update(e.token).digest();return r=>{let n=yr("sha256").update(r).digest();if(!og(t,n))throw new g("Invalid bearer token",401);return structuredClone(e.claims)}}(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]="e6c49c89-781e-59a3-9c19-6a1c40424587")}catch{}})();var Je="io.modelcontextprotocol/ui",_e="2026-01-26",xr="text/html;profile=mcp-app",wr=Object.freeze({specVersion:_e,mimeTypes:[xr]});function BM(e){let t=e.clientCapabilities.extensions;if(!_(t))return!1;let r=t[Je];if(r===void 0)return!1;if(!_(r))throw new l("Invalid MCP Apps client capability",f.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[Je]:wr}}});let n=r.mimeTypes,o=r.specVersion;if(!Array.isArray(n)||!n.includes(xr)||o!==void 0&&o!==_e)throw new l("Unsupported MCP Apps client capability",f.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[Je]:wr}}});return!0}var Eg={csp:{connectDomains:[],resourceDomains:[],frameDomains:[]},permissions:{},prefersBorder:!0},Or=Object.freeze([{id:"context",name:"Context explorer",description:"Inspect bounded project context, provenance, omissions, and token accounting.",toolName:"pm_context",uri:"ui://pm/context.html"},{id:"graph",name:"Relationship graph",description:"Explore typed relationships, explaining paths, and graph-governance evidence.",toolName:"pm_graph",uri:"ui://pm/graph.html"},{id:"plan",name:"Plan and milestone view",description:"Review durable plan steps, dependencies, decisions, discoveries, and validation state.",toolName:"pm_plan",uri:"ui://pm/plan.html"},{id:"assurance",name:"Assurance dashboard",description:"Inspect validation verdicts, evidence, omissions, and actionable recovery paths.",toolName:"pm_validate",uri:"ui://pm/assurance.html"},{id:"operations",name:"Long-operation view",description:"Inspect durable test and operation results without creating a second task store.",toolName:"pm_test",uri:"ui://pm/operations.html"}].map(e=>({...e,toolMeta:{resourceUri:e.uri,visibility:["model","app"]},resourceMeta:Eg})));function qM(e){return Or.find(t=>t.uri===e)}function zM(e){let t=new Map(Or.map(r=>[r.toolName,r]));return e.map(r=>{let n=t.get(r.name);return n?{...r,_meta:{...r._meta,ui:n.toolMeta}}:{...r}})}function Ar(e){return e.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function VM(e){let t=Ar(e.name),r=Ar(e.description),n=JSON.stringify({name:`pm-${e.id}-view`,version:_e}),o=JSON.stringify(_e);return`<!doctype html>
|
|
1
|
+
import{A as xv,B as Oh,C as Rh,D as Ov,E as Rv,a as ls,b as us,c as ps,d as fs,e as gv,f as yv,g as ir,h as hh,i as gh,j as yh,l as bh,m as Ch,n as Th,o as wh,p as Sh,q as Eh,r as Ah,s as xh,t as bv,u as Cv,v as Tv,w as wv,x as Sv,y as Ev,z as Av}from"./chunks/chunk-RI4XNOYS.js";import{A as mP,B as _P,C as hP,D as gP,E as yP,F as bP,G as CP,H as TP,I as wP,J as SP,K as EP,L as AP,M as xP,N as OP,O as RP,P as IP,Q as vP,R as PP,S as kP,T as MP,U as NP,V as LP,W as DP,X as $P,Y as FP,a as Bv,b as qv,c as zv,d as Vv,e as Hv,f as Kv,g as Wv,h as Xv,i as Yv,j as Jv,k as Zv,l as Qv,m as eP,n as tP,o as rP,p as nP,q as oP,r as iP,s as sP,t as aP,u as cP,v as dP,w as lP,x as uP,y as pP,z as fP}from"./chunks/chunk-A24WAVE6.js";import{a as Iv,b as vv,c as Pv,d as kv}from"./chunks/chunk-YW4QK2G7.js";import{a as Mv,b as Nv,c as Lv,d as Dv,e as $v,f as Fv,g as jv,h as Gv,i as Uv}from"./chunks/chunk-X6CMGV6L.js";import{$ as Qt,$a as Um,$b as U_,A as YA,Aa as dm,Ab as m_,Ac as mh,B as su,Ba as lm,Bb as __,Bc as _h,C as Ju,Ca as um,Cb as h_,D as Zu,Da as pm,Db as g_,E as Qu,Ea as fm,Eb as y_,F as ep,Fa as mm,Fb as b_,G as tp,Ga as _m,Gb as C_,H as Ep,Ha as hm,Hb as T_,I as He,Ia as gm,Ib as w_,J as Ap,Ja as ym,Jb as S_,K as xp,Ka as bm,Kb as E_,L as Op,La as Cm,Lb as A_,M as Rp,Ma as Tm,Mb as x_,N as Ip,Na as wm,Nb as O_,O as vp,Oa as Sm,Ob as R_,P as GI,Pa as Em,Pb as I_,Q as UI,Qa as Am,Qb as v_,R as BI,Ra as xm,Rb as P_,S as zt,Sa as Om,Sb as k_,T as Vt,Ta as Rm,Tb as M_,U as Ht,Ua as Im,Ub as N_,V as Kt,Va as or,Vb as L_,W as Wt,Wa as me,Wb as D_,X as Xt,Xa as $m,Xb as $_,Y as Yt,Ya as Fm,Yb as F_,Z as Jt,Za as jm,Zb as j_,_ as Zt,_a as Gm,_b as G_,a as Gc,aa as er,ab as Bm,ac as B_,b as Uc,ba as af,bb as qm,bc as q_,c as Bc,ca as cf,cb as zm,cc as z_,d as SA,da as df,db as Vm,dc as V_,e as EA,ea as lf,eb as Hm,ec as H_,f as zc,fa as uf,fb as Km,fc as K_,g as PA,ga as Ke,gb as Wm,gc as W_,h as kA,ha as pf,hb as Xm,hc as X_,i as MA,ia as ff,ib as Ym,ic as Y_,j as NA,ja as mf,jb as Jm,jc as J_,k as LA,ka as _f,kb as Zm,kc as Z_,l as DA,la as hf,lb as Qm,lc as Q_,m as $A,ma as gf,mb as e_,mc as eh,n as FA,na as yf,nb as t_,nc as th,o as jA,oa as bf,ob as r_,oc as rh,p as GA,pa as ev,pb as n_,pc as nh,q as UA,qa as tv,qb as o_,qc as oh,r as BA,ra as rv,rb as i_,rc as ih,s as qA,sa as nv,sb as s_,sc as sh,t as zA,ta as ov,tb as a_,tc as ah,u as Xc,ua as nm,ub as c_,uc as ch,v as VA,va as om,vb as d_,vc as dh,w as HA,wa as im,wb as l_,wc as lh,x as KA,xa as sm,xb as u_,xc as uh,y as WA,ya as am,yb as p_,yc as ph,z as XA,za as cm,zb as f_,zc as fh}from"./chunks/chunk-V72UV7QS.js";import{a as qt,f as AI,g as xI,h as Mp,i as Np}from"./chunks/chunk-I2AS367G.js";import{A as FI,B as jI,C as Vp,D as Hp,E as Kp,b as iu,c as CR,d as mI,e as yI,f as bI,g as CI,h as TI,i as wI,j as Pp,k as SI,l as Up,m as Bp,n as qp,o as zp,p as OI,q as RI,r as II,s as vI,t as PI,u as kI,v as MI,w as NI,x as LI,y as DI,z as $I}from"./chunks/chunk-OGBVU67G.js";import{$a as kl,$b as oI,$c as Qp,$d as Bf,A as Mx,Aa as TO,Ab as jO,Ac as fp,Ad as Of,B as Nx,Ba as wO,Bb as GO,Bc as mp,Bd as av,C as Lx,Ca as SO,Cb as UO,Cc as _p,Cd as cv,D as Dx,Da as EO,Db as BO,Dc as hp,Dd as dv,E as Kx,Ea as AO,Eb as qO,Ec as gp,Ed as lv,Fa as xO,Fb as zO,Fc as yp,Fd as uv,Ga as OO,Gb as VO,Gc as bp,Gd as rr,Ha as RO,Hb as HO,Hc as Cp,Hd as pv,Ia as IO,Ib as KO,Ic as Tp,Id as fv,J as Vd,Ja as vO,Jb as WO,Jc as hI,Jd as nr,Ka as PO,Kb as XO,Kc as gI,Kd as mv,La as kO,Lb as au,Lc as wp,Ld as _v,Ma as MO,Mb as cu,Na as NO,Nb as du,Nd as Rf,Oa as LO,Ob as lu,Od as If,Pa as DO,Pb as uu,Pc as Sp,Pd as vf,Qa as wl,Qd as Pf,Ra as Sl,Rb as pu,Rc as EI,Rd as kf,Sa as $O,Sb as fu,Sc as kp,Sd as Mf,Ta as El,Tb as mu,Tc as Wp,Td as Nf,Ua as Al,Ub as _u,Uc as Xp,Ud as Lf,Va as xl,Vb as hu,Vc as Yp,Vd as Df,Wa as Ol,Wb as Vu,Wc as WI,Wd as $f,Xa as Rl,Xb as Hu,Xc as XI,Xd as Ff,Ya as Il,Yb as Ku,Yc as YI,Yd as jf,Za as vl,Zb as Wu,Zc as Jp,Zd as Gf,_a as Pl,_b as nI,_c as Zp,_d as Uf,a as ax,aa as Wx,ab as Ml,ac as iI,ad as ef,ae as qf,b as cx,ba as Xx,bb as Nl,bc as sI,bd as tf,be as zf,c as dx,ca as Hd,cb as Ll,cc as aI,cd as rf,ce as Vf,d as lx,da as Kd,db as Dl,dc as Xu,dd as nf,de as Hf,e as ux,ea as Wd,eb as $l,ec as Yu,ed as of,ee as hv,f as px,fa as Xd,fb as Fl,fc as cI,fd as sf,fe as Kf,g as fx,ga as Yd,gb as jl,gc as dI,gd as JI,ge as Wf,h as mx,ha as Jd,hb as Gl,hc as lI,hd as ZI,he as Xf,i as _x,ia as Zd,ib as Ul,ic as Ve,id as QI,ie as Yf,j as hx,ja as iO,jb as Bl,jc as uI,jd as Cf,je as Jf,k as gx,ka as sO,kb as ql,kc as Bt,kd as iv,ke as Zf,l as yx,la as aO,lb as zl,lc as pI,ld as tr,le as Qf,m as bx,ma as cO,mb as Vl,mc as fI,md as sv,me as em,n as Cx,na as dO,nb as Hl,nd as We,ne as tm,o as Tx,oa as lO,ob as Kl,oc as rp,od as re,oe as rm,p as wx,pa as uO,pb as Wl,pc as np,pd as Tf,pe as vm,q as Sx,qa as pO,qb as Xl,qc as _I,qe as Pm,r as Ex,ra as fO,rb as Yl,rc as op,re as km,s as Ax,sa as mO,sb as Jl,sc as ip,sd as Xe,se as Mm,t as xx,ta as _O,tb as Zl,tc as sp,td as wf,te as Nm,u as Ox,ua as hO,ub as Ql,uc as ap,ud as Sf,ue as Lm,v as Rx,va as gO,vb as eu,vc as cp,ve as Dm,w as Ix,wa as yO,wb as tu,wc as dp,wd as fe,x as vx,xb as ru,xc as lp,xd as Ef,y as Px,ya as bO,yb as nu,yc as up,yd as Af,z as kx,za as CO,zb as FO,zc as pp,zd as xf}from"./chunks/chunk-TXW6VL33.js";import{Ba as _l,Ca as hl,Da as gl,Ea as yl,Fa as bl,H as al,Ha as Cl,I as cl,Ia as Tl,J as dl,Ja as Lp,K as ll,Ka as Dp,L as Lt,La as $p,Na as Fp,Oa as jp,Pa as Gp,a as IA,b as vA,c as Vc,d as Hc,f as Kc,g as Wc,h as Yx,i as Jx,j as Zx,k as Qx,l as eO,m as tO,n as rO,o as nO,oa as Dt,p as Qd,pa as $t,q as el,qa as Ft,r as tl,ra as jt,s as rl,sa as ul,t as nl,u as oO,ua as pl,v as ol,va as fl,w as il,wa as ml,x as sl}from"./chunks/chunk-HI6BHPCU.js";import{$ as Hx,$a as aR,$b as Su,Aa as Fd,Ab as RR,Ac as rI,B as Yc,Ba as jd,Bb as IR,Bc as qI,C as $x,Ca as Gd,Cb as vR,Cc as zI,D as Fx,Da as Ud,Db as PR,Dc as VI,E as jx,Ea as Bd,Eb as kR,Ec as HI,F as Gx,Fa as qd,Fb as MR,Fc as KI,G as Ux,Ga as zd,Gb as NR,H as Bx,Hb as LR,I as qx,Ia as YO,Ib as DR,J as zx,Ja as JO,Jb as $R,K as Vx,Ka as ZO,Kb as FR,L as Jc,La as QO,Lb as jR,M as Zc,Ma as eR,Mb as GR,N as Qc,Na as tR,Nb as UR,O as ed,Oa as rR,Ob as BR,P as td,Pa as nR,Pb as qR,Q as rd,Qa as oR,Qb as zR,R as nd,Ra as iR,Rb as VR,S as od,Sa as sR,Sb as HR,T as id,Tb as KR,U as sd,Ub as WR,V as ad,Vb as XR,W as ze,Wb as YR,X as cd,Xb as JR,Y as dd,Yb as ZR,Z as ld,Zb as Tu,_ as ud,_b as wu,a as mA,aa as pd,ab as cR,ac as Eu,b as _A,ba as fd,bb as dR,bc as Au,c as hA,ca as md,cb as lR,cc as xu,d as gA,da as _d,db as uR,dc as Gt,e as yA,ea as hd,eb as pR,ec as Ou,fa as gd,fc as Ru,ga as yd,gc as Iu,h as bA,ha as bd,hb as fR,hc as vu,i as CA,ia as Cd,ib as mR,ic as Pu,j as qc,ja as Td,jb as _R,jc as ku,k as TA,ka as wd,kb as hR,kc as Mu,l as wA,la as Sd,lb as gR,lc as Nu,m as AA,ma as Ed,mb as yR,mc as Lu,n as xA,na as Ad,nb as bR,nc as Du,o as OA,oa as xd,ob as ou,oc as $u,p as RA,pa as Od,pb as gu,pc as Fu,q as JA,qa as Rd,qb as yu,qc as ju,r as ZA,ra as Id,rb as bu,rc as Gu,s as QA,sa as vd,sb as Cu,sc as Uu,t as ex,ta as Pd,tb as TR,tc as Bu,u as tx,ua as kd,ub as wR,uc as Ut,v as rx,va as Md,vb as SR,vc as qu,w as nx,wa as Nd,wb as ER,wc as QR,x as ox,xa as Ld,xb as AR,xc as eI,y as ix,ya as Dd,yb as xR,yc as tI,z as sx,za as $d,zb as OR,zc as zu}from"./chunks/chunk-VGLHECAP.js";import{$ as Zb,$a as Xn,$d as To,$e as ZT,$f as Ei,$g as uS,$h as jS,$j as ds,$k as aA,$l as Fa,$m as Lc,Ab as SC,Ac as BC,Ae as jT,Af as Qo,Ag as jw,Ah as IS,Ai as eE,Aj as NE,Ak as As,Al as ua,Am as uc,B as Ub,Bc as ro,Bd as xT,Be as Fe,Bf as ei,Bg as Gw,Bj as LE,Bk as xs,Bl as pa,Bm as pc,C as L,Cc as qC,Ce as GT,Cf as ti,Cg as Uw,Ch as vS,Cj as DE,Ck as Os,Cl as fa,Cm as fc,D as Bb,Dc as zC,Dd as so,De as Fo,Df as je,Dg as Bw,Dh as PS,Di as tE,Dj as Pt,Dk as Rs,Dl as ma,Dm as mc,E as b,Ec as VC,Ed as OT,Ee as jo,Ef as Ge,Eg as qw,Ei as rE,Ej as $E,Ek as Is,El as _a,Em as _c,Fc as HC,Fd as ao,Fe as Go,Ff as ri,Fg as zw,Fh as kS,Fi as qi,Fj as FE,Fk as vs,Fl as ha,Fm as hc,G as qb,Gc as KC,Ge as Uo,Gf as ni,Gg as Vw,Gi as nE,Gj as jE,Gk as Ps,Gl as ga,Gm as gc,H as zb,Hc as WC,Hd as RT,Hf as oi,Hg as Hw,Hh as MS,Hi as oE,Hj as GE,Hk as ks,Hl as ya,Hm as yc,Ic as XC,Id as IT,If as ii,Ig as Kw,Ih as NS,Ii as iE,Ij as UE,Ik as Ms,Il as ba,Im as bc,Jc as YC,Jd as vT,Jf as si,Jg as Ww,Jh as LS,Ji as sE,Jj as BE,Jk as Ns,Jl as Ca,Jm as Cc,K as Vb,Ka as lC,Kc as no,Kd as co,Kf as ai,Kg as Xw,Kh as DS,Ki as vt,Kj as qE,Kk as Ls,Kl as Ta,Km as Tc,La as uC,Lb as EC,Lc as JC,Ld as lo,Lf as ci,Lg as Yw,Lh as Pi,Li as aE,Lj as zE,Lk as Ds,Ll as wa,Lm as wc,Ma as pC,Mb as Jn,Mc as oo,Md as uo,Me as Bo,Mf as di,Mg as Jw,Mh as ki,Mi as cE,Mj as VE,Mk as $s,Ml as Sa,Mm as Sc,N as Hb,Nb as Zn,Nd as po,Ne as qo,Nf as li,Ng as Zw,Nh as Mi,Ni as dE,Nj as Yi,Nk as Fs,Nl as Ea,Nm as Ec,O as Et,Ob as AC,Oc as ZC,Od as fo,Oe as zo,Of as ui,Og as Qw,Oh as Ni,Oi as lE,Oj as Ji,Ok as js,Ol as Aa,Om as Ac,Pa as Vn,Pb as xC,Pc as QC,Pd as mo,Pf as pi,Pg as eS,Ph as Li,Pj as Zi,Pk as Gs,Pl as xa,Pm as xc,Q as At,Qa as fC,Qb as v,Qc as eT,Qd as _o,Qe as UT,Qf as fi,Qg as tS,Qh as Di,Qi as uE,Qj as Qi,Qk as Us,Ql as Oa,Qm as Oc,R as Dn,Ra as mC,Rb as OC,Rc as tT,Rd as PT,Re as BT,Rf as mi,Rg as rS,Rh as $i,Ri as pE,Rj as es,Rk as Bs,Rl as Ra,S as $n,Sa as _C,Sb as Rt,Sc as rT,Sd as kT,Se as qT,Sf as _i,Sg as nS,Sh as Fi,Si as fE,Sj as ts,Sk as qs,Sl as Ia,Sm as qe,T as xt,Ta as hC,Tb as RC,Tc as It,Te as zT,Tf as hi,Tg as oS,Th as ji,Ti as mE,Tk as zs,Tl as va,Tm as te,Uc as nT,Ud as ho,Ue as VT,Uf as gi,Ug as iS,Uh as $S,Ui as zi,Uj as rs,Uk as Vs,Ul as Pa,Um as Rc,V as Kb,Va as Hn,Vb as IC,Vc as oT,Vd as go,Ve as HT,Vf as yi,Vg as sS,Vi,Vj as ns,Vk as Hs,Vl as ka,Vm as Ic,Wa as Kn,Wc as iT,Wd as MT,We as KT,Wf as bi,Wg as aS,Wh as Gi,Wi as Hi,Wj as os,Wk as nA,Wl as Ma,Wm as vc,X as Wb,Xa as De,Xd as yo,Xe as WT,Xf as Ci,Xg as cS,Xh as Ui,Xi as Ki,Xj as is,Xk as oA,Xl as Na,Xm as Pc,Y as Xb,Ya as gC,Yc as sT,Yd as bo,Ye as XT,Yf as Ti,Yg as dS,Yh as Bi,Yi as Wi,Yj as ss,Yk as Ue,Yl as La,Ym as kc,Z as Yb,Zc as aT,Zd as NT,Ze as YT,Zf as wi,Zi as Xi,Zj as as,Zk as iA,Zl as Da,Zm as Mc,_ as Jb,_a as Wn,_d as Co,_e as JT,_f as Si,_g as lS,_h as FS,_i as _E,_j as cs,_k as sA,_l as $a,_m as Nc,aa as Qb,ad as io,ae as D,af as QT,ag as Ai,ai as GS,aj as hE,ak as HE,al as Mt,am as ja,an as Dc,ba as eC,bb as Yn,bd as cT,be as wo,bf as ew,bg as xi,bi as US,bj as gE,bk as KE,bl as Be,bm as Ga,bn as $c,c as Mn,ca as tC,cd as dT,cf as tw,cg as Oi,ch as pS,ci as BS,cj as yE,ck as WE,cl as cA,cm as Ua,cn as Fc,d as St,da as rC,dd as lT,df as rw,dg as Ri,dh as fS,dk as XE,dl as dA,dm as Ba,dn as jc,e as pe,ea as nC,ed as uT,ef as nw,eg as gw,eh as mS,ei as qS,ej as bE,ek as YE,el as lA,em as qa,en as Nt,f as Nn,fd as pT,ff as ow,fg as yw,fh as _S,fk as JE,fl as uA,fm as za,g as Le,ga as oC,gc as vC,gd as fT,gf as iw,gg as bw,gh as hS,gi as zS,gk as ZE,gl as pA,gm as Va,h as Ln,ha as iC,hc as PC,he as LT,hf as sw,hg as Cw,hh as gS,hi as VS,hj as CE,hk as QE,hl as fA,hm as Ha,ia as sC,ic as kC,id as mT,ie as DT,if as aw,ig as Tw,ih as yS,ii as HS,il as Ks,im as Ka,j as Lb,ja as aC,jd as _T,je as $T,jf as cw,jg as ww,jh as bS,ji as KS,jj as TE,jl as Ws,jm as Wa,k as Db,ka as cC,kc as MC,kd as hT,ke as So,kf as dw,kg as Sw,kh as CS,ki as WS,kl as Xs,km as Xa,l as $b,la as dC,lc as NC,ld as gT,le as Eo,lf as lw,lg as Ew,lh as TS,lk as kt,ll as Ys,lm as Ya,ma as Fn,me as Ao,mf as uw,mg as Aw,mh as wS,mk as eA,ml as Js,mm as Ja,na as jn,nc as LC,nd as yT,ne as xo,nf as pw,ng as xw,nh as SS,nj as wE,nk as tA,nl as Zs,nm as Za,oa as Gn,oc as Qn,od as bT,oe as Oo,of as fw,og as Ow,oh as ES,oj as SE,ok as rA,ol as Qs,om as Qa,pe as Ro,pf as mw,pg as Rw,pj as EE,pk as ms,pl as ea,pm as ec,qc as eo,qd as CT,qe as Io,qf as _w,qg as Iw,qh as AS,qj as AE,qk as _s,ql as ta,qm as tc,rc as to,rd as TT,re as vo,rf as hw,rg as vw,rh as Ii,rj as xE,rk as hs,rl as ra,rm as rc,s as Fb,sa as Un,sb as yC,sd as wT,se as Po,sf as Vo,sg as Pw,sh as vi,sk as gs,sl as na,sm as nc,tb as $e,td as ST,te as ko,tf as Ho,tg as kw,tj as OE,tk as ys,tl as oa,tm as oc,u as jb,ua as Bn,ub as Ot,uc as DC,ud as ET,ue as Mo,uf as Ko,ug as Mw,uj as RE,uk as bs,ul as ia,um as ic,va as qn,vb as bC,vc as $C,vd as AT,ve as No,vf as Wo,vg as Nw,vi as XS,vj as IE,vk as Cs,vl as sa,vm as sc,wa as zn,wb as CC,wc as FC,we as Lo,wf as Xo,wg as Lw,wi as YS,wj as vE,wk as Ts,wl as aa,wm as ac,x as Gb,xb as TC,xc as jC,xe as Do,xf as Yo,xg as Dw,xh as xS,xi as JS,xj as PE,xk as ws,xl as ca,xm as cc,yb as wC,yc as GC,ye as $o,yf as Jo,yg as $w,yh as OS,yi as ZS,yj as kE,yk as Ss,yl as da,ym as dc,zb as V,zc as UC,ze as FT,zf as Zo,zg as Fw,zh as RS,zi as QS,zj as ME,zk as Es,zl as la,zm as lc}from"./chunks/chunk-6XSKPNCF.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]="0ec82581-c626-544c-9deb-ec5e810fd7e9")}catch{}})();var H="2026-07-28",jP=["2025-11-25","2025-06-18"],Ye=[H],f={headerMismatch:-32020,missingRequiredClientCapability:-32021,unsupportedProtocolVersion:-32022,invalidParams:-32602},O={clientCapabilities:"io.modelcontextprotocol/clientCapabilities",clientInfo:"io.modelcontextprotocol/clientInfo",protocolVersion:"io.modelcontextprotocol/protocolVersion",serverInfo:"io.modelcontextprotocol/serverInfo"},p=class extends Error{code;data;constructor(t,r,n={}){super(t),this.name="PmMcpProtocolError",this.code=r,this.data=n}};function _(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Ih(e){if(e===void 0)return;if(!_(e))throw new p("Invalid MCP clientInfo metadata",f.invalidParams,{field:O.clientInfo,expected:"object"});let t=typeof e.name=="string"?e.name.trim():"",r=typeof e.version=="string"?e.version.trim():"";if(t.length===0||r.length===0)throw new p("Invalid MCP clientInfo metadata",f.invalidParams,{field:O.clientInfo,required:["name","version"]});let n={name:t.slice(0,128),version:r.slice(0,128)};return typeof e.description=="string"&&e.description.trim()&&(n.description=e.description.trim().slice(0,1024)),typeof e.websiteUrl=="string"&&e.websiteUrl.trim()&&(n.websiteUrl=e.websiteUrl.trim().slice(0,2048)),n}function Je(e){let t=_(e)?e._meta:void 0;if(!_(t))throw new p("Missing required MCP request metadata",f.invalidParams,{required:[O.protocolVersion,O.clientCapabilities]});let r=t[O.protocolVersion];if(typeof r!="string"||!Ye.includes(r))throw new p("Unsupported protocol version",f.unsupportedProtocolVersion,{supported:[...Ye],requested:typeof r=="string"?r:null});let n=t[O.clientCapabilities];if(!_(n))throw new p("Invalid MCP client capabilities metadata",f.invalidParams,{field:O.clientCapabilities,expected:"object"});let o=Ih(t[O.clientInfo]);return{protocolVersion:H,clientCapabilities:n,...o?{clientInfo:o}:{}}}function GP(e,t){if(t!==e.protocolVersion)throw new p("MCP protocol header does not match request metadata",f.headerMismatch,{header:t??null,metadata:e.protocolVersion})}function UP(e,t){let r=t.filter(n=>!Object.prototype.hasOwnProperty.call(e.clientCapabilities,n));if(r.length>0)throw new p("Missing required client capability",f.missingRequiredClientCapability,{requiredCapabilities:Object.fromEntries(r.map(n=>[n,{}]))})}function BP(e,t){let r=e.clientCapabilities.extensions;return _(r)&&_(r[t])}function Ze(e,t){let r=_(e._meta)?e._meta:{};return{...e,_meta:{...r,[O.serverInfo]:{...t}}}}function vh(e,t){return Ze({...e,resultType:"complete"},t)}function qP(e){let t=e.ttlMs??6e4;if(!Number.isFinite(t)||t<0)throw new p("Invalid MCP discovery cache TTL",f.invalidParams,{ttlMs:t});return vh({supportedVersions:[...Ye],capabilities:structuredClone(e.capabilities),ttlMs:t,cacheScope:"public",...e.instructions?{instructions:e.instructions}:{}},e.serverInfo)}function zP(e,t){if(_(e)&&typeof e.resultType=="string")return e.resultType;if(t==="legacy")return"complete";throw new p("Modern MCP result is missing resultType",f.invalidParams,{required:"resultType"})}import{createHash as cr,createHmac as dr,timingSafeEqual as Ph}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]="469f704b-12eb-524d-bcc8-fb8f9f1775f2")}catch{}})();var kh=["elicitation/create","roots/list","sampling/createMessage"],sr=class extends Error{inputRequests;requestState;constructor(t){super("MCP operation requires additional input"),this.name="PmMcpInputRequiredError",this.inputRequests=t.inputRequests,this.requestState=t.requestState}},lr=/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/u,_e=32,et=64*1024,he=16*1024,Qe={maxBytes:256*1024,maxDepth:32,maxNodes:4096};function Mh(e){return e==="elicitation/create"?"elicitation":e==="sampling/createMessage"?"sampling":"roots"}function ge(e,t,r){let n;try{n=JSON.stringify(e)}catch{throw new p(`Invalid ${r}: value is not JSON serializable`,f.invalidParams,{field:r})}if(Buffer.byteLength(n,"utf8")>t)throw new p(`Invalid ${r}: payload exceeds the protocol bound`,f.invalidParams,{field:r,maximumBytes:t})}function tt(e,t){if(!_(e))throw new p("Invalid MCP inputRequests",f.invalidParams,{field:"inputRequests",expected:"object"});let r=Object.entries(e);if(r.length===0||r.length>_e)throw new p("Invalid MCP inputRequests count",f.invalidParams,{minimum:1,maximum:_e,observed:r.length});let n={};for(let[o,i]of r){if(!lr.test(o)||!_(i))throw new p("Invalid MCP input request entry",f.invalidParams,{field:`inputRequests.${o}`});let s=i.method;if(typeof s!="string"||!kh.includes(s))throw new p("Unsupported MCP input request method",f.invalidParams,{field:`inputRequests.${o}.method`,method:s??null});let a=Mh(s);if(!Object.prototype.hasOwnProperty.call(t.clientCapabilities,a))throw new p("Missing required client capability",f.missingRequiredClientCapability,{requiredCapabilities:{[a]:{}}});if(!_(i.params))throw new p("Invalid MCP input request parameters",f.invalidParams,{field:`inputRequests.${o}.params`,expected:"object"});n[o]={method:s,params:structuredClone(i.params)}}return ge(n,et,"inputRequests"),n}function ur(e){if(!_(e))throw new p("Invalid MCP inputResponses",f.invalidParams,{field:"inputResponses",expected:"object"});let t=Object.entries(e);if(t.length>_e)throw new p("Invalid MCP inputResponses count",f.invalidParams,{maximum:_e,observed:t.length});let r={};for(let[n,o]of t){if(!lr.test(n)||!_(o))throw new p("Invalid MCP input response entry",f.invalidParams,{field:`inputResponses.${n}`});r[n]=structuredClone(o)}return ge(r,et,"inputResponses"),r}function WP(e){let t=e.requestState?.trim();if(t&&Buffer.byteLength(t,"utf8")>he)throw new p("Invalid MCP requestState: payload exceeds the protocol bound",f.invalidParams,{field:"requestState",maximumBytes:he});let r=e.inputRequests===void 0?void 0:tt(e.inputRequests,e.requestContext);if(r===void 0&&!t)throw new p("InputRequiredResult requires inputRequests or requestState",f.invalidParams,{requiredAnyOf:["inputRequests","requestState"]});return{resultType:"input_required",...r?{inputRequests:r}:{},...t?{requestState:t}:{},_meta:{[O.serverInfo]:{...e.serverInfo}}}}function pr(e){let t=Buffer.from(e);if(t.byteLength<32)throw new p("MCP requestState signing key must contain at least 32 bytes",f.invalidParams,{minimumBytes:32});return t}function XP(e,t){if(!Number.isSafeInteger(e.expiresAt)||e.expiresAt<=0||e.method.trim().length===0||e.parameterDigest.trim().length===0||e.principal.trim().length===0)throw new p("Invalid MCP requestState payload",f.invalidParams);let r=Buffer.from(JSON.stringify({version:1,...e}),"utf8");if(r.byteLength>he/2)throw new p("MCP requestState payload exceeds the protocol bound",f.invalidParams,{maximumBytes:he/2});let n=r.toString("base64url"),o=dr("sha256",pr(t)).update(n).digest("base64url");return`${n}.${o}`}function Nh(e){if(!_(e)||e.version!==1)throw new p("Invalid MCP requestState payload",f.invalidParams,{field:"requestState"});let{expiresAt:t,method:r,parameterDigest:n,principal:o,state:i}=e;if(typeof t!="number"||!Number.isSafeInteger(t))throw new p("Invalid MCP requestState payload",f.invalidParams,{field:"requestState"});if(typeof r!="string"||typeof n!="string"||typeof o!="string")throw new p("Invalid MCP requestState payload",f.invalidParams,{field:"requestState"});return{expiresAt:t,method:r,parameterDigest:n,principal:o,state:i}}function YP(e,t,r){let[n,o,i]=e.split(".");if(!n||!o||i!==void 0)throw new p("Invalid MCP requestState encoding",f.invalidParams,{field:"requestState"});let s=Buffer.from(o,"base64url"),a=dr("sha256",pr(t)).update(n).digest();if(s.byteLength!==a.byteLength||!Ph(s,a))throw new p("Invalid MCP requestState signature",f.invalidParams,{field:"requestState"});let c;try{c=JSON.parse(Buffer.from(n,"base64url").toString("utf8"))}catch{c=null}let d=Nh(c),{expiresAt:l,method:u,parameterDigest:m,principal:g}=d;if(l<(r.nowMs??Date.now()))throw new p("Expired MCP requestState",f.invalidParams,{field:"requestState",expiredAt:l});if(u!==r.method||m!==r.parameterDigest||g!==r.principal)throw new p("MCP requestState binding mismatch",f.invalidParams,{field:"requestState"});return d}function JP(e){return ge(e,et,"request parameters"),cr("sha256").update(JSON.stringify(e)).digest("hex")}var ar=class{#e=new Set;#t;constructor(t=4096){if(!Number.isSafeInteger(t)||t<1)throw new p("Invalid MCP replay guard capacity",f.invalidParams,{maximumEntries:t});this.#t=t}consume(t){let r=cr("sha256").update(t).digest("hex");if(this.#e.has(r))throw new p("MCP requestState replay detected",f.invalidParams,{field:"requestState"});if(this.#e.size>=this.#t){let n=this.#e.values().next().value;this.#e.delete(n)}this.#e.add(r)}};function Lh(e){if(!Number.isSafeInteger(e.ttlMs)||e.ttlMs<0||e.cacheScope!=="public"&&e.cacheScope!=="private")throw new p("Invalid MCP cache policy",f.invalidParams,{ttlMs:e.ttlMs,cacheScope:e.cacheScope});return{ttlMs:e.ttlMs,cacheScope:e.cacheScope}}function ZP(e,t){return{...e,...Lh(t)}}function Dh(e){return e.replaceAll("~1","/").replaceAll("~0","~")}function $h(e,t){if(t==="#")return e;if(!t.startsWith("#/"))return;let r=e;for(let n of t.slice(2).split("/").map(Dh)){if(!_(r)&&!Array.isArray(r)||!Object.prototype.hasOwnProperty.call(r,n))return;r=r[n]}return r}function Fh(e){let t=e.maxBytes??Qe.maxBytes,r=e.maxDepth??Qe.maxDepth,n=e.maxNodes??Qe.maxNodes;if(!Number.isSafeInteger(t)||t<2)throw new p("Invalid MCP JSON Schema work bounds",f.invalidParams);if(!Number.isSafeInteger(r)||r<1)throw new p("Invalid MCP JSON Schema work bounds",f.invalidParams);if(!Number.isSafeInteger(n)||n<1)throw new p("Invalid MCP JSON Schema work bounds",f.invalidParams);return{maximumBytes:t,maximumDepth:r,maximumNodes:n}}function jh(e,t){let r=Array.isArray(e.value)?e.value:_(e.value)?Object.values(e.value):[];for(let n of r)t.push({value:n,depth:e.depth+1})}function Gh(e,t){if(!_(t)||typeof t.$ref!="string")return;let r=t.$ref;if(r.startsWith("#")&&$h(e,r)===void 0)throw new p("MCP JSON Schema contains an unresolved local reference",f.invalidParams,{reference:r})}function QP(e,t={}){let{maximumBytes:r,maximumDepth:n,maximumNodes:o}=Fh(t);if(typeof e!="boolean"&&!_(e))throw new p("Invalid MCP JSON Schema root",f.invalidParams,{expected:"object or boolean"});ge(e,r,"JSON Schema");let i=[{value:e,depth:0}],s=0;for(;i.length>0;){let a=i.pop();if(s+=1,s>o||a.depth>n)throw new p("MCP JSON Schema exceeds validation work bounds",f.invalidParams,{maximumDepth:n,maximumNodes:o});Gh(e,a.value),jh(a,i)}return structuredClone(e)}import{randomUUID as Uh}from"node:crypto";import{readFile as Bh}from"node:fs/promises";import fr 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]="1774674f-4d33-5a24-9d97-522c55b861c0")}catch{}})();var ak="io.modelcontextprotocol/tasks",qh=["working","input_required","completed","failed","cancelled"],zh=/^mcp-task-[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/iu,Vh=3600*1e3,Hh=1e3,be=1024,Kh=30,Wh=2e3;function rt(e){return new p(e,f.invalidParams,{code:"mcp_task_not_found_or_not_authorized"})}function ye(e){let t=e.trim();if(!zh.test(t))throw rt("Unknown MCP task");return t}function mr(e,t){if(typeof e!="string"||!Number.isFinite(Date.parse(e)))throw new p("Corrupt MCP task record",f.invalidParams,{field:t});return e}function _r(e){if(!_(e)||typeof e.code!="number"||!Number.isFinite(e.code)||typeof e.message!="string")throw new p("Corrupt MCP task error",f.invalidParams);return{code:e.code,message:e.message.slice(0,be),..._(e.data)?{data:structuredClone(e.data)}:{}}}function Xh(e){if(!qh.includes(e))throw new p("Corrupt MCP task record",f.invalidParams);return e}function Yh(e){if(typeof e!="string"||e.length===0)throw new p("Corrupt MCP task record",f.invalidParams);return e}function Jh(e){if(typeof e!="number"||!Number.isSafeInteger(e)||e<1)throw new p("Corrupt MCP task record",f.invalidParams);return e}function Zh(e){if(e!==null&&(typeof e!="number"||!Number.isSafeInteger(e)||e<0))throw new p("Corrupt MCP task record",f.invalidParams);return e}function Qh(e){if(e!==void 0){if(typeof e!="number"||!Number.isSafeInteger(e)||e<0)throw new p("Corrupt MCP task record",f.invalidParams);return e}}function eg(e){if(!Array.isArray(e)||e.some(t=>typeof t!="string"))throw new p("Corrupt MCP task record",f.invalidParams);return[...e]}function tg(e){if(!_(e)||e.version!==1)throw new p("Corrupt MCP task record",f.invalidParams);let t=typeof e.taskId=="string"?ye(e.taskId):"",r=Xh(e.status),n=Yh(e.principal),o=Jh(e.workerPid),i=Zh(e.ttlMs),s=Qh(e.pollIntervalMs),a={version:1,taskId:t,status:r,principal:n,workerPid:o,createdAt:mr(e.createdAt,"createdAt"),lastUpdatedAt:mr(e.lastUpdatedAt,"lastUpdatedAt"),ttlMs:i,consumedInputKeys:eg(e.consumedInputKeys),...typeof e.statusMessage=="string"?{statusMessage:e.statusMessage.slice(0,be)}:{},...typeof s=="number"?{pollIntervalMs:s}:{}};if(_(e.inputRequests)&&(a.inputRequests=structuredClone(e.inputRequests)),_(e.inputResponses)&&(a.inputResponses=structuredClone(e.inputResponses)),_(e.result)&&(a.result=structuredClone(e.result)),e.error!==void 0&&(a.error=_r(e.error)),a.status==="input_required"&&!a.inputRequests||a.status==="completed"&&!a.result||a.status==="failed"&&!a.error)throw new p("Corrupt MCP task status payload",f.invalidParams,{status:a.status});return a}function K(e){let t={taskId:e.taskId,status:e.status,createdAt:e.createdAt,lastUpdatedAt:e.lastUpdatedAt,ttlMs:e.ttlMs,...e.statusMessage?{statusMessage:e.statusMessage}:{},...e.pollIntervalMs===void 0?{}:{pollIntervalMs:e.pollIntervalMs}};return e.status==="input_required"?{...t,status:"input_required",inputRequests:structuredClone(e.inputRequests)}:e.status==="completed"?{...t,status:"completed",result:structuredClone(e.result)}:e.status==="failed"?{...t,status:"failed",error:structuredClone(e.error)}:e.status==="cancelled"?{...t,status:"cancelled"}:{...t,status:"working"}}function ne(e){return e==="completed"||e==="failed"||e==="cancelled"}function rg(e){try{return process.kill(e,0),!0}catch(t){return!(typeof t=="object"&&t!==null&&"code"in t&&t.code==="ESRCH")}}var nt=class{#e;#t;#r;#n;#i;constructor(t){this.#e=fr.resolve(t.pmRoot),this.#t=t.owner?.trim()||"pm-mcp",this.#r=t.now??(()=>new Date),this.#n=t.taskIdFactory??(()=>`mcp-task-${Uh()}`),this.#i=t.workerPid??process.pid}#s(t){return fr.join(this.#e,"runtime","mcp-tasks","records",`${ye(t)}.json`)}async#c(t){try{return tg(JSON.parse(await Bh(this.#s(t),"utf8")))}catch(r){throw pe(r)||r instanceof SyntaxError?rt("Unknown MCP task"):r}}async#a(t){await Le(this.#s(t.taskId),`${JSON.stringify(t,null,2)}
|
|
2
|
+
`)}async#o(t,r,n){let o=ye(t),i=await Fe(this.#e,o,Kh,this.#t,!1,!1,Wh);try{let s=await this.#c(o);if(s.principal!==r)throw rt("Unknown MCP task");let a=n(s);return await this.#a(a),a}finally{await i()}}async create(t){let r=ye(this.#n()),n=t.principal.trim(),o=t.ttlMs===void 0?Vh:t.ttlMs,i=t.pollIntervalMs??Hh;if(n.length===0||o!==null&&(!Number.isSafeInteger(o)||o<0)||!Number.isSafeInteger(i)||i<0)throw new p("Invalid MCP task creation options",f.invalidParams);let s=this.#r().toISOString(),a={version:1,taskId:r,status:"working",createdAt:s,lastUpdatedAt:s,ttlMs:o,pollIntervalMs:i,principal:n,workerPid:this.#i,consumedInputKeys:[],...t.statusMessage?.trim()?{statusMessage:t.statusMessage.trim().slice(0,be)}:{}};return await this.#a(a),{...K(a),resultType:"task"}}async get(t,r){return K(await this.#o(t,r,n=>{if(ne(n.status))return n;let o=this.#r().getTime(),i=n.ttlMs!==null&&Date.parse(n.createdAt)+n.ttlMs<=o,s=n.workerPid!==this.#i&&!rg(n.workerPid);return!i&&!s?n:{...n,status:"failed",statusMessage:i?"Task retention expired before completion.":"Task worker ended before recording a terminal result.",lastUpdatedAt:this.#r().toISOString(),error:{code:-32603,message:i?"MCP task expired":"MCP task worker unavailable after restart",data:{recoverable:!1,createNewTask:!0}},inputRequests:void 0}}))}async requireInput(t){let r=tt(t.inputRequests,t.requestContext);return K(await this.#o(t.taskId,t.principal,n=>{if(ne(n.status))return n;let o=Object.keys(r).filter(i=>n.consumedInputKeys.includes(i));if(o.length>0)throw new p("MCP task input request keys must be unique for the task lifetime",f.invalidParams,{reused:o});return{...n,status:"input_required",statusMessage:t.statusMessage?.trim().slice(0,be),lastUpdatedAt:this.#r().toISOString(),inputRequests:r}}))}async update(t,r,n){let o=ur(n),i=[],s=[];return await this.#o(t,r,a=>{if(a.status!=="input_required"||!a.inputRequests)return a;let c={...a.inputRequests},d=a.inputResponses?{...a.inputResponses}:{};for(let[l,u]of Object.entries(o))Object.prototype.hasOwnProperty.call(c,l)&&(d[l]=u,delete c[l],i.push(l));return s=Object.keys(c).sort(),i.length===0?a:{...a,status:s.length===0?"working":"input_required",lastUpdatedAt:this.#r().toISOString(),inputRequests:s.length===0?void 0:c,inputResponses:d,consumedInputKeys:[...new Set([...a.consumedInputKeys,...i])].sort()}}),{acceptedKeys:i.sort(),remainingKeys:s}}async takeInputResponses(t,r){let n={};return await this.#o(t,r,o=>(n=structuredClone(o.inputResponses??{}),Object.keys(n).length===0?o:{...o,inputResponses:void 0})),n}async complete(t,r,n){return K(await this.#o(t,r,o=>ne(o.status)?o:{...o,status:"completed",statusMessage:"Task completed.",lastUpdatedAt:this.#r().toISOString(),result:structuredClone(n),inputRequests:void 0,error:void 0}))}async fail(t,r,n){let o=_r(n);return K(await this.#o(t,r,i=>ne(i.status)?i:{...i,status:"failed",statusMessage:o.message,lastUpdatedAt:this.#r().toISOString(),error:o,inputRequests:void 0,result:void 0}))}async cancel(t,r){return K(await this.#o(t,r,n=>ne(n.status)?n:{...n,status:"cancelled",statusMessage:"Task cancelled by the client.",lastUpdatedAt:this.#r().toISOString(),inputRequests:void 0,result:void 0,error:void 0}))}};function ck(e){return new nt(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]="cb791784-bde2-5b1d-b5df-038282816043")}catch{}})();var Ce="io.modelcontextprotocol/subscriptionId",hr=256,gr=2048,ng=5e3;function og(e,t){return new Promise((r,n)=>{let o=setTimeout(()=>n(new Error("MCP subscription sink write timed out")),ng);o.unref(),Promise.resolve().then(()=>e(t)).then(()=>{clearTimeout(o),r()},i=>{clearTimeout(o),n(i instanceof Error?i:new Error(String(i)))})})}function ot(e,t){if(e!==void 0){if(typeof e!="boolean")throw new p("Invalid MCP subscription filter",f.invalidParams,{field:`notifications.${t}`,expected:"boolean"});return e||void 0}}function ig(e){if(!_(e))throw new p("Invalid MCP subscription filter",f.invalidParams,{field:"notifications",expected:"object"});let t=ot(e.toolsListChanged,"toolsListChanged"),r=ot(e.promptsListChanged,"promptsListChanged"),n=ot(e.resourcesListChanged,"resourcesListChanged"),o;if(e.resourceSubscriptions!==void 0){if(!Array.isArray(e.resourceSubscriptions)||e.resourceSubscriptions.length>hr)throw new p("Invalid MCP resource subscriptions",f.invalidParams,{field:"notifications.resourceSubscriptions",maximum:hr});let i=new Set;for(let s of e.resourceSubscriptions){if(typeof s!="string"||s.trim().length===0||Buffer.byteLength(s,"utf8")>gr)throw new p("Invalid MCP resource subscription URI",f.invalidParams,{field:"notifications.resourceSubscriptions",maximumBytes:gr});i.add(s)}i.size>0&&(o=[...i].sort())}return{...t?{toolsListChanged:t}:{},...r?{promptsListChanged:r}:{},...n?{resourcesListChanged:n}:{},...o?{resourceSubscriptions:o}:{}}}function sg(e,t){return{...e.toolsListChanged&&t.tools?.listChanged?{toolsListChanged:!0}:{},...e.promptsListChanged&&t.prompts?.listChanged?{promptsListChanged:!0}:{},...e.resourcesListChanged&&t.resources?.listChanged?{resourcesListChanged:!0}:{},...e.resourceSubscriptions&&t.resources?.subscribe?{resourceSubscriptions:[...e.resourceSubscriptions]}:{}}}var yr=class{#e;#t=new Map;#r;constructor(t){this.#e=structuredClone(t.capabilities),this.#r={...t.serverInfo}}get size(){return this.#t.size}async open(t){if(this.#t.has(t.id))throw new p("MCP subscription id is already active",f.invalidParams,{subscriptionId:t.id});let r=sg(ig(t.notifications),this.#e),n={filter:r,sink:t.sink,writeQueue:Promise.resolve()};this.#t.set(t.id,n);try{await this.#n(t.id,n,{jsonrpc:"2.0",method:"notifications/subscriptions/acknowledged",params:{_meta:{[Ce]:t.id},notifications:structuredClone(r)}},!0)}catch(o){throw this.#t.delete(t.id),o}return structuredClone(r)}async emitListChanged(t){let r=`${t}ListChanged`,n=`notifications/${t}/list_changed`,o=[];for(let[i,s]of this.#t)s.filter[r]===!0&&o.push(this.#n(i,s,{jsonrpc:"2.0",method:n,params:{_meta:{[Ce]:i}}}));return(await Promise.all(o)).filter(Boolean).length}async emitResourceUpdated(t){let r=[];for(let[n,o]of this.#t)o.filter.resourceSubscriptions?.includes(t)&&r.push(this.#n(n,o,{jsonrpc:"2.0",method:"notifications/resources/updated",params:{_meta:{[Ce]:n},uri:t}}));return(await Promise.all(r)).filter(Boolean).length}async#n(t,r,n,o=!1){let i=r.writeQueue.then(async()=>{if(this.#t.get(t)!==r)return!1;try{return await og(r.sink,n),!0}catch(s){if(this.#t.get(t)===r&&this.#t.delete(t),o)throw s;return!1}});return r.writeQueue=i.then(()=>{},()=>{}),i}close(t){if(this.#t.delete(t))return{...Ze({resultType:"complete",_meta:{[Ce]:t}},this.#r)}}closeAll(){let t=[];for(let r of this.#t.keys()){let n=this.close(r);t.push({id:r,result:n})}return t}};(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="5ffe7128-0fbb-59af-89ef-74d5d799a00d")}catch{}})();var br=/^=\?base64\?([A-Za-z0-9+/]*={0,2})\?=$/u,ag=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/u,Cr=/^[\t\x20-\x7E]*$/u,Tr=new Set(["prompts/get","resources/read","tools/call"]);function cg(e){let t=new Map;for(let[r,n]of Object.entries(e)){if(n===void 0)continue;let o=typeof n=="string"?n:n.join(", ");t.set(r.toLowerCase(),o)}return t}function A(e,t){throw new p(e,f.headerMismatch,{header:t})}function wr(e){let t=typeof e=="boolean"?String(e).toLowerCase():String(e);return t.length>0&&t.trim()===t&&Cr.test(t)&&!br.test(t)?t:`=?base64?${Buffer.from(t,"utf8").toString("base64")}?=`}function Sr(e,t){let r=br.exec(e);if(r){let n=r[1],o=Buffer.from(n,"base64");return o.toString("base64")!==n||o.length===0?A("Malformed MCP Base64 header value",t):o.toString("utf8")}return e.length===0||e.trim()!==e||!Cr.test(e)?A("Malformed MCP header value",t):e}function Te(e){return Array.isArray(e)?e.some(Te):_(e)?Object.prototype.hasOwnProperty.call(e,"x-mcp-header")||Object.values(e).some(Te):!1}function dg(e,t,r){let n=e["x-mcp-header"];if(n===void 0)return;let o=e.type;if(typeof n!="string"||!ag.test(n)||!["boolean","integer","string"].includes(String(o))||r.has(n.toLowerCase()))throw new p("Invalid MCP x-mcp-header annotation",f.invalidParams,{field:t.join("."),annotation:n});return r.add(n.toLowerCase()),{name:n,path:t,type:o}}function Er(e){if(!_(e))throw new p("Invalid MCP tool schema",f.invalidParams,{field:"inputSchema",expected:"object"});let t=[],r=new Set,n=(o,i)=>{let s=o.properties;if(s!==void 0){if(!_(s))throw new p("Invalid MCP tool schema properties",f.invalidParams,{field:"inputSchema.properties"});for(let[a,c]of Object.entries(s)){if(!_(c))continue;let d=[...i,a],l=dg(c,d,r);l&&t.push(l);for(let[u,m]of Object.entries(c))if(u!=="properties"&&u!=="x-mcp-header"&&Te(m))throw new p("MCP x-mcp-header is not statically reachable",f.invalidParams,{field:d.join("."),keyword:u});n(c,d)}}};for(let[o,i]of Object.entries(e))if(o!=="properties"&&Te(i))throw new p("MCP x-mcp-header is not statically reachable",f.invalidParams,{field:"inputSchema",keyword:o});return n(e,[]),t}function Ar(e,t){let r=e;for(let n of t){if(!_(r))return;r=r[n]}return r}function xr(e,t){let r=e==="resources/read"?t.uri:t.name;return typeof r=="string"?r:void 0}function lg(e,t){let r=_(e.arguments)?e.arguments:{},n={};for(let o of Er(t)){let i=Ar(r,o.path);if(i==null)continue;if(!(o.type==="integer"&&typeof i=="number"&&Number.isSafeInteger(i)||o.type==="boolean"&&typeof i=="boolean"||o.type==="string"&&typeof i=="string"))throw new p("Invalid MCP custom header argument",f.invalidParams,{field:o.path.join("."),expected:o.type});n[`Mcp-Param-${o.name}`]=wr(i)}return n}function fk(e){let t=_(e.request.params)?e.request.params:void 0,r=Je(t),n=e.request.method;if(typeof n!="string"||n.length===0)return A("Missing MCP request method","Mcp-Method");let o={Accept:"application/json, text/event-stream","Content-Type":"application/json","MCP-Protocol-Version":r.protocolVersion,"Mcp-Method":n},i=xr(n,t);if(Tr.has(n)){if(i===void 0)return A("Missing MCP request name","Mcp-Name");o["Mcp-Name"]=wr(i)}return n==="tools/call"&&e.toolSchema!==void 0&&Object.assign(o,lg(t,e.toolSchema)),o}function ug(e,t){let r=t.method;(typeof r!="string"||r.length===0)&&A("Missing MCP request method","Mcp-Method");let n=_(t.params)?t.params:void 0,o=Je(n).protocolVersion;if(e.get("mcp-protocol-version")!==o&&A("MCP protocol header does not match request metadata","MCP-Protocol-Version"),e.get("mcp-method")!==r&&A("MCP method header does not match request body","Mcp-Method"),Tr.has(r)){let i=e.get("mcp-name"),s=xr(r,n);(i===void 0||s===void 0||Sr(i,"Mcp-Name")!==s)&&A("MCP name header does not match request body","Mcp-Name")}e.has("last-event-id")&&A("MCP SSE resumability is not supported","Last-Event-ID")}function pg(e,t,r){return e.type==="integer"?typeof t=="number"&&Number.isSafeInteger(t)&&Number(r)===t:e.type==="boolean"?typeof t=="boolean"&&r===String(t):typeof t=="string"&&r===t}function fg(e){let t=_(e.params.arguments)?e.params.arguments:{};for(let r of Er(e.toolSchema)){let n=Ar(t,r.path),o=`Mcp-Param-${r.name}`,i=e.headers.get(o.toLowerCase());if(n==null){i!==void 0&&A("Unexpected MCP parameter header",o);continue}i===void 0&&A("Missing MCP parameter header",o),pg(r,n,Sr(i,o))||A("MCP parameter header does not match request body",o)}}function mk(e){let t=cg(e.headers),r=typeof e.request.method=="string"?e.request.method:"";ug(t,e.request),!(r!=="tools/call"||e.toolSchema===void 0)&&fg({headers:t,params:e.request.params,toolSchema:e.toolSchema})}var _k=H;import{AsyncLocalStorage as mg}from"node:async_hooks";import{createHash as Or,timingSafeEqual as _g}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]="a9aefc86-a8ce-5ecf-bb54-e5fa3ea277c7")}catch{}})();var y=class extends Error{httpStatus;challenge;constructor(t,r,n){super(t),this.name="PmMcpAuthorizationError",this.httpStatus=r,this.challenge=n}},hg=/^00-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})$/u,gg=/^[a-z][a-z0-9_*/-]{0,255}$/u,yg=/^(?:[a-z0-9][a-z0-9_*/-]{0,240})@[a-z][a-z0-9_*/-]{0,13}$/u,bg=/^[\x20-\x2B\x2D-\x3C\x3E-\x7E]{0,255}[\x21-\x2B\x2D-\x3C\x3E-\x7E]$/u,Ir=/^[\x21\x23-\x5B\x5D-\x7E]+$/u,vr=/^[A-Za-z0-9!#$%&'*+.^_`|~-]+$/u,Cg=/^[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]*$/u,Tg=/%(?![0-9A-Fa-f]{2})/u,wg=512,Sg=32,Eg=180,Ag=8192,xg=8192,Pr=new mg;function E(e,t,r=!1){if(new RegExp("\\p{Cc}","u").test(e))throw new y(`Invalid ${t}`,401);let n;try{n=new URL(e)}catch{throw new y(`Invalid ${t}`,401)}let o=n.hostname==="127.0.0.1"||n.hostname==="localhost";if(n.hash.length>0||n.protocol!=="https:"&&!(r&&o&&n.protocol==="http:"))throw new y(`Invalid ${t}`,401);return n}function Og(e,t){let r=t.toLowerCase();for(let[n,o]of Object.entries(e))if(!(n.toLowerCase()!==r||o===void 0))return typeof o=="string"?o:o.join(", ")}function Ck(e){let t=E(e.resource,"protected resource URI",!0).href.replace(/\/$/u,"");if(e.authorizationServers.length===0)throw new y("Protected resource metadata requires an authorization server",401);let r=e.authorizationServers.map(o=>E(o,"authorization server issuer").href.replace(/\/$/u,"")),n=[...new Set(e.scopes??[])];if(n.some(o=>!Ir.test(o)))throw new y("Invalid authorization scope",401);return{resource:t,authorization_servers:r,...n.length>0?{scopes_supported:n.sort()}:{}}}function Tk(e){let t=E(e,"authorization server issuer"),r=t.pathname.replace(/^\/+|\/+$/gu,""),n=t.origin;return r?[`${n}/.well-known/oauth-authorization-server/${r}`,`${n}/.well-known/openid-configuration/${r}`,`${n}/${r}/.well-known/openid-configuration`]:[`${n}/.well-known/oauth-authorization-server`,`${n}/.well-known/openid-configuration`]}function wk(e,t){if(!_(e)||typeof e.issuer!="string")throw new y("Invalid authorization server metadata",401);let r=E(t,"expected issuer").href.replace(/\/$/u,"");if(E(e.issuer,"metadata issuer").href.replace(/\/$/u,"")!==r)throw new y("Authorization server issuer mismatch",401);if(!Array.isArray(e.code_challenge_methods_supported)||!e.code_challenge_methods_supported.includes("S256"))throw new y("Authorization server does not support required S256 PKCE",401);let o=d=>{let l=e[d];if(typeof l!="string")throw new y(`Authorization server metadata requires ${d}`,401);return E(l,d).href},i=d=>{let l=e[d];return typeof l=="string"?E(l,d).href:void 0},s=o("authorization_endpoint"),a=o("token_endpoint"),c=i("registration_endpoint");return{issuer:r,authorization_endpoint:s,token_endpoint:a,code_challenge_methods_supported:[...new Set(e.code_challenge_methods_supported.filter(d=>typeof d=="string"))],...e.client_id_metadata_document_supported===!0?{client_id_metadata_document_supported:!0}:{},...c?{registration_endpoint:c}:{}}}function Sk(e){return e.hasPreRegisteredClient?"pre_registered":e.metadata.client_id_metadata_document_supported?"client_id_metadata_document":e.metadata.registration_endpoint?"dynamic":"user_supplied"}function Ek(e){if(e.responseIssuer===void 0){if(e.issuerParameterSupported)throw new y("Authorization response omitted the advertised issuer",401);return}if(e.responseIssuer!==e.expectedIssuer)throw new y("Authorization response issuer mismatch",401)}function Ak(e,t){let r=E(t,"client metadata document URL");if(r.pathname==="/"||!_(e)||e.client_id!==r.href||typeof e.client_name!="string"||e.client_name.trim().length===0||!Array.isArray(e.redirect_uris)||e.redirect_uris.length===0)throw new y("Invalid Client ID Metadata Document",401);for(let n of e.redirect_uris){if(typeof n!="string")throw new y("Invalid client redirect URI",401);E(n,"client redirect URI",!0)}return structuredClone(e)}function xk(e){if(e.redirectUris.length===0||e.clientName.trim().length===0)throw new y("Invalid dynamic client registration metadata",401);let t=e.redirectUris.map(r=>E(r,"redirect URI",!0).href);return{application_type:e.applicationType,client_name:e.clientName.trim().slice(0,128),redirect_uris:t,grant_types:["authorization_code","refresh_token"],response_types:["code"],token_endpoint_auth_method:"none"}}var Rr=class{#e=new Map;set(t,r){let n=E(t,"credential issuer").href;this.#e.set(n,structuredClone(r))}get(t){let r=E(t,"credential issuer").href,n=this.#e.get(r);return n?structuredClone(n):void 0}delete(t){let r=E(t,"credential issuer").href;return this.#e.delete(r)}};function Rg(e){let t=e.traceparent,r=e.tracestate;if(t!==void 0){let n=typeof t=="string"?hg.exec(t):null;if(!n)throw new y("Invalid MCP traceparent",403);let o=n[1],i=n[2];if(/^0+$/u.test(o)||/^0+$/u.test(i))throw new y("Invalid MCP traceparent",403)}if(r!==void 0&&(typeof r!="string"||!vg(r)))throw new y("Invalid MCP tracestate",403);return{...typeof t=="string"?{traceparent:t}:{},...typeof r=="string"?{tracestate:r}:{}}}function $(e){return e.replace(/^[ \t]*|[ \t]*$/gu,"")}function Ig(e){return gg.test(e)||yg.test(e)}function vg(e){if(Buffer.byteLength(e,"utf8")>wg)return!1;let t=e.split(",");if(t.length>Sg)return!1;let r=new Set;for(let n of t){let o=$(n);if(o.length===0)continue;let i=o.indexOf("="),s=i>0?o.slice(0,i):"",a=i>0?o.slice(i+1):"";if(!Ig(s)||!bg.test(a)||r.has(s))return!1;r.add(s)}return!0}function kr(e){return Cg.test(e)&&!Tg.test(e)}function Pg(e){let t=$(e),r=t.indexOf("="),n=$(r>=0?t.slice(0,r):t),o=r>=0?$(t.slice(r+1)):void 0;return vr.test(n)&&(o===void 0||kr(o))}function kg(e){let t=$(e),r=t.split(";"),n=r[0],o=r.slice(1),i=n.indexOf("="),s=$(i>0?n.slice(0,i):""),a=i>0?$(n.slice(i+1)):"";if(!(!vr.test(s)||!kr(a)||!o.every(Pg)))return{key:s,serialized:t}}function Mg(e,t){if(e===void 0)return;if(typeof e!="string"||Buffer.byteLength(e,"utf8")>Ag)throw new y("Invalid MCP baggage",403);let r=new Set(t),n=e.split(",");if(n.length>Eg)throw new y("Invalid MCP baggage",403);let o=[];for(let i of n){let s=kg(i);if(!s)throw new y("Invalid MCP baggage",403);r.has(s.key)&&o.push(s.serialized)}return o.length>0?o.join(","):void 0}function Ok(e,t={}){let r=_(e)&&_(e._meta)?e._meta:{},n=Mg(r.baggage,t.baggageAllowlist??[]);return{...Rg(r),...n?{baggage:n}:{}}}function Rk(e,t){return Pr.run(structuredClone(e),t)}function Ik(){let e=Pr.getStore();return e?{...e}:void 0}async function vk(e){let t=E(e.policy.resourceMetadataUrl,"protected resource metadata URL",!0).href,r=[...new Set(e.policy.requiredScopes??[])];if(r.some(u=>!Ir.test(u)))throw new y("Invalid authorization scope",401);let n=`Bearer resource_metadata="${t}"`;if(new URL(e.requestUrl,e.policy.resource).searchParams.has("access_token"))throw new y("Access tokens must not appear in URI query parameters",401,n);let s=Og(e.headers,"authorization")?.match(/^Bearer ([^\s]+)$/iu);if(!s)throw new y("Missing or malformed bearer token",401,n);let a=s[1];if(Buffer.byteLength(a,"utf8")>xg)throw new y("Missing or malformed bearer token",401,n);let c;try{c=await e.policy.verifyAccessToken(a)}catch{throw new y("Invalid bearer token",401,n)}let d=Array.isArray(c.audience)?c.audience:[c.audience];if(c.issuer!==e.policy.issuer||!d.includes(e.policy.resource))throw new y("Bearer token issuer or audience mismatch",401,n);let l=r.filter(u=>!c.scopes.includes(u));if(l.length>0)throw new y("Bearer token has insufficient scope",403,`${n}, scope="${l.join(" ")}"`);return{...c,audience:[...d],scopes:[...c.scopes]}}function Pk(e){let t=Or("sha256").update(e.token).digest();return r=>{let n=Or("sha256").update(r).digest();if(!_g(t,n))throw new y("Invalid bearer token",401);return structuredClone(e.claims)}}(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]="e6c49c89-781e-59a3-9c19-6a1c40424587")}catch{}})();var it="io.modelcontextprotocol/ui",we="2026-01-26",Lr="text/html;profile=mcp-app",Mr=Object.freeze({specVersion:we,mimeTypes:[Lr]});function Nk(e){let t=e.clientCapabilities.extensions;if(!_(t))return!1;let r=t[it];if(r===void 0)return!1;if(!_(r))throw new p("Invalid MCP Apps client capability",f.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[it]:Mr}}});let n=r.mimeTypes,o=r.specVersion;if(!Array.isArray(n)||!n.includes(Lr)||o!==void 0&&o!==we)throw new p("Unsupported MCP Apps client capability",f.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[it]:Mr}}});return!0}var Ng={csp:{connectDomains:[],resourceDomains:[],frameDomains:[]},permissions:{},prefersBorder:!0},Dr=Object.freeze([{id:"context",name:"Context explorer",description:"Inspect bounded project context, provenance, omissions, and token accounting.",toolName:"pm_context",uri:"ui://pm/context.html"},{id:"graph",name:"Relationship graph",description:"Explore typed relationships, explaining paths, and graph-governance evidence.",toolName:"pm_graph",uri:"ui://pm/graph.html"},{id:"plan",name:"Plan and milestone view",description:"Review durable plan steps, dependencies, decisions, discoveries, and validation state.",toolName:"pm_plan",uri:"ui://pm/plan.html"},{id:"assurance",name:"Assurance dashboard",description:"Inspect validation verdicts, evidence, omissions, and actionable recovery paths.",toolName:"pm_validate",uri:"ui://pm/assurance.html"},{id:"operations",name:"Long-operation view",description:"Inspect durable test and operation results without creating a second task store.",toolName:"pm_test",uri:"ui://pm/operations.html"}].map(e=>({...e,toolMeta:{resourceUri:e.uri,visibility:["model","app"]},resourceMeta:Ng})));function Lk(e){return Dr.find(t=>t.uri===e)}function Dk(e){let t=new Map(Dr.map(r=>[r.toolName,r]));return e.map(r=>{let n=t.get(r.name);return n?{...r,_meta:{...r._meta,ui:n.toolMeta}}:{...r}})}function Nr(e){return e.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function $k(e){let t=Nr(e.name),r=Nr(e.description),n=JSON.stringify({name:`pm-${e.id}-view`,version:we}),o=JSON.stringify(we);return`<!doctype html>
|
|
3
3
|
<html lang="en">
|
|
4
4
|
<head>
|
|
5
5
|
<meta charset="utf-8">
|
|
@@ -22,12 +22,12 @@ import{A as NI,B as hh,C as gh,D as LI,E as DI,a as Qi,b as es,c as ts,d as rs,e
|
|
|
22
22
|
(()=>{"use strict";const MAX=24000,status=document.querySelector("#status"),result=document.querySelector("#result"),input=document.querySelector("#input"),pending=new Map();let nextId=1;const render=(node,value)=>{let text;try{text=typeof value==="string"?value:JSON.stringify(value,null,2)}catch{text="Result could not be serialized."}if(text.length>MAX)text=text.slice(0,MAX)+"\\n\\n[View truncated at "+MAX+" characters; use the authoritative pm tool with a cursor or narrower projection.]";node.textContent=text};const send=(message)=>window.parent.postMessage(message,"*");window.addEventListener("message",event=>{if(event.source!==window.parent||!event.data||event.data.jsonrpc!=="2.0")return;const message=event.data;if(message.id!==undefined&&pending.has(message.id)){pending.get(message.id)(message);pending.delete(message.id);return}if(message.method==="ui/notifications/tool-input"||message.method==="ui/notifications/tool-input-partial"){render(input,message.params?.arguments??message.params);status.textContent="Input received"}else if(message.method==="ui/notifications/tool-result"){render(result,message.params);status.textContent="Current tool result"}else if(message.method==="ui/notifications/tool-cancelled"){status.textContent="Tool call cancelled";status.classList.add("notice")}else if(message.method==="ui/notifications/host-context-changed"&&message.params?.theme){document.documentElement.style.colorScheme=message.params.theme}});const request=(method,params)=>new Promise(resolve=>{const id=nextId++;pending.set(id,resolve);send({jsonrpc:"2.0",id,method,params})});document.querySelector("#copy").addEventListener("click",async()=>{const text=result.textContent+"\\n\\n"+input.textContent;try{await navigator.clipboard.writeText(text);status.textContent="Visible evidence copied"}catch{status.textContent="Clipboard permission unavailable";status.classList.add("notice")}});request("ui/initialize",{appInfo:${n},appCapabilities:{},protocolVersion:${o}}).then(message=>{if(message.error){status.textContent="Host rejected MCP App initialization";status.classList.add("notice");return}send({jsonrpc:"2.0",method:"ui/notifications/initialized"});status.textContent="Connected \u2014 awaiting authoritative result"})})();
|
|
23
23
|
</script>
|
|
24
24
|
</body>
|
|
25
|
-
</html>`}import{createHash as
|
|
26
|
-
`)).digest("hex");n.set(a.name,{uri:`skill://${a.name}/SKILL.md`,frontmatter:
|
|
27
|
-
`)).digest("hex").slice(0,16)}#r(t,r){if(!t)return 0;try{let n=JSON.parse(Buffer.from(t,"base64url").toString("utf8"));return(typeof n!="object"||n===null||!("fingerprint"in n)||n.fingerprint!==this.#t||!("scope"in n)||n.scope!==r||!("offset"in n)||!Number.isInteger(n.offset)||Number(n.offset)<0)&&C("Skill cursor is invalid or stale."),Number(n.offset)}catch(n){if(n instanceof l)throw n;return C("Skill cursor is invalid or stale.")}}#n(t,r){return Buffer.from(JSON.stringify({fingerprint:this.#t,offset:t,scope:r})).toString("base64url")}static async load(t){let r=await kr(P.join(t.packageRoot,".agents","skills"),"package",t.packageVersion);if(t.workspaceRoot){let n=P.resolve(t.packageRoot,".agents","skills"),o=P.resolve(t.workspaceRoot,".agents","skills");if(o!==n){let i=await kr(o,"workspace",t.packageVersion);for(let[s,a]of i)r.set(s,a)}}return new e(r)}list(t={}){let r=t.limit??I.defaultPageSize;Pr.has(r)||C(`Skill list limit must be an integer from 1 to ${I.maxPageSize}.`);let n=this.#r(t.cursor,"skills/list"),o=[...this.#e.values()].sort((c,d)=>c.uri.localeCompare(d.uri)),i=o.slice(n,n+r),s=n+i.length,a=s<o.length;return{skills:i.map(vr),hasMore:a,...a?{nextCursor:this.#n(s,"skills/list")}:{}}}get(t){let r=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)\/SKILL\.md$/u.exec(t),n=r?this.#e.get(r[1]):void 0;return n||C(`Unknown pm MCP skill: ${t}.`,{field:"uri"}),vr(n)}read(t){let r=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)\/(.+)$/u.exec(t),n=r?this.#e.get(r[1]):void 0,o=r?.[2]??"",i=n&&o?n.files.get(o):void 0,s=n?.resources.find(d=>d.uri===t);(!n||!i||!s)&&C(`Unknown pm MCP skill resource: ${t}.`,{field:"uri"});let a={digest:s.digest,origin:n._meta.origin,trust:"untrusted"},c=Mr(o,i);return c!=="application/octet-stream"?{contents:[{uri:t,mimeType:c,text:i.toString("utf8"),_meta:a}]}:{contents:[{uri:t,mimeType:c,blob:i.toString("base64"),_meta:a}]}}readDirectory(t,r={}){let n=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)(?:\/(.+))?$/u.exec(t),o=n?this.#e.get(n[1]):void 0;o||C(`Unknown pm MCP skill directory: ${t}.`,{field:"uri"});let i=(n?.[2]??"").replace(/\/$/u,""),s=i.length>0?`${i}/`:"",a=`skill://${n[1]}`,c=new Map;for(let T of o.resources){let S=T.uri.slice(`${a}/`.length);if(!S.startsWith(s))continue;let $=S.slice(s.length),[R,...mt]=$.split("/"),bn=`${a}/${s}${R}`,Tn=o.files.get(`${s}${R}`);c.set(R,{uri:bn,name:R,mimeType:mt.length>0?"inode/directory":Mr(R,Tn)})}i.length>0&&c.size===0&&C(`Unknown pm MCP skill directory: ${t}.`,{field:"uri"});let d=r.limit??I.maxPageSize;Pr.has(d)||C(`Skill directory limit must be an integer from 1 to ${I.maxPageSize}.`);let u=this.#r(r.cursor,t),p=[...c.values()].sort((T,S)=>T.uri.localeCompare(S.uri)),m=p.slice(u,u+d),y=u+m.length,h=y<p.length;return{resources:m,hasMore:h,...h?{nextCursor:this.#n(y,t)}:{}}}};(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="cc0d4dd1-20e8-59d4-acb5-9f8ed639d35f")}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]="fa4eb88d-f50e-59fa-be7f-0cfb42931a73")}catch{}})();var v="https://schema.unbrained.dev/pm/corpus-shape/v1";function B(e,t){if(!Number.isSafeInteger(e)||e<=0)throw new TypeError(`Corpus shape ${t} must be a positive safe integer`);return e}function Z(e,t){if(!Number.isSafeInteger(e)||e<0)throw new TypeError(`Corpus shape ${t} must be a non-negative safe integer`);return e}function Fr(e){if(!(typeof e!="object"||e===null||Object.isFrozen(e))){for(let t of Object.values(e))Fr(t);Object.freeze(e)}}function q(e){if(e.schema!==v)throw new TypeError(`Unsupported corpus shape schema: ${e.schema}`);if(e.name.trim().length===0||e.description.trim().length===0)throw new TypeError("Corpus shape name and description must be non-empty");if(B(e.hierarchy_depth,"hierarchy_depth"),B(e.hierarchy_fanout,"hierarchy_fanout"),Z(e.age_span_days,"age_span_days"),B(e.history_entries_per_item,"history_entries_per_item"),Z(e.comments_per_100_items,"comments_per_100_items"),Z(e.notes_per_100_items,"notes_per_100_items"),Z(e.learnings_per_100_items,"learnings_per_100_items"),B(e.author_cardinality,"author_cardinality"),B(e.component_count,"component_count"),e.edge_kind_mix.length===0||e.edge_kind_mix.some(r=>r.kind.trim().length===0||r.weight<=0))throw new TypeError("Corpus shape edge_kind_mix requires non-empty kinds with positive weights");if(e.terminal_statuses.some(r=>!e.custom_statuses.includes(r)))throw new TypeError("Corpus shape terminal_statuses must be declared in custom_statuses");let t=structuredClone(e);return Fr(t),t}var he=[{kind:"implements",weight:5},{kind:"blocked_by",weight:2},{kind:"discovered_from",weight:2},{kind:"verifies",weight:2},{kind:"supersedes",weight:1},{kind:"related",weight:4}],z=Object.freeze({scratch:q({schema:v,name:"scratch",description:"Seconds-old, shallow project with minimal history.",hierarchy_depth:2,hierarchy_fanout:50,age_span_days:0,history_entries_per_item:1,comments_per_100_items:2,notes_per_100_items:1,learnings_per_100_items:1,edge_kind_mix:[{kind:"related",weight:1}],author_cardinality:2,component_count:1,include_cycles:!1,custom_types:[],custom_statuses:[],terminal_statuses:[],custom_fields:[]}),representative:q({schema:v,name:"representative",description:"Medium-lived project with rich evidence and typed lineage.",hierarchy_depth:5,hierarchy_fanout:8,age_span_days:730,history_entries_per_item:12,comments_per_100_items:30,notes_per_100_items:12,learnings_per_100_items:10,edge_kind_mix:he,author_cardinality:32,component_count:1,include_cycles:!1,custom_types:["Experiment"],custom_statuses:["review"],terminal_statuses:[],custom_fields:["domain"]}),"deep-graph":q({schema:v,name:"deep-graph",description:"Deep typed relationship graph with deterministic cycles.",hierarchy_depth:16,hierarchy_fanout:2,age_span_days:3650,history_entries_per_item:6,comments_per_100_items:15,notes_per_100_items:8,learnings_per_100_items:8,edge_kind_mix:he,author_cardinality:16,component_count:1,include_cycles:!0,custom_types:[],custom_statuses:[],terminal_statuses:[],custom_fields:[]}),"multi-decade":q({schema:v,name:"multi-decade",description:"Thirty-year event history with dense per-item evolution.",hierarchy_depth:6,hierarchy_fanout:6,age_span_days:10958,history_entries_per_item:24,comments_per_100_items:40,notes_per_100_items:20,learnings_per_100_items:16,edge_kind_mix:he,author_cardinality:64,component_count:1,include_cycles:!1,custom_types:["Program"],custom_statuses:["archived"],terminal_statuses:["archived"],custom_fields:["portfolio"]}),"disconnected-archive":q({schema:v,name:"disconnected-archive",description:"Multiple disconnected historical project components.",hierarchy_depth:4,hierarchy_fanout:10,age_span_days:7305,history_entries_per_item:8,comments_per_100_items:10,notes_per_100_items:5,learnings_per_100_items:6,edge_kind_mix:he,author_cardinality:24,component_count:5,include_cycles:!1,custom_types:["Archive"],custom_statuses:["archived"],terminal_statuses:["archived"],custom_fields:["archive_source"]})});function kg(){return Object.keys(z).sort().map(e=>z[e])}function vg(e){let t=e.trim().toLowerCase();if(!Object.hasOwn(z,t))throw new TypeError(`Unknown corpus shape "${e}". Available: ${Object.keys(z).join(", ")}`);return z[t]}var $r=new WeakMap;function Gr(e,t){if(e===0)return[];let r=$r.get(t);r===void 0&&(r=t.edge_kind_mix.flatMap(o=>Array.from({length:o.weight},()=>o.kind)),$r.set(t,r));let n=[r[e%r.length]];return t.include_cycles&&e>2&&e%17===0&&n.push("related"),[...new Set(n)]}function Ng(e,t,r,n=42){if(Z(t,"item index"),B(r,"item count"),t>=r)throw new RangeError(`Corpus item index ${t} exceeds ${r}`);let o=Math.min(e.component_count,r),i=t%o,s=Math.floor(t/o),a=0,c=1;for(let S=0;S<e.hierarchy_depth;S+=1)a=Math.min(Number.MAX_SAFE_INTEGER,a+c),c=Math.min(Number.MAX_SAFE_INTEGER,c*e.hierarchy_fanout);let d=s%a,u=s-d,p=d===0?void 0:i+(u+Math.floor((d-1)/e.hierarchy_fanout))*o,m=Date.UTC(2026,0,1),y=e.age_span_days*864e5,h=new Date(m+(r===1?0:Math.round(t/(r-1)*y))).toISOString(),T=(t*37+n)%100;return{index:t,id:`pm-s${t.toString(36).padStart(7,"0")}`,...p===void 0?{}:{parent:`pm-s${p.toString(36).padStart(7,"0")}`},component:i,timestamp:h,author:`pm-corpus-agent-${(t+n)%Math.min(e.author_cardinality,r)}`,history_entry_count:e.history_entries_per_item,dependency_kinds:Gr(t,e),has_comment:T<e.comments_per_100_items,has_note:T<e.notes_per_100_items,has_learning:T<e.learnings_per_100_items,...e.custom_types.length>0&&t%11===0?{custom_type:e.custom_types[t%e.custom_types.length]}:{},...e.custom_statuses.length>0&&t%13===0?{custom_status:e.custom_statuses[t%e.custom_statuses.length]}:{}}}var et=class{shape;authors=new Set;components=new Set;depths=new Map;childCounts=new Map;edgeKinds={};expectedEdgeKinds={};annotations={comments:0,notes:0,learnings:0};annotationFields;planMismatches=[];itemCount=0;observedDepth=0;observedFanout=0;historyEntryCount=0;firstTimestamp=null;lastTimestamp=null;constructor(t){this.shape=t,this.annotationFields=[["comments","has_comment",t.comments_per_100_items],["notes","has_note",t.notes_per_100_items],["learnings","has_learning",t.learnings_per_100_items]]}recordMismatch(t,r){t&&this.planMismatches.push(r)}recordEdgeKinds(t,r){for(let n of r)t[n]=(t[n]??0)+1}add(t){this.itemCount+=1,this.authors.add(t.author),this.components.add(t.component),this.recordMismatch(this.depths.has(t.id),`duplicate_id:${t.id}`);let r=1;if(t.parent!==void 0){let n=this.depths.get(t.parent);this.recordMismatch(n===void 0,`parent_missing:${t.parent}`),r=(n??0)+1;let o=(this.childCounts.get(t.parent)??0)+1;this.childCounts.set(t.parent,o),this.observedFanout=Math.max(this.observedFanout,o)}this.depths.set(t.id,r),this.observedDepth=Math.max(this.observedDepth,r),this.historyEntryCount+=t.history_entry_count,this.recordMismatch(t.history_entry_count!==this.shape.history_entries_per_item,"history_entries_per_item:drift"),this.firstTimestamp=this.firstTimestamp===null||t.timestamp<this.firstTimestamp?t.timestamp:this.firstTimestamp,this.lastTimestamp=this.lastTimestamp===null||t.timestamp>this.lastTimestamp?t.timestamp:this.lastTimestamp;for(let[n,o]of this.annotationFields)this.annotations[n]+=Number(t[o]);this.recordEdgeKinds(this.edgeKinds,t.dependency_kinds),this.recordEdgeKinds(this.expectedEdgeKinds,Gr(t.index,this.shape))}finish(){let t=Math.min(this.shape.author_cardinality,this.itemCount),r=Math.min(this.shape.component_count,this.itemCount),n=[...this.planMismatches,...this.itemCount===0?["item_count:empty"]:[],...this.authors.size===t?[]:[`author_count:${this.authors.size}!=${t}`],...this.components.size===r?[]:[`component_count:${this.components.size}!=${r}`],...this.observedDepth<=this.shape.hierarchy_depth?[]:[`hierarchy_depth:${this.observedDepth}>${this.shape.hierarchy_depth}`],...this.observedFanout<=this.shape.hierarchy_fanout?[]:[`hierarchy_fanout:${this.observedFanout}>${this.shape.hierarchy_fanout}`]];for(let[s,,a]of this.annotationFields){let c=Math.floor(this.itemCount/100),d=this.itemCount%100,u=c*a+Math.max(0,a+d-100),p=c*a+Math.min(a,d),m=this.annotations[s];(m<u||m>p)&&n.push(`${s}:${m}!in[${u},${p}]`)}let o=new Set([...Object.keys(this.edgeKinds),...Object.keys(this.expectedEdgeKinds)]);for(let s of[...o].sort()){let a=this.edgeKinds[s]??0,c=this.expectedEdgeKinds[s]??0;a!==c&&n.push(`edge_kind:${s}:${a}!=${c}`)}let i=[...new Set(n)];return{shape:this.shape.name,item_count:this.itemCount,author_count:this.authors.size,component_count:this.components.size,hierarchy_depth:this.observedDepth,hierarchy_fanout:this.observedFanout,timestamp_range:{first:this.firstTimestamp,last:this.lastTimestamp},history_entry_count:this.historyEntryCount,annotations:{...this.annotations},edge_kinds:{...this.edgeKinds},matches_declaration:i.length===0,mismatches:i}}};function Ur(e){return new et(e)}function Lg(e,t){let r=Ur(e);for(let n of t)r.add(n);return r.finish()}(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]="cea03617-5e90-5683-a9d1-289087ed4646")}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]="8c9a34bd-b77a-55ab-a5d1-3594cecfeb3f")}catch{}})();async function Dg(){let e=Re(process.cwd(),process.env.PM_PATH);await Ct(e,(t,r)=>St(t,r,{apply_runtime_defaults:!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]="f48b9002-59dc-54d3-95de-36bf0d11b39a")}catch{}})();var jr="https://schema.unbrained.dev/pm/workspace-recipe/v1";function tt(e,t){if(e===null||typeof e=="boolean"||typeof e=="string")return e;if(typeof e=="number"){if(!Number.isFinite(e))throw new Error(`Workspace recipe JSON number must be finite at ${t}`);return e}if(Array.isArray(e))return Object.freeze(e.map((r,n)=>tt(r,`${t}[${n}]`)));if(typeof e!="object"||Object.getPrototypeOf(e)!==Object.prototype&&Object.getPrototypeOf(e)!==null)throw new Error(`Workspace recipe input must contain JSON values at ${t}`);return Object.freeze(Object.fromEntries(Object.entries(e).map(([r,n])=>[r,tt(n,`${t}.${r}`)])))}function Br(e){if(e.schema!==jr)throw new Error(`Unsupported workspace recipe schema: ${e.schema}`);let t=ht(e);if(e.operations.some(r=>r.action.trim().length===0||r.input===null||Array.isArray(r.input)))throw new Error("Workspace recipe operations require an action and object input");return Object.freeze({...t,operations:Object.freeze(e.operations.map((r,n)=>Object.freeze({action:r.action,input:tt(r.input,`operations[${n}].input`)})))})}async function qr(e,t){let r=Br(e);return gt(r,t)}async function $g(e,t){return qr(e,async()=>{let r=[];for(let[n,o]of e.operations.entries())r.push(await t(o,n));return r})}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="a108f4d2-80c3-540e-821c-5acdf68eb7fa")}catch{}})();async function Fg(){await Et()}(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]="340305b6-e3c8-5daa-bfbe-4a9c62a6d039")}catch{}})();var zr=["lines","branches","functions","statements"];function Gg(e,t){if(typeof t!="object"||t===null||Array.isArray(t))throw new TypeError(`Coverage entry for ${e} must be an object.`)}function Ug(e,t,r){if(typeof r!="object"||r===null||Array.isArray(r))throw new TypeError(`Coverage entry ${e} has invalid ${t} counts.`);let n=r;if(typeof n.covered!="number"||typeof n.total!="number"||!Number.isInteger(n.covered)||!Number.isInteger(n.total)||n.covered<0||n.total<n.covered)throw new TypeError(`Coverage entry ${e} has invalid ${t} counts.`);return{covered:n.covered,total:n.total}}function jg(e){if(typeof e!="object"||e===null||Array.isArray(e))throw new TypeError("Coverage summary must be a JSON object.");if(!("total"in e))throw new TypeError("Coverage summary is missing the total entry.");let t=[];for(let[r,n]of Object.entries(e)){Gg(r,n);for(let o of zr){let i=Ug(r,o,n[o]),s=i.total-i.covered;s>0&&t.push({file:r,metric:o,uncovered:s,...i})}}return t}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="3edb1f4f-d26e-51a8-b62a-caffdd3ac44b")}catch{}})();var Bg=["captured_redacted","captured_verbatim"],qg=[{label:"home directory",pattern:/(?:\/home\/|\/Users\/)[^/\s"']+/u},{label:"GitHub token",pattern:/\b(?:gh[oprsu]_[A-Za-z0-9_]{20,})\b/u},{label:"npm token",pattern:/\bnpm_[A-Za-z0-9]{20,}\b/u},{label:"private key",pattern:/-----BEGIN (?:RSA |EC |OPENSSH )?PRIVATE KEY-----/u}];function x(e){return typeof e=="string"&&e.trim().length>0}function zg(e,t){if(typeof t!="object"||t===null||Array.isArray(t))return[{boundary_id:e.id,kind:"invalid_fixture",detail:`${e.fixture_path} must contain a JSON object.`}];let r=t,n=[];r.boundary_id!==e.id&&n.push({boundary_id:e.id,kind:"fixture_boundary_mismatch",detail:`${e.fixture_path} names ${String(r.boundary_id)} instead of ${e.id}.`}),(r.version!==1||!Bg.includes(r.capture_source)||!x(r.capture_provenance)||!Array.isArray(r.redactions)||!r.redactions.every(x)||!("input"in r)||!("observed"in r))&&n.push({boundary_id:e.id,kind:"invalid_fixture",detail:`${e.fixture_path} lacks captured provenance, redaction metadata, input, or observed output.`});let o=JSON.stringify(t);for(let i of qg)i.pattern.test(o)&&n.push({boundary_id:e.id,kind:"unsafe_fixture",detail:`${e.fixture_path} contains a possible ${i.label}.`});return n}function Vg(e,t){let r=Date.parse(e.waiver_expires_at),n=x(e.waiver_reason)&&x(e.waiver_owner)&&e.waiver_expires_at.endsWith("Z")&&yt(e.waiver_expires_at)&&Number.isFinite(r);return{captured:0,waived:n&&r>=t?1:0,findings:n?r<t?[{boundary_id:e.id,kind:"expired_waiver",detail:`Boundary ${e.id} waiver expired at ${e.waiver_expires_at}.`}]:[]:[{boundary_id:e.id,kind:"invalid_waiver",detail:`Boundary ${e.id} waiver requires reason, owner, and an RFC 3339 UTC expiry.`}]}}function Hg(e,t,r){if(!x(e.id)||!x(e.producer)||!x(e.consumer)||!x(e.format))return{captured:0,waived:0,findings:[{boundary_id:x(e.id)?e.id:"unknown",kind:"invalid_boundary",detail:"Each boundary requires non-empty id, producer, consumer, and format."}]};if("fixture_path"in e){let n=t[e.fixture_path],o=x(e.fixture_path)&&e.fixture_path in t?zg(e,n):[{boundary_id:e.id,kind:"missing_fixture",detail:`Boundary ${e.id} fixture ${String(e.fixture_path)} is missing.`}];return{captured:o.length===0?1:0,waived:0,findings:o}}return Vg(e,r)}function Tk(e,t,r=new Date){let n=[];if(e.version!==1||!x(e.inventory_scope)||!Array.isArray(e.boundaries))return{ok:!1,boundary_count:0,captured_count:0,waived_count:0,findings:[{boundary_id:"registry",kind:"invalid_registry",detail:"Boundary registry requires version 1, inventory_scope, and boundaries."}]};let o=new Set,i=0,s=0;for(let a of e.boundaries){if(typeof a!="object"||a===null||Array.isArray(a)){n.push({boundary_id:"unknown",kind:"invalid_boundary",detail:"Each boundary must be a JSON object."});continue}let c=a,d=x(c.id)?c.id:void 0;if(d!==void 0&&o.has(d)){n.push({boundary_id:d,kind:"duplicate_boundary",detail:`Boundary ${d} is inventoried more than once.`});continue}d!==void 0&&o.add(d);let u=Hg(c,t,r.getTime());i+=u.captured,s+=u.waived,n.push(...u.findings)}return n.sort((a,c)=>a.boundary_id!==c.boundary_id?a.boundary_id.localeCompare(c.boundary_id):a.kind.localeCompare(c.kind)),{ok:n.length===0,boundary_count:e.boundaries.length,captured_count:i,waived_count:s,findings:n}}import V from"node:fs";import rt 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]="611e9aba-d08e-5c1a-89c9-c7fda0cc9bc9")}catch{}})();var Vr=300*1e3,Kg=3;function Ak(e){return(e?.trim()||"development").replace(/[^a-zA-Z0-9._-]/g,"_").replace(/^\./,"_")}function xk(e,t){let r=t.trim();if(!/^[a-zA-Z0-9_-][a-zA-Z0-9._-]*$/.test(r))throw new TypeError("Compile-cache generation must be a safe non-empty filename token.");V.mkdirSync(e,{recursive:!0});let n=rt.join(e,r);V.mkdirSync(n,{recursive:!0});let o=new Date;V.utimesSync(n,o,o);let i=V.readdirSync(e).filter(d=>d!==r).flatMap(d=>{try{return[{name:d,mtimeMs:V.statSync(rt.join(e,d)).mtimeMs}]}catch(u){if(u instanceof Error&&"code"in u&&oe(u))return[];throw u}}).sort((d,u)=>u.mtimeMs-d.mtimeMs||d.name.localeCompare(u.name)),s=i.filter(d=>o.getTime()-d.mtimeMs<Vr),a=Math.max(0,Kg-1-s.length),c=i.filter(d=>o.getTime()-d.mtimeMs>=Vr).slice(a).map(d=>d.name).sort((d,u)=>d.localeCompare(u));for(let d of c)V.rmSync(rt.join(e,d),{recursive:!0,force:!0,maxRetries:3,retryDelay:50});return{retained:r,removed:c}}import Hr from"node:fs";import ye 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]="962636b0-ed3b-5ad0-ae0c-904435025986")}catch{}})();var Te="@unbrained/pm-cli",Wg=new Set(["append","claim","changelog","close","close-many","close-task","comments","config","copy","create","dedupe-merge","delete","deps","docs","extension","event","events","files","focus","gc","history-author-acknowledge","history-compact","history-redact","history-repair","init","install","item","learnings","meet","merge","normalize","notes","package","packages","pause-task","plan","profile","reindex","release","remind","restore","schema","start-task","test","test-all","test-runs","test-runs-worker","telemetry","templates","twin","update","update-many","upgrade","vcs","workspace"]),Kr=new Set(["--author","--output-budget","--output-format","--output-include","--output-limit","--output-session","--path","--pm-path"]),it=/\b(\d{4})\.(\d{1,2})\.(\d{1,2})(?:-(\d+))?\b/u;function E(e,t){return e.some(r=>t.includes(r.split("=",1)[0]))}function nt(e,t){return["activate","adopt","adopt-all","deactivate","init","install","migrate","reload","uninstall"].includes(t[0]??"")||E(e,["--activate","--adopt","--adopt-all","--deactivate","--fix-managed-state","--init","--install","--output","--reload","--scaffold","--uninstall"])}var Xg={changelog:(e,t)=>{if(t[0]==="generate")return!E(e,["--check"]);let r=e.indexOf("export");return t[0]==="export"&&(E(e,["--output"])||r>=0&&e[r+1]!==void 0&&!e[r+1].startsWith("-"))},comments:e=>E(e,["--add","--delete","--edit","--file","--stdin"]),config:(e,t)=>(t[0]==="project"||t[0]==="global"?t[1]:t[0])==="set",deps:()=>!1,docs:e=>E(e,["--add","--add-glob","--migrate","--remove"]),duplicates:()=>!1,events:()=>!1,extension:nt,files:(e,t)=>E(e,["--add","--add-glob","--migrate","--remove"])||t[0]==="discover"&&E(e,["--apply"]),health:e=>!E(e,["--check-only","--no-refresh","--skip-vectors"]),learnings:e=>E(e,["--add","--delete","--edit","--file","--stdin"]),merge:(e,t)=>t[0]!=="report",notes:e=>E(e,["--add","--delete","--edit","--file","--stdin"]),package:nt,packages:nt,profile:(e,t)=>t[0]==="apply",schema:(e,t)=>["add-field","add-status","add-type","remove-field","remove-status","remove-type","remap-status","rename-field","rename-type"].includes(t[0]??"")&&!(E(e,["--infer"])&&!E(e,["--apply"])),telemetry:(e,t)=>t.slice(0,2).some(r=>["clear","flush"].includes(r)),templates:(e,t)=>t[0]==="save",test:e=>E(e,["--add","--add-json","--background","--measure","--remove","--resume","--run","--stop"]),validate:e=>E(e,["--auto-fix","--prune-missing"]),vcs:(e,t)=>["abandon","create","merge","propose","ref-create"].includes(t[0]??""),workspace:(e,t)=>t[0]==="snapshot"&&["create","delete","restore"].includes(t[1]??"")};function be(e){let t=e.match(it);return t?[Number(t[1]),Number(t[2]),Number(t[3]),Number(t[4]??0)]:null}function ge(e,t){let r=be(e),n=be(t);if(!r||!n)return null;for(let o=0;o<r.length;o+=1){let i=r[o]-n[o];if(i!==0)return Math.sign(i)}return 0}function ot(e){try{let t=JSON.parse(Hr.readFileSync(e,"utf8"));return typeof t=="object"&&t!==null&&!Array.isArray(t)?t:null}catch{return null}}function Yg(e){let t=[];for(let r of["dependencies","devDependencies","optionalDependencies","peerDependencies"]){let n=e[r];if(typeof n!="object"||n===null)continue;let o=n[Te],i=typeof o=="string"?o.trim():"",s=/^[<!]/u.test(i)?void 0:i.match(it)?.[0];s&&t.push(s)}return t.sort((r,n)=>ge(n,r))[0]}function Jg(e){let r=ot(ye.join(e,"package-lock.json"))?.packages;if(typeof r!="object"||r===null)return;let n=r["node_modules/@unbrained/pm-cli"];if(typeof n!="object"||n===null)return;let o=n.version;return typeof o=="string"?o:void 0}function Zg(e,t){try{let r=Hr.readFileSync(ye.join(e,t),"utf8").split(/\r?\n/u),n=r.findIndex(c=>c.includes(Te));if(n<0)return;let o=r[n].match(/^\s*/u)[0].length,i=[r[n]];for(let c=n+1;c<r.length;c+=1){let d=r[c],u=d.trim(),p=d.match(/^\s*/u)[0].length;if(u.length>0&&p<=o)break;i.push(d)}return i.join(`
|
|
28
|
-
`).match(/^\s*version(?::\s*|\s+)["']?(\d{4}\.\d{1,2}\.\d{1,2}(?:-\d+)?)/mu)?.[1]??i[0].match(it)?.[0]}catch{return}}function Qg(e){let t=[],r=ot(ye.join(e,"package.json")),n=r?Yg(r):void 0;n&&t.push({version:n,source:"package.json"});let i=ot(ye.join(e,"node_modules","@unbrained","pm-cli","package.json"))?.version;typeof i=="string"&&be(i)&&t.push({version:i,source:"installed-package"});let s=Jg(e);s&&be(s)&&t.push({version:s,source:"package-lock.json"});for(let a of["pnpm-lock.yaml","yarn.lock"]){let c=Zg(e,a);c&&t.push({version:c,source:a})}return t}function Wr(e){for(let t=0;t<e.length;t+=1){let r=e[t];if(Kr.has(r)){t+=1;continue}if(!r.startsWith("-"))return{command:r.toLowerCase(),index:t}}}function ey(e){let t=Wr(e);if(!t||E(e,["--help","-h","--dry-run"]))return!1;let{command:r,index:n}=t,o=[];for(let s=n+1;s<e.length;s+=1){let a=e[s];if(Kr.has(a)){s+=1;continue}a.startsWith("-")||o.push(a.toLowerCase())}let i=Xg[r];return i?i(e,o):Wg.has(r)}function ty(e){let t=Wr(e.argv)?.command,r=ey(e.argv),o=Qg(e.projectRoot).filter(a=>ge(a.version,e.executingVersion)!==null).sort((a,c)=>ge(c.version,a.version))[0],i=o!==void 0&&ge(e.executingVersion,o.version)===-1,s=i&&!r?{code:"project_runtime_stale_read",executing_version:e.executingVersion,project_version:o.version,source:o.source,message:"This read is using an older pm runtime than the project requires.",next_steps:[`Run the command through the project's installed ${Te} ${o.version}.`,"Install the project dependencies with its declared package manager if the local executable is missing."]}:void 0;return{compatible:!r||!i||e.allowStale===!0,executing_version:e.executingVersion,...o?{project_version:o.version,source:o.source}:{},...t?{command:t}:{},mutating:r,stale:i,...s?{warning:s}:{},override_applied:i&&r&&e.allowStale===!0}}function kk(e){let t=ty(e);if(t.compatible)return t;throw new b(`pm ${t.executing_version} cannot mutate a project pinned to newer pm ${t.project_version}.`,F.CONFLICT,{code:"project_runtime_stale_mutation",reason:t.source,why:"An older runtime can write storage, history, and merge contracts it does not understand.",nextSteps:[`Run this command through the project's installed ${Te} ${t.project_version}.`,"For an intentional recovery only, set PM_ALLOW_STALE_CLI=1 for this invocation and record why.","Read-only commands remain available without an override."]})}import{createHash as ry}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]="4586a8b2-07c8-53d4-9c5d-ca557ee07977")}catch{}})();var st=1;function H(e){e?.throwIfAborted()}function N(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship graph ${t} must be non-empty`);return e.trim()}function K(e,t,r={}){let n=Date.parse(r.createdAt??new Date().toISOString());if(!Number.isFinite(n))throw new TypeError("Relationship graph createdAt must be a valid timestamp");let o=e.nodes(),i=e.edges(),s=t.list();return Object.freeze({version:st,fingerprint:ry("sha256").update(ie({nodes:o,edges:i,kinds:s})).digest("hex"),created_at:new Date(n).toISOString(),nodes:o,edges:i,kinds:s})}function ny(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ee(e){if(!ny(e))throw new TypeError("Relationship graph snapshot must be an object");if(e.version!==st)throw new TypeError(`Unsupported relationship graph snapshot version: ${String(e.version)}`);if(!Array.isArray(e.nodes)||e.nodes.some(o=>typeof o!="string"))throw new TypeError("Relationship graph snapshot nodes must be strings");if(!Array.isArray(e.edges)||!Array.isArray(e.kinds))throw new TypeError("Relationship graph snapshot edges and kinds must be arrays");if(typeof e.created_at!="string"||!Number.isFinite(Date.parse(e.created_at)))throw new TypeError("Relationship graph snapshot created_at must be valid");if(typeof e.fingerprint!="string")throw new TypeError("Relationship graph snapshot fingerprint must be a string");let t=new Ie([]);for(let o of e.kinds)t.register(o);let r=new G(e.nodes,e.edges,t),n=K(r,t,{createdAt:e.created_at});if(n.fingerprint!==e.fingerprint)throw new TypeError("Relationship graph snapshot fingerprint mismatch");return{snapshot:n,registry:t,graph:r}}async function M(e,t){N(e.name,"adapter name");let r=N(t.workspace,"workspace");H(t.signal);let n=await e.read({...t,workspace:r});return H(t.signal),n===null?null:ee(n)}async function Ce(e,t){let r=N(t.workspace,"workspace"),n=ee(t.snapshot).snapshot,o=await M(e,{workspace:r,signal:t.signal});if(o?.snapshot.fingerprint===n.fingerprint)return{adapter:e.name,workspace:r,disposition:"current",fingerprint:n.fingerprint,previous_fingerprint:o.snapshot.fingerprint,node_count:n.nodes.length,edge_count:n.edges.length};if(H(t.signal),await e.replace({workspace:r,signal:t.signal,snapshot:n,expected_fingerprint:o?.snapshot.fingerprint??null}),(await M(e,{workspace:r,signal:t.signal}))?.snapshot.fingerprint!==n.fingerprint)throw new Error(`Relationship graph adapter "${e.name}" did not expose the replaced snapshot`);return{adapter:e.name,workspace:r,disposition:"written",fingerprint:n.fingerprint,...o?{previous_fingerprint:o.snapshot.fingerprint}:{},node_count:n.nodes.length,edge_count:n.edges.length}}function oy(e,t={}){let r=e.map(ee),n=new Map;for(let s of r)for(let a of s.snapshot.kinds){let c=n.get(a.kind);if(c&&ie(c)!==ie(a))throw new TypeError(`Conflicting federated relationship kind: ${a.kind}`);n.set(a.kind,a)}let o=new Ie([...n.values()].sort((s,a)=>s.kind.localeCompare(a.kind))),i=new G(new Set(r.flatMap(s=>[...s.snapshot.nodes])),r.flatMap(s=>[...s.snapshot.edges]),o);return K(i,o,t)}var Q=class{name;#e=new Map;constructor(t="memory"){this.name=N(t,"adapter name")}async read(t){H(t.signal);let r=this.#e.get(N(t.workspace,"workspace"));return r?structuredClone(r):null}async replace(t){H(t.signal);let r=N(t.workspace,"workspace"),n=this.#e.get(r);if(t.expected_fingerprint!==void 0&&(n?.fingerprint??null)!==t.expected_fingerprint)throw new Error(`Relationship graph adapter conflict for ${r}`);this.#e.set(r,structuredClone(ee(t.snapshot).snapshot))}async clear(t){H(t.signal);let r=N(t.workspace,"workspace"),n=this.#e.get(r);if(t.expected_fingerprint!==void 0&&(n?.fingerprint??null)!==t.expected_fingerprint)throw new Error(`Relationship graph adapter conflict for ${r}`);this.#e.delete(r)}};(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="423d6e5d-93e5-5f29-93e0-11ddca9c3156")}catch{}})();function Xr(e,t){if(!Number.isInteger(e)||e<1)throw new TypeError(`Relationship graph ${t} must be a positive integer`);return e}function iy(e){let t=Xr(e.nodeCount,"nodeCount"),r=Xr(e.edgeStride??1,"edgeStride"),n=e.topology??"chain";if(!["chain","star","disconnected"].includes(n))throw new TypeError(`Unsupported relationship graph topology: ${n}`);let o=(e.kind??"related").trim(),i=(e.idPrefix??"node").trim();if(!o||!i)throw new TypeError("Relationship graph kind and idPrefix must be non-empty");let s=n==="disconnected"?0:Math.floor((t-1)/r);return{node_count:t,edge_count:s,edge_basis:"fixture_generated",nodes:{*[Symbol.iterator](){for(let a=0;a<t;a+=1)yield`${i}-${a}`}},edges:{*[Symbol.iterator](){if(n!=="disconnected")for(let a=r;a<t;a+=r)yield{source:`${i}-${n==="star"?0:a-r}`,target:`${i}-${a}`,kind:o}}}}}function L(e,t){if(!e)throw new Error(`Relationship graph adapter conformance: ${t}`)}async function Yr(e,t={}){let r=t.workspace?.trim()||"pm-graph-conformance",n=bt(),o=K(new G(["a","b"],[{source:"a",target:"b",kind:"related"}],n),n,{createdAt:"2026-01-01T00:00:00.000Z"}),i=K(new G(["a","b","c"],[{source:"a",target:"b",kind:"related"},{source:"b",target:"c",kind:"blocked_by"}],n),n,{createdAt:"2026-01-02T00:00:00.000Z"}),s=[];L(await M(e,{workspace:r})===null,"workspace must start empty"),s.push({name:"empty-read",passed:!0});let a=await Ce(e,{workspace:r,snapshot:o});L(a.disposition==="written","first sync must write"),s.push({name:"atomic-replace",passed:!0}),(await e.read({workspace:r})).nodes.push("mutated-reader-copy"),L((await M(e,{workspace:r}))?.snapshot.nodes.length===2,"reads must not mutate stored state"),s.push({name:"read-isolation",passed:!0}),L((await Ce(e,{workspace:r,snapshot:o})).disposition==="current","identical sync must be idempotent"),s.push({name:"idempotent-sync",passed:!0}),await e.replace({workspace:r,snapshot:i,expected_fingerprint:o.fingerprint}),L((await M(e,{workspace:r}))?.snapshot.fingerprint===i.fingerprint,"replacement must become visible"),s.push({name:"replacement-visibility",passed:!0});let d=!1;try{await e.replace({workspace:r,snapshot:o,expected_fingerprint:o.fingerprint})}catch{d=!0}return L(d,"stale compare-and-swap must fail"),s.push({name:"stale-cas",passed:!0}),e.clear&&(await e.clear({workspace:r,expected_fingerprint:i.fingerprint}),L(await M(e,{workspace:r})===null,"clear must remove the workspace"),s.push({name:"clear",passed:!0})),{adapter:e.name,workspace:r,cases:Object.freeze(s),clear_supported:e.clear!==void 0}}function sy(e){return Yr(new Q,e?{workspace: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]="20842b89-cef6-542e-b069-76c22b340f1d")}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]="5133d678-01f4-5164-aea7-2cc5ed42dd58")}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]="006109f8-cb09-5a91-8929-7ac7521753b6")}catch{}})();var at=2,ay=["self_reported","independent_transport"];function Se(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function te(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`${t} must be a non-empty string`);return e.trim()}function Jr(e,t,r=!1){if(!Array.isArray(e)||e.length===0)throw new TypeError(`${t} must be a non-empty string array`);return e.map((n,o)=>{let i=te(n,`${t}[${String(o)}]`);return r?n:i})}function ct(e,t){return e===void 0?void 0:te(e,t)}function cy(e,t){if(e===void 0)return;if(!Se(e)||Object.keys(e).length===0)throw new TypeError(`${t} must be a non-empty object`);let r=Object.entries(e).map(([n,o])=>{if(n.length===0||n.split(".").some(i=>i.length===0))throw new TypeError(`${t} must use dot-separated own-property paths`);if(o!==null&&typeof o!="string"&&typeof o!="boolean"&&(typeof o!="number"||!Number.isFinite(o)))throw new TypeError(`${t} values must be JSON primitives`);return[n,o]});return Object.fromEntries(r)}function dy(e,t,r,n,o,i){if(n==="refusal"){if($e(r)||o===void 0||i===void 0)throw new TypeError(`${e} refusal steps require a non-success exit, error code, and refusal surface`);return}if(o!==void 0||i!==void 0)throw new TypeError(`${e} only refusal steps may declare expected_error_code or expected_refusal_surface`);let s=Yt(t);if(s===void 0)throw new TypeError(`${e}.args must identify a command after global flags`);let a=vt(s);if(!$e(r)||r!==0&&!a?.exit_codes.some(d=>d===r))throw new TypeError(`${e} successful output must use exit code 0 or a command-declared successful effect exit`);let c=Wt(s).kind;if(n!==c)throw new TypeError(`${e} expected ${n}, but ${s} declares ${c}`)}function uy(e,t,r){if(!Se(e))throw new TypeError(`tasks.${t}.steps[${String(r)}] must be an object`);let n=`tasks.${t}.steps[${String(r)}]`,o=te(e.id,`${n}.id`),i=Jr(e.args,`${n}.args`,!0),s=e.expected_exit_code;if(typeof s!="number"||!Number.isSafeInteger(s))throw new TypeError(`${n}.expected_exit_code must be a safe integer`);let a=e.expected_output_kind;if(a!=="refusal"&&!Kt.includes(a))throw new TypeError(`${n}.expected_output_kind is unsupported`);let c=a,d=e.expected_accounting_mode;if(!ay.includes(d))throw new TypeError(`${n}.expected_accounting_mode is unsupported`);let u=d;if(u==="independent_transport"&&c!=="refusal")throw new TypeError(`${n} independent_transport accounting is supported only for refusal steps`);let p=Jr(e.required_fields,`${n}.required_fields`);if(p.some(S=>S.split(".").some($=>$.length===0)))throw new TypeError(`${n}.required_fields must contain dot-separated own-property paths`);let m=cy(e.expected_field_values,`${n}.expected_field_values`),y=ct(e.expected_error_code,`${n}.expected_error_code`),h=ct(e.expected_refusal_surface,`${n}.expected_refusal_surface`),T=ct(e.recovery_for,`${n}.recovery_for`);return dy(n,i,s,c,y,h),{id:o,args:i,expected_exit_code:s,expected_output_kind:c,expected_accounting_mode:u,required_fields:p,...m?{expected_field_values:m}:{},...y?{expected_error_code:y}:{},...h?{expected_refusal_surface:h}:{},...T?{recovery_for:T}:{}}}function ly(e,t){if(!Se(e))throw new TypeError(`tasks[${String(t)}] must be an object`);let r=te(e.id,`tasks[${String(t)}].id`),n=te(e.description,`tasks.${r}.description`);if(!Array.isArray(e.steps)||e.steps.length===0)throw new TypeError(`tasks.${r}.steps must be a non-empty array`);let o=e.steps.map((s,a)=>uy(s,r,a)),i=new Map;for(let s of o){if(i.has(s.id))throw new TypeError(`tasks.${r} contains duplicate step id ${s.id}`);if(s.recovery_for!==void 0&&(i.get(s.recovery_for)?.expected_output_kind!=="refusal"||s.expected_output_kind==="refusal"))throw new TypeError(`tasks.${r}.${s.id} recovery_for must reference an earlier refusal and declare successful output`);i.set(s.id,s)}if(o.at(-1)?.expected_output_kind==="refusal")throw new TypeError(`tasks.${r} completed task must terminate with successful output`);for(let s of o)if(s.expected_output_kind==="refusal"&&!o.some(a=>a.recovery_for===s.id))throw new TypeError(`tasks.${r}.${s.id} refusal must have a later successful recovery_for step`);return{id:r,description:n,steps:o}}function iv(e){if(!Se(e))throw new TypeError("agent-task transcript corpus must be an object");if(e.version!==at)throw new TypeError(`agent-task transcript corpus version must be ${String(at)}`);if(!Array.isArray(e.tasks)||e.tasks.length===0)throw new TypeError("agent-task transcript corpus tasks must be non-empty");let t=e.tasks.map((n,o)=>ly(n,o)),r=new Set;for(let n of t){if(r.has(n.id))throw new TypeError(`duplicate agent-task transcript id ${n.id}`);r.add(n.id)}return{version:at,tasks:t}}import{createHash as Zr}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]="54a3448c-719c-5404-a9b9-c3072a2fdce2")}catch{}})();function Qr(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship backfill ${t} must be non-empty`);return e.trim()}function dv(e,t){let r=Qr(t.migrationId,"migrationId"),n=Qr(t.author,"author"),o=Date.parse(t.timestamp);if(!Number.isFinite(o))throw new TypeError("Relationship backfill timestamp must be valid");let i=new Date(o).toISOString(),s=De(e,void 0,t.registry),a=s.graph.nodes(),c=s.graph.edges().map(m=>{let y=Zr("sha256").update(JSON.stringify([r,m.kind,m.source,m.target,m.createdAt??null,m.author??null,m.payload??null])).digest("hex").slice(0,24);return Object.freeze({eventId:`backfill:${r}:${y}`,relationshipId:`migration:${r}:${y}`,action:"add",edge:m,author:n,timestamp:i,reason:`Backfill ${r} from legacy item metadata`})}),d=Zr("sha256").update(JSON.stringify({migrationId:r,nodes:a,events:c})).digest("hex"),u=new Set([...t.existingEventIds??[]].filter(m=>typeof m=="string").map(m=>m.trim()).filter(Boolean)),p=c.filter(m=>!u.has(m.eventId));return Object.freeze({migration_id:r,fingerprint:d,nodes:a,events:Object.freeze(p),edge_count:c.length,skipped_existing_count:c.length-p.length,duplicate_dependency_rows:s.duplicateRows.length,dangling_reference_count:s.dangling.active.length+s.dangling.legacy_terminal.length})}import*as en from"node:module";(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]="4f4e7daa-14aa-5dad-8a30-79a4d76159d4")}catch{}})();var re=["suggested_retry","candidate_command","example","next_step","migration_hint","restore_with"],dt={suggested_retry:{kind:"suggested_retry",semantics:"recovery"},retry_command:{kind:"suggested_retry",semantics:"recovery"},candidate_command:{kind:"candidate_command",semantics:"recovery"},candidate_commands:{kind:"candidate_command",semantics:"recovery"},fallback_candidates:{kind:"candidate_command",semantics:"recovery",nested_value_field:"command"},next_best_command:{kind:"candidate_command",semantics:"recovery"},example:{kind:"example",semantics:"recovery"},examples:{kind:"example",semantics:"recovery"},next_step:{kind:"next_step",semantics:"recovery"},next_steps:{kind:"next_step",semantics:"recovery"},suggested_next_steps:{kind:"next_step",semantics:"recovery"},migration_hint:{kind:"migration_hint",semantics:"replacement"},migration_hints:{kind:"migration_hint",semantics:"replacement"},restore_with:{kind:"restore_with",semantics:"behavior_preserving"}},lv=Object.freeze(Object.keys(dt));function tn(e){if(Object.hasOwn(dt,e))return dt[e]}var py=new Set([..."=([{,:;!?&|+-*%^~<>","=>"]);function W(e,t){return e<t?-1:e>t?1:0}function fy(e,t){let r=e[t],n=t+1,o="";for(;n<e.length&&e[n]!==r;)e[n]==="\\"?n+=2:(o+=e[n],n+=1);return e[n]===r&&(n+=1),{next:n,value:o}}function my(e){return e===void 0||e.kind==="punctuator"&&py.has(e.value)||e.kind==="identifier"&&["return","case","throw","else","yield"].includes(e.value)}function _y(e,t){if(/\s/u.test(e[t]))return t+1;if(e.startsWith("//",t)){let r=e.indexOf(`
|
|
29
|
-
`,t+2);return r===-1?e.length:r+1}if(e.startsWith("/*",t))return e.indexOf("*/",t+2)+2}function
|
|
30
|
-
`&&t.push(r+1);return t}function
|
|
31
|
-
`)}(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]="0ec8c375-e58e-5ce4-b0aa-8a8a4dfa0778")}catch{}})();function ky(e){return[e.expected_error_code!==void 0&&e.error_code!==e.expected_error_code?{code:"error_code_mismatch",probe_id:e.probe_id,detail:`Expected error code ${e.expected_error_code}, received ${e.error_code??"<missing>"}.`}:void 0,e.expected_allowed_values!==void 0&&JSON.stringify([...e.allowed_values].sort())!==JSON.stringify([...e.expected_allowed_values].sort())?{code:"incomplete_allowed_values",probe_id:e.probe_id,detail:"The refusal's accepted domain differs from the SDK-owned domain contract."}:void 0,e.expected_suggested_retry_args!==void 0&&(e.suggested_retry_args?.length??0)===0?{code:"missing_suggested_retry_args",probe_id:e.probe_id,detail:"The refusal omitted shell-free suggested retry arguments."}:void 0,e.expected_suggested_retry_args!==void 0&&(e.suggested_retry_args?.length??0)>0&&JSON.stringify(e.suggested_retry_args)!==JSON.stringify(e.expected_suggested_retry_args)?{code:"suggested_retry_args_mismatch",probe_id:e.probe_id,detail:"The refusal's suggested retry arguments differ from the SDK-owned contract."}:void 0]}function vy(e){return[e.exit_code!==F.USAGE?{code:"non_refusal_exit",probe_id:e.probe_id,detail:`${e.entrypoint} returned exit code ${e.exit_code}; a structured usage refusal must return ${F.USAGE}.`}:void 0,e.allowed_values_required!==!1&&e.allowed_values.length===0?{code:"missing_allowed_values",probe_id:e.probe_id,detail:"The refusal omitted its complete accepted value domain."}:void 0,e.allowed_values.includes(e.rejected_value)?{code:"accepted_rejected_value",probe_id:e.probe_id,detail:`${e.rejected_value} is both rejected and advertised as allowed.`}:void 0,e.suggested_retry.trim().length===0?{code:"missing_suggested_retry",probe_id:e.probe_id,detail:"The refusal omitted an executable suggested retry."}:void 0,e.retry_succeeded?void 0:{code:"retry_failed",probe_id:e.probe_id,detail:"The advertised suggested retry did not succeed."},...ky(e)]}function Av(e){let t=[],r=new Set,n=0;e.length===0&&t.push({code:"empty_corpus",probe_id:"corpus",detail:"At least one real refusal observation is required."});for(let o of e){if(r.has(o.probe_id)){t.push({code:"duplicate_probe",probe_id:o.probe_id,detail:`${o.probe_id} was supplied more than once.`});continue}r.add(o.probe_id);let i=t.length;for(let s of vy(o))s!==void 0&&t.push(s);t.length===i&&(n+=1)}return t.sort((o,i)=>o.probe_id!==i.probe_id?o.probe_id.localeCompare(i.probe_id):o.code.localeCompare(i.code)),{ok:t.length===0,probe_count:r.size,closed_probe_count:n,closure_fraction:r.size===0?0:n/r.size,findings:t}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="2e90ea29-2708-5af8-b390-599be97718e7")}catch{}})();var on="not-a-declared-action";function Ny(e,t){if(e.startsWith("assurance ")&&t.name==="kind")return"measurement";switch(t.value_kind){case"integer":return"1";case"item_id":return"pm-domain";case"action":throw new Error(`Cannot synthesize a preceding action value for positional slot ${t.name}.`);default:return"example"}}function lt(e){return e.replaceAll(/[^a-z0-9]+/gu,"-").replaceAll(/^-|-$/gu,"")}function vv(e=Ne.filter(t=>wt.some(r=>r.command===t.command&&r.disposition!=="package_owned"))){return e.flatMap(t=>t.slots.flatMap((r,n)=>{if(!r.required)return[];let o=t.command.split(" "),i=X(t.command).flatMap(a=>a.required?[a.flag,...a.value_name?["example"]:[]]:[]),s=ve.some(a=>a.command===t.command);return[{probe_id:`required-argument-${lt(t.command)}-${lt(r.name)}`,command:t.command,refusal_args:[...o,...t.slots.slice(0,n).map(a=>Ny(t.command,a)),...i],recovery_args:[...o,"--help"],error_code:s&&!t.command.startsWith("assurance ")?"invalid_argument_value":/^extension (?:activate|adopt|deactivate|uninstall)$/u.test(t.command)?"missing_lifecycle_target":"missing_required_argument",missing_argument:r.name,missing_argument_index:n}]})).sort((t,r)=>t.probe_id.localeCompare(r.probe_id))}function Ly(e){switch(e){case"assurance":case"workspace snapshot":return ve.filter(({parent:t})=>t===e).map(({action:t})=>t);case"graph":return Me;case"merge":return ke;case"plan":return Fe;case"profile":return Ge;case"schema":return xt;default:throw new Error(`Required positional action family ${e} has no authoritative value domain.`)}}function Nv(e=Ne){return e.filter(({slots:t})=>t[0]?.required===!0&&t[0].value_kind==="action").map(({command:t})=>{let r=t.split(" ");return{probe_id:`unknown-subcommand-${lt(t)}`,command:t,refusal_args:[...r,on],recovery_args:[...r,"--help"],error_code:"unknown_subcommand",rejected_value:on,allowed_values:[...Ly(t)].sort()}}).sort((t,r)=>t.probe_id.localeCompare(r.probe_id))}function Dy(e,t){let r=[...t].sort();return e.length===t.length&&[...e].sort().every((n,o)=>n===r[o])}function $y(e,t){if(!t)return[{code:"refusal_probe_missing",probe_id:e.probe_id,detail:`${e.probe_id} has no runtime observation.`}];let r=[];return t.error_code!==e.error_code&&r.push({code:"refusal_error_code_mismatch",probe_id:e.probe_id,detail:`${e.probe_id} emitted ${t.error_code||"<none>"}; expected ${e.error_code}.`}),t.exit_code!==2&&r.push({code:"refusal_exit_code_mismatch",probe_id:e.probe_id,detail:`${e.probe_id} exited ${t.exit_code}; expected usage exit 2.`}),"allowed_values"in e&&!Dy(t.allowed_values,e.allowed_values)&&r.push({code:"refusal_allowed_values_mismatch",probe_id:e.probe_id,detail:`${e.probe_id} did not expose its complete action domain.`}),t.recovery_succeeded||r.push({code:"refusal_recovery_failed",probe_id:e.probe_id,detail:`${e.probe_id} help recovery did not succeed.`}),t.refusal_mutated_state&&r.push({code:"refusal_mutated_state",probe_id:e.probe_id,detail:`${e.probe_id} changed tracker state while refusing input${t.mutated_paths?.length?`: ${t.mutated_paths.join(", ")}`:"."}`}),r}function Lv(e,t){let r=new Map(e.map(s=>[s.probe_id,s])),n=new Map(t.map(s=>[s.probe_id,s])),o=[...e.flatMap(s=>$y(s,n.get(s.probe_id))),...t.filter(s=>!r.has(s.probe_id)).map(s=>({code:"unexpected_refusal_probe",probe_id:s.probe_id,detail:`${s.probe_id} has no declared grammar refusal contract.`}))];o.sort((s,a)=>s.probe_id.localeCompare(a.probe_id)||s.code.localeCompare(a.code));let i=new Set(o.map(({probe_id:s})=>s));return{ok:o.length===0,probe_count:e.length,closed_probe_count:e.filter(({probe_id:s})=>!i.has(s)).length,findings: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]="941a11a9-f756-56b3-9dc1-8afd78bc9328")}catch{}})();var pt=[{probe_id:"tracker-root-missing",failure_kind:"missing_root",expected_error_code:"tracker_root_missing",expected_exit_code:3,recovery_kind:"initialize"},{probe_id:"tracker-root-settings-missing",failure_kind:"settings_missing",expected_error_code:"tracker_not_initialized",expected_exit_code:3,recovery_kind:"initialize"},{probe_id:"tracker-root-not-directory",failure_kind:"not_directory",expected_error_code:"tracker_root_not_directory",expected_exit_code:2,recovery_kind:"select_directory"},{probe_id:"tracker-root-unreadable",failure_kind:"unreadable_root",expected_error_code:"tracker_root_unreadable",expected_exit_code:1,recovery_kind:"repair_permissions"}];function $v(){return pt.map(e=>({...e}))}function Fy(e,t){let r=[];t.error_code!==e.expected_error_code&&r.push({code:"error_code_mismatch",probe_id:e.probe_id,detail:`Expected ${e.expected_error_code}, received ${t.error_code}.`}),t.exit_code!==e.expected_exit_code&&r.push({code:"exit_code_mismatch",probe_id:e.probe_id,detail:`Expected exit ${e.expected_exit_code}, received ${t.exit_code}.`}),t.recovery_kind!==e.recovery_kind&&r.push({code:"recovery_kind_mismatch",probe_id:e.probe_id,detail:`Expected ${e.recovery_kind}, received ${t.recovery_kind}.`});let n=t.suggested_retry_args.indexOf("init"),o=n===0||n===2&&t.suggested_retry_args[0]==="--pm-path"&&t.suggested_retry_args[1]?.length>0;return e.recovery_kind==="initialize"&&!o&&r.push({code:"missing_init_recovery",probe_id:e.probe_id,detail:"Missing and uninitialized roots must emit a tokenized init retry."}),(t.unsafe_init_recommended||e.recovery_kind!=="initialize"&&t.suggested_retry_args.includes("init"))&&r.push({code:"unsafe_init_recovery",probe_id:e.probe_id,detail:"A tracker root that cannot be initialized safely must not recommend initialization."}),t.retry_succeeded||r.push({code:"retry_failed",probe_id:e.probe_id,detail:"The emitted retry or safe alternate-root recovery did not execute successfully."}),r}function Fv(e){let t=new Map(e.map(o=>[o.probe_id,o])),r=[],n=0;for(let o of pt){let i=t.get(o.probe_id);if(i===void 0){r.push({code:"missing_probe",probe_id:o.probe_id,detail:"No runtime observation was supplied for this contract."});continue}let s=Fy(o,i);r.push(...s),s.length===0&&(n+=1)}return r.sort((o,i)=>o.probe_id.localeCompare(i.probe_id)||o.code.localeCompare(i.code)),{ok:r.length===0,probe_count:pt.length,closed_probe_count:n,findings:r}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="3466866d-8869-5ab6-b981-d084e7330aa5")}catch{}})();var Ee,Gy=Object.freeze({list:"list-item-projection","list-all":"list-item-projection","list-draft":"list-item-projection","list-open":"list-item-projection","list-in-progress":"list-item-projection","list-blocked":"list-item-projection","list-closed":"list-item-projection","list-canceled":"list-item-projection",get:"get-item-projection",graph:"graph-detail-projection",search:"search-result-projection",history:"history-entry-projection",events:"mutation-event-projection",activity:"activity-entry-projection",deps:"dependency-graph-projection",health:"health-diagnostic-projection",validate:"validation-diagnostic-projection",contracts:"contract-catalog-projection"});function Uy(e,t){if(t==="--limit")return"result-row-limit";if(t==="--node-limit")return"graph-node-limit";if(t==="--edge-limit")return"graph-edge-limit";if(t==="--output-limit")return"rendered-output-row-limit";if(t==="--output-budget")return"rendered-output-byte-budget";if(t==="--token-budget")return"context-intent-token-budget";if(t==="--full"){let r=Gy[e];if(r===void 0)throw new Error(`Command ${e} exposes --full without a registered projection concept.`);return r}return t!=="--file"?t.slice(2):["create","update","update-many"].includes(e)?"linked-file-path":["comments","notes","learnings"].includes(e)?"entry-file-input":"plan-definition-file"}function we(){if(Ee!==void 0)return Ee;let t=Y.filter(({command:i})=>Le(i)).flatMap(({command:i,family:s})=>Ht(i,X(i)).map(a=>({command:i,family:s,concept:Uy(i,a.flag),flag:a.flag,aliases:Object.freeze([...a.aliases??[]]),value_kind:a.repeatable?"list":a.flag==="--limit"?"number":a.value_type}))),r=new Set(t.flatMap(i=>i.aliases.map(s=>`${i.command}:${s}`))),n=t.filter(i=>!r.has(`${i.command}:${i.flag}`)),o=new Map;for(let i of n){let s=o.get(i.concept)??new Set;s.add(i.value_kind),o.set(i.concept,s)}return Ee=Object.freeze(n.map(i=>Object.freeze({...i,concept:o.get(i.concept)?.size===1?i.concept:`${i.concept}@${i.command}`}))),Ee}function qv(){return Object.freeze(we().map(e=>Object.freeze({command:e.command,canonical_flag:e.flag,accepted_spellings:Object.freeze([...new Set([e.flag,...e.aliases])].sort())})))}var sn=Object.freeze({init:30,config:35,extension:53,package:54,packages:54,install:26,upgrade:29,create:100,copy:24,focus:22,list:86,"list-all":85,"list-draft":84,"list-open":84,"list-in-progress":84,"list-blocked":84,"list-closed":84,"list-canceled":84,aggregate:37,context:45,ctx:45,get:30,graph:34,search:78,duplicates:24,eval:25,next:35,history:35,events:33,"history-redact":27,"history-repair":26,"history-compact":30,"history-author-acknowledge":28,merge:24,schema:40,profile:22,activity:35,restore:23,update:105,"update-many":140,close:31,"close-many":72,delete:24,append:24,comments:31,notes:35,learnings:27,files:39,docs:30,deps:32,plan:109,test:52,"test-all":40,telemetry:21,stats:29,health:36,validate:45,assurance:30,gc:22,workspace:23,contracts:29,claim:36,release:23,"start-task":23,"pause-task":23,"close-task":24,meet:33,event:33,remind:29,"test-runs-worker":25});function an(){let e=new Map(Object.keys(sn).map(t=>[t,0]));for(let{command:t}of we())e.set(t,Number(e.get(t))+1);return Object.freeze(Object.entries(sn).map(([t,r])=>Object.freeze({command:t,current:Number(e.get(t)),maximum:r})))}function jy(e,t,r){for(let n of e)for(let o of n.aliases){let i=t.get(`${n.command}:${o}`);i===void 0||i.flag===n.flag||r.push({code:"alias_collision",command:n.command,detail:`${o} aliases ${n.flag} but is canonical for ${i.flag}.`})}}function By(e,t,r){let n=new Set(t.map(({command:o})=>o));for(let o of e.keys())n.has(o)||r.push({code:"missing_budget",command:o,detail:`${o} has canonical flags but no persisted budget.`});for(let o of t){let i=e.get(o.command)??0;i===0&&r.push({code:"stale_budget",command:o.command,detail:`${o.command} has a persisted budget but no canonical flags.`}),!(i<=o.maximum)&&r.push({code:"budget_exceeded",command:o.command,detail:`${i} canonical flags exceed the ratcheted maximum ${o.maximum}.`})}}function qy(e,t,r){let n=new Map(e.map(o=>[`${o.command}:${o.flag}`,o]));for(let o of t){let i=`${o.command}:${o.canonical_flag}`,s=n.get(i);if(!s){r.push({code:"removed_canonical_spelling",command:o.command,detail:`${o.canonical_flag} disappeared from the executable spelling inventory.`});continue}let a=new Set([s.flag,...s.aliases]);for(let c of o.accepted_spellings)a.has(c)||r.push({code:"removed_compatibility_spelling",command:o.command,detail:`${c} no longer resolves to ${o.canonical_flag}.`})}}function zv(e=we(),t=an(),r=[]){let n=[],o=new Map,i=new Map,s=new Map,a=new Map;for(let c of e){let d=`${c.command}:${c.flag}`;o.has(d)?n.push({code:"duplicate_canonical_flag",command:c.command,detail:`${c.flag} has more than one canonical row.`}):o.set(d,c),a.set(c.command,(a.get(c.command)??0)+1);let u=i.get(c.concept);u!==void 0&&u!==c.value_kind?n.push({code:"inconsistent_concept_kind",command:c.command,detail:`${c.concept} uses both ${u} and ${c.value_kind}.`}):i.set(c.concept,c.value_kind);let p=s.get(c.concept);p!==void 0&&p!==c.flag?n.push({code:"semantic_spelling_collision",command:c.command,detail:`${c.concept} is canonicalized by both ${p} and ${c.flag}.`}):s.set(c.concept,c.flag)}return jy(e,o,n),By(a,t,n),qy(e,r,n),n.sort((c,d)=>c.command.localeCompare(d.command)||c.code.localeCompare(d.code)||c.detail.localeCompare(d.detail)),{ok:n.length===0,entry_count:e.length,budget_count:t.length,concept_count:new Set(e.map(({concept:c})=>c)).size,baseline_entry_count:r.length,findings:n}}function Vv(){let e=we(),t=an(),r=new Map(t.map(({command:o})=>[o,"unknown"]));for(let{command:o,family:i}of e)r.set(o,i);return["# Generated flag lexicon budgets","","This file is generated by `listPmFlagLexicon()`. Compatibility aliases do not consume canonical budget.","","| Command | Capability family | Canonical flags | Maximum |","| --- | --- | ---: | ---: |",...t.map(({command:o,current:i,maximum:s})=>{let a=r.get(o);return`| \`${o}\` | ${a} | ${i} | ${s} |`}),""].join(`
|
|
32
|
-
`)}(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]="7fc669d4-1db2-5636-8304-2c111a684726")}catch{}})();function Kv(e){return e}function Wv(e){return e}function Xv(e){return e}function Yv(e){return e}function Jv(e){return e}function Zv(e){return e}function Qv(e){return e}function eN(e){return e}function tN(e){return e}function rN(e){return e}function nN(e){return e}function oN(e){return e}function iN(e){return e}function sN(e){return{handled:!0,result:e}}function aN(){return{handled:!1}}function cN(e){return e}function dN(e){return e}function uN(e){return e}function lN(e){return e}function pN(e){return e}function fN(e){return e}function mN(e){return e}function _N(e){return e}function hN(e){return 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]="5bbfab95-010d-5507-ab01-f8f43943d295")}catch{}})();function zy(e={},t={}){return new ae(t).extension(void 0,{...e,migrate:!0})}function Vy(e={},t={}){return new ae(t).packageMigrate(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]="bca95ba2-258c-5be2-8428-dcb8dbc87ef0")}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]="ff251826-36f0-5b92-bee8-ca71d265986c")}catch{}})();import{createHash as dn,createHmac as Hy,randomBytes as Ky,timingSafeEqual as Wy}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]="4853ebbf-f28a-55f1-b306-aa75cb9355ae")}catch{}})();var o0="dev.unbrained.pm/progressive-tool-discovery",i0=Object.freeze({version:1,discoveryTool:"pm_discover",canonicalResult:"structuredContent.result",compatibilityText:"pointer"}),Xy=Object.freeze(["pm_discover","pm_next","pm_context","pm_search","pm_get"]),D=Object.freeze({lexical:.4,semantic:.2,graph:.1,permission:.15,freshness:.05,usage:.1}),Yy=Object.freeze(["profile_changed","tool_contract_changed","workspace_extension_changed","authorization_changed","ranking_signal_changed","cursor_integrity_key_rotated"]),un={core:0,standard:1,full:2,internal:3},ln=Object.freeze(["core","standard","full"]),Jy=new Set(["core","standard","full","custom"]),pn=new Set(Y.map(({family:e})=>e)),Zy=Ky(32);function xe(e,t){if(typeof e!="string")throw new b(`pm tool discovery ${t} must be a string of at most 4096 Unicode characters.`,64);let r=e[Symbol.iterator](),n=0;for(let o=r.next();!o.done;o=r.next())if(n+=1,n>4096)throw new b(`pm tool discovery ${t} must be a string of at most 4096 Unicode characters.`,64);return e}function fn(e){if(!Number.isInteger(e)||Number(e)<1||Number(e)>100)throw new b("pm tool discovery limit must be from 1 through 100.",64);return Number(e)}function mn(e){if(e!=="unbounded"&&(!Number.isInteger(e)||Number(e)<128))throw new b("pm tool discovery outputBudget must be unbounded or an integer of at least 128.",64);return e==="unbounded"?e:Number(e)}function _n(e){if(e!==void 0&&typeof e!="boolean")throw new b("pm tool discovery includeSchema must be a boolean.",64);return e===!0}function hn(e){if(e===null||typeof e!="object"||Array.isArray(e))throw new b("pm tool discovery options must be an object.",64)}function Qy(e){if(!Array.isArray(e))throw new b("pm tool discovery candidates must be an array.",64);for(let[t,r]of e.entries()){if(r===null||typeof r!="object"||Array.isArray(r))throw new b(`pm tool discovery candidate ${t} must be an object.`,64);if(typeof r.name!="string"||r.name.trim().length===0)throw new b(`pm tool discovery candidate ${t} name must be a non-empty string.`,64);if(typeof r.description!="string"||r.description.trim().length===0)throw new b(`pm tool discovery candidate ${t} description must be a non-empty string.`,64);if(r.inputSchema===null||typeof r.inputSchema!="object"||Array.isArray(r.inputSchema))throw new b(`pm tool discovery candidate ${t} inputSchema must be an object.`,64);if(r.authorized!==void 0&&typeof r.authorized!="boolean")throw new b(`pm tool discovery candidate ${t} authorized must be a boolean.`,64)}}function s0(e){if(hn(e),e.family!==void 0&&(typeof e.family!="string"||!pn.has(e.family)))throw new b("pm tool discovery family must be a declared capability family.",64);if(e.tier!==void 0&&(typeof e.tier!="string"||!ln.includes(e.tier)))throw new b("pm tool discovery tier must be core, standard, or full.",64);return{...e.query!==void 0?{query:xe(e.query,"query")}:{},...e.family!==void 0?{family:e.family}:{},...e.tier!==void 0?{tier:e.tier}:{},...e.limit!==void 0?{limit:fn(e.limit)}:{},...e.cursor!==void 0?{cursor:xe(e.cursor,"cursor")}:{},...e.includeSchema!==void 0?{includeSchema:_n(e.includeSchema)}:{},...e.outputBudget!==void 0?{outputBudget:mn(e.outputBudget)}:{}}}function eb(e){return e===void 0||!Number.isFinite(e)?0:Math.min(1,Math.max(0,e))}function ne(e){return[...new Set(e.toLowerCase().match(/[a-z0-9]+/gu)??[])].sort()}function tb(e,t){let r=ne(e);if(r.length===0)return 0;let n=new Set(ne(t)),o=r.filter(s=>n.has(s)).length,i=t.toLowerCase().includes(e.toLowerCase())?.25:0;return Math.min(1,o/r.length+i)}function rb(e,t){let r=ne(e);if(r.length===0)return 0;let n=t.toLowerCase(),o=ne(t),i=r.filter(a=>o.some(c=>c.startsWith(a)||a.startsWith(c))).length,s=n.includes(e.toLowerCase())?.2:0;return Math.min(1,i/r.length+s)}function cn(e){return dn("sha256").update(JSON.stringify(e)).digest("hex").slice(0,24)}function gn(e,t,r){return Hy("sha256",r).update(JSON.stringify({version:1,fingerprint:e,offset:t})).digest("base64url")}function nb(e,t,r){let n={version:1,offset:t,signature:gn(e,t,r)};return Buffer.from(JSON.stringify(n),"utf8").toString("base64url")}function ob(e,t,r,n){if(e===void 0)return 0;try{let o=JSON.parse(Buffer.from(e,"base64url").toString("utf8"));if(o.version!==1||!Number.isInteger(o.offset)||(o.offset??-1)<0||Number(o.offset)>r||typeof o.signature!="string")throw new Error("cursor fields do not match the request");let i=Buffer.from(gn(t,o.offset,n),"base64url"),s=Buffer.from(o.signature,"base64url");if(s.length!==i.length||!Wy(s,i))throw new Error("cursor signature does not match the request");return o.offset}catch(o){throw new b("Invalid or stale pm tool discovery cursor; restart discovery without cursor.",64,{reason:String(o)})}}function ft(e,t,r){return{value:eb(e),weight:t,available:r!=="unavailable",source:r}}function Ae(e,t,r){return ft(e??t,r,e===void 0?"computed":"host")}function ib(e,t,r){let n=Object.hasOwn(se,e.name)?se[e.name]:"help",o=Ue(n),i=`${e.name} ${e.description} ${n} ${o}`,s=tb(t,i),a=new Set(ne(t)),c={lexical:ft(s,D.lexical,"computed"),semantic:Ae(e.signals?.semantic,rb(t,i),D.semantic),graph:Ae(e.signals?.graph,a.has(o)||a.has(n)?1:0,D.graph),permission:ft(1,D.permission,"authorization"),freshness:Ae(e.signals?.freshness,1,D.freshness),usage:Ae(e.signals?.usage,Xy.includes(e.name)?1:0,D.usage)},d=Object.values(c).reduce((u,p)=>u+p.value*p.weight,0);return{name:e.name,description:e.description,command:n,tier:je(n),family:o,score:Number(d.toFixed(6)),signals:c,...r?{input_schema:structuredClone(e.inputSchema)}:{}}}function sb(e){if(e.cursorIntegrityKey!==void 0&&(!(e.cursorIntegrityKey instanceof Uint8Array)||e.cursorIntegrityKey.byteLength<32))throw new b("pm tool discovery cursorIntegrityKey must contain at least 32 bytes.",64);if(e.tier!==void 0&&(typeof e.tier!="string"||!ln.includes(e.tier)))throw new b("pm tool discovery tier must be core, standard, or full.",64);if(e.family!==void 0&&(typeof e.family!="string"||!pn.has(e.family)))throw new b("pm tool discovery family must be a declared capability family.",64);if(e.profile!==void 0&&(typeof e.profile!="string"||!Jy.has(e.profile)))throw new b("pm tool discovery profile must be core, standard, full, or custom.",64)}function ab(e){let r=xe(e.query===void 0?"":e.query,"query").trim().replace(/\s+/gu," ");xe(e.cursor===void 0?"":e.cursor,"cursor");let n=fn(e.limit===void 0?10:e.limit),o=mn(e.outputBudget===void 0?1200:e.outputBudget);return sb(e),{query:r,includeSchema:_n(e.includeSchema),limit:n,budget:o,maximumTier:un[e.tier??"full"],profile:e.profile===void 0?"core":e.profile}}function yn(e,t,r){let n=r??e.tools.reduce((s,a,c)=>s+(c===0?0:1)+Buffer.byteLength(JSON.stringify(a),"utf8"),0),o={...e,tools:[]},i=0;for(let s=0;s<4;s+=1){let a=Buffer.byteLength(JSON.stringify({...o,token_cost:{estimated_tokens:i,budget:t,within_budget:!0}}),"utf8"),c=Math.ceil((a+n)/4);if(c===i)break;i=c}return i}function cb(e,t,r){return e.filter(n=>n.authorized!==!1).map(n=>ib(n,r.query,r.includeSchema)).filter(n=>n.tier!=="internal"&&un[n.tier]<=r.maximumTier&&(t.family===void 0||n.family===t.family)).sort((n,o)=>o.score-n.score||(n.name<o.name?-1:n.name>o.name?1:0))}function db(e,t,r){if(t==="unbounded")return[...e];let n=[],o=0;for(let[i,s]of e.entries()){let a=o+(i===0?0:1)+Buffer.byteLength(JSON.stringify(s),"utf8");if(yn(r(i+1),t,a)>t)break;n.push(s),o=a}return n}function a0(e,t={}){Qy(e),hn(t);let r=ab(t),n=t.cursorIntegrityKey??Zy,o=cb(e,t,r),i=cn({query:r.query,family:t.family??null,tier:t.tier??"full",includeSchema:r.includeSchema,profile:r.profile,ranked:o}),s=ob(t.cursor,i,o.length,n),a=o.slice(s,s+r.limit),c=[];r.includeSchema||c.push({name:"input_schema",reason:"compact_projection",restore_with:"Set includeSchema=true."}),s+r.limit<o.length&&c.push({name:"tools",reason:"limit",restore_with:"Continue with next_cursor or increase limit."});let d={result_type:"pm_tool_discovery",contract_version:1,query:r.query,profile:r.profile,total:o.length,ranking_policy:{version:1,formula:"weighted_sum_then_name",weights:D},cache:{key:cn({fingerprint:i,cursorIntegrityKey:dn("sha256").update(n).digest("hex"),limit:r.limit,offset:s,budget:r.budget}),ttl_ms:3e4,scope:"private",invalidates_on:Yy}},u=(h,T=h.length)=>{let S=s+T,$=S<o.length,R=[...c];return T<a.length&&R.push({name:"tools",reason:"token_budget",restore_with:"Continue with next_cursor or increase outputBudget."}),{...d,tools:[...h],returned:T,has_more:$,...$?{next_cursor:nb(i,S,n)}:{},omission_receipt:{has_omissions:R.length>0,omitted:R}}},p=h=>{let T=u(h),S=yn(T,r.budget);return{...T,token_cost:{estimated_tokens:S,budget:r.budget,within_budget:r.budget==="unbounded"||S<=r.budget}}},m=db(a,r.budget,h=>u([],h)),y=p(m);if(a.length>0&&m.length===0){let h=p([a[0]]).token_cost.estimated_tokens;throw new b(`pm tool discovery outputBudget is too small to return a tool; increase it to at least ${h}.`,64,{required:String(h)})}if(r.budget!=="unbounded"&&y.token_cost.estimated_tokens>r.budget)throw new b(`pm tool discovery outputBudget is too small; at least ${y.token_cost.estimated_tokens} estimated tokens are required for this page.`,64,{required:String(y.token_cost.estimated_tokens)});return y}(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]="036baf5a-3ba9-55ea-a11b-d9e94a848b92")}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]="62e450f7-9ed9-5855-923a-7b2ffb8b49f4")}catch{}})();export{Zx as ACTIONABILITY_ORDERING_KINDS,cs as ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS,nc as ACTIVITY_FLAG_CONTRACTS,po as AGENT_PROVENANCE_DIMENSIONS,js as AGGREGATE_FLAG_CONTRACTS,Oa as APPEND_FLAG_CONTRACTS,Wx as ASSURANCE_ACTIONS,Xx as ASSURANCE_DECLARATION_KINDS,MA as ASSURANCE_DOCUMENT_VERSION,Ka as ASSURANCE_FLAG_CONTRACTS,kA as ASSURANCE_GATE_TRIGGERS,vA as ASSURANCE_MEASUREMENT_SOURCE_KINDS,YA as ASSURANCE_PRESET_IDS,OA as AssuranceEvaluationRefusalError,xA as AssuranceMutationRefusalError,RA as AssuranceSourceResolutionError,Yn as BASELINE_ITEM_FORMAT_VERSION,Bg as BOUNDARY_FIXTURE_CAPTURE_SOURCES,uO as BRIEF_LIST_FIELDS,mo as BUILTIN_AGENT_PROVENANCE_ADAPTERS,z as BUILTIN_CORPUS_SHAPES,fo as BUILTIN_HARNESS_SIGNAL_DESCRIPTORS,xn as BUILTIN_ITEM_TYPE_VALUES,Dt as BUILTIN_PROFILES,Kb as BUILTIN_RELATIONSHIP_KINDS,is as CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS,rc as CALENDAR_FLAG_CONTRACTS,Ra as CLAIM_FLAG_CONTRACTS,Cc as CLOSE_ACTION_OPTION_KEYS,Aa as CLOSE_FLAG_CONTRACTS,xa as CLOSE_MANY_FLAG_CONTRACTS,Na as CLOSE_TASK_FLAG_CONTRACTS,Bs as COMMENTS_FLAG_CONTRACTS,Gb as COMMON_MUTATION_COMMAND_OPTION_KEYS,_c as COMPLETION_FLAG_CONTRACTS,kn as CONFIDENCE_TEXT_VALUES,na as CONFIG_FLAG_CONTRACTS,ss as CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS,MO as CONTEXT_EVALUATION_METRIC_NAMES,ic as CONTEXT_FLAG_CONTRACTS,Mt as CONTEXT_OUTPUT_VALUES,DO as CONTEXT_PACKING_PROFILES,EO as CONTEXT_RECENCY_EPOCH,OO as CONTEXT_RELEVANCE_SERVICE,AO as CONTEXT_RELEVANCE_SIGNAL_NAMES,GO as CONTEXT_SIGNAL_SET_VERSION,FO as CONTEXT_SIGNAL_STORE_FORMAT_VERSION,UO as CONTEXT_SIGNAL_STORE_WARNING_DETAILS,mc as CONTRACTS_FLAG_CONTRACTS,Za as COPY_FLAG_CONTRACTS,ps as CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,ms as CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,fs as CREATE_COMMANDER_STRING_OPTION_CONTRACTS,mb as CREATE_DIRECT_CLOSE_REASON_DEFAULT,Wa as CREATE_FLAG_CONTRACTS,jS as CURRENT_HISTORY_ITEM_HASH_VERSION,Jn as CURRENT_ITEM_FORMAT_VERSION,zO as ContextSignalStore,CS as ContextUsageValidationError,bA as DEFAULT_AUTHOR_IDENTITY_VOCABULARY,CR as DEFAULT_CHILD_SAMPLE_LIMIT,dO as DEFAULT_COMPACT_LIST_FIELDS,IE as DEFAULT_DERIVED_INDEX_MINIMUM_ITEMS,Lp as DEFAULT_EVAL_QUERIES_RELATIVE_PATH,iR as DEFAULT_TERMINAL_TRANSITION_POLICY,WO as DEFAULT_WORKSPACE_MEMORY_MINIMUM_ITEMS,jx as DEFECT_ESCAPE_CLASSES,Bx as DEFECT_GATE_EVIDENCE_DISPOSITIONS,Pa as DELETE_FLAG_CONTRACTS,In as DEPENDENCY_KIND_VALUES,cc as DEPS_FLAG_CONTRACTS,Hs as DOCS_FLAG_CONTRACTS,za as DUPLICATES_FLAG_CONTRACTS,uc as EVAL_FLAG_CONTRACTS,Mp as EVAL_QUERY_SET_CONTRACT,kp as EVAL_QUERY_SET_EXAMPLE,Pp as EVAL_QUERY_SET_SCHEMA_ID,oc as EVENTS_FLAG_CONTRACTS,Da as EVENT_FLAG_CONTRACTS,Lo as EXECUTABLE_COMMAND_ALIASES,F as EXIT_CODE,ma as EXTENSION_ACTIVATE_FLAG_CONTRACTS,fa as EXTENSION_ADOPT_ALL_FLAG_CONTRACTS,Ca as EXTENSION_ADOPT_FLAG_CONTRACTS,Yw as EXTENSION_CAPABILITIES,pb as EXTENSION_CAPABILITY_CONTRACT,ub as EXTENSION_CAPABILITY_CONTRACT_VERSION,lb as EXTENSION_CAPABILITY_LEGACY_ALIASES,jn as EXTENSION_CAPABILITY_REGISTRATION_SURFACES,Ta as EXTENSION_CATALOG_FLAG_CONTRACTS,_a as EXTENSION_DEACTIVATE_FLAG_CONTRACTS,pa as EXTENSION_DESCRIBE_FLAG_CONTRACTS,ba as EXTENSION_DOCTOR_FLAG_CONTRACTS,la as EXTENSION_EXPLORE_FLAG_CONTRACTS,oa as EXTENSION_FLAG_CONTRACTS,sa as EXTENSION_INIT_FLAG_CONTRACTS,da as EXTENSION_INSTALL_FLAG_CONTRACTS,ga as EXTENSION_MANAGE_FLAG_CONTRACTS,ha as EXTENSION_MIGRATE_FLAG_CONTRACTS,Jw as EXTENSION_POLICY_MODES,Zw as EXTENSION_POLICY_SURFACES,ya as EXTENSION_RELOAD_FLAG_CONTRACTS,eA as EXTENSION_SANDBOX_PROFILES,ia as EXTENSION_SCOPE_FLAG_CONTRACTS,Qw as EXTENSION_TRUST_MODES,ua as EXTENSION_UNINSTALL_FLAG_CONTRACTS,sx as EXTERNAL_DEPENDENCY_RESOLUTION_STATUSES,ox as EXTERNAL_DEPENDENCY_SOURCE_KIND,ix as EXTERNAL_DEPENDENCY_SOURCE_KIND_ALIAS,Vs as FILES_FLAG_CONTRACTS,Qa as FOCUS_FLAG_CONTRACTS,Ba as GC_FLAG_CONTRACTS,fO as GET_DEPTH_VALUES,sc as GET_FLAG_CONTRACTS,Gs as GLOBAL_FLAG_CONTRACTS,Cd as GRAPH_DURABLE_CACHE_MIN_ITEMS,Td as GRAPH_DURABLE_CACHE_VERSION,dc as GRAPH_FLAG_CONTRACTS,Me as GRAPH_SUBCOMMAND_VALUES,ac as GUIDE_FLAG_CONTRACTS,Va as HEALTH_FLAG_CONTRACTS,Js as HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS,fx as HISTORY_AUTHOR_ATTRIBUTION_BASELINE,dI as HISTORY_COMPACT_BULK_DEFAULT_MIN_ENTRIES,Zs as HISTORY_COMPACT_FLAG_CONTRACTS,Oo as HISTORY_EVENT_CLASSIFICATION_VERSION,Ks as HISTORY_FLAG_CONTRACTS,Xs as HISTORY_REDACT_FLAG_CONTRACTS,Ys as HISTORY_REPAIR_FLAG_CONTRACTS,wp as INIT_AGENT_GUIDANCE_MODE_VALUES,ra as INIT_FLAG_CONTRACTS,Sa as INSTALL_FLAG_CONTRACTS,Mn as ISSUE_SEVERITY_VALUES,Ya as ITEM_COMPLETE_FLAG_CONTRACTS,VR as ITEM_LATEST_TIMESTAMP_FIELDS,fb as ITEM_METADATA_KEY_ORDER,Xa as ITEM_MUTATE_FLAG_CONTRACTS,Ja as ITEM_REOPEN_FLAG_CONTRACTS,On as ITEM_TYPE_VALUES,zR as ITEM_UNION_COLLECTION_FIELDS,qO as JsonFileContextSignalStoreAdapter,zs as LEARNINGS_FLAG_CONTRACTS,Jl as LINKED_TEST_ENV_NAME_PATTERN,Zl as LINKED_TEST_PM_CONTEXT_MODE_VALUES,Yl as LINKED_TEST_PROTECTED_ENV_KEYS,Ql as LINKED_TEST_WORKSPACE_CONTEXT_MODE_VALUES,ns as LIST_COMMANDER_STRING_OPTION_CONTRACTS,lO as LIST_COMMAND_DEFAULT_PROJECTIONS,rA as LIST_FILTER_EXTENSION_FLAG_DEFINITIONS,Us as LIST_FILTER_FLAG_CONTRACTS,gO as LIST_SORT_FIELDS,yO as LIST_SORT_ORDER_VALUES,Ro as MAINTENANCE_HISTORY_OPERATIONS,TR as MAX_CHILD_PROJECTION_ITEMS,La as MEET_FLAG_CONTRACTS,WR as MERGE_DRIVER_ARTIFACT_VALUES,Ws as MERGE_FLAG_CONTRACTS,ke as MERGE_SUBCOMMAND_VALUES,JR as MUTATION_EVENT_WIRE_BUDGET,Q as MemoryRelationshipGraphAdapter,as as NEXT_COMMANDER_STRING_OPTION_CONTRACTS,pc as NEXT_FLAG_CONTRACTS,kl as NEXT_OUTPUT_VALUES,qs as NOTES_FLAG_CONTRACTS,aa as PACKAGE_FLAG_CONTRACTS,ca as PACKAGE_INIT_FLAG_CONTRACTS,va as PAUSE_TASK_FLAG_CONTRACTS,Tc as PLAN_CREATE_METADATA_PARAMETER_KEYS,ta as PLAN_FLAG_CONTRACTS,mp as PLAN_SHOW_DEPTH_VALUES,Fe as PLAN_SUBCOMMANDS,_p as PLAN_TEMPLATE_NAMES,ay as PM_AGENT_TASK_ACCOUNTING_MODES,at as PM_AGENT_TASK_TRANSCRIPT_VERSION,Ic as PM_CLI_EXPECTED_ERROR_NAME,Ow as PM_CLI_GRAMMAR_CONTRACT,Sw as PM_CLI_GRAMMAR_NOUNS,Wo as PM_CLI_ONLY_TOOL_ACTION_WAIVERS,Ew as PM_CLI_SHARED_VERBS,No as PM_COMMAND_ALIAS_CONTRACTS,Y as PM_COMMAND_CAPABILITY_CONTRACTS,wt as PM_COMMAND_DESTINATION_CONTRACTS,lR as PM_COMMAND_EXIT_CONTRACTS,uR as PM_COMMAND_EXIT_OUTCOME_CONTRACTS,pi as PM_COMMAND_OUTPUT_BUDGET_CONTRACTS,CI as PM_COMMAND_OUTPUT_ENVELOPE_CONTRACTS,Ne as PM_COMMAND_POSITIONAL_CONTRACTS,uf as PM_COMMAND_VISIBILITY_CONTRACTS,oA as PM_COMPLETE_LIST_FINDING_CODES,uA as PM_CONTEXT_INTENTS_FILE,OS as PM_CONTEXT_INTENT_CONTRACTS,zo as PM_CORE_COMMAND_NAMES,v as PM_CORPUS_SHAPE_SCHEMA,Yo as PM_DEPRECATED_TOOL_ACTIONS,ai as PM_DIAGNOSTIC_DEGRADATION_STEPS,ci as PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS,si as PM_DIAGNOSTIC_OUTPUT_CLASSES,Jo as PM_DISCOVERABLE_TOOL_ACTIONS,bI as PM_ERROR_CODE_CATALOG,_I as PM_ERROR_CODE_EXIT_CLASS_CONTRACTS,zr as PM_EXACT_COVERAGE_METRICS,Fo as PM_EXTENSION_CAPABILITY_CONTRACTS,Vo as PM_EXTENSION_PACKAGE_ACTION_SUBCOMMANDS,Uo as PM_EXTENSION_POLICY_MODE_CONTRACTS,qo as PM_EXTENSION_POLICY_SURFACE_CONTRACTS,Bo as PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS,Go as PM_EXTENSION_SERVICE_NAME_CONTRACTS,jo as PM_EXTENSION_TRUST_MODE_CONTRACTS,Tx as PM_GITATTRIBUTES_END,bx as PM_GITATTRIBUTES_START,Sx as PM_GITATTRIBUTES_V2_END,Cx as PM_GITATTRIBUTES_V2_START,Lc as PM_GITIGNORE_END,Nc as PM_GITIGNORE_START,Ko as PM_ITEM_ACTION_SUBCOMMANDS,Je as PM_MCP_APPS_EXTENSION,wr as PM_MCP_APPS_SERVER_CAPABILITY,_e as PM_MCP_APPS_SPEC_VERSION,Or as PM_MCP_APP_CONTRACTS,xr as PM_MCP_APP_MIME_TYPE,Xy as PM_MCP_ENTRY_TOOL_NAMES,f as PM_MCP_ERROR_CODES,EM as PM_MCP_HTTP_PROTOCOL_VERSION,Ch as PM_MCP_INPUT_REQUEST_METHODS,KP as PM_MCP_LEGACY_PROTOCOL_VERSIONS,O as PM_MCP_META_KEYS,o0 as PM_MCP_PROGRESSIVE_DISCOVERY_EXTENSION,i0 as PM_MCP_PROGRESSIVE_DISCOVERY_SERVER_CAPABILITY,_f as PM_MCP_PROMPT_CONTRACTS,U as PM_MCP_PROTOCOL_VERSION,mf as PM_MCP_RESOURCE_CONTRACTS,Qe as PM_MCP_SKILLS_DRAFT_REVISION,Rr as PM_MCP_SKILLS_EXTENSION,Og as PM_MCP_SKILLS_SERVER_CAPABILITY,I as PM_MCP_SKILL_LIMITS,fe as PM_MCP_SUBSCRIPTION_ID_META_KEY,Be as PM_MCP_SUPPORTED_PROTOCOL_VERSIONS,_M as PM_MCP_TASKS_EXTENSION,kh as PM_MCP_TASK_STATUSES,se as PM_MCP_TOOL_COMMAND_CONTRACTS,bC as PM_MODE_PAIRED_OUTPUT_PROJECTION_CONTRACTS,Gi as PM_MUTATION_ACTION_CONTRACTS,ii as PM_OUTPUT_BUDGET_CLASSES,oi as PM_OUTPUT_DEGRADATION_STEPS,Kt as PM_OUTPUT_ENVELOPE_KINDS,Rt as PM_PACKAGE_CONVENTIONAL_RESOURCE_ROOTS,Ho as PM_PACKAGE_ONLY_ACTION_SUBCOMMANDS,Ot as PM_PACKAGE_RESOURCE_KINDS,ve as PM_POSITIONAL_ACTION_CONTRACTS,Rc as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA,xc as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION,iS as PM_READ_OUTPUT_COMPOSITION_OPTION_FLAGS,HC as PM_READ_OUTPUT_CONTINUATION_FINGERPRINT_POLICIES,rS as PM_READ_OUTPUT_DIMENSIONS,oS as PM_READ_OUTPUT_OPTION_FLAGS,JC as PM_READ_OUTPUT_SESSION_MAX_SEEN_ITEM_IDS,YC as PM_READ_OUTPUT_SESSION_MIN_TOKENS,nS as PM_READ_OUTPUT_SURFACES,sS as PM_READ_OUTPUT_SURFACE_CONTRACTS,yC as PM_READ_ROW_CONTRACTS,gC as PM_READ_ROW_JQ_SELECTOR,lv as PM_RECOVERY_REFERENCE_FIELDS,re as PM_RECOVERY_REFERENCE_KINDS,My as PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE,nn as PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE_V2,yv as PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE,rn as PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE_V2,Qi as PM_REPRODUCIBLE_PROCESS_ENV,pR as PM_SUCCESS_EXIT_CODES,Xo as PM_TOOL_ACTIONS,Sc as PM_TOOL_ACTION_PARAMETER_CONTRACTS,Oc as PM_TOOL_PARAMETERS_SCHEMA,Ac as PM_TOOL_PARAMETERS_SCHEMA_MAJOR,wc as PM_TOOL_PARAMETERS_SCHEMA_VERSION,yc as PM_TOOL_RESERVED_CUSTOM_FIELD_PROPERTIES,jr as PM_WORKSPACE_RECIPE_SCHEMA,ea as PROFILE_FLAG_CONTRACTS,qt as PROFILE_LINT_CODES,Bt as PROFILE_LINT_DIMENSIONS,Lt as PROFILE_NAMES,Ge as PROFILE_SUBCOMMANDS,b as PmCliError,ae as PmClient,iA as PmCompleteListValidationError,g as PmMcpAuthorizationError,Jt as PmMcpInputRequiredError,br as PmMcpIssuerCredentialStore,l as PmMcpProtocolError,Zt as PmMcpRequestStateReplayGuard,Nr as PmMcpSkillRegistry,dr as PmMcpSubscriptionRegistry,Xe as PmMcpTaskStore,LC as QUERY_CURSOR_CONTRACT,wa as REINDEX_FLAG_CONTRACTS,wE as REINDEX_LOCK_ID,st as RELATIONSHIP_GRAPH_SNAPSHOT_VERSION,Ma as RELEASE_FLAG_CONTRACTS,$a as REMIND_FLAG_CONTRACTS,Tt as RESERVED_ITEM_FIELD_NAMES,Ia as RESTORE_FLAG_CONTRACTS,Pn as RISK_VALUES,Bw as RelationshipEventLog,qw as RelationshipEventStore,G as RelationshipGraph,Ie as RelationshipKindRegistry,Qs as SCHEMA_FLAG_CONTRACTS,os as SEARCH_COMMANDER_STRING_OPTION_CONTRACTS,nA as SEARCH_EXTENSION_FLAG_DEFINITIONS,fc as SEARCH_FLAG_CONTRACTS,ml as SEMANTIC_ATTRIBUTION_LIMITS,hb as SETTINGS_DEFAULTS,Up as SNAPSHOT_SCHEMA,hx as SOURCE_CONTEXT_ACCESS_ENV,gx as SOURCE_CONTEXT_WRITE_OVERRIDE_ENV,ka as START_TASK_FLAG_CONTRACTS,qa as STATS_FLAG_CONTRACTS,Rn as STATUS_VALUES,Fs as SUBCOMMAND_GLOBAL_FLAG_CONTRACTS,Io as SUBSTANTIVE_HISTORY_OPERATIONS,BS as SUPPORTED_HISTORY_ITEM_HASH_VERSIONS,vb as SUPPRESS_HOST_OUTPUT_MARKER,Ua as TELEMETRY_FLAG_CONTRACTS,Df as TELEMETRY_SUBCOMMANDS,Ga as TEST_ALL_FLAG_CONTRACTS,Fa as TEST_FLAG_CONTRACTS,ja as TEST_RUNS_FLAG_CONTRACTS,Mf as TEST_RUN_MEASUREMENT_LIMIT,ks as TOOL_ACTIVITY_OPTION_CONTRACTS,Ts as TOOL_AGGREGATE_OPTION_CONTRACTS,Rs as TOOL_BULK_MUTATION_FILTER_OPTION_CONTRACT_SOURCE,Ms as TOOL_CALENDAR_OPTION_CONTRACTS,Ps as TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS,vs as TOOL_CONTEXT_OPTION_CONTRACTS,As as TOOL_CREATE_OPTION_CONTRACTS,ws as TOOL_CREATE_OPTION_CONTRACT_SOURCE,Ns as TOOL_DEPS_OPTION_CONTRACTS,Ls as TOOL_GRAPH_OPTION_CONTRACTS,bs as TOOL_LIST_FILTER_OPTION_CONTRACTS,Cs as TOOL_SEARCH_FILTER_OPTION_CONTRACTS,Es as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS,Ss as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACT_SOURCE,Is as TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS,Os as TOOL_UPDATE_OPTION_CONTRACTS,xs as TOOL_UPDATE_OPTION_CONTRACT_SOURCE,_b as TYPE_TO_FOLDER,Mb as UNKNOWN_SUBCOMMAND_COMPATIBILITY_CODES,_s as UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,gs as UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,hs as UPDATE_COMMANDER_STRING_OPTION_CONTRACTS,ec as UPDATE_FLAG_CONTRACTS,tc as UPDATE_MANY_FLAG_CONTRACTS,Ea as UPGRADE_FLAG_CONTRACTS,Ha as VALIDATE_FLAG_CONTRACTS,lc as WORKSPACE_FLAG_CONTRACTS,Ti as WORKSPACE_HISTORY_ID,jp as WORKSPACE_SNAPSHOT_ACTIONS,Zc as WorkspaceGraphCache,Ww as WorkspaceTransactionInterruptedError,kc as _testOnly,SO as _testOnlyAggregateCommand,Ep as _testOnlyConfigCommand,AR as _testOnlyGetCommand,pu as _testOnlyHealthCommand,Rp as _testOnlyInit,Ap as _testOnlyInitAgentGuidance,XI as _testOnlyItemTransaction,tI as _testOnlyMutationEvents,rR as _testOnlyNextCommand,jR as _testOnlySearchCommand,gR as _testOnlySimilarity,Xp as _testOnlyTemplates,Vu as _testOnlyValidateCommand,aI as _testOnlyWorkspacePosition,ex as acceptAssuranceProposals,qu as acknowledgeLinkedTests,jd as acknowledgeUnknownAuthorHistoryEvents,Ud as acknowledgeUnknownAuthorHistoryEventsFromTransport,PE as acquireItemMetadataDerivedIndexLock,Pe as acquireLock,aP as activateExtensionForTest,cT as activateExtensions,lo as agentSessionEnvironment,km as aggregate,Tf as analyzeAgentProvenanceDescriptorCoverage,zx as analyzeDefectChangeRisk,Vw as analyzeGraphImpact,Bc as analyzeHierarchyIntegrity,Hw as analyzeKnowledgeGraph,mR as analyzePmCommandExitConformance,Zo as analyzePmToolActionParity,vx as analyzeReconciliationDiscard,zw as analyzeRelationshipExecution,fd as analyzeRelationshipSchedule,oh as analyzeSdkActionCoverage,At as analyzeSdkCliParameterCompleteness,zm as append,bi as appendHistoryEntry,wi as appendWorkspaceAuditEvent,Ei as appendWorkspaceHistoryChange,FT as applyAcceptanceCriteriaMutations,ZA as applyAssurancePreset,dh as applyBootstrapPagerPolicy,kS as applyContextIntentProjection,Ml as applyContextTagProjection,bO as applyFilterValueEcho,Lw as applyHistoryPatch,hh as applyInvocationAuthorOverride,yu as applyPathMigrations,mS as applyReadOutputDimensions,uS as applyReadOutputIncludeModes,QC as applyReadOutputSessionReferences,NT as applyRegisteredItemFieldDefaultsAndValidation,Su as applyStandaloneNote,su as applyStoredExtensionMigrationState,UT as applyTagRemovals,dR as applyTerminalOrderingPolicy,Eu as artifactKey,Cb as asRecordClone,Tb as asRecordOrNull,De as assembleWorkspaceRelationshipGraph,dA as assertCompleteListResult,jP as assertExtensionBlueprint,UP as assertExtensionCapabilityUsage,SP as assertExtensionDeactivated,zP as assertExtensionManifestCompatible,qP as assertExtensionManifestMatchesBlueprint,VP as assertExtensionPreflight,Vc as assertHierarchyMutationAllowed,uI as assertHistoryCompactTarget,Lx as assertHistoryRepairTarget,Li as assertInitializedTracker,bu as assertLinkedArtifactMutationIsUnambiguous,XP as assertMcpClientCapabilities,WP as assertMcpProtocolHeader,sy as assertMemoryRelationshipGraphAdapterConformance,qT as assertNoUnknownCsvKeys,EP as assertPackageManifest,sE as assertParentReferenceIsNotSelf,QM as assertPmMcpSkillsCapability,BP as assertProjectProfile,kk as assertProjectRuntimeCompatibility,TC as assertProjectionModeChoice,Ni as assertReadableTrackerRoot,wP as assertRegisteredCommandContract,NP as assertRegisteredCommandOverride,PP as assertRegisteredExporter,AP as assertRegisteredFlags,xP as assertRegisteredHook,IP as assertRegisteredImporter,MP as assertRegisteredItemField,kP as assertRegisteredItemType,GP as assertRegisteredMigration,LP as assertRegisteredParserOverride,DP as assertRegisteredPreflightOverride,vP as assertRegisteredProfile,$P as assertRegisteredRendererOverride,OP as assertRegisteredSearchProvider,FP as assertRegisteredServiceOverride,RP as assertRegisteredVectorStoreAdapter,Jb as assertRelationshipEdgeAllowed,Yr as assertRelationshipGraphAdapterConformance,NA as assuranceAssertionUpdateIsLoosening,LS as attachContextIntentReceipt,gS as attachContextUsageServingReceipt,Gu as attachLinkedTestMutationProvenance,Fu as attachLinkedTestProvenance,ze as attachMcpServerInfo,xC as attachOutputOmissionReceipt,$S as attachOutputTokenAccounting,DS as attachReadOutputContracts,eS as attachReadOutputSessionReceipt,Hd as auditMergeAttributeFence,Ex as auditMergeDriverConfiguration,yd as auditWorkspaceRelationshipGraph,FM as authorizeMcpHttpRequest,ao as boundAgentEpisodeIdentity,zC as boundReadOutputRows,Ol as buildChildrenByParent,IR as buildCompactSearchFilterSummary,TO as buildContentFilterEcho,BO as buildContextSignalSnapshot,Ng as buildCorpusShapeItemPlan,qx as buildDefectRecurrenceIndex,ru as buildExtensionDescribeResult,CO as buildGovernanceMissingFilterEcho,mE as buildInvalidTypeError,SR as buildItemChildrenRollup,KI as buildItemCompletionMutations,xO as buildItemContextRelevanceCandidates,DE as buildItemNotFoundError,wR as buildItemSchedule,IM as buildMcpAuthorizationDiscoveryUrls,bh as buildMcpCompleteResult,JP as buildMcpDiscoverResult,NM as buildMcpDynamicRegistrationMetadata,CM as buildMcpHttpRequestHeaders,rM as buildMcpInputRequiredResult,RM as buildMcpProtectedResourceMetadata,zd as buildMergeAttributePatterns,Ec as buildPmActionToolInputSchema,Cv as buildPmRefusalClosureCensus,lx as buildRelationshipContext,jE as buildSearchCorpus,qE as buildSemanticCorpusInput,Fx as buildStatusRoleWarnings,vi as buildTrackerInitializationRecovery,XE as buildVectorizationEmbeddingIdentity,YE as buildVectorizationEmbeddingMetadata,PR as buildVerboseSearchFilters,XO as buildWorkspaceMemorySnapshot,so as canonicalDocument,Ub as canonicalizeCommandOptionKey,wO as canonicalizeContextRecencyCoordinate,Wb as canonicalizeRelationshipKind,pv as censusPmRecoveryReferenceProducers,cA as certifyCompleteListResult,iP as checkExtensionManifestCompatibility,O_ as claim,R_ as claimNext,mx as classifyHistoryAuthorEvent,Po as classifyHistoryEvent,rI as classifyHostEnvironmentFault,FR as classifyImplicitSemanticFallbackReason,eo as classifyItemFormatVersion,Gf as classifyLinkedTestCommandSafety,Uf as classifyLinkedTestFailure,AT as clearActiveExtensionHooks,xd as clearDurableGraphCache,pC as clearFocusedItem,Fc as clearWorkspaceContractsCache,x_ as close,Fl as closeItem,D_ as closeTask,ph as coalesceRepeatedListFlags,Qx as collectBlockedByIds,tO as collectBlockedByIdsFromCorpus,bS as collectContextUsageDeliveredItemIds,Xc as collectDanglingDependencyReferences,nO as collectDependencyBlockedIds,Kc as collectDuplicateDependencyRows,gd as collectDuplicateRelationshipEdgeGroups,$R as collectErrorCauseCodes,jc as collectHierarchyRelations,_r as collectMcpHeaderAnnotations,Yc as collectMissingDependencyTargetIds,Vl as collectNewOrderingCycleWarnings,md as collectOrderingCycles,Wc as collectOrderingStorageContradictions,fA as collectPackageContextIntentContracts,Pt as collectPackageExtensionDirectories,kT as collectRegisteredItemFieldNames,oC as collectRuntimeCreateFieldValues,_E as collectRuntimeFilterValues,iC as collectRuntimeUpdateFieldValues,Sl as collectSubtreeIds,Bn as collectUsedExtensionCapabilities,jb as commandOptionFlagLabel,Lm as comments,mm as commitImportedItem,WI as commitItemCompletion,HI as commitItemMutations,Xw as commitWorkspaceTransaction,$s as compactFlagAliasContracts,El as compareCriticalItems,ge as comparePmDateVersions,Kw as compareRelationshipSnapshots,Sb as compareTimestampStrings,wA as compileHistoryProvenanceMatcher,PS as composeContextIntentContracts,ZI as composeExtension,oP as composeExtensionPackage,oO as computeActionabilityReport,QS as computeHistoryDiff,ld as computeRelationshipCentrality,ud as computeRelationshipDominators,Jc as computeWorkspaceGraphFingerprint,Hm as config,wT as consumeAfterCommandAffectedItems,xm as context,NS as contextIntentRowId,P_ as copy,jf as countFailureCategories,BC as countReadOutputRows,E_ as create,JA as createAssurancePreset,Ux as createAssuranceWorkspaceContext,wb as createCheckpointId,sA as createCompleteListOptions,dT as createCoreCommandHookContext,Ur as createCorpusShapeMeasurement,GA as createEmptyAssuranceDocument,Qb as createEmptyExtensionRegistrationRegistry,vc as createExtensionCommandSdk,Un as createExtensionContributionInventory,HP as createExtensionTestHarness,yi as createHistoryEntry,pw as createLazyModule,GM as createMcpStaticBearerVerifier,hM as createMcpTaskStore,LE as createMutationGuardSdk,CC as createOutputOmissionReceipt,Pc as createPmCliExpectedError,gh as createPmCliProgram,ui as createPmCommandOutputBudget,RC as createQueryFingerprint,iy as createRelationshipGraphScaleFixture,K as createRelationshipGraphSnapshot,bt as createRelationshipKindRegistry,ts as createReproducibleProcessRunner,MR as createSearchCursorFingerprint,uT as createSerialQueue,XT as createStdinTokenResolver,kb as createUnknownSubcommandError,Bp as createWorkspaceSnapshot,cP as deactivateExtensionForTest,aN as declineServiceOverride,vS as decodeContextIntentCursor,lw as decodeHtmlEntitiesInOptions,mr as decodeMcpHttpHeaderValue,kC as decodeQueryCursor,PC as decodeQueryCursorEnvelope,MC as decodeQueryCursorState,XC as decodeReadOutputContinuationCursor,zM as decoratePmMcpToolsWithApps,Au as dedupeLinkedArtifacts,RO as defaultScoreContextCandidates,fN as defineAfterCommandHook,lN as defineBeforeCommandHook,pN as defineBeforeMutationHook,Xv as defineCommand,rN as defineCommandOverride,q as defineCorpusShape,uN as defineExporter,YI as defineExtension,JI as defineExtensionBlueprint,Kv as defineExtensionManifest,Yv as defineFlag,dN as defineImporter,Zv as defineItemField,Jv as defineItemType,Qv as defineMigration,hN as defineOnIndexHook,_N as defineOnReadHook,mN as defineOnWriteHook,nN as defineParserOverride,li as definePmCommandOutputBudget,TI as definePmCommandOutputEnvelope,hI as definePmErrorCodeCatalog,oN as definePreflightOverride,Wv as defineProjectProfile,cN as defineRendererOverride,eN as defineSearchProvider,iN as defineServiceOverride,tN as defineVectorStoreAdapter,Br as defineWorkspaceRecipe,M_ as deleteItem,Wp as deleteWorkspaceSnapshot,Zb as dependencyToRelationship,Bm as deps,QA as deriveAssuranceProposals,eP as deriveExtensionCapabilities,_R as derivePmBulkMutationEffect,fv as derivePmRecoveryReferenceObligations,Yd as deriveSchemaEvolutionMigrationId,ow as deriveTelemetryCommandResolution,bE as describeAllowedTransitions,_x as describeExtensionActivation,tP as describeExtensionBlueprint,il as describeItemOwnershipConflict,Ut as describeProfileComposition,jt as describeProjectProfile,PI as describeUnknownError,Co as detectAgentIdentity,Ao as detectHarnessIdentity,cd as detectRelationshipCommunities,So as diagnoseAgentIdentity,bd as diffRelationshipAuditSnapshots,Nf as diffTestRunMeasurements,iM as digestMcpRequestParameters,sT as discoverExtensions,Ln as discoverNearbyPmRoot,a0 as discoverPmTools,Qg as discoverProjectRuntimeVersionPins,jm as docs,Nm as duplicates,Sd as durableGraphCachePath,Od as durableGraphCacheStatus,Zn as effectiveItemFormatVersion,Cw as emitTelemetryErrorEvent,fm as emptyImportedDocument,fr as encodeMcpHttpHeaderValue,IC as encodeQueryCursor,WC as encodeReadOutputContinuationCursor,eE as enforceHistoryStreamPolicyForItem,tE as enforceHistoryStreamPolicyForItems,fI as enrichCliFlagInvocationContract,Ht as enrichCliFlagInvocationContracts,$w as ensureMaterializedHistoryTarget,$c as ensurePmGitignore,fu as ensureScope,nw as ensureSentryInit,pm as ensureTrackerInitialized,sd as enumerateRelationshipPaths,mi as estimatePmOutputTokens,jA as evaluateAssuranceAssertion,BA as evaluateAssuranceGate,Tk as evaluateBoundaryFixtures,kO as evaluateContextRanking,Vx as evaluateDefectGateEvidence,UA as evaluateMeasurement,ji as evaluateMutationGuard,xf as evaluateProvenanceCoverage,Ef as evaluateSemanticAttributionCoverage,Xl as evaluateSimilarityGovernance,yE as evaluateTransition,zE as executeEmbeddingBatchesWithRetry,KE as executeVectorDelete,WE as executeVectorReset,HE as executeVectorUpsert,$g as executeWorkspaceRecipe,Cu as expandAddGlobEntries,Mu as explainSourceTraceability,$_ as extension,G_ as extensionActivate,U_ as extensionDeactivate,F_ as extensionList,zy as extensionMigrate,LM as extractMcpTraceContext,vw as extractPatchFailureContext,Lu as extractReferencedPmItemIdsFromCommand,oy as federateRelationshipGraphSnapshots,Fm as files,Gm as filesDiscover,Um as filesLookup,TS as finalizeContextUsageDelivery,jg as findCoverageDeficits,Wl as findDuplicateClusters,qd as findGitWorkspaceRoot,eu as findInstalledNpmPackageCandidate,qM as findPmMcpAppByUri,dd as findRedundantRelationshipEdges,pd as findRelationshipCutStructure,Kl as findSimilarItems,Tw as finishTelemetryCommand,Ib as flattenFlagListValue,Fg as flushTelemetryQueue,v_ as focus,ad as forEachMatchedRelationshipEdge,hd as formatDuplicateEdgeGroup,qc as formatHierarchyRelation,_d as formatOrderingStorageContradiction,xw as formatPmPositionalActionFlagTip,cf as formatProfileApplyHuman,af as formatProfileLintHuman,of as formatProfileListHuman,sf as formatProfileShowHuman,Qd as formatSchemaEvolutionMigrationHuman,UR as formatVectorIndexRecoveryWarnings,sI as formatWorkspacePositionHuman,g_ as gc,Mi as generateItemId,Pm as get,CT as getActiveCommandResult,RS as getActiveContextIntentContracts,zn as getActiveExtensionRegistrations,$M as getActiveMcpTraceContext,zA as getAssuranceDeclaration,eh as getContracts,uC as getFocusedItem,Fn as getHistoryPath,jw as getItemAt,$n as getItemPath,zi as getMutationActionContract,Dc as getPmGitignoreBlock,Dn as getSettingsPath,Q_ as getWorkspaceContracts,Ci as getWorkspaceHistoryPath,qm as graph,Ed as graphAuditBaselinePath,wf as groupHistoryByEpisode,sN as handleServiceOverride,YP as hasMcpClientExtension,BM as hasPmMcpAppsCapability,Le as hasSubcommandFlagContractsForCommand,JE as hasVectorizationEmbeddingIdentityChanged,ZE as hasVectorizationVectorDimensionChanged,qS as hashDocument,zS as hashDocumentForVersion,VS as hashEmptyDocument,h_ as health,rd as hierarchyAncestors,nd as hierarchyDescendants,C_ as historyCompact,S_ as historyCompactBulk,EA as historyEntryMatchesProvenance,y_ as historyRedact,b_ as historyRepair,T_ as historyRepairAll,eO as indexBlockedByIds,zc as indexHierarchyRelations,QE as inferConsistentVectorDimension,di as inferPmOutputBudgetClass,Vm as init,aA as inspectCompleteListResult,eT as inspectExtensionManifestSchema,Ld as inspectHistoryAuthorStream,Rx as inspectMergeReceiptEvidence,ty as inspectProjectRuntimeCompatibility,Ji as inspectStaleInProgressItems,$x as inspectStatusRoleAssignments,Si as inspectWorkspaceHistoryState,qp as inspectWorkspaceSnapshot,Xd as installMergeFence,ZP as interpretMcpResultType,Nl as isAlreadyClaimedError,vI as isCommanderError,el as isErrnoError,rx as isExternalDependencyReference,nx as isExternalDependencySourceKind,oe as isFileMissingError,Lb as isHostOutputSuppressed,_ as isMcpRecord,Bi as isMutationAction,Yb as isOrderingRelationshipKind,oE as isPlaceholderReferenceToken,Mc as isPmCliExpectedError,ei as isPmExtensionCapabilityContract,ri as isPmExtensionPolicyModeContract,ni as isPmExtensionPolicySurfaceContract,ti as isPmExtensionServiceNameContract,fR as isPmKnownExitCode,SI as isPmMutationReceipt,$e as isPmSuccessfulExitCode,Qo as isPmToolAction,ey as isProjectMutatingInvocation,fw as isPureSnakeCaseAlias,_S as isReadOutputBudgetExceeded,EC as isReadRowContract,Nd as isRuntimeRecord,hw as isTerminalPlanMode,aC as isTerminalStatus,An as isTimestampLiteral,zI as itemDocumentToMutationOptions,ER as itemHasSchedule,Vi as jaccardSimilarity,$m as learnings,Pb as levenshteinDistanceWithinLimit,Ju as limitAnnotationEntries,Uu as linkedTestTrustFingerprint,rP as lintExtensionBlueprint,tT as lintExtensionManifestSchema,zt as lintProjectProfile,Om as list,ho as listAgentProvenanceAdapters,lh as listAliasPluralKeys,Rm as listAllComplete,vE as listAllDocumentCandidatesCached,Fi as listAllItemMetadata,NE as listAllItemMetadataLight,qA as listAssuranceDeclarations,XA as listAssuranceVerdicts,kg as listBuiltinCorpusShapes,$I as listCoreClosedDomainContracts,mO as listGetProjectionFields,Ax as listInvalidProvenanceHistoryStreamIds,pO as listListProjectionFields,Ix as listMergeReceipts,qi as listMutationActions,ZR as listMutationEvents,an as listPmCommandFlagBudgets,pf as listPmCommandsForFamily,lf as listPmCommandsForTier,we as listPmFlagLexicon,qv as listPmFlagSpellingInventory,ff as listPmMcpToolsForProfile,vv as listPmRequiredArgumentRefusalContracts,Nv as listPmSubcommandRefusalContracts,Gt as listProfiles,$v as listTrackerPreflightRecoveryContracts,zp as listWorkspaceSnapshots,mA as loadContextIntentRuntimeLayers,Yp as loadCreateTemplateOptions,aT as loadExtensions,Id as loadGraphAuditBaseline,xb as loadMutationCheckpoint,M as loadRelationshipGraphAdapter,Di as locateItem,BT as looksLikeGenericKeyValueEntry,qC as mapReadOutputRows,Px as markMergeReceiptReconciled,hE as matchesRuntimeFilters,yw as maybeRunFirstUseTelemetryPrompt,Lg as measureCorpusShapePlan,GT as mergeAdditiveTags,QI as mergeExtensionBlueprints,BR as mergeHistoryStreams,HR as mergeItemDocuments,KR as mergeJsonDocuments,fh as mergeLinkedTestTwoTokenEntries,qR as mergeRelationshipEventStreams,Il as mergeSortedWarnings,_w as migrateItemFilesToFormat,FE as mutateItem,$E as mutateItemWithHistoryContext,Ai as mutateWorkspaceJsonWithHistory,Mm as next,yo as normalizeAgentProvenanceAdapterValue,Yu as normalizeAnnotationTransportOptions,PA as normalizeAssuranceEvaluation,IA as normalizeAssuranceMutation,mh as normalizeBootstrapInvocation,QT as normalizeBulkIdsValue,Hc as normalizeDependencyGraphTarget,ux as normalizeDependencySeedId,dx as normalizeDependencySourceKind,Gn as normalizeExtensionContributionInventory,wx as normalizeInvalidHistoryProvenance,xI as normalizeItemAddressInvocation,Qn as normalizeItemFormatVersion,Pi as normalizeItemId,no as normalizeItemMetadata,uh as normalizeLegacyExtensionActionSyntax,Tu as normalizeLinkedPath,nE as normalizeParentReferenceValue,$t as normalizeProfileName,Ii as normalizeRawItemId,lS as normalizeReadOutputIncludeModeOptions,XS as normalizeReplayPatchOps,Hi as normalizeSimilarityText,sC as normalizeStatusForRegistry,ro as normalizeStatusInput,rC as normalizeStatusInputWithRegistry,kI as normalizeThrownExitCode,Dm as notes,wn as nowIso,wd as openDurableGraphCache,oM as openMcpRequestState,od as orderingPredecessors,id as orderingSuccessors,$O as packContextCandidates,wl as packRankedContextItems,Y_ as packageActivate,X_ as packageCatalog,J_ as packageDeactivate,K_ as packageDescribe,V_ as packageDoctor,q_ as packageInstall,j_ as packageLifecycle,B_ as packageList,H_ as packageManage,Vy as packageMigrate,W_ as packageReload,z_ as packageUninstall,NC as paginateQueryRows,mu as parseAddEntries,_u as parseAddGlobEntries,Qu as parseAnnotationTextInput,jI as parseAtomicMutationControls,ch as parseBootstrapCommandName,ih as parseBootstrapGlobalOptions,ah as parseBootstrapHelpRequest,_h as parseBootstrapTypeValue,ZT as parseBulkIdsText,Tl as parseContextDepth,hl as parseContextFocusFields,lA as parseContextIntentDeclarations,Cl as parseContextSections,jO as parseContextSignalSnapshot,jT as parseCsvKv,Kx as parseDefectChangeRiskRequest,Hx as parseDefectRecurrencePolicy,vp as parseEvalQuerySet,kd as parseGraphSubcommand,CA as parseHistoryProvenanceFilters,hA as parseIntegerLimit,cC as parseItemDocument,BI as parseItemMutationBatch,fE as parseLimit,cp as parseLinkedTestAssertionEqualsMap,dp as parseLinkedTestAssertionGteMap,rp as parseLinkedTestBoolean,np as parseLinkedTestContextMode,tp as parseLinkedTestEnvClear,ep as parseLinkedTestEnvSet,up as parseLinkedTestJsonEntries,ap as parseLinkedTestMinLines,sp as parseLinkedTestRegexList,ip as parseLinkedTestStringList,op as parseLinkedTestWorkspaceContextMode,wh as parseMcpCachePolicy,yh as parseMcpImplementation,Ke as parseMcpInputRequests,rr as parseMcpInputResponses,Wh as parseMcpSubscriptionFilter,gu as parseMigrateEntries,iO as parseMultiValueFilter,EI as parseMutationReceipt,JT as parseOptionalNonNegativeInteger,YT as parseOptionalNumber,iv as parsePmAgentTaskTranscriptCorpus,s0 as parsePmToolDiscoveryOptions,gA as parsePriority,cO as parsePriorityFilterSet,ZC as parseReadOutputSession,vT as parseRegisteredItemFieldAssignments,ee as parseRelationshipGraphSnapshot,hu as parseRemoveEntries,Pu as parseSourceLineRange,dE as parseStatusFilterCsv,sO as parseStringFilterSet,Kn as parseTags,kf as parseTestRunMeasurements,yA as parseType,aO as parseTypeFilterSet,Gd as parseUnknownAuthorHistoryEventCoordinates,nR as partitionDecisionEntries,ZS as patchPathToChangedField,Cn as pathExists,L_ as pauseTask,Ad as persistDurableGraphResult,TE as persistSelectedItemFormat,RR as planAgentIdentityVocabularyMutation,KO as planCompletedAtBackfill,Vt as planProfileApplication,dv as planRelationshipEventBackfill,Md as planRelationshipRemediation,Jd as planSchemaEvolutionMigration,$d as planUnknownAuthorHistoryAcknowledgment,Vp as planWorkspaceSnapshotRestore,Iw as positionalShapeKey,Pw as positionalSignatureKey,sP as preflightExtension,Wi as prepareSimilarityText,VT as preserveMutationStdinTokenFields,zT as preserveMutationStdinTokenLiterals,US as printError,GS as printResult,u_ as profile,f_ as profileApply,m_ as profileLint,l_ as profileList,p_ as profileShow,ET as projectAfterCommandItemSnapshot,gl as projectContextFocusRows,Pf as projectFleetAttributionAnalytics,SA as projectHistoryProvenance,hi as projectPmDiagnosticOutput,gi as projectPmDiagnosticText,Rf as projectProvenanceCoverageAnalytics,zu as projectValidateCounts,tx as promoteAssuranceAssertion,yS as propagateContextUsageServingReceipt,xk as pruneCompileCacheGenerations,VA as putAssuranceDeclaration,HA as putAssuranceDeclarationBundle,xE as queryItemMetadataIndex,OE as queryLinkedFileMetadataIndex,RE as querySimilarItemMetadataIndex,vf as queryTestRunMeasurementsBelow,ko as quoteCommandArg,Mo as quoteWindowsCommandArg,DI as rankCommandPaths,Zu as readAnnotationEntries,Eo as readAuthorEnvironment,Kf as readBooleanOption,xS as readContextUsageAffinity,Wf as readCsvListOption,iu as readExtensionMigrationState,Sn as readFileIfExists,ds as readFirstStringFromCommanderOptions,us as readFirstValueFromCommanderOptions,Af as readHistoryAnalyticsWindow,_C as readHistoryEntries,yf as readImprovementLedger,ME as readItemMetadataDerivedIndexState,$i as readLocatedItem,jC as readOutputBudgetCollections,KC as readOutputCollectionFingerprint,UC as readOutputContinuationRowCollections,FC as readOutputContinuationRowPaths,dS as readOutputIncludeModeOptions,GC as readOutputRowCollections,$C as readOutputRowPaths,tS as readOutputSessionRemainingTokens,It as readPmPackageManifest,th as readRequiredString,ki as readSettings,CE as readSettingsWithMetadata,ls as readStringArrayFromCommanderOptions,Hf as readStringOption,MI as readThrownExitCode,ew as readVectorizationStatusLedger,pA as readWorkspaceContextIntentContracts,VO as readWorkspaceContextSignals,YO as readWorkspaceMemory,iI as readWorkspacePosition,qn as reconcileExtensionCapabilityUsage,Oi as reconcileWorkspaceJsonHistory,ST as recordAfterCommandAffectedItem,WA as recordAssuranceVerdict,ll as recordClaimSemanticAttribution,ES as recordContextUsageDelivery,SS as recordContextUsageServing,wS as recordContextUsageTouch,AS as recordContextUsageTouches,fl as recordFocusSemanticAttribution,gf as recordImprovementObservation,pl as recordReleaseSemanticAttribution,kE as refreshItemMetadataDerivedIndex,Kd as refreshMergeAttributeFenceIfInstalled,rw as refreshSearchArtifactsForMutation,go as registerAgentProvenanceAdapters,ax as registerExternalDependencyResolver,_o as registerHarnessSignalDescriptors,hC as registerOutputMaterialFieldGroups,I_ as release,KA as removeAssuranceDeclaration,En as removeFileIfExists,Ru as renameArtifactsResultKey,al as renderCalendarMarkdown,cl as renderCalendarToon,Pl as renderContextMarkdown,nu as renderExtensionDescribeMarkdown,tu as renderExtensionSurfaceMarkdown,gm as renderGuideMarkdown,II as renderMissingOptionRetry,oR as renderNextMarkdown,FI as renderPmClosedDomainHelp,vo as renderPmCommand,$o as renderPmCommandAliasMigrationHint,hf as renderPmCommandVisibilityMarkdown,Vv as renderPmFlagLexiconMarkdown,VM as renderPmMcpAppHtml,Sv as renderPmRefusalClosureCensusMarkdown,lE as renderRowsAsCsv,pE as renderRowsAsTable,A_ as reopen,Dw as replayHistoryToTarget,KS as replayToCanonicalItemDocument,HS as replayToItemDocument,aR as requireTerminalReason,cR as requireTerminalReasonWithRecovery,yT as resetActiveExtensionRuntimeState,ed as resetWorkspaceGraphCache,co as resolveAgentSessionContextFromSignals,ol as resolveAnnotationIndex,tl as resolveAnnotationInput,mC as resolveAuthor,xo as resolveAuthorIdentity,rE as resolveBodyFileContent,vg as resolveBuiltinCorpusShape,sl as resolveCalendarOutputFormat,gI as resolveCanonicalPmErrorCodeContract,Xb as resolveCanonicalRelationshipKind,fC as resolveClaimPrincipal,eC as resolveCliBulkIdsInput,zb as resolveCommandOptionPolicyState,Ak as resolveCompileCacheGeneration,HO as resolveCompletionTimestamp,Fb as resolveConfiguredPmPackageRoot,hO as resolveContentFieldFilters,MS as resolveContextIntentContract,yl as resolveContextOutputFormat,bl as resolveContextTokenBudget,yR as resolveCreateExplicitEmptyFlag,GE as resolveEmbeddingProviders,du as resolveExtensionInstallSourceIdentity,ou as resolveExtensionMigrationStatePath,iT as resolveExtensionRoots,cx as resolveExternalDependencyReference,Rb as resolveFlagValueKind,_m as resolveGuideOutputFormat,bf as resolveHistoryEpisodeGroupIdentity,TA as resolveHistoryProvenanceDimensions,Fw as resolveHistorySubject,Nw as resolveHistoryTarget,LR as resolveHybridSemanticWeight,Nn as resolveImplicitPmRoot,Eb as resolveIsoOrRelative,rO as resolveItemBlockers,qI as resolveItemMutationDocument,vn as resolveItemTypeRegistry,tC as resolveItemTypesFilePath,Bf as resolveLinkedTestFailureExitCode,Du as resolveLinkedTestSourceRef,$u as resolveLinkedTestSourceWorkspaceRoot,ju as resolveLinkedTestTrust,Bu as resolveLinkedTestTrustBatch,Xh as resolveMcpAcknowledgedSubscriptionFilter,qe as resolveMcpRequestContext,Bd as resolveMergeInstallContext,_O as resolveMissingMetadataFilters,RI as resolveMissingOptionPlaceholder,SC as resolveModePairedOutputOmissionReceipt,tR as resolveNextOutputFormat,AC as resolveOutputOmissionReceipt,$b as resolvePmCliVersion,Do as resolvePmCommandAlias,Ue as resolvePmCommandCapabilityFamily,vt as resolvePmCommandExitContract,fi as resolvePmCommandOutputBudget,Wt as resolvePmCommandOutputEnvelope,ww as resolvePmCommandPositionalContract,je as resolvePmCommandVisibilityTier,_i as resolvePmDiagnosticOutputBudget,yI as resolvePmErrorCodeContract,Uy as resolvePmFlagSemanticConcept,Db as resolvePmPackageRootFromModule,Aw as resolvePmPositionalActionContract,hc as resolvePmPositionalActionFlagContracts,Re as resolvePmRoot,bc as resolvePmToolCustomFieldCollision,aE as resolvePriority,Ft as resolveProfile,Vd as resolveProjectMergeTypeFolders,vC as resolveQueryCursorStart,pS as resolveReadOutputDimensions,hS as resolveReadOutputEncoding,VC as resolveReadOutputRecoveryBudget,aS as resolveReadOutputSurface,wC as resolveReadRowContract,OI as resolveRecoveryCommandName,LT as resolveRegisteredSearchProvider,DT as resolveRegisteredVectorStoreAdapter,es as resolveReproducibleProcessEnvironment,Xn as resolveRuntimeFieldRegistry,Wn as resolveRuntimeStatusRegistry,UE as resolveSearchCorpusFields,vR as resolveSearchMaxResults,kR as resolveSearchPage,NR as resolveSearchScoreThreshold,DR as resolveSearchTuning,BE as resolveSemanticCorpusCharacterLimit,ul as resolveSemanticLineageIds,EE as resolveSettingsWithSemanticRuntimeDefaults,yx as resolveSourceContextWritePolicy,df as resolveStartTaskInProgressStatus,X as resolveSubcommandFlagContractsForCommand,gb as resolveTelemetryErrorCategory,sR as resolveTerminalReason,qb as resolveTypeDefinition,Bb as resolveTypeName,uE as resolveTypeSynonym,gE as resolveTypeWorkflows,Fd as resolveUnknownAuthorAcknowledgmentSelector,GR as resolveVectorIndexRecovery,VE as resolveVectorStores,Uc as resolveWorkspaceRelationshipKindRegistry,Hb as resolveWorkspaceRoot,k_ as restore,Ob as restoreCheckpointItems,Ri as restoreWorkspaceJsonFromHistory,Kp as restoreWorkspaceSnapshot,Hp as restoreWorkspaceSnapshotWithRecovery,nh as runAction,xT as runActiveBeforeMutationHooks,RT as runActiveCommandHandler,OT as runActiveOnIndexHooks,Hn as runActiveOnReadHooks,Vn as runActiveOnWriteHooks,IT as runActiveParserOverride,PT as runActivePreflightOverride,MT as runActiveServiceOverride,Gc as runActivity,oT as runAfterCommandHooks,Wu as runAggregate,nl as runAnnotationCommand,Xu as runAppend,Yx as runAssuranceAction,Jx as runAssuranceDispatch,nT as runBeforeCommandHooks,dl as runCalendar,Ll as runClaim,Dl as runClaimNext,Gl as runClose,jl as runCloseMany,Bl as runComments,ym as runCompletion,Sp as runConfig,kt as runContext,LO as runContextEvaluationCorpus,vO as runContextEvaluationScenario,gp as runCopy,lp as runCreate,yp as runDelete,td as runDeps,Iu as runDocs,wI as runDuplicates,Dp as runEval,Fp as runEvent,uu as runExtension,cu as runExtensionMigrateAction,au as runExtensionMigrations,ku as runFiles,Nu as runFilesDiscover,vu as runFilesLookup,If as runFleetAttributionAnalytics,bp as runFocus,Cp as runGc,Tp as runGet,vd as runGraph,hm as runGuide,lu as runHealth,hR as runHistory,cI as runHistoryCompact,lI as runHistoryCompactBulk,Gw as runHistoryRedact,Nx as runHistoryRepair,Dx as runHistoryRepairAll,Ip as runInit,xp as runInitAgentGuidance,ql as runLearnings,Ou as runLinkedArtifacts,qf as runLinkedTests,Ku as runList,$p as runMeet,XR as runMergeDriver,Wd as runMergeInstall,kx as runMergeReceiptEvidenceReport,Mx as runMergeReceiptReport,YR as runMergeReconcile,vl as runNext,zl as runNotes,hp as runPlan,nf as runProfileApply,rf as runProfileLint,ef as runProfileList,tf as runProfileShow,Of as runProvenanceCoverageAnalytics,dP as runRegisteredCommandForTest,mP as runRegisteredCommandOverrideForTest,CP as runRegisteredExporterForTest,lP as runRegisteredHookForTest,TP as runRegisteredImporterForTest,bP as runRegisteredMigrationForTest,uP as runRegisteredMutationGuardForTest,pP as runRegisteredParserOverrideForTest,fP as runRegisteredPreflightOverrideForTest,_P as runRegisteredRendererOverrideForTest,gP as runRegisteredSearchProviderForTest,hP as runRegisteredServiceOverrideForTest,yP as runRegisteredVectorStoreAdapterForTest,Xt as runReindex,$l as runRelease,Gp as runRemind,pI as runReopen,Ul as runRestore,Zd as runSchemaEvolutionMigration,Np as runSearch,Dg as runSearchRefreshWorkerEntrypoint,bm as runStartBackgroundRun,Lf as runStats,$f as runTelemetry,Zp as runTemplatesList,Jp as runTemplatesSave,Qp as runTemplatesShow,zf as runTest,Vf as runTestAll,Tm as runTestRunsList,Sm as runTestRunsLogs,wm as runTestRunsResume,Cm as runTestRunsStatus,Em as runTestRunsStop,Am as runTestRunsWorker,pp as runUpdate,fp as runUpdateMany,Nt as runUpgrade,Hu as runValidate,rh as runWithActiveExtensions,uo as runWithAgentSessionContext,IS as runWithContextIntentContracts,_A as runWithDiscoveredContextIntentContracts,bo as runWithHarnessDetectionSignals,DM as runWithMcpTraceContext,rs as runWithReproducibleProcessEnvironment,To as runWithWorkspaceHarnessSignalDescriptors,qr as runWithWorkspaceRecipe,xR as runWorkspaceTransactionGc,Pd as saveGraphAuditBaseline,px as scanExtensionHostVersions,Dd as scanHistoryAuthorAttribution,to as scanItemFormatVersions,Ui as scanMutationSecrets,xx as scanProvenanceResolverHealth,Zi as scanStaleInProgressItems,Gx as scanStorageIntegrity,Km as schema,e_ as schemaAddField,Zm as schemaAddStatus,Ym as schemaAddType,o_ as schemaApplyPreset,i_ as schemaInferTypes,Wm as schemaList,r_ as schemaListFields,c_ as schemaRemapStatus,t_ as schemaRemoveField,Qm as schemaRemoveStatus,Jm as schemaRemoveType,a_ as schemaRenameField,s_ as schemaRenameType,Xm as schemaShow,n_ as schemaShowField,d_ as schemaShowStatus,LI as scoreCommandPathMatch,IO as scoreContextCandidates,PO as scoreContextCandidatesWithActiveExtensions,Xi as scoreItemSimilarity,Lv as scorePmGrammarRefusalClosure,Av as scorePmRefusalClosure,Yi as scorePreparedItemSimilarity,Fv as scoreTrackerPreflightRecoveryClosure,nM as sealMcpRequestState,Im as search,QO as searchWorkspaceMemory,eR as searchWorkspaceMemoryReadResult,OC as selectCursorSemanticOptions,lm as selectImportAuthor,MM as selectMcpClientRegistrationMode,ZO as selectWorkspaceMemory,JO as selectWorkspaceMemoryRollups,_l as semanticAttributionAffinity,cw as sentryCaptureCliError,aw as sentryFinishCommandSpan,uw as sentryFlush,dw as sentryLogCliUsageError,iw as sentrySetCommandContext,sw as sentryStartCommandSpan,io as serializeItemDocument,GI as serializeNdjsonRows,UI as serializeNdjsonStream,bT as setActiveCommandContext,TT as setActiveCommandResult,pT as setActiveExtensionCommands,lT as setActiveExtensionHooks,fT as setActiveExtensionParsers,mT as setActiveExtensionPreflight,gT as setActiveExtensionRegistrations,hT as setActiveExtensionRenderers,_T as setActiveExtensionServices,lC as setFocusedItem,gw as shouldCompletePlanOnClose,Rd as shouldPersistDurableGraphCache,WT as shouldResolveMutationStdinTokenField,KT as shouldResolveMutationStdinTokens,AE as shouldRunSearchRefreshInForeground,Hl as similarityAdvisoryWarnings,DC as sliceReadOutputRowCollection,wu as sortLinkedArtifacts,$T as splitAcceptanceCriteria,mw as splitCommaList,oo as splitFrontMatter,fS as stabilizeReadOutputReceiptEstimates,ie as stableStringify,rT as stableValueEquals,N_ as startTask,bw as startTelemetryCommand,vm as stats,nC as statusIsTerminal,sh as stripGlobalBootstrapTokens,QR as subscribeMutationEventBatches,eI as subscribeMutationEvents,OR as summarizeAgentIdentityVocabulary,Cf as summarizeAgentModelProvenance,Sf as summarizeAgentProvenance,NO as summarizeContextEvaluationReports,Ff as summarizeContextPreflight,AA as summarizeHistoryProvenance,Op as summarizeInitResult,Ox as summarizeMergeReceipt,bR as supportsCreateExplicitEmpty,AI as supportsItemIdAlias,Nb as suppressHostOutput,Ce as syncRelationshipGraphAdapter,nP as synthesizeExtensionManifest,gc as toCompletionFlagString,Rl as toContextFocusItem,Al as toContextPackingSummary,xl as toContextRankingSummary,bb as toErrorMessage,Yf as toEstimatedMinutesValue,tA as toExtensionFlagDefinitions,tm as toImportBoolean,im as toImportConfidence,em as toImportInteger,dm as toImportLinkedDocs,cm as toImportLinkedFiles,um as toImportLinkedTests,am as toImportLogEntries,sm as toImportNormalizedEnum,om as toImportNumberMap,Jf as toImportPriority,Qf as toImportStatus,rm as toImportStringList,nm as toImportStringMap,Zf as toImportTags,dC as toItemRecord,Xf as toNonEmptyImportString,yb as toNonEmptyStringOrUndefined,WS as toReplayDocument,Ki as tokenizeSimilarityText,HT as transferMutationStdinTokenPolicy,nI as translateHostEnvironmentFault,w_ as update,Z_ as upgrade,__ as validate,DA as validateAssertionDefinition,FA as validateAssuranceDocument,$A as validateGateDefinition,VI as validateItemMutationRows,xu as validateLinkedPaths,kM as validateMcpAuthorizationResponseIssuer,PM as validateMcpAuthorizationServerMetadata,vM as validateMcpClientMetadataDocument,SM as validateMcpHttpRequestHeaders,aM as validateMcpJsonSchema,LA as validateMeasurementDefinition,iE as validateMissingParentReference,cS as validateReadOutputOptions,cE as validateSprintOrReleaseValue,Vb as validateTypeOptions,mI as verifyCliFlagInvocationParity,Rw as verifyExplicitPositionalSlotCensus,JS as verifyHistoryChain,YS as verifyHistoryChainWithVersion,Uw as verifyHistoryEntries,kw as verifyPmCliGrammar,Mw as verifyPmCommandPositionalContracts,zv as verifyPmFlagLexicon,hv as verifyPmRecoveryKindRuntimeCoverage,Py as verifyPmRecoveryProducerRuntimeCoverage,_v as verifyPmRecoveryReferences,Tv as verifyPmRefusalClosureIdentityRatchet,bv as verifyPmRefusalClosureRatchet,mv as verifyPmRefusalReachability,ys as verifyToolOptionCliParity,Ds as withFlagAliasMetadata,oI as withHostEnvironmentBoundary,sM as withMcpCachePolicy,Qc as workspaceGraphCache,rl as wrapOwnershipConflict,NI as wrapThrownErrorForSentry,wo as writeAuthorEnvironment,Oe as writeFileAtomic,Ab as writeMutationCheckpoint,SE as writeSettings,FS as writeStdout,tw as writeVectorizationStatusLedger,xi as writeWorkspaceJsonWithHistory};
|
|
25
|
+
</html>`}import{createHash as st}from"node:crypto";import{lstat as Lg,readdir as zr,readFile as Dg}from"node:fs/promises";import k from"node:path";import{parseDocument as $g}from"yaml";(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]="5f60bc89-c81b-57ee-a8f2-0d0b18d0af1b")}catch{}})();var $r="io.modelcontextprotocol/skills",at="SEP-2640@a3e147ca2710f68214247aecc729731ee1ae8d03",Fg=Object.freeze({revision:at,status:"draft",directoryRead:!0});function Vk(e,t=!1){let r=e.clientCapabilities.extensions,n=_(r)?r[$r]:void 0;if(!_(n)||n.revision!==at||t&&n.directoryRead!==!0)throw new p("Missing or incompatible Skills over MCP draft capability",f.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[$r]:Fg}}})}var P=Object.freeze({maxFilesPerSkill:512,maxFileBytes:16*1024*1024,maxSkillBytes:16*1024*1024,defaultPageSize:20,maxPageSize:100}),Fr=100,jg=32*1024*1024,Gg=/^[a-z0-9]+(?:-[a-z0-9]+)*$/u,jr=new Set(Array.from({length:P.maxPageSize},(e,t)=>t+1));function T(e,t){throw new p(e,-32602,t)}function Gr(e,t){try{return new TextDecoder("utf-8",{fatal:!0}).decode(t),e.endsWith(".md")?"text/markdown":"text/plain"}catch{return"application/octet-stream"}}function Ug(e,t){let r=/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/u.exec(e);r||T(`Skill ${t} is missing YAML frontmatter.`);let n=$g(r[1],{prettyErrors:!1,strict:!0,uniqueKeys:!0});n.errors.length>0&&T(`Skill ${t} has invalid YAML frontmatter.`,{errors:n.errors.map(i=>i.message)});let o;try{o=n.toJS({maxAliasCount:0})}catch(i){T(`Skill ${t} has unsupported YAML aliases.`,{error:String(i)})}return(typeof o!="object"||o===null||Array.isArray(o))&&T(`Skill ${t} frontmatter must be an object.`),o}async function Bg(e,t,r,n){return r>P.maxFileBytes&&T(`Skill resource exceeds the per-file limit: ${t}.`),n.files+=1,n.files>P.maxFilesPerSkill&&T(`Skill exceeds ${P.maxFilesPerSkill} files.`),n.skillBytes+=r,n.skillBytes>P.maxSkillBytes&&T(`Skill exceeds the aggregate byte limit: ${t}.`),n.originBytes.value+=r,n.originBytes.value>jg&&T(`Skill origin exceeds the aggregate byte limit: ${t}.`),Dg(e)}async function Vr(e,t,r){let n=k.join(e,t),o=await zr(n,{withFileTypes:!0}),i=[];for(let s of o.sort((a,c)=>a.name.localeCompare(c.name))){let a=k.posix.join(t.split(k.sep).join("/"),s.name),c=k.join(e,...a.split("/")),d=await Lg(c);d.isSymbolicLink()&&T(`Skill resource must not be a symbolic link: ${a}.`),d.isDirectory()?i.push(...await Vr(e,a,r)):d.isFile()?i.push({relative:a,bytes:await Bg(c,a,d.size,r)}):T(`Skill resource must be a regular file or directory: ${a}.`)}return i}async function Ur(e,t,r){let n=new Map,o;try{o=await zr(e,{withFileTypes:!0})}catch(a){if(St(a))return n;throw a}let i=o.filter(a=>a.isDirectory()&&Gg.test(a.name)).sort((a,c)=>a.name.localeCompare(c.name));i.length>Fr&&T(`Skill origin exceeds ${Fr} directories.`);let s={value:0};for(let a of i){let c=await Vr(k.join(e,a.name),"",{files:0,skillBytes:0,originBytes:s}),d=c.reduce((h,C)=>h+C.bytes.byteLength,0),l=c.find(h=>h.relative==="SKILL.md");if(!l)continue;let u=Ug(l.bytes.toString("utf8"),a.name);u.name!==a.name&&T(`Skill directory ${a.name} must match frontmatter name.`,{actual:u.name??null,expected:a.name}),(typeof u.description!="string"||u.description.trim().length===0)&&T(`Skill ${a.name} requires a non-empty frontmatter description.`,{required:["description"]});let m=c.map(h=>({uri:`skill://${a.name}/${h.relative}`,digest:`sha256:${st("sha256").update(h.bytes).digest("hex")}`,size:h.bytes.byteLength})),g=st("sha256").update(m.map(h=>`${h.uri}:${h.digest}`).join(`
|
|
26
|
+
`)).digest("hex");n.set(a.name,{uri:`skill://${a.name}/SKILL.md`,frontmatter:u,resources:m,_meta:{contractVersion:1,extensionRevision:at,origin:t,packageVersion:r,protocolVersion:H,trust:"untrusted",estimatedTokens:Math.ceil(d/4)},files:new Map(c.map(h=>[h.relative,h.bytes])),fingerprint:g})}return n}function Br(e){let{files:t,fingerprint:r,...n}=e;return n}var qr=class e{#e;#t;constructor(t){this.#e=t,this.#t=st("sha256").update([...t.entries()].sort(([r],[n])=>r.localeCompare(n)).map(([r,n])=>`${r}:${n.fingerprint}`).join(`
|
|
27
|
+
`)).digest("hex").slice(0,16)}#r(t,r){if(!t)return 0;try{let n=JSON.parse(Buffer.from(t,"base64url").toString("utf8"));return(typeof n!="object"||n===null||!("fingerprint"in n)||n.fingerprint!==this.#t||!("scope"in n)||n.scope!==r||!("offset"in n)||!Number.isInteger(n.offset)||Number(n.offset)<0)&&T("Skill cursor is invalid or stale."),Number(n.offset)}catch(n){if(n instanceof p)throw n;return T("Skill cursor is invalid or stale.")}}#n(t,r){return Buffer.from(JSON.stringify({fingerprint:this.#t,offset:t,scope:r})).toString("base64url")}static async load(t){let r=await Ur(k.join(t.packageRoot,".agents","skills"),"package",t.packageVersion);if(t.workspaceRoot){let n=k.resolve(t.packageRoot,".agents","skills"),o=k.resolve(t.workspaceRoot,".agents","skills");if(o!==n){let i=await Ur(o,"workspace",t.packageVersion);for(let[s,a]of i)r.set(s,a)}}return new e(r)}list(t={}){let r=t.limit??P.defaultPageSize;jr.has(r)||T(`Skill list limit must be an integer from 1 to ${P.maxPageSize}.`);let n=this.#r(t.cursor,"skills/list"),o=[...this.#e.values()].sort((c,d)=>c.uri.localeCompare(d.uri)),i=o.slice(n,n+r),s=n+i.length,a=s<o.length;return{skills:i.map(Br),hasMore:a,...a?{nextCursor:this.#n(s,"skills/list")}:{}}}get(t){let r=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)\/SKILL\.md$/u.exec(t),n=r?this.#e.get(r[1]):void 0;return n||T(`Unknown pm MCP skill: ${t}.`,{field:"uri"}),Br(n)}read(t){let r=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)\/(.+)$/u.exec(t),n=r?this.#e.get(r[1]):void 0,o=r?.[2]??"",i=n&&o?n.files.get(o):void 0,s=n?.resources.find(d=>d.uri===t);(!n||!i||!s)&&T(`Unknown pm MCP skill resource: ${t}.`,{field:"uri"});let a={digest:s.digest,origin:n._meta.origin,trust:"untrusted"},c=Gr(o,i);return c!=="application/octet-stream"?{contents:[{uri:t,mimeType:c,text:i.toString("utf8"),_meta:a}]}:{contents:[{uri:t,mimeType:c,blob:i.toString("base64"),_meta:a}]}}readDirectory(t,r={}){let n=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)(?:\/(.+))?$/u.exec(t),o=n?this.#e.get(n[1]):void 0;o||T(`Unknown pm MCP skill directory: ${t}.`,{field:"uri"});let i=(n?.[2]??"").replace(/\/$/u,""),s=i.length>0?`${i}/`:"",a=`skill://${n[1]}`,c=new Map;for(let C of o.resources){let w=C.uri.slice(`${a}/`.length);if(!w.startsWith(s))continue;let z=w.slice(s.length),[I,...wt]=z.split("/"),Pn=`${a}/${s}${I}`,kn=o.files.get(`${s}${I}`);c.set(I,{uri:Pn,name:I,mimeType:wt.length>0?"inode/directory":Gr(I,kn)})}i.length>0&&c.size===0&&T(`Unknown pm MCP skill directory: ${t}.`,{field:"uri"});let d=r.limit??P.maxPageSize;jr.has(d)||T(`Skill directory limit must be an integer from 1 to ${P.maxPageSize}.`);let l=this.#r(r.cursor,t),u=[...c.values()].sort((C,w)=>C.uri.localeCompare(w.uri)),m=u.slice(l,l+d),g=l+m.length,h=g<u.length;return{resources:m,hasMore:h,...h?{nextCursor:this.#n(g,t)}:{}}}};(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="cc0d4dd1-20e8-59d4-acb5-9f8ed639d35f")}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]="f48b9002-59dc-54d3-95de-36bf0d11b39a")}catch{}})();var Hr="https://schema.unbrained.dev/pm/workspace-recipe/v1";function ct(e,t){if(e===null||typeof e=="boolean"||typeof e=="string")return e;if(typeof e=="number"){if(!Number.isFinite(e))throw new Error(`Workspace recipe JSON number must be finite at ${t}`);return e}if(Array.isArray(e))return Object.freeze(e.map((r,n)=>ct(r,`${t}[${n}]`)));if(typeof e!="object"||Object.getPrototypeOf(e)!==Object.prototype&&Object.getPrototypeOf(e)!==null)throw new Error(`Workspace recipe input must contain JSON values at ${t}`);return Object.freeze(Object.fromEntries(Object.entries(e).map(([r,n])=>[r,ct(n,`${t}.${r}`)])))}function Se(e){if(e.schema!==Hr)throw new Error(`Unsupported workspace recipe schema: ${e.schema}`);let t=Et(e);if(e.operations.some(r=>r.action.trim().length===0||r.input===null||Array.isArray(r.input)))throw new Error("Workspace recipe operations require an action and object input");return Object.freeze({...t,operations:Object.freeze(e.operations.map((r,n)=>Object.freeze({action:r.action,input:ct(r.input,`operations[${n}].input`)})))})}async function Kr(e,t){let r=Se(e);return At(r,t)}async function qg(e,t){return Kr(e,async()=>{let r=[];for(let[n,o]of e.operations.entries())r.push(await t(o,n));return r})}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="38cb0b88-262f-5061-b95a-f4532bc52613")}catch{}})();var Wr="pm.agent-observation/v1",Xr="pm.agent-verdict/v1",Yr="pm.agent-episode/v1";function R(e,t){if(!Number.isSafeInteger(e)||e<=0)throw new Error(`${t} must be a positive safe integer.`)}function M(e,t){if(e.trim().length===0)throw new Error(`${t} must not be empty.`)}function oe(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let t of Object.values(e))oe(t)}return e}function zg(e){if(e.length===0)throw new Error("observation.reads must declare at least one bounded read.");let t=0;for(let r of e)if(M(r.command,"observation.reads.command"),R(r.budget_tokens,"observation.reads.budget_tokens"),t+=r.budget_tokens,!Number.isSafeInteger(t))throw new Error("observation read ceilings exceed safe integer range.")}function Vg(e){if(e.basis!=="emitted_bytes")throw new Error("observation calibration must use emitted_bytes.");for(let r of e.samples)if(!Number.isSafeInteger(r)||r<0)throw new Error("observation calibration samples must be non-negative safe integers.");if(e.samples.length===0)throw new Error("observation calibration must include at least one sample.");if(R(e.expected_emitted_bytes,"observation.calibration.expected_emitted_bytes"),!Number.isSafeInteger(e.tolerance_bytes)||e.tolerance_bytes<0)throw new Error("observation.calibration.tolerance_bytes must be a non-negative safe integer.");let t=e.samples.reduce((r,n)=>r+n,0)/e.samples.length;if(Math.abs(t-e.expected_emitted_bytes)>e.tolerance_bytes)throw new Error("observation expected_emitted_bytes is outside the calibrated sample tolerance.")}function Hg(e){if(e.length===0)throw new Error("observation.tiers must declare a degradation ladder.");let t=new Set,r=Number.POSITIVE_INFINITY;for(let n of e){if(M(n.id,"observation.tiers.id"),R(n.max_tokens,"observation.tiers.max_tokens"),t.has(n.id))throw new Error(`Duplicate observation tier: ${n.id}.`);if(t.add(n.id),n.max_tokens>r)throw new Error("observation tiers must be ordered from largest to smallest max_tokens.");r=n.max_tokens;let o=new Set;for(let i of n.fields){if(F(i,"observation.tiers.fields"),o.has(i))throw new Error(`Duplicate observation tier field: ${i}.`);o.add(i)}}}function Kg(e){if(e.schema!==Wr)throw new Error(`observation.schema must be ${Wr}.`);return M(e.id,"observation.id"),R(e.version,"observation.version"),zg(e.reads),Vg(e.calibration),e.corpus_dependence.kind==="bounded"&&(M(e.corpus_dependence.dimension,"observation.corpus_dependence.dimension"),R(e.corpus_dependence.maximum,"observation.corpus_dependence.maximum")),Hg(e.tiers),oe(structuredClone(e))}function eM(e){return{contract_id:e.id,contract_version:e.version,guaranteed_ceiling_tokens:e.reads.reduce((t,r)=>t+r.budget_tokens,0),expected_emitted_bytes:e.calibration.expected_emitted_bytes,expected_tokens:Math.ceil(e.calibration.expected_emitted_bytes/4),tolerance_bytes:e.calibration.tolerance_bytes,calibration_basis:"emitted_bytes",corpus_dependence:e.corpus_dependence}}async function Wg(e,t,r){R(r.budget_tokens,"observation request budget_tokens");let n=[];for(let[o,i]of e.tiers.entries()){n.push(i.id);let s=await t(i),a=Buffer.byteLength(v(s),"utf8"),c=Math.ceil(a/4);if(c<=Math.min(r.budget_tokens,i.max_tokens))return{status:"served",payload:s,receipt:{contract_id:e.id,contract_version:e.version,served_tier:i.id,degraded:o>0,attempted_tiers:n,emitted_bytes:a,estimated_tokens:c,calibration_basis:"emitted_bytes"}}}return{status:"refused",reason:"no_declared_tier_fits_budget",receipt:{contract_id:e.id,contract_version:e.version,served_tier:null,degraded:e.tiers.length>1,attempted_tiers:n,emitted_bytes:null,estimated_tokens:null,calibration_basis:"emitted_bytes"}}}function F(e,t){let r=e.split(".");if(r.some(n=>n.length===0||n==="__proto__"||n==="prototype"||n==="constructor"))throw new Error(`${t} must be a safe, non-empty dot-separated path.`);return r}function Jr(e,t){let r=e;for(let n of F(t,"recorded field path")){if(r===null||typeof r!="object"||!Object.hasOwn(r,n))return;r=r[n]}return r}function Xg(e){return`/${F(e,"verdict predicate path").map(t=>t.replaceAll("~","~0").replaceAll("/","~1")).join("/")}`}function Yg(e){if(e.kind!=="field_equals")return;let t;try{t=JSON.stringify(e.expected)}catch{throw new Error(`Expected value for verdict predicate ${e.id} must be JSON serializable.`)}if(t===void 0)throw new Error(`Expected value for verdict predicate ${e.id} must be JSON serializable.`)}function Jg(e){if(e.schema!==Xr)throw new Error(`verdict.schema must be ${Xr}.`);M(e.id,"verdict.id"),R(e.version,"verdict.version");let t=new Set;for(let n of e.predicates){M(n.id,"verdict.predicates.id"),F(n.path,"verdict.predicates.path");let o=n.kind;if(o!=="field_equals"&&o!=="field_present"&&o!=="field_absent")throw new Error(`Unsupported verdict predicate kind for ${n.id}.`);if(t.has(n.id))throw new Error(`Duplicate verdict predicate: ${n.id}.`);Yg(n),t.add(n.id)}if(e.composition.operator!=="all"&&e.composition.operator!=="any")throw new Error("verdict composition operator must be all or any.");if(e.composition.predicate_ids.length!==e.predicates.length)throw new Error("verdict composition must reference every predicate exactly once.");let r=new Set(e.composition.predicate_ids);if(r.size!==e.composition.predicate_ids.length||[...r].some(n=>!t.has(n)))throw new Error("verdict composition contains duplicate or unknown predicate ids.");return oe(structuredClone(e))}function Zg(e,t){if(e.predicates.length===0)return{contract_id:e.id,contract_version:e.version,snapshot_id:t.snapshot_id,outcome:"not_applicable",score:null,policy:"verdict_only_no_reward",reason:"no_predicates_declared",predicates:[]};let r=new Map(e.predicates.map(s=>[s.id,s])),n=e.composition.predicate_ids.map(s=>{let a=r.get(s),c=Jr(t.state,a.path),d=a.kind==="field_present"?c!==void 0:a.kind==="field_absent"?c===void 0:v(c)===v(a.expected);return{id:s,outcome:d?"satisfied":"violated",evidence_pointer:`${t.snapshot_id}#${Xg(a.path)}`,evidence_digest:Rt(v(c))}}),o=n.filter(s=>s.outcome==="satisfied").length,i=e.composition.operator==="all"?o===n.length:o>0;return{contract_id:e.id,contract_version:e.version,snapshot_id:t.snapshot_id,outcome:i?"satisfied":"violated",score:o/n.length,policy:"verdict_only_no_reward",predicates:n}}function tM(e){if(e.schema!==Yr)throw new Error(`episode.schema must be ${Yr}.`);if(M(e.id,"episode.id"),R(e.version,"episode.version"),!["benchmark","evaluation","training","scale_transfer"].includes(e.mode))throw new Error("episode.mode is not supported.");if(e.task_item_ids.length===0)throw new Error("episode.task_item_ids must declare at least one pm item.");for(let t of e.task_item_ids)M(t,"episode.task_item_ids");R(e.limits.max_actions,"episode.limits.max_actions"),R(e.limits.max_observations,"episode.limits.max_observations"),R(e.limits.max_tokens_per_observation,"episode.limits.max_tokens_per_observation");for(let t of e.observable_fields)F(t,"episode.observable_fields");for(let t of e.withheld_fields)F(t,"episode.withheld_fields");for(let t of e.observable_fields){let r=e.withheld_fields.find(n=>t===n||t.startsWith(`${n}.`)||n.startsWith(`${t}.`));if(r!==void 0)throw new Error(`Observable field ${t} overlaps withheld field ${r}.`)}for(let t of e.observation.tiers)for(let r of t.fields)if(!e.observable_fields.includes(r))throw new Error(`Observation tier field ${r} is not declared observable.`);return Kg(e.observation),Jg(e.verdict),Se(e.recipe),oe(structuredClone(e))}function Qg(e,t,r){let n=F(t,"observation projection field"),o=e;for(let[i,s]of n.entries()){if(i===n.length-1){r!==void 0&&(o[s]=structuredClone(r));return}let a=o[s];(a===null||typeof a!="object"||Array.isArray(a))&&(o[s]={}),o=o[s]}}function ey(e,t){let r={};for(let n of t)Qg(r,n,Jr(e,n));return r}async function rM(e,t){let r=[],n=0,o=0,i=!1,s,a={episode:{id:e.id,label:`pm agent environment v${e.version}`},provenance:{role:e.mode,topic:"agent-environment"}},c=await D(a,()=>t.reset(e.recipe));r.push({sequence:1,kind:"reset",state_id:c.state_id});let d=async()=>{if(i)throw new Error("episode is already closed.");if(o>=e.limits.max_observations)throw new Error("episode exceeded limits.max_observations.");o+=1;let u=await t.readRecordedState(),m=await Wg(e.observation,async g=>ey(u.state,g.fields),{budget_tokens:e.limits.max_tokens_per_observation});return r.push({sequence:r.length+1,kind:"observation",state_id:m.receipt.served_tier??u.snapshot_id}),m},l=async(u=!1)=>{if(i&&!u)throw new Error("episode is already closed.");if(o>=e.limits.max_observations)throw new Error("episode exceeded limits.max_observations.");o+=1;let m=await t.readRecordedState(),g=Zg(e.verdict,m);return r.push({sequence:r.length+1,kind:"verdict",state_id:m.snapshot_id}),g};return{observe:()=>D(a,d),step:async u=>{if(i)throw new Error("episode is already closed.");if(n>=e.limits.max_actions)throw new Error("episode exceeded limits.max_actions.");n+=1;let m=await D(a,()=>t.execute(u));return r.push({sequence:r.length+1,kind:"action",state_id:m.state_id}),m},score:()=>D(a,l),close:()=>s!==void 0?s:i?Promise.reject(new Error("episode is already closed.")):(i=!0,s=D(a,()=>l(!0)).then(m=>(r.push({sequence:r.length+1,kind:"close",state_id:m.snapshot_id}),{verdict:m,trajectory:oe(structuredClone(r))})).catch(m=>{throw i=!1,m}).finally(()=>{s=void 0}),s)}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="fa4eb88d-f50e-59fa-be7f-0cfb42931a73")}catch{}})();var j="https://schema.unbrained.dev/pm/corpus-shape/v1";function W(e,t){if(!Number.isSafeInteger(e)||e<=0)throw new TypeError(`Corpus shape ${t} must be a positive safe integer`);return e}function ie(e,t){if(!Number.isSafeInteger(e)||e<0)throw new TypeError(`Corpus shape ${t} must be a non-negative safe integer`);return e}function Qr(e){if(!(typeof e!="object"||e===null||Object.isFrozen(e))){for(let t of Object.values(e))Qr(t);Object.freeze(e)}}function X(e){if(e.schema!==j)throw new TypeError(`Unsupported corpus shape schema: ${e.schema}`);if(e.name.trim().length===0||e.description.trim().length===0)throw new TypeError("Corpus shape name and description must be non-empty");if(W(e.hierarchy_depth,"hierarchy_depth"),W(e.hierarchy_fanout,"hierarchy_fanout"),ie(e.age_span_days,"age_span_days"),W(e.history_entries_per_item,"history_entries_per_item"),ie(e.comments_per_100_items,"comments_per_100_items"),ie(e.notes_per_100_items,"notes_per_100_items"),ie(e.learnings_per_100_items,"learnings_per_100_items"),W(e.author_cardinality,"author_cardinality"),W(e.component_count,"component_count"),e.edge_kind_mix.length===0||e.edge_kind_mix.some(r=>r.kind.trim().length===0||r.weight<=0))throw new TypeError("Corpus shape edge_kind_mix requires non-empty kinds with positive weights");if(e.terminal_statuses.some(r=>!e.custom_statuses.includes(r)))throw new TypeError("Corpus shape terminal_statuses must be declared in custom_statuses");let t=structuredClone(e);return Qr(t),t}var Ee=[{kind:"implements",weight:5},{kind:"blocked_by",weight:2},{kind:"discovered_from",weight:2},{kind:"verifies",weight:2},{kind:"supersedes",weight:1},{kind:"related",weight:4}],Y=Object.freeze({scratch:X({schema:j,name:"scratch",description:"Seconds-old, shallow project with minimal history.",hierarchy_depth:2,hierarchy_fanout:50,age_span_days:0,history_entries_per_item:1,comments_per_100_items:2,notes_per_100_items:1,learnings_per_100_items:1,edge_kind_mix:[{kind:"related",weight:1}],author_cardinality:2,component_count:1,include_cycles:!1,custom_types:[],custom_statuses:[],terminal_statuses:[],custom_fields:[]}),representative:X({schema:j,name:"representative",description:"Medium-lived project with rich evidence and typed lineage.",hierarchy_depth:5,hierarchy_fanout:8,age_span_days:730,history_entries_per_item:12,comments_per_100_items:30,notes_per_100_items:12,learnings_per_100_items:10,edge_kind_mix:Ee,author_cardinality:32,component_count:1,include_cycles:!1,custom_types:["Experiment"],custom_statuses:["review"],terminal_statuses:[],custom_fields:["domain"]}),"deep-graph":X({schema:j,name:"deep-graph",description:"Deep typed relationship graph with deterministic cycles.",hierarchy_depth:16,hierarchy_fanout:2,age_span_days:3650,history_entries_per_item:6,comments_per_100_items:15,notes_per_100_items:8,learnings_per_100_items:8,edge_kind_mix:Ee,author_cardinality:16,component_count:1,include_cycles:!0,custom_types:[],custom_statuses:[],terminal_statuses:[],custom_fields:[]}),"multi-decade":X({schema:j,name:"multi-decade",description:"Thirty-year event history with dense per-item evolution.",hierarchy_depth:6,hierarchy_fanout:6,age_span_days:10958,history_entries_per_item:24,comments_per_100_items:40,notes_per_100_items:20,learnings_per_100_items:16,edge_kind_mix:Ee,author_cardinality:64,component_count:1,include_cycles:!1,custom_types:["Program"],custom_statuses:["archived"],terminal_statuses:["archived"],custom_fields:["portfolio"]}),"disconnected-archive":X({schema:j,name:"disconnected-archive",description:"Multiple disconnected historical project components.",hierarchy_depth:4,hierarchy_fanout:10,age_span_days:7305,history_entries_per_item:8,comments_per_100_items:10,notes_per_100_items:5,learnings_per_100_items:6,edge_kind_mix:Ee,author_cardinality:24,component_count:5,include_cycles:!1,custom_types:["Archive"],custom_statuses:["archived"],terminal_statuses:["archived"],custom_fields:["archive_source"]})});function ty(){return Object.keys(Y).sort().map(e=>Y[e])}function ry(e){let t=e.trim().toLowerCase();if(!Object.hasOwn(Y,t))throw new TypeError(`Unknown corpus shape "${e}". Available: ${Object.keys(Y).join(", ")}`);return Y[t]}var Zr=new WeakMap;function en(e,t){if(e===0)return[];let r=Zr.get(t);r===void 0&&(r=t.edge_kind_mix.flatMap(o=>Array.from({length:o.weight},()=>o.kind)),Zr.set(t,r));let n=[r[e%r.length]];return t.include_cycles&&e>2&&e%17===0&&n.push("related"),[...new Set(n)]}function ny(e,t,r,n=42){if(ie(t,"item index"),W(r,"item count"),t>=r)throw new RangeError(`Corpus item index ${t} exceeds ${r}`);let o=Math.min(e.component_count,r),i=t%o,s=Math.floor(t/o),a=0,c=1;for(let w=0;w<e.hierarchy_depth;w+=1)a=Math.min(Number.MAX_SAFE_INTEGER,a+c),c=Math.min(Number.MAX_SAFE_INTEGER,c*e.hierarchy_fanout);let d=s%a,l=s-d,u=d===0?void 0:i+(l+Math.floor((d-1)/e.hierarchy_fanout))*o,m=Date.UTC(2026,0,1),g=e.age_span_days*864e5,h=new Date(m+(r===1?0:Math.round(t/(r-1)*g))).toISOString(),C=(t*37+n)%100;return{index:t,id:`pm-s${t.toString(36).padStart(7,"0")}`,...u===void 0?{}:{parent:`pm-s${u.toString(36).padStart(7,"0")}`},component:i,timestamp:h,author:`pm-corpus-agent-${(t+n)%Math.min(e.author_cardinality,r)}`,history_entry_count:e.history_entries_per_item,dependency_kinds:en(t,e),has_comment:C<e.comments_per_100_items,has_note:C<e.notes_per_100_items,has_learning:C<e.learnings_per_100_items,...e.custom_types.length>0&&t%11===0?{custom_type:e.custom_types[t%e.custom_types.length]}:{},...e.custom_statuses.length>0&&t%13===0?{custom_status:e.custom_statuses[t%e.custom_statuses.length]}:{}}}var dt=class{shape;authors=new Set;components=new Set;depths=new Map;childCounts=new Map;edgeKinds={};expectedEdgeKinds={};annotations={comments:0,notes:0,learnings:0};annotationFields;planMismatches=[];itemCount=0;observedDepth=0;observedFanout=0;historyEntryCount=0;firstTimestamp=null;lastTimestamp=null;constructor(t){this.shape=t,this.annotationFields=[["comments","has_comment",t.comments_per_100_items],["notes","has_note",t.notes_per_100_items],["learnings","has_learning",t.learnings_per_100_items]]}recordMismatch(t,r){t&&this.planMismatches.push(r)}recordEdgeKinds(t,r){for(let n of r)t[n]=(t[n]??0)+1}add(t){this.itemCount+=1,this.authors.add(t.author),this.components.add(t.component),this.recordMismatch(this.depths.has(t.id),`duplicate_id:${t.id}`);let r=1;if(t.parent!==void 0){let n=this.depths.get(t.parent);this.recordMismatch(n===void 0,`parent_missing:${t.parent}`),r=(n??0)+1;let o=(this.childCounts.get(t.parent)??0)+1;this.childCounts.set(t.parent,o),this.observedFanout=Math.max(this.observedFanout,o)}this.depths.set(t.id,r),this.observedDepth=Math.max(this.observedDepth,r),this.historyEntryCount+=t.history_entry_count,this.recordMismatch(t.history_entry_count!==this.shape.history_entries_per_item,"history_entries_per_item:drift"),this.firstTimestamp=this.firstTimestamp===null||t.timestamp<this.firstTimestamp?t.timestamp:this.firstTimestamp,this.lastTimestamp=this.lastTimestamp===null||t.timestamp>this.lastTimestamp?t.timestamp:this.lastTimestamp;for(let[n,o]of this.annotationFields)this.annotations[n]+=Number(t[o]);this.recordEdgeKinds(this.edgeKinds,t.dependency_kinds),this.recordEdgeKinds(this.expectedEdgeKinds,en(t.index,this.shape))}finish(){let t=Math.min(this.shape.author_cardinality,this.itemCount),r=Math.min(this.shape.component_count,this.itemCount),n=[...this.planMismatches,...this.itemCount===0?["item_count:empty"]:[],...this.authors.size===t?[]:[`author_count:${this.authors.size}!=${t}`],...this.components.size===r?[]:[`component_count:${this.components.size}!=${r}`],...this.observedDepth<=this.shape.hierarchy_depth?[]:[`hierarchy_depth:${this.observedDepth}>${this.shape.hierarchy_depth}`],...this.observedFanout<=this.shape.hierarchy_fanout?[]:[`hierarchy_fanout:${this.observedFanout}>${this.shape.hierarchy_fanout}`]];for(let[s,,a]of this.annotationFields){let c=Math.floor(this.itemCount/100),d=this.itemCount%100,l=c*a+Math.max(0,a+d-100),u=c*a+Math.min(a,d),m=this.annotations[s];(m<l||m>u)&&n.push(`${s}:${m}!in[${l},${u}]`)}let o=new Set([...Object.keys(this.edgeKinds),...Object.keys(this.expectedEdgeKinds)]);for(let s of[...o].sort()){let a=this.edgeKinds[s]??0,c=this.expectedEdgeKinds[s]??0;a!==c&&n.push(`edge_kind:${s}:${a}!=${c}`)}let i=[...new Set(n)];return{shape:this.shape.name,item_count:this.itemCount,author_count:this.authors.size,component_count:this.components.size,hierarchy_depth:this.observedDepth,hierarchy_fanout:this.observedFanout,timestamp_range:{first:this.firstTimestamp,last:this.lastTimestamp},history_entry_count:this.historyEntryCount,annotations:{...this.annotations},edge_kinds:{...this.edgeKinds},matches_declaration:i.length===0,mismatches:i}}};function tn(e){return new dt(e)}function oy(e,t){let r=tn(e);for(let n of t)r.add(n);return r.finish()}(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]="cea03617-5e90-5683-a9d1-289087ed4646")}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]="8c9a34bd-b77a-55ab-a5d1-3594cecfeb3f")}catch{}})();async function iy(){let e=De(process.cwd(),process.env.PM_PATH);await vt(e,(t,r)=>Pt(t,r,{apply_runtime_defaults:!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]="a108f4d2-80c3-540e-821c-5acdf68eb7fa")}catch{}})();async function sy(){await kt()}(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]="340305b6-e3c8-5daa-bfbe-4a9c62a6d039")}catch{}})();var rn=["lines","branches","functions","statements"];function ay(e,t){if(typeof t!="object"||t===null||Array.isArray(t))throw new TypeError(`Coverage entry for ${e} must be an object.`)}function cy(e,t,r){if(typeof r!="object"||r===null||Array.isArray(r))throw new TypeError(`Coverage entry ${e} has invalid ${t} counts.`);let n=r;if(typeof n.covered!="number"||typeof n.total!="number"||!Number.isInteger(n.covered)||!Number.isInteger(n.total)||n.covered<0||n.total<n.covered)throw new TypeError(`Coverage entry ${e} has invalid ${t} counts.`);return{covered:n.covered,total:n.total}}function dy(e){if(typeof e!="object"||e===null||Array.isArray(e))throw new TypeError("Coverage summary must be a JSON object.");if(!("total"in e))throw new TypeError("Coverage summary is missing the total entry.");let t=[];for(let[r,n]of Object.entries(e)){ay(r,n);for(let o of rn){let i=cy(r,o,n[o]),s=i.total-i.covered;s>0&&t.push({file:r,metric:o,uncovered:s,...i})}}return t}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="3edb1f4f-d26e-51a8-b62a-caffdd3ac44b")}catch{}})();var ly=["captured_redacted","captured_verbatim"],uy=[{label:"home directory",pattern:/(?:\/home\/|\/Users\/)[^/\s"']+/u},{label:"GitHub token",pattern:/\b(?:gh[oprsu]_[A-Za-z0-9_]{20,})\b/u},{label:"npm token",pattern:/\bnpm_[A-Za-z0-9]{20,}\b/u},{label:"private key",pattern:/-----BEGIN (?:RSA |EC |OPENSSH )?PRIVATE KEY-----/u}];function x(e){return typeof e=="string"&&e.trim().length>0}function py(e,t){if(typeof t!="object"||t===null||Array.isArray(t))return[{boundary_id:e.id,kind:"invalid_fixture",detail:`${e.fixture_path} must contain a JSON object.`}];let r=t,n=[];r.boundary_id!==e.id&&n.push({boundary_id:e.id,kind:"fixture_boundary_mismatch",detail:`${e.fixture_path} names ${String(r.boundary_id)} instead of ${e.id}.`}),(r.version!==1||!ly.includes(r.capture_source)||!x(r.capture_provenance)||!Array.isArray(r.redactions)||!r.redactions.every(x)||!("input"in r)||!("observed"in r))&&n.push({boundary_id:e.id,kind:"invalid_fixture",detail:`${e.fixture_path} lacks captured provenance, redaction metadata, input, or observed output.`});let o=JSON.stringify(t);for(let i of uy)i.pattern.test(o)&&n.push({boundary_id:e.id,kind:"unsafe_fixture",detail:`${e.fixture_path} contains a possible ${i.label}.`});return n}function fy(e,t){let r=Date.parse(e.waiver_expires_at),n=x(e.waiver_reason)&&x(e.waiver_owner)&&e.waiver_expires_at.endsWith("Z")&&xt(e.waiver_expires_at)&&Number.isFinite(r);return{captured:0,waived:n&&r>=t?1:0,findings:n?r<t?[{boundary_id:e.id,kind:"expired_waiver",detail:`Boundary ${e.id} waiver expired at ${e.waiver_expires_at}.`}]:[]:[{boundary_id:e.id,kind:"invalid_waiver",detail:`Boundary ${e.id} waiver requires reason, owner, and an RFC 3339 UTC expiry.`}]}}function my(e,t,r){if(!x(e.id)||!x(e.producer)||!x(e.consumer)||!x(e.format))return{captured:0,waived:0,findings:[{boundary_id:x(e.id)?e.id:"unknown",kind:"invalid_boundary",detail:"Each boundary requires non-empty id, producer, consumer, and format."}]};if("fixture_path"in e){let n=t[e.fixture_path],o=x(e.fixture_path)&&e.fixture_path in t?py(e,n):[{boundary_id:e.id,kind:"missing_fixture",detail:`Boundary ${e.id} fixture ${String(e.fixture_path)} is missing.`}];return{captured:o.length===0?1:0,waived:0,findings:o}}return fy(e,r)}function bM(e,t,r=new Date){let n=[];if(e.version!==1||!x(e.inventory_scope)||!Array.isArray(e.boundaries))return{ok:!1,boundary_count:0,captured_count:0,waived_count:0,findings:[{boundary_id:"registry",kind:"invalid_registry",detail:"Boundary registry requires version 1, inventory_scope, and boundaries."}]};let o=new Set,i=0,s=0;for(let a of e.boundaries){if(typeof a!="object"||a===null||Array.isArray(a)){n.push({boundary_id:"unknown",kind:"invalid_boundary",detail:"Each boundary must be a JSON object."});continue}let c=a,d=x(c.id)?c.id:void 0;if(d!==void 0&&o.has(d)){n.push({boundary_id:d,kind:"duplicate_boundary",detail:`Boundary ${d} is inventoried more than once.`});continue}d!==void 0&&o.add(d);let l=my(c,t,r.getTime());i+=l.captured,s+=l.waived,n.push(...l.findings)}return n.sort((a,c)=>a.boundary_id!==c.boundary_id?a.boundary_id.localeCompare(c.boundary_id):a.kind.localeCompare(c.kind)),{ok:n.length===0,boundary_count:e.boundaries.length,captured_count:i,waived_count:s,findings:n}}import J from"node:fs";import lt 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]="611e9aba-d08e-5c1a-89c9-c7fda0cc9bc9")}catch{}})();var nn=300*1e3,_y=3;function EM(e){return(e?.trim()||"development").replace(/[^a-zA-Z0-9._-]/g,"_").replace(/^\./,"_")}function AM(e,t){let r=t.trim();if(!/^[a-zA-Z0-9_-][a-zA-Z0-9._-]*$/.test(r))throw new TypeError("Compile-cache generation must be a safe non-empty filename token.");J.mkdirSync(e,{recursive:!0});let n=lt.join(e,r);J.mkdirSync(n,{recursive:!0});let o=new Date;J.utimesSync(n,o,o);let i=J.readdirSync(e).filter(d=>d!==r).flatMap(d=>{try{return[{name:d,mtimeMs:J.statSync(lt.join(e,d)).mtimeMs}]}catch(l){if(l instanceof Error&&"code"in l&&pe(l))return[];throw l}}).sort((d,l)=>l.mtimeMs-d.mtimeMs||d.name.localeCompare(l.name)),s=i.filter(d=>o.getTime()-d.mtimeMs<nn),a=Math.max(0,_y-1-s.length),c=i.filter(d=>o.getTime()-d.mtimeMs>=nn).slice(a).map(d=>d.name).sort((d,l)=>d.localeCompare(l));for(let d of c)J.rmSync(lt.join(e,d),{recursive:!0,force:!0,maxRetries:3,retryDelay:50});return{retained:r,removed:c}}import on from"node:fs";import xe 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]="f9737b75-b285-5fe9-a9ce-63e7c07626cb")}catch{}})();var se="@unbrained/pm-cli",hy=new Set(["append","claim","changelog","close","close-many","close-task","comments","config","copy","create","dedupe-merge","delete","deps","docs","extension","event","events","files","focus","gc","history-author-acknowledge","history-compact","history-redact","history-repair","init","install","item","learnings","meet","merge","normalize","notes","package","packages","pause-task","plan","profile","reindex","release","remind","restore","schema","start-task","test","test-all","test-runs","test-runs-worker","telemetry","templates","twin","update","update-many","upgrade","vcs","workspace"]),sn=new Set(["--author","--output-budget","--output-format","--output-include","--output-limit","--output-session","--path","--pm-path"]),ft=/\b(\d{4})\.(\d{1,2})\.(\d{1,2})(?:-(\d+))?\b/u,Re="2026.8.31";function S(e,t){return e.some(r=>t.includes(r.split("=",1)[0]))}function ut(e,t){return["activate","adopt","adopt-all","deactivate","init","install","migrate","reload","uninstall"].includes(t[0]??"")||S(e,["--activate","--adopt","--adopt-all","--deactivate","--fix-managed-state","--init","--install","--output","--reload","--scaffold","--uninstall"])}var gy={changelog:(e,t)=>{if(t[0]==="generate")return!S(e,["--check"]);let r=e.indexOf("export");return t[0]==="export"&&(S(e,["--output"])||r>=0&&e[r+1]!==void 0&&!e[r+1].startsWith("-"))},comments:e=>S(e,["--add","--delete","--edit","--file","--stdin"]),config:(e,t)=>(t[0]==="project"||t[0]==="global"?t[1]:t[0])==="set",deps:()=>!1,docs:e=>S(e,["--add","--add-glob","--migrate","--remove"]),duplicates:()=>!1,events:()=>!1,extension:ut,files:(e,t)=>S(e,["--add","--add-glob","--migrate","--remove"])||t[0]==="discover"&&S(e,["--apply"]),health:e=>!S(e,["--check-only","--no-refresh","--skip-vectors"]),learnings:e=>S(e,["--add","--delete","--edit","--file","--stdin"]),merge:(e,t)=>t[0]!=="report",notes:e=>S(e,["--add","--delete","--edit","--file","--stdin"]),package:ut,packages:ut,profile:(e,t)=>t[0]==="apply",schema:(e,t)=>["add-field","add-status","add-type","remove-field","remove-status","remove-type","remap-status","rename-field","rename-type"].includes(t[0]??"")&&!(S(e,["--infer"])&&!S(e,["--apply"])),telemetry:(e,t)=>t.slice(0,2).some(r=>["clear","flush"].includes(r)),templates:(e,t)=>t[0]==="save",test:e=>S(e,["--add","--add-json","--background","--measure","--remove","--resume","--run","--stop"]),validate:e=>S(e,["--auto-fix","--prune-missing"]),vcs:(e,t)=>["abandon","create","merge","propose","ref-create"].includes(t[0]??""),workspace:(e,t)=>t[0]==="snapshot"&&["create","delete","restore"].includes(t[1]??"")};function Oe(e){let t=e.match(ft);return t?[Number(t[1]),Number(t[2]),Number(t[3]),Number(t[4]??0)]:null}function G(e,t){let r=Oe(e),n=Oe(t);if(!r||!n)return null;for(let o=0;o<r.length;o+=1){let i=r[o]-n[o];if(i!==0)return Math.sign(i)}return 0}function Ae(e){return G(e,Re)!==-1?3:2}function yy(e,t){if(t===3)return e.filter(r=>r.history_epoch_compatible===!1).map(r=>({...r,declaration:r.declaration??r.version})).sort((r,n)=>G(r.version,n.version))[0]}function pt(e){try{let t=JSON.parse(on.readFileSync(e,"utf8"));return typeof t=="object"&&t!==null&&!Array.isArray(t)?t:null}catch{return null}}function by(e){let t=[...e.matchAll(/(<=|<)\s*v?(\d{4}\.\d{1,2}\.\d{1,2}(?:-\d+)?)/gu)].map(n=>({inclusive:n[1]==="<=",version:n[2]})),r=e.match(/\b\d{4}\.\d{1,2}\.\d{1,2}(?:-\d+)?\s+-\s+v?(\d{4}\.\d{1,2}\.\d{1,2}(?:-\d+)?)/u);return r?[...t,{inclusive:!0,version:r[1]}]:t}function Cy(e){let t=e.split("||").map(r=>by(r));return{bounded:t.some(r=>r.length>0),compatible:t.some(r=>r.every(n=>{let o=G(Re,n.version);return o!==null&&(n.inclusive?o!==1:o===-1)}))}}function Ty(e){return["dependencies","devDependencies","optionalDependencies","peerDependencies"].flatMap(t=>{let r=e[t];if(typeof r!="object"||r===null)return[];let n=r[se],o=typeof n=="string"?n.trim():"",i=/^[<!]/u.test(o)?void 0:o.match(ft)?.[0];if(!i)return[];let s=/^(?:=|v)?\d{4}\.\d{1,2}\.\d{1,2}(?:-\d+)?$/u.test(o),a=Cy(o);return[{version:i,constraint:s?"exact":a.bounded?"range":"minimum",...s?{}:{declaration:o},history_epoch_compatible:s?G(i,Re)!==-1:a.compatible}]})}function wy(e){let r=pt(xe.join(e,"package-lock.json"))?.packages;if(typeof r!="object"||r===null)return;let n=r["node_modules/@unbrained/pm-cli"];if(typeof n!="object"||n===null)return;let o=n.version;return typeof o=="string"?o:void 0}function Sy(e,t){try{let r=on.readFileSync(xe.join(e,t),"utf8").split(/\r?\n/u),n=r.findIndex(c=>c.includes(se));if(n<0)return;let o=r[n].match(/^\s*/u)[0].length,i=[r[n]];for(let c=n+1;c<r.length;c+=1){let d=r[c],l=d.trim(),u=d.match(/^\s*/u)[0].length;if(l.length>0&&u<=o)break;i.push(d)}return i.join(`
|
|
28
|
+
`).match(/^\s*version(?::\s*|\s+)["']?(\d{4}\.\d{1,2}\.\d{1,2}(?:-\d+)?)/mu)?.[1]??i[0].match(ft)?.[0]}catch{return}}function Ey(e){let t=[],r=pt(xe.join(e,"package.json"));r&&t.push(...Ty(r).map(s=>({...s,source:"package.json"})));let o=pt(xe.join(e,"node_modules","@unbrained","pm-cli","package.json"))?.version;typeof o=="string"&&Oe(o)&&t.push({version:o,source:"installed-package",constraint:"exact",history_epoch_compatible:Ae(o)===3});let i=wy(e);i&&Oe(i)&&t.push({version:i,source:"package-lock.json",constraint:"exact",history_epoch_compatible:Ae(i)===3});for(let s of["pnpm-lock.yaml","yarn.lock"]){let a=Sy(e,s);a&&t.push({version:a,source:s,constraint:"exact",history_epoch_compatible:Ae(a)===3})}return t}function an(e){for(let t=0;t<e.length;t+=1){let r=e[t];if(sn.has(r)){t+=1;continue}if(!r.startsWith("-"))return{command:r.toLowerCase(),index:t}}}function Ay(e){let t=an(e);if(!t||S(e,["--help","-h","--dry-run"]))return!1;let{command:r,index:n}=t,o=[];for(let s=n+1;s<e.length;s+=1){let a=e[s];if(sn.has(a)){s+=1;continue}a.startsWith("-")||o.push(a.toLowerCase())}let i=gy[r];return i?i(e,o):hy.has(r)}function xy(e){let t=an(e.argv)?.command,r=Ay(e.argv),n=Ey(e.projectRoot).filter(l=>G(l.version,e.executingVersion)!==null).sort((l,u)=>G(u.version,l.version)),o=n[0],i=o!==void 0&&G(e.executingVersion,o.version)===-1,s=Ae(e.executingVersion),a=yy(n,s),c=r&&a!==void 0,d=i&&!r?{code:"project_runtime_stale_read",executing_version:e.executingVersion,project_version:o.version,source:o.source,message:"This read is using an older pm runtime than the project requires.",next_steps:[`Run the command through the project's installed ${se} ${o.version}.`,"Install the project dependencies with its declared package manager if the local executable is missing."]}:void 0;return{compatible:!r||!i&&!c||e.allowStale===!0,executing_version:e.executingVersion,...o?{project_version:o.version,source:o.source}:{},...t?{command:t}:{},mutating:r,stale:i,history_epoch_incompatible:c,writer_item_hash_version:s,...a?{incompatible_project_version:a.declaration,incompatible_source:a.source}:{},...d?{warning:d}:{},override_applied:r&&(i||c)&&e.allowStale===!0}}function PM(e){let t=xy(e);if(t.compatible)return t;throw t.history_epoch_incompatible?new b(`pm ${t.executing_version} cannot write item-hash epoch ${t.writer_item_hash_version} into a project pinned to pm ${t.incompatible_project_version}.`,L.CONFLICT,{code:"project_runtime_history_epoch_incompatible",reason:t.incompatible_source,why:`The pinned runtime cannot read item_hash_version ${t.writer_item_hash_version}; allowing the write would break its health and validation gates.`,nextSteps:[`Upgrade the project's ${se} pin to ${Re} or newer before mutating tracker history.`,"For an intentional coordinated migration only, set PM_ALLOW_STALE_CLI=1 for this invocation and record why.","Read-only commands remain available without an override."]}):new b(`pm ${t.executing_version} cannot mutate a project pinned to newer pm ${t.project_version}.`,L.CONFLICT,{code:"project_runtime_stale_mutation",reason:t.source,why:"An older runtime can write storage, history, and merge contracts it does not understand.",nextSteps:[`Run this command through the project's installed ${se} ${t.project_version}.`,"For an intentional recovery only, set PM_ALLOW_STALE_CLI=1 for this invocation and record why.","Read-only commands remain available without an override."]})}import{createHash as Oy}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]="4586a8b2-07c8-53d4-9c5d-ca557ee07977")}catch{}})();var mt=1;function Z(e){e?.throwIfAborted()}function U(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship graph ${t} must be non-empty`);return e.trim()}function Q(e,t,r={}){let n=Date.parse(r.createdAt??new Date().toISOString());if(!Number.isFinite(n))throw new TypeError("Relationship graph createdAt must be a valid timestamp");let o=e.nodes(),i=e.edges(),s=t.list();return Object.freeze({version:mt,fingerprint:Oy("sha256").update(v({nodes:o,edges:i,kinds:s})).digest("hex"),created_at:new Date(n).toISOString(),nodes:o,edges:i,kinds:s})}function Ry(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ce(e){if(!Ry(e))throw new TypeError("Relationship graph snapshot must be an object");if(e.version!==mt)throw new TypeError(`Unsupported relationship graph snapshot version: ${String(e.version)}`);if(!Array.isArray(e.nodes)||e.nodes.some(o=>typeof o!="string"))throw new TypeError("Relationship graph snapshot nodes must be strings");if(!Array.isArray(e.edges)||!Array.isArray(e.kinds))throw new TypeError("Relationship graph snapshot edges and kinds must be arrays");if(typeof e.created_at!="string"||!Number.isFinite(Date.parse(e.created_at)))throw new TypeError("Relationship graph snapshot created_at must be valid");if(typeof e.fingerprint!="string")throw new TypeError("Relationship graph snapshot fingerprint must be a string");let t=new $e([]);for(let o of e.kinds)t.register(o);let r=new V(e.nodes,e.edges,t),n=Q(r,t,{createdAt:e.created_at});if(n.fingerprint!==e.fingerprint)throw new TypeError("Relationship graph snapshot fingerprint mismatch");return{snapshot:n,registry:t,graph:r}}async function N(e,t){U(e.name,"adapter name");let r=U(t.workspace,"workspace");Z(t.signal);let n=await e.read({...t,workspace:r});return Z(t.signal),n===null?null:ce(n)}async function Ie(e,t){let r=U(t.workspace,"workspace"),n=ce(t.snapshot).snapshot,o=await N(e,{workspace:r,signal:t.signal});if(o?.snapshot.fingerprint===n.fingerprint)return{adapter:e.name,workspace:r,disposition:"current",fingerprint:n.fingerprint,previous_fingerprint:o.snapshot.fingerprint,node_count:n.nodes.length,edge_count:n.edges.length};if(Z(t.signal),await e.replace({workspace:r,signal:t.signal,snapshot:n,expected_fingerprint:o?.snapshot.fingerprint??null}),(await N(e,{workspace:r,signal:t.signal}))?.snapshot.fingerprint!==n.fingerprint)throw new Error(`Relationship graph adapter "${e.name}" did not expose the replaced snapshot`);return{adapter:e.name,workspace:r,disposition:"written",fingerprint:n.fingerprint,...o?{previous_fingerprint:o.snapshot.fingerprint}:{},node_count:n.nodes.length,edge_count:n.edges.length}}function Iy(e,t={}){let r=e.map(ce),n=new Map;for(let s of r)for(let a of s.snapshot.kinds){let c=n.get(a.kind);if(c&&v(c)!==v(a))throw new TypeError(`Conflicting federated relationship kind: ${a.kind}`);n.set(a.kind,a)}let o=new $e([...n.values()].sort((s,a)=>s.kind.localeCompare(a.kind))),i=new V(new Set(r.flatMap(s=>[...s.snapshot.nodes])),r.flatMap(s=>[...s.snapshot.edges]),o);return Q(i,o,t)}var ae=class{name;#e=new Map;constructor(t="memory"){this.name=U(t,"adapter name")}async read(t){Z(t.signal);let r=this.#e.get(U(t.workspace,"workspace"));return r?structuredClone(r):null}async replace(t){Z(t.signal);let r=U(t.workspace,"workspace"),n=this.#e.get(r);if(t.expected_fingerprint!==void 0&&(n?.fingerprint??null)!==t.expected_fingerprint)throw new Error(`Relationship graph adapter conflict for ${r}`);this.#e.set(r,structuredClone(ce(t.snapshot).snapshot))}async clear(t){Z(t.signal);let r=U(t.workspace,"workspace"),n=this.#e.get(r);if(t.expected_fingerprint!==void 0&&(n?.fingerprint??null)!==t.expected_fingerprint)throw new Error(`Relationship graph adapter conflict for ${r}`);this.#e.delete(r)}};(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="423d6e5d-93e5-5f29-93e0-11ddca9c3156")}catch{}})();function cn(e,t){if(!Number.isInteger(e)||e<1)throw new TypeError(`Relationship graph ${t} must be a positive integer`);return e}function vy(e){let t=cn(e.nodeCount,"nodeCount"),r=cn(e.edgeStride??1,"edgeStride"),n=e.topology??"chain";if(!["chain","star","disconnected"].includes(n))throw new TypeError(`Unsupported relationship graph topology: ${n}`);let o=(e.kind??"related").trim(),i=(e.idPrefix??"node").trim();if(!o||!i)throw new TypeError("Relationship graph kind and idPrefix must be non-empty");let s=n==="disconnected"?0:Math.floor((t-1)/r);return{node_count:t,edge_count:s,edge_basis:"fixture_generated",nodes:{*[Symbol.iterator](){for(let a=0;a<t;a+=1)yield`${i}-${a}`}},edges:{*[Symbol.iterator](){if(n!=="disconnected")for(let a=r;a<t;a+=r)yield{source:`${i}-${n==="star"?0:a-r}`,target:`${i}-${a}`,kind:o}}}}}function B(e,t){if(!e)throw new Error(`Relationship graph adapter conformance: ${t}`)}async function dn(e,t={}){let r=t.workspace?.trim()||"pm-graph-conformance",n=Ot(),o=Q(new V(["a","b"],[{source:"a",target:"b",kind:"related"}],n),n,{createdAt:"2026-01-01T00:00:00.000Z"}),i=Q(new V(["a","b","c"],[{source:"a",target:"b",kind:"related"},{source:"b",target:"c",kind:"blocked_by"}],n),n,{createdAt:"2026-01-02T00:00:00.000Z"}),s=[];B(await N(e,{workspace:r})===null,"workspace must start empty"),s.push({name:"empty-read",passed:!0});let a=await Ie(e,{workspace:r,snapshot:o});B(a.disposition==="written","first sync must write"),s.push({name:"atomic-replace",passed:!0}),(await e.read({workspace:r})).nodes.push("mutated-reader-copy"),B((await N(e,{workspace:r}))?.snapshot.nodes.length===2,"reads must not mutate stored state"),s.push({name:"read-isolation",passed:!0}),B((await Ie(e,{workspace:r,snapshot:o})).disposition==="current","identical sync must be idempotent"),s.push({name:"idempotent-sync",passed:!0}),await e.replace({workspace:r,snapshot:i,expected_fingerprint:o.fingerprint}),B((await N(e,{workspace:r}))?.snapshot.fingerprint===i.fingerprint,"replacement must become visible"),s.push({name:"replacement-visibility",passed:!0});let d=!1;try{await e.replace({workspace:r,snapshot:o,expected_fingerprint:o.fingerprint})}catch{d=!0}return B(d,"stale compare-and-swap must fail"),s.push({name:"stale-cas",passed:!0}),e.clear&&(await e.clear({workspace:r,expected_fingerprint:i.fingerprint}),B(await N(e,{workspace:r})===null,"clear must remove the workspace"),s.push({name:"clear",passed:!0})),{adapter:e.name,workspace:r,cases:Object.freeze(s),clear_supported:e.clear!==void 0}}function Py(e){return dn(new ae,e?{workspace: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]="20842b89-cef6-542e-b069-76c22b340f1d")}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]="5133d678-01f4-5164-aea7-2cc5ed42dd58")}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]="006109f8-cb09-5a91-8929-7ac7521753b6")}catch{}})();var _t=2,ky=["self_reported","independent_transport"];function ve(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function de(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`${t} must be a non-empty string`);return e.trim()}function ln(e,t,r=!1){if(!Array.isArray(e)||e.length===0)throw new TypeError(`${t} must be a non-empty string array`);return e.map((n,o)=>{let i=de(n,`${t}[${String(o)}]`);return r?n:i})}function ht(e,t){return e===void 0?void 0:de(e,t)}function My(e,t){if(e===void 0)return;if(!ve(e)||Object.keys(e).length===0)throw new TypeError(`${t} must be a non-empty object`);let r=Object.entries(e).map(([n,o])=>{if(n.length===0||n.split(".").some(i=>i.length===0))throw new TypeError(`${t} must use dot-separated own-property paths`);if(o!==null&&typeof o!="string"&&typeof o!="boolean"&&(typeof o!="number"||!Number.isFinite(o)))throw new TypeError(`${t} values must be JSON primitives`);return[n,o]});return Object.fromEntries(r)}function Ny(e,t,r,n,o,i){if(n==="refusal"){if(Ve(r)||o===void 0||i===void 0)throw new TypeError(`${e} refusal steps require a non-success exit, error code, and refusal surface`);return}if(o!==void 0||i!==void 0)throw new TypeError(`${e} only refusal steps may declare expected_error_code or expected_refusal_surface`);let s=ir(t);if(s===void 0)throw new TypeError(`${e}.args must identify a command after global flags`);let a=Bt(s);if(!Ve(r)||r!==0&&!a?.exit_codes.some(d=>d===r))throw new TypeError(`${e} successful output must use exit code 0 or a command-declared successful effect exit`);let c=nr(s).kind;if(n!==c)throw new TypeError(`${e} expected ${n}, but ${s} declares ${c}`)}function Ly(e,t,r){if(!ve(e))throw new TypeError(`tasks.${t}.steps[${String(r)}] must be an object`);let n=`tasks.${t}.steps[${String(r)}]`,o=de(e.id,`${n}.id`),i=ln(e.args,`${n}.args`,!0),s=e.expected_exit_code;if(typeof s!="number"||!Number.isSafeInteger(s))throw new TypeError(`${n}.expected_exit_code must be a safe integer`);let a=e.expected_output_kind;if(a!=="refusal"&&!rr.includes(a))throw new TypeError(`${n}.expected_output_kind is unsupported`);let c=a,d=e.expected_accounting_mode;if(!ky.includes(d))throw new TypeError(`${n}.expected_accounting_mode is unsupported`);let l=d;if(l==="independent_transport"&&c!=="refusal")throw new TypeError(`${n} independent_transport accounting is supported only for refusal steps`);let u=ln(e.required_fields,`${n}.required_fields`);if(u.some(w=>w.split(".").some(z=>z.length===0)))throw new TypeError(`${n}.required_fields must contain dot-separated own-property paths`);let m=My(e.expected_field_values,`${n}.expected_field_values`),g=ht(e.expected_error_code,`${n}.expected_error_code`),h=ht(e.expected_refusal_surface,`${n}.expected_refusal_surface`),C=ht(e.recovery_for,`${n}.recovery_for`);return Ny(n,i,s,c,g,h),{id:o,args:i,expected_exit_code:s,expected_output_kind:c,expected_accounting_mode:l,required_fields:u,...m?{expected_field_values:m}:{},...g?{expected_error_code:g}:{},...h?{expected_refusal_surface:h}:{},...C?{recovery_for:C}:{}}}function Dy(e,t){if(!ve(e))throw new TypeError(`tasks[${String(t)}] must be an object`);let r=de(e.id,`tasks[${String(t)}].id`),n=de(e.description,`tasks.${r}.description`);if(!Array.isArray(e.steps)||e.steps.length===0)throw new TypeError(`tasks.${r}.steps must be a non-empty array`);let o=e.steps.map((s,a)=>Ly(s,r,a)),i=new Map;for(let s of o){if(i.has(s.id))throw new TypeError(`tasks.${r} contains duplicate step id ${s.id}`);if(s.recovery_for!==void 0&&(i.get(s.recovery_for)?.expected_output_kind!=="refusal"||s.expected_output_kind==="refusal"))throw new TypeError(`tasks.${r}.${s.id} recovery_for must reference an earlier refusal and declare successful output`);i.set(s.id,s)}if(o.at(-1)?.expected_output_kind==="refusal")throw new TypeError(`tasks.${r} completed task must terminate with successful output`);for(let s of o)if(s.expected_output_kind==="refusal"&&!o.some(a=>a.recovery_for===s.id))throw new TypeError(`tasks.${r}.${s.id} refusal must have a later successful recovery_for step`);return{id:r,description:n,steps:o}}function oN(e){if(!ve(e))throw new TypeError("agent-task transcript corpus must be an object");if(e.version!==_t)throw new TypeError(`agent-task transcript corpus version must be ${String(_t)}`);if(!Array.isArray(e.tasks)||e.tasks.length===0)throw new TypeError("agent-task transcript corpus tasks must be non-empty");let t=e.tasks.map((n,o)=>Dy(n,o)),r=new Set;for(let n of t){if(r.has(n.id))throw new TypeError(`duplicate agent-task transcript id ${n.id}`);r.add(n.id)}return{version:_t,tasks:t}}import{createHash as un}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]="54a3448c-719c-5404-a9b9-c3072a2fdce2")}catch{}})();function pn(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship backfill ${t} must be non-empty`);return e.trim()}function cN(e,t){let r=pn(t.migrationId,"migrationId"),n=pn(t.author,"author"),o=Date.parse(t.timestamp);if(!Number.isFinite(o))throw new TypeError("Relationship backfill timestamp must be valid");let i=new Date(o).toISOString(),s=ze(e,void 0,t.registry),a=s.graph.nodes(),c=s.graph.edges().map(m=>{let g=un("sha256").update(JSON.stringify([r,m.kind,m.source,m.target,m.createdAt??null,m.author??null,m.payload??null])).digest("hex").slice(0,24);return Object.freeze({eventId:`backfill:${r}:${g}`,relationshipId:`migration:${r}:${g}`,action:"add",edge:m,author:n,timestamp:i,reason:`Backfill ${r} from legacy item metadata`})}),d=un("sha256").update(JSON.stringify({migrationId:r,nodes:a,events:c})).digest("hex"),l=new Set([...t.existingEventIds??[]].filter(m=>typeof m=="string").map(m=>m.trim()).filter(Boolean)),u=c.filter(m=>!l.has(m.eventId));return Object.freeze({migration_id:r,fingerprint:d,nodes:a,events:Object.freeze(u),edge_count:c.length,skipped_existing_count:c.length-u.length,duplicate_dependency_rows:s.duplicateRows.length,dangling_reference_count:s.dangling.active.length+s.dangling.legacy_terminal.length})}import*as fn from"node:module";(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]="4f4e7daa-14aa-5dad-8a30-79a4d76159d4")}catch{}})();var le=["suggested_retry","candidate_command","example","next_step","migration_hint","restore_with"],gt={suggested_retry:{kind:"suggested_retry",semantics:"recovery"},retry_command:{kind:"suggested_retry",semantics:"recovery"},candidate_command:{kind:"candidate_command",semantics:"recovery"},candidate_commands:{kind:"candidate_command",semantics:"recovery"},fallback_candidates:{kind:"candidate_command",semantics:"recovery",nested_value_field:"command"},next_best_command:{kind:"candidate_command",semantics:"recovery"},example:{kind:"example",semantics:"recovery"},examples:{kind:"example",semantics:"recovery"},next_step:{kind:"next_step",semantics:"recovery"},next_steps:{kind:"next_step",semantics:"recovery"},suggested_next_steps:{kind:"next_step",semantics:"recovery"},migration_hint:{kind:"migration_hint",semantics:"replacement"},migration_hints:{kind:"migration_hint",semantics:"replacement"},restore_with:{kind:"restore_with",semantics:"behavior_preserving"}},lN=Object.freeze(Object.keys(gt));function mn(e){if(Object.hasOwn(gt,e))return gt[e]}var $y=new Set([..."=([{,:;!?&|+-*%^~<>","=>"]);function ee(e,t){return e<t?-1:e>t?1:0}function Fy(e,t){let r=e[t],n=t+1,o="";for(;n<e.length&&e[n]!==r;)e[n]==="\\"?n+=2:(o+=e[n],n+=1);return e[n]===r&&(n+=1),{next:n,value:o}}function jy(e){return e===void 0||e.kind==="punctuator"&&$y.has(e.value)||e.kind==="identifier"&&["return","case","throw","else","yield"].includes(e.value)}function Gy(e,t){if(/\s/u.test(e[t]))return t+1;if(e.startsWith("//",t)){let r=e.indexOf(`
|
|
29
|
+
`,t+2);return r===-1?e.length:r+1}if(e.startsWith("/*",t))return e.indexOf("*/",t+2)+2}function Uy(e,t,r){if(e[t]!=="/"||!jy(r))return;let n=t+1,o=!1;for(;n<e.length;)if(e[n]==="\\")n+=2;else if(e[n]==="[")o=!0,n+=1;else if(e[n]==="]")o=!1,n+=1;else if(e[n]==="/"&&!o){for(n+=1;/[A-Za-z]/u.test(e.charAt(n));)n+=1;return n}else n+=1;return n}function By(e,t){let r=e[t];if(r==="'"||r==='"'||r==="`"){let o=Fy(e,t);return r==="`"?{next:o.next}:{next:o.next,token:{kind:"string",value:o.value,offset:t+1}}}if(/[A-Za-z_$]/u.test(r)){let o=t+1;for(;/[A-Za-z0-9_$]/u.test(e[o]??"");)o+=1;return{next:o,token:{kind:"identifier",value:e.slice(t,o),offset:t}}}let n=e.startsWith("=>",t)?"=>":r;return{next:t+n.length,token:{kind:"punctuator",value:n,offset:t}}}function qy(e){let t=[],r=0;for(;r<e.length;){let n=Gy(e,r);if(n!==void 0){r=n;continue}let o=Uy(e,r,t.at(-1));if(o!==void 0){r=o;continue}let i=By(e,r);i.token&&t.push(i.token),r=i.next}return t}var zy=new Set(["object","block","pattern"]),Vy=new Set(["const","let","var"]),Hy=new Set(["}",")","]"]),Ky=new Set(["=","(","[",",",":","?","return"]);function Wy(e,t,r){if([...r].reverse().find(i=>zy.has(i.kind))?.kind==="pattern"||r.at(-1)?.kind==="paren"&&r.at(-1)?.parameter_list)return"pattern";let o=e[t-1];return o?.kind==="identifier"&&Vy.has(o.value)?"pattern":o?.value==="=>"||o?.value===")"?"block":o&&Ky.has(o.value)?"object":"block"}function Xy(e,t,r){let n=e[t];if(n.value==="{"){let a=Wy(e,t,r);return{kind:a,...a==="object"?{member_start:!0,candidates:[]}:{}}}if(n.value==="[")return{kind:"array"};if(n.value!=="(")return;let o=e[t-1],i=e[t-2];return{kind:"paren",...o?.value==="function"||i?.value==="function"?{parameter_list:!0}:{}}}function Yy(e,t,r){if(!(e?.kind!=="object"||!e.member_start||t.kind!=="identifier"&&t.kind!=="string"||r?.value!==":"||!/^[A-Za-z][A-Za-z0-9_]*$/u.test(t.value)))return{field:t.value,offset:t.offset}}function Jy(e,t){return e[t+1]?.value===")"&&e[t+2]?.value==="=>"||e[t+1]?.value==="="}function Zy(e){let t=qy(fn.stripTypeScriptTypes(e,{mode:"strip"})),r=[],n=[];for(let[o,i]of t.entries()){let s=n.at(-1),a=Yy(s,i,t[o+1]);a&&s.candidates.push(a);let c=Xy(t,o,n);if(c)n.push(c);else if(Hy.has(i.value)){let d=n.pop();d?.kind==="object"&&!Jy(t,o)&&r.push(...d.candidates)}else i.value===","&&s?.kind==="object"?s.member_start=!0:s?.kind==="object"&&i.value!==":"&&(s.member_start=!1)}return r}function Qy(e){let t=[0];for(let r=0;r<e.length;r+=1)e[r]===`
|
|
30
|
+
`&&t.push(r+1);return t}function eb(e,t){let r=0,n=e.length;for(;r<n;){let o=Math.floor((r+n)/2);e[o]<=t?r=o+1:n=o}return r}function uN(e){let t=[],r=[];for(let o of[...e].sort((i,s)=>ee(i.path,s.path))){let i=Qy(o.content),s;try{s=Zy(o.content)}catch(a){r.push({kind:"invalid_source",subject:o.path,detail:`${o.path} could not be parsed for recovery producers: ${String(a)}.`});continue}for(let a of s){let c=a.field,d=eb(i,a.offset),l=mn(c);l?t.push({path:o.path,line:d,field:c,kind:l.kind}):/(?:retry_command|candidate_command|fallback_candidate|next_best_command|example|next_step|migration_hint|restore_with)/u.test(c)&&!/(?:_total|_truncated)$/u.test(c)&&r.push({kind:"unknown_recovery_field",subject:`${o.path}:${d}:${c}`,detail:`${c} resembles a recovery reference but has no typed field contract.`})}}let n=Object.fromEntries(le.map(o=>[o,t.filter(i=>i.kind===o).length]));for(let o of le)n[o]===0&&r.push({kind:"missing_kind_producer",subject:o,detail:`No source producer emits the ${o} recovery-reference kind.`});return t.sort((o,i)=>o.path!==i.path?ee(o.path,i.path):o.line!==i.line?o.line-i.line:ee(o.field,i.field)),r.sort((o,i)=>o.subject!==i.subject?ee(o.subject,i.subject):ee(o.kind,i.kind)),{ok:r.length===0,scanned_file_count:e.length,producer_count:t.length,producer_count_by_kind:n,producers:t,findings:r}}function pN(e,t){let r=[],n=(o,i)=>{if(Array.isArray(o)){o.forEach((s,a)=>n(s,[...i,String(a)]));return}if(!(typeof o!="object"||o===null))for(let[s,a]of Object.entries(o).sort(([c],[d])=>ee(c,d))){let c=mn(s),d=c?.kind==="migration_hint"&&o.semantics==="behavior_preserving"?{...c,semantics:"behavior_preserving"}:c,l=[a].flat();d!==void 0&&l.forEach((u,m)=>{let g="nested_value_field"in d&&typeof d.nested_value_field=="string"?d.nested_value_field:void 0,h=g&&typeof u=="object"&&u!==null&&!Array.isArray(u)?u[g]:u;if(typeof h!="string"||h.trim().length===0)return;let C=[...i,s,String(m)].map(w=>encodeURIComponent(w)).join("/");r.push({id:`${e}:${d.kind}:${C}`,probe_id:e,kind:d.kind,semantics:d.semantics,value:h})}),n(a,[...i,s])}};return n(t,[]),r}function fN(e,t){let r=e.flatMap(s=>(s.owned_states??[]).map(a=>({contract:s,state:a}))),n=[],o=new Map;for(let s of t){if(o.has(s.probe_id)){n.push({kind:"duplicate_probe",probe_id:s.probe_id,detail:`Observation ${s.probe_id} was supplied more than once.`});continue}o.set(s.probe_id,s)}let i=new Set(r.map(({state:s})=>s.probe_id));for(let{contract:s,state:a}of r){let c=o.get(a.probe_id);if(!c){n.push({kind:"missing_probe",probe_id:a.probe_id,detail:`No entrypoint observation was recorded for ${s.code}.`});continue}c.code!==s.code&&n.push({kind:"wrong_error_code",probe_id:a.probe_id,detail:`Expected ${s.code}; observed ${c.code}.`}),c.exit_class!==a.expected_exit_class&&n.push({kind:"wrong_exit_class",probe_id:a.probe_id,detail:`Expected ${a.expected_exit_class}; observed ${c.exit_class}.`}),a.entrypoints.includes(c.entrypoint)||n.push({kind:"wrong_entrypoint",probe_id:a.probe_id,detail:`Expected one of ${a.entrypoints.join(", ")}; observed ${c.entrypoint}.`})}for(let s of t)i.has(s.probe_id)||n.push({kind:"undeclared_probe",probe_id:s.probe_id,detail:`Observation ${s.probe_id} has no catalog declaration.`});return n.sort((s,a)=>s.probe_id!==a.probe_id?s.probe_id.localeCompare(a.probe_id):s.kind.localeCompare(a.kind)),{ok:n.length===0,declared_probe_count:r.length,observed_probe_count:t.length,findings:n}}function mN(e,t){let r=[],n=new Set,o=new Set;for(let c of e){if(n.has(c.id)){o.add(c.id),r.push({kind:"duplicate_obligation",reference_id:c.id,detail:`Recovery obligation ${c.id} was declared more than once.`});continue}n.add(c.id)}let i=new Map;for(let c of t){if(i.has(c.id)){r.push({kind:"duplicate_observation",reference_id:c.id,detail:`Recovery reference ${c.id} was observed more than once.`});continue}i.set(c.id,c),n.has(c.id)||r.push({kind:"undeclared_observation",reference_id:c.id,detail:`Recovery observation ${c.id} has no emitted obligation.`})}for(let c of e){if(o.has(c.id))continue;let d=i.get(c.id);d?d.reachable?d.semantics!==c.semantics&&r.push({kind:"wrong_semantics",reference_id:c.id,detail:`Recovery reference ${c.value} promised ${c.semantics}; proof demonstrated ${d.semantics}.`}):r.push({kind:"unreachable_reference",reference_id:c.id,detail:`Recovery reference ${c.value} did not reach its promised target.`}):r.push({kind:"missing_observation",reference_id:c.id,detail:`No reachability proof was recorded for ${c.kind} ${c.value}.`})}let s=le.map(c=>{let d=e.filter(u=>u.kind===c),l=d.filter(u=>!o.has(u.id)).map(u=>i.get(u.id)).filter(u=>u!==void 0);return{kind:c,declared:d.length,observed:l.length,passed:d.filter(u=>{let m=i.get(u.id);return!o.has(u.id)&&m?.reachable===!0&&m.semantics===u.semantics}).length}});r.sort((c,d)=>c.reference_id!==d.reference_id?c.reference_id.localeCompare(d.reference_id):c.kind.localeCompare(d.kind));let a=s.reduce((c,d)=>c+d.passed,0);return{ok:r.length===0,declared_reference_count:e.length,observed_reference_count:t.length,pass_fraction:n.size===0?1:a/n.size,coverage_by_kind:s,findings:r}}function tb(e,t){let r=new Map(le.map(i=>[i,new Set]));for(let i of t)r.get(i.kind).add(i.value);let n=le.map(i=>({kind:i,source_producers:e.producer_count_by_kind[i],runtime_values:r.get(i).size})),o=n.filter(({source_producers:i,runtime_values:s})=>i>0&&s===0).map(({kind:i})=>i);return{ok:e.ok&&o.length===0,source_producer_count:e.producer_count,runtime_value_count:n.reduce((i,{runtime_values:s})=>i+s,0),coverage_by_kind:n,missing_runtime_kinds:o}}var _N=tb;(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]="a1efaf49-c6ca-53dd-8fad-eb2540c20cc8")}catch{}})();var gN=16,rb=Object.freeze(["bulk_ids_input_empty","bulk_ids_input_missing_path","bulk_ids_input_unreadable","invalid_argument_value","missing_lifecycle_target","missing_required_argument","projection_options_mutually_exclusive","tracker_not_initialized","tracker_root_missing","tracker_root_not_directory","tracker_root_unreadable","unknown_context_intent","unknown_field_projection","unknown_option","unknown_subcommand"]),_n=18,hn=Object.freeze([...rb,"manifest_unknown_key","no_version_bounds_declared"].sort((e,t)=>e.localeCompare(t)));function yN(e,t=_n){return{ok:e.executable_error_code_count>=t,baseline:t,actual:e.executable_error_code_count}}function bN(e,t=hn){let r=new Set(e.rows.filter(({disposition:o})=>o==="executable").map(({canonical_code:o})=>o)),n=t.filter(o=>!r.has(o));return{ok:n.length===0,required_canonical_codes:[...t],missing_required_canonical_codes:n}}function yt(e,t){let r=e.get(t);if(r)return r;let n={kinds:new Set,probeIds:new Set};return e.set(t,n),n}function CN(e,t,r){let n=new Map(e.map(l=>[l.code,l.canonical_code??l.code])),o=new Map,i=0,s=0;for(let l of e){let u=yt(o,l.canonical_code??l.code);for(let m of l.owned_states??[])u.kinds.add("owned_state"),u.probeIds.add(m.probe_id)}for(let l of t){let u=n.get(l.error_code);if(u===void 0)continue;i+=1;let m=yt(o,u);m.kinds.add("closed_domain"),m.probeIds.add(l.probe_id)}for(let l of r){let u=n.get(l.error_code);if(u===void 0)continue;s+=1;let m=yt(o,u);m.kinds.add("grammar"),m.probeIds.add(l.probe_id)}let a=e.map(l=>{let u=l.canonical_code??l.code,m=o.get(u),g=[...m.probeIds].sort();return{code:l.code,canonical_code:u,disposition:g.length>0?"executable":"uncovered",evidence_kinds:[...m.kinds].sort(),probe_ids:g}}).sort((l,u)=>l.code<u.code?-1:1),c=a.filter(({disposition:l})=>l==="uncovered").map(({code:l})=>l),d=a.length-c.length;return{ok:c.length===0,catalog_error_code_count:a.length,executable_error_code_count:d,uncovered_error_code_count:c.length,coverage_fraction:a.length===0?1:d/a.length,closed_domain_probe_count:i,grammar_probe_count:s,uncovered_error_codes:c,rows:a}}function TN(e){let t=e.rows.map(r=>`| \`${r.code}\` | \`${r.canonical_code}\` | ${r.disposition} | ${r.evidence_kinds.join(", ")||"none"} | ${r.probe_ids.length} |`);return["# Generated refusal closure census","","Tracker: `pm-f05lsg`.","","Every catalog code is listed. An `uncovered` row is an explicit closure obligation, never an omission or implied approval.","",`- Catalog error codes: ${e.catalog_error_code_count}`,`- Executable error codes: ${e.executable_error_code_count}`,`- Executable-code ratchet floor: ${_n}`,`- Required executable canonical codes: ${hn.map(r=>`\`${r}\``).join(", ")}`,`- Uncovered error codes: ${e.uncovered_error_code_count}`,`- Coverage fraction: ${e.coverage_fraction.toFixed(6)}`,`- Closed-domain probes: ${e.closed_domain_probe_count}`,`- Grammar probes: ${e.grammar_probe_count}`,"","| Error code | Canonical code | Disposition | Evidence kinds | Probe count |","| --- | --- | --- | --- | --- |",...t,""].join(`
|
|
31
|
+
`)}(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]="0ec8c375-e58e-5ce4-b0aa-8a8a4dfa0778")}catch{}})();function nb(e){return[e.expected_error_code!==void 0&&e.error_code!==e.expected_error_code?{code:"error_code_mismatch",probe_id:e.probe_id,detail:`Expected error code ${e.expected_error_code}, received ${e.error_code??"<missing>"}.`}:void 0,e.expected_allowed_values!==void 0&&JSON.stringify([...e.allowed_values].sort())!==JSON.stringify([...e.expected_allowed_values].sort())?{code:"incomplete_allowed_values",probe_id:e.probe_id,detail:"The refusal's accepted domain differs from the SDK-owned domain contract."}:void 0,e.expected_suggested_retry_args!==void 0&&(e.suggested_retry_args?.length??0)===0?{code:"missing_suggested_retry_args",probe_id:e.probe_id,detail:"The refusal omitted shell-free suggested retry arguments."}:void 0,e.expected_suggested_retry_args!==void 0&&(e.suggested_retry_args?.length??0)>0&&JSON.stringify(e.suggested_retry_args)!==JSON.stringify(e.expected_suggested_retry_args)?{code:"suggested_retry_args_mismatch",probe_id:e.probe_id,detail:"The refusal's suggested retry arguments differ from the SDK-owned contract."}:void 0]}function ob(e){return[e.exit_code!==L.USAGE?{code:"non_refusal_exit",probe_id:e.probe_id,detail:`${e.entrypoint} returned exit code ${e.exit_code}; a structured usage refusal must return ${L.USAGE}.`}:void 0,e.allowed_values_required!==!1&&e.allowed_values.length===0?{code:"missing_allowed_values",probe_id:e.probe_id,detail:"The refusal omitted its complete accepted value domain."}:void 0,e.allowed_values.includes(e.rejected_value)?{code:"accepted_rejected_value",probe_id:e.probe_id,detail:`${e.rejected_value} is both rejected and advertised as allowed.`}:void 0,e.suggested_retry.trim().length===0?{code:"missing_suggested_retry",probe_id:e.probe_id,detail:"The refusal omitted an executable suggested retry."}:void 0,e.retry_succeeded?void 0:{code:"retry_failed",probe_id:e.probe_id,detail:"The advertised suggested retry did not succeed."},...nb(e)]}function EN(e){let t=[],r=new Set,n=0;e.length===0&&t.push({code:"empty_corpus",probe_id:"corpus",detail:"At least one real refusal observation is required."});for(let o of e){if(r.has(o.probe_id)){t.push({code:"duplicate_probe",probe_id:o.probe_id,detail:`${o.probe_id} was supplied more than once.`});continue}r.add(o.probe_id);let i=t.length;for(let s of ob(o))s!==void 0&&t.push(s);t.length===i&&(n+=1)}return t.sort((o,i)=>o.probe_id!==i.probe_id?o.probe_id.localeCompare(i.probe_id):o.code.localeCompare(i.code)),{ok:t.length===0,probe_count:r.size,closed_probe_count:n,closure_fraction:r.size===0?0:n/r.size,findings:t}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="2e90ea29-2708-5af8-b390-599be97718e7")}catch{}})();var gn="not-a-declared-action";function ib(e,t){if(e.startsWith("assurance ")&&t.name==="kind")return"measurement";switch(t.value_kind){case"integer":return"1";case"item_id":return"pm-domain";case"action":throw new Error(`Cannot synthesize a preceding action value for positional slot ${t.name}.`);default:return"example"}}function bt(e){return e.replaceAll(/[^a-z0-9]+/gu,"-").replaceAll(/^-|-$/gu,"")}function kN(e=Be.filter(t=>Mt.some(r=>r.command===t.command&&r.disposition!=="package_owned"))){return e.flatMap(t=>t.slots.flatMap((r,n)=>{if(!r.required)return[];let o=t.command.split(" "),i=te(t.command).flatMap(a=>a.required?[a.flag,...a.value_name?["example"]:[]]:[]),s=Ue.some(a=>a.command===t.command);return[{probe_id:`required-argument-${bt(t.command)}-${bt(r.name)}`,command:t.command,refusal_args:[...o,...t.slots.slice(0,n).map(a=>ib(t.command,a)),...i],recovery_args:[...o,"--help"],error_code:s&&!t.command.startsWith("assurance ")?"invalid_argument_value":/^extension (?:activate|adopt|deactivate|uninstall)$/u.test(t.command)?"missing_lifecycle_target":"missing_required_argument",missing_argument:r.name,missing_argument_index:n}]})).sort((t,r)=>t.probe_id.localeCompare(r.probe_id))}function sb(e){switch(e){case"assurance":case"workspace snapshot":return Ue.filter(({parent:t})=>t===e).map(({action:t})=>t);case"graph":return je;case"merge":return Ge;case"plan":return He;case"profile":return Ke;case"schema":return Lt;default:throw new Error(`Required positional action family ${e} has no authoritative value domain.`)}}function MN(e=Be){return e.filter(({slots:t})=>t[0]?.required===!0&&t[0].value_kind==="action").map(({command:t})=>{let r=t.split(" ");return{probe_id:`unknown-subcommand-${bt(t)}`,command:t,refusal_args:[...r,gn],recovery_args:[...r,"--help"],error_code:"unknown_subcommand",rejected_value:gn,allowed_values:[...sb(t)].sort()}}).sort((t,r)=>t.probe_id.localeCompare(r.probe_id))}function ab(e,t){let r=[...t].sort();return e.length===t.length&&[...e].sort().every((n,o)=>n===r[o])}function cb(e,t){if(!t)return[{code:"refusal_probe_missing",probe_id:e.probe_id,detail:`${e.probe_id} has no runtime observation.`}];let r=[];return t.error_code!==e.error_code&&r.push({code:"refusal_error_code_mismatch",probe_id:e.probe_id,detail:`${e.probe_id} emitted ${t.error_code||"<none>"}; expected ${e.error_code}.`}),t.exit_code!==2&&r.push({code:"refusal_exit_code_mismatch",probe_id:e.probe_id,detail:`${e.probe_id} exited ${t.exit_code}; expected usage exit 2.`}),"allowed_values"in e&&!ab(t.allowed_values,e.allowed_values)&&r.push({code:"refusal_allowed_values_mismatch",probe_id:e.probe_id,detail:`${e.probe_id} did not expose its complete action domain.`}),t.recovery_succeeded||r.push({code:"refusal_recovery_failed",probe_id:e.probe_id,detail:`${e.probe_id} help recovery did not succeed.`}),t.refusal_mutated_state&&r.push({code:"refusal_mutated_state",probe_id:e.probe_id,detail:`${e.probe_id} changed tracker state while refusing input${t.mutated_paths?.length?`: ${t.mutated_paths.join(", ")}`:"."}`}),r}function NN(e,t){let r=new Map(e.map(s=>[s.probe_id,s])),n=new Map(t.map(s=>[s.probe_id,s])),o=[...e.flatMap(s=>cb(s,n.get(s.probe_id))),...t.filter(s=>!r.has(s.probe_id)).map(s=>({code:"unexpected_refusal_probe",probe_id:s.probe_id,detail:`${s.probe_id} has no declared grammar refusal contract.`}))];o.sort((s,a)=>s.probe_id.localeCompare(a.probe_id)||s.code.localeCompare(a.code));let i=new Set(o.map(({probe_id:s})=>s));return{ok:o.length===0,probe_count:e.length,closed_probe_count:e.filter(({probe_id:s})=>!i.has(s)).length,findings: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]="941a11a9-f756-56b3-9dc1-8afd78bc9328")}catch{}})();var Ct=[{probe_id:"tracker-root-missing",failure_kind:"missing_root",expected_error_code:"tracker_root_missing",expected_exit_code:3,recovery_kind:"initialize"},{probe_id:"tracker-root-settings-missing",failure_kind:"settings_missing",expected_error_code:"tracker_not_initialized",expected_exit_code:3,recovery_kind:"initialize"},{probe_id:"tracker-root-not-directory",failure_kind:"not_directory",expected_error_code:"tracker_root_not_directory",expected_exit_code:2,recovery_kind:"select_directory"},{probe_id:"tracker-root-unreadable",failure_kind:"unreadable_root",expected_error_code:"tracker_root_unreadable",expected_exit_code:1,recovery_kind:"repair_permissions"}];function DN(){return Ct.map(e=>({...e}))}function db(e,t){let r=[];t.error_code!==e.expected_error_code&&r.push({code:"error_code_mismatch",probe_id:e.probe_id,detail:`Expected ${e.expected_error_code}, received ${t.error_code}.`}),t.exit_code!==e.expected_exit_code&&r.push({code:"exit_code_mismatch",probe_id:e.probe_id,detail:`Expected exit ${e.expected_exit_code}, received ${t.exit_code}.`}),t.recovery_kind!==e.recovery_kind&&r.push({code:"recovery_kind_mismatch",probe_id:e.probe_id,detail:`Expected ${e.recovery_kind}, received ${t.recovery_kind}.`});let n=t.suggested_retry_args.indexOf("init"),o=n===0||n===2&&t.suggested_retry_args[0]==="--pm-path"&&t.suggested_retry_args[1]?.length>0;return e.recovery_kind==="initialize"&&!o&&r.push({code:"missing_init_recovery",probe_id:e.probe_id,detail:"Missing and uninitialized roots must emit a tokenized init retry."}),(t.unsafe_init_recommended||e.recovery_kind!=="initialize"&&t.suggested_retry_args.includes("init"))&&r.push({code:"unsafe_init_recovery",probe_id:e.probe_id,detail:"A tracker root that cannot be initialized safely must not recommend initialization."}),t.retry_succeeded||r.push({code:"retry_failed",probe_id:e.probe_id,detail:"The emitted retry or safe alternate-root recovery did not execute successfully."}),r}function $N(e){let t=new Map(e.map(o=>[o.probe_id,o])),r=[],n=0;for(let o of Ct){let i=t.get(o.probe_id);if(i===void 0){r.push({code:"missing_probe",probe_id:o.probe_id,detail:"No runtime observation was supplied for this contract."});continue}let s=db(o,i);r.push(...s),s.length===0&&(n+=1)}return r.sort((o,i)=>o.probe_id.localeCompare(i.probe_id)||o.code.localeCompare(i.code)),{ok:r.length===0,probe_count:Ct.length,closed_probe_count:n,findings:r}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="3466866d-8869-5ab6-b981-d084e7330aa5")}catch{}})();var Pe,lb=Object.freeze({list:"list-item-projection","list-all":"list-item-projection","list-draft":"list-item-projection","list-open":"list-item-projection","list-in-progress":"list-item-projection","list-blocked":"list-item-projection","list-closed":"list-item-projection","list-canceled":"list-item-projection",get:"get-item-projection",graph:"graph-detail-projection",search:"search-result-projection",history:"history-entry-projection",events:"mutation-event-projection",activity:"activity-entry-projection",deps:"dependency-graph-projection",health:"health-diagnostic-projection",validate:"validation-diagnostic-projection",contracts:"contract-catalog-projection"});function ub(e,t){if(t==="--limit")return"result-row-limit";if(t==="--node-limit")return"graph-node-limit";if(t==="--edge-limit")return"graph-edge-limit";if(t==="--output-limit")return"rendered-output-row-limit";if(t==="--output-budget")return"rendered-output-byte-budget";if(t==="--token-budget")return"context-intent-token-budget";if(t==="--full"){let r=lb[e];if(r===void 0)throw new Error(`Command ${e} exposes --full without a registered projection concept.`);return r}return t!=="--file"?t.slice(2):["create","update","update-many"].includes(e)?"linked-file-path":["comments","notes","learnings"].includes(e)?"entry-file-input":"plan-definition-file"}function ke(){if(Pe!==void 0)return Pe;let t=re.filter(({command:i})=>qe(i)).flatMap(({command:i,family:s})=>tr(i,te(i)).map(a=>({command:i,family:s,concept:ub(i,a.flag),flag:a.flag,aliases:Object.freeze([...a.aliases??[]]),value_kind:a.repeatable?"list":a.flag==="--limit"?"number":a.value_type}))),r=new Set(t.flatMap(i=>i.aliases.map(s=>`${i.command}:${s}`))),n=t.filter(i=>!r.has(`${i.command}:${i.flag}`)),o=new Map;for(let i of n){let s=o.get(i.concept)??new Set;s.add(i.value_kind),o.set(i.concept,s)}return Pe=Object.freeze(n.map(i=>Object.freeze({...i,concept:o.get(i.concept)?.size===1?i.concept:`${i.concept}@${i.command}`}))),Pe}function BN(){return Object.freeze(ke().map(e=>Object.freeze({command:e.command,canonical_flag:e.flag,accepted_spellings:Object.freeze([...new Set([e.flag,...e.aliases])].sort())})))}var yn=Object.freeze({init:30,config:35,extension:53,package:54,packages:54,install:26,upgrade:29,create:100,copy:24,focus:22,list:86,"list-all":85,"list-draft":84,"list-open":84,"list-in-progress":84,"list-blocked":84,"list-closed":84,"list-canceled":84,aggregate:37,context:45,ctx:45,get:30,graph:34,search:78,duplicates:24,eval:25,next:35,history:35,events:33,"history-redact":27,"history-repair":26,"history-compact":30,"history-author-acknowledge":28,merge:24,schema:40,profile:22,activity:35,restore:23,update:105,"update-many":140,close:31,"close-many":72,delete:24,append:24,comments:31,notes:35,learnings:27,files:39,docs:30,deps:32,plan:109,test:52,"test-all":40,telemetry:21,stats:29,health:36,validate:45,assurance:30,gc:22,workspace:23,contracts:29,claim:36,release:23,"start-task":23,"pause-task":23,"close-task":24,meet:33,event:33,remind:29,"test-runs-worker":25});function bn(){let e=new Map(Object.keys(yn).map(t=>[t,0]));for(let{command:t}of ke())e.set(t,Number(e.get(t))+1);return Object.freeze(Object.entries(yn).map(([t,r])=>Object.freeze({command:t,current:Number(e.get(t)),maximum:r})))}function pb(e,t,r){for(let n of e)for(let o of n.aliases){let i=t.get(`${n.command}:${o}`);i===void 0||i.flag===n.flag||r.push({code:"alias_collision",command:n.command,detail:`${o} aliases ${n.flag} but is canonical for ${i.flag}.`})}}function fb(e,t,r){let n=new Set(t.map(({command:o})=>o));for(let o of e.keys())n.has(o)||r.push({code:"missing_budget",command:o,detail:`${o} has canonical flags but no persisted budget.`});for(let o of t){let i=e.get(o.command)??0;i===0&&r.push({code:"stale_budget",command:o.command,detail:`${o.command} has a persisted budget but no canonical flags.`}),!(i<=o.maximum)&&r.push({code:"budget_exceeded",command:o.command,detail:`${i} canonical flags exceed the ratcheted maximum ${o.maximum}.`})}}function mb(e,t,r){let n=new Map(e.map(o=>[`${o.command}:${o.flag}`,o]));for(let o of t){let i=`${o.command}:${o.canonical_flag}`,s=n.get(i);if(!s){r.push({code:"removed_canonical_spelling",command:o.command,detail:`${o.canonical_flag} disappeared from the executable spelling inventory.`});continue}let a=new Set([s.flag,...s.aliases]);for(let c of o.accepted_spellings)a.has(c)||r.push({code:"removed_compatibility_spelling",command:o.command,detail:`${c} no longer resolves to ${o.canonical_flag}.`})}}function qN(e=ke(),t=bn(),r=[]){let n=[],o=new Map,i=new Map,s=new Map,a=new Map;for(let c of e){let d=`${c.command}:${c.flag}`;o.has(d)?n.push({code:"duplicate_canonical_flag",command:c.command,detail:`${c.flag} has more than one canonical row.`}):o.set(d,c),a.set(c.command,(a.get(c.command)??0)+1);let l=i.get(c.concept);l!==void 0&&l!==c.value_kind?n.push({code:"inconsistent_concept_kind",command:c.command,detail:`${c.concept} uses both ${l} and ${c.value_kind}.`}):i.set(c.concept,c.value_kind);let u=s.get(c.concept);u!==void 0&&u!==c.flag?n.push({code:"semantic_spelling_collision",command:c.command,detail:`${c.concept} is canonicalized by both ${u} and ${c.flag}.`}):s.set(c.concept,c.flag)}return pb(e,o,n),fb(a,t,n),mb(e,r,n),n.sort((c,d)=>c.command.localeCompare(d.command)||c.code.localeCompare(d.code)||c.detail.localeCompare(d.detail)),{ok:n.length===0,entry_count:e.length,budget_count:t.length,concept_count:new Set(e.map(({concept:c})=>c)).size,baseline_entry_count:r.length,findings:n}}function zN(){let e=ke(),t=bn(),r=new Map(t.map(({command:o})=>[o,"unknown"]));for(let{command:o,family:i}of e)r.set(o,i);return["# Generated flag lexicon budgets","","This file is generated by `listPmFlagLexicon()`. Compatibility aliases do not consume canonical budget.","","| Command | Capability family | Canonical flags | Maximum |","| --- | --- | ---: | ---: |",...t.map(({command:o,current:i,maximum:s})=>{let a=r.get(o);return`| \`${o}\` | ${a} | ${i} | ${s} |`}),""].join(`
|
|
32
|
+
`)}(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]="7fc669d4-1db2-5636-8304-2c111a684726")}catch{}})();function HN(e){return e}function KN(e){return e}function WN(e){return e}function XN(e){return e}function YN(e){return e}function JN(e){return e}function ZN(e){return e}function QN(e){return e}function e0(e){return e}function t0(e){return e}function r0(e){return e}function n0(e){return e}function o0(e){return e}function i0(e){return{handled:!0,result:e}}function s0(){return{handled:!1}}function a0(e){return e}function c0(e){return e}function d0(e){return e}function l0(e){return e}function u0(e){return e}function p0(e){return e}function f0(e){return e}function m0(e){return e}function _0(e){return 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]="5bbfab95-010d-5507-ab01-f8f43943d295")}catch{}})();function _b(e={},t={}){return new me(t).extension(void 0,{...e,migrate:!0})}function hb(e={},t={}){return new me(t).packageMigrate(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]="bca95ba2-258c-5be2-8428-dcb8dbc87ef0")}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]="ff251826-36f0-5b92-bee8-ca71d265986c")}catch{}})();import{createHash as Tn,createHmac as gb,randomBytes as yb,timingSafeEqual as bb}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]="4853ebbf-f28a-55f1-b306-aa75cb9355ae")}catch{}})();var nL="dev.unbrained.pm/progressive-tool-discovery",oL=Object.freeze({version:1,discoveryTool:"pm_discover",canonicalResult:"structuredContent.result",compatibilityText:"pointer"}),Cb=Object.freeze(["pm_discover","pm_next","pm_context","pm_search","pm_get"]),q=Object.freeze({lexical:.4,semantic:.2,graph:.1,permission:.15,freshness:.05,usage:.1}),Tb=Object.freeze(["profile_changed","tool_contract_changed","workspace_extension_changed","authorization_changed","ranking_signal_changed","cursor_integrity_key_rotated"]),wn={core:0,standard:1,full:2,internal:3},Sn=Object.freeze(["core","standard","full"]),wb=new Set(["core","standard","full","custom"]),En=new Set(re.map(({family:e})=>e)),Sb=yb(32);function Ne(e,t){if(typeof e!="string")throw new b(`pm tool discovery ${t} must be a string of at most 4096 Unicode characters.`,64);let r=e[Symbol.iterator](),n=0;for(let o=r.next();!o.done;o=r.next())if(n+=1,n>4096)throw new b(`pm tool discovery ${t} must be a string of at most 4096 Unicode characters.`,64);return e}function An(e){if(!Number.isInteger(e)||Number(e)<1||Number(e)>100)throw new b("pm tool discovery limit must be from 1 through 100.",64);return Number(e)}function xn(e){if(e!=="unbounded"&&(!Number.isInteger(e)||Number(e)<128))throw new b("pm tool discovery outputBudget must be unbounded or an integer of at least 128.",64);return e==="unbounded"?e:Number(e)}function On(e){if(e!==void 0&&typeof e!="boolean")throw new b("pm tool discovery includeSchema must be a boolean.",64);return e===!0}function Rn(e){if(e===null||typeof e!="object"||Array.isArray(e))throw new b("pm tool discovery options must be an object.",64)}function Eb(e){if(!Array.isArray(e))throw new b("pm tool discovery candidates must be an array.",64);for(let[t,r]of e.entries()){if(r===null||typeof r!="object"||Array.isArray(r))throw new b(`pm tool discovery candidate ${t} must be an object.`,64);if(typeof r.name!="string"||r.name.trim().length===0)throw new b(`pm tool discovery candidate ${t} name must be a non-empty string.`,64);if(typeof r.description!="string"||r.description.trim().length===0)throw new b(`pm tool discovery candidate ${t} description must be a non-empty string.`,64);if(r.inputSchema===null||typeof r.inputSchema!="object"||Array.isArray(r.inputSchema))throw new b(`pm tool discovery candidate ${t} inputSchema must be an object.`,64);if(r.authorized!==void 0&&typeof r.authorized!="boolean")throw new b(`pm tool discovery candidate ${t} authorized must be a boolean.`,64)}}function iL(e){if(Rn(e),e.family!==void 0&&(typeof e.family!="string"||!En.has(e.family)))throw new b("pm tool discovery family must be a declared capability family.",64);if(e.tier!==void 0&&(typeof e.tier!="string"||!Sn.includes(e.tier)))throw new b("pm tool discovery tier must be core, standard, or full.",64);return{...e.query!==void 0?{query:Ne(e.query,"query")}:{},...e.family!==void 0?{family:e.family}:{},...e.tier!==void 0?{tier:e.tier}:{},...e.limit!==void 0?{limit:An(e.limit)}:{},...e.cursor!==void 0?{cursor:Ne(e.cursor,"cursor")}:{},...e.includeSchema!==void 0?{includeSchema:On(e.includeSchema)}:{},...e.outputBudget!==void 0?{outputBudget:xn(e.outputBudget)}:{}}}function Ab(e){return e===void 0||!Number.isFinite(e)?0:Math.min(1,Math.max(0,e))}function ue(e){return[...new Set(e.toLowerCase().match(/[a-z0-9]+/gu)??[])].sort()}function xb(e,t){let r=ue(e);if(r.length===0)return 0;let n=new Set(ue(t)),o=r.filter(s=>n.has(s)).length,i=t.toLowerCase().includes(e.toLowerCase())?.25:0;return Math.min(1,o/r.length+i)}function Ob(e,t){let r=ue(e);if(r.length===0)return 0;let n=t.toLowerCase(),o=ue(t),i=r.filter(a=>o.some(c=>c.startsWith(a)||a.startsWith(c))).length,s=n.includes(e.toLowerCase())?.2:0;return Math.min(1,i/r.length+s)}function Cn(e){return Tn("sha256").update(JSON.stringify(e)).digest("hex").slice(0,24)}function In(e,t,r){return gb("sha256",r).update(JSON.stringify({version:1,fingerprint:e,offset:t})).digest("base64url")}function Rb(e,t,r){let n={version:1,offset:t,signature:In(e,t,r)};return Buffer.from(JSON.stringify(n),"utf8").toString("base64url")}function Ib(e,t,r,n){if(e===void 0)return 0;try{let o=JSON.parse(Buffer.from(e,"base64url").toString("utf8"));if(o.version!==1||!Number.isInteger(o.offset)||(o.offset??-1)<0||Number(o.offset)>r||typeof o.signature!="string")throw new Error("cursor fields do not match the request");let i=Buffer.from(In(t,o.offset,n),"base64url"),s=Buffer.from(o.signature,"base64url");if(s.length!==i.length||!bb(s,i))throw new Error("cursor signature does not match the request");return o.offset}catch(o){throw new b("Invalid or stale pm tool discovery cursor; restart discovery without cursor.",64,{reason:String(o)})}}function Tt(e,t,r){return{value:Ab(e),weight:t,available:r!=="unavailable",source:r}}function Me(e,t,r){return Tt(e??t,r,e===void 0?"computed":"host")}function vb(e,t,r){let n=Object.hasOwn(fe,e.name)?fe[e.name]:"help",o=We(n),i=`${e.name} ${e.description} ${n} ${o}`,s=xb(t,i),a=new Set(ue(t)),c={lexical:Tt(s,q.lexical,"computed"),semantic:Me(e.signals?.semantic,Ob(t,i),q.semantic),graph:Me(e.signals?.graph,a.has(o)||a.has(n)?1:0,q.graph),permission:Tt(1,q.permission,"authorization"),freshness:Me(e.signals?.freshness,1,q.freshness),usage:Me(e.signals?.usage,Cb.includes(e.name)?1:0,q.usage)},d=Object.values(c).reduce((l,u)=>l+u.value*u.weight,0);return{name:e.name,description:e.description,command:n,tier:Xe(n),family:o,score:Number(d.toFixed(6)),signals:c,...r?{input_schema:structuredClone(e.inputSchema)}:{}}}function Pb(e){if(e.cursorIntegrityKey!==void 0&&(!(e.cursorIntegrityKey instanceof Uint8Array)||e.cursorIntegrityKey.byteLength<32))throw new b("pm tool discovery cursorIntegrityKey must contain at least 32 bytes.",64);if(e.tier!==void 0&&(typeof e.tier!="string"||!Sn.includes(e.tier)))throw new b("pm tool discovery tier must be core, standard, or full.",64);if(e.family!==void 0&&(typeof e.family!="string"||!En.has(e.family)))throw new b("pm tool discovery family must be a declared capability family.",64);if(e.profile!==void 0&&(typeof e.profile!="string"||!wb.has(e.profile)))throw new b("pm tool discovery profile must be core, standard, full, or custom.",64)}function kb(e){let r=Ne(e.query===void 0?"":e.query,"query").trim().replace(/\s+/gu," ");Ne(e.cursor===void 0?"":e.cursor,"cursor");let n=An(e.limit===void 0?10:e.limit),o=xn(e.outputBudget===void 0?1200:e.outputBudget);return Pb(e),{query:r,includeSchema:On(e.includeSchema),limit:n,budget:o,maximumTier:wn[e.tier??"full"],profile:e.profile===void 0?"core":e.profile}}function vn(e,t,r){let n=r??e.tools.reduce((s,a,c)=>s+(c===0?0:1)+Buffer.byteLength(JSON.stringify(a),"utf8"),0),o={...e,tools:[]},i=0;for(let s=0;s<4;s+=1){let a=Buffer.byteLength(JSON.stringify({...o,token_cost:{estimated_tokens:i,budget:t,within_budget:!0}}),"utf8"),c=Math.ceil((a+n)/4);if(c===i)break;i=c}return i}function Mb(e,t,r){return e.filter(n=>n.authorized!==!1).map(n=>vb(n,r.query,r.includeSchema)).filter(n=>n.tier!=="internal"&&wn[n.tier]<=r.maximumTier&&(t.family===void 0||n.family===t.family)).sort((n,o)=>o.score-n.score||(n.name<o.name?-1:n.name>o.name?1:0))}function Nb(e,t,r){if(t==="unbounded")return[...e];let n=[],o=0;for(let[i,s]of e.entries()){let a=o+(i===0?0:1)+Buffer.byteLength(JSON.stringify(s),"utf8");if(vn(r(i+1),t,a)>t)break;n.push(s),o=a}return n}function sL(e,t={}){Eb(e),Rn(t);let r=kb(t),n=t.cursorIntegrityKey??Sb,o=Mb(e,t,r),i=Cn({query:r.query,family:t.family??null,tier:t.tier??"full",includeSchema:r.includeSchema,profile:r.profile,ranked:o}),s=Ib(t.cursor,i,o.length,n),a=o.slice(s,s+r.limit),c=[];r.includeSchema||c.push({name:"input_schema",reason:"compact_projection",restore_with:"Set includeSchema=true."}),s+r.limit<o.length&&c.push({name:"tools",reason:"limit",restore_with:"Continue with next_cursor or increase limit."});let d={result_type:"pm_tool_discovery",contract_version:1,query:r.query,profile:r.profile,total:o.length,ranking_policy:{version:1,formula:"weighted_sum_then_name",weights:q},cache:{key:Cn({fingerprint:i,cursorIntegrityKey:Tn("sha256").update(n).digest("hex"),limit:r.limit,offset:s,budget:r.budget}),ttl_ms:3e4,scope:"private",invalidates_on:Tb}},l=(h,C=h.length)=>{let w=s+C,z=w<o.length,I=[...c];return C<a.length&&I.push({name:"tools",reason:"token_budget",restore_with:"Continue with next_cursor or increase outputBudget."}),{...d,tools:[...h],returned:C,has_more:z,...z?{next_cursor:Rb(i,w,n)}:{},omission_receipt:{has_omissions:I.length>0,omitted:I}}},u=h=>{let C=l(h),w=vn(C,r.budget);return{...C,token_cost:{estimated_tokens:w,budget:r.budget,within_budget:r.budget==="unbounded"||w<=r.budget}}},m=Nb(a,r.budget,h=>l([],h)),g=u(m);if(a.length>0&&m.length===0){let h=u([a[0]]).token_cost.estimated_tokens;throw new b(`pm tool discovery outputBudget is too small to return a tool; increase it to at least ${h}.`,64,{required:String(h)})}if(r.budget!=="unbounded"&&g.token_cost.estimated_tokens>r.budget)throw new b(`pm tool discovery outputBudget is too small; at least ${g.token_cost.estimated_tokens} estimated tokens are required for this page.`,64,{required:String(g.token_cost.estimated_tokens)});return g}(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]="036baf5a-3ba9-55ea-a11b-d9e94a848b92")}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]="ea74fa78-184f-55e7-8c8e-fb912f4d26d8")}catch{}})();export{YO as ACTIONABILITY_ORDERING_KINDS,bs as ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS,mc as ACTIVITY_FLAG_CONTRACTS,So as AGENT_PROVENANCE_DIMENSIONS,Zs as AGGREGATE_FLAG_CONTRACTS,Fa as APPEND_FLAG_CONTRACTS,HO as ASSURANCE_ACTIONS,KO as ASSURANCE_DECLARATION_KINDS,px as ASSURANCE_DOCUMENT_VERSION,oc as ASSURANCE_FLAG_CONTRACTS,fx as ASSURANCE_GATE_TRIGGERS,mx as ASSURANCE_MEASUREMENT_SOURCE_KINDS,Px as ASSURANCE_PRESET_IDS,cx as AssuranceEvaluationRefusalError,ax as AssuranceMutationRefusalError,dx as AssuranceSourceResolutionError,co as BASELINE_ITEM_FORMAT_VERSION,ly as BOUNDARY_FIXTURE_CAPTURE_SOURCES,cR as BRIEF_LIST_FIELDS,Ao as BUILTIN_AGENT_PROVENANCE_ADAPTERS,Y as BUILTIN_CORPUS_SHAPES,Eo as BUILTIN_HARNESS_SIGNAL_DESCRIPTORS,Fn as BUILTIN_ITEM_TYPE_VALUES,Vt as BUILTIN_PROFILES,yC as BUILTIN_RELATIONSHIP_KINDS,hs as CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS,fc as CALENDAR_FLAG_CONTRACTS,ja as CLAIM_FLAG_CONTRACTS,kc as CLOSE_ACTION_OPTION_KEYS,Da as CLOSE_FLAG_CONTRACTS,$a as CLOSE_MANY_FLAG_CONTRACTS,Va as CLOSE_TASK_FLAG_CONTRACTS,Qs as COMMENTS_FLAG_CONTRACTS,lC as COMMON_MUTATION_COMMAND_OPTION_KEYS,xc as COMPLETION_FLAG_CONTRACTS,zn as CONFIDENCE_TEXT_VALUES,ma as CONFIG_FLAG_CONTRACTS,gs as CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS,IR as CONTEXT_EVALUATION_METRIC_NAMES,hc as CONTEXT_FLAG_CONTRACTS,Gt as CONTEXT_OUTPUT_VALUES,NR as CONTEXT_PACKING_PROFILES,TR as CONTEXT_RECENCY_EPOCH,AR as CONTEXT_RELEVANCE_SERVICE,SR as CONTEXT_RELEVANCE_SIGNAL_NAMES,$R as CONTEXT_SIGNAL_SET_VERSION,DR as CONTEXT_SIGNAL_STORE_FORMAT_VERSION,FR as CONTEXT_SIGNAL_STORE_WARNING_DETAILS,Ac as CONTRACTS_FLAG_CONTRACTS,dc as COPY_FLAG_CONTRACTS,Ss as CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,As as CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,Es as CREATE_COMMANDER_STRING_OPTION_CONTRACTS,jb as CREATE_DIRECT_CLOSE_REASON_DEFAULT,ic as CREATE_FLAG_CONTRACTS,pS as CURRENT_HISTORY_ITEM_HASH_VERSION,mS as CURRENT_HISTORY_RECORD_HASH_VERSION,lo as CURRENT_ITEM_FORMAT_VERSION,BR as ContextSignalStore,Hw as ContextUsageValidationError,ex as DEFAULT_AUTHOR_IDENTITY_VOCABULARY,bI as DEFAULT_CHILD_SAMPLE_LIMIT,aR as DEFAULT_COMPACT_LIST_FIELDS,lE as DEFAULT_DERIVED_INDEX_MINIMUM_ITEMS,Hp as DEFAULT_EVAL_QUERIES_RELATIVE_PATH,nI as DEFAULT_TERMINAL_TRANSITION_POLICY,HR as DEFAULT_WORKSPACE_MEMORY_MINIMUM_ITEMS,jO as DEFECT_ESCAPE_CLASSES,GO as DEFECT_GATE_EVIDENCE_DISPOSITIONS,Ua as DELETE_FLAG_CONTRACTS,Un as DEPENDENCY_KIND_VALUES,bc as DEPS_FLAG_CONTRACTS,na as DOCS_FLAG_CONTRACTS,tc as DUPLICATES_FLAG_CONTRACTS,EO as DURABLE_MERGE_RECEIPT_INTRODUCED_AT,Tc as EVAL_FLAG_CONTRACTS,Bp as EVAL_QUERY_SET_CONTRACT,qp as EVAL_QUERY_SET_EXAMPLE,Up as EVAL_QUERY_SET_SCHEMA_ID,_c as EVENTS_FLAG_CONTRACTS,Ka as EVENT_FLAG_CONTRACTS,Ho as EXECUTABLE_COMMAND_ALIASES,L as EXIT_CODE,Aa as EXTENSION_ACTIVATE_FLAG_CONTRACTS,Ea as EXTENSION_ADOPT_ALL_FLAG_CONTRACTS,ka as EXTENSION_ADOPT_FLAG_CONTRACTS,PA as EXTENSION_CAPABILITIES,$b as EXTENSION_CAPABILITY_CONTRACT,Lb as EXTENSION_CAPABILITY_CONTRACT_VERSION,Db as EXTENSION_CAPABILITY_LEGACY_ALIASES,Qn as EXTENSION_CAPABILITY_REGISTRATION_SURFACES,Pa as EXTENSION_CATALOG_FLAG_CONTRACTS,xa as EXTENSION_DEACTIVATE_FLAG_CONTRACTS,Sa as EXTENSION_DESCRIBE_FLAG_CONTRACTS,va as EXTENSION_DOCTOR_FLAG_CONTRACTS,wa as EXTENSION_EXPLORE_FLAG_CONTRACTS,_a as EXTENSION_FLAG_CONTRACTS,ga as EXTENSION_INIT_FLAG_CONTRACTS,Ca as EXTENSION_INSTALL_FLAG_CONTRACTS,Ra as EXTENSION_MANAGE_FLAG_CONTRACTS,Oa as EXTENSION_MIGRATE_FLAG_CONTRACTS,kA as EXTENSION_POLICY_MODES,MA as EXTENSION_POLICY_SURFACES,Ia as EXTENSION_RELOAD_FLAG_CONTRACTS,LA as EXTENSION_SANDBOX_PROFILES,ha as EXTENSION_SCOPE_FLAG_CONTRACTS,NA as EXTENSION_TRUST_MODES,Ta as EXTENSION_UNINSTALL_FLAG_CONTRACTS,Ux as EXTERNAL_DEPENDENCY_RESOLUTION_STATUSES,jx as EXTERNAL_DEPENDENCY_SOURCE_KIND,Gx as EXTERNAL_DEPENDENCY_SOURCE_KIND_ALIAS,ra as FILES_FLAG_CONTRACTS,lc as FOCUS_FLAG_CONTRACTS,Qa as GC_FLAG_CONTRACTS,uR as GET_DEPTH_VALUES,gc as GET_FLAG_CONTRACTS,Ys as GLOBAL_FLAG_CONTRACTS,kd as GRAPH_DURABLE_CACHE_MIN_ITEMS,Pd as GRAPH_DURABLE_CACHE_VERSION,Cc as GRAPH_FLAG_CONTRACTS,je as GRAPH_SUBCOMMAND_VALUES,yc as GUIDE_FLAG_CONTRACTS,rc as HEALTH_FLAG_CONTRACTS,ca as HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS,Wx as HISTORY_AUTHOR_ATTRIBUTION_BASELINE,tv as HISTORY_COMPACT_BULK_DEFAULT_MIN_ENTRIES,da as HISTORY_COMPACT_FLAG_CONTRACTS,Fo as HISTORY_EVENT_CLASSIFICATION_VERSION,oa as HISTORY_FLAG_CONTRACTS,Re as HISTORY_ITEM_HASH_VERSION_3_INTRODUCED_IN,sa as HISTORY_REDACT_FLAG_CONTRACTS,aa as HISTORY_REPAIR_FLAG_CONTRACTS,Lp as INIT_AGENT_GUIDANCE_MODE_VALUES,fa as INIT_FLAG_CONTRACTS,Ma as INSTALL_FLAG_CONTRACTS,qn as ISSUE_SEVERITY_VALUES,ac as ITEM_COMPLETE_FLAG_CONTRACTS,_O as ITEM_LATEST_TIMESTAMP_FIELDS,Fb as ITEM_METADATA_KEY_ORDER,sc as ITEM_MUTATE_FLAG_CONTRACTS,cc as ITEM_REOPEN_FLAG_CONTRACTS,cO as ITEM_SCALAR_MISSING_VALUE,jn as ITEM_TYPE_VALUES,mO as ITEM_UNION_COLLECTION_FIELDS,UR as JsonFileContextSignalStoreAdapter,ta as LEARNINGS_FLAG_CONTRACTS,cp as LINKED_TEST_ENV_NAME_PATTERN,dp as LINKED_TEST_PM_CONTEXT_MODE_VALUES,ap as LINKED_TEST_PROTECTED_ENV_KEYS,lp as LINKED_TEST_WORKSPACE_CONTEXT_MODE_VALUES,ms as LIST_COMMANDER_STRING_OPTION_CONTRACTS,dR as LIST_COMMAND_DEFAULT_PROJECTIONS,$A as LIST_FILTER_EXTENSION_FLAG_DEFINITIONS,Js as LIST_FILTER_FLAG_CONTRACTS,_R as LIST_SORT_FIELDS,hR as LIST_SORT_ORDER_VALUES,jo as MAINTENANCE_HISTORY_OPERATIONS,yI as MAX_CHILD_PROJECTION_ITEMS,Ha as MEET_FLAG_CONTRACTS,GI as MERGE_DRIVER_ARTIFACT_VALUES,ia as MERGE_FLAG_CONTRACTS,Ge as MERGE_SUBCOMMAND_VALUES,qI as MUTATION_EVENT_WIRE_BUDGET,ae as MemoryRelationshipGraphAdapter,ys as NEXT_COMMANDER_STRING_OPTION_CONTRACTS,Sc as NEXT_FLAG_CONTRACTS,qu as NEXT_OUTPUT_VALUES,ea as NOTES_FLAG_CONTRACTS,ya as PACKAGE_FLAG_CONTRACTS,ba as PACKAGE_INIT_FLAG_CONTRACTS,za as PAUSE_TASK_FLAG_CONTRACTS,Pc as PLAN_CREATE_METADATA_PARAMETER_KEYS,pa as PLAN_FLAG_CONTRACTS,Ap as PLAN_SHOW_DEPTH_VALUES,He as PLAN_SUBCOMMANDS,xp as PLAN_TEMPLATE_NAMES,ky as PM_AGENT_TASK_ACCOUNTING_MODES,_t as PM_AGENT_TASK_TRANSCRIPT_VERSION,Gc as PM_CLI_EXPECTED_ERROR_NAME,cA as PM_CLI_GRAMMAR_CONTRACT,nA as PM_CLI_GRAMMAR_NOUNS,ii as PM_CLI_ONLY_TOOL_ACTION_WAIVERS,oA as PM_CLI_SHARED_VERBS,Vo as PM_COMMAND_ALIAS_CONTRACTS,re as PM_COMMAND_CAPABILITY_CONTRACTS,Mt as PM_COMMAND_DESTINATION_CONTRACTS,dI as PM_COMMAND_EXIT_CONTRACTS,cI as PM_COMMAND_EXIT_OUTCOME_CONTRACTS,Si as PM_COMMAND_OUTPUT_BUDGET_CONTRACTS,fv as PM_COMMAND_OUTPUT_ENVELOPE_CONTRACTS,Be as PM_COMMAND_POSITIONAL_CONTRACTS,Tf as PM_COMMAND_VISIBILITY_CONTRACTS,jA as PM_COMPLETE_LIST_FINDING_CODES,VA as PM_CONTEXT_INTENTS_FILE,Zw as PM_CONTEXT_INTENT_CONTRACTS,ti as PM_CORE_COMMAND_NAMES,j as PM_CORPUS_SHAPE_SCHEMA,ai as PM_DEPRECATED_TOOL_ACTIONS,yi as PM_DIAGNOSTIC_DEGRADATION_STEPS,bi as PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS,gi as PM_DIAGNOSTIC_OUTPUT_CLASSES,ci as PM_DISCOVERABLE_TOOL_ACTIONS,Yr as PM_EPISODE_SCHEMA,uv as PM_ERROR_CODE_CATALOG,av as PM_ERROR_CODE_EXIT_CLASS_CONTRACTS,rn as PM_EXACT_COVERAGE_METRICS,Xo as PM_EXTENSION_CAPABILITY_CONTRACTS,ri as PM_EXTENSION_PACKAGE_ACTION_SUBCOMMANDS,Jo as PM_EXTENSION_POLICY_MODE_CONTRACTS,ei as PM_EXTENSION_POLICY_SURFACE_CONTRACTS,Qo as PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS,Yo as PM_EXTENSION_SERVICE_NAME_CONTRACTS,Zo as PM_EXTENSION_TRUST_MODE_CONTRACTS,tO as PM_GITATTRIBUTES_END,eO as PM_GITATTRIBUTES_START,nO as PM_GITATTRIBUTES_V2_END,rO as PM_GITATTRIBUTES_V2_START,Hc as PM_GITIGNORE_END,Vc as PM_GITIGNORE_START,oi as PM_ITEM_ACTION_SUBCOMMANDS,it as PM_MCP_APPS_EXTENSION,Mr as PM_MCP_APPS_SERVER_CAPABILITY,we as PM_MCP_APPS_SPEC_VERSION,Dr as PM_MCP_APP_CONTRACTS,Lr as PM_MCP_APP_MIME_TYPE,Cb as PM_MCP_ENTRY_TOOL_NAMES,f as PM_MCP_ERROR_CODES,_k as PM_MCP_HTTP_PROTOCOL_VERSION,kh as PM_MCP_INPUT_REQUEST_METHODS,jP as PM_MCP_LEGACY_PROTOCOL_VERSIONS,O as PM_MCP_META_KEYS,nL as PM_MCP_PROGRESSIVE_DISCOVERY_EXTENSION,oL as PM_MCP_PROGRESSIVE_DISCOVERY_SERVER_CAPABILITY,xf as PM_MCP_PROMPT_CONTRACTS,H as PM_MCP_PROTOCOL_VERSION,Af as PM_MCP_RESOURCE_CONTRACTS,at as PM_MCP_SKILLS_DRAFT_REVISION,$r as PM_MCP_SKILLS_EXTENSION,Fg as PM_MCP_SKILLS_SERVER_CAPABILITY,P as PM_MCP_SKILL_LIMITS,Ce as PM_MCP_SUBSCRIPTION_ID_META_KEY,Ye as PM_MCP_SUPPORTED_PROTOCOL_VERSIONS,ak as PM_MCP_TASKS_EXTENSION,qh as PM_MCP_TASK_STATUSES,fe as PM_MCP_TOOL_COMMAND_CONTRACTS,zT as PM_MODE_PAIRED_OUTPUT_PROJECTION_CONTRACTS,Yi as PM_MUTATION_ACTION_CONTRACTS,Wr as PM_OBSERVATION_SCHEMA,hi as PM_OUTPUT_BUDGET_CLASSES,_i as PM_OUTPUT_DEGRADATION_STEPS,rr as PM_OUTPUT_ENVELOPE_KINDS,$t as PM_PACKAGE_CONVENTIONAL_RESOURCE_ROOTS,ni as PM_PACKAGE_ONLY_ACTION_SUBCOMMANDS,Dt as PM_PACKAGE_RESOURCE_KINDS,Ue as PM_POSITIONAL_ACTION_CONTRACTS,jc as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA,$c as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION,vw as PM_READ_OUTPUT_COMPOSITION_OPTION_FLAGS,gw as PM_READ_OUTPUT_CONTINUATION_FINGERPRINT_POLICIES,Ow as PM_READ_OUTPUT_DIMENSIONS,Iw as PM_READ_OUTPUT_OPTION_FLAGS,ww as PM_READ_OUTPUT_SESSION_MAX_SEEN_ITEM_IDS,Tw as PM_READ_OUTPUT_SESSION_MIN_TOKENS,Rw as PM_READ_OUTPUT_SURFACES,Pw as PM_READ_OUTPUT_SURFACE_CONTRACTS,qT as PM_READ_ROW_CONTRACTS,BT as PM_READ_ROW_JQ_SELECTOR,lN as PM_RECOVERY_REFERENCE_FIELDS,le as PM_RECOVERY_REFERENCE_KINDS,rb as PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE,hn as PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE_V2,gN as PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE,_n as PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE_V2,ls as PM_REPRODUCIBLE_PROCESS_ENV,lI as PM_SUCCESS_EXIT_CODES,si as PM_TOOL_ACTIONS,Mc as PM_TOOL_ACTION_PARAMETER_CONTRACTS,Fc as PM_TOOL_PARAMETERS_SCHEMA,Dc as PM_TOOL_PARAMETERS_SCHEMA_MAJOR,Lc as PM_TOOL_PARAMETERS_SCHEMA_VERSION,Ic as PM_TOOL_RESERVED_CUSTOM_FIELD_PROPERTIES,Xr as PM_VERDICT_SCHEMA,Hr as PM_WORKSPACE_RECIPE_SCHEMA,ua as PROFILE_FLAG_CONTRACTS,Zt as PROFILE_LINT_CODES,Jt as PROFILE_LINT_DIMENSIONS,zt as PROFILE_NAMES,Ke as PROFILE_SUBCOMMANDS,b as PmCliError,me as PmClient,GA as PmCompleteListValidationError,y as PmMcpAuthorizationError,sr as PmMcpInputRequiredError,Rr as PmMcpIssuerCredentialStore,p as PmMcpProtocolError,ar as PmMcpRequestStateReplayGuard,qr as PmMcpSkillRegistry,yr as PmMcpSubscriptionRegistry,nt as PmMcpTaskStore,sw as QUERY_CURSOR_CONTRACT,La as REINDEX_FLAG_CONTRACTS,iE as REINDEX_LOCK_ID,mt as RELATIONSHIP_GRAPH_SNAPSHOT_VERSION,Ba as RELEASE_FLAG_CONTRACTS,Wa as REMIND_FLAG_CONTRACTS,It as RESERVED_ITEM_FIELD_NAMES,Ga as RESTORE_FLAG_CONTRACTS,Bn as RISK_VALUES,SA as RelationshipEventLog,EA as RelationshipEventStore,V as RelationshipGraph,$e as RelationshipKindRegistry,la as SCHEMA_FLAG_CONTRACTS,_s as SEARCH_COMMANDER_STRING_OPTION_CONTRACTS,FA as SEARCH_EXTENSION_FLAG_DEFINITIONS,Ec as SEARCH_FLAG_CONTRACTS,Au as SEMANTIC_ATTRIBUTION_LIMITS,Ub as SETTINGS_DEFAULTS,Jp as SNAPSHOT_SCHEMA,Jx as SOURCE_CONTEXT_ACCESS_ENV,Zx as SOURCE_CONTEXT_WRITE_OVERRIDE_ENV,qa as START_TASK_FLAG_CONTRACTS,ec as STATS_FLAG_CONTRACTS,Gn as STATUS_VALUES,Xs as SUBCOMMAND_GLOBAL_FLAG_CONTRACTS,Go as SUBSTANTIVE_HISTORY_OPERATIONS,fS as SUPPORTED_HISTORY_ITEM_HASH_VERSIONS,_S as SUPPORTED_HISTORY_RECORD_HASH_VERSIONS,oC as SUPPRESS_HOST_OUTPUT_MARKER,Ja as TELEMETRY_FLAG_CONTRACTS,Kf as TELEMETRY_SUBCOMMANDS,Ya as TEST_ALL_FLAG_CONTRACTS,Xa as TEST_FLAG_CONTRACTS,Za as TEST_RUNS_FLAG_CONTRACTS,Bf as TEST_RUN_MEASUREMENT_LIMIT,qs as TOOL_ACTIVITY_OPTION_CONTRACTS,Ps as TOOL_AGGREGATE_OPTION_CONTRACTS,js as TOOL_BULK_MUTATION_FILTER_OPTION_CONTRACT_SOURCE,Bs as TOOL_CALENDAR_OPTION_CONTRACTS,Us as TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS,zs as TOOL_CONTEXT_OPTION_CONTRACTS,Ds as TOOL_CREATE_OPTION_CONTRACTS,Ls as TOOL_CREATE_OPTION_CONTRACT_SOURCE,Vs as TOOL_DEPS_OPTION_CONTRACTS,Hs as TOOL_GRAPH_OPTION_CONTRACTS,vs as TOOL_LIST_FILTER_OPTION_CONTRACTS,ks as TOOL_SEARCH_FILTER_OPTION_CONTRACTS,Ns as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS,Ms as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACT_SOURCE,Gs as TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS,Fs as TOOL_UPDATE_OPTION_CONTRACTS,$s as TOOL_UPDATE_OPTION_CONTRACT_SOURCE,Gb as TYPE_TO_FOLDER,rC as UNKNOWN_SUBCOMMAND_COMPATIBILITY_CODES,xs as UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,Rs as UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,Os as UPDATE_COMMANDER_STRING_OPTION_CONTRACTS,uc as UPDATE_FLAG_CONTRACTS,pc as UPDATE_MANY_FLAG_CONTRACTS,Na as UPGRADE_FLAG_CONTRACTS,nc as VALIDATE_FLAG_CONTRACTS,wc as WORKSPACE_FLAG_CONTRACTS,Pi as WORKSPACE_HISTORY_ID,Zp as WORKSPACE_SNAPSHOT_ACTIONS,dd as WorkspaceGraphCache,IA as WorkspaceTransactionInterruptedError,qc as _testOnly,CR as _testOnlyAggregateCommand,Np as _testOnlyConfigCommand,SI as _testOnlyGetCommand,Sl as _testOnlyHealthCommand,jp as _testOnlyInit,Dp as _testOnlyInitAgentGuidance,Uv as _testOnlyItemTransaction,KI as _testOnlyMutationEvents,eI as _testOnlyNextCommand,jI as _testOnlySearchCommand,_I as _testOnlySimilarity,af as _testOnlyTemplates,ru as _testOnlyValidateCommand,QI as _testOnlyWorkspacePosition,Lx as acceptAssuranceProposals,eu as acknowledgeLinkedTests,Zd as acknowledgeUnknownAuthorHistoryEvents,Jd as acknowledgeUnknownAuthorHistoryEventsFromTransport,uE as acquireItemMetadataDerivedIndexLock,Fe as acquireLock,Qv as activateExtensionForTest,MC as activateExtensions,wo as agentSessionEnvironment,qm as aggregate,Pf as analyzeAgentProvenanceDescriptorCoverage,BO as analyzeDefectChangeRisk,xA as analyzeGraphImpact,Qc as analyzeHierarchyIntegrity,OA as analyzeKnowledgeGraph,pI as analyzePmCommandExitConformance,di as analyzePmToolActionParity,PO as analyzeReconciliationDiscard,AA as analyzeRelationshipExecution,Ed as analyzeRelationshipSchedule,_h as analyzeSdkActionCoverage,Nt as analyzeSdkCliParameterCompleteness,t_ as append,vi as appendHistoryEntry,Li as appendWorkspaceAuditEvent,Ni as appendWorkspaceHistoryChange,dT as applyAcceptanceCriteriaMutations,Mx as applyAssurancePreset,Ch as applyBootstrapPagerPolicy,nS as applyContextIntentProjection,Bu as applyContextTagProjection,gR as applyFilterValueEcho,hA as applyHistoryPatch,Oh as applyInvocationAuthorOverride,Il as applyPathMigrations,jw as applyReadOutputDimensions,Lw as applyReadOutputIncludeModes,Ew as applyReadOutputSessionReferences,iT as applyRegisteredItemFieldDefaultsAndValidation,Ml as applyStandaloneNote,gl as applyStoredExtensionMigrationState,uT as applyTagRemovals,aI as applyTerminalOrderingPolicy,Nl as artifactKey,Hb as asRecordClone,Vb as asRecordOrNull,ze as assembleWorkspaceRelationshipGraph,zA as assertCompleteListResult,MP as assertExtensionBlueprint,kP as assertExtensionCapabilityUsage,mP as assertExtensionDeactivated,DP as assertExtensionManifestCompatible,LP as assertExtensionManifestMatchesBlueprint,$P as assertExtensionPreflight,rd as assertHierarchyMutationAllowed,rv as assertHistoryCompactTarget,MO as assertHistoryRepairTarget,Hi as assertInitializedTracker,vl as assertLinkedArtifactMutationIsUnambiguous,UP as assertMcpClientCapabilities,GP as assertMcpProtocolHeader,Py as assertMemoryRelationshipGraphAdapterConformance,mT as assertNoUnknownCsvKeys,_P as assertPackageManifest,US as assertParentReferenceIsNotSelf,Vk as assertPmMcpSkillsCapability,NP as assertProjectProfile,PM as assertProjectRuntimeCompatibility,VT as assertProjectionModeChoice,Vi as assertReadableTrackerRoot,hP as assertRegisteredCommandContract,xP as assertRegisteredCommandOverride,wP as assertRegisteredExporter,gP as assertRegisteredFlags,yP as assertRegisteredHook,TP as assertRegisteredImporter,SP as assertRegisteredItemField,EP as assertRegisteredItemType,PP as assertRegisteredMigration,OP as assertRegisteredParserOverride,RP as assertRegisteredPreflightOverride,AP as assertRegisteredProfile,IP as assertRegisteredRendererOverride,bP as assertRegisteredSearchProvider,vP as assertRegisteredServiceOverride,CP as assertRegisteredVectorStoreAdapter,wC as assertRelationshipEdgeAllowed,dn as assertRelationshipGraphAdapterConformance,_x as assuranceAssertionUpdateIsLoosening,sS as attachContextIntentReceipt,Bw as attachContextUsageServingReceipt,Yl as attachLinkedTestMutationProvenance,Xl as attachLinkedTestProvenance,Ze as attachMcpServerInfo,JT as attachOutputOmissionReceipt,cS as attachOutputTokenAccounting,aS as attachReadOutputContracts,Aw as attachReadOutputSessionReceipt,nl as auditMergeAttributeFence,oO as auditMergeDriverConfiguration,Id as auditWorkspaceRelationshipGraph,vk as authorizeMcpHttpRequest,Co as boundAgentEpisodeIdentity,_w as boundReadOutputRows,Fu as buildChildrenByParent,OI as buildCompactSearchFilterSummary,yR as buildContentFilterEcho,GR as buildContextSignalSnapshot,ny as buildCorpusShapeItemPlan,UO as buildDefectRecurrenceIndex,fl as buildExtensionDescribeResult,bR as buildGovernanceMissingFilterEcho,XS as buildInvalidTypeError,CI as buildItemChildrenRollup,jv as buildItemCompletionMutations,ER as buildItemContextRelevanceCandidates,gE as buildItemNotFoundError,wI as buildItemSchedule,Tk as buildMcpAuthorizationDiscoveryUrls,vh as buildMcpCompleteResult,qP as buildMcpDiscoverResult,xk as buildMcpDynamicRegistrationMetadata,fk as buildMcpHttpRequestHeaders,WP as buildMcpInputRequiredResult,Ck as buildMcpProtectedResourceMetadata,tl as buildMergeAttributePatterns,Nc as buildPmActionToolInputSchema,CN as buildPmRefusalClosureCensus,Hx as buildRelationshipContext,wE as buildSearchCorpus,EE as buildSemanticCorpusInput,DO as buildStatusRoleWarnings,zi as buildTrackerInitializationRecovery,vE as buildVectorizationEmbeddingIdentity,PE as buildVectorizationEmbeddingMetadata,RI as buildVerboseSearchFilters,KR as buildWorkspaceMemorySnapshot,bo as canonicalDocument,uC as canonicalizeCommandOptionKey,wR as canonicalizeContextRecencyCoordinate,bC as canonicalizeRelationshipKind,uN as censusPmRecoveryReferenceProducers,qA as certifyCompleteListResult,Jv as checkExtensionManifestCompatibility,F_ as claim,j_ as claimNext,Xx as classifyHistoryAuthorEvent,Uo as classifyHistoryEvent,vO as classifyHistoryMergeReceiptReferences,WI as classifyHostEnvironmentFault,DI as classifyImplicitSemanticFallbackReason,fo as classifyItemFormatVersion,Yf as classifyLinkedTestCommandSafety,Jf as classifyLinkedTestFailure,YC as clearActiveExtensionHooks,$d as clearDurableGraphCache,$T as clearFocusedItem,Xc as clearWorkspaceContractsCache,$_ as close,Xu as closeItem,K_ as closeTask,Sh as coalesceRepeatedListFlags,JO as collectBlockedByIds,QO as collectBlockedByIdsFromCorpus,zw as collectContextUsageDeliveredItemIds,sd as collectDanglingDependencyReferences,tR as collectDependencyBlockedIds,od as collectDuplicateDependencyRows,Rd as collectDuplicateRelationshipEdgeGroups,LI as collectErrorCauseCodes,Zc as collectHierarchyRelations,Er as collectMcpHeaderAnnotations,ad as collectMissingDependencyTargetIds,rp as collectNewOrderingCycleWarnings,Ad as collectOrderingCycles,id as collectOrderingStorageContradictions,WA as collectPackageContextIntentContracts,jt as collectPackageExtensionDirectories,nT as collectRegisteredItemFieldNames,IT as collectRuntimeCreateFieldValues,YS as collectRuntimeFilterValues,vT as collectRuntimeUpdateFieldValues,Mu as collectSubtreeIds,eo as collectUsedExtensionCapabilities,pC as commandOptionFlagLabel,Hm as comments,Am as commitImportedItem,Gv as commitItemCompletion,Fv as commitItemMutations,vA as commitWorkspaceTransaction,Ws as compactFlagAliasContracts,Nu as compareCriticalItems,G as comparePmDateVersions,RA as compareRelationshipSnapshots,Kb as compareTimestampStrings,ix as compileHistoryProvenanceMatcher,tS as composeContextIntentContracts,zv as composeExtension,Yv as composeExtensionPackage,rR as computeActionabilityReport,NS as computeHistoryDiff,wd as computeRelationshipCentrality,Td as computeRelationshipDominators,cd as computeWorkspaceGraphFingerprint,n_ as config,XC as consumeAfterCommandAffectedItems,$m as context,iS as contextIntentRowId,U_ as copy,Zf as countFailureCategories,fw as countReadOutputRows,N_ as create,kx as createAssurancePreset,FO as createAssuranceWorkspaceContext,Xb as createCheckpointId,UA as createCompleteListOptions,NC as createCoreCommandHookContext,tn as createCorpusShapeMeasurement,Cx as createEmptyAssuranceDocument,EC as createEmptyExtensionRegistrationRegistry,zc as createExtensionCommandSdk,Zn as createExtensionContributionInventory,FP as createExtensionTestHarness,Ii as createHistoryEntry,KE as createLazyModule,Pk as createMcpStaticBearerVerifier,ck as createMcpTaskStore,hE as createMutationGuardSdk,HT as createOutputOmissionReceipt,Uc as createPmCliExpectedError,Rh as createPmCliProgram,Ti as createPmCommandOutputBudget,QT as createQueryFingerprint,vy as createRelationshipGraphScaleFixture,Q as createRelationshipGraphSnapshot,Ot as createRelationshipKindRegistry,ps as createReproducibleProcessRunner,II as createSearchCursorFingerprint,LC as createSerialQueue,CT as createStdinTokenResolver,nC as createUnknownSubcommandError,Qp as createWorkspaceSnapshot,eP as deactivateExtensionForTest,s0 as declineServiceOverride,oS as decodeContextIntentCursor,HE as decodeHtmlEntitiesInOptions,Sr as decodeMcpHttpHeaderValue,nw as decodeQueryCursor,tw as decodeQueryCursorEnvelope,rw as decodeQueryCursorState,Cw as decodeReadOutputContinuationCursor,Dk as decoratePmMcpToolsWithApps,Dl as dedupeLinkedArtifacts,xR as defaultScoreContextCandidates,p0 as defineAfterCommandHook,l0 as defineBeforeCommandHook,u0 as defineBeforeMutationHook,WN as defineCommand,t0 as defineCommandOverride,X as defineCorpusShape,tM as defineEpisodeSpecification,d0 as defineExporter,Bv as defineExtension,qv as defineExtensionBlueprint,HN as defineExtensionManifest,XN as defineFlag,c0 as defineImporter,JN as defineItemField,YN as defineItemType,ZN as defineMigration,Kg as defineObservationContract,_0 as defineOnIndexHook,m0 as defineOnReadHook,f0 as defineOnWriteHook,r0 as defineParserOverride,wi as definePmCommandOutputBudget,pv as definePmCommandOutputEnvelope,cv as definePmErrorCodeCatalog,n0 as definePreflightOverride,KN as defineProjectProfile,a0 as defineRendererOverride,QN as defineSearchProvider,o0 as defineServiceOverride,e0 as defineVectorStoreAdapter,Jg as defineVerdictContract,Se as defineWorkspaceRecipe,B_ as deleteItem,sf as deleteWorkspaceSnapshot,SC as dependencyToRelationship,Qm as deps,Nx as deriveAssuranceProposals,Hv as deriveExtensionCapabilities,fI as derivePmBulkMutationEffect,pN as derivePmRecoveryReferenceObligations,al as deriveSchemaEvolutionMigrationId,jE as deriveTelemetryCommandResolution,eE as describeAllowedTransitions,Yx as describeExtensionActivation,Kv as describeExtensionBlueprint,hu as describeItemOwnershipConflict,eM as describeObservationCost,Xt as describeProfileComposition,Yt as describeProjectProfile,wv as describeUnknownError,ko as detectAgentIdentity,Do as detectHarnessIdentity,bd as detectRelationshipCommunities,Mo as diagnoseAgentIdentity,vd as diffRelationshipAuditSnapshots,Vf as diffTestRunMeasurements,JP as digestMcpRequestParameters,PC as discoverExtensions,Kn as discoverNearbyPmRoot,sL as discoverPmTools,Ey as discoverProjectRuntimeVersionPins,Zm as docs,Vm as duplicates,Md as durableGraphCachePath,Fd as durableGraphCacheStatus,uo as effectiveItemFormatVersion,rA as emitTelemetryErrorEvent,Em as emptyImportedDocument,lO as encodeItemScalarDecisionValue,wr as encodeMcpHttpHeaderValue,ew as encodeQueryCursor,bw as encodeReadOutputContinuationCursor,LS as enforceHistoryStreamPolicyForItem,DS as enforceHistoryStreamPolicyForItems,iv as enrichCliFlagInvocationContract,tr as enrichCliFlagInvocationContracts,yA as ensureMaterializedHistoryTarget,Wc as ensurePmGitignore,El as ensureScope,FE as ensureSentryInit,Sm as ensureTrackerInitialized,gd as enumerateRelationshipPaths,Ai as estimatePmOutputTokens,wx as evaluateAssuranceAssertion,Sx as evaluateAssuranceGate,bM as evaluateBoundaryFixtures,vR as evaluateContextRanking,qO as evaluateDefectGateEvidence,Tx as evaluateMeasurement,Zi as evaluateMutationGuard,$f as evaluateProvenanceCoverage,Nf as evaluateSemanticAttributionCoverage,sp as evaluateSimilarityGovernance,QS as evaluateTransition,Zg as evaluateVerdictContract,AE as executeEmbeddingBatchesWithRetry,RE as executeVectorDelete,IE as executeVectorReset,OE as executeVectorUpsert,qg as executeWorkspaceRecipe,kl as expandAddGlobEntries,Bl as explainSourceTraceability,W_ as extension,Y_ as extensionActivate,J_ as extensionDeactivate,X_ as extensionList,_b as extensionMigrate,IO as extractHistoryMergeReceiptDispositions,RO as extractHistoryMergeReceiptReferences,Ok as extractMcpTraceContext,mA as extractPatchFailureContext,Hl as extractReferencedPmItemIdsFromCommand,Iy as federateRelationshipGraphSnapshots,Xm as files,Ym as filesDiscover,Jm as filesLookup,Vw as finalizeContextUsageDelivery,dy as findCoverageDeficits,ip as findDuplicateClusters,el as findGitWorkspaceRoot,ul as findInstalledNpmPackageCandidate,Lk as findPmMcpAppByUri,Cd as findRedundantRelationshipEdges,Sd as findRelationshipCutStructure,op as findSimilarItems,tA as finishTelemetryCommand,eC as flattenFlagListValue,sy as flushTelemetryQueue,z_ as focus,yd as forEachMatchedRelationshipEdge,Od as formatDuplicateEdgeGroup,ed as formatHierarchyRelation,xd as formatOrderingStorageContradiction,aA as formatPmPositionalActionFlagTip,bf as formatProfileApplyHuman,yf as formatProfileLintHuman,hf as formatProfileListHuman,gf as formatProfileShowHuman,ll as formatSchemaEvolutionMigrationHuman,FI as formatVectorIndexRecoveryWarnings,ZI as formatWorkspacePositionHuman,R_ as gc,Bi as generateItemId,Um as get,HC as getActiveCommandResult,Qw as getActiveContextIntentContracts,ro as getActiveExtensionRegistrations,Ik as getActiveMcpTraceContext,Ax as getAssuranceDeclaration,uh as getContracts,LT as getFocusedItem,Yn as getHistoryPath,wA as getItemAt,Xn as getItemPath,ts as getMutationActionContract,Kc as getPmGitignoreBlock,Wn as getSettingsPath,lh as getWorkspaceContracts,ki as getWorkspaceHistoryPath,e_ as graph,Nd as graphAuditBaselinePath,Lf as groupHistoryByEpisode,i0 as handleServiceOverride,BP as hasMcpClientExtension,Nk as hasPmMcpAppsCapability,qe as hasSubcommandFlagContractsForCommand,kE as hasVectorizationEmbeddingIdentityChanged,ME as hasVectorizationVectorDimensionChanged,SS as hashDocument,ES as hashDocumentForVersion,AS as hashEmptyDocument,gS as hashHistoryPatch,hS as hashHistoryRecord,yS as hashHistoryStream,uO as hashItemScalarDecisionValue,O_ as health,fd as hierarchyAncestors,md as hierarchyDescendants,k_ as historyCompact,M_ as historyCompactBulk,ox as historyEntryMatchesProvenance,Ae as historyItemHashVersionForRuntime,I_ as historyRedact,v_ as historyRepair,P_ as historyRepairAll,ZO as indexBlockedByIds,td as indexHierarchyRelations,NE as inferConsistentVectorDimension,Ci as inferPmOutputBudgetClass,r_ as init,BA as inspectCompleteListResult,AC as inspectExtensionManifestSchema,Hd as inspectHistoryAuthorStream,bO as inspectMergeReceiptEvidence,xy as inspectProjectRuntimeCompatibility,cs as inspectStaleInProgressItems,LO as inspectStatusRoleAssignments,Mi as inspectWorkspaceHistoryState,ef as inspectWorkspaceSnapshot,sl as installMergeFence,zP as interpretMcpResultType,Vu as isAlreadyClaimedError,Av as isCommanderError,uu as isErrnoError,$x as isExternalDependencyReference,Fx as isExternalDependencySourceKind,pe as isFileMissingError,sC as isHostOutputSuppressed,dO as isItemScalarMissingValue,AO as isLegacyMergeReceiptSummary,_ as isMcpRecord,Qi as isMutationAction,TC as isOrderingRelationshipKind,jS as isPlaceholderReferenceToken,Bc as isPmCliExpectedError,ui as isPmExtensionCapabilityContract,fi as isPmExtensionPolicyModeContract,mi as isPmExtensionPolicySurfaceContract,pi as isPmExtensionServiceNameContract,uI as isPmKnownExitCode,mv as isPmMutationReceipt,Ve as isPmSuccessfulExitCode,li as isPmToolAction,xO as isPreDurableCloneLocalReceiptSummary,OO as isPreDurableDispositionEligibleReference,Ay as isProjectMutatingInvocation,WE as isPureSnakeCaseAlias,Gw as isReadOutputBudgetExceeded,WT as isReadRowContract,Vd as isRuntimeRecord,JE as isTerminalPlanMode,kT as isTerminalStatus,$n as isTimestampLiteral,Dv as itemDocumentToMutationOptions,TI as itemHasSchedule,rs as jaccardSimilarity,Wm as learnings,tC as levenshteinDistanceWithinLimit,cu as limitAnnotationEntries,Jl as linkedTestTrustFingerprint,Wv as lintExtensionBlueprint,xC as lintExtensionManifestSchema,Qt as lintProjectProfile,Fm as list,Oo as listAgentProvenanceAdapters,wh as listAliasPluralKeys,jm as listAllComplete,mE as listAllDocumentCandidatesCached,Xi as listAllItemMetadata,_E as listAllItemMetadataLight,Ex as listAssuranceDeclarations,vx as listAssuranceVerdicts,ty as listBuiltinCorpusShapes,Iv as listCoreClosedDomainContracts,pR as listGetProjectionFields,sO as listInvalidProvenanceHistoryStreamIds,lR as listListProjectionFields,CO as listMergeReceipts,es as listMutationActions,zI as listMutationEvents,bn as listPmCommandFlagBudgets,Sf as listPmCommandsForFamily,wf as listPmCommandsForTier,ke as listPmFlagLexicon,BN as listPmFlagSpellingInventory,Ef as listPmMcpToolsForProfile,kN as listPmRequiredArgumentRefusalContracts,MN as listPmSubcommandRefusalContracts,Wt as listProfiles,DN as listTrackerPreflightRecoveryContracts,tf as listWorkspaceSnapshots,XA as loadContextIntentRuntimeLayers,cf as loadCreateTemplateOptions,kC as loadExtensions,Gd as loadGraphAuditBaseline,Jb as loadMutationCheckpoint,N as loadRelationshipGraphAdapter,Ki as locateItem,fT as looksLikeGenericKeyValueEntry,mw as mapReadOutputRows,TO as markMergeReceiptReconciled,JS as matchesRuntimeFilters,QE as maybeRunFirstUseTelemetryPrompt,oy as measureCorpusShapePlan,lT as mergeAdditiveTags,Vv as mergeExtensionBlueprints,pO as mergeHistoryStreams,hO as mergeItemDocuments,gO as mergeJsonDocuments,Eh as mergeLinkedTestTwoTokenEntries,fO as mergeRelationshipEventStreams,Gu as mergeSortedWarnings,YE as migrateItemFilesToFormat,bE as mutateItem,yE as mutateItemWithHistoryContext,Di as mutateWorkspaceJsonWithHistory,Bm as next,Io as normalizeAgentProvenanceAdapterValue,au as normalizeAnnotationTransportOptions,ux as normalizeAssuranceEvaluation,lx as normalizeAssuranceMutation,Ah as normalizeBootstrapInvocation,ET as normalizeBulkIdsValue,nd as normalizeDependencyGraphTarget,Vx as normalizeDependencySeedId,zx as normalizeDependencySourceKind,Jn as normalizeExtensionContributionInventory,iO as normalizeInvalidHistoryProvenance,yv as normalizeItemAddressInvocation,po as normalizeItemFormatVersion,Ui as normalizeItemId,ho as normalizeItemMetadata,Th as normalizeLegacyExtensionActionSyntax,Pl as normalizeLinkedPath,FS as normalizeParentReferenceValue,Ht as normalizeProfileName,Gi as normalizeRawItemId,Dw as normalizeReadOutputIncludeModeOptions,IS as normalizeReplayPatchOps,ns as normalizeSimilarityText,PT as normalizeStatusForRegistry,_o as normalizeStatusInput,OT as normalizeStatusInputWithRegistry,Ev as normalizeThrownExitCode,Km as notes,Dn as nowIso,Ld as openDurableGraphCache,YP as openMcpRequestState,rM as openPmEpisode,_d as orderingPredecessors,hd as orderingSuccessors,LR as packContextCandidates,Lu as packRankedContextItems,ah as packageActivate,sh as packageCatalog,ch as packageDeactivate,oh as packageDescribe,rh as packageDoctor,eh as packageInstall,Z_ as packageLifecycle,Q_ as packageList,nh as packageManage,hb as packageMigrate,ih as packageReload,th as packageUninstall,iw as paginateQueryRows,Al as parseAddEntries,xl as parseAddGlobEntries,lu as parseAnnotationTextInput,Mv as parseAtomicMutationControls,bh as parseBootstrapCommandName,hh as parseBootstrapGlobalOptions,yh as parseBootstrapHelpRequest,xh as parseBootstrapTypeValue,ST as parseBulkIdsText,Pu as parseContextDepth,Ou as parseContextFocusFields,HA as parseContextIntentDeclarations,ku as parseContextSections,jR as parseContextSignalSnapshot,pT as parseCsvKv,VO as parseDefectChangeRiskRequest,zO as parseDefectRecurrencePolicy,zp as parseEvalQuerySet,qd as parseGraphSubcommand,rx as parseHistoryProvenanceFilters,JA as parseIntegerLimit,MT as parseItemDocument,Nv as parseItemMutationBatch,WS as parseLimit,bp as parseLinkedTestAssertionEqualsMap,Cp as parseLinkedTestAssertionGteMap,fp as parseLinkedTestBoolean,mp as parseLinkedTestContextMode,pp as parseLinkedTestEnvClear,up as parseLinkedTestEnvSet,Tp as parseLinkedTestJsonEntries,yp as parseLinkedTestMinLines,gp as parseLinkedTestRegexList,hp as parseLinkedTestStringList,_p as parseLinkedTestWorkspaceContextMode,Lh as parseMcpCachePolicy,Ih as parseMcpImplementation,tt as parseMcpInputRequests,ur as parseMcpInputResponses,ig as parseMcpSubscriptionFilter,Rl as parseMigrateEntries,nR as parseMultiValueFilter,_v as parseMutationReceipt,wT as parseOptionalNonNegativeInteger,TT as parseOptionalNumber,oN as parsePmAgentTaskTranscriptCorpus,iL as parsePmToolDiscoveryOptions,ZA as parsePriority,sR as parsePriorityFilterSet,Sw as parseReadOutputSession,oT as parseRegisteredItemFieldAssignments,ce as parseRelationshipGraphSnapshot,Ol as parseRemoveEntries,Ul as parseSourceLineRange,zS as parseStatusFilterCsv,oR as parseStringFilterSet,io as parseTags,qf as parseTestRunMeasurements,QA as parseType,iR as parseTypeFilterSet,Yd as parseUnknownAuthorHistoryEventCoordinates,tI as partitionDecisionEntries,MS as patchPathToChangedField,Mn as pathExists,H_ as pauseTask,Dd as persistDurableGraphResult,tE as persistSelectedItemFormat,xI as planAgentIdentityVocabularyMutation,VR as planCompletedAtBackfill,er as planProfileApplication,cN as planRelationshipEventBackfill,Bd as planRelationshipRemediation,cl as planSchemaEvolutionMigration,Wd as planUnknownAuthorHistoryAcknowledgment,rf as planWorkspaceSnapshotRestore,lA as positionalShapeKey,uA as positionalSignatureKey,Zv as preflightExtension,is as prepareSimilarityText,hT as preserveMutationStdinTokenFields,_T as preserveMutationStdinTokenLiterals,uS as printError,lS as printResult,T_ as profile,E_ as profileApply,A_ as profileLint,w_ as profileList,S_ as profileShow,WC as projectAfterCommandItemSnapshot,Ru as projectContextFocusRows,Uf as projectFleetAttributionAnalytics,nx as projectHistoryProvenance,Oi as projectPmDiagnosticOutput,Ri as projectPmDiagnosticText,jf as projectProvenanceCoverageAnalytics,tu as projectValidateCounts,Dx as promoteAssuranceAssertion,qw as propagateContextUsageServingReceipt,AM as pruneCompileCacheGenerations,xx as putAssuranceDeclaration,Ox as putAssuranceDeclarationBundle,aE as queryItemMetadataIndex,cE as queryLinkedFileMetadataIndex,dE as querySimilarItemMetadataIndex,zf as queryTestRunMeasurementsBelow,qo as quoteCommandArg,Bo as quoteWindowsCommandArg,Rv as rankCommandPaths,du as readAnnotationEntries,No as readAuthorEnvironment,om as readBooleanOption,Jw as readContextUsageAffinity,im as readCsvListOption,hl as readExtensionMigrationState,Nn as readFileIfExists,Cs as readFirstStringFromCommanderOptions,Ts as readFirstValueFromCommanderOptions,Df as readHistoryAnalyticsWindow,GT as readHistoryEntries,If as readImprovementLedger,pE as readItemMetadataDerivedIndexState,Wi as readLocatedItem,pw as readOutputBudgetCollections,yw as readOutputCollectionFingerprint,uw as readOutputContinuationRowCollections,dw as readOutputContinuationRowPaths,Nw as readOutputIncludeModeOptions,lw as readOutputRowCollections,cw as readOutputRowPaths,xw as readOutputSessionRemainingTokens,Ft as readPmPackageManifest,ph as readRequiredString,qi as readSettings,rE as readSettingsWithMetadata,ws as readStringArrayFromCommanderOptions,nm as readStringOption,Sv as readThrownExitCode,LE as readVectorizationStatusLedger,KA as readWorkspaceContextIntentContracts,qR as readWorkspaceContextSignals,WR as readWorkspaceMemory,JI as readWorkspacePosition,kS as reanchorHistoryEntries,to as reconcileExtensionCapabilityUsage,Fi as reconcileWorkspaceJsonHistory,KC as recordAfterCommandAffectedItem,Ix as recordAssuranceVerdict,wu as recordClaimSemanticAttribution,Ww as recordContextUsageDelivery,Kw as recordContextUsageServing,Xw as recordContextUsageTouch,Yw as recordContextUsageTouches,Eu as recordFocusSemanticAttribution,Rf as recordImprovementObservation,Su as recordReleaseSemanticAttribution,fE as refreshItemMetadataDerivedIndex,ol as refreshMergeAttributeFenceIfInstalled,$E as refreshSearchArtifactsForMutation,Ro as registerAgentProvenanceAdapters,Bx as registerExternalDependencyResolver,xo as registerHarnessSignalDescriptors,UT as registerOutputMaterialFieldGroups,G_ as release,Rx as removeAssuranceDeclaration,Ln as removeFileIfExists,jl as renameArtifactsResultKey,yu as renderCalendarMarkdown,bu as renderCalendarToon,Uu as renderContextMarkdown,ml as renderExtensionDescribeMarkdown,pl as renderExtensionSurfaceMarkdown,Rm as renderGuideMarkdown,Tv as renderMissingOptionRetry,rI as renderNextMarkdown,vv as renderPmClosedDomainHelp,zo as renderPmCommand,Wo as renderPmCommandAliasMigrationHint,Of as renderPmCommandVisibilityMarkdown,zN as renderPmFlagLexiconMarkdown,$k as renderPmMcpAppHtml,TN as renderPmRefusalClosureCensusMarkdown,HS as renderRowsAsCsv,KS as renderRowsAsTable,D_ as reopen,gA as replayHistoryToTarget,OS as replayToCanonicalItemDocument,xS as replayToItemDocument,iI as requireTerminalReason,sI as requireTerminalReasonWithRecovery,TS as resealHistoryRewrite,qC as resetActiveExtensionRuntimeState,ud as resetWorkspaceGraphCache,To as resolveAgentSessionContextFromSignals,_u as resolveAnnotationIndex,pu as resolveAnnotationInput,jT as resolveAuthor,$o as resolveAuthorIdentity,$S as resolveBodyFileContent,ry as resolveBuiltinCorpusShape,gu as resolveCalendarOutputFormat,dv as resolveCanonicalPmErrorCodeContract,CC as resolveCanonicalRelationshipKind,FT as resolveClaimPrincipal,AT as resolveCliBulkIdsInput,_C as resolveCommandOptionPolicyState,EM as resolveCompileCacheGeneration,zR as resolveCompletionTimestamp,dC as resolveConfiguredPmPackageRoot,mR as resolveContentFieldFilters,rS as resolveContextIntentContract,Iu as resolveContextOutputFormat,vu as resolveContextTokenBudget,hI as resolveCreateExplicitEmptyFlag,CE as resolveEmbeddingProviders,Cl as resolveExtensionInstallSourceIdentity,_l as resolveExtensionMigrationStatePath,vC as resolveExtensionRoots,qx as resolveExternalDependencyReference,Qb as resolveFlagValueKind,xm as resolveGuideOutputFormat,vf as resolveHistoryEpisodeGroupIdentity,tx as resolveHistoryProvenanceDimensions,bA as resolveHistorySubject,_A as resolveHistoryTarget,MI as resolveHybridSemanticWeight,Hn as resolveImplicitPmRoot,Wb as resolveIsoOrRelative,eR as resolveItemBlockers,Lv as resolveItemMutationDocument,Vn as resolveItemTypeRegistry,xT as resolveItemTypesFilePath,Qf as resolveLinkedTestFailureExitCode,Kl as resolveLinkedTestSourceRef,Wl as resolveLinkedTestSourceWorkspaceRoot,Zl as resolveLinkedTestTrust,Ql as resolveLinkedTestTrustBatch,sg as resolveMcpAcknowledgedSubscriptionFilter,Je as resolveMcpRequestContext,Qd as resolveMergeInstallContext,fR as resolveMissingMetadataFilters,Cv as resolveMissingOptionPlaceholder,KT as resolveModePairedOutputOmissionReceipt,QR as resolveNextOutputFormat,YT as resolveOutputOmissionReceipt,cC as resolvePmCliVersion,Ko as resolvePmCommandAlias,We as resolvePmCommandCapabilityFamily,Bt as resolvePmCommandExitContract,Ei as resolvePmCommandOutputBudget,nr as resolvePmCommandOutputEnvelope,iA as resolvePmCommandPositionalContract,Xe as resolvePmCommandVisibilityTier,xi as resolvePmDiagnosticOutputBudget,lv as resolvePmErrorCodeContract,ub as resolvePmFlagSemanticConcept,aC as resolvePmPackageRootFromModule,sA as resolvePmPositionalActionContract,Oc as resolvePmPositionalActionFlagContracts,De as resolvePmRoot,vc as resolvePmToolCustomFieldCollision,BS as resolvePriority,Kt as resolveProfile,rl as resolveProjectMergeTypeFolders,ow as resolveQueryCursorStart,$w as resolveReadOutputDimensions,Uw as resolveReadOutputEncoding,hw as resolveReadOutputRecoveryBudget,kw as resolveReadOutputSurface,XT as resolveReadRowContract,bv as resolveRecoveryCommandName,sT as resolveRegisteredSearchProvider,aT as resolveRegisteredVectorStoreAdapter,us as resolveReproducibleProcessEnvironment,ao as resolveRuntimeFieldRegistry,so as resolveRuntimeStatusRegistry,TE as resolveSearchCorpusFields,PI as resolveSearchMaxResults,vI as resolveSearchPage,kI as resolveSearchScoreThreshold,NI as resolveSearchTuning,SE as resolveSemanticCorpusCharacterLimit,Tu as resolveSemanticLineageIds,oE as resolveSettingsWithSemanticRuntimeDefaults,Qx as resolveSourceContextWritePolicy,Cf as resolveStartTaskInProgressStatus,te as resolveSubcommandFlagContractsForCommand,Bb as resolveTelemetryErrorCategory,oI as resolveTerminalReason,mC as resolveTypeDefinition,fC as resolveTypeName,VS as resolveTypeSynonym,ZS as resolveTypeWorkflows,Xd as resolveUnknownAuthorAcknowledgmentSelector,$I as resolveVectorIndexRecovery,xE as resolveVectorStores,Jc as resolveWorkspaceRelationshipKindRegistry,gC as resolveWorkspaceRoot,q_ as restore,Zb as restoreCheckpointItems,ji as restoreWorkspaceJsonFromHistory,of as restoreWorkspaceSnapshot,nf as restoreWorkspaceSnapshotWithRecovery,mh as runAction,JC as runActiveBeforeMutationHooks,QC as runActiveCommandHandler,ZC as runActiveOnIndexHooks,oo as runActiveOnReadHooks,no as runActiveOnWriteHooks,eT as runActiveParserOverride,tT as runActivePreflightOverride,rT as runActiveServiceOverride,Yc as runActivity,IC as runAfterCommandHooks,iu as runAggregate,mu as runAnnotationCommand,su as runAppend,WO as runAssuranceAction,XO as runAssuranceDispatch,RC as runBeforeCommandHooks,Cu as runCalendar,Hu as runClaim,Ku as runClaimNext,Yu as runClose,Zu as runCloseMany,Qu as runComments,Im as runCompletion,Mp as runConfig,Ut as runContext,MR as runContextEvaluationCorpus,PR as runContextEvaluationScenario,Rp as runCopy,wp as runCreate,Ip as runDelete,pd as runDeps,Gl as runDocs,hv as runDuplicates,Kp as runEval,Xp as runEvent,Tl as runExtension,bl as runExtensionMigrateAction,yl as runExtensionMigrations,ql as runFiles,Vl as runFilesDiscover,zl as runFilesLookup,Gf as runFleetAttributionAnalytics,vp as runFocus,kp as runGc,Pp as runGet,zd as runGraph,Om as runGuide,wl as runHealth,mI as runHistory,ev as runHistoryCompact,nv as runHistoryCompactBulk,CA as runHistoryRedact,kO as runHistoryRepair,NO as runHistoryRepairAll,Gp as runInit,$p as runInitAgentGuidance,ep as runLearnings,Fl as runLinkedArtifacts,em as runLinkedTests,ou as runList,Wp as runMeet,UI as runMergeDriver,il as runMergeInstall,SO as runMergeReceiptEvidenceReport,wO as runMergeReceiptReport,BI as runMergeReconcile,zu as runNext,tp as runNotes,Op as runPlan,_f as runProfileApply,mf as runProfileLint,pf as runProfileList,ff as runProfileShow,Ff as runProvenanceCoverageAnalytics,tP as runRegisteredCommandForTest,sP as runRegisteredCommandOverrideForTest,fP as runRegisteredExporterForTest,nP as runRegisteredHookForTest,pP as runRegisteredImporterForTest,uP as runRegisteredMigrationForTest,rP as runRegisteredMutationGuardForTest,oP as runRegisteredParserOverrideForTest,iP as runRegisteredPreflightOverrideForTest,aP as runRegisteredRendererOverrideForTest,dP as runRegisteredSearchProviderForTest,cP as runRegisteredServiceOverrideForTest,lP as runRegisteredVectorStoreAdapterForTest,or as runReindex,Wu as runRelease,Yp as runRemind,ov as runReopen,Ju as runRestore,dl as runSchemaEvolutionMigration,Vp as runSearch,iy as runSearchRefreshWorkerEntrypoint,vm as runStartBackgroundRun,Hf as runStats,Wf as runTelemetry,lf as runTemplatesList,df as runTemplatesSave,uf as runTemplatesShow,tm as runTest,rm as runTestAll,Pm as runTestRunsList,Mm as runTestRunsLogs,Lm as runTestRunsResume,km as runTestRunsStatus,Nm as runTestRunsStop,Dm as runTestRunsWorker,Sp as runUpdate,Ep as runUpdateMany,qt as runUpgrade,nu as runValidate,fh as runWithActiveExtensions,D as runWithAgentSessionContext,eS as runWithContextIntentContracts,YA as runWithDiscoveredContextIntentContracts,vo as runWithHarnessDetectionSignals,Rk as runWithMcpTraceContext,fs as runWithReproducibleProcessEnvironment,Po as runWithWorkspaceHarnessSignalDescriptors,Kr as runWithWorkspaceRecipe,EI as runWorkspaceTransactionGc,Ud as saveGraphAuditBaseline,Kx as scanExtensionHostVersions,Kd as scanHistoryAuthorAttribution,mo as scanItemFormatVersions,Ji as scanMutationSecrets,aO as scanProvenanceResolverHealth,ds as scanStaleInProgressItems,$O as scanStorageIntegrity,o_ as schema,u_ as schemaAddField,d_ as schemaAddStatus,a_ as schemaAddType,__ as schemaApplyPreset,h_ as schemaInferTypes,i_ as schemaList,f_ as schemaListFields,b_ as schemaRemapStatus,p_ as schemaRemoveField,l_ as schemaRemoveStatus,c_ as schemaRemoveType,y_ as schemaRenameField,g_ as schemaRenameType,s_ as schemaShow,m_ as schemaShowField,C_ as schemaShowStatus,Ov as scoreCommandPathMatch,OR as scoreContextCandidates,RR as scoreContextCandidatesWithActiveExtensions,ss as scoreItemSimilarity,NN as scorePmGrammarRefusalClosure,EN as scorePmRefusalClosure,as as scorePreparedItemSimilarity,$N as scoreTrackerPreflightRecoveryClosure,bS as sealHistoryRecord,XP as sealMcpRequestState,Gm as search,JR as searchWorkspaceMemory,ZR as searchWorkspaceMemoryReadResult,ZT as selectCursorSemanticOptions,wm as selectImportAuthor,Sk as selectMcpClientRegistrationMode,YR as selectWorkspaceMemory,XR as selectWorkspaceMemoryRollups,xu as semanticAttributionAffinity,qE as sentryCaptureCliError,BE as sentryFinishCommandSpan,VE as sentryFlush,zE as sentryLogCliUsageError,GE as sentrySetCommandContext,UE as sentryStartCommandSpan,yo as serializeItemDocument,Pv as serializeNdjsonRows,kv as serializeNdjsonStream,Wg as serveDeclaredObservation,zC as setActiveCommandContext,VC as setActiveCommandResult,$C as setActiveExtensionCommands,DC as setActiveExtensionHooks,FC as setActiveExtensionParsers,jC as setActiveExtensionPreflight,BC as setActiveExtensionRegistrations,UC as setActiveExtensionRenderers,GC as setActiveExtensionServices,DT as setFocusedItem,ZE as shouldCompletePlanOnClose,jd as shouldPersistDurableGraphCache,bT as shouldResolveMutationStdinTokenField,yT as shouldResolveMutationStdinTokens,sE as shouldRunSearchRefreshInForeground,np as similarityAdvisoryWarnings,aw as sliceReadOutputRowCollection,Ll as sortLinkedArtifacts,cT as splitAcceptanceCriteria,XE as splitCommaList,go as splitFrontMatter,Fw as stabilizeReadOutputReceiptEstimates,v as stableStringify,OC as stableValueEquals,V_ as startTask,eA as startTelemetryCommand,zm as stats,RT as statusIsTerminal,gh as stripGlobalBootstrapTokens,VI as subscribeMutationEventBatches,HI as subscribeMutationEvents,AI as summarizeAgentIdentityVocabulary,kf as summarizeAgentModelProvenance,Mf as summarizeAgentProvenance,kR as summarizeContextEvaluationReports,Xf as summarizeContextPreflight,sx as summarizeHistoryProvenance,Fp as summarizeInitResult,yO as summarizeMergeReceipt,gI as supportsCreateExplicitEmpty,gv as supportsItemIdAlias,iC as suppressHostOutput,Ie as syncRelationshipGraphAdapter,Xv as synthesizeExtensionManifest,Rc as toCompletionFlagString,ju as toContextFocusItem,Du as toContextPackingSummary,$u as toContextRankingSummary,zb as toErrorMessage,am as toEstimatedMinutesValue,DA as toExtensionFlagDefinitions,pm as toImportBoolean,hm as toImportConfidence,um as toImportInteger,Cm as toImportLinkedDocs,bm as toImportLinkedFiles,Tm as toImportLinkedTests,ym as toImportLogEntries,gm as toImportNormalizedEnum,_m as toImportNumberMap,cm as toImportPriority,lm as toImportStatus,fm as toImportStringList,mm as toImportStringMap,dm as toImportTags,NT as toItemRecord,sm as toNonEmptyImportString,qb as toNonEmptyStringOrUndefined,RS as toReplayDocument,os as tokenizeSimilarityText,gT as transferMutationStdinTokenPolicy,XI as translateHostEnvironmentFault,L_ as update,dh as upgrade,x_ as validate,gx as validateAssertionDefinition,bx as validateAssuranceDocument,yx as validateGateDefinition,$v as validateItemMutationRows,$l as validateLinkedPaths,Ek as validateMcpAuthorizationResponseIssuer,wk as validateMcpAuthorizationServerMetadata,Ak as validateMcpClientMetadataDocument,mk as validateMcpHttpRequestHeaders,QP as validateMcpJsonSchema,hx as validateMeasurementDefinition,GS as validateMissingParentReference,Mw as validateReadOutputOptions,qS as validateSprintOrReleaseValue,hC as validateTypeOptions,sv as verifyCliFlagInvocationParity,dA as verifyExplicitPositionalSlotCensus,PS as verifyHistoryChain,vS as verifyHistoryChainWithVersion,TA as verifyHistoryEntries,CS as verifyHistoryRecordHash,wS as verifyHistoryRewriteEvidence,fA as verifyPmCliGrammar,pA as verifyPmCommandPositionalContracts,qN as verifyPmFlagLexicon,_N as verifyPmRecoveryKindRuntimeCoverage,tb as verifyPmRecoveryProducerRuntimeCoverage,mN as verifyPmRecoveryReferences,bN as verifyPmRefusalClosureIdentityRatchet,yN as verifyPmRefusalClosureRatchet,fN as verifyPmRefusalReachability,Is as verifyToolOptionCliParity,Ks as withFlagAliasMetadata,YI as withHostEnvironmentBoundary,ZP as withMcpCachePolicy,ld as workspaceGraphCache,fu as wrapOwnershipConflict,xv as wrapThrownErrorForSentry,Lo as writeAuthorEnvironment,Le as writeFileAtomic,Yb as writeMutationCheckpoint,nE as writeSettings,dS as writeStdout,DE as writeVectorizationStatusLedger,$i as writeWorkspaceJsonWithHistory};
|
|
33
33
|
//# sourceMappingURL=sdk.js.map
|