@unbrained/pm-cli 2026.9.2 → 2026.9.3
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 +17 -0
- package/dist/cli/after-command-context-usage.js +16 -3
- package/dist/cli-bundle/bundle-manifest.json +154 -154
- package/dist/cli-bundle/chunks/{chunk-T6H5BZCP.js → chunk-34HASX3S.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-AY324UJ5.js +9 -0
- package/dist/cli-bundle/chunks/{chunk-TAG4VC22.js → chunk-DKGP3QLE.js} +27 -27
- package/dist/cli-bundle/chunks/chunk-E5RBBCXO.js +230 -0
- package/dist/cli-bundle/chunks/{chunk-DTGWEL23.js → chunk-EDPIS7EB.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-X4RCGLTX.js → chunk-IEHHE6GA.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-UDW64J2W.js → chunk-L7B7343B.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-FZ4Z2J4F.js → chunk-LENC656S.js} +41 -41
- package/dist/cli-bundle/chunks/{chunk-ZLJIFSOE.js → chunk-LISESA7W.js} +33 -33
- package/dist/cli-bundle/chunks/{chunk-3WICXLVT.js → chunk-UPPM2FOZ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-Y7VOMSZT.js → chunk-Y4PJ6HPK.js} +2 -2
- package/dist/cli-bundle/chunks/{register-list-query-XYNX4ASQ.js → register-list-query-W2ZTOMKP.js} +2 -2
- package/dist/cli-bundle/chunks/{register-mutation-WFQ7MJTX.js → register-mutation-RVND5NCG.js} +2 -2
- package/dist/cli-bundle/chunks/{register-operations-JVTI7JPP.js → register-operations-TTROIVC4.js} +2 -2
- package/dist/cli-bundle/chunks/{register-setup-KVNC5KPL.js → register-setup-D3ZFHY3L.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-3ZBI35HU.js +176 -0
- package/dist/cli-bundle/focused-chunks/{chunk-SVXJYD6G.js → chunk-4HJFY4MB.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-4RRHC3S4.js +6 -0
- package/dist/cli-bundle/focused-chunks/chunk-4WR46RMG.js +9 -0
- package/dist/cli-bundle/focused-chunks/chunk-5RFXUPN5.js +3 -0
- package/dist/cli-bundle/focused-chunks/chunk-BWKHEIVF.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-4O4CJAR6.js → chunk-D7KXFBXV.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-MKHG3T76.js → chunk-GHCZ3YFR.js} +3 -3
- package/dist/cli-bundle/focused-chunks/{chunk-KB5OFSFD.js → chunk-GT7MXDLW.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-KBLZRU62.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-KZ2NB3ET.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-M5M6SVHS.js +3 -0
- package/dist/cli-bundle/focused-chunks/{chunk-BEVHCEWG.js → chunk-OL5EH6I3.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-MEASX544.js → chunk-Q45NHPF2.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-O67VDLOT.js → chunk-QKHCSUGJ.js} +42 -42
- package/dist/cli-bundle/focused-chunks/chunk-S27XMBIN.js +8 -0
- package/dist/cli-bundle/focused-chunks/chunk-TXE4TSHM.js +12 -0
- package/dist/cli-bundle/focused-chunks/chunk-UCLO3XDU.js +2 -0
- package/dist/cli-bundle/main.js +15 -15
- 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 -28
- 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 +35 -33
- package/dist/cli-bundle/sdk-query.js +1 -1
- package/dist/cli-bundle/sdk-runtime.js +1 -1
- package/dist/cli-bundle/sdk-testing.js +1 -1
- package/dist/cli-bundle/sdk.js +9 -9
- package/dist/core/history/event-classification.d.ts +21 -0
- package/dist/core/history/event-classification.js +109 -0
- package/dist/core/history/event-index.d.ts +14 -3
- package/dist/core/history/event-index.js +543 -88
- package/dist/core/history/history.js +47 -18
- package/dist/core/history/workspace-history.js +7 -6
- package/dist/core/lock/lock.d.ts +22 -2
- package/dist/core/lock/lock.js +121 -19
- package/dist/core/output/output.js +31 -7
- package/dist/core/shared/time.d.ts +2 -0
- package/dist/core/shared/time.js +8 -2
- package/dist/core/store/item-metadata-query-index.js +5 -5
- package/dist/sdk/context/recency.d.ts +9 -0
- package/dist/sdk/context/recency.js +34 -0
- package/dist/sdk/context/usage-egress.d.ts +9 -0
- package/dist/sdk/context/usage-egress.js +30 -0
- package/dist/sdk/context-intent-contracts.js +7 -3
- package/dist/sdk/context-relevance.d.ts +23 -0
- package/dist/sdk/context-relevance.js +94 -23
- package/dist/sdk/context-signal-store.d.ts +7 -3
- package/dist/sdk/context-signal-store.js +155 -42
- package/dist/sdk/context-usage.d.ts +54 -0
- package/dist/sdk/context-usage.js +245 -16
- package/dist/sdk/generated/generated-error-code-catalog-part-1.js +14 -14
- package/dist/sdk/generated/generated-error-code-catalog-part-2.js +14 -2
- package/dist/sdk/index.d.ts +2 -0
- package/dist/sdk/index.js +4 -2
- package/dist/sdk/init.d.ts +2 -0
- package/dist/sdk/init.js +18 -9
- package/dist/sdk/query/context.d.ts +3 -1
- package/dist/sdk/query/context.js +21 -9
- package/dist/sdk/query/next.js +18 -9
- package/dist/sdk/runtime-input.d.ts +2 -0
- package/dist/sdk/runtime-input.js +25 -2
- package/dist/sdk/runtime.d.ts +1 -0
- package/dist/sdk/runtime.js +17 -26
- package/dist/types.d.ts +2 -0
- package/dist/types.js +2 -2
- package/docs/CONTEXT_RELEVANCE.md +44 -1
- package/docs/PERFORMANCE.md +6 -3
- package/docs/READ_OUTPUT_CONTRACTS.md +9 -1
- package/docs/SDK.md +11 -8
- package/docs/SDK_CONTEXT.md +7 -0
- package/docs/generated/REFUSAL_CLOSURE_CENSUS.md +4 -3
- package/marketplace.json +2 -2
- package/package.json +4 -4
- 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 +241 -24
- package/dist/cli-bundle/chunks/chunk-GOACULJW.js +0 -13
- package/dist/cli-bundle/chunks/chunk-NOPL37X4.js +0 -205
- package/dist/cli-bundle/focused-chunks/chunk-242AXYB2.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-2FEZ5SKM.js +0 -3
- package/dist/cli-bundle/focused-chunks/chunk-6GCRSLPG.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-7VATS5QY.js +0 -16
- package/dist/cli-bundle/focused-chunks/chunk-JEFKLWMM.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-PF3E6Q36.js +0 -8
- package/dist/cli-bundle/focused-chunks/chunk-QDFJIRKN.js +0 -4
- package/dist/cli-bundle/focused-chunks/chunk-RMRCQPWU.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-S4U5CN5Q.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-T2LXXSOD.js +0 -158
- package/dist/cli-bundle/focused-chunks/chunk-Z2USIBR2.js +0 -5
package/dist/cli-bundle/sdk.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{A as wI,B as ph,C as fh,D as EI,E as AI,a as Xi,b as Yi,c as Ji,d as Zi,e as mI,f as _I,g as Yt,h as th,i as rh,j as nh,l as oh,m as ih,n as sh,o as ah,p as ch,q as dh,r as uh,s as lh,t as hI,u as gI,v as yI,w as bI,x as CI,y as TI,z as SI}from"./chunks/chunk-DTGWEL23.js";import{A as lP,B as pP,C as fP,D as mP,E as _P,F as hP,G as gP,H as yP,I as bP,J as CP,K as TP,L as SP,M as wP,N as EP,O as AP,P as xP,Q as RP,R as OP,S as IP,T as PP,U as MP,V as kP,W as vP,X as NP,Y as LP,a as GI,b as UI,c as jI,d as BI,e as qI,f as zI,g as VI,h as HI,i as KI,j as WI,k as XI,l as YI,m as JI,n as ZI,o as QI,p as eP,q as tP,r as rP,s as nP,t as oP,u as iP,v as sP,w as aP,x as cP,y as dP,z as uP}from"./chunks/chunk-UDW64J2W.js";import{a as xI,b as RI,c as OI,d as II}from"./chunks/chunk-3WICXLVT.js";import{a as PI,b as MI,c as kI,d as vI,e as NI,f as LI,g as DI,h as $I,i as FI}from"./chunks/chunk-T6H5BZCP.js";import{$ as Ft,$a as Xt,$b as C_,A as tA,Aa as Bf,Ab as Km,Ac as K_,B as Vu,Ba as qf,Bb as Wm,Bc as W_,C as Dl,Ca as zf,Cb as Xm,Cc as X_,D as $l,Da as Vf,Db as Ym,Dc as Y_,E as Fl,Ea as Hf,Eb as Jm,Ec as J_,F as Gl,Fa as Kf,Fb as Zm,Fc as Z_,G as Ul,Ga as Wf,Gb as Qm,Gc as Q_,H as dp,Ha as Xf,Hb as e_,Hc as eh,I as Fe,Ia as Yf,Ib as t_,J as up,Ja as Jf,Jb as r_,K as lp,Ka as Zf,Kb as n_,L as pp,La as Qf,Lb as o_,M as fp,Ma as em,Mb as i_,N as mp,Na as tm,Nb as s_,O as _p,Oa as rm,Ob as a_,P as MO,Pa as nm,Pb as c_,Q as kO,Qa as om,Qb as d_,R as vO,Ra as im,Rb as u_,S as NO,Sa as sm,Sb as l_,T as LO,Ta as am,Tb as p_,U as DO,Ua as cm,Ub as f_,V as $O,Va as dm,Vb as m_,W as FO,Wa as um,Wb as __,X as GO,Xa as lm,Xb as h_,Y as Lt,Ya as pm,Yb as g_,Z as Dt,Za as fm,Zb as y_,_ as $t,_a as mm,_b as b_,a as Ac,aa as Gt,ab as ae,ac as T_,b as xc,ba as Ut,bb as Sm,bc as S_,c as Rc,ca as jt,cb as wm,cc as w_,d as OE,da as Bt,db as Em,dc as E_,e as IE,ea as qt,eb as Am,ec as A_,f as Ic,fa as zt,fb as xm,fc as x_,g as DE,ga as Vt,gb as Rm,gc as R_,h as $E,ha as Vp,hb as Om,hc as O_,i as FE,ia as Hp,ib as Im,ic as I_,j as GE,ja as Kp,jb as Pm,jc as P_,k as UE,ka as Wp,kb as Mm,kc as M_,l as jE,la as Xp,lb as km,lc as k_,m as BE,ma as Ge,mb as vm,mc as v_,n as qE,na as Yp,nb as Nm,nc as N_,o as zE,oa as Jp,ob as Lm,oc as L_,p as VE,pa as Zp,pb as Dm,pc as D_,q as HE,qa as Qp,qb as $m,qc as $_,r as KE,ra as ef,rb as Fm,rc as F_,s as WE,sa as tf,sb as Gm,sc as G_,t as XE,ta as rf,tb as Um,tc as U_,u as Nc,ua as nf,ub as jm,uc as j_,v as YE,va as JO,vb as Bm,vc as B_,w as JE,wa as ZO,wb as qm,wc as q_,x as ZE,xa as QO,xb as zm,xc as z_,y as QE,ya as eI,yb as Vm,yc as V_,z as eA,za as tI,zb as Hm,zc as H_}from"./chunks/chunk-FZ4Z2J4F.js";import{a as Nt,f as hO,g as gO,h as yp,i as bp}from"./chunks/chunk-Y7VOMSZT.js";import{A as IO,B as PO,C as Pp,D as Mp,E as kp,b as zu,c as cR,d as iO,e as dO,f as uO,g as lO,h as pO,i as fO,j as hp,k as mO,l as xp,m as Rp,n as Op,o as Ip,p as yO,q as bO,r as CO,s as TO,t as SO,u as wO,v as EO,w as AO,x as xO,y as RO,z as OO}from"./chunks/chunk-X4RCGLTX.js";import{$ as QA,$a as Lu,$b as ql,$d as gm,A as FA,Aa as Ax,Ab as Zu,Ac as gp,Ad as yf,B as GA,Ba as du,Bb as Qu,Bc as vp,Bd as bf,C as UA,Ca as uu,Cb as el,Cc as Np,Cd as Cf,D as jA,Da as lu,Db as tl,Dc as Lp,Dd as Tf,E as ZA,Ea as pu,Eb as Pl,Ec as VO,Ed as Sf,Fa as fu,Fb as Ml,Fc as HO,Fd as wf,Ga as mu,Gb as kl,Gc as KO,Gd as Ef,Ha as _u,Hb as vl,Hc as Dp,Hd as Af,Ia as hu,Ib as WR,Ic as $p,Id as xf,J as Pd,Ja as gu,Jb as XR,Jc as Fp,Jd as Rf,Ka as yu,Kb as YR,Kc as Gp,Kd as Of,La as bu,Lb as JR,Lc as Up,Ld as If,Ma as Cu,Mb as ZR,Mc as jp,Md as Pf,Na as Tu,Nb as Nl,Nc as Bp,Nd as Mf,Oa as Su,Ob as Ll,Oc as qp,Od as fI,Pa as wu,Pb as QR,Pc as zp,Pd as kf,Qa as Eu,Qb as eO,Qc as WO,Qd as vf,Ra as Au,Rb as tO,Rc as XO,Rd as Nf,Sa as xu,Sb as $e,Sc as YO,Sd as Lf,Ta as Ru,Tb as rO,Tc as of,Td as Df,Ua as Ou,Ub as vt,Uc as rI,Ud as $f,Va as Iu,Vb as nO,Vc as Ht,Vd as Ff,Wa as Pu,Wb as oO,Wc as nI,Wd as Gf,Xa as Mu,Xc as Ue,Xd as Uf,Ya as ku,Yb as jl,Yc as Y,Yd as jf,Za as vu,Zb as Bl,Zc as sf,Zd as _m,_a as Nu,_b as sO,_d as hm,a as pA,aa as ex,ab as Du,ac as zl,ad as je,ae as ym,b as fA,ba as Md,bb as $u,bc as Vl,bd as af,be as bm,c as mA,ca as kd,cb as Fu,cc as Hl,cd as cf,ce as Cm,d as _A,da as vd,db as Gu,dc as Kl,de as Tm,e as hA,ea as Nd,eb as Uu,ec as Wl,ed as se,f as gA,fa as Ld,fb as ju,fc as Xl,fd as df,g as yA,ga as Dd,gb as Bu,gc as Yl,gd as uf,h as bA,ha as $d,hb as xx,hc as Jl,hd as lf,i as CA,ia as ux,ib as Rx,ic as Zl,id as pf,j as TA,ja as lx,jb as Ox,jc as Ql,jd as oI,k as SA,ka as px,kb as Ix,kc as ep,kd as iI,l as wA,la as fx,lb as Px,lc as tp,ld as sI,m as EA,mb as Mx,mc as rp,md as aI,n as AA,na as mx,nb as kx,nc as np,nd as cI,o as xA,oa as _x,ob as vx,oc as op,od as Kt,p as RA,pa as hx,pb as Nx,pc as ip,pd as dI,q as OA,qa as gx,qb as Lx,qc as sp,qd as uI,r as IA,ra as yx,rb as Dx,rc as aO,rd as Wt,s as PA,sa as bx,sb as $x,sc as cO,sd as lI,t as MA,ta as Cx,tb as Hu,tc as ap,td as pI,u as kA,ua as Tx,ub as Ku,v as vA,va as Sx,vb as Wu,vd as ff,w as NA,wa as wx,wb as Xu,wd as mf,x as LA,xa as Ex,xb as Yu,xc as cp,xd as _f,y as DA,ya as au,yd as hf,z as $A,za as cu,zb as Ju,zc as _O,zd as gf}from"./chunks/chunk-ZLJIFSOE.js";import{Ba as eu,Ca as tu,Da as ru,Ea as nu,Fa as ou,H as Hd,Ha as iu,I as Kd,Ia as su,J as Wd,Ja as Cp,K as Xd,Ka as Tp,L as xt,La as Sp,Ma as wp,Na as Ep,Oa as Ap,a as NE,b as LE,c as Pc,d as Mc,f as kc,g as vc,h as tx,i as rx,j as nx,k as ox,l as ix,m as sx,n as ax,o as cx,oa as Rt,p as Fd,pa as Ot,q as Gd,qa as It,r as Ud,ra as Pt,s as jd,sa as Yd,t as Bd,u as dx,ua as Jd,v as qd,va as Zd,w as zd,wa as Qd,x as Vd}from"./chunks/chunk-TAG4VC22.js";import{$ as JA,$a as Xx,$b as qR,Aa as wd,Ab as hR,Ac as VR,B as Lc,Ba as Ed,Bb as gR,Bc as HR,C as BA,Ca as Ad,Cb as yR,Cc as Il,D as qA,Da as xd,Db as bR,Dc as KR,E as zA,Ea as Rd,Eb as CR,Ec as UO,F as VA,Fa as Od,Fb as TR,Fc as jO,G as HA,Ga as Id,Gb as SR,Gc as BO,H as KA,Hb as wR,Hc as qO,I as WA,Ia as Fx,Ib as ER,Ic as zO,J as XA,Ja as Gx,Jb as AR,K as YA,Ka as Ux,Kb as xR,L as Dc,La as jx,Lb as RR,M as $c,Ma as Bx,Mb as OR,N as Fc,Na as qx,Nb as IR,O as Gc,Oa as zx,Ob as PR,P as Uc,Pa as Vx,Pb as MR,Q as jc,Qa as Hx,Qb as kR,R as Bc,Ra as Kx,Rb as vR,S as qc,Sa as Wx,Sb as NR,T as zc,Tb as LR,U as Vc,Ub as DR,V as Hc,Vb as $R,W as De,Wb as FR,X as Kc,Xb as GR,Y as Wc,Yb as UR,Z as Xc,Zb as jR,_ as Yc,_b as BR,a as bE,aa as Jc,ab as Yx,ac as sl,b as CE,ba as Zc,bb as Jx,bc as al,c as TE,ca as Qc,cb as Zx,cc as cl,d as SE,da as ed,db as Qx,dc as dl,e as wE,ea as td,eb as eR,ec as ul,fa as rd,fc as ll,ga as nd,gc as Mt,h as EE,ha as od,hb as tR,hc as pl,i as AE,ia as id,ib as rR,ic as fl,j as Oc,ja as sd,jb as nR,jc as ml,k as xE,ka as ad,kb as oR,kc as _l,l as RE,la as cd,lb as iR,lc as hl,m as PE,ma as dd,mb as sR,mc as gl,n as ME,na as ud,nb as aR,nc as yl,o as kE,oa as ld,ob as qu,oc as bl,p as vE,pa as pd,pb as rl,pc as Cl,q as rA,qa as fd,qb as nl,qc as Tl,r as nA,ra as md,rb as ol,rc as Sl,s as oA,sa as _d,sb as il,sc as wl,t as iA,ta as hd,tb as dR,tc as El,u as sA,ua as gd,ub as uR,uc as Al,v as aA,va as yd,vb as lR,vc as xl,w as cA,wa as bd,wb as pR,wc as Rl,x as dA,xa as Cd,xb as fR,xc as kt,y as uA,ya as Td,yb as mR,yc as Ol,z as lA,za as Sd,zb as _R,zc as zR}from"./chunks/chunk-GOACULJW.js";import{$ as Eb,$c as Kn,$d as uo,$e as PT,$f as zT,$g as NS,$h as nw,$i as $w,$j as cs,$k as Ws,$l as Wa,Ac as zn,Ad as JC,Ae as lT,Af as qo,Ag as gS,Ai as Ni,Aj as Hi,Ak as uE,Al as Ta,Am as yc,B as pb,Bc as mC,Bf as zo,Bg as yS,Bh as qS,Bi as Cw,Bj as Ki,Bk as lE,Bl as Sa,Bm as bc,C as F,Cc as _C,Cd as Wn,Cf as Vo,Cg as bS,Ch as zS,Cj as Wi,Ck as pE,Cl as wa,Cm as Cc,D as fb,Dc as hC,Dd as ZC,Df as Ho,Dg as CS,Dh as VS,Di as Tw,Dj as Jw,Dk as Et,Dl as Ea,Dm as Tc,E as b,Ec as gC,Ed as Xn,Ef as Ko,Eg as TS,Eh as HS,Ei as Sw,Ej as Zw,Ek as Ne,El as Aa,Em as Sc,Fc as yC,Fe as Ro,Ff as Wo,Fg as SS,Fh as KS,Fi as ww,Fj as Qw,Fk as fE,Fl as xa,Fm as wc,G as mb,Gc as bC,Gd as QC,Ge as Oo,Gf as Xo,Gg as wS,Gj as eE,Gk as mE,Gl as Ra,Gm as Ec,H as _b,Hc as CC,Hd as eT,He as Io,Hf as Yo,Hg as ES,Hh as WS,Hi as Ew,Hj as tE,Hk as _E,Hl as Oa,Hm as At,Ic as TC,Id as tT,If as Jo,Ij as rE,Ik as hE,Il as Ia,Ja as Lb,Jc as Vn,Jd as Yn,Je as pT,Jf as Zo,Jg as AS,Jh as XS,Jj as nE,Jk as gE,Jl as Pa,K as hb,Ka as Db,Kb as Xb,Kc as SC,Kd as Jn,Ke as fT,Kf as Qo,Kg as xS,Kh as YS,Ki as Aw,Kj as oE,Kk as yE,Kl as Ma,La as $b,Lb as Gn,Lc as Hn,Ld as Zn,Le as mT,Lf as ei,Lh as JS,Lk as ks,Ll as ka,Mb as Un,Md as Qn,Me as _T,Mf as ti,Mh as ZS,Mi as xw,Mk as vs,Ml as va,N as gb,Nb as Yb,Nc as wC,Nd as eo,Ne as hT,Nf as ri,Ng as RS,Nh as QS,Nk as Ns,Nl as Na,O as ht,Oa as vn,Ob as Jb,Oc as EC,Od as to,Oe as gT,Of as ni,Og as OS,Oj as wt,Ok as Ls,Ol as La,Pa as Fb,Pb as ie,Pc as AC,Pd as ro,Pe as yT,Pf as oi,Pg as IS,Pj as iE,Pk as Ds,Pl as Da,Q as gt,Qa as Gb,Qb as Zb,Qc as xC,Qd as rT,Qe as bT,Qf as ii,Qg as PS,Qi as Rw,Qj as sE,Qk as $s,Ql as $a,R as En,Ra as Ub,Rc as RC,Rd as nT,Re as CT,Rf as si,Ri as Ow,Rj as aE,Rk as Fs,Rl as Fa,S as An,Sa as jb,Sb as Qb,Sc as Ct,Se as TT,Sf as ai,Sg as MS,Si as Iw,Sj as Qi,Sk as Gs,Sl as Ga,T as yt,Tc as OC,Td as no,Te as ST,Tf as ci,Tg as mi,Ti as Pw,Tj as es,Tk as Us,Tl as Ua,U as yb,Ua as Nn,Ub as eC,Uc as IC,Ud as oo,Ue as wT,Uf as di,Ug as _i,Ui as Mw,Uj as ts,Uk as js,Ul as ja,Va as Ln,Vc as PC,Vd as oT,Ve as ET,Vf as ui,Vj as rs,Vk as Bs,Vl as Ba,W as bb,Wa as Oe,Wd as io,We as AT,Wf as li,Wi as kw,Wj as ns,Wk as qs,Wl as qa,X as Cb,Xa as Bb,Xc as MC,Xd as so,Xe as xT,Xf as pi,Xi as vw,Xj as os,Xk as zs,Xl as za,Y as Tb,Yc as kC,Yd as iT,Ye as RT,Yf as fi,Yh as ew,Yi as Nw,Yj as is,Yk as Vs,Yl as Va,Z as Sb,Za as Dn,Zd as ao,Ze as OT,Zf as BT,Zg as kS,Zh as tw,Zi as Lw,Zj as ss,Zk as Hs,Zl as Ha,_ as wb,_a as $n,_d as co,_e as IT,_f as qT,_g as vS,_h as rw,_i as Dw,_j as as,_k as Ks,_l as Ka,aa as Ab,ab as Fn,ad as vC,ae as lo,af as MT,ag as VT,ah as LS,ai as ow,aj as Fw,ak as ds,al as Xs,am as Xa,ba as xb,bd as NC,bf as kT,bg as HT,bi as iw,bj as Gw,bk as us,bl as Ys,bm as Ya,c as Tn,ca as Rb,cd as LC,cf as vT,cg as KT,ch as DS,cj as Uw,ck as ls,cl as Js,cm as Ja,d as _t,da as Ob,dd as DC,df as NT,dg as WT,dh as $S,dj as jw,dk as ps,dl as Zs,dm as Za,e as oe,ed as $C,ef as LT,eg as XT,ei as sw,ej as St,ek as fs,el as Qs,em as Qa,f as Sn,fa as Ib,fc as tC,fd as FC,ff as DT,fg as YT,fi as aw,fj as Bw,fk as ms,fl as ea,fm as ec,g as Re,ga as Pb,gc as rC,ge as sT,gf as $T,gg as JT,gi as Oi,gj as qw,gk as _s,gl as ta,gm as tc,h as wn,ha as Mb,hc as nC,hd as GC,he as aT,hf as FT,hg as ZT,hh as FS,hi as cw,hj as zw,hk as hs,hl as ra,hm as rc,ia as kb,id as UC,ie as cT,if as GT,ig as QT,ih as GS,ii as dw,ij as Vw,ik as gs,il as na,im as nc,j as sb,ja as vb,jc as oC,jd as jC,je as po,jf as UT,jg as eS,jh as US,ji as uw,jj as Hw,jk as ys,jl as oa,jm as oc,k as ab,ka as Nb,kc as iC,kd as BC,ke as fo,kf as jT,kg as tS,kh as jS,ki as lw,kj as Kw,kk as bs,kl as ia,km as ic,l as cb,la as xn,le as mo,lf as Po,lg as rS,lh as ke,li as Tt,lj as Ww,lk as Cs,ll as sa,lm as sc,ma as Rn,mc as sC,md as qC,me as _o,mf as Mo,mg as nS,mh as hi,mi as pw,mj as Xw,mk as Ts,ml as aa,mm as ac,na as On,nc as jn,nd as zC,ne as ho,nf as ko,ng as oS,nh as gi,ni as fw,nj as Yw,nk as Ss,nl as ca,nm as cc,oe as go,of as vo,og as iS,oh as yi,oi as mw,oj as Li,ok as ws,ol as da,om as dc,pc as Bn,pd as VC,pe as yo,pf as No,pg as sS,ph as bi,pi as _w,pj as Di,pk as Es,pl as ua,pm as uc,qc as qn,qd as HC,qe as bo,qf as Lo,qg as aS,qh as Ci,qj as $i,qk as As,ql as la,qm as lc,ra as In,rb as qb,rd as KC,re as Co,rf as Do,rg as cS,rh as Ti,ri as hw,rj as Fi,rk as xs,rl as pa,rm as pc,s as db,sb as Ie,sd as WC,se as To,sf as $o,sg as dS,sh as Si,si as gw,sj as Gi,sk as Rs,sl as fa,ta as Pn,tb as bt,tc as aC,td as XC,te as So,tf as Fo,tg as uS,th as wi,ti as yw,tj as Ui,tk as Os,tl as ma,tm as Le,u as ub,ua as Mn,ub as zb,uc as cC,ud as YC,ue as wo,uf as Go,ug as lS,uh as Ei,ui as bw,uk as Is,ul as _a,um as X,va as kn,vb as Vb,vc as dC,ve as Eo,vf as Uo,vg as pS,vh as BS,vi as Ii,vj as ji,vk as Ps,vl as ha,vm as fc,wb as Hb,wc as uC,we as Ao,wf as Pe,wg as fS,wi as Pi,wj as Bi,wk as Ms,wl as ga,wm as mc,x as lb,xb as Kb,xc as lC,xe as xo,xf as Me,xg as mS,xh as Ai,xi as Mi,xj as qi,xk as cE,xl as ya,xm as _c,yb as G,yc as pC,ye as dT,yf as jo,yg as _S,yh as xi,yi as ki,yj as zi,yk as dE,yl as ba,ym as hc,zb as Wb,zc as fC,ze as uT,zf as Bo,zg as hS,zh as Ri,zi as vi,zj as Vi,zk as ve,zl as Ca,zm as gc}from"./chunks/chunk-NOPL37X4.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",DP=["2025-11-25","2025-06-18"],Be=[U],f={headerMismatch:-32020,missingRequiredClientCapability:-32021,unsupportedProtocolVersion:-32022,invalidParams:-32602},R={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 mh(e){if(e===void 0)return;if(!_(e))throw new l("Invalid MCP clientInfo metadata",f.invalidParams,{field:R.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:R.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:[R.protocolVersion,R.clientCapabilities]});let r=t[R.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[R.clientCapabilities];if(!_(n))throw new l("Invalid MCP client capabilities metadata",f.invalidParams,{field:R.clientCapabilities,expected:"object"});let o=mh(t[R.clientInfo]);return{protocolVersion:U,clientCapabilities:n,...o?{clientInfo:o}:{}}}function $P(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 FP(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 GP(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,[R.serverInfo]:{...t}}}}function _h(e,t){return ze({...e,resultType:"complete"},t)}function UP(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 _h({supportedVersions:[...Be],capabilities:structuredClone(e.capabilities),ttlMs:t,cacheScope:"public",...e.instructions?{instructions:e.instructions}:{}},e.serverInfo)}function jP(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 hh}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 gh=["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 yh(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"||!gh.includes(s))throw new l("Unsupported MCP input request method",f.invalidParams,{field:`inputRequests.${o}.method`,method:s??null});let a=yh(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 VP(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:{[R.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 HP(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 bh(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 KP(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||!hh(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=bh(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 WP(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 Ch(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 XP(e,t){return{...e,...Ch(t)}}function Th(e){return e.replaceAll("~1","/").replaceAll("~0","~")}function Sh(e,t){if(t==="#")return e;if(!t.startsWith("#/"))return;let r=e;for(let n of t.slice(2).split("/").map(Th)){if(!_(r)&&!Array.isArray(r)||!Object.prototype.hasOwnProperty.call(r,n))return;r=r[n]}return r}function wh(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 Eh(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 Ah(e,t){if(!_(t)||typeof t.$ref!="string")return;let r=t.$ref;if(r.startsWith("#")&&Sh(e,r)===void 0)throw new l("MCP JSON Schema contains an unresolved local reference",f.invalidParams,{reference:r})}function YP(e,t={}){let{maximumBytes:r,maximumDepth:n,maximumNodes:o}=wh(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});Ah(e,a.value),Eh(a,i)}return structuredClone(e)}import{randomUUID as xh}from"node:crypto";import{readFile as Rh}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 oM="io.modelcontextprotocol/tasks",Oh=["working","input_required","completed","failed","cancelled"],Ih=/^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,Ph=3600*1e3,Mh=1e3,pe=1024,kh=30,vh=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(!Ih.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 Nh(e){if(!Oh.includes(e))throw new l("Corrupt MCP task record",f.invalidParams);return e}function Lh(e){if(typeof e!="string"||e.length===0)throw new l("Corrupt MCP task record",f.invalidParams);return e}function Dh(e){if(typeof e!="number"||!Number.isSafeInteger(e)||e<1)throw new l("Corrupt MCP task record",f.invalidParams);return e}function $h(e){if(e!==null&&(typeof e!="number"||!Number.isSafeInteger(e)||e<0))throw new l("Corrupt MCP task record",f.invalidParams);return e}function Fh(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 Gh(e){if(!Array.isArray(e)||e.some(t=>typeof t!="string"))throw new l("Corrupt MCP task record",f.invalidParams);return[...e]}function Uh(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=Nh(e.status),n=Lh(e.principal),o=Dh(e.workerPid),i=$h(e.ttlMs),s=Fh(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:Gh(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 jh(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-${xh()}`),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 Uh(JSON.parse(await Rh(this.#s(t),"utf8")))}catch(r){throw oe(r)||r instanceof SyntaxError?We("Unknown MCP task"):r}}async#a(t){await Re(this.#s(t.taskId),`${JSON.stringify(t,null,2)}
|
|
2
|
-
`)}async#o(t,r,n){let o=le(t),i=await ke(this.#e,o,kh,this.#t,!1,!1,vh);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?Ph:t.ttlMs,i=t.pollIntervalMs??Mh;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&&!jh(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 iM(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,Bh=5e3;function qh(e,t){return new Promise((r,n)=>{let o=setTimeout(()=>n(new Error("MCP subscription sink write timed out")),Bh);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 zh(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 Vh(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=Vh(zh(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 qh(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,Hh=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/u,lr=/^[\t\x20-\x7E]*$/u,pr=new Set(["prompts/get","resources/read","tools/call"]);function Kh(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 Wh(e,t,r){let n=e["x-mcp-header"];if(n===void 0)return;let o=e.type;if(typeof n!="string"||!Hh.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=Wh(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 Xh(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 uM(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,Xh(t,e.toolSchema)),o}function Yh(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 Jh(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 Zh(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),Jh(r,n,mr(i,o))||A("MCP parameter header does not match request body",o)}}function lM(e){let t=Kh(e.headers),r=typeof e.request.method=="string"?e.request.method:"";Yh(t,e.request),!(r!=="tools/call"||e.toolSchema===void 0)&&Zh({headers:t,params:e.request.params,toolSchema:e.toolSchema})}var pM=U;import{AsyncLocalStorage as Qh}from"node:async_hooks";import{createHash as yr,timingSafeEqual as eg}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}},tg=/^00-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})$/u,rg=/^[a-z][a-z0-9_*/-]{0,255}$/u,ng=/^(?:[a-z0-9][a-z0-9_*/-]{0,240})@[a-z][a-z0-9_*/-]{0,13}$/u,og=/^[\x20-\x2B\x2D-\x3C\x3E-\x7E]{0,255}[\x21-\x2B\x2D-\x3C\x3E-\x7E]$/u,Cr=/^[\x21\x23-\x5B\x5D-\x7E]+$/u,Tr=/^[A-Za-z0-9!#$%&'*+.^_`|~-]+$/u,ig=/^[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]*$/u,sg=/%(?![0-9A-Fa-f]{2})/u,ag=512,cg=32,dg=180,ug=8192,lg=8192,Sr=new Qh;function E(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 pg(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 gM(e){let t=E(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=>E(o,"authorization server issuer").href.replace(/\/$/u,"")),n=[...new Set(e.scopes??[])];if(n.some(o=>!Cr.test(o)))throw new g("Invalid authorization scope",401);return{resource:t,authorization_servers:r,...n.length>0?{scopes_supported:n.sort()}:{}}}function yM(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 bM(e,t){if(!_(e)||typeof e.issuer!="string")throw new g("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 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 E(u,d).href},i=d=>{let u=e[d];return typeof u=="string"?E(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 CM(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 TM(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 SM(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 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);E(n,"client redirect URI",!0)}return structuredClone(e)}function wM(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=>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 br=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 fg(e){let t=e.traceparent,r=e.tracestate;if(t!==void 0){let n=typeof t=="string"?tg.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"||!_g(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 mg(e){return rg.test(e)||ng.test(e)}function _g(e){if(Buffer.byteLength(e,"utf8")>ag)return!1;let t=e.split(",");if(t.length>cg)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(!mg(s)||!og.test(a)||r.has(s))return!1;r.add(s)}return!0}function wr(e){return ig.test(e)&&!sg.test(e)}function hg(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 Tr.test(n)&&(o===void 0||wr(o))}function gg(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(!(!Tr.test(s)||!wr(a)||!o.every(hg)))return{key:s,serialized:t}}function yg(e,t){if(e===void 0)return;if(typeof e!="string"||Buffer.byteLength(e,"utf8")>ug)throw new g("Invalid MCP baggage",403);let r=new Set(t),n=e.split(",");if(n.length>dg)throw new g("Invalid MCP baggage",403);let o=[];for(let i of n){let s=gg(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 EM(e,t={}){let r=_(e)&&_(e._meta)?e._meta:{},n=yg(r.baggage,t.baggageAllowlist??[]);return{...fg(r),...n?{baggage:n}:{}}}function AM(e,t){return Sr.run(structuredClone(e),t)}function xM(){let e=Sr.getStore();return e?{...e}:void 0}async function RM(e){let t=E(e.policy.resourceMetadataUrl,"protected resource metadata URL",!0).href,r=[...new Set(e.policy.requiredScopes??[])];if(r.some(p=>!Cr.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=pg(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")>lg)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 OM(e){let t=yr("sha256").update(e.token).digest();return r=>{let n=yr("sha256").update(r).digest();if(!eg(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",Er=Object.freeze({specVersion:_e,mimeTypes:[xr]});function MM(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]:Er}}});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]:Er}}});return!0}var bg={csp:{connectDomains:[],resourceDomains:[],frameDomains:[]},permissions:{},prefersBorder:!0},Rr=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:bg})));function kM(e){return Rr.find(t=>t.uri===e)}function vM(e){let t=new Map(Rr.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 NM(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 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>
|
|
3
3
|
<html lang="en">
|
|
4
4
|
<head>
|
|
5
5
|
<meta charset="utf-8">
|
|
@@ -22,12 +22,12 @@ import{A as wI,B as ph,C as fh,D as EI,E as AI,a as Xi,b as Yi,c as Ji,d as Zi,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 Ze}from"node:crypto";import{lstat as
|
|
25
|
+
</html>`}import{createHash as Ze}from"node:crypto";import{lstat as wg,readdir as Lr,readFile as Ag}from"node:fs/promises";import P from"node:path";import{parseDocument as xg}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 Rr="io.modelcontextprotocol/skills",Qe="SEP-2640@a3e147ca2710f68214247aecc729731ee1ae8d03",Og=Object.freeze({revision:Qe,status:"draft",directoryRead:!0});function QM(e,t=!1){let r=e.clientCapabilities.extensions,n=_(r)?r[Rr]:void 0;if(!_(n)||n.revision!==Qe||t&&n.directoryRead!==!0)throw new l("Missing or incompatible Skills over MCP draft capability",f.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[Rr]:Og}}})}var I=Object.freeze({maxFilesPerSkill:512,maxFileBytes:16*1024*1024,maxSkillBytes:16*1024*1024,defaultPageSize:20,maxPageSize:100}),Ir=100,Rg=32*1024*1024,Ig=/^[a-z0-9]+(?:-[a-z0-9]+)*$/u,Pr=new Set(Array.from({length:I.maxPageSize},(e,t)=>t+1));function C(e,t){throw new l(e,-32602,t)}function Mr(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 Pg(e,t){let r=/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/u.exec(e);r||C(`Skill ${t} is missing YAML frontmatter.`);let n=xg(r[1],{prettyErrors:!1,strict:!0,uniqueKeys:!0});n.errors.length>0&&C(`Skill ${t} has invalid YAML frontmatter.`,{errors:n.errors.map(i=>i.message)});let o;try{o=n.toJS({maxAliasCount:0})}catch(i){C(`Skill ${t} has unsupported YAML aliases.`,{error:String(i)})}return(typeof o!="object"||o===null||Array.isArray(o))&&C(`Skill ${t} frontmatter must be an object.`),o}async function Mg(e,t,r,n){return r>I.maxFileBytes&&C(`Skill resource exceeds the per-file limit: ${t}.`),n.files+=1,n.files>I.maxFilesPerSkill&&C(`Skill exceeds ${I.maxFilesPerSkill} files.`),n.skillBytes+=r,n.skillBytes>I.maxSkillBytes&&C(`Skill exceeds the aggregate byte limit: ${t}.`),n.originBytes.value+=r,n.originBytes.value>Rg&&C(`Skill origin exceeds the aggregate byte limit: ${t}.`),Ag(e)}async function Dr(e,t,r){let n=P.join(e,t),o=await Lr(n,{withFileTypes:!0}),i=[];for(let s of o.sort((a,c)=>a.name.localeCompare(c.name))){let a=P.posix.join(t.split(P.sep).join("/"),s.name),c=P.join(e,...a.split("/")),d=await wg(c);d.isSymbolicLink()&&C(`Skill resource must not be a symbolic link: ${a}.`),d.isDirectory()?i.push(...await Dr(e,a,r)):d.isFile()?i.push({relative:a,bytes:await Mg(c,a,d.size,r)}):C(`Skill resource must be a regular file or directory: ${a}.`)}return i}async function kr(e,t,r){let n=new Map,o;try{o=await Lr(e,{withFileTypes:!0})}catch(a){if(_t(a))return n;throw a}let i=o.filter(a=>a.isDirectory()&&Ig.test(a.name)).sort((a,c)=>a.name.localeCompare(c.name));i.length>Ir&&C(`Skill origin exceeds ${Ir} directories.`);let s={value:0};for(let a of i){let c=await Dr(P.join(e,a.name),"",{files:0,skillBytes:0,originBytes:s}),d=c.reduce((h,T)=>h+T.bytes.byteLength,0),u=c.find(h=>h.relative==="SKILL.md");if(!u)continue;let p=Pg(u.bytes.toString("utf8"),a.name);p.name!==a.name&&C(`Skill directory ${a.name} must match frontmatter name.`,{actual:p.name??null,expected:a.name}),(typeof p.description!="string"||p.description.trim().length===0)&&C(`Skill ${a.name} requires a non-empty frontmatter description.`,{required:["description"]});let m=c.map(h=>({uri:`skill://${a.name}/${h.relative}`,digest:`sha256:${Ze("sha256").update(h.bytes).digest("hex")}`,size:h.bytes.byteLength})),y=Ze("sha256").update(m.map(h=>`${h.uri}:${h.digest}`).join(`
|
|
26
26
|
`)).digest("hex");n.set(a.name,{uri:`skill://${a.name}/SKILL.md`,frontmatter:p,resources:m,_meta:{contractVersion:1,extensionRevision:Qe,origin:t,packageVersion:r,protocolVersion:U,trust:"untrusted",estimatedTokens:Math.ceil(d/4)},files:new Map(c.map(h=>[h.relative,h.bytes])),fingerprint:y})}return n}function vr(e){let{files:t,fingerprint:r,...n}=e;return n}var Nr=class e{#e;#t;constructor(t){this.#e=t,this.#t=Ze("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 l)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 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)||T(`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||T(`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)&&T(`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||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 S=C.uri.slice(`${a}/`.length);if(!S.startsWith(s))continue;let $=S.slice(s.length),[O,...mt]=$.split("/"),bn=`${a}/${s}${O}`,Cn=o.files.get(`${s}${O}`);c.set(O,{uri:bn,name:O,mimeType:mt.length>0?"inode/directory":Mr(O,Cn)})}i.length>0&&c.size===0&&T(`Unknown pm MCP skill directory: ${t}.`,{field:"uri"});let d=r.limit??I.maxPageSize;Pr.has(d)||T(`Skill directory limit must be an integer from 1 to ${I.maxPageSize}.`);let u=this.#r(r.cursor,t),p=[...c.values()].sort((C,S)=>C.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 Og(){return Object.keys(z).sort().map(e=>z[e])}function Ig(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 Pg(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(),C=(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: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 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 Mg(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 kg(){let e=Oe(process.cwd(),process.env.PM_PATH);await Tt(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 vg(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 Ng(){await wt()}(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 Lg(e,t){if(typeof t!="object"||t===null||Array.isArray(t))throw new TypeError(`Coverage entry for ${e} must be an object.`)}function Dg(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 $g(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)){Lg(r,n);for(let o of zr){let i=Dg(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 Fg=["captured_redacted","captured_verbatim"],Gg=[{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 Ug(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||!Fg.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 Gg)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 jg(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 Bg(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?Ug(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 jg(e,r)}function dk(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=Bg(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,qg=3;function mk(e){return(e?.trim()||"development").replace(/[^a-zA-Z0-9._-]/g,"_").replace(/^\./,"_")}function _k(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,qg-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 Ce="@unbrained/pm-cli",zg=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 w(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]??"")||w(e,["--activate","--adopt","--adopt-all","--deactivate","--fix-managed-state","--init","--install","--output","--reload","--scaffold","--uninstall"])}var Vg={changelog:(e,t)=>{if(t[0]==="generate")return!w(e,["--check"]);let r=e.indexOf("export");return t[0]==="export"&&(w(e,["--output"])||r>=0&&e[r+1]!==void 0&&!e[r+1].startsWith("-"))},comments:e=>w(e,["--add","--delete","--edit","--file","--stdin"]),config:(e,t)=>(t[0]==="project"||t[0]==="global"?t[1]:t[0])==="set",deps:()=>!1,docs:e=>w(e,["--add","--add-glob","--migrate","--remove"]),duplicates:()=>!1,events:()=>!1,extension:nt,files:(e,t)=>w(e,["--add","--add-glob","--migrate","--remove"])||t[0]==="discover"&&w(e,["--apply"]),health:e=>!w(e,["--check-only","--no-refresh","--skip-vectors"]),learnings:e=>w(e,["--add","--delete","--edit","--file","--stdin"]),merge:(e,t)=>t[0]!=="report",notes:e=>w(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]??"")&&!(w(e,["--infer"])&&!w(e,["--apply"])),telemetry:(e,t)=>t.slice(0,2).some(r=>["clear","flush"].includes(r)),templates:(e,t)=>t[0]==="save",test:e=>w(e,["--add","--add-json","--background","--measure","--remove","--resume","--run","--stop"]),validate:e=>w(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 Hg(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[Ce],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 Kg(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 Wg(e,t){try{let r=Hr.readFileSync(ye.join(e,t),"utf8").split(/\r?\n/u),n=r.findIndex(c=>c.includes(Ce));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 Xg(e){let t=[],r=ot(ye.join(e,"package.json")),n=r?Hg(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=Kg(e);s&&be(s)&&t.push({version:s,source:"package-lock.json"});for(let a of["pnpm-lock.yaml","yarn.lock"]){let c=Wg(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 Yg(e){let t=Wr(e);if(!t||w(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=Vg[r];return i?i(e,o):zg.has(r)}function Jg(e){let t=Wr(e.argv)?.command,r=Yg(e.argv),o=Xg(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 ${Ce} ${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 Tk(e){let t=Jg(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 ${Ce} ${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 Zg}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:Zg("sha256").update(ie({nodes:o,edges:i,kinds:s})).digest("hex"),created_at:new Date(n).toISOString(),nodes:o,edges:i,kinds:s})}function Qg(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ee(e){if(!Qg(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 Te(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 ey(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 ty(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 Te(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 Te(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 ry(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,ny=["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 oy(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 iy(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 sy(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(!ny.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=oy(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`),C=ct(e.recovery_for,`${n}.recovery_for`);return iy(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}:{},...C?{recovery_for:C}:{}}}function ay(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)=>sy(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 Wk(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)=>ay(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 Zk(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"}},ev=Object.freeze(Object.keys(dt));function tn(e){if(Object.hasOwn(dt,e))return dt[e]}var cy=new Set([..."=([{,:;!?&|+-*%^~<>","=>"]);function W(e,t){return e<t?-1:e>t?1:0}function dy(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 uy(e){return e===void 0||e.kind==="punctuator"&&cy.has(e.value)||e.kind==="identifier"&&["return","case","throw","else","yield"].includes(e.value)}function ly(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 Oy(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 Iy(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."},...Oy(e)]}function mv(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 Iy(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 Py(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 Sv(e=Ne.filter(t=>Et.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=>Py(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 My(e){switch(e){case"assurance":case"workspace snapshot":return ve.filter(({parent:t})=>t===e).map(({action:t})=>t);case"graph":return Pe;case"merge":return Me;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 wv(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:[...My(t)].sort()}}).sort((t,r)=>t.probe_id.localeCompare(r.probe_id))}function ky(e,t){let r=[...t].sort();return e.length===t.length&&[...e].sort().every((n,o)=>n===r[o])}function vy(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&&!ky(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 Ev(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=>vy(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 xv(){return pt.map(e=>({...e}))}function Ny(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 Rv(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=Ny(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 we,Ly=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 Dy(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=Ly[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 Ee(){if(we!==void 0)return we;let t=Y.filter(({command:i})=>Le(i)).flatMap(({command:i,family:s})=>Ht(i,X(i)).map(a=>({command:i,family:s,concept:Dy(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 we=Object.freeze(n.map(i=>Object.freeze({...i,concept:o.get(i.concept)?.size===1?i.concept:`${i.concept}@${i.command}`}))),we}function kv(){return Object.freeze(Ee().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 Ee())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 $y(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 Fy(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 Gy(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 vv(e=Ee(),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 $y(e,o,n),Fy(a,t,n),Gy(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 Nv(){let e=Ee(),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 Dv(e){return e}function $v(e){return e}function Fv(e){return e}function Gv(e){return e}function Uv(e){return e}function jv(e){return e}function Bv(e){return e}function qv(e){return e}function zv(e){return e}function Vv(e){return e}function Hv(e){return e}function Kv(e){return e}function Wv(e){return e}function Xv(e){return{handled:!0,result:e}}function Yv(){return{handled:!1}}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(){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 Uy(e={},t={}){return new ae(t).extension(void 0,{...e,migrate:!0})}function jy(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 By,randomBytes as qy,timingSafeEqual as zy}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 KN="dev.unbrained.pm/progressive-tool-discovery",WN=Object.freeze({version:1,discoveryTool:"pm_discover",canonicalResult:"structuredContent.result",compatibilityText:"pointer"}),Vy=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}),Hy=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"]),Ky=new Set(["core","standard","full","custom"]),pn=new Set(Y.map(({family:e})=>e)),Wy=qy(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 Xy(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 XN(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 Yy(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 Jy(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 Zy(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 By("sha256",r).update(JSON.stringify({version:1,fingerprint:e,offset:t})).digest("base64url")}function Qy(e,t,r){let n={version:1,offset:t,signature:gn(e,t,r)};return Buffer.from(JSON.stringify(n),"utf8").toString("base64url")}function eb(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||!zy(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:Yy(e),weight:t,available:r!=="unavailable",source:r}}function Ae(e,t,r){return ft(e??t,r,e===void 0?"computed":"host")}function tb(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=Jy(t,i),a=new Set(ne(t)),c={lexical:ft(s,D.lexical,"computed"),semantic:Ae(e.signals?.semantic,Zy(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,Vy.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 rb(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"||!Ky.has(e.profile)))throw new b("pm tool discovery profile must be core, standard, full, or custom.",64)}function nb(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 rb(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 ob(e,t,r){return e.filter(n=>n.authorized!==!1).map(n=>tb(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 ib(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 YN(e,t={}){Xy(e),hn(t);let r=nb(t),n=t.cursorIntegrityKey??Wy,o=ob(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=eb(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:Hy}},u=(h,C=h.length)=>{let S=s+C,$=S<o.length,O=[...c];return C<a.length&&O.push({name:"tools",reason:"token_budget",restore_with:"Continue with next_cursor or increase outputBudget."}),{...d,tools:[...h],returned:C,has_more:$,...$?{next_cursor:Qy(i,S,n)}:{},omission_receipt:{has_omissions:O.length>0,omitted:O}}},p=h=>{let C=u(h),S=yn(C,r.budget);return{...C,token_cost:{estimated_tokens:S,budget:r.budget,within_budget:r.budget==="unbounded"||S<=r.budget}}},m=ib(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]="8a1a02de-32cb-5714-b950-6041ae8ce229")}catch{}})();export{Fx as ACTIONABILITY_ORDERING_KINDS,os as ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS,Qa as ACTIVITY_FLAG_CONTRACTS,po as AGENT_PROVENANCE_DIMENSIONS,$s as AGGREGATE_FLAG_CONTRACTS,wa as APPEND_FLAG_CONTRACTS,Nx as ASSURANCE_ACTIONS,Lx as ASSURANCE_DECLARATION_KINDS,gA as ASSURANCE_DOCUMENT_VERSION,qa as ASSURANCE_FLAG_CONTRACTS,yA as ASSURANCE_GATE_TRIGGERS,bA as ASSURANCE_MEASUREMENT_SOURCE_KINDS,DA as ASSURANCE_PRESET_IDS,fA as AssuranceEvaluationRefusalError,pA as AssuranceMutationRefusalError,mA as AssuranceSourceResolutionError,Yn as BASELINE_ITEM_FORMAT_VERSION,Fg as BOUNDARY_FIXTURE_CAPTURE_SOURCES,Yx 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,qb as BUILTIN_RELATIONSHIP_KINDS,ts as CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS,Za as CALENDAR_FLAG_CONTRACTS,Ea as CLAIM_FLAG_CONTRACTS,gc as CLOSE_ACTION_OPTION_KEYS,Ta as CLOSE_FLAG_CONTRACTS,Sa as CLOSE_MANY_FLAG_CONTRACTS,Pa as CLOSE_TASK_FLAG_CONTRACTS,Fs as COMMENTS_FLAG_CONTRACTS,Lb as COMMON_MUTATION_COMMAND_OPTION_KEYS,lc as COMPLETION_FLAG_CONTRACTS,kn as CONFIDENCE_TEXT_VALUES,Qs as CONFIG_FLAG_CONTRACTS,rs as CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS,_R as CONTEXT_EVALUATION_METRIC_NAMES,tc as CONTEXT_FLAG_CONTRACTS,Mt as CONTEXT_OUTPUT_VALUES,CR as CONTEXT_PACKING_PROFILES,lR as CONTEXT_RELEVANCE_SERVICE,dR as CONTEXT_RELEVANCE_SIGNAL_NAMES,OR as CONTEXT_SIGNAL_SET_VERSION,RR as CONTEXT_SIGNAL_STORE_FORMAT_VERSION,IR as CONTEXT_SIGNAL_STORE_WARNING_DETAILS,uc as CONTRACTS_FLAG_CONTRACTS,Wa as COPY_FLAG_CONTRACTS,cs as CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,us as CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,ds as CREATE_COMMANDER_STRING_OPTION_CONTRACTS,ub as CREATE_DIRECT_CLOSE_REASON_DEFAULT,za as CREATE_FLAG_CONTRACTS,RS as CURRENT_HISTORY_ITEM_HASH_VERSION,Jn as CURRENT_ITEM_FORMAT_VERSION,vR as ContextSignalStore,SR as ContextUsageValidationError,iA as DEFAULT_AUTHOR_IDENTITY_VOCABULARY,uO as DEFAULT_CHILD_SAMPLE_LIMIT,Xx as DEFAULT_COMPACT_LIST_FIELDS,_w as DEFAULT_DERIVED_INDEX_MINIMUM_ITEMS,Mp as DEFAULT_EVAL_QUERIES_RELATIVE_PATH,WR as DEFAULT_TERMINAL_TRANSITION_POLICY,$R as DEFAULT_WORKSPACE_MEMORY_MINIMUM_ITEMS,Rx as DEFECT_ESCAPE_CLASSES,Ox as DEFECT_GATE_EVIDENCE_DISPOSITIONS,xa as DELETE_FLAG_CONTRACTS,In as DEPENDENCY_KIND_VALUES,oc as DEPS_FLAG_CONTRACTS,Bs as DOCS_FLAG_CONTRACTS,Ua as DUPLICATES_FLAG_CONTRACTS,sc as EVAL_FLAG_CONTRACTS,Rp as EVAL_QUERY_SET_CONTRACT,Op as EVAL_QUERY_SET_EXAMPLE,xp as EVAL_QUERY_SET_SCHEMA_ID,ec as EVENTS_FLAG_CONTRACTS,ka as EVENT_FLAG_CONTRACTS,Mo as EXECUTABLE_COMMAND_ALIASES,F as EXIT_CODE,ua as EXTENSION_ACTIVATE_FLAG_CONTRACTS,da as EXTENSION_ADOPT_ALL_FLAG_CONTRACTS,ga as EXTENSION_ADOPT_FLAG_CONTRACTS,DE as EXTENSION_CAPABILITIES,cb as EXTENSION_CAPABILITY_CONTRACT,sb as EXTENSION_CAPABILITY_CONTRACT_VERSION,ab as EXTENSION_CAPABILITY_LEGACY_ALIASES,jn as EXTENSION_CAPABILITY_REGISTRATION_SURFACES,ha as EXTENSION_CATALOG_FLAG_CONTRACTS,la as EXTENSION_DEACTIVATE_FLAG_CONTRACTS,ca as EXTENSION_DESCRIBE_FLAG_CONTRACTS,_a as EXTENSION_DOCTOR_FLAG_CONTRACTS,aa as EXTENSION_EXPLORE_FLAG_CONTRACTS,ea as EXTENSION_FLAG_CONTRACTS,ra as EXTENSION_INIT_FLAG_CONTRACTS,ia as EXTENSION_INSTALL_FLAG_CONTRACTS,fa as EXTENSION_MANAGE_FLAG_CONTRACTS,pa as EXTENSION_MIGRATE_FLAG_CONTRACTS,$E as EXTENSION_POLICY_MODES,FE as EXTENSION_POLICY_SURFACES,ma as EXTENSION_RELOAD_FLAG_CONTRACTS,UE as EXTENSION_SANDBOX_PROFILES,ta as EXTENSION_SCOPE_FLAG_CONTRACTS,GE as EXTENSION_TRUST_MODES,sa as EXTENSION_UNINSTALL_FLAG_CONTRACTS,HA as EXTERNAL_DEPENDENCY_RESOLUTION_STATUSES,zA as EXTERNAL_DEPENDENCY_SOURCE_KIND,VA as EXTERNAL_DEPENDENCY_SOURCE_KIND_ALIAS,js as FILES_FLAG_CONTRACTS,Xa as FOCUS_FLAG_CONTRACTS,Fa as GC_FLAG_CONTRACTS,Qx as GET_DEPTH_VALUES,rc as GET_FLAG_CONTRACTS,Ls as GLOBAL_FLAG_CONTRACTS,gd as GRAPH_DURABLE_CACHE_MIN_ITEMS,hd as GRAPH_DURABLE_CACHE_VERSION,ic as GRAPH_FLAG_CONTRACTS,Pe as GRAPH_SUBCOMMAND_VALUES,nc as GUIDE_FLAG_CONTRACTS,ja as HEALTH_FLAG_CONTRACTS,Ks as HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS,QA as HISTORY_AUTHOR_ATTRIBUTION_BASELINE,ZO as HISTORY_COMPACT_BULK_DEFAULT_MIN_ENTRIES,Ws as HISTORY_COMPACT_FLAG_CONTRACTS,qs as HISTORY_FLAG_CONTRACTS,Vs as HISTORY_REDACT_FLAG_CONTRACTS,Hs as HISTORY_REPAIR_FLAG_CONTRACTS,Cp as INIT_AGENT_GUIDANCE_MODE_VALUES,Zs as INIT_FLAG_CONTRACTS,ya as INSTALL_FLAG_CONTRACTS,Mn as ISSUE_SEVERITY_VALUES,Ha as ITEM_COMPLETE_FLAG_CONTRACTS,NO as ITEM_LATEST_TIMESTAMP_FIELDS,db as ITEM_METADATA_KEY_ORDER,Va as ITEM_MUTATE_FLAG_CONTRACTS,Ka as ITEM_REOPEN_FLAG_CONTRACTS,Rn as ITEM_TYPE_VALUES,vO as ITEM_UNION_COLLECTION_FIELDS,kR as JsonFileContextSignalStoreAdapter,Us as LEARNINGS_FLAG_CONTRACTS,Kl as LINKED_TEST_ENV_NAME_PATTERN,Wl as LINKED_TEST_PM_CONTEXT_MODE_VALUES,Hl as LINKED_TEST_PROTECTED_ENV_KEYS,Xl as LINKED_TEST_WORKSPACE_CONTEXT_MODE_VALUES,Qi as LIST_COMMANDER_STRING_OPTION_CONTRACTS,Jx as LIST_COMMAND_DEFAULT_PROJECTIONS,BE as LIST_FILTER_EXTENSION_FLAG_DEFINITIONS,Ds as LIST_FILTER_FLAG_CONTRACTS,nR as LIST_SORT_FIELDS,oR as LIST_SORT_ORDER_VALUES,dO as MAX_CHILD_PROJECTION_ITEMS,Ma as MEET_FLAG_CONTRACTS,$O as MERGE_DRIVER_ARTIFACT_VALUES,zs as MERGE_FLAG_CONTRACTS,Me as MERGE_SUBCOMMAND_VALUES,UO as MUTATION_EVENT_WIRE_BUDGET,Q as MemoryRelationshipGraphAdapter,ns as NEXT_COMMANDER_STRING_OPTION_CONTRACTS,cc as NEXT_FLAG_CONTRACTS,Ol as NEXT_OUTPUT_VALUES,Gs as NOTES_FLAG_CONTRACTS,na as PACKAGE_FLAG_CONTRACTS,oa as PACKAGE_INIT_FLAG_CONTRACTS,Ia as PAUSE_TASK_FLAG_CONTRACTS,hc as PLAN_CREATE_METADATA_PARAMETER_KEYS,Js as PLAN_FLAG_CONTRACTS,up as PLAN_SHOW_DEPTH_VALUES,Fe as PLAN_SUBCOMMANDS,lp as PLAN_TEMPLATE_NAMES,ny as PM_AGENT_TASK_ACCOUNTING_MODES,at as PM_AGENT_TASK_TRANSCRIPT_VERSION,Ac as PM_CLI_EXPECTED_ERROR_NAME,fE as PM_CLI_GRAMMAR_CONTRACT,cE as PM_CLI_GRAMMAR_NOUNS,zo as PM_CLI_ONLY_TOOL_ACTION_WAIVERS,dE as PM_CLI_SHARED_VERBS,Po as PM_COMMAND_ALIAS_CONTRACTS,Y as PM_COMMAND_CAPABILITY_CONTRACTS,Et as PM_COMMAND_DESTINATION_CONTRACTS,eO as PM_COMMAND_EXIT_CONTRACTS,QR as PM_COMMAND_EXIT_OUTCOME_CONTRACTS,ci as PM_COMMAND_OUTPUT_BUDGET_CONTRACTS,uI as PM_COMMAND_OUTPUT_ENVELOPE_CONTRACTS,Ne as PM_COMMAND_POSITIONAL_CONTRACTS,sf as PM_COMMAND_VISIBILITY_CONTRACTS,zE as PM_COMPLETE_LIST_FINDING_CODES,YE as PM_CONTEXT_INTENTS_FILE,fS as PM_CONTEXT_INTENT_CONTRACTS,Uo as PM_CORE_COMMAND_NAMES,v as PM_CORPUS_SHAPE_SCHEMA,Ho as PM_DEPRECATED_TOOL_ACTIONS,ni as PM_DIAGNOSTIC_DEGRADATION_STEPS,oi as PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS,ri as PM_DIAGNOSTIC_OUTPUT_CLASSES,Ko as PM_DISCOVERABLE_TOOL_ACTIONS,cI as PM_ERROR_CODE_CATALOG,oI as PM_ERROR_CODE_EXIT_CLASS_CONTRACTS,zr as PM_EXACT_COVERAGE_METRICS,No as PM_EXTENSION_CAPABILITY_CONTRACTS,jo as PM_EXTENSION_PACKAGE_ACTION_SUBCOMMANDS,Do as PM_EXTENSION_POLICY_MODE_CONTRACTS,Go as PM_EXTENSION_POLICY_SURFACE_CONTRACTS,Fo as PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS,Lo as PM_EXTENSION_SERVICE_NAME_CONTRACTS,$o as PM_EXTENSION_TRUST_MODE_CONTRACTS,sx as PM_GITATTRIBUTES_END,ix as PM_GITATTRIBUTES_START,cx as PM_GITATTRIBUTES_V2_END,ax as PM_GITATTRIBUTES_V2_START,Mc as PM_GITIGNORE_END,Pc as PM_GITIGNORE_START,qo as PM_ITEM_ACTION_SUBCOMMANDS,Je as PM_MCP_APPS_EXTENSION,Er as PM_MCP_APPS_SERVER_CAPABILITY,_e as PM_MCP_APPS_SPEC_VERSION,Rr as PM_MCP_APP_CONTRACTS,xr as PM_MCP_APP_MIME_TYPE,Vy as PM_MCP_ENTRY_TOOL_NAMES,f as PM_MCP_ERROR_CODES,pM as PM_MCP_HTTP_PROTOCOL_VERSION,gh as PM_MCP_INPUT_REQUEST_METHODS,DP as PM_MCP_LEGACY_PROTOCOL_VERSIONS,R as PM_MCP_META_KEYS,KN as PM_MCP_PROGRESSIVE_DISCOVERY_EXTENSION,WN as PM_MCP_PROGRESSIVE_DISCOVERY_SERVER_CAPABILITY,lf as PM_MCP_PROMPT_CONTRACTS,U as PM_MCP_PROTOCOL_VERSION,uf as PM_MCP_RESOURCE_CONTRACTS,Qe as PM_MCP_SKILLS_DRAFT_REVISION,Or as PM_MCP_SKILLS_EXTENSION,wg 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,oM as PM_MCP_TASKS_EXTENSION,Oh as PM_MCP_TASK_STATUSES,se as PM_MCP_TOOL_COMMAND_CONTRACTS,_T as PM_MODE_PAIRED_OUTPUT_PROJECTION_CONTRACTS,Li as PM_MUTATION_ACTION_CONTRACTS,ti as PM_OUTPUT_BUDGET_CLASSES,ei as PM_OUTPUT_DEGRADATION_STEPS,Kt as PM_OUTPUT_ENVELOPE_KINDS,Ot as PM_PACKAGE_CONVENTIONAL_RESOURCE_ROOTS,Bo as PM_PACKAGE_ONLY_ACTION_SUBCOMMANDS,Rt as PM_PACKAGE_RESOURCE_KINDS,ve as PM_POSITIONAL_ACTION_CONTRACTS,Ec as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA,Sc as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION,tS as PM_READ_OUTPUT_COMPOSITION_OPTION_FLAGS,BT as PM_READ_OUTPUT_CONTINUATION_FINGERPRINT_POLICIES,ZT as PM_READ_OUTPUT_DIMENSIONS,eS as PM_READ_OUTPUT_OPTION_FLAGS,KT as PM_READ_OUTPUT_SESSION_MAX_SEEN_ITEM_IDS,HT as PM_READ_OUTPUT_SESSION_MIN_TOKENS,QT as PM_READ_OUTPUT_SURFACES,rS as PM_READ_OUTPUT_SURFACE_CONTRACTS,mT as PM_READ_ROW_CONTRACTS,fT as PM_READ_ROW_JQ_SELECTOR,ev as PM_RECOVERY_REFERENCE_FIELDS,re as PM_RECOVERY_REFERENCE_KINDS,Ry as PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE,nn as PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE_V2,av as PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE,rn as PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE_V2,Xi as PM_REPRODUCIBLE_PROCESS_ENV,tO as PM_SUCCESS_EXIT_CODES,Vo as PM_TOOL_ACTIONS,yc as PM_TOOL_ACTION_PARAMETER_CONTRACTS,wc as PM_TOOL_PARAMETERS_SCHEMA,Tc as PM_TOOL_PARAMETERS_SCHEMA_MAJOR,Cc as PM_TOOL_PARAMETERS_SCHEMA_VERSION,mc as PM_TOOL_RESERVED_CUSTOM_FIELD_PROPERTIES,jr as PM_WORKSPACE_RECIPE_SCHEMA,Ys 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,VE 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,MT as QUERY_CURSOR_CONTRACT,Ca as REINDEX_FLAG_CONTRACTS,uw as REINDEX_LOCK_ID,st as RELATIONSHIP_GRAPH_SNAPSHOT_VERSION,Ra as RELEASE_FLAG_CONTRACTS,va as REMIND_FLAG_CONTRACTS,Ct as RESERVED_ITEM_FIELD_NAMES,Aa as RESTORE_FLAG_CONTRACTS,Pn as RISK_VALUES,OE as RelationshipEventLog,IE as RelationshipEventStore,G as RelationshipGraph,Ie as RelationshipKindRegistry,Xs as SCHEMA_FLAG_CONTRACTS,es as SEARCH_COMMANDER_STRING_OPTION_CONTRACTS,qE as SEARCH_EXTENSION_FLAG_DEFINITIONS,dc as SEARCH_FLAG_CONTRACTS,ul as SEMANTIC_ATTRIBUTION_LIMITS,pb as SETTINGS_DEFAULTS,Dp as SNAPSHOT_SCHEMA,rx as SOURCE_CONTEXT_ACCESS_ENV,nx as SOURCE_CONTEXT_WRITE_OVERRIDE_ENV,Oa as START_TASK_FLAG_CONTRACTS,Ga as STATS_FLAG_CONTRACTS,On as STATUS_VALUES,Ns as SUBCOMMAND_GLOBAL_FLAG_CONTRACTS,OS as SUPPORTED_HISTORY_ITEM_HASH_VERSIONS,Ib as SUPPRESS_HOST_OUTPUT_MARKER,Da as TELEMETRY_FLAG_CONTRACTS,kf as TELEMETRY_SUBCOMMANDS,La as TEST_ALL_FLAG_CONTRACTS,Na as TEST_FLAG_CONTRACTS,$a as TEST_RUNS_FLAG_CONTRACTS,Rf as TEST_RUN_MEASUREMENT_LIMIT,Os as TOOL_ACTIVITY_OPTION_CONTRACTS,hs as TOOL_AGGREGATE_OPTION_CONTRACTS,Es as TOOL_BULK_MUTATION_FILTER_OPTION_CONTRACT_SOURCE,Rs as TOOL_CALENDAR_OPTION_CONTRACTS,xs as TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS,Is as TOOL_CONTEXT_OPTION_CONTRACTS,Ts as TOOL_CREATE_OPTION_CONTRACTS,Cs as TOOL_CREATE_OPTION_CONTRACT_SOURCE,Ps as TOOL_DEPS_OPTION_CONTRACTS,Ms as TOOL_GRAPH_OPTION_CONTRACTS,_s as TOOL_LIST_FILTER_OPTION_CONTRACTS,gs as TOOL_SEARCH_FILTER_OPTION_CONTRACTS,bs as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS,ys as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACT_SOURCE,As as TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS,ws as TOOL_UPDATE_OPTION_CONTRACTS,Ss as TOOL_UPDATE_OPTION_CONTRACT_SOURCE,lb as TYPE_TO_FOLDER,Rb as UNKNOWN_SUBCOMMAND_COMPATIBILITY_CODES,ls as UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,fs as UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,ps as UPDATE_COMMANDER_STRING_OPTION_CONTRACTS,Ya as UPDATE_FLAG_CONTRACTS,Ja as UPDATE_MANY_FLAG_CONTRACTS,ba as UPGRADE_FLAG_CONTRACTS,Ba as VALIDATE_FLAG_CONTRACTS,ac as WORKSPACE_FLAG_CONTRACTS,hi as WORKSPACE_HISTORY_ID,$p as WORKSPACE_SNAPSHOT_ACTIONS,Wc as WorkspaceGraphCache,NE as WorkspaceTransactionInterruptedError,Oc as _testOnly,cR as _testOnlyAggregateCommand,bp as _testOnlyConfigCommand,mO as _testOnlyGetCommand,cu as _testOnlyHealthCommand,Ep as _testOnlyInit,Tp as _testOnlyInitAgentGuidance,FI as _testOnlyItemTransaction,zO as _testOnlyMutationEvents,VR as _testOnlyNextCommand,PO as _testOnlySearchCommand,sO as _testOnlySimilarity,Vp as _testOnlyTemplates,ju as _testOnlyValidateCommand,YO as _testOnlyWorkspacePosition,UA as acceptAssuranceProposals,Gu as acknowledgeLinkedTests,$d as acknowledgeUnknownAuthorHistoryEvents,Dd as acknowledgeUnknownAuthorHistoryEventsFromTransport,hw as acquireItemMetadataDerivedIndexLock,ke as acquireLock,YI as activateExtensionForTest,oC as activateExtensions,lo as agentSessionEnvironment,Om as aggregate,hf as analyzeAgentProvenanceDescriptorCoverage,Px as analyzeDefectChangeRisk,ME as analyzeGraphImpact,Fc as analyzeHierarchyIntegrity,kE as analyzeKnowledgeGraph,nO as analyzePmCommandExitConformance,Wo as analyzePmToolActionParity,bx as analyzeReconciliationDiscard,PE as analyzeRelationshipExecution,dd as analyzeRelationshipSchedule,eh as analyzeSdkActionCoverage,At as analyzeSdkCliParameterCompleteness,Um as append,_i as appendHistoryEntry,Ci as appendWorkspaceAuditEvent,bi as appendWorkspaceHistoryChange,NC as applyAcceptanceCriteriaMutations,FA as applyAssurancePreset,ih as applyBootstrapPagerPolicy,yS as applyContextIntentProjection,Rl as applyContextTagProjection,iR as applyFilterValueEcho,TE as applyHistoryPatch,ph as applyInvocationAuthorOverride,mu as applyPathMigrations,uS as applyReadOutputDimensions,sS as applyReadOutputIncludeModes,XT as applyReadOutputSessionReferences,PC as applyRegisteredItemFieldDefaultsAndValidation,yu as applyStandaloneNote,ru as applyStoredExtensionMigrationState,DC as applyTagRemovals,ZR as applyTerminalOrderingPolicy,bu as artifactKey,gb as asRecordClone,hb as asRecordOrNull,De as assembleWorkspaceRelationshipGraph,XE as assertCompleteListResult,PP as assertExtensionBlueprint,IP as assertExtensionCapabilityUsage,lP as assertExtensionDeactivated,vP as assertExtensionManifestCompatible,kP as assertExtensionManifestMatchesBlueprint,NP as assertExtensionPreflight,jc as assertHierarchyMutationAllowed,QO as assertHistoryCompactTarget,Tx as assertHistoryRepairTarget,Mi as assertInitializedTracker,_u as assertLinkedArtifactMutationIsUnambiguous,FP as assertMcpClientCapabilities,$P as assertMcpProtocolHeader,ry as assertMemoryRelationshipGraphAdapterConformance,GC as assertNoUnknownCsvKeys,pP as assertPackageManifest,HS as assertParentReferenceIsNotSelf,BM as assertPmMcpSkillsCapability,MP as assertProjectProfile,Tk as assertProjectRuntimeCompatibility,hT as assertProjectionModeChoice,Pi as assertReadableTrackerRoot,fP as assertRegisteredCommandContract,wP as assertRegisteredCommandOverride,bP as assertRegisteredExporter,mP as assertRegisteredFlags,_P as assertRegisteredHook,yP as assertRegisteredImporter,CP as assertRegisteredItemField,TP as assertRegisteredItemType,OP as assertRegisteredMigration,EP as assertRegisteredParserOverride,AP as assertRegisteredPreflightOverride,SP as assertRegisteredProfile,xP as assertRegisteredRendererOverride,hP as assertRegisteredSearchProvider,RP as assertRegisteredServiceOverride,gP as assertRegisteredVectorStoreAdapter,Kb as assertRelationshipEdgeAllowed,Yr as assertRelationshipGraphAdapterConformance,CA as assuranceAssertionUpdateIsLoosening,TS as attachContextIntentReceipt,Lu as attachLinkedTestMutationProvenance,Nu as attachLinkedTestProvenance,ze as attachMcpServerInfo,ST as attachOutputOmissionReceipt,wS as attachOutputTokenAccounting,SS as attachReadOutputContracts,YT as attachReadOutputSessionReceipt,Bd as auditMergeAttributeFence,dx as auditMergeDriverConfiguration,md as auditWorkspaceRelationshipGraph,RM as authorizeMcpHttpRequest,ao as boundAgentEpisodeIdentity,UT as boundReadOutputRows,wl as buildChildrenByParent,yO as buildCompactSearchFilterSummary,sR as buildContentFilterEcho,MR as buildContextSignalSnapshot,Pg as buildCorpusShapeItemPlan,Ix as buildDefectRecurrenceIndex,Zd as buildExtensionDescribeResult,aR as buildGovernanceMissingFilterEcho,ew as buildInvalidTypeError,lO as buildItemChildrenRollup,DI as buildItemCompletionMutations,uR as buildItemContextRelevanceCandidates,Sw as buildItemNotFoundError,fO as buildItemSchedule,yM as buildMcpAuthorizationDiscoveryUrls,_h as buildMcpCompleteResult,UP as buildMcpDiscoverResult,wM as buildMcpDynamicRegistrationMetadata,uM as buildMcpHttpRequestHeaders,VP as buildMcpInputRequiredResult,gM as buildMcpProtectedResourceMetadata,Ud as buildMergeAttributePatterns,bc as buildPmActionToolInputSchema,uv as buildPmRefusalClosureCensus,JA as buildRelationshipContext,Rw as buildSearchCorpus,Iw as buildSemanticCorpusInput,Ex as buildStatusRoleWarnings,Ii as buildTrackerInitializationRecovery,Lw as buildVectorizationEmbeddingIdentity,Dw as buildVectorizationEmbeddingMetadata,bO as buildVerboseSearchFilters,FR as buildWorkspaceMemorySnapshot,so as canonicalDocument,Db as canonicalizeCommandOptionKey,zb as canonicalizeRelationshipKind,tv as censusPmRecoveryReferenceProducers,WE as certifyCompleteListResult,WI as checkExtensionManifestCompatibility,w_ as claim,E_ as claimNext,ex as classifyHistoryAuthorEvent,VO as classifyHostEnvironmentFault,RO as classifyImplicitSemanticFallbackReason,eo as classifyItemFormatVersion,Lf as classifyLinkedTestCommandSafety,Df as classifyLinkedTestFailure,TC as clearActiveExtensionHooks,Sd as clearDurableGraphCache,cT as clearFocusedItem,Nc as clearWorkspaceContractsCache,S_ as close,Nl as closeItem,k_ as closeTask,ch as coalesceRepeatedListFlags,Gx as collectBlockedByIds,jx as collectBlockedByIdsFromCorpus,Vc as collectDanglingDependencyReferences,qx as collectDependencyBlockedIds,qc as collectDuplicateDependencyRows,fd as collectDuplicateRelationshipEdgeGroups,xO as collectErrorCauseCodes,$c as collectHierarchyRelations,_r as collectMcpHeaderAnnotations,Hc as collectMissingDependencyTargetIds,jl as collectNewOrderingCycleWarnings,ud as collectOrderingCycles,zc as collectOrderingStorageContradictions,QE as collectPackageContextIntentContracts,Pt as collectPackageExtensionDirectories,OC as collectRegisteredItemFieldNames,eT as collectRuntimeCreateFieldValues,tw as collectRuntimeFilterValues,tT as collectRuntimeUpdateFieldValues,yl as collectSubtreeIds,Bn as collectUsedExtensionCapabilities,$b as commandOptionFlagLabel,Mm as comments,um as commitImportedItem,$I as commitItemCompletion,LI as commitItemMutations,LE as commitWorkspaceTransaction,vs as compactFlagAliasContracts,bl as compareCriticalItems,ge as comparePmDateVersions,vE as compareRelationshipSnapshots,yb as compareTimestampStrings,uA as compileHistoryProvenanceMatcher,hS as composeContextIntentContracts,jI as composeExtension,KI as composeExtensionPackage,zx as computeActionabilityReport,GS as computeHistoryDiff,ad as computeRelationshipCentrality,sd as computeRelationshipDominators,Kc as computeWorkspaceGraphFingerprint,Bm as config,CC as consumeAfterCommandAffectedItems,Sm as context,CS as contextIntentRowId,x_ as copy,$f as countFailureCategories,FT as countReadOutputRows,b_ as create,$A as createAssurancePreset,xx as createAssuranceWorkspaceContext,Cb as createCheckpointId,HE as createCompleteListOptions,iC as createCoreCommandHookContext,Ur as createCorpusShapeMeasurement,AA as createEmptyAssuranceDocument,Xb as createEmptyExtensionRegistrationRegistry,Ic as createExtensionCommandSdk,Un as createExtensionContributionInventory,LP as createExtensionTestHarness,mi as createHistoryEntry,Zw as createLazyModule,OM as createMcpStaticBearerVerifier,iM as createMcpTaskStore,Tw as createMutationGuardSdk,gT as createOutputOmissionReceipt,xc as createPmCliExpectedError,fh as createPmCliProgram,si as createPmCommandOutputBudget,ET as createQueryFingerprint,ty as createRelationshipGraphScaleFixture,K as createRelationshipGraphSnapshot,bt as createRelationshipKindRegistry,Ji as createReproducibleProcessRunner,CO as createSearchCursorFingerprint,sC as createSerialQueue,VC as createStdinTokenResolver,Ob as createUnknownSubcommandError,Fp as createWorkspaceSnapshot,JI as deactivateExtensionForTest,Yv as declineServiceOverride,bS as decodeContextIntentCursor,Jw as decodeHtmlEntitiesInOptions,mr as decodeMcpHttpHeaderValue,OT as decodeQueryCursor,xT as decodeQueryCursorEnvelope,RT as decodeQueryCursorState,VT as decodeReadOutputContinuationCursor,vM as decoratePmMcpToolsWithApps,Tu as dedupeLinkedArtifacts,pR as defaultScoreContextCandidates,rN as defineAfterCommandHook,eN as defineBeforeCommandHook,tN as defineBeforeMutationHook,Fv as defineCommand,Vv as defineCommandOverride,q as defineCorpusShape,Qv as defineExporter,GI as defineExtension,UI as defineExtensionBlueprint,Dv as defineExtensionManifest,Gv as defineFlag,Zv as defineImporter,jv as defineItemField,Uv as defineItemType,Bv as defineMigration,iN as defineOnIndexHook,oN as defineOnReadHook,nN as defineOnWriteHook,Hv as defineParserOverride,ai as definePmCommandOutputBudget,dI as definePmCommandOutputEnvelope,iI as definePmErrorCodeCatalog,Kv as definePreflightOverride,$v as defineProjectProfile,Jv as defineRendererOverride,qv as defineSearchProvider,Wv as defineServiceOverride,zv as defineVectorStoreAdapter,Br as defineWorkspaceRecipe,R_ as deleteItem,zp as deleteWorkspaceSnapshot,Wb as dependencyToRelationship,Fm as deps,GA as deriveAssuranceProposals,qI as deriveExtensionCapabilities,oO as derivePmBulkMutationEffect,rv as derivePmRecoveryReferenceObligations,Hd as deriveSchemaEvolutionMigrationId,zw as deriveTelemetryCommandResolution,iw as describeAllowedTransitions,tx as describeExtensionActivation,zI as describeExtensionBlueprint,tl as describeItemOwnershipConflict,Ut as describeProfileComposition,jt as describeProjectProfile,bI as describeUnknownError,To as detectAgentIdentity,Ao as detectHarnessIdentity,od as detectRelationshipCommunities,So as diagnoseAgentIdentity,_d as diffRelationshipAuditSnapshots,Pf as diffTestRunMeasurements,WP as digestMcpRequestParameters,rC as discoverExtensions,Ln as discoverNearbyPmRoot,YN as discoverPmTools,Xg as discoverProjectRuntimeVersionPins,$m as docs,Pm as duplicates,yd as durableGraphCachePath,wd as durableGraphCacheStatus,Zn as effectiveItemFormatVersion,aE as emitTelemetryErrorEvent,dm as emptyImportedDocument,fr as encodeMcpHttpHeaderValue,AT as encodeQueryCursor,zT as encodeReadOutputContinuationCursor,US as enforceHistoryStreamPolicyForItem,jS as enforceHistoryStreamPolicyForItems,rI as enrichCliFlagInvocationContract,Ht as enrichCliFlagInvocationContracts,wE as ensureMaterializedHistoryTarget,vc as ensurePmGitignore,du as ensureScope,qw as ensureSentryInit,cm as ensureTrackerInitialized,rd as enumerateRelationshipPaths,ui as estimatePmOutputTokens,RA as evaluateAssuranceAssertion,OA as evaluateAssuranceGate,dk as evaluateBoundaryFixtures,hR as evaluateContextRanking,Mx as evaluateDefectGateEvidence,xA as evaluateMeasurement,$i as evaluateMutationGuard,Sf as evaluateProvenanceCoverage,bf as evaluateSemanticAttributionCoverage,Vl as evaluateSimilarityGovernance,ow as evaluateTransition,Pw as executeEmbeddingBatchesWithRetry,vw as executeVectorDelete,Nw as executeVectorReset,kw as executeVectorUpsert,vg as executeWorkspaceRecipe,gu as expandAddGlobEntries,Ru as explainSourceTraceability,v_ as extension,L_ as extensionActivate,D_ as extensionDeactivate,N_ as extensionList,Uy as extensionMigrate,EM as extractMcpTraceContext,bE as extractPatchFailureContext,Mu as extractReferencedPmItemIdsFromCommand,ey as federateRelationshipGraphSnapshots,Nm as files,Lm as filesDiscover,Dm as filesLookup,$g as findCoverageDeficits,zl as findDuplicateClusters,Gd as findGitWorkspaceRoot,Yd as findInstalledNpmPackageCandidate,kM as findPmMcpAppByUri,id as findRedundantRelationshipEdges,cd as findRelationshipCutStructure,ql as findSimilarItems,sE as finishTelemetryCommand,Ab as flattenFlagListValue,Ng as flushTelemetryQueue,I_ as focus,nd as forEachMatchedRelationshipEdge,pd as formatDuplicateEdgeGroup,Gc as formatHierarchyRelation,ld as formatOrderingStorageContradiction,pE as formatPmPositionalActionFlagTip,nf as formatProfileApplyHuman,rf as formatProfileLintHuman,ef as formatProfileListHuman,tf as formatProfileShowHuman,Xd as formatSchemaEvolutionMigrationHuman,IO as formatVectorIndexRecoveryWarnings,XO as formatWorkspacePositionHuman,f_ as gc,Ri as generateItemId,xm as get,gC as getActiveCommandResult,mS as getActiveContextIntentContracts,zn as getActiveExtensionRegistrations,xM as getActiveMcpTraceContext,PA as getAssuranceDeclaration,Y_ as getContracts,sT as getFocusedItem,Fn as getHistoryPath,RE as getItemAt,$n as getItemPath,Ui as getMutationActionContract,kc as getPmGitignoreBlock,Dn as getSettingsPath,X_ as getWorkspaceContracts,gi as getWorkspaceHistoryPath,Gm as graph,bd as graphAuditBaselinePath,Cf as groupHistoryByEpisode,Xv as handleServiceOverride,GP as hasMcpClientExtension,MM as hasPmMcpAppsCapability,Le as hasSubcommandFlagContractsForCommand,$w as hasVectorizationEmbeddingIdentityChanged,Fw as hasVectorizationVectorDimensionChanged,IS as hashDocument,PS as hashDocumentForVersion,MS as hashEmptyDocument,p_ as health,Zc as hierarchyAncestors,Qc as hierarchyDescendants,g_ as historyCompact,y_ as historyCompactBulk,dA as historyEntryMatchesProvenance,m_ as historyRedact,__ as historyRepair,h_ as historyRepairAll,Ux as indexBlockedByIds,Uc as indexHierarchyRelations,Gw as inferConsistentVectorDimension,ii as inferPmOutputBudgetClass,jm as init,KE as inspectCompleteListResult,Yb as inspectExtensionManifestSchema,Md as inspectHistoryAuthorStream,mx as inspectMergeReceiptEvidence,Jg as inspectProjectRuntimeCompatibility,Ki as inspectStaleInProgressItems,wx as inspectStatusRoleAssignments,yi as inspectWorkspaceHistoryState,Gp as inspectWorkspaceSnapshot,Vd as installMergeFence,jP as interpretMcpResultType,Pl as isAlreadyClaimedError,SI as isCommanderError,Yu as isErrnoError,BA as isExternalDependencyReference,qA as isExternalDependencySourceKind,oe as isFileMissingError,Mb as isHostOutputSuppressed,_ as isMcpRecord,Fi as isMutationAction,Hb as isOrderingRelationshipKind,zS as isPlaceholderReferenceToken,Rc as isPmCliExpectedError,Yo as isPmExtensionCapabilityContract,Zo as isPmExtensionPolicyModeContract,Qo as isPmExtensionPolicySurfaceContract,Jo as isPmExtensionServiceNameContract,rO as isPmKnownExitCode,lI as isPmMutationReceipt,$e as isPmSuccessfulExitCode,Xo as isPmToolAction,Yg as isProjectMutatingInvocation,Qw as isPureSnakeCaseAlias,lS as isReadOutputBudgetExceeded,bT as isReadRowContract,Pd as isRuntimeRecord,rE as isTerminalPlanMode,nT as isTerminalStatus,An as isTimestampLiteral,vI as itemDocumentToMutationOptions,pO as itemHasSchedule,ji as jaccardSimilarity,vm as learnings,xb as levenshteinDistanceWithinLimit,Ku as limitAnnotationEntries,Du as linkedTestTrustFingerprint,VI as lintExtensionBlueprint,Jb as lintExtensionManifestSchema,zt as lintProjectProfile,wm as list,ho as listAgentProvenanceAdapters,ah as listAliasPluralKeys,Em as listAllComplete,bw as listAllDocumentCandidatesCached,Ni as listAllItemMetadata,Cw as listAllItemMetadataLight,IA as listAssuranceDeclarations,LA as listAssuranceVerdicts,Og as listBuiltinCorpusShapes,xI as listCoreClosedDomainContracts,eR as listGetProjectionFields,lx as listInvalidProvenanceHistoryStreamIds,Zx as listListProjectionFields,_x as listMergeReceipts,Gi as listMutationActions,jO as listMutationEvents,an as listPmCommandFlagBudgets,cf as listPmCommandsForFamily,af as listPmCommandsForTier,Ee as listPmFlagLexicon,kv as listPmFlagSpellingInventory,df as listPmMcpToolsForProfile,Sv as listPmRequiredArgumentRefusalContracts,wv as listPmSubcommandRefusalContracts,Gt as listProfiles,xv as listTrackerPreflightRecoveryContracts,Up as listWorkspaceSnapshots,eA as loadContextIntentRuntimeLayers,Hp as loadCreateTemplateOptions,nC as loadExtensions,Ad as loadGraphAuditBaseline,Sb as loadMutationCheckpoint,M as loadRelationshipGraphAdapter,ki as locateItem,FC as looksLikeGenericKeyValueEntry,GT as mapReadOutputRows,hx as markMergeReceiptReconciled,rw as matchesRuntimeFilters,oE as maybeRunFirstUseTelemetryPrompt,Mg as measureCorpusShapePlan,LC as mergeAdditiveTags,BI as mergeExtensionBlueprints,MO as mergeHistoryStreams,LO as mergeItemDocuments,DO as mergeJsonDocuments,dh as mergeLinkedTestTwoTokenEntries,kO as mergeRelationshipEventStreams,Al as mergeSortedWarnings,tE as migrateItemFilesToFormat,Ew as mutateItem,ww as mutateItemWithHistoryContext,Ti as mutateWorkspaceJsonWithHistory,Rm as next,yo as normalizeAgentProvenanceAdapterValue,Hu as normalizeAnnotationTransportOptions,hA as normalizeAssuranceEvaluation,_A as normalizeAssuranceMutation,uh as normalizeBootstrapInvocation,XC as normalizeBulkIdsValue,Bc as normalizeDependencyGraphTarget,YA as normalizeDependencySeedId,XA as normalizeDependencySourceKind,Gn as normalizeExtensionContributionInventory,ux as normalizeInvalidHistoryProvenance,_I as normalizeItemAddressInvocation,Qn as normalizeItemFormatVersion,xi as normalizeItemId,no as normalizeItemMetadata,sh as normalizeLegacyExtensionActionSyntax,hu as normalizeLinkedPath,qS as normalizeParentReferenceValue,$t as normalizeProfileName,Ai as normalizeRawItemId,aS as normalizeReadOutputIncludeModeOptions,LS as normalizeReplayPatchOps,Bi as normalizeSimilarityText,rT as normalizeStatusForRegistry,ro as normalizeStatusInput,ZC as normalizeStatusInputWithRegistry,TI as normalizeThrownExitCode,km as notes,En as nowIso,Cd as openDurableGraphCache,KP as openMcpRequestState,ed as orderingPredecessors,td as orderingSuccessors,TR as packContextCandidates,Cl as packRankedContextItems,H_ as packageActivate,V_ as packageCatalog,K_ as packageDeactivate,q_ as packageDescribe,j_ as packageDoctor,G_ as packageInstall,$_ as packageLifecycle,F_ as packageList,B_ as packageManage,jy as packageMigrate,z_ as packageReload,U_ as packageUninstall,PT as paginateQueryRows,uu as parseAddEntries,lu as parseAddGlobEntries,Xu as parseAnnotationTextInput,PI as parseAtomicMutationControls,oh as parseBootstrapCommandName,th as parseBootstrapGlobalOptions,nh as parseBootstrapHelpRequest,lh as parseBootstrapTypeValue,WC as parseBulkIdsText,hl as parseContextDepth,pl as parseContextFocusFields,JE as parseContextIntentDeclarations,gl as parseContextSections,PR as parseContextSignalSnapshot,$C as parseCsvKv,vx as parseDefectChangeRiskRequest,kx as parseDefectRecurrencePolicy,Ip as parseEvalQuerySet,Od as parseGraphSubcommand,aA as parseHistoryProvenanceFilters,rA as parseIntegerLimit,oT as parseItemDocument,MI as parseItemMutationBatch,QS as parseLimit,op as parseLinkedTestAssertionEqualsMap,ip as parseLinkedTestAssertionGteMap,Zl as parseLinkedTestBoolean,Ql as parseLinkedTestContextMode,Jl as parseLinkedTestEnvClear,Yl as parseLinkedTestEnvSet,sp as parseLinkedTestJsonEntries,np as parseLinkedTestMinLines,rp as parseLinkedTestRegexList,tp as parseLinkedTestStringList,ep as parseLinkedTestWorkspaceContextMode,Ch as parseMcpCachePolicy,mh as parseMcpImplementation,Ke as parseMcpInputRequests,rr as parseMcpInputResponses,zh as parseMcpSubscriptionFilter,fu as parseMigrateEntries,Vx as parseMultiValueFilter,pI as parseMutationReceipt,KC as parseOptionalNonNegativeInteger,HC as parseOptionalNumber,Wk as parsePmAgentTaskTranscriptCorpus,XN as parsePmToolDiscoveryOptions,nA as parsePriority,Wx as parsePriorityFilterSet,WT as parseReadOutputSession,IC as parseRegisteredItemFieldAssignments,ee as parseRelationshipGraphSnapshot,pu as parseRemoveEntries,xu as parseSourceLineRange,XS as parseStatusFilterCsv,Hx as parseStringFilterSet,Kn as parseTags,Of as parseTestRunMeasurements,oA as parseType,Kx as parseTypeFilterSet,Ld as parseUnknownAuthorHistoryEventCoordinates,HR as partitionDecisionEntries,FS as patchPathToChangedField,Tn as pathExists,M_ as pauseTask,Td as persistDurableGraphResult,sw as persistSelectedItemFormat,gO as planAgentIdentityVocabularyMutation,DR as planCompletedAtBackfill,Vt as planProfileApplication,Zk as planRelationshipEventBackfill,Rd as planRelationshipRemediation,Kd as planSchemaEvolutionMigration,vd as planUnknownAuthorHistoryAcknowledgment,jp as planWorkspaceSnapshotRestore,_E as positionalShapeKey,hE as positionalSignatureKey,XI as preflightExtension,zi as prepareSimilarityText,jC as preserveMutationStdinTokenFields,UC as preserveMutationStdinTokenLiterals,xS as printError,AS as printResult,s_ as profile,d_ as profileApply,u_ as profileLint,a_ as profileList,c_ as profileShow,bC as projectAfterCommandItemSnapshot,fl as projectContextFocusRows,xf as projectFleetAttributionAnalytics,cA as projectHistoryProvenance,pi as projectPmDiagnosticOutput,fi as projectPmDiagnosticText,Ef as projectProvenanceCoverageAnalytics,Uu as projectValidateCounts,jA as promoteAssuranceAssertion,_k as pruneCompileCacheGenerations,MA as putAssuranceDeclaration,kA as putAssuranceDeclarationBundle,pw as queryItemMetadataIndex,fw as queryLinkedFileMetadataIndex,mw as querySimilarItemMetadataIndex,If as queryTestRunMeasurementsBelow,Oo as quoteCommandArg,Ro as quoteWindowsCommandArg,AI as rankCommandPaths,Wu as readAnnotationEntries,wo as readAuthorEnvironment,qf as readBooleanOption,xR as readContextUsageAffinity,zf as readCsvListOption,tu as readExtensionMigrationState,Sn as readFileIfExists,is as readFirstStringFromCommanderOptions,ss as readFirstValueFromCommanderOptions,Tf as readHistoryAnalyticsWindow,lT as readHistoryEntries,mf as readImprovementLedger,gw as readItemMetadataDerivedIndexState,vi as readLocatedItem,$T as readOutputBudgetCollections,qT as readOutputCollectionFingerprint,DT as readOutputContinuationRowCollections,NT as readOutputContinuationRowPaths,iS as readOutputIncludeModeOptions,LT as readOutputRowCollections,vT as readOutputRowPaths,JT as readOutputSessionRemainingTokens,It as readPmPackageManifest,J_ as readRequiredString,Oi as readSettings,aw as readSettingsWithMetadata,as as readStringArrayFromCommanderOptions,Bf as readStringOption,CI as readThrownExitCode,Uw as readVectorizationStatusLedger,ZE as readWorkspaceContextIntentContracts,NR as readWorkspaceContextSignals,GR as readWorkspaceMemory,WO as readWorkspacePosition,qn as reconcileExtensionCapabilityUsage,wi as reconcileWorkspaceJsonHistory,yC as recordAfterCommandAffectedItem,NA as recordAssuranceVerdict,al as recordClaimSemanticAttribution,wR as recordContextUsageServing,ER as recordContextUsageTouch,AR as recordContextUsageTouches,dl as recordFocusSemanticAttribution,ff as recordImprovementObservation,cl as recordReleaseSemanticAttribution,yw as refreshItemMetadataDerivedIndex,qd as refreshMergeAttributeFenceIfInstalled,Bw as refreshSearchArtifactsForMutation,go as registerAgentProvenanceAdapters,KA as registerExternalDependencyResolver,_o as registerHarnessSignalDescriptors,pT as registerOutputMaterialFieldGroups,A_ as release,vA as removeAssuranceDeclaration,wn as removeFileIfExists,Eu as renameArtifactsResultKey,nl as renderCalendarMarkdown,ol as renderCalendarToon,xl as renderContextMarkdown,Qd as renderExtensionDescribeMarkdown,Jd as renderExtensionSurfaceMarkdown,fm as renderGuideMarkdown,yI as renderMissingOptionRetry,KR as renderNextMarkdown,RI as renderPmClosedDomainHelp,Io as renderPmCommand,vo as renderPmCommandAliasMigrationHint,pf as renderPmCommandVisibilityMarkdown,Nv as renderPmFlagLexiconMarkdown,NM as renderPmMcpAppHtml,lv as renderPmRefusalClosureCensusMarkdown,JS as renderRowsAsCsv,ZS as renderRowsAsTable,T_ as reopen,SE as replayHistoryToTarget,vS as replayToCanonicalItemDocument,kS as replayToItemDocument,YR as requireTerminalReason,JR as requireTerminalReasonWithRecovery,mC as resetActiveExtensionRuntimeState,Yc as resetWorkspaceGraphCache,co as resolveAgentSessionContextFromSignals,el as resolveAnnotationIndex,Ju as resolveAnnotationInput,uT as resolveAuthor,xo as resolveAuthorIdentity,BS as resolveBodyFileContent,Ig as resolveBuiltinCorpusShape,rl as resolveCalendarOutputFormat,sI as resolveCanonicalPmErrorCodeContract,Vb as resolveCanonicalRelationshipKind,dT as resolveClaimPrincipal,YC as resolveCliBulkIdsInput,Ub as resolveCommandOptionPolicyState,mk as resolveCompileCacheGeneration,LR as resolveCompletionTimestamp,Nb as resolveConfiguredPmPackageRoot,rR as resolveContentFieldFilters,gS as resolveContextIntentContract,ml as resolveContextOutputFormat,_l as resolveContextTokenBudget,aO as resolveCreateExplicitEmptyFlag,Aw as resolveEmbeddingProviders,iu as resolveExtensionInstallSourceIdentity,eu as resolveExtensionMigrationStatePath,tC as resolveExtensionRoots,WA as resolveExternalDependencyReference,Eb as resolveFlagValueKind,lm as resolveGuideOutputFormat,_f as resolveHistoryEpisodeGroupIdentity,sA as resolveHistoryProvenanceDimensions,EE as resolveHistorySubject,CE as resolveHistoryTarget,EO as resolveHybridSemanticWeight,Nn as resolveImplicitPmRoot,bb as resolveIsoOrRelative,Bx as resolveItemBlockers,kI as resolveItemMutationDocument,vn as resolveItemTypeRegistry,JC as resolveItemTypesFilePath,Ff as resolveLinkedTestFailureExitCode,ku as resolveLinkedTestSourceRef,vu as resolveLinkedTestSourceWorkspaceRoot,$u as resolveLinkedTestTrust,Fu as resolveLinkedTestTrustBatch,Vh as resolveMcpAcknowledgedSubscriptionFilter,qe as resolveMcpRequestContext,Fd as resolveMergeInstallContext,tR as resolveMissingMetadataFilters,gI as resolveMissingOptionPlaceholder,yT as resolveModePairedOutputOmissionReceipt,zR as resolveNextOutputFormat,TT as resolveOutputOmissionReceipt,vb as resolvePmCliVersion,ko as resolvePmCommandAlias,Ue as resolvePmCommandCapabilityFamily,vt as resolvePmCommandExitContract,di as resolvePmCommandOutputBudget,Wt as resolvePmCommandOutputEnvelope,uE as resolvePmCommandPositionalContract,je as resolvePmCommandVisibilityTier,li as resolvePmDiagnosticOutputBudget,aI as resolvePmErrorCodeContract,Dy as resolvePmFlagSemanticConcept,kb as resolvePmPackageRootFromModule,lE as resolvePmPositionalActionContract,pc as resolvePmPositionalActionFlagContracts,Oe as resolvePmRoot,_c as resolvePmToolCustomFieldCollision,KS as resolvePriority,Ft as resolveProfile,jd as resolveProjectMergeTypeFolders,IT as resolveQueryCursorStart,cS as resolveReadOutputDimensions,pS as resolveReadOutputEncoding,jT as resolveReadOutputRecoveryBudget,nS as resolveReadOutputSurface,CT as resolveReadRowContract,hI as resolveRecoveryCommandName,MC as resolveRegisteredSearchProvider,kC as resolveRegisteredVectorStoreAdapter,Yi as resolveReproducibleProcessEnvironment,Xn as resolveRuntimeFieldRegistry,Wn as resolveRuntimeStatusRegistry,xw as resolveSearchCorpusFields,SO as resolveSearchMaxResults,TO as resolveSearchPage,wO as resolveSearchScoreThreshold,AO as resolveSearchTuning,Ow as resolveSemanticCorpusCharacterLimit,sl as resolveSemanticLineageIds,dw as resolveSettingsWithSemanticRuntimeDefaults,ox as resolveSourceContextWritePolicy,of as resolveStartTaskInProgressStatus,X as resolveSubcommandFlagContractsForCommand,fb as resolveTelemetryErrorCategory,XR as resolveTerminalReason,Gb as resolveTypeDefinition,Fb as resolveTypeName,YS as resolveTypeSynonym,nw as resolveTypeWorkflows,Nd as resolveUnknownAuthorAcknowledgmentSelector,OO as resolveVectorIndexRecovery,Mw as resolveVectorStores,Dc as resolveWorkspaceRelationshipKindRegistry,Bb as resolveWorkspaceRoot,O_ as restore,wb as restoreCheckpointItems,Ei as restoreWorkspaceJsonFromHistory,qp as restoreWorkspaceSnapshot,Bp as restoreWorkspaceSnapshotWithRecovery,Q_ as runAction,SC as runActiveBeforeMutationHooks,EC as runActiveCommandHandler,wC as runActiveOnIndexHooks,Hn as runActiveOnReadHooks,Vn as runActiveOnWriteHooks,AC as runActiveParserOverride,xC as runActivePreflightOverride,RC as runActiveServiceOverride,Lc as runActivity,eC as runAfterCommandHooks,zu as runAggregate,Qu as runAnnotationCommand,Vu as runAppend,Dx as runAssuranceAction,$x as runAssuranceDispatch,Qb as runBeforeCommandHooks,il as runCalendar,Ml as runClaim,kl as runClaimNext,Ll as runClose,$l as runCloseMany,Fl as runComments,mm as runCompletion,yp as runConfig,kt as runContext,bR as runContextEvaluationCorpus,gR as runContextEvaluationScenario,fp as runCopy,ap as runCreate,mp as runDelete,Jc as runDeps,Au as runDocs,fI as runDuplicates,kp as runEval,Np as runEvent,su as runExtension,ou as runExtensionMigrateAction,nu as runExtensionMigrations,Ou as runFiles,Pu as runFilesDiscover,Iu as runFilesLookup,Af as runFleetAttributionAnalytics,_p as runFocus,gp as runGc,hp as runGet,Id as runGraph,pm as runGuide,au as runHealth,iO as runHistory,JO as runHistoryCompact,eI as runHistoryCompactBulk,AE as runHistoryRedact,Cx as runHistoryRepair,Sx as runHistoryRepairAll,Ap as runInit,Sp as runInitAgentGuidance,Gl as runLearnings,wu as runLinkedArtifacts,Gf as runLinkedTests,qu as runList,vp as runMeet,FO as runMergeDriver,zd as runMergeInstall,yx as runMergeReceiptEvidenceReport,gx as runMergeReceiptReport,GO as runMergeReconcile,Il as runNext,Ul as runNotes,pp as runPlan,Qp as runProfileApply,Zp as runProfileLint,Yp as runProfileList,Jp as runProfileShow,wf as runProvenanceCoverageAnalytics,ZI as runRegisteredCommandForTest,nP as runRegisteredCommandOverrideForTest,uP as runRegisteredExporterForTest,eP as runRegisteredHookForTest,dP as runRegisteredImporterForTest,cP as runRegisteredMigrationForTest,QI as runRegisteredMutationGuardForTest,tP as runRegisteredParserOverrideForTest,rP as runRegisteredPreflightOverrideForTest,oP as runRegisteredRendererOverrideForTest,sP as runRegisteredSearchProviderForTest,iP as runRegisteredServiceOverrideForTest,aP as runRegisteredVectorStoreAdapterForTest,Xt as runReindex,vl as runRelease,Lp as runRemind,tI as runReopen,Dl as runRestore,Wd as runSchemaEvolutionMigration,Pp as runSearch,kg as runSearchRefreshWorkerEntrypoint,_m as runStartBackgroundRun,Mf as runStats,vf as runTelemetry,Wp as runTemplatesList,Kp as runTemplatesSave,Xp as runTemplatesShow,Uf as runTest,jf as runTestAll,hm as runTestRunsList,ym as runTestRunsLogs,Cm as runTestRunsResume,gm as runTestRunsStatus,bm as runTestRunsStop,Tm as runTestRunsWorker,cp as runUpdate,dp as runUpdateMany,Nt as runUpgrade,Bu as runValidate,Z_ as runWithActiveExtensions,uo as runWithAgentSessionContext,_S as runWithContextIntentContracts,tA as runWithDiscoveredContextIntentContracts,bo as runWithHarnessDetectionSignals,AM as runWithMcpTraceContext,Zi as runWithReproducibleProcessEnvironment,Co as runWithWorkspaceHarnessSignalDescriptors,qr as runWithWorkspaceRecipe,_O as runWorkspaceTransactionGc,xd as saveGraphAuditBaseline,ZA as scanExtensionHostVersions,kd as scanHistoryAuthorAttribution,to as scanItemFormatVersions,Di as scanMutationSecrets,px as scanProvenanceResolverHealth,Wi as scanStaleInProgressItems,Ax as scanStorageIntegrity,qm as schema,Ym as schemaAddField,Wm as schemaAddStatus,Hm as schemaAddType,e_ as schemaApplyPreset,t_ as schemaInferTypes,zm as schemaList,Zm as schemaListFields,o_ as schemaRemapStatus,Jm as schemaRemoveField,Xm as schemaRemoveStatus,Km as schemaRemoveType,n_ as schemaRenameField,r_ as schemaRenameType,Vm as schemaShow,Qm as schemaShowField,i_ as schemaShowStatus,EI as scoreCommandPathMatch,fR as scoreContextCandidates,mR as scoreContextCandidatesWithActiveExtensions,Vi as scoreItemSimilarity,Ev as scorePmGrammarRefusalClosure,mv as scorePmRefusalClosure,Hi as scorePreparedItemSimilarity,Rv as scoreTrackerPreflightRecoveryClosure,HP as sealMcpRequestState,Am as search,BR as searchWorkspaceMemory,qR as searchWorkspaceMemoryReadResult,wT as selectCursorSemanticOptions,am as selectImportAuthor,CM as selectMcpClientRegistrationMode,jR as selectWorkspaceMemory,UR as selectWorkspaceMemoryRollups,ll as semanticAttributionAffinity,Ww as sentryCaptureCliError,Kw as sentryFinishCommandSpan,Yw as sentryFlush,Xw as sentryLogCliUsageError,Vw as sentrySetCommandContext,Hw as sentryStartCommandSpan,io as serializeItemDocument,OI as serializeNdjsonRows,II as serializeNdjsonStream,_C as setActiveCommandContext,hC as setActiveCommandResult,cC as setActiveExtensionCommands,aC as setActiveExtensionHooks,dC as setActiveExtensionParsers,uC as setActiveExtensionPreflight,fC as setActiveExtensionRegistrations,pC as setActiveExtensionRenderers,lC as setActiveExtensionServices,aT as setFocusedItem,nE as shouldCompletePlanOnClose,Ed as shouldPersistDurableGraphCache,zC as shouldResolveMutationStdinTokenField,qC as shouldResolveMutationStdinTokens,lw as shouldRunSearchRefreshInForeground,Bl as similarityAdvisoryWarnings,kT as sliceReadOutputRowCollection,Cu as sortLinkedArtifacts,vC as splitAcceptanceCriteria,eE as splitCommaList,oo as splitFrontMatter,dS as stabilizeReadOutputReceiptEstimates,ie as stableStringify,Zb as stableValueEquals,P_ as startTask,iE as startTelemetryCommand,Im as stats,QC as statusIsTerminal,rh as stripGlobalBootstrapTokens,BO as subscribeMutationEventBatches,qO as subscribeMutationEvents,hO as summarizeAgentIdentityVocabulary,gf as summarizeAgentModelProvenance,yf as summarizeAgentProvenance,yR as summarizeContextEvaluationReports,Nf as summarizeContextPreflight,lA as summarizeHistoryProvenance,wp as summarizeInitResult,fx as summarizeMergeReceipt,cO as supportsCreateExplicitEmpty,mI as supportsItemIdAlias,Pb as suppressHostOutput,Te as syncRelationshipGraphAdapter,HI as synthesizeExtensionManifest,fc as toCompletionFlagString,El as toContextFocusItem,Tl as toContextPackingSummary,Sl as toContextRankingSummary,_b as toErrorMessage,Hf as toEstimatedMinutesValue,jE as toExtensionFlagDefinitions,Jf as toImportBoolean,tm as toImportConfidence,Yf as toImportInteger,im as toImportLinkedDocs,om as toImportLinkedFiles,sm as toImportLinkedTests,nm as toImportLogEntries,rm as toImportNormalizedEnum,em as toImportNumberMap,Kf as toImportPriority,Xf as toImportStatus,Zf as toImportStringList,Qf as toImportStringMap,Wf as toImportTags,iT as toItemRecord,Vf as toNonEmptyImportString,mb as toNonEmptyStringOrUndefined,NS as toReplayDocument,qi as tokenizeSimilarityText,BC as transferMutationStdinTokenPolicy,HO as translateHostEnvironmentFault,C_ as update,W_ as upgrade,l_ as validate,SA as validateAssertionDefinition,EA as validateAssuranceDocument,wA as validateGateDefinition,NI as validateItemMutationRows,Su as validateLinkedPaths,TM as validateMcpAuthorizationResponseIssuer,bM as validateMcpAuthorizationServerMetadata,SM as validateMcpClientMetadataDocument,lM as validateMcpHttpRequestHeaders,YP as validateMcpJsonSchema,TA as validateMeasurementDefinition,VS as validateMissingParentReference,oS as validateReadOutputOptions,WS as validateSprintOrReleaseValue,jb as validateTypeOptions,nI as verifyCliFlagInvocationParity,mE as verifyExplicitPositionalSlotCensus,$S as verifyHistoryChain,DS as verifyHistoryChainWithVersion,xE as verifyHistoryEntries,yE as verifyPmCliGrammar,gE as verifyPmCommandPositionalContracts,vv as verifyPmFlagLexicon,iv as verifyPmRecoveryKindRuntimeCoverage,xy as verifyPmRecoveryProducerRuntimeCoverage,ov as verifyPmRecoveryReferences,dv as verifyPmRefusalClosureIdentityRatchet,cv as verifyPmRefusalClosureRatchet,nv as verifyPmRefusalReachability,ms as verifyToolOptionCliParity,ks as withFlagAliasMetadata,KO as withHostEnvironmentBoundary,XP as withMcpCachePolicy,Xc as workspaceGraphCache,Zu as wrapOwnershipConflict,wI as wrapThrownErrorForSentry,Eo as writeAuthorEnvironment,Re as writeFileAtomic,Tb as writeMutationCheckpoint,cw as writeSettings,ES as writeStdout,jw as writeVectorizationStatusLedger,Si as writeWorkspaceJsonWithHistory};
|
|
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 hy(e,t,r){if(e[t]!=="/"||!my(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 gy(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 yy(e){let t=[],r=0;for(;r<e.length;){let n=_y(e,r);if(n!==void 0){r=n;continue}let o=hy(e,r,t.at(-1));if(o!==void 0){r=o;continue}let i=gy(e,r);i.token&&t.push(i.token),r=i.next}return t}var by=new Set(["object","block","pattern"]),Ty=new Set(["const","let","var"]),Cy=new Set(["}",")","]"]),Sy=new Set(["=","(","[",",",":","?","return"]);function Ey(e,t,r){if([...r].reverse().find(i=>by.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"&&Ty.has(o.value)?"pattern":o?.value==="=>"||o?.value===")"?"block":o&&Sy.has(o.value)?"object":"block"}function wy(e,t,r){let n=e[t];if(n.value==="{"){let a=Ey(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 Ay(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 xy(e,t){return e[t+1]?.value===")"&&e[t+2]?.value==="=>"||e[t+1]?.value==="="}function Oy(e){let t=yy(en.stripTypeScriptTypes(e,{mode:"strip"})),r=[],n=[];for(let[o,i]of t.entries()){let s=n.at(-1),a=Ay(s,i,t[o+1]);a&&s.candidates.push(a);let c=wy(t,o,n);if(c)n.push(c);else if(Cy.has(i.value)){let d=n.pop();d?.kind==="object"&&!xy(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 Ry(e){let t=[0];for(let r=0;r<e.length;r+=1)e[r]===`
|
|
30
|
+
`&&t.push(r+1);return t}function Iy(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 pv(e){let t=[],r=[];for(let o of[...e].sort((i,s)=>W(i.path,s.path))){let i=Ry(o.content),s;try{s=Oy(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=Iy(i,a.offset),u=tn(c);u?t.push({path:o.path,line:d,field:c,kind:u.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(re.map(o=>[o,t.filter(i=>i.kind===o).length]));for(let o of re)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?W(o.path,i.path):o.line!==i.line?o.line-i.line:W(o.field,i.field)),r.sort((o,i)=>o.subject!==i.subject?W(o.subject,i.subject):W(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 fv(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])=>W(c,d))){let c=tn(s),d=c?.kind==="migration_hint"&&o.semantics==="behavior_preserving"?{...c,semantics:"behavior_preserving"}:c,u=[a].flat();d!==void 0&&u.forEach((p,m)=>{let y="nested_value_field"in d&&typeof d.nested_value_field=="string"?d.nested_value_field:void 0,h=y&&typeof p=="object"&&p!==null&&!Array.isArray(p)?p[y]:p;if(typeof h!="string"||h.trim().length===0)return;let T=[...i,s,String(m)].map(S=>encodeURIComponent(S)).join("/");r.push({id:`${e}:${d.kind}:${T}`,probe_id:e,kind:d.kind,semantics:d.semantics,value:h})}),n(a,[...i,s])}};return n(t,[]),r}function mv(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 _v(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=re.map(c=>{let d=e.filter(p=>p.kind===c),u=d.filter(p=>!o.has(p.id)).map(p=>i.get(p.id)).filter(p=>p!==void 0);return{kind:c,declared:d.length,observed:u.length,passed:d.filter(p=>{let m=i.get(p.id);return!o.has(p.id)&&m?.reachable===!0&&m.semantics===p.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 Py(e,t){let r=new Map(re.map(i=>[i,new Set]));for(let i of t)r.get(i.kind).add(i.value);let n=re.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 hv=Py;(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 yv=16,My=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"]),rn=18,nn=Object.freeze([...My,"manifest_unknown_key","no_version_bounds_declared"].sort((e,t)=>e.localeCompare(t)));function bv(e,t=rn){return{ok:e.executable_error_code_count>=t,baseline:t,actual:e.executable_error_code_count}}function Tv(e,t=nn){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 ut(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 Cv(e,t,r){let n=new Map(e.map(u=>[u.code,u.canonical_code??u.code])),o=new Map,i=0,s=0;for(let u of e){let p=ut(o,u.canonical_code??u.code);for(let m of u.owned_states??[])p.kinds.add("owned_state"),p.probeIds.add(m.probe_id)}for(let u of t){let p=n.get(u.error_code);if(p===void 0)continue;i+=1;let m=ut(o,p);m.kinds.add("closed_domain"),m.probeIds.add(u.probe_id)}for(let u of r){let p=n.get(u.error_code);if(p===void 0)continue;s+=1;let m=ut(o,p);m.kinds.add("grammar"),m.probeIds.add(u.probe_id)}let a=e.map(u=>{let p=u.canonical_code??u.code,m=o.get(p),y=[...m.probeIds].sort();return{code:u.code,canonical_code:p,disposition:y.length>0?"executable":"uncovered",evidence_kinds:[...m.kinds].sort(),probe_ids:y}}).sort((u,p)=>u.code<p.code?-1:1),c=a.filter(({disposition:u})=>u==="uncovered").map(({code:u})=>u),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 Sv(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: ${rn}`,`- Required executable canonical codes: ${nn.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 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};
|
|
33
33
|
//# sourceMappingURL=sdk.js.map
|