@unbrained/pm-cli 2026.9.30 → 2026.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +2 -2
- package/CHANGELOG.md +20 -0
- package/dist/cli/error-guidance.d.ts +5 -0
- package/dist/cli/error-guidance.js +1 -1
- package/dist/cli/main.js +2 -2
- package/dist/cli/register-list-query.d.ts +8 -5
- package/dist/cli/register-list-query.js +2 -2
- package/dist/cli/register-structured-mutation.d.ts +2 -0
- package/dist/cli/register-structured-mutation.js +1 -1
- package/dist/cli/runtime/projection-retry.d.ts +9 -0
- package/dist/cli/runtime/projection-retry.js +2 -0
- package/dist/cli/runtime/selection.d.ts +5 -1
- package/dist/cli/runtime/selection.js +1 -1
- package/dist/cli-bundle/bundle-manifest.json +157 -157
- package/dist/cli-bundle/chunks/{chunk-EGAIIWI3.js → chunk-7FUEQOYG.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-7NL3A2BY.js +2 -0
- package/dist/cli-bundle/chunks/chunk-CZLAWXDR.js +8 -0
- package/dist/cli-bundle/chunks/chunk-HY6M34B4.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-O23CQ5T4.js → chunk-MTJMOI4I.js} +14 -14
- package/dist/cli-bundle/chunks/chunk-R4TUD355.js +6 -0
- package/dist/cli-bundle/chunks/chunk-R7ULWMBG.js +238 -0
- package/dist/cli-bundle/chunks/chunk-SV7CZEVV.js +20 -0
- package/dist/cli-bundle/chunks/chunk-TRYXVQ7W.js +3 -0
- package/dist/cli-bundle/chunks/{chunk-BTCE36JS.js → chunk-WP6NRH72.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-XRN3JYNN.js → chunk-XOUBIF6Z.js} +38 -38
- package/dist/cli-bundle/chunks/chunk-Z2GYDSAO.js +3 -0
- package/dist/cli-bundle/chunks/{chunk-6YEET7XI.js → chunk-ZI7F3FVE.js} +47 -47
- package/dist/cli-bundle/chunks/{register-list-query-SYNBVMNG.js → register-list-query-R4PHNB7W.js} +6 -6
- package/dist/cli-bundle/chunks/register-mutation-PDDAUDYV.js +20 -0
- package/dist/cli-bundle/chunks/{register-operations-7FCJUC4Z.js → register-operations-A5HJT46K.js} +2 -2
- package/dist/cli-bundle/chunks/{register-setup-YTWW2KL5.js → register-setup-EZ2F25JI.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-MOUCTR72.js → chunk-3BIYG72P.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-T4PZJQG4.js → chunk-4FFPGNCJ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-AKB3JN57.js → chunk-BLCTBSGT.js} +45 -45
- package/dist/cli-bundle/focused-chunks/{chunk-XUCXRZZZ.js → chunk-DBD4W4QP.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-KZULQIAG.js → chunk-E754JDLY.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-4AORVUT4.js → chunk-EJN7DY3B.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-OMBDUJWZ.js → chunk-FKK2HI3S.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-GBD4EN6S.js +12 -0
- package/dist/cli-bundle/focused-chunks/{chunk-ZJ3CLTV4.js → chunk-GMYUNHST.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-IR4UXLRP.js +20 -0
- package/dist/cli-bundle/focused-chunks/{chunk-RIJQQOEZ.js → chunk-UTRSM3ZK.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-EVMH4SKN.js → chunk-VVWYI2X7.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-WCY6HRZO.js +30 -0
- package/dist/cli-bundle/focused-chunks/{chunk-XB5Q2P7Z.js → chunk-XRSCIYHR.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-YC32ZSLS.js +165 -0
- package/dist/cli-bundle/focused-chunks/{chunk-IQBFYQF2.js → chunk-ZIXFMIUL.js} +2 -2
- package/dist/cli-bundle/main.js +22 -22
- package/dist/cli-bundle/sdk-authoring.js +1 -1
- package/dist/cli-bundle/sdk-contracts.js +2 -2
- package/dist/cli-bundle/sdk-core.js +2 -2
- package/dist/cli-bundle/sdk-governance.js +1 -1
- package/dist/cli-bundle/sdk-graph.js +1 -1
- package/dist/cli-bundle/sdk-merge.js +48 -48
- package/dist/cli-bundle/sdk-query.js +1 -1
- package/dist/cli-bundle/sdk-runtime.js +1 -1
- package/dist/cli-bundle/sdk-testing.js +1 -1
- package/dist/cli-bundle/sdk.js +7 -7
- package/dist/core/fs/fs-utils.d.ts +11 -0
- package/dist/core/fs/fs-utils.js +2 -2
- package/dist/core/shared/errors.d.ts +9 -0
- package/dist/core/shared/errors.js +1 -1
- package/dist/core/store/settings.d.ts +15 -5
- package/dist/core/store/settings.js +3 -3
- package/dist/core/telemetry/runtime.js +3 -3
- package/dist/mcp/server.js +1 -1
- package/dist/sdk/agent/closed-domain-contracts.js +1 -1
- package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1 -1
- package/dist/sdk/generated/generated-error-code-catalog-part-2.js +1 -1
- package/dist/sdk/item-transaction.d.ts +11 -0
- package/dist/sdk/item-transaction.js +1 -1
- package/dist/sdk/merge/install.d.ts +2 -2
- package/dist/sdk/merge/install.js +1 -1
- package/dist/sdk/pagination.js +1 -1
- package/dist/sdk/public-surface.json +1 -1
- package/dist/sdk/query/context.d.ts +2 -0
- package/dist/sdk/query/context.js +1 -1
- package/dist/sdk/query/get.d.ts +19 -15
- package/dist/sdk/query/get.js +1 -1
- package/dist/sdk/query/list.js +1 -1
- package/dist/sdk/query/search-contracts.js +1 -1
- package/dist/sdk/query/search-pagination.d.ts +4 -0
- package/dist/sdk/query/search-pagination.js +1 -1
- package/dist/sdk/query/search.js +1 -1
- package/dist/sdk/read-output/options.d.ts +14 -0
- package/dist/sdk/read-output/options.js +2 -0
- package/dist/sdk/read-output-budget.js +1 -1
- package/dist/sdk/read-output-contracts.js +1 -1
- package/dist/sdk/read-output-rows.d.ts +4 -0
- package/dist/sdk/read-output-rows.js +1 -1
- package/dist/sdk/runtime-primitives.d.ts +2 -2
- package/dist/sdk/runtime-primitives.js +1 -1
- package/dist/sdk/runtime.js +1 -1
- package/dist/sdk/workspace-transaction.d.ts +2 -0
- package/dist/sdk/workspace-transaction.js +2 -2
- package/docs/BOUNDED_CONTEXT_READS.md +10 -7
- package/docs/COMMANDS.md +1 -1
- package/docs/MERGE_SAFETY.md +12 -6
- package/docs/OUTPUT_PROJECTION_CONTRACTS.md +27 -0
- package/docs/SDK.md +98 -0
- package/docs/generated/REFUSAL_CLOSURE_CENSUS.md +6 -3
- package/marketplace.json +2 -2
- package/package.json +1 -1
- 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-claude/package.json +2 -2
- package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
- package/plugins/pm-codex/package.json +2 -2
- package/plugins/pm-codex/plugin.json +1 -1
- package/dist/cli-bundle/chunks/chunk-6XTJLOKW.js +0 -3
- package/dist/cli-bundle/chunks/chunk-A6NDNRCK.js +0 -6
- package/dist/cli-bundle/chunks/chunk-BNAT4EYR.js +0 -20
- package/dist/cli-bundle/chunks/chunk-BX4LEJX4.js +0 -8
- package/dist/cli-bundle/chunks/chunk-FYTXVVZG.js +0 -2
- package/dist/cli-bundle/chunks/chunk-UIAH7UFK.js +0 -238
- package/dist/cli-bundle/chunks/chunk-USTAFHIM.js +0 -2
- package/dist/cli-bundle/chunks/chunk-YM342ELM.js +0 -3
- package/dist/cli-bundle/chunks/register-mutation-4GSUK23D.js +0 -20
- package/dist/cli-bundle/focused-chunks/chunk-3CAZ7Z4R.js +0 -30
- package/dist/cli-bundle/focused-chunks/chunk-EFD4ATS7.js +0 -12
- package/dist/cli-bundle/focused-chunks/chunk-IDB6E3ZV.js +0 -165
- package/dist/cli-bundle/focused-chunks/chunk-UPOMLSW7.js +0 -20
package/dist/cli-bundle/sdk.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{A as PM,B as MM,C as kM,D as xM,E as NM,a as Vn,b as $S,c as FS,d as GS,e as US,f as jS,g as Yi,h as Ji,i as Zi,j as Qi,k as es,l as OM,m as RM,n as Ch,o as Th,p as Sh,r as Eh,s as wh,t as Ah,u as vh,v as Oh,w as Rh,x as Ih,y as Ph,z as IM}from"./chunks/chunk-USTAFHIM.js";import{A as Ck,B as Tk,C as Sk,D as Ek,E as wk,F as Ak,G as vk,H as Ok,I as Rk,J as Ik,K as Pk,L as Mk,M as kk,N as xk,O as Nk,P as Lk,Q as Dk,R as $k,S as Fk,T as Gk,U as Uk,V as jk,W as Bk,X as qk,Y as zk,a as WM,b as XM,c as YM,d as JM,e as ZM,f as QM,g as ek,h as tk,i as rk,j as ok,k as nk,l as ik,m as sk,n as ak,o as ck,p as dk,q as lk,r as uk,s as pk,t as mk,u as fk,v as _k,w as hk,x as gk,y as yk,z as bk}from"./chunks/chunk-BX4LEJX4.js";import{a as Mh}from"./chunks/chunk-BTCE36JS.js";import{a as LM,b as DM,c as $M,d as FM}from"./chunks/chunk-YM342ELM.js";import{a as GM,b as UM,c as jM,d as BM,e as qM,f as zM,g as VM,h as HM,i as KM}from"./chunks/chunk-FYTXVVZG.js";import{$ as rm,$a as Kf,$b as K_,A as Ve,Aa as _f,Ab as C_,B as Bp,Ba as hf,Bb as T_,C as qp,Ca as gf,Cb as S_,D as zp,Da as yf,Db as E_,E as Vp,Ea as bf,Eb as w_,F as Hp,Fa as Cf,Fb as A_,G as Bt,Ga as Tf,Gb as v_,H as qt,Ha as Sf,Hb as O_,I as zt,Ia as Ef,Ib as R_,J as Vt,Ja as wf,Jb as I_,K as Ht,Ka as Af,Kb as P_,L as Kt,La as vf,Lb as M_,M as Wt,Ma as Of,Mb as k_,N as Xt,Na as Rf,Nb as x_,O as Yt,Oa as If,Ob as N_,P as Jt,Pa as Pf,Pb as L_,Q as Zt,Qa as Mf,Qb as D_,R as Kp,Ra as kf,Rb as $_,S as Wp,Sa as xf,Sb as F_,T as Xp,Ta as Nf,Tb as G_,U as Yp,Ua as Lf,Ub as U_,V as Jp,Va as Qt,Vb as j_,W as He,Wa as me,Wb as B_,X as Zp,Xa as qf,Xb as q_,Y as Qp,Ya as zf,Yb as z_,Z as em,Za as Vf,Zb as V_,_ as tm,_a as Hf,_b as H_,a as MS,aa as om,ab as Wf,ac as W_,b as kS,ba as nm,bb as Xf,bc as X_,c as xS,ca as im,cb as Yf,cc as Y_,d as NS,da as cM,db as Jf,dc as J_,e as LS,ea as dM,eb as Zf,ec as Z_,f as DS,fa as lM,fb as Qf,fc as Q_,g as Ni,ga as ym,gb as e_,gc as eh,h as Li,ha as bm,hb as t_,hc as th,i as Di,ia as Cm,ib as r_,ic as rh,j as Ew,ja as sf,jb as o_,jc as oh,k as ww,ka as af,kb as n_,kc as nh,l as zi,la as bM,lb as i_,lc as ih,m as TR,ma as CM,mb as s_,mc as sh,n as SR,na as TM,nb as a_,nc as ah,o as ER,oa as SM,ob as c_,oc as ch,p as wR,pa as EM,pb as d_,pc as dh,q as AR,qa as wM,qb as l_,qc as lh,r as vR,ra as AM,rb as u_,rc as uh,s as tl,sa as vM,sb as p_,sc as ph,t as Mu,ta as cf,tb as m_,tc as mh,u as ku,ua as df,ub as f_,uc as fh,v as Du,va as lf,vb as __,vc as _h,w as $u,wa as uf,wb as h_,wc as hh,x as tp,xa as pf,xb as g_,xc as gh,y as cp,ya as mf,yb as y_,yc as yh,z as YI,za as ff,zb as b_,zc as bh}from"./chunks/chunk-XRN3JYNN.js";import{e as IR,f as PR,g as rl,h as ol,i as Gt}from"./chunks/chunk-6XTJLOKW.js";import{A as JP,B as ZP,C as QP,D as eM,E as tM,F as rM,G as oM,H as nM,I as iM,J as sM,K as aM,L as cm,M as dm,N as lm,O as um,P as pm,Q as mm,R as fm,S as _m,T as hm,U as gm,a as xI,b as NI,c as LI,d as DI,e as $I,f as Pu,g as FI,h as GI,i as UI,j as jI,k as BI,m as Lu,n as sm,o as UP,p as jP,q as BP,r as qP,s as zP,t as VP,u as am,v as HP,w as KP,x as WP,y as XP,z as YP}from"./chunks/chunk-A6NDNRCK.js";import{$ as KO,$a as pl,$b as Su,$c as Gp,A as SO,Ab as LR,Ac as Bu,Ad as Bm,B as EO,Bb as DR,Bc as qu,Bd as qm,C as wO,Cb as $R,Cc as zu,Cd as zm,D as AO,Db as FR,Dc as Vu,Dd as Vm,E as vO,Eb as GR,Ec as Hu,Ed as Hm,F as ze,Fa as Gd,Fb as UR,Fc as Ku,Fd as Km,G as OO,Ga as Ud,Gb as sI,Gc as Wu,Gd as Wm,H as xt,Ha as jd,Hb as aI,Hc as Xu,Hd as Xm,I as RO,Ia as Bd,Ib as cI,Ic as Yu,J as IO,Ja as qd,Jb as dI,Jc as Ju,Jd as Ym,K as PO,Kb as lI,Kc as Zu,Kd as Jm,L as MO,La as zd,Lb as uI,Lc as Qu,Ld as Zm,M as kO,Ma as Vd,Mb as pI,Md as Qm,N as xO,Na as Hd,Nb as yI,Nc as WI,Nd as ef,O as NO,Oa as Kd,Ob as bI,Oc as XI,Od as tf,P as LO,Pa as OR,Pb as _u,Pc as ep,Pd as rf,Q as DO,Qa as RR,Qb as hu,Qc as dp,Qd as of,R as $O,Ra as Wd,Rb as CI,Rd as nf,S as FO,Sa as Xd,Sb as TI,Sd as Df,T as GO,Ta as Yd,Tb as SI,Td as $f,U as UO,Ua as Jd,Ub as EI,Uc as lp,Ud as Ff,V as jO,Va as Zd,Vb as wI,Vd as Gf,W as BO,Wa as Qd,Wb as gu,Wc as up,Wd as Uf,X as qO,Xa as el,Xb as yu,Xc as Lp,Xd as jf,Y as zO,Ya as dl,Yb as bu,Yc as Dp,Yd as Bf,Z as VO,Za as ll,Zb as Cu,Zc as $p,_ as HO,_a as ul,_b as Tu,_c as Fp,a as mO,aa as WO,ab as ml,ac as Eu,ad as Up,b as Pt,ba as XO,bb as fl,bc as wu,bd as jp,c as fO,ca as YO,cb as _l,cc as Au,cd as Tm,d as Be,da as JO,db as hl,dc as vu,dd as Sm,e as ee,ea as ZO,eb as gl,ec as Ou,ed as Em,f as td,fa as QO,fb as yl,fc as Ru,fd as wm,gb as bl,gc as AI,gd as Am,hb as Cl,hc as vI,hd as vm,i as qe,ib as Tl,ic as OI,id as Om,j as rd,jb as Sl,jc as RI,jd as Rm,k as od,kb as El,kc as II,kd as Im,lb as wl,lc as PI,ld as hM,m as pe,ma as Fd,mb as Al,mc as MI,md as gM,n as nd,nb as vl,nc as kI,nd as yM,o as id,ob as kR,oc as Iu,od as Pm,p as sd,pb as Ol,pc as qI,pd as Mm,q as ad,qb as Rl,qc as zI,qd as km,r as _O,rb as Il,rc as VI,rd as xm,s as hO,sb as Pl,sc as HI,sd as Nm,t as gO,tb as xR,tc as KI,td as Lm,u as yO,ub as Ml,uc as xu,ud as Dm,v as bO,vb as kl,vc as Nu,vd as $m,w as Mt,wb as xl,wc as Fu,wd as Fm,x as CO,xb as Nl,xc as Gu,xd as Gm,y as TO,yb as Ll,yc as Uu,yd as Um,z as kt,zb as NR,zc as ju,zd as jm}from"./chunks/chunk-O23CQ5T4.js";import{$ as Sd,$a as kd,A as mR,B as fR,C as pd,D as md,E as fd,F as _d,G as hd,H as _R,I as gd,J as yd,Ja as Lt,K as bd,Ka as Dt,La as $t,Ma as Ft,Na as wd,Pa as Ad,Qa as vd,Ra as Od,T as hR,U as gR,W as yR,Wa as Rd,X as bR,Xa as Id,Y as CR,Z as Cd,Za as Pd,_ as Td,_a as Md,a as Iw,aa as Ed,ab as xd,b as Pw,ba as Nt,bb as Nd,c as Vi,d as Hi,db as Ld,e as Ki,eb as Dd,f as Wi,fb as $d,g as Xi,i as cd,j as dd,l as ld,m as ud,n as eR,o as tR,p as rR,q as oR,r as nR,s as iR,t as sR,u as aR,v as cR,w as dR,x as lR,y as uR,z as pR}from"./chunks/chunk-6YEET7XI.js";import{$ as tO,$a as fu,$b as sP,$c as uM,Aa as jl,Ac as xP,Ba as Bl,Bb as mI,Bc as NP,Ca as ql,Cb as fI,Cc as LP,Da as zl,Db as _I,Dc as Ut,Ea as Vl,Eb as hI,Ec as gp,Fa as Hl,Fb as gI,Fc as yp,G as Hv,Ga as Kl,Gb as rp,Gc as bp,H as Kv,Ha as Wl,Hb as op,Hc as Cp,I as Wv,Ia as Xl,Ib as np,Ic as Tp,J as Xv,Ja as Yl,Jb as ip,Jc as Sp,K as Yv,Ka as Jl,Kb as sp,Kc as Ep,L as Jv,La as Zl,Lb as ap,Lc as wp,M as Zv,Ma as Ql,Mb as pp,Mc as Ap,N as Qv,Na as eu,Nb as mp,Nc as vp,O as qc,Oa as tu,Ob as fp,Oc as Op,P as zc,Pa as ru,Pb as _p,Pc as Rp,Q as Vc,Qa as ou,Qb as JI,Qc as Ip,R as Hc,Ra as nu,Rb as ZI,Rc as Pp,S as Kc,Sa as iu,Sb as QI,Sc as Mp,T as Wc,Ta as su,Tb as eP,Tc as kp,U as Xc,Ua as au,Ub as tP,Uc as jt,V as Yc,Va as cu,Vb as rP,Vc as xp,W as Jc,Wa as du,Wb as oP,Wc as DP,X as Zc,Xa as lu,Xc as $P,Y as Qc,Ya as uu,Yb as hp,Yc as FP,Z as je,Za as pu,Zb as nP,Zc as Np,_ as eO,_a as mu,_b as iP,_c as GP,aa as rO,ac as aP,ad as pM,b as Cw,ba as oO,bc as cP,bd as mM,c as Tw,ca as nO,cb as jR,cc as dP,cd as fM,d as Sw,da as iO,db as BR,dc as lP,dd as _M,e as Aw,eb as qR,ec as uP,f as vw,fb as zR,fc as pP,g as Ow,ga as sO,gb as VR,gc as mP,h as Rw,ha as aO,hb as HR,hc as fP,i as Pv,ia as cO,ib as KR,ic as _P,j as Mv,ja as dO,jb as WR,jc as hP,k as kv,ka as lO,kb as XR,kc as gP,l as xv,la as uO,lb as YR,lc as yP,m as Nv,ma as pO,mb as JR,mc as bP,n as Lv,na as ed,nb as ZR,nc as CP,o as Dv,oa as nl,ob as QR,oc as TP,p as $v,pa as il,pc as SP,q as Fv,qa as sl,qc as EP,r as Gv,ra as al,rc as wP,s as Uv,sa as MR,sb as eI,sc as AP,t as jv,tc as vP,u as Bv,ua as cl,ub as tI,uc as OP,v as qv,va as Dl,vb as rI,vc as RP,w as zv,wa as $l,wc as IP,x as Vv,xa as Fl,xb as oI,xc as PP,ya as Gl,yb as nI,yc as MP,za as Ul,zb as iI,zc as kP}from"./chunks/chunk-BNAT4EYR.js";import{$a as iC,$c as an,$d as hn,$g as wi,$h as VE,$k as is,$l as fv,$m as _a,$n as _c,A as Do,Ac as PC,Ad as _T,Ae as kT,Af as SS,Ag as ai,Ah as OE,Ai as Ui,Aj as Jw,Ak as rs,Al as cv,Am as qs,An as Ba,Ao as Gc,B as xe,Bc as rn,Bd as hT,Be as xT,Bf as ES,Bg as dE,Bh as RE,Bi as wt,Bk as kA,Bl as gs,Bm as zs,Bn as qa,Bo as Uc,C as $o,Cc as MC,Cd as gT,Ce as NT,Cf as wS,Cg as ci,Ci as rw,Cj as Zw,Cl as ys,Cm as Vs,Cn as za,Co as jc,Dc as kC,Dd as yT,De as LT,Df as AS,Dg as di,Dh as IE,Di as ow,Dj as Qw,Dk as xA,Dl as bs,Dm as Hs,Dn as Va,Do as Bc,E as Nb,Eb as aC,Ec as xC,Ed as bT,Ee as DT,Ef as vS,Eg as L,Eh as Mi,Ei as nw,Ej as eA,Ek as NA,El as Cs,Em as Ks,En as Ha,Eo as It,F as Lb,Fc as NC,Fd as CT,Fe as $T,Ff as OS,Fg as li,Fh as ki,Fi as iw,Fj as tA,Fk as LA,Fl as Ts,Fm as Ws,Fn as Ka,G as Db,Gb as cC,Gc as LC,Ge as FT,Gf as RS,Gh as PE,Gi as sw,Gj as rA,Gk as DA,Gl as Ss,Gm as Xs,Gn as Wa,H as $b,Hb as dC,Hc as DC,Hd as TT,He as GT,Hi as aw,Hj as oA,Hk as $A,Hl as Es,Hm as Ys,Hn as Xa,I as Fb,Ib as lC,Ic as $C,Id as ST,Ie as UT,If as IS,Ii as cw,Ij as nA,Ik as FA,Il as ws,Im as Js,In as Ya,J as Gb,Jb as uC,Jc as FC,Jd as ET,Je as jT,Jf as PS,Ji as dw,Jj as iA,Jk as GA,Jl as As,Jn as Ja,Kb as pC,Kc as on,Kd as wT,Kf as Hn,Ki as lw,Kj as sA,Kk as UA,Kl as vs,Km as Zs,Kn as Za,L as Ub,Lc as GC,Ld as AT,Le as BT,Lf as Kn,Lg as lE,Lh as ME,Lk as jA,Ll as Os,Lm as Qs,Ln as Qa,M as jb,Mc as nn,Md as vT,Me as qT,Mf as Wn,Mg as uE,Mh as kE,Mi as uw,Mj as aA,Mk as BA,Ml as Rs,Mm as ea,Mn as ec,Na as Zb,Nb as mC,Nd as OT,Ne as zT,Nf as BS,Ng as pE,Nh as xE,Ni as pw,Nj as cA,Nk as vt,Nl as Is,Nm as ta,Nn as tc,Oa as Qb,Ob as fC,Oc as UC,Od as RT,Oe as VT,Of as qS,Og as ui,Oh as NE,Oi as mw,Oj as dA,Ok as qA,Ol as Ps,Om as ra,On as rc,P as Bb,Pa as eC,Pc as jC,Pd as IT,Pe as HT,Pf as zS,Pg as pi,Ph as LE,Pi as fw,Pj as lA,Pl as Ms,Pm as oa,Pn as oc,Qc as BC,Qd as PT,Qe as KT,Qf as VS,Qg as mi,Qh as DE,Qi as ji,Qj as uA,Ql as ks,Qm as na,Qn as nc,Rb as I,Rc as qC,Rd as MT,Re as WT,Rf as HS,Rg as fi,Ri as Bi,Rk as zA,Rl as xs,Rm as ia,Rn as ic,S as qb,Sa as Vo,Sb as _C,Sc as zC,Sd as dn,Se as XT,Sf as KS,Sg as _i,Sh as $E,Sj as pA,Sk as VA,Sl as Ns,Sm as sa,Sn as sc,Ta as tC,Tb as yt,Td as ln,Te as YT,Tf as WS,Tg as hi,Ti as qi,Tk as HA,Tm as aa,Tn as ac,U as zb,Ua as rC,Ub as hC,Ud as un,Ue as JT,Uf as XS,Ug as gi,Uh as FE,Ui as _w,Uj as mA,Uk as KA,Ul as dv,Um as ca,Un as cc,V as Vb,Va as oC,Vd as pn,Ve as ZT,Vf as YS,Vg as yi,Vh as GE,Vj as fA,Vk as WA,Vl as lv,Vm as da,Vn as dc,W as Hb,Wa as nC,Wb as gC,Wd as mn,We as QT,Wf as JS,Wg as bi,Wh as UE,Wi as hw,Wj as _A,Wk as XA,Wm as la,Wn as lc,Xd as fn,Xe as eS,Xf as ZS,Xg as Ci,Xh as jE,Xi as gw,Xj as hA,Xk as YA,Xm as ua,Xn as uc,Ya as Ho,Yc as bt,Yd as _n,Ye as tS,Yf as QS,Yg as Ti,Yh as BE,Yi as yw,Yj as gA,Yk as JA,Yl as uv,Ym as pa,Yn as pc,Za as Ko,Zc as Ct,Zd as Le,Ze as rS,Zf as eE,Zg as Si,Zh as qE,Zk as os,Zl as pv,Zm as ma,Zn as mc,_a as Ne,_c as sn,_d as De,_e as Tt,_g as Ei,_h as zE,_i as bw,_k as ns,_l as mv,_m as fa,_n as fc,ad as cn,ae as gn,af as St,ah as Ai,ai as HE,aj as Mw,al as ss,am as _v,an as ha,b as vo,ba as Kb,bb as Wo,be as yn,bf as qn,bh as mE,bj as kw,bl as as,bm as hv,bn as ga,bo as Ue,c as Oo,cb as Xo,cd as VC,ce as bn,cf as zn,ch as fE,cj as xw,cl as cs,cm as gv,cn as ya,co as Q,d as Ro,da as Wb,dd as HC,de as Cn,df as Et,dg as tE,dh as vi,dj as Nw,dm as yv,dn as ba,do as hc,e as Io,eb as Yo,ed as KC,ee as Tn,eh as _E,ej as Lw,el as ds,em as bv,en as Ca,eo as gc,f as Pe,fd as WC,fe as Sn,ff as oS,fg as Xn,fh as Oi,fi as KE,fj as Dw,fl as ls,fm as Cv,fn as Ta,fo as yc,g as Po,ga as Xb,gc as yC,gd as XC,ge as En,gg as rE,gh as Ri,gj as $w,gk as yA,gl as us,gm as Fe,gn as Sa,go as bc,h as N,hc as bC,hd as YC,he as wn,hf as nS,hg as Yn,hh as Ii,hi as WE,hk as bA,hl as ps,hm as Tv,hn as Ea,ho as Cc,i as Me,ic as CC,id as JC,ie as An,if as $e,ih as Pi,ii as xi,ij as Fw,ik as CA,il as ms,im as Sv,in as wa,io as Tc,j as Mo,jd as ZC,je as vn,jf as iS,jg as oE,ji as XE,jj as Gw,jk as TA,jl as fs,jm as Ev,jn as Aa,jo as Sc,k as ko,ka as Yb,kc as TC,kd as QC,ke as On,kf as sS,kg as nE,kk as SA,kl as _s,km as Rt,kn as va,ko as Ec,l as xo,la as ue,lc as SC,ld as eT,le as Rn,lf as aS,lg as iE,li as YE,lk as EA,ll as hs,lm as Ge,ln as Oa,lo as wc,m as No,ma as Jb,md as tT,me as In,mf as cS,mg as Jn,mi as JE,mj as ts,mk as wA,ml as ZA,mm as wv,mn as Ra,mo as Ac,n as Rb,na as b,nc as EC,nd as rT,ne as Pn,nf as dS,ng as Zn,ni as ZE,nj as Uw,nk as AA,nl as QA,nm as Av,nn as Ia,no as vc,o as ke,oa as Fo,oc as Qo,od as oT,oe as Mn,of as lS,og as Qn,oi as QE,oj as jw,ok as vA,ol as ev,om as vv,on as Pa,oo as Oc,p as ht,pa as Go,pd as nT,pe as kn,pf as uS,pg as ei,ph as hE,pi as ew,pj as Bw,pk as At,pl as tv,pm as Ov,pn as Ma,po as Rc,q as Ib,qa as Uo,qc as en,qd as iT,qe as xn,qf as pS,qg as ti,qh as gE,qj as qw,ql as rv,qm as Rv,qn as ka,qo as Ic,r as Pb,rb as Jo,rc as tn,rd as sT,re as Nn,rf as mS,rg as ri,rh as yE,ri as $i,rj as zw,rk as OA,rl as ov,rm as Iv,rn as xa,ro as Pc,s as Mb,sb as Zo,sd as aT,se as Ln,sf as fS,sg as oi,sh as bE,si as Fi,sj as Vw,sl as nv,sm as Ls,sn as Na,so as Mc,t as kb,tb as sC,td as cT,te as Dn,tf as _S,tg as sE,th as CE,ti as Gi,tk as RA,tl as iv,tm as Ds,tn as La,to as kc,u as q,ua as jo,uc as wC,ud as dT,ue as $n,uf as hS,ug as aE,uh as TE,uj as Hw,um as $s,un as Da,uo as xc,v as xb,vc as AC,vd as lT,ve as Fn,vf as gS,vh as SE,vj as Kw,vm as Fs,vn as $a,vo as Nc,wa as Bo,wc as vC,wd as uT,we as Gn,wf as yS,wg as ni,wh as EE,wi as tw,wj as Ww,wm as Gs,wn as Fa,wo as Lc,x as Lo,xa as qo,xc as OC,xd as pT,xe as Un,xf as bS,xg as ii,xh as wE,xj as Xw,xk as IA,xl as Ot,xm as Us,xn as Ga,xo as Dc,y as gt,ya as zo,yc as RC,yd as mT,ye as jn,yf as CS,yg as cE,yh as AE,yk as PA,yl as sv,ym as js,yn as Ua,yo as $c,z as le,zc as IC,zd as fT,ze as Bn,zf as TS,zg as si,zh as vE,zj as Yw,zk as MA,zl as av,zm as Bs,zn as ja,zo as Fc}from"./chunks/chunk-UIAH7UFK.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]="08485124-a2f1-5bb5-9316-533a3f7888bc")}catch{}})();var z="2026-07-28",Vk=["2025-11-25","2025-06-18"],Ke=[z],m={headerMismatch:-32020,missingRequiredClientCapability:-32021,unsupportedProtocolVersion:-32022,invalidParams:-32602},w={clientCapabilities:"io.modelcontextprotocol/clientCapabilities",clientInfo:"io.modelcontextprotocol/clientInfo",logLevel:"io.modelcontextprotocol/logLevel",protocolVersion:"io.modelcontextprotocol/protocolVersion",serverInfo:"io.modelcontextprotocol/serverInfo"},er=["debug","info","notice","warning","error","critical","alert","emergency"],p=class extends Error{code;data;constructor(t,r,o={}){super(t),this.name="PmMcpProtocolError",this.code=r,this.data=o}};function _(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function kh(e){if(e===void 0)return;if(!_(e))throw new p("Invalid MCP clientInfo metadata",m.invalidParams,{field:w.clientInfo,expected:"object"});let t=typeof e.name=="string"?e.name.trim():"",r=typeof e.version=="string"?e.version.trim():"";if(t.length===0||r.length===0)throw new p("Invalid MCP clientInfo metadata",m.invalidParams,{field:w.clientInfo,required:["name","version"]});let o={name:t.slice(0,128),version:r.slice(0,128)};return typeof e.description=="string"&&e.description.trim()&&(o.description=e.description.trim().slice(0,1024)),typeof e.websiteUrl=="string"&&e.websiteUrl.trim()&&(o.websiteUrl=e.websiteUrl.trim().slice(0,2048)),o}function xh(e){if(e!==void 0){if(typeof e!="string"||!er.includes(e))throw new p("Invalid MCP logLevel metadata",m.invalidParams,{field:w.logLevel,allowed:[...er]});return e}}function We(e){let t=_(e)?e._meta:void 0;if(!_(t))throw new p("Missing required MCP request metadata",m.invalidParams,{required:[w.protocolVersion,w.clientCapabilities]});let r=t[w.protocolVersion];if(typeof r!="string"||!Ke.includes(r))throw new p("Unsupported protocol version",m.unsupportedProtocolVersion,{supported:[...Ke],requested:typeof r=="string"?r:null});let o=t[w.clientCapabilities];if(!_(o))throw new p("Invalid MCP client capabilities metadata",m.invalidParams,{field:w.clientCapabilities,expected:"object"});let n=kh(t[w.clientInfo]),i=xh(t[w.logLevel]);return{protocolVersion:z,clientCapabilities:o,...n?{clientInfo:n}:{},...i?{logLevel:i}:{}}}function Hk(e,t){if(t!==e.protocolVersion)throw new p("MCP protocol header does not match request metadata",m.headerMismatch,{header:t??null,metadata:e.protocolVersion})}function Kk(e,t){let r=t.filter(o=>!Object.prototype.hasOwnProperty.call(e.clientCapabilities,o));if(r.length>0)throw new p("Missing required client capability",m.missingRequiredClientCapability,{requiredCapabilities:Object.fromEntries(r.map(o=>[o,{}]))})}function Wk(e,t){let r=e.clientCapabilities.extensions;return _(r)&&_(r[t])}function Xe(e,t){let r=_(e._meta)?e._meta:{};return{...e,_meta:{...r,[w.serverInfo]:{...t}}}}function Nh(e,t){return Xe({...e,resultType:"complete"},t)}function Xk(e){let t=e.ttlMs??6e4;if(!Number.isFinite(t)||t<0)throw new p("Invalid MCP discovery cache TTL",m.invalidParams,{ttlMs:t});return Nh({supportedVersions:[...Ke],capabilities:structuredClone(e.capabilities),ttlMs:t,cacheScope:"public",...e.instructions?{instructions:e.instructions}:{}},e.serverInfo)}function Yk(e,t){if(_(e)&&typeof e.resultType=="string")return e.resultType;if(t==="legacy")return"complete";throw new p("Modern MCP result is missing resultType",m.invalidParams,{required:"resultType"})}import{createHash as or,createHmac as nr,timingSafeEqual as Lh}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]="6505e714-d1f3-5794-88c8-51c1644acec9")}catch{}})();var Dh=["elicitation/create","roots/list","sampling/createMessage"],tr=class extends Error{inputRequests;requestState;constructor(t){super("MCP operation requires additional input"),this.name="PmMcpInputRequiredError",this.inputRequests=t.inputRequests,this.requestState=t.requestState}},ir=/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/u,fe=32,Je=64*1024,_e=16*1024,Ye={maxBytes:256*1024,maxDepth:32,maxNodes:4096};function $h(e){return e==="elicitation/create"?"elicitation":e==="sampling/createMessage"?"sampling":"roots"}function he(e,t,r){let o;try{o=JSON.stringify(e)}catch{throw new p(`Invalid ${r}: value is not JSON serializable`,m.invalidParams,{field:r})}if(Buffer.byteLength(o,"utf8")>t)throw new p(`Invalid ${r}: payload exceeds the protocol bound`,m.invalidParams,{field:r,maximumBytes:t})}function Ze(e,t){if(!_(e))throw new p("Invalid MCP inputRequests",m.invalidParams,{field:"inputRequests",expected:"object"});let r=Object.entries(e);if(r.length===0||r.length>fe)throw new p("Invalid MCP inputRequests count",m.invalidParams,{minimum:1,maximum:fe,observed:r.length});let o={};for(let[n,i]of r){if(!ir.test(n)||!_(i))throw new p("Invalid MCP input request entry",m.invalidParams,{field:`inputRequests.${n}`});let s=i.method;if(typeof s!="string"||!Dh.includes(s))throw new p("Unsupported MCP input request method",m.invalidParams,{field:`inputRequests.${n}.method`,method:s??null});let a=$h(s);if(!Object.prototype.hasOwnProperty.call(t.clientCapabilities,a))throw new p("Missing required client capability",m.missingRequiredClientCapability,{requiredCapabilities:{[a]:{}}});if(!_(i.params))throw new p("Invalid MCP input request parameters",m.invalidParams,{field:`inputRequests.${n}.params`,expected:"object"});o[n]={method:s,params:structuredClone(i.params)}}return he(o,Je,"inputRequests"),o}function sr(e){if(!_(e))throw new p("Invalid MCP inputResponses",m.invalidParams,{field:"inputResponses",expected:"object"});let t=Object.entries(e);if(t.length>fe)throw new p("Invalid MCP inputResponses count",m.invalidParams,{maximum:fe,observed:t.length});let r={};for(let[o,n]of t){if(!ir.test(o)||!_(n))throw new p("Invalid MCP input response entry",m.invalidParams,{field:`inputResponses.${o}`});r[o]=structuredClone(n)}return he(r,Je,"inputResponses"),r}function ex(e){let t=e.requestState?.trim();if(t&&Buffer.byteLength(t,"utf8")>_e)throw new p("Invalid MCP requestState: payload exceeds the protocol bound",m.invalidParams,{field:"requestState",maximumBytes:_e});let r=e.inputRequests===void 0?void 0:Ze(e.inputRequests,e.requestContext);if(r===void 0&&!t)throw new p("InputRequiredResult requires inputRequests or requestState",m.invalidParams,{requiredAnyOf:["inputRequests","requestState"]});return{resultType:"input_required",...r?{inputRequests:r}:{},...t?{requestState:t}:{},_meta:{[w.serverInfo]:{...e.serverInfo}}}}function ar(e){let t=Buffer.from(e);if(t.byteLength<32)throw new p("MCP requestState signing key must contain at least 32 bytes",m.invalidParams,{minimumBytes:32});return t}function tx(e,t){if(!Number.isSafeInteger(e.expiresAt)||e.expiresAt<=0||e.method.trim().length===0||e.parameterDigest.trim().length===0||e.principal.trim().length===0)throw new p("Invalid MCP requestState payload",m.invalidParams);let r=Buffer.from(JSON.stringify({version:1,...e}),"utf8");if(r.byteLength>_e/2)throw new p("MCP requestState payload exceeds the protocol bound",m.invalidParams,{maximumBytes:_e/2});let o=r.toString("base64url"),n=nr("sha256",ar(t)).update(o).digest("base64url");return`${o}.${n}`}function Fh(e){if(!_(e)||e.version!==1)throw new p("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});let{expiresAt:t,method:r,parameterDigest:o,principal:n,state:i}=e;if(typeof t!="number"||!Number.isSafeInteger(t))throw new p("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});if(typeof r!="string"||typeof o!="string"||typeof n!="string")throw new p("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});return{expiresAt:t,method:r,parameterDigest:o,principal:n,state:i}}function rx(e,t,r){let[o,n,i]=e.split(".");if(!o||!n||i!==void 0)throw new p("Invalid MCP requestState encoding",m.invalidParams,{field:"requestState"});let s=Buffer.from(n,"base64url"),a=nr("sha256",ar(t)).update(o).digest();if(s.byteLength!==a.byteLength||!Lh(s,a))throw new p("Invalid MCP requestState signature",m.invalidParams,{field:"requestState"});let c;try{c=JSON.parse(Buffer.from(o,"base64url").toString("utf8"))}catch{c=null}let d=Fh(c),{expiresAt:l,method:u,parameterDigest:f,principal:g}=d;if(l<(r.nowMs??Date.now()))throw new p("Expired MCP requestState",m.invalidParams,{field:"requestState",expiredAt:l});if(u!==r.method||f!==r.parameterDigest||g!==r.principal)throw new p("MCP requestState binding mismatch",m.invalidParams,{field:"requestState"});return d}function ox(e){return he(e,Je,"request parameters"),or("sha256").update(JSON.stringify(e)).digest("hex")}var rr=class{#e=new Set;#t;constructor(t=4096){if(!Number.isSafeInteger(t)||t<1)throw new p("Invalid MCP replay guard capacity",m.invalidParams,{maximumEntries:t});this.#t=t}consume(t){let r=or("sha256").update(t).digest("hex");if(this.#e.has(r))throw new p("MCP requestState replay detected",m.invalidParams,{field:"requestState"});if(this.#e.size>=this.#t){let o=this.#e.values().next().value;this.#e.delete(o)}this.#e.add(r)}};function Gh(e){if(!Number.isSafeInteger(e.ttlMs)||e.ttlMs<0||e.cacheScope!=="public"&&e.cacheScope!=="private")throw new p("Invalid MCP cache policy",m.invalidParams,{ttlMs:e.ttlMs,cacheScope:e.cacheScope});return{ttlMs:e.ttlMs,cacheScope:e.cacheScope}}function nx(e,t){return{...e,...Gh(t)}}function Uh(e){return e.replaceAll("~1","/").replaceAll("~0","~")}function jh(e,t){if(t==="#")return e;if(!t.startsWith("#/"))return;let r=e;for(let o of t.slice(2).split("/").map(Uh)){if(!_(r)&&!Array.isArray(r)||!Object.prototype.hasOwnProperty.call(r,o))return;r=r[o]}return r}function Bh(e){let t=e.maxBytes??Ye.maxBytes,r=e.maxDepth??Ye.maxDepth,o=e.maxNodes??Ye.maxNodes;if(!Number.isSafeInteger(t)||t<2)throw new p("Invalid MCP JSON Schema work bounds",m.invalidParams);if(!Number.isSafeInteger(r)||r<1)throw new p("Invalid MCP JSON Schema work bounds",m.invalidParams);if(!Number.isSafeInteger(o)||o<1)throw new p("Invalid MCP JSON Schema work bounds",m.invalidParams);return{maximumBytes:t,maximumDepth:r,maximumNodes:o}}function qh(e,t){let r=Array.isArray(e.value)?e.value:_(e.value)?Object.values(e.value):[];for(let o of r)t.push({value:o,depth:e.depth+1})}function zh(e,t){if(!_(t)||typeof t.$ref!="string")return;let r=t.$ref;if(r.startsWith("#")&&jh(e,r)===void 0)throw new p("MCP JSON Schema contains an unresolved local reference",m.invalidParams,{reference:r})}function ix(e,t={}){let{maximumBytes:r,maximumDepth:o,maximumNodes:n}=Bh(t);if(typeof e!="boolean"&&!_(e))throw new p("Invalid MCP JSON Schema root",m.invalidParams,{expected:"object or boolean"});he(e,r,"JSON Schema");let i=[{value:e,depth:0}],s=0;for(;i.length>0;){let a=i.pop();if(s+=1,s>n||a.depth>o)throw new p("MCP JSON Schema exceeds validation work bounds",m.invalidParams,{maximumDepth:o,maximumNodes:n});zh(e,a.value),qh(a,i)}return structuredClone(e)}import{randomUUID as Vh}from"node:crypto";import{readFile as Hh}from"node:fs/promises";import cr 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]="7f5b3ba6-07cf-5317-8f62-63e84f561232")}catch{}})();var mx="io.modelcontextprotocol/tasks",Kh=["working","input_required","completed","failed","cancelled"],Wh=/^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,Xh=3600*1e3,Yh=1e3,ye=1024,Jh=30,Zh=2e3;function Qe(e){return new p(e,m.invalidParams,{code:"mcp_task_not_found_or_not_authorized"})}function ge(e){let t=e.trim();if(!Wh.test(t))throw Qe("Unknown MCP task");return t}function dr(e,t){if(typeof e!="string"||!Number.isFinite(Date.parse(e)))throw new p("Corrupt MCP task record",m.invalidParams,{field:t});return e}function lr(e){if(!_(e)||typeof e.code!="number"||!Number.isFinite(e.code)||typeof e.message!="string")throw new p("Corrupt MCP task error",m.invalidParams);return{code:e.code,message:e.message.slice(0,ye),..._(e.data)?{data:structuredClone(e.data)}:{}}}function Qh(e){if(!Kh.includes(e))throw new p("Corrupt MCP task record",m.invalidParams);return e}function eg(e){if(typeof e!="string"||e.length===0)throw new p("Corrupt MCP task record",m.invalidParams);return e}function tg(e){if(typeof e!="number"||!Number.isSafeInteger(e)||e<1)throw new p("Corrupt MCP task record",m.invalidParams);return e}function rg(e){if(e!==null&&(typeof e!="number"||!Number.isSafeInteger(e)||e<0))throw new p("Corrupt MCP task record",m.invalidParams);return e}function og(e){if(e!==void 0){if(typeof e!="number"||!Number.isSafeInteger(e)||e<0)throw new p("Corrupt MCP task record",m.invalidParams);return e}}function ng(e){if(!Array.isArray(e)||e.some(t=>typeof t!="string"))throw new p("Corrupt MCP task record",m.invalidParams);return[...e]}function ig(e){if(!_(e)||e.version!==1)throw new p("Corrupt MCP task record",m.invalidParams);let t=typeof e.taskId=="string"?ge(e.taskId):"",r=Qh(e.status),o=eg(e.principal),n=tg(e.workerPid),i=rg(e.ttlMs),s=og(e.pollIntervalMs),a={version:1,taskId:t,status:r,principal:o,workerPid:n,createdAt:dr(e.createdAt,"createdAt"),lastUpdatedAt:dr(e.lastUpdatedAt,"lastUpdatedAt"),ttlMs:i,consumedInputKeys:ng(e.consumedInputKeys),...typeof e.statusMessage=="string"?{statusMessage:e.statusMessage.slice(0,ye)}:{},...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=lr(e.error)),a.status==="input_required"&&!a.inputRequests||a.status==="completed"&&!a.result||a.status==="failed"&&!a.error)throw new p("Corrupt MCP task status payload",m.invalidParams,{status:a.status});return a}function V(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 te(e){return e==="completed"||e==="failed"||e==="cancelled"}function sg(e){try{return process.kill(e,0),!0}catch(t){return!(typeof t=="object"&&t!==null&&"code"in t&&t.code==="ESRCH")}}var et=class{#e;#t;#r;#o;#i;constructor(t){this.#e=cr.resolve(t.pmRoot),this.#t=t.owner?.trim()||"pm-mcp",this.#r=t.now??(()=>new Date),this.#o=t.taskIdFactory??(()=>`mcp-task-${Vh()}`),this.#i=t.workerPid??process.pid}#s(t){return cr.join(this.#e,"runtime","mcp-tasks","records",`${ge(t)}.json`)}async#c(t){try{return ig(JSON.parse(await Hh(this.#s(t),"utf8")))}catch(r){throw le(r)||r instanceof SyntaxError?Qe("Unknown MCP task"):r}}async#a(t){await xe(this.#s(t.taskId),`${JSON.stringify(t,null,2)}
|
|
2
|
-
`)}async#n(t,r,o){let n=ge(t),i=await $e(this.#e,n,Jh,this.#t,!1,!1,Zh);try{let s=await this.#c(n);if(s.principal!==r)throw Qe("Unknown MCP task");let a=o(s);return await this.#a(a),a}finally{await i()}}async create(t){let r=ge(this.#o()),o=t.principal.trim(),n=t.ttlMs===void 0?Xh:t.ttlMs,i=t.pollIntervalMs??Yh;if(o.length===0||n!==null&&(!Number.isSafeInteger(n)||n<0)||!Number.isSafeInteger(i)||i<0)throw new p("Invalid MCP task creation options",m.invalidParams);let s=this.#r().toISOString(),a={version:1,taskId:r,status:"working",createdAt:s,lastUpdatedAt:s,ttlMs:n,pollIntervalMs:i,principal:o,workerPid:this.#i,consumedInputKeys:[],...t.statusMessage?.trim()?{statusMessage:t.statusMessage.trim().slice(0,ye)}:{}};return await this.#a(a),{...V(a),resultType:"task"}}async get(t,r){return V(await this.#n(t,r,o=>{if(te(o.status))return o;let n=this.#r().getTime(),i=o.ttlMs!==null&&Date.parse(o.createdAt)+o.ttlMs<=n,s=o.workerPid!==this.#i&&!sg(o.workerPid);return!i&&!s?o:{...o,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=Ze(t.inputRequests,t.requestContext);return V(await this.#n(t.taskId,t.principal,o=>{if(te(o.status))return o;let n=Object.keys(r).filter(i=>o.consumedInputKeys.includes(i));if(n.length>0)throw new p("MCP task input request keys must be unique for the task lifetime",m.invalidParams,{reused:n});return{...o,status:"input_required",statusMessage:t.statusMessage?.trim().slice(0,ye),lastUpdatedAt:this.#r().toISOString(),inputRequests:r}}))}async update(t,r,o){let n=sr(o),i=[],s=[];return await this.#n(t,r,a=>{if(a.status!=="input_required"||!a.inputRequests)return a;let c={...a.inputRequests},d=a.inputResponses?{...a.inputResponses}:{};for(let[l,u]of Object.entries(n))Object.prototype.hasOwnProperty.call(c,l)&&(d[l]=u,delete c[l],i.push(l));return s=Object.keys(c).sort(),i.length===0?a:{...a,status:s.length===0?"working":"input_required",lastUpdatedAt:this.#r().toISOString(),inputRequests:s.length===0?void 0:c,inputResponses:d,consumedInputKeys:[...new Set([...a.consumedInputKeys,...i])].sort()}}),{acceptedKeys:i.sort(),remainingKeys:s}}async takeInputResponses(t,r){let o={};return await this.#n(t,r,n=>(o=structuredClone(n.inputResponses??{}),Object.keys(o).length===0?n:{...n,inputResponses:void 0})),o}async complete(t,r,o){return V(await this.#n(t,r,n=>te(n.status)?n:{...n,status:"completed",statusMessage:"Task completed.",lastUpdatedAt:this.#r().toISOString(),result:structuredClone(o),inputRequests:void 0,error:void 0}))}async fail(t,r,o){let n=lr(o);return V(await this.#n(t,r,i=>te(i.status)?i:{...i,status:"failed",statusMessage:n.message,lastUpdatedAt:this.#r().toISOString(),error:n,inputRequests:void 0,result:void 0}))}async cancel(t,r){return V(await this.#n(t,r,o=>te(o.status)?o:{...o,status:"cancelled",statusMessage:"Task cancelled by the client.",lastUpdatedAt:this.#r().toISOString(),inputRequests:void 0,result:void 0,error:void 0}))}};function fx(e){return new et(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]="f87864d3-e499-57f7-b1e3-4ea3f30b7725")}catch{}})();var be="io.modelcontextprotocol/subscriptionId",ur=256,pr=2048,ag=5e3;function cg(e,t){return new Promise((r,o)=>{let n=setTimeout(()=>o(new Error("MCP subscription sink write timed out")),ag);n.unref(),Promise.resolve().then(()=>e(t)).then(()=>{clearTimeout(n),r()},i=>{clearTimeout(n),o(i instanceof Error?i:new Error(String(i)))})})}function tt(e,t){if(e!==void 0){if(typeof e!="boolean")throw new p("Invalid MCP subscription filter",m.invalidParams,{field:`notifications.${t}`,expected:"boolean"});return e||void 0}}function dg(e){if(!_(e))throw new p("Invalid MCP subscription filter",m.invalidParams,{field:"notifications",expected:"object"});let t=tt(e.toolsListChanged,"toolsListChanged"),r=tt(e.promptsListChanged,"promptsListChanged"),o=tt(e.resourcesListChanged,"resourcesListChanged"),n;if(e.resourceSubscriptions!==void 0){if(!Array.isArray(e.resourceSubscriptions)||e.resourceSubscriptions.length>ur)throw new p("Invalid MCP resource subscriptions",m.invalidParams,{field:"notifications.resourceSubscriptions",maximum:ur});let i=new Set;for(let s of e.resourceSubscriptions){if(typeof s!="string"||s.trim().length===0||Buffer.byteLength(s,"utf8")>pr)throw new p("Invalid MCP resource subscription URI",m.invalidParams,{field:"notifications.resourceSubscriptions",maximumBytes:pr});i.add(s)}i.size>0&&(n=[...i].sort())}return{...t?{toolsListChanged:t}:{},...r?{promptsListChanged:r}:{},...o?{resourcesListChanged:o}:{},...n?{resourceSubscriptions:n}:{}}}function lg(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 mr=class{#e;#t=new Map;#r;constructor(t){this.#e=structuredClone(t.capabilities),this.#r={...t.serverInfo}}get size(){return this.#t.size}async open(t){if(this.#t.has(t.id))throw new p("MCP subscription id is already active",m.invalidParams,{subscriptionId:t.id});let r=lg(dg(t.notifications),this.#e),o={filter:r,sink:t.sink,writeQueue:Promise.resolve()};this.#t.set(t.id,o);try{await this.#o(t.id,o,{jsonrpc:"2.0",method:"notifications/subscriptions/acknowledged",params:{_meta:{[be]:t.id},notifications:structuredClone(r)}},!0)}catch(n){throw this.#t.delete(t.id),n}return structuredClone(r)}async emitListChanged(t){let r=`${t}ListChanged`,o=`notifications/${t}/list_changed`,n=[];for(let[i,s]of this.#t)s.filter[r]===!0&&n.push(this.#o(i,s,{jsonrpc:"2.0",method:o,params:{_meta:{[be]:i}}}));return(await Promise.all(n)).filter(Boolean).length}async emitResourceUpdated(t){let r=[];for(let[o,n]of this.#t)n.filter.resourceSubscriptions?.includes(t)&&r.push(this.#o(o,n,{jsonrpc:"2.0",method:"notifications/resources/updated",params:{_meta:{[be]:o},uri:t}}));return(await Promise.all(r)).filter(Boolean).length}async#o(t,r,o,n=!1){let i=r.writeQueue.then(async()=>{if(this.#t.get(t)!==r)return!1;try{return await cg(r.sink,o),!0}catch(s){if(this.#t.get(t)===r&&this.#t.delete(t),n)throw s;return!1}});return r.writeQueue=i.then(()=>{},()=>{}),i}close(t){if(this.#t.delete(t))return{...Xe({resultType:"complete",_meta:{[be]:t}},this.#r)}}closeAll(){let t=[];for(let r of this.#t.keys()){let o=this.close(r);t.push({id:r,result:o})}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]="7d591d0b-f009-519c-8024-c6fa18effb8e")}catch{}})();var fr=/^=\?base64\?([A-Za-z0-9+/]*={0,2})\?=$/u,ug=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/u,_r=/^[\t\x20-\x7E]*$/u,hr=new Set(["prompts/get","resources/read","tools/call"]);function pg(e){let t=new Map;for(let[r,o]of Object.entries(e)){if(o===void 0)continue;let n=typeof o=="string"?o:o.join(", ");t.set(r.toLowerCase(),n)}return t}function A(e,t){throw new p(e,m.headerMismatch,{header:t})}function gr(e){let t=typeof e=="boolean"?String(e).toLowerCase():String(e);return t.length>0&&t.trim()===t&&_r.test(t)&&!fr.test(t)?t:`=?base64?${Buffer.from(t,"utf8").toString("base64")}?=`}function yr(e,t){let r=fr.exec(e);if(r){let o=r[1],n=Buffer.from(o,"base64");return n.toString("base64")!==o||n.length===0?A("Malformed MCP Base64 header value",t):n.toString("utf8")}return e.length===0||e.trim()!==e||!_r.test(e)?A("Malformed MCP header value",t):e}function Ce(e){return Array.isArray(e)?e.some(Ce):_(e)?Object.prototype.hasOwnProperty.call(e,"x-mcp-header")||Object.values(e).some(Ce):!1}function mg(e,t,r){let o=e["x-mcp-header"];if(o===void 0)return;let n=e.type;if(typeof o!="string"||!ug.test(o)||!["boolean","integer","string"].includes(String(n))||r.has(o.toLowerCase()))throw new p("Invalid MCP x-mcp-header annotation",m.invalidParams,{field:t.join("."),annotation:o});return r.add(o.toLowerCase()),{name:o,path:t,type:n}}function br(e){if(!_(e))throw new p("Invalid MCP tool schema",m.invalidParams,{field:"inputSchema",expected:"object"});let t=[],r=new Set,o=(n,i)=>{let s=n.properties;if(s!==void 0){if(!_(s))throw new p("Invalid MCP tool schema properties",m.invalidParams,{field:"inputSchema.properties"});for(let[a,c]of Object.entries(s)){if(!_(c))continue;let d=[...i,a],l=mg(c,d,r);l&&t.push(l);for(let[u,f]of Object.entries(c))if(u!=="properties"&&u!=="x-mcp-header"&&Ce(f))throw new p("MCP x-mcp-header is not statically reachable",m.invalidParams,{field:d.join("."),keyword:u});o(c,d)}}};for(let[n,i]of Object.entries(e))if(n!=="properties"&&Ce(i))throw new p("MCP x-mcp-header is not statically reachable",m.invalidParams,{field:"inputSchema",keyword:n});return o(e,[]),t}function Cr(e,t){let r=e;for(let o of t){if(!_(r))return;r=r[o]}return r}function Tr(e,t){let r=e==="resources/read"?t.uri:t.name;return typeof r=="string"?r:void 0}function fg(e,t){let r=_(e.arguments)?e.arguments:{},o={};for(let n of br(t)){let i=Cr(r,n.path);if(i==null)continue;if(!(n.type==="integer"&&typeof i=="number"&&Number.isSafeInteger(i)||n.type==="boolean"&&typeof i=="boolean"||n.type==="string"&&typeof i=="string"))throw new p("Invalid MCP custom header argument",m.invalidParams,{field:n.path.join("."),expected:n.type});o[`Mcp-Param-${n.name}`]=gr(i)}return o}function bx(e){let t=_(e.request.params)?e.request.params:void 0,r=We(t),o=e.request.method;if(typeof o!="string"||o.length===0)return A("Missing MCP request method","Mcp-Method");let n={Accept:"application/json, text/event-stream","Content-Type":"application/json","MCP-Protocol-Version":r.protocolVersion,"Mcp-Method":o},i=Tr(o,t);if(hr.has(o)){if(i===void 0)return A("Missing MCP request name","Mcp-Name");n["Mcp-Name"]=gr(i)}return o==="tools/call"&&e.toolSchema!==void 0&&Object.assign(n,fg(t,e.toolSchema)),n}function _g(e,t){let r=t.method;(typeof r!="string"||r.length===0)&&A("Missing MCP request method","Mcp-Method");let o=_(t.params)?t.params:void 0,n=We(o).protocolVersion;if(e.get("mcp-protocol-version")!==n&&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"),hr.has(r)){let i=e.get("mcp-name"),s=Tr(r,o);(i===void 0||s===void 0||yr(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 hg(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 gg(e){let t=_(e.params.arguments)?e.params.arguments:{};for(let r of br(e.toolSchema)){let o=Cr(t,r.path),n=`Mcp-Param-${r.name}`,i=e.headers.get(n.toLowerCase());if(o==null){i!==void 0&&A("Unexpected MCP parameter header",n);continue}i===void 0&&A("Missing MCP parameter header",n),hg(r,o,yr(i,n))||A("MCP parameter header does not match request body",n)}}function Cx(e){let t=pg(e.headers),r=typeof e.request.method=="string"?e.request.method:"";_g(t,e.request),!(r!=="tools/call"||e.toolSchema===void 0)&&gg({headers:t,params:e.request.params,toolSchema:e.toolSchema})}var Tx=z;import{AsyncLocalStorage as yg}from"node:async_hooks";import{createHash as Sr,timingSafeEqual as bg}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]="6a5310f6-3add-5108-b39f-61607918dc9f")}catch{}})();var y=class extends Error{httpStatus;challenge;constructor(t,r,o){super(t),this.name="PmMcpAuthorizationError",this.httpStatus=r,this.challenge=o}},Cg=/^00-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})$/u,Tg=/^[a-z][a-z0-9_*/-]{0,255}$/u,Sg=/^(?:[a-z0-9][a-z0-9_*/-]{0,240})@[a-z][a-z0-9_*/-]{0,13}$/u,Eg=/^[\x20-\x2B\x2D-\x3C\x3E-\x7E]{0,255}[\x21-\x2B\x2D-\x3C\x3E-\x7E]$/u,wr=/^[\x21\x23-\x5B\x5D-\x7E]+$/u,Ar=/^[A-Za-z0-9!#$%&'*+.^_`|~-]+$/u,wg=/^[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]*$/u,Ag=/%(?![0-9A-Fa-f]{2})/u,vg=512,Og=32,Rg=180,Ig=8192,Pg=8192,vr=new yg;function E(e,t,r=!1){if(new RegExp("\\p{Cc}","u").test(e))throw new y(`Invalid ${t}`,401);let o;try{o=new URL(e)}catch{throw new y(`Invalid ${t}`,401)}let n=o.hostname==="127.0.0.1"||o.hostname==="localhost";if(o.hash.length>0||o.protocol!=="https:"&&!(r&&n&&o.protocol==="http:"))throw new y(`Invalid ${t}`,401);return o}function Mg(e,t){let r=t.toLowerCase();for(let[o,n]of Object.entries(e))if(!(o.toLowerCase()!==r||n===void 0))return typeof n=="string"?n:n.join(", ")}function vx(e){let t=E(e.resource,"protected resource URI",!0).href.replace(/\/$/u,"");if(e.authorizationServers.length===0)throw new y("Protected resource metadata requires an authorization server",401);let r=e.authorizationServers.map(n=>E(n,"authorization server issuer").href.replace(/\/$/u,"")),o=[...new Set(e.scopes??[])];if(o.some(n=>!wr.test(n)))throw new y("Invalid authorization scope",401);return{resource:t,authorization_servers:r,...o.length>0?{scopes_supported:o.sort()}:{}}}function Ox(e){let t=E(e,"authorization server issuer"),r=t.pathname.replace(/^\/+|\/+$/gu,""),o=t.origin;return r?[`${o}/.well-known/oauth-authorization-server/${r}`,`${o}/.well-known/openid-configuration/${r}`,`${o}/${r}/.well-known/openid-configuration`]:[`${o}/.well-known/oauth-authorization-server`,`${o}/.well-known/openid-configuration`]}function Rx(e,t){if(!_(e)||typeof e.issuer!="string")throw new y("Invalid authorization server metadata",401);let r=E(t,"expected issuer").href.replace(/\/$/u,"");if(E(e.issuer,"metadata issuer").href.replace(/\/$/u,"")!==r)throw new y("Authorization server issuer mismatch",401);if(!Array.isArray(e.code_challenge_methods_supported)||!e.code_challenge_methods_supported.includes("S256"))throw new y("Authorization server does not support required S256 PKCE",401);let n=d=>{let l=e[d];if(typeof l!="string")throw new y(`Authorization server metadata requires ${d}`,401);return E(l,d).href},i=d=>{let l=e[d];return typeof l=="string"?E(l,d).href:void 0},s=n("authorization_endpoint"),a=n("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 Ix(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 Px(e){if(e.responseIssuer===void 0){if(e.issuerParameterSupported)throw new y("Authorization response omitted the advertised issuer",401);return}if(e.responseIssuer!==e.expectedIssuer)throw new y("Authorization response issuer mismatch",401)}function Mx(e,t){let r=E(t,"client metadata document URL");if(r.pathname==="/"||!_(e)||e.client_id!==r.href||typeof e.client_name!="string"||e.client_name.trim().length===0||!Array.isArray(e.redirect_uris)||e.redirect_uris.length===0)throw new y("Invalid Client ID Metadata Document",401);for(let o of e.redirect_uris){if(typeof o!="string")throw new y("Invalid client redirect URI",401);E(o,"client redirect URI",!0)}return structuredClone(e)}function kx(e){if(e.redirectUris.length===0||e.clientName.trim().length===0)throw new y("Invalid dynamic client registration metadata",401);let t=e.redirectUris.map(r=>E(r,"redirect URI",!0).href);return{application_type:e.applicationType,client_name:e.clientName.trim().slice(0,128),redirect_uris:t,grant_types:["authorization_code","refresh_token"],response_types:["code"],token_endpoint_auth_method:"none"}}var Er=class{#e=new Map;set(t,r){let o=E(t,"credential issuer").href;this.#e.set(o,structuredClone(r))}get(t){let r=E(t,"credential issuer").href,o=this.#e.get(r);return o?structuredClone(o):void 0}delete(t){let r=E(t,"credential issuer").href;return this.#e.delete(r)}};function kg(e){let t=e.traceparent,r=e.tracestate;if(t!==void 0){let o=typeof t=="string"?Cg.exec(t):null;if(!o)throw new y("Invalid MCP traceparent",403);let n=o[1],i=o[2];if(/^0+$/u.test(n)||/^0+$/u.test(i))throw new y("Invalid MCP traceparent",403)}if(r!==void 0&&(typeof r!="string"||!Ng(r)))throw new y("Invalid MCP tracestate",403);return{...typeof t=="string"?{traceparent:t}:{},...typeof r=="string"?{tracestate:r}:{}}}function D(e){return e.replace(/^[ \t]*|[ \t]*$/gu,"")}function xg(e){return Tg.test(e)||Sg.test(e)}function Ng(e){if(Buffer.byteLength(e,"utf8")>vg)return!1;let t=e.split(",");if(t.length>Og)return!1;let r=new Set;for(let o of t){let n=D(o);if(n.length===0)continue;let i=n.indexOf("="),s=i>0?n.slice(0,i):"",a=i>0?n.slice(i+1):"";if(!xg(s)||!Eg.test(a)||r.has(s))return!1;r.add(s)}return!0}function Or(e){return wg.test(e)&&!Ag.test(e)}function Lg(e){let t=D(e),r=t.indexOf("="),o=D(r>=0?t.slice(0,r):t),n=r>=0?D(t.slice(r+1)):void 0;return Ar.test(o)&&(n===void 0||Or(n))}function Dg(e){let t=D(e),r=t.split(";"),o=r[0],n=r.slice(1),i=o.indexOf("="),s=D(i>0?o.slice(0,i):""),a=i>0?D(o.slice(i+1)):"";if(!(!Ar.test(s)||!Or(a)||!n.every(Lg)))return{key:s,serialized:t}}function $g(e,t){if(e===void 0)return;if(typeof e!="string"||Buffer.byteLength(e,"utf8")>Ig)throw new y("Invalid MCP baggage",403);let r=new Set(t),o=e.split(",");if(o.length>Rg)throw new y("Invalid MCP baggage",403);let n=[];for(let i of o){let s=Dg(i);if(!s)throw new y("Invalid MCP baggage",403);r.has(s.key)&&n.push(s.serialized)}return n.length>0?n.join(","):void 0}function xx(e,t={}){let r=_(e)&&_(e._meta)?e._meta:{},o=$g(r.baggage,t.baggageAllowlist??[]);return{...kg(r),...o?{baggage:o}:{}}}function Nx(e,t){return vr.run(structuredClone(e),t)}function Lx(){let e=vr.getStore();return e?{...e}:void 0}async function Dx(e){let t=E(e.policy.resourceMetadataUrl,"protected resource metadata URL",!0).href,r=[...new Set(e.policy.requiredScopes??[])];if(r.some(u=>!wr.test(u)))throw new y("Invalid authorization scope",401);let o=`Bearer resource_metadata="${t}"`;if(new URL(e.requestUrl,e.policy.resource).searchParams.has("access_token"))throw new y("Access tokens must not appear in URI query parameters",401,o);let s=Mg(e.headers,"authorization")?.match(/^Bearer ([^\s]+)$/iu);if(!s)throw new y("Missing or malformed bearer token",401,o);let a=s[1];if(Buffer.byteLength(a,"utf8")>Pg)throw new y("Missing or malformed bearer token",401,o);let c;try{c=await e.policy.verifyAccessToken(a)}catch{throw new y("Invalid bearer token",401,o)}let d=Array.isArray(c.audience)?c.audience:[c.audience];if(c.issuer!==e.policy.issuer||!d.includes(e.policy.resource))throw new y("Bearer token issuer or audience mismatch",401,o);let l=r.filter(u=>!c.scopes.includes(u));if(l.length>0)throw new y("Bearer token has insufficient scope",403,`${o}, scope="${l.join(" ")}"`);return{...c,audience:[...d],scopes:[...c.scopes]}}function $x(e){let t=Sr("sha256").update(e.token).digest();return r=>{let o=Sr("sha256").update(r).digest();if(!bg(t,o))throw new y("Invalid bearer token",401);return structuredClone(e.claims)}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="4f17095e-2dba-530c-935c-1803ed359510")}catch{}})();var rt="io.modelcontextprotocol/ui",Te="2026-01-26",Pr="text/html;profile=mcp-app",Rr=Object.freeze({specVersion:Te,mimeTypes:[Pr]});function Ux(e){let t=e.clientCapabilities.extensions;if(!_(t))return!1;let r=t[rt];if(r===void 0)return!1;if(!_(r))throw new p("Invalid MCP Apps client capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[rt]:Rr}}});let o=r.mimeTypes,n=r.specVersion;if(!Array.isArray(o)||!o.includes(Pr)||n!==void 0&&n!==Te)throw new p("Unsupported MCP Apps client capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[rt]:Rr}}});return!0}var Fg={csp:{connectDomains:[],resourceDomains:[],frameDomains:[]},permissions:{},prefersBorder:!0},Mr=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:Fg})));function jx(e){return Mr.find(t=>t.uri===e)}function Bx(e){let t=new Map(Mr.map(r=>[r.toolName,r]));return e.map(r=>{let o=t.get(r.name);return o?{...r,_meta:{...r._meta,ui:o.toolMeta}}:{...r}})}function Ir(e){return e.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function qx(e){let t=Ir(e.name),r=Ir(e.description),o=JSON.stringify({name:`pm-${e.id}-view`,version:Te}),n=JSON.stringify(Te);return`<!doctype html>
|
|
1
|
+
import{A as LM,B as DM,C as $M,D as FM,E as GM,a as Vn,b as US,c as jS,d as BS,e as qS,f as zS,g as Ww,h as Xw,i as ka,j as xa,k as Na,m as La,n as Da,o as $a,p as Fa,q as Ga,r as Ua,s as ja,t as Ba,u as Za,v as Qa,w as ec,x as tc,y as rc,z as NM}from"./chunks/chunk-7NL3A2BY.js";import{A as vk,B as Ok,C as Rk,D as Ik,E as Pk,F as Mk,G as kk,H as xk,I as Nk,J as Lk,K as Dk,L as $k,M as Fk,N as Gk,O as Uk,P as jk,Q as Bk,R as qk,S as zk,T as Vk,U as Hk,V as Kk,W as Wk,X as Xk,Y as Yk,a as ek,b as tk,c as rk,d as ok,e as nk,f as ik,g as sk,h as ak,i as ck,j as dk,k as lk,l as uk,m as pk,n as mk,o as fk,p as _k,q as hk,r as gk,s as yk,t as bk,u as Ck,v as Tk,w as Sk,x as Ek,y as wk,z as Ak}from"./chunks/chunk-CZLAWXDR.js";import{a as Mh}from"./chunks/chunk-WP6NRH72.js";import{a as UM,b as jM,c as BM,d as qM}from"./chunks/chunk-TRYXVQ7W.js";import{a as zM,b as VM,c as HM,d as KM,e as WM,f as XM,g as YM,h as JM,i as ZM,j as QM}from"./chunks/chunk-HY6M34B4.js";import{$ as mm,$a as n_,$b as nh,A as Ve,Aa as vf,Ab as M_,B as Qp,Ba as Of,Bb as k_,C as em,Ca as Rf,Cb as x_,D as tm,Da as If,Db as N_,E as rm,Ea as Pf,Eb as L_,F as om,Fa as Mf,Fb as D_,G as Bt,Ga as kf,Gb as $_,H as qt,Ha as xf,Hb as F_,I as zt,Ia as Nf,Ib as G_,J as Vt,Ja as Lf,Jb as U_,K as Ht,Ka as Df,Kb as j_,L as Kt,La as $f,Lb as B_,M as Wt,Ma as Ff,Mb as q_,N as Xt,Na as Gf,Nb as z_,O as Yt,Oa as Uf,Ob as V_,P as Jt,Pa as jf,Pb as H_,Q as Zt,Qa as Bf,Qb as K_,R as nm,Ra as qf,Rb as W_,S as im,Sa as zf,Sb as X_,T as sm,Ta as Vf,Tb as Y_,U as am,Ua as Hf,Ub as J_,V as cm,Va as Qt,Vb as Z_,W as He,Wa as me,Wb as Q_,X as dm,Xa as e_,Xb as eh,Y as lm,Ya as t_,Yb as th,Z as um,Za as r_,Zb as rh,_ as pm,_a as o_,_b as oh,a as NS,aa as fm,ab as i_,ac as ih,b as LS,ba as _m,bb as s_,bc as sh,c as DS,ca as hm,cb as a_,cc as ah,d as $S,da as _M,db as c_,dc as ch,e as FS,ea as hM,eb as d_,ec as dh,f as GS,fa as gM,fb as l_,fc as lh,g as Ni,ga as Im,gb as u_,gc as uh,h as Li,ha as Pm,hb as p_,hc as ph,i as Di,ia as Mm,ib as m_,ic as mh,j as Ow,ja as gf,jb as f_,jc as fh,k as Rw,ka as yf,kb as __,kc as _h,l as zi,la as vM,lb as h_,lc as hh,m as RR,ma as OM,mb as g_,mc as gh,n as IR,na as RM,nb as y_,nc as yh,o as PR,oa as IM,ob as b_,oc as bh,p as MR,pa as PM,pb as C_,pc as Ch,q as kR,qa as MM,qb as T_,qc as Th,r as xR,ra as kM,rb as S_,rc as Sh,s as pl,sa as xM,sb as E_,sc as Eh,t as Bu,ta as bf,tb as w_,tc as wh,u as qu,ua as Cf,ub as A_,uc as Ah,v as Ku,va as Tf,vb as v_,vc as vh,w as Wu,wa as Sf,wb as O_,wc as Oh,x as pp,xa as Ef,xb as R_,xc as Rh,y as bp,ya as wf,yb as I_,yc as Ih,z as oP,za as Af,zb as P_,zc as Ph}from"./chunks/chunk-XOUBIF6Z.js";import{e as DR,f as $R,g as ml,h as fl,i as Gt}from"./chunks/chunk-Z2GYDSAO.js";import{A as nM,B as iM,C as sM,D as aM,E as cM,F as dM,G as lM,H as uM,I as pM,J as mM,K as fM,L as bm,M as Cm,N as Tm,O as Sm,P as Em,Q as wm,R as Am,S as vm,T as Om,U as Rm,a as UI,b as jI,c as BI,d as qI,e as zI,f as ju,g as VI,h as HI,i as KI,j as WI,k as XI,m as Hu,n as gm,o as KP,p as WP,q as XP,r as YP,s as JP,t as ZP,u as ym,v as QP,w as eM,x as tM,y as rM,z as oM}from"./chunks/chunk-R4TUD355.js";import{$ as eR,$a as El,$b as xu,$c as Yp,A as IO,Ab as BR,Ac as Qu,Ad as Qm,B as PO,Bb as qR,Bc as ep,Bd as ef,C as MO,Cb as zR,Cc as tp,Cd as tf,D as kO,Db as VR,Dc as rp,Dd as rf,E as xO,Eb as HR,Ec as op,Ed as of,F as ze,Fa as Yd,Fb as KR,Fc as np,Fd as nf,G as NO,Ga as Jd,Gb as mI,Gc as ip,Gd as sf,H as xt,Ha as Zd,Hb as fI,Hc as sp,Hd as af,I as LO,Ia as Qd,Ib as _I,Ic as ap,J as DO,Ja as el,Jb as hI,Jc as cp,Jd as cf,K as $O,Kb as gI,Kc as dp,Kd as df,L as FO,La as tl,Lb as yI,Lc as lp,Ld as lf,M as GO,Ma as rl,Mb as bI,Md as uf,N as UO,Na as ol,Nb as AI,Nc as tP,Nd as pf,O as jO,Oa as nl,Ob as vI,Oc as rP,Od as mf,P as BO,Pa as NR,Pb as vu,Pc as up,Pd as ff,Q as qO,Qa as LR,Qb as Ou,Qc as Cp,Qd as _f,R as zO,Ra as il,Rb as OI,Rd as hf,S as VO,Sa as sl,Sb as RI,Sd as Kf,T as HO,Ta as al,Tb as II,Td as Wf,U as KO,Ua as cl,Ub as PI,Uc as Tp,Ud as Xf,V as WO,Va as dl,Vb as MI,Vd as Yf,W as XO,Wa as ll,Wb as Ru,Wc as Sp,Wd as Jf,X as YO,Xa as ul,Xb as Iu,Xc as Hp,Xd as Zf,Y as JO,Ya as Cl,Yb as Pu,Yc as Kp,Yd as Qf,Z as ZO,Za as Tl,Zb as Mu,Zc as Wp,_ as QO,_a as Sl,_b as ku,_c as Xp,a as CO,aa as tR,ab as wl,ac as Nu,ad as Jp,b as Pt,ba as rR,bb as Al,bc as Lu,bd as Zp,c as TO,ca as oR,cb as vl,cc as Du,cd as km,d as Be,da as nR,db as Ol,dc as $u,dd as xm,e as ee,ea as iR,eb as Rl,ec as Fu,ed as Nm,f as pd,fa as sR,fb as Il,fc as Gu,fd as Lm,gb as Pl,gc as kI,gd as Dm,hb as Ml,hc as xI,hd as $m,i as qe,ib as kl,ic as NI,id as Fm,j as md,jb as xl,jc as LI,jd as Gm,k as fd,kb as Nl,kc as DI,kd as Um,lb as Ll,lc as $I,ld as EM,m as pe,ma as Xd,mb as Dl,mc as FI,md as wM,n as _d,nb as $l,nc as GI,nd as AM,o as hd,ob as GR,oc as Uu,od as jm,p as gd,pb as Fl,pc as YI,pd as Bm,q as yd,qb as Gl,qc as JI,qd as qm,r as SO,rb as Ul,rc as ZI,rd as zm,s as EO,sb as jl,sc as QI,sd as Vm,t as wO,tb as UR,tc as eP,td as Hm,u as AO,ub as Bl,uc as zu,ud as Km,v as vO,vb as ql,vc as Vu,vd as Wm,w as Mt,wb as zl,wc as Xu,wd as Xm,x as OO,xb as Vl,xc as Yu,xd as Ym,y as RO,yb as Hl,yc as Ju,yd as Jm,z as kt,zb as jR,zc as Zu,zd as Zm}from"./chunks/chunk-MTJMOI4I.js";import{$ as kd,$a as Bd,A as bR,B as CR,C as TR,D as Ed,E as wd,F as Ad,G as vd,H as Od,I as SR,J as Rd,K as Id,Ka as Lt,L as Pd,La as Dt,Ma as $t,Na as Ft,Oa as Ld,Qa as Dd,Ra as $d,Sa as Fd,U as ER,V as wR,X as AR,Xa as Gd,Y as vR,Ya as Ud,Z as OR,_ as Md,_a as jd,a as xw,aa as xd,ab as qd,b as Nw,ba as Nd,bb as zd,c as Lw,ca as Nt,cb as Vd,d as Vi,e as Hi,eb as Hd,f as Ki,fb as Kd,g as Wi,gb as Wd,h as Xi,j as bd,k as Cd,m as Td,n as Sd,o as aR,p as cR,q as dR,r as lR,s as uR,t as pR,u as mR,v as fR,w as _R,x as hR,y as gR,z as yR}from"./chunks/chunk-ZI7F3FVE.js";import{$ as cO,$a as Au,$b as mP,$c as yM,Aa as Zl,Ac as UP,Ba as Ql,Bb as CI,Bc as jP,Ca as eu,Cb as TI,Cc as BP,Da as tu,Db as SI,Dc as Ut,Ea as ru,Eb as EI,Ec as Rp,Fa as ou,Fb as wI,Fc as Ip,G as Qv,Ga as nu,Gb as mp,Gc as Pp,H as eO,Ha as iu,Hb as fp,Hc as Mp,I as tO,Ia as su,Ib as _p,Ic as kp,J as rO,Ja as au,Jb as hp,Jc as xp,K as oO,Ka as cu,Kb as gp,Kc as Np,L as nO,La as du,Lb as yp,Lc as Lp,M as iO,Ma as lu,Mb as Ep,Mc as Dp,N as sO,Na as uu,Nb as wp,Nc as $p,O as ed,Oa as pu,Ob as Ap,Oc as Fp,P as td,Pa as mu,Pb as vp,Pc as Gp,Q as rd,Qa as fu,Qb as nP,Qc as Up,R as od,Ra as _u,Rb as iP,Rc as jp,S as nd,Sa as hu,Sb as sP,Sc as Bp,T as id,Ta as gu,Tb as aP,Tc as qp,U as sd,Ua as yu,Ub as cP,Uc as jt,V as ad,Va as bu,Vb as dP,Vc as zp,W as cd,Wa as Cu,Wb as lP,Wc as qP,X as dd,Xa as Tu,Xc as zP,Y as ld,Ya as Su,Yb as Op,Yc as VP,Z as je,Za as Eu,Zb as uP,Zc as Vp,_ as aO,_a as wu,_b as pP,_c as HP,aa as dO,ac as fP,ad as bM,b as ww,ba as lO,bc as _P,bd as CM,c as Aw,ca as uO,cb as WR,cc as hP,cd as TM,d as vw,da as pO,db as XR,dc as gP,dd as SM,e as Iw,eb as YR,ec as yP,f as Pw,fb as JR,fc as bP,g as Mw,ga as mO,gb as ZR,gc as CP,h as kw,ha as fO,hb as QR,hc as TP,i as $v,ia as _O,ib as eI,ic as SP,j as Fv,ja as hO,jb as tI,jc as EP,k as Gv,ka as gO,kb as rI,kc as wP,l as Uv,la as yO,lb as oI,lc as AP,m as jv,ma as bO,mb as nI,mc as vP,n as Bv,na as ud,nb as iI,nc as OP,o as qv,oa as _l,ob as sI,oc as RP,p as zv,pa as hl,pc as IP,q as Vv,qa as gl,qc as PP,r as Hv,ra as yl,rc as MP,s as Kv,sa as FR,sb as aI,sc as kP,t as Wv,tc as xP,u as Xv,ua as bl,ub as cI,uc as NP,v as Yv,va as Kl,vb as dI,vc as LP,w as Jv,wa as Wl,wc as DP,x as Zv,xa as Xl,xb as lI,xc as $P,ya as Yl,yb as uI,yc as FP,za as Jl,zb as pI,zc as GP}from"./chunks/chunk-SV7CZEVV.js";import{$a as Ko,$c as Ct,$d as fn,$e as oS,$f as tE,$g as yi,$h as BE,$i as bw,$j as vs,$k as va,$l as AA,$m as iv,$n as Rc,A as Do,Aa as zo,Ac as IC,Ad as fT,Ae as Gn,Af as TS,Ah as wE,Ai as Gi,Aj as es,Ak as Qs,Al as nA,Am as UA,An as hc,Ao as qc,Bc as PC,Bd as _T,Be as Un,Bf as SS,Bg as ni,Bh as AE,Bj as ts,Bk as ea,Bm as jA,Bn as gc,Bo as zc,C as xe,Cc as MC,Cd as hT,Ce as jn,Cf as ES,Cg as ii,Ch as vE,Cj as rs,Ck as ta,Cm as BA,Cn as yc,Co as Vc,D as $o,Dc as rn,Dd as gT,De as Bn,Df as wS,Dg as uE,Dh as OE,Di as iw,Dj as os,Dk as ra,Dl as oc,Dm as qA,Dn as gv,Do as Hc,Ec as kC,Ed as yT,Ee as LT,Ef as AS,Eg as si,Eh as RE,Ej as ns,Ek as oa,El as iA,Em as zA,En as yv,Eo as Kc,F as Nb,Fc as xC,Fd as bT,Fe as DT,Ff as vS,Fg as ai,Fh as IE,Fj as is,Fk as na,Fl as sA,Fm as VA,Fn as bv,Fo as Wc,G as Lb,Gb as cC,Gc as NC,Gd as CT,Ge as $T,Gf as OS,Gg as pE,Gh as PE,Gj as ss,Gk as ia,Gl as aA,Gm as vt,Gn as Cv,Go as Xc,H as Db,Hc as LC,Hd as TT,He as FT,Hf as RS,Hg as ci,Hh as ME,Hi as Ui,Hj as as,Hk as sa,Hl as cA,Hn as Tv,Ho as Yc,I as $b,Ib as dC,Ic as DC,Id as ST,Ie as GT,If as IS,Ig as di,Ii as wt,Ij as cs,Ik as aa,Il as dA,Im as HA,In as Sv,Io as Jc,J as Fb,Jb as lC,Jc as $C,Jd as ET,Je as UT,Jf as PS,Jg as L,Jh as kE,Ji as sw,Jj as ds,Jk as ca,Jl as lA,Jn as Ev,Jo as Zc,K as Gb,Kb as uC,Kc as FC,Ke as jT,Kf as MS,Kg as li,Kh as Mi,Ki as aw,Kj as ls,Kk as da,Km as KA,Kn as wv,Ko as Qc,Lb as pC,Lc as GC,Ld as wT,Le as BT,Lh as ki,Li as cw,Lj as us,Lk as la,Ll as uA,Lo as It,M as Ub,Mb as mC,Mc as on,Md as AT,Me as qT,Mf as kS,Mh as xE,Mi as dw,Mj as ps,Mk as ua,Ml as pA,N as jb,Nc as UC,Nd as vT,Ne as zT,Nf as xS,Ni as lw,Nk as pa,Nl as mA,Oc as nn,Od as OT,Of as Hn,Oi as uw,Oj as ms,Ok as ma,Ol as fA,Om as WA,On as Rt,Pa as Zb,Pb as fC,Pd as RT,Pe as VT,Pf as Kn,Pi as pw,Pj as fs,Pk as fa,Pm as XA,Pn as Av,Q as Bb,Qa as Qb,Qb as _C,Qc as jC,Qd as IT,Qe as HT,Qf as Wn,Qi as mw,Qj as _s,Qk as _a,Ql as _A,Qm as YA,Qn as vv,Ra as eC,Rc as BC,Rd as PT,Re as KT,Rf as VS,Rg as mE,Rh as NE,Ri as fw,Rj as hs,Rk as ha,Rl as hA,Rm as nc,Rn as Ov,Sc as qC,Sd as MT,Se as WT,Sf as HS,Sg as fE,Sh as LE,Sj as gs,Sk as ga,Sm as JA,Sn as bc,T as qb,Tb as I,Tc as zC,Td as kT,Te as XT,Tf as KS,Tg as _E,Th as DE,Ti as _w,Tj as ys,Tk as ya,Tl as gA,Tn as Cc,Ua as Vo,Ub as hC,Uc as VC,Ud as xT,Ue as YT,Uf as WS,Ug as ui,Uh as $E,Ui as hw,Uj as bs,Uk as ba,Ul as yA,Um as ZA,Un as Tc,V as zb,Va as tC,Vb as yt,Vd as NT,Ve as JT,Vf as XS,Vg as pi,Vh as FE,Vi as gw,Vj as Cs,Vk as Ca,Vl as bA,Vm as QA,Vn as Sc,W as Vb,Wa as rC,Wb as gC,Wd as dn,We as ZT,Wf as YS,Wg as mi,Wh as GE,Wi as yw,Wj as Ts,Wk as Ta,Wl as CA,Wm as ev,Wn as Ec,X as Hb,Xa as oC,Xd as ln,Xe as QT,Xf as JS,Xg as fi,Xi as ji,Xj as Ss,Xk as Sa,Xl as TA,Xm as tv,Xn as wc,Ya as nC,Yb as yC,Yd as un,Ye as eS,Yf as ZS,Yg as _i,Yh as UE,Yi as Bi,Yj as Es,Yk as Ea,Yl as SA,Ym as rv,Yn as Ac,Zd as pn,Ze as tS,Zf as QS,Zg as hi,Zj as ws,Zk as wa,Zl as EA,Zm as ov,Zn as vc,_a as Ho,_c as bt,_d as mn,_e as rS,_f as eE,_g as gi,_h as jE,_i as qi,_j as As,_k as Aa,_l as wA,_m as nv,_n as Oc,ab as Ne,ad as sn,ae as _n,af as nS,ag as rE,ah as bi,ai as qE,ak as Os,al as Oa,an as sv,ao as Ic,b as vo,bb as iC,bd as an,be as Le,bf as iS,bg as oE,bh as Ci,bi as zE,bj as Cw,bk as Rs,bl as Ra,bm as vA,bn as av,bo as Pc,c as Oo,ca as Kb,cb as sC,cd as cn,ce as De,cf as Tt,ch as Ti,ci as VE,cj as Tw,ck as Is,cl as Ia,cm as OA,cn as Ot,co as Mc,d as Ro,db as Wo,de as hn,dh as Si,di as HE,dj as Sw,dk as Ps,dl as Pa,dm as RA,dn as cv,do as kc,e as Io,eb as Xo,ed as HC,ee as gn,ef as St,eh as Ei,ei as KE,ek as Ms,em as IA,eo as xc,f as Pe,fa as Wb,fd as KC,fe as yn,ff as qn,fh as wi,fi as WE,fj as Ew,fk as ks,fl as Ue,fm as PA,fo as Nc,g as Po,gb as Yo,gd as WC,ge as bn,gf as zn,gh as Ai,gi as XE,gk as xs,gl as Q,gn as dv,go as Lc,h as N,hd as XC,he as Cn,hf as Et,hg as nE,hh as hE,hj as Dw,hk as Ns,hl as Ma,hm as MA,hn as lv,ho as Dc,i as Me,ia as Xb,ic as bC,id as YC,ie as Tn,ih as gE,ij as $w,ik as Ls,il as qa,in as uv,j as Mo,jc as CC,jd as JC,je as Sn,jf as sS,jh as vi,jj as Fw,jk as Ds,jl as za,jm as kA,jn as pv,jo as Rv,k as ko,kc as TC,kd as ZC,ke as En,kg as Xn,kh as yE,ki as YE,kj as Fe,kk as $s,kl as Va,km as xA,kn as mv,ko as Iv,l as xo,ld as QC,le as wn,lf as aS,lg as iE,lh as Oi,lj as Gw,lk as Fs,ll as Ha,lm as NA,ln as fv,m as No,ma as Yb,mc as SC,md as eT,me as An,mf as $e,mg as Yn,mh as Ri,mi as JE,mj as Uw,mk as Gs,ml as Ka,mm as LA,mn as _v,n as Rb,na as ue,nc as EC,nd as tT,ne as vn,nf as cS,nh as Ii,nj as jw,nk as Us,nl as Wa,nm as DA,nn as hv,no as Pv,o as ke,oa as Jb,od as rT,oe as On,of as dS,og as sE,oh as Pi,oi as ZE,oj as At,ok as js,ol as Xa,on as ic,oo as Mv,p as ht,pa as b,pc as wC,pd as oT,pe as Rn,pf as lS,pg as aE,pi as xi,pj as Ge,pk as Bs,pl as Ya,pn as sc,po as kv,q as Ib,qa as Fo,qc as Qo,qd as nT,qe as In,qf as uS,qg as cE,qi as QE,qj as Bw,qk as qs,ql as Ja,qn as ac,qo as xv,r as Pb,ra as Go,rd as iT,re as Pn,rf as pS,rg as Jn,rj as qw,rk as zs,rl as Yw,rn as cc,ro as Nv,s as Mb,sa as Uo,sc as en,sd as sT,se as Mn,sf as mS,sg as Zn,si as ew,sj as zw,sk as Vs,sl as Jw,sn as dc,so as Lv,t as kb,tb as Jo,tc as tn,td as aT,te as kn,tf as fS,tg as Qn,ti as tw,tj as Vw,tk as Hs,tl as Zw,tn as lc,to as Dv,u as q,ub as Zo,ud as cT,ue as xn,uf as _S,ug as ei,ui as rw,uj as Hw,uk as Ks,ul as Qw,uo as $c,v as xb,vb as aC,vd as dT,ve as Nn,vf as hS,vg as ti,vh as bE,vi as ow,vj as Kw,vk as Ws,vl as eA,vn as uc,vo as Fc,wa as jo,wc as AC,wd as lT,we as Ln,wf as gS,wg as ri,wh as CE,wi as nw,wj as Yi,wk as Xs,wl as tA,wn as pc,wo as Gc,x as Lo,xc as vC,xd as uT,xe as Dn,xf as yS,xg as oi,xh as TE,xj as Ji,xk as Ys,xl as rA,xm as $A,xn as mc,xo as Uc,y as gt,ya as Bo,yc as OC,yd as pT,ye as $n,yf as bS,yg as dE,yh as SE,yi as $i,yj as Zi,yk as Js,ym as FA,yn as fc,yo as jc,z as le,za as qo,zc as RC,zd as mT,ze as Fn,zf as CS,zg as lE,zh as EE,zi as Fi,zj as Qi,zk as Zs,zl as oA,zm as GA,zn as _c,zo as Bc}from"./chunks/chunk-R7ULWMBG.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]="08485124-a2f1-5bb5-9316-533a3f7888bc")}catch{}})();var z="2026-07-28",Jk=["2025-11-25","2025-06-18"],Ke=[z],m={headerMismatch:-32020,missingRequiredClientCapability:-32021,unsupportedProtocolVersion:-32022,invalidParams:-32602},w={clientCapabilities:"io.modelcontextprotocol/clientCapabilities",clientInfo:"io.modelcontextprotocol/clientInfo",logLevel:"io.modelcontextprotocol/logLevel",protocolVersion:"io.modelcontextprotocol/protocolVersion",serverInfo:"io.modelcontextprotocol/serverInfo"},er=["debug","info","notice","warning","error","critical","alert","emergency"],p=class extends Error{code;data;constructor(t,r,o={}){super(t),this.name="PmMcpProtocolError",this.code=r,this.data=o}};function _(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function kh(e){if(e===void 0)return;if(!_(e))throw new p("Invalid MCP clientInfo metadata",m.invalidParams,{field:w.clientInfo,expected:"object"});let t=typeof e.name=="string"?e.name.trim():"",r=typeof e.version=="string"?e.version.trim():"";if(t.length===0||r.length===0)throw new p("Invalid MCP clientInfo metadata",m.invalidParams,{field:w.clientInfo,required:["name","version"]});let o={name:t.slice(0,128),version:r.slice(0,128)};return typeof e.description=="string"&&e.description.trim()&&(o.description=e.description.trim().slice(0,1024)),typeof e.websiteUrl=="string"&&e.websiteUrl.trim()&&(o.websiteUrl=e.websiteUrl.trim().slice(0,2048)),o}function xh(e){if(e!==void 0){if(typeof e!="string"||!er.includes(e))throw new p("Invalid MCP logLevel metadata",m.invalidParams,{field:w.logLevel,allowed:[...er]});return e}}function We(e){let t=_(e)?e._meta:void 0;if(!_(t))throw new p("Missing required MCP request metadata",m.invalidParams,{required:[w.protocolVersion,w.clientCapabilities]});let r=t[w.protocolVersion];if(typeof r!="string"||!Ke.includes(r))throw new p("Unsupported protocol version",m.unsupportedProtocolVersion,{supported:[...Ke],requested:typeof r=="string"?r:null});let o=t[w.clientCapabilities];if(!_(o))throw new p("Invalid MCP client capabilities metadata",m.invalidParams,{field:w.clientCapabilities,expected:"object"});let n=kh(t[w.clientInfo]),i=xh(t[w.logLevel]);return{protocolVersion:z,clientCapabilities:o,...n?{clientInfo:n}:{},...i?{logLevel:i}:{}}}function Zk(e,t){if(t!==e.protocolVersion)throw new p("MCP protocol header does not match request metadata",m.headerMismatch,{header:t??null,metadata:e.protocolVersion})}function Qk(e,t){let r=t.filter(o=>!Object.prototype.hasOwnProperty.call(e.clientCapabilities,o));if(r.length>0)throw new p("Missing required client capability",m.missingRequiredClientCapability,{requiredCapabilities:Object.fromEntries(r.map(o=>[o,{}]))})}function ex(e,t){let r=e.clientCapabilities.extensions;return _(r)&&_(r[t])}function Xe(e,t){let r=_(e._meta)?e._meta:{};return{...e,_meta:{...r,[w.serverInfo]:{...t}}}}function Nh(e,t){return Xe({...e,resultType:"complete"},t)}function tx(e){let t=e.ttlMs??6e4;if(!Number.isFinite(t)||t<0)throw new p("Invalid MCP discovery cache TTL",m.invalidParams,{ttlMs:t});return Nh({supportedVersions:[...Ke],capabilities:structuredClone(e.capabilities),ttlMs:t,cacheScope:"public",...e.instructions?{instructions:e.instructions}:{}},e.serverInfo)}function rx(e,t){if(_(e)&&typeof e.resultType=="string")return e.resultType;if(t==="legacy")return"complete";throw new p("Modern MCP result is missing resultType",m.invalidParams,{required:"resultType"})}import{createHash as or,createHmac as nr,timingSafeEqual as Lh}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]="6505e714-d1f3-5794-88c8-51c1644acec9")}catch{}})();var Dh=["elicitation/create","roots/list","sampling/createMessage"],tr=class extends Error{inputRequests;requestState;constructor(t){super("MCP operation requires additional input"),this.name="PmMcpInputRequiredError",this.inputRequests=t.inputRequests,this.requestState=t.requestState}},ir=/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/u,fe=32,Je=64*1024,_e=16*1024,Ye={maxBytes:256*1024,maxDepth:32,maxNodes:4096};function $h(e){return e==="elicitation/create"?"elicitation":e==="sampling/createMessage"?"sampling":"roots"}function he(e,t,r){let o;try{o=JSON.stringify(e)}catch{throw new p(`Invalid ${r}: value is not JSON serializable`,m.invalidParams,{field:r})}if(Buffer.byteLength(o,"utf8")>t)throw new p(`Invalid ${r}: payload exceeds the protocol bound`,m.invalidParams,{field:r,maximumBytes:t})}function Ze(e,t){if(!_(e))throw new p("Invalid MCP inputRequests",m.invalidParams,{field:"inputRequests",expected:"object"});let r=Object.entries(e);if(r.length===0||r.length>fe)throw new p("Invalid MCP inputRequests count",m.invalidParams,{minimum:1,maximum:fe,observed:r.length});let o={};for(let[n,i]of r){if(!ir.test(n)||!_(i))throw new p("Invalid MCP input request entry",m.invalidParams,{field:`inputRequests.${n}`});let s=i.method;if(typeof s!="string"||!Dh.includes(s))throw new p("Unsupported MCP input request method",m.invalidParams,{field:`inputRequests.${n}.method`,method:s??null});let a=$h(s);if(!Object.prototype.hasOwnProperty.call(t.clientCapabilities,a))throw new p("Missing required client capability",m.missingRequiredClientCapability,{requiredCapabilities:{[a]:{}}});if(!_(i.params))throw new p("Invalid MCP input request parameters",m.invalidParams,{field:`inputRequests.${n}.params`,expected:"object"});o[n]={method:s,params:structuredClone(i.params)}}return he(o,Je,"inputRequests"),o}function sr(e){if(!_(e))throw new p("Invalid MCP inputResponses",m.invalidParams,{field:"inputResponses",expected:"object"});let t=Object.entries(e);if(t.length>fe)throw new p("Invalid MCP inputResponses count",m.invalidParams,{maximum:fe,observed:t.length});let r={};for(let[o,n]of t){if(!ir.test(o)||!_(n))throw new p("Invalid MCP input response entry",m.invalidParams,{field:`inputResponses.${o}`});r[o]=structuredClone(n)}return he(r,Je,"inputResponses"),r}function sx(e){let t=e.requestState?.trim();if(t&&Buffer.byteLength(t,"utf8")>_e)throw new p("Invalid MCP requestState: payload exceeds the protocol bound",m.invalidParams,{field:"requestState",maximumBytes:_e});let r=e.inputRequests===void 0?void 0:Ze(e.inputRequests,e.requestContext);if(r===void 0&&!t)throw new p("InputRequiredResult requires inputRequests or requestState",m.invalidParams,{requiredAnyOf:["inputRequests","requestState"]});return{resultType:"input_required",...r?{inputRequests:r}:{},...t?{requestState:t}:{},_meta:{[w.serverInfo]:{...e.serverInfo}}}}function ar(e){let t=Buffer.from(e);if(t.byteLength<32)throw new p("MCP requestState signing key must contain at least 32 bytes",m.invalidParams,{minimumBytes:32});return t}function ax(e,t){if(!Number.isSafeInteger(e.expiresAt)||e.expiresAt<=0||e.method.trim().length===0||e.parameterDigest.trim().length===0||e.principal.trim().length===0)throw new p("Invalid MCP requestState payload",m.invalidParams);let r=Buffer.from(JSON.stringify({version:1,...e}),"utf8");if(r.byteLength>_e/2)throw new p("MCP requestState payload exceeds the protocol bound",m.invalidParams,{maximumBytes:_e/2});let o=r.toString("base64url"),n=nr("sha256",ar(t)).update(o).digest("base64url");return`${o}.${n}`}function Fh(e){if(!_(e)||e.version!==1)throw new p("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});let{expiresAt:t,method:r,parameterDigest:o,principal:n,state:i}=e;if(typeof t!="number"||!Number.isSafeInteger(t))throw new p("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});if(typeof r!="string"||typeof o!="string"||typeof n!="string")throw new p("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});return{expiresAt:t,method:r,parameterDigest:o,principal:n,state:i}}function cx(e,t,r){let[o,n,i]=e.split(".");if(!o||!n||i!==void 0)throw new p("Invalid MCP requestState encoding",m.invalidParams,{field:"requestState"});let s=Buffer.from(n,"base64url"),a=nr("sha256",ar(t)).update(o).digest();if(s.byteLength!==a.byteLength||!Lh(s,a))throw new p("Invalid MCP requestState signature",m.invalidParams,{field:"requestState"});let c;try{c=JSON.parse(Buffer.from(o,"base64url").toString("utf8"))}catch{c=null}let d=Fh(c),{expiresAt:l,method:u,parameterDigest:f,principal:g}=d;if(l<(r.nowMs??Date.now()))throw new p("Expired MCP requestState",m.invalidParams,{field:"requestState",expiredAt:l});if(u!==r.method||f!==r.parameterDigest||g!==r.principal)throw new p("MCP requestState binding mismatch",m.invalidParams,{field:"requestState"});return d}function dx(e){return he(e,Je,"request parameters"),or("sha256").update(JSON.stringify(e)).digest("hex")}var rr=class{#e=new Set;#t;constructor(t=4096){if(!Number.isSafeInteger(t)||t<1)throw new p("Invalid MCP replay guard capacity",m.invalidParams,{maximumEntries:t});this.#t=t}consume(t){let r=or("sha256").update(t).digest("hex");if(this.#e.has(r))throw new p("MCP requestState replay detected",m.invalidParams,{field:"requestState"});if(this.#e.size>=this.#t){let o=this.#e.values().next().value;this.#e.delete(o)}this.#e.add(r)}};function Gh(e){if(!Number.isSafeInteger(e.ttlMs)||e.ttlMs<0||e.cacheScope!=="public"&&e.cacheScope!=="private")throw new p("Invalid MCP cache policy",m.invalidParams,{ttlMs:e.ttlMs,cacheScope:e.cacheScope});return{ttlMs:e.ttlMs,cacheScope:e.cacheScope}}function lx(e,t){return{...e,...Gh(t)}}function Uh(e){return e.replaceAll("~1","/").replaceAll("~0","~")}function jh(e,t){if(t==="#")return e;if(!t.startsWith("#/"))return;let r=e;for(let o of t.slice(2).split("/").map(Uh)){if(!_(r)&&!Array.isArray(r)||!Object.prototype.hasOwnProperty.call(r,o))return;r=r[o]}return r}function Bh(e){let t=e.maxBytes??Ye.maxBytes,r=e.maxDepth??Ye.maxDepth,o=e.maxNodes??Ye.maxNodes;if(!Number.isSafeInteger(t)||t<2)throw new p("Invalid MCP JSON Schema work bounds",m.invalidParams);if(!Number.isSafeInteger(r)||r<1)throw new p("Invalid MCP JSON Schema work bounds",m.invalidParams);if(!Number.isSafeInteger(o)||o<1)throw new p("Invalid MCP JSON Schema work bounds",m.invalidParams);return{maximumBytes:t,maximumDepth:r,maximumNodes:o}}function qh(e,t){let r=Array.isArray(e.value)?e.value:_(e.value)?Object.values(e.value):[];for(let o of r)t.push({value:o,depth:e.depth+1})}function zh(e,t){if(!_(t)||typeof t.$ref!="string")return;let r=t.$ref;if(r.startsWith("#")&&jh(e,r)===void 0)throw new p("MCP JSON Schema contains an unresolved local reference",m.invalidParams,{reference:r})}function ux(e,t={}){let{maximumBytes:r,maximumDepth:o,maximumNodes:n}=Bh(t);if(typeof e!="boolean"&&!_(e))throw new p("Invalid MCP JSON Schema root",m.invalidParams,{expected:"object or boolean"});he(e,r,"JSON Schema");let i=[{value:e,depth:0}],s=0;for(;i.length>0;){let a=i.pop();if(s+=1,s>n||a.depth>o)throw new p("MCP JSON Schema exceeds validation work bounds",m.invalidParams,{maximumDepth:o,maximumNodes:n});zh(e,a.value),qh(a,i)}return structuredClone(e)}import{randomUUID as Vh}from"node:crypto";import{readFile as Hh}from"node:fs/promises";import cr 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]="7f5b3ba6-07cf-5317-8f62-63e84f561232")}catch{}})();var bx="io.modelcontextprotocol/tasks",Kh=["working","input_required","completed","failed","cancelled"],Wh=/^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,Xh=3600*1e3,Yh=1e3,ye=1024,Jh=30,Zh=2e3;function Qe(e){return new p(e,m.invalidParams,{code:"mcp_task_not_found_or_not_authorized"})}function ge(e){let t=e.trim();if(!Wh.test(t))throw Qe("Unknown MCP task");return t}function dr(e,t){if(typeof e!="string"||!Number.isFinite(Date.parse(e)))throw new p("Corrupt MCP task record",m.invalidParams,{field:t});return e}function lr(e){if(!_(e)||typeof e.code!="number"||!Number.isFinite(e.code)||typeof e.message!="string")throw new p("Corrupt MCP task error",m.invalidParams);return{code:e.code,message:e.message.slice(0,ye),..._(e.data)?{data:structuredClone(e.data)}:{}}}function Qh(e){if(!Kh.includes(e))throw new p("Corrupt MCP task record",m.invalidParams);return e}function eg(e){if(typeof e!="string"||e.length===0)throw new p("Corrupt MCP task record",m.invalidParams);return e}function tg(e){if(typeof e!="number"||!Number.isSafeInteger(e)||e<1)throw new p("Corrupt MCP task record",m.invalidParams);return e}function rg(e){if(e!==null&&(typeof e!="number"||!Number.isSafeInteger(e)||e<0))throw new p("Corrupt MCP task record",m.invalidParams);return e}function og(e){if(e!==void 0){if(typeof e!="number"||!Number.isSafeInteger(e)||e<0)throw new p("Corrupt MCP task record",m.invalidParams);return e}}function ng(e){if(!Array.isArray(e)||e.some(t=>typeof t!="string"))throw new p("Corrupt MCP task record",m.invalidParams);return[...e]}function ig(e){if(!_(e)||e.version!==1)throw new p("Corrupt MCP task record",m.invalidParams);let t=typeof e.taskId=="string"?ge(e.taskId):"",r=Qh(e.status),o=eg(e.principal),n=tg(e.workerPid),i=rg(e.ttlMs),s=og(e.pollIntervalMs),a={version:1,taskId:t,status:r,principal:o,workerPid:n,createdAt:dr(e.createdAt,"createdAt"),lastUpdatedAt:dr(e.lastUpdatedAt,"lastUpdatedAt"),ttlMs:i,consumedInputKeys:ng(e.consumedInputKeys),...typeof e.statusMessage=="string"?{statusMessage:e.statusMessage.slice(0,ye)}:{},...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=lr(e.error)),a.status==="input_required"&&!a.inputRequests||a.status==="completed"&&!a.result||a.status==="failed"&&!a.error)throw new p("Corrupt MCP task status payload",m.invalidParams,{status:a.status});return a}function V(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 te(e){return e==="completed"||e==="failed"||e==="cancelled"}function sg(e){try{return process.kill(e,0),!0}catch(t){return!(typeof t=="object"&&t!==null&&"code"in t&&t.code==="ESRCH")}}var et=class{#e;#t;#r;#o;#i;constructor(t){this.#e=cr.resolve(t.pmRoot),this.#t=t.owner?.trim()||"pm-mcp",this.#r=t.now??(()=>new Date),this.#o=t.taskIdFactory??(()=>`mcp-task-${Vh()}`),this.#i=t.workerPid??process.pid}#s(t){return cr.join(this.#e,"runtime","mcp-tasks","records",`${ge(t)}.json`)}async#c(t){try{return ig(JSON.parse(await Hh(this.#s(t),"utf8")))}catch(r){throw le(r)||r instanceof SyntaxError?Qe("Unknown MCP task"):r}}async#a(t){await xe(this.#s(t.taskId),`${JSON.stringify(t,null,2)}
|
|
2
|
+
`)}async#n(t,r,o){let n=ge(t),i=await $e(this.#e,n,Jh,this.#t,!1,!1,Zh);try{let s=await this.#c(n);if(s.principal!==r)throw Qe("Unknown MCP task");let a=o(s);return await this.#a(a),a}finally{await i()}}async create(t){let r=ge(this.#o()),o=t.principal.trim(),n=t.ttlMs===void 0?Xh:t.ttlMs,i=t.pollIntervalMs??Yh;if(o.length===0||n!==null&&(!Number.isSafeInteger(n)||n<0)||!Number.isSafeInteger(i)||i<0)throw new p("Invalid MCP task creation options",m.invalidParams);let s=this.#r().toISOString(),a={version:1,taskId:r,status:"working",createdAt:s,lastUpdatedAt:s,ttlMs:n,pollIntervalMs:i,principal:o,workerPid:this.#i,consumedInputKeys:[],...t.statusMessage?.trim()?{statusMessage:t.statusMessage.trim().slice(0,ye)}:{}};return await this.#a(a),{...V(a),resultType:"task"}}async get(t,r){return V(await this.#n(t,r,o=>{if(te(o.status))return o;let n=this.#r().getTime(),i=o.ttlMs!==null&&Date.parse(o.createdAt)+o.ttlMs<=n,s=o.workerPid!==this.#i&&!sg(o.workerPid);return!i&&!s?o:{...o,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=Ze(t.inputRequests,t.requestContext);return V(await this.#n(t.taskId,t.principal,o=>{if(te(o.status))return o;let n=Object.keys(r).filter(i=>o.consumedInputKeys.includes(i));if(n.length>0)throw new p("MCP task input request keys must be unique for the task lifetime",m.invalidParams,{reused:n});return{...o,status:"input_required",statusMessage:t.statusMessage?.trim().slice(0,ye),lastUpdatedAt:this.#r().toISOString(),inputRequests:r}}))}async update(t,r,o){let n=sr(o),i=[],s=[];return await this.#n(t,r,a=>{if(a.status!=="input_required"||!a.inputRequests)return a;let c={...a.inputRequests},d=a.inputResponses?{...a.inputResponses}:{};for(let[l,u]of Object.entries(n))Object.prototype.hasOwnProperty.call(c,l)&&(d[l]=u,delete c[l],i.push(l));return s=Object.keys(c).sort(),i.length===0?a:{...a,status:s.length===0?"working":"input_required",lastUpdatedAt:this.#r().toISOString(),inputRequests:s.length===0?void 0:c,inputResponses:d,consumedInputKeys:[...new Set([...a.consumedInputKeys,...i])].sort()}}),{acceptedKeys:i.sort(),remainingKeys:s}}async takeInputResponses(t,r){let o={};return await this.#n(t,r,n=>(o=structuredClone(n.inputResponses??{}),Object.keys(o).length===0?n:{...n,inputResponses:void 0})),o}async complete(t,r,o){return V(await this.#n(t,r,n=>te(n.status)?n:{...n,status:"completed",statusMessage:"Task completed.",lastUpdatedAt:this.#r().toISOString(),result:structuredClone(o),inputRequests:void 0,error:void 0}))}async fail(t,r,o){let n=lr(o);return V(await this.#n(t,r,i=>te(i.status)?i:{...i,status:"failed",statusMessage:n.message,lastUpdatedAt:this.#r().toISOString(),error:n,inputRequests:void 0,result:void 0}))}async cancel(t,r){return V(await this.#n(t,r,o=>te(o.status)?o:{...o,status:"cancelled",statusMessage:"Task cancelled by the client.",lastUpdatedAt:this.#r().toISOString(),inputRequests:void 0,result:void 0,error:void 0}))}};function Cx(e){return new et(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]="f87864d3-e499-57f7-b1e3-4ea3f30b7725")}catch{}})();var be="io.modelcontextprotocol/subscriptionId",ur=256,pr=2048,ag=5e3;function cg(e,t){return new Promise((r,o)=>{let n=setTimeout(()=>o(new Error("MCP subscription sink write timed out")),ag);n.unref(),Promise.resolve().then(()=>e(t)).then(()=>{clearTimeout(n),r()},i=>{clearTimeout(n),o(i instanceof Error?i:new Error(String(i)))})})}function tt(e,t){if(e!==void 0){if(typeof e!="boolean")throw new p("Invalid MCP subscription filter",m.invalidParams,{field:`notifications.${t}`,expected:"boolean"});return e||void 0}}function dg(e){if(!_(e))throw new p("Invalid MCP subscription filter",m.invalidParams,{field:"notifications",expected:"object"});let t=tt(e.toolsListChanged,"toolsListChanged"),r=tt(e.promptsListChanged,"promptsListChanged"),o=tt(e.resourcesListChanged,"resourcesListChanged"),n;if(e.resourceSubscriptions!==void 0){if(!Array.isArray(e.resourceSubscriptions)||e.resourceSubscriptions.length>ur)throw new p("Invalid MCP resource subscriptions",m.invalidParams,{field:"notifications.resourceSubscriptions",maximum:ur});let i=new Set;for(let s of e.resourceSubscriptions){if(typeof s!="string"||s.trim().length===0||Buffer.byteLength(s,"utf8")>pr)throw new p("Invalid MCP resource subscription URI",m.invalidParams,{field:"notifications.resourceSubscriptions",maximumBytes:pr});i.add(s)}i.size>0&&(n=[...i].sort())}return{...t?{toolsListChanged:t}:{},...r?{promptsListChanged:r}:{},...o?{resourcesListChanged:o}:{},...n?{resourceSubscriptions:n}:{}}}function lg(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 mr=class{#e;#t=new Map;#r;constructor(t){this.#e=structuredClone(t.capabilities),this.#r={...t.serverInfo}}get size(){return this.#t.size}async open(t){if(this.#t.has(t.id))throw new p("MCP subscription id is already active",m.invalidParams,{subscriptionId:t.id});let r=lg(dg(t.notifications),this.#e),o={filter:r,sink:t.sink,writeQueue:Promise.resolve()};this.#t.set(t.id,o);try{await this.#o(t.id,o,{jsonrpc:"2.0",method:"notifications/subscriptions/acknowledged",params:{_meta:{[be]:t.id},notifications:structuredClone(r)}},!0)}catch(n){throw this.#t.delete(t.id),n}return structuredClone(r)}async emitListChanged(t){let r=`${t}ListChanged`,o=`notifications/${t}/list_changed`,n=[];for(let[i,s]of this.#t)s.filter[r]===!0&&n.push(this.#o(i,s,{jsonrpc:"2.0",method:o,params:{_meta:{[be]:i}}}));return(await Promise.all(n)).filter(Boolean).length}async emitResourceUpdated(t){let r=[];for(let[o,n]of this.#t)n.filter.resourceSubscriptions?.includes(t)&&r.push(this.#o(o,n,{jsonrpc:"2.0",method:"notifications/resources/updated",params:{_meta:{[be]:o},uri:t}}));return(await Promise.all(r)).filter(Boolean).length}async#o(t,r,o,n=!1){let i=r.writeQueue.then(async()=>{if(this.#t.get(t)!==r)return!1;try{return await cg(r.sink,o),!0}catch(s){if(this.#t.get(t)===r&&this.#t.delete(t),n)throw s;return!1}});return r.writeQueue=i.then(()=>{},()=>{}),i}close(t){if(this.#t.delete(t))return{...Xe({resultType:"complete",_meta:{[be]:t}},this.#r)}}closeAll(){let t=[];for(let r of this.#t.keys()){let o=this.close(r);t.push({id:r,result:o})}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]="7d591d0b-f009-519c-8024-c6fa18effb8e")}catch{}})();var fr=/^=\?base64\?([A-Za-z0-9+/]*={0,2})\?=$/u,ug=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/u,_r=/^[\t\x20-\x7E]*$/u,hr=new Set(["prompts/get","resources/read","tools/call"]);function pg(e){let t=new Map;for(let[r,o]of Object.entries(e)){if(o===void 0)continue;let n=typeof o=="string"?o:o.join(", ");t.set(r.toLowerCase(),n)}return t}function A(e,t){throw new p(e,m.headerMismatch,{header:t})}function gr(e){let t=typeof e=="boolean"?String(e).toLowerCase():String(e);return t.length>0&&t.trim()===t&&_r.test(t)&&!fr.test(t)?t:`=?base64?${Buffer.from(t,"utf8").toString("base64")}?=`}function yr(e,t){let r=fr.exec(e);if(r){let o=r[1],n=Buffer.from(o,"base64");return n.toString("base64")!==o||n.length===0?A("Malformed MCP Base64 header value",t):n.toString("utf8")}return e.length===0||e.trim()!==e||!_r.test(e)?A("Malformed MCP header value",t):e}function Ce(e){return Array.isArray(e)?e.some(Ce):_(e)?Object.prototype.hasOwnProperty.call(e,"x-mcp-header")||Object.values(e).some(Ce):!1}function mg(e,t,r){let o=e["x-mcp-header"];if(o===void 0)return;let n=e.type;if(typeof o!="string"||!ug.test(o)||!["boolean","integer","string"].includes(String(n))||r.has(o.toLowerCase()))throw new p("Invalid MCP x-mcp-header annotation",m.invalidParams,{field:t.join("."),annotation:o});return r.add(o.toLowerCase()),{name:o,path:t,type:n}}function br(e){if(!_(e))throw new p("Invalid MCP tool schema",m.invalidParams,{field:"inputSchema",expected:"object"});let t=[],r=new Set,o=(n,i)=>{let s=n.properties;if(s!==void 0){if(!_(s))throw new p("Invalid MCP tool schema properties",m.invalidParams,{field:"inputSchema.properties"});for(let[a,c]of Object.entries(s)){if(!_(c))continue;let d=[...i,a],l=mg(c,d,r);l&&t.push(l);for(let[u,f]of Object.entries(c))if(u!=="properties"&&u!=="x-mcp-header"&&Ce(f))throw new p("MCP x-mcp-header is not statically reachable",m.invalidParams,{field:d.join("."),keyword:u});o(c,d)}}};for(let[n,i]of Object.entries(e))if(n!=="properties"&&Ce(i))throw new p("MCP x-mcp-header is not statically reachable",m.invalidParams,{field:"inputSchema",keyword:n});return o(e,[]),t}function Cr(e,t){let r=e;for(let o of t){if(!_(r))return;r=r[o]}return r}function Tr(e,t){let r=e==="resources/read"?t.uri:t.name;return typeof r=="string"?r:void 0}function fg(e,t){let r=_(e.arguments)?e.arguments:{},o={};for(let n of br(t)){let i=Cr(r,n.path);if(i==null)continue;if(!(n.type==="integer"&&typeof i=="number"&&Number.isSafeInteger(i)||n.type==="boolean"&&typeof i=="boolean"||n.type==="string"&&typeof i=="string"))throw new p("Invalid MCP custom header argument",m.invalidParams,{field:n.path.join("."),expected:n.type});o[`Mcp-Param-${n.name}`]=gr(i)}return o}function Ax(e){let t=_(e.request.params)?e.request.params:void 0,r=We(t),o=e.request.method;if(typeof o!="string"||o.length===0)return A("Missing MCP request method","Mcp-Method");let n={Accept:"application/json, text/event-stream","Content-Type":"application/json","MCP-Protocol-Version":r.protocolVersion,"Mcp-Method":o},i=Tr(o,t);if(hr.has(o)){if(i===void 0)return A("Missing MCP request name","Mcp-Name");n["Mcp-Name"]=gr(i)}return o==="tools/call"&&e.toolSchema!==void 0&&Object.assign(n,fg(t,e.toolSchema)),n}function _g(e,t){let r=t.method;(typeof r!="string"||r.length===0)&&A("Missing MCP request method","Mcp-Method");let o=_(t.params)?t.params:void 0,n=We(o).protocolVersion;if(e.get("mcp-protocol-version")!==n&&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"),hr.has(r)){let i=e.get("mcp-name"),s=Tr(r,o);(i===void 0||s===void 0||yr(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 hg(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 gg(e){let t=_(e.params.arguments)?e.params.arguments:{};for(let r of br(e.toolSchema)){let o=Cr(t,r.path),n=`Mcp-Param-${r.name}`,i=e.headers.get(n.toLowerCase());if(o==null){i!==void 0&&A("Unexpected MCP parameter header",n);continue}i===void 0&&A("Missing MCP parameter header",n),hg(r,o,yr(i,n))||A("MCP parameter header does not match request body",n)}}function vx(e){let t=pg(e.headers),r=typeof e.request.method=="string"?e.request.method:"";_g(t,e.request),!(r!=="tools/call"||e.toolSchema===void 0)&&gg({headers:t,params:e.request.params,toolSchema:e.toolSchema})}var Ox=z;import{AsyncLocalStorage as yg}from"node:async_hooks";import{createHash as Sr,timingSafeEqual as bg}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]="6a5310f6-3add-5108-b39f-61607918dc9f")}catch{}})();var y=class extends Error{httpStatus;challenge;constructor(t,r,o){super(t),this.name="PmMcpAuthorizationError",this.httpStatus=r,this.challenge=o}},Cg=/^00-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})$/u,Tg=/^[a-z][a-z0-9_*/-]{0,255}$/u,Sg=/^(?:[a-z0-9][a-z0-9_*/-]{0,240})@[a-z][a-z0-9_*/-]{0,13}$/u,Eg=/^[\x20-\x2B\x2D-\x3C\x3E-\x7E]{0,255}[\x21-\x2B\x2D-\x3C\x3E-\x7E]$/u,wr=/^[\x21\x23-\x5B\x5D-\x7E]+$/u,Ar=/^[A-Za-z0-9!#$%&'*+.^_`|~-]+$/u,wg=/^[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]*$/u,Ag=/%(?![0-9A-Fa-f]{2})/u,vg=512,Og=32,Rg=180,Ig=8192,Pg=8192,vr=new yg;function E(e,t,r=!1){if(new RegExp("\\p{Cc}","u").test(e))throw new y(`Invalid ${t}`,401);let o;try{o=new URL(e)}catch{throw new y(`Invalid ${t}`,401)}let n=o.hostname==="127.0.0.1"||o.hostname==="localhost";if(o.hash.length>0||o.protocol!=="https:"&&!(r&&n&&o.protocol==="http:"))throw new y(`Invalid ${t}`,401);return o}function Mg(e,t){let r=t.toLowerCase();for(let[o,n]of Object.entries(e))if(!(o.toLowerCase()!==r||n===void 0))return typeof n=="string"?n:n.join(", ")}function kx(e){let t=E(e.resource,"protected resource URI",!0).href.replace(/\/$/u,"");if(e.authorizationServers.length===0)throw new y("Protected resource metadata requires an authorization server",401);let r=e.authorizationServers.map(n=>E(n,"authorization server issuer").href.replace(/\/$/u,"")),o=[...new Set(e.scopes??[])];if(o.some(n=>!wr.test(n)))throw new y("Invalid authorization scope",401);return{resource:t,authorization_servers:r,...o.length>0?{scopes_supported:o.sort()}:{}}}function xx(e){let t=E(e,"authorization server issuer"),r=t.pathname.replace(/^\/+|\/+$/gu,""),o=t.origin;return r?[`${o}/.well-known/oauth-authorization-server/${r}`,`${o}/.well-known/openid-configuration/${r}`,`${o}/${r}/.well-known/openid-configuration`]:[`${o}/.well-known/oauth-authorization-server`,`${o}/.well-known/openid-configuration`]}function Nx(e,t){if(!_(e)||typeof e.issuer!="string")throw new y("Invalid authorization server metadata",401);let r=E(t,"expected issuer").href.replace(/\/$/u,"");if(E(e.issuer,"metadata issuer").href.replace(/\/$/u,"")!==r)throw new y("Authorization server issuer mismatch",401);if(!Array.isArray(e.code_challenge_methods_supported)||!e.code_challenge_methods_supported.includes("S256"))throw new y("Authorization server does not support required S256 PKCE",401);let n=d=>{let l=e[d];if(typeof l!="string")throw new y(`Authorization server metadata requires ${d}`,401);return E(l,d).href},i=d=>{let l=e[d];return typeof l=="string"?E(l,d).href:void 0},s=n("authorization_endpoint"),a=n("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 Lx(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 Dx(e){if(e.responseIssuer===void 0){if(e.issuerParameterSupported)throw new y("Authorization response omitted the advertised issuer",401);return}if(e.responseIssuer!==e.expectedIssuer)throw new y("Authorization response issuer mismatch",401)}function $x(e,t){let r=E(t,"client metadata document URL");if(r.pathname==="/"||!_(e)||e.client_id!==r.href||typeof e.client_name!="string"||e.client_name.trim().length===0||!Array.isArray(e.redirect_uris)||e.redirect_uris.length===0)throw new y("Invalid Client ID Metadata Document",401);for(let o of e.redirect_uris){if(typeof o!="string")throw new y("Invalid client redirect URI",401);E(o,"client redirect URI",!0)}return structuredClone(e)}function Fx(e){if(e.redirectUris.length===0||e.clientName.trim().length===0)throw new y("Invalid dynamic client registration metadata",401);let t=e.redirectUris.map(r=>E(r,"redirect URI",!0).href);return{application_type:e.applicationType,client_name:e.clientName.trim().slice(0,128),redirect_uris:t,grant_types:["authorization_code","refresh_token"],response_types:["code"],token_endpoint_auth_method:"none"}}var Er=class{#e=new Map;set(t,r){let o=E(t,"credential issuer").href;this.#e.set(o,structuredClone(r))}get(t){let r=E(t,"credential issuer").href,o=this.#e.get(r);return o?structuredClone(o):void 0}delete(t){let r=E(t,"credential issuer").href;return this.#e.delete(r)}};function kg(e){let t=e.traceparent,r=e.tracestate;if(t!==void 0){let o=typeof t=="string"?Cg.exec(t):null;if(!o)throw new y("Invalid MCP traceparent",403);let n=o[1],i=o[2];if(/^0+$/u.test(n)||/^0+$/u.test(i))throw new y("Invalid MCP traceparent",403)}if(r!==void 0&&(typeof r!="string"||!Ng(r)))throw new y("Invalid MCP tracestate",403);return{...typeof t=="string"?{traceparent:t}:{},...typeof r=="string"?{tracestate:r}:{}}}function D(e){return e.replace(/^[ \t]*|[ \t]*$/gu,"")}function xg(e){return Tg.test(e)||Sg.test(e)}function Ng(e){if(Buffer.byteLength(e,"utf8")>vg)return!1;let t=e.split(",");if(t.length>Og)return!1;let r=new Set;for(let o of t){let n=D(o);if(n.length===0)continue;let i=n.indexOf("="),s=i>0?n.slice(0,i):"",a=i>0?n.slice(i+1):"";if(!xg(s)||!Eg.test(a)||r.has(s))return!1;r.add(s)}return!0}function Or(e){return wg.test(e)&&!Ag.test(e)}function Lg(e){let t=D(e),r=t.indexOf("="),o=D(r>=0?t.slice(0,r):t),n=r>=0?D(t.slice(r+1)):void 0;return Ar.test(o)&&(n===void 0||Or(n))}function Dg(e){let t=D(e),r=t.split(";"),o=r[0],n=r.slice(1),i=o.indexOf("="),s=D(i>0?o.slice(0,i):""),a=i>0?D(o.slice(i+1)):"";if(!(!Ar.test(s)||!Or(a)||!n.every(Lg)))return{key:s,serialized:t}}function $g(e,t){if(e===void 0)return;if(typeof e!="string"||Buffer.byteLength(e,"utf8")>Ig)throw new y("Invalid MCP baggage",403);let r=new Set(t),o=e.split(",");if(o.length>Rg)throw new y("Invalid MCP baggage",403);let n=[];for(let i of o){let s=Dg(i);if(!s)throw new y("Invalid MCP baggage",403);r.has(s.key)&&n.push(s.serialized)}return n.length>0?n.join(","):void 0}function Gx(e,t={}){let r=_(e)&&_(e._meta)?e._meta:{},o=$g(r.baggage,t.baggageAllowlist??[]);return{...kg(r),...o?{baggage:o}:{}}}function Ux(e,t){return vr.run(structuredClone(e),t)}function jx(){let e=vr.getStore();return e?{...e}:void 0}async function Bx(e){let t=E(e.policy.resourceMetadataUrl,"protected resource metadata URL",!0).href,r=[...new Set(e.policy.requiredScopes??[])];if(r.some(u=>!wr.test(u)))throw new y("Invalid authorization scope",401);let o=`Bearer resource_metadata="${t}"`;if(new URL(e.requestUrl,e.policy.resource).searchParams.has("access_token"))throw new y("Access tokens must not appear in URI query parameters",401,o);let s=Mg(e.headers,"authorization")?.match(/^Bearer ([^\s]+)$/iu);if(!s)throw new y("Missing or malformed bearer token",401,o);let a=s[1];if(Buffer.byteLength(a,"utf8")>Pg)throw new y("Missing or malformed bearer token",401,o);let c;try{c=await e.policy.verifyAccessToken(a)}catch{throw new y("Invalid bearer token",401,o)}let d=Array.isArray(c.audience)?c.audience:[c.audience];if(c.issuer!==e.policy.issuer||!d.includes(e.policy.resource))throw new y("Bearer token issuer or audience mismatch",401,o);let l=r.filter(u=>!c.scopes.includes(u));if(l.length>0)throw new y("Bearer token has insufficient scope",403,`${o}, scope="${l.join(" ")}"`);return{...c,audience:[...d],scopes:[...c.scopes]}}function qx(e){let t=Sr("sha256").update(e.token).digest();return r=>{let o=Sr("sha256").update(r).digest();if(!bg(t,o))throw new y("Invalid bearer token",401);return structuredClone(e.claims)}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="4f17095e-2dba-530c-935c-1803ed359510")}catch{}})();var rt="io.modelcontextprotocol/ui",Te="2026-01-26",Pr="text/html;profile=mcp-app",Rr=Object.freeze({specVersion:Te,mimeTypes:[Pr]});function Hx(e){let t=e.clientCapabilities.extensions;if(!_(t))return!1;let r=t[rt];if(r===void 0)return!1;if(!_(r))throw new p("Invalid MCP Apps client capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[rt]:Rr}}});let o=r.mimeTypes,n=r.specVersion;if(!Array.isArray(o)||!o.includes(Pr)||n!==void 0&&n!==Te)throw new p("Unsupported MCP Apps client capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[rt]:Rr}}});return!0}var Fg={csp:{connectDomains:[],resourceDomains:[],frameDomains:[]},permissions:{},prefersBorder:!0},Mr=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:Fg})));function Kx(e){return Mr.find(t=>t.uri===e)}function Wx(e){let t=new Map(Mr.map(r=>[r.toolName,r]));return e.map(r=>{let o=t.get(r.name);return o?{...r,_meta:{...r._meta,ui:o.toolMeta}}:{...r}})}function Ir(e){return e.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function Xx(e){let t=Ir(e.name),r=Ir(e.description),o=JSON.stringify({name:`pm-${e.id}-view`,version:Te}),n=JSON.stringify(Te);return`<!doctype html>
|
|
3
3
|
<html lang="en">
|
|
4
4
|
<head>
|
|
5
5
|
<meta charset="utf-8">
|
|
@@ -22,11 +22,11 @@ import{A as PM,B as MM,C as kM,D as xM,E as NM,a as Vn,b as $S,c as FS,d as GS,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:${o},appCapabilities:{},protocolVersion:${n}}).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 ot}from"node:crypto";import{lstat as Gg,readdir as Gr,readFile as Ug}from"node:fs/promises";import M from"node:path";import{parseDocument as jg}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]="6bfbe073-3869-5451-9d65-499960a28af9")}catch{}})();var kr="io.modelcontextprotocol/skills",nt="SEP-2640@a3e147ca2710f68214247aecc729731ee1ae8d03",Bg=Object.freeze({revision:nt,status:"draft",directoryRead:!0});function
|
|
25
|
+
</html>`}import{createHash as ot}from"node:crypto";import{lstat as Gg,readdir as Gr,readFile as Ug}from"node:fs/promises";import M from"node:path";import{parseDocument as jg}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]="6bfbe073-3869-5451-9d65-499960a28af9")}catch{}})();var kr="io.modelcontextprotocol/skills",nt="SEP-2640@a3e147ca2710f68214247aecc729731ee1ae8d03",Bg=Object.freeze({revision:nt,status:"draft",directoryRead:!0});function o0(e,t=!1){let r=e.clientCapabilities.extensions,o=_(r)?r[kr]:void 0;if(!_(o)||o.revision!==nt||t&&o.directoryRead!==!0)throw new p("Missing or incompatible Skills over MCP draft capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[kr]:Bg}}})}var P=Object.freeze({maxFilesPerSkill:512,maxFileBytes:16*1024*1024,maxSkillBytes:16*1024*1024,defaultPageSize:20,maxPageSize:100}),xr=100,qg=32*1024*1024,zg=/^[a-z0-9]+(?:-[a-z0-9]+)*$/u,Nr=new Set(Array.from({length:P.maxPageSize},(e,t)=>t+1));function T(e,t){throw new p(e,-32602,t)}function Lr(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 Vg(e,t){let r=/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/u.exec(e);r||T(`Skill ${t} is missing YAML frontmatter.`);let o=jg(r[1],{prettyErrors:!1,strict:!0,uniqueKeys:!0});o.errors.length>0&&T(`Skill ${t} has invalid YAML frontmatter.`,{errors:o.errors.map(i=>i.message)});let n;try{n=o.toJS({maxAliasCount:0})}catch(i){T(`Skill ${t} has unsupported YAML aliases.`,{error:String(i)})}return(typeof n!="object"||n===null||Array.isArray(n))&&T(`Skill ${t} frontmatter must be an object.`),n}async function Hg(e,t,r,o){return r>P.maxFileBytes&&T(`Skill resource exceeds the per-file limit: ${t}.`),o.files+=1,o.files>P.maxFilesPerSkill&&T(`Skill exceeds ${P.maxFilesPerSkill} files.`),o.skillBytes+=r,o.skillBytes>P.maxSkillBytes&&T(`Skill exceeds the aggregate byte limit: ${t}.`),o.originBytes.value+=r,o.originBytes.value>qg&&T(`Skill origin exceeds the aggregate byte limit: ${t}.`),Ug(e)}async function Ur(e,t,r){let o=M.join(e,t),n=await Gr(o,{withFileTypes:!0}),i=[];for(let s of n.sort((a,c)=>a.name.localeCompare(c.name))){let a=M.posix.join(t.split(M.sep).join("/"),s.name),c=M.join(e,...a.split("/")),d=await Gg(c);d.isSymbolicLink()&&T(`Skill resource must not be a symbolic link: ${a}.`),d.isDirectory()?i.push(...await Ur(e,a,r)):d.isFile()?i.push({relative:a,bytes:await Hg(c,a,d.size,r)}):T(`Skill resource must be a regular file or directory: ${a}.`)}return i}async function Dr(e,t,r){let o=new Map,n;try{n=await Gr(e,{withFileTypes:!0})}catch(a){if(gt(a))return o;throw a}let i=n.filter(a=>a.isDirectory()&&zg.test(a.name)).sort((a,c)=>a.name.localeCompare(c.name));i.length>xr&&T(`Skill origin exceeds ${xr} directories.`);let s={value:0};for(let a of i){let c=await Ur(M.join(e,a.name),"",{files:0,skillBytes:0,originBytes:s}),d=c.reduce((h,C)=>h+C.bytes.byteLength,0),l=c.find(h=>h.relative==="SKILL.md");if(!l)continue;let u=Vg(l.bytes.toString("utf8"),a.name);u.name!==a.name&&T(`Skill directory ${a.name} must match frontmatter name.`,{actual:u.name??null,expected:a.name}),(typeof u.description!="string"||u.description.trim().length===0)&&T(`Skill ${a.name} requires a non-empty frontmatter description.`,{required:["description"]});let f=c.map(h=>({uri:`skill://${a.name}/${h.relative}`,digest:`sha256:${ot("sha256").update(h.bytes).digest("hex")}`,size:h.bytes.byteLength})),g=ot("sha256").update(f.map(h=>`${h.uri}:${h.digest}`).join(`
|
|
26
26
|
`)).digest("hex");o.set(a.name,{uri:`skill://${a.name}/SKILL.md`,frontmatter:u,resources:f,_meta:{contractVersion:1,extensionRevision:nt,origin:t,packageVersion:r,protocolVersion:z,trust:"untrusted",estimatedTokens:Math.ceil(d/4)},files:new Map(c.map(h=>[h.relative,h.bytes])),fingerprint:g})}return o}function $r(e){let{files:t,fingerprint:r,...o}=e;return o}var Fr=class e{#e;#t;constructor(t){this.#e=t,this.#t=ot("sha256").update([...t.entries()].sort(([r],[o])=>r.localeCompare(o)).map(([r,o])=>`${r}:${o.fingerprint}`).join(`
|
|
27
|
-
`)).digest("hex").slice(0,16)}#r(t,r){if(!t)return 0;try{let o=JSON.parse(Buffer.from(t,"base64url").toString("utf8"));return(typeof o!="object"||o===null||!("fingerprint"in o)||o.fingerprint!==this.#t||!("scope"in o)||o.scope!==r||!("offset"in o)||!Number.isInteger(o.offset)||Number(o.offset)<0)&&T("Skill cursor is invalid or stale."),Number(o.offset)}catch(o){if(o instanceof p)throw o;return T("Skill cursor is invalid or stale.")}}#o(t,r){return Buffer.from(JSON.stringify({fingerprint:this.#t,offset:t,scope:r})).toString("base64url")}static async load(t){let r=await Dr(M.join(t.packageRoot,".agents","skills"),"package",t.packageVersion);if(t.workspaceRoot){let o=M.resolve(t.packageRoot,".agents","skills"),n=M.resolve(t.workspaceRoot,".agents","skills");if(n!==o){let i=await Dr(n,"workspace",t.packageVersion);for(let[s,a]of i)r.set(s,a)}}return new e(r)}list(t={}){let r=t.limit??P.defaultPageSize;Nr.has(r)||T(`Skill list limit must be an integer from 1 to ${P.maxPageSize}.`);let o=this.#r(t.cursor,"skills/list"),n=[...this.#e.values()].sort((c,d)=>c.uri.localeCompare(d.uri)),i=n.slice(o,o+r),s=o+i.length,a=s<n.length;return{skills:i.map($r),hasMore:a,...a?{nextCursor:this.#o(s,"skills/list")}:{}}}get(t){let r=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)\/SKILL\.md$/u.exec(t),o=r?this.#e.get(r[1]):void 0;return o||T(`Unknown pm MCP skill: ${t}.`,{field:"uri"}),$r(o)}read(t){let r=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)\/(.+)$/u.exec(t),o=r?this.#e.get(r[1]):void 0,n=r?.[2]??"",i=o&&n?o.files.get(n):void 0,s=o?.resources.find(d=>d.uri===t);(!o||!i||!s)&&T(`Unknown pm MCP skill resource: ${t}.`,{field:"uri"});let a={digest:s.digest,origin:o._meta.origin,trust:"untrusted"},c=Lr(n,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 o=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)(?:\/(.+))?$/u.exec(t),n=o?this.#e.get(o[1]):void 0;n||T(`Unknown pm MCP skill directory: ${t}.`,{field:"uri"});let i=(o?.[2]??"").replace(/\/$/u,""),s=i.length>0?`${i}/`:"",a=`skill://${o[1]}`,c=new Map;for(let C of n.resources){let S=C.uri.slice(`${a}/`.length);if(!S.startsWith(s))continue;let B=S.slice(s.length),[R,..._t]=B.split("/"),wo=`${a}/${s}${R}`,Ao=n.files.get(`${s}${R}`);c.set(R,{uri:wo,name:R,mimeType:_t.length>0?"inode/directory":Lr(R,Ao)})}i.length>0&&c.size===0&&T(`Unknown pm MCP skill directory: ${t}.`,{field:"uri"});let d=r.limit??P.maxPageSize;Nr.has(d)||T(`Skill directory limit must be an integer from 1 to ${P.maxPageSize}.`);let l=this.#r(r.cursor,t),u=[...c.values()].sort((C,S)=>C.uri.localeCompare(S.uri)),f=u.slice(l,l+d),g=l+f.length,h=g<u.length;return{resources:f,hasMore:h,...h?{nextCursor:this.#o(g,t)}:{}}}};(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="38023567-8a5b-5e25-8d71-5112f74d1894")}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]="76fdc288-42b3-52b9-adc7-81e504f23ae3")}catch{}})();var jr="https://schema.unbrained.dev/pm/workspace-recipe/v1";function it(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,o)=>it(r,`${t}[${o}]`)));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,o])=>[r,it(o,`${t}.${r}`)])))}function Se(e){if(e.schema!==jr)throw new Error(`Unsupported workspace recipe schema: ${e.schema}`);let t=Tt(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,o)=>Object.freeze({action:r.action,input:it(r.input,`operations[${o}].input`)})))})}async function Br(e,t){let r=Se(e);return St(r,t)}async function Kg(e,t){return Br(e,async()=>{let r=[];for(let[o,n]of e.operations.entries())r.push(await t(n,o));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]="6e293af6-ee81-59b4-8d80-05e5c20bdcf1")}catch{}})();var qr="pm.agent-observation/v1",zr="pm.agent-verdict/v1",Vr="pm.agent-episode/v1";function O(e,t){if(!Number.isSafeInteger(e)||e<=0)throw new Error(`${t} must be a positive safe integer.`)}function k(e,t){if(e.trim().length===0)throw new Error(`${t} must not be empty.`)}function re(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let t of Object.values(e))re(t)}return e}function Wg(e){if(e.length===0)throw new Error("observation.reads must declare at least one bounded read.");let t=0;for(let r of e)if(k(r.command,"observation.reads.command"),O(r.budget_tokens,"observation.reads.budget_tokens"),t+=r.budget_tokens,!Number.isSafeInteger(t))throw new Error("observation read ceilings exceed safe integer range.")}function Xg(e){if(e.basis!=="emitted_bytes")throw new Error("observation calibration must use emitted_bytes.");for(let r of e.samples)if(!Number.isSafeInteger(r)||r<0)throw new Error("observation calibration samples must be non-negative safe integers.");if(e.samples.length===0)throw new Error("observation calibration must include at least one sample.");if(O(e.expected_emitted_bytes,"observation.calibration.expected_emitted_bytes"),!Number.isSafeInteger(e.tolerance_bytes)||e.tolerance_bytes<0)throw new Error("observation.calibration.tolerance_bytes must be a non-negative safe integer.");let t=e.samples.reduce((r,o)=>r+o,0)/e.samples.length;if(Math.abs(t-e.expected_emitted_bytes)>e.tolerance_bytes)throw new Error("observation expected_emitted_bytes is outside the calibrated sample tolerance.")}function Yg(e){if(e.length===0)throw new Error("observation.tiers must declare a degradation ladder.");let t=new Set,r=Number.POSITIVE_INFINITY;for(let o of e){if(k(o.id,"observation.tiers.id"),O(o.max_tokens,"observation.tiers.max_tokens"),t.has(o.id))throw new Error(`Duplicate observation tier: ${o.id}.`);if(t.add(o.id),o.max_tokens>r)throw new Error("observation tiers must be ordered from largest to smallest max_tokens.");r=o.max_tokens;let n=new Set;for(let i of o.fields){if($(i,"observation.tiers.fields"),n.has(i))throw new Error(`Duplicate observation tier field: ${i}.`);n.add(i)}}}function Jg(e){if(e.schema!==qr)throw new Error(`observation.schema must be ${qr}.`);return k(e.id,"observation.id"),O(e.version,"observation.version"),Wg(e.reads),Xg(e.calibration),e.corpus_dependence.kind==="bounded"&&(k(e.corpus_dependence.dimension,"observation.corpus_dependence.dimension"),O(e.corpus_dependence.maximum,"observation.corpus_dependence.maximum")),Yg(e.tiers),re(structuredClone(e))}function s0(e){return{contract_id:e.id,contract_version:e.version,guaranteed_ceiling_tokens:e.reads.reduce((t,r)=>t+r.budget_tokens,0),expected_emitted_bytes:e.calibration.expected_emitted_bytes,expected_tokens:Math.ceil(e.calibration.expected_emitted_bytes/4),tolerance_bytes:e.calibration.tolerance_bytes,calibration_basis:"emitted_bytes",corpus_dependence:e.corpus_dependence}}async function Zg(e,t,r){O(r.budget_tokens,"observation request budget_tokens");let o=[];for(let[n,i]of e.tiers.entries()){o.push(i.id);let s=await t(i),a=Buffer.byteLength(I(s),"utf8"),c=Math.ceil(a/4);if(c<=Math.min(r.budget_tokens,i.max_tokens))return{status:"served",payload:s,receipt:{contract_id:e.id,contract_version:e.version,served_tier:i.id,degraded:n>0,attempted_tiers:o,emitted_bytes:a,estimated_tokens:c,calibration_basis:"emitted_bytes"}}}return{status:"refused",reason:"no_declared_tier_fits_budget",receipt:{contract_id:e.id,contract_version:e.version,served_tier:null,degraded:e.tiers.length>1,attempted_tiers:o,emitted_bytes:null,estimated_tokens:null,calibration_basis:"emitted_bytes"}}}function $(e,t){let r=e.split(".");if(r.some(o=>o.length===0||o==="__proto__"||o==="prototype"||o==="constructor"))throw new Error(`${t} must be a safe, non-empty dot-separated path.`);return r}function Hr(e,t){let r=e;for(let o of $(t,"recorded field path")){if(r===null||typeof r!="object"||!Object.hasOwn(r,o))return;r=r[o]}return r}function Qg(e){return`/${$(e,"verdict predicate path").map(t=>t.replaceAll("~","~0").replaceAll("/","~1")).join("/")}`}function ey(e){if(e.kind!=="field_equals")return;let t;try{t=JSON.stringify(e.expected)}catch{throw new Error(`Expected value for verdict predicate ${e.id} must be JSON serializable.`)}if(t===void 0)throw new Error(`Expected value for verdict predicate ${e.id} must be JSON serializable.`)}function ty(e){if(e.schema!==zr)throw new Error(`verdict.schema must be ${zr}.`);k(e.id,"verdict.id"),O(e.version,"verdict.version");let t=new Set;for(let o of e.predicates){k(o.id,"verdict.predicates.id"),$(o.path,"verdict.predicates.path");let n=o.kind;if(n!=="field_equals"&&n!=="field_present"&&n!=="field_absent")throw new Error(`Unsupported verdict predicate kind for ${o.id}.`);if(t.has(o.id))throw new Error(`Duplicate verdict predicate: ${o.id}.`);ey(o),t.add(o.id)}if(e.composition.operator!=="all"&&e.composition.operator!=="any")throw new Error("verdict composition operator must be all or any.");if(e.composition.predicate_ids.length!==e.predicates.length)throw new Error("verdict composition must reference every predicate exactly once.");let r=new Set(e.composition.predicate_ids);if(r.size!==e.composition.predicate_ids.length||[...r].some(o=>!t.has(o)))throw new Error("verdict composition contains duplicate or unknown predicate ids.");return re(structuredClone(e))}function ry(e,t){if(e.predicates.length===0)return{contract_id:e.id,contract_version:e.version,snapshot_id:t.snapshot_id,outcome:"not_applicable",score:null,policy:"verdict_only_no_reward",reason:"no_predicates_declared",predicates:[]};let r=new Map(e.predicates.map(s=>[s.id,s])),o=e.composition.predicate_ids.map(s=>{let a=r.get(s),c=Hr(t.state,a.path),d=a.kind==="field_present"?c!==void 0:a.kind==="field_absent"?c===void 0:I(c)===I(a.expected);return{id:s,outcome:d?"satisfied":"violated",evidence_pointer:`${t.snapshot_id}#${Qg(a.path)}`,evidence_digest:yt(I(c))}}),n=o.filter(s=>s.outcome==="satisfied").length,i=e.composition.operator==="all"?n===o.length:n>0;return{contract_id:e.id,contract_version:e.version,snapshot_id:t.snapshot_id,outcome:i?"satisfied":"violated",score:n/o.length,policy:"verdict_only_no_reward",predicates:o}}function a0(e){if(e.schema!==Vr)throw new Error(`episode.schema must be ${Vr}.`);if(k(e.id,"episode.id"),O(e.version,"episode.version"),!["benchmark","evaluation","training","scale_transfer"].includes(e.mode))throw new Error("episode.mode is not supported.");if(e.task_item_ids.length===0)throw new Error("episode.task_item_ids must declare at least one pm item.");for(let t of e.task_item_ids)k(t,"episode.task_item_ids");O(e.limits.max_actions,"episode.limits.max_actions"),O(e.limits.max_observations,"episode.limits.max_observations"),O(e.limits.max_tokens_per_observation,"episode.limits.max_tokens_per_observation");for(let t of e.observable_fields)$(t,"episode.observable_fields");for(let t of e.withheld_fields)$(t,"episode.withheld_fields");for(let t of e.observable_fields){let r=e.withheld_fields.find(o=>t===o||t.startsWith(`${o}.`)||o.startsWith(`${t}.`));if(r!==void 0)throw new Error(`Observable field ${t} overlaps withheld field ${r}.`)}for(let t of e.observation.tiers)for(let r of t.fields)if(!e.observable_fields.includes(r))throw new Error(`Observation tier field ${r} is not declared observable.`);return Jg(e.observation),ty(e.verdict),Se(e.recipe),re(structuredClone(e))}function oy(e,t,r){let o=$(t,"observation projection field"),n=e;for(let[i,s]of o.entries()){if(i===o.length-1){r!==void 0&&(n[s]=structuredClone(r));return}let a=n[s];(a===null||typeof a!="object"||Array.isArray(a))&&(n[s]={}),n=n[s]}}function ny(e,t){let r={};for(let o of t)oy(r,o,Hr(e,o));return r}async function c0(e,t){let r=[],o=0,n=0,i=!1,s,a={episode:{id:e.id,label:`pm agent environment v${e.version}`},provenance:{role:e.mode,topic:"agent-environment"}},c=await L(a,()=>t.reset(e.recipe));r.push({sequence:1,kind:"reset",state_id:c.state_id});let d=async()=>{if(i)throw new Error("episode is already closed.");if(n>=e.limits.max_observations)throw new Error("episode exceeded limits.max_observations.");n+=1;let u=await t.readRecordedState(),f=await Zg(e.observation,async g=>ny(u.state,g.fields),{budget_tokens:e.limits.max_tokens_per_observation});return r.push({sequence:r.length+1,kind:"observation",state_id:f.receipt.served_tier??u.snapshot_id}),f},l=async(u=!1)=>{if(i&&!u)throw new Error("episode is already closed.");if(n>=e.limits.max_observations)throw new Error("episode exceeded limits.max_observations.");n+=1;let f=await t.readRecordedState(),g=ry(e.verdict,f);return r.push({sequence:r.length+1,kind:"verdict",state_id:f.snapshot_id}),g};return{observe:()=>L(a,d),step:async u=>{if(i)throw new Error("episode is already closed.");if(o>=e.limits.max_actions)throw new Error("episode exceeded limits.max_actions.");o+=1;let f=await L(a,()=>t.execute(u));return r.push({sequence:r.length+1,kind:"action",state_id:f.state_id}),f},score:()=>L(a,l),close:()=>s!==void 0?s:i?Promise.reject(new Error("episode is already closed.")):(i=!0,s=L(a,()=>l(!0)).then(f=>(r.push({sequence:r.length+1,kind:"close",state_id:f.snapshot_id}),{verdict:f,trajectory:re(structuredClone(r))})).catch(f=>{throw i=!1,f}).finally(()=>{s=void 0}),s)}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="9394fb87-fb36-5886-b262-ce2787326053")}catch{}})();var F="https://schema.unbrained.dev/pm/corpus-shape/v1";function H(e,t){if(!Number.isSafeInteger(e)||e<=0)throw new TypeError(`Corpus shape ${t} must be a positive safe integer`);return e}function oe(e,t){if(!Number.isSafeInteger(e)||e<0)throw new TypeError(`Corpus shape ${t} must be a non-negative safe integer`);return e}function Wr(e){if(!(typeof e!="object"||e===null||Object.isFrozen(e))){for(let t of Object.values(e))Wr(t);Object.freeze(e)}}function K(e){if(e.schema!==F)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(H(e.hierarchy_depth,"hierarchy_depth"),H(e.hierarchy_fanout,"hierarchy_fanout"),oe(e.age_span_days,"age_span_days"),H(e.history_entries_per_item,"history_entries_per_item"),oe(e.comments_per_100_items,"comments_per_100_items"),oe(e.notes_per_100_items,"notes_per_100_items"),oe(e.learnings_per_100_items,"learnings_per_100_items"),H(e.author_cardinality,"author_cardinality"),H(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 Wr(t),t}var Ee=[{kind:"implements",weight:5},{kind:"blocked_by",weight:2},{kind:"discovered_from",weight:2},{kind:"verifies",weight:2},{kind:"supersedes",weight:1},{kind:"related",weight:4}],W=Object.freeze({scratch:K({schema:F,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:K({schema:F,name:"representative",description:"Medium-lived project with rich evidence and typed lineage.",hierarchy_depth:5,hierarchy_fanout:8,age_span_days:730,history_entries_per_item:12,comments_per_100_items:30,notes_per_100_items:12,learnings_per_100_items:10,edge_kind_mix:Ee,author_cardinality:32,component_count:1,include_cycles:!1,custom_types:["Experiment"],custom_statuses:["review"],terminal_statuses:[],custom_fields:["domain"]}),"deep-graph":K({schema:F,name:"deep-graph",description:"Deep typed relationship graph with deterministic cycles.",hierarchy_depth:16,hierarchy_fanout:2,age_span_days:3650,history_entries_per_item:6,comments_per_100_items:15,notes_per_100_items:8,learnings_per_100_items:8,edge_kind_mix:Ee,author_cardinality:16,component_count:1,include_cycles:!0,custom_types:[],custom_statuses:[],terminal_statuses:[],custom_fields:[]}),"multi-decade":K({schema:F,name:"multi-decade",description:"Thirty-year event history with dense per-item evolution.",hierarchy_depth:6,hierarchy_fanout:6,age_span_days:10958,history_entries_per_item:24,comments_per_100_items:40,notes_per_100_items:20,learnings_per_100_items:16,edge_kind_mix:Ee,author_cardinality:64,component_count:1,include_cycles:!1,custom_types:["Program"],custom_statuses:["archived"],terminal_statuses:["archived"],custom_fields:["portfolio"]}),"disconnected-archive":K({schema:F,name:"disconnected-archive",description:"Multiple disconnected historical project components.",hierarchy_depth:4,hierarchy_fanout:10,age_span_days:7305,history_entries_per_item:8,comments_per_100_items:10,notes_per_100_items:5,learnings_per_100_items:6,edge_kind_mix:Ee,author_cardinality:24,component_count:5,include_cycles:!1,custom_types:["Archive"],custom_statuses:["archived"],terminal_statuses:["archived"],custom_fields:["archive_source"]})});function iy(){return Object.keys(W).sort().map(e=>W[e])}function sy(e){let t=e.trim().toLowerCase();if(!Object.hasOwn(W,t))throw new TypeError(`Unknown corpus shape "${e}". Available: ${Object.keys(W).join(", ")}`);return W[t]}var Kr=new WeakMap;function Xr(e,t){if(e===0)return[];let r=Kr.get(t);r===void 0&&(r=t.edge_kind_mix.flatMap(n=>Array.from({length:n.weight},()=>n.kind)),Kr.set(t,r));let o=[r[e%r.length]];return t.include_cycles&&e>2&&e%17===0&&o.push("related"),[...new Set(o)]}function ay(e,t,r,o=42){if(oe(t,"item index"),H(r,"item count"),t>=r)throw new RangeError(`Corpus item index ${t} exceeds ${r}`);let n=Math.min(e.component_count,r),i=t%n,s=Math.floor(t/n),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,l=s-d,u=d===0?void 0:i+(l+Math.floor((d-1)/e.hierarchy_fanout))*n,f=Date.UTC(2026,0,1),g=e.age_span_days*864e5,h=new Date(f+(r===1?0:Math.round(t/(r-1)*g))).toISOString(),C=(t*37+o)%100;return{index:t,id:`pm-s${t.toString(36).padStart(7,"0")}`,...u===void 0?{}:{parent:`pm-s${u.toString(36).padStart(7,"0")}`},component:i,timestamp:h,author:`pm-corpus-agent-${(t+o)%Math.min(e.author_cardinality,r)}`,history_entry_count:e.history_entries_per_item,dependency_kinds:Xr(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 st=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 o of r)t[o]=(t[o]??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 o=this.depths.get(t.parent);this.recordMismatch(o===void 0,`parent_missing:${t.parent}`),r=(o??0)+1;let n=(this.childCounts.get(t.parent)??0)+1;this.childCounts.set(t.parent,n),this.observedFanout=Math.max(this.observedFanout,n)}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[o,n]of this.annotationFields)this.annotations[o]+=Number(t[n]);this.recordEdgeKinds(this.edgeKinds,t.dependency_kinds),this.recordEdgeKinds(this.expectedEdgeKinds,Xr(t.index,this.shape))}finish(){let t=Math.min(this.shape.author_cardinality,this.itemCount),r=Math.min(this.shape.component_count,this.itemCount),o=[...this.planMismatches,...this.itemCount===0?["item_count:empty"]:[],...this.authors.size===t?[]:[`author_count:${this.authors.size}!=${t}`],...this.components.size===r?[]:[`component_count:${this.components.size}!=${r}`],...this.observedDepth<=this.shape.hierarchy_depth?[]:[`hierarchy_depth:${this.observedDepth}>${this.shape.hierarchy_depth}`],...this.observedFanout<=this.shape.hierarchy_fanout?[]:[`hierarchy_fanout:${this.observedFanout}>${this.shape.hierarchy_fanout}`]];for(let[s,,a]of this.annotationFields){let c=Math.floor(this.itemCount/100),d=this.itemCount%100,l=c*a+Math.max(0,a+d-100),u=c*a+Math.min(a,d),f=this.annotations[s];(f<l||f>u)&&o.push(`${s}:${f}!in[${l},${u}]`)}let n=new Set([...Object.keys(this.edgeKinds),...Object.keys(this.expectedEdgeKinds)]);for(let s of[...n].sort()){let a=this.edgeKinds[s]??0,c=this.expectedEdgeKinds[s]??0;a!==c&&o.push(`edge_kind:${s}:${a}!=${c}`)}let i=[...new Set(o)];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 Yr(e){return new st(e)}function cy(e,t){let r=Yr(e);for(let o of t)r.add(o);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]="48d03e9b-14a4-545c-8e5d-5f5f2092a113")}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]="dd1a948a-2fa2-5d2e-a41c-31f75297f17e")}catch{}})();async function dy(){let e=Ne(process.cwd(),process.env.PM_PATH);await At(e,(t,r)=>vt(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]="4534b1c9-de27-5745-88f2-641b00b94714")}catch{}})();async function ly(){await Ot()}(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]="b84b220f-cad0-5861-b3ed-07453179706e")}catch{}})();var Jr=["lines","branches","functions","statements"];function uy(e,t){if(typeof t!="object"||t===null||Array.isArray(t))throw new TypeError(`Coverage entry for ${e} must be an object.`)}function py(e,t,r){if(typeof r!="object"||r===null||Array.isArray(r))throw new TypeError(`Coverage entry ${e} has invalid ${t} counts.`);let o=r;if(typeof o.covered!="number"||typeof o.total!="number"||!Number.isInteger(o.covered)||!Number.isInteger(o.total)||o.covered<0||o.total<o.covered)throw new TypeError(`Coverage entry ${e} has invalid ${t} counts.`);return{covered:o.covered,total:o.total}}function my(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,o]of Object.entries(e)){uy(r,o);for(let n of Jr){let i=py(r,n,o[n]),s=i.total-i.covered;s>0&&t.push({file:r,metric:n,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]="aa6b9997-a4c6-5bfb-8804-45b34afd9e01")}catch{}})();var fy=["captured_redacted","captured_verbatim"],_y=[{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 v(e){return typeof e=="string"&&e.trim().length>0}function hy(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,o=[];r.boundary_id!==e.id&&o.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||!fy.includes(r.capture_source)||!v(r.capture_provenance)||!Array.isArray(r.redactions)||!r.redactions.every(v)||!("input"in r)||!("observed"in r))&&o.push({boundary_id:e.id,kind:"invalid_fixture",detail:`${e.fixture_path} lacks captured provenance, redaction metadata, input, or observed output.`});let n=JSON.stringify(t);for(let i of _y)i.pattern.test(n)&&o.push({boundary_id:e.id,kind:"unsafe_fixture",detail:`${e.fixture_path} contains a possible ${i.label}.`});return o}function gy(e,t){let r=Date.parse(e.waiver_expires_at),o=v(e.waiver_reason)&&v(e.waiver_owner)&&e.waiver_expires_at.endsWith("Z")&&Et(e.waiver_expires_at)&&Number.isFinite(r);return{captured:0,waived:o&&r>=t?1:0,findings:o?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 yy(e,t,r){if(!v(e.id)||!v(e.producer)||!v(e.consumer)||!v(e.format))return{captured:0,waived:0,findings:[{boundary_id:v(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 o=t[e.fixture_path],n=v(e.fixture_path)&&e.fixture_path in t?hy(e,o):[{boundary_id:e.id,kind:"missing_fixture",detail:`Boundary ${e.id} fixture ${String(e.fixture_path)} is missing.`}];return{captured:n.length===0?1:0,waived:0,findings:n}}return gy(e,r)}function A0(e,t,r=new Date){let o=[];if(e.version!==1||!v(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 n=new Set,i=0,s=0;for(let a of e.boundaries){if(typeof a!="object"||a===null||Array.isArray(a)){o.push({boundary_id:"unknown",kind:"invalid_boundary",detail:"Each boundary must be a JSON object."});continue}let c=a,d=v(c.id)?c.id:void 0;if(d!==void 0&&n.has(d)){o.push({boundary_id:d,kind:"duplicate_boundary",detail:`Boundary ${d} is inventoried more than once.`});continue}d!==void 0&&n.add(d);let l=yy(c,t,r.getTime());i+=l.captured,s+=l.waived,o.push(...l.findings)}return o.sort((a,c)=>a.boundary_id!==c.boundary_id?a.boundary_id.localeCompare(c.boundary_id):a.kind.localeCompare(c.kind)),{ok:o.length===0,boundary_count:e.boundaries.length,captured_count:i,waived_count:s,findings:o}}import X from"node:fs";import at 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]="9c9e4ac4-51b2-5920-bb27-a4f239f6b429")}catch{}})();var Zr=300*1e3,by=3;function P0(e){return(e?.trim()||"development").replace(/[^a-zA-Z0-9._-]/g,"_").replace(/^\./,"_")}function M0(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.");X.mkdirSync(e,{recursive:!0});let o=at.join(e,r);X.mkdirSync(o,{recursive:!0});let n=new Date;X.utimesSync(o,n,n);let i=X.readdirSync(e).filter(d=>d!==r).flatMap(d=>{try{return[{name:d,mtimeMs:X.statSync(at.join(e,d)).mtimeMs}]}catch(l){if(l instanceof Error&&"code"in l&&le(l))return[];throw l}}).sort((d,l)=>l.mtimeMs-d.mtimeMs||d.name.localeCompare(l.name)),s=i.filter(d=>n.getTime()-d.mtimeMs<Zr),a=Math.max(0,by-1-s.length),c=i.filter(d=>n.getTime()-d.mtimeMs>=Zr).slice(a).map(d=>d.name).sort((d,l)=>d.localeCompare(l));for(let d of c)X.rmSync(at.join(e,d),{recursive:!0,force:!0,maxRetries:3,retryDelay:50});return{retained:r,removed:c}}import{createHash as Cy}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]="eb475dcd-d16c-51fb-b248-b14cf5ade4de")}catch{}})();var ct=1;function Y(e){e?.throwIfAborted()}function G(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship graph ${t} must be non-empty`);return e.trim()}function J(e,t,r={}){let o=Date.parse(r.createdAt??new Date().toISOString());if(!Number.isFinite(o))throw new TypeError("Relationship graph createdAt must be a valid timestamp");let n=e.nodes(),i=e.edges(),s=t.list();return Object.freeze({version:ct,fingerprint:Cy("sha256").update(I({nodes:n,edges:i,kinds:s})).digest("hex"),created_at:new Date(o).toISOString(),nodes:n,edges:i,kinds:s})}function Ty(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ie(e){if(!Ty(e))throw new TypeError("Relationship graph snapshot must be an object");if(e.version!==ct)throw new TypeError(`Unsupported relationship graph snapshot version: ${String(e.version)}`);if(!Array.isArray(e.nodes)||e.nodes.some(n=>typeof n!="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 ke([]);for(let n of e.kinds)t.register(n);let r=new q(e.nodes,e.edges,t),o=J(r,t,{createdAt:e.created_at});if(o.fingerprint!==e.fingerprint)throw new TypeError("Relationship graph snapshot fingerprint mismatch");return{snapshot:o,registry:t,graph:r}}async function x(e,t){G(e.name,"adapter name");let r=G(t.workspace,"workspace");Y(t.signal);let o=await e.read({...t,workspace:r});return Y(t.signal),o===null?null:ie(o)}async function we(e,t){let r=G(t.workspace,"workspace"),o=ie(t.snapshot).snapshot,n=await x(e,{workspace:r,signal:t.signal});if(n?.snapshot.fingerprint===o.fingerprint)return{adapter:e.name,workspace:r,disposition:"current",fingerprint:o.fingerprint,previous_fingerprint:n.snapshot.fingerprint,node_count:o.nodes.length,edge_count:o.edges.length};if(Y(t.signal),await e.replace({workspace:r,signal:t.signal,snapshot:o,expected_fingerprint:n?.snapshot.fingerprint??null}),(await x(e,{workspace:r,signal:t.signal}))?.snapshot.fingerprint!==o.fingerprint)throw new Error(`Relationship graph adapter "${e.name}" did not expose the replaced snapshot`);return{adapter:e.name,workspace:r,disposition:"written",fingerprint:o.fingerprint,...n?{previous_fingerprint:n.snapshot.fingerprint}:{},node_count:o.nodes.length,edge_count:o.edges.length}}function Sy(e,t={}){let r=e.map(ie),o=new Map;for(let s of r)for(let a of s.snapshot.kinds){let c=o.get(a.kind);if(c&&I(c)!==I(a))throw new TypeError(`Conflicting federated relationship kind: ${a.kind}`);o.set(a.kind,a)}let n=new ke([...o.values()].sort((s,a)=>s.kind.localeCompare(a.kind))),i=new q(new Set(r.flatMap(s=>[...s.snapshot.nodes])),r.flatMap(s=>[...s.snapshot.edges]),n);return J(i,n,t)}var ne=class{name;#e=new Map;constructor(t="memory"){this.name=G(t,"adapter name")}async read(t){Y(t.signal);let r=this.#e.get(G(t.workspace,"workspace"));return r?structuredClone(r):null}async replace(t){Y(t.signal);let r=G(t.workspace,"workspace"),o=this.#e.get(r);if(t.expected_fingerprint!==void 0&&(o?.fingerprint??null)!==t.expected_fingerprint)throw new Error(`Relationship graph adapter conflict for ${r}`);this.#e.set(r,structuredClone(ie(t.snapshot).snapshot))}async clear(t){Y(t.signal);let r=G(t.workspace,"workspace"),o=this.#e.get(r);if(t.expected_fingerprint!==void 0&&(o?.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]="9a60b8c0-37d1-5c04-a079-e1351caf6e09")}catch{}})();function Qr(e,t){if(!Number.isInteger(e)||e<1)throw new TypeError(`Relationship graph ${t} must be a positive integer`);return e}function Ey(e){let t=Qr(e.nodeCount,"nodeCount"),r=Qr(e.edgeStride??1,"edgeStride"),o=e.topology??"chain";if(!["chain","star","disconnected"].includes(o))throw new TypeError(`Unsupported relationship graph topology: ${o}`);let n=(e.kind??"related").trim(),i=(e.idPrefix??"node").trim();if(!n||!i)throw new TypeError("Relationship graph kind and idPrefix must be non-empty");let s=o==="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(o!=="disconnected")for(let a=r;a<t;a+=r)yield{source:`${i}-${o==="star"?0:a-r}`,target:`${i}-${a}`,kind:n}}}}}function U(e,t){if(!e)throw new Error(`Relationship graph adapter conformance: ${t}`)}async function eo(e,t={}){let r=t.workspace?.trim()||"pm-graph-conformance",o=ht(),n=J(new q(["a","b"],[{source:"a",target:"b",kind:"related"}],o),o,{createdAt:"2026-01-01T00:00:00.000Z"}),i=J(new q(["a","b","c"],[{source:"a",target:"b",kind:"related"},{source:"b",target:"c",kind:"blocked_by"}],o),o,{createdAt:"2026-01-02T00:00:00.000Z"}),s=[];U(await x(e,{workspace:r})===null,"workspace must start empty"),s.push({name:"empty-read",passed:!0});let a=await we(e,{workspace:r,snapshot:n});U(a.disposition==="written","first sync must write"),s.push({name:"atomic-replace",passed:!0}),(await e.read({workspace:r})).nodes.push("mutated-reader-copy"),U((await x(e,{workspace:r}))?.snapshot.nodes.length===2,"reads must not mutate stored state"),s.push({name:"read-isolation",passed:!0}),U((await we(e,{workspace:r,snapshot:n})).disposition==="current","identical sync must be idempotent"),s.push({name:"idempotent-sync",passed:!0}),await e.replace({workspace:r,snapshot:i,expected_fingerprint:n.fingerprint}),U((await x(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:n,expected_fingerprint:n.fingerprint})}catch{d=!0}return U(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}),U(await x(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 wy(e){return eo(new ne,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]="df28925a-72d8-5d39-accf-e295ee01d3f9")}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]="d45a8203-4501-5797-a6cc-a2e7844adec9")}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]="4d2bee02-8003-578c-9d25-32755534f8ff")}catch{}})();var dt=2,Ay=["self_reported","independent_transport"];function Ae(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function se(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`${t} must be a non-empty string`);return e.trim()}function to(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((o,n)=>{let i=se(o,`${t}[${String(n)}]`);return r?o:i})}function lt(e,t){return e===void 0?void 0:se(e,t)}function vy(e,t){if(e===void 0)return;if(!Ae(e)||Object.keys(e).length===0)throw new TypeError(`${t} must be a non-empty object`);let r=Object.entries(e).map(([o,n])=>{if(o.length===0||o.split(".").some(i=>i.length===0))throw new TypeError(`${t} must use dot-separated own-property paths`);if(n!==null&&typeof n!="string"&&typeof n!="boolean"&&(typeof n!="number"||!Number.isFinite(n)))throw new TypeError(`${t} values must be JSON primitives`);return[o,n]});return Object.fromEntries(r)}function Oy(e,t,r,o,n,i){if(o==="refusal"){if(ze(r)||n===void 0||i===void 0)throw new TypeError(`${e} refusal steps require a non-success exit, error code, and refusal surface`);return}if(n!==void 0||i!==void 0)throw new TypeError(`${e} only refusal steps may declare expected_error_code or expected_refusal_surface`);let s=bt(t);if(s===void 0)throw new TypeError(`${e}.args must identify a command after global flags`);let a=t[s].trim().toLowerCase();if(a==="history"){let l=Ct(t.slice(s+1));l!==void 0&&(a=Me(`history ${l}`))}let c=xt(a);if(!ze(r)||r!==0&&!c?.exit_codes.some(l=>l===r))throw new TypeError(`${e} successful output must use exit code 0 or a command-declared successful effect exit`);let d=kt(a).kind;if(o!==d)throw new TypeError(`${e} expected ${o}, but ${a} declares ${d}`)}function Ry(e,t,r){if(!Ae(e))throw new TypeError(`tasks.${t}.steps[${String(r)}] must be an object`);let o=`tasks.${t}.steps[${String(r)}]`,n=se(e.id,`${o}.id`),i=to(e.args,`${o}.args`,!0),s=e.expected_exit_code;if(typeof s!="number"||!Number.isSafeInteger(s))throw new TypeError(`${o}.expected_exit_code must be a safe integer`);let a=e.expected_output_kind;if(a!=="refusal"&&!Mt.includes(a))throw new TypeError(`${o}.expected_output_kind is unsupported`);let c=a,d=e.expected_accounting_mode;if(!Ay.includes(d))throw new TypeError(`${o}.expected_accounting_mode is unsupported`);let l=d;if(l==="independent_transport"&&c!=="refusal")throw new TypeError(`${o} independent_transport accounting is supported only for refusal steps`);let u=to(e.required_fields,`${o}.required_fields`);if(u.some(S=>S.split(".").some(B=>B.length===0)))throw new TypeError(`${o}.required_fields must contain dot-separated own-property paths`);let f=vy(e.expected_field_values,`${o}.expected_field_values`),g=lt(e.expected_error_code,`${o}.expected_error_code`),h=lt(e.expected_refusal_surface,`${o}.expected_refusal_surface`),C=lt(e.recovery_for,`${o}.recovery_for`);return Oy(o,i,s,c,g,h),{id:n,args:i,expected_exit_code:s,expected_output_kind:c,expected_accounting_mode:l,required_fields:u,...f?{expected_field_values:f}:{},...g?{expected_error_code:g}:{},...h?{expected_refusal_surface:h}:{},...C?{recovery_for:C}:{}}}function Iy(e,t){if(!Ae(e))throw new TypeError(`tasks[${String(t)}] must be an object`);let r=se(e.id,`tasks[${String(t)}].id`),o=se(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 n=e.steps.map((s,a)=>Ry(s,r,a)),i=new Map;for(let s of n){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(n.at(-1)?.expected_output_kind==="refusal")throw new TypeError(`tasks.${r} completed task must terminate with successful output`);for(let s of n)if(s.expected_output_kind==="refusal"&&!n.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:o,steps:n}}function aN(e){if(!Ae(e))throw new TypeError("agent-task transcript corpus must be an object");if(e.version!==dt)throw new TypeError(`agent-task transcript corpus version must be ${String(dt)}`);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((o,n)=>Iy(o,n)),r=new Set;for(let o of t){if(r.has(o.id))throw new TypeError(`duplicate agent-task transcript id ${o.id}`);r.add(o.id)}return{version:dt,tasks:t}}import{createHash as ro}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]="41ef1735-c534-5b84-8367-1278007cb7c6")}catch{}})();function oo(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship backfill ${t} must be non-empty`);return e.trim()}function uN(e,t){let r=oo(t.migrationId,"migrationId"),o=oo(t.author,"author"),n=Date.parse(t.timestamp);if(!Number.isFinite(n))throw new TypeError("Relationship backfill timestamp must be valid");let i=new Date(n).toISOString(),s=je(e,void 0,t.registry),a=s.graph.nodes(),c=s.graph.edges().map(f=>{let g=ro("sha256").update(JSON.stringify([r,f.kind,f.source,f.target,f.createdAt??null,f.author??null,f.payload??null])).digest("hex").slice(0,24);return Object.freeze({eventId:`backfill:${r}:${g}`,relationshipId:`migration:${r}:${g}`,action:"add",edge:f,author:o,timestamp:i,reason:`Backfill ${r} from legacy item metadata`})}),d=ro("sha256").update(JSON.stringify({migrationId:r,nodes:a,events:c})).digest("hex"),l=new Set([...t.existingEventIds??[]].filter(f=>typeof f=="string").map(f=>f.trim()).filter(Boolean)),u=c.filter(f=>!l.has(f.eventId));return Object.freeze({migration_id:r,fingerprint:d,nodes:a,events:Object.freeze(u),edge_count:c.length,skipped_existing_count:c.length-u.length,duplicate_dependency_rows:s.duplicateRows.length,dangling_reference_count:s.dangling.active.length+s.dangling.legacy_terminal.length})}import*as no 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]="81067f95-115f-5aee-b649-55d86c3915d4")}catch{}})();var ae=["suggested_retry","candidate_command","example","next_step","migration_hint","restore_with"],ut={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"}},mN=Object.freeze(Object.keys(ut));function io(e){if(Object.hasOwn(ut,e))return ut[e]}var Py=new Set([..."=([{,:;!?&|+-*%^~<>","=>"]);function Z(e,t){return e<t?-1:e>t?1:0}function My(e,t){let r=e[t],o=t+1,n="";for(;o<e.length&&e[o]!==r;)e[o]==="\\"?o+=2:(n+=e[o],o+=1);return e[o]===r&&(o+=1),{next:o,value:n}}function ky(e){return e===void 0||e.kind==="punctuator"&&Py.has(e.value)||e.kind==="identifier"&&["return","case","throw","else","yield"].includes(e.value)}function xy(e,t){if(/\s/u.test(e[t]))return t+1;if(e.startsWith("//",t)){let r=e.indexOf(`
|
|
27
|
+
`)).digest("hex").slice(0,16)}#r(t,r){if(!t)return 0;try{let o=JSON.parse(Buffer.from(t,"base64url").toString("utf8"));return(typeof o!="object"||o===null||!("fingerprint"in o)||o.fingerprint!==this.#t||!("scope"in o)||o.scope!==r||!("offset"in o)||!Number.isInteger(o.offset)||Number(o.offset)<0)&&T("Skill cursor is invalid or stale."),Number(o.offset)}catch(o){if(o instanceof p)throw o;return T("Skill cursor is invalid or stale.")}}#o(t,r){return Buffer.from(JSON.stringify({fingerprint:this.#t,offset:t,scope:r})).toString("base64url")}static async load(t){let r=await Dr(M.join(t.packageRoot,".agents","skills"),"package",t.packageVersion);if(t.workspaceRoot){let o=M.resolve(t.packageRoot,".agents","skills"),n=M.resolve(t.workspaceRoot,".agents","skills");if(n!==o){let i=await Dr(n,"workspace",t.packageVersion);for(let[s,a]of i)r.set(s,a)}}return new e(r)}list(t={}){let r=t.limit??P.defaultPageSize;Nr.has(r)||T(`Skill list limit must be an integer from 1 to ${P.maxPageSize}.`);let o=this.#r(t.cursor,"skills/list"),n=[...this.#e.values()].sort((c,d)=>c.uri.localeCompare(d.uri)),i=n.slice(o,o+r),s=o+i.length,a=s<n.length;return{skills:i.map($r),hasMore:a,...a?{nextCursor:this.#o(s,"skills/list")}:{}}}get(t){let r=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)\/SKILL\.md$/u.exec(t),o=r?this.#e.get(r[1]):void 0;return o||T(`Unknown pm MCP skill: ${t}.`,{field:"uri"}),$r(o)}read(t){let r=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)\/(.+)$/u.exec(t),o=r?this.#e.get(r[1]):void 0,n=r?.[2]??"",i=o&&n?o.files.get(n):void 0,s=o?.resources.find(d=>d.uri===t);(!o||!i||!s)&&T(`Unknown pm MCP skill resource: ${t}.`,{field:"uri"});let a={digest:s.digest,origin:o._meta.origin,trust:"untrusted"},c=Lr(n,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 o=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)(?:\/(.+))?$/u.exec(t),n=o?this.#e.get(o[1]):void 0;n||T(`Unknown pm MCP skill directory: ${t}.`,{field:"uri"});let i=(o?.[2]??"").replace(/\/$/u,""),s=i.length>0?`${i}/`:"",a=`skill://${o[1]}`,c=new Map;for(let C of n.resources){let S=C.uri.slice(`${a}/`.length);if(!S.startsWith(s))continue;let B=S.slice(s.length),[R,..._t]=B.split("/"),wo=`${a}/${s}${R}`,Ao=n.files.get(`${s}${R}`);c.set(R,{uri:wo,name:R,mimeType:_t.length>0?"inode/directory":Lr(R,Ao)})}i.length>0&&c.size===0&&T(`Unknown pm MCP skill directory: ${t}.`,{field:"uri"});let d=r.limit??P.maxPageSize;Nr.has(d)||T(`Skill directory limit must be an integer from 1 to ${P.maxPageSize}.`);let l=this.#r(r.cursor,t),u=[...c.values()].sort((C,S)=>C.uri.localeCompare(S.uri)),f=u.slice(l,l+d),g=l+f.length,h=g<u.length;return{resources:f,hasMore:h,...h?{nextCursor:this.#o(g,t)}:{}}}};(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="38023567-8a5b-5e25-8d71-5112f74d1894")}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]="76fdc288-42b3-52b9-adc7-81e504f23ae3")}catch{}})();var jr="https://schema.unbrained.dev/pm/workspace-recipe/v1";function it(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,o)=>it(r,`${t}[${o}]`)));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,o])=>[r,it(o,`${t}.${r}`)])))}function Se(e){if(e.schema!==jr)throw new Error(`Unsupported workspace recipe schema: ${e.schema}`);let t=Tt(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,o)=>Object.freeze({action:r.action,input:it(r.input,`operations[${o}].input`)})))})}async function Br(e,t){let r=Se(e);return St(r,t)}async function Kg(e,t){return Br(e,async()=>{let r=[];for(let[o,n]of e.operations.entries())r.push(await t(n,o));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]="6e293af6-ee81-59b4-8d80-05e5c20bdcf1")}catch{}})();var qr="pm.agent-observation/v1",zr="pm.agent-verdict/v1",Vr="pm.agent-episode/v1";function O(e,t){if(!Number.isSafeInteger(e)||e<=0)throw new Error(`${t} must be a positive safe integer.`)}function k(e,t){if(e.trim().length===0)throw new Error(`${t} must not be empty.`)}function re(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let t of Object.values(e))re(t)}return e}function Wg(e){if(e.length===0)throw new Error("observation.reads must declare at least one bounded read.");let t=0;for(let r of e)if(k(r.command,"observation.reads.command"),O(r.budget_tokens,"observation.reads.budget_tokens"),t+=r.budget_tokens,!Number.isSafeInteger(t))throw new Error("observation read ceilings exceed safe integer range.")}function Xg(e){if(e.basis!=="emitted_bytes")throw new Error("observation calibration must use emitted_bytes.");for(let r of e.samples)if(!Number.isSafeInteger(r)||r<0)throw new Error("observation calibration samples must be non-negative safe integers.");if(e.samples.length===0)throw new Error("observation calibration must include at least one sample.");if(O(e.expected_emitted_bytes,"observation.calibration.expected_emitted_bytes"),!Number.isSafeInteger(e.tolerance_bytes)||e.tolerance_bytes<0)throw new Error("observation.calibration.tolerance_bytes must be a non-negative safe integer.");let t=e.samples.reduce((r,o)=>r+o,0)/e.samples.length;if(Math.abs(t-e.expected_emitted_bytes)>e.tolerance_bytes)throw new Error("observation expected_emitted_bytes is outside the calibrated sample tolerance.")}function Yg(e){if(e.length===0)throw new Error("observation.tiers must declare a degradation ladder.");let t=new Set,r=Number.POSITIVE_INFINITY;for(let o of e){if(k(o.id,"observation.tiers.id"),O(o.max_tokens,"observation.tiers.max_tokens"),t.has(o.id))throw new Error(`Duplicate observation tier: ${o.id}.`);if(t.add(o.id),o.max_tokens>r)throw new Error("observation tiers must be ordered from largest to smallest max_tokens.");r=o.max_tokens;let n=new Set;for(let i of o.fields){if($(i,"observation.tiers.fields"),n.has(i))throw new Error(`Duplicate observation tier field: ${i}.`);n.add(i)}}}function Jg(e){if(e.schema!==qr)throw new Error(`observation.schema must be ${qr}.`);return k(e.id,"observation.id"),O(e.version,"observation.version"),Wg(e.reads),Xg(e.calibration),e.corpus_dependence.kind==="bounded"&&(k(e.corpus_dependence.dimension,"observation.corpus_dependence.dimension"),O(e.corpus_dependence.maximum,"observation.corpus_dependence.maximum")),Yg(e.tiers),re(structuredClone(e))}function p0(e){return{contract_id:e.id,contract_version:e.version,guaranteed_ceiling_tokens:e.reads.reduce((t,r)=>t+r.budget_tokens,0),expected_emitted_bytes:e.calibration.expected_emitted_bytes,expected_tokens:Math.ceil(e.calibration.expected_emitted_bytes/4),tolerance_bytes:e.calibration.tolerance_bytes,calibration_basis:"emitted_bytes",corpus_dependence:e.corpus_dependence}}async function Zg(e,t,r){O(r.budget_tokens,"observation request budget_tokens");let o=[];for(let[n,i]of e.tiers.entries()){o.push(i.id);let s=await t(i),a=Buffer.byteLength(I(s),"utf8"),c=Math.ceil(a/4);if(c<=Math.min(r.budget_tokens,i.max_tokens))return{status:"served",payload:s,receipt:{contract_id:e.id,contract_version:e.version,served_tier:i.id,degraded:n>0,attempted_tiers:o,emitted_bytes:a,estimated_tokens:c,calibration_basis:"emitted_bytes"}}}return{status:"refused",reason:"no_declared_tier_fits_budget",receipt:{contract_id:e.id,contract_version:e.version,served_tier:null,degraded:e.tiers.length>1,attempted_tiers:o,emitted_bytes:null,estimated_tokens:null,calibration_basis:"emitted_bytes"}}}function $(e,t){let r=e.split(".");if(r.some(o=>o.length===0||o==="__proto__"||o==="prototype"||o==="constructor"))throw new Error(`${t} must be a safe, non-empty dot-separated path.`);return r}function Hr(e,t){let r=e;for(let o of $(t,"recorded field path")){if(r===null||typeof r!="object"||!Object.hasOwn(r,o))return;r=r[o]}return r}function Qg(e){return`/${$(e,"verdict predicate path").map(t=>t.replaceAll("~","~0").replaceAll("/","~1")).join("/")}`}function ey(e){if(e.kind!=="field_equals")return;let t;try{t=JSON.stringify(e.expected)}catch{throw new Error(`Expected value for verdict predicate ${e.id} must be JSON serializable.`)}if(t===void 0)throw new Error(`Expected value for verdict predicate ${e.id} must be JSON serializable.`)}function ty(e){if(e.schema!==zr)throw new Error(`verdict.schema must be ${zr}.`);k(e.id,"verdict.id"),O(e.version,"verdict.version");let t=new Set;for(let o of e.predicates){k(o.id,"verdict.predicates.id"),$(o.path,"verdict.predicates.path");let n=o.kind;if(n!=="field_equals"&&n!=="field_present"&&n!=="field_absent")throw new Error(`Unsupported verdict predicate kind for ${o.id}.`);if(t.has(o.id))throw new Error(`Duplicate verdict predicate: ${o.id}.`);ey(o),t.add(o.id)}if(e.composition.operator!=="all"&&e.composition.operator!=="any")throw new Error("verdict composition operator must be all or any.");if(e.composition.predicate_ids.length!==e.predicates.length)throw new Error("verdict composition must reference every predicate exactly once.");let r=new Set(e.composition.predicate_ids);if(r.size!==e.composition.predicate_ids.length||[...r].some(o=>!t.has(o)))throw new Error("verdict composition contains duplicate or unknown predicate ids.");return re(structuredClone(e))}function ry(e,t){if(e.predicates.length===0)return{contract_id:e.id,contract_version:e.version,snapshot_id:t.snapshot_id,outcome:"not_applicable",score:null,policy:"verdict_only_no_reward",reason:"no_predicates_declared",predicates:[]};let r=new Map(e.predicates.map(s=>[s.id,s])),o=e.composition.predicate_ids.map(s=>{let a=r.get(s),c=Hr(t.state,a.path),d=a.kind==="field_present"?c!==void 0:a.kind==="field_absent"?c===void 0:I(c)===I(a.expected);return{id:s,outcome:d?"satisfied":"violated",evidence_pointer:`${t.snapshot_id}#${Qg(a.path)}`,evidence_digest:yt(I(c))}}),n=o.filter(s=>s.outcome==="satisfied").length,i=e.composition.operator==="all"?n===o.length:n>0;return{contract_id:e.id,contract_version:e.version,snapshot_id:t.snapshot_id,outcome:i?"satisfied":"violated",score:n/o.length,policy:"verdict_only_no_reward",predicates:o}}function m0(e){if(e.schema!==Vr)throw new Error(`episode.schema must be ${Vr}.`);if(k(e.id,"episode.id"),O(e.version,"episode.version"),!["benchmark","evaluation","training","scale_transfer"].includes(e.mode))throw new Error("episode.mode is not supported.");if(e.task_item_ids.length===0)throw new Error("episode.task_item_ids must declare at least one pm item.");for(let t of e.task_item_ids)k(t,"episode.task_item_ids");O(e.limits.max_actions,"episode.limits.max_actions"),O(e.limits.max_observations,"episode.limits.max_observations"),O(e.limits.max_tokens_per_observation,"episode.limits.max_tokens_per_observation");for(let t of e.observable_fields)$(t,"episode.observable_fields");for(let t of e.withheld_fields)$(t,"episode.withheld_fields");for(let t of e.observable_fields){let r=e.withheld_fields.find(o=>t===o||t.startsWith(`${o}.`)||o.startsWith(`${t}.`));if(r!==void 0)throw new Error(`Observable field ${t} overlaps withheld field ${r}.`)}for(let t of e.observation.tiers)for(let r of t.fields)if(!e.observable_fields.includes(r))throw new Error(`Observation tier field ${r} is not declared observable.`);return Jg(e.observation),ty(e.verdict),Se(e.recipe),re(structuredClone(e))}function oy(e,t,r){let o=$(t,"observation projection field"),n=e;for(let[i,s]of o.entries()){if(i===o.length-1){r!==void 0&&(n[s]=structuredClone(r));return}let a=n[s];(a===null||typeof a!="object"||Array.isArray(a))&&(n[s]={}),n=n[s]}}function ny(e,t){let r={};for(let o of t)oy(r,o,Hr(e,o));return r}async function f0(e,t){let r=[],o=0,n=0,i=!1,s,a={episode:{id:e.id,label:`pm agent environment v${e.version}`},provenance:{role:e.mode,topic:"agent-environment"}},c=await L(a,()=>t.reset(e.recipe));r.push({sequence:1,kind:"reset",state_id:c.state_id});let d=async()=>{if(i)throw new Error("episode is already closed.");if(n>=e.limits.max_observations)throw new Error("episode exceeded limits.max_observations.");n+=1;let u=await t.readRecordedState(),f=await Zg(e.observation,async g=>ny(u.state,g.fields),{budget_tokens:e.limits.max_tokens_per_observation});return r.push({sequence:r.length+1,kind:"observation",state_id:f.receipt.served_tier??u.snapshot_id}),f},l=async(u=!1)=>{if(i&&!u)throw new Error("episode is already closed.");if(n>=e.limits.max_observations)throw new Error("episode exceeded limits.max_observations.");n+=1;let f=await t.readRecordedState(),g=ry(e.verdict,f);return r.push({sequence:r.length+1,kind:"verdict",state_id:f.snapshot_id}),g};return{observe:()=>L(a,d),step:async u=>{if(i)throw new Error("episode is already closed.");if(o>=e.limits.max_actions)throw new Error("episode exceeded limits.max_actions.");o+=1;let f=await L(a,()=>t.execute(u));return r.push({sequence:r.length+1,kind:"action",state_id:f.state_id}),f},score:()=>L(a,l),close:()=>s!==void 0?s:i?Promise.reject(new Error("episode is already closed.")):(i=!0,s=L(a,()=>l(!0)).then(f=>(r.push({sequence:r.length+1,kind:"close",state_id:f.snapshot_id}),{verdict:f,trajectory:re(structuredClone(r))})).catch(f=>{throw i=!1,f}).finally(()=>{s=void 0}),s)}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="9394fb87-fb36-5886-b262-ce2787326053")}catch{}})();var F="https://schema.unbrained.dev/pm/corpus-shape/v1";function H(e,t){if(!Number.isSafeInteger(e)||e<=0)throw new TypeError(`Corpus shape ${t} must be a positive safe integer`);return e}function oe(e,t){if(!Number.isSafeInteger(e)||e<0)throw new TypeError(`Corpus shape ${t} must be a non-negative safe integer`);return e}function Wr(e){if(!(typeof e!="object"||e===null||Object.isFrozen(e))){for(let t of Object.values(e))Wr(t);Object.freeze(e)}}function K(e){if(e.schema!==F)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(H(e.hierarchy_depth,"hierarchy_depth"),H(e.hierarchy_fanout,"hierarchy_fanout"),oe(e.age_span_days,"age_span_days"),H(e.history_entries_per_item,"history_entries_per_item"),oe(e.comments_per_100_items,"comments_per_100_items"),oe(e.notes_per_100_items,"notes_per_100_items"),oe(e.learnings_per_100_items,"learnings_per_100_items"),H(e.author_cardinality,"author_cardinality"),H(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 Wr(t),t}var Ee=[{kind:"implements",weight:5},{kind:"blocked_by",weight:2},{kind:"discovered_from",weight:2},{kind:"verifies",weight:2},{kind:"supersedes",weight:1},{kind:"related",weight:4}],W=Object.freeze({scratch:K({schema:F,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:K({schema:F,name:"representative",description:"Medium-lived project with rich evidence and typed lineage.",hierarchy_depth:5,hierarchy_fanout:8,age_span_days:730,history_entries_per_item:12,comments_per_100_items:30,notes_per_100_items:12,learnings_per_100_items:10,edge_kind_mix:Ee,author_cardinality:32,component_count:1,include_cycles:!1,custom_types:["Experiment"],custom_statuses:["review"],terminal_statuses:[],custom_fields:["domain"]}),"deep-graph":K({schema:F,name:"deep-graph",description:"Deep typed relationship graph with deterministic cycles.",hierarchy_depth:16,hierarchy_fanout:2,age_span_days:3650,history_entries_per_item:6,comments_per_100_items:15,notes_per_100_items:8,learnings_per_100_items:8,edge_kind_mix:Ee,author_cardinality:16,component_count:1,include_cycles:!0,custom_types:[],custom_statuses:[],terminal_statuses:[],custom_fields:[]}),"multi-decade":K({schema:F,name:"multi-decade",description:"Thirty-year event history with dense per-item evolution.",hierarchy_depth:6,hierarchy_fanout:6,age_span_days:10958,history_entries_per_item:24,comments_per_100_items:40,notes_per_100_items:20,learnings_per_100_items:16,edge_kind_mix:Ee,author_cardinality:64,component_count:1,include_cycles:!1,custom_types:["Program"],custom_statuses:["archived"],terminal_statuses:["archived"],custom_fields:["portfolio"]}),"disconnected-archive":K({schema:F,name:"disconnected-archive",description:"Multiple disconnected historical project components.",hierarchy_depth:4,hierarchy_fanout:10,age_span_days:7305,history_entries_per_item:8,comments_per_100_items:10,notes_per_100_items:5,learnings_per_100_items:6,edge_kind_mix:Ee,author_cardinality:24,component_count:5,include_cycles:!1,custom_types:["Archive"],custom_statuses:["archived"],terminal_statuses:["archived"],custom_fields:["archive_source"]})});function iy(){return Object.keys(W).sort().map(e=>W[e])}function sy(e){let t=e.trim().toLowerCase();if(!Object.hasOwn(W,t))throw new TypeError(`Unknown corpus shape "${e}". Available: ${Object.keys(W).join(", ")}`);return W[t]}var Kr=new WeakMap;function Xr(e,t){if(e===0)return[];let r=Kr.get(t);r===void 0&&(r=t.edge_kind_mix.flatMap(n=>Array.from({length:n.weight},()=>n.kind)),Kr.set(t,r));let o=[r[e%r.length]];return t.include_cycles&&e>2&&e%17===0&&o.push("related"),[...new Set(o)]}function ay(e,t,r,o=42){if(oe(t,"item index"),H(r,"item count"),t>=r)throw new RangeError(`Corpus item index ${t} exceeds ${r}`);let n=Math.min(e.component_count,r),i=t%n,s=Math.floor(t/n),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,l=s-d,u=d===0?void 0:i+(l+Math.floor((d-1)/e.hierarchy_fanout))*n,f=Date.UTC(2026,0,1),g=e.age_span_days*864e5,h=new Date(f+(r===1?0:Math.round(t/(r-1)*g))).toISOString(),C=(t*37+o)%100;return{index:t,id:`pm-s${t.toString(36).padStart(7,"0")}`,...u===void 0?{}:{parent:`pm-s${u.toString(36).padStart(7,"0")}`},component:i,timestamp:h,author:`pm-corpus-agent-${(t+o)%Math.min(e.author_cardinality,r)}`,history_entry_count:e.history_entries_per_item,dependency_kinds:Xr(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 st=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 o of r)t[o]=(t[o]??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 o=this.depths.get(t.parent);this.recordMismatch(o===void 0,`parent_missing:${t.parent}`),r=(o??0)+1;let n=(this.childCounts.get(t.parent)??0)+1;this.childCounts.set(t.parent,n),this.observedFanout=Math.max(this.observedFanout,n)}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[o,n]of this.annotationFields)this.annotations[o]+=Number(t[n]);this.recordEdgeKinds(this.edgeKinds,t.dependency_kinds),this.recordEdgeKinds(this.expectedEdgeKinds,Xr(t.index,this.shape))}finish(){let t=Math.min(this.shape.author_cardinality,this.itemCount),r=Math.min(this.shape.component_count,this.itemCount),o=[...this.planMismatches,...this.itemCount===0?["item_count:empty"]:[],...this.authors.size===t?[]:[`author_count:${this.authors.size}!=${t}`],...this.components.size===r?[]:[`component_count:${this.components.size}!=${r}`],...this.observedDepth<=this.shape.hierarchy_depth?[]:[`hierarchy_depth:${this.observedDepth}>${this.shape.hierarchy_depth}`],...this.observedFanout<=this.shape.hierarchy_fanout?[]:[`hierarchy_fanout:${this.observedFanout}>${this.shape.hierarchy_fanout}`]];for(let[s,,a]of this.annotationFields){let c=Math.floor(this.itemCount/100),d=this.itemCount%100,l=c*a+Math.max(0,a+d-100),u=c*a+Math.min(a,d),f=this.annotations[s];(f<l||f>u)&&o.push(`${s}:${f}!in[${l},${u}]`)}let n=new Set([...Object.keys(this.edgeKinds),...Object.keys(this.expectedEdgeKinds)]);for(let s of[...n].sort()){let a=this.edgeKinds[s]??0,c=this.expectedEdgeKinds[s]??0;a!==c&&o.push(`edge_kind:${s}:${a}!=${c}`)}let i=[...new Set(o)];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 Yr(e){return new st(e)}function cy(e,t){let r=Yr(e);for(let o of t)r.add(o);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]="48d03e9b-14a4-545c-8e5d-5f5f2092a113")}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]="dd1a948a-2fa2-5d2e-a41c-31f75297f17e")}catch{}})();async function dy(){let e=Ne(process.cwd(),process.env.PM_PATH);await vt(e,(t,r)=>Ot(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]="4534b1c9-de27-5745-88f2-641b00b94714")}catch{}})();async function ly(){await Rt()}(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]="b84b220f-cad0-5861-b3ed-07453179706e")}catch{}})();var Jr=["lines","branches","functions","statements"];function uy(e,t){if(typeof t!="object"||t===null||Array.isArray(t))throw new TypeError(`Coverage entry for ${e} must be an object.`)}function py(e,t,r){if(typeof r!="object"||r===null||Array.isArray(r))throw new TypeError(`Coverage entry ${e} has invalid ${t} counts.`);let o=r;if(typeof o.covered!="number"||typeof o.total!="number"||!Number.isInteger(o.covered)||!Number.isInteger(o.total)||o.covered<0||o.total<o.covered)throw new TypeError(`Coverage entry ${e} has invalid ${t} counts.`);return{covered:o.covered,total:o.total}}function my(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,o]of Object.entries(e)){uy(r,o);for(let n of Jr){let i=py(r,n,o[n]),s=i.total-i.covered;s>0&&t.push({file:r,metric:n,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]="aa6b9997-a4c6-5bfb-8804-45b34afd9e01")}catch{}})();var fy=["captured_redacted","captured_verbatim"],_y=[{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 v(e){return typeof e=="string"&&e.trim().length>0}function hy(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,o=[];r.boundary_id!==e.id&&o.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||!fy.includes(r.capture_source)||!v(r.capture_provenance)||!Array.isArray(r.redactions)||!r.redactions.every(v)||!("input"in r)||!("observed"in r))&&o.push({boundary_id:e.id,kind:"invalid_fixture",detail:`${e.fixture_path} lacks captured provenance, redaction metadata, input, or observed output.`});let n=JSON.stringify(t);for(let i of _y)i.pattern.test(n)&&o.push({boundary_id:e.id,kind:"unsafe_fixture",detail:`${e.fixture_path} contains a possible ${i.label}.`});return o}function gy(e,t){let r=Date.parse(e.waiver_expires_at),o=v(e.waiver_reason)&&v(e.waiver_owner)&&e.waiver_expires_at.endsWith("Z")&&Et(e.waiver_expires_at)&&Number.isFinite(r);return{captured:0,waived:o&&r>=t?1:0,findings:o?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 yy(e,t,r){if(!v(e.id)||!v(e.producer)||!v(e.consumer)||!v(e.format))return{captured:0,waived:0,findings:[{boundary_id:v(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 o=t[e.fixture_path],n=v(e.fixture_path)&&e.fixture_path in t?hy(e,o):[{boundary_id:e.id,kind:"missing_fixture",detail:`Boundary ${e.id} fixture ${String(e.fixture_path)} is missing.`}];return{captured:n.length===0?1:0,waived:0,findings:n}}return gy(e,r)}function M0(e,t,r=new Date){let o=[];if(e.version!==1||!v(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 n=new Set,i=0,s=0;for(let a of e.boundaries){if(typeof a!="object"||a===null||Array.isArray(a)){o.push({boundary_id:"unknown",kind:"invalid_boundary",detail:"Each boundary must be a JSON object."});continue}let c=a,d=v(c.id)?c.id:void 0;if(d!==void 0&&n.has(d)){o.push({boundary_id:d,kind:"duplicate_boundary",detail:`Boundary ${d} is inventoried more than once.`});continue}d!==void 0&&n.add(d);let l=yy(c,t,r.getTime());i+=l.captured,s+=l.waived,o.push(...l.findings)}return o.sort((a,c)=>a.boundary_id!==c.boundary_id?a.boundary_id.localeCompare(c.boundary_id):a.kind.localeCompare(c.kind)),{ok:o.length===0,boundary_count:e.boundaries.length,captured_count:i,waived_count:s,findings:o}}import X from"node:fs";import at 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]="9c9e4ac4-51b2-5920-bb27-a4f239f6b429")}catch{}})();var Zr=300*1e3,by=3;function D0(e){return(e?.trim()||"development").replace(/[^a-zA-Z0-9._-]/g,"_").replace(/^\./,"_")}function $0(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.");X.mkdirSync(e,{recursive:!0});let o=at.join(e,r);X.mkdirSync(o,{recursive:!0});let n=new Date;X.utimesSync(o,n,n);let i=X.readdirSync(e).filter(d=>d!==r).flatMap(d=>{try{return[{name:d,mtimeMs:X.statSync(at.join(e,d)).mtimeMs}]}catch(l){if(l instanceof Error&&"code"in l&&le(l))return[];throw l}}).sort((d,l)=>l.mtimeMs-d.mtimeMs||d.name.localeCompare(l.name)),s=i.filter(d=>n.getTime()-d.mtimeMs<Zr),a=Math.max(0,by-1-s.length),c=i.filter(d=>n.getTime()-d.mtimeMs>=Zr).slice(a).map(d=>d.name).sort((d,l)=>d.localeCompare(l));for(let d of c)X.rmSync(at.join(e,d),{recursive:!0,force:!0,maxRetries:3,retryDelay:50});return{retained:r,removed:c}}import{createHash as Cy}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]="eb475dcd-d16c-51fb-b248-b14cf5ade4de")}catch{}})();var ct=1;function Y(e){e?.throwIfAborted()}function G(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship graph ${t} must be non-empty`);return e.trim()}function J(e,t,r={}){let o=Date.parse(r.createdAt??new Date().toISOString());if(!Number.isFinite(o))throw new TypeError("Relationship graph createdAt must be a valid timestamp");let n=e.nodes(),i=e.edges(),s=t.list();return Object.freeze({version:ct,fingerprint:Cy("sha256").update(I({nodes:n,edges:i,kinds:s})).digest("hex"),created_at:new Date(o).toISOString(),nodes:n,edges:i,kinds:s})}function Ty(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ie(e){if(!Ty(e))throw new TypeError("Relationship graph snapshot must be an object");if(e.version!==ct)throw new TypeError(`Unsupported relationship graph snapshot version: ${String(e.version)}`);if(!Array.isArray(e.nodes)||e.nodes.some(n=>typeof n!="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 ke([]);for(let n of e.kinds)t.register(n);let r=new q(e.nodes,e.edges,t),o=J(r,t,{createdAt:e.created_at});if(o.fingerprint!==e.fingerprint)throw new TypeError("Relationship graph snapshot fingerprint mismatch");return{snapshot:o,registry:t,graph:r}}async function x(e,t){G(e.name,"adapter name");let r=G(t.workspace,"workspace");Y(t.signal);let o=await e.read({...t,workspace:r});return Y(t.signal),o===null?null:ie(o)}async function we(e,t){let r=G(t.workspace,"workspace"),o=ie(t.snapshot).snapshot,n=await x(e,{workspace:r,signal:t.signal});if(n?.snapshot.fingerprint===o.fingerprint)return{adapter:e.name,workspace:r,disposition:"current",fingerprint:o.fingerprint,previous_fingerprint:n.snapshot.fingerprint,node_count:o.nodes.length,edge_count:o.edges.length};if(Y(t.signal),await e.replace({workspace:r,signal:t.signal,snapshot:o,expected_fingerprint:n?.snapshot.fingerprint??null}),(await x(e,{workspace:r,signal:t.signal}))?.snapshot.fingerprint!==o.fingerprint)throw new Error(`Relationship graph adapter "${e.name}" did not expose the replaced snapshot`);return{adapter:e.name,workspace:r,disposition:"written",fingerprint:o.fingerprint,...n?{previous_fingerprint:n.snapshot.fingerprint}:{},node_count:o.nodes.length,edge_count:o.edges.length}}function Sy(e,t={}){let r=e.map(ie),o=new Map;for(let s of r)for(let a of s.snapshot.kinds){let c=o.get(a.kind);if(c&&I(c)!==I(a))throw new TypeError(`Conflicting federated relationship kind: ${a.kind}`);o.set(a.kind,a)}let n=new ke([...o.values()].sort((s,a)=>s.kind.localeCompare(a.kind))),i=new q(new Set(r.flatMap(s=>[...s.snapshot.nodes])),r.flatMap(s=>[...s.snapshot.edges]),n);return J(i,n,t)}var ne=class{name;#e=new Map;constructor(t="memory"){this.name=G(t,"adapter name")}async read(t){Y(t.signal);let r=this.#e.get(G(t.workspace,"workspace"));return r?structuredClone(r):null}async replace(t){Y(t.signal);let r=G(t.workspace,"workspace"),o=this.#e.get(r);if(t.expected_fingerprint!==void 0&&(o?.fingerprint??null)!==t.expected_fingerprint)throw new Error(`Relationship graph adapter conflict for ${r}`);this.#e.set(r,structuredClone(ie(t.snapshot).snapshot))}async clear(t){Y(t.signal);let r=G(t.workspace,"workspace"),o=this.#e.get(r);if(t.expected_fingerprint!==void 0&&(o?.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]="9a60b8c0-37d1-5c04-a079-e1351caf6e09")}catch{}})();function Qr(e,t){if(!Number.isInteger(e)||e<1)throw new TypeError(`Relationship graph ${t} must be a positive integer`);return e}function Ey(e){let t=Qr(e.nodeCount,"nodeCount"),r=Qr(e.edgeStride??1,"edgeStride"),o=e.topology??"chain";if(!["chain","star","disconnected"].includes(o))throw new TypeError(`Unsupported relationship graph topology: ${o}`);let n=(e.kind??"related").trim(),i=(e.idPrefix??"node").trim();if(!n||!i)throw new TypeError("Relationship graph kind and idPrefix must be non-empty");let s=o==="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(o!=="disconnected")for(let a=r;a<t;a+=r)yield{source:`${i}-${o==="star"?0:a-r}`,target:`${i}-${a}`,kind:n}}}}}function U(e,t){if(!e)throw new Error(`Relationship graph adapter conformance: ${t}`)}async function eo(e,t={}){let r=t.workspace?.trim()||"pm-graph-conformance",o=ht(),n=J(new q(["a","b"],[{source:"a",target:"b",kind:"related"}],o),o,{createdAt:"2026-01-01T00:00:00.000Z"}),i=J(new q(["a","b","c"],[{source:"a",target:"b",kind:"related"},{source:"b",target:"c",kind:"blocked_by"}],o),o,{createdAt:"2026-01-02T00:00:00.000Z"}),s=[];U(await x(e,{workspace:r})===null,"workspace must start empty"),s.push({name:"empty-read",passed:!0});let a=await we(e,{workspace:r,snapshot:n});U(a.disposition==="written","first sync must write"),s.push({name:"atomic-replace",passed:!0}),(await e.read({workspace:r})).nodes.push("mutated-reader-copy"),U((await x(e,{workspace:r}))?.snapshot.nodes.length===2,"reads must not mutate stored state"),s.push({name:"read-isolation",passed:!0}),U((await we(e,{workspace:r,snapshot:n})).disposition==="current","identical sync must be idempotent"),s.push({name:"idempotent-sync",passed:!0}),await e.replace({workspace:r,snapshot:i,expected_fingerprint:n.fingerprint}),U((await x(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:n,expected_fingerprint:n.fingerprint})}catch{d=!0}return U(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}),U(await x(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 wy(e){return eo(new ne,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]="df28925a-72d8-5d39-accf-e295ee01d3f9")}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]="d45a8203-4501-5797-a6cc-a2e7844adec9")}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]="4d2bee02-8003-578c-9d25-32755534f8ff")}catch{}})();var dt=2,Ay=["self_reported","independent_transport"];function Ae(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function se(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`${t} must be a non-empty string`);return e.trim()}function to(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((o,n)=>{let i=se(o,`${t}[${String(n)}]`);return r?o:i})}function lt(e,t){return e===void 0?void 0:se(e,t)}function vy(e,t){if(e===void 0)return;if(!Ae(e)||Object.keys(e).length===0)throw new TypeError(`${t} must be a non-empty object`);let r=Object.entries(e).map(([o,n])=>{if(o.length===0||o.split(".").some(i=>i.length===0))throw new TypeError(`${t} must use dot-separated own-property paths`);if(n!==null&&typeof n!="string"&&typeof n!="boolean"&&(typeof n!="number"||!Number.isFinite(n)))throw new TypeError(`${t} values must be JSON primitives`);return[o,n]});return Object.fromEntries(r)}function Oy(e,t,r,o,n,i){if(o==="refusal"){if(ze(r)||n===void 0||i===void 0)throw new TypeError(`${e} refusal steps require a non-success exit, error code, and refusal surface`);return}if(n!==void 0||i!==void 0)throw new TypeError(`${e} only refusal steps may declare expected_error_code or expected_refusal_surface`);let s=bt(t);if(s===void 0)throw new TypeError(`${e}.args must identify a command after global flags`);let a=t[s].trim().toLowerCase();if(a==="history"){let l=Ct(t.slice(s+1));l!==void 0&&(a=Me(`history ${l}`))}let c=xt(a);if(!ze(r)||r!==0&&!c?.exit_codes.some(l=>l===r))throw new TypeError(`${e} successful output must use exit code 0 or a command-declared successful effect exit`);let d=kt(a).kind;if(o!==d)throw new TypeError(`${e} expected ${o}, but ${a} declares ${d}`)}function Ry(e,t,r){if(!Ae(e))throw new TypeError(`tasks.${t}.steps[${String(r)}] must be an object`);let o=`tasks.${t}.steps[${String(r)}]`,n=se(e.id,`${o}.id`),i=to(e.args,`${o}.args`,!0),s=e.expected_exit_code;if(typeof s!="number"||!Number.isSafeInteger(s))throw new TypeError(`${o}.expected_exit_code must be a safe integer`);let a=e.expected_output_kind;if(a!=="refusal"&&!Mt.includes(a))throw new TypeError(`${o}.expected_output_kind is unsupported`);let c=a,d=e.expected_accounting_mode;if(!Ay.includes(d))throw new TypeError(`${o}.expected_accounting_mode is unsupported`);let l=d;if(l==="independent_transport"&&c!=="refusal")throw new TypeError(`${o} independent_transport accounting is supported only for refusal steps`);let u=to(e.required_fields,`${o}.required_fields`);if(u.some(S=>S.split(".").some(B=>B.length===0)))throw new TypeError(`${o}.required_fields must contain dot-separated own-property paths`);let f=vy(e.expected_field_values,`${o}.expected_field_values`),g=lt(e.expected_error_code,`${o}.expected_error_code`),h=lt(e.expected_refusal_surface,`${o}.expected_refusal_surface`),C=lt(e.recovery_for,`${o}.recovery_for`);return Oy(o,i,s,c,g,h),{id:n,args:i,expected_exit_code:s,expected_output_kind:c,expected_accounting_mode:l,required_fields:u,...f?{expected_field_values:f}:{},...g?{expected_error_code:g}:{},...h?{expected_refusal_surface:h}:{},...C?{recovery_for:C}:{}}}function Iy(e,t){if(!Ae(e))throw new TypeError(`tasks[${String(t)}] must be an object`);let r=se(e.id,`tasks[${String(t)}].id`),o=se(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 n=e.steps.map((s,a)=>Ry(s,r,a)),i=new Map;for(let s of n){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(n.at(-1)?.expected_output_kind==="refusal")throw new TypeError(`tasks.${r} completed task must terminate with successful output`);for(let s of n)if(s.expected_output_kind==="refusal"&&!n.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:o,steps:n}}function mN(e){if(!Ae(e))throw new TypeError("agent-task transcript corpus must be an object");if(e.version!==dt)throw new TypeError(`agent-task transcript corpus version must be ${String(dt)}`);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((o,n)=>Iy(o,n)),r=new Set;for(let o of t){if(r.has(o.id))throw new TypeError(`duplicate agent-task transcript id ${o.id}`);r.add(o.id)}return{version:dt,tasks:t}}import{createHash as ro}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]="41ef1735-c534-5b84-8367-1278007cb7c6")}catch{}})();function oo(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship backfill ${t} must be non-empty`);return e.trim()}function gN(e,t){let r=oo(t.migrationId,"migrationId"),o=oo(t.author,"author"),n=Date.parse(t.timestamp);if(!Number.isFinite(n))throw new TypeError("Relationship backfill timestamp must be valid");let i=new Date(n).toISOString(),s=je(e,void 0,t.registry),a=s.graph.nodes(),c=s.graph.edges().map(f=>{let g=ro("sha256").update(JSON.stringify([r,f.kind,f.source,f.target,f.createdAt??null,f.author??null,f.payload??null])).digest("hex").slice(0,24);return Object.freeze({eventId:`backfill:${r}:${g}`,relationshipId:`migration:${r}:${g}`,action:"add",edge:f,author:o,timestamp:i,reason:`Backfill ${r} from legacy item metadata`})}),d=ro("sha256").update(JSON.stringify({migrationId:r,nodes:a,events:c})).digest("hex"),l=new Set([...t.existingEventIds??[]].filter(f=>typeof f=="string").map(f=>f.trim()).filter(Boolean)),u=c.filter(f=>!l.has(f.eventId));return Object.freeze({migration_id:r,fingerprint:d,nodes:a,events:Object.freeze(u),edge_count:c.length,skipped_existing_count:c.length-u.length,duplicate_dependency_rows:s.duplicateRows.length,dangling_reference_count:s.dangling.active.length+s.dangling.legacy_terminal.length})}import*as no 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]="81067f95-115f-5aee-b649-55d86c3915d4")}catch{}})();var ae=["suggested_retry","candidate_command","example","next_step","migration_hint","restore_with"],ut={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"}},bN=Object.freeze(Object.keys(ut));function io(e){if(Object.hasOwn(ut,e))return ut[e]}var Py=new Set([..."=([{,:;!?&|+-*%^~<>","=>"]);function Z(e,t){return e<t?-1:e>t?1:0}function My(e,t){let r=e[t],o=t+1,n="";for(;o<e.length&&e[o]!==r;)e[o]==="\\"?o+=2:(n+=e[o],o+=1);return e[o]===r&&(o+=1),{next:o,value:n}}function ky(e){return e===void 0||e.kind==="punctuator"&&Py.has(e.value)||e.kind==="identifier"&&["return","case","throw","else","yield"].includes(e.value)}function xy(e,t){if(/\s/u.test(e[t]))return t+1;if(e.startsWith("//",t)){let r=e.indexOf(`
|
|
28
28
|
`,t+2);return r===-1?e.length:r+1}if(e.startsWith("/*",t))return e.indexOf("*/",t+2)+2}function Ny(e,t,r){if(e[t]!=="/"||!ky(r))return;let o=t+1,n=!1;for(;o<e.length;)if(e[o]==="\\")o+=2;else if(e[o]==="[")n=!0,o+=1;else if(e[o]==="]")n=!1,o+=1;else if(e[o]==="/"&&!n){for(o+=1;/[A-Za-z]/u.test(e.charAt(o));)o+=1;return o}else o+=1;return o}function Ly(e,t){let r=e[t];if(r==="'"||r==='"'||r==="`"){let n=My(e,t);return r==="`"?{next:n.next}:{next:n.next,token:{kind:"string",value:n.value,offset:t+1}}}if(/[A-Za-z_$]/u.test(r)){let n=t+1;for(;/[A-Za-z0-9_$]/u.test(e[n]??"");)n+=1;return{next:n,token:{kind:"identifier",value:e.slice(t,n),offset:t}}}let o=e.startsWith("=>",t)?"=>":r;return{next:t+o.length,token:{kind:"punctuator",value:o,offset:t}}}function Dy(e){let t=[],r=0;for(;r<e.length;){let o=xy(e,r);if(o!==void 0){r=o;continue}let n=Ny(e,r,t.at(-1));if(n!==void 0){r=n;continue}let i=Ly(e,r);i.token&&t.push(i.token),r=i.next}return t}var $y=new Set(["object","block","pattern"]),Fy=new Set(["const","let","var"]),Gy=new Set(["}",")","]"]),Uy=new Set(["=","(","[",",",":","?","return"]);function jy(e,t,r){if([...r].reverse().find(i=>$y.has(i.kind))?.kind==="pattern"||r.at(-1)?.kind==="paren"&&r.at(-1)?.parameter_list)return"pattern";let n=e[t-1];return n?.kind==="identifier"&&Fy.has(n.value)?"pattern":n?.value==="=>"||n?.value===")"?"block":n&&Uy.has(n.value)?"object":"block"}function By(e,t,r){let o=e[t];if(o.value==="{"){let a=jy(e,t,r);return{kind:a,...a==="object"?{member_start:!0,candidates:[]}:{}}}if(o.value==="[")return{kind:"array"};if(o.value!=="(")return;let n=e[t-1],i=e[t-2];return{kind:"paren",...n?.value==="function"||i?.value==="function"?{parameter_list:!0}:{}}}function qy(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 zy(e,t){return e[t+1]?.value===")"&&e[t+2]?.value==="=>"||e[t+1]?.value==="="}function Vy(e){let t=Dy(no.stripTypeScriptTypes(e,{mode:"strip"})),r=[],o=[];for(let[n,i]of t.entries()){let s=o.at(-1),a=qy(s,i,t[n+1]);a&&s.candidates.push(a);let c=By(t,n,o);if(c)o.push(c);else if(Gy.has(i.value)){let d=o.pop();d?.kind==="object"&&!zy(t,n)&&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 Hy(e){let t=[0];for(let r=0;r<e.length;r+=1)e[r]===`
|
|
29
|
-
`&&t.push(r+1);return t}function Ky(e,t){let r=0,o=e.length;for(;r<o;){let n=Math.floor((r+o)/2);e[n]<=t?r=n+1:o=n}return r}function
|
|
30
|
-
`)}(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]="6ecdd8cf-3153-5ed9-abd4-e8a73da6662a")}catch{}})();function Yy(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 Jy(e){return[e.exit_code!==ue.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 ${ue.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."},...Yy(e)]}function ON(e){let t=[],r=new Set,o=0;e.length===0&&t.push({code:"empty_corpus",probe_id:"corpus",detail:"At least one real refusal observation is required."});for(let n of e){if(r.has(n.probe_id)){t.push({code:"duplicate_probe",probe_id:n.probe_id,detail:`${n.probe_id} was supplied more than once.`});continue}r.add(n.probe_id);let i=t.length;for(let s of Jy(n))s!==void 0&&t.push(s);t.length===i&&(o+=1)}return t.sort((n,i)=>n.probe_id!==i.probe_id?n.probe_id.localeCompare(i.probe_id):n.code.localeCompare(i.code)),{ok:t.length===0,probe_count:r.size,closed_probe_count:o,closure_fraction:r.size===0?0:o/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]="41d33f0e-f925-54da-a75d-52a73dd76f38")}catch{}})();var co="not-a-declared-action";function Zy(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 ce(e){return e.replaceAll(/[^a-z0-9]+/gu,"-").replaceAll(/^-|-$/gu,"")}function DN(e=Ge.filter(t=>Rt.some(r=>r.command===t.command&&r.disposition!=="package_owned"))){let t=new Set(e.filter(({command:r})=>!r.includes(" ")).map(({command:r})=>ce(r)));return e.flatMap(r=>r.slots.flatMap((o,n)=>{if(!o.required)return[];let i=r.command.split(" "),s=ce(r.command),a=i.length>1&&t.has(s)?i.map(ce).join("--"):s,c=Q(r.command).flatMap(l=>l.required?[l.flag,...l.value_name?["example"]:[]]:[]),d=Fe.some(l=>l.command===r.command);return[{probe_id:`required-argument-${a}-${ce(o.name)}`,command:r.command,refusal_args:[...i,...r.slots.slice(0,n).map(l=>Zy(r.command,l)),...c],recovery_args:[...i,"--help"],error_code:d&&!r.command.startsWith("assurance ")?"invalid_argument_value":/^extension (?:activate|adopt|deactivate|uninstall)$/u.test(r.command)?"missing_lifecycle_target":"missing_required_argument",missing_argument:o.name,missing_argument_index:n}]})).sort((r,o)=>r.probe_id.localeCompare(o.probe_id))}function Qy(e){switch(N(e)){case"assurance":case"workspace snapshot":return Fe.filter(({parent:t})=>t===e).map(({action:t})=>t);case"graph":return Le;case"merge":return De;case"plan":return Ve;case"profile":return He;case"schema":return Nt;default:throw new Error(`Required positional action family ${e} has no authoritative value domain.`)}}function $N(e=Ge){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-${ce(t)}`,command:t,refusal_args:[...r,co],recovery_args:[...r,"--help"],error_code:"unknown_subcommand",rejected_value:co,allowed_values:[...Qy(t)].sort()}}).sort((t,r)=>t.probe_id.localeCompare(r.probe_id))}function eb(e,t){let r=[...t].sort();return e.length===t.length&&[...e].sort().every((o,n)=>o===r[n])}function tb(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&&!eb(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 FN(e,t){let r=new Map(e.map(s=>[s.probe_id,s])),o=new Map(t.map(s=>[s.probe_id,s])),n=[...e.flatMap(s=>tb(s,o.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.`}))];n.sort((s,a)=>s.probe_id.localeCompare(a.probe_id)||s.code.localeCompare(a.code));let i=new Set(n.map(({probe_id:s})=>s));return{ok:n.length===0,probe_count:e.length,closed_probe_count:e.filter(({probe_id:s})=>!i.has(s)).length,findings:n}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="5053cc84-63e5-50d3-9a4c-00c2a485ed69")}catch{}})();var mt=[{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 UN(){return mt.map(e=>({...e}))}function rb(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 o=t.suggested_retry_args.indexOf("init"),n=o===0||o===2&&t.suggested_retry_args[0]==="--pm-path"&&t.suggested_retry_args[1]?.length>0;return e.recovery_kind==="initialize"&&!n&&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 jN(e){let t=new Map(e.map(n=>[n.probe_id,n])),r=[],o=0;for(let n of mt){let i=t.get(n.probe_id);if(i===void 0){r.push({code:"missing_probe",probe_id:n.probe_id,detail:"No runtime observation was supplied for this contract."});continue}let s=rb(n,i);r.push(...s),s.length===0&&(o+=1)}return r.sort((n,i)=>n.probe_id.localeCompare(i.probe_id)||n.code.localeCompare(i.code)),{ok:r.length===0,probe_count:mt.length,closed_probe_count:o,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]="3bb9b0da-78ce-5793-96e2-2de27b8f18fa")}catch{}})();var ve,ob=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 nb(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=ob[N(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(N(e))?"linked-file-path":["comments","notes","learnings"].includes(N(e))?"entry-file-input":"plan-definition-file"}function Oe(){if(ve!==void 0)return ve;let t=ee.filter(({command:i})=>Ue(i)).flatMap(({command:i,family:s})=>Pt(i,Q(i)).map(a=>({command:i,family:s,concept:nb(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}`))),o=t.filter(i=>!r.has(`${i.command}:${i.flag}`)),n=new Map;for(let i of o){let s=n.get(i.concept)??new Set;s.add(i.value_kind),n.set(i.concept,s)}return ve=Object.freeze(o.map(i=>Object.freeze({...i,concept:n.get(i.concept)?.size===1?i.concept:`${i.concept}@${i.command}`}))),ve}function KN(){return Object.freeze(Oe().map(e=>Object.freeze({command:e.command,canonical_flag:e.flag,accepted_spellings:Object.freeze([...new Set([e.flag,...e.aliases])].sort())})))}var lo=Object.freeze({init:30,item:20,config:36,extension:54,package:55,packages:55,install:27,upgrade:29,create:100,copy:24,focus:22,list:86,"list-all":86,"list-draft":84,"list-open":84,"list-in-progress":84,"list-blocked":84,"list-closed":84,"list-canceled":84,aggregate:40,context:45,ctx:45,get:30,graph:34,search:78,duplicates:25,eval:25,next:38,history:35,events:33,"history-attest":23,"history-redact":27,"history-repair":27,"history-compact":30,"history-author-acknowledge":28,merge:27,schema:43,profile:22,activity:35,restore:23,update:105,"update-many":146,close:32,"close-many":72,delete:24,append:25,comments:31,notes:35,learnings:31,files:39,docs:30,deps:32,plan:109,test:53,"test-all":40,telemetry:21,stats:29,health:36,validate:46,assurance:30,gc:22,workspace:23,contracts:29,claim:39,release:24,"start-task":23,"pause-task":23,"close-task":24,meet:33,event:33,remind:29,"test-runs-worker":20}),uo=Object.freeze({...lo,...Object.fromEntries(Pe.flatMap(({alias:e,canonical:t})=>{let r=lo[e];return r===void 0?[]:[[t,r]]}))});function po(){let e=new Map(Object.keys(uo).map(t=>[t,0]));for(let{command:t}of Oe())e.set(t,Number(e.get(t))+1);return Object.freeze(Object.entries(uo).map(([t,r])=>Object.freeze({command:t,current:Number(e.get(t)),maximum:r})))}function ib(e,t,r){for(let o of e)for(let n of o.aliases){let i=t.get(`${o.command}:${n}`);i===void 0||i.flag===o.flag||r.push({code:"alias_collision",command:o.command,detail:`${n} aliases ${o.flag} but is canonical for ${i.flag}.`})}}function sb(e,t,r){let o=new Set(t.map(({command:n})=>n));for(let n of e.keys())o.has(n)||r.push({code:"missing_budget",command:n,detail:`${n} has canonical flags but no persisted budget.`});for(let n of t){let i=e.get(n.command)??0;i===0&&r.push({code:"stale_budget",command:n.command,detail:`${n.command} has a persisted budget but no canonical flags.`}),!(i<=n.maximum)&&r.push({code:"budget_exceeded",command:n.command,detail:`${i} canonical flags exceed the ratcheted maximum ${n.maximum}.`})}}function ab(e,t,r){let o=new Map(e.map(n=>[`${n.command}:${n.flag}`,n]));for(let n of t){let i=`${n.command}:${n.canonical_flag}`,s=o.get(i);if(!s){r.push({code:"removed_canonical_spelling",command:n.command,detail:`${n.canonical_flag} disappeared from the executable spelling inventory.`});continue}let a=new Set([s.flag,...s.aliases]);for(let c of n.accepted_spellings)a.has(c)||r.push({code:"removed_compatibility_spelling",command:n.command,detail:`${c} no longer resolves to ${n.canonical_flag}.`})}}function WN(e=Oe(),t=po(),r=[]){let o=[],n=new Map,i=new Map,s=new Map,a=new Map;for(let c of e){let d=`${c.command}:${c.flag}`;n.has(d)?o.push({code:"duplicate_canonical_flag",command:c.command,detail:`${c.flag} has more than one canonical row.`}):n.set(d,c),a.set(c.command,(a.get(c.command)??0)+1);let l=i.get(c.concept);l!==void 0&&l!==c.value_kind?o.push({code:"inconsistent_concept_kind",command:c.command,detail:`${c.concept} uses both ${l} and ${c.value_kind}.`}):i.set(c.concept,c.value_kind);let u=s.get(c.concept);u!==void 0&&u!==c.flag?o.push({code:"semantic_spelling_collision",command:c.command,detail:`${c.concept} is canonicalized by both ${u} and ${c.flag}.`}):s.set(c.concept,c.flag)}return ib(e,n,o),sb(a,t,o),ab(e,r,o),o.sort((c,d)=>c.command.localeCompare(d.command)||c.code.localeCompare(d.code)||c.detail.localeCompare(d.detail)),{ok:o.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:o}}function XN(){let e=Oe(),t=po(),r=new Map(t.map(({command:n})=>[n,"unknown"]));for(let{command:n,family:i}of e)r.set(n,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:n,current:i,maximum:s})=>{let a=r.get(n);return`| \`${n}\` | ${a} | ${i} | ${s} |`}),""].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]="a169a68c-13d0-5a3a-b231-abdf1a34ef6a")}catch{}})();function JN(e){return e}function ZN(e){return e}function QN(e){return e}function eL(e){return e}function tL(e){return e}function rL(e){return e}function oL(e){return e}function nL(e){return e}function iL(e){return e}function sL(e){return e}function aL(e){return e}function cL(e){return e}function dL(e){return e}function lL(e){return{handled:!0,result:e}}function uL(){return{handled:!1}}function pL(e){return e}function mL(e){return e}function fL(e){return e}function _L(e){return e}function hL(e){return e}function gL(e){return e}function yL(e){return e}function bL(e){return e}function CL(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]="14bbf3be-03a5-5ff3-888f-6e8b9a68ac73")}catch{}})();function cb(e={},t={}){return new me(t).extension(void 0,{...e,migrate:!0})}function db(e={},t={}){return new me(t).packageMigrate(e)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="af4da99c-f557-5bf7-a439-c14878e4970d")}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]="47924d35-d6ce-5507-adbf-c4c3cb25c18e")}catch{}})();import{createHash as fo,createHmac as lb,randomBytes as ub,timingSafeEqual as pb}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]="31eda153-a06e-51ef-a62f-f6dce09064d3")}catch{}})();var hD="dev.unbrained.pm/progressive-tool-discovery",gD=Object.freeze({version:1,discoveryTool:"pm_discover",canonicalResult:"structuredContent.result",compatibilityText:"pointer"}),mb=Object.freeze(["pm_discover","pm_next","pm_context","pm_search","pm_get"]),j=Object.freeze({lexical:.4,semantic:.2,graph:.1,permission:.15,freshness:.05,usage:.1}),fb=Object.freeze(["profile_changed","tool_contract_changed","workspace_extension_changed","authorization_changed","ranking_signal_changed","cursor_integrity_key_rotated"]),_o={core:0,standard:1,full:2,internal:3},ho=Object.freeze(["core","standard","full"]),_b=new Set(["core","standard","full","custom"]),go=new Set(ee.map(({family:e})=>e)),hb=ub(32);function Ie(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](),o=0;for(let n=r.next();!n.done;n=r.next())if(o+=1,o>4096)throw new b(`pm tool discovery ${t} must be a string of at most 4096 Unicode characters.`,64);return e}function yo(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 bo(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 Co(e){if(e!==void 0&&typeof e!="boolean")throw new b("pm tool discovery includeSchema must be a boolean.",64);return e===!0}function To(e){if(e===null||typeof e!="object"||Array.isArray(e))throw new b("pm tool discovery options must be an object.",64)}function gb(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 yD(e){if(To(e),e.family!==void 0&&(typeof e.family!="string"||!go.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"||!ho.includes(e.tier)))throw new b("pm tool discovery tier must be core, standard, or full.",64);return{...e.query!==void 0?{query:Ie(e.query,"query")}:{},...e.family!==void 0?{family:e.family}:{},...e.tier!==void 0?{tier:e.tier}:{},...e.limit!==void 0?{limit:yo(e.limit)}:{},...e.cursor!==void 0?{cursor:Ie(e.cursor,"cursor")}:{},...e.includeSchema!==void 0?{includeSchema:Co(e.includeSchema)}:{},...e.outputBudget!==void 0?{outputBudget:bo(e.outputBudget)}:{}}}function yb(e){return e===void 0||!Number.isFinite(e)?0:Math.min(1,Math.max(0,e))}function de(e){return[...new Set(e.toLowerCase().match(/[a-z0-9]+/gu)??[])].sort()}function bb(e,t){let r=de(e);if(r.length===0)return 0;let o=new Set(de(t)),n=r.filter(s=>o.has(s)).length,i=t.toLowerCase().includes(e.toLowerCase())?.25:0;return Math.min(1,n/r.length+i)}function Cb(e,t){let r=de(e);if(r.length===0)return 0;let o=t.toLowerCase(),n=de(t),i=r.filter(a=>n.some(c=>c.startsWith(a)||a.startsWith(c))).length,s=o.includes(e.toLowerCase())?.2:0;return Math.min(1,i/r.length+s)}function mo(e){return fo("sha256").update(JSON.stringify(e)).digest("hex").slice(0,24)}function So(e,t,r){return lb("sha256",r).update(JSON.stringify({version:1,fingerprint:e,offset:t})).digest("base64url")}function Tb(e,t,r){let o={version:1,offset:t,signature:So(e,t,r)};return Buffer.from(JSON.stringify(o),"utf8").toString("base64url")}function Sb(e,t,r,o){if(e===void 0)return 0;try{let n=JSON.parse(Buffer.from(e,"base64url").toString("utf8"));if(n.version!==1||!Number.isInteger(n.offset)||(n.offset??-1)<0||Number(n.offset)>r||typeof n.signature!="string")throw new Error("cursor fields do not match the request");let i=Buffer.from(So(t,n.offset,o),"base64url"),s=Buffer.from(n.signature,"base64url");if(s.length!==i.length||!pb(s,i))throw new Error("cursor signature does not match the request");return n.offset}catch(n){throw new b("Invalid or stale pm tool discovery cursor; restart discovery without cursor.",64,{reason:String(n)})}}function ft(e,t,r){return{value:yb(e),weight:t,available:r!=="unavailable",source:r}}function Re(e,t,r){return ft(e??t,r,e===void 0?"computed":"host")}function Eb(e,t,r){let o=Object.hasOwn(pe,e.name)?pe[e.name]:"help",n=Be(o),i=`${e.name} ${e.description} ${o} ${n}`,s=bb(t,i),a=new Set(de(t)),c={lexical:ft(s,j.lexical,"computed"),semantic:Re(e.signals?.semantic,Cb(t,i),j.semantic),graph:Re(e.signals?.graph,a.has(n)||a.has(o)?1:0,j.graph),permission:ft(1,j.permission,"authorization"),freshness:Re(e.signals?.freshness,1,j.freshness),usage:Re(e.signals?.usage,mb.includes(e.name)?1:0,j.usage)},d=Object.values(c).reduce((l,u)=>l+u.value*u.weight,0);return{name:e.name,description:e.description,command:o,tier:qe(o),family:n,score:Number(d.toFixed(6)),signals:c,...r?{input_schema:structuredClone(e.inputSchema)}:{}}}function wb(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"||!ho.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"||!go.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"||!_b.has(e.profile)))throw new b("pm tool discovery profile must be core, standard, full, or custom.",64)}function Ab(e){let r=Ie(e.query===void 0?"":e.query,"query").trim().replace(/\s+/gu," ");Ie(e.cursor===void 0?"":e.cursor,"cursor");let o=yo(e.limit===void 0?10:e.limit),n=bo(e.outputBudget===void 0?1200:e.outputBudget);return wb(e),{query:r,includeSchema:Co(e.includeSchema),limit:o,budget:n,maximumTier:_o[e.tier??"full"],profile:e.profile===void 0?"core":e.profile}}function Eo(e,t,r){let o=r??e.tools.reduce((s,a,c)=>s+(c===0?0:1)+Buffer.byteLength(JSON.stringify(a),"utf8"),0),n={...e,tools:[]},i=0;for(let s=0;s<4;s+=1){let a=Buffer.byteLength(JSON.stringify({...n,token_cost:{estimated_tokens:i,budget:t,within_budget:!0}}),"utf8"),c=Math.ceil((a+o)/4);if(c===i)break;i=c}return i}function vb(e,t,r){return e.filter(o=>o.authorized!==!1).map(o=>Eb(o,r.query,r.includeSchema)).filter(o=>o.tier!=="internal"&&_o[o.tier]<=r.maximumTier&&(t.family===void 0||o.family===t.family)).sort((o,n)=>n.score-o.score||(o.name<n.name?-1:o.name>n.name?1:0))}function Ob(e,t,r){if(t==="unbounded")return[...e];let o=[],n=0;for(let[i,s]of e.entries()){let a=n+(i===0?0:1)+Buffer.byteLength(JSON.stringify(s),"utf8");if(Eo(r(i+1),t,a)>t)break;o.push(s),n=a}return o}function bD(e,t={}){gb(e),To(t);let r=Ab(t),o=t.cursorIntegrityKey??hb,n=vb(e,t,r),i=mo({query:r.query,family:t.family??null,tier:t.tier??"full",includeSchema:r.includeSchema,profile:r.profile,ranked:n}),s=Sb(t.cursor,i,n.length,o),a=n.slice(s,s+r.limit),c=[];r.includeSchema||c.push({name:"input_schema",reason:"compact_projection",restore_with:"Set includeSchema=true."}),s+r.limit<n.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:n.length,ranking_policy:{version:1,formula:"weighted_sum_then_name",weights:j},cache:{key:mo({fingerprint:i,cursorIntegrityKey:fo("sha256").update(o).digest("hex"),limit:r.limit,offset:s,budget:r.budget}),ttl_ms:3e4,scope:"private",invalidates_on:fb}},l=(h,C=h.length)=>{let S=s+C,B=S<n.length,R=[...c];return C<a.length&&R.push({name:"tools",reason:"token_budget",restore_with:"Continue with next_cursor or increase outputBudget."}),{...d,tools:[...h],returned:C,has_more:B,...B?{next_cursor:Tb(i,S,o)}:{},omission_receipt:{has_omissions:R.length>0,omitted:R}}},u=h=>{let C=l(h),S=Eo(C,r.budget);return{...C,token_cost:{estimated_tokens:S,budget:r.budget,within_budget:r.budget==="unbounded"||S<=r.budget}}},f=Ob(a,r.budget,h=>l([],h)),g=u(f);if(a.length>0&&f.length===0){let h=u([a[0]]).token_cost.estimated_tokens;throw new b(`pm tool discovery outputBudget is too small to return a tool; increase it to at least ${h}.`,64,{required:String(h)})}if(r.budget!=="unbounded"&&g.token_cost.estimated_tokens>r.budget)throw new b(`pm tool discovery outputBudget is too small; at least ${g.token_cost.estimated_tokens} estimated tokens are required for this page.`,64,{required:String(g.token_cost.estimated_tokens)});return g}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="d007edcb-46f0-5546-b804-27d86afe23e7")}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]="e9d5c73b-d4fe-56ca-a2ad-229b04baad63")}catch{}})();export{Mv as ACTIONABILITY_ORDERING_KINDS,xc as ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS,rc as ACTIVITY_FLAG_CONTRACTS,ui as AGENT_PROVENANCE_DIMENSIONS,Us as AGGREGATE_FLAG_CONTRACTS,va as APPEND_FLAG_CONTRACTS,RI as ASSURANCE_ACTIONS,II as ASSURANCE_DECLARATION_KINDS,LO as ASSURANCE_DOCUMENT_VERSION,Ha as ASSURANCE_FLAG_CONTRACTS,DO as ASSURANCE_GATE_TRIGGERS,$O as ASSURANCE_MEASUREMENT_SOURCE_KINDS,NR as ASSURANCE_PRESET_IDS,MO as AssuranceEvaluationRefusalError,PO as AssuranceMutationRefusalError,kO as AssuranceSourceResolutionError,Jn as BASELINE_ITEM_FORMAT_VERSION,fy as BOUNDARY_FIXTURE_CAPTURE_SOURCES,tO as BRIEF_LIST_FIELDS,mi as BUILTIN_AGENT_PROVENANCE_ADAPTERS,W as BUILTIN_CORPUS_SHAPES,pi as BUILTIN_HARNESS_SIGNAL_DESCRIPTORS,Fo as BUILTIN_ITEM_TYPE_VALUES,qt as BUILTIN_PROFILES,Rb as BUILTIN_RELATIONSHIP_KINDS,Pc as CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS,tc as CALENDAR_FLAG_CONTRACTS,Oa as CLAIM_FLAG_CONTRACTS,Cc as CLOSE_ACTION_OPTION_KEYS,wa as CLOSE_FLAG_CONTRACTS,Aa as CLOSE_MANY_FLAG_CONTRACTS,xa as CLOSE_TASK_FLAG_CONTRACTS,js as COMMENTS_FLAG_CONTRACTS,Zb as COMMON_MUTATION_COMMAND_OPTION_KEYS,fc as COMPLETION_FLAG_CONTRACTS,zo as CONFIDENCE_TEXT_VALUES,ra as CONFIG_FLAG_CONTRACTS,Mc as CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS,pP as CONTEXT_EVALUATION_METRIC_NAMES,nc as CONTEXT_FLAG_CONTRACTS,Ut as CONTEXT_OUTPUT_VALUES,gP as CONTEXT_PACKING_PROFILES,nP as CONTEXT_RECENCY_EPOCH,cP as CONTEXT_RELEVANCE_SERVICE,sP as CONTEXT_RELEVANCE_SIGNAL_NAMES,CP as CONTEXT_SIGNAL_SET_VERSION,bP as CONTEXT_SIGNAL_STORE_FORMAT_VERSION,TP as CONTEXT_SIGNAL_STORE_WARNING_DETAILS,iS as CONTEXT_USAGE_LIMITS,mc as CONTRACTS_FLAG_CONTRACTS,Ja as COPY_FLAG_CONTRACTS,$c as CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,Gc as CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,Fc as CREATE_COMMANDER_STRING_OPTION_CONTRACTS,Wb as CREATE_DIRECT_CLOSE_REASON_DEFAULT,Ka as CREATE_FLAG_CONTRACTS,ZS as CURRENT_HISTORY_HASH_ALGORITHM,hE as CURRENT_HISTORY_ITEM_HASH_VERSION,yE as CURRENT_HISTORY_RECORD_HASH_VERSION,Zn as CURRENT_ITEM_FORMAT_VERSION,AP as ContextSignalStore,sS as ContextUsageValidationError,JI as DEFAULT_AUTHOR_IDENTITY_VOCABULARY,BP as DEFAULT_CHILD_SAMPLE_LIMIT,eO as DEFAULT_COMPACT_LIST_FIELDS,lw as DEFAULT_DERIVED_INDEX_MINIMUM_ITEMS,hm as DEFAULT_EVAL_QUERIES_RELATIVE_PATH,qI as DEFAULT_TERMINAL_TRANSITION_POLICY,IP as DEFAULT_WORKSPACE_MEMORY_MINIMUM_ITEMS,uv as DEFECT_ESCAPE_CLASSES,pv as DEFECT_GATE_EVIDENCE_DISPOSITIONS,Ia as DELETE_FLAG_CONTRACTS,jo as DEPENDENCY_KIND_VALUES,ac as DEPS_FLAG_CONTRACTS,Vs as DOCS_FLAG_CONTRACTS,qa as DUPLICATES_FLAG_CONTRACTS,sI as DURABLE_MERGE_RECEIPT_INTRODUCED_AT,dc as EVAL_FLAG_CONTRACTS,dm as EVAL_METRIC_NAMES,mm as EVAL_QUERY_SET_CONTRACT,fm as EVAL_QUERY_SET_EXAMPLE,pm as EVAL_QUERY_SET_SCHEMA_ID,oc as EVENTS_FLAG_CONTRACTS,La as EVENT_FLAG_CONTRACTS,ko as EXECUTABLE_COMMAND_ALIASES,ue as EXIT_CODE,ma as EXTENSION_ACTIVATE_FLAG_CONTRACTS,pa as EXTENSION_ADOPT_ALL_FLAG_CONTRACTS,Ca as EXTENSION_ADOPT_FLAG_CONTRACTS,bM as EXTENSION_CAPABILITIES,Hb as EXTENSION_CAPABILITY_CONTRACT,zb as EXTENSION_CAPABILITY_CONTRACT_VERSION,Vb as EXTENSION_CAPABILITY_LEGACY_ALIASES,Qo as EXTENSION_CAPABILITY_REGISTRATION_SURFACES,ba as EXTENSION_CATALOG_FLAG_CONTRACTS,fa as EXTENSION_DEACTIVATE_FLAG_CONTRACTS,ua as EXTENSION_DESCRIBE_FLAG_CONTRACTS,ya as EXTENSION_DOCTOR_FLAG_CONTRACTS,la as EXTENSION_EXPLORE_FLAG_CONTRACTS,oa as EXTENSION_FLAG_CONTRACTS,ia as EXTENSION_INIT_FLAG_CONTRACTS,ca as EXTENSION_INSTALL_FLAG_CONTRACTS,ha as EXTENSION_MANAGE_FLAG_CONTRACTS,_a as EXTENSION_MIGRATE_FLAG_CONTRACTS,CM as EXTENSION_POLICY_MODES,TM as EXTENSION_POLICY_SURFACES,ga as EXTENSION_RELOAD_FLAG_CONTRACTS,EM as EXTENSION_SANDBOX_PROFILES,na as EXTENSION_SCOPE_FLAG_CONTRACTS,SM as EXTENSION_TRUST_MODES,da as EXTENSION_UNINSTALL_FLAG_CONTRACTS,Wv as EXTERNAL_DEPENDENCY_RESOLUTION_STATUSES,Hv as EXTERNAL_DEPENDENCY_SOURCE_KIND,Kv as EXTERNAL_DEPENDENCY_SOURCE_KIND_ALIAS,zs as FILES_FLAG_CONTRACTS,Za as FOCUS_FLAG_CONTRACTS,ja as GC_FLAG_CONTRACTS,nO as GET_DEPTH_VALUES,ic as GET_FLAG_CONTRACTS,Fs as GLOBAL_FLAG_CONTRACTS,ru as GRAPH_DURABLE_CACHE_MIN_ITEMS,tu as GRAPH_DURABLE_CACHE_VERSION,cc as GRAPH_FLAG_CONTRACTS,yv as GRAPH_QUERY_DEFAULTS,Le as GRAPH_SUBCOMMAND_VALUES,sc as GUIDE_FLAG_CONTRACTS,za as HEALTH_FLAG_CONTRACTS,Ys as HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS,OR as HISTORY_AUTHOR_ATTRIBUTION_BASELINE,NI as HISTORY_COMPACT_BULK_DEFAULT_MIN_ENTRIES,Js as HISTORY_COMPACT_FLAG_CONTRACTS,Oi as HISTORY_EVENT_CLASSIFICATION_VERSION,Hs as HISTORY_FLAG_CONTRACTS,YS as HISTORY_HASH_ALGORITHMS,nR as HISTORY_ITEM_HASH_VERSION_3_INTRODUCED_IN,Ws as HISTORY_REDACT_FLAG_CONTRACTS,Xs as HISTORY_REPAIR_FLAG_CONTRACTS,kd as INIT_AGENT_GUIDANCE_MODE_VALUES,ta as INIT_FLAG_CONTRACTS,Ta as INSTALL_FLAG_CONTRACTS,qo as ISSUE_SEVERITY_VALUES,Xa as ITEM_COMPLETE_FLAG_CONTRACTS,JR as ITEM_LATEST_TIMESTAMP_FIELDS,Kb as ITEM_METADATA_KEY_ORDER,Wa as ITEM_MUTATE_FLAG_CONTRACTS,Ya as ITEM_REOPEN_FLAG_CONTRACTS,zR as ITEM_SCALAR_MISSING_VALUE,Go as ITEM_TYPE_VALUES,YR as ITEM_UNION_COLLECTION_FIELDS,wP as JsonFileContextSignalStoreAdapter,qs as LEARNINGS_FLAG_CONTRACTS,JS as LEGACY_HISTORY_HASH_ALGORITHM,Uu as LINKED_TEST_ENV_NAME_PATTERN,ju as LINKED_TEST_PM_CONTEXT_MODE_VALUES,Gu as LINKED_TEST_PROTECTED_ENV_KEYS,Bu as LINKED_TEST_WORKSPACE_CONTEXT_MODE_VALUES,Rc as LIST_COMMANDER_STRING_OPTION_CONTRACTS,rO as LIST_COMMAND_DEFAULT_PROJECTIONS,AM as LIST_FILTER_EXTENSION_FLAG_DEFINITIONS,Gs as LIST_FILTER_FLAG_CONTRACTS,cO as LIST_SORT_FIELDS,dO as LIST_SORT_ORDER_VALUES,Ri as MAINTENANCE_HISTORY_OPERATIONS,jP as MAX_CHILD_PROJECTION_ITEMS,ST as MAX_WORKFLOW_POLICIES,ET as MAX_WORKFLOW_POLICY_TERMS,Na as MEET_FLAG_CONTRACTS,cM as MERGE_DRIVER_ARTIFACT_VALUES,Ks as MERGE_FLAG_CONTRACTS,De as MERGE_SUBCOMMAND_VALUES,uM as MUTATION_EVENT_WIRE_BUDGET,ne as MemoryRelationshipGraphAdapter,kc as NEXT_COMMANDER_STRING_OPTION_CONTRACTS,uc as NEXT_FLAG_CONTRACTS,xp as NEXT_OUTPUT_VALUES,Bs as NOTES_FLAG_CONTRACTS,sa as PACKAGE_FLAG_CONTRACTS,aa as PACKAGE_INIT_FLAG_CONTRACTS,ka as PAUSE_TASK_FLAG_CONTRACTS,bc as PLAN_CREATE_METADATA_PARAMETER_KEYS,ea as PLAN_FLAG_CONTRACTS,Bp as PLAN_SHOW_DEPTH_VALUES,Ve as PLAN_SUBCOMMANDS,qp as PLAN_TEMPLATE_NAMES,Ay as PM_AGENT_TASK_ACCOUNTING_MODES,dt as PM_AGENT_TASK_TRANSCRIPT_VERSION,Ro as PM_BULK_LIFECYCLE_COMMAND_ALIASES,Ni as PM_CLI_EXPECTED_ERROR_NAME,wv as PM_CLI_GRAMMAR_CONTRACT,bv as PM_CLI_GRAMMAR_NOUNS,bn as PM_CLI_ONLY_TOOL_ACTION_WAIVERS,Cv as PM_CLI_SHARED_VERBS,Mo as PM_COMMAND_ALIAS_CONTRACTS,ee as PM_COMMAND_CAPABILITY_CONTRACTS,Rt as PM_COMMAND_DESTINATION_CONTRACTS,AO as PM_COMMAND_EXIT_CONTRACTS,wO as PM_COMMAND_EXIT_OUTCOME_CONTRACTS,$n as PM_COMMAND_OUTPUT_BUDGET_CONTRACTS,TO as PM_COMMAND_OUTPUT_ENVELOPE_CONTRACTS,Ge as PM_COMMAND_POSITIONAL_CONTRACTS,td as PM_COMMAND_VISIBILITY_CONTRACTS,TR as PM_COMPLETE_LIST_FINDING_CODES,MS as PM_CONTEXT_INTENTS_FILE,hS as PM_CONTEXT_INTENT_CONTRACTS,Oo as PM_CONTEXT_OPS_COMMAND_ALIASES,_n as PM_CORE_COMMAND_NAMES,F as PM_CORPUS_SHAPE_SCHEMA,Tn as PM_DEPRECATED_TOOL_ACTIONS,kn as PM_DIAGNOSTIC_DEGRADATION_STEPS,xn as PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS,Mn as PM_DIAGNOSTIC_OUTPUT_CLASSES,Sn as PM_DISCOVERABLE_TOOL_ACTIONS,Vr as PM_EPISODE_SCHEMA,bO as PM_ERROR_CODE_CATALOG,_O as PM_ERROR_CODE_EXIT_CLASS_CONTRACTS,Jr as PM_EXACT_COVERAGE_METRICS,dn as PM_EXTENSION_CAPABILITY_CONTRACTS,hn as PM_EXTENSION_PACKAGE_ACTION_SUBCOMMANDS,un as PM_EXTENSION_POLICY_MODE_CONTRACTS,fn as PM_EXTENSION_POLICY_SURFACE_CONTRACTS,mn as PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS,ln as PM_EXTENSION_SERVICE_NAME_CONTRACTS,pn as PM_EXTENSION_TRUST_MODE_CONTRACTS,pR as PM_GITATTRIBUTES_END,uR as PM_GITATTRIBUTES_START,fR as PM_GITATTRIBUTES_V2_END,mR as PM_GITATTRIBUTES_V2_START,dd as PM_GITIGNORE_END,cd as PM_GITIGNORE_START,FI as PM_HISTORY_ATTESTATION_CONTRACT,vo as PM_HISTORY_COMMAND_ALIASES,zS as PM_HISTORY_OPERATION_ALIASES,HS as PM_HISTORY_OPERATION_CONTRACT,VS as PM_HISTORY_OPERATION_PATTERNS,yn as PM_ITEM_ACTION_SUBCOMMANDS,BS as PM_ITEM_HISTORY_OPERATIONS,rt as PM_MCP_APPS_EXTENSION,Rr as PM_MCP_APPS_SERVER_CAPABILITY,Te as PM_MCP_APPS_SPEC_VERSION,Mr as PM_MCP_APP_CONTRACTS,Pr as PM_MCP_APP_MIME_TYPE,mb as PM_MCP_ENTRY_TOOL_NAMES,m as PM_MCP_ERROR_CODES,Tx as PM_MCP_HTTP_PROTOCOL_VERSION,Dh as PM_MCP_INPUT_REQUEST_METHODS,Vk as PM_MCP_LEGACY_PROTOCOL_VERSIONS,er as PM_MCP_LOG_LEVELS,w as PM_MCP_META_KEYS,hD as PM_MCP_PROGRESSIVE_DISCOVERY_EXTENSION,gD as PM_MCP_PROGRESSIVE_DISCOVERY_SERVER_CAPABILITY,sd as PM_MCP_PROMPT_CONTRACTS,z as PM_MCP_PROTOCOL_VERSION,id as PM_MCP_RESOURCE_CONTRACTS,nt as PM_MCP_SKILLS_DRAFT_REVISION,kr as PM_MCP_SKILLS_EXTENSION,Bg as PM_MCP_SKILLS_SERVER_CAPABILITY,P as PM_MCP_SKILL_LIMITS,be as PM_MCP_SUBSCRIPTION_ID_META_KEY,Ke as PM_MCP_SUPPORTED_PROTOCOL_VERSIONS,mx as PM_MCP_TASKS_EXTENSION,Kh as PM_MCP_TASK_STATUSES,pe as PM_MCP_TOOL_COMMAND_CONTRACTS,WC as PM_MODE_PAIRED_OUTPUT_PROJECTION_CONTRACTS,os as PM_MUTATION_ACTION_CONTRACTS,Pe as PM_NAMESPACED_COMMAND_ALIASES,qr as PM_OBSERVATION_SCHEMA,Pn as PM_OUTPUT_BUDGET_CLASSES,In as PM_OUTPUT_DEGRADATION_STEPS,Mt as PM_OUTPUT_ENVELOPE_KINDS,Dt as PM_PACKAGE_CONVENTIONAL_RESOURCE_ROOTS,gn as PM_PACKAGE_ONLY_ACTION_SUBCOMMANDS,Lt as PM_PACKAGE_RESOURCE_KINDS,Fe as PM_POSITIONAL_ACTION_CONTRACTS,Oc as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA,Ac as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION,VT as PM_READ_OUTPUT_COMPOSITION_OPTION_FLAGS,kT as PM_READ_OUTPUT_CONTINUATION_FINGERPRINT_POLICIES,BT as PM_READ_OUTPUT_DIMENSIONS,zT as PM_READ_OUTPUT_OPTION_FLAGS,$T as PM_READ_OUTPUT_SESSION_MAX_SEEN_ITEM_IDS,DT as PM_READ_OUTPUT_SESSION_MIN_TOKENS,qT as PM_READ_OUTPUT_SURFACES,HT as PM_READ_OUTPUT_SURFACE_CONTRACTS,KC as PM_READ_ROW_CONTRACTS,HC as PM_READ_ROW_JQ_SELECTOR,mN as PM_RECOVERY_REFERENCE_FIELDS,ae as PM_RECOVERY_REFERENCE_KINDS,Xy as PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE,ao as PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE_V2,CN as PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE,so as PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE_V2,Io as PM_RELOCATED_COMMAND_ALIASES,Ji as PM_REPRODUCIBLE_PROCESS_ENV,vO as PM_SUCCESS_EXIT_CODES,Cn as PM_TOOL_ACTIONS,Tc as PM_TOOL_ACTION_PARAMETER_CONTRACTS,vc as PM_TOOL_PARAMETERS_SCHEMA,wc as PM_TOOL_PARAMETERS_SCHEMA_MAJOR,Ec as PM_TOOL_PARAMETERS_SCHEMA_VERSION,gc as PM_TOOL_RESERVED_CUSTOM_FIELD_PROPERTIES,zr as PM_VERDICT_SCHEMA,qS as PM_WORKSPACE_HISTORY_OPERATIONS,jr as PM_WORKSPACE_RECIPE_SCHEMA,Qs as PROFILE_FLAG_CONTRACTS,Yt as PROFILE_LINT_CODES,Xt as PROFILE_LINT_DIMENSIONS,Bt as PROFILE_NAMES,He as PROFILE_SUBCOMMANDS,b as PmCliError,me as PmClient,SR as PmCompleteListValidationError,y as PmMcpAuthorizationError,tr as PmMcpInputRequiredError,Er as PmMcpIssuerCredentialStore,p as PmMcpProtocolError,rr as PmMcpRequestStateReplayGuard,Fr as PmMcpSkillRegistry,mr as PmMcpSubscriptionRegistry,et as PmMcpTaskStore,lT as QUERY_CURSOR_CONTRACT,Ea as REINDEX_FLAG_CONTRACTS,AA as REINDEX_LOCK_ID,ct as RELATIONSHIP_GRAPH_SNAPSHOT_VERSION,Pa as RELEASE_FLAG_CONTRACTS,Da as REMIND_FLAG_CONTRACTS,wt as RESERVED_ITEM_FIELD_NAMES,Ra as RESTORE_FLAG_CONTRACTS,Bo as RISK_VALUES,Ew as RelationshipEventLog,ww as RelationshipEventStore,q as RelationshipGraph,ke as RelationshipKindRegistry,Zs as SCHEMA_FLAG_CONTRACTS,Ic as SEARCH_COMMANDER_STRING_OPTION_CONTRACTS,vM as SEARCH_EXTENSION_FLAG_DEFINITIONS,pc as SEARCH_FLAG_CONTRACTS,sp as SEMANTIC_ATTRIBUTION_LIMITS,Yb as SETTINGS_DEFAULTS,Tm as SNAPSHOT_SCHEMA,tR as SOURCE_CONTEXT_ACCESS_ENV,rR as SOURCE_CONTEXT_WRITE_OVERRIDE_ENV,Ma as START_TASK_FLAG_CONTRACTS,Ba as STATS_FLAG_CONTRACTS,Uo as STATUS_VALUES,$s as SUBCOMMAND_GLOBAL_FLAG_CONTRACTS,Ii as SUBSTANTIVE_HISTORY_OPERATIONS,gE as SUPPORTED_HISTORY_ITEM_HASH_VERSIONS,bE as SUPPORTED_HISTORY_RECORD_HASH_VERSIONS,Nb as SUPPRESS_HOST_OUTPUT_MARKER,Ga as TELEMETRY_FLAG_CONTRACTS,Xm as TELEMETRY_SUBCOMMANDS,Fa as TEST_ALL_FLAG_CONTRACTS,$a as TEST_FLAG_CONTRACTS,Ua as TEST_RUNS_FLAG_CONTRACTS,zm as TEST_RUN_MEASUREMENT_LIMIT,Ms as TOOL_ACTIVITY_OPTION_CONTRACTS,bs as TOOL_AGGREGATE_OPTION_CONTRACTS,Os as TOOL_BULK_MUTATION_FILTER_OPTION_CONTRACT_SOURCE,Ps as TOOL_CALENDAR_OPTION_CONTRACTS,Is as TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS,ks as TOOL_CONTEXT_OPTION_CONTRACTS,ws as TOOL_CREATE_OPTION_CONTRACTS,Es as TOOL_CREATE_OPTION_CONTRACT_SOURCE,xs as TOOL_DEPS_OPTION_CONTRACTS,Ns as TOOL_GRAPH_OPTION_CONTRACTS,ys as TOOL_LIST_FILTER_OPTION_CONTRACTS,Cs as TOOL_SEARCH_FILTER_OPTION_CONTRACTS,Ss as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS,Ts as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACT_SOURCE,Rs as TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS,vs as TOOL_UPDATE_OPTION_CONTRACTS,As as TOOL_UPDATE_OPTION_CONTRACT_SOURCE,Xb as TYPE_TO_FOLDER,Dw as UNKNOWN_SUBCOMMAND_COMPATIBILITY_CODES,Uc as UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,Bc as UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,jc as UPDATE_COMMANDER_STRING_OPTION_CONTRACTS,Qa as UPDATE_FLAG_CONTRACTS,ec as UPDATE_MANY_FLAG_CONTRACTS,Sa as UPGRADE_FLAG_CONTRACTS,Va as VALIDATE_FLAG_CONTRACTS,TT as WORKFLOW_POLICY_ACTIONS,gR as WORKFLOW_POLICY_DOCUMENT_SCHEMA,hR as WORKFLOW_POLICY_SCHEMA,lc as WORKSPACE_FLAG_CONTRACTS,FE as WORKSPACE_HISTORY_ID,Sm as WORKSPACE_SNAPSHOT_ACTIONS,il as WorkspaceGraphCache,Iw as WorkspaceTransactionInterruptedError,Pu as _testOnly,UP as _testOnlyAggregateCommand,ol as _testOnlyConfigCommand,HP as _testOnlyGetCommand,hu as _testOnlyHealthCommand,Dd as _testOnlyInit,xd as _testOnlyInitAgentGuidance,KM as _testOnlyItemTransaction,_M as _testOnlyMutationEvents,$P as _testOnlyNextCommand,aM as _testOnlySearchCommand,kR as _testOnlySimilarity,Kp as _testOnlyTemplates,Ou as _testOnlyValidateCommand,yM as _testOnlyWorkspacePosition,FR as acceptAssuranceProposals,Au as acknowledgeLinkedTests,el as acknowledgeUnknownAuthorHistoryEvents,Qd as acknowledgeUnknownAuthorHistoryEventsFromTransport,uw as acquireItemMetadataDerivedIndexLock,$e as acquireLock,ik as activateExtensionForTest,TC as activateExtensions,li as agentSessionEnvironment,Xf as aggregate,xm as analyzeAgentProvenanceDescriptorCoverage,fv as analyzeDefectChangeRisk,OI as analyzeDefectRecurrenceCoverage,Rl as analyzeDuplicateItems,vw as analyzeGraphImpact,Vc as analyzeHierarchyIntegrity,Ow as analyzeKnowledgeGraph,RO as analyzePmCommandExitConformance,En as analyzePmToolActionParity,fI as analyzeReconciliationDiscard,Aw as analyzeRelationshipExecution,Kl as analyzeRelationshipSchedule,bh as analyzeSdkActionCoverage,It as analyzeSdkCliParameterCompleteness,a_ as append,ki as appendHistoryEntry,BE as appendWorkspaceAuditEvent,jE as appendWorkspaceHistoryChange,jw as applyAcceptanceCriteriaMutations,DR as applyAssurancePreset,wh as applyBootstrapPagerPolicy,SI as applyClosureTimestampFix,TS as applyContextIntentProjection,kp as applyContextTagProjection,lO as applyFilterValueEcho,ZE as applyHistoryPatch,Yi as applyInvocationAuthorOverride,fl as applyPathMigrations,eS as applyReadOutputDimensions,YT as applyReadOutputIncludeModes,GT as applyReadOutputSessionReferences,nw as applyRegisteredItemFieldDefaultsAndValidation,yl as applyStandaloneNote,Ki as applyStoredExtensionMigrationState,qw as applyTagRemovals,KI as applyTerminalOrderingPolicy,bl as artifactKey,qb as asRecordClone,Bb as asRecordOrNull,je as assembleWorkspaceRelationshipGraph,vR as assertCompleteListResult,Gk as assertExtensionBlueprint,Fk as assertExtensionCapabilityUsage,Ck as assertExtensionDeactivated,Bk as assertExtensionManifestCompatible,jk as assertExtensionManifestMatchesBlueprint,qk as assertExtensionPreflight,Wc as assertHierarchyMutationAllowed,LI as assertHistoryCompactTarget,hI as assertHistoryRepairTarget,Wn as assertInitializedTracker,_l as assertLinkedArtifactMutationIsUnambiguous,Kk as assertMcpClientCapabilities,Hk as assertMcpProtocolHeader,wy as assertMemoryRelationshipGraphAdapterConformance,Hw as assertNoUnknownCsvKeys,Tk as assertPackageManifest,lA as assertParentReferenceIsNotSelf,Jx as assertPmMcpSkillsCapability,Uk as assertProjectProfile,lR as assertProjectRuntimeCompatibility,XC as assertProjectionModeChoice,Kn as assertReadableTrackerRoot,Sk as assertRegisteredCommandContract,kk as assertRegisteredCommandOverride,Rk as assertRegisteredExporter,Ek as assertRegisteredFlags,wk as assertRegisteredHook,Ok as assertRegisteredImporter,Ik as assertRegisteredItemField,Pk as assertRegisteredItemType,$k as assertRegisteredMigration,xk as assertRegisteredParserOverride,Nk as assertRegisteredPreflightOverride,Mk as assertRegisteredProfile,Lk as assertRegisteredRendererOverride,Ak as assertRegisteredSearchProvider,Dk as assertRegisteredServiceOverride,vk as assertRegisteredVectorStoreAdapter,kb as assertRelationshipEdgeAllowed,eo as assertRelationshipGraphAdapterConformance,Mw as assertSchemaPreviewSupported,FO as assuranceAssertionUpdateIsLoosening,wS as attachContextIntentReceipt,aS as attachContextUsageServingReceipt,Tu as attachLinkedTestMutationProvenance,Cu as attachLinkedTestProvenance,Xe as attachMcpServerInfo,tT as attachOutputOmissionReceipt,vS as attachOutputTokenAccounting,AS as attachReadOutputContracts,UT as attachReadOutputSessionReceipt,hd as auditMergeAttributeFence,_R as auditMergeDriverConfiguration,Ql as auditWorkspaceRelationshipGraph,Dx as authorizeMcpHttpRequest,ci as boundAgentEpisodeIdentity,bT as boundReadOutputRows,Rp as buildChildrenByParent,tM as buildCompactSearchFilterSummary,uO as buildContentFilterEcho,EP as buildContextSignalSnapshot,ay as buildCorpusShapeItemPlan,mv as buildDefectRecurrenceIndex,vd as buildExtensionDescribeResult,Rd as buildExtensionInstallPlan,pO as buildGovernanceMissingFilterEcho,yA as buildInvalidTypeError,qP as buildItemChildrenRollup,VM as buildItemCompletionMutations,aP as buildItemContextRelevanceCandidates,gw as buildItemNotFoundError,VP as buildItemSchedule,EI as buildLinkedFileRepairReport,Ox as buildMcpAuthorizationDiscoveryUrls,Nh as buildMcpCompleteResult,Xk as buildMcpDiscoverResult,kx as buildMcpDynamicRegistrationMetadata,bx as buildMcpHttpRequestHeaders,ex as buildMcpInputRequiredResult,vx as buildMcpProtectedResourceMetadata,fd as buildMergeAttributePatterns,Sc as buildPmActionToolInputSchema,EN as buildPmRefusalClosureCensus,MR as buildRelationshipContext,IA as buildSearchCorpus,MA as buildSemanticCorpusInput,bI as buildStatusRoleWarnings,Hn as buildTrackerInitializationRecovery,DA as buildVectorizationEmbeddingIdentity,$A as buildVectorizationEmbeddingMetadata,rM as buildVerboseSearchFilters,yR as buildWorkflowCompletenessCheck,PP as buildWorkspaceMemorySnapshot,ai as canonicalDocument,Qb as canonicalizeCommandOptionKey,NM as canonicalizeCommandSuggestions,iP as canonicalizeContextRecencyCoordinate,Ib as canonicalizeRelationshipKind,fN as censusPmRecoveryReferenceProducers,AR as certifyCompleteListResult,ok as checkExtensionManifestCompatibility,z_ as claim,V_ as claimNext,RR as classifyHistoryAuthorEvent,Pi as classifyHistoryEvent,pI as classifyHistoryMergeReceiptReferences,lC as classifyHostEnvironmentFault,nM as classifyImplicitSemanticFallbackReason,ti as classifyItemFormatVersion,Zm as classifyLinkedTestCommandSafety,Qm as classifyLinkedTestFailure,FC as clearActiveExtensionHooks,au as clearDurableGraphCache,pE as clearFocusedItem,af as clearWorkspaceContractsCache,q_ as close,xu as closeItem,Q_ as closeTask,Oh as coalesceRepeatedListFlags,kv as collectBlockedByIds,Nv as collectBlockedByIdsFromCorpus,dS as collectContextUsageDeliveredItemIds,Zc as collectDanglingDependencyReferences,Dv as collectDependencyBlockedIds,Yc as collectDuplicateDependencyRows,Zl as collectDuplicateRelationshipEdgeGroups,oM as collectErrorCauseCodes,zc as collectHierarchyRelations,br as collectMcpHeaderAnnotations,Qc as collectMissingDependencyTargetIds,Fu as collectNewOrderingCycleWarnings,Xl as collectOrderingCycles,Jc as collectOrderingStorageContradictions,NS as collectPackageContextIntentContracts,Ft as collectPackageExtensionDirectories,rw as collectRegisteredItemFieldNames,nE as collectRuntimeCreateFieldValues,bA as collectRuntimeFilterValues,iE as collectRuntimeUpdateFieldValues,Ep as collectSubtreeIds,en as collectUsedExtensionCapabilities,eC as commandOptionFlagLabel,Zf as comments,Mf as commitImportedItem,HM as commitItemCompletion,zM as commitItemMutations,Pw as commitWorkspaceTransaction,Ds as compactFlagAliasContracts,wp as compareCriticalItems,iR as comparePmDateVersions,Rw as compareRelationshipSnapshots,oS as compareTimestampStrings,rP as compileHistoryProvenanceMatcher,bS as composeContextIntentContracts,YM as composeExtension,rk as composeExtensionPackage,Fv as computeActionabilityReport,iA as computeHistoryDiff,Vl as computeRelationshipCentrality,zl as computeRelationshipDominators,nl as computeWorkspaceGraphFingerprint,d_ as config,$C as consumeAfterCommandAffectedItems,qf as context,ES as contextIntentRowId,K_ as copy,ef as countFailureCategories,gT as countReadOutputRows,U_ as create,LR as createAssurancePreset,AI as createAssuranceWorkspaceContext,kw as createCheckpointId,ER as createCompleteListOptions,SC as createCoreCommandHookContext,Yr as createCorpusShapeMeasurement,qO as createEmptyAssuranceDocument,aC as createEmptyExtensionRegistrationRegistry,zi as createExtensionCommandSdk,Zo as createExtensionContributionInventory,zk as createExtensionTestHarness,Mi as createHistoryEntry,QA as createLazyModule,bR as createLifecycleCompletenessPolicies,$x as createMcpStaticBearerVerifier,fx as createMcpTaskStore,hw as createMutationGuardSdk,YC as createOutputOmissionReceipt,Li as createPmCliExpectedError,Vn as createPmCliProgram,Ln as createPmCommandOutputBudget,oT as createQueryFingerprint,Ey as createRelationshipGraphScaleFixture,J as createRelationshipGraphSnapshot,ht as createRelationshipKindRegistry,Qi as createReproducibleProcessRunner,QP as createSearchCursorFingerprint,EC as createSerialQueue,Zw as createStdinTokenResolver,$w as createUnknownSubcommandError,MT as createWorkflowPolicyEvaluator,Em as createWorkspaceSnapshot,sk as deactivateExtensionForTest,uL as declineServiceOverride,SS as decodeContextIntentCursor,ZA as decodeHtmlEntitiesInOptions,yr as decodeMcpHttpHeaderValue,aT as decodeQueryCursor,iT as decodeQueryCursorEnvelope,sT as decodeQueryCursorState,LT as decodeReadOutputContinuationCursor,Bx as decoratePmMcpToolsWithApps,Tl as dedupeLinkedArtifacts,dP as defaultScoreContextCandidates,gL as defineAfterCommandHook,_L as defineBeforeCommandHook,hL as defineBeforeMutationHook,QN as defineCommand,sL as defineCommandOverride,K as defineCorpusShape,a0 as defineEpisodeSpecification,fL as defineExporter,WM as defineExtension,XM as defineExtensionBlueprint,JN as defineExtensionManifest,eL as defineFlag,mL as defineImporter,rL as defineItemField,tL as defineItemType,oL as defineMigration,Jg as defineObservationContract,CL as defineOnIndexHook,bL as defineOnReadHook,yL as defineOnWriteHook,aL as defineParserOverride,Dn as definePmCommandOutputBudget,CO as definePmCommandOutputEnvelope,hO as definePmErrorCodeCatalog,cL as definePreflightOverride,ZN as defineProjectProfile,pL as defineRendererOverride,nL as defineSearchProvider,dL as defineServiceOverride,iL as defineVectorStoreAdapter,ty as defineVerdictContract,Se as defineWorkspaceRecipe,W_ as deleteItem,Im as deleteWorkspaceSnapshot,xb as dependencyToRelationship,i_ as deps,$R as deriveAssuranceProposals,CI as deriveClosureTimestamp,ZM as deriveExtensionCapabilities,IO as derivePmBulkMutationEffect,_N as derivePmRecoveryReferenceObligations,Wl as deriveRelationshipDeadlines,Cd as deriveSchemaEvolutionMigrationId,VA as deriveTelemetryCommandResolution,EA as describeAllowedTransitions,eR as describeExtensionActivation,QM as describeExtensionBlueprint,up as describeItemOwnershipConflict,s0 as describeObservationCost,Kt as describeProfileComposition,Wt as describeProjectProfile,$S as describeUnknownError,Ci as detectAgentIdentity,wi as detectHarnessIdentity,Bl as detectRelationshipCommunities,Ti as diagnoseAgentIdentity,eu as diffRelationshipAuditSnapshots,Km as diffTestRunMeasurements,ox as digestMcpRequestParameters,bC as discoverExtensions,Ko as discoverNearbyPmRoot,bD as discoverPmTools,aR as discoverProjectRuntimeVersionPins,n_ as docs,Jf as duplicates,ou as durableGraphCachePath,cu as durableGraphCacheStatus,Qn as effectiveItemFormatVersion,cv as emitTelemetryErrorEvent,Pf as emptyImportedDocument,HR as encodeItemScalarDecisionValue,gr as encodeMcpHttpHeaderValue,nT as encodeQueryCursor,NT as encodeReadOutputContinuationCursor,iw as enforceHistoryStreamPolicyForItem,sw as enforceHistoryStreamPolicyForItems,mO as enrichCliFlagInvocationContract,Pt as enrichCliFlagInvocationContracts,ew as ensureMaterializedHistoryTarget,ud as ensurePmGitignore,dl as ensureScope,zA as ensureSentryInit,If as ensureTrackerInitialized,Ul as enumerateRelationshipPaths,Gn as estimatePmOutputTokens,VO as evaluateAssuranceAssertion,HO as evaluateAssuranceGate,A0 as evaluateBoundaryFixtures,mP as evaluateContextRanking,_v as evaluateDefectGateEvidence,zO as evaluateMeasurement,um as evaluateMetricFloors,is as evaluateMutationGuard,Gm as evaluateProvenanceCoverage,Dm as evaluateSemanticAttributionCoverage,Pl as evaluateSimilarityGovernance,SA as evaluateTransition,ry as evaluateVerdictContract,PT as evaluateWorkflowPolicies,rs as executeEmbeddingBatchesWithRetry,NA as executeVectorDelete,LA as executeVectorReset,xA as executeVectorUpsert,Kg as executeWorkspaceRecipe,gl as expandAddGlobEntries,kl as explainSourceTraceability,UI as exportAttestation,eh as extension,rh as extensionActivate,oh as extensionDeactivate,th as extensionList,cb as extensionMigrate,uI as extractHistoryMergeReceiptDispositions,lI as extractHistoryMergeReceiptReferences,xx as extractMcpTraceContext,YE as extractPatchFailureContext,gu as extractReferencedPmItemIdsFromCommand,Sy as federateRelationshipGraphSnapshots,t_ as files,r_ as filesDiscover,o_ as filesLookup,lS as finalizeContextUsageDelivery,my as findCoverageDeficits,Il as findDuplicateClusters,md as findGitWorkspaceRoot,PE as findHistoryIdentityDiscontinuities,wd as findInstalledNpmPackageCandidate,jx as findPmMcpAppByUri,Po as findPmNamespacedCommand,ql as findRedundantRelationshipEdges,Hl as findRelationshipCutStructure,Ol as findSimilarItems,av as finishTelemetryCommand,fC as flattenFlagListValue,ly as flushTelemetryQueue,Y_ as focus,jl as forEachMatchedRelationshipEdge,Jl as formatDuplicateEdgeGroup,Hc as formatHierarchyRelation,Yl as formatOrderingStorageContradiction,Ev as formatPmPositionalActionFlagTip,im as formatProfileApplyHuman,nm as formatProfileLintHuman,rm as formatProfileListHuman,om as formatProfileShowHuman,Ed as formatSchemaEvolutionMigrationHuman,sM as formatVectorIndexRecoveryWarnings,gM as formatWorkspacePositionHuman,N_ as gc,Gi as generateItemId,Kf as get,NC as getActiveCommandResult,gS as getActiveContextIntentContracts,rn as getActiveExtensionRegistrations,Lx as getActiveMcpTraceContext,WO as getAssuranceDeclaration,hh as getContracts,lE as getFocusedItem,Yo as getHistoryPath,Sw as getItemAt,Xo as getItemPath,cs as getMutationActionContract,ld as getPmGitignoreBlock,Wo as getSettingsPath,cf as getWorkspaceContracts,GE as getWorkspaceHistoryPath,s_ as graph,nu as graphAuditBaselinePath,$m as groupHistoryByEpisode,lL as handleServiceOverride,Wk as hasMcpClientExtension,Ux as hasPmMcpAppsCapability,Ue as hasSubcommandFlagContractsForCommand,FA as hasVectorizationEmbeddingIdentityChanged,GA as hasVectorizationVectorDimensionChanged,OE as hashDocument,RE as hashDocumentForVersion,IE as hashEmptyDocument,TE as hashHistoryPatch,CE as hashHistoryRecord,SE as hashHistoryStream,KR as hashItemScalarDecisionValue,x_ as health,Dl as hierarchyAncestors,$l as hierarchyDescendants,F_ as historyCompact,G_ as historyCompactBulk,eE as historyDigest,tP as historyEntryMatchesProvenance,sR as historyItemHashVersionForRuntime,L_ as historyRedact,D_ as historyRepair,$_ as historyRepairAll,xv as indexBlockedByIds,Kc as indexHierarchyRelations,UA as inferConsistentVectorDimension,Nn as inferPmOutputBudgetClass,c_ as init,wR as inspectCompleteListResult,cC as inspectExtensionManifestSchema,Wd as inspectHistoryAuthorStream,tI as inspectMergeReceiptEvidence,dR as inspectProjectRuntimeCompatibility,_s as inspectStaleInProgressItems,Mh as inspectStaticExtensionInventory,yI as inspectStatusRoleAssignments,UE as inspectWorkspaceHistoryState,wm as inspectWorkspaceSnapshot,bd as installMergeFence,Yk as interpretMcpResultType,Lp as isAlreadyClaimedError,US as isCommanderError,qd as isErrnoError,dv as isExternalDependencyReference,lv as isExternalDependencySourceKind,le as isFileMissingError,Db as isHostOutputSuppressed,VR as isItemScalarMissingValue,aI as isLegacyMergeReceiptSummary,_ as isMcpRecord,ss as isMutationAction,Mb as isOrderingRelationshipKind,cA as isPlaceholderReferenceToken,Di as isPmCliExpectedError,An as isPmExtensionCapabilityContract,On as isPmExtensionPolicyModeContract,Rn as isPmExtensionPolicySurfaceContract,vn as isPmExtensionServiceNameContract,OO as isPmKnownExitCode,SO as isPmMutationReceipt,ze as isPmSuccessfulExitCode,wn as isPmToolAction,cI as isPreDurableCloneLocalReceiptSummary,dI as isPreDurableDispositionEligibleReference,cR as isProjectMutatingInvocation,ev as isPureSnakeCaseAlias,tS as isReadOutputBudgetExceeded,ZC as isReadRowContract,Fd as isRuntimeRecord,ov as isTerminalPlanMode,aE as isTerminalStatus,zn as isTimestampLiteral,BM as itemDocumentToMutationOptions,zP as itemHasSchedule,ds as jaccardSimilarity,e_ as learnings,sC as levenshteinDistanceWithinLimit,Ud as limitAnnotationEntries,Su as linkedTestTrustFingerprint,ek as lintExtensionBlueprint,dC as lintExtensionManifestSchema,Jt as lintProjectProfile,zf as list,_i as listAgentProvenanceAdapters,vh as listAliasPluralKeys,Vf as listAllComplete,fw as listAllDocumentCandidatesCached,qi as listAllItemMetadata,_w as listAllItemMetadataLight,KO as listAssuranceDeclarations,QO as listAssuranceVerdicts,iy as listBuiltinCorpusShapes,LM as listCoreClosedDomainContracts,iO as listGetProjectionFields,BR as listInvalidProvenanceHistoryStreamIds,oO as listListProjectionFields,rI as listMergeReceipts,as as listMutationActions,pM as listMutationEvents,po as listPmCommandFlagBudgets,od as listPmCommandsForFamily,rd as listPmCommandsForTier,Oe as listPmFlagLexicon,KN as listPmFlagSpellingInventory,nd as listPmMcpToolsForProfile,DN as listPmRequiredArgumentRefusalContracts,$N as listPmSubcommandRefusalContracts,Ht as listProfiles,UN as listTrackerPreflightRecoveryContracts,Am as listWorkspaceSnapshots,LS as loadContextIntentRuntimeLayers,Wp as loadCreateTemplateOptions,CC as loadExtensions,lu as loadGraphAuditBaseline,Nw as loadMutationCheckpoint,x as loadRelationshipGraphAdapter,ji as locateItem,Vw as looksLikeGenericKeyValueEntry,yT as mapReadOutputRows,oI as markMergeReceiptReconciled,CA as matchesRuntimeFilters,iv as maybeRunFirstUseTelemetryPrompt,cy as measureCorpusShapePlan,Ui as measureItemMetadataReadWork,Bw as mergeAdditiveTags,JM as mergeExtensionBlueprints,WR as mergeHistoryStreams,ZR as mergeItemDocuments,QR as mergeJsonDocuments,Rh as mergeLinkedTestTwoTokenEntries,XR as mergeRelationshipEventStreams,Pp as mergeSortedWarnings,rv as migrateItemFilesToFormat,bw as mutateItem,yw as mutateItemWithHistoryContext,qE as mutateWorkspaceJsonWithHistory,Wf as next,gi as normalizeAgentProvenanceAdapterValue,Gd as normalizeAnnotationTransportOptions,NO as normalizeAssuranceEvaluation,xO as normalizeAssuranceMutation,Ih as normalizeBootstrapInvocation,rA as normalizeBulkIdsValue,Xc as normalizeDependencyGraphTarget,Zv as normalizeDependencySeedId,Jv as normalizeDependencySourceKind,Jo as normalizeExtensionContributionInventory,XS as normalizeHistoryOperationForWrite,jR as normalizeInvalidHistoryProvenance,RM as normalizeItemAddressInvocation,ei as normalizeItemFormatVersion,Fi as normalizeItemId,ni as normalizeItemMetadata,Qv as normalizeItemReference,Ah as normalizeLegacyExtensionActionSyntax,hl as normalizeLinkedPath,aA as normalizeParentReferenceValue,zt as normalizeProfileName,$i as normalizeRawItemId,JT as normalizeReadOutputIncludeModeOptions,NE as normalizeReplayPatchOps,ls as normalizeSimilarityText,sE as normalizeStatusForRegistry,oi as normalizeStatusInput,rE as normalizeStatusInputWithRegistry,GS as normalizeThrownExitCode,Qf as notes,qn as nowIso,iu as openDurableGraphCache,rx as openMcpRequestState,c0 as openPmEpisode,Fl as orderingPredecessors,Gl as orderingSuccessors,yP as packContextCandidates,Ap as packRankedContextItems,mh as packageActivate,ph as packageCatalog,fh as packageDeactivate,lh as packageDescribe,ch as packageDoctor,sh as packageInstall,nh as packageLifecycle,ih as packageList,dh as packageManage,db as packageMigrate,uh as packageReload,ah as packageUninstall,dT as paginateQueryRows,ll as parseAddEntries,ul as parseAddGlobEntries,Bd as parseAnnotationTextInput,GM as parseAtomicMutationControls,Eh as parseBootstrapCommandName,Ch as parseBootstrapGlobalOptions,Sh as parseBootstrapHelpRequest,Ph as parseBootstrapTypeValue,tA as parseBulkIdsText,Tp as parseContextDepth,gp as parseContextFocusFields,kS as parseContextIntentDeclarations,Sp as parseContextSections,SP as parseContextSignalSnapshot,zw as parseCsvKv,gv as parseDefectChangeRiskRequest,vI as parseDefectRecurrenceCoverageRequest,hv as parseDefectRecurrencePolicy,lm as parseEvalMetricFloors,_m as parseEvalQuerySet,mu as parseGraphSubcommand,GI as parseHistoryAttestation,QI as parseHistoryProvenanceFilters,Gv as parseIntegerLimit,cE as parseItemDocument,UM as parseItemMutationBatch,gA as parseLimit,Ju as parseLinkedTestAssertionEqualsMap,Zu as parseLinkedTestAssertionGteMap,Vu as parseLinkedTestBoolean,Hu as parseLinkedTestContextMode,zu as parseLinkedTestEnvClear,qu as parseLinkedTestEnvSet,Qu as parseLinkedTestJsonEntries,Yu as parseLinkedTestMinLines,Xu as parseLinkedTestRegexList,Wu as parseLinkedTestStringList,Ku as parseLinkedTestWorkspaceContextMode,Gh as parseMcpCachePolicy,kh as parseMcpImplementation,Ze as parseMcpInputRequests,sr as parseMcpInputResponses,dg as parseMcpSubscriptionFilter,ml as parseMigrateEntries,Bv as parseMultiValueFilter,EO as parseMutationReceipt,eA as parseOptionalNonNegativeInteger,Qw as parseOptionalNumber,aN as parsePmAgentTaskTranscriptCorpus,yD as parsePmToolDiscoveryOptions,Uv as parsePriority,Vv as parsePriorityFilterSet,FT as parseReadOutputSession,ow as parseRegisteredItemFieldAssignments,ie as parseRelationshipGraphSnapshot,pl as parseRemoveEntries,Ml as parseSourceLineRange,mA as parseStatusFilterCsv,qv as parseStringFilterSet,ts as parseTags,Vm as parseTestRunMeasurements,jv as parseType,zv as parseTypeFilterSet,Zd as parseUnknownAuthorHistoryEventCoordinates,wT as parseWorkflowPolicy,AT as parseWorkflowPolicyDocument,FP as partitionDecisionEntries,nA as patchPathToChangedField,Lo as pathExists,Z_ as pauseTask,su as persistDurableGraphResult,KE as persistSelectedItemFormat,PR as planAgentIdentityVocabularyMutation,RP as planCompletedAtBackfill,Id as planExtensionDirectoryCopy,Zt as planProfileApplication,uN as planRelationshipEventBackfill,pu as planRelationshipRemediation,Td as planSchemaEvolutionMigration,Yd as planUnknownAuthorHistoryAcknowledgment,vm as planWorkspaceSnapshotRestore,vv as positionalShapeKey,Ov as positionalSignatureKey,nk as preflightExtension,ps as prepareSimilarityText,Ww as preserveMutationStdinTokenFields,Kw as preserveMutationStdinTokenLiterals,PS as printError,IS as printResult,O_ as profile,P_ as profileApply,M_ as profileLint,R_ as profileList,I_ as profileShow,DC as projectAfterCommandItemSnapshot,yp as projectContextFocusRows,qm as projectFleetAttributionAnalytics,eP as projectHistoryProvenance,jn as projectPmDiagnosticOutput,Bn as projectPmDiagnosticText,jm as projectProvenanceCoverageAnalytics,vu as projectValidateCounts,GR as promoteAssuranceAssertion,cS as propagateContextUsageServingReceipt,M0 as pruneCompileCacheGenerations,XO as putAssuranceDeclaration,YO as putAssuranceDeclarationBundle,aw as queryItemMetadataIndex,cw as queryLinkedFileMetadataIndex,dw as querySimilarItemMetadataIndex,Hm as queryTestRunMeasurementsBelow,an as quoteCommandArg,sn as quoteWindowsCommandArg,xM as rankCommandPaths,jd as readAnnotationEntries,Si as readAuthorEnvironment,lf as readBooleanOption,_S as readContextUsageAffinity,uf as readCsvListOption,Hi as readExtensionMigrationState,Do as readFileIfExists,Nc as readFirstStringFromCommanderOptions,Lc as readFirstValueFromCommanderOptions,Fm as readHistoryAnalyticsWindow,_E as readHistoryEntries,vi as readHistorySnapshot,Mm as readImprovementLedger,pw as readItemMetadataDerivedIndexState,Bi as readLocatedItem,hT as readOutputBudgetCollections,xT as readOutputCollectionFingerprint,_T as readOutputContinuationRowCollections,mT as readOutputContinuationRowPaths,XT as readOutputIncludeModeOptions,fT as readOutputRowCollections,pT as readOutputRowPaths,jT as readOutputSessionRemainingTokens,$t as readPmPackageManifest,sf as readRequiredString,xi as readSettings,WE as readSettingsWithMetadata,Dc as readStringArrayFromCommanderOptions,df as readStringOption,FS as readThrownExitCode,jA as readVectorizationStatusLedger,tw as readWorkflowPolicies,vT as readWorkflowPolicyField,xS as readWorkspaceContextIntentContracts,vP as readWorkspaceContextSignals,MP as readWorkspaceMemory,hM as readWorkspacePosition,$E as reanchorHistoryEntries,tn as reconcileExtensionCapabilityUsage,VE as reconcileWorkspaceJsonHistory,LC as recordAfterCommandAffectedItem,ZO as recordAssuranceVerdict,op as recordClaimSemanticAttribution,pS as recordContextUsageDelivery,uS as recordContextUsageServing,mS as recordContextUsageTouch,fS as recordContextUsageTouches,ip as recordFocusSemanticAttribution,Pm as recordImprovementObservation,np as recordReleaseSemanticAttribution,mw as refreshItemMetadataDerivedIndex,gd as refreshMergeAttributeFenceIfInstalled,qA as refreshSearchArtifactsForMutation,hi as registerAgentProvenanceAdapters,Xv as registerExternalDependencyResolver,fi as registerHarnessSignalDescriptors,VC as registerOutputMaterialFieldGroups,H_ as release,JO as removeAssuranceDeclaration,$o as removeFileIfExists,wl as renameArtifactsResultKey,mp as renderCalendarMarkdown,fp as renderCalendarToon,Mp as renderContextMarkdown,Od as renderExtensionDescribeMarkdown,Ad as renderExtensionSurfaceMarkdown,Nf as renderGuideMarkdown,MM as renderMissingOptionRetry,GP as renderNextMarkdown,DM as renderPmClosedDomainHelp,cn as renderPmCommand,No as renderPmCommandAliasMigrationHint,ad as renderPmCommandVisibilityMarkdown,XN as renderPmFlagLexiconMarkdown,qx as renderPmMcpAppHtml,wN as renderPmRefusalClosureCensusMarkdown,_A as renderRowsAsCsv,hA as renderRowsAsTable,B_ as reopen,QE as replayHistoryToTarget,kE as replayToCanonicalItemDocument,ME as replayToItemDocument,WS as requireHistoryOperation,VI as requireTerminalReason,HI as requireTerminalReasonWithRecovery,AE as resealHistoryRewrite,MC as resetActiveExtensionRuntimeState,al as resetWorkspaceGraphCache,di as resolveAgentSessionContextFromSignals,Kd as resolveAnnotationIndex,zd as resolveAnnotationInput,fE as resolveAuthor,Ai as resolveAuthorIdentity,sA as resolveBodyFileContent,sy as resolveBuiltinCorpusShape,pp as resolveCalendarOutputFormat,gO as resolveCanonicalPmErrorCodeContract,Pb as resolveCanonicalRelationshipKind,mE as resolveClaimPrincipal,oA as resolveCliBulkIdsInput,oC as resolveCommandOptionPolicyState,P0 as resolveCompileCacheGeneration,OP as resolveCompletionTimestamp,Gb as resolveConfiguredPmPackageRoot,aO as resolveContentFieldFilters,CS as resolveContextIntentContract,bp as resolveContextOutputFormat,Cp as resolveContextTokenBudget,WI as resolveCreateExplicitEmptyFlag,XP as resolveEffectiveSearchMode,OA as resolveEmbeddingProviders,Pd as resolveExtensionInstallSourceIdentity,Vi as resolveExtensionMigrationStatePath,yC as resolveExtensionRoots,Yv as resolveExternalDependencyReference,mC as resolveFlagValueKind,kf as resolveGuideOutputFormat,km as resolveHistoryEpisodeGroupIdentity,QS as resolveHistoryHashAlgorithm,KS as resolveHistoryOperation,ZI as resolveHistoryProvenanceDimensions,Cw as resolveHistorySubject,JE as resolveHistoryTarget,JP as resolveHybridSemanticWeight,Ho as resolveImplicitPmRoot,nS as resolveIsoOrRelative,Lv as resolveItemBlockers,Pv as resolveItemExecutionRole,jM as resolveItemMutationDocument,Vo as resolveItemTypeRegistry,tE as resolveItemTypesFilePath,tf as resolveLinkedTestFailureExitCode,yu as resolveLinkedTestSourceRef,bu as resolveLinkedTestSourceWorkspaceRoot,Eu as resolveLinkedTestTrust,wu as resolveLinkedTestTrustBatch,lg as resolveMcpAcknowledgedSubscriptionFilter,We as resolveMcpRequestContext,pd as resolveMergeInstallContext,sO as resolveMissingMetadataFilters,PM as resolveMissingOptionPlaceholder,JC as resolveModePairedOutputOmissionReceipt,DP as resolveNextOutputFormat,eT as resolveOutputOmissionReceipt,Fb as resolvePmCliVersion,xo as resolvePmCommandAlias,Be as resolvePmCommandCapabilityFamily,xt as resolvePmCommandExitContract,N as resolvePmCommandOperation,Fn as resolvePmCommandOutputBudget,kt as resolvePmCommandOutputEnvelope,Tv as resolvePmCommandPositionalContract,qe as resolvePmCommandVisibilityTier,Un as resolvePmDiagnosticOutputBudget,yO as resolvePmErrorCodeContract,nb as resolvePmFlagSemanticConcept,Me as resolvePmHistoryOperation,$b as resolvePmPackageRootFromModule,Sv as resolvePmPositionalActionContract,_c as resolvePmPositionalActionFlagContracts,Ne as resolvePmRoot,yc as resolvePmToolCustomFieldCollision,uA as resolvePriority,Vt as resolveProfile,_d as resolveProjectMergeTypeFolders,cT as resolveQueryCursorStart,ZT as resolveReadOutputDimensions,rS as resolveReadOutputEncoding,CT as resolveReadOutputRecoveryBudget,KT as resolveReadOutputSurface,QC as resolveReadRowContract,IM as resolveRecoveryCommandName,Fw as resolveRegisteredSearchProvider,Gw as resolveRegisteredVectorStoreAdapter,Zi as resolveReproducibleProcessEnvironment,Yn as resolveRuntimeFieldRegistry,Xn as resolveRuntimeStatusRegistry,RA as resolveSearchCorpusFields,WP as resolveSearchMaxResults,eM as resolveSearchPage,YP as resolveSearchScoreThreshold,ZP as resolveSearchTuning,PA as resolveSemanticCorpusCharacterLimit,rp as resolveSemanticLineageIds,wA as resolveSettingsWithSemanticRuntimeDefaults,oR as resolveSourceContextWritePolicy,dp as resolveStartTaskInProgressStatus,Q as resolveSubcommandFlagContractsForCommand,Jb as resolveTelemetryErrorCategory,zI as resolveTerminalReason,rC as resolveTypeDefinition,tC as resolveTypeName,fA as resolveTypeSynonym,TA as resolveTypeWorkflows,Jd as resolveUnknownAuthorAcknowledgmentSelector,iM as resolveVectorIndexRecovery,kA as resolveVectorStores,qc as resolveWorkspaceRelationshipKindRegistry,iC as resolveWorkspaceRoot,X_ as restore,Lw as restoreCheckpointItems,HE as restoreWorkspaceJsonFromHistory,Rm as restoreWorkspaceSnapshot,Om as restoreWorkspaceSnapshotWithRecovery,yh as runAction,GC as runActiveBeforeMutationHooks,jC as runActiveCommandHandler,UC as runActiveOnIndexHooks,nn as runActiveOnReadHooks,on as runActiveOnWriteHooks,BC as runActiveParserOverride,qC as runActivePreflightOverride,zC as runActiveServiceOverride,hp as runActivity,gC as runAfterCommandHooks,sm as runAggregate,Hd as runAnnotationCommand,ku as runAppend,PI as runAssuranceAction,MI as runAssuranceDispatch,hC as runBeforeCommandHooks,_p as runCalendar,Dp as runClaim,$p as runClaimNext,Nu as runClose,Du as runCloseMany,jp as runCloseTask,tl as runComments,Lf as runCompletion,rl as runConfig,jt as runContext,hP as runContextEvaluationCorpus,fP as runContextEvaluationScenario,$u as runCopy,ep as runCreate,tp as runDelete,cl as runDeps,Al as runDocs,xR as runDuplicates,gm as runEval,bm as runEvent,Md as runExtension,Xi as runExtensionMigrateAction,Wi as runExtensionMigrations,xl as runFiles,Ll as runFilesDiscover,Nl as runFilesLookup,Bm as runFleetAttributionAnalytics,cp as runFocus,Iu as runGc,am as runGet,fu as runGraph,xf as runGuide,_u as runHealth,KP as runHistory,BI as runHistoryAttest,xI as runHistoryCompact,DI as runHistoryCompactBulk,mI as runHistoryMaintenance,$I as runHistoryRedact,_I as runHistoryRepair,gI as runHistoryRepairAll,$d as runInit,Nd as runInitAgentGuidance,Mu as runLearnings,El as runLinkedArtifacts,rf as runLinkedTests,ed as runList,ym as runMeet,dM as runMergeDriver,yd as runMergeInstall,iI as runMergeReceiptEvidenceReport,nI as runMergeReceiptReport,lM as runMergeReconcile,Np as runNext,Hp as runNotes,Up as runPauseTask,zp as runPlan,tm as runProfileApply,em as runProfileLint,Zp as runProfileList,Qp as runProfileShow,Um as runProvenanceCoverageAnalytics,ak as runRegisteredCommandForTest,pk as runRegisteredCommandOverrideForTest,bk as runRegisteredExporterForTest,dk as runRegisteredHookForTest,yk as runRegisteredImporterForTest,gk as runRegisteredMigrationForTest,ck as runRegisteredMutationGuardForTest,lk as runRegisteredParserOverrideForTest,uk as runRegisteredPreflightOverrideForTest,mk as runRegisteredRendererOverrideForTest,_k as runRegisteredSearchProviderForTest,fk as runRegisteredServiceOverrideForTest,hk as runRegisteredVectorStoreAdapterForTest,Qt as runReindex,Fp as runRelease,Cm as runRemind,YI as runReopen,Lu as runRestore,Sd as runSchemaEvolutionMigration,cm as runSearch,dy as runSearchRefreshWorkerEntrypoint,Df as runStartBackgroundRun,Gp as runStartTask,Wm as runStats,Ym as runTelemetry,Yp as runTemplatesList,Xp as runTemplatesSave,Jp as runTemplatesShow,of as runTest,nf as runTestAll,$f as runTestRunsList,Gf as runTestRunsLogs,jf as runTestRunsResume,Ff as runTestRunsStatus,Uf as runTestRunsStop,Bf as runTestRunsWorker,lp as runUpdate,Vp as runUpdateMany,Gt as runUpgrade,Ru as runValidate,gh as runWithActiveExtensions,L as runWithAgentSessionContext,yS as runWithContextIntentContracts,DS as runWithDiscoveredContextIntentContracts,yi as runWithHarnessDetectionSignals,Nx as runWithMcpTraceContext,es as runWithReproducibleProcessEnvironment,bi as runWithWorkspaceHarnessSignalDescriptors,Br as runWithWorkspaceRecipe,CR as runWorkflowPolicyAction,kI as runWorkspaceTransactionGc,uu as saveGraphAuditBaseline,TI as scanClosureTimestamps,UR as scanExtensionHostVersions,Xd as scanHistoryAuthorAttribution,ri as scanItemFormatVersions,ns as scanMutationSecrets,qR as scanProvenanceResolverHealth,hs as scanStaleInProgressItems,wI as scanStorageIntegrity,l_ as schema,g_ as schemaAddField,__ as schemaAddStatus,m_ as schemaAddType,T_ as schemaApplyPreset,S_ as schemaInferTypes,u_ as schemaList,b_ as schemaListFields,A_ as schemaRemapStatus,y_ as schemaRemoveField,h_ as schemaRemoveStatus,f_ as schemaRemoveType,w_ as schemaRenameField,E_ as schemaRenameType,p_ as schemaShow,C_ as schemaShowField,v_ as schemaShowStatus,kM as scoreCommandPathMatch,lP as scoreContextCandidates,uP as scoreContextCandidatesWithActiveExtensions,ms as scoreItemSimilarity,FN as scorePmGrammarRefusalClosure,ON as scorePmRefusalClosure,fs as scorePreparedItemSimilarity,jN as scoreTrackerPreflightRecoveryClosure,EE as sealHistoryRecord,tx as sealMcpRequestState,Hf as search,NP as searchWorkspaceMemory,LP as searchWorkspaceMemoryReadResult,$v as selectActionableEntries,rT as selectCursorSemanticOptions,Rf as selectImportAuthor,Ix as selectMcpClientRegistrationMode,xP as selectWorkspaceMemory,kP as selectWorkspaceMemoryRollups,ap as semanticAttributionAffinity,XA as sentryCaptureCliError,WA as sentryFinishCommandSpan,JA as sentryFlush,YA as sentryLogCliUsageError,HA as sentrySetCommandContext,KA as sentryStartCommandSpan,si as serializeItemDocument,$M as serializeNdjsonRows,FM as serializeNdjsonStream,Zg as serveDeclaredObservation,kC as setActiveCommandContext,xC as setActiveCommandResult,AC as setActiveExtensionCommands,wC as setActiveExtensionHooks,vC as setActiveExtensionParsers,OC as setActiveExtensionPreflight,PC as setActiveExtensionRegistrations,IC as setActiveExtensionRenderers,RC as setActiveExtensionServices,uE as setFocusedItem,nv as shouldCompletePlanOnClose,du as shouldPersistDurableGraphCache,Jw as shouldResolveMutationStdinTokenField,Yw as shouldResolveMutationStdinTokens,vA as shouldRunSearchRefreshInForeground,vl as similarityAdvisoryWarnings,uT as sliceReadOutputRowCollection,Cl as sortLinkedArtifacts,Uw as splitAcceptanceCriteria,tv as splitCommaList,ii as splitFrontMatter,QT as stabilizeReadOutputReceiptEstimates,I as stableStringify,_C as stableValueEquals,J_ as startTask,sv as startTelemetryCommand,Yf as stats,oE as statusIsTerminal,Th as stripGlobalBootstrapTokens,mM as subscribeMutationEventBatches,fM as subscribeMutationEvents,IR as summarizeAgentIdentityVocabulary,Nm as summarizeAgentModelProvenance,Lm as summarizeAgentProvenance,_P as summarizeContextEvaluationReports,Jm as summarizeContextPreflight,oP as summarizeHistoryProvenance,Ld as summarizeInitResult,eI as summarizeMergeReceipt,XI as supportsCreateExplicitEmpty,OM as supportsItemIdAlias,Lb as suppressHostOutput,we as syncRelationshipGraphAdapter,tk as synthesizeExtensionManifest,hc as toCompletionFlagString,Ip as toContextFocusItem,vp as toContextPackingSummary,Op as toContextRankingSummary,jb as toErrorMessage,mf as toEstimatedMinutesValue,wM as toExtensionFlagDefinitions,yf as toImportBoolean,Sf as toImportConfidence,gf as toImportInteger,vf as toImportLinkedDocs,Af as toImportLinkedFiles,Of as toImportLinkedTests,wf as toImportLogEntries,Ef as toImportNormalizedEnum,Tf as toImportNumberMap,ff as toImportPriority,hf as toImportStatus,bf as toImportStringList,Cf as toImportStringMap,_f as toImportTags,dE as toItemRecord,pf as toNonEmptyImportString,Ub as toNonEmptyStringOrUndefined,xE as toReplayDocument,us as tokenizeSimilarityText,Xw as transferMutationStdinTokenPolicy,uC as translateHostEnvironmentFault,j_ as update,_h as upgrade,k_ as validate,UO as validateAssertionDefinition,BO as validateAssuranceDocument,jO as validateGateDefinition,qM as validateItemMutationRows,Sl as validateLinkedPaths,Px as validateMcpAuthorizationResponseIssuer,Rx as validateMcpAuthorizationServerMetadata,Mx as validateMcpClientMetadataDocument,Cx as validateMcpHttpRequestHeaders,ix as validateMcpJsonSchema,GO as validateMeasurementDefinition,dA as validateMissingParentReference,WT as validateReadOutputOptions,pA as validateSprintOrReleaseValue,nC as validateTypeOptions,jI as verifyAttestation,fO as verifyCliFlagInvocationParity,Av as verifyExplicitPositionalSlotCensus,DE as verifyHistoryChain,LE as verifyHistoryChainWithVersion,Tw as verifyHistoryEntries,wE as verifyHistoryRecordHash,vE as verifyHistoryRewriteEvidence,Iv as verifyPmCliGrammar,Rv as verifyPmCommandPositionalContracts,WN as verifyPmFlagLexicon,yN as verifyPmRecoveryKindRuntimeCoverage,Wy as verifyPmRecoveryProducerRuntimeCoverage,gN as verifyPmRecoveryReferences,SN as verifyPmRefusalClosureIdentityRatchet,TN as verifyPmRefusalClosureRatchet,hN as verifyPmRefusalReachability,gs as verifyToolOptionCliParity,Ls as withFlagAliasMetadata,pC as withHostEnvironmentBoundary,nx as withMcpCachePolicy,RT as workflowApprovalFingerprint,IT as workflowPolicyApplies,OT as workflowPolicyFingerprint,sl as workspaceGraphCache,Vd as wrapOwnershipConflict,jS as wrapThrownErrorForSentry,Ei as writeAuthorEnvironment,xe as writeFileAtomic,xw as writeMutationCheckpoint,XE as writeSettings,RS as writeStderr,OS as writeStdout,BA as writeVectorizationStatusLedger,zE as writeWorkspaceJsonWithHistory};
|
|
29
|
+
`&&t.push(r+1);return t}function Ky(e,t){let r=0,o=e.length;for(;r<o;){let n=Math.floor((r+o)/2);e[n]<=t?r=n+1:o=n}return r}function CN(e){let t=[],r=[];for(let n of[...e].sort((i,s)=>Z(i.path,s.path))){let i=Hy(n.content),s;try{s=Vy(n.content)}catch(a){r.push({kind:"invalid_source",subject:n.path,detail:`${n.path} could not be parsed for recovery producers: ${String(a)}.`});continue}for(let a of s){let c=a.field,d=Ky(i,a.offset),l=io(c);l?t.push({path:n.path,line:d,field:c,kind:l.kind}):/(?:retry_command|candidate_command|fallback_candidate|next_best_command|example|next_step|migration_hint|restore_with)/u.test(c)&&!/(?:_total|_truncated)$/u.test(c)&&r.push({kind:"unknown_recovery_field",subject:`${n.path}:${d}:${c}`,detail:`${c} resembles a recovery reference but has no typed field contract.`})}}let o=Object.fromEntries(ae.map(n=>[n,t.filter(i=>i.kind===n).length]));for(let n of ae)o[n]===0&&r.push({kind:"missing_kind_producer",subject:n,detail:`No source producer emits the ${n} recovery-reference kind.`});return t.sort((n,i)=>n.path!==i.path?Z(n.path,i.path):n.line!==i.line?n.line-i.line:Z(n.field,i.field)),r.sort((n,i)=>n.subject!==i.subject?Z(n.subject,i.subject):Z(n.kind,i.kind)),{ok:r.length===0,scanned_file_count:e.length,producer_count:t.length,producer_count_by_kind:o,producers:t,findings:r}}function TN(e,t){let r=[],o=(n,i)=>{if(Array.isArray(n)){n.forEach((s,a)=>o(s,[...i,String(a)]));return}if(!(typeof n!="object"||n===null))for(let[s,a]of Object.entries(n).sort(([c],[d])=>Z(c,d))){let c=io(s),d=c?.kind==="migration_hint"&&n.semantics==="behavior_preserving"?{...c,semantics:"behavior_preserving"}:c,l=[a].flat();d!==void 0&&l.forEach((u,f)=>{let g="nested_value_field"in d&&typeof d.nested_value_field=="string"?d.nested_value_field:void 0,h=g&&typeof u=="object"&&u!==null&&!Array.isArray(u)?u[g]:u;if(typeof h!="string"||h.trim().length===0)return;let C=[...i,s,String(f)].map(S=>encodeURIComponent(S)).join("/");r.push({id:`${e}:${d.kind}:${C}`,probe_id:e,kind:d.kind,semantics:d.semantics,value:h})}),o(a,[...i,s])}};return o(t,[]),r}function SN(e,t){let r=e.flatMap(s=>(s.owned_states??[]).map(a=>({contract:s,state:a}))),o=[],n=new Map;for(let s of t){if(n.has(s.probe_id)){o.push({kind:"duplicate_probe",probe_id:s.probe_id,detail:`Observation ${s.probe_id} was supplied more than once.`});continue}n.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=n.get(a.probe_id);if(!c){o.push({kind:"missing_probe",probe_id:a.probe_id,detail:`No entrypoint observation was recorded for ${s.code}.`});continue}c.code!==s.code&&o.push({kind:"wrong_error_code",probe_id:a.probe_id,detail:`Expected ${s.code}; observed ${c.code}.`}),c.exit_class!==a.expected_exit_class&&o.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)||o.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)||o.push({kind:"undeclared_probe",probe_id:s.probe_id,detail:`Observation ${s.probe_id} has no catalog declaration.`});return o.sort((s,a)=>s.probe_id!==a.probe_id?s.probe_id.localeCompare(a.probe_id):s.kind.localeCompare(a.kind)),{ok:o.length===0,declared_probe_count:r.length,observed_probe_count:t.length,findings:o}}function EN(e,t){let r=[],o=new Set,n=new Set;for(let c of e){if(o.has(c.id)){n.add(c.id),r.push({kind:"duplicate_obligation",reference_id:c.id,detail:`Recovery obligation ${c.id} was declared more than once.`});continue}o.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),o.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(n.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=ae.map(c=>{let d=e.filter(u=>u.kind===c),l=d.filter(u=>!n.has(u.id)).map(u=>i.get(u.id)).filter(u=>u!==void 0);return{kind:c,declared:d.length,observed:l.length,passed:d.filter(u=>{let f=i.get(u.id);return!n.has(u.id)&&f?.reachable===!0&&f.semantics===u.semantics}).length}});r.sort((c,d)=>c.reference_id!==d.reference_id?c.reference_id.localeCompare(d.reference_id):c.kind.localeCompare(d.kind));let a=s.reduce((c,d)=>c+d.passed,0);return{ok:r.length===0,declared_reference_count:e.length,observed_reference_count:t.length,pass_fraction:o.size===0?1:a/o.size,coverage_by_kind:s,findings:r}}function Wy(e,t){let r=new Map(ae.map(i=>[i,new Set]));for(let i of t)r.get(i.kind).add(i.value);let o=ae.map(i=>({kind:i,source_producers:e.producer_count_by_kind[i],runtime_values:r.get(i).size})),n=o.filter(({source_producers:i,runtime_values:s})=>i>0&&s===0).map(({kind:i})=>i);return{ok:e.ok&&n.length===0,source_producer_count:e.producer_count,runtime_value_count:o.reduce((i,{runtime_values:s})=>i+s,0),coverage_by_kind:o,missing_runtime_kinds:n}}var wN=Wy;(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]="ae22de89-8bac-5728-a6e2-29b342383abe")}catch{}})();var vN=16,Xy=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"]),so=18,ao=Object.freeze([...Xy,"manifest_unknown_key","no_version_bounds_declared"].sort((e,t)=>e.localeCompare(t)));function ON(e,t=so){return{ok:e.executable_error_code_count>=t,baseline:t,actual:e.executable_error_code_count}}function RN(e,t=ao){let r=new Set(e.rows.filter(({disposition:n})=>n==="executable").map(({canonical_code:n})=>n)),o=t.filter(n=>!r.has(n));return{ok:o.length===0,required_canonical_codes:[...t],missing_required_canonical_codes:o}}function pt(e,t){let r=e.get(t);if(r)return r;let o={kinds:new Set,probeIds:new Set};return e.set(t,o),o}function IN(e,t,r){let o=new Map(e.map(l=>[l.code,l.canonical_code??l.code])),n=new Map,i=0,s=0;for(let l of e){let u=pt(n,l.canonical_code??l.code);for(let f of l.owned_states??[])u.kinds.add("owned_state"),u.probeIds.add(f.probe_id)}for(let l of t){let u=o.get(l.error_code);if(u===void 0)continue;i+=1;let f=pt(n,u);f.kinds.add("closed_domain"),f.probeIds.add(l.probe_id)}for(let l of r){let u=o.get(l.error_code);if(u===void 0)continue;s+=1;let f=pt(n,u);f.kinds.add("grammar"),f.probeIds.add(l.probe_id)}let a=e.map(l=>{let u=l.canonical_code??l.code,f=n.get(u),g=[...f.probeIds].sort();return{code:l.code,canonical_code:u,disposition:g.length>0?"executable":"uncovered",evidence_kinds:[...f.kinds].sort(),probe_ids:g}}).sort((l,u)=>l.code<u.code?-1:1),c=a.filter(({disposition:l})=>l==="uncovered").map(({code:l})=>l),d=a.length-c.length;return{ok:c.length===0,catalog_error_code_count:a.length,executable_error_code_count:d,uncovered_error_code_count:c.length,coverage_fraction:a.length===0?1:d/a.length,closed_domain_probe_count:i,grammar_probe_count:s,uncovered_error_codes:c,rows:a}}function PN(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: ${so}`,`- Required executable canonical codes: ${ao.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(`
|
|
30
|
+
`)}(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]="6ecdd8cf-3153-5ed9-abd4-e8a73da6662a")}catch{}})();function Yy(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 Jy(e){return[e.exit_code!==ue.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 ${ue.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."},...Yy(e)]}function xN(e){let t=[],r=new Set,o=0;e.length===0&&t.push({code:"empty_corpus",probe_id:"corpus",detail:"At least one real refusal observation is required."});for(let n of e){if(r.has(n.probe_id)){t.push({code:"duplicate_probe",probe_id:n.probe_id,detail:`${n.probe_id} was supplied more than once.`});continue}r.add(n.probe_id);let i=t.length;for(let s of Jy(n))s!==void 0&&t.push(s);t.length===i&&(o+=1)}return t.sort((n,i)=>n.probe_id!==i.probe_id?n.probe_id.localeCompare(i.probe_id):n.code.localeCompare(i.code)),{ok:t.length===0,probe_count:r.size,closed_probe_count:o,closure_fraction:r.size===0?0:o/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]="41d33f0e-f925-54da-a75d-52a73dd76f38")}catch{}})();var co="not-a-declared-action";function Zy(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 ce(e){return e.replaceAll(/[^a-z0-9]+/gu,"-").replaceAll(/^-|-$/gu,"")}function BN(e=Ge.filter(t=>At.some(r=>r.command===t.command&&r.disposition!=="package_owned"))){let t=new Set(e.filter(({command:r})=>!r.includes(" ")).map(({command:r})=>ce(r)));return e.flatMap(r=>r.slots.flatMap((o,n)=>{if(!o.required)return[];let i=r.command.split(" "),s=ce(r.command),a=i.length>1&&t.has(s)?i.map(ce).join("--"):s,c=Q(r.command).flatMap(l=>l.required?[l.flag,...l.value_name?["example"]:[]]:[]),d=Fe.some(l=>l.command===r.command);return[{probe_id:`required-argument-${a}-${ce(o.name)}`,command:r.command,refusal_args:[...i,...r.slots.slice(0,n).map(l=>Zy(r.command,l)),...c],recovery_args:[...i,"--help"],error_code:d&&!r.command.startsWith("assurance ")?"invalid_argument_value":/^extension (?:activate|adopt|deactivate|uninstall)$/u.test(r.command)?"missing_lifecycle_target":"missing_required_argument",missing_argument:o.name,missing_argument_index:n}]})).sort((r,o)=>r.probe_id.localeCompare(o.probe_id))}function Qy(e){switch(N(e)){case"assurance":case"workspace snapshot":return Fe.filter(({parent:t})=>t===e).map(({action:t})=>t);case"graph":return Le;case"merge":return De;case"plan":return Ve;case"profile":return He;case"schema":return Nt;default:throw new Error(`Required positional action family ${e} has no authoritative value domain.`)}}function qN(e=Ge){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-${ce(t)}`,command:t,refusal_args:[...r,co],recovery_args:[...r,"--help"],error_code:"unknown_subcommand",rejected_value:co,allowed_values:[...Qy(t)].sort()}}).sort((t,r)=>t.probe_id.localeCompare(r.probe_id))}function eb(e,t){let r=[...t].sort();return e.length===t.length&&[...e].sort().every((o,n)=>o===r[n])}function tb(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&&!eb(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 zN(e,t){let r=new Map(e.map(s=>[s.probe_id,s])),o=new Map(t.map(s=>[s.probe_id,s])),n=[...e.flatMap(s=>tb(s,o.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.`}))];n.sort((s,a)=>s.probe_id.localeCompare(a.probe_id)||s.code.localeCompare(a.code));let i=new Set(n.map(({probe_id:s})=>s));return{ok:n.length===0,probe_count:e.length,closed_probe_count:e.filter(({probe_id:s})=>!i.has(s)).length,findings:n}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="5053cc84-63e5-50d3-9a4c-00c2a485ed69")}catch{}})();var mt=[{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 HN(){return mt.map(e=>({...e}))}function rb(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 o=t.suggested_retry_args.indexOf("init"),n=o===0||o===2&&t.suggested_retry_args[0]==="--pm-path"&&t.suggested_retry_args[1]?.length>0;return e.recovery_kind==="initialize"&&!n&&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 KN(e){let t=new Map(e.map(n=>[n.probe_id,n])),r=[],o=0;for(let n of mt){let i=t.get(n.probe_id);if(i===void 0){r.push({code:"missing_probe",probe_id:n.probe_id,detail:"No runtime observation was supplied for this contract."});continue}let s=rb(n,i);r.push(...s),s.length===0&&(o+=1)}return r.sort((n,i)=>n.probe_id.localeCompare(i.probe_id)||n.code.localeCompare(i.code)),{ok:r.length===0,probe_count:mt.length,closed_probe_count:o,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]="3bb9b0da-78ce-5793-96e2-2de27b8f18fa")}catch{}})();var ve,ob=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 nb(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=ob[N(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(N(e))?"linked-file-path":["comments","notes","learnings"].includes(N(e))?"entry-file-input":"plan-definition-file"}function Oe(){if(ve!==void 0)return ve;let t=ee.filter(({command:i})=>Ue(i)).flatMap(({command:i,family:s})=>Pt(i,Q(i)).map(a=>({command:i,family:s,concept:nb(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}`))),o=t.filter(i=>!r.has(`${i.command}:${i.flag}`)),n=new Map;for(let i of o){let s=n.get(i.concept)??new Set;s.add(i.value_kind),n.set(i.concept,s)}return ve=Object.freeze(o.map(i=>Object.freeze({...i,concept:n.get(i.concept)?.size===1?i.concept:`${i.concept}@${i.command}`}))),ve}function QN(){return Object.freeze(Oe().map(e=>Object.freeze({command:e.command,canonical_flag:e.flag,accepted_spellings:Object.freeze([...new Set([e.flag,...e.aliases])].sort())})))}var lo=Object.freeze({init:30,item:20,config:36,extension:54,package:55,packages:55,install:27,upgrade:29,create:100,copy:24,focus:22,list:86,"list-all":86,"list-draft":84,"list-open":84,"list-in-progress":84,"list-blocked":84,"list-closed":84,"list-canceled":84,aggregate:40,context:45,ctx:45,get:30,graph:34,search:78,duplicates:25,eval:25,next:38,history:35,events:33,"history-attest":23,"history-redact":27,"history-repair":27,"history-compact":30,"history-author-acknowledge":28,merge:27,schema:43,profile:22,activity:35,restore:23,update:105,"update-many":146,close:32,"close-many":72,delete:24,append:25,comments:31,notes:35,learnings:31,files:39,docs:30,deps:32,plan:109,test:53,"test-all":40,telemetry:21,stats:29,health:36,validate:46,assurance:30,gc:22,workspace:23,contracts:29,claim:39,release:24,"start-task":23,"pause-task":23,"close-task":24,meet:33,event:33,remind:29,"test-runs-worker":20}),uo=Object.freeze({...lo,...Object.fromEntries(Pe.flatMap(({alias:e,canonical:t})=>{let r=lo[e];return r===void 0?[]:[[t,r]]}))});function po(){let e=new Map(Object.keys(uo).map(t=>[t,0]));for(let{command:t}of Oe())e.set(t,Number(e.get(t))+1);return Object.freeze(Object.entries(uo).map(([t,r])=>Object.freeze({command:t,current:Number(e.get(t)),maximum:r})))}function ib(e,t,r){for(let o of e)for(let n of o.aliases){let i=t.get(`${o.command}:${n}`);i===void 0||i.flag===o.flag||r.push({code:"alias_collision",command:o.command,detail:`${n} aliases ${o.flag} but is canonical for ${i.flag}.`})}}function sb(e,t,r){let o=new Set(t.map(({command:n})=>n));for(let n of e.keys())o.has(n)||r.push({code:"missing_budget",command:n,detail:`${n} has canonical flags but no persisted budget.`});for(let n of t){let i=e.get(n.command)??0;i===0&&r.push({code:"stale_budget",command:n.command,detail:`${n.command} has a persisted budget but no canonical flags.`}),!(i<=n.maximum)&&r.push({code:"budget_exceeded",command:n.command,detail:`${i} canonical flags exceed the ratcheted maximum ${n.maximum}.`})}}function ab(e,t,r){let o=new Map(e.map(n=>[`${n.command}:${n.flag}`,n]));for(let n of t){let i=`${n.command}:${n.canonical_flag}`,s=o.get(i);if(!s){r.push({code:"removed_canonical_spelling",command:n.command,detail:`${n.canonical_flag} disappeared from the executable spelling inventory.`});continue}let a=new Set([s.flag,...s.aliases]);for(let c of n.accepted_spellings)a.has(c)||r.push({code:"removed_compatibility_spelling",command:n.command,detail:`${c} no longer resolves to ${n.canonical_flag}.`})}}function eL(e=Oe(),t=po(),r=[]){let o=[],n=new Map,i=new Map,s=new Map,a=new Map;for(let c of e){let d=`${c.command}:${c.flag}`;n.has(d)?o.push({code:"duplicate_canonical_flag",command:c.command,detail:`${c.flag} has more than one canonical row.`}):n.set(d,c),a.set(c.command,(a.get(c.command)??0)+1);let l=i.get(c.concept);l!==void 0&&l!==c.value_kind?o.push({code:"inconsistent_concept_kind",command:c.command,detail:`${c.concept} uses both ${l} and ${c.value_kind}.`}):i.set(c.concept,c.value_kind);let u=s.get(c.concept);u!==void 0&&u!==c.flag?o.push({code:"semantic_spelling_collision",command:c.command,detail:`${c.concept} is canonicalized by both ${u} and ${c.flag}.`}):s.set(c.concept,c.flag)}return ib(e,n,o),sb(a,t,o),ab(e,r,o),o.sort((c,d)=>c.command.localeCompare(d.command)||c.code.localeCompare(d.code)||c.detail.localeCompare(d.detail)),{ok:o.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:o}}function tL(){let e=Oe(),t=po(),r=new Map(t.map(({command:n})=>[n,"unknown"]));for(let{command:n,family:i}of e)r.set(n,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:n,current:i,maximum:s})=>{let a=r.get(n);return`| \`${n}\` | ${a} | ${i} | ${s} |`}),""].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]="a169a68c-13d0-5a3a-b231-abdf1a34ef6a")}catch{}})();function oL(e){return e}function nL(e){return e}function iL(e){return e}function sL(e){return e}function aL(e){return e}function cL(e){return e}function dL(e){return e}function lL(e){return e}function uL(e){return e}function pL(e){return e}function mL(e){return e}function fL(e){return e}function _L(e){return e}function hL(e){return{handled:!0,result:e}}function gL(){return{handled:!1}}function yL(e){return e}function bL(e){return e}function CL(e){return e}function TL(e){return e}function SL(e){return e}function EL(e){return e}function wL(e){return e}function AL(e){return e}function vL(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]="14bbf3be-03a5-5ff3-888f-6e8b9a68ac73")}catch{}})();function cb(e={},t={}){return new me(t).extension(void 0,{...e,migrate:!0})}function db(e={},t={}){return new me(t).packageMigrate(e)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="af4da99c-f557-5bf7-a439-c14878e4970d")}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]="47924d35-d6ce-5507-adbf-c4c3cb25c18e")}catch{}})();import{createHash as fo,createHmac as lb,randomBytes as ub,timingSafeEqual as pb}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]="31eda153-a06e-51ef-a62f-f6dce09064d3")}catch{}})();var SD="dev.unbrained.pm/progressive-tool-discovery",ED=Object.freeze({version:1,discoveryTool:"pm_discover",canonicalResult:"structuredContent.result",compatibilityText:"pointer"}),mb=Object.freeze(["pm_discover","pm_next","pm_context","pm_search","pm_get"]),j=Object.freeze({lexical:.4,semantic:.2,graph:.1,permission:.15,freshness:.05,usage:.1}),fb=Object.freeze(["profile_changed","tool_contract_changed","workspace_extension_changed","authorization_changed","ranking_signal_changed","cursor_integrity_key_rotated"]),_o={core:0,standard:1,full:2,internal:3},ho=Object.freeze(["core","standard","full"]),_b=new Set(["core","standard","full","custom"]),go=new Set(ee.map(({family:e})=>e)),hb=ub(32);function Ie(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](),o=0;for(let n=r.next();!n.done;n=r.next())if(o+=1,o>4096)throw new b(`pm tool discovery ${t} must be a string of at most 4096 Unicode characters.`,64);return e}function yo(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 bo(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 Co(e){if(e!==void 0&&typeof e!="boolean")throw new b("pm tool discovery includeSchema must be a boolean.",64);return e===!0}function To(e){if(e===null||typeof e!="object"||Array.isArray(e))throw new b("pm tool discovery options must be an object.",64)}function gb(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 wD(e){if(To(e),e.family!==void 0&&(typeof e.family!="string"||!go.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"||!ho.includes(e.tier)))throw new b("pm tool discovery tier must be core, standard, or full.",64);return{...e.query!==void 0?{query:Ie(e.query,"query")}:{},...e.family!==void 0?{family:e.family}:{},...e.tier!==void 0?{tier:e.tier}:{},...e.limit!==void 0?{limit:yo(e.limit)}:{},...e.cursor!==void 0?{cursor:Ie(e.cursor,"cursor")}:{},...e.includeSchema!==void 0?{includeSchema:Co(e.includeSchema)}:{},...e.outputBudget!==void 0?{outputBudget:bo(e.outputBudget)}:{}}}function yb(e){return e===void 0||!Number.isFinite(e)?0:Math.min(1,Math.max(0,e))}function de(e){return[...new Set(e.toLowerCase().match(/[a-z0-9]+/gu)??[])].sort()}function bb(e,t){let r=de(e);if(r.length===0)return 0;let o=new Set(de(t)),n=r.filter(s=>o.has(s)).length,i=t.toLowerCase().includes(e.toLowerCase())?.25:0;return Math.min(1,n/r.length+i)}function Cb(e,t){let r=de(e);if(r.length===0)return 0;let o=t.toLowerCase(),n=de(t),i=r.filter(a=>n.some(c=>c.startsWith(a)||a.startsWith(c))).length,s=o.includes(e.toLowerCase())?.2:0;return Math.min(1,i/r.length+s)}function mo(e){return fo("sha256").update(JSON.stringify(e)).digest("hex").slice(0,24)}function So(e,t,r){return lb("sha256",r).update(JSON.stringify({version:1,fingerprint:e,offset:t})).digest("base64url")}function Tb(e,t,r){let o={version:1,offset:t,signature:So(e,t,r)};return Buffer.from(JSON.stringify(o),"utf8").toString("base64url")}function Sb(e,t,r,o){if(e===void 0)return 0;try{let n=JSON.parse(Buffer.from(e,"base64url").toString("utf8"));if(n.version!==1||!Number.isInteger(n.offset)||(n.offset??-1)<0||Number(n.offset)>r||typeof n.signature!="string")throw new Error("cursor fields do not match the request");let i=Buffer.from(So(t,n.offset,o),"base64url"),s=Buffer.from(n.signature,"base64url");if(s.length!==i.length||!pb(s,i))throw new Error("cursor signature does not match the request");return n.offset}catch(n){throw new b("Invalid or stale pm tool discovery cursor; restart discovery without cursor.",64,{reason:String(n)})}}function ft(e,t,r){return{value:yb(e),weight:t,available:r!=="unavailable",source:r}}function Re(e,t,r){return ft(e??t,r,e===void 0?"computed":"host")}function Eb(e,t,r){let o=Object.hasOwn(pe,e.name)?pe[e.name]:"help",n=Be(o),i=`${e.name} ${e.description} ${o} ${n}`,s=bb(t,i),a=new Set(de(t)),c={lexical:ft(s,j.lexical,"computed"),semantic:Re(e.signals?.semantic,Cb(t,i),j.semantic),graph:Re(e.signals?.graph,a.has(n)||a.has(o)?1:0,j.graph),permission:ft(1,j.permission,"authorization"),freshness:Re(e.signals?.freshness,1,j.freshness),usage:Re(e.signals?.usage,mb.includes(e.name)?1:0,j.usage)},d=Object.values(c).reduce((l,u)=>l+u.value*u.weight,0);return{name:e.name,description:e.description,command:o,tier:qe(o),family:n,score:Number(d.toFixed(6)),signals:c,...r?{input_schema:structuredClone(e.inputSchema)}:{}}}function wb(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"||!ho.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"||!go.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"||!_b.has(e.profile)))throw new b("pm tool discovery profile must be core, standard, full, or custom.",64)}function Ab(e){let r=Ie(e.query===void 0?"":e.query,"query").trim().replace(/\s+/gu," ");Ie(e.cursor===void 0?"":e.cursor,"cursor");let o=yo(e.limit===void 0?10:e.limit),n=bo(e.outputBudget===void 0?1200:e.outputBudget);return wb(e),{query:r,includeSchema:Co(e.includeSchema),limit:o,budget:n,maximumTier:_o[e.tier??"full"],profile:e.profile===void 0?"core":e.profile}}function Eo(e,t,r){let o=r??e.tools.reduce((s,a,c)=>s+(c===0?0:1)+Buffer.byteLength(JSON.stringify(a),"utf8"),0),n={...e,tools:[]},i=0;for(let s=0;s<4;s+=1){let a=Buffer.byteLength(JSON.stringify({...n,token_cost:{estimated_tokens:i,budget:t,within_budget:!0}}),"utf8"),c=Math.ceil((a+o)/4);if(c===i)break;i=c}return i}function vb(e,t,r){return e.filter(o=>o.authorized!==!1).map(o=>Eb(o,r.query,r.includeSchema)).filter(o=>o.tier!=="internal"&&_o[o.tier]<=r.maximumTier&&(t.family===void 0||o.family===t.family)).sort((o,n)=>n.score-o.score||(o.name<n.name?-1:o.name>n.name?1:0))}function Ob(e,t,r){if(t==="unbounded")return[...e];let o=[],n=0;for(let[i,s]of e.entries()){let a=n+(i===0?0:1)+Buffer.byteLength(JSON.stringify(s),"utf8");if(Eo(r(i+1),t,a)>t)break;o.push(s),n=a}return o}function AD(e,t={}){gb(e),To(t);let r=Ab(t),o=t.cursorIntegrityKey??hb,n=vb(e,t,r),i=mo({query:r.query,family:t.family??null,tier:t.tier??"full",includeSchema:r.includeSchema,profile:r.profile,ranked:n}),s=Sb(t.cursor,i,n.length,o),a=n.slice(s,s+r.limit),c=[];r.includeSchema||c.push({name:"input_schema",reason:"compact_projection",restore_with:"Set includeSchema=true."}),s+r.limit<n.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:n.length,ranking_policy:{version:1,formula:"weighted_sum_then_name",weights:j},cache:{key:mo({fingerprint:i,cursorIntegrityKey:fo("sha256").update(o).digest("hex"),limit:r.limit,offset:s,budget:r.budget}),ttl_ms:3e4,scope:"private",invalidates_on:fb}},l=(h,C=h.length)=>{let S=s+C,B=S<n.length,R=[...c];return C<a.length&&R.push({name:"tools",reason:"token_budget",restore_with:"Continue with next_cursor or increase outputBudget."}),{...d,tools:[...h],returned:C,has_more:B,...B?{next_cursor:Tb(i,S,o)}:{},omission_receipt:{has_omissions:R.length>0,omitted:R}}},u=h=>{let C=l(h),S=Eo(C,r.budget);return{...C,token_cost:{estimated_tokens:S,budget:r.budget,within_budget:r.budget==="unbounded"||S<=r.budget}}},f=Ob(a,r.budget,h=>l([],h)),g=u(f);if(a.length>0&&f.length===0){let h=u([a[0]]).token_cost.estimated_tokens;throw new b(`pm tool discovery outputBudget is too small to return a tool; increase it to at least ${h}.`,64,{required:String(h)})}if(r.budget!=="unbounded"&&g.token_cost.estimated_tokens>r.budget)throw new b(`pm tool discovery outputBudget is too small; at least ${g.token_cost.estimated_tokens} estimated tokens are required for this page.`,64,{required:String(g.token_cost.estimated_tokens)});return g}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="d007edcb-46f0-5546-b804-27d86afe23e7")}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]="e9d5c73b-d4fe-56ca-a2ad-229b04baad63")}catch{}})();export{Fv as ACTIONABILITY_ORDERING_KINDS,Wa as ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS,ga as ACTIVITY_FLAG_CONTRACTS,ui as AGENT_PROVENANCE_DIMENSIONS,ts as AGGREGATE_FLAG_CONTRACTS,js as APPEND_FLAG_CONTRACTS,LI as ASSURANCE_ACTIONS,DI as ASSURANCE_DECLARATION_KINDS,BO as ASSURANCE_DOCUMENT_VERSION,aa as ASSURANCE_FLAG_CONTRACTS,qO as ASSURANCE_GATE_TRIGGERS,zO as ASSURANCE_MEASUREMENT_SOURCE_KINDS,jR as ASSURANCE_PRESET_IDS,FO as AssuranceEvaluationRefusalError,$O as AssuranceMutationRefusalError,GO as AssuranceSourceResolutionError,Jn as BASELINE_ITEM_FORMAT_VERSION,fy as BOUNDARY_FIXTURE_CAPTURE_SOURCES,cO as BRIEF_LIST_FIELDS,mi as BUILTIN_AGENT_PROVENANCE_ADAPTERS,W as BUILTIN_CORPUS_SHAPES,pi as BUILTIN_HARNESS_SIGNAL_DESCRIPTORS,Fo as BUILTIN_ITEM_TYPE_VALUES,qt as BUILTIN_PROFILES,Rb as BUILTIN_RELATIONSHIP_KINDS,Va as CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS,ha as CALENDAR_FLAG_CONTRACTS,Bs as CLAIM_FLAG_CONTRACTS,Uc as CLOSE_ACTION_OPTION_KEYS,Gs as CLOSE_FLAG_CONTRACTS,Us as CLOSE_MANY_FLAG_CONTRACTS,Ws as CLOSE_TASK_FLAG_CONTRACTS,rs as COMMENTS_FLAG_CONTRACTS,Zb as COMMON_MUTATION_COMMAND_OPTION_KEYS,Ia as COMPLETION_FLAG_CONTRACTS,zo as CONFIDENCE_TEXT_VALUES,gs as CONFIG_FLAG_CONTRACTS,Ha as CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS,bP as CONTEXT_EVALUATION_METRIC_NAMES,ba as CONTEXT_FLAG_CONTRACTS,Ut as CONTEXT_OUTPUT_VALUES,wP as CONTEXT_PACKING_PROFILES,uP as CONTEXT_RECENCY_EPOCH,_P as CONTEXT_RELEVANCE_SERVICE,mP as CONTEXT_RELEVANCE_SIGNAL_NAMES,OP as CONTEXT_SIGNAL_SET_VERSION,vP as CONTEXT_SIGNAL_STORE_FORMAT_VERSION,RP as CONTEXT_SIGNAL_STORE_WARNING_DETAILS,cS as CONTEXT_USAGE_LIMITS,Ra as CONTRACTS_FLAG_CONTRACTS,pa as COPY_FLAG_CONTRACTS,Wc as CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,Yc as CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,Xc as CREATE_COMMANDER_STRING_OPTION_CONTRACTS,Wb as CREATE_DIRECT_CLOSE_REASON_DEFAULT,ca as CREATE_FLAG_CONTRACTS,tE as CURRENT_HISTORY_HASH_ALGORITHM,bE as CURRENT_HISTORY_ITEM_HASH_VERSION,TE as CURRENT_HISTORY_RECORD_HASH_VERSION,Zn as CURRENT_ITEM_FORMAT_VERSION,kP as ContextSignalStore,dS as ContextUsageValidationError,nP as DEFAULT_AUTHOR_IDENTITY_VOCABULARY,XP as DEFAULT_CHILD_SAMPLE_LIMIT,aO as DEFAULT_COMPACT_LIST_FIELDS,fw as DEFAULT_DERIVED_INDEX_MINIMUM_ITEMS,Om as DEFAULT_EVAL_QUERIES_RELATIVE_PATH,YI as DEFAULT_TERMINAL_TRANSITION_POLICY,DP as DEFAULT_WORKSPACE_MEMORY_MINIMUM_ITEMS,Pv as DEFECT_ESCAPE_CLASSES,Mv as DEFECT_GATE_EVIDENCE_DISPOSITIONS,zs as DELETE_FLAG_CONTRACTS,jo as DEPENDENCY_KIND_VALUES,Sa as DEPS_FLAG_CONTRACTS,ss as DOCS_FLAG_CONTRACTS,na as DUPLICATES_FLAG_CONTRACTS,mI as DURABLE_MERGE_RECEIPT_INTRODUCED_AT,wa as EVAL_FLAG_CONTRACTS,Cm as EVAL_METRIC_NAMES,wm as EVAL_QUERY_SET_CONTRACT,Am as EVAL_QUERY_SET_EXAMPLE,Em as EVAL_QUERY_SET_SCHEMA_ID,ya as EVENTS_FLAG_CONTRACTS,Ys as EVENT_FLAG_CONTRACTS,ko as EXECUTABLE_COMMAND_ALIASES,ue as EXIT_CODE,Rs as EXTENSION_ACTIVATE_FLAG_CONTRACTS,Os as EXTENSION_ADOPT_ALL_FLAG_CONTRACTS,Ls as EXTENSION_ADOPT_FLAG_CONTRACTS,vM as EXTENSION_CAPABILITIES,Hb as EXTENSION_CAPABILITY_CONTRACT,zb as EXTENSION_CAPABILITY_CONTRACT_VERSION,Vb as EXTENSION_CAPABILITY_LEGACY_ALIASES,Qo as EXTENSION_CAPABILITY_REGISTRATION_SURFACES,Ns as EXTENSION_CATALOG_FLAG_CONTRACTS,Is as EXTENSION_DEACTIVATE_FLAG_CONTRACTS,vs as EXTENSION_DESCRIBE_FLAG_CONTRACTS,xs as EXTENSION_DOCTOR_FLAG_CONTRACTS,As as EXTENSION_EXPLORE_FLAG_CONTRACTS,ys as EXTENSION_FLAG_CONTRACTS,Cs as EXTENSION_INIT_FLAG_CONTRACTS,Es as EXTENSION_INSTALL_FLAG_CONTRACTS,Ms as EXTENSION_MANAGE_FLAG_CONTRACTS,Ps as EXTENSION_MIGRATE_FLAG_CONTRACTS,OM as EXTENSION_POLICY_MODES,RM as EXTENSION_POLICY_SURFACES,ks as EXTENSION_RELOAD_FLAG_CONTRACTS,PM as EXTENSION_SANDBOX_PROFILES,bs as EXTENSION_SCOPE_FLAG_CONTRACTS,IM as EXTENSION_TRUST_MODES,ws as EXTENSION_UNINSTALL_FLAG_CONTRACTS,tO as EXTERNAL_DEPENDENCY_RESOLUTION_STATUSES,Qv as EXTERNAL_DEPENDENCY_SOURCE_KIND,eO as EXTERNAL_DEPENDENCY_SOURCE_KIND_ALIAS,is as FILES_FLAG_CONTRACTS,ma as FOCUS_FLAG_CONTRACTS,ra as GC_FLAG_CONTRACTS,uO as GET_DEPTH_VALUES,Ca as GET_FLAG_CONTRACTS,Qi as GLOBAL_FLAG_CONTRACTS,mu as GRAPH_DURABLE_CACHE_MIN_ITEMS,pu as GRAPH_DURABLE_CACHE_VERSION,Ea as GRAPH_FLAG_CONTRACTS,Dw as GRAPH_QUERY_DEFAULTS,Le as GRAPH_SUBCOMMAND_VALUES,Ta as GUIDE_FLAG_CONTRACTS,ia as HEALTH_FLAG_CONTRACTS,us as HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS,NR as HISTORY_AUTHOR_ATTRIBUTION_BASELINE,jI as HISTORY_COMPACT_BULK_DEFAULT_MIN_ENTRIES,ps as HISTORY_COMPACT_FLAG_CONTRACTS,Oi as HISTORY_EVENT_CLASSIFICATION_VERSION,as as HISTORY_FLAG_CONTRACTS,QS as HISTORY_HASH_ALGORITHMS,uR as HISTORY_ITEM_HASH_VERSION_3_INTRODUCED_IN,ds as HISTORY_REDACT_FLAG_CONTRACTS,ls as HISTORY_REPAIR_FLAG_CONTRACTS,qd as INIT_AGENT_GUIDANCE_MODE_VALUES,hs as INIT_FLAG_CONTRACTS,Ds as INSTALL_FLAG_CONTRACTS,qo as ISSUE_SEVERITY_VALUES,la as ITEM_COMPLETE_FLAG_CONTRACTS,nI as ITEM_LATEST_TIMESTAMP_FIELDS,Kb as ITEM_METADATA_KEY_ORDER,da as ITEM_MUTATE_FLAG_CONTRACTS,ua as ITEM_REOPEN_FLAG_CONTRACTS,JR as ITEM_SCALAR_MISSING_VALUE,Go as ITEM_TYPE_VALUES,oI as ITEM_UNION_COLLECTION_FIELDS,MP as JsonFileContextSignalStoreAdapter,ns as LEARNINGS_FLAG_CONTRACTS,eE as LEGACY_HISTORY_HASH_ALGORITHM,Ju as LINKED_TEST_ENV_NAME_PATTERN,Zu as LINKED_TEST_PM_CONTEXT_MODE_VALUES,Yu as LINKED_TEST_PROTECTED_ENV_KEYS,Qu as LINKED_TEST_WORKSPACE_CONTEXT_MODE_VALUES,qa as LIST_COMMANDER_STRING_OPTION_CONTRACTS,dO as LIST_COMMAND_DEFAULT_PROJECTIONS,kM as LIST_FILTER_EXTENSION_FLAG_DEFINITIONS,es as LIST_FILTER_FLAG_CONTRACTS,_O as LIST_SORT_FIELDS,hO as LIST_SORT_ORDER_VALUES,Ri as MAINTENANCE_HISTORY_OPERATIONS,WP as MAX_CHILD_PROJECTION_ITEMS,AT as MAX_WORKFLOW_POLICIES,vT as MAX_WORKFLOW_POLICY_TERMS,Xs as MEET_FLAG_CONTRACTS,_M as MERGE_DRIVER_ARTIFACT_VALUES,cs as MERGE_FLAG_CONTRACTS,De as MERGE_SUBCOMMAND_VALUES,yM as MUTATION_EVENT_WIRE_BUDGET,ne as MemoryRelationshipGraphAdapter,Ka as NEXT_COMMANDER_STRING_OPTION_CONTRACTS,va as NEXT_FLAG_CONTRACTS,zp as NEXT_OUTPUT_VALUES,os as NOTES_FLAG_CONTRACTS,Ts as PACKAGE_FLAG_CONTRACTS,Ss as PACKAGE_INIT_FLAG_CONTRACTS,Ks as PAUSE_TASK_FLAG_CONTRACTS,Gc as PLAN_CREATE_METADATA_PARAMETER_KEYS,_s as PLAN_FLAG_CONTRACTS,Qp as PLAN_SHOW_DEPTH_VALUES,Ve as PLAN_SUBCOMMANDS,em as PLAN_TEMPLATE_NAMES,Ay as PM_AGENT_TASK_ACCOUNTING_MODES,dt as PM_AGENT_TASK_TRANSCRIPT_VERSION,Ro as PM_BULK_LIFECYCLE_COMMAND_ALIASES,Ni as PM_CLI_EXPECTED_ERROR_NAME,Bw as PM_CLI_GRAMMAR_CONTRACT,$w as PM_CLI_GRAMMAR_NOUNS,bn as PM_CLI_ONLY_TOOL_ACTION_WAIVERS,Fw as PM_CLI_SHARED_VERBS,Mo as PM_COMMAND_ALIAS_CONTRACTS,ee as PM_COMMAND_CAPABILITY_CONTRACTS,At as PM_COMMAND_DESTINATION_CONTRACTS,kO as PM_COMMAND_EXIT_CONTRACTS,MO as PM_COMMAND_EXIT_OUTCOME_CONTRACTS,$n as PM_COMMAND_OUTPUT_BUDGET_CONTRACTS,RO as PM_COMMAND_OUTPUT_ENVELOPE_CONTRACTS,Ge as PM_COMMAND_POSITIONAL_CONTRACTS,pd as PM_COMMAND_VISIBILITY_CONTRACTS,RR as PM_COMPLETE_LIST_FINDING_CODES,NS as PM_CONTEXT_INTENTS_FILE,bS as PM_CONTEXT_INTENT_CONTRACTS,Oo as PM_CONTEXT_OPS_COMMAND_ALIASES,_n as PM_CORE_COMMAND_NAMES,F as PM_CORPUS_SHAPE_SCHEMA,Tn as PM_DEPRECATED_TOOL_ACTIONS,kn as PM_DIAGNOSTIC_DEGRADATION_STEPS,xn as PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS,Mn as PM_DIAGNOSTIC_OUTPUT_CLASSES,Sn as PM_DISCOVERABLE_TOOL_ACTIONS,Vr as PM_EPISODE_SCHEMA,vO as PM_ERROR_CODE_CATALOG,SO as PM_ERROR_CODE_EXIT_CLASS_CONTRACTS,Jr as PM_EXACT_COVERAGE_METRICS,dn as PM_EXTENSION_CAPABILITY_CONTRACTS,hn as PM_EXTENSION_PACKAGE_ACTION_SUBCOMMANDS,un as PM_EXTENSION_POLICY_MODE_CONTRACTS,fn as PM_EXTENSION_POLICY_SURFACE_CONTRACTS,mn as PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS,ln as PM_EXTENSION_SERVICE_NAME_CONTRACTS,pn as PM_EXTENSION_TRUST_MODE_CONTRACTS,bR as PM_GITATTRIBUTES_END,yR as PM_GITATTRIBUTES_START,TR as PM_GITATTRIBUTES_V2_END,CR as PM_GITATTRIBUTES_V2_START,Cd as PM_GITIGNORE_END,bd as PM_GITIGNORE_START,VI as PM_HISTORY_ATTESTATION_CONTRACT,vo as PM_HISTORY_COMMAND_ALIASES,KS as PM_HISTORY_OPERATION_ALIASES,XS as PM_HISTORY_OPERATION_CONTRACT,WS as PM_HISTORY_OPERATION_PATTERNS,yn as PM_ITEM_ACTION_SUBCOMMANDS,VS as PM_ITEM_HISTORY_OPERATIONS,rt as PM_MCP_APPS_EXTENSION,Rr as PM_MCP_APPS_SERVER_CAPABILITY,Te as PM_MCP_APPS_SPEC_VERSION,Mr as PM_MCP_APP_CONTRACTS,Pr as PM_MCP_APP_MIME_TYPE,mb as PM_MCP_ENTRY_TOOL_NAMES,m as PM_MCP_ERROR_CODES,Ox as PM_MCP_HTTP_PROTOCOL_VERSION,Dh as PM_MCP_INPUT_REQUEST_METHODS,Jk as PM_MCP_LEGACY_PROTOCOL_VERSIONS,er as PM_MCP_LOG_LEVELS,w as PM_MCP_META_KEYS,SD as PM_MCP_PROGRESSIVE_DISCOVERY_EXTENSION,ED as PM_MCP_PROGRESSIVE_DISCOVERY_SERVER_CAPABILITY,gd as PM_MCP_PROMPT_CONTRACTS,z as PM_MCP_PROTOCOL_VERSION,hd as PM_MCP_RESOURCE_CONTRACTS,nt as PM_MCP_SKILLS_DRAFT_REVISION,kr as PM_MCP_SKILLS_EXTENSION,Bg as PM_MCP_SKILLS_SERVER_CAPABILITY,P as PM_MCP_SKILL_LIMITS,be as PM_MCP_SUBSCRIPTION_ID_META_KEY,Ke as PM_MCP_SUPPORTED_PROTOCOL_VERSIONS,bx as PM_MCP_TASKS_EXTENSION,Kh as PM_MCP_TASK_STATUSES,pe as PM_MCP_TOOL_COMMAND_CONTRACTS,XC as PM_MODE_PAIRED_OUTPUT_PROJECTION_CONTRACTS,ic as PM_MUTATION_ACTION_CONTRACTS,Pe as PM_NAMESPACED_COMMAND_ALIASES,qr as PM_OBSERVATION_SCHEMA,Pn as PM_OUTPUT_BUDGET_CLASSES,In as PM_OUTPUT_DEGRADATION_STEPS,Mt as PM_OUTPUT_ENVELOPE_KINDS,Dt as PM_PACKAGE_CONVENTIONAL_RESOURCE_ROOTS,gn as PM_PACKAGE_ONLY_ACTION_SUBCOMMANDS,Lt as PM_PACKAGE_RESOURCE_KINDS,Fe as PM_POSITIONAL_ACTION_CONTRACTS,Kc as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA,Vc as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION,WT as PM_READ_OUTPUT_COMPOSITION_OPTION_FLAGS,LT as PM_READ_OUTPUT_CONTINUATION_FINGERPRINT_POLICIES,VT as PM_READ_OUTPUT_DIMENSIONS,KT as PM_READ_OUTPUT_OPTION_FLAGS,UT as PM_READ_OUTPUT_SESSION_MAX_SEEN_ITEM_IDS,GT as PM_READ_OUTPUT_SESSION_MIN_TOKENS,HT as PM_READ_OUTPUT_SURFACES,XT as PM_READ_OUTPUT_SURFACE_CONTRACTS,WC as PM_READ_ROW_CONTRACTS,KC as PM_READ_ROW_JQ_SELECTOR,bN as PM_RECOVERY_REFERENCE_FIELDS,ae as PM_RECOVERY_REFERENCE_KINDS,Xy as PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE,ao as PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE_V2,vN as PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE,so as PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE_V2,Io as PM_RELOCATED_COMMAND_ALIASES,Qa as PM_REPRODUCIBLE_PROCESS_ENV,xO as PM_SUCCESS_EXIT_CODES,Cn as PM_TOOL_ACTIONS,jc as PM_TOOL_ACTION_PARAMETER_CONTRACTS,Hc as PM_TOOL_PARAMETERS_SCHEMA,zc as PM_TOOL_PARAMETERS_SCHEMA_MAJOR,qc as PM_TOOL_PARAMETERS_SCHEMA_VERSION,$c as PM_TOOL_RESERVED_CUSTOM_FIELD_PROPERTIES,zr as PM_VERDICT_SCHEMA,HS as PM_WORKSPACE_HISTORY_OPERATIONS,jr as PM_WORKSPACE_RECIPE_SCHEMA,fs as PROFILE_FLAG_CONTRACTS,Yt as PROFILE_LINT_CODES,Xt as PROFILE_LINT_DIMENSIONS,Bt as PROFILE_NAMES,He as PROFILE_SUBCOMMANDS,b as PmCliError,me as PmClient,IR as PmCompleteListValidationError,y as PmMcpAuthorizationError,tr as PmMcpInputRequiredError,Er as PmMcpIssuerCredentialStore,p as PmMcpProtocolError,rr as PmMcpRequestStateReplayGuard,Fr as PmMcpSkillRegistry,mr as PmMcpSubscriptionRegistry,et as PmMcpTaskStore,uT as QUERY_CURSOR_CONTRACT,Fs as REINDEX_FLAG_CONTRACTS,zA as REINDEX_LOCK_ID,ct as RELATIONSHIP_GRAPH_SNAPSHOT_VERSION,Vs as RELEASE_FLAG_CONTRACTS,Js as REMIND_FLAG_CONTRACTS,wt as RESERVED_ITEM_FIELD_NAMES,qs as RESTORE_FLAG_CONTRACTS,Bo as RISK_VALUES,Ow as RelationshipEventLog,Rw as RelationshipEventStore,q as RelationshipGraph,ke as RelationshipKindRegistry,ms as SCHEMA_FLAG_CONTRACTS,za as SEARCH_COMMANDER_STRING_OPTION_CONTRACTS,xM as SEARCH_EXTENSION_FLAG_DEFINITIONS,Oa as SEARCH_FLAG_CONTRACTS,gp as SEMANTIC_ATTRIBUTION_LIMITS,Yb as SETTINGS_DEFAULTS,km as SNAPSHOT_SCHEMA,cR as SOURCE_CONTEXT_ACCESS_ENV,dR as SOURCE_CONTEXT_WRITE_OVERRIDE_ENV,Hs as START_TASK_FLAG_CONTRACTS,oa as STATS_FLAG_CONTRACTS,Uo as STATUS_VALUES,Zi as SUBCOMMAND_GLOBAL_FLAG_CONTRACTS,Ii as SUBSTANTIVE_HISTORY_OPERATIONS,CE as SUPPORTED_HISTORY_ITEM_HASH_VERSIONS,SE as SUPPORTED_HISTORY_RECORD_HASH_VERSIONS,Nb as SUPPRESS_HOST_OUTPUT_MARKER,ea as TELEMETRY_FLAG_CONTRACTS,af as TELEMETRY_SUBCOMMANDS,Qs as TEST_ALL_FLAG_CONTRACTS,Zs as TEST_FLAG_CONTRACTS,ta as TEST_RUNS_FLAG_CONTRACTS,tf as TEST_RUN_MEASUREMENT_LIMIT,xc as TOOL_ACTIVITY_OPTION_CONTRACTS,Tc as TOOL_AGGREGATE_OPTION_CONTRACTS,Ic as TOOL_BULK_MUTATION_FILTER_OPTION_CONTRACT_SOURCE,kc as TOOL_CALENDAR_OPTION_CONTRACTS,Mc as TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS,Nc as TOOL_CONTEXT_OPTION_CONTRACTS,vc as TOOL_CREATE_OPTION_CONTRACTS,Ac as TOOL_CREATE_OPTION_CONTRACT_SOURCE,Lc as TOOL_DEPS_OPTION_CONTRACTS,Dc as TOOL_GRAPH_OPTION_CONTRACTS,Cc as TOOL_LIST_FILTER_OPTION_CONTRACTS,Sc as TOOL_SEARCH_FILTER_OPTION_CONTRACTS,wc as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS,Ec as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACT_SOURCE,Pc as TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS,Rc as TOOL_UPDATE_OPTION_CONTRACTS,Oc as TOOL_UPDATE_OPTION_CONTRACT_SOURCE,Xb as TYPE_TO_FOLDER,tA as UNKNOWN_SUBCOMMAND_COMPATIBILITY_CODES,Jc as UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,Qc as UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,Zc as UPDATE_COMMANDER_STRING_OPTION_CONTRACTS,fa as UPDATE_FLAG_CONTRACTS,_a as UPDATE_MANY_FLAG_CONTRACTS,$s as UPGRADE_FLAG_CONTRACTS,sa as VALIDATE_FLAG_CONTRACTS,wT as WORKFLOW_POLICY_ACTIONS,wR as WORKFLOW_POLICY_DOCUMENT_SCHEMA,ER as WORKFLOW_POLICY_SCHEMA,Aa as WORKSPACE_FLAG_CONTRACTS,jE as WORKSPACE_HISTORY_ID,xm as WORKSPACE_SNAPSHOT_ACTIONS,hl as WorkspaceGraphCache,xw as WorkspaceTransactionInterruptedError,ju as _testOnly,KP as _testOnlyAggregateCommand,fl as _testOnlyConfigCommand,QP as _testOnlyGetCommand,Ou as _testOnlyHealthCommand,Kd as _testOnlyInit,zd as _testOnlyInitAgentGuidance,QM as _testOnlyItemTransaction,SM as _testOnlyMutationEvents,zP as _testOnlyNextCommand,fM as _testOnlySearchCommand,GR as _testOnlySimilarity,nm as _testOnlyTemplates,Fu as _testOnlyValidateCommand,AM as _testOnlyWorkspacePosition,VR as acceptAssuranceProposals,Du as acknowledgeLinkedTests,ul as acknowledgeUnknownAuthorHistoryEvents,ll as acknowledgeUnknownAuthorHistoryEventsFromTransport,_w as acquireItemMetadataDerivedIndexLock,$e as acquireLock,uk as activateExtensionForTest,SC as activateExtensions,li as agentSessionEnvironment,s_ as aggregate,zm as analyzeAgentProvenanceDescriptorCoverage,xv as analyzeDefectChangeRisk,NI as analyzeDefectRecurrenceCoverage,Gl as analyzeDuplicateItems,Pw as analyzeGraphImpact,rd as analyzeHierarchyIntegrity,Mw as analyzeKnowledgeGraph,LO as analyzePmCommandExitConformance,En as analyzePmToolActionParity,TI as analyzeReconciliationDiscard,Iw as analyzeRelationshipExecution,nu as analyzeRelationshipSchedule,Ph as analyzeSdkActionCoverage,It as analyzeSdkCliParameterCompleteness,y_ as append,ki as appendHistoryEntry,VE as appendWorkspaceAuditEvent,zE as appendWorkspaceHistoryChange,sA as applyAcceptanceCriteriaMutations,qR as applyAssurancePreset,Da as applyBootstrapPagerPolicy,II as applyClosureTimestampFix,wS as applyContextIntentProjection,qp as applyContextTagProjection,gO as applyFilterValueEcho,rw as applyHistoryPatch,Za as applyInvocationAuthorOverride,Al as applyPathMigrations,oS as applyReadOutputDimensions,QT as applyReadOutputIncludeModes,BT as applyReadOutputSessionReferences,cw as applyRegisteredItemFieldDefaultsAndValidation,Il as applyStandaloneNote,Ki as applyStoredExtensionMigrationState,cA as applyTagRemovals,eP as applyTerminalOrderingPolicy,Pl as artifactKey,qb as asRecordClone,Bb as asRecordOrNull,je as assembleWorkspaceRelationshipGraph,xR as assertCompleteListResult,Vk as assertExtensionBlueprint,zk as assertExtensionCapabilityUsage,vk as assertExtensionDeactivated,Wk as assertExtensionManifestCompatible,Kk as assertExtensionManifestMatchesBlueprint,Xk as assertExtensionPreflight,id as assertHierarchyMutationAllowed,BI as assertHistoryCompactTarget,EI as assertHistoryRepairTarget,Wn as assertInitializedTracker,vl as assertLinkedArtifactMutationIsUnambiguous,Qk as assertMcpClientCapabilities,Zk as assertMcpProtocolHeader,wy as assertMemoryRelationshipGraphAdapterConformance,uA as assertNoUnknownCsvKeys,Ok as assertPackageManifest,IA as assertParentReferenceIsNotSelf,o0 as assertPmMcpSkillsCapability,Hk as assertProjectProfile,gR as assertProjectRuntimeCompatibility,YC as assertProjectionModeChoice,Kn as assertReadableTrackerRoot,Rk as assertRegisteredCommandContract,Fk as assertRegisteredCommandOverride,Nk as assertRegisteredExporter,Ik as assertRegisteredFlags,Pk as assertRegisteredHook,xk as assertRegisteredImporter,Lk as assertRegisteredItemField,Dk as assertRegisteredItemType,qk as assertRegisteredMigration,Gk as assertRegisteredParserOverride,Uk as assertRegisteredPreflightOverride,$k as assertRegisteredProfile,jk as assertRegisteredRendererOverride,Mk as assertRegisteredSearchProvider,Bk as assertRegisteredServiceOverride,kk as assertRegisteredVectorStoreAdapter,kb as assertRelationshipEdgeAllowed,eo as assertRelationshipGraphAdapterConformance,Yw as assertSchemaPreviewSupported,VO as assuranceAssertionUpdateIsLoosening,OS as attachContextIntentReceipt,lS as attachContextUsageServingReceipt,ku as attachLinkedTestMutationProvenance,Mu as attachLinkedTestProvenance,Xe as attachMcpServerInfo,rT as attachOutputOmissionReceipt,IS as attachOutputTokenAccounting,RS as attachReadOutputContracts,qT as attachReadOutputSessionReceipt,Od as auditMergeAttributeFence,SR as auditMergeDriverConfiguration,lu as auditWorkspaceRelationshipGraph,Bx as authorizeMcpHttpRequest,ci as boundAgentEpisodeIdentity,CT as boundReadOutputRows,Gp as buildChildrenByParent,cM as buildCompactSearchFilterSummary,yO as buildContentFilterEcho,PP as buildContextSignalSnapshot,ay as buildCorpusShapeItemPlan,kv as buildDefectRecurrenceIndex,$d as buildExtensionDescribeResult,Gd as buildExtensionInstallPlan,bO as buildGovernanceMissingFilterEcho,$A as buildInvalidTypeError,YP as buildItemChildrenRollup,JM as buildItemCompletionMutations,fP as buildItemContextRelevanceCandidates,Tw as buildItemNotFoundError,ZP as buildItemSchedule,PI as buildLinkedFileRepairReport,xx as buildMcpAuthorizationDiscoveryUrls,Nh as buildMcpCompleteResult,tx as buildMcpDiscoverResult,Fx as buildMcpDynamicRegistrationMetadata,Ax as buildMcpHttpRequestHeaders,sx as buildMcpInputRequiredResult,kx as buildMcpProtectedResourceMetadata,Ad as buildMergeAttributePatterns,Bc as buildPmActionToolInputSchema,IN as buildPmRefusalClosureCensus,FR as buildRelationshipContext,WA as buildSearchCorpus,YA as buildSemanticCorpusInput,vI as buildStatusRoleWarnings,Hn as buildTrackerInitializationRecovery,tv as buildVectorizationEmbeddingIdentity,rv as buildVectorizationEmbeddingMetadata,dM as buildVerboseSearchFilters,AR as buildWorkflowCompletenessCheck,$P as buildWorkspaceMemorySnapshot,ai as canonicalDocument,Qb as canonicalizeCommandOptionKey,GM as canonicalizeCommandSuggestions,pP as canonicalizeContextRecencyCoordinate,Ib as canonicalizeRelationshipKind,CN as censusPmRecoveryReferenceProducers,kR as certifyCompleteListResult,dk as checkExtensionManifestCompatibility,th as claim,rh as claimNext,LR as classifyHistoryAuthorEvent,Pi as classifyHistoryEvent,bI as classifyHistoryMergeReceiptReferences,uC as classifyHostEnvironmentFault,uM as classifyImplicitSemanticFallbackReason,ti as classifyItemFormatVersion,lf as classifyLinkedTestCommandSafety,uf as classifyLinkedTestFailure,GC as clearActiveExtensionHooks,yu as clearDurableGraphCache,_E as clearFocusedItem,yf as clearWorkspaceContractsCache,eh as close,zu as closeItem,lh as closeTask,Ga as coalesceRepeatedListFlags,Gv as collectBlockedByIds,jv as collectBlockedByIdsFromCorpus,pS as collectContextUsageDeliveredItemIds,dd as collectDanglingDependencyReferences,qv as collectDependencyBlockedIds,ad as collectDuplicateDependencyRows,du as collectDuplicateRelationshipEdgeGroups,lM as collectErrorCauseCodes,td as collectHierarchyRelations,br as collectMcpHeaderAnnotations,ld as collectMissingDependencyTargetIds,Xu as collectNewOrderingCycleWarnings,su as collectOrderingCycles,cd as collectOrderingStorageContradictions,$S as collectPackageContextIntentContracts,Ft as collectPackageExtensionDirectories,sw as collectRegisteredItemFieldNames,aE as collectRuntimeCreateFieldValues,FA as collectRuntimeFilterValues,cE as collectRuntimeUpdateFieldValues,Np as collectSubtreeIds,en as collectUsedExtensionCapabilities,eC as commandOptionFlagLabel,d_ as comments,Bf as commitImportedItem,ZM as commitItemCompletion,YM as commitItemMutations,Lw as commitWorkspaceTransaction,Ji as compactFlagAliasContracts,Lp as compareCriticalItems,pR as comparePmDateVersions,kw as compareRelationshipSnapshots,sS as compareTimestampStrings,dP as compileHistoryProvenanceMatcher,SS as composeContextIntentContracts,rk as composeExtension,ck as composeExtensionPackage,Vv as computeActionabilityReport,wA as computeHistoryDiff,ru as computeRelationshipCentrality,tu as computeRelationshipDominators,_l as computeWorkspaceGraphFingerprint,C_ as config,FC as consumeAfterCommandAffectedItems,e_ as context,vS as contextIntentRowId,nh as copy,pf as countFailureCategories,yT as countReadOutputRows,J_ as create,BR as createAssurancePreset,kI as createAssuranceWorkspaceContext,Jw as createCheckpointId,PR as createCompleteListOptions,EC as createCoreCommandHookContext,Yr as createCorpusShapeMeasurement,YO as createEmptyAssuranceDocument,cC as createEmptyExtensionRegistrationRegistry,zi as createExtensionCommandSdk,Zo as createExtensionContributionInventory,Yk as createExtensionTestHarness,Mi as createHistoryEntry,yv as createLazyModule,vR as createLifecycleCompletenessPolicies,qx as createMcpStaticBearerVerifier,Cx as createMcpTaskStore,Cw as createMutationGuardSdk,JC as createOutputOmissionReceipt,Li as createPmCliExpectedError,Vn as createPmCliProgram,Ln as createPmCommandOutputBudget,nT as createQueryFingerprint,Ey as createRelationshipGraphScaleFixture,J as createRelationshipGraphSnapshot,ht as createRelationshipKindRegistry,tc as createReproducibleProcessRunner,sM as createSearchCursorFingerprint,wC as createSerialQueue,gA as createStdinTokenResolver,rA as createUnknownSubcommandError,NT as createWorkflowPolicyEvaluator,Nm as createWorkspaceSnapshot,pk as deactivateExtensionForTest,gL as declineServiceOverride,AS as decodeContextIntentCursor,gv as decodeHtmlEntitiesInOptions,yr as decodeMcpHttpHeaderValue,cT as decodeQueryCursor,sT as decodeQueryCursorEnvelope,aT as decodeQueryCursorState,FT as decodeReadOutputContinuationCursor,Wx as decoratePmMcpToolsWithApps,kl as dedupeLinkedArtifacts,hP as defaultScoreContextCandidates,EL as defineAfterCommandHook,TL as defineBeforeCommandHook,SL as defineBeforeMutationHook,iL as defineCommand,pL as defineCommandOverride,K as defineCorpusShape,m0 as defineEpisodeSpecification,CL as defineExporter,ek as defineExtension,tk as defineExtensionBlueprint,oL as defineExtensionManifest,sL as defineFlag,bL as defineImporter,cL as defineItemField,aL as defineItemType,dL as defineMigration,Jg as defineObservationContract,vL as defineOnIndexHook,AL as defineOnReadHook,wL as defineOnWriteHook,mL as defineParserOverride,Dn as definePmCommandOutputBudget,OO as definePmCommandOutputEnvelope,EO as definePmErrorCodeCatalog,fL as definePreflightOverride,nL as defineProjectProfile,yL as defineRendererOverride,lL as defineSearchProvider,_L as defineServiceOverride,uL as defineVectorStoreAdapter,ty as defineVerdictContract,Se as defineWorkspaceRecipe,ih as deleteItem,Um as deleteWorkspaceSnapshot,xb as dependencyToRelationship,h_ as deps,zR as deriveAssuranceProposals,OI as deriveClosureTimestamp,nk as deriveExtensionCapabilities,DO as derivePmBulkMutationEffect,TN as derivePmRecoveryReferenceObligations,iu as deriveRelationshipDeadlines,Md as deriveSchemaEvolutionMigrationId,lv as deriveTelemetryCommandResolution,BA as describeAllowedTransitions,aR as describeExtensionActivation,ik as describeExtensionBlueprint,Sp as describeItemOwnershipConflict,p0 as describeObservationCost,Kt as describeProfileComposition,Wt as describeProjectProfile,US as describeUnknownError,Ci as detectAgentIdentity,wi as detectHarnessIdentity,Ql as detectRelationshipCommunities,Ti as diagnoseAgentIdentity,uu as diffRelationshipAuditSnapshots,nf as diffTestRunMeasurements,dx as digestMcpRequestParameters,CC as discoverExtensions,Ko as discoverNearbyPmRoot,AD as discoverPmTools,fR as discoverProjectRuntimeVersionPins,__ as docs,c_ as duplicates,fu as durableGraphCachePath,bu as durableGraphCacheStatus,Qn as effectiveItemFormatVersion,Ov as emitTelemetryErrorEvent,jf as emptyImportedDocument,QR as encodeItemScalarDecisionValue,gr as encodeMcpHttpHeaderValue,iT as encodeQueryCursor,$T as encodeReadOutputContinuationCursor,dw as enforceHistoryStreamPolicyForItem,lw as enforceHistoryStreamPolicyForItems,CO as enrichCliFlagInvocationContract,Pt as enrichCliFlagInvocationContracts,nw as ensureMaterializedHistoryTarget,Sd as ensurePmGitignore,Cl as ensureScope,dv as ensureSentryInit,Uf as ensureTrackerInitialized,Jl as enumerateRelationshipPaths,Gn as estimatePmOutputTokens,ZO as evaluateAssuranceAssertion,QO as evaluateAssuranceGate,M0 as evaluateBoundaryFixtures,CP as evaluateContextRanking,Nv as evaluateDefectGateEvidence,JO as evaluateMeasurement,Sm as evaluateMetricFloors,ac as evaluateMutationGuard,Ym as evaluateProvenanceCoverage,Km as evaluateSemanticAttributionCoverage,jl as evaluateSimilarityGovernance,jA as evaluateTransition,ry as evaluateVerdictContract,xT as evaluateWorkflowPolicies,nc as executeEmbeddingBatchesWithRetry,QA as executeVectorDelete,ev as executeVectorReset,ZA as executeVectorUpsert,Kg as executeWorkspaceRecipe,Rl as expandAddGlobEntries,ql as explainSourceTraceability,KI as exportAttestation,uh as extension,mh as extensionActivate,fh as extensionDeactivate,ph as extensionList,cb as extensionMigrate,yI as extractHistoryMergeReceiptDispositions,gI as extractHistoryMergeReceiptReferences,Gx as extractMcpTraceContext,ew as extractPatchFailureContext,Ru as extractReferencedPmItemIdsFromCommand,Sy as federateRelationshipGraphSnapshots,p_ as files,m_ as filesDiscover,f_ as filesLookup,mS as finalizeContextUsageDelivery,my as findCoverageDeficits,Ul as findDuplicateClusters,wd as findGitWorkspaceRoot,xE as findHistoryIdentityDiscontinuities,Ld as findInstalledNpmPackageCandidate,Kx as findPmMcpAppByUri,Po as findPmNamespacedCommand,eu as findRedundantRelationshipEdges,ou as findRelationshipCutStructure,Fl as findSimilarItems,vv as finishTelemetryCommand,_C as flattenFlagListValue,ly as flushTelemetryQueue,ah as focus,Zl as forEachMatchedRelationshipEdge,cu as formatDuplicateEdgeGroup,od as formatHierarchyRelation,au as formatOrderingStorageContradiction,jw as formatPmPositionalActionFlagTip,hm as formatProfileApplyHuman,_m as formatProfileLintHuman,mm as formatProfileListHuman,fm as formatProfileShowHuman,Nd as formatSchemaEvolutionMigrationHuman,mM as formatVectorIndexRecoveryWarnings,wM as formatWorkspacePositionHuman,V_ as gc,Gi as generateItemId,n_ as get,LC as getActiveCommandResult,CS as getActiveContextIntentContracts,rn as getActiveExtensionRegistrations,jx as getActiveMcpTraceContext,tR as getAssuranceDeclaration,Oh as getContracts,mE as getFocusedItem,Yo as getHistoryPath,vw as getItemAt,Xo as getItemPath,lc as getMutationActionContract,Td as getPmGitignoreBlock,Wo as getSettingsPath,bf as getWorkspaceContracts,BE as getWorkspaceHistoryPath,g_ as graph,_u as graphAuditBaselinePath,Wm as groupHistoryByEpisode,hL as handleServiceOverride,ex as hasMcpClientExtension,Hx as hasPmMcpAppsCapability,Ue as hasSubcommandFlagContractsForCommand,ov as hasVectorizationEmbeddingIdentityChanged,nv as hasVectorizationVectorDimensionChanged,PE as hashDocument,ME as hashDocumentForVersion,kE as hashEmptyDocument,wE as hashHistoryPatch,EE as hashHistoryRecord,AE as hashHistoryStream,eI as hashItemScalarDecisionValue,z_ as health,Kl as hierarchyAncestors,Wl as hierarchyDescendants,X_ as historyCompact,Y_ as historyCompactBulk,oE as historyDigest,cP as historyEntryMatchesProvenance,mR as historyItemHashVersionForRuntime,H_ as historyRedact,K_ as historyRepair,W_ as historyRepairAll,Uv as indexBlockedByIds,nd as indexHierarchyRelations,iv as inferConsistentVectorDimension,Nn as inferPmOutputBudgetClass,b_ as init,MR as inspectCompleteListResult,dC as inspectExtensionManifestSchema,il as inspectHistoryAuthorStream,cI as inspectMergeReceiptEvidence,hR as inspectProjectRuntimeCompatibility,gc as inspectStaleInProgressItems,Mh as inspectStaticExtensionInventory,AI as inspectStatusRoleAssignments,qE as inspectWorkspaceHistoryState,Lm as inspectWorkspaceSnapshot,Pd as installMergeFence,rx as interpretMcpResultType,Hp as isAlreadyClaimedError,qS as isCommanderError,el as isErrnoError,Rv as isExternalDependencyReference,Iv as isExternalDependencySourceKind,le as isFileMissingError,Db as isHostOutputSuppressed,ZR as isItemScalarMissingValue,fI as isLegacyMergeReceiptSummary,_ as isMcpRecord,cc as isMutationAction,Mb as isOrderingRelationshipKind,OA as isPlaceholderReferenceToken,Di as isPmCliExpectedError,An as isPmExtensionCapabilityContract,On as isPmExtensionPolicyModeContract,Rn as isPmExtensionPolicySurfaceContract,vn as isPmExtensionServiceNameContract,NO as isPmKnownExitCode,IO as isPmMutationReceipt,ze as isPmSuccessfulExitCode,wn as isPmToolAction,_I as isPreDurableCloneLocalReceiptSummary,hI as isPreDurableDispositionEligibleReference,_R as isProjectMutatingInvocation,bv as isPureSnakeCaseAlias,nS as isReadOutputBudgetExceeded,QC as isReadRowContract,Xd as isRuntimeRecord,Sv as isTerminalPlanMode,lE as isTerminalStatus,zn as isTimestampLiteral,KM as itemDocumentToMutationOptions,JP as itemHasSchedule,uc as jaccardSimilarity,u_ as learnings,aC as levenshteinDistanceWithinLimit,Jd as limitAnnotationEntries,xu as linkedTestTrustFingerprint,sk as lintExtensionBlueprint,lC as lintExtensionManifestSchema,Jt as lintProjectProfile,t_ as list,_i as listAgentProvenanceAdapters,Fa as listAliasPluralKeys,r_ as listAllComplete,yw as listAllDocumentCandidatesCached,qi as listAllItemMetadata,bw as listAllItemMetadataLight,eR as listAssuranceDeclarations,sR as listAssuranceVerdicts,iy as listBuiltinCorpusShapes,UM as listCoreClosedDomainContracts,pO as listGetProjectionFields,XR as listInvalidProvenanceHistoryStreamIds,lO as listListProjectionFields,dI as listMergeReceipts,dc as listMutationActions,bM as listMutationEvents,po as listPmCommandFlagBudgets,fd as listPmCommandsForFamily,md as listPmCommandsForTier,Oe as listPmFlagLexicon,QN as listPmFlagSpellingInventory,_d as listPmMcpToolsForProfile,BN as listPmRequiredArgumentRefusalContracts,qN as listPmSubcommandRefusalContracts,Ht as listProfiles,HN as listTrackerPreflightRecoveryContracts,Dm as listWorkspaceSnapshots,FS as loadContextIntentRuntimeLayers,im as loadCreateTemplateOptions,TC as loadExtensions,Tu as loadGraphAuditBaseline,Qw as loadMutationCheckpoint,x as loadRelationshipGraphAdapter,ji as locateItem,lA as looksLikeGenericKeyValueEntry,bT as mapReadOutputRows,lI as markMergeReceiptReconciled,GA as matchesRuntimeFilters,wv as maybeRunFirstUseTelemetryPrompt,cy as measureCorpusShapePlan,Ui as measureItemMetadataReadWork,aA as mergeAdditiveTags,ok as mergeExtensionBlueprints,tI as mergeHistoryStreams,iI as mergeItemDocuments,sI as mergeJsonDocuments,Ua as mergeLinkedTestTwoTokenEntries,rI as mergeRelationshipEventStreams,jp as mergeSortedWarnings,Tv as migrateItemFilesToFormat,Ew as mutateItem,Sw as mutateItemWithHistoryContext,HE as mutateWorkspaceJsonWithHistory,i_ as next,gi as normalizeAgentProvenanceAdapterValue,Yd as normalizeAnnotationTransportOptions,jO as normalizeAssuranceEvaluation,UO as normalizeAssuranceMutation,ja as normalizeBootstrapInvocation,TA as normalizeBulkIdsValue,sd as normalizeDependencyGraphTarget,iO as normalizeDependencySeedId,nO as normalizeDependencySourceKind,Jo as normalizeExtensionContributionInventory,ZS as normalizeHistoryOperationForWrite,WR as normalizeInvalidHistoryProvenance,Xw as normalizeItemAddressInvocation,ei as normalizeItemFormatVersion,Fi as normalizeItemId,ni as normalizeItemMetadata,sO as normalizeItemReference,$a as normalizeLegacyExtensionActionSyntax,Ol as normalizeLinkedPath,vA as normalizeParentReferenceValue,zt as normalizeProfileName,$i as normalizeRawItemId,eS as normalizeReadOutputIncludeModeOptions,$E as normalizeReplayPatchOps,pc as normalizeSimilarityText,dE as normalizeStatusForRegistry,oi as normalizeStatusInput,iE as normalizeStatusInputWithRegistry,BS as normalizeThrownExitCode,l_ as notes,qn as nowIso,hu as openDurableGraphCache,cx as openMcpRequestState,f0 as openPmEpisode,Xl as orderingPredecessors,Yl as orderingSuccessors,AP as packContextCandidates,Dp as packRankedContextItems,wh as packageActivate,Eh as packageCatalog,Ah as packageDeactivate,Th as packageDescribe,bh as packageDoctor,gh as packageInstall,_h as packageLifecycle,hh as packageList,Ch as packageManage,db as packageMigrate,Sh as packageReload,yh as packageUninstall,lT as paginateQueryRows,Tl as parseAddEntries,Sl as parseAddGlobEntries,Qd as parseAnnotationTextInput,zM as parseAtomicMutationControls,La as parseBootstrapCommandName,ka as parseBootstrapGlobalOptions,Na as parseBootstrapHelpRequest,Ba as parseBootstrapTypeValue,CA as parseBulkIdsText,kp as parseContextDepth,Rp as parseContextFocusFields,LS as parseContextIntentDeclarations,xp as parseContextSections,IP as parseContextSignalSnapshot,dA as parseCsvKv,Dv as parseDefectChangeRiskRequest,xI as parseDefectRecurrenceCoverageRequest,Lv as parseDefectRecurrencePolicy,Tm as parseEvalMetricFloors,vm as parseEvalQuerySet,wu as parseGraphSubcommand,HI as parseHistoryAttestation,sP as parseHistoryProvenanceFilters,Hv as parseIntegerLimit,uE as parseItemDocument,VM as parseItemMutationBatch,DA as parseLimit,cp as parseLinkedTestAssertionEqualsMap,dp as parseLinkedTestAssertionGteMap,rp as parseLinkedTestBoolean,op as parseLinkedTestContextMode,tp as parseLinkedTestEnvClear,ep as parseLinkedTestEnvSet,lp as parseLinkedTestJsonEntries,ap as parseLinkedTestMinLines,sp as parseLinkedTestRegexList,ip as parseLinkedTestStringList,np as parseLinkedTestWorkspaceContextMode,Gh as parseMcpCachePolicy,kh as parseMcpImplementation,Ze as parseMcpInputRequests,sr as parseMcpInputResponses,dg as parseMcpSubscriptionFilter,wl as parseMigrateEntries,Xv as parseMultiValueFilter,PO as parseMutationReceipt,bA as parseOptionalNonNegativeInteger,yA as parseOptionalNumber,mN as parsePmAgentTaskTranscriptCorpus,wD as parsePmToolDiscoveryOptions,Kv as parsePriority,Zv as parsePriorityFilterSet,jT as parseReadOutputSession,aw as parseRegisteredItemFieldAssignments,ie as parseRelationshipGraphSnapshot,El as parseRemoveEntries,Bl as parseSourceLineRange,kA as parseStatusFilterCsv,Yv as parseStringFilterSet,oc as parseTags,rf as parseTestRunMeasurements,Wv as parseType,Jv as parseTypeFilterSet,dl as parseUnknownAuthorHistoryEventCoordinates,OT as parseWorkflowPolicy,RT as parseWorkflowPolicyDocument,VP as partitionDecisionEntries,EA as patchPathToChangedField,Lo as pathExists,dh as pauseTask,gu as persistDurableGraphResult,JE as persistSelectedItemFormat,$R as planAgentIdentityVocabularyMutation,LP as planCompletedAtBackfill,Ud as planExtensionDirectoryCopy,Zt as planProfileApplication,gN as planRelationshipEventBackfill,Eu as planRelationshipRemediation,kd as planSchemaEvolutionMigration,al as planUnknownAuthorHistoryAcknowledgment,$m as planWorkspaceSnapshotRestore,zw as positionalShapeKey,Vw as positionalSignatureKey,lk as preflightExtension,fc as prepareSimilarityText,mA as preserveMutationStdinTokenFields,pA as preserveMutationStdinTokenLiterals,XM as previewItemMutations,xS as printError,kS as printResult,F_ as profile,j_ as profileApply,B_ as profileLint,G_ as profileList,U_ as profileShow,$C as projectAfterCommandItemSnapshot,Ip as projectContextFocusRows,ef as projectFleetAttributionAnalytics,aP as projectHistoryProvenance,jn as projectPmDiagnosticOutput,Bn as projectPmDiagnosticText,Zm as projectProvenanceCoverageAnalytics,$u as projectValidateCounts,HR as promoteAssuranceAssertion,uS as propagateContextUsageServingReceipt,$0 as pruneCompileCacheGenerations,rR as putAssuranceDeclaration,oR as putAssuranceDeclarationBundle,uw as queryItemMetadataIndex,pw as queryLinkedFileMetadataIndex,mw as querySimilarItemMetadataIndex,of as queryTestRunMeasurementsBelow,an as quoteCommandArg,sn as quoteWindowsCommandArg,FM as rankCommandPaths,Zd as readAnnotationEntries,Si as readAuthorEnvironment,Tf as readBooleanOption,yS as readContextUsageAffinity,Sf as readCsvListOption,Hi as readExtensionMigrationState,Do as readFileIfExists,Xa as readFirstStringFromCommanderOptions,Ya as readFirstValueFromCommanderOptions,Xm as readHistoryAnalyticsWindow,yE as readHistoryEntries,vi as readHistorySnapshot,Bm as readImprovementLedger,hw as readItemMetadataDerivedIndexState,Bi as readLocatedItem,gT as readOutputBudgetCollections,DT as readOutputCollectionFingerprint,hT as readOutputContinuationRowCollections,fT as readOutputContinuationRowPaths,ZT as readOutputIncludeModeOptions,_T as readOutputRowCollections,mT as readOutputRowPaths,zT as readOutputSessionRemainingTokens,$t as readPmPackageManifest,gf as readRequiredString,xi as readSettings,ZE as readSettingsWithMetadata,Ja as readStringArrayFromCommanderOptions,Cf as readStringOption,jS as readThrownExitCode,sv as readVectorizationStatusLedger,iw as readWorkflowPolicies,IT as readWorkflowPolicyField,DS as readWorkspaceContextIntentContracts,xP as readWorkspaceContextSignals,FP as readWorkspaceMemory,EM as readWorkspacePosition,UE as reanchorHistoryEntries,tn as reconcileExtensionCapabilityUsage,WE as reconcileWorkspaceJsonHistory,DC as recordAfterCommandAffectedItem,iR as recordAssuranceVerdict,fp as recordClaimSemanticAttribution,_S as recordContextUsageDelivery,fS as recordContextUsageServing,hS as recordContextUsageTouch,gS as recordContextUsageTouches,hp as recordFocusSemanticAttribution,jm as recordImprovementObservation,_p as recordReleaseSemanticAttribution,gw as refreshItemMetadataDerivedIndex,Rd as refreshMergeAttributeFenceIfInstalled,ST as refreshReadOutputDeliveredCounts,cv as refreshSearchArtifactsForMutation,hi as registerAgentProvenanceAdapters,rO as registerExternalDependencyResolver,fi as registerHarnessSignalDescriptors,HC as registerOutputMaterialFieldGroups,oh as release,TT as rememberReadOutputFocusRows,nR as removeAssuranceDeclaration,$o as removeFileIfExists,Ll as renameArtifactsResultKey,wp as renderCalendarMarkdown,Ap as renderCalendarToon,Bp as renderContextMarkdown,Fd as renderExtensionDescribeMarkdown,Dd as renderExtensionSurfaceMarkdown,Vf as renderGuideMarkdown,DM as renderMissingOptionRetry,HP as renderNextMarkdown,jM as renderPmClosedDomainHelp,cn as renderPmCommand,No as renderPmCommandAliasMigrationHint,yd as renderPmCommandVisibilityMarkdown,tL as renderPmFlagLexiconMarkdown,Xx as renderPmMcpAppHtml,PN as renderPmRefusalClosureCensusMarkdown,NA as renderRowsAsCsv,LA as renderRowsAsTable,Q_ as reopen,ow as replayHistoryToTarget,LE as replayToCanonicalItemDocument,NE as replayToItemDocument,JS as requireHistoryOperation,ZI as requireTerminalReason,QI as requireTerminalReasonWithRecovery,RE as resealHistoryRewrite,kC as resetActiveExtensionRuntimeState,yl as resetWorkspaceGraphCache,di as resolveAgentSessionContextFromSignals,nl as resolveAnnotationIndex,tl as resolveAnnotationInput,gE as resolveAuthor,Ai as resolveAuthorIdentity,AA as resolveBodyFileContent,sy as resolveBuiltinCorpusShape,Ep as resolveCalendarOutputFormat,wO as resolveCanonicalPmErrorCodeContract,Pb as resolveCanonicalRelationshipKind,hE as resolveClaimPrincipal,SA as resolveCliBulkIdsInput,oC as resolveCommandOptionPolicyState,D0 as resolveCompileCacheGeneration,NP as resolveCompletionTimestamp,Gb as resolveConfiguredPmPackageRoot,fO as resolveContentFieldFilters,ES as resolveContextIntentContract,Pp as resolveContextOutputFormat,Mp as resolveContextTokenBudget,tP as resolveCreateExplicitEmptyFlag,rM as resolveEffectiveSearchMode,HA as resolveEmbeddingProviders,jd as resolveExtensionInstallSourceIdentity,Vi as resolveExtensionMigrationStatePath,bC as resolveExtensionRoots,oO as resolveExternalDependencyReference,fC as resolveFlagValueKind,sC as resolveGlobalPmRoot,qf as resolveGuideOutputFormat,qm as resolveHistoryEpisodeGroupIdentity,rE as resolveHistoryHashAlgorithm,YS as resolveHistoryOperation,iP as resolveHistoryProvenanceDimensions,ww as resolveHistorySubject,tw as resolveHistoryTarget,nM as resolveHybridSemanticWeight,Ho as resolveImplicitPmRoot,aS as resolveIsoOrRelative,Bv as resolveItemBlockers,$v as resolveItemExecutionRole,HM as resolveItemMutationDocument,Vo as resolveItemTypeRegistry,nE as resolveItemTypesFilePath,mf as resolveLinkedTestFailureExitCode,Iu as resolveLinkedTestSourceRef,Pu as resolveLinkedTestSourceWorkspaceRoot,Nu as resolveLinkedTestTrust,Lu as resolveLinkedTestTrustBatch,lg as resolveMcpAcknowledgedSubscriptionFilter,We as resolveMcpRequestContext,Ed as resolveMergeInstallContext,mO as resolveMissingMetadataFilters,LM as resolveMissingOptionPlaceholder,ZC as resolveModePairedOutputOmissionReceipt,qP as resolveNextOutputFormat,tT as resolveOutputOmissionReceipt,Fb as resolvePmCliVersion,xo as resolvePmCommandAlias,Be as resolvePmCommandCapabilityFamily,xt as resolvePmCommandExitContract,N as resolvePmCommandOperation,Fn as resolvePmCommandOutputBudget,kt as resolvePmCommandOutputEnvelope,Gw as resolvePmCommandPositionalContract,qe as resolvePmCommandVisibilityTier,Un as resolvePmDiagnosticOutputBudget,AO as resolvePmErrorCodeContract,nb as resolvePmFlagSemanticConcept,Me as resolvePmHistoryOperation,$b as resolvePmPackageRootFromModule,Uw as resolvePmPositionalActionContract,Pa as resolvePmPositionalActionFlagContracts,Ne as resolvePmRoot,Fc as resolvePmToolCustomFieldCollision,PA as resolvePriority,Vt as resolveProfile,vd as resolveProjectMergeTypeFolders,dT as resolveQueryCursorStart,tS as resolveReadOutputDimensions,iS as resolveReadOutputEncoding,ET as resolveReadOutputRecoveryBudget,YT as resolveReadOutputSurface,eT as resolveReadRowContract,NM as resolveRecoveryCommandName,oA as resolveRegisteredSearchProvider,nA as resolveRegisteredVectorStoreAdapter,ec as resolveReproducibleProcessEnvironment,Yn as resolveRuntimeFieldRegistry,Xn as resolveRuntimeStatusRegistry,KA as resolveSearchCorpusFields,tM as resolveSearchMaxResults,aM as resolveSearchPage,oM as resolveSearchScoreThreshold,iM as resolveSearchTuning,XA as resolveSemanticCorpusCharacterLimit,mp as resolveSemanticLineageIds,qA as resolveSettingsWithSemanticRuntimeDefaults,lR as resolveSourceContextWritePolicy,Cp as resolveStartTaskInProgressStatus,Q as resolveSubcommandFlagContractsForCommand,Jb as resolveTelemetryErrorCategory,JI as resolveTerminalReason,rC as resolveTypeDefinition,tC as resolveTypeName,xA as resolveTypeSynonym,UA as resolveTypeWorkflows,cl as resolveUnknownAuthorAcknowledgmentSelector,pM as resolveVectorIndexRecovery,JA as resolveVectorStores,ed as resolveWorkspaceRelationshipKindRegistry,iC as resolveWorkspaceRoot,sh as restore,eA as restoreCheckpointItems,XE as restoreWorkspaceJsonFromHistory,Gm as restoreWorkspaceSnapshot,Fm as restoreWorkspaceSnapshotWithRecovery,Ih as runAction,UC as runActiveBeforeMutationHooks,BC as runActiveCommandHandler,jC as runActiveOnIndexHooks,nn as runActiveOnReadHooks,on as runActiveOnWriteHooks,qC as runActiveParserOverride,zC as runActivePreflightOverride,VC as runActiveServiceOverride,Op as runActivity,yC as runAfterCommandHooks,gm as runAggregate,ol as runAnnotationCommand,qu as runAppend,$I as runAssuranceAction,FI as runAssuranceDispatch,gC as runBeforeCommandHooks,vp as runCalendar,Kp as runClaim,Wp as runClaimNext,Vu as runClose,Ku as runCloseMany,Zp as runCloseTask,pl as runComments,Hf as runCompletion,ml as runConfig,jt as runContext,EP as runContextEvaluationCorpus,TP as runContextEvaluationScenario,Wu as runCopy,up as runCreate,pp as runDelete,bl as runDeps,Dl as runDocs,UR as runDuplicates,Rm as runEval,Pm as runEvent,Bd as runExtension,Xi as runExtensionMigrateAction,Wi as runExtensionMigrations,zl as runFiles,Hl as runFilesDiscover,Vl as runFilesLookup,Qm as runFleetAttributionAnalytics,bp as runFocus,Uu as runGc,ym as runGet,Au as runGraph,zf as runGuide,vu as runHealth,eM as runHistory,XI as runHistoryAttest,UI as runHistoryCompact,qI as runHistoryCompactBulk,CI as runHistoryMaintenance,zI as runHistoryRedact,SI as runHistoryRepair,wI as runHistoryRepairAll,Wd as runInit,Vd as runInitAgentGuidance,Bu as runLearnings,Nl as runLinkedArtifacts,ff as runLinkedTests,ud as runList,Im as runMeet,hM as runMergeDriver,Id as runMergeInstall,pI as runMergeReceiptEvidenceReport,uI as runMergeReceiptReport,gM as runMergeReconcile,Vp as runNext,om as runNotes,Jp as runPauseTask,tm as runPlan,pm as runProfileApply,um as runProfileLint,dm as runProfileList,lm as runProfileShow,Jm as runProvenanceCoverageAnalytics,mk as runRegisteredCommandForTest,yk as runRegisteredCommandOverrideForTest,Ak as runRegisteredExporterForTest,_k as runRegisteredHookForTest,wk as runRegisteredImporterForTest,Ek as runRegisteredMigrationForTest,fk as runRegisteredMutationGuardForTest,hk as runRegisteredParserOverrideForTest,gk as runRegisteredPreflightOverrideForTest,bk as runRegisteredRendererOverrideForTest,Tk as runRegisteredSearchProviderForTest,Ck as runRegisteredServiceOverrideForTest,Sk as runRegisteredVectorStoreAdapterForTest,Qt as runReindex,Xp as runRelease,Mm as runRemind,oP as runReopen,Hu as runRestore,xd as runSchemaEvolutionMigration,bm as runSearch,dy as runSearchRefreshWorkerEntrypoint,Kf as runStartBackgroundRun,Yp as runStartTask,sf as runStats,cf as runTelemetry,am as runTemplatesList,sm as runTemplatesSave,cm as runTemplatesShow,_f as runTest,hf as runTestAll,Wf as runTestRunsList,Yf as runTestRunsLogs,Zf as runTestRunsResume,Xf as runTestRunsStatus,Jf as runTestRunsStop,Qf as runTestRunsWorker,Tp as runUpdate,rm as runUpdateMany,Gt as runUpgrade,Gu as runValidate,Rh as runWithActiveExtensions,L as runWithAgentSessionContext,YE as runWithConfigurationOnlySettings,TS as runWithContextIntentContracts,GS as runWithDiscoveredContextIntentContracts,yi as runWithHarnessDetectionSignals,Ux as runWithMcpTraceContext,rc as runWithReproducibleProcessEnvironment,bi as runWithWorkspaceHarnessSignalDescriptors,Br as runWithWorkspaceRecipe,OR as runWorkflowPolicyAction,GI as runWorkspaceTransactionGc,Su as saveGraphAuditBaseline,RI as scanClosureTimestamps,KR as scanExtensionHostVersions,sl as scanHistoryAuthorAttribution,ri as scanItemFormatVersions,sc as scanMutationSecrets,YR as scanProvenanceResolverHealth,yc as scanStaleInProgressItems,MI as scanStorageIntegrity,T_ as schema,R_ as schemaAddField,v_ as schemaAddStatus,w_ as schemaAddType,k_ as schemaApplyPreset,x_ as schemaInferTypes,S_ as schemaList,P_ as schemaListFields,D_ as schemaRemapStatus,I_ as schemaRemoveField,O_ as schemaRemoveStatus,A_ as schemaRemoveType,L_ as schemaRenameField,N_ as schemaRenameType,E_ as schemaShow,M_ as schemaShowField,$_ as schemaShowStatus,$M as scoreCommandPathMatch,gP as scoreContextCandidates,yP as scoreContextCandidatesWithActiveExtensions,_c as scoreItemSimilarity,zN as scorePmGrammarRefusalClosure,xN as scorePmRefusalClosure,hc as scorePreparedItemSimilarity,KN as scoreTrackerPreflightRecoveryClosure,vE as sealHistoryRecord,ax as sealMcpRequestState,o_ as search,jP as searchWorkspaceMemory,BP as searchWorkspaceMemoryReadResult,zv as selectActionableEntries,oT as selectCursorSemanticOptions,Gf as selectImportAuthor,Lx as selectMcpClientRegistrationMode,UP as selectWorkspaceMemory,GP as selectWorkspaceMemoryRollups,yp as semanticAttributionAffinity,fv as sentryCaptureCliError,mv as sentryFinishCommandSpan,hv as sentryFlush,_v as sentryLogCliUsageError,uv as sentrySetCommandContext,pv as sentryStartCommandSpan,si as serializeItemDocument,BM as serializeNdjsonRows,qM as serializeNdjsonStream,Zg as serveDeclaredObservation,xC as setActiveCommandContext,NC as setActiveCommandResult,vC as setActiveExtensionCommands,AC as setActiveExtensionHooks,OC as setActiveExtensionParsers,RC as setActiveExtensionPreflight,MC as setActiveExtensionRegistrations,PC as setActiveExtensionRenderers,IC as setActiveExtensionServices,fE as setFocusedItem,Ev as shouldCompletePlanOnClose,Cu as shouldPersistDurableGraphCache,hA as shouldResolveMutationStdinTokenField,_A as shouldResolveMutationStdinTokens,VA as shouldRunSearchRefreshInForeground,$l as similarityAdvisoryWarnings,pT as sliceReadOutputRowCollection,Ml as sortLinkedArtifacts,iA as splitAcceptanceCriteria,Cv as splitCommaList,ii as splitFrontMatter,rS as stabilizeReadOutputReceiptEstimates,I as stableStringify,hC as stableValueEquals,ch as startTask,Av as startTelemetryCommand,a_ as stats,sE as statusIsTerminal,xa as stripGlobalBootstrapTokens,CM as subscribeMutationEventBatches,TM as subscribeMutationEvents,DR as summarizeAgentIdentityVocabulary,Vm as summarizeAgentModelProvenance,Hm as summarizeAgentProvenance,SP as summarizeContextEvaluationReports,df as summarizeContextPreflight,lP as summarizeHistoryProvenance,Hd as summarizeInitResult,aI as summarizeMergeReceipt,rP as supportsCreateExplicitEmpty,Ww as supportsItemIdAlias,Lb as suppressHostOutput,we as syncRelationshipGraphAdapter,ak as synthesizeExtensionManifest,Ma as toCompletionFlagString,Up as toContextFocusItem,$p as toContextPackingSummary,Fp as toContextRankingSummary,jb as toErrorMessage,wf as toEstimatedMinutesValue,MM as toExtensionFlagDefinitions,If as toImportBoolean,xf as toImportConfidence,Rf as toImportInteger,$f as toImportLinkedDocs,Df as toImportLinkedFiles,Ff as toImportLinkedTests,Lf as toImportLogEntries,Nf as toImportNormalizedEnum,kf as toImportNumberMap,Af as toImportPriority,Of as toImportStatus,Pf as toImportStringList,Mf as toImportStringMap,vf as toImportTags,pE as toItemRecord,Ef as toNonEmptyImportString,Ub as toNonEmptyStringOrUndefined,DE as toReplayDocument,mc as tokenizeSimilarityText,fA as transferMutationStdinTokenPolicy,pC as translateHostEnvironmentFault,Z_ as update,vh as upgrade,q_ as validate,KO as validateAssertionDefinition,XO as validateAssuranceDocument,WO as validateGateDefinition,WM as validateItemMutationRows,xl as validateLinkedPaths,Dx as validateMcpAuthorizationResponseIssuer,Nx as validateMcpAuthorizationServerMetadata,$x as validateMcpClientMetadataDocument,vx as validateMcpHttpRequestHeaders,ux as validateMcpJsonSchema,HO as validateMeasurementDefinition,RA as validateMissingParentReference,JT as validateReadOutputOptions,MA as validateSprintOrReleaseValue,nC as validateTypeOptions,Nw as validateWorkspaceTransactionIdentity,WI as verifyAttestation,TO as verifyCliFlagInvocationParity,qw as verifyExplicitPositionalSlotCensus,GE as verifyHistoryChain,FE as verifyHistoryChainWithVersion,Aw as verifyHistoryEntries,OE as verifyHistoryRecordHash,IE as verifyHistoryRewriteEvidence,Kw as verifyPmCliGrammar,Hw as verifyPmCommandPositionalContracts,eL as verifyPmFlagLexicon,wN as verifyPmRecoveryKindRuntimeCoverage,Wy as verifyPmRecoveryProducerRuntimeCoverage,EN as verifyPmRecoveryReferences,RN as verifyPmRefusalClosureIdentityRatchet,ON as verifyPmRefusalClosureRatchet,SN as verifyPmRefusalReachability,bc as verifyToolOptionCliParity,Yi as withFlagAliasMetadata,mC as withHostEnvironmentBoundary,lx as withMcpCachePolicy,MT as workflowApprovalFingerprint,kT as workflowPolicyApplies,PT as workflowPolicyFingerprint,gl as workspaceGraphCache,rl as wrapOwnershipConflict,zS as wrapThrownErrorForSentry,Ei as writeAuthorEnvironment,xe as writeFileAtomic,Zw as writeMutationCheckpoint,QE as writeSettings,MS as writeStderr,PS as writeStdout,av as writeVectorizationStatusLedger,KE as writeWorkspaceJsonWithHistory};
|
|
32
32
|
//# sourceMappingURL=sdk.js.map
|