@unbrained/pm-cli 2026.10.27 → 2026.10.28

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.
Files changed (120) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/CHANGELOG.md +23 -0
  3. package/dist/cli/commander-usage.js +2 -2
  4. package/dist/cli/error-guidance.js +2 -2
  5. package/dist/cli-bundle/bundle-manifest.json +1 -1
  6. package/dist/cli-bundle/chunks/chunk-2J7I54MQ.js +2 -0
  7. package/dist/cli-bundle/chunks/{chunk-25MTQAHX.js → chunk-3KMYHYJV.js} +2 -2
  8. package/dist/cli-bundle/chunks/{chunk-UHKN6TJM.js → chunk-7V37RC2L.js} +44 -44
  9. package/dist/cli-bundle/chunks/{chunk-5PTMQBKJ.js → chunk-AHVN4GHF.js} +30 -29
  10. package/dist/cli-bundle/chunks/{chunk-QQYLNHZK.js → chunk-CS7QDSUX.js} +28 -28
  11. package/dist/cli-bundle/chunks/{chunk-34OQP43K.js → chunk-CXUQEZDX.js} +3 -3
  12. package/dist/cli-bundle/chunks/{chunk-X5TMR7KC.js → chunk-D3AIQZXF.js} +2 -2
  13. package/dist/cli-bundle/chunks/{chunk-NNIYQHYT.js → chunk-D6P6IBPN.js} +2 -2
  14. package/dist/cli-bundle/chunks/{chunk-HIX2OMEZ.js → chunk-DKLEDWVW.js} +2 -2
  15. package/dist/cli-bundle/chunks/{chunk-2XUDAQK5.js → chunk-DM3PICGU.js} +2 -2
  16. package/dist/cli-bundle/chunks/{chunk-32QK43XG.js → chunk-E5QBZ4HI.js} +2 -2
  17. package/dist/cli-bundle/chunks/{chunk-H434DKYU.js → chunk-JESLOJD7.js} +2 -2
  18. package/dist/cli-bundle/chunks/{chunk-57YPOOED.js → chunk-LWW4F4G2.js} +2 -2
  19. package/dist/cli-bundle/chunks/{chunk-O3LPT34G.js → chunk-PQLRKFPZ.js} +3 -3
  20. package/dist/cli-bundle/chunks/{chunk-ONC4BBQP.js → chunk-RZQNFHXO.js} +2 -2
  21. package/dist/cli-bundle/chunks/{chunk-ER7RLJW5.js → chunk-TH5KPAN4.js} +2 -2
  22. package/dist/cli-bundle/chunks/{chunk-F26MRQZY.js → chunk-XHONSCLJ.js} +6 -6
  23. package/dist/cli-bundle/chunks/{chunk-EKV5GP6P.js → chunk-YUBUNECD.js} +42 -42
  24. package/dist/cli-bundle/chunks/{chunk-OQOEBWHU.js → chunk-YYD5MNAV.js} +2 -2
  25. package/dist/cli-bundle/chunks/{chunk-Q55KZDNF.js → chunk-ZX3XMTZG.js} +2 -2
  26. package/dist/cli-bundle/chunks/{indexed-receipt-blobs-63WYG2PY.js → indexed-receipt-blobs-LHLE7PSG.js} +2 -2
  27. package/dist/cli-bundle/chunks/{mutation-admission-L3A6FSZ7.js → mutation-admission-GKDKHRTZ.js} +2 -2
  28. package/dist/cli-bundle/chunks/{register-list-query-YSQ7UTFI.js → register-list-query-MHJJUM6M.js} +2 -2
  29. package/dist/cli-bundle/chunks/{register-mutation-6HRXYASW.js → register-mutation-SN425O3R.js} +2 -2
  30. package/dist/cli-bundle/chunks/{register-operations-4O3YOYXF.js → register-operations-EYUIUGPW.js} +2 -2
  31. package/dist/cli-bundle/chunks/{register-setup-3WAXNDMY.js → register-setup-WUZ2ZSMY.js} +2 -2
  32. package/dist/cli-bundle/chunks/{settlement-hook-CRW6PVQK.js → settlement-hook-MN3Y7LVX.js} +2 -2
  33. package/dist/cli-bundle/chunks/{stage-I46WD4EN.js → stage-2FYJGGG3.js} +2 -2
  34. package/dist/cli-bundle/focused-chunks/chunk-3EHVI673.js +2 -0
  35. package/dist/cli-bundle/focused-chunks/{chunk-ZA6AEYIM.js → chunk-46WLWK73.js} +2 -2
  36. package/dist/cli-bundle/focused-chunks/{chunk-E5C24MCV.js → chunk-4GN2ZPT5.js} +2 -2
  37. package/dist/cli-bundle/focused-chunks/{chunk-NLZUI234.js → chunk-6L4KKRK7.js} +18 -18
  38. package/dist/cli-bundle/focused-chunks/{chunk-WDKZB3V6.js → chunk-6VDRAJYX.js} +2 -2
  39. package/dist/cli-bundle/focused-chunks/{chunk-KTXU5WU6.js → chunk-7SZPZOIC.js} +2 -2
  40. package/dist/cli-bundle/focused-chunks/{chunk-YQKLKRMW.js → chunk-B4ZQJEMT.js} +2 -2
  41. package/dist/cli-bundle/focused-chunks/{chunk-J67PFM3O.js → chunk-BZSACRVX.js} +3 -3
  42. package/dist/cli-bundle/focused-chunks/{chunk-Y57A4ZDI.js → chunk-C2GLO7HU.js} +3 -3
  43. package/dist/cli-bundle/focused-chunks/{chunk-R2MTHS2H.js → chunk-DRN4W3YJ.js} +2 -2
  44. package/dist/cli-bundle/focused-chunks/{chunk-TAFMNTA5.js → chunk-F6UQJJYB.js} +2 -2
  45. package/dist/cli-bundle/focused-chunks/{chunk-TGUOEOKP.js → chunk-I4X6AKOO.js} +2 -2
  46. package/dist/cli-bundle/focused-chunks/{chunk-SM2KGD4J.js → chunk-IQKLJFJE.js} +2 -2
  47. package/dist/cli-bundle/focused-chunks/{chunk-XK3XMZM4.js → chunk-JTCGDODH.js} +2 -2
  48. package/dist/cli-bundle/focused-chunks/{chunk-HWD63G54.js → chunk-L5GX2FGZ.js} +2 -2
  49. package/dist/cli-bundle/focused-chunks/{chunk-MVY6JDIH.js → chunk-LPWZERVD.js} +11 -11
  50. package/dist/cli-bundle/focused-chunks/{chunk-YW5GHQN2.js → chunk-ML5JIUM6.js} +2 -2
  51. package/dist/cli-bundle/focused-chunks/{chunk-YC6NCPLK.js → chunk-OASYSUOH.js} +16 -16
  52. package/dist/cli-bundle/focused-chunks/{chunk-BH7RE2ZY.js → chunk-ON5WFDCG.js} +2 -2
  53. package/dist/cli-bundle/focused-chunks/{chunk-4TXZBGOR.js → chunk-QUPGBO2L.js} +2 -2
  54. package/dist/cli-bundle/focused-chunks/{chunk-SYL73MEI.js → chunk-R3EA3SDW.js} +3 -3
  55. package/dist/cli-bundle/focused-chunks/{chunk-B266DDBJ.js → chunk-TUN4M757.js} +2 -2
  56. package/dist/cli-bundle/focused-chunks/{chunk-ZH7GTEWL.js → chunk-Z26ZPQH6.js} +2 -2
  57. package/dist/cli-bundle/focused-chunks/{indexed-receipt-blobs-GAFC52LQ.js → indexed-receipt-blobs-5H6RMRTK.js} +2 -2
  58. package/dist/cli-bundle/focused-chunks/{mutation-admission-ENBFMV2X.js → mutation-admission-TM3SVU2O.js} +2 -2
  59. package/dist/cli-bundle/focused-chunks/{settlement-hook-PUYJJDFL.js → settlement-hook-LBVWWSCF.js} +2 -2
  60. package/dist/cli-bundle/focused-chunks/{stage-MAWZTM2H.js → stage-7ZBRX2Q2.js} +2 -2
  61. package/dist/cli-bundle/main.js +21 -21
  62. package/dist/cli-bundle/sdk-authoring.js +1 -1
  63. package/dist/cli-bundle/sdk-contracts.js +1 -1
  64. package/dist/cli-bundle/sdk-core.js +25 -24
  65. package/dist/cli-bundle/sdk-governance.js +1 -1
  66. package/dist/cli-bundle/sdk-graph.js +1 -1
  67. package/dist/cli-bundle/sdk-merge.js +46 -46
  68. package/dist/cli-bundle/sdk-query.js +1 -1
  69. package/dist/cli-bundle/sdk-runtime.js +1 -1
  70. package/dist/cli-bundle/sdk-testing.js +1 -1
  71. package/dist/cli-bundle/sdk.js +11 -11
  72. package/dist/core/item/priority.js +1 -1
  73. package/dist/core/shared/errors.d.ts +2 -0
  74. package/dist/core/shared/errors.js +1 -1
  75. package/dist/core/store/item-store.js +1 -1
  76. package/dist/sdk/agent/command-recovery.d.ts +5 -0
  77. package/dist/sdk/agent/command-recovery.js +1 -1
  78. package/dist/sdk/command-line.d.ts +6 -0
  79. package/dist/sdk/command-line.js +1 -1
  80. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1 -1
  81. package/dist/sdk/index.d.ts +1 -1
  82. package/dist/sdk/index.js +1 -1
  83. package/dist/sdk/lifecycle/close.js +1 -1
  84. package/dist/sdk/lifecycle/create.js +1 -1
  85. package/dist/sdk/lifecycle/update-many.js +1 -1
  86. package/dist/sdk/lifecycle/update.js +1 -1
  87. package/dist/sdk/public-surface.json +1 -1
  88. package/dist/sdk/query/history.d.ts +4 -0
  89. package/dist/sdk/query/history.js +1 -1
  90. package/dist/sdk/runtime/actions.js +1 -1
  91. package/dist/sdk/runtime.js +1 -1
  92. package/dist/sdk/test/command-resolution.d.ts +5 -0
  93. package/dist/sdk/test/command-resolution.js +3 -0
  94. package/dist/sdk/test/execution.js +2 -2
  95. package/docs/COMMANDS.md +28 -1
  96. package/docs/SDK.md +40 -0
  97. package/docs/TESTING.md +28 -2
  98. package/marketplace.json +1 -1
  99. package/package.json +1 -1
  100. package/packages/pm-beads/package.json +1 -1
  101. package/packages/pm-calendar/package.json +1 -1
  102. package/packages/pm-command-kit/package.json +1 -1
  103. package/packages/pm-digital-twin/package.json +1 -1
  104. package/packages/pm-governance-audit/package.json +1 -1
  105. package/packages/pm-guide-shell/package.json +1 -1
  106. package/packages/pm-kanban/package.json +1 -1
  107. package/packages/pm-lifecycle-hooks/package.json +1 -1
  108. package/packages/pm-linked-test-adapters/package.json +1 -1
  109. package/packages/pm-search-advanced/package.json +1 -1
  110. package/packages/pm-templates/package.json +1 -1
  111. package/packages/pm-todos/package.json +1 -1
  112. package/packages/pm-vcs/package.json +1 -1
  113. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  114. package/plugins/pm-claude/package.json +1 -1
  115. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  116. package/plugins/pm-codex/package.json +1 -1
  117. package/plugins/pm-codex/plugin.json +1 -1
  118. package/runtime-dependencies.json +1 -1
  119. package/dist/cli-bundle/chunks/chunk-XERBUA6A.js +0 -2
  120. package/dist/cli-bundle/focused-chunks/chunk-U4UBQBS7.js +0 -2
@@ -1,8 +1,8 @@
1
- import{a as Uh}from"./chunks/chunk-OQOEBWHU.js";import{a as S0,b as w0,c as E0,d as A0}from"./chunks/chunk-X5TMR7KC.js";import{a as v0,b as O0,c as P0,d as R0,e as I0,f as M0,g as k0,h as x0,i as N0,j as L0,k as D0,l as $0,m as F0,n as G0,o as U0,p as j0,q as B0}from"./chunks/chunk-Q55KZDNF.js";import{A as y0,B as b0,C as T0,D as C0,a as Xn,b as NA,c as LA,d as Ga,e as Ua,f as ja,h as Ba,i as qa,j as za,k as Ha,l as Va,m as Ka,n as Wa,o as Ya,p as id,q as sd,r as ad,s as dd,t as cd,u as u0,v as m0,w as f0,x as _0,y as h0,z as g0}from"./chunks/chunk-XERBUA6A.js";import{a as _w,b as hw,c as gw,d as yw,e as bw}from"./chunks/chunk-25MTQAHX.js";import{A as _k,B as hk,C as gk,D as yk,E as bk,F as Tk,G as Ck,H as Sk,I as wk,J as Ek,K as Ak,L as vk,M as Ok,N as Pk,O as Rk,P as Ik,Q as Mk,R as kk,S as xk,T as Nk,U as Lk,V as Dk,W as $k,X as Fk,Y as Gk,Z as Uk,_ as jk,a as q0,b as z0,c as H0,d as V0,e as K0,f as W0,g as Y0,h as X0,i as J0,j as Z0,k as Q0,l as ek,m as tk,n as rk,o as ok,p as nk,q as ik,r as sk,s as ak,t as dk,u as ck,v as lk,w as pk,x as uk,y as mk,z as fk}from"./chunks/chunk-32QK43XG.js";import{$ as Cm,$a as f_,$b as fh,A as im,Aa as Df,Ab as j_,B as sm,Ba as $f,Bb as B_,C as am,Ca as Ff,Cb as q_,D as cm,Da as Gf,Db as z_,E as lm,Ea as Uf,Eb as H_,F as qt,Fa as jf,Fb as V_,G as zt,Ga as Bf,Gb as K_,H as Ht,Ha as qf,Hb as W_,I as Vt,Ia as zf,Ib as Y_,J as Kt,Ja as Hf,Jb as X_,K as Wt,Ka as Vf,Kb as J_,L as Yt,La as Kf,Lb as Z_,M as Xt,Ma as Wf,Mb as Q_,N as Jt,Na as Yf,Nb as eh,O as Zt,Oa as Xf,Ob as th,P as Qt,Pa as Jf,Pb as rh,Q as pm,Qa as Zf,Qb as oh,R as um,Ra as Qf,Rb as nh,S as mm,Sa as e_,Sb as ih,T as fm,Ta as t_,Tb as sh,U as _m,Ua as er,Ub as ah,V as Xe,Va as ge,Vb as dh,W as hm,Wa as c_,Wb as ch,X as gm,Xa as l_,Xb as lh,Y as ym,Ya as p_,Yb as ph,Z as bm,Za as u_,Zb as uh,_ as Tm,_a as m_,_b as mh,a as cw,aa as Sm,ab as __,ac as _h,b as lw,ba as wm,bb as h_,bc as hh,c as pw,ca as KM,cb as g_,cc as gh,d as uw,da as WM,db as y_,dc as yh,e as mw,ea as YM,eb as b_,ec as bh,f as fw,fa as Dm,fb as T_,fc as Th,g as pA,ga as $m,gb as C_,gc as Ch,h as uA,ha as Fm,hb as S_,hc as Sh,i as mA,ia as vf,ib as w_,ic as wh,j as fA,ja as Of,jb as E_,jc as Eh,k as Ji,ka as n0,kb as A_,kc as Ah,l as iR,la as i0,lb as v_,lc as vh,m as sR,ma as s0,mb as O_,mc as Oh,n as aR,na as a0,nb as P_,nc as Ph,o as dR,oa as d0,ob as R_,oc as Rh,p as cR,pa as c0,pb as I_,pc as Ih,q as lR,qa as l0,qb as M_,qc as Mh,r as yl,ra as p0,rb as k_,rc as kh,s as Wp,sa as Pf,sb as x_,sc as xh,t as Yp,ta as Rf,tb as N_,tc as Nh,u as Zp,ua as If,ub as L_,uc as Lh,v as Qp,va as Mf,vb as D_,vc as Dh,w as yu,wa as kf,wb as $_,wc as $h,x as Au,xa as xf,xb as F_,xc as Fh,y as LI,ya as Nf,yb as G_,yc as Gh,z as Ye,za as Lf,zb as U_}from"./chunks/chunk-EKV5GP6P.js";import{e as mR,f as fR,g as bl,h as Tl,i as Ut}from"./chunks/chunk-HIX2OMEZ.js";import{A as DM,B as $M,C as FM,D as GM,E as UM,F as jM,G as BM,H as qM,I as zM,J as HM,K as VM,L as vm,M as Om,N as Pm,O as Rm,P as Im,Q as Mm,R as km,S as xm,T as Nm,U as Lm,a as yI,b as bI,c as TI,d as CI,e as SI,f as Kp,g as wI,h as EI,i as AI,j as vI,k as OI,m as dm,n as Em,o as AM,p as vM,q as OM,r as PM,s as RM,t as IM,u as Am,v as MM,w as kM,x as xM,y as NM,z as LM}from"./chunks/chunk-F26MRQZY.js";import{$ as FP,$a as Jl,$b as tu,$c as tf,A as mP,Aa as vl,Ab as Dp,Ac as Pu,Ad as n_,B as fP,Ba as Ol,Bb as $p,Bc as Zu,Bd as i_,C as _P,Ca as Pl,Cb as Fp,Cc as Qu,Cd as s_,D as hP,Da as Rl,Db as Gp,Dc as em,Dd as a_,E as gP,Ea as Il,Eb as Up,Ec as tm,Ed as d_,F as We,Fa as Ml,Fb as jp,Fc as rm,G as yP,Ga as kl,Gb as Bp,Gc as om,H as Nt,Ha as xl,Hb as qp,Hc as nm,I as bP,Ia as Nl,Ib as zp,Ic as Gm,J as TP,Ja as Ll,Jb as Hp,Jc as Um,K as CP,Ka as Dl,Kb as lI,Kc as jm,L as SP,La as $l,Lb as pI,Lc as Bm,M as wP,Ma as Fl,Mb as uI,Mc as qm,N as EP,Na as Gl,Nb as mI,Nc as zm,O as AP,Oa as Ul,Ob as fI,Oc as Hm,P as vP,Pa as jl,Pb as _I,Pc as Vm,Q as OP,Qa as Bl,Qb as hI,Qc as Km,R as PP,Ra as ql,Rb as gI,Rc as t0,S as RP,Sa as gR,Sb as Vp,Sc as r0,T as IP,Ta as zl,Tb as PI,Tc as o0,U as MP,Ua as Hl,Ub as RI,Uc as Wm,V as kP,Va as Vl,Vb as II,Vc as Ym,W as xP,Wa as Kl,Wb as MI,Wc as Xm,X as NP,Xa as yR,Xb as kI,Xc as Jm,Y as LP,Ya as Wl,Yb as Xp,Yc as Zm,Z as DP,Za as Yl,Zb as Jp,Zc as Qm,_ as $P,_a as Xl,_b as eu,_c as ef,a as nP,aa as GP,ab as Zl,ad as rf,b as Mt,ba as UP,bb as bR,bc as ru,bd as of,c as iP,ca as jP,cb as TR,cc as ou,cd as nf,d as Ve,da as BP,db as CR,dc as nu,dd as sf,e as te,ea as qP,eb as SR,ec as iu,ed as af,f as bc,fa as zP,fb as wR,fc as su,fd as df,gb as ER,gc as au,gd as cf,ha as rl,hb as AR,hc as du,hd as lf,i as Ke,ia as ol,ib as HR,ic as cu,id as pf,j as Tc,ja as nl,jb as VR,jc as lu,jd as uf,k as Cc,ka as il,kb as KR,kc as pu,kd as mf,la as sl,lb as WR,lc as uu,ld as ff,m as he,mb as YR,mc as mu,n as Sc,na as al,nb as XR,nc as fu,nd as _f,o as wc,oa as dl,ob as JR,oc as _u,od as hf,p as Ec,pa as cl,pb as oI,pc as hu,pd as gf,q as Ac,qa as ll,qb as nI,qd as yf,r as sP,ra as pR,rb as kp,rc as xI,rd as bf,s as aP,sa as uR,sb as xp,sc as NI,sd as Tf,t as dP,ta as pl,tb as iI,tc as gu,td as Cf,u as cP,ua as ul,ub as sI,uc as vu,ud as Sf,v as lP,va as ml,vb as aI,vd as wf,w as kt,wa as fl,wb as dI,wd as Ef,x as pP,xa as _l,xb as cI,xd as Af,y as uP,ya as hl,yb as Np,yc as Ou,yd as r_,z as xt,za as gl,zb as Lp,zd as o_}from"./chunks/chunk-5PTMQBKJ.js";import{f as sc}from"./chunks/chunk-H434DKYU.js";import{A as Uc,Aa as Yc,B as jc,Ba as Xc,C as Lt,Ca as Jc,Da as Zc,Fa as Qc,Ga as el,Ha as tl,a as bA,b as TA,c as CA,d as Zi,e as Qi,f as es,g as ts,h as rs,ia as Dt,j as HP,ja as $t,ka as Ft,la as Gt,ma as Bc,oa as qc,pa as zc,qa as Hc,s as eR,t as tR,v as rR,w as oR,wa as Vc,x as nR,xa as Kc,y as Fc,z as Gc,za as Wc}from"./chunks/chunk-NNIYQHYT.js";import{$ as _c,$b as HI,$c as XM,A as UO,Aa as sp,Ac as yM,B as jO,Ba as ap,Bb as ZR,Bc as bM,C as BO,Ca as dp,Cb as QR,Cc as TM,Da as cp,Db as eI,Dc as jt,Ea as lp,Eb as tI,Ec as Nu,Fa as pp,Fb as rI,Fc as Lu,Ga as up,Gb as bu,Gc as Du,Ha as mp,Hb as Tu,Hc as $u,Ia as fp,Ib as Cu,Ic as Fu,Ja as _p,Jb as Su,Jc as Gu,Ka as hp,Kb as wu,Kc as Uu,L as qO,La as gp,Lb as Eu,Lc as ju,M as zO,Ma as yp,Mb as Ru,Mc as Bu,N as HO,Na as bp,Nb as Iu,Nc as qu,O as VO,Oa as Tp,Ob as Mu,Oc as zu,P as KO,Pa as Cp,Pb as ku,Pc as Hu,Q as WO,Qa as Sp,Qb as DI,Qc as Vu,R as YO,Ra as wp,Rb as $I,Rc as Ku,S as XO,Sa as Ep,Sb as FI,Sc as Wu,T as ac,Ta as Ap,Tb as GI,Tc as Yu,U as dc,Ua as vp,Ub as UI,Uc as Bt,V as cc,Va as Op,Vb as jI,Vc as Xu,W as lc,Wa as Pp,Wb as BI,Wc as CM,X as pc,Xa as Rp,Xc as SM,Y as uc,Ya as Ip,Yb as xu,Yc as wM,Z as mc,Za as Mp,Zb as qI,Zc as Ju,_ as fc,_b as zI,_c as EM,a as Gi,aa as hc,ac as VI,ad as JM,b as Ui,ba as gc,bb as vR,bc as KI,bd as ZM,c as ji,ca as He,cb as OR,cc as WI,cd as QM,d as Bi,da as JO,db as PR,dc as YI,dd as e0,e as qi,ea as ZO,eb as RR,ec as XI,fa as QO,fb as IR,fc as JI,g as dA,ga as eP,gb as MR,gc as ZI,h as cA,ha as tP,hb as kR,hc as QI,i as lA,ia as rP,ib as xR,ic as eM,j as _A,ja as oP,jb as NR,jc as tM,k as hA,ka as yc,kb as LR,kc as rM,l as gA,la as Cl,lb as DR,lc as oM,m as yA,ma as Sl,mb as $R,mc as nM,n as OO,na as wl,nb as FR,nc as iM,o as PO,oa as El,oc as sM,p as RO,pa as _R,pc as aM,q as IO,qa as hR,qc as dM,r as MO,rb as GR,rc as cM,s as kO,sa as Al,sc as lM,t as xO,ta as Ql,tb as UR,tc as pM,u as NO,ua as ep,ub as jR,uc as uM,v as LO,va as tp,vc as mM,w as DO,wa as rp,wc as fM,x as $O,xa as op,xb as BR,xc as _M,y as FO,ya as np,yb as qR,yc as hM,z as GO,za as ip,zb as zR,zc as gM}from"./chunks/chunk-O3LPT34G.js";import"./chunks/chunk-4D25HF3V.js";import{$ as OA,$a as Ks,$b as td,$c as gv,$e as Ud,A as YE,Aa as Ts,Ab as Ta,Ad as Ot,Ae as cO,Af as Qd,B as XE,Ba as Cs,Bb as Ca,Be as lO,Bf as ec,C as JE,Ca as Ss,Cb as Sa,Cd as xv,Ce as pO,Cf as tc,D as ZE,Da as ws,Db as wa,De as uO,Df as rc,Ea as Es,Eb as Ea,Ec as ZA,Ed as Nv,Ee as mO,Ef as oc,F as QE,Fa as As,Fb as Aa,Ff as nc,G as eA,Ga as vs,Gb as va,Gc as QA,Gf as ic,H as tA,Ha as Os,Hb as Oa,Hc as ev,Hf as It,I as rA,Ia as Ps,Ib as Pa,Ic as tv,Id as Lv,Ie as Rt,J as Wi,Ja as Rs,Jb as Ra,Jc as rv,Jd as Dv,Je as fO,K as Yi,Ka as Is,Kb as Ia,Kc as ov,Kd as $v,Ke as _O,La as Ms,Lb as Ma,Lc as nv,Ld as pd,Le as hO,M as Xi,Ma as ks,Mb as ka,Md as Fv,Me as Ad,N as oA,Na as xs,Nb as xa,Nc as iv,Ne as vd,Oa as Ns,Ob as Na,Oc as sv,Od as Gv,Oe as Od,P as nA,Pa as Ls,Pb as La,Pd as Uv,Pe as Pd,Q as iA,Qa as Ds,Qb as Da,Qc as av,Qd as jv,Qe as Rd,R as sA,Ra as $s,Rb as $a,Rc as dv,Rd as Bv,Re as Id,Sa as Fs,Sc as cv,Sd as qv,Se as Md,T as aA,Ta as Gs,Tb as ze,Tc as lv,Td as zv,Te as kd,Ua as Us,Ub as ee,Uc as pv,Ud as Hv,Ue as xd,V as SA,Va as js,Vb as Fa,Vc as uv,Vd as Vv,Ve as Nd,W as wA,Wa as Bs,Wb as Xa,Wd as Kv,We as Ld,X as EA,Xa as qs,Xb as Ja,Xc as mv,Xd as Wv,Xe as Dd,Y as Be,Ya as zs,Yb as Za,Yc as fv,Yd as Pt,Ye as $d,Z as AA,Za as Hs,Zb as Qa,Zc as _v,Zd as Yv,Ze as Fd,_ as vA,_a as Vs,_b as ed,_c as hv,_e as Gd,aa as vt,ab as Ws,ac as rd,ae as Xv,af as jd,b as IE,ba as qe,bb as Ys,bc as od,bd as yv,be as Jv,bf as Bd,c as ME,ca as PA,cb as Xs,cc as nd,ce as Zv,cf as qd,d as kE,da as RA,db as Js,dc as DA,dd as bv,de as Qv,df as zd,e as xE,ea as IA,eb as Zs,ed as Tv,ee as eO,ef as Hd,f as NE,fa as MA,fb as Qs,fc as ld,fd as Cv,fe as tO,ff as Vd,ga as kA,gb as ea,gc as $A,gd as Sv,ge as rO,gf as Kd,h as zi,ha as xA,hb as ta,hc as FA,hd as wv,he as oO,hf as Wd,i as Hi,ia as os,ib as ra,ic as GA,ie as nO,j as Vi,ja as ns,jb as oa,jc as UA,je as iO,jf as gO,ka as is,kb as na,kc as jA,ke as ud,kf as yO,la as ss,lb as ia,lc as BA,le as md,m as LE,ma as as,mb as sa,me as fd,na as ds,nb as aa,nc as qA,ne as _d,nf as bO,oa as cs,ob as da,oc as zA,oe as hd,of as TO,pa as ls,pb as ca,pc as HA,pe as gd,pf as CO,q as Ki,qa as ps,qb as la,qc as VA,qe as yd,qf as SO,ra as us,rb as pa,rd as Ev,re as bd,rf as wO,sa as ms,sb as ua,sc as KA,sd as Av,se as Td,sf as EO,ta as fs,tb as ma,tc as WA,td as vv,te as Cd,tf as AO,u as At,ua as _s,ub as fa,ud as Ov,ue as Sd,uf as vO,v as DE,va as hs,vb as _a,vc as YA,vd as Pv,ve as wd,w as $E,wa as gs,wb as ha,wc as XA,wd as Rv,we as Ed,wf as Yd,x as FE,xa as ys,xb as ga,xc as JA,xd as Iv,xe as sO,xf as Xd,y as GE,ya as bs,yb as ya,yd as Mv,ye as aO,yf as Jd,z as UE,zb as ba,zd as kv,ze as dO,zf as Zd}from"./chunks/chunk-QQYLNHZK.js";import"./chunks/chunk-SPPHDVZE.js";import"./chunks/chunk-57YPOOED.js";import{a as VP,b as KP,c as WP,d as YP,e as XP,f as JP,g as ZP,h as Ic,i as Mc,j as kc,k as xc,l as Nc,m as QP,n as Lc,o as Dc,p as $c}from"./chunks/chunk-34OQP43K.js";import"./chunks/chunk-IB7UB5TE.js";import{$a as kT,$b as HT,$c as Pn,$d as qn,$f as Rw,$g as gi,$h as mE,A as aT,Aa as Jo,Ac as tC,Ad as In,Ae as mS,Af as JS,Ag as si,Ai as RE,B as dT,Ba as Zo,Bb as Cn,Bc as wn,Bd as Mn,Be as fS,Bf as ZS,Bg as ai,Bh as eE,Bi as jE,Cb as Sn,Cd as kn,Ce as _S,Cf as QS,Cg as di,Ch as tE,Ci as BE,D as cT,Da as Qo,Db as LT,Dc as En,De as hS,Df as ew,Dg as Gw,Di as qE,Ec as An,Ed as NC,Ee as gS,Ef as tw,Eg as Uw,Eh as rE,Ei as zE,Fd as LC,Fe as yS,Ff as rw,Fi as HE,G as lT,Gd as DC,Ge as bS,Gf as ow,Gh as ki,Gi as VE,Hc as rC,Hd as $C,He as TS,Hg as ci,Hh as xi,Hi as KE,Ic as oC,Id as FC,Ie as CS,Ig as li,Ih as Ni,Ii as WE,J as pT,Jc as nC,Jd as GC,Je as SS,Jf as nw,Jg as jw,Jh as Li,Kc as iC,Kd as UC,Ke as wS,Kf as iw,Kg as pi,Lc as sC,Ld as jC,Le as ES,Lf as sw,Lg as ui,M as uT,Mc as aC,Md as BC,Me as AS,Mg as Bw,N as jo,Nc as dC,Nd as qC,Nf as aw,Ng as mi,O as Bo,Ob as DT,Oc as vn,Od as zC,Oe as wt,Of as dw,Og as fi,P as qo,Pa as R,Pc as cC,Pd as HC,Pf as Jn,Pg as D,Qa as ST,Qb as $T,Qc as lC,Qe as Et,Qf as Zn,Qg as _i,Ra as Tt,Rb as FT,Rd as xn,Rf as Qn,Rh as oE,Sa as wT,Sb as GT,Sd as Nn,Se as Kn,Sf as Tw,Sh as nE,T as zo,Ta as ET,Tb as UT,Tc as pC,Td as Ln,Te as Wn,Tf as Cw,Th as iE,Ua as AT,Ub as jT,Uc as uC,Ud as Dn,Ue as _e,Uf as Sw,Uh as sE,V as Ho,Va as vT,Vc as mC,Vd as $n,Vf as ww,Vh as aE,W as Vo,Wa as OT,Wb as BT,Wc as fC,Wd as Fn,We as vS,Wf as Ew,Wh as dE,X as Ko,Xa as PT,Xb as qT,Xc as _C,Xd as Gn,Xf as Aw,Xg as qw,Xh as cE,Ya as RT,Yc as hC,Yd as Un,Ye as OS,Yf as vw,Yg as zw,Yh as lE,Za as IT,Zc as On,Zd as jn,Zf as Ow,Zg as Hw,Zh as pE,_a as MT,_b as zT,_c as gC,_d as Bn,_f as Pw,_g as hi,_h as uE,a as Ro,ab as xT,ac as VT,ae as zn,ag as Iw,ah as yi,ai as fE,b as Io,bb as en,bc as KT,bd as yC,be as Hn,bf as je,bg as Mw,bh as bi,bi as _E,c as Mo,cb as tn,cd as bC,ce as Vn,cf as Yn,cg as kw,ch as Ti,d as ko,db as rn,dd as TC,de as VC,df as PS,dh as Ci,di as hE,e as Ne,eb as on,ed as CC,ee as KC,ef as RS,eh as Si,ei as Di,f as xo,fb as nn,fc as WT,fd as SC,fe as WC,ff as IS,fh as wi,fi as $i,g as L,gb as sn,ge as YC,gf as MS,gh as Ei,gi as gE,h as Le,hb as an,hc as YT,hd as Rn,he as XC,hf as kS,hh as Ai,hi as yE,i as No,ib as Ge,ie as JC,if as xS,ih as vi,ii as bE,j as Lo,jb as Ue,jd as wC,je as ZC,jf as NS,jg as xw,jh as Oi,ji as TE,k as Do,ka as mT,kb as dn,kd as EC,kf as LS,kh as Pi,ki as CE,l as $o,la as fT,lb as cn,ld as AC,lf as DS,lh as Ri,li as SE,m as qb,ma as _T,mb as ln,md as vC,me as QC,mf as $S,mg as ei,mh as Ii,mi as wE,n as De,nb as pn,nd as OC,ne as eS,nf as FS,ng as Nw,nh as Vw,ni as EE,o as yt,ob as un,od as PC,oe as tS,of as GS,og as ti,oh as Kw,oi as AE,p as zb,pa as Wo,pb as mn,pd as RC,pe as rS,pf as US,ph as Mi,q as Hb,qa as hT,qb as fn,qd as IC,qe as oS,qf as jS,qg as Lw,qh as Ww,r as Vb,ra as gT,rb as _n,rd as MC,re as nS,rf as BS,rg as Dw,rh as Yw,s as Kb,sa as yT,sb as hn,sd as kC,se as iS,sf as qS,si as vE,t as z,ta as bT,tb as gn,tc as XT,td as xC,te as sS,tf as zS,tg as $w,u as Wb,ub as yn,uc as JT,ue as aS,uf as HS,ug as Fw,va as Yo,vb as bn,vc as ZT,ve as dS,vf as VS,vg as ri,vi as OE,w as oT,wa as Xo,wb as Tn,we as cS,wf as KS,wg as oi,wh as Xw,x as nT,xa as Fe,xc as QT,xe as lS,xf as WS,xh as Jw,y as iT,ya as TT,yc as eC,yd as Ct,ye as pS,yf as YS,yg as ni,yh as Zw,yi as PE,z as sT,za as CT,zb as NT,zd as St,ze as uS,zf as XS,zg as ii,zh as Qw,zi as Fi}from"./chunks/chunk-UHKN6TJM.js";import{a as vc,b as Oc,e as Pc,f as Rc}from"./chunks/chunk-ER7RLJW5.js";import"./chunks/chunk-VS565KBX.js";import{A as me,B as rT,C as b,E as Fo,F as bt,G as fe,H as Go,K as $e,M as Uo,b as Yb,c as Xb,d as Jb,m as Zb,r as Qb,u as eT,y as tT}from"./chunks/chunk-ONC4BBQP.js";import"./chunks/chunk-XAWE4EAK.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]="8f11e0bf-4115-55a8-bd39-c360f43cdc09")}catch{}})();var H="2026-07-28",rr=["2025-11-25","2025-06-18"],re=[H],m={headerMismatch:-32020,missingRequiredClientCapability:-32021,unsupportedProtocolVersion:-32022,invalidParams:-32602},E={clientCapabilities:"io.modelcontextprotocol/clientCapabilities",clientInfo:"io.modelcontextprotocol/clientInfo",logLevel:"io.modelcontextprotocol/logLevel",protocolVersion:"io.modelcontextprotocol/protocolVersion",serverInfo:"io.modelcontextprotocol/serverInfo"},tr=["debug","info","notice","warning","error","critical","alert","emergency"],u=class extends Error{code;data;constructor(t,r,o={}){super(t),this.name="PmMcpProtocolError",this.code=r,this.data=o}};function h(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function jh(e){if(e===void 0)return;if(!h(e))throw new u("Invalid MCP clientInfo metadata",m.invalidParams,{field:E.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 u("Invalid MCP clientInfo metadata",m.invalidParams,{field:E.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 Bh(e){if(e!==void 0){if(typeof e!="string"||!tr.includes(e))throw new u("Invalid MCP logLevel metadata",m.invalidParams,{field:E.logLevel,allowed:[...tr]});return e}}function Je(e){let t=h(e)?e._meta:void 0;if(!h(t))throw new u("Missing required MCP request metadata",m.invalidParams,{required:[E.protocolVersion,E.clientCapabilities]});let r=t[E.protocolVersion];if(typeof r!="string"||!re.includes(r))throw new u("Unsupported protocol version",m.unsupportedProtocolVersion,{supported:[...re],requested:typeof r=="string"?r:null});let o=t[E.clientCapabilities];if(!h(o))throw new u("Invalid MCP client capabilities metadata",m.invalidParams,{field:E.clientCapabilities,expected:"object"});let n=jh(t[E.clientInfo]),s=Bh(t[E.logLevel]);return{protocolVersion:H,clientCapabilities:o,...n?{clientInfo:n}:{},...s?{logLevel:s}:{}}}function Bk(e,t){if(t!==e.protocolVersion)throw new u("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 u("Missing required client capability",m.missingRequiredClientCapability,{requiredCapabilities:Object.fromEntries(r.map(o=>[o,{}]))})}function zk(e,t){let r=e.clientCapabilities.extensions;return h(r)&&h(r[t])}function Ze(e,t){let r=h(e._meta)?e._meta:{};return{...e,_meta:{...r,[E.serverInfo]:{...t}}}}function qh(e,t){return Ze({...e,resultType:"complete"},t)}function Hk(e){let t=e.ttlMs??6e4;if(!Number.isFinite(t)||t<0)throw new u("Invalid MCP discovery cache TTL",m.invalidParams,{ttlMs:t});return qh({supportedVersions:[...re],capabilities:structuredClone(e.capabilities),ttlMs:t,cacheScope:"public",...e.instructions?{instructions:e.instructions}:{}},e.serverInfo)}function Vk(e,t){if(h(e)&&typeof e.resultType=="string")return e.resultType;if(t==="legacy")return"complete";throw new u("Modern MCP result is missing resultType",m.invalidParams,{required:"resultType"})}(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]="d4a56906-c542-567e-9265-15184a5c330b")}catch{}})();var zh=new Set(["--help","-h","--version","-V"]);function Hh(e,t){let r=[`Usage: ${e==="stdio"?"pm-mcp":"pm-mcp-http"} [--help | --version]`,"",e==="stdio"?"JSON-RPC over stdin/stdout. With no arguments, starts the stdio server.":"Streamable HTTP POST /mcp. With no arguments, starts the HTTP server.","","Options:"," -h, --help Print help and exit before transport startup."," -V, --version Print the package version and exit.","","Environment:"," PM_PATH Tracker root (otherwise discovered from cwd)."," PM_GLOBAL_PATH Global settings root."," PM_MCP_PROFILE core (default), standard, full, or custom."," PM_MCP_TOOLS Comma-separated tool allowlist for custom profile."," PM_MCP_DISCOVERY_CURSOR_KEY Shared discovery cursor secret, at least 32 UTF-8 bytes."," PM_MCP_BAGGAGE_ALLOWLIST Comma-separated permitted trace baggage keys."];return e==="http"&&r.push(" PM_MCP_HTTP_HOST Bind host (default 127.0.0.1)."," PM_MCP_HTTP_PORT Bind port, 0..65535 (default 3000)."," PM_MCP_HTTP_ALLOWED_ORIGINS Comma-separated exact browser origins (default none)."," PM_MCP_HTTP_BEARER_TOKEN Deployment token for the bundled verifier."," PM_MCP_HTTP_AUTH_ISSUER Exact HTTPS authorization-server issuer."," PM_MCP_HTTP_RESOURCE Canonical resource/audience URI."," PM_MCP_HTTP_SCOPES Space-separated scopes (default pm:read pm:write).","","Non-loopback HTTP requires bearer token, issuer, and resource together."),r.push("",`MCP protocol: ${re.join(", ")}.`,e==="stdio"?`Legacy initialize compatibility: ${rr.join(", ")}.`:"HTTP requires modern per-request metadata; legacy initialize is stdio-only.","",e==="stdio"?"Client configuration:":"Example loopback server:",e==="stdio"?JSON.stringify({mcpServers:{pm:{command:"npx",args:["--yes","--package",`@unbrained/pm-cli@${t}`,"pm-mcp"]}}}):`PM_MCP_HTTP_PORT=3000 npx --yes --package @unbrained/pm-cli@${t} pm-mcp-http`,...e==="http"?["HTTP client configuration:",JSON.stringify({mcpServers:{pm:{url:"http://127.0.0.1:3000/mcp"}}})]:[],"","Configuration: https://github.com/unbraind/pm-cli/blob/main/docs/MCP_REMOTE_TRANSPORT_SECURITY.md",""),r.join(`
2
- `)}function Yk(e,t,r){if(e.length===0)return{kind:"serve"};let o=e.find(n=>!zh.has(n));if(o!==void 0){let n=t==="stdio"?"pm-mcp":"pm-mcp-http";return{kind:"exit",exitCode:64,stdout:"",stderr:`Unsupported argument ${JSON.stringify(o)}. Run ${n} --help.
3
- `}}return{kind:"exit",exitCode:0,stdout:e.includes("--help")||e.includes("-h")?Hh(t,r):`${r}
4
- `,stderr:""}}import{createHash as ir,createHmac as sr,timingSafeEqual as Vh}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]="15b81dd0-ef1a-58be-b6ee-5975b6778993")}catch{}})();var Kh=["elicitation/create","roots/list","sampling/createMessage"],or=class extends Error{inputRequests;requestState;constructor(t){super("MCP operation requires additional input"),this.name="PmMcpInputRequiredError",this.inputRequests=t.inputRequests,this.requestState=t.requestState}},ar=/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/u,ye=32,et=64*1024,be=16*1024,Qe={maxBytes:256*1024,maxDepth:32,maxNodes:4096};function Wh(e){return e==="elicitation/create"?"elicitation":e==="sampling/createMessage"?"sampling":"roots"}function Te(e,t,r){let o;try{o=JSON.stringify(e)}catch{throw new u(`Invalid ${r}: value is not JSON serializable`,m.invalidParams,{field:r})}if(Buffer.byteLength(o,"utf8")>t)throw new u(`Invalid ${r}: payload exceeds the protocol bound`,m.invalidParams,{field:r,maximumBytes:t})}function tt(e,t){if(!h(e))throw new u("Invalid MCP inputRequests",m.invalidParams,{field:"inputRequests",expected:"object"});let r=Object.entries(e);if(r.length===0||r.length>ye)throw new u("Invalid MCP inputRequests count",m.invalidParams,{minimum:1,maximum:ye,observed:r.length});let o={};for(let[n,s]of r){if(!ar.test(n)||!h(s))throw new u("Invalid MCP input request entry",m.invalidParams,{field:`inputRequests.${n}`});let i=s.method;if(typeof i!="string"||!Kh.includes(i))throw new u("Unsupported MCP input request method",m.invalidParams,{field:`inputRequests.${n}.method`,method:i??null});let a=Wh(i);if(!Object.prototype.hasOwnProperty.call(t.clientCapabilities,a))throw new u("Missing required client capability",m.missingRequiredClientCapability,{requiredCapabilities:{[a]:{}}});if(!h(s.params))throw new u("Invalid MCP input request parameters",m.invalidParams,{field:`inputRequests.${n}.params`,expected:"object"});o[n]={method:i,params:structuredClone(s.params)}}return Te(o,et,"inputRequests"),o}function dr(e){if(!h(e))throw new u("Invalid MCP inputResponses",m.invalidParams,{field:"inputResponses",expected:"object"});let t=Object.entries(e);if(t.length>ye)throw new u("Invalid MCP inputResponses count",m.invalidParams,{maximum:ye,observed:t.length});let r={};for(let[o,n]of t){if(!ar.test(o)||!h(n))throw new u("Invalid MCP input response entry",m.invalidParams,{field:`inputResponses.${o}`});r[o]=structuredClone(n)}return Te(r,et,"inputResponses"),r}function Qk(e){let t=e.requestState?.trim();if(t&&Buffer.byteLength(t,"utf8")>be)throw new u("Invalid MCP requestState: payload exceeds the protocol bound",m.invalidParams,{field:"requestState",maximumBytes:be});let r=e.inputRequests===void 0?void 0:tt(e.inputRequests,e.requestContext);if(r===void 0&&!t)throw new u("InputRequiredResult requires inputRequests or requestState",m.invalidParams,{requiredAnyOf:["inputRequests","requestState"]});return{resultType:"input_required",...r?{inputRequests:r}:{},...t?{requestState:t}:{},_meta:{[E.serverInfo]:{...e.serverInfo}}}}function cr(e){let t=Buffer.from(e);if(t.byteLength<32)throw new u("MCP requestState signing key must contain at least 32 bytes",m.invalidParams,{minimumBytes:32});return t}function ex(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 u("Invalid MCP requestState payload",m.invalidParams);let r=Buffer.from(JSON.stringify({version:1,...e}),"utf8");if(r.byteLength>be/2)throw new u("MCP requestState payload exceeds the protocol bound",m.invalidParams,{maximumBytes:be/2});let o=r.toString("base64url"),n=sr("sha256",cr(t)).update(o).digest("base64url");return`${o}.${n}`}function Yh(e){if(!h(e)||e.version!==1)throw new u("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});let{expiresAt:t,method:r,parameterDigest:o,principal:n,state:s}=e;if(typeof t!="number"||!Number.isSafeInteger(t))throw new u("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});if(typeof r!="string"||typeof o!="string"||typeof n!="string")throw new u("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});return{expiresAt:t,method:r,parameterDigest:o,principal:n,state:s}}function tx(e,t,r){let[o,n,s]=e.split(".");if(!o||!n||s!==void 0)throw new u("Invalid MCP requestState encoding",m.invalidParams,{field:"requestState"});let i=Buffer.from(n,"base64url"),a=sr("sha256",cr(t)).update(o).digest();if(i.byteLength!==a.byteLength||!Vh(i,a))throw new u("Invalid MCP requestState signature",m.invalidParams,{field:"requestState"});let d;try{d=JSON.parse(Buffer.from(o,"base64url").toString("utf8"))}catch{d=null}let c=Yh(d),{expiresAt:l,method:p,parameterDigest:f,principal:_}=c;if(l<(r.nowMs??Date.now()))throw new u("Expired MCP requestState",m.invalidParams,{field:"requestState",expiredAt:l});if(p!==r.method||f!==r.parameterDigest||_!==r.principal)throw new u("MCP requestState binding mismatch",m.invalidParams,{field:"requestState"});return c}function rx(e){return Te(e,et,"request parameters"),ir("sha256").update(JSON.stringify(e)).digest("hex")}var nr=class{#e=new Set;#t;constructor(t=4096){if(!Number.isSafeInteger(t)||t<1)throw new u("Invalid MCP replay guard capacity",m.invalidParams,{maximumEntries:t});this.#t=t}consume(t){let r=ir("sha256").update(t).digest("hex");if(this.#e.has(r))throw new u("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 Xh(e){if(!Number.isSafeInteger(e.ttlMs)||e.ttlMs<0||e.cacheScope!=="public"&&e.cacheScope!=="private")throw new u("Invalid MCP cache policy",m.invalidParams,{ttlMs:e.ttlMs,cacheScope:e.cacheScope});return{ttlMs:e.ttlMs,cacheScope:e.cacheScope}}function ox(e,t){return{...e,...Xh(t)}}function Jh(e){return e.replaceAll("~1","/").replaceAll("~0","~")}function Zh(e,t){if(t==="#")return e;if(!t.startsWith("#/"))return;let r=e;for(let o of t.slice(2).split("/").map(Jh)){if(!h(r)&&!Array.isArray(r)||!Object.prototype.hasOwnProperty.call(r,o))return;r=r[o]}return r}function Qh(e){let t=e.maxBytes??Qe.maxBytes,r=e.maxDepth??Qe.maxDepth,o=e.maxNodes??Qe.maxNodes;if(!Number.isSafeInteger(t)||t<2)throw new u("Invalid MCP JSON Schema work bounds",m.invalidParams);if(!Number.isSafeInteger(r)||r<1)throw new u("Invalid MCP JSON Schema work bounds",m.invalidParams);if(!Number.isSafeInteger(o)||o<1)throw new u("Invalid MCP JSON Schema work bounds",m.invalidParams);return{maximumBytes:t,maximumDepth:r,maximumNodes:o}}function eg(e,t){let r=Array.isArray(e.value)?e.value:h(e.value)?Object.values(e.value):[];for(let o of r)t.push({value:o,depth:e.depth+1})}function tg(e,t){if(!h(t)||typeof t.$ref!="string")return;let r=t.$ref;if(r.startsWith("#")&&Zh(e,r)===void 0)throw new u("MCP JSON Schema contains an unresolved local reference",m.invalidParams,{reference:r})}function nx(e,t={}){let{maximumBytes:r,maximumDepth:o,maximumNodes:n}=Qh(t);if(typeof e!="boolean"&&!h(e))throw new u("Invalid MCP JSON Schema root",m.invalidParams,{expected:"object or boolean"});Te(e,r,"JSON Schema");let s=[{value:e,depth:0}],i=0;for(;s.length>0;){let a=s.pop();if(i+=1,i>n||a.depth>o)throw new u("MCP JSON Schema exceeds validation work bounds",m.invalidParams,{maximumDepth:o,maximumNodes:n});tg(e,a.value),eg(a,s)}return structuredClone(e)}import{randomUUID as rg}from"node:crypto";import{readFile as og}from"node:fs/promises";import lr 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]="f3e94896-b2a0-561c-902b-71c28ddde2a1")}catch{}})();var ux="io.modelcontextprotocol/tasks",ng=["working","input_required","completed","failed","cancelled"],ig=/^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,sg=3600*1e3,ag=1e3,Se=1024,dg=30,cg=2e3;function rt(e){return new u(e,m.invalidParams,{code:"mcp_task_not_found_or_not_authorized"})}function Ce(e){let t=e.trim();if(!ig.test(t))throw rt("Unknown MCP task");return t}function pr(e,t){if(typeof e!="string"||!Number.isFinite(Date.parse(e)))throw new u("Corrupt MCP task record",m.invalidParams,{field:t});return e}function ur(e){if(!h(e)||typeof e.code!="number"||!Number.isFinite(e.code)||typeof e.message!="string")throw new u("Corrupt MCP task error",m.invalidParams);return{code:e.code,message:e.message.slice(0,Se),...h(e.data)?{data:structuredClone(e.data)}:{}}}function lg(e){if(!ng.includes(e))throw new u("Corrupt MCP task record",m.invalidParams);return e}function pg(e){if(typeof e!="string"||e.length===0)throw new u("Corrupt MCP task record",m.invalidParams);return e}function ug(e){if(typeof e!="number"||!Number.isSafeInteger(e)||e<1)throw new u("Corrupt MCP task record",m.invalidParams);return e}function mg(e){if(e!==null&&(typeof e!="number"||!Number.isSafeInteger(e)||e<0))throw new u("Corrupt MCP task record",m.invalidParams);return e}function fg(e){if(e!==void 0){if(typeof e!="number"||!Number.isSafeInteger(e)||e<0)throw new u("Corrupt MCP task record",m.invalidParams);return e}}function _g(e){if(!Array.isArray(e)||e.some(t=>typeof t!="string"))throw new u("Corrupt MCP task record",m.invalidParams);return[...e]}function hg(e){if(!h(e)||e.version!==1)throw new u("Corrupt MCP task record",m.invalidParams);let t=typeof e.taskId=="string"?Ce(e.taskId):"",r=lg(e.status),o=pg(e.principal),n=ug(e.workerPid),s=mg(e.ttlMs),i=fg(e.pollIntervalMs),a={version:1,taskId:t,status:r,principal:o,workerPid:n,createdAt:pr(e.createdAt,"createdAt"),lastUpdatedAt:pr(e.lastUpdatedAt,"lastUpdatedAt"),ttlMs:s,consumedInputKeys:_g(e.consumedInputKeys),...typeof e.statusMessage=="string"?{statusMessage:e.statusMessage.slice(0,Se)}:{},...typeof i=="number"?{pollIntervalMs:i}:{}};if(h(e.inputRequests)&&(a.inputRequests=structuredClone(e.inputRequests)),h(e.inputResponses)&&(a.inputResponses=structuredClone(e.inputResponses)),h(e.result)&&(a.result=structuredClone(e.result)),e.error!==void 0&&(a.error=ur(e.error)),a.status==="input_required"&&!a.inputRequests||a.status==="completed"&&!a.result||a.status==="failed"&&!a.error)throw new u("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 oe(e){return e==="completed"||e==="failed"||e==="cancelled"}function gg(e){try{return process.kill(e,0),!0}catch(t){return!(typeof t=="object"&&t!==null&&"code"in t&&t.code==="ESRCH")}}var ot=class{#e;#t;#r;#o;#i;constructor(t){this.#e=lr.resolve(t.pmRoot),this.#t=t.owner?.trim()||"pm-mcp",this.#r=t.now??(()=>new Date),this.#o=t.taskIdFactory??(()=>`mcp-task-${rg()}`),this.#i=t.workerPid??process.pid}#s(t){return lr.join(this.#e,"runtime","mcp-tasks","records",`${Ce(t)}.json`)}async#d(t){try{return hg(JSON.parse(await og(this.#s(t),"utf8")))}catch(r){throw fe(r)||r instanceof SyntaxError?rt("Unknown MCP task"):r}}async#a(t){await $e(this.#s(t.taskId),`${JSON.stringify(t,null,2)}
5
- `)}async#n(t,r,o){let n=Ce(t),s=await je(this.#e,n,dg,this.#t,!1,!1,cg);try{let i=await this.#d(n);if(i.principal!==r)throw rt("Unknown MCP task");let a=o(i);return await this.#a(a),a}finally{await s()}}async create(t){let r=Ce(this.#o()),o=t.principal.trim(),n=t.ttlMs===void 0?sg:t.ttlMs,s=t.pollIntervalMs??ag;if(o.length===0||n!==null&&(!Number.isSafeInteger(n)||n<0)||!Number.isSafeInteger(s)||s<0)throw new u("Invalid MCP task creation options",m.invalidParams);let i=this.#r().toISOString(),a={version:1,taskId:r,status:"working",createdAt:i,lastUpdatedAt:i,ttlMs:n,pollIntervalMs:s,principal:o,workerPid:this.#i,consumedInputKeys:[],...t.statusMessage?.trim()?{statusMessage:t.statusMessage.trim().slice(0,Se)}:{}};return await this.#a(a),{...V(a),resultType:"task"}}async get(t,r){return V(await this.#n(t,r,o=>{if(oe(o.status))return o;let n=this.#r().getTime(),s=o.ttlMs!==null&&Date.parse(o.createdAt)+o.ttlMs<=n,i=o.workerPid!==this.#i&&!gg(o.workerPid);return!s&&!i?o:{...o,status:"failed",statusMessage:s?"Task retention expired before completion.":"Task worker ended before recording a terminal result.",lastUpdatedAt:this.#r().toISOString(),error:{code:-32603,message:s?"MCP task expired":"MCP task worker unavailable after restart",data:{recoverable:!1,createNewTask:!0}},inputRequests:void 0}}))}async requireInput(t){let r=tt(t.inputRequests,t.requestContext);return V(await this.#n(t.taskId,t.principal,o=>{if(oe(o.status))return o;let n=Object.keys(r).filter(s=>o.consumedInputKeys.includes(s));if(n.length>0)throw new u("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,Se),lastUpdatedAt:this.#r().toISOString(),inputRequests:r}}))}async update(t,r,o){let n=dr(o),s=[],i=[];return await this.#n(t,r,a=>{if(a.status!=="input_required"||!a.inputRequests)return a;let d={...a.inputRequests},c=a.inputResponses?{...a.inputResponses}:{};for(let[l,p]of Object.entries(n))Object.prototype.hasOwnProperty.call(d,l)&&(c[l]=p,delete d[l],s.push(l));return i=Object.keys(d).sort(),s.length===0?a:{...a,status:i.length===0?"working":"input_required",lastUpdatedAt:this.#r().toISOString(),inputRequests:i.length===0?void 0:d,inputResponses:c,consumedInputKeys:[...new Set([...a.consumedInputKeys,...s])].sort()}}),{acceptedKeys:s.sort(),remainingKeys:i}}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=>oe(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=ur(o);return V(await this.#n(t,r,s=>oe(s.status)?s:{...s,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=>oe(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 mx(e){return new ot(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]="15cbe26a-5716-5e8c-8700-eb36a1a056d6")}catch{}})();var we="io.modelcontextprotocol/subscriptionId",mr=256,fr=2048,yg=5e3;function bg(e,t){return new Promise((r,o)=>{let n=setTimeout(()=>o(new Error("MCP subscription sink write timed out")),yg);n.unref(),Promise.resolve().then(()=>e(t)).then(()=>{clearTimeout(n),r()},s=>{clearTimeout(n),o(s instanceof Error?s:new Error(String(s)))})})}function nt(e,t){if(e!==void 0){if(typeof e!="boolean")throw new u("Invalid MCP subscription filter",m.invalidParams,{field:`notifications.${t}`,expected:"boolean"});return e||void 0}}function Tg(e){if(!h(e))throw new u("Invalid MCP subscription filter",m.invalidParams,{field:"notifications",expected:"object"});let t=nt(e.toolsListChanged,"toolsListChanged"),r=nt(e.promptsListChanged,"promptsListChanged"),o=nt(e.resourcesListChanged,"resourcesListChanged"),n;if(e.resourceSubscriptions!==void 0){if(!Array.isArray(e.resourceSubscriptions)||e.resourceSubscriptions.length>mr)throw new u("Invalid MCP resource subscriptions",m.invalidParams,{field:"notifications.resourceSubscriptions",maximum:mr});let s=new Set;for(let i of e.resourceSubscriptions){if(typeof i!="string"||i.trim().length===0||Buffer.byteLength(i,"utf8")>fr)throw new u("Invalid MCP resource subscription URI",m.invalidParams,{field:"notifications.resourceSubscriptions",maximumBytes:fr});s.add(i)}s.size>0&&(n=[...s].sort())}return{...t?{toolsListChanged:t}:{},...r?{promptsListChanged:r}:{},...o?{resourcesListChanged:o}:{},...n?{resourceSubscriptions:n}:{}}}function Cg(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 _r=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 u("MCP subscription id is already active",m.invalidParams,{subscriptionId:t.id});let r=Cg(Tg(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:{[we]: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[s,i]of this.#t)i.filter[r]===!0&&n.push(this.#o(s,i,{jsonrpc:"2.0",method:o,params:{_meta:{[we]:s}}}));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:{[we]:o},uri:t}}));return(await Promise.all(r)).filter(Boolean).length}async#o(t,r,o,n=!1){let s=r.writeQueue.then(async()=>{if(this.#t.get(t)!==r)return!1;try{return await bg(r.sink,o),!0}catch(i){if(this.#t.get(t)===r&&this.#t.delete(t),n)throw i;return!1}});return r.writeQueue=s.then(()=>{},()=>{}),s}close(t){if(this.#t.delete(t))return{...Ze({resultType:"complete",_meta:{[we]: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]="3681273a-e101-57a0-9446-982c450e7183")}catch{}})();var hr=/^=\?base64\?([A-Za-z0-9+/]*={0,2})\?=$/u,Sg=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/u,gr=/^[\t\x20-\x7E]*$/u,yr=new Set(["prompts/get","resources/read","tools/call"]);function wg(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 u(e,m.headerMismatch,{header:t})}function br(e){let t=typeof e=="boolean"?String(e).toLowerCase():String(e);return t.length>0&&t.trim()===t&&gr.test(t)&&!hr.test(t)?t:`=?base64?${Buffer.from(t,"utf8").toString("base64")}?=`}function Tr(e,t){let r=hr.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||!gr.test(e)?A("Malformed MCP header value",t):e}function Ee(e){return Array.isArray(e)?e.some(Ee):h(e)?Object.prototype.hasOwnProperty.call(e,"x-mcp-header")||Object.values(e).some(Ee):!1}function Eg(e,t,r){let o=e["x-mcp-header"];if(o===void 0)return;let n=e.type;if(typeof o!="string"||!Sg.test(o)||!["boolean","integer","string"].includes(String(n))||r.has(o.toLowerCase()))throw new u("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 Cr(e){if(!h(e))throw new u("Invalid MCP tool schema",m.invalidParams,{field:"inputSchema",expected:"object"});let t=[],r=new Set,o=(n,s)=>{let i=n.properties;if(i!==void 0){if(!h(i))throw new u("Invalid MCP tool schema properties",m.invalidParams,{field:"inputSchema.properties"});for(let[a,d]of Object.entries(i)){if(!h(d))continue;let c=[...s,a],l=Eg(d,c,r);l&&t.push(l);for(let[p,f]of Object.entries(d))if(p!=="properties"&&p!=="x-mcp-header"&&Ee(f))throw new u("MCP x-mcp-header is not statically reachable",m.invalidParams,{field:c.join("."),keyword:p});o(d,c)}}};for(let[n,s]of Object.entries(e))if(n!=="properties"&&Ee(s))throw new u("MCP x-mcp-header is not statically reachable",m.invalidParams,{field:"inputSchema",keyword:n});return o(e,[]),t}function Sr(e,t){let r=e;for(let o of t){if(!h(r))return;r=r[o]}return r}function wr(e,t){let r=e==="resources/read"?t.uri:t.name;return typeof r=="string"?r:void 0}function Ag(e,t){let r=h(e.arguments)?e.arguments:{},o={};for(let n of Cr(t)){let s=Sr(r,n.path);if(s!=null){if(!(n.type==="integer"&&typeof s=="number"&&Number.isSafeInteger(s)||n.type==="boolean"&&typeof s=="boolean"||n.type==="string"&&typeof s=="string"))throw new u("Invalid MCP custom header argument",m.invalidParams,{field:n.path.join("."),expected:n.type});o[`Mcp-Param-${n.name}`]=br(s)}}return o}function yx(e){let t=h(e.request.params)?e.request.params:void 0,r=Je(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},s=wr(o,t);if(yr.has(o)){if(s===void 0)return A("Missing MCP request name","Mcp-Name");n["Mcp-Name"]=br(s)}return o==="tools/call"&&e.toolSchema!==void 0&&Object.assign(n,Ag(t,e.toolSchema)),n}function vg(e,t){let r=t.method;(typeof r!="string"||r.length===0)&&A("Missing MCP request method","Mcp-Method");let o=h(t.params)?t.params:void 0,n=Je(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"),yr.has(r)){let s=e.get("mcp-name"),i=wr(r,o);(s===void 0||i===void 0||Tr(s,"Mcp-Name")!==i)&&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 Og(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 Pg(e){let t=h(e.params.arguments)?e.params.arguments:{};for(let r of Cr(e.toolSchema)){let o=Sr(t,r.path),n=`Mcp-Param-${r.name}`,s=e.headers.get(n.toLowerCase());if(o==null){s!==void 0&&A("Unexpected MCP parameter header",n);continue}s===void 0&&A("Missing MCP parameter header",n),Og(r,o,Tr(s,n))||A("MCP parameter header does not match request body",n)}}function bx(e){let t=wg(e.headers),r=typeof e.request.method=="string"?e.request.method:"";vg(t,e.request),!(r!=="tools/call"||e.toolSchema===void 0)&&Pg({headers:t,params:e.request.params,toolSchema:e.toolSchema})}var Tx=H;import{AsyncLocalStorage as Rg}from"node:async_hooks";import{createHash as Er,timingSafeEqual as Ig}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]="a7c30d99-a0e4-552e-be61-0c54a455e211")}catch{}})();var y=class extends Error{httpStatus;challenge;constructor(t,r,o){super(t),this.name="PmMcpAuthorizationError",this.httpStatus=r,this.challenge=o}},Mg=/^00-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})$/u,kg=/^[a-z][a-z0-9_*/-]{0,255}$/u,xg=/^(?:[a-z0-9][a-z0-9_*/-]{0,240})@[a-z][a-z0-9_*/-]{0,13}$/u,Ng=/^[\x20-\x2B\x2D-\x3C\x3E-\x7E]{0,255}[\x21-\x2B\x2D-\x3C\x3E-\x7E]$/u,vr=/^[\x21\x23-\x5B\x5D-\x7E]+$/u,Or=/^[A-Za-z0-9!#$%&'*+.^_`|~-]+$/u,Lg=/^[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]*$/u,Dg=/%(?![0-9A-Fa-f]{2})/u,$g=512,Fg=32,Gg=180,Ug=8192,jg=8192,Pr=new Rg;function w(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 Bg(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 Ax(e){let t=w(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=>w(n,"authorization server issuer").href.replace(/\/$/u,"")),o=[...new Set(e.scopes??[])];if(o.some(n=>!vr.test(n)))throw new y("Invalid authorization scope",401);return{resource:t,authorization_servers:r,...o.length>0?{scopes_supported:o.sort()}:{}}}function vx(e){let t=w(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 Ox(e,t){if(!h(e)||typeof e.issuer!="string")throw new y("Invalid authorization server metadata",401);let r=w(t,"expected issuer").href.replace(/\/$/u,"");if(w(e.issuer,"metadata issuer").href.replace(/\/$/u,"")!==r)throw new y("Authorization server issuer mismatch",401);if(!Array.isArray(e.code_challenge_methods_supported)||!e.code_challenge_methods_supported.includes("S256"))throw new y("Authorization server does not support required S256 PKCE",401);let o=d=>{let c=e[d];if(typeof c!="string")throw new y(`Authorization server metadata requires ${d}`,401);return w(c,d).href},n=d=>{let c=e[d];return typeof c=="string"?w(c,d).href:void 0},s=o("authorization_endpoint"),i=o("token_endpoint"),a=n("registration_endpoint");return{issuer:r,authorization_endpoint:s,token_endpoint:i,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}:{},...a?{registration_endpoint:a}:{}}}function Px(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 Rx(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 Ix(e,t){let r=w(t,"client metadata document URL");if(r.pathname==="/"||!h(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);w(o,"client redirect URI",!0)}return structuredClone(e)}function Mx(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=>w(r,"redirect URI",!0).href);return{application_type:e.applicationType,client_name:e.clientName.trim().slice(0,128),redirect_uris:t,grant_types:["authorization_code","refresh_token"],response_types:["code"],token_endpoint_auth_method:"none"}}var Ar=class{#e=new Map;set(t,r){let o=w(t,"credential issuer").href;this.#e.set(o,structuredClone(r))}get(t){let r=w(t,"credential issuer").href,o=this.#e.get(r);return o?structuredClone(o):void 0}delete(t){let r=w(t,"credential issuer").href;return this.#e.delete(r)}};function qg(e){let t=e.traceparent,r=e.tracestate;if(t!==void 0){let o=typeof t=="string"?Mg.exec(t):null;if(!o)throw new y("Invalid MCP traceparent",403);let n=o[1],s=o[2];if(/^0+$/u.test(n)||/^0+$/u.test(s))throw new y("Invalid MCP traceparent",403)}if(r!==void 0&&(typeof r!="string"||!Hg(r)))throw new y("Invalid MCP tracestate",403);return{...typeof t=="string"?{traceparent:t}:{},...typeof r=="string"?{tracestate:r}:{}}}function $(e){return e.replace(/^[ \t]*|[ \t]*$/gu,"")}function zg(e){return kg.test(e)||xg.test(e)}function Hg(e){if(Buffer.byteLength(e,"utf8")>$g)return!1;let t=e.split(",");if(t.length>Fg)return!1;let r=new Set;for(let o of t){let n=$(o);if(n.length===0)continue;let s=n.indexOf("="),i=s>0?n.slice(0,s):"",a=s>0?n.slice(s+1):"";if(!zg(i)||!Ng.test(a)||r.has(i))return!1;r.add(i)}return!0}function Rr(e){return Lg.test(e)&&!Dg.test(e)}function Vg(e){let t=$(e),r=t.indexOf("="),o=$(r>=0?t.slice(0,r):t),n=r>=0?$(t.slice(r+1)):void 0;return Or.test(o)&&(n===void 0||Rr(n))}function Kg(e){let t=$(e),r=t.split(";"),o=r[0],n=r.slice(1),s=o.indexOf("="),i=$(s>0?o.slice(0,s):""),a=s>0?$(o.slice(s+1)):"";if(!(!Or.test(i)||!Rr(a)||!n.every(Vg)))return{key:i,serialized:t}}function Wg(e,t){if(e===void 0)return;if(typeof e!="string"||Buffer.byteLength(e,"utf8")>Ug)throw new y("Invalid MCP baggage",403);let r=new Set(t),o=e.split(",");if(o.length>Gg)throw new y("Invalid MCP baggage",403);let n=[];for(let s of o){let i=Kg(s);if(!i)throw new y("Invalid MCP baggage",403);r.has(i.key)&&n.push(i.serialized)}return n.length>0?n.join(","):void 0}function kx(e,t={}){let r=h(e)&&h(e._meta)?e._meta:{},o=Wg(r.baggage,t.baggageAllowlist??[]);return{...qg(r),...o?{baggage:o}:{}}}function xx(e,t){return Pr.run(structuredClone(e),t)}function Nx(){let e=Pr.getStore();return e?{...e}:void 0}async function Lx(e){let t=w(e.policy.resourceMetadataUrl,"protected resource metadata URL",!0).href,r=[...new Set(e.policy.requiredScopes??[])];if(r.some(c=>!vr.test(c)))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 n=Bg(e.headers,"authorization")?.match(/^Bearer ([^\s]+)$/iu);if(!n)throw new y("Missing or malformed bearer token",401,o);let s=n[1];if(Buffer.byteLength(s,"utf8")>jg)throw new y("Missing or malformed bearer token",401,o);let i;try{i=await e.policy.verifyAccessToken(s)}catch{throw new y("Invalid bearer token",401,o)}let a=Array.isArray(i.audience)?i.audience:[i.audience];if(i.issuer!==e.policy.issuer||!a.includes(e.policy.resource))throw new y("Bearer token issuer or audience mismatch",401,o);let d=r.filter(c=>!i.scopes.includes(c));if(d.length>0)throw new y("Bearer token has insufficient scope",403,`${o}, scope="${d.join(" ")}"`);return{...i,audience:[...a],scopes:[...i.scopes]}}function Dx(e){let t=Er("sha256").update(e.token).digest();return r=>{let o=Er("sha256").update(r).digest();if(!Ig(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]="46f5fe59-6b84-5c68-ad07-bb1329f4ea29")}catch{}})();var it="io.modelcontextprotocol/ui",Ae="2026-01-26",kr="text/html;profile=mcp-app",Ir=Object.freeze({specVersion:Ae,mimeTypes:[kr]});function Gx(e){let t=e.clientCapabilities.extensions;if(!h(t))return!1;let r=t[it];if(r===void 0)return!1;if(!h(r))throw new u("Invalid MCP Apps client capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[it]:Ir}}});let o=r.mimeTypes,n=r.specVersion;if(!Array.isArray(o)||!o.includes(kr)||n!==void 0&&n!==Ae)throw new u("Unsupported MCP Apps client capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[it]:Ir}}});return!0}var Yg={csp:{connectDomains:[],resourceDomains:[],frameDomains:[]},permissions:{},prefersBorder:!0},xr=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:Yg})));function Ux(e){return xr.find(t=>t.uri===e)}function jx(e){let t=new Map(xr.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 Mr(e){return e.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;")}function Bx(e){let t=Mr(e.name),r=Mr(e.description),o=JSON.stringify({name:`pm-${e.id}-view`,version:Ae}),n=JSON.stringify(Ae);return`<!doctype html>
1
+ import{a as jh}from"./chunks/chunk-YYD5MNAV.js";import{a as E0,b as A0,c as v0,d as O0}from"./chunks/chunk-D3AIQZXF.js";import{a as P0,b as R0,c as I0,d as M0,e as k0,f as x0,g as N0,h as L0,i as D0,j as $0,k as F0,l as G0,m as U0,n as j0,o as B0,p as q0,q as z0}from"./chunks/chunk-ZX3XMTZG.js";import{A as b0,B as T0,C as C0,D as S0,E as w0,a as Jn,b as LA,c as DA,d as Ua,e as ja,f as Ba,h as qa,i as za,j as Ha,k as Va,l as Ka,m as Wa,n as Ya,o as Xa,p as sd,q as ad,r as dd,s as cd,t as ld,u as m0,v as f0,w as _0,x as h0,y as g0,z as y0}from"./chunks/chunk-2J7I54MQ.js";import{a as hw,b as gw,c as yw,d as bw,e as Tw}from"./chunks/chunk-3KMYHYJV.js";import{A as gk,B as yk,C as bk,D as Tk,E as Ck,F as Sk,G as wk,H as Ek,I as Ak,J as vk,K as Ok,L as Pk,M as Rk,N as Ik,O as Mk,P as kk,Q as xk,R as Nk,S as Lk,T as Dk,U as $k,V as Fk,W as Gk,X as Uk,Y as jk,Z as Bk,_ as qk,a as H0,b as V0,c as K0,d as W0,e as Y0,f as X0,g as J0,h as Z0,i as Q0,j as ek,k as tk,l as rk,m as ok,n as nk,o as ik,p as sk,q as ak,r as dk,s as ck,t as lk,u as pk,v as uk,w as mk,x as fk,y as _k,z as hk}from"./chunks/chunk-E5QBZ4HI.js";import{$ as Sm,$a as __,$b as _h,A as sm,Aa as $f,Ab as B_,B as am,Ba as Ff,Bb as q_,C as dm,Ca as Gf,Cb as z_,D as lm,Da as Uf,Db as H_,E as pm,Ea as jf,Eb as V_,F as qt,Fa as Bf,Fb as K_,G as zt,Ga as qf,Gb as W_,H as Ht,Ha as zf,Hb as Y_,I as Vt,Ia as Hf,Ib as X_,J as Kt,Ja as Vf,Jb as J_,K as Wt,Ka as Kf,Kb as Z_,L as Yt,La as Wf,Lb as Q_,M as Xt,Ma as Yf,Mb as eh,N as Jt,Na as Xf,Nb as th,O as Zt,Oa as Jf,Ob as rh,P as Qt,Pa as Zf,Pb as oh,Q as um,Qa as Qf,Qb as nh,R as mm,Ra as e_,Rb as ih,S as fm,Sa as t_,Sb as sh,T as _m,Ta as r_,Tb as ah,U as hm,Ua as er,Ub as dh,V as Xe,Va as ge,Vb as ch,W as gm,Wa as l_,Wb as lh,X as ym,Xa as p_,Xb as ph,Y as bm,Ya as u_,Yb as uh,Z as Tm,Za as m_,Zb as mh,_ as Cm,_a as f_,_b as fh,a as lw,aa as wm,ab as h_,ac as hh,b as pw,ba as Em,bb as g_,bc as gh,c as uw,ca as WM,cb as y_,cc as yh,d as mw,da as YM,db as b_,dc as bh,e as fw,ea as XM,eb as T_,ec as Th,f as _w,fa as $m,fb as C_,fc as Ch,g as uA,ga as Fm,gb as S_,gc as Sh,h as mA,ha as Gm,hb as w_,hc as wh,i as fA,ia as Of,ib as E_,ic as Eh,j as _A,ja as Pf,jb as A_,jc as Ah,k as Zi,ka as i0,kb as v_,kc as vh,l as sR,la as s0,lb as O_,lc as Oh,m as aR,ma as a0,mb as P_,mc as Ph,n as dR,na as d0,nb as R_,nc as Rh,o as cR,oa as c0,ob as I_,oc as Ih,p as lR,pa as l0,pb as M_,pc as Mh,q as pR,qa as p0,qb as k_,qc as kh,r as bl,ra as u0,rb as x_,rc as xh,s as Yp,sa as Rf,sb as N_,sc as Nh,t as Xp,ta as If,tb as L_,tc as Lh,u as Qp,ua as Mf,ub as D_,uc as Dh,v as eu,va as kf,vb as $_,vc as $h,w as bu,wa as xf,wb as F_,wc as Fh,x as vu,xa as Nf,xb as G_,xc as Gh,y as DI,ya as Lf,yb as U_,yc as Uh,z as Ye,za as Df,zb as j_}from"./chunks/chunk-YUBUNECD.js";import{e as fR,f as _R,g as Tl,h as Cl,i as Ut}from"./chunks/chunk-DKLEDWVW.js";import{A as $M,B as FM,C as GM,D as UM,E as jM,F as BM,G as qM,H as zM,I as HM,J as VM,K as KM,L as Om,M as Pm,N as Rm,O as Im,P as Mm,Q as km,R as xm,S as Nm,T as Lm,U as Dm,a as bI,b as TI,c as CI,d as SI,e as wI,f as Wp,g as EI,h as AI,i as vI,j as OI,k as PI,m as cm,n as Am,o as vM,p as OM,q as PM,r as RM,s as IM,t as MM,u as vm,v as kM,w as xM,x as NM,y as LM,z as DM}from"./chunks/chunk-XHONSCLJ.js";import{$ as GP,$a as Zl,$b as ru,$c as rf,A as fP,Aa as Ol,Ab as $p,Ac as Ru,Ad as i_,B as _P,Ba as Pl,Bb as Fp,Bc as Qu,Bd as s_,C as hP,Ca as Rl,Cb as Gp,Cc as em,Cd as a_,D as gP,Da as Il,Db as Up,Dc as tm,Dd as d_,E as yP,Ea as Ml,Eb as jp,Ec as rm,Ed as c_,F as We,Fa as kl,Fb as Bp,Fc as om,G as bP,Ga as xl,Gb as qp,Gc as nm,H as Nt,Ha as Nl,Hb as zp,Hc as im,I as TP,Ia as Ll,Ib as Hp,Ic as Um,J as CP,Ja as Dl,Jb as Vp,Jc as jm,K as SP,Ka as $l,Kb as pI,Kc as Bm,L as wP,La as Fl,Lb as uI,Lc as qm,M as EP,Ma as Gl,Mb as mI,Mc as zm,N as AP,Na as Ul,Nb as fI,Nc as Hm,O as vP,Oa as jl,Ob as _I,Oc as Vm,P as OP,Pa as Bl,Pb as hI,Pc as Km,Q as PP,Qa as ql,Qb as gI,Qc as Wm,R as RP,Ra as zl,Rb as yI,Rc as r0,S as IP,Sa as yR,Sb as Kp,Sc as o0,T as MP,Ta as Hl,Tb as RI,Tc as n0,U as kP,Ua as Vl,Ub as II,Uc as Ym,V as xP,Va as Kl,Vb as MI,Vc as Xm,W as NP,Wa as Wl,Wb as kI,Wc as Jm,X as LP,Xa as bR,Xb as xI,Xc as Zm,Y as DP,Ya as Yl,Yb as Jp,Yc as Qm,Z as $P,Za as Xl,Zb as Zp,Zc as ef,_ as FP,_a as Jl,_b as tu,_c as tf,a as iP,aa as UP,ab as Ql,ad as of,b as Mt,ba as jP,bb as TR,bc as ou,bd as nf,c as sP,ca as BP,cb as CR,cc as nu,cd as sf,d as Ve,da as qP,db as SR,dc as iu,dd as af,e as te,ea as zP,eb as wR,ec as su,ed as df,f as Tc,fa as HP,fb as ER,fc as au,fd as cf,gb as AR,gc as du,gd as lf,ha as ol,hb as vR,hc as cu,hd as pf,i as Ke,ia as nl,ib as VR,ic as lu,id as uf,j as Cc,ja as il,jb as KR,jc as pu,jd as mf,k as Sc,ka as sl,kb as WR,kc as uu,kd as ff,la as al,lb as YR,lc as mu,ld as _f,m as he,mb as XR,mc as fu,n as wc,na as dl,nb as JR,nc as _u,nd as hf,o as Ec,oa as cl,ob as ZR,oc as hu,od as gf,p as Ac,pa as ll,pb as nI,pc as gu,pd as yf,q as vc,qa as pl,qb as iI,qd as bf,r as aP,ra as uR,rb as xp,rc as NI,rd as Tf,s as dP,sa as mR,sb as Np,sc as LI,sd as Cf,t as cP,ta as ul,tb as sI,tc as yu,td as Sf,u as lP,ua as ml,ub as aI,uc as Ou,ud as wf,v as pP,va as fl,vb as dI,vd as Ef,w as kt,wa as _l,wb as cI,wd as Af,x as uP,xa as hl,xb as lI,xd as vf,y as mP,ya as gl,yb as Lp,yc as Pu,yd as o_,z as xt,za as yl,zb as Dp,zd as n_}from"./chunks/chunk-AHVN4GHF.js";import{f as ac}from"./chunks/chunk-JESLOJD7.js";import{A as jc,Aa as Xc,B as Bc,Ba as Jc,C as Lt,Ca as Zc,Da as Qc,Fa as el,Ga as tl,Ha as rl,a as TA,b as CA,c as SA,d as Qi,e as es,f as ts,g as rs,h as os,ia as Dt,j as VP,ja as $t,ka as Ft,la as Gt,ma as qc,oa as zc,pa as Hc,qa as Vc,s as tR,t as rR,v as oR,w as nR,wa as Kc,x as iR,xa as Wc,y as Gc,z as Uc,za as Yc}from"./chunks/chunk-D6P6IBPN.js";import{$ as hc,$b as VI,$c as JM,A as jO,Aa as ap,Ac as bM,B as BO,Ba as dp,Bb as QR,Bc as TM,C as qO,Ca as cp,Cb as eI,Cc as CM,Da as lp,Db as tI,Dc as jt,Ea as pp,Eb as rI,Ec as Lu,Fa as up,Fb as oI,Fc as Du,Ga as mp,Gb as Tu,Gc as $u,Ha as fp,Hb as Cu,Hc as Fu,Ia as _p,Ib as Su,Ic as Gu,Ja as hp,Jb as wu,Jc as Uu,Ka as gp,Kb as Eu,Kc as ju,L as zO,La as yp,Lb as Au,Lc as Bu,M as HO,Ma as bp,Mb as Iu,Mc as qu,N as VO,Na as Tp,Nb as Mu,Nc as zu,O as KO,Oa as Cp,Ob as ku,Oc as Hu,P as WO,Pa as Sp,Pb as xu,Pc as Vu,Q as YO,Qa as wp,Qb as $I,Qc as Ku,R as XO,Ra as Ep,Rb as FI,Rc as Wu,S as JO,Sa as Ap,Sb as GI,Sc as Yu,T as dc,Ta as vp,Tb as UI,Tc as Xu,U as cc,Ua as Op,Ub as jI,Uc as Bt,V as lc,Va as Pp,Vb as BI,Vc as Ju,W as pc,Wa as Rp,Wb as qI,Wc as SM,X as uc,Xa as Ip,Xc as wM,Y as mc,Ya as Mp,Yb as Nu,Yc as EM,Z as fc,Za as kp,Zb as zI,Zc as Zu,_ as _c,_b as HI,_c as AM,a as Ui,aa as gc,ac as KI,ad as ZM,b as ji,ba as yc,bb as OR,bc as WI,bd as QM,c as Bi,ca as He,cb as PR,cc as YI,cd as e0,d as qi,da as ZO,db as RR,dc as XI,dd as t0,e as zi,ea as QO,eb as IR,ec as JI,fa as eP,fb as MR,fc as ZI,g as cA,ga as tP,gb as kR,gc as QI,h as lA,ha as rP,hb as xR,hc as eM,i as pA,ia as oP,ib as NR,ic as tM,j as hA,ja as nP,jb as LR,jc as rM,k as gA,ka as bc,kb as DR,kc as oM,l as yA,la as Sl,lb as $R,lc as nM,m as bA,ma as wl,mb as FR,mc as iM,n as PO,na as El,nb as GR,nc as sM,o as RO,oa as Al,oc as aM,p as IO,pa as hR,pc as dM,q as MO,qa as gR,qc as cM,r as kO,rb as UR,rc as lM,s as xO,sa as vl,sc as pM,t as NO,ta as ep,tb as jR,tc as uM,u as LO,ua as tp,ub as BR,uc as mM,v as DO,va as rp,vc as fM,w as $O,wa as op,wc as _M,x as FO,xa as np,xb as qR,xc as hM,y as GO,ya as ip,yb as zR,yc as gM,z as UO,za as sp,zb as HR,zc as yM}from"./chunks/chunk-PQLRKFPZ.js";import"./chunks/chunk-4D25HF3V.js";import{$ as PA,$a as Ws,$b as rd,$c as yv,$e as jd,A as XE,Aa as Cs,Ab as Ca,Ad as Ot,Ae as lO,Af as ec,B as JE,Ba as Ss,Bb as Sa,Be as pO,Bf as tc,C as ZE,Ca as ws,Cb as wa,Cd as Nv,Ce as uO,Cf as rc,D as QE,Da as Es,Db as Ea,De as mO,Df as oc,Ea as As,Eb as Aa,Ec as QA,Ed as Lv,Ee as fO,Ef as nc,F as eA,Fa as vs,Fb as va,Ff as ic,G as tA,Ga as Os,Gb as Oa,Gc as ev,Gf as sc,H as rA,Ha as Ps,Hb as Pa,Hc as tv,Hf as It,I as oA,Ia as Rs,Ib as Ra,Ic as rv,Id as Dv,Ie as Rt,J as Yi,Ja as Is,Jb as Ia,Jc as ov,Jd as $v,Je as _O,K as Xi,Ka as Ms,Kb as Ma,Kc as nv,Kd as Fv,Ke as hO,La as ks,Lb as ka,Lc as iv,Ld as ud,Le as gO,M as Ji,Ma as xs,Mb as xa,Md as Gv,Me as vd,N as nA,Na as Ns,Nb as Na,Nc as sv,Ne as Od,Oa as Ls,Ob as La,Oc as av,Od as Uv,Oe as Pd,P as iA,Pa as Ds,Pb as Da,Pd as jv,Pe as Rd,Q as sA,Qa as $s,Qb as $a,Qc as dv,Qd as Bv,Qe as Id,R as aA,Ra as Fs,Rb as Fa,Rc as cv,Rd as qv,Re as Md,Sa as Gs,Sc as lv,Sd as zv,Se as kd,T as dA,Ta as Us,Tb as ze,Tc as pv,Td as Hv,Te as xd,Ua as js,Ub as ee,Uc as uv,Ud as Vv,Ue as Nd,V as wA,Va as Bs,Vb as Ga,Vc as mv,Vd as Kv,Ve as Ld,W as EA,Wa as qs,Wb as Ja,Wd as Wv,We as Dd,X as AA,Xa as zs,Xb as Za,Xc as fv,Xd as Yv,Xe as $d,Y as Be,Ya as Hs,Yb as Qa,Yc as _v,Yd as Pt,Ye as Fd,Z as vA,Za as Vs,Zb as ed,Zc as hv,Zd as Xv,Ze as Gd,_ as OA,_a as Ks,_b as td,_c as gv,_e as Ud,aa as vt,ab as Ys,ac as od,ae as Jv,af as Bd,b as ME,ba as qe,bb as Xs,bc as nd,bd as bv,be as Zv,bf as qd,c as kE,ca as RA,cb as Js,cc as id,ce as Qv,cf as zd,d as xE,da as IA,db as Zs,dc as $A,dd as Tv,de as eO,df as Hd,e as NE,ea as MA,eb as Qs,ed as Cv,ee as tO,ef as Vd,f as LE,fa as kA,fb as ea,fc as pd,fd as Sv,fe as rO,ff as Kd,ga as xA,gb as ta,gc as FA,gd as wv,ge as oO,gf as Wd,h as Hi,ha as NA,hb as ra,hc as GA,hd as Ev,he as nO,hf as Yd,i as Vi,ia as ns,ib as oa,ic as UA,ie as iO,j as Ki,ja as is,jb as na,jc as jA,je as sO,jf as yO,ka as ss,kb as ia,kc as BA,ke as md,kf as bO,la as as,lb as sa,lc as qA,le as fd,m as DE,ma as ds,mb as aa,me as _d,na as cs,nb as da,nc as zA,ne as hd,nf as TO,oa as ls,ob as ca,oc as HA,oe as gd,of as CO,pa as ps,pb as la,pc as VA,pe as yd,pf as SO,q as Wi,qa as us,qb as pa,qc as KA,qe as bd,qf as wO,ra as ms,rb as ua,rd as Av,re as Td,rf as EO,sa as fs,sb as ma,sc as WA,sd as vv,se as Cd,sf as AO,ta as _s,tb as fa,tc as YA,td as Ov,te as Sd,tf as vO,u as At,ua as hs,ub as _a,ud as Pv,ue as wd,uf as OO,v as $E,va as gs,vb as ha,vc as XA,vd as Rv,ve as Ed,w as FE,wa as ys,wb as ga,wc as JA,wd as Iv,we as Ad,wf as Xd,x as GE,xa as bs,xb as ya,xc as ZA,xd as Mv,xe as aO,xf as Jd,y as UE,ya as Ts,yb as ba,yd as kv,ye as dO,yf as Zd,z as jE,zb as Ta,zd as xv,ze as cO,zf as Qd}from"./chunks/chunk-CS7QDSUX.js";import"./chunks/chunk-SPPHDVZE.js";import"./chunks/chunk-LWW4F4G2.js";import{a as KP,b as WP,c as YP,d as XP,e as JP,f as ZP,g as QP,h as Mc,i as kc,j as xc,k as Nc,l as Lc,m as eR,n as Dc,o as $c,p as Fc}from"./chunks/chunk-CXUQEZDX.js";import"./chunks/chunk-IB7UB5TE.js";import{$a as xT,$b as VT,$c as Pn,$d as Bn,$f as Pw,$g as Vw,$h as uE,A as dT,Aa as Jo,Ac as rC,Ad as In,Ae as uS,Af as XS,Ag as ii,Ah as Qw,Ai as RE,B as cT,Ba as Zo,Bb as Cn,Bc as wn,Bd as Mn,Be as mS,Bf as JS,Bg as si,Bh as eE,Bi as Gi,Cb as Sn,Cd as kn,Ce as fS,Cf as ZS,Cg as ai,Ci as IE,D as lT,Da as Qo,Db as DT,Dc as En,De as _S,Df as QS,Dg as di,Dh as tE,Di as BE,Ec as An,Ed as xn,Ee as hS,Ef as ew,Eg as ci,Eh as rE,Ei as qE,Fe as gS,Ff as tw,Fg as Uw,Fi as zE,G as pT,Gd as LC,Ge as yS,Gf as rw,Gg as jw,Gh as oE,Gi as HE,Hc as oC,Hd as DC,He as bS,Hf as ow,Hi as VE,Ic as nC,Id as $C,Ie as TS,If as nw,Ih as xi,Ii as KE,J as uT,Jc as iC,Jd as FC,Je as CS,Jg as li,Jh as Ni,Ji as WE,Kc as sC,Kd as GC,Ke as SS,Kg as pi,Kh as Li,Ki as YE,Lc as aC,Ld as UC,Le as wS,Lf as iw,Lg as Bw,Lh as Di,M as mT,Mc as dC,Md as jC,Me as ES,Mf as sw,Mg as ui,N as jo,Nc as cC,Nd as BC,Ne as AS,Nf as aw,Ng as mi,O as Bo,Ob as $T,Oc as vn,Od as qC,Oe as vS,Og as qw,P as qo,Pa as R,Pc as lC,Pd as zC,Pf as dw,Pg as fi,Qa as wT,Qb as FT,Qc as pC,Qd as HC,Qe as wt,Qf as cw,Qg as _i,Ra as Tt,Rb as GT,Rd as VC,Rf as Zn,Rg as D,Sa as ET,Sb as UT,Se as Et,Sf as Qn,Sg as hi,T as zo,Ta as AT,Tb as jT,Tc as uC,Td as Nn,Tf as ei,Th as nE,Ua as vT,Ub as BT,Uc as mC,Ud as Ln,Ue as Wn,Uf as Cw,Uh as iE,V as Ho,Va as OT,Vc as fC,Vd as Dn,Ve as Yn,Vf as Sw,Vh as sE,W as Vo,Wa as PT,Wb as qT,Wc as _C,Wd as $n,We as _e,Wf as ww,Wh as aE,X as Ko,Xa as RT,Xb as zT,Xc as hC,Xd as Fn,Xf as Ew,Xh as dE,Ya as IT,Yc as gC,Yd as Gn,Ye as OS,Yf as Aw,Yh as cE,Za as MT,Zc as On,Zd as Un,Zf as vw,Zg as zw,Zh as lE,_a as kT,_b as HT,_c as yC,_d as jn,_e as PS,_f as Ow,_g as Hw,_h as pE,a as Ro,ab as NT,ac as KT,ae as qn,ag as Rw,ah as gi,ai as mE,b as Io,bb as en,bc as WT,bd as bC,be as zn,bg as Iw,bh as yi,bi as fE,c as Mo,cb as tn,cd as TC,ce as Hn,cg as Mw,ch as bi,ci as _E,d as ko,db as rn,dd as CC,de as Vn,df as je,dg as kw,dh as Ti,di as hE,e as Ne,eb as on,ed as SC,ee as Kn,ef as Xn,eg as xw,eh as Ci,f as xo,fb as nn,fc as YT,fd as wC,fe as KC,ff as RS,fh as Si,fi as gE,g as L,gb as sn,ge as WC,gf as IS,gh as wi,gi as $i,h as Le,hb as an,hc as XT,hd as Rn,he as YC,hf as MS,hh as Ei,hi as Fi,i as No,ib as Ge,ie as XC,if as kS,ih as Ai,ii as yE,j as Lo,jb as Ue,jd as EC,je as JC,jf as xS,jh as vi,ji as bE,k as Do,ka as fT,kb as dn,kd as AC,ke as ZC,kf as NS,kh as Oi,ki as TE,l as $o,la as _T,lb as cn,ld as vC,le as QC,lf as LS,lg as Nw,lh as Pi,li as CE,m as zb,ma as hT,mb as ln,md as OC,mf as DS,mh as Ri,mi as SE,n as De,nb as pn,nd as PC,nf as $S,nh as Ii,ni as wE,o as yt,ob as un,od as RC,oe as eS,of as FS,og as ti,oh as Mi,oi as EE,p as Hb,pa as Wo,pb as mn,pd as IC,pe as tS,pf as GS,pg as Lw,ph as Kw,pi as AE,q as Vb,qa as gT,qb as fn,qd as MC,qe as rS,qf as US,qg as ri,qh as Ww,qi as vE,r as Kb,ra as yT,rb as _n,rd as kC,re as oS,rf as jS,rh as ki,s as Wb,sa as bT,sb as hn,sd as xC,se as nS,sf as BS,sg as Dw,sh as Yw,t as z,ta as TT,tb as gn,tc as JT,td as NC,te as iS,tf as qS,tg as $w,th as Xw,u as Yb,ub as yn,uc as ZT,ue as sS,uf as zS,ui as OE,va as Yo,vb as bn,vc as QT,ve as aS,vf as HS,vg as Fw,w as nT,wa as Xo,wb as Tn,we as dS,wf as VS,wg as Gw,x as iT,xa as Fe,xc as eC,xe as cS,xf as KS,xg as oi,xi as PE,y as sT,ya as CT,yc as tC,yd as Ct,ye as lS,yf as WS,yg as ni,yh as Jw,z as aT,za as ST,zb as LT,zd as St,ze as pS,zf as YS,zh as Zw}from"./chunks/chunk-7V37RC2L.js";import{a as Oc,b as Pc,e as Rc,f as Ic}from"./chunks/chunk-TH5KPAN4.js";import"./chunks/chunk-VS565KBX.js";import{A as me,B as oT,C as b,E as Fo,F as bt,G as fe,H as Go,K as $e,M as Uo,b as Xb,c as Jb,d as Zb,m as Qb,r as eT,u as tT,y as rT}from"./chunks/chunk-RZQNFHXO.js";import"./chunks/chunk-XAWE4EAK.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]="8f11e0bf-4115-55a8-bd39-c360f43cdc09")}catch{}})();var H="2026-07-28",rr=["2025-11-25","2025-06-18"],re=[H],m={headerMismatch:-32020,missingRequiredClientCapability:-32021,unsupportedProtocolVersion:-32022,invalidParams:-32602},E={clientCapabilities:"io.modelcontextprotocol/clientCapabilities",clientInfo:"io.modelcontextprotocol/clientInfo",logLevel:"io.modelcontextprotocol/logLevel",protocolVersion:"io.modelcontextprotocol/protocolVersion",serverInfo:"io.modelcontextprotocol/serverInfo"},tr=["debug","info","notice","warning","error","critical","alert","emergency"],u=class extends Error{code;data;constructor(t,r,o={}){super(t),this.name="PmMcpProtocolError",this.code=r,this.data=o}};function h(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Bh(e){if(e===void 0)return;if(!h(e))throw new u("Invalid MCP clientInfo metadata",m.invalidParams,{field:E.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 u("Invalid MCP clientInfo metadata",m.invalidParams,{field:E.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 qh(e){if(e!==void 0){if(typeof e!="string"||!tr.includes(e))throw new u("Invalid MCP logLevel metadata",m.invalidParams,{field:E.logLevel,allowed:[...tr]});return e}}function Je(e){let t=h(e)?e._meta:void 0;if(!h(t))throw new u("Missing required MCP request metadata",m.invalidParams,{required:[E.protocolVersion,E.clientCapabilities]});let r=t[E.protocolVersion];if(typeof r!="string"||!re.includes(r))throw new u("Unsupported protocol version",m.unsupportedProtocolVersion,{supported:[...re],requested:typeof r=="string"?r:null});let o=t[E.clientCapabilities];if(!h(o))throw new u("Invalid MCP client capabilities metadata",m.invalidParams,{field:E.clientCapabilities,expected:"object"});let n=Bh(t[E.clientInfo]),s=qh(t[E.logLevel]);return{protocolVersion:H,clientCapabilities:o,...n?{clientInfo:n}:{},...s?{logLevel:s}:{}}}function zk(e,t){if(t!==e.protocolVersion)throw new u("MCP protocol header does not match request metadata",m.headerMismatch,{header:t??null,metadata:e.protocolVersion})}function Hk(e,t){let r=t.filter(o=>!Object.prototype.hasOwnProperty.call(e.clientCapabilities,o));if(r.length>0)throw new u("Missing required client capability",m.missingRequiredClientCapability,{requiredCapabilities:Object.fromEntries(r.map(o=>[o,{}]))})}function Vk(e,t){let r=e.clientCapabilities.extensions;return h(r)&&h(r[t])}function Ze(e,t){let r=h(e._meta)?e._meta:{};return{...e,_meta:{...r,[E.serverInfo]:{...t}}}}function zh(e,t){return Ze({...e,resultType:"complete"},t)}function Kk(e){let t=e.ttlMs??6e4;if(!Number.isFinite(t)||t<0)throw new u("Invalid MCP discovery cache TTL",m.invalidParams,{ttlMs:t});return zh({supportedVersions:[...re],capabilities:structuredClone(e.capabilities),ttlMs:t,cacheScope:"public",...e.instructions?{instructions:e.instructions}:{}},e.serverInfo)}function Wk(e,t){if(h(e)&&typeof e.resultType=="string")return e.resultType;if(t==="legacy")return"complete";throw new u("Modern MCP result is missing resultType",m.invalidParams,{required:"resultType"})}(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]="d4a56906-c542-567e-9265-15184a5c330b")}catch{}})();var Hh=new Set(["--help","-h","--version","-V"]);function Vh(e,t){let r=[`Usage: ${e==="stdio"?"pm-mcp":"pm-mcp-http"} [--help | --version]`,"",e==="stdio"?"JSON-RPC over stdin/stdout. With no arguments, starts the stdio server.":"Streamable HTTP POST /mcp. With no arguments, starts the HTTP server.","","Options:"," -h, --help Print help and exit before transport startup."," -V, --version Print the package version and exit.","","Environment:"," PM_PATH Tracker root (otherwise discovered from cwd)."," PM_GLOBAL_PATH Global settings root."," PM_MCP_PROFILE core (default), standard, full, or custom."," PM_MCP_TOOLS Comma-separated tool allowlist for custom profile."," PM_MCP_DISCOVERY_CURSOR_KEY Shared discovery cursor secret, at least 32 UTF-8 bytes."," PM_MCP_BAGGAGE_ALLOWLIST Comma-separated permitted trace baggage keys."];return e==="http"&&r.push(" PM_MCP_HTTP_HOST Bind host (default 127.0.0.1)."," PM_MCP_HTTP_PORT Bind port, 0..65535 (default 3000)."," PM_MCP_HTTP_ALLOWED_ORIGINS Comma-separated exact browser origins (default none)."," PM_MCP_HTTP_BEARER_TOKEN Deployment token for the bundled verifier."," PM_MCP_HTTP_AUTH_ISSUER Exact HTTPS authorization-server issuer."," PM_MCP_HTTP_RESOURCE Canonical resource/audience URI."," PM_MCP_HTTP_SCOPES Space-separated scopes (default pm:read pm:write).","","Non-loopback HTTP requires bearer token, issuer, and resource together."),r.push("",`MCP protocol: ${re.join(", ")}.`,e==="stdio"?`Legacy initialize compatibility: ${rr.join(", ")}.`:"HTTP requires modern per-request metadata; legacy initialize is stdio-only.","",e==="stdio"?"Client configuration:":"Example loopback server:",e==="stdio"?JSON.stringify({mcpServers:{pm:{command:"npx",args:["--yes","--package",`@unbrained/pm-cli@${t}`,"pm-mcp"]}}}):`PM_MCP_HTTP_PORT=3000 npx --yes --package @unbrained/pm-cli@${t} pm-mcp-http`,...e==="http"?["HTTP client configuration:",JSON.stringify({mcpServers:{pm:{url:"http://127.0.0.1:3000/mcp"}}})]:[],"","Configuration: https://github.com/unbraind/pm-cli/blob/main/docs/MCP_REMOTE_TRANSPORT_SECURITY.md",""),r.join(`
2
+ `)}function Jk(e,t,r){if(e.length===0)return{kind:"serve"};let o=e.find(n=>!Hh.has(n));if(o!==void 0){let n=t==="stdio"?"pm-mcp":"pm-mcp-http";return{kind:"exit",exitCode:64,stdout:"",stderr:`Unsupported argument ${JSON.stringify(o)}. Run ${n} --help.
3
+ `}}return{kind:"exit",exitCode:0,stdout:e.includes("--help")||e.includes("-h")?Vh(t,r):`${r}
4
+ `,stderr:""}}import{createHash as ir,createHmac as sr,timingSafeEqual as Kh}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]="15b81dd0-ef1a-58be-b6ee-5975b6778993")}catch{}})();var Wh=["elicitation/create","roots/list","sampling/createMessage"],or=class extends Error{inputRequests;requestState;constructor(t){super("MCP operation requires additional input"),this.name="PmMcpInputRequiredError",this.inputRequests=t.inputRequests,this.requestState=t.requestState}},ar=/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/u,ye=32,et=64*1024,be=16*1024,Qe={maxBytes:256*1024,maxDepth:32,maxNodes:4096};function Yh(e){return e==="elicitation/create"?"elicitation":e==="sampling/createMessage"?"sampling":"roots"}function Te(e,t,r){let o;try{o=JSON.stringify(e)}catch{throw new u(`Invalid ${r}: value is not JSON serializable`,m.invalidParams,{field:r})}if(Buffer.byteLength(o,"utf8")>t)throw new u(`Invalid ${r}: payload exceeds the protocol bound`,m.invalidParams,{field:r,maximumBytes:t})}function tt(e,t){if(!h(e))throw new u("Invalid MCP inputRequests",m.invalidParams,{field:"inputRequests",expected:"object"});let r=Object.entries(e);if(r.length===0||r.length>ye)throw new u("Invalid MCP inputRequests count",m.invalidParams,{minimum:1,maximum:ye,observed:r.length});let o={};for(let[n,s]of r){if(!ar.test(n)||!h(s))throw new u("Invalid MCP input request entry",m.invalidParams,{field:`inputRequests.${n}`});let i=s.method;if(typeof i!="string"||!Wh.includes(i))throw new u("Unsupported MCP input request method",m.invalidParams,{field:`inputRequests.${n}.method`,method:i??null});let a=Yh(i);if(!Object.prototype.hasOwnProperty.call(t.clientCapabilities,a))throw new u("Missing required client capability",m.missingRequiredClientCapability,{requiredCapabilities:{[a]:{}}});if(!h(s.params))throw new u("Invalid MCP input request parameters",m.invalidParams,{field:`inputRequests.${n}.params`,expected:"object"});o[n]={method:i,params:structuredClone(s.params)}}return Te(o,et,"inputRequests"),o}function dr(e){if(!h(e))throw new u("Invalid MCP inputResponses",m.invalidParams,{field:"inputResponses",expected:"object"});let t=Object.entries(e);if(t.length>ye)throw new u("Invalid MCP inputResponses count",m.invalidParams,{maximum:ye,observed:t.length});let r={};for(let[o,n]of t){if(!ar.test(o)||!h(n))throw new u("Invalid MCP input response entry",m.invalidParams,{field:`inputResponses.${o}`});r[o]=structuredClone(n)}return Te(r,et,"inputResponses"),r}function tx(e){let t=e.requestState?.trim();if(t&&Buffer.byteLength(t,"utf8")>be)throw new u("Invalid MCP requestState: payload exceeds the protocol bound",m.invalidParams,{field:"requestState",maximumBytes:be});let r=e.inputRequests===void 0?void 0:tt(e.inputRequests,e.requestContext);if(r===void 0&&!t)throw new u("InputRequiredResult requires inputRequests or requestState",m.invalidParams,{requiredAnyOf:["inputRequests","requestState"]});return{resultType:"input_required",...r?{inputRequests:r}:{},...t?{requestState:t}:{},_meta:{[E.serverInfo]:{...e.serverInfo}}}}function cr(e){let t=Buffer.from(e);if(t.byteLength<32)throw new u("MCP requestState signing key must contain at least 32 bytes",m.invalidParams,{minimumBytes:32});return t}function rx(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 u("Invalid MCP requestState payload",m.invalidParams);let r=Buffer.from(JSON.stringify({version:1,...e}),"utf8");if(r.byteLength>be/2)throw new u("MCP requestState payload exceeds the protocol bound",m.invalidParams,{maximumBytes:be/2});let o=r.toString("base64url"),n=sr("sha256",cr(t)).update(o).digest("base64url");return`${o}.${n}`}function Xh(e){if(!h(e)||e.version!==1)throw new u("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});let{expiresAt:t,method:r,parameterDigest:o,principal:n,state:s}=e;if(typeof t!="number"||!Number.isSafeInteger(t))throw new u("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});if(typeof r!="string"||typeof o!="string"||typeof n!="string")throw new u("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});return{expiresAt:t,method:r,parameterDigest:o,principal:n,state:s}}function ox(e,t,r){let[o,n,s]=e.split(".");if(!o||!n||s!==void 0)throw new u("Invalid MCP requestState encoding",m.invalidParams,{field:"requestState"});let i=Buffer.from(n,"base64url"),a=sr("sha256",cr(t)).update(o).digest();if(i.byteLength!==a.byteLength||!Kh(i,a))throw new u("Invalid MCP requestState signature",m.invalidParams,{field:"requestState"});let d;try{d=JSON.parse(Buffer.from(o,"base64url").toString("utf8"))}catch{d=null}let c=Xh(d),{expiresAt:l,method:p,parameterDigest:f,principal:_}=c;if(l<(r.nowMs??Date.now()))throw new u("Expired MCP requestState",m.invalidParams,{field:"requestState",expiredAt:l});if(p!==r.method||f!==r.parameterDigest||_!==r.principal)throw new u("MCP requestState binding mismatch",m.invalidParams,{field:"requestState"});return c}function nx(e){return Te(e,et,"request parameters"),ir("sha256").update(JSON.stringify(e)).digest("hex")}var nr=class{#e=new Set;#t;constructor(t=4096){if(!Number.isSafeInteger(t)||t<1)throw new u("Invalid MCP replay guard capacity",m.invalidParams,{maximumEntries:t});this.#t=t}consume(t){let r=ir("sha256").update(t).digest("hex");if(this.#e.has(r))throw new u("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 Jh(e){if(!Number.isSafeInteger(e.ttlMs)||e.ttlMs<0||e.cacheScope!=="public"&&e.cacheScope!=="private")throw new u("Invalid MCP cache policy",m.invalidParams,{ttlMs:e.ttlMs,cacheScope:e.cacheScope});return{ttlMs:e.ttlMs,cacheScope:e.cacheScope}}function ix(e,t){return{...e,...Jh(t)}}function Zh(e){return e.replaceAll("~1","/").replaceAll("~0","~")}function Qh(e,t){if(t==="#")return e;if(!t.startsWith("#/"))return;let r=e;for(let o of t.slice(2).split("/").map(Zh)){if(!h(r)&&!Array.isArray(r)||!Object.prototype.hasOwnProperty.call(r,o))return;r=r[o]}return r}function eg(e){let t=e.maxBytes??Qe.maxBytes,r=e.maxDepth??Qe.maxDepth,o=e.maxNodes??Qe.maxNodes;if(!Number.isSafeInteger(t)||t<2)throw new u("Invalid MCP JSON Schema work bounds",m.invalidParams);if(!Number.isSafeInteger(r)||r<1)throw new u("Invalid MCP JSON Schema work bounds",m.invalidParams);if(!Number.isSafeInteger(o)||o<1)throw new u("Invalid MCP JSON Schema work bounds",m.invalidParams);return{maximumBytes:t,maximumDepth:r,maximumNodes:o}}function tg(e,t){let r=Array.isArray(e.value)?e.value:h(e.value)?Object.values(e.value):[];for(let o of r)t.push({value:o,depth:e.depth+1})}function rg(e,t){if(!h(t)||typeof t.$ref!="string")return;let r=t.$ref;if(r.startsWith("#")&&Qh(e,r)===void 0)throw new u("MCP JSON Schema contains an unresolved local reference",m.invalidParams,{reference:r})}function sx(e,t={}){let{maximumBytes:r,maximumDepth:o,maximumNodes:n}=eg(t);if(typeof e!="boolean"&&!h(e))throw new u("Invalid MCP JSON Schema root",m.invalidParams,{expected:"object or boolean"});Te(e,r,"JSON Schema");let s=[{value:e,depth:0}],i=0;for(;s.length>0;){let a=s.pop();if(i+=1,i>n||a.depth>o)throw new u("MCP JSON Schema exceeds validation work bounds",m.invalidParams,{maximumDepth:o,maximumNodes:n});rg(e,a.value),tg(a,s)}return structuredClone(e)}import{randomUUID as og}from"node:crypto";import{readFile as ng}from"node:fs/promises";import lr 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]="f3e94896-b2a0-561c-902b-71c28ddde2a1")}catch{}})();var fx="io.modelcontextprotocol/tasks",ig=["working","input_required","completed","failed","cancelled"],sg=/^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,ag=3600*1e3,dg=1e3,Se=1024,cg=30,lg=2e3;function rt(e){return new u(e,m.invalidParams,{code:"mcp_task_not_found_or_not_authorized"})}function Ce(e){let t=e.trim();if(!sg.test(t))throw rt("Unknown MCP task");return t}function pr(e,t){if(typeof e!="string"||!Number.isFinite(Date.parse(e)))throw new u("Corrupt MCP task record",m.invalidParams,{field:t});return e}function ur(e){if(!h(e)||typeof e.code!="number"||!Number.isFinite(e.code)||typeof e.message!="string")throw new u("Corrupt MCP task error",m.invalidParams);return{code:e.code,message:e.message.slice(0,Se),...h(e.data)?{data:structuredClone(e.data)}:{}}}function pg(e){if(!ig.includes(e))throw new u("Corrupt MCP task record",m.invalidParams);return e}function ug(e){if(typeof e!="string"||e.length===0)throw new u("Corrupt MCP task record",m.invalidParams);return e}function mg(e){if(typeof e!="number"||!Number.isSafeInteger(e)||e<1)throw new u("Corrupt MCP task record",m.invalidParams);return e}function fg(e){if(e!==null&&(typeof e!="number"||!Number.isSafeInteger(e)||e<0))throw new u("Corrupt MCP task record",m.invalidParams);return e}function _g(e){if(e!==void 0){if(typeof e!="number"||!Number.isSafeInteger(e)||e<0)throw new u("Corrupt MCP task record",m.invalidParams);return e}}function hg(e){if(!Array.isArray(e)||e.some(t=>typeof t!="string"))throw new u("Corrupt MCP task record",m.invalidParams);return[...e]}function gg(e){if(!h(e)||e.version!==1)throw new u("Corrupt MCP task record",m.invalidParams);let t=typeof e.taskId=="string"?Ce(e.taskId):"",r=pg(e.status),o=ug(e.principal),n=mg(e.workerPid),s=fg(e.ttlMs),i=_g(e.pollIntervalMs),a={version:1,taskId:t,status:r,principal:o,workerPid:n,createdAt:pr(e.createdAt,"createdAt"),lastUpdatedAt:pr(e.lastUpdatedAt,"lastUpdatedAt"),ttlMs:s,consumedInputKeys:hg(e.consumedInputKeys),...typeof e.statusMessage=="string"?{statusMessage:e.statusMessage.slice(0,Se)}:{},...typeof i=="number"?{pollIntervalMs:i}:{}};if(h(e.inputRequests)&&(a.inputRequests=structuredClone(e.inputRequests)),h(e.inputResponses)&&(a.inputResponses=structuredClone(e.inputResponses)),h(e.result)&&(a.result=structuredClone(e.result)),e.error!==void 0&&(a.error=ur(e.error)),a.status==="input_required"&&!a.inputRequests||a.status==="completed"&&!a.result||a.status==="failed"&&!a.error)throw new u("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 oe(e){return e==="completed"||e==="failed"||e==="cancelled"}function yg(e){try{return process.kill(e,0),!0}catch(t){return!(typeof t=="object"&&t!==null&&"code"in t&&t.code==="ESRCH")}}var ot=class{#e;#t;#r;#o;#i;constructor(t){this.#e=lr.resolve(t.pmRoot),this.#t=t.owner?.trim()||"pm-mcp",this.#r=t.now??(()=>new Date),this.#o=t.taskIdFactory??(()=>`mcp-task-${og()}`),this.#i=t.workerPid??process.pid}#s(t){return lr.join(this.#e,"runtime","mcp-tasks","records",`${Ce(t)}.json`)}async#d(t){try{return gg(JSON.parse(await ng(this.#s(t),"utf8")))}catch(r){throw fe(r)||r instanceof SyntaxError?rt("Unknown MCP task"):r}}async#a(t){await $e(this.#s(t.taskId),`${JSON.stringify(t,null,2)}
5
+ `)}async#n(t,r,o){let n=Ce(t),s=await je(this.#e,n,cg,this.#t,!1,!1,lg);try{let i=await this.#d(n);if(i.principal!==r)throw rt("Unknown MCP task");let a=o(i);return await this.#a(a),a}finally{await s()}}async create(t){let r=Ce(this.#o()),o=t.principal.trim(),n=t.ttlMs===void 0?ag:t.ttlMs,s=t.pollIntervalMs??dg;if(o.length===0||n!==null&&(!Number.isSafeInteger(n)||n<0)||!Number.isSafeInteger(s)||s<0)throw new u("Invalid MCP task creation options",m.invalidParams);let i=this.#r().toISOString(),a={version:1,taskId:r,status:"working",createdAt:i,lastUpdatedAt:i,ttlMs:n,pollIntervalMs:s,principal:o,workerPid:this.#i,consumedInputKeys:[],...t.statusMessage?.trim()?{statusMessage:t.statusMessage.trim().slice(0,Se)}:{}};return await this.#a(a),{...V(a),resultType:"task"}}async get(t,r){return V(await this.#n(t,r,o=>{if(oe(o.status))return o;let n=this.#r().getTime(),s=o.ttlMs!==null&&Date.parse(o.createdAt)+o.ttlMs<=n,i=o.workerPid!==this.#i&&!yg(o.workerPid);return!s&&!i?o:{...o,status:"failed",statusMessage:s?"Task retention expired before completion.":"Task worker ended before recording a terminal result.",lastUpdatedAt:this.#r().toISOString(),error:{code:-32603,message:s?"MCP task expired":"MCP task worker unavailable after restart",data:{recoverable:!1,createNewTask:!0}},inputRequests:void 0}}))}async requireInput(t){let r=tt(t.inputRequests,t.requestContext);return V(await this.#n(t.taskId,t.principal,o=>{if(oe(o.status))return o;let n=Object.keys(r).filter(s=>o.consumedInputKeys.includes(s));if(n.length>0)throw new u("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,Se),lastUpdatedAt:this.#r().toISOString(),inputRequests:r}}))}async update(t,r,o){let n=dr(o),s=[],i=[];return await this.#n(t,r,a=>{if(a.status!=="input_required"||!a.inputRequests)return a;let d={...a.inputRequests},c=a.inputResponses?{...a.inputResponses}:{};for(let[l,p]of Object.entries(n))Object.prototype.hasOwnProperty.call(d,l)&&(c[l]=p,delete d[l],s.push(l));return i=Object.keys(d).sort(),s.length===0?a:{...a,status:i.length===0?"working":"input_required",lastUpdatedAt:this.#r().toISOString(),inputRequests:i.length===0?void 0:d,inputResponses:c,consumedInputKeys:[...new Set([...a.consumedInputKeys,...s])].sort()}}),{acceptedKeys:s.sort(),remainingKeys:i}}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=>oe(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=ur(o);return V(await this.#n(t,r,s=>oe(s.status)?s:{...s,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=>oe(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 _x(e){return new ot(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]="15cbe26a-5716-5e8c-8700-eb36a1a056d6")}catch{}})();var we="io.modelcontextprotocol/subscriptionId",mr=256,fr=2048,bg=5e3;function Tg(e,t){return new Promise((r,o)=>{let n=setTimeout(()=>o(new Error("MCP subscription sink write timed out")),bg);n.unref(),Promise.resolve().then(()=>e(t)).then(()=>{clearTimeout(n),r()},s=>{clearTimeout(n),o(s instanceof Error?s:new Error(String(s)))})})}function nt(e,t){if(e!==void 0){if(typeof e!="boolean")throw new u("Invalid MCP subscription filter",m.invalidParams,{field:`notifications.${t}`,expected:"boolean"});return e||void 0}}function Cg(e){if(!h(e))throw new u("Invalid MCP subscription filter",m.invalidParams,{field:"notifications",expected:"object"});let t=nt(e.toolsListChanged,"toolsListChanged"),r=nt(e.promptsListChanged,"promptsListChanged"),o=nt(e.resourcesListChanged,"resourcesListChanged"),n;if(e.resourceSubscriptions!==void 0){if(!Array.isArray(e.resourceSubscriptions)||e.resourceSubscriptions.length>mr)throw new u("Invalid MCP resource subscriptions",m.invalidParams,{field:"notifications.resourceSubscriptions",maximum:mr});let s=new Set;for(let i of e.resourceSubscriptions){if(typeof i!="string"||i.trim().length===0||Buffer.byteLength(i,"utf8")>fr)throw new u("Invalid MCP resource subscription URI",m.invalidParams,{field:"notifications.resourceSubscriptions",maximumBytes:fr});s.add(i)}s.size>0&&(n=[...s].sort())}return{...t?{toolsListChanged:t}:{},...r?{promptsListChanged:r}:{},...o?{resourcesListChanged:o}:{},...n?{resourceSubscriptions:n}:{}}}function Sg(e,t){return{...e.toolsListChanged&&t.tools?.listChanged?{toolsListChanged:!0}:{},...e.promptsListChanged&&t.prompts?.listChanged?{promptsListChanged:!0}:{},...e.resourcesListChanged&&t.resources?.listChanged?{resourcesListChanged:!0}:{},...e.resourceSubscriptions&&t.resources?.subscribe?{resourceSubscriptions:[...e.resourceSubscriptions]}:{}}}var _r=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 u("MCP subscription id is already active",m.invalidParams,{subscriptionId:t.id});let r=Sg(Cg(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:{[we]: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[s,i]of this.#t)i.filter[r]===!0&&n.push(this.#o(s,i,{jsonrpc:"2.0",method:o,params:{_meta:{[we]:s}}}));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:{[we]:o},uri:t}}));return(await Promise.all(r)).filter(Boolean).length}async#o(t,r,o,n=!1){let s=r.writeQueue.then(async()=>{if(this.#t.get(t)!==r)return!1;try{return await Tg(r.sink,o),!0}catch(i){if(this.#t.get(t)===r&&this.#t.delete(t),n)throw i;return!1}});return r.writeQueue=s.then(()=>{},()=>{}),s}close(t){if(this.#t.delete(t))return{...Ze({resultType:"complete",_meta:{[we]: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]="3681273a-e101-57a0-9446-982c450e7183")}catch{}})();var hr=/^=\?base64\?([A-Za-z0-9+/]*={0,2})\?=$/u,wg=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/u,gr=/^[\t\x20-\x7E]*$/u,yr=new Set(["prompts/get","resources/read","tools/call"]);function Eg(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 u(e,m.headerMismatch,{header:t})}function br(e){let t=typeof e=="boolean"?String(e).toLowerCase():String(e);return t.length>0&&t.trim()===t&&gr.test(t)&&!hr.test(t)?t:`=?base64?${Buffer.from(t,"utf8").toString("base64")}?=`}function Tr(e,t){let r=hr.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||!gr.test(e)?A("Malformed MCP header value",t):e}function Ee(e){return Array.isArray(e)?e.some(Ee):h(e)?Object.prototype.hasOwnProperty.call(e,"x-mcp-header")||Object.values(e).some(Ee):!1}function Ag(e,t,r){let o=e["x-mcp-header"];if(o===void 0)return;let n=e.type;if(typeof o!="string"||!wg.test(o)||!["boolean","integer","string"].includes(String(n))||r.has(o.toLowerCase()))throw new u("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 Cr(e){if(!h(e))throw new u("Invalid MCP tool schema",m.invalidParams,{field:"inputSchema",expected:"object"});let t=[],r=new Set,o=(n,s)=>{let i=n.properties;if(i!==void 0){if(!h(i))throw new u("Invalid MCP tool schema properties",m.invalidParams,{field:"inputSchema.properties"});for(let[a,d]of Object.entries(i)){if(!h(d))continue;let c=[...s,a],l=Ag(d,c,r);l&&t.push(l);for(let[p,f]of Object.entries(d))if(p!=="properties"&&p!=="x-mcp-header"&&Ee(f))throw new u("MCP x-mcp-header is not statically reachable",m.invalidParams,{field:c.join("."),keyword:p});o(d,c)}}};for(let[n,s]of Object.entries(e))if(n!=="properties"&&Ee(s))throw new u("MCP x-mcp-header is not statically reachable",m.invalidParams,{field:"inputSchema",keyword:n});return o(e,[]),t}function Sr(e,t){let r=e;for(let o of t){if(!h(r))return;r=r[o]}return r}function wr(e,t){let r=e==="resources/read"?t.uri:t.name;return typeof r=="string"?r:void 0}function vg(e,t){let r=h(e.arguments)?e.arguments:{},o={};for(let n of Cr(t)){let s=Sr(r,n.path);if(s!=null){if(!(n.type==="integer"&&typeof s=="number"&&Number.isSafeInteger(s)||n.type==="boolean"&&typeof s=="boolean"||n.type==="string"&&typeof s=="string"))throw new u("Invalid MCP custom header argument",m.invalidParams,{field:n.path.join("."),expected:n.type});o[`Mcp-Param-${n.name}`]=br(s)}}return o}function Tx(e){let t=h(e.request.params)?e.request.params:void 0,r=Je(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},s=wr(o,t);if(yr.has(o)){if(s===void 0)return A("Missing MCP request name","Mcp-Name");n["Mcp-Name"]=br(s)}return o==="tools/call"&&e.toolSchema!==void 0&&Object.assign(n,vg(t,e.toolSchema)),n}function Og(e,t){let r=t.method;(typeof r!="string"||r.length===0)&&A("Missing MCP request method","Mcp-Method");let o=h(t.params)?t.params:void 0,n=Je(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"),yr.has(r)){let s=e.get("mcp-name"),i=wr(r,o);(s===void 0||i===void 0||Tr(s,"Mcp-Name")!==i)&&A("MCP name header does not match request body","Mcp-Name")}e.has("last-event-id")&&A("MCP SSE resumability is not supported","Last-Event-ID")}function Pg(e,t,r){return e.type==="integer"?typeof t=="number"&&Number.isSafeInteger(t)&&Number(r)===t:e.type==="boolean"?typeof t=="boolean"&&r===String(t):typeof t=="string"&&r===t}function Rg(e){let t=h(e.params.arguments)?e.params.arguments:{};for(let r of Cr(e.toolSchema)){let o=Sr(t,r.path),n=`Mcp-Param-${r.name}`,s=e.headers.get(n.toLowerCase());if(o==null){s!==void 0&&A("Unexpected MCP parameter header",n);continue}s===void 0&&A("Missing MCP parameter header",n),Pg(r,o,Tr(s,n))||A("MCP parameter header does not match request body",n)}}function Cx(e){let t=Eg(e.headers),r=typeof e.request.method=="string"?e.request.method:"";Og(t,e.request),!(r!=="tools/call"||e.toolSchema===void 0)&&Rg({headers:t,params:e.request.params,toolSchema:e.toolSchema})}var Sx=H;import{AsyncLocalStorage as Ig}from"node:async_hooks";import{createHash as Er,timingSafeEqual as Mg}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]="a7c30d99-a0e4-552e-be61-0c54a455e211")}catch{}})();var y=class extends Error{httpStatus;challenge;constructor(t,r,o){super(t),this.name="PmMcpAuthorizationError",this.httpStatus=r,this.challenge=o}},kg=/^00-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})$/u,xg=/^[a-z][a-z0-9_*/-]{0,255}$/u,Ng=/^(?:[a-z0-9][a-z0-9_*/-]{0,240})@[a-z][a-z0-9_*/-]{0,13}$/u,Lg=/^[\x20-\x2B\x2D-\x3C\x3E-\x7E]{0,255}[\x21-\x2B\x2D-\x3C\x3E-\x7E]$/u,vr=/^[\x21\x23-\x5B\x5D-\x7E]+$/u,Or=/^[A-Za-z0-9!#$%&'*+.^_`|~-]+$/u,Dg=/^[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]*$/u,$g=/%(?![0-9A-Fa-f]{2})/u,Fg=512,Gg=32,Ug=180,jg=8192,Bg=8192,Pr=new Ig;function w(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 qg(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 Ox(e){let t=w(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=>w(n,"authorization server issuer").href.replace(/\/$/u,"")),o=[...new Set(e.scopes??[])];if(o.some(n=>!vr.test(n)))throw new y("Invalid authorization scope",401);return{resource:t,authorization_servers:r,...o.length>0?{scopes_supported:o.sort()}:{}}}function Px(e){let t=w(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(!h(e)||typeof e.issuer!="string")throw new y("Invalid authorization server metadata",401);let r=w(t,"expected issuer").href.replace(/\/$/u,"");if(w(e.issuer,"metadata issuer").href.replace(/\/$/u,"")!==r)throw new y("Authorization server issuer mismatch",401);if(!Array.isArray(e.code_challenge_methods_supported)||!e.code_challenge_methods_supported.includes("S256"))throw new y("Authorization server does not support required S256 PKCE",401);let o=d=>{let c=e[d];if(typeof c!="string")throw new y(`Authorization server metadata requires ${d}`,401);return w(c,d).href},n=d=>{let c=e[d];return typeof c=="string"?w(c,d).href:void 0},s=o("authorization_endpoint"),i=o("token_endpoint"),a=n("registration_endpoint");return{issuer:r,authorization_endpoint:s,token_endpoint:i,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}:{},...a?{registration_endpoint:a}:{}}}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 Mx(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 kx(e,t){let r=w(t,"client metadata document URL");if(r.pathname==="/"||!h(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);w(o,"client redirect URI",!0)}return structuredClone(e)}function xx(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=>w(r,"redirect URI",!0).href);return{application_type:e.applicationType,client_name:e.clientName.trim().slice(0,128),redirect_uris:t,grant_types:["authorization_code","refresh_token"],response_types:["code"],token_endpoint_auth_method:"none"}}var Ar=class{#e=new Map;set(t,r){let o=w(t,"credential issuer").href;this.#e.set(o,structuredClone(r))}get(t){let r=w(t,"credential issuer").href,o=this.#e.get(r);return o?structuredClone(o):void 0}delete(t){let r=w(t,"credential issuer").href;return this.#e.delete(r)}};function zg(e){let t=e.traceparent,r=e.tracestate;if(t!==void 0){let o=typeof t=="string"?kg.exec(t):null;if(!o)throw new y("Invalid MCP traceparent",403);let n=o[1],s=o[2];if(/^0+$/u.test(n)||/^0+$/u.test(s))throw new y("Invalid MCP traceparent",403)}if(r!==void 0&&(typeof r!="string"||!Vg(r)))throw new y("Invalid MCP tracestate",403);return{...typeof t=="string"?{traceparent:t}:{},...typeof r=="string"?{tracestate:r}:{}}}function $(e){return e.replace(/^[ \t]*|[ \t]*$/gu,"")}function Hg(e){return xg.test(e)||Ng.test(e)}function Vg(e){if(Buffer.byteLength(e,"utf8")>Fg)return!1;let t=e.split(",");if(t.length>Gg)return!1;let r=new Set;for(let o of t){let n=$(o);if(n.length===0)continue;let s=n.indexOf("="),i=s>0?n.slice(0,s):"",a=s>0?n.slice(s+1):"";if(!Hg(i)||!Lg.test(a)||r.has(i))return!1;r.add(i)}return!0}function Rr(e){return Dg.test(e)&&!$g.test(e)}function Kg(e){let t=$(e),r=t.indexOf("="),o=$(r>=0?t.slice(0,r):t),n=r>=0?$(t.slice(r+1)):void 0;return Or.test(o)&&(n===void 0||Rr(n))}function Wg(e){let t=$(e),r=t.split(";"),o=r[0],n=r.slice(1),s=o.indexOf("="),i=$(s>0?o.slice(0,s):""),a=s>0?$(o.slice(s+1)):"";if(!(!Or.test(i)||!Rr(a)||!n.every(Kg)))return{key:i,serialized:t}}function Yg(e,t){if(e===void 0)return;if(typeof e!="string"||Buffer.byteLength(e,"utf8")>jg)throw new y("Invalid MCP baggage",403);let r=new Set(t),o=e.split(",");if(o.length>Ug)throw new y("Invalid MCP baggage",403);let n=[];for(let s of o){let i=Wg(s);if(!i)throw new y("Invalid MCP baggage",403);r.has(i.key)&&n.push(i.serialized)}return n.length>0?n.join(","):void 0}function Nx(e,t={}){let r=h(e)&&h(e._meta)?e._meta:{},o=Yg(r.baggage,t.baggageAllowlist??[]);return{...zg(r),...o?{baggage:o}:{}}}function Lx(e,t){return Pr.run(structuredClone(e),t)}function Dx(){let e=Pr.getStore();return e?{...e}:void 0}async function $x(e){let t=w(e.policy.resourceMetadataUrl,"protected resource metadata URL",!0).href,r=[...new Set(e.policy.requiredScopes??[])];if(r.some(c=>!vr.test(c)))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 n=qg(e.headers,"authorization")?.match(/^Bearer ([^\s]+)$/iu);if(!n)throw new y("Missing or malformed bearer token",401,o);let s=n[1];if(Buffer.byteLength(s,"utf8")>Bg)throw new y("Missing or malformed bearer token",401,o);let i;try{i=await e.policy.verifyAccessToken(s)}catch{throw new y("Invalid bearer token",401,o)}let a=Array.isArray(i.audience)?i.audience:[i.audience];if(i.issuer!==e.policy.issuer||!a.includes(e.policy.resource))throw new y("Bearer token issuer or audience mismatch",401,o);let d=r.filter(c=>!i.scopes.includes(c));if(d.length>0)throw new y("Bearer token has insufficient scope",403,`${o}, scope="${d.join(" ")}"`);return{...i,audience:[...a],scopes:[...i.scopes]}}function Fx(e){let t=Er("sha256").update(e.token).digest();return r=>{let o=Er("sha256").update(r).digest();if(!Mg(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]="46f5fe59-6b84-5c68-ad07-bb1329f4ea29")}catch{}})();var it="io.modelcontextprotocol/ui",Ae="2026-01-26",kr="text/html;profile=mcp-app",Ir=Object.freeze({specVersion:Ae,mimeTypes:[kr]});function jx(e){let t=e.clientCapabilities.extensions;if(!h(t))return!1;let r=t[it];if(r===void 0)return!1;if(!h(r))throw new u("Invalid MCP Apps client capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[it]:Ir}}});let o=r.mimeTypes,n=r.specVersion;if(!Array.isArray(o)||!o.includes(kr)||n!==void 0&&n!==Ae)throw new u("Unsupported MCP Apps client capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[it]:Ir}}});return!0}var Xg={csp:{connectDomains:[],resourceDomains:[],frameDomains:[]},permissions:{},prefersBorder:!0},xr=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:Xg})));function Bx(e){return xr.find(t=>t.uri===e)}function qx(e){let t=new Map(xr.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 Mr(e){return e.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;")}function zx(e){let t=Mr(e.name),r=Mr(e.description),o=JSON.stringify({name:`pm-${e.id}-view`,version:Ae}),n=JSON.stringify(Ae);return`<!doctype html>
6
6
  <html lang="en">
7
7
  <head>
8
8
  <meta charset="utf-8">
@@ -25,11 +25,11 @@ import{a as Uh}from"./chunks/chunk-OQOEBWHU.js";import{a as S0,b as w0,c as E0,d
25
25
  (()=>{"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"})})();
26
26
  </script>
27
27
  </body>
28
- </html>`}import{createHash as st}from"node:crypto";import{lstat as Xg,readdir as jr,readFile as Jg}from"node:fs/promises";import M from"node:path";import{parseDocument as Zg}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]="eafd8bc3-0da1-5220-8fb1-6967eecdb6bf")}catch{}})();var Nr="io.modelcontextprotocol/skills",at="SEP-2640@a3e147ca2710f68214247aecc729731ee1ae8d03",Qg=Object.freeze({revision:at,status:"draft",directoryRead:!0});function Xx(e,t=!1){let r=e.clientCapabilities.extensions,o=h(r)?r[Nr]:void 0;if(!h(o)||o.revision!==at||t&&o.directoryRead!==!0)throw new u("Missing or incompatible Skills over MCP draft capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[Nr]:Qg}}})}var I=Object.freeze({maxFilesPerSkill:512,maxFileBytes:16*1024*1024,maxSkillBytes:16*1024*1024,defaultPageSize:20,maxPageSize:100}),Lr=100,ey=32*1024*1024,ty=/^[a-z0-9]+(?:-[a-z0-9]+)*$/u,Dr=new Set(Array.from({length:I.maxPageSize},(e,t)=>t+1));function C(e,t){throw new u(e,-32602,t)}function $r(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 ry(e,t){let r=/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/u.exec(e);r||C(`Skill ${t} is missing YAML frontmatter.`);let o=Zg(r[1],{prettyErrors:!1,strict:!0,uniqueKeys:!0});o.errors.length>0&&C(`Skill ${t} has invalid YAML frontmatter.`,{errors:o.errors.map(s=>s.message)});let n;try{n=o.toJS({maxAliasCount:0})}catch(s){C(`Skill ${t} has unsupported YAML aliases.`,{error:String(s)})}return(typeof n!="object"||n===null||Array.isArray(n))&&C(`Skill ${t} frontmatter must be an object.`),n}async function oy(e,t,r,o){return r>I.maxFileBytes&&C(`Skill resource exceeds the per-file limit: ${t}.`),o.files+=1,o.files>I.maxFilesPerSkill&&C(`Skill exceeds ${I.maxFilesPerSkill} files.`),o.skillBytes+=r,o.skillBytes>I.maxSkillBytes&&C(`Skill exceeds the aggregate byte limit: ${t}.`),o.originBytes.value+=r,o.originBytes.value>ey&&C(`Skill origin exceeds the aggregate byte limit: ${t}.`),Jg(e)}async function Br(e,t,r){let o=M.join(e,t),n=await jr(o,{withFileTypes:!0}),s=[];for(let i of n.sort((a,d)=>a.name.localeCompare(d.name))){let a=M.posix.join(t.split(M.sep).join("/"),i.name),d=M.join(e,...a.split("/")),c=await Xg(d);c.isSymbolicLink()&&C(`Skill resource must not be a symbolic link: ${a}.`),c.isDirectory()?s.push(...await Br(e,a,r)):c.isFile()?s.push({relative:a,bytes:await oy(d,a,c.size,r)}):C(`Skill resource must be a regular file or directory: ${a}.`)}return s}async function Fr(e,t,r){let o=new Map,n;try{n=await jr(e,{withFileTypes:!0})}catch(a){if(bt(a))return o;throw a}let s=n.filter(a=>a.isDirectory()&&ty.test(a.name)).sort((a,d)=>a.name.localeCompare(d.name));s.length>Lr&&C(`Skill origin exceeds ${Lr} directories.`);let i={value:0};for(let a of s){let d=await Br(M.join(e,a.name),"",{files:0,skillBytes:0,originBytes:i}),c=d.reduce((g,T)=>g+T.bytes.byteLength,0),l=d.find(g=>g.relative==="SKILL.md");if(!l)continue;let p=ry(l.bytes.toString("utf8"),a.name);p.name!==a.name&&C(`Skill directory ${a.name} must match frontmatter name.`,{actual:p.name??null,expected:a.name}),(typeof p.description!="string"||p.description.trim().length===0)&&C(`Skill ${a.name} requires a non-empty frontmatter description.`,{required:["description"]});let f=d.map(g=>({uri:`skill://${a.name}/${g.relative}`,digest:`sha256:${st("sha256").update(g.bytes).digest("hex")}`,size:g.bytes.byteLength})),_=st("sha256").update(f.map(g=>`${g.uri}:${g.digest}`).join(`
28
+ </html>`}import{createHash as st}from"node:crypto";import{lstat as Jg,readdir as jr,readFile as Zg}from"node:fs/promises";import M from"node:path";import{parseDocument as Qg}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]="eafd8bc3-0da1-5220-8fb1-6967eecdb6bf")}catch{}})();var Nr="io.modelcontextprotocol/skills",at="SEP-2640@a3e147ca2710f68214247aecc729731ee1ae8d03",ey=Object.freeze({revision:at,status:"draft",directoryRead:!0});function Zx(e,t=!1){let r=e.clientCapabilities.extensions,o=h(r)?r[Nr]:void 0;if(!h(o)||o.revision!==at||t&&o.directoryRead!==!0)throw new u("Missing or incompatible Skills over MCP draft capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[Nr]:ey}}})}var I=Object.freeze({maxFilesPerSkill:512,maxFileBytes:16*1024*1024,maxSkillBytes:16*1024*1024,defaultPageSize:20,maxPageSize:100}),Lr=100,ty=32*1024*1024,ry=/^[a-z0-9]+(?:-[a-z0-9]+)*$/u,Dr=new Set(Array.from({length:I.maxPageSize},(e,t)=>t+1));function C(e,t){throw new u(e,-32602,t)}function $r(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 oy(e,t){let r=/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/u.exec(e);r||C(`Skill ${t} is missing YAML frontmatter.`);let o=Qg(r[1],{prettyErrors:!1,strict:!0,uniqueKeys:!0});o.errors.length>0&&C(`Skill ${t} has invalid YAML frontmatter.`,{errors:o.errors.map(s=>s.message)});let n;try{n=o.toJS({maxAliasCount:0})}catch(s){C(`Skill ${t} has unsupported YAML aliases.`,{error:String(s)})}return(typeof n!="object"||n===null||Array.isArray(n))&&C(`Skill ${t} frontmatter must be an object.`),n}async function ny(e,t,r,o){return r>I.maxFileBytes&&C(`Skill resource exceeds the per-file limit: ${t}.`),o.files+=1,o.files>I.maxFilesPerSkill&&C(`Skill exceeds ${I.maxFilesPerSkill} files.`),o.skillBytes+=r,o.skillBytes>I.maxSkillBytes&&C(`Skill exceeds the aggregate byte limit: ${t}.`),o.originBytes.value+=r,o.originBytes.value>ty&&C(`Skill origin exceeds the aggregate byte limit: ${t}.`),Zg(e)}async function Br(e,t,r){let o=M.join(e,t),n=await jr(o,{withFileTypes:!0}),s=[];for(let i of n.sort((a,d)=>a.name.localeCompare(d.name))){let a=M.posix.join(t.split(M.sep).join("/"),i.name),d=M.join(e,...a.split("/")),c=await Jg(d);c.isSymbolicLink()&&C(`Skill resource must not be a symbolic link: ${a}.`),c.isDirectory()?s.push(...await Br(e,a,r)):c.isFile()?s.push({relative:a,bytes:await ny(d,a,c.size,r)}):C(`Skill resource must be a regular file or directory: ${a}.`)}return s}async function Fr(e,t,r){let o=new Map,n;try{n=await jr(e,{withFileTypes:!0})}catch(a){if(bt(a))return o;throw a}let s=n.filter(a=>a.isDirectory()&&ry.test(a.name)).sort((a,d)=>a.name.localeCompare(d.name));s.length>Lr&&C(`Skill origin exceeds ${Lr} directories.`);let i={value:0};for(let a of s){let d=await Br(M.join(e,a.name),"",{files:0,skillBytes:0,originBytes:i}),c=d.reduce((g,T)=>g+T.bytes.byteLength,0),l=d.find(g=>g.relative==="SKILL.md");if(!l)continue;let p=oy(l.bytes.toString("utf8"),a.name);p.name!==a.name&&C(`Skill directory ${a.name} must match frontmatter name.`,{actual:p.name??null,expected:a.name}),(typeof p.description!="string"||p.description.trim().length===0)&&C(`Skill ${a.name} requires a non-empty frontmatter description.`,{required:["description"]});let f=d.map(g=>({uri:`skill://${a.name}/${g.relative}`,digest:`sha256:${st("sha256").update(g.bytes).digest("hex")}`,size:g.bytes.byteLength})),_=st("sha256").update(f.map(g=>`${g.uri}:${g.digest}`).join(`
29
29
  `)).digest("hex");o.set(a.name,{uri:`skill://${a.name}/SKILL.md`,frontmatter:p,resources:f,_meta:{contractVersion:1,extensionRevision:at,origin:t,packageVersion:r,protocolVersion:H,trust:"untrusted",estimatedTokens:Math.ceil(c/4)},files:new Map(d.map(g=>[g.relative,g.bytes])),fingerprint:_})}return o}function Gr(e){let{files:t,fingerprint:r,...o}=e;return o}var Ur=class e{#e;#t;constructor(t){this.#e=t,this.#t=st("sha256").update([...t.entries()].sort(([r],[o])=>r.localeCompare(o)).map(([r,o])=>`${r}:${o.fingerprint}`).join(`
30
- `)).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)&&C("Skill cursor is invalid or stale."),Number(o.offset)}catch(o){if(o instanceof u)throw o;return C("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 Fr(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 s=await Fr(n,"workspace",t.packageVersion);for(let[i,a]of s)r.set(i,a)}}return new e(r)}list(t={}){let r=t.limit??I.defaultPageSize;Dr.has(r)||C(`Skill list limit must be an integer from 1 to ${I.maxPageSize}.`);let o=this.#r(t.cursor,"skills/list"),n=[...this.#e.values()].sort((d,c)=>d.uri.localeCompare(c.uri)),s=n.slice(o,o+r),i=o+s.length,a=i<n.length;return{skills:s.map(Gr),hasMore:a,...a?{nextCursor:this.#o(i,"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||C(`Unknown pm MCP skill: ${t}.`,{field:"uri"}),Gr(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]??"",s=o&&n?o.files.get(n):void 0,i=o?.resources.find(c=>c.uri===t);(!o||!s||!i)&&C(`Unknown pm MCP skill resource: ${t}.`,{field:"uri"});let a={digest:i.digest,origin:o._meta.origin,trust:"untrusted"},d=$r(n,s);return d!=="application/octet-stream"?{contents:[{uri:t,mimeType:d,text:s.toString("utf8"),_meta:a}]}:{contents:[{uri:t,mimeType:d,blob:s.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||C(`Unknown pm MCP skill directory: ${t}.`,{field:"uri"});let s=(o?.[2]??"").replace(/\/$/u,""),i=s.length>0?`${s}/`:"",a=`skill://${o[1]}`,d=new Map;for(let T of n.resources){let S=T.uri.slice(`${a}/`.length);if(!S.startsWith(i))continue;let q=S.slice(i.length),[P,...vo]=q.split("/"),Oo=`${a}/${i}${P}`,Po=n.files.get(`${i}${P}`);d.set(P,{uri:Oo,name:P,mimeType:vo.length>0?"inode/directory":$r(P,Po)})}s.length>0&&d.size===0&&C(`Unknown pm MCP skill directory: ${t}.`,{field:"uri"});let c=r.limit??I.maxPageSize;Dr.has(c)||C(`Skill directory limit must be an integer from 1 to ${I.maxPageSize}.`);let l=this.#r(r.cursor,t),p=[...d.values()].sort((T,S)=>T.uri.localeCompare(S.uri)),f=p.slice(l,l+c),_=l+f.length,g=_<p.length;return{resources:f,hasMore:g,...g?{nextCursor:this.#o(_,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]="2b24276b-948b-50bd-bfd9-f429cd74be70")}catch{}})();var qr="https://schema.unbrained.dev/pm/workspace-recipe/v1";function dt(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)=>dt(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,dt(o,`${t}.${r}`)])))}function ve(e){if(e.schema!==qr)throw new Error(`Unsupported workspace recipe schema: ${e.schema}`);let t=wt(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:dt(r.input,`operations[${o}].input`)})))})}async function zr(e,t){let r=ve(e);return Et(r,t)}async function ny(e,t){return zr(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]="c234be1c-35b7-5388-8a70-a012e9a34389")}catch{}})();var Hr="pm.agent-observation/v1",Vr="pm.agent-verdict/v1",Kr="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 ne(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let t of Object.values(e))ne(t)}return e}function iy(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 sy(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 ay(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 s of o.fields){if(F(s,"observation.tiers.fields"),n.has(s))throw new Error(`Duplicate observation tier field: ${s}.`);n.add(s)}}}function dy(e){if(e.schema!==Hr)throw new Error(`observation.schema must be ${Hr}.`);return k(e.id,"observation.id"),O(e.version,"observation.version"),iy(e.reads),sy(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")),ay(e.tiers),ne(structuredClone(e))}function iN(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 cy(e,t,r){O(r.budget_tokens,"observation request budget_tokens");let o=[];for(let[n,s]of e.tiers.entries()){o.push(s.id);let i=await t(s),a=Buffer.byteLength(R(i),"utf8"),d=Math.ceil(a/4);if(d<=Math.min(r.budget_tokens,s.max_tokens))return{status:"served",payload:i,receipt:{contract_id:e.id,contract_version:e.version,served_tier:s.id,degraded:n>0,attempted_tiers:o,emitted_bytes:a,estimated_tokens:d,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 F(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 Wr(e,t){let r=e;for(let o of F(t,"recorded field path")){if(r===null||typeof r!="object"||!Object.hasOwn(r,o))return;r=r[o]}return r}function ly(e){return`/${F(e,"verdict predicate path").map(t=>t.replaceAll("~","~0").replaceAll("/","~1")).join("/")}`}function py(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 uy(e){if(e.schema!==Vr)throw new Error(`verdict.schema must be ${Vr}.`);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"),F(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}.`);py(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 ne(structuredClone(e))}function my(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(i=>[i.id,i])),o=e.composition.predicate_ids.map(i=>{let a=r.get(i),d=Wr(t.state,a.path),c=a.kind==="field_present"?d!==void 0:a.kind==="field_absent"?d===void 0:R(d)===R(a.expected);return{id:i,outcome:c?"satisfied":"violated",evidence_pointer:`${t.snapshot_id}#${ly(a.path)}`,evidence_digest:Tt(R(d))}}),n=o.filter(i=>i.outcome==="satisfied").length,s=e.composition.operator==="all"?n===o.length:n>0;return{contract_id:e.id,contract_version:e.version,snapshot_id:t.snapshot_id,outcome:s?"satisfied":"violated",score:n/o.length,policy:"verdict_only_no_reward",predicates:o}}function sN(e){if(e.schema!==Kr)throw new Error(`episode.schema must be ${Kr}.`);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)F(t,"episode.observable_fields");for(let t of e.withheld_fields)F(t,"episode.withheld_fields");for(let t of e.observable_fields){let r=e.withheld_fields.find(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 dy(e.observation),uy(e.verdict),ve(e.recipe),ne(structuredClone(e))}function fy(e,t,r){let o=F(t,"observation projection field"),n=e;for(let[s,i]of o.entries()){if(s===o.length-1){r!==void 0&&(n[i]=structuredClone(r));return}let a=n[i];(a===null||typeof a!="object"||Array.isArray(a))&&(n[i]={}),n=n[i]}}function _y(e,t){let r={};for(let o of t)fy(r,o,Wr(e,o));return r}async function aN(e,t){let r=[],o=0,n=0,s=!1,i,a={episode:{id:e.id,label:`pm agent environment v${e.version}`},provenance:{role:e.mode,topic:"agent-environment"}},d=await D(a,()=>t.reset(e.recipe));r.push({sequence:1,kind:"reset",state_id:d.state_id});let c=async()=>{if(s)throw new Error("episode is already closed.");if(n>=e.limits.max_observations)throw new Error("episode exceeded limits.max_observations.");n+=1;let p=await t.readRecordedState(),f=await cy(e.observation,async _=>_y(p.state,_.fields),{budget_tokens:e.limits.max_tokens_per_observation});return r.push({sequence:r.length+1,kind:"observation",state_id:f.receipt.served_tier??p.snapshot_id}),f},l=async(p=!1)=>{if(s&&!p)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(),_=my(e.verdict,f);return r.push({sequence:r.length+1,kind:"verdict",state_id:f.snapshot_id}),_};return{observe:()=>D(a,c),step:async p=>{if(s)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 D(a,()=>t.execute(p));return r.push({sequence:r.length+1,kind:"action",state_id:f.state_id}),f},score:()=>D(a,l),close:()=>i!==void 0?i:s?Promise.reject(new Error("episode is already closed.")):(s=!0,i=D(a,()=>l(!0)).then(p=>(r.push({sequence:r.length+1,kind:"close",state_id:p.snapshot_id}),{verdict:p,trajectory:ne(structuredClone(r))})).catch(p=>{throw s=!1,p}).finally(()=>{i=void 0}),i)}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="14472bc2-ebca-5b9c-9462-bd8694b630a0")}catch{}})();var G="https://schema.unbrained.dev/pm/corpus-shape/v1";function K(e,t){if(!Number.isSafeInteger(e)||e<=0)throw new TypeError(`Corpus shape ${t} must be a positive safe integer`);return e}function ie(e,t){if(!Number.isSafeInteger(e)||e<0)throw new TypeError(`Corpus shape ${t} must be a non-negative safe integer`);return e}function Xr(e){if(!(typeof e!="object"||e===null||Object.isFrozen(e))){for(let t of Object.values(e))Xr(t);Object.freeze(e)}}function W(e){if(e.schema!==G)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(K(e.hierarchy_depth,"hierarchy_depth"),K(e.hierarchy_fanout,"hierarchy_fanout"),ie(e.age_span_days,"age_span_days"),K(e.history_entries_per_item,"history_entries_per_item"),ie(e.comments_per_100_items,"comments_per_100_items"),ie(e.notes_per_100_items,"notes_per_100_items"),ie(e.learnings_per_100_items,"learnings_per_100_items"),K(e.author_cardinality,"author_cardinality"),K(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 Xr(t),t}var Oe=[{kind:"implements",weight:5},{kind:"blocked_by",weight:2},{kind:"discovered_from",weight:2},{kind:"verifies",weight:2},{kind:"supersedes",weight:1},{kind:"related",weight:4}],Y=Object.freeze({scratch:W({schema:G,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:W({schema:G,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:Oe,author_cardinality:32,component_count:1,include_cycles:!1,custom_types:["Experiment"],custom_statuses:["review"],terminal_statuses:[],custom_fields:["domain"]}),"deep-graph":W({schema:G,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:Oe,author_cardinality:16,component_count:1,include_cycles:!0,custom_types:[],custom_statuses:[],terminal_statuses:[],custom_fields:[]}),"multi-decade":W({schema:G,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:Oe,author_cardinality:64,component_count:1,include_cycles:!1,custom_types:["Program"],custom_statuses:["archived"],terminal_statuses:["archived"],custom_fields:["portfolio"]}),"disconnected-archive":W({schema:G,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:Oe,author_cardinality:24,component_count:5,include_cycles:!1,custom_types:["Archive"],custom_statuses:["archived"],terminal_statuses:["archived"],custom_fields:["archive_source"]})});function hy(){return Object.keys(Y).sort().map(e=>Y[e])}function gy(e){let t=e.trim().toLowerCase();if(!Object.hasOwn(Y,t))throw new TypeError(`Unknown corpus shape "${e}". Available: ${Object.keys(Y).join(", ")}`);return Y[t]}var Yr=new WeakMap;function Jr(e,t){if(e===0)return[];let r=Yr.get(t);r===void 0&&(r=t.edge_kind_mix.flatMap(n=>Array.from({length:n.weight},()=>n.kind)),Yr.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 yy(e,t,r,o=42){if(ie(t,"item index"),K(r,"item count"),t>=r)throw new RangeError(`Corpus item index ${t} exceeds ${r}`);let n=Math.min(e.component_count,r),s=t%n,i=Math.floor(t/n),a=0,d=1;for(let S=0;S<e.hierarchy_depth;S+=1)a=Math.min(Number.MAX_SAFE_INTEGER,a+d),d=Math.min(Number.MAX_SAFE_INTEGER,d*e.hierarchy_fanout);let c=i%a,l=i-c,p=c===0?void 0:s+(l+Math.floor((c-1)/e.hierarchy_fanout))*n,f=Date.UTC(2026,0,1),_=e.age_span_days*864e5,g=new Date(f+(r===1?0:Math.round(t/(r-1)*_))).toISOString(),T=(t*37+o)%100;return{index:t,id:`pm-s${t.toString(36).padStart(7,"0")}`,...p===void 0?{}:{parent:`pm-s${p.toString(36).padStart(7,"0")}`},component:s,timestamp:g,author:`pm-corpus-agent-${(t+o)%Math.min(e.author_cardinality,r)}`,history_entry_count:e.history_entries_per_item,dependency_kinds:Jr(t,e),has_comment:T<e.comments_per_100_items,has_note:T<e.notes_per_100_items,has_learning:T<e.learnings_per_100_items,...e.custom_types.length>0&&t%11===0?{custom_type:e.custom_types[t%e.custom_types.length]}:{},...e.custom_statuses.length>0&&t%13===0?{custom_status:e.custom_statuses[t%e.custom_statuses.length]}:{}}}var ct=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,Jr(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[i,,a]of this.annotationFields){let d=Math.floor(this.itemCount/100),c=this.itemCount%100,l=d*a+Math.max(0,a+c-100),p=d*a+Math.min(a,c),f=this.annotations[i];(f<l||f>p)&&o.push(`${i}:${f}!in[${l},${p}]`)}let n=new Set([...Object.keys(this.edgeKinds),...Object.keys(this.expectedEdgeKinds)]);for(let i of[...n].sort()){let a=this.edgeKinds[i]??0,d=this.expectedEdgeKinds[i]??0;a!==d&&o.push(`edge_kind:${i}:${a}!=${d}`)}let s=[...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:s.length===0,mismatches:s}}};function Zr(e){return new ct(e)}function by(e,t){let r=Zr(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]="6a6b2905-b6b7-5b46-b87d-8b8287e37745")}catch{}})();async function Ty(){let e=Fe(process.cwd(),process.env.PM_PATH);await Ot(e,(t,r)=>Pt(t,r,{apply_runtime_defaults:!0}))}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="4534b1c9-de27-5745-88f2-641b00b94714")}catch{}})();async function Cy(){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]="c1cb8d82-20a6-5460-a0ff-f55312911218")}catch{}})();var Qr=["lines","branches","functions","statements"];function Sy(e,t){if(typeof t!="object"||t===null||Array.isArray(t))throw new TypeError(`Coverage entry for ${e} must be an object.`)}function wy(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 Ey(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)){Sy(r,o);for(let n of Qr){let s=wy(r,n,o[n]),i=s.total-s.covered;i>0&&t.push({file:r,metric:n,uncovered:i,...s})}}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]="7e55d416-9cc3-51c5-8e56-6b5fd5c836a9")}catch{}})();var Ay=["captured_redacted","captured_verbatim"],vy=[{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 Oy(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||!Ay.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 s of vy)s.pattern.test(n)&&o.push({boundary_id:e.id,kind:"unsafe_fixture",detail:`${e.fixture_path} contains a possible ${s.label}.`});return o}function Py(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")&&_e(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 Ry(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?Oy(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 Py(e,r)}function EN(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,s=0,i=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 d=a,c=v(d.id)?d.id:void 0;if(c!==void 0&&n.has(c)){o.push({boundary_id:c,kind:"duplicate_boundary",detail:`Boundary ${c} is inventoried more than once.`});continue}c!==void 0&&n.add(c);let l=Ry(d,t,r.getTime());s+=l.captured,i+=l.waived,o.push(...l.findings)}return o.sort((a,d)=>a.boundary_id!==d.boundary_id?a.boundary_id.localeCompare(d.boundary_id):a.kind.localeCompare(d.kind)),{ok:o.length===0,boundary_count:e.boundaries.length,captured_count:s,waived_count:i,findings:o}}import X from"node:fs";import lt from"node:path";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="aacf5738-098d-50f9-b619-19e472b577ea")}catch{}})();var eo=300*1e3,Iy=3;function RN(e){return(e?.trim()||"development").replace(/[^a-zA-Z0-9._-]/g,"_").replace(/^\./,"_")}function IN(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=lt.join(e,r);X.mkdirSync(o,{recursive:!0});let n=new Date;X.utimesSync(o,n,n);let s=X.readdirSync(e).filter(c=>c!==r).flatMap(c=>{try{return[{name:c,mtimeMs:X.statSync(lt.join(e,c)).mtimeMs}]}catch(l){if(l instanceof Error&&"code"in l&&fe(l))return[];throw l}}).sort((c,l)=>l.mtimeMs-c.mtimeMs||c.name.localeCompare(l.name)),i=s.filter(c=>n.getTime()-c.mtimeMs<eo),a=Math.max(0,Iy-1-i.length),d=s.filter(c=>n.getTime()-c.mtimeMs>=eo).slice(a).map(c=>c.name).sort((c,l)=>c.localeCompare(l));for(let c of d)X.rmSync(lt.join(e,c),{recursive:!0,force:!0,maxRetries:3,retryDelay:50});return{retained:r,removed:d}}import{createHash as My}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]="ff60bc5b-bd85-5b3c-9a55-21e7e72477ac")}catch{}})();var pt=1;function J(e){e?.throwIfAborted()}function U(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship graph ${t} must be non-empty`);return e.trim()}function Z(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(),s=e.edges(),i=t.list();return Object.freeze({version:pt,fingerprint:My("sha256").update(R({nodes:n,edges:s,kinds:i})).digest("hex"),created_at:new Date(o).toISOString(),nodes:n,edges:s,kinds:i})}function ky(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ae(e){if(!ky(e))throw new TypeError("Relationship graph snapshot must be an object");if(e.version!==pt)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 De([]);for(let n of e.kinds)t.register(n);let r=new z(e.nodes,e.edges,t),o=Z(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){U(e.name,"adapter name");let r=U(t.workspace,"workspace");J(t.signal);let o=await e.read({...t,workspace:r});return J(t.signal),o===null?null:ae(o)}async function Pe(e,t){let r=U(t.workspace,"workspace"),o=ae(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(J(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 xy(e,t={}){let r=e.map(ae),o=new Map;for(let i of r)for(let a of i.snapshot.kinds){let d=o.get(a.kind);if(d&&R(d)!==R(a))throw new TypeError(`Conflicting federated relationship kind: ${a.kind}`);o.set(a.kind,a)}let n=new De([...o.values()].sort((i,a)=>i.kind.localeCompare(a.kind))),s=new z(new Set(r.flatMap(i=>[...i.snapshot.nodes])),r.flatMap(i=>[...i.snapshot.edges]),n);return Z(s,n,t)}var se=class{name;#e=new Map;constructor(t="memory"){this.name=U(t,"adapter name")}async read(t){J(t.signal);let r=this.#e.get(U(t.workspace,"workspace"));return r?structuredClone(r):null}async replace(t){J(t.signal);let r=U(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(ae(t.snapshot).snapshot))}async clear(t){J(t.signal);let r=U(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]="e47f9bb8-f98e-5159-9116-29c3e6fedfc3")}catch{}})();function to(e,t){if(!Number.isInteger(e)||e<1)throw new TypeError(`Relationship graph ${t} must be a positive integer`);return e}function Ny(e){let t=to(e.nodeCount,"nodeCount"),r=to(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(),s=(e.idPrefix??"node").trim();if(!n||!s)throw new TypeError("Relationship graph kind and idPrefix must be non-empty");let i=o==="disconnected"?0:Math.floor((t-1)/r);return{node_count:t,edge_count:i,edge_basis:"fixture_generated",nodes:{*[Symbol.iterator](){for(let a=0;a<t;a+=1)yield`${s}-${a}`}},edges:{*[Symbol.iterator](){if(o!=="disconnected")for(let a=r;a<t;a+=r)yield{source:`${s}-${o==="star"?0:a-r}`,target:`${s}-${a}`,kind:n}}}}}function j(e,t){if(!e)throw new Error(`Relationship graph adapter conformance: ${t}`)}async function ro(e,t={}){let r=t.workspace?.trim()||"pm-graph-conformance",o=yt(),n=Z(new z(["a","b"],[{source:"a",target:"b",kind:"related"}],o),o,{createdAt:"2026-01-01T00:00:00.000Z"}),s=Z(new z(["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"}),i=[];j(await x(e,{workspace:r})===null,"workspace must start empty"),i.push({name:"empty-read",passed:!0});let a=await Pe(e,{workspace:r,snapshot:n});j(a.disposition==="written","first sync must write"),i.push({name:"atomic-replace",passed:!0}),(await e.read({workspace:r})).nodes.push("mutated-reader-copy"),j((await x(e,{workspace:r}))?.snapshot.nodes.length===2,"reads must not mutate stored state"),i.push({name:"read-isolation",passed:!0}),j((await Pe(e,{workspace:r,snapshot:n})).disposition==="current","identical sync must be idempotent"),i.push({name:"idempotent-sync",passed:!0}),await e.replace({workspace:r,snapshot:s,expected_fingerprint:n.fingerprint}),j((await x(e,{workspace:r}))?.snapshot.fingerprint===s.fingerprint,"replacement must become visible"),i.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 j(d,"stale compare-and-swap must fail"),i.push({name:"stale-cas",passed:!0}),e.clear&&(await e.clear({workspace:r,expected_fingerprint:s.fingerprint}),j(await x(e,{workspace:r})===null,"clear must remove the workspace"),i.push({name:"clear",passed:!0})),{adapter:e.name,workspace:r,cases:Object.freeze(i),clear_supported:e.clear!==void 0}}function Ly(e){return ro(new se,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]="58736688-35d0-545d-892e-e0ede7fedc1a")}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]="f5567aa1-0268-574d-907b-38d6249538ce")}catch{}})();var ut=2,Dy=["self_reported","independent_transport"];function Re(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function de(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`${t} must be a non-empty string`);return e.trim()}function oo(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 s=de(o,`${t}[${String(n)}]`);return r?o:s})}function mt(e,t){return e===void 0?void 0:de(e,t)}function $y(e,t){if(e===void 0)return;if(!Re(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(s=>s.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 Fy(e,t,r,o,n,s){if(o==="refusal"){if(We(r)||n===void 0||s===void 0)throw new TypeError(`${e} refusal steps require a non-success exit, error code, and refusal surface`);return}if(n!==void 0||s!==void 0)throw new TypeError(`${e} only refusal steps may declare expected_error_code or expected_refusal_surface`);let i=Ct(t);if(i===void 0)throw new TypeError(`${e}.args must identify a command after global flags`);let a=t[i].trim().toLowerCase();if(a==="history"){let l=St(t.slice(i+1));l!==void 0&&(a=Le(`history ${l}`))}let d=Nt(a);if(!We(r)||r!==0&&!d?.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 c=xt(a).kind;if(o!==c)throw new TypeError(`${e} expected ${o}, but ${a} declares ${c}`)}function Gy(e,t,r){if(!Re(e))throw new TypeError(`tasks.${t}.steps[${String(r)}] must be an object`);let o=`tasks.${t}.steps[${String(r)}]`,n=de(e.id,`${o}.id`),s=oo(e.args,`${o}.args`,!0),i=e.expected_exit_code;if(typeof i!="number"||!Number.isSafeInteger(i))throw new TypeError(`${o}.expected_exit_code must be a safe integer`);let a=e.expected_output_kind;if(a!=="refusal"&&!kt.includes(a))throw new TypeError(`${o}.expected_output_kind is unsupported`);let d=a,c=e.expected_accounting_mode;if(!Dy.includes(c))throw new TypeError(`${o}.expected_accounting_mode is unsupported`);let l=c;if(l==="independent_transport"&&d!=="refusal")throw new TypeError(`${o} independent_transport accounting is supported only for refusal steps`);let p=oo(e.required_fields,`${o}.required_fields`);if(p.some(S=>S.split(".").some(q=>q.length===0)))throw new TypeError(`${o}.required_fields must contain dot-separated own-property paths`);let f=$y(e.expected_field_values,`${o}.expected_field_values`),_=mt(e.expected_error_code,`${o}.expected_error_code`),g=mt(e.expected_refusal_surface,`${o}.expected_refusal_surface`),T=mt(e.recovery_for,`${o}.recovery_for`);return Fy(o,s,i,d,_,g),{id:n,args:s,expected_exit_code:i,expected_output_kind:d,expected_accounting_mode:l,required_fields:p,...f?{expected_field_values:f}:{},..._?{expected_error_code:_}:{},...g?{expected_refusal_surface:g}:{},...T?{recovery_for:T}:{}}}function Uy(e,t){if(!Re(e))throw new TypeError(`tasks[${String(t)}] must be an object`);let r=de(e.id,`tasks[${String(t)}].id`),o=de(e.description,`tasks.${r}.description`);if(!Array.isArray(e.steps)||e.steps.length===0)throw new TypeError(`tasks.${r}.steps must be a non-empty array`);let n=e.steps.map((i,a)=>Gy(i,r,a)),s=new Map;for(let i of n){if(s.has(i.id))throw new TypeError(`tasks.${r} contains duplicate step id ${i.id}`);if(i.recovery_for!==void 0&&(s.get(i.recovery_for)?.expected_output_kind!=="refusal"||i.expected_output_kind==="refusal"))throw new TypeError(`tasks.${r}.${i.id} recovery_for must reference an earlier refusal and declare successful output`);s.set(i.id,i)}if(n.at(-1)?.expected_output_kind==="refusal")throw new TypeError(`tasks.${r} completed task must terminate with successful output`);for(let i of n)if(i.expected_output_kind==="refusal"&&!n.some(a=>a.recovery_for===i.id))throw new TypeError(`tasks.${r}.${i.id} refusal must have a later successful recovery_for step`);return{id:r,description:o,steps:n}}function aL(e){if(!Re(e))throw new TypeError("agent-task transcript corpus must be an object");if(e.version!==ut)throw new TypeError(`agent-task transcript corpus version must be ${String(ut)}`);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)=>Uy(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:ut,tasks:t}}import{createHash as no}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]="7163a078-d8be-5bca-813f-c941fcb8e406")}catch{}})();function io(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship backfill ${t} must be non-empty`);return e.trim()}function pL(e,t){let r=io(t.migrationId,"migrationId"),o=io(t.author,"author"),n=Date.parse(t.timestamp);if(!Number.isFinite(n))throw new TypeError("Relationship backfill timestamp must be valid");let s=new Date(n).toISOString(),i=He(e,void 0,t.registry),a=i.graph.nodes(),d=i.graph.edges().map(f=>{let _=no("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}:${_}`,relationshipId:`migration:${r}:${_}`,action:"add",edge:f,author:o,timestamp:s,reason:`Backfill ${r} from legacy item metadata`})}),c=no("sha256").update(JSON.stringify({migrationId:r,nodes:a,events:d})).digest("hex"),l=new Set([...t.existingEventIds??[]].filter(f=>typeof f=="string").map(f=>f.trim()).filter(Boolean)),p=d.filter(f=>!l.has(f.eventId));return Object.freeze({migration_id:r,fingerprint:c,nodes:a,events:Object.freeze(p),edge_count:d.length,skipped_existing_count:d.length-p.length,duplicate_dependency_rows:i.duplicateRows.length,dangling_reference_count:i.dangling.active.length+i.dangling.legacy_terminal.length})}import*as so 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]="7a1d7194-6ff1-5365-ab64-80b47b0176d7")}catch{}})();var ce=["suggested_retry","candidate_command","example","next_step","migration_hint","restore_with"],ft={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"}},mL=Object.freeze(Object.keys(ft));function ao(e){if(Object.hasOwn(ft,e))return ft[e]}var jy=new Set([..."=([{,:;!?&|+-*%^~<>","=>"]);function Q(e,t){return e<t?-1:e>t?1:0}function By(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 qy(e){return e===void 0||e.kind==="punctuator"&&jy.has(e.value)||e.kind==="identifier"&&["return","case","throw","else","yield"].includes(e.value)}function zy(e,t){if(/\s/u.test(e[t]))return t+1;if(e.startsWith("//",t)){let r=e.indexOf(`
31
- `,t+2);return r===-1?e.length:r+1}if(e.startsWith("/*",t))return e.indexOf("*/",t+2)+2}function Hy(e,t,r){if(e[t]!=="/"||!qy(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 Vy(e,t){let r=e[t];if(r==="'"||r==='"'||r==="`"){let n=By(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 Ky(e){let t=[],r=0;for(;r<e.length;){let o=zy(e,r);if(o!==void 0){r=o;continue}let n=Hy(e,r,t.at(-1));if(n!==void 0){r=n;continue}let s=Vy(e,r);s.token&&t.push(s.token),r=s.next}return t}var Wy=new Set(["object","block","pattern"]),Yy=new Set(["const","let","var"]),Xy=new Set(["}",")","]"]),Jy=new Set(["=","(","[",",",":","?","return"]);function Zy(e,t,r){if([...r].reverse().find(n=>Wy.has(n.kind))?.kind==="pattern"||r.at(-1)?.kind==="paren"&&r.at(-1)?.parameter_list)return"pattern";let o=e[t-1];return o?.kind==="identifier"&&Yy.has(o.value)?"pattern":o?.value==="=>"||o?.value===")"?"block":o&&Jy.has(o.value)?"object":"block"}function Qy(e,t,r){let o=e[t];if(o.value==="{"){let i=Zy(e,t,r);return{kind:i,...i==="object"?{member_start:!0,candidates:[]}:{}}}if(o.value==="[")return{kind:"array"};if(o.value!=="(")return;let n=e[t-1],s=e[t-2];return{kind:"paren",...n?.value==="function"||s?.value==="function"?{parameter_list:!0}:{}}}function eb(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 tb(e,t){return e[t+1]?.value===")"&&e[t+2]?.value==="=>"||e[t+1]?.value==="="}function rb(e){let t=Ky(so.stripTypeScriptTypes(e,{mode:"strip"})),r=[],o=[];for(let[n,s]of t.entries()){let i=o.at(-1),a=eb(i,s,t[n+1]);a&&i.candidates.push(a);let d=Qy(t,n,o);if(d)o.push(d);else if(Xy.has(s.value)){let c=o.pop();c?.kind==="object"&&!tb(t,n)&&r.push(...c.candidates)}else s.value===","&&i?.kind==="object"?i.member_start=!0:i?.kind==="object"&&s.value!==":"&&(i.member_start=!1)}return r}function ob(e){let t=[0];for(let r=0;r<e.length;r+=1)e[r]===`
32
- `&&t.push(r+1);return t}function nb(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 fL(e){let t=[],r=[];for(let n of[...e].sort((s,i)=>Q(s.path,i.path))){let s=ob(n.content),i;try{i=rb(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 i){let d=a.field,c=nb(s,a.offset),l=ao(d);l?t.push({path:n.path,line:c,field:d,kind:l.kind}):/(?:retry_command|candidate_command|fallback_candidate|next_best_command|example|next_step|migration_hint|restore_with)/u.test(d)&&!/(?:_total|_truncated)$/u.test(d)&&r.push({kind:"unknown_recovery_field",subject:`${n.path}:${c}:${d}`,detail:`${d} resembles a recovery reference but has no typed field contract.`})}}let o=Object.fromEntries(ce.map(n=>[n,t.filter(s=>s.kind===n).length]));for(let n of ce)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,s)=>n.path!==s.path?Q(n.path,s.path):n.line!==s.line?n.line-s.line:Q(n.field,s.field)),r.sort((n,s)=>n.subject!==s.subject?Q(n.subject,s.subject):Q(n.kind,s.kind)),{ok:r.length===0,scanned_file_count:e.length,producer_count:t.length,producer_count_by_kind:o,producers:t,findings:r}}function _L(e,t){let r=[],o=(n,s)=>{if(Array.isArray(n)){n.forEach((i,a)=>o(i,[...s,String(a)]));return}if(!(typeof n!="object"||n===null))for(let[i,a]of Object.entries(n).sort(([d],[c])=>Q(d,c))){let d=ao(i),c=d?.kind==="migration_hint"&&n.semantics==="behavior_preserving"?{...d,semantics:"behavior_preserving"}:d,l=[a].flat();c!==void 0&&l.forEach((p,f)=>{let _="nested_value_field"in c&&typeof c.nested_value_field=="string"?c.nested_value_field:void 0,g=_&&typeof p=="object"&&p!==null&&!Array.isArray(p)?p[_]:p;if(typeof g!="string"||g.trim().length===0)return;let T=[...s,i,String(f)].map(S=>encodeURIComponent(S)).join("/");r.push({id:`${e}:${c.kind}:${T}`,probe_id:e,kind:c.kind,semantics:c.semantics,value:g})}),o(a,[...s,i])}};return o(t,[]),r}function hL(e,t){let r=e.flatMap(i=>(i.owned_states??[]).map(a=>({contract:i,state:a}))),o=[],n=new Map;for(let i of t){if(n.has(i.probe_id)){o.push({kind:"duplicate_probe",probe_id:i.probe_id,detail:`Observation ${i.probe_id} was supplied more than once.`});continue}n.set(i.probe_id,i)}let s=new Set(r.map(({state:i})=>i.probe_id));for(let{contract:i,state:a}of r){let d=n.get(a.probe_id);if(!d){o.push({kind:"missing_probe",probe_id:a.probe_id,detail:`No entrypoint observation was recorded for ${i.code}.`});continue}d.code!==i.code&&o.push({kind:"wrong_error_code",probe_id:a.probe_id,detail:`Expected ${i.code}; observed ${d.code}.`}),d.exit_class!==a.expected_exit_class&&o.push({kind:"wrong_exit_class",probe_id:a.probe_id,detail:`Expected ${a.expected_exit_class}; observed ${d.exit_class}.`}),a.entrypoints.includes(d.entrypoint)||o.push({kind:"wrong_entrypoint",probe_id:a.probe_id,detail:`Expected one of ${a.entrypoints.join(", ")}; observed ${d.entrypoint}.`})}for(let i of t)s.has(i.probe_id)||o.push({kind:"undeclared_probe",probe_id:i.probe_id,detail:`Observation ${i.probe_id} has no catalog declaration.`});return o.sort((i,a)=>i.probe_id!==a.probe_id?i.probe_id.localeCompare(a.probe_id):i.kind.localeCompare(a.kind)),{ok:o.length===0,declared_probe_count:r.length,observed_probe_count:t.length,findings:o}}function gL(e,t){let r=[],o=new Set,n=new Set;for(let d of e){if(o.has(d.id)){n.add(d.id),r.push({kind:"duplicate_obligation",reference_id:d.id,detail:`Recovery obligation ${d.id} was declared more than once.`});continue}o.add(d.id)}let s=new Map;for(let d of t){if(s.has(d.id)){r.push({kind:"duplicate_observation",reference_id:d.id,detail:`Recovery reference ${d.id} was observed more than once.`});continue}s.set(d.id,d),o.has(d.id)||r.push({kind:"undeclared_observation",reference_id:d.id,detail:`Recovery observation ${d.id} has no emitted obligation.`})}for(let d of e){if(n.has(d.id))continue;let c=s.get(d.id);c?c.reachable?c.semantics!==d.semantics&&r.push({kind:"wrong_semantics",reference_id:d.id,detail:`Recovery reference ${d.value} promised ${d.semantics}; proof demonstrated ${c.semantics}.`}):r.push({kind:"unreachable_reference",reference_id:d.id,detail:`Recovery reference ${d.value} did not reach its promised target.`}):r.push({kind:"missing_observation",reference_id:d.id,detail:`No reachability proof was recorded for ${d.kind} ${d.value}.`})}let i=ce.map(d=>{let c=e.filter(p=>p.kind===d),l=c.filter(p=>!n.has(p.id)).map(p=>s.get(p.id)).filter(p=>p!==void 0);return{kind:d,declared:c.length,observed:l.length,passed:c.filter(p=>{let f=s.get(p.id);return!n.has(p.id)&&f?.reachable===!0&&f.semantics===p.semantics}).length}});r.sort((d,c)=>d.reference_id!==c.reference_id?d.reference_id.localeCompare(c.reference_id):d.kind.localeCompare(c.kind));let a=i.reduce((d,c)=>d+c.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:i,findings:r}}function ib(e,t){let r=new Map(ce.map(s=>[s,new Set]));for(let s of t)r.get(s.kind).add(s.value);let o=ce.map(s=>({kind:s,source_producers:e.producer_count_by_kind[s],runtime_values:r.get(s).size})),n=o.filter(({source_producers:s,runtime_values:i})=>s>0&&i===0).map(({kind:s})=>s);return{ok:e.ok&&n.length===0,source_producer_count:e.producer_count,runtime_value_count:o.reduce((s,{runtime_values:i})=>s+i,0),coverage_by_kind:o,missing_runtime_kinds:n}}var yL=ib;(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]="2b2197f3-7203-52c8-9cc7-f714b33a9306")}catch{}})();var TL=16,sb=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"]),co=18,lo=Object.freeze([...sb,"manifest_unknown_key","no_version_bounds_declared"].sort((e,t)=>e.localeCompare(t)));function CL(e,t=co){return{ok:e.executable_error_code_count>=t,baseline:t,actual:e.executable_error_code_count}}function SL(e,t=lo){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 _t(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 wL(e,t,r){let o=new Map(e.map(l=>[l.code,l.canonical_code??l.code])),n=new Map,s=0,i=0;for(let l of e){let p=_t(n,l.canonical_code??l.code);for(let f of l.owned_states??[])p.kinds.add("owned_state"),p.probeIds.add(f.probe_id)}for(let l of t){let p=o.get(l.error_code);if(p===void 0)continue;s+=1;let f=_t(n,p);f.kinds.add("closed_domain"),f.probeIds.add(l.probe_id)}for(let l of r){let p=o.get(l.error_code);if(p===void 0)continue;i+=1;let f=_t(n,p);f.kinds.add("grammar"),f.probeIds.add(l.probe_id)}let a=e.map(l=>{let p=l.canonical_code??l.code,f=n.get(p),_=[...f.probeIds].sort();return{code:l.code,canonical_code:p,disposition:_.length>0?"executable":"uncovered",evidence_kinds:[...f.kinds].sort(),probe_ids:_}}).sort((l,p)=>l.code<p.code?-1:1),d=a.filter(({disposition:l})=>l==="uncovered").map(({code:l})=>l),c=a.length-d.length;return{ok:d.length===0,catalog_error_code_count:a.length,executable_error_code_count:c,uncovered_error_code_count:d.length,coverage_fraction:a.length===0?1:c/a.length,closed_domain_probe_count:s,grammar_probe_count:i,uncovered_error_codes:d,rows:a}}function EL(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: ${co}`,`- Required executable canonical codes: ${lo.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(`
33
- `)}(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]="d252409d-e33e-5c9e-9671-789f0ee87312")}catch{}})();function ab(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 db(e){return[e.exit_code!==me.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 ${me.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."},...ab(e)]}function OL(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 s=t.length;for(let i of db(n))i!==void 0&&t.push(i);t.length===s&&(o+=1)}return t.sort((n,s)=>n.probe_id!==s.probe_id?n.probe_id.localeCompare(s.probe_id):n.code.localeCompare(s.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]="39b4e1fe-a34a-5ffc-9447-eaf8c46863c7")}catch{}})();var po="not-a-declared-action";function cb(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 le(e){return e.replaceAll(/[^a-z0-9]+/gu,"-").replaceAll(/^-|-$/gu,"")}function DL(e=qe.filter(t=>vt.some(r=>r.command===t.command&&r.disposition!=="package_owned"))){let t=new Set(e.filter(({command:r})=>!r.includes(" ")).map(({command:r})=>le(r)));return e.flatMap(r=>r.slots.flatMap((o,n)=>{if(!o.required)return[];let s=r.command.split(" "),i=le(r.command),a=s.length>1&&t.has(i)?s.map(le).join("--"):i,d=ee(r.command).flatMap(l=>l.required?[l.flag,...l.value_name?["example"]:[]]:[]),c=Be.some(l=>l.command===r.command);return[{probe_id:`required-argument-${a}-${le(o.name)}`,command:r.command,refusal_args:[...s,...r.slots.slice(0,n).map(l=>cb(r.command,l)),...d],recovery_args:[...s,"--help"],error_code:c&&!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 lb(e){switch(L(e)){case"assurance":case"workspace snapshot":return Be.filter(({parent:t})=>t===e).map(({action:t})=>t);case"graph":return Ge;case"merge":return Ue;case"plan":return Ye;case"profile":return Xe;case"schema":return Lt;default:throw new Error(`Required positional action family ${e} has no authoritative value domain.`)}}function $L(e=qe){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-${le(t)}`,command:t,refusal_args:[...r,po],recovery_args:[...r,"--help"],error_code:"unknown_subcommand",rejected_value:po,allowed_values:[...lb(t)].sort()}}).sort((t,r)=>t.probe_id.localeCompare(r.probe_id))}function pb(e,t){let r=[...t].sort();return e.length===t.length&&[...e].sort().every((o,n)=>o===r[n])}function ub(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&&!pb(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 FL(e,t){let r=new Map(e.map(i=>[i.probe_id,i])),o=new Map(t.map(i=>[i.probe_id,i])),n=[...e.flatMap(i=>ub(i,o.get(i.probe_id))),...t.filter(i=>!r.has(i.probe_id)).map(i=>({code:"unexpected_refusal_probe",probe_id:i.probe_id,detail:`${i.probe_id} has no declared grammar refusal contract.`}))];n.sort((i,a)=>i.probe_id.localeCompare(a.probe_id)||i.code.localeCompare(a.code));let s=new Set(n.map(({probe_id:i})=>i));return{ok:n.length===0,probe_count:e.length,closed_probe_count:e.filter(({probe_id:i})=>!s.has(i)).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]="d3795bc4-fbe5-5ca4-bc90-b72a2d469dc7")}catch{}})();var ht=[{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 UL(){return ht.map(e=>({...e}))}function mb(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 jL(e){let t=new Map(e.map(n=>[n.probe_id,n])),r=[],o=0;for(let n of ht){let s=t.get(n.probe_id);if(s===void 0){r.push({code:"missing_probe",probe_id:n.probe_id,detail:"No runtime observation was supplied for this contract."});continue}let i=mb(n,s);r.push(...i),i.length===0&&(o+=1)}return r.sort((n,s)=>n.probe_id.localeCompare(s.probe_id)||n.code.localeCompare(s.code)),{ok:r.length===0,probe_count:ht.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]="32070e26-7a40-50ff-84d7-73e50ff5f01f")}catch{}})();var Ie,fb=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 _b(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=fb[L(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(L(e))?"linked-file-path":["comments","notes","learnings"].includes(L(e))?"entry-file-input":"plan-definition-file"}function Me(){if(Ie!==void 0)return Ie;let e=te.filter(({command:n})=>ze(n)).flatMap(({command:n,family:s})=>Mt(n,ee(n)).map(i=>({command:n,family:s,concept:_b(n,i.flag),flag:i.flag,aliases:Object.freeze([...i.aliases??[]]),value_kind:i.repeatable?"list":i.flag==="--limit"?"number":i.value_type}))),t=new Set(e.flatMap(n=>n.aliases.map(s=>`${n.command}:${s}`))),r=e.filter(n=>!t.has(`${n.command}:${n.flag}`)),o=new Map;for(let n of r){let s=o.get(n.concept)??new Set;s.add(n.value_kind),o.set(n.concept,s)}return Ie=Object.freeze(r.map(n=>Object.freeze({...n,concept:o.get(n.concept)?.size===1?n.concept:`${n.concept}@${n.command}`}))),Ie}function KL(){return Object.freeze(Me().map(e=>Object.freeze({command:e.command,canonical_flag:e.flag,accepted_spellings:Object.freeze([...new Set([e.flag,...e.aliases])].sort())})))}var uo=Object.freeze({init:30,item:20,config:36,extension:55,package:56,packages:56,install:27,upgrade:29,create:102,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:34,"history-attest":23,"history-redact":27,"history-repair":27,"history-compact":30,"history-author-acknowledge":28,merge:29,schema:43,profile:22,activity:36,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:111,test:56,"test-all":40,telemetry:21,stats:29,health:36,validate:46,assurance:30,gc:22,workspace:23,contracts:29,claim:39,release:25,"start-task":23,"pause-task":23,"close-task":24,meet:33,event:33,remind:29,"test-runs-worker":20}),mo=Object.freeze({...uo,...Object.fromEntries(Ne.flatMap(({alias:e,canonical:t})=>{let r=uo[e];return r===void 0?[]:[[t,r]]}))});function fo(){let e=new Map(Object.keys(mo).map(t=>[t,0]));for(let{command:t}of Me())e.set(t,Number(e.get(t))+1);return Object.freeze(Object.entries(mo).map(([t,r])=>Object.freeze({command:t,current:Number(e.get(t)),maximum:r})))}function hb(e,t,r){for(let o of e)for(let n of o.aliases){let s=t.get(`${o.command}:${n}`);s===void 0||s.flag===o.flag||r.push({code:"alias_collision",command:o.command,detail:`${n} aliases ${o.flag} but is canonical for ${s.flag}.`})}}function gb(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 s=e.get(n.command)??0;s===0&&r.push({code:"stale_budget",command:n.command,detail:`${n.command} has a persisted budget but no canonical flags.`}),!(s<=n.maximum)&&r.push({code:"budget_exceeded",command:n.command,detail:`${s} canonical flags exceed the ratcheted maximum ${n.maximum}.`})}}function yb(e,t,r){let o=new Map(e.map(n=>[`${n.command}:${n.flag}`,n]));for(let n of t){let s=`${n.command}:${n.canonical_flag}`,i=o.get(s);if(!i){r.push({code:"removed_canonical_spelling",command:n.command,detail:`${n.canonical_flag} disappeared from the executable spelling inventory.`});continue}let a=new Set([i.flag,...i.aliases]);for(let d of n.accepted_spellings)a.has(d)||r.push({code:"removed_compatibility_spelling",command:n.command,detail:`${d} no longer resolves to ${n.canonical_flag}.`})}}function WL(e=Me(),t=fo(),r=[]){let o=[],n=new Map,s=new Map,i=new Map,a=new Map;for(let d of e){let c=`${d.command}:${d.flag}`;n.has(c)?o.push({code:"duplicate_canonical_flag",command:d.command,detail:`${d.flag} has more than one canonical row.`}):n.set(c,d),a.set(d.command,(a.get(d.command)??0)+1);let l=s.get(d.concept);l!==void 0&&l!==d.value_kind?o.push({code:"inconsistent_concept_kind",command:d.command,detail:`${d.concept} uses both ${l} and ${d.value_kind}.`}):s.set(d.concept,d.value_kind);let p=i.get(d.concept);p!==void 0&&p!==d.flag?o.push({code:"semantic_spelling_collision",command:d.command,detail:`${d.concept} is canonicalized by both ${p} and ${d.flag}.`}):i.set(d.concept,d.flag)}return hb(e,n,o),gb(a,t,o),yb(e,r,o),o.sort((d,c)=>d.command.localeCompare(c.command)||d.code.localeCompare(c.code)||d.detail.localeCompare(c.detail)),{ok:o.length===0,entry_count:e.length,budget_count:t.length,concept_count:new Set(e.map(({concept:d})=>d)).size,baseline_entry_count:r.length,findings:o}}function YL(){let e=Me(),t=fo(),r=new Map(t.map(({command:o})=>[o,"unknown"]));for(let{command:o,family:n}of e)r.set(o,n);return["# Generated flag lexicon budgets","","This file is generated by `listPmFlagLexicon()`. Compatibility aliases do not consume canonical budget.","","| Command | Capability family | Canonical flags | Maximum |","| --- | --- | ---: | ---: |",...t.map(({command:o,current:n,maximum:s})=>{let i=r.get(o);return`| \`${o}\` | ${i} | ${n} | ${s} |`}),""].join(`
34
- `)}(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]="4c9a1aa8-05b6-53da-a8b1-f1a7289d39cf")}catch{}})();function JL(e){return e}function ZL(e){return e}function QL(e){return e}function eD(e){return e}function tD(e){return e}function rD(e){return e}function oD(e){return e}function nD(e){return e}function iD(e){return e}function sD(e){return e}function aD(e){return e}function dD(e){return e}function cD(e){return e}function lD(e){return{handled:!0,result:e}}function pD(){return{handled:!1}}function uD(e){return e}function mD(e){return e}function fD(e){return e}function _D(e){return e}function hD(e){return e}function gD(e){return e}function yD(e){return e}function bD(e){return e}function TD(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]="68ca9ab1-91e0-5020-859e-fc1f1f6dcc56")}catch{}})();function bb(e={},t={}){return new ge(t).extension(void 0,{...e,migrate:!0})}function Tb(e={},t={}){return new ge(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]="d0b86c6a-67f0-52f2-90b8-d1058e8f2284")}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]="604d7dcb-9fea-5631-8a72-b2a7ff3278f8")}catch{}})();function N(e){if(typeof e!="string"||!_e(e))throw new TypeError("Invalid reliability timestamp.");return Date.parse(e)}function Cb(e){let t=N(e.window_start),r=N(e.window_end);if(t>=r||!Number.isFinite(e.max_failure_rate)||e.max_failure_rate<0||e.max_failure_rate>=1||!Number.isSafeInteger(e.min_completed_attempts)||e.min_completed_attempts<1)throw new TypeError("Invalid reliability window policy.");if(e.families.length===0||e.families.some(o=>typeof o!="string"||o.trim().length===0)||new Set(e.families).size!==e.families.length)throw new TypeError("Expected unique, nonempty reliability families.");return{start:t,end:r}}function Sb(e,t,r,o){let n=new Map(t.map(i=>[i,[]])),s=new Set;for(let i of e){if(typeof i.id!="string"||i.id.trim().length===0||s.has(i.id))throw new TypeError("Invalid or duplicate reliability attempt identity.");s.add(i.id);let a=n.get(i.family);if(!a||!["success","failure","pending"].includes(i.outcome)||i.cause!==void 0&&(!["product","infrastructure","unknown"].includes(i.cause)||i.outcome!=="failure"))throw new TypeError("Invalid reliability attempt family, outcome or cause.");let d=N(i.started_at);if(i.repaired_at!==void 0&&(N(i.repaired_at)<d||i.outcome!=="failure"))throw new TypeError("Invalid reliability repair chronology.");d>=r&&d<o&&a.push(i)}return n}function FD(e,t){let{start:r,end:o}=Cb(t),n=[...Sb(e,t.families,r,o)].map(([s,i])=>{let a=i.filter(_=>_.outcome==="failure"),d=i.filter(_=>_.outcome!=="pending").length,c=d===0?null:a.length/d,l=a.filter(_=>_.repaired_at!==void 0&&N(_.repaired_at)<o),p={product:0,infrastructure:0,unknown:0};for(let _ of a)p[_.cause??"unknown"]+=1;let f=[];return d<t.min_completed_attempts&&f.push("insufficient_completed_attempts"),c!==null&&c>t.max_failure_rate&&f.push("failure_rate"),{family:s,attempts:i.length,completed:d,failed:a.length,pending:i.length-d,failure_rate:c,affected_days:[...new Set(a.map(_=>new Date(N(_.started_at)).toISOString().slice(0,10)))].sort(),repair_minutes:l.map(_=>(N(_.repaired_at)-N(_.started_at))/6e4).sort((_,g)=>_-g),unresolved:a.length-l.length,causes:p,violations:f,ok:f.length===0}});return{schema:"pm-reliability-window/1",window_start:new Date(r).toISOString(),window_end:new Date(o).toISOString(),ok:n.every(s=>s.ok),families: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]="773ad2b6-326e-5483-bdce-a377f935cb31")}catch{}})();function pe(e){return typeof e=="string"&&e.length>0&&e.trim()===e}function wb(e){if(!Array.isArray(e)||e.length<2)throw new TypeError("Expected at least two artifact ledgers.");let t=new Map;for(let r of e){if(r===null||typeof r!="object"||!pe(r.name)||t.has(r.name)||r.complete!==!0)throw new TypeError("Expected unique complete artifact ledgers.");if(!Array.isArray(r.identities))throw new TypeError("Invalid or duplicate artifact identity.");let o=new Set(r.identities);if(o.size!==r.identities.length||[...o].some(n=>!pe(n)))throw new TypeError("Invalid or duplicate artifact identity.");t.set(r.name,o)}if([...t.values()].every(r=>r.size===0))throw new TypeError("Empty inventories cannot establish artifact reconciliation.");return t}function Eb(e,t){if(!Array.isArray(e))throw new TypeError("Expected unique evidence-backed artifact exceptions.");let r=new Map;for(let o of e){if(o===null||typeof o!="object"||!pe(o.identity)||r.has(o.identity)||!pe(o.reason)||!pe(o.evidence))throw new TypeError("Expected unique evidence-backed artifact exceptions.");let n=o.missing_from;if(!Array.isArray(n)||n.length===0||n.length>=t.length||new Set(n).size!==n.length||[...n].some(s=>!t.includes(s)))throw new TypeError("Invalid artifact exception ledger signature.");r.set(o.identity,o)}return r}function UD(e,t=[]){let r=wb(e),o=[...r.keys()].sort(),n=Eb(t,o),s=[...new Set([...r.values()].flatMap(c=>[...c]))].sort(),i=[],a=new Set;for(let c of s){let l=o.filter(_=>!r.get(_).has(c));if(l.length===0)continue;let p=n.get(c),f=p!==void 0&&JSON.stringify([...p.missing_from].sort())===JSON.stringify(l);f&&a.add(c),i.push({identity:c,present_in:o.filter(_=>r.get(_).has(c)),missing_from:l,disposition:f?{reason:p.reason,evidence:p.evidence}:null})}let d=[...n.keys()].filter(c=>!a.has(c)).sort();return{schema:"pm-artifact-ledgers/1",ok:i.every(c=>c.disposition!==null)&&d.length===0,counts:Object.fromEntries(o.map(c=>[c,r.get(c).size])),findings:i,stale_exceptions:d}}(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]="fca4e9bb-3a30-512e-9929-565ab6c11c54")}catch{}})();import{createHash as ho,createHmac as Ab,randomBytes as vb,timingSafeEqual as Ob}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]="837ee381-0838-55d3-bcdf-7352fb76661d")}catch{}})();var w1="dev.unbrained.pm/progressive-tool-discovery",E1=Object.freeze({version:1,discoveryTool:"pm_discover",canonicalResult:"structuredContent.result",compatibilityText:"pointer"}),Pb=Object.freeze(["pm_discover","pm_next","pm_context","pm_search","pm_get"]),B=Object.freeze({lexical:.4,semantic:.2,graph:.1,permission:.15,freshness:.05,usage:.1}),Rb=Object.freeze(["profile_changed","tool_contract_changed","workspace_extension_changed","authorization_changed","ranking_signal_changed","cursor_integrity_key_rotated"]),go={core:0,standard:1,full:2,internal:3},yo=Object.freeze(["core","standard","full"]),Ib=new Set(["core","standard","full","custom"]),bo=new Set(te.map(({family:e})=>e)),Mb=vb(32);function xe(e,t){if(typeof e!="string")throw new b(`pm tool discovery ${t} must be a string of at most 4096 Unicode characters.`,64);let r=e[Symbol.iterator](),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 To(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 Co(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 So(e){if(e!==void 0&&typeof e!="boolean")throw new b("pm tool discovery includeSchema must be a boolean.",64);return e===!0}function wo(e){if(e===null||typeof e!="object"||Array.isArray(e))throw new b("pm tool discovery options must be an object.",64)}function kb(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 A1(e){if(wo(e),e.family!==void 0&&(typeof e.family!="string"||!bo.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"||!yo.includes(e.tier)))throw new b("pm tool discovery tier must be core, standard, or full.",64);return{...e.query!==void 0?{query:xe(e.query,"query")}:{},...e.family!==void 0?{family:e.family}:{},...e.tier!==void 0?{tier:e.tier}:{},...e.limit!==void 0?{limit:To(e.limit)}:{},...e.cursor!==void 0?{cursor:xe(e.cursor,"cursor")}:{},...e.includeSchema!==void 0?{includeSchema:So(e.includeSchema)}:{},...e.outputBudget!==void 0?{outputBudget:Co(e.outputBudget)}:{}}}function xb(e){return e===void 0||!Number.isFinite(e)?0:Math.min(1,Math.max(0,e))}function ue(e){return[...new Set(e.toLowerCase().match(/[a-z0-9]+/gu)??[])].sort()}function Nb(e,t){let r=ue(e);if(r.length===0)return 0;let o=new Set(ue(t)),n=r.filter(i=>o.has(i)).length,s=t.toLowerCase().includes(e.toLowerCase())?.25:0;return Math.min(1,n/r.length+s)}function Lb(e,t){let r=ue(e);if(r.length===0)return 0;let o=t.toLowerCase(),n=ue(t),s=r.filter(a=>n.some(d=>d.startsWith(a)||a.startsWith(d))).length,i=o.includes(e.toLowerCase())?.2:0;return Math.min(1,s/r.length+i)}function _o(e){return ho("sha256").update(JSON.stringify(e)).digest("hex").slice(0,24)}function Eo(e,t,r){return Ab("sha256",r).update(JSON.stringify({version:1,fingerprint:e,offset:t})).digest("base64url")}function Db(e,t,r){let o={version:1,offset:t,signature:Eo(e,t,r)};return Buffer.from(JSON.stringify(o),"utf8").toString("base64url")}function $b(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 s=Buffer.from(Eo(t,n.offset,o),"base64url"),i=Buffer.from(n.signature,"base64url");if(i.length!==s.length||!Ob(i,s))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 gt(e,t,r){return{value:xb(e),weight:t,available:r!=="unavailable",source:r}}function ke(e,t,r){return gt(e??t,r,e===void 0?"computed":"host")}function Fb(e,t,r){let o=Object.hasOwn(he,e.name)?he[e.name]:"help",n=Ve(o),s=`${e.name} ${e.description} ${o} ${n}`,i=Nb(t,s),a=new Set(ue(t)),d={lexical:gt(i,B.lexical,"computed"),semantic:ke(e.signals?.semantic,Lb(t,s),B.semantic),graph:ke(e.signals?.graph,a.has(n)||a.has(o)?1:0,B.graph),permission:gt(1,B.permission,"authorization"),freshness:ke(e.signals?.freshness,1,B.freshness),usage:ke(e.signals?.usage,Pb.includes(e.name)?1:0,B.usage)},c=Object.values(d).reduce((l,p)=>l+p.value*p.weight,0);return{name:e.name,description:e.description,command:o,tier:Ke(o),family:n,score:Number(c.toFixed(6)),signals:d,...r?{input_schema:structuredClone(e.inputSchema)}:{}}}function Gb(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"||!yo.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"||!bo.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"||!Ib.has(e.profile)))throw new b("pm tool discovery profile must be core, standard, full, or custom.",64)}function Ub(e){let t=xe(e.query===void 0?"":e.query,"query").trim().replace(/\s+/gu," ");xe(e.cursor===void 0?"":e.cursor,"cursor");let r=To(e.limit===void 0?10:e.limit),o=Co(e.outputBudget===void 0?1200:e.outputBudget);return Gb(e),{query:t,includeSchema:So(e.includeSchema),limit:r,budget:o,maximumTier:go[e.tier??"full"],profile:e.profile===void 0?"core":e.profile}}function Ao(e,t,r){let o=r??e.tools.reduce((i,a,d)=>i+(d===0?0:1)+Buffer.byteLength(JSON.stringify(a),"utf8"),0),n={...e,tools:[]},s=0;for(let i=0;i<4;i+=1){let a=Buffer.byteLength(JSON.stringify({...n,token_cost:{estimated_tokens:s,budget:t,within_budget:!0}}),"utf8"),d=Math.ceil((a+o)/4);if(d===s)break;s=d}return s}function jb(e,t,r){return e.filter(o=>o.authorized!==!1).map(o=>Fb(o,r.query,r.includeSchema)).filter(o=>o.tier!=="internal"&&go[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 Bb(e,t,r){if(t==="unbounded")return[...e];let o=[],n=0;for(let[s,i]of e.entries()){let a=n+(s===0?0:1)+Buffer.byteLength(JSON.stringify(i),"utf8");if(Ao(r(s+1),t,a)>t)break;o.push(i),n=a}return o}function v1(e,t={}){kb(e),wo(t);let r=Ub(t),o=t.cursorIntegrityKey??Mb,n=jb(e,t,r),s=_o({query:r.query,family:t.family??null,tier:t.tier??"full",includeSchema:r.includeSchema,profile:r.profile,ranked:n}),i=$b(t.cursor,s,n.length,o),a=n.slice(i,i+r.limit),d=[];r.includeSchema||d.push({name:"input_schema",reason:"compact_projection",restore_with:"Set includeSchema=true."}),i+r.limit<n.length&&d.push({name:"tools",reason:"limit",restore_with:"Continue with next_cursor or increase limit."});let c={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:B},cache:{key:_o({fingerprint:s,cursorIntegrityKey:ho("sha256").update(o).digest("hex"),limit:r.limit,offset:i,budget:r.budget}),ttl_ms:3e4,scope:"private",invalidates_on:Rb}},l=(g,T=g.length)=>{let S=i+T,q=S<n.length,P=[...d];return T<a.length&&P.push({name:"tools",reason:"token_budget",restore_with:"Continue with next_cursor or increase outputBudget."}),{...c,tools:[...g],returned:T,has_more:q,...q?{next_cursor:Db(s,S,o)}:{},omission_receipt:{has_omissions:P.length>0,omitted:P}}},p=g=>{let T=l(g),S=Ao(T,r.budget);return{...T,token_cost:{estimated_tokens:S,budget:r.budget,within_budget:r.budget==="unbounded"||S<=r.budget}}},f=Bb(a,r.budget,g=>l([],g)),_=p(f);if(a.length>0&&f.length===0){let g=p([a[0]]).token_cost.estimated_tokens;throw new b(`pm tool discovery outputBudget is too small to return a tool; increase it to at least ${g}.`,64,{required:String(g)})}if(r.budget!=="unbounded"&&_.token_cost.estimated_tokens>r.budget)throw new b(`pm tool discovery outputBudget is too small; at least ${_.token_cost.estimated_tokens} estimated tokens are required for this page.`,64,{required:String(_.token_cost.estimated_tokens)});return _}(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]="39336651-18af-56d7-b658-5e735a2adad5")}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]="96b0cbea-cad0-5363-b9d0-61d580db6935")}catch{}})();export{PO as ACTIONABILITY_ORDERING_KINDS,td as ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS,Ea as ACTIVITY_FLAG_CONTRACTS,hi as AGENT_PROVENANCE_DIMENSIONS,ds as AGGREGATE_FLAG_CONTRACTS,Ws as APPEND_FLAG_CONTRACTS,mI as ASSURANCE_ACTIONS,fI as ASSURANCE_DECLARATION_KINDS,vP as ASSURANCE_DOCUMENT_VERSION,fa as ASSURANCE_FLAG_CONTRACTS,OP as ASSURANCE_GATE_TRIGGERS,PP as ASSURANCE_MEASUREMENT_SOURCE_KINDS,bR as ASSURANCE_PRESET_IDS,SP as AssuranceEvaluationRefusalError,CP as AssuranceMutationRefusalError,wP as AssuranceSourceResolutionError,ri as BASELINE_ITEM_FORMAT_VERSION,Ay as BOUNDARY_FIXTURE_CAPTURE_SOURCES,QS as BRIEF_LIST_FIELDS,yi as BUILTIN_AGENT_PROVENANCE_ADAPTERS,Y as BUILTIN_CORPUS_SHAPES,gi as BUILTIN_HARNESS_SIGNAL_DESCRIPTORS,jo as BUILTIN_ITEM_TYPE_VALUES,zt as BUILTIN_PROFILES,qb as BUILTIN_RELATIONSHIP_KINDS,Za as CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS,wa as CALENDAR_FLAG_CONTRACTS,Ys as CLAIM_FLAG_CONTRACTS,Zd as CLOSE_ACTION_OPTION_KEYS,Vs as CLOSE_FLAG_CONTRACTS,Ks as CLOSE_MANY_FLAG_CONTRACTS,ta as CLOSE_TASK_FLAG_CONTRACTS,cs as COMMENTS_FLAG_CONTRACTS,mT as COMMON_MUTATION_COMMAND_OPTION_KEYS,Da as COMPLETION_FLAG_CONTRACTS,Ko as CONFIDENCE_TEXT_VALUES,Es as CONFIG_FLAG_CONTRACTS,Qa as CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS,JI as CONTEXT_EVALUATION_METRIC_NAMES,va as CONTEXT_FLAG_CONTRACTS,jt as CONTEXT_OUTPUT_VALUES,rM as CONTEXT_PACKING_PROFILES,qI as CONTEXT_RECENCY_EPOCH,KI as CONTEXT_RELEVANCE_SERVICE,HI as CONTEXT_RELEVANCE_SIGNAL_NAMES,iM as CONTEXT_SIGNAL_SET_VERSION,nM as CONTEXT_SIGNAL_STORE_FORMAT_VERSION,sM as CONTEXT_SIGNAL_STORE_WARNING_DETAILS,PS as CONTEXT_USAGE_LIMITS,La as CONTRACTS_FLAG_CONTRACTS,ba as COPY_FLAG_CONTRACTS,Ad as CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,Od as CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,vd as CREATE_COMMANDER_STRING_OPTION_CONTRACTS,Qb as CREATE_DIRECT_CLOSE_REASON_DEFAULT,_a as CREATE_FLAG_CONTRACTS,Iw as CURRENT_HISTORY_HASH_ALGORITHM,oE as CURRENT_HISTORY_ITEM_HASH_VERSION,iE as CURRENT_HISTORY_RECORD_HASH_VERSION,oi as CURRENT_ITEM_FORMAT_VERSION,lM as ContextSignalStore,RS as ContextUsageValidationError,DI as DEFAULT_AUTHOR_IDENTITY_VOCABULARY,OM as DEFAULT_CHILD_SAMPLE_LIMIT,ZS as DEFAULT_COMPACT_LIST_FIELDS,ZE as DEFAULT_DERIVED_INDEX_MINIMUM_ITEMS,Nm as DEFAULT_EVAL_QUERIES_RELATIVE_PATH,_R as DEFAULT_RELATIONSHIP_CONTEXT_TOKEN_BUDGET,PI as DEFAULT_TERMINAL_TRANSITION_POLICY,fM as DEFAULT_WORKSPACE_MEMORY_MINIMUM_ITEMS,bO as DEFECT_ESCAPE_CLASSES,TO as DEFECT_GATE_EVIDENCE_DISPOSITIONS,Js as DELETE_FLAG_CONTRACTS,zo as DEPENDENCY_KIND_VALUES,Ra as DEPS_FLAG_CONTRACTS,ms as DOCS_FLAG_CONTRACTS,pa as DUPLICATES_FLAG_CONTRACTS,HR as DURABLE_MERGE_RECEIPT_INTRODUCED_AT,EO as DefectRecurrencePolicyParseError,Ma as EVAL_FLAG_CONTRACTS,Om as EVAL_METRIC_NAMES,Mm as EVAL_QUERY_SET_CONTRACT,km as EVAL_QUERY_SET_EXAMPLE,Im as EVAL_QUERY_SET_SCHEMA_ID,Aa as EVENTS_FLAG_CONTRACTS,oa as EVENT_FLAG_CONTRACTS,Lo as EXECUTABLE_COMMAND_ALIASES,me as EXIT_CODE,Ls as EXTENSION_ACTIVATE_FLAG_CONTRACTS,Ns as EXTENSION_ADOPT_ALL_FLAG_CONTRACTS,Bs as EXTENSION_ADOPT_FLAG_CONTRACTS,n0 as EXTENSION_CAPABILITIES,Jb as EXTENSION_CAPABILITY_CONTRACT,Yb as EXTENSION_CAPABILITY_CONTRACT_VERSION,Xb as EXTENSION_CAPABILITY_LEGACY_ALIASES,wn as EXTENSION_CAPABILITY_REGISTRATION_SURFACES,js as EXTENSION_CATALOG_FLAG_CONTRACTS,Ds as EXTENSION_DEACTIVATE_FLAG_CONTRACTS,xs as EXTENSION_DESCRIBE_FLAG_CONTRACTS,Us as EXTENSION_DOCTOR_FLAG_CONTRACTS,ks as EXTENSION_EXPLORE_FLAG_CONTRACTS,As as EXTENSION_FLAG_CONTRACTS,Os as EXTENSION_INIT_FLAG_CONTRACTS,Is as EXTENSION_INSTALL_FLAG_CONTRACTS,Fs as EXTENSION_MANAGE_FLAG_CONTRACTS,$s as EXTENSION_MIGRATE_FLAG_CONTRACTS,i0 as EXTENSION_POLICY_MODES,s0 as EXTENSION_POLICY_SURFACES,Gs as EXTENSION_RELOAD_FLAG_CONTRACTS,d0 as EXTENSION_SANDBOX_PROFILES,vs as EXTENSION_SCOPE_FLAG_CONTRACTS,a0 as EXTENSION_TRUST_MODES,Ms as EXTENSION_UNINSTALL_FLAG_CONTRACTS,HO as EXTERNAL_DEPENDENCY_RESOLUTION_STATUSES,qO as EXTERNAL_DEPENDENCY_SOURCE_KIND,zO as EXTERNAL_DEPENDENCY_SOURCE_KIND_ALIAS,us as FILES_FLAG_CONTRACTS,Ta as FOCUS_FLAG_CONTRACTS,ca as GC_FLAG_CONTRACTS,rw as GET_DEPTH_VALUES,Oa as GET_FLAG_CONTRACTS,ss as GLOBAL_FLAG_CONTRACTS,bp as GRAPH_DURABLE_CACHE_MIN_ITEMS,yp as GRAPH_DURABLE_CACHE_VERSION,Ia as GRAPH_FLAG_CONTRACTS,SA as GRAPH_QUERY_DEFAULTS,Ge as GRAPH_SUBCOMMAND_VALUES,Pa as GUIDE_FLAG_CONTRACTS,ua as HEALTH_FLAG_CONTRACTS,ys as HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS,pR as HISTORY_AUTHOR_ATTRIBUTION_BASELINE,bI as HISTORY_COMPACT_BULK_DEFAULT_MIN_ENTRIES,bs as HISTORY_COMPACT_FLAG_CONTRACTS,ki as HISTORY_EVENT_CLASSIFICATION_VERSION,fs as HISTORY_FLAG_CONTRACTS,Pw as HISTORY_HASH_ALGORITHMS,jE as HISTORY_ITEM_HASH_VERSION_3_INTRODUCED_IN,hs as HISTORY_REDACT_FLAG_CONTRACTS,gs as HISTORY_REPAIR_FLAG_CONTRACTS,Xc as INIT_AGENT_GUIDANCE_MODE_VALUES,ws as INIT_FLAG_CONTRACTS,qs as INSTALL_FLAG_CONTRACTS,Vo as ISSUE_SEVERITY_VALUES,ga as ITEM_COMPLETE_FLAG_CONTRACTS,DR as ITEM_LATEST_TIMESTAMP_FIELDS,Zb as ITEM_METADATA_KEY_ORDER,ha as ITEM_MUTATE_FLAG_CONTRACTS,ya as ITEM_REOPEN_FLAG_CONTRACTS,RR as ITEM_SCALAR_MISSING_VALUE,Bo as ITEM_TYPE_VALUES,LR as ITEM_UNION_COLLECTION_FIELDS,cM as JsonFileContextSignalStoreAdapter,ps as LEARNINGS_FLAG_CONTRACTS,Rw as LEGACY_HISTORY_HASH_ALGORITHM,ou as LINKED_TEST_ENV_NAME_PATTERN,nu as LINKED_TEST_PM_CONTEXT_MODE_VALUES,ru as LINKED_TEST_PROTECTED_ENV_KEYS,iu as LINKED_TEST_WORKSPACE_CONTEXT_MODE_VALUES,Xa as LIST_COMMANDER_STRING_OPTION_CONTRACTS,ew as LIST_COMMAND_DEFAULT_PROJECTIONS,l0 as LIST_FILTER_EXTENSION_FLAG_DEFINITIONS,as as LIST_FILTER_FLAG_CONTRACTS,QO as LIST_SORT_FIELDS,eP as LIST_SORT_ORDER_VALUES,xi as MAINTENANCE_HISTORY_OPERATIONS,vM as MAX_CHILD_PROJECTION_ITEMS,ET as MAX_WORKFLOW_POLICIES,AT as MAX_WORKFLOW_POLICY_TERMS,ra as MEET_FLAG_CONTRACTS,KM as MERGE_DRIVER_ARTIFACT_VALUES,_s as MERGE_FLAG_CONTRACTS,Ue as MERGE_SUBCOMMAND_VALUES,XM as MUTATION_EVENT_WIRE_BUDGET,se as MemoryRelationshipGraphAdapter,ed as NEXT_COMMANDER_STRING_OPTION_CONTRACTS,xa as NEXT_FLAG_CONTRACTS,Xu as NEXT_OUTPUT_VALUES,ls as NOTES_FLAG_CONTRACTS,pA as OutputEnvelopeFitError,Ps as PACKAGE_FLAG_CONTRACTS,Rs as PACKAGE_INIT_FLAG_CONTRACTS,ea as PAUSE_TASK_FLAG_CONTRACTS,Jd as PLAN_CREATE_METADATA_PARAMETER_KEYS,Ss as PLAN_FLAG_CONTRACTS,im as PLAN_SHOW_DEPTH_VALUES,Ye as PLAN_SUBCOMMANDS,sm as PLAN_TEMPLATE_NAMES,Dy as PM_AGENT_TASK_ACCOUNTING_MODES,ut as PM_AGENT_TASK_TRANSCRIPT_VERSION,Mo as PM_BULK_LIFECYCLE_COMMAND_ALIASES,Ui as PM_CLI_EXPECTED_ERROR_NAME,PA as PM_CLI_GRAMMAR_CONTRACT,wA as PM_CLI_GRAMMAR_NOUNS,pn as PM_CLI_ONLY_TOOL_ACTION_WAIVERS,EA as PM_CLI_SHARED_VERBS,No as PM_COMMAND_ALIAS_CONTRACTS,te as PM_COMMAND_CAPABILITY_CONTRACTS,vt as PM_COMMAND_DESTINATION_CONTRACTS,hP as PM_COMMAND_EXIT_CONTRACTS,_P as PM_COMMAND_EXIT_OUTCOME_CONTRACTS,jn as PM_COMMAND_OUTPUT_BUDGET_CONTRACTS,uP as PM_COMMAND_OUTPUT_ENVELOPE_CONTRACTS,qe as PM_COMMAND_POSITIONAL_CONTRACTS,bc as PM_COMMAND_VISIBILITY_CONTRACTS,iR as PM_COMPLETE_LIST_FINDING_CODES,cw as PM_CONTEXT_INTENTS_FILE,GS as PM_CONTEXT_INTENT_CONTRACTS,Io as PM_CONTEXT_OPS_COMMAND_ALIASES,an as PM_CORE_COMMAND_NAMES,G as PM_CORPUS_SHAPE_SCHEMA,mn as PM_DEPRECATED_TOOL_ACTIONS,Dn as PM_DIAGNOSTIC_DEGRADATION_STEPS,$n as PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS,Ln as PM_DIAGNOSTIC_OUTPUT_CLASSES,fn as PM_DISCOVERABLE_TOOL_ACTIONS,Kr as PM_EPISODE_SCHEMA,lP as PM_ERROR_CODE_CATALOG,sP as PM_ERROR_CODE_EXIT_CLASS_CONTRACTS,Qr as PM_EXACT_COVERAGE_METRICS,en as PM_EXTENSION_CAPABILITY_CONTRACTS,dn as PM_EXTENSION_PACKAGE_ACTION_SUBCOMMANDS,rn as PM_EXTENSION_POLICY_MODE_CONTRACTS,sn as PM_EXTENSION_POLICY_SURFACE_CONTRACTS,nn as PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS,tn as PM_EXTENSION_SERVICE_NAME_CONTRACTS,on as PM_EXTENSION_TRUST_MODE_CONTRACTS,XP as PM_GITATTRIBUTES_END,YP as PM_GITATTRIBUTES_START,ZP as PM_GITATTRIBUTES_V2_END,JP as PM_GITATTRIBUTES_V2_START,Oc as PM_GITIGNORE_END,vc as PM_GITIGNORE_START,wI as PM_HISTORY_ATTESTATION_CONTRACT,Ro as PM_HISTORY_COMMAND_ALIASES,Sw as PM_HISTORY_OPERATION_ALIASES,Ew as PM_HISTORY_OPERATION_CONTRACT,ww as PM_HISTORY_OPERATION_PATTERNS,ln as PM_ITEM_ACTION_SUBCOMMANDS,Tw as PM_ITEM_HISTORY_OPERATIONS,it as PM_MCP_APPS_EXTENSION,Ir as PM_MCP_APPS_SERVER_CAPABILITY,Ae as PM_MCP_APPS_SPEC_VERSION,xr as PM_MCP_APP_CONTRACTS,kr as PM_MCP_APP_MIME_TYPE,Pb as PM_MCP_ENTRY_TOOL_NAMES,m as PM_MCP_ERROR_CODES,Tx as PM_MCP_HTTP_PROTOCOL_VERSION,Kh as PM_MCP_INPUT_REQUEST_METHODS,rr as PM_MCP_LEGACY_PROTOCOL_VERSIONS,tr as PM_MCP_LOG_LEVELS,E as PM_MCP_META_KEYS,w1 as PM_MCP_PROGRESSIVE_DISCOVERY_EXTENSION,E1 as PM_MCP_PROGRESSIVE_DISCOVERY_SERVER_CAPABILITY,Ec as PM_MCP_PROMPT_CONTRACTS,H as PM_MCP_PROTOCOL_VERSION,wc as PM_MCP_RESOURCE_CONTRACTS,at as PM_MCP_SKILLS_DRAFT_REVISION,Nr as PM_MCP_SKILLS_EXTENSION,Qg as PM_MCP_SKILLS_SERVER_CAPABILITY,I as PM_MCP_SKILL_LIMITS,we as PM_MCP_SUBSCRIPTION_ID_META_KEY,re as PM_MCP_SUPPORTED_PROTOCOL_VERSIONS,ux as PM_MCP_TASKS_EXTENSION,ng as PM_MCP_TASK_STATUSES,he as PM_MCP_TOOL_COMMAND_CONTRACTS,vC as PM_MODE_PAIRED_OUTPUT_PROJECTION_CONTRACTS,ud as PM_MUTATION_ACTION_CONTRACTS,Ne as PM_NAMESPACED_COMMAND_ALIASES,Hr as PM_OBSERVATION_SCHEMA,Nn as PM_OUTPUT_BUDGET_CLASSES,xn as PM_OUTPUT_DEGRADATION_STEPS,kt as PM_OUTPUT_ENVELOPE_KINDS,$t as PM_PACKAGE_CONVENTIONAL_RESOURCE_ROOTS,cn as PM_PACKAGE_ONLY_ACTION_SUBCOMMANDS,Dt as PM_PACKAGE_RESOURCE_KINDS,Be as PM_POSITIONAL_ACTION_CONTRACTS,ic as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA,oc as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION,tS as PM_READ_OUTPUT_COMPOSITION_OPTION_FLAGS,mS as PM_READ_OUTPUT_CONTINUATION_FINGERPRINT_POLICIES,QC as PM_READ_OUTPUT_DIMENSIONS,eS as PM_READ_OUTPUT_OPTION_FLAGS,WC as PM_READ_OUTPUT_SESSION_MAX_SEEN_ITEM_IDS,KC as PM_READ_OUTPUT_SESSION_MIN_TOKENS,NT as PM_READ_OUTPUT_SURFACES,rS as PM_READ_OUTPUT_SURFACE_CONTRACTS,AC as PM_READ_ROW_CONTRACTS,EC as PM_READ_ROW_JQ_SELECTOR,mL as PM_RECOVERY_REFERENCE_FIELDS,ce as PM_RECOVERY_REFERENCE_KINDS,sb as PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE,lo as PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE_V2,TL as PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE,co as PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE_V2,ko as PM_RELOCATED_COMMAND_ALIASES,sd as PM_REPRODUCIBLE_PROCESS_ENV,gP as PM_SUCCESS_EXIT_CODES,un as PM_TOOL_ACTIONS,Qd as PM_TOOL_ACTION_PARAMETER_CONTRACTS,nc as PM_TOOL_PARAMETERS_SCHEMA,rc as PM_TOOL_PARAMETERS_SCHEMA_MAJOR,tc as PM_TOOL_PARAMETERS_SCHEMA_VERSION,Yd as PM_TOOL_RESERVED_CUSTOM_FIELD_PROPERTIES,Vr as PM_VERDICT_SCHEMA,Cw as PM_WORKSPACE_HISTORY_OPERATIONS,qr as PM_WORKSPACE_RECIPE_SCHEMA,Cs as PROFILE_FLAG_CONTRACTS,Jt as PROFILE_LINT_CODES,Xt as PROFILE_LINT_DIMENSIONS,qt as PROFILE_NAMES,Xe as PROFILE_SUBCOMMANDS,b as PmCliError,ge as PmClient,sR as PmCompleteListValidationError,y as PmMcpAuthorizationError,or as PmMcpInputRequiredError,Ar as PmMcpIssuerCredentialStore,u as PmMcpProtocolError,nr as PmMcpRequestStateReplayGuard,Ur as PmMcpSkillRegistry,_r as PmMcpSubscriptionRegistry,ot as PmMcpTaskStore,AS as QUERY_CURSOR_CONTRACT,Hs as REINDEX_FLAG_CONTRACTS,Mv as REINDEX_LOCK_ID,pt as RELATIONSHIP_GRAPH_SNAPSHOT_VERSION,Zs as RELEASE_FLAG_CONTRACTS,na as REMIND_FLAG_CONTRACTS,At as RESERVED_ITEM_FIELD_NAMES,Xs as RESTORE_FLAG_CONTRACTS,Ho as RISK_VALUES,mA as RelationshipEventLog,fA as RelationshipEventStore,z as RelationshipGraph,De as RelationshipKindRegistry,Ts as SCHEMA_FLAG_CONTRACTS,Ja as SEARCH_COMMANDER_STRING_OPTION_CONTRACTS,p0 as SEARCH_EXTENSION_FLAG_DEFINITIONS,Na as SEARCH_FLAG_CONTRACTS,wu as SEMANTIC_ATTRIBUTION_LIMITS,tT as SETTINGS_DEFAULTS,Gm as SNAPSHOT_SCHEMA,VP as SOURCE_CONTEXT_ACCESS_ENV,KP as SOURCE_CONTEXT_WRITE_OVERRIDE_ENV,Qs as START_TASK_FLAG_CONTRACTS,la as STATS_FLAG_CONTRACTS,qo as STATUS_VALUES,is as SUBCOMMAND_GLOBAL_FLAG_CONTRACTS,Ni as SUBSTANTIVE_HISTORY_OPERATIONS,nE as SUPPORTED_HISTORY_ITEM_HASH_VERSIONS,sE as SUPPORTED_HISTORY_RECORD_HASH_VERSIONS,oT as SUPPRESS_HOST_OUTPUT_MARKER,aa as TELEMETRY_FLAG_CONTRACTS,ff as TELEMETRY_SUBCOMMANDS,sa as TEST_ALL_FLAG_CONTRACTS,ia as TEST_FLAG_CONTRACTS,da as TEST_RUNS_FLAG_CONTRACTS,cf as TEST_RUN_MEASUREMENT_LIMIT,Hd as TOOL_ACTIVITY_OPTION_CONTRACTS,xd as TOOL_AGGREGATE_OPTION_CONTRACTS,jd as TOOL_BULK_MUTATION_FILTER_OPTION_CONTRACT_SOURCE,zd as TOOL_CALENDAR_OPTION_CONTRACTS,qd as TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS,Vd as TOOL_CONTEXT_OPTION_CONTRACTS,Fd as TOOL_CREATE_OPTION_CONTRACTS,$d as TOOL_CREATE_OPTION_CONTRACT_SOURCE,Kd as TOOL_DEPS_OPTION_CONTRACTS,Wd as TOOL_GRAPH_OPTION_CONTRACTS,kd as TOOL_LIST_FILTER_OPTION_CONTRACTS,Nd as TOOL_SEARCH_FILTER_OPTION_CONTRACTS,Dd as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS,Ld as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACT_SOURCE,Bd as TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS,Ud as TOOL_UPDATE_OPTION_CONTRACTS,Gd as TOOL_UPDATE_OPTION_CONTRACT_SOURCE,eT as TYPE_TO_FOLDER,ov as UNKNOWN_SUBCOMMAND_COMPATIBILITY_CODES,Pd as UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,Id as UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,Rd as UPDATE_COMMANDER_STRING_OPTION_CONTRACTS,Ca as UPDATE_FLAG_CONTRACTS,Sa as UPDATE_MANY_FLAG_CONTRACTS,zs as UPGRADE_FLAG_CONTRACTS,ma as VALIDATE_FLAG_CONTRACTS,wT as WORKFLOW_POLICY_ACTIONS,tR as WORKFLOW_POLICY_DOCUMENT_SCHEMA,eR as WORKFLOW_POLICY_SCHEMA,ka as WORKSPACE_FLAG_CONTRACTS,gE as WORKSPACE_HISTORY_ID,Um as WORKSPACE_SNAPSHOT_ACTIONS,Sl as WorkspaceGraphCache,bA as WorkspaceTransactionInterruptedError,Kp as _testOnly,AM as _testOnlyAggregateCommand,Tl as _testOnlyConfigCommand,MM as _testOnlyGetCommand,xp as _testOnlyHealthCommand,el as _testOnlyInit,Jc as _testOnlyInitAgentGuidance,U0 as _testOnlyItemTransaction,e0 as _testOnlyMutationEvents,SM as _testOnlyNextCommand,VM as _testOnlySearchCommand,gR as _testOnlySimilarity,pm as _testOnlyTemplates,zp as _testOnlyValidateCommand,o0 as _testOnlyWorkspacePosition,wR as acceptAssuranceProposals,Bp as acknowledgeLinkedTests,gl as acknowledgeUnknownAuthorHistoryEvents,hl as acknowledgeUnknownAuthorHistoryEventsFromTransport,QE as acquireItemMetadataDerivedIndexLock,je as acquireLock,Yn as acquireLockLease,rk as activateExtensionForTest,QT as activateExtensions,_i as agentSessionEnvironment,__ as aggregate,Jm as analyzeAgentProvenanceDescriptorCoverage,SO as analyzeDefectChangeRisk,uI as analyzeDefectRecurrenceCoverage,Hl as analyzeDuplicateItems,hA as analyzeGraphImpact,cc as analyzeHierarchyIntegrity,gA as analyzeKnowledgeGraph,bP as analyzePmCommandExitConformance,_n as analyzePmToolActionParity,QR as analyzeReconciliationDiscard,_A as analyzeRelationshipExecution,lp as analyzeRelationshipSchedule,Gh as analyzeSdkActionCoverage,It as analyzeSdkCliParameterCompleteness,O_ as append,$i as appendHistoryEntry,CE as appendWorkspaceAuditEvent,TE as appendWorkspaceHistoryChange,FA as applyAcceptanceCriteriaMutations,CR as applyAssurancePreset,qa as applyBootstrapPagerPolicy,aI as applyClosureTimestampFix,zS as applyContextIntentProjection,Yu as applyContextTagProjection,tP as applyFilterValueEcho,kE as applyHistoryPatch,id as applyInvocationAuthorOverride,Ml as applyPathMigrations,lS as applyReadOutputDimensions,sS as applyReadOutputIncludeModes,XC as applyReadOutputSessionReferences,FE as applyRegisteredItemFieldDefaultsAndValidation,Ll as applyStandaloneNote,es as applyStoredExtensionMigrationState,UA as applyTagRemovals,kI as applyTerminalOrderingPolicy,Dl as artifactKey,uT as asRecordClone,pT as asRecordOrNull,He as assembleWorkspaceRelationshipGraph,lR as assertCompleteListResult,Dk as assertExtensionBlueprint,Lk as assertExtensionCapabilityUsage,gk as assertExtensionDeactivated,Gk as assertExtensionManifestCompatible,Fk as assertExtensionManifestMatchesBlueprint,Uk as assertExtensionPreflight,uc as assertHierarchyMutationAllowed,TI as assertHistoryCompactTarget,tI as assertHistoryRepairTarget,Qn as assertInitializedTracker,kl as assertLinkedArtifactMutationIsUnambiguous,qk as assertMcpClientCapabilities,Bk as assertMcpProtocolHeader,Ly as assertMemoryRelationshipGraphAdapterConformance,qA as assertNoUnknownCsvKeys,tu as assertNonHierarchyCardinalityMutationAllowed,yk as assertPackageManifest,hv as assertParentReferenceIsNotSelf,Xx as assertPmMcpSkillsCapability,$k as assertProjectProfile,WE as assertProjectRuntimeCompatibility,HE as assertProjectRuntimeFormatGuard,OC as assertProjectionModeChoice,Zn as assertReadableTrackerRoot,bk as assertRegisteredCommandContract,Rk as assertRegisteredCommandOverride,Ak as assertRegisteredExporter,Tk as assertRegisteredFlags,Ck as assertRegisteredHook,Ek as assertRegisteredImporter,vk as assertRegisteredItemField,Ok as assertRegisteredItemType,Nk as assertRegisteredMigration,Ik as assertRegisteredParserOverride,Mk as assertRegisteredPreflightOverride,Pk as assertRegisteredProfile,kk as assertRegisteredRendererOverride,Sk as assertRegisteredSearchProvider,xk as assertRegisteredServiceOverride,wk as assertRegisteredVectorStoreAdapter,Kb as assertRelationshipEdgeAllowed,ro as assertRelationshipGraphAdapterConformance,DA as assertSchemaPreviewSupported,gf as assertTestMeasurementRun,RP as assuranceAssertionUpdateIsLoosening,KS as attachContextIntentReceipt,IS as attachContextUsageServingReceipt,Fp as attachLinkedTestMutationProvenance,$p as attachLinkedTestProvenance,Ze as attachMcpServerInfo,xC as attachOutputOmissionReceipt,YS as attachOutputTokenAccounting,WS as attachReadOutputContracts,JC as attachReadOutputSessionReceipt,Nc as auditMergeAttributeFence,QP as auditMergeDriverConfiguration,hp as auditWorkspaceRelationshipGraph,Lx as authorizeMcpHttpRequest,mi as boundAgentEpisodeIdentity,BC as boundReadOutputRows,Hu as buildChildrenByParent,UM as buildCompactSearchFilterSummary,rP as buildContentFilterEcho,dM as buildContextSignalSnapshot,yy as buildCorpusShapeItemPlan,CO as buildDefectRecurrenceIndex,zc as buildExtensionDescribeResult,Vc as buildExtensionInstallPlan,oP as buildGovernanceMissingFilterEcho,Ev as buildInvalidTypeError,PM as buildItemChildrenRollup,F0 as buildItemCompletionMutations,VI as buildItemContextRelevanceCandidates,iA as buildItemNotFoundError,IM as buildItemSchedule,dI as buildLinkedFileRepairReport,vx as buildMcpAuthorizationDiscoveryUrls,qh as buildMcpCompleteResult,Hk as buildMcpDiscoverResult,Mx as buildMcpDynamicRegistrationMetadata,yx as buildMcpHttpRequestHeaders,Qk as buildMcpInputRequiredResult,Ax as buildMcpProtectedResourceMetadata,kc as buildMergeAttributePatterns,ec as buildPmActionToolInputSchema,wL as buildPmRefusalClosureCensus,hR as buildRelationshipContext,Lv as buildSearchCorpus,$v as buildSemanticCorpusInput,nI as buildStatusRoleWarnings,Jn as buildTrackerInitializationRecovery,Bv as buildVectorizationEmbeddingIdentity,qv as buildVectorizationEmbeddingMetadata,jM as buildVerboseSearchFilters,rR as buildWorkflowCompletenessCheck,_M as buildWorkspaceMemorySnapshot,ui as canonicalDocument,fT as canonicalizeCommandOptionKey,C0 as canonicalizeCommandSuggestions,zI as canonicalizeContextRecencyCoordinate,zb as canonicalizeRelationshipKind,fL as censusPmRecoveryReferenceProducers,cR as certifyCompleteListResult,Z0 as checkExtensionManifestCompatibility,lh as claim,ph as claimNext,uR as classifyHistoryAuthorEvent,Li as classifyHistoryEvent,JR as classifyHistoryMergeReceiptReferences,GT as classifyHostEnvironmentFault,qM as classifyImplicitSemanticFallbackReason,si as classifyItemFormatVersion,bf as classifyLinkedTestCommandSafety,Tf as classifyLinkedTestFailure,hC as clearActiveExtensionHooks,Ep as clearDurableGraphCache,Hw as clearFocusedItem,Of as clearWorkspaceContractsCache,ch as close,Xp as closeItem,bh as closeTask,Va as coalesceRepeatedListFlags,RO as collectBlockedByIds,MO as collectBlockedByIdsFromCorpus,kS as collectContextUsageDeliveredItemIds,hc as collectDanglingDependencyReferences,xO as collectDependencyBlockedIds,fc as collectDuplicateDependencyRows,_p as collectDuplicateRelationshipEdgeGroups,BM as collectErrorCauseCodes,dc as collectHierarchyRelations,Cr as collectMcpHeaderAnnotations,gc as collectMissingDependencyTargetIds,eu as collectNewOrderingCycleWarnings,up as collectOrderingCycles,_c as collectOrderingStorageContradictions,uw as collectPackageContextIntentContracts,Gt as collectPackageExtensionDirectories,DE as collectRegisteredItemFieldNames,$w as collectRuntimeCreateFieldValues,Av as collectRuntimeFilterValues,Fw as collectRuntimeUpdateFieldValues,Uu as collectSubtreeIds,En as collectUsedExtensionCapabilities,_T as commandOptionFlagLabel,y_ as comments,Jf as commitImportedItem,G0 as commitItemCompletion,$0 as commitItemMutations,CA as commitWorkspaceTransaction,ns as compactFlagAliasContracts,ju as compareCriticalItems,BE as comparePmDateVersions,yA as compareRelationshipSnapshots,vS as compareTimestampStrings,jI as compileHistoryProvenanceMatcher,BS as composeContextIntentContracts,H0 as composeExtension,J0 as composeExtensionPackage,LO as computeActionabilityReport,pv as computeHistoryDiff,dp as computeRelationshipCentrality,ap as computeRelationshipDominators,Cl as computeWorkspaceGraphFingerprint,R_ as config,_C as consumeAfterCommandAffectedItems,c_ as context,VS as contextIntentRowId,mh as copy,Cf as countFailureCategories,UC as countReadOutputRows,sh as create,TR as createAssurancePreset,lI as createAssuranceWorkspaceContext,QA as createCheckpointId,aR as createCompleteListOptions,eC as createCoreCommandHookContext,Zr as createCorpusShapeMeasurement,NP as createEmptyAssuranceDocument,DT as createEmptyExtensionRegistrationRegistry,Ji as createExtensionCommandSdk,Sn as createExtensionContributionInventory,jk as createExtensionTestHarness,Di as createHistoryEntry,aO as createLazyModule,oR as createLifecycleCompletenessPolicies,Dx as createMcpStaticBearerVerifier,mx as createMcpTaskStore,nA as createMutationGuardSdk,PC as createOutputOmissionReceipt,Bi as createPmCliExpectedError,Xn as createPmCliProgram,Gn as createPmCommandOutputBudget,yS as createQueryFingerprint,Ny as createRelationshipGraphScaleFixture,Z as createRelationshipGraphSnapshot,yt as createRelationshipKindRegistry,dd as createReproducibleProcessRunner,FM as createSearchCursorFingerprint,tC as createSerialQueue,YA as createStdinTokenResolver,nv as createUnknownSubcommandError,xT as createWorkflowPolicyEvaluator,jm as createWorkspaceSnapshot,ok as deactivateExtensionForTest,pD as declineServiceOverride,HS as decodeContextIntentCursor,sO as decodeHtmlEntitiesInOptions,Tr as decodeMcpHttpHeaderValue,JS as decodePmTableRows,SS as decodeQueryCursor,TS as decodeQueryCursorEnvelope,CS as decodeQueryCursorState,hS as decodeReadOutputContinuationCursor,ek as decodeToon,jx as decoratePmMcpToolsWithApps,Fl as dedupeLinkedArtifacts,WI as defaultScoreContextCandidates,gD as defineAfterCommandHook,_D as defineBeforeCommandHook,hD as defineBeforeMutationHook,QL as defineCommand,sD as defineCommandOverride,W as defineCorpusShape,sN as defineEpisodeSpecification,fD as defineExporter,q0 as defineExtension,z0 as defineExtensionBlueprint,JL as defineExtensionManifest,eD as defineFlag,mD as defineImporter,rD as defineItemField,tD as defineItemType,oD as defineMigration,dy as defineObservationContract,TD as defineOnIndexHook,bD as defineOnReadHook,yD as defineOnWriteHook,aD as defineParserOverride,Un as definePmCommandOutputBudget,pP as definePmCommandOutputEnvelope,aP as definePmErrorCodeCatalog,dD as definePreflightOverride,ZL as defineProjectProfile,uD as defineRendererOverride,nD as defineSearchProvider,cD as defineServiceOverride,iD as defineVectorStoreAdapter,uy as defineVerdictContract,ve as defineWorkspaceRecipe,fh as deleteItem,Km as deleteWorkspaceSnapshot,Wb as dependencyToRelationship,A_ as deps,SR as deriveAssuranceProposals,iI as deriveClosureTimestamp,K0 as deriveExtensionCapabilities,v0 as deriveMutationTransactionId,TP as derivePmBulkMutationEffect,_L as derivePmRecoveryReferenceObligations,pp as deriveRelationshipDeadlines,Fc as deriveSchemaEvolutionMigrationId,Zv as deriveTelemetryCommandResolution,Rv as describeAllowedTransitions,HP as describeExtensionActivation,W0 as describeExtensionBlueprint,KT as describeFlagScalarValueFailure,Pu as describeItemOwnershipConflict,iN as describeObservationCost,Wt as describeProfileComposition,Yt as describeProjectProfile,_w as describeUnknownError,Ai as detectAgentIdentity,Ri as detectHarnessIdentity,ip as detectRelationshipCommunities,vi as diagnoseAgentIdentity,gp as diffRelationshipAuditSnapshots,uf as diffTestRunMeasurements,rx as digestMcpRequestParameters,JT as discoverExtensions,Xo as discoverNearbyPmRoot,v1 as discoverPmTools,zE as discoverProjectRuntimeVersionPins,E_ as docs,g_ as duplicates,Tp as durableGraphCachePath,Ap as durableGraphCacheStatus,ni as effectiveItemFormatVersion,hO as emitTelemetryErrorEvent,Xf as emptyImportedDocument,MR as encodeItemScalarDecisionValue,br as encodeMcpHttpHeaderValue,XS as encodePmTableRows,bS as encodeQueryCursor,_S as encodeReadOutputContinuationCursor,tk as encodeToon,GE as enforceHistoryStreamPolicyForItem,UE as enforceHistoryStreamPolicyForItems,nP as enrichCliFlagInvocationContract,Mt as enrichCliFlagInvocationContracts,NE as ensureMaterializedHistoryTarget,Rc as ensurePmGitignore,vl as ensureScope,Jv as ensureSentryCommandTracing,Xv as ensureSentryInit,Yf as ensureTrackerInitialized,op as enumerateRelationshipPaths,qn as estimatePmOutputTokens,DP as evaluateAssuranceAssertion,$P as evaluateAssuranceGate,EN as evaluateBoundaryFixtures,ZI as evaluateContextRanking,wO as evaluateDefectGateEvidence,LP as evaluateMeasurement,Rm as evaluateMetricFloors,fd as evaluateMutationGuard,of as evaluateProvenanceCoverage,FD as evaluateReliabilityWindow,ef as evaluateSemanticAttributionCoverage,Kl as evaluateSimilarityGovernance,Pv as evaluateTransition,my as evaluateVerdictContract,kT as evaluateWorkflowPolicies,pd as executeEmbeddingBatchesWithRetry,Uv as executeVectorDelete,jv as executeVectorReset,Gv as executeVectorUpsert,ny as executeWorkspaceRecipe,Nl as expandAddGlobEntries,Yl as explainSourceTraceability,AI as exportAttestation,Th as extension,Sh as extensionActivate,wh as extensionDeactivate,Ch as extensionList,bb as extensionMigrate,XR as extractHistoryMergeReceiptDispositions,YR as extractHistoryMergeReceiptReferences,kx as extractMcpTraceContext,IE as extractPatchFailureContext,Np as extractReferencedPmItemIdsFromCommand,xy as federateRelationshipGraphSnapshots,C_ as files,S_ as filesDiscover,w_ as filesLookup,xS as finalizeContextUsageDelivery,Ey as findCoverageDeficits,Vl as findDuplicateClusters,Mc as findGitWorkspaceRoot,Yw as findHistoryIdentityDiscontinuities,Bc as findInstalledNpmPackageCandidate,Ux as findPmMcpAppByUri,xo as findPmNamespacedCommand,sp as findRedundantRelationshipEdges,cp as findRelationshipCutStructure,zl as findSimilarItems,_O as finishTelemetryCommand,uA as fitOutputEnvelope,VT as flattenFlagListValue,Cy as flushTelemetryQueue,hh as focus,np as forEachMatchedRelationshipEdge,fp as formatDuplicateEdgeGroup,lc as formatHierarchyRelation,mp as formatOrderingStorageContradiction,OA as formatPmPositionalActionFlagTip,wm as formatProfileApplyHuman,Sm as formatProfileLintHuman,Tm as formatProfileListHuman,Cm as formatProfileShowHuman,jc as formatSchemaEvolutionMigrationHuman,HM as formatVectorIndexRecoveryWarnings,r0 as formatWorkspacePositionHuman,eh as gc,Vi as generateItemId,m_ as get,uC as getActiveCommandResult,US as getActiveContextIntentContracts,vn as getActiveExtensionRegistrations,Nx as getActiveMcpTraceContext,GP as getAssuranceDeclaration,Dh as getContracts,qw as getFocusedItem,Qo as getHistoryPath,lA as getItemAt,Zo as getItemPath,gd as getMutationActionContract,Pc as getPmGitignoreBlock,Jo as getSettingsPath,Pf as getWorkspaceContracts,yE as getWorkspaceHistoryPath,v_ as graph,Cp as graphAuditBaselinePath,tf as groupHistoryByEpisode,lD as handleServiceOverride,zk as hasMcpClientExtension,Gx as hasPmMcpAppsCapability,ze as hasSubcommandFlagContractsForCommand,zv as hasVectorizationEmbeddingIdentityChanged,Hv as hasVectorizationVectorDimensionChanged,fE as hashDocument,_E as hashDocumentForVersion,hE as hashEmptyDocument,dE as hashHistoryPatch,aE as hashHistoryRecord,cE as hashHistoryStream,kR as hashItemScalarDecisionValue,Q_ as health,Ql as hierarchyAncestors,ep as hierarchyDescendants,nh as historyCompact,ih as historyCompactBulk,kw as historyDigest,UI as historyEntryMatchesProvenance,qE as historyItemHashVersionForRuntime,th as historyRedact,rh as historyRepair,oh as historyRepairAll,IO as indexBlockedByIds,pc as indexHierarchyRelations,Vv as inferConsistentVectorDimension,Fn as inferPmOutputBudgetClass,P_ as init,dR as inspectCompleteListResult,$T as inspectExtensionManifestSchema,pl as inspectHistoryAuthorStream,UR as inspectMergeReceiptEvidence,KE as inspectProjectRuntimeCompatibility,wd as inspectStaleInProgressItems,Uh as inspectStaticExtensionInventory,oI as inspectStatusRoleAssignments,bE as inspectWorkspaceHistoryState,Bm as inspectWorkspaceSnapshot,$c as installMergeFence,Vk as interpretMcpResultType,Zu as isAlreadyClaimedError,yw as isCommanderError,f0 as isCompatibleRecoveryFlag,sl as isErrnoError,gO as isExternalDependencyReference,yO as isExternalDependencySourceKind,fe as isFileMissingError,iT as isHostOutputSuppressed,ji as isItemAlreadyExistsError,IR as isItemScalarMissingValue,VR as isLegacyMergeReceiptSummary,h as isMcpRecord,_d as isMutationAction,Vb as isOrderingRelationshipKind,fv as isPlaceholderReferenceToken,qi as isPmCliExpectedError,gn as isPmExtensionCapabilityContract,bn as isPmExtensionPolicyModeContract,Tn as isPmExtensionPolicySurfaceContract,yn as isPmExtensionServiceNameContract,yP as isPmKnownExitCode,mP as isPmMutationReceipt,We as isPmSuccessfulExitCode,Gi as isPmTokenBudgetRecovery,hn as isPmToolAction,KR as isPreDurableCloneLocalReceiptSummary,WR as isPreDurableDispositionEligibleReference,VE as isProjectMutatingInvocation,dO as isPureSnakeCaseAlias,pS as isReadOutputBudgetExceeded,VC as isReadOutputSessionReference,m0 as isReadProjectionRecoveryFlag,IC as isReadRowContract,sc as isRuntimeRecord,pO as isTerminalPlanMode,Uw as isTerminalStatus,Wn as isTimestampLiteral,M0 as itemDocumentToMutationOptions,RM as itemHasSchedule,Rn as jaccardSimilarity,T_ as learnings,LT as levenshteinDistanceWithinLimit,ol as limitAnnotationEntries,Gp as linkedTestTrustFingerprint,Y0 as lintExtensionBlueprint,FT as lintExtensionManifestSchema,Zt as lintProjectProfile,l_ as list,Ti as listAgentProvenanceAdapters,Ha as listAliasPluralKeys,p_ as listAllComplete,rA as listAllDocumentCandidatesCached,Xi as listAllItemMetadata,oA as listAllItemMetadataLight,FP as listAssuranceDeclarations,zP as listAssuranceVerdicts,hy as listBuiltinCorpusShapes,S0 as listCoreClosedDomainContracts,ow as listGetProjectionFields,OR as listInvalidProvenanceHistoryStreamIds,tw as listListProjectionFields,jR as listMergeReceipts,hd as listMutationActions,JM as listMutationEvents,fo as listPmCommandFlagBudgets,Cc as listPmCommandsForFamily,Tc as listPmCommandsForTier,Me as listPmFlagLexicon,KL as listPmFlagSpellingInventory,Sc as listPmMcpToolsForProfile,DL as listPmRequiredArgumentRefusalContracts,$L as listPmSubcommandRefusalContracts,Kt as listProfiles,UL as listTrackerPreflightRecoveryContracts,N0 as listUpsertKeyCandidates,qm as listWorkspaceSnapshots,mw as loadContextIntentRuntimeLayers,um as loadCreateTemplateOptions,ZT as loadExtensions,Op as loadGraphAuditBaseline,L0 as loadGuardedRuntimeSchema,tv as loadMutationCheckpoint,x as loadRelationshipGraphAdapter,Wi as locateItem,BA as looksLikeGenericKeyValueEntry,jC as mapReadOutputRows,BR as markMergeReceiptReconciled,vv as matchesRuntimeFilters,mO as maybeRunFirstUseTelemetryPrompt,by as measureCorpusShapePlan,Ki as measureItemMetadataReadWork,GA as mergeAdditiveTags,V0 as mergeExtensionBlueprints,xR as mergeHistoryStreams,$R as mergeItemDocuments,FR as mergeJsonDocuments,Ka as mergeLinkedTestTwoTokenEntries,NR as mergeRelationshipEventStreams,Ku as mergeSortedWarnings,lO as migrateItemFilesToFormat,aA as mutateItem,sA as mutateItemWithHistoryContext,SE as mutateWorkspaceJsonWithHistory,f_ as next,Si as normalizeAgentProvenanceAdapterValue,rl as normalizeAnnotationTransportOptions,AP as normalizeAssuranceEvaluation,EP as normalizeAssuranceMutation,Wa as normalizeBootstrapInvocation,dv as normalizeBulkIdsValue,mc as normalizeDependencyGraphTarget,YO as normalizeDependencySeedId,WO as normalizeDependencySourceKind,Cn as normalizeExtensionContributionInventory,Ow as normalizeHistoryOperationForWrite,vR as normalizeInvalidHistoryProvenance,LA as normalizeItemAddressInvocation,ii as normalizeItemFormatVersion,Hi as normalizeItemId,ci as normalizeItemMetadata,XO as normalizeItemReference,za as normalizeLegacyExtensionActionSyntax,xl as normalizeLinkedPath,mv as normalizeParentReferenceValue,Ht as normalizeProfileName,zi as normalizeRawItemId,aS as normalizeReadOutputIncludeModeOptions,Qw as normalizeReplayPatchOps,yd as normalizeSimilarityText,Gw as normalizeStatusForRegistry,di as normalizeStatusInput,Nw as normalizeStatusInputWithRegistry,gw as normalizeThrownExitCode,b_ as notes,Kn as nowIso,Sp as openDurableGraphCache,tx as openMcpRequestState,aN as openPmEpisode,tp as orderingPredecessors,rp as orderingSuccessors,oM as packContextCandidates,Bu as packRankedContextItems,xh as packageActivate,kh as packageCatalog,Nh as packageDeactivate,Ih as packageDescribe,Ph as packageDoctor,vh as packageInstall,Eh as packageLifecycle,Ah as packageList,Rh as packageManage,Tb as packageMigrate,Mh as packageReload,Oh as packageUninstall,ES as paginateQueryRows,Ol as parseAddEntries,Pl as parseAddGlobEntries,il as parseAnnotationTextInput,O0 as parseAtomicMutationControls,Ba as parseBootstrapCommandName,Ga as parseBootstrapGlobalOptions,ja as parseBootstrapHelpRequest,Ya as parseBootstrapTypeValue,av as parseBulkIdsText,Fu as parseContextDepth,Nu as parseContextFocusFields,lw as parseContextIntentDeclarations,Gu as parseContextSections,aM as parseContextSignalSnapshot,jA as parseCsvKv,vO as parseDefectChangeRiskRequest,pI as parseDefectRecurrenceCoverageRequest,AO as parseDefectRecurrencePolicy,Pm as parseEvalMetricFloors,xm as parseEvalQuerySet,BT as parseExtensionLongFlagToken,Ip as parseGraphSubcommand,EI as parseHistoryAttestation,FI as parseHistoryProvenanceFilters,DO as parseIntegerLimit,jw as parseItemDocument,P0 as parseItemMutationBatch,wv as parseLimit,fu as parseLinkedTestAssertionEqualsMap,_u as parseLinkedTestAssertionGteMap,du as parseLinkedTestBoolean,cu as parseLinkedTestContextMode,au as parseLinkedTestEnvClear,su as parseLinkedTestEnvSet,hu as parseLinkedTestJsonEntries,mu as parseLinkedTestMinLines,uu as parseLinkedTestRegexList,pu as parseLinkedTestStringList,lu as parseLinkedTestWorkspaceContextMode,Xh as parseMcpCachePolicy,jh as parseMcpImplementation,tt as parseMcpInputRequests,dr as parseMcpInputResponses,Tg as parseMcpSubscriptionFilter,Il as parseMigrateEntries,GO as parseMultiValueFilter,fP as parseMutationReceipt,JA as parseOptionalNonNegativeInteger,XA as parseOptionalNumber,aL as parsePmAgentTaskTranscriptCorpus,A1 as parsePmToolDiscoveryOptions,$O as parsePriority,BO as parsePriorityFilterSet,YC as parseReadOutputSession,$E as parseRegisteredItemFieldAssignments,ae as parseRelationshipGraphSnapshot,Rl as parseRemoveEntries,Wl as parseSourceLineRange,bv as parseStatusFilterCsv,UO as parseStringFilterSet,ld as parseTags,lf as parseTestRunMeasurements,FO as parseType,jO as parseTypeFilterSet,_l as parseUnknownAuthorHistoryEventCoordinates,vT as parseWorkflowPolicy,OT as parseWorkflowPolicyDocument,wM as partitionDecisionEntries,lv as patchPathToChangedField,Fo as pathExists,yh as pauseTask,wp as persistDurableGraphResult,OE as persistSelectedItemFormat,fR as planAgentIdentityVocabularyMutation,mM as planCompletedAtBackfill,Kc as planExtensionDirectoryCopy,B0 as planItemMutationDocument,Qt as planProfileApplication,pL as planRelationshipEventBackfill,Rp as planRelationshipRemediation,Gc as planSchemaEvolutionMigration,ml as planUnknownAuthorHistoryAcknowledgment,zm as planWorkspaceSnapshotRestore,IA as positionalShapeKey,MA as positionalSignatureKey,Q0 as preflightExtension,Td as prepareSimilarityText,HA as preserveMutationStdinTokenFields,zA as preserveMutationStdinTokenLiterals,j0 as previewItemMutationDocument,D0 as previewItemMutations,dw as printError,aw as printResult,K_ as profile,X_ as profileApply,J_ as profileLint,W_ as profileList,Y_ as profileShow,fC as projectAfterCommandItemSnapshot,Lu as projectContextFocusRows,df as projectFleetAttributionAnalytics,GI as projectHistoryProvenance,nw as projectPmBriefListEnvelope,Hn as projectPmDiagnosticOutput,Vn as projectPmDiagnosticText,sf as projectProvenanceCoverageAnalytics,qp as projectValidateCounts,ER as promoteAssuranceAssertion,MS as propagateContextUsageServingReceipt,IN as pruneCompileCacheGenerations,UP as putAssuranceDeclaration,jP as putAssuranceDeclarationBundle,YE as queryItemMetadataIndex,XE as queryLinkedFileMetadataIndex,JE as querySimilarItemMetadataIndex,pf as queryTestRunMeasurementsBelow,Mn as quoteCommandArg,In as quoteWindowsCommandArg,T0 as rankCommandPaths,nl as readAnnotationEntries,Oi as readAuthorEnvironment,If as readBooleanOption,FS as readContextUsageAffinity,Mf as readCsvListOption,Qi as readExtensionMigrationState,Go as readFileIfExists,rd as readFirstStringFromCommanderOptions,od as readFirstValueFromCommanderOptions,rf as readHistoryAnalyticsWindow,Ww as readHistoryEntries,Mi as readHistorySnapshot,Ym as readImprovementLedger,eA as readItemMetadataDerivedIndexState,Yi as readLocatedItem,GC as readOutputBudgetCollections,fS as readOutputCollectionFingerprint,FC as readOutputContinuationRowCollections,DC as readOutputContinuationRowPaths,iS as readOutputIncludeModeOptions,$C as readOutputRowCollections,LC as readOutputRowPaths,ZC as readOutputSessionRemainingTokens,Ft as readPmPackageManifest,vf as readRequiredString,Dw as readRuntimeFieldOptionValue,Fi as readSettings,PE as readSettingsWithMetadata,nd as readStringArrayFromCommanderOptions,Rf as readStringOption,hw as readThrownExitCode,Kv as readVectorizationStatusLedger,LE as readWorkflowPolicies,PT as readWorkflowPolicyField,pw as readWorkspaceContextIntentContracts,pM as readWorkspaceContextSignals,hM as readWorkspaceMemory,t0 as readWorkspacePosition,rE as reanchorHistoryEntries,UD as reconcileArtifactLedgers,An as reconcileExtensionCapabilityUsage,EE as reconcileWorkspaceJsonHistory,mC as recordAfterCommandAffectedItem,qP as recordAssuranceVerdict,Tu as recordClaimSemanticAttribution,LS as recordContextUsageDelivery,NS as recordContextUsageServing,DS as recordContextUsageTouch,$S as recordContextUsageTouches,Su as recordFocusSemanticAttribution,Wm as recordImprovementObservation,Cu as recordReleaseSemanticAttribution,tA as refreshItemMetadataDerivedIndex,Lc as refreshMergeAttributeFenceIfInstalled,zC as refreshReadOutputDeliveredCounts,Yv as refreshSearchArtifactsForMutation,Ci as registerAgentProvenanceAdapters,VO as registerExternalDependencyResolver,bi as registerHarnessSignalDescriptors,wC as registerOutputMaterialFieldGroups,uh as release,qC as rememberReadOutputFocusRows,BP as removeAssuranceDeclaration,Uo as removeFileIfExists,jl as renameArtifactsResultKey,Iu as renderCalendarMarkdown,Mu as renderCalendarToon,Wu as renderContextMarkdown,Hc as renderExtensionDescribeMarkdown,qc as renderExtensionSurfaceMarkdown,e_ as renderGuideMarkdown,g0 as renderMissingOptionRetry,EM as renderNextMarkdown,w0 as renderPmClosedDomainHelp,kn as renderPmCommand,$o as renderPmCommandAliasMigrationHint,Ac as renderPmCommandVisibilityMarkdown,YL as renderPmFlagLexiconMarkdown,Bx as renderPmMcpAppHtml,EL as renderPmRefusalClosureCensusMarkdown,Cv as renderRowsAsCsv,Sv as renderRowsAsTable,dh as reopen,xE as replayHistoryToTarget,Jw as replayToCanonicalItemDocument,Xw as replayToItemDocument,vw as requireHistoryOperation,II as requireTerminalReason,MI as requireTerminalReasonWithRecovery,uE as resealHistoryRewrite,cC as resetActiveExtensionRuntimeState,El as resetWorkspaceGraphCache,fi as resolveAgentSessionContextFromSignals,ll as resolveAnnotationIndex,al as resolveAnnotationInput,Kw as resolveAuthor,Ii as resolveAuthorIdentity,uv as resolveBodyFileContent,gy as resolveBuiltinCorpusShape,Ru as resolveCalendarOutputFormat,dP as resolveCanonicalPmErrorCodeContract,Hb as resolveCanonicalRelationshipKind,Vw as resolveClaimPrincipal,cv as resolveCliBulkIdsInput,yT as resolveCommandOptionPolicyState,RN as resolveCompileCacheGeneration,uM as resolveCompletionTimestamp,dT as resolveConfiguredPmPackageRoot,ZO as resolveContentFieldFilters,qS as resolveContextIntentContract,Du as resolveContextOutputFormat,$u as resolveContextTokenBudget,xI as resolveCreateExplicitEmptyFlag,NM as resolveEffectiveSearchMode,xv as resolveEmbeddingProviders,HT as resolveExtensionFlagValueContract,Wc as resolveExtensionInstallSourceIdentity,qT as resolveExtensionLongFlagName,Zi as resolveExtensionMigrationStatePath,XT as resolveExtensionRoots,KO as resolveExternalDependencyReference,zT as resolveFlagValueKind,CT as resolveGlobalPmRoot,Zf as resolveGuideOutputFormat,Xm as resolveHistoryEpisodeGroupIdentity,Mw as resolveHistoryHashAlgorithm,Aw as resolveHistoryOperation,$I as resolveHistoryProvenanceDimensions,dA as resolveHistorySubject,ME as resolveHistoryTarget,DM as resolveHybridSemanticWeight,Yo as resolveImplicitPmRoot,OS as resolveIsoOrRelative,kO as resolveItemBlockers,OO as resolveItemExecutionRole,I0 as resolveItemMutationDocument,Wo as resolveItemTypeRegistry,xw as resolveItemTypesFilePath,ZA as resolveLinkedResourcePositionalRecovery,Sf as resolveLinkedTestFailureExitCode,Lp as resolveLinkedTestSourceRef,Dp as resolveLinkedTestSourceWorkspaceRoot,Up as resolveLinkedTestTrust,jp as resolveLinkedTestTrustBatch,Cg as resolveMcpAcknowledgedSubscriptionFilter,Je as resolveMcpRequestContext,Ic as resolveMergeInstallContext,y0 as resolveMisnestedCommandPath,JO as resolveMissingMetadataFilters,h0 as resolveMissingOptionPlaceholder,RC as resolveModePairedOutputOmissionReceipt,CM as resolveNextOutputFormat,kC as resolveOutputOmissionReceipt,aT as resolvePmCliVersion,Do as resolvePmCommandAlias,Ve as resolvePmCommandCapabilityFamily,Nt as resolvePmCommandExitContract,L as resolvePmCommandOperation,Bn as resolvePmCommandOutputBudget,xt as resolvePmCommandOutputEnvelope,AA as resolvePmCommandPositionalContract,Ke as resolvePmCommandVisibilityTier,zn as resolvePmDiagnosticOutputBudget,cP as resolvePmErrorCodeContract,_b as resolvePmFlagSemanticConcept,Le as resolvePmHistoryOperation,Yk as resolvePmMcpExecutableInvocation,sT as resolvePmPackageRootFromModule,vA as resolvePmPositionalActionContract,$a as resolvePmPositionalActionFlagContracts,Fe as resolvePmRoot,Xd as resolvePmToolCustomFieldCollision,gv as resolvePriority,Vt as resolveProfile,xc as resolveProjectMergeTypeFolders,wS as resolveQueryCursorStart,u0 as resolveReadOptionRetryArgs,dS as resolveReadOutputDimensions,uS as resolveReadOutputEncoding,HC as resolveReadOutputRecoveryBudget,oS as resolveReadOutputSurface,MC as resolveReadRowContract,_0 as resolveRecoveryCommandName,iv as resolveRegisteredSearchProvider,sv as resolveRegisteredVectorStoreAdapter,ad as resolveReproducibleProcessEnvironment,ti as resolveRuntimeFieldRegistry,ei as resolveRuntimeStatusRegistry,Nv as resolveSearchCorpusFields,xM as resolveSearchMaxResults,GM as resolveSearchPage,LM as resolveSearchScoreThreshold,$M as resolveSearchTuning,Dv as resolveSemanticCorpusCharacterLimit,bu as resolveSemanticLineageIds,Iv as resolveSettingsWithSemanticRuntimeDefaults,WP as resolveSourceContextWritePolicy,vu as resolveStartTaskInProgressStatus,ee as resolveSubcommandFlagContractsForCommand,rT as resolveTelemetryErrorCategory,RI as resolveTerminalReason,x0 as resolveTransactionSchema,gT as resolveTypeDefinition,hT as resolveTypeName,Tv as resolveTypeSynonym,Ov as resolveTypeWorkflows,fl as resolveUnknownAuthorAcknowledgmentSelector,zM as resolveVectorIndexRecovery,Fv as resolveVectorStores,ac as resolveWorkspaceRelationshipKindRegistry,TT as resolveWorkspaceRoot,_h as restore,rv as restoreCheckpointItems,AE as restoreWorkspaceJsonFromHistory,Vm as restoreWorkspaceSnapshot,Hm as restoreWorkspaceSnapshotWithRecovery,Fh as runAction,gC as runActiveBeforeMutationHooks,bC as runActiveCommandHandler,yC as runActiveOnIndexHooks,Pn as runActiveOnReadHooks,On as runActiveOnWriteHooks,TC as runActiveParserOverride,CC as runActivePreflightOverride,SC as runActiveServiceOverride,xu as runActivity,YT as runAfterCommandHooks,Em as runAggregate,cl as runAnnotationCommand,Yp as runAppend,_I as runAssuranceAction,hI as runAssuranceDispatch,WT as runBeforeCommandHooks,ku as runCalendar,Qu as runClaim,em as runClaimNext,Jp as runClose,Zp as runCloseMany,nm as runCloseTask,yl as runComments,t_ as runCompletion,bl as runConfig,Bt as runContext,tM as runContextEvaluationCorpus,QI as runContextEvaluationScenario,Qp as runCopy,gu as runCreate,yu as runDelete,Al as runDeps,Bl as runDocs,yR as runDuplicates,Lm as runEval,$m as runEvent,Yc as runExtension,rs as runExtensionMigrateAction,ts as runExtensionMigrations,Xl as runFiles,Zl as runFilesDiscover,Jl as runFilesLookup,af as runFleetAttributionAnalytics,Au as runFocus,Vp as runGc,Am as runGet,Mp as runGraph,Qf as runGuide,kp as runHealth,kM as runHistory,OI as runHistoryAttest,yI as runHistoryCompact,CI as runHistoryCompactBulk,ZR as runHistoryMaintenance,SI as runHistoryRedact,eI as runHistoryRepair,rI as runHistoryRepairAll,tl as runInit,Zc as runInitAgentGuidance,Wp as runLearnings,Ul as runLinkedArtifacts,wf as runLinkedTests,yc as runList,Dm as runMeet,WM as runMergeDriver,Dc as runMergeInstall,zR as runMergeReceiptEvidenceReport,qR as runMergeReceiptReport,YM as runMergeReconcile,Ju as runNext,lm as runNotes,om as runPauseTask,am as runPlan,bm as runProfileApply,ym as runProfileLint,hm as runProfileList,gm as runProfileShow,nf as runProvenanceCoverageAnalytics,nk as runRegisteredCommandForTest,ck as runRegisteredCommandOverrideForTest,hk as runRegisteredExporterForTest,sk as runRegisteredHookForTest,_k as runRegisteredImporterForTest,fk as runRegisteredMigrationForTest,ik as runRegisteredMutationGuardForTest,ak as runRegisteredParserOverrideForTest,dk as runRegisteredPreflightOverrideForTest,lk as runRegisteredRendererOverrideForTest,uk as runRegisteredSearchProviderForTest,pk as runRegisteredServiceOverrideForTest,mk as runRegisteredVectorStoreAdapterForTest,er as runReindex,tm as runRelease,Fm as runRemind,LI as runReopen,dm as runRestore,Uc as runSchemaEvolutionMigration,vm as runSearch,Ty as runSearchRefreshWorkerEntrypoint,r_ as runStartBackgroundRun,rm as runStartTask,mf as runStats,_f as runTelemetry,fm as runTemplatesList,mm as runTemplatesSave,_m as runTemplatesShow,Ef as runTest,Af as runTestAll,o_ as runTestRunsList,i_ as runTestRunsLogs,a_ as runTestRunsResume,n_ as runTestRunsStatus,s_ as runTestRunsStop,d_ as runTestRunsWorker,Ou as runUpdate,cm as runUpdateMany,Ut as runUpgrade,Hp as runValidate,$h as runWithActiveExtensions,D as runWithAgentSessionContext,vE as runWithConfigurationOnlySettings,jS as runWithContextIntentContracts,fw as runWithDiscoveredContextIntentContracts,wi as runWithHarnessDetectionSignals,xx as runWithMcpTraceContext,cd as runWithReproducibleProcessEnvironment,Ei as runWithWorkspaceHarnessSignalDescriptors,zr as runWithWorkspaceRecipe,nR as runWorkflowPolicyAction,gI as runWorkspaceTransactionGc,Pp as saveGraphAuditBaseline,sI as scanClosureTimestamps,AR as scanExtensionHostVersions,ul as scanHistoryAuthorAttribution,ai as scanItemFormatVersions,md as scanMutationSecrets,PR as scanProvenanceResolverHealth,Ed as scanStaleInProgressItems,cI as scanStorageIntegrity,I_ as schema,$_ as schemaAddField,L_ as schemaAddStatus,x_ as schemaAddType,j_ as schemaApplyPreset,B_ as schemaInferTypes,M_ as schemaList,G_ as schemaListFields,H_ as schemaRemapStatus,F_ as schemaRemoveField,D_ as schemaRemoveStatus,N_ as schemaRemoveType,z_ as schemaRenameField,q_ as schemaRenameType,k_ as schemaShow,U_ as schemaShowField,V_ as schemaShowStatus,b0 as scoreCommandPathMatch,YI as scoreContextCandidates,XI as scoreContextCandidatesWithActiveExtensions,Cd as scoreItemSimilarity,FL as scorePmGrammarRefusalClosure,OL as scorePmRefusalClosure,Sd as scorePreparedItemSimilarity,jL as scoreTrackerPreflightRecoveryClosure,lE as sealHistoryRecord,ex as sealMcpRequestState,u_ as search,bM as searchWorkspaceMemory,TM as searchWorkspaceMemoryReadResult,NO as selectActionableEntries,gS as selectCursorSemanticOptions,Wf as selectImportAuthor,Px as selectMcpClientRegistrationMode,yM as selectWorkspaceMemory,gM as selectWorkspaceMemoryRollups,Eu as semanticAttributionAffinity,oO as sentryCaptureCliError,tO as sentryDiscardCommandSpan,rO as sentryFinishCommandSpan,iO as sentryFlush,nO as sentryLogCliUsageError,Qv as sentrySetCommandContext,eO as sentryStartCommandSpan,pi as serializeItemDocument,E0 as serializeNdjsonRows,A0 as serializeNdjsonStream,cy as serveDeclaredObservation,lC as setActiveCommandContext,pC as setActiveCommandResult,oC as setActiveExtensionCommands,rC as setActiveExtensionHooks,nC as setActiveExtensionParsers,iC as setActiveExtensionPreflight,dC as setActiveExtensionRegistrations,aC as setActiveExtensionRenderers,sC as setActiveExtensionServices,zw as setFocusedItem,uO as shouldCompletePlanOnClose,vp as shouldPersistDurableGraphCache,WA as shouldResolveMutationStdinTokenField,KA as shouldResolveMutationStdinTokens,kv as shouldRunSearchRefreshInForeground,ql as similarityAdvisoryWarnings,NC as sliceReadOutputRowCollection,$l as sortLinkedArtifacts,$A as splitAcceptanceCriteria,cO as splitCommaList,li as splitFrontMatter,cS as stabilizeReadOutputReceiptEstimates,R as stableStringify,R0 as stableUpsertValue,ST as stableValueEquals,gh as startTask,fO as startTelemetryCommand,h_ as stats,Lw as statusIsTerminal,Ua as stripGlobalBootstrapTokens,ZM as subscribeMutationEventBatches,QM as subscribeMutationEvents,mR as summarizeAgentIdentityVocabulary,Zm as summarizeAgentModelProvenance,Qm as summarizeAgentProvenance,eM as summarizeContextEvaluationReports,yf as summarizeContextPreflight,BI as summarizeHistoryProvenance,Qc as summarizeInitResult,GR as summarizeMergeReceipt,NI as supportsCreateExplicitEmpty,NA as supportsItemIdAlias,nT as suppressHostOutput,Pe as syncRelationshipGraphAdapter,X0 as synthesizeExtensionManifest,Fa as toCompletionFlagString,Vu as toContextFocusItem,qu as toContextPackingSummary,zu as toContextRankingSummary,lT as toErrorMessage,xf as toEstimatedMinutesValue,c0 as toExtensionFlagDefinitions,Ff as toImportBoolean,Bf as toImportConfidence,$f as toImportInteger,Vf as toImportLinkedDocs,Hf as toImportLinkedFiles,Kf as toImportLinkedTests,zf as toImportLogEntries,qf as toImportNormalizedEnum,jf as toImportNumberMap,Nf as toImportPriority,Df as toImportStatus,Gf as toImportStringList,Uf as toImportStringMap,Lf as toImportTags,Bw as toItemRecord,kf as toNonEmptyImportString,cT as toNonEmptyStringOrUndefined,Zw as toReplayDocument,bd as tokenizeSimilarityText,VA as transferMutationStdinTokenPolicy,UT as translateHostEnvironmentFault,ah as update,hf as updateLinkedTest,Lh as upgrade,Z_ as validate,MP as validateAssertionDefinition,xP as validateAssuranceDocument,kP as validateGateDefinition,k0 as validateItemMutationRows,Gl as validateLinkedPaths,Rx as validateMcpAuthorizationResponseIssuer,Ox as validateMcpAuthorizationServerMetadata,Ix as validateMcpClientMetadataDocument,bx as validateMcpHttpRequestHeaders,nx as validateMcpJsonSchema,IP as validateMeasurementDefinition,_v as validateMissingParentReference,nS as validateReadOutputOptions,yv as validateSprintOrReleaseValue,bT as validateTypeOptions,TA as validateWorkspaceTransactionIdentity,vI as verifyAttestation,iP as verifyCliFlagInvocationParity,RA as verifyExplicitPositionalSlotCensus,tE as verifyHistoryChain,eE as verifyHistoryChainWithVersion,cA as verifyHistoryEntries,pE as verifyHistoryRecordHash,mE as verifyHistoryRewriteEvidence,xA as verifyPmCliGrammar,kA as verifyPmCommandPositionalContracts,WL as verifyPmFlagLexicon,yL as verifyPmRecoveryKindRuntimeCoverage,ib as verifyPmRecoveryProducerRuntimeCoverage,gL as verifyPmRecoveryReferences,SL as verifyPmRefusalClosureIdentityRatchet,CL as verifyPmRefusalClosureRatchet,hL as verifyPmRefusalReachability,Md as verifyToolOptionCliParity,os as withFlagAliasMetadata,jT as withHostEnvironmentBoundary,ox as withMcpCachePolicy,IT as workflowApprovalFingerprint,MT as workflowPolicyApplies,RT as workflowPolicyFingerprint,wl as workspaceGraphCache,dl as wrapOwnershipConflict,bw as wrapThrownErrorForSentry,Pi as writeAuthorEnvironment,$e as writeFileAtomic,ev as writeMutationCheckpoint,RE as writeSettings,sw as writeStderr,iw as writeStdout,Wv as writeVectorizationStatusLedger,wE as writeWorkspaceJsonWithHistory};
30
+ `)).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)&&C("Skill cursor is invalid or stale."),Number(o.offset)}catch(o){if(o instanceof u)throw o;return C("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 Fr(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 s=await Fr(n,"workspace",t.packageVersion);for(let[i,a]of s)r.set(i,a)}}return new e(r)}list(t={}){let r=t.limit??I.defaultPageSize;Dr.has(r)||C(`Skill list limit must be an integer from 1 to ${I.maxPageSize}.`);let o=this.#r(t.cursor,"skills/list"),n=[...this.#e.values()].sort((d,c)=>d.uri.localeCompare(c.uri)),s=n.slice(o,o+r),i=o+s.length,a=i<n.length;return{skills:s.map(Gr),hasMore:a,...a?{nextCursor:this.#o(i,"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||C(`Unknown pm MCP skill: ${t}.`,{field:"uri"}),Gr(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]??"",s=o&&n?o.files.get(n):void 0,i=o?.resources.find(c=>c.uri===t);(!o||!s||!i)&&C(`Unknown pm MCP skill resource: ${t}.`,{field:"uri"});let a={digest:i.digest,origin:o._meta.origin,trust:"untrusted"},d=$r(n,s);return d!=="application/octet-stream"?{contents:[{uri:t,mimeType:d,text:s.toString("utf8"),_meta:a}]}:{contents:[{uri:t,mimeType:d,blob:s.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||C(`Unknown pm MCP skill directory: ${t}.`,{field:"uri"});let s=(o?.[2]??"").replace(/\/$/u,""),i=s.length>0?`${s}/`:"",a=`skill://${o[1]}`,d=new Map;for(let T of n.resources){let S=T.uri.slice(`${a}/`.length);if(!S.startsWith(i))continue;let q=S.slice(i.length),[P,...vo]=q.split("/"),Oo=`${a}/${i}${P}`,Po=n.files.get(`${i}${P}`);d.set(P,{uri:Oo,name:P,mimeType:vo.length>0?"inode/directory":$r(P,Po)})}s.length>0&&d.size===0&&C(`Unknown pm MCP skill directory: ${t}.`,{field:"uri"});let c=r.limit??I.maxPageSize;Dr.has(c)||C(`Skill directory limit must be an integer from 1 to ${I.maxPageSize}.`);let l=this.#r(r.cursor,t),p=[...d.values()].sort((T,S)=>T.uri.localeCompare(S.uri)),f=p.slice(l,l+c),_=l+f.length,g=_<p.length;return{resources:f,hasMore:g,...g?{nextCursor:this.#o(_,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]="2b24276b-948b-50bd-bfd9-f429cd74be70")}catch{}})();var qr="https://schema.unbrained.dev/pm/workspace-recipe/v1";function dt(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)=>dt(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,dt(o,`${t}.${r}`)])))}function ve(e){if(e.schema!==qr)throw new Error(`Unsupported workspace recipe schema: ${e.schema}`);let t=wt(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:dt(r.input,`operations[${o}].input`)})))})}async function zr(e,t){let r=ve(e);return Et(r,t)}async function iy(e,t){return zr(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]="c234be1c-35b7-5388-8a70-a012e9a34389")}catch{}})();var Hr="pm.agent-observation/v1",Vr="pm.agent-verdict/v1",Kr="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 ne(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let t of Object.values(e))ne(t)}return e}function sy(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 ay(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 dy(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 s of o.fields){if(F(s,"observation.tiers.fields"),n.has(s))throw new Error(`Duplicate observation tier field: ${s}.`);n.add(s)}}}function cy(e){if(e.schema!==Hr)throw new Error(`observation.schema must be ${Hr}.`);return k(e.id,"observation.id"),O(e.version,"observation.version"),sy(e.reads),ay(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")),dy(e.tiers),ne(structuredClone(e))}function aN(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 ly(e,t,r){O(r.budget_tokens,"observation request budget_tokens");let o=[];for(let[n,s]of e.tiers.entries()){o.push(s.id);let i=await t(s),a=Buffer.byteLength(R(i),"utf8"),d=Math.ceil(a/4);if(d<=Math.min(r.budget_tokens,s.max_tokens))return{status:"served",payload:i,receipt:{contract_id:e.id,contract_version:e.version,served_tier:s.id,degraded:n>0,attempted_tiers:o,emitted_bytes:a,estimated_tokens:d,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 F(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 Wr(e,t){let r=e;for(let o of F(t,"recorded field path")){if(r===null||typeof r!="object"||!Object.hasOwn(r,o))return;r=r[o]}return r}function py(e){return`/${F(e,"verdict predicate path").map(t=>t.replaceAll("~","~0").replaceAll("/","~1")).join("/")}`}function uy(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 my(e){if(e.schema!==Vr)throw new Error(`verdict.schema must be ${Vr}.`);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"),F(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}.`);uy(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 ne(structuredClone(e))}function fy(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(i=>[i.id,i])),o=e.composition.predicate_ids.map(i=>{let a=r.get(i),d=Wr(t.state,a.path),c=a.kind==="field_present"?d!==void 0:a.kind==="field_absent"?d===void 0:R(d)===R(a.expected);return{id:i,outcome:c?"satisfied":"violated",evidence_pointer:`${t.snapshot_id}#${py(a.path)}`,evidence_digest:Tt(R(d))}}),n=o.filter(i=>i.outcome==="satisfied").length,s=e.composition.operator==="all"?n===o.length:n>0;return{contract_id:e.id,contract_version:e.version,snapshot_id:t.snapshot_id,outcome:s?"satisfied":"violated",score:n/o.length,policy:"verdict_only_no_reward",predicates:o}}function dN(e){if(e.schema!==Kr)throw new Error(`episode.schema must be ${Kr}.`);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)F(t,"episode.observable_fields");for(let t of e.withheld_fields)F(t,"episode.withheld_fields");for(let t of e.observable_fields){let r=e.withheld_fields.find(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 cy(e.observation),my(e.verdict),ve(e.recipe),ne(structuredClone(e))}function _y(e,t,r){let o=F(t,"observation projection field"),n=e;for(let[s,i]of o.entries()){if(s===o.length-1){r!==void 0&&(n[i]=structuredClone(r));return}let a=n[i];(a===null||typeof a!="object"||Array.isArray(a))&&(n[i]={}),n=n[i]}}function hy(e,t){let r={};for(let o of t)_y(r,o,Wr(e,o));return r}async function cN(e,t){let r=[],o=0,n=0,s=!1,i,a={episode:{id:e.id,label:`pm agent environment v${e.version}`},provenance:{role:e.mode,topic:"agent-environment"}},d=await D(a,()=>t.reset(e.recipe));r.push({sequence:1,kind:"reset",state_id:d.state_id});let c=async()=>{if(s)throw new Error("episode is already closed.");if(n>=e.limits.max_observations)throw new Error("episode exceeded limits.max_observations.");n+=1;let p=await t.readRecordedState(),f=await ly(e.observation,async _=>hy(p.state,_.fields),{budget_tokens:e.limits.max_tokens_per_observation});return r.push({sequence:r.length+1,kind:"observation",state_id:f.receipt.served_tier??p.snapshot_id}),f},l=async(p=!1)=>{if(s&&!p)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(),_=fy(e.verdict,f);return r.push({sequence:r.length+1,kind:"verdict",state_id:f.snapshot_id}),_};return{observe:()=>D(a,c),step:async p=>{if(s)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 D(a,()=>t.execute(p));return r.push({sequence:r.length+1,kind:"action",state_id:f.state_id}),f},score:()=>D(a,l),close:()=>i!==void 0?i:s?Promise.reject(new Error("episode is already closed.")):(s=!0,i=D(a,()=>l(!0)).then(p=>(r.push({sequence:r.length+1,kind:"close",state_id:p.snapshot_id}),{verdict:p,trajectory:ne(structuredClone(r))})).catch(p=>{throw s=!1,p}).finally(()=>{i=void 0}),i)}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="14472bc2-ebca-5b9c-9462-bd8694b630a0")}catch{}})();var G="https://schema.unbrained.dev/pm/corpus-shape/v1";function K(e,t){if(!Number.isSafeInteger(e)||e<=0)throw new TypeError(`Corpus shape ${t} must be a positive safe integer`);return e}function ie(e,t){if(!Number.isSafeInteger(e)||e<0)throw new TypeError(`Corpus shape ${t} must be a non-negative safe integer`);return e}function Xr(e){if(!(typeof e!="object"||e===null||Object.isFrozen(e))){for(let t of Object.values(e))Xr(t);Object.freeze(e)}}function W(e){if(e.schema!==G)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(K(e.hierarchy_depth,"hierarchy_depth"),K(e.hierarchy_fanout,"hierarchy_fanout"),ie(e.age_span_days,"age_span_days"),K(e.history_entries_per_item,"history_entries_per_item"),ie(e.comments_per_100_items,"comments_per_100_items"),ie(e.notes_per_100_items,"notes_per_100_items"),ie(e.learnings_per_100_items,"learnings_per_100_items"),K(e.author_cardinality,"author_cardinality"),K(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 Xr(t),t}var Oe=[{kind:"implements",weight:5},{kind:"blocked_by",weight:2},{kind:"discovered_from",weight:2},{kind:"verifies",weight:2},{kind:"supersedes",weight:1},{kind:"related",weight:4}],Y=Object.freeze({scratch:W({schema:G,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:W({schema:G,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:Oe,author_cardinality:32,component_count:1,include_cycles:!1,custom_types:["Experiment"],custom_statuses:["review"],terminal_statuses:[],custom_fields:["domain"]}),"deep-graph":W({schema:G,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:Oe,author_cardinality:16,component_count:1,include_cycles:!0,custom_types:[],custom_statuses:[],terminal_statuses:[],custom_fields:[]}),"multi-decade":W({schema:G,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:Oe,author_cardinality:64,component_count:1,include_cycles:!1,custom_types:["Program"],custom_statuses:["archived"],terminal_statuses:["archived"],custom_fields:["portfolio"]}),"disconnected-archive":W({schema:G,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:Oe,author_cardinality:24,component_count:5,include_cycles:!1,custom_types:["Archive"],custom_statuses:["archived"],terminal_statuses:["archived"],custom_fields:["archive_source"]})});function gy(){return Object.keys(Y).sort().map(e=>Y[e])}function yy(e){let t=e.trim().toLowerCase();if(!Object.hasOwn(Y,t))throw new TypeError(`Unknown corpus shape "${e}". Available: ${Object.keys(Y).join(", ")}`);return Y[t]}var Yr=new WeakMap;function Jr(e,t){if(e===0)return[];let r=Yr.get(t);r===void 0&&(r=t.edge_kind_mix.flatMap(n=>Array.from({length:n.weight},()=>n.kind)),Yr.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 by(e,t,r,o=42){if(ie(t,"item index"),K(r,"item count"),t>=r)throw new RangeError(`Corpus item index ${t} exceeds ${r}`);let n=Math.min(e.component_count,r),s=t%n,i=Math.floor(t/n),a=0,d=1;for(let S=0;S<e.hierarchy_depth;S+=1)a=Math.min(Number.MAX_SAFE_INTEGER,a+d),d=Math.min(Number.MAX_SAFE_INTEGER,d*e.hierarchy_fanout);let c=i%a,l=i-c,p=c===0?void 0:s+(l+Math.floor((c-1)/e.hierarchy_fanout))*n,f=Date.UTC(2026,0,1),_=e.age_span_days*864e5,g=new Date(f+(r===1?0:Math.round(t/(r-1)*_))).toISOString(),T=(t*37+o)%100;return{index:t,id:`pm-s${t.toString(36).padStart(7,"0")}`,...p===void 0?{}:{parent:`pm-s${p.toString(36).padStart(7,"0")}`},component:s,timestamp:g,author:`pm-corpus-agent-${(t+o)%Math.min(e.author_cardinality,r)}`,history_entry_count:e.history_entries_per_item,dependency_kinds:Jr(t,e),has_comment:T<e.comments_per_100_items,has_note:T<e.notes_per_100_items,has_learning:T<e.learnings_per_100_items,...e.custom_types.length>0&&t%11===0?{custom_type:e.custom_types[t%e.custom_types.length]}:{},...e.custom_statuses.length>0&&t%13===0?{custom_status:e.custom_statuses[t%e.custom_statuses.length]}:{}}}var ct=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,Jr(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[i,,a]of this.annotationFields){let d=Math.floor(this.itemCount/100),c=this.itemCount%100,l=d*a+Math.max(0,a+c-100),p=d*a+Math.min(a,c),f=this.annotations[i];(f<l||f>p)&&o.push(`${i}:${f}!in[${l},${p}]`)}let n=new Set([...Object.keys(this.edgeKinds),...Object.keys(this.expectedEdgeKinds)]);for(let i of[...n].sort()){let a=this.edgeKinds[i]??0,d=this.expectedEdgeKinds[i]??0;a!==d&&o.push(`edge_kind:${i}:${a}!=${d}`)}let s=[...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:s.length===0,mismatches:s}}};function Zr(e){return new ct(e)}function Ty(e,t){let r=Zr(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]="6a6b2905-b6b7-5b46-b87d-8b8287e37745")}catch{}})();async function Cy(){let e=Fe(process.cwd(),process.env.PM_PATH);await Ot(e,(t,r)=>Pt(t,r,{apply_runtime_defaults:!0}))}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="4534b1c9-de27-5745-88f2-641b00b94714")}catch{}})();async function Sy(){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]="c1cb8d82-20a6-5460-a0ff-f55312911218")}catch{}})();var Qr=["lines","branches","functions","statements"];function wy(e,t){if(typeof t!="object"||t===null||Array.isArray(t))throw new TypeError(`Coverage entry for ${e} must be an object.`)}function Ey(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 Ay(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)){wy(r,o);for(let n of Qr){let s=Ey(r,n,o[n]),i=s.total-s.covered;i>0&&t.push({file:r,metric:n,uncovered:i,...s})}}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]="7e55d416-9cc3-51c5-8e56-6b5fd5c836a9")}catch{}})();var vy=["captured_redacted","captured_verbatim"],Oy=[{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 Py(e,t){if(typeof t!="object"||t===null||Array.isArray(t))return[{boundary_id:e.id,kind:"invalid_fixture",detail:`${e.fixture_path} must contain a JSON object.`}];let r=t,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||!vy.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 s of Oy)s.pattern.test(n)&&o.push({boundary_id:e.id,kind:"unsafe_fixture",detail:`${e.fixture_path} contains a possible ${s.label}.`});return o}function Ry(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")&&_e(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 Iy(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?Py(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 Ry(e,r)}function vN(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,s=0,i=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 d=a,c=v(d.id)?d.id:void 0;if(c!==void 0&&n.has(c)){o.push({boundary_id:c,kind:"duplicate_boundary",detail:`Boundary ${c} is inventoried more than once.`});continue}c!==void 0&&n.add(c);let l=Iy(d,t,r.getTime());s+=l.captured,i+=l.waived,o.push(...l.findings)}return o.sort((a,d)=>a.boundary_id!==d.boundary_id?a.boundary_id.localeCompare(d.boundary_id):a.kind.localeCompare(d.kind)),{ok:o.length===0,boundary_count:e.boundaries.length,captured_count:s,waived_count:i,findings:o}}import X from"node:fs";import lt from"node:path";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="aacf5738-098d-50f9-b619-19e472b577ea")}catch{}})();var eo=300*1e3,My=3;function MN(e){return(e?.trim()||"development").replace(/[^a-zA-Z0-9._-]/g,"_").replace(/^\./,"_")}function kN(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=lt.join(e,r);X.mkdirSync(o,{recursive:!0});let n=new Date;X.utimesSync(o,n,n);let s=X.readdirSync(e).filter(c=>c!==r).flatMap(c=>{try{return[{name:c,mtimeMs:X.statSync(lt.join(e,c)).mtimeMs}]}catch(l){if(l instanceof Error&&"code"in l&&fe(l))return[];throw l}}).sort((c,l)=>l.mtimeMs-c.mtimeMs||c.name.localeCompare(l.name)),i=s.filter(c=>n.getTime()-c.mtimeMs<eo),a=Math.max(0,My-1-i.length),d=s.filter(c=>n.getTime()-c.mtimeMs>=eo).slice(a).map(c=>c.name).sort((c,l)=>c.localeCompare(l));for(let c of d)X.rmSync(lt.join(e,c),{recursive:!0,force:!0,maxRetries:3,retryDelay:50});return{retained:r,removed:d}}import{createHash as ky}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]="ff60bc5b-bd85-5b3c-9a55-21e7e72477ac")}catch{}})();var pt=1;function J(e){e?.throwIfAborted()}function U(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship graph ${t} must be non-empty`);return e.trim()}function Z(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(),s=e.edges(),i=t.list();return Object.freeze({version:pt,fingerprint:ky("sha256").update(R({nodes:n,edges:s,kinds:i})).digest("hex"),created_at:new Date(o).toISOString(),nodes:n,edges:s,kinds:i})}function xy(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ae(e){if(!xy(e))throw new TypeError("Relationship graph snapshot must be an object");if(e.version!==pt)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 De([]);for(let n of e.kinds)t.register(n);let r=new z(e.nodes,e.edges,t),o=Z(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){U(e.name,"adapter name");let r=U(t.workspace,"workspace");J(t.signal);let o=await e.read({...t,workspace:r});return J(t.signal),o===null?null:ae(o)}async function Pe(e,t){let r=U(t.workspace,"workspace"),o=ae(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(J(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 Ny(e,t={}){let r=e.map(ae),o=new Map;for(let i of r)for(let a of i.snapshot.kinds){let d=o.get(a.kind);if(d&&R(d)!==R(a))throw new TypeError(`Conflicting federated relationship kind: ${a.kind}`);o.set(a.kind,a)}let n=new De([...o.values()].sort((i,a)=>i.kind.localeCompare(a.kind))),s=new z(new Set(r.flatMap(i=>[...i.snapshot.nodes])),r.flatMap(i=>[...i.snapshot.edges]),n);return Z(s,n,t)}var se=class{name;#e=new Map;constructor(t="memory"){this.name=U(t,"adapter name")}async read(t){J(t.signal);let r=this.#e.get(U(t.workspace,"workspace"));return r?structuredClone(r):null}async replace(t){J(t.signal);let r=U(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(ae(t.snapshot).snapshot))}async clear(t){J(t.signal);let r=U(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]="e47f9bb8-f98e-5159-9116-29c3e6fedfc3")}catch{}})();function to(e,t){if(!Number.isInteger(e)||e<1)throw new TypeError(`Relationship graph ${t} must be a positive integer`);return e}function Ly(e){let t=to(e.nodeCount,"nodeCount"),r=to(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(),s=(e.idPrefix??"node").trim();if(!n||!s)throw new TypeError("Relationship graph kind and idPrefix must be non-empty");let i=o==="disconnected"?0:Math.floor((t-1)/r);return{node_count:t,edge_count:i,edge_basis:"fixture_generated",nodes:{*[Symbol.iterator](){for(let a=0;a<t;a+=1)yield`${s}-${a}`}},edges:{*[Symbol.iterator](){if(o!=="disconnected")for(let a=r;a<t;a+=r)yield{source:`${s}-${o==="star"?0:a-r}`,target:`${s}-${a}`,kind:n}}}}}function j(e,t){if(!e)throw new Error(`Relationship graph adapter conformance: ${t}`)}async function ro(e,t={}){let r=t.workspace?.trim()||"pm-graph-conformance",o=yt(),n=Z(new z(["a","b"],[{source:"a",target:"b",kind:"related"}],o),o,{createdAt:"2026-01-01T00:00:00.000Z"}),s=Z(new z(["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"}),i=[];j(await x(e,{workspace:r})===null,"workspace must start empty"),i.push({name:"empty-read",passed:!0});let a=await Pe(e,{workspace:r,snapshot:n});j(a.disposition==="written","first sync must write"),i.push({name:"atomic-replace",passed:!0}),(await e.read({workspace:r})).nodes.push("mutated-reader-copy"),j((await x(e,{workspace:r}))?.snapshot.nodes.length===2,"reads must not mutate stored state"),i.push({name:"read-isolation",passed:!0}),j((await Pe(e,{workspace:r,snapshot:n})).disposition==="current","identical sync must be idempotent"),i.push({name:"idempotent-sync",passed:!0}),await e.replace({workspace:r,snapshot:s,expected_fingerprint:n.fingerprint}),j((await x(e,{workspace:r}))?.snapshot.fingerprint===s.fingerprint,"replacement must become visible"),i.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 j(d,"stale compare-and-swap must fail"),i.push({name:"stale-cas",passed:!0}),e.clear&&(await e.clear({workspace:r,expected_fingerprint:s.fingerprint}),j(await x(e,{workspace:r})===null,"clear must remove the workspace"),i.push({name:"clear",passed:!0})),{adapter:e.name,workspace:r,cases:Object.freeze(i),clear_supported:e.clear!==void 0}}function Dy(e){return ro(new se,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]="58736688-35d0-545d-892e-e0ede7fedc1a")}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]="f5567aa1-0268-574d-907b-38d6249538ce")}catch{}})();var ut=2,$y=["self_reported","independent_transport"];function Re(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function de(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`${t} must be a non-empty string`);return e.trim()}function oo(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 s=de(o,`${t}[${String(n)}]`);return r?o:s})}function mt(e,t){return e===void 0?void 0:de(e,t)}function Fy(e,t){if(e===void 0)return;if(!Re(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(s=>s.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 Gy(e,t,r,o,n,s){if(o==="refusal"){if(We(r)||n===void 0||s===void 0)throw new TypeError(`${e} refusal steps require a non-success exit, error code, and refusal surface`);return}if(n!==void 0||s!==void 0)throw new TypeError(`${e} only refusal steps may declare expected_error_code or expected_refusal_surface`);let i=Ct(t);if(i===void 0)throw new TypeError(`${e}.args must identify a command after global flags`);let a=t[i].trim().toLowerCase();if(a==="history"){let l=St(t.slice(i+1));l!==void 0&&(a=Le(`history ${l}`))}let d=Nt(a);if(!We(r)||r!==0&&!d?.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 c=xt(a).kind;if(o!==c)throw new TypeError(`${e} expected ${o}, but ${a} declares ${c}`)}function Uy(e,t,r){if(!Re(e))throw new TypeError(`tasks.${t}.steps[${String(r)}] must be an object`);let o=`tasks.${t}.steps[${String(r)}]`,n=de(e.id,`${o}.id`),s=oo(e.args,`${o}.args`,!0),i=e.expected_exit_code;if(typeof i!="number"||!Number.isSafeInteger(i))throw new TypeError(`${o}.expected_exit_code must be a safe integer`);let a=e.expected_output_kind;if(a!=="refusal"&&!kt.includes(a))throw new TypeError(`${o}.expected_output_kind is unsupported`);let d=a,c=e.expected_accounting_mode;if(!$y.includes(c))throw new TypeError(`${o}.expected_accounting_mode is unsupported`);let l=c;if(l==="independent_transport"&&d!=="refusal")throw new TypeError(`${o} independent_transport accounting is supported only for refusal steps`);let p=oo(e.required_fields,`${o}.required_fields`);if(p.some(S=>S.split(".").some(q=>q.length===0)))throw new TypeError(`${o}.required_fields must contain dot-separated own-property paths`);let f=Fy(e.expected_field_values,`${o}.expected_field_values`),_=mt(e.expected_error_code,`${o}.expected_error_code`),g=mt(e.expected_refusal_surface,`${o}.expected_refusal_surface`),T=mt(e.recovery_for,`${o}.recovery_for`);return Gy(o,s,i,d,_,g),{id:n,args:s,expected_exit_code:i,expected_output_kind:d,expected_accounting_mode:l,required_fields:p,...f?{expected_field_values:f}:{},..._?{expected_error_code:_}:{},...g?{expected_refusal_surface:g}:{},...T?{recovery_for:T}:{}}}function jy(e,t){if(!Re(e))throw new TypeError(`tasks[${String(t)}] must be an object`);let r=de(e.id,`tasks[${String(t)}].id`),o=de(e.description,`tasks.${r}.description`);if(!Array.isArray(e.steps)||e.steps.length===0)throw new TypeError(`tasks.${r}.steps must be a non-empty array`);let n=e.steps.map((i,a)=>Uy(i,r,a)),s=new Map;for(let i of n){if(s.has(i.id))throw new TypeError(`tasks.${r} contains duplicate step id ${i.id}`);if(i.recovery_for!==void 0&&(s.get(i.recovery_for)?.expected_output_kind!=="refusal"||i.expected_output_kind==="refusal"))throw new TypeError(`tasks.${r}.${i.id} recovery_for must reference an earlier refusal and declare successful output`);s.set(i.id,i)}if(n.at(-1)?.expected_output_kind==="refusal")throw new TypeError(`tasks.${r} completed task must terminate with successful output`);for(let i of n)if(i.expected_output_kind==="refusal"&&!n.some(a=>a.recovery_for===i.id))throw new TypeError(`tasks.${r}.${i.id} refusal must have a later successful recovery_for step`);return{id:r,description:o,steps:n}}function cL(e){if(!Re(e))throw new TypeError("agent-task transcript corpus must be an object");if(e.version!==ut)throw new TypeError(`agent-task transcript corpus version must be ${String(ut)}`);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)=>jy(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:ut,tasks:t}}import{createHash as no}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]="7163a078-d8be-5bca-813f-c941fcb8e406")}catch{}})();function io(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship backfill ${t} must be non-empty`);return e.trim()}function mL(e,t){let r=io(t.migrationId,"migrationId"),o=io(t.author,"author"),n=Date.parse(t.timestamp);if(!Number.isFinite(n))throw new TypeError("Relationship backfill timestamp must be valid");let s=new Date(n).toISOString(),i=He(e,void 0,t.registry),a=i.graph.nodes(),d=i.graph.edges().map(f=>{let _=no("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}:${_}`,relationshipId:`migration:${r}:${_}`,action:"add",edge:f,author:o,timestamp:s,reason:`Backfill ${r} from legacy item metadata`})}),c=no("sha256").update(JSON.stringify({migrationId:r,nodes:a,events:d})).digest("hex"),l=new Set([...t.existingEventIds??[]].filter(f=>typeof f=="string").map(f=>f.trim()).filter(Boolean)),p=d.filter(f=>!l.has(f.eventId));return Object.freeze({migration_id:r,fingerprint:c,nodes:a,events:Object.freeze(p),edge_count:d.length,skipped_existing_count:d.length-p.length,duplicate_dependency_rows:i.duplicateRows.length,dangling_reference_count:i.dangling.active.length+i.dangling.legacy_terminal.length})}import*as so 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]="7a1d7194-6ff1-5365-ab64-80b47b0176d7")}catch{}})();var ce=["suggested_retry","candidate_command","example","next_step","migration_hint","restore_with"],ft={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"}},_L=Object.freeze(Object.keys(ft));function ao(e){if(Object.hasOwn(ft,e))return ft[e]}var By=new Set([..."=([{,:;!?&|+-*%^~<>","=>"]);function Q(e,t){return e<t?-1:e>t?1:0}function qy(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 zy(e){return e===void 0||e.kind==="punctuator"&&By.has(e.value)||e.kind==="identifier"&&["return","case","throw","else","yield"].includes(e.value)}function Hy(e,t){if(/\s/u.test(e[t]))return t+1;if(e.startsWith("//",t)){let r=e.indexOf(`
31
+ `,t+2);return r===-1?e.length:r+1}if(e.startsWith("/*",t))return e.indexOf("*/",t+2)+2}function Vy(e,t,r){if(e[t]!=="/"||!zy(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 Ky(e,t){let r=e[t];if(r==="'"||r==='"'||r==="`"){let n=qy(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 Wy(e){let t=[],r=0;for(;r<e.length;){let o=Hy(e,r);if(o!==void 0){r=o;continue}let n=Vy(e,r,t.at(-1));if(n!==void 0){r=n;continue}let s=Ky(e,r);s.token&&t.push(s.token),r=s.next}return t}var Yy=new Set(["object","block","pattern"]),Xy=new Set(["const","let","var"]),Jy=new Set(["}",")","]"]),Zy=new Set(["=","(","[",",",":","?","return"]);function Qy(e,t,r){if([...r].reverse().find(n=>Yy.has(n.kind))?.kind==="pattern"||r.at(-1)?.kind==="paren"&&r.at(-1)?.parameter_list)return"pattern";let o=e[t-1];return o?.kind==="identifier"&&Xy.has(o.value)?"pattern":o?.value==="=>"||o?.value===")"?"block":o&&Zy.has(o.value)?"object":"block"}function eb(e,t,r){let o=e[t];if(o.value==="{"){let i=Qy(e,t,r);return{kind:i,...i==="object"?{member_start:!0,candidates:[]}:{}}}if(o.value==="[")return{kind:"array"};if(o.value!=="(")return;let n=e[t-1],s=e[t-2];return{kind:"paren",...n?.value==="function"||s?.value==="function"?{parameter_list:!0}:{}}}function tb(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 rb(e,t){return e[t+1]?.value===")"&&e[t+2]?.value==="=>"||e[t+1]?.value==="="}function ob(e){let t=Wy(so.stripTypeScriptTypes(e,{mode:"strip"})),r=[],o=[];for(let[n,s]of t.entries()){let i=o.at(-1),a=tb(i,s,t[n+1]);a&&i.candidates.push(a);let d=eb(t,n,o);if(d)o.push(d);else if(Jy.has(s.value)){let c=o.pop();c?.kind==="object"&&!rb(t,n)&&r.push(...c.candidates)}else s.value===","&&i?.kind==="object"?i.member_start=!0:i?.kind==="object"&&s.value!==":"&&(i.member_start=!1)}return r}function nb(e){let t=[0];for(let r=0;r<e.length;r+=1)e[r]===`
32
+ `&&t.push(r+1);return t}function ib(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 hL(e){let t=[],r=[];for(let n of[...e].sort((s,i)=>Q(s.path,i.path))){let s=nb(n.content),i;try{i=ob(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 i){let d=a.field,c=ib(s,a.offset),l=ao(d);l?t.push({path:n.path,line:c,field:d,kind:l.kind}):/(?:retry_command|candidate_command|fallback_candidate|next_best_command|example|next_step|migration_hint|restore_with)/u.test(d)&&!/(?:_total|_truncated)$/u.test(d)&&r.push({kind:"unknown_recovery_field",subject:`${n.path}:${c}:${d}`,detail:`${d} resembles a recovery reference but has no typed field contract.`})}}let o=Object.fromEntries(ce.map(n=>[n,t.filter(s=>s.kind===n).length]));for(let n of ce)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,s)=>n.path!==s.path?Q(n.path,s.path):n.line!==s.line?n.line-s.line:Q(n.field,s.field)),r.sort((n,s)=>n.subject!==s.subject?Q(n.subject,s.subject):Q(n.kind,s.kind)),{ok:r.length===0,scanned_file_count:e.length,producer_count:t.length,producer_count_by_kind:o,producers:t,findings:r}}function gL(e,t){let r=[],o=(n,s)=>{if(Array.isArray(n)){n.forEach((i,a)=>o(i,[...s,String(a)]));return}if(!(typeof n!="object"||n===null))for(let[i,a]of Object.entries(n).sort(([d],[c])=>Q(d,c))){let d=ao(i),c=d?.kind==="migration_hint"&&n.semantics==="behavior_preserving"?{...d,semantics:"behavior_preserving"}:d,l=[a].flat();c!==void 0&&l.forEach((p,f)=>{let _="nested_value_field"in c&&typeof c.nested_value_field=="string"?c.nested_value_field:void 0,g=_&&typeof p=="object"&&p!==null&&!Array.isArray(p)?p[_]:p;if(typeof g!="string"||g.trim().length===0)return;let T=[...s,i,String(f)].map(S=>encodeURIComponent(S)).join("/");r.push({id:`${e}:${c.kind}:${T}`,probe_id:e,kind:c.kind,semantics:c.semantics,value:g})}),o(a,[...s,i])}};return o(t,[]),r}function yL(e,t){let r=e.flatMap(i=>(i.owned_states??[]).map(a=>({contract:i,state:a}))),o=[],n=new Map;for(let i of t){if(n.has(i.probe_id)){o.push({kind:"duplicate_probe",probe_id:i.probe_id,detail:`Observation ${i.probe_id} was supplied more than once.`});continue}n.set(i.probe_id,i)}let s=new Set(r.map(({state:i})=>i.probe_id));for(let{contract:i,state:a}of r){let d=n.get(a.probe_id);if(!d){o.push({kind:"missing_probe",probe_id:a.probe_id,detail:`No entrypoint observation was recorded for ${i.code}.`});continue}d.code!==i.code&&o.push({kind:"wrong_error_code",probe_id:a.probe_id,detail:`Expected ${i.code}; observed ${d.code}.`}),d.exit_class!==a.expected_exit_class&&o.push({kind:"wrong_exit_class",probe_id:a.probe_id,detail:`Expected ${a.expected_exit_class}; observed ${d.exit_class}.`}),a.entrypoints.includes(d.entrypoint)||o.push({kind:"wrong_entrypoint",probe_id:a.probe_id,detail:`Expected one of ${a.entrypoints.join(", ")}; observed ${d.entrypoint}.`})}for(let i of t)s.has(i.probe_id)||o.push({kind:"undeclared_probe",probe_id:i.probe_id,detail:`Observation ${i.probe_id} has no catalog declaration.`});return o.sort((i,a)=>i.probe_id!==a.probe_id?i.probe_id.localeCompare(a.probe_id):i.kind.localeCompare(a.kind)),{ok:o.length===0,declared_probe_count:r.length,observed_probe_count:t.length,findings:o}}function bL(e,t){let r=[],o=new Set,n=new Set;for(let d of e){if(o.has(d.id)){n.add(d.id),r.push({kind:"duplicate_obligation",reference_id:d.id,detail:`Recovery obligation ${d.id} was declared more than once.`});continue}o.add(d.id)}let s=new Map;for(let d of t){if(s.has(d.id)){r.push({kind:"duplicate_observation",reference_id:d.id,detail:`Recovery reference ${d.id} was observed more than once.`});continue}s.set(d.id,d),o.has(d.id)||r.push({kind:"undeclared_observation",reference_id:d.id,detail:`Recovery observation ${d.id} has no emitted obligation.`})}for(let d of e){if(n.has(d.id))continue;let c=s.get(d.id);c?c.reachable?c.semantics!==d.semantics&&r.push({kind:"wrong_semantics",reference_id:d.id,detail:`Recovery reference ${d.value} promised ${d.semantics}; proof demonstrated ${c.semantics}.`}):r.push({kind:"unreachable_reference",reference_id:d.id,detail:`Recovery reference ${d.value} did not reach its promised target.`}):r.push({kind:"missing_observation",reference_id:d.id,detail:`No reachability proof was recorded for ${d.kind} ${d.value}.`})}let i=ce.map(d=>{let c=e.filter(p=>p.kind===d),l=c.filter(p=>!n.has(p.id)).map(p=>s.get(p.id)).filter(p=>p!==void 0);return{kind:d,declared:c.length,observed:l.length,passed:c.filter(p=>{let f=s.get(p.id);return!n.has(p.id)&&f?.reachable===!0&&f.semantics===p.semantics}).length}});r.sort((d,c)=>d.reference_id!==c.reference_id?d.reference_id.localeCompare(c.reference_id):d.kind.localeCompare(c.kind));let a=i.reduce((d,c)=>d+c.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:i,findings:r}}function sb(e,t){let r=new Map(ce.map(s=>[s,new Set]));for(let s of t)r.get(s.kind).add(s.value);let o=ce.map(s=>({kind:s,source_producers:e.producer_count_by_kind[s],runtime_values:r.get(s).size})),n=o.filter(({source_producers:s,runtime_values:i})=>s>0&&i===0).map(({kind:s})=>s);return{ok:e.ok&&n.length===0,source_producer_count:e.producer_count,runtime_value_count:o.reduce((s,{runtime_values:i})=>s+i,0),coverage_by_kind:o,missing_runtime_kinds:n}}var TL=sb;(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]="2b2197f3-7203-52c8-9cc7-f714b33a9306")}catch{}})();var SL=16,ab=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"]),co=18,lo=Object.freeze([...ab,"manifest_unknown_key","no_version_bounds_declared"].sort((e,t)=>e.localeCompare(t)));function wL(e,t=co){return{ok:e.executable_error_code_count>=t,baseline:t,actual:e.executable_error_code_count}}function EL(e,t=lo){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 _t(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 AL(e,t,r){let o=new Map(e.map(l=>[l.code,l.canonical_code??l.code])),n=new Map,s=0,i=0;for(let l of e){let p=_t(n,l.canonical_code??l.code);for(let f of l.owned_states??[])p.kinds.add("owned_state"),p.probeIds.add(f.probe_id)}for(let l of t){let p=o.get(l.error_code);if(p===void 0)continue;s+=1;let f=_t(n,p);f.kinds.add("closed_domain"),f.probeIds.add(l.probe_id)}for(let l of r){let p=o.get(l.error_code);if(p===void 0)continue;i+=1;let f=_t(n,p);f.kinds.add("grammar"),f.probeIds.add(l.probe_id)}let a=e.map(l=>{let p=l.canonical_code??l.code,f=n.get(p),_=[...f.probeIds].sort();return{code:l.code,canonical_code:p,disposition:_.length>0?"executable":"uncovered",evidence_kinds:[...f.kinds].sort(),probe_ids:_}}).sort((l,p)=>l.code<p.code?-1:1),d=a.filter(({disposition:l})=>l==="uncovered").map(({code:l})=>l),c=a.length-d.length;return{ok:d.length===0,catalog_error_code_count:a.length,executable_error_code_count:c,uncovered_error_code_count:d.length,coverage_fraction:a.length===0?1:c/a.length,closed_domain_probe_count:s,grammar_probe_count:i,uncovered_error_codes:d,rows:a}}function vL(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: ${co}`,`- Required executable canonical codes: ${lo.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(`
33
+ `)}(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]="d252409d-e33e-5c9e-9671-789f0ee87312")}catch{}})();function db(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 cb(e){return[e.exit_code!==me.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 ${me.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."},...db(e)]}function RL(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 s=t.length;for(let i of cb(n))i!==void 0&&t.push(i);t.length===s&&(o+=1)}return t.sort((n,s)=>n.probe_id!==s.probe_id?n.probe_id.localeCompare(s.probe_id):n.code.localeCompare(s.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]="39b4e1fe-a34a-5ffc-9447-eaf8c46863c7")}catch{}})();var po="not-a-declared-action";function lb(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 le(e){return e.replaceAll(/[^a-z0-9]+/gu,"-").replaceAll(/^-|-$/gu,"")}function FL(e=qe.filter(t=>vt.some(r=>r.command===t.command&&r.disposition!=="package_owned"))){let t=new Set(e.filter(({command:r})=>!r.includes(" ")).map(({command:r})=>le(r)));return e.flatMap(r=>r.slots.flatMap((o,n)=>{if(!o.required)return[];let s=r.command.split(" "),i=le(r.command),a=s.length>1&&t.has(i)?s.map(le).join("--"):i,d=ee(r.command).flatMap(l=>l.required?[l.flag,...l.value_name?["example"]:[]]:[]),c=Be.some(l=>l.command===r.command);return[{probe_id:`required-argument-${a}-${le(o.name)}`,command:r.command,refusal_args:[...s,...r.slots.slice(0,n).map(l=>lb(r.command,l)),...d],recovery_args:[...s,"--help"],error_code:c&&!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 pb(e){switch(L(e)){case"assurance":case"workspace snapshot":return Be.filter(({parent:t})=>t===e).map(({action:t})=>t);case"graph":return Ge;case"merge":return Ue;case"plan":return Ye;case"profile":return Xe;case"schema":return Lt;default:throw new Error(`Required positional action family ${e} has no authoritative value domain.`)}}function GL(e=qe){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-${le(t)}`,command:t,refusal_args:[...r,po],recovery_args:[...r,"--help"],error_code:"unknown_subcommand",rejected_value:po,allowed_values:[...pb(t)].sort()}}).sort((t,r)=>t.probe_id.localeCompare(r.probe_id))}function ub(e,t){let r=[...t].sort();return e.length===t.length&&[...e].sort().every((o,n)=>o===r[n])}function mb(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&&!ub(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 UL(e,t){let r=new Map(e.map(i=>[i.probe_id,i])),o=new Map(t.map(i=>[i.probe_id,i])),n=[...e.flatMap(i=>mb(i,o.get(i.probe_id))),...t.filter(i=>!r.has(i.probe_id)).map(i=>({code:"unexpected_refusal_probe",probe_id:i.probe_id,detail:`${i.probe_id} has no declared grammar refusal contract.`}))];n.sort((i,a)=>i.probe_id.localeCompare(a.probe_id)||i.code.localeCompare(a.code));let s=new Set(n.map(({probe_id:i})=>i));return{ok:n.length===0,probe_count:e.length,closed_probe_count:e.filter(({probe_id:i})=>!s.has(i)).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]="d3795bc4-fbe5-5ca4-bc90-b72a2d469dc7")}catch{}})();var ht=[{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 BL(){return ht.map(e=>({...e}))}function fb(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 qL(e){let t=new Map(e.map(n=>[n.probe_id,n])),r=[],o=0;for(let n of ht){let s=t.get(n.probe_id);if(s===void 0){r.push({code:"missing_probe",probe_id:n.probe_id,detail:"No runtime observation was supplied for this contract."});continue}let i=fb(n,s);r.push(...i),i.length===0&&(o+=1)}return r.sort((n,s)=>n.probe_id.localeCompare(s.probe_id)||n.code.localeCompare(s.code)),{ok:r.length===0,probe_count:ht.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]="32070e26-7a40-50ff-84d7-73e50ff5f01f")}catch{}})();var Ie,_b=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 hb(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=_b[L(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(L(e))?"linked-file-path":["comments","notes","learnings"].includes(L(e))?"entry-file-input":"plan-definition-file"}function Me(){if(Ie!==void 0)return Ie;let e=te.filter(({command:n})=>ze(n)).flatMap(({command:n,family:s})=>Mt(n,ee(n)).map(i=>({command:n,family:s,concept:hb(n,i.flag),flag:i.flag,aliases:Object.freeze([...i.aliases??[]]),value_kind:i.repeatable?"list":i.flag==="--limit"?"number":i.value_type}))),t=new Set(e.flatMap(n=>n.aliases.map(s=>`${n.command}:${s}`))),r=e.filter(n=>!t.has(`${n.command}:${n.flag}`)),o=new Map;for(let n of r){let s=o.get(n.concept)??new Set;s.add(n.value_kind),o.set(n.concept,s)}return Ie=Object.freeze(r.map(n=>Object.freeze({...n,concept:o.get(n.concept)?.size===1?n.concept:`${n.concept}@${n.command}`}))),Ie}function YL(){return Object.freeze(Me().map(e=>Object.freeze({command:e.command,canonical_flag:e.flag,accepted_spellings:Object.freeze([...new Set([e.flag,...e.aliases])].sort())})))}var uo=Object.freeze({init:30,item:20,config:36,extension:55,package:56,packages:56,install:27,upgrade:29,create:102,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:34,"history-attest":23,"history-redact":27,"history-repair":27,"history-compact":30,"history-author-acknowledge":28,merge:29,schema:43,profile:22,activity:36,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:111,test:56,"test-all":40,telemetry:21,stats:29,health:36,validate:46,assurance:30,gc:22,workspace:23,contracts:29,claim:39,release:25,"start-task":23,"pause-task":23,"close-task":24,meet:33,event:33,remind:29,"test-runs-worker":20}),mo=Object.freeze({...uo,...Object.fromEntries(Ne.flatMap(({alias:e,canonical:t})=>{let r=uo[e];return r===void 0?[]:[[t,r]]}))});function fo(){let e=new Map(Object.keys(mo).map(t=>[t,0]));for(let{command:t}of Me())e.set(t,Number(e.get(t))+1);return Object.freeze(Object.entries(mo).map(([t,r])=>Object.freeze({command:t,current:Number(e.get(t)),maximum:r})))}function gb(e,t,r){for(let o of e)for(let n of o.aliases){let s=t.get(`${o.command}:${n}`);s===void 0||s.flag===o.flag||r.push({code:"alias_collision",command:o.command,detail:`${n} aliases ${o.flag} but is canonical for ${s.flag}.`})}}function yb(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 s=e.get(n.command)??0;s===0&&r.push({code:"stale_budget",command:n.command,detail:`${n.command} has a persisted budget but no canonical flags.`}),!(s<=n.maximum)&&r.push({code:"budget_exceeded",command:n.command,detail:`${s} canonical flags exceed the ratcheted maximum ${n.maximum}.`})}}function bb(e,t,r){let o=new Map(e.map(n=>[`${n.command}:${n.flag}`,n]));for(let n of t){let s=`${n.command}:${n.canonical_flag}`,i=o.get(s);if(!i){r.push({code:"removed_canonical_spelling",command:n.command,detail:`${n.canonical_flag} disappeared from the executable spelling inventory.`});continue}let a=new Set([i.flag,...i.aliases]);for(let d of n.accepted_spellings)a.has(d)||r.push({code:"removed_compatibility_spelling",command:n.command,detail:`${d} no longer resolves to ${n.canonical_flag}.`})}}function XL(e=Me(),t=fo(),r=[]){let o=[],n=new Map,s=new Map,i=new Map,a=new Map;for(let d of e){let c=`${d.command}:${d.flag}`;n.has(c)?o.push({code:"duplicate_canonical_flag",command:d.command,detail:`${d.flag} has more than one canonical row.`}):n.set(c,d),a.set(d.command,(a.get(d.command)??0)+1);let l=s.get(d.concept);l!==void 0&&l!==d.value_kind?o.push({code:"inconsistent_concept_kind",command:d.command,detail:`${d.concept} uses both ${l} and ${d.value_kind}.`}):s.set(d.concept,d.value_kind);let p=i.get(d.concept);p!==void 0&&p!==d.flag?o.push({code:"semantic_spelling_collision",command:d.command,detail:`${d.concept} is canonicalized by both ${p} and ${d.flag}.`}):i.set(d.concept,d.flag)}return gb(e,n,o),yb(a,t,o),bb(e,r,o),o.sort((d,c)=>d.command.localeCompare(c.command)||d.code.localeCompare(c.code)||d.detail.localeCompare(c.detail)),{ok:o.length===0,entry_count:e.length,budget_count:t.length,concept_count:new Set(e.map(({concept:d})=>d)).size,baseline_entry_count:r.length,findings:o}}function JL(){let e=Me(),t=fo(),r=new Map(t.map(({command:o})=>[o,"unknown"]));for(let{command:o,family:n}of e)r.set(o,n);return["# Generated flag lexicon budgets","","This file is generated by `listPmFlagLexicon()`. Compatibility aliases do not consume canonical budget.","","| Command | Capability family | Canonical flags | Maximum |","| --- | --- | ---: | ---: |",...t.map(({command:o,current:n,maximum:s})=>{let i=r.get(o);return`| \`${o}\` | ${i} | ${n} | ${s} |`}),""].join(`
34
+ `)}(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]="4c9a1aa8-05b6-53da-a8b1-f1a7289d39cf")}catch{}})();function QL(e){return e}function eD(e){return e}function tD(e){return e}function rD(e){return e}function oD(e){return e}function nD(e){return e}function iD(e){return e}function sD(e){return e}function aD(e){return e}function dD(e){return e}function cD(e){return e}function lD(e){return e}function pD(e){return e}function uD(e){return{handled:!0,result:e}}function mD(){return{handled:!1}}function fD(e){return e}function _D(e){return e}function hD(e){return e}function gD(e){return e}function yD(e){return e}function bD(e){return e}function TD(e){return e}function CD(e){return e}function SD(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]="68ca9ab1-91e0-5020-859e-fc1f1f6dcc56")}catch{}})();function Tb(e={},t={}){return new ge(t).extension(void 0,{...e,migrate:!0})}function Cb(e={},t={}){return new ge(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]="d0b86c6a-67f0-52f2-90b8-d1058e8f2284")}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]="604d7dcb-9fea-5631-8a72-b2a7ff3278f8")}catch{}})();function N(e){if(typeof e!="string"||!_e(e))throw new TypeError("Invalid reliability timestamp.");return Date.parse(e)}function Sb(e){let t=N(e.window_start),r=N(e.window_end);if(t>=r||!Number.isFinite(e.max_failure_rate)||e.max_failure_rate<0||e.max_failure_rate>=1||!Number.isSafeInteger(e.min_completed_attempts)||e.min_completed_attempts<1)throw new TypeError("Invalid reliability window policy.");if(e.families.length===0||e.families.some(o=>typeof o!="string"||o.trim().length===0)||new Set(e.families).size!==e.families.length)throw new TypeError("Expected unique, nonempty reliability families.");return{start:t,end:r}}function wb(e,t,r,o){let n=new Map(t.map(i=>[i,[]])),s=new Set;for(let i of e){if(typeof i.id!="string"||i.id.trim().length===0||s.has(i.id))throw new TypeError("Invalid or duplicate reliability attempt identity.");s.add(i.id);let a=n.get(i.family);if(!a||!["success","failure","pending"].includes(i.outcome)||i.cause!==void 0&&(!["product","infrastructure","unknown"].includes(i.cause)||i.outcome!=="failure"))throw new TypeError("Invalid reliability attempt family, outcome or cause.");let d=N(i.started_at);if(i.repaired_at!==void 0&&(N(i.repaired_at)<d||i.outcome!=="failure"))throw new TypeError("Invalid reliability repair chronology.");d>=r&&d<o&&a.push(i)}return n}function UD(e,t){let{start:r,end:o}=Sb(t),n=[...wb(e,t.families,r,o)].map(([s,i])=>{let a=i.filter(_=>_.outcome==="failure"),d=i.filter(_=>_.outcome!=="pending").length,c=d===0?null:a.length/d,l=a.filter(_=>_.repaired_at!==void 0&&N(_.repaired_at)<o),p={product:0,infrastructure:0,unknown:0};for(let _ of a)p[_.cause??"unknown"]+=1;let f=[];return d<t.min_completed_attempts&&f.push("insufficient_completed_attempts"),c!==null&&c>t.max_failure_rate&&f.push("failure_rate"),{family:s,attempts:i.length,completed:d,failed:a.length,pending:i.length-d,failure_rate:c,affected_days:[...new Set(a.map(_=>new Date(N(_.started_at)).toISOString().slice(0,10)))].sort(),repair_minutes:l.map(_=>(N(_.repaired_at)-N(_.started_at))/6e4).sort((_,g)=>_-g),unresolved:a.length-l.length,causes:p,violations:f,ok:f.length===0}});return{schema:"pm-reliability-window/1",window_start:new Date(r).toISOString(),window_end:new Date(o).toISOString(),ok:n.every(s=>s.ok),families: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]="773ad2b6-326e-5483-bdce-a377f935cb31")}catch{}})();function pe(e){return typeof e=="string"&&e.length>0&&e.trim()===e}function Eb(e){if(!Array.isArray(e)||e.length<2)throw new TypeError("Expected at least two artifact ledgers.");let t=new Map;for(let r of e){if(r===null||typeof r!="object"||!pe(r.name)||t.has(r.name)||r.complete!==!0)throw new TypeError("Expected unique complete artifact ledgers.");if(!Array.isArray(r.identities))throw new TypeError("Invalid or duplicate artifact identity.");let o=new Set(r.identities);if(o.size!==r.identities.length||[...o].some(n=>!pe(n)))throw new TypeError("Invalid or duplicate artifact identity.");t.set(r.name,o)}if([...t.values()].every(r=>r.size===0))throw new TypeError("Empty inventories cannot establish artifact reconciliation.");return t}function Ab(e,t){if(!Array.isArray(e))throw new TypeError("Expected unique evidence-backed artifact exceptions.");let r=new Map;for(let o of e){if(o===null||typeof o!="object"||!pe(o.identity)||r.has(o.identity)||!pe(o.reason)||!pe(o.evidence))throw new TypeError("Expected unique evidence-backed artifact exceptions.");let n=o.missing_from;if(!Array.isArray(n)||n.length===0||n.length>=t.length||new Set(n).size!==n.length||[...n].some(s=>!t.includes(s)))throw new TypeError("Invalid artifact exception ledger signature.");r.set(o.identity,o)}return r}function BD(e,t=[]){let r=Eb(e),o=[...r.keys()].sort(),n=Ab(t,o),s=[...new Set([...r.values()].flatMap(c=>[...c]))].sort(),i=[],a=new Set;for(let c of s){let l=o.filter(_=>!r.get(_).has(c));if(l.length===0)continue;let p=n.get(c),f=p!==void 0&&JSON.stringify([...p.missing_from].sort())===JSON.stringify(l);f&&a.add(c),i.push({identity:c,present_in:o.filter(_=>r.get(_).has(c)),missing_from:l,disposition:f?{reason:p.reason,evidence:p.evidence}:null})}let d=[...n.keys()].filter(c=>!a.has(c)).sort();return{schema:"pm-artifact-ledgers/1",ok:i.every(c=>c.disposition!==null)&&d.length===0,counts:Object.fromEntries(o.map(c=>[c,r.get(c).size])),findings:i,stale_exceptions:d}}(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]="fca4e9bb-3a30-512e-9929-565ab6c11c54")}catch{}})();import{createHash as ho,createHmac as vb,randomBytes as Ob,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]="837ee381-0838-55d3-bcdf-7352fb76661d")}catch{}})();var A1="dev.unbrained.pm/progressive-tool-discovery",v1=Object.freeze({version:1,discoveryTool:"pm_discover",canonicalResult:"structuredContent.result",compatibilityText:"pointer"}),Rb=Object.freeze(["pm_discover","pm_next","pm_context","pm_search","pm_get"]),B=Object.freeze({lexical:.4,semantic:.2,graph:.1,permission:.15,freshness:.05,usage:.1}),Ib=Object.freeze(["profile_changed","tool_contract_changed","workspace_extension_changed","authorization_changed","ranking_signal_changed","cursor_integrity_key_rotated"]),go={core:0,standard:1,full:2,internal:3},yo=Object.freeze(["core","standard","full"]),Mb=new Set(["core","standard","full","custom"]),bo=new Set(te.map(({family:e})=>e)),kb=Ob(32);function xe(e,t){if(typeof e!="string")throw new b(`pm tool discovery ${t} must be a string of at most 4096 Unicode characters.`,64);let r=e[Symbol.iterator](),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 To(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 Co(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 So(e){if(e!==void 0&&typeof e!="boolean")throw new b("pm tool discovery includeSchema must be a boolean.",64);return e===!0}function wo(e){if(e===null||typeof e!="object"||Array.isArray(e))throw new b("pm tool discovery options must be an object.",64)}function xb(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 O1(e){if(wo(e),e.family!==void 0&&(typeof e.family!="string"||!bo.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"||!yo.includes(e.tier)))throw new b("pm tool discovery tier must be core, standard, or full.",64);return{...e.query!==void 0?{query:xe(e.query,"query")}:{},...e.family!==void 0?{family:e.family}:{},...e.tier!==void 0?{tier:e.tier}:{},...e.limit!==void 0?{limit:To(e.limit)}:{},...e.cursor!==void 0?{cursor:xe(e.cursor,"cursor")}:{},...e.includeSchema!==void 0?{includeSchema:So(e.includeSchema)}:{},...e.outputBudget!==void 0?{outputBudget:Co(e.outputBudget)}:{}}}function Nb(e){return e===void 0||!Number.isFinite(e)?0:Math.min(1,Math.max(0,e))}function ue(e){return[...new Set(e.toLowerCase().match(/[a-z0-9]+/gu)??[])].sort()}function Lb(e,t){let r=ue(e);if(r.length===0)return 0;let o=new Set(ue(t)),n=r.filter(i=>o.has(i)).length,s=t.toLowerCase().includes(e.toLowerCase())?.25:0;return Math.min(1,n/r.length+s)}function Db(e,t){let r=ue(e);if(r.length===0)return 0;let o=t.toLowerCase(),n=ue(t),s=r.filter(a=>n.some(d=>d.startsWith(a)||a.startsWith(d))).length,i=o.includes(e.toLowerCase())?.2:0;return Math.min(1,s/r.length+i)}function _o(e){return ho("sha256").update(JSON.stringify(e)).digest("hex").slice(0,24)}function Eo(e,t,r){return vb("sha256",r).update(JSON.stringify({version:1,fingerprint:e,offset:t})).digest("base64url")}function $b(e,t,r){let o={version:1,offset:t,signature:Eo(e,t,r)};return Buffer.from(JSON.stringify(o),"utf8").toString("base64url")}function Fb(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 s=Buffer.from(Eo(t,n.offset,o),"base64url"),i=Buffer.from(n.signature,"base64url");if(i.length!==s.length||!Pb(i,s))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 gt(e,t,r){return{value:Nb(e),weight:t,available:r!=="unavailable",source:r}}function ke(e,t,r){return gt(e??t,r,e===void 0?"computed":"host")}function Gb(e,t,r){let o=Object.hasOwn(he,e.name)?he[e.name]:"help",n=Ve(o),s=`${e.name} ${e.description} ${o} ${n}`,i=Lb(t,s),a=new Set(ue(t)),d={lexical:gt(i,B.lexical,"computed"),semantic:ke(e.signals?.semantic,Db(t,s),B.semantic),graph:ke(e.signals?.graph,a.has(n)||a.has(o)?1:0,B.graph),permission:gt(1,B.permission,"authorization"),freshness:ke(e.signals?.freshness,1,B.freshness),usage:ke(e.signals?.usage,Rb.includes(e.name)?1:0,B.usage)},c=Object.values(d).reduce((l,p)=>l+p.value*p.weight,0);return{name:e.name,description:e.description,command:o,tier:Ke(o),family:n,score:Number(c.toFixed(6)),signals:d,...r?{input_schema:structuredClone(e.inputSchema)}:{}}}function Ub(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"||!yo.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"||!bo.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"||!Mb.has(e.profile)))throw new b("pm tool discovery profile must be core, standard, full, or custom.",64)}function jb(e){let t=xe(e.query===void 0?"":e.query,"query").trim().replace(/\s+/gu," ");xe(e.cursor===void 0?"":e.cursor,"cursor");let r=To(e.limit===void 0?10:e.limit),o=Co(e.outputBudget===void 0?1200:e.outputBudget);return Ub(e),{query:t,includeSchema:So(e.includeSchema),limit:r,budget:o,maximumTier:go[e.tier??"full"],profile:e.profile===void 0?"core":e.profile}}function Ao(e,t,r){let o=r??e.tools.reduce((i,a,d)=>i+(d===0?0:1)+Buffer.byteLength(JSON.stringify(a),"utf8"),0),n={...e,tools:[]},s=0;for(let i=0;i<4;i+=1){let a=Buffer.byteLength(JSON.stringify({...n,token_cost:{estimated_tokens:s,budget:t,within_budget:!0}}),"utf8"),d=Math.ceil((a+o)/4);if(d===s)break;s=d}return s}function Bb(e,t,r){return e.filter(o=>o.authorized!==!1).map(o=>Gb(o,r.query,r.includeSchema)).filter(o=>o.tier!=="internal"&&go[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 qb(e,t,r){if(t==="unbounded")return[...e];let o=[],n=0;for(let[s,i]of e.entries()){let a=n+(s===0?0:1)+Buffer.byteLength(JSON.stringify(i),"utf8");if(Ao(r(s+1),t,a)>t)break;o.push(i),n=a}return o}function P1(e,t={}){xb(e),wo(t);let r=jb(t),o=t.cursorIntegrityKey??kb,n=Bb(e,t,r),s=_o({query:r.query,family:t.family??null,tier:t.tier??"full",includeSchema:r.includeSchema,profile:r.profile,ranked:n}),i=Fb(t.cursor,s,n.length,o),a=n.slice(i,i+r.limit),d=[];r.includeSchema||d.push({name:"input_schema",reason:"compact_projection",restore_with:"Set includeSchema=true."}),i+r.limit<n.length&&d.push({name:"tools",reason:"limit",restore_with:"Continue with next_cursor or increase limit."});let c={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:B},cache:{key:_o({fingerprint:s,cursorIntegrityKey:ho("sha256").update(o).digest("hex"),limit:r.limit,offset:i,budget:r.budget}),ttl_ms:3e4,scope:"private",invalidates_on:Ib}},l=(g,T=g.length)=>{let S=i+T,q=S<n.length,P=[...d];return T<a.length&&P.push({name:"tools",reason:"token_budget",restore_with:"Continue with next_cursor or increase outputBudget."}),{...c,tools:[...g],returned:T,has_more:q,...q?{next_cursor:$b(s,S,o)}:{},omission_receipt:{has_omissions:P.length>0,omitted:P}}},p=g=>{let T=l(g),S=Ao(T,r.budget);return{...T,token_cost:{estimated_tokens:S,budget:r.budget,within_budget:r.budget==="unbounded"||S<=r.budget}}},f=qb(a,r.budget,g=>l([],g)),_=p(f);if(a.length>0&&f.length===0){let g=p([a[0]]).token_cost.estimated_tokens;throw new b(`pm tool discovery outputBudget is too small to return a tool; increase it to at least ${g}.`,64,{required:String(g)})}if(r.budget!=="unbounded"&&_.token_cost.estimated_tokens>r.budget)throw new b(`pm tool discovery outputBudget is too small; at least ${_.token_cost.estimated_tokens} estimated tokens are required for this page.`,64,{required:String(_.token_cost.estimated_tokens)});return _}(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]="39336651-18af-56d7-b658-5e735a2adad5")}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]="684f032c-ee69-54f5-82a7-b1c3a93c526c")}catch{}})();export{RO as ACTIONABILITY_ORDERING_KINDS,rd as ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS,Aa as ACTIVITY_FLAG_CONTRACTS,gi as AGENT_PROVENANCE_DIMENSIONS,cs as AGGREGATE_FLAG_CONTRACTS,Ys as APPEND_FLAG_CONTRACTS,fI as ASSURANCE_ACTIONS,_I as ASSURANCE_DECLARATION_KINDS,OP as ASSURANCE_DOCUMENT_VERSION,_a as ASSURANCE_FLAG_CONTRACTS,PP as ASSURANCE_GATE_TRIGGERS,RP as ASSURANCE_MEASUREMENT_SOURCE_KINDS,TR as ASSURANCE_PRESET_IDS,wP as AssuranceEvaluationRefusalError,SP as AssuranceMutationRefusalError,EP as AssuranceSourceResolutionError,oi as BASELINE_ITEM_FORMAT_VERSION,vy as BOUNDARY_FIXTURE_CAPTURE_SOURCES,ew as BRIEF_LIST_FIELDS,bi as BUILTIN_AGENT_PROVENANCE_ADAPTERS,Y as BUILTIN_CORPUS_SHAPES,yi as BUILTIN_HARNESS_SIGNAL_DESCRIPTORS,jo as BUILTIN_ITEM_TYPE_VALUES,zt as BUILTIN_PROFILES,zb as BUILTIN_RELATIONSHIP_KINDS,Qa as CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS,Ea as CALENDAR_FLAG_CONTRACTS,Xs as CLAIM_FLAG_CONTRACTS,Qd as CLOSE_ACTION_OPTION_KEYS,Ks as CLOSE_FLAG_CONTRACTS,Ws as CLOSE_MANY_FLAG_CONTRACTS,ra as CLOSE_TASK_FLAG_CONTRACTS,ls as COMMENTS_FLAG_CONTRACTS,fT as COMMON_MUTATION_COMMAND_OPTION_KEYS,$a as COMPLETION_FLAG_CONTRACTS,Ko as CONFIDENCE_TEXT_VALUES,As as CONFIG_FLAG_CONTRACTS,ed as CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS,ZI as CONTEXT_EVALUATION_METRIC_NAMES,Oa as CONTEXT_FLAG_CONTRACTS,jt as CONTEXT_OUTPUT_VALUES,oM as CONTEXT_PACKING_PROFILES,zI as CONTEXT_RECENCY_EPOCH,WI as CONTEXT_RELEVANCE_SERVICE,VI as CONTEXT_RELEVANCE_SIGNAL_NAMES,sM as CONTEXT_SIGNAL_SET_VERSION,iM as CONTEXT_SIGNAL_STORE_FORMAT_VERSION,aM as CONTEXT_SIGNAL_STORE_WARNING_DETAILS,RS as CONTEXT_USAGE_LIMITS,Da as CONTRACTS_FLAG_CONTRACTS,Ta as COPY_FLAG_CONTRACTS,vd as CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,Pd as CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,Od as CREATE_COMMANDER_STRING_OPTION_CONTRACTS,eT as CREATE_DIRECT_CLOSE_REASON_DEFAULT,ha as CREATE_FLAG_CONTRACTS,Mw as CURRENT_HISTORY_HASH_ALGORITHM,nE as CURRENT_HISTORY_ITEM_HASH_VERSION,sE as CURRENT_HISTORY_RECORD_HASH_VERSION,ni as CURRENT_ITEM_FORMAT_VERSION,pM as ContextSignalStore,IS as ContextUsageValidationError,$I as DEFAULT_AUTHOR_IDENTITY_VOCABULARY,PM as DEFAULT_CHILD_SAMPLE_LIMIT,QS as DEFAULT_COMPACT_LIST_FIELDS,QE as DEFAULT_DERIVED_INDEX_MINIMUM_ITEMS,Lm as DEFAULT_EVAL_QUERIES_RELATIVE_PATH,hR as DEFAULT_RELATIONSHIP_CONTEXT_TOKEN_BUDGET,RI as DEFAULT_TERMINAL_TRANSITION_POLICY,_M as DEFAULT_WORKSPACE_MEMORY_MINIMUM_ITEMS,TO as DEFECT_ESCAPE_CLASSES,CO as DEFECT_GATE_EVIDENCE_DISPOSITIONS,Zs as DELETE_FLAG_CONTRACTS,zo as DEPENDENCY_KIND_VALUES,Ia as DEPS_FLAG_CONTRACTS,fs as DOCS_FLAG_CONTRACTS,ua as DUPLICATES_FLAG_CONTRACTS,VR as DURABLE_MERGE_RECEIPT_INTRODUCED_AT,AO as DefectRecurrencePolicyParseError,ka as EVAL_FLAG_CONTRACTS,Pm as EVAL_METRIC_NAMES,km as EVAL_QUERY_SET_CONTRACT,xm as EVAL_QUERY_SET_EXAMPLE,Mm as EVAL_QUERY_SET_SCHEMA_ID,va as EVENTS_FLAG_CONTRACTS,na as EVENT_FLAG_CONTRACTS,Lo as EXECUTABLE_COMMAND_ALIASES,me as EXIT_CODE,Ds as EXTENSION_ACTIVATE_FLAG_CONTRACTS,Ls as EXTENSION_ADOPT_ALL_FLAG_CONTRACTS,qs as EXTENSION_ADOPT_FLAG_CONTRACTS,i0 as EXTENSION_CAPABILITIES,Zb as EXTENSION_CAPABILITY_CONTRACT,Xb as EXTENSION_CAPABILITY_CONTRACT_VERSION,Jb as EXTENSION_CAPABILITY_LEGACY_ALIASES,wn as EXTENSION_CAPABILITY_REGISTRATION_SURFACES,Bs as EXTENSION_CATALOG_FLAG_CONTRACTS,$s as EXTENSION_DEACTIVATE_FLAG_CONTRACTS,Ns as EXTENSION_DESCRIBE_FLAG_CONTRACTS,js as EXTENSION_DOCTOR_FLAG_CONTRACTS,xs as EXTENSION_EXPLORE_FLAG_CONTRACTS,vs as EXTENSION_FLAG_CONTRACTS,Ps as EXTENSION_INIT_FLAG_CONTRACTS,Ms as EXTENSION_INSTALL_FLAG_CONTRACTS,Gs as EXTENSION_MANAGE_FLAG_CONTRACTS,Fs as EXTENSION_MIGRATE_FLAG_CONTRACTS,s0 as EXTENSION_POLICY_MODES,a0 as EXTENSION_POLICY_SURFACES,Us as EXTENSION_RELOAD_FLAG_CONTRACTS,c0 as EXTENSION_SANDBOX_PROFILES,Os as EXTENSION_SCOPE_FLAG_CONTRACTS,d0 as EXTENSION_TRUST_MODES,ks as EXTENSION_UNINSTALL_FLAG_CONTRACTS,VO as EXTERNAL_DEPENDENCY_RESOLUTION_STATUSES,zO as EXTERNAL_DEPENDENCY_SOURCE_KIND,HO as EXTERNAL_DEPENDENCY_SOURCE_KIND_ALIAS,ms as FILES_FLAG_CONTRACTS,Ca as FOCUS_FLAG_CONTRACTS,la as GC_FLAG_CONTRACTS,ow as GET_DEPTH_VALUES,Pa as GET_FLAG_CONTRACTS,as as GLOBAL_FLAG_CONTRACTS,Tp as GRAPH_DURABLE_CACHE_MIN_ITEMS,bp as GRAPH_DURABLE_CACHE_VERSION,Ma as GRAPH_FLAG_CONTRACTS,wA as GRAPH_QUERY_DEFAULTS,Ge as GRAPH_SUBCOMMAND_VALUES,Ra as GUIDE_FLAG_CONTRACTS,ma as HEALTH_FLAG_CONTRACTS,bs as HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS,uR as HISTORY_AUTHOR_ATTRIBUTION_BASELINE,TI as HISTORY_COMPACT_BULK_DEFAULT_MIN_ENTRIES,Ts as HISTORY_COMPACT_FLAG_CONTRACTS,xi as HISTORY_EVENT_CLASSIFICATION_VERSION,_s as HISTORY_FLAG_CONTRACTS,Rw as HISTORY_HASH_ALGORITHMS,BE as HISTORY_ITEM_HASH_VERSION_3_INTRODUCED_IN,gs as HISTORY_REDACT_FLAG_CONTRACTS,ys as HISTORY_REPAIR_FLAG_CONTRACTS,Jc as INIT_AGENT_GUIDANCE_MODE_VALUES,Es as INIT_FLAG_CONTRACTS,zs as INSTALL_FLAG_CONTRACTS,Vo as ISSUE_SEVERITY_VALUES,ya as ITEM_COMPLETE_FLAG_CONTRACTS,$R as ITEM_LATEST_TIMESTAMP_FIELDS,Qb as ITEM_METADATA_KEY_ORDER,ga as ITEM_MUTATE_FLAG_CONTRACTS,ba as ITEM_REOPEN_FLAG_CONTRACTS,IR as ITEM_SCALAR_MISSING_VALUE,Bo as ITEM_TYPE_VALUES,DR as ITEM_UNION_COLLECTION_FIELDS,lM as JsonFileContextSignalStoreAdapter,us as LEARNINGS_FLAG_CONTRACTS,Iw as LEGACY_HISTORY_HASH_ALGORITHM,nu as LINKED_TEST_ENV_NAME_PATTERN,iu as LINKED_TEST_PM_CONTEXT_MODE_VALUES,ou as LINKED_TEST_PROTECTED_ENV_KEYS,su as LINKED_TEST_WORKSPACE_CONTEXT_MODE_VALUES,Ja as LIST_COMMANDER_STRING_OPTION_CONTRACTS,tw as LIST_COMMAND_DEFAULT_PROJECTIONS,p0 as LIST_FILTER_EXTENSION_FLAG_DEFINITIONS,ds as LIST_FILTER_FLAG_CONTRACTS,eP as LIST_SORT_FIELDS,tP as LIST_SORT_ORDER_VALUES,Ni as MAINTENANCE_HISTORY_OPERATIONS,OM as MAX_CHILD_PROJECTION_ITEMS,AT as MAX_WORKFLOW_POLICIES,vT as MAX_WORKFLOW_POLICY_TERMS,oa as MEET_FLAG_CONTRACTS,WM as MERGE_DRIVER_ARTIFACT_VALUES,hs as MERGE_FLAG_CONTRACTS,Ue as MERGE_SUBCOMMAND_VALUES,JM as MUTATION_EVENT_WIRE_BUDGET,se as MemoryRelationshipGraphAdapter,td as NEXT_COMMANDER_STRING_OPTION_CONTRACTS,Na as NEXT_FLAG_CONTRACTS,Ju as NEXT_OUTPUT_VALUES,ps as NOTES_FLAG_CONTRACTS,uA as OutputEnvelopeFitError,Rs as PACKAGE_FLAG_CONTRACTS,Is as PACKAGE_INIT_FLAG_CONTRACTS,ta as PAUSE_TASK_FLAG_CONTRACTS,Zd as PLAN_CREATE_METADATA_PARAMETER_KEYS,ws as PLAN_FLAG_CONTRACTS,sm as PLAN_SHOW_DEPTH_VALUES,Ye as PLAN_SUBCOMMANDS,am as PLAN_TEMPLATE_NAMES,$y as PM_AGENT_TASK_ACCOUNTING_MODES,ut as PM_AGENT_TASK_TRANSCRIPT_VERSION,Mo as PM_BULK_LIFECYCLE_COMMAND_ALIASES,ji as PM_CLI_EXPECTED_ERROR_NAME,RA as PM_CLI_GRAMMAR_CONTRACT,EA as PM_CLI_GRAMMAR_NOUNS,pn as PM_CLI_ONLY_TOOL_ACTION_WAIVERS,AA as PM_CLI_SHARED_VERBS,No as PM_COMMAND_ALIAS_CONTRACTS,te as PM_COMMAND_CAPABILITY_CONTRACTS,vt as PM_COMMAND_DESTINATION_CONTRACTS,gP as PM_COMMAND_EXIT_CONTRACTS,hP as PM_COMMAND_EXIT_OUTCOME_CONTRACTS,Bn as PM_COMMAND_OUTPUT_BUDGET_CONTRACTS,mP as PM_COMMAND_OUTPUT_ENVELOPE_CONTRACTS,qe as PM_COMMAND_POSITIONAL_CONTRACTS,Tc as PM_COMMAND_VISIBILITY_CONTRACTS,sR as PM_COMPLETE_LIST_FINDING_CODES,lw as PM_CONTEXT_INTENTS_FILE,US as PM_CONTEXT_INTENT_CONTRACTS,Io as PM_CONTEXT_OPS_COMMAND_ALIASES,an as PM_CORE_COMMAND_NAMES,G as PM_CORPUS_SHAPE_SCHEMA,mn as PM_DEPRECATED_TOOL_ACTIONS,$n as PM_DIAGNOSTIC_DEGRADATION_STEPS,Fn as PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS,Dn as PM_DIAGNOSTIC_OUTPUT_CLASSES,fn as PM_DISCOVERABLE_TOOL_ACTIONS,Kr as PM_EPISODE_SCHEMA,pP as PM_ERROR_CODE_CATALOG,aP as PM_ERROR_CODE_EXIT_CLASS_CONTRACTS,Qr as PM_EXACT_COVERAGE_METRICS,en as PM_EXTENSION_CAPABILITY_CONTRACTS,dn as PM_EXTENSION_PACKAGE_ACTION_SUBCOMMANDS,rn as PM_EXTENSION_POLICY_MODE_CONTRACTS,sn as PM_EXTENSION_POLICY_SURFACE_CONTRACTS,nn as PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS,tn as PM_EXTENSION_SERVICE_NAME_CONTRACTS,on as PM_EXTENSION_TRUST_MODE_CONTRACTS,JP as PM_GITATTRIBUTES_END,XP as PM_GITATTRIBUTES_START,QP as PM_GITATTRIBUTES_V2_END,ZP as PM_GITATTRIBUTES_V2_START,Pc as PM_GITIGNORE_END,Oc as PM_GITIGNORE_START,EI as PM_HISTORY_ATTESTATION_CONTRACT,Ro as PM_HISTORY_COMMAND_ALIASES,ww as PM_HISTORY_OPERATION_ALIASES,Aw as PM_HISTORY_OPERATION_CONTRACT,Ew as PM_HISTORY_OPERATION_PATTERNS,ln as PM_ITEM_ACTION_SUBCOMMANDS,Cw as PM_ITEM_HISTORY_OPERATIONS,it as PM_MCP_APPS_EXTENSION,Ir as PM_MCP_APPS_SERVER_CAPABILITY,Ae as PM_MCP_APPS_SPEC_VERSION,xr as PM_MCP_APP_CONTRACTS,kr as PM_MCP_APP_MIME_TYPE,Rb as PM_MCP_ENTRY_TOOL_NAMES,m as PM_MCP_ERROR_CODES,Sx as PM_MCP_HTTP_PROTOCOL_VERSION,Wh as PM_MCP_INPUT_REQUEST_METHODS,rr as PM_MCP_LEGACY_PROTOCOL_VERSIONS,tr as PM_MCP_LOG_LEVELS,E as PM_MCP_META_KEYS,A1 as PM_MCP_PROGRESSIVE_DISCOVERY_EXTENSION,v1 as PM_MCP_PROGRESSIVE_DISCOVERY_SERVER_CAPABILITY,Ac as PM_MCP_PROMPT_CONTRACTS,H as PM_MCP_PROTOCOL_VERSION,Ec as PM_MCP_RESOURCE_CONTRACTS,at as PM_MCP_SKILLS_DRAFT_REVISION,Nr as PM_MCP_SKILLS_EXTENSION,ey as PM_MCP_SKILLS_SERVER_CAPABILITY,I as PM_MCP_SKILL_LIMITS,we as PM_MCP_SUBSCRIPTION_ID_META_KEY,re as PM_MCP_SUPPORTED_PROTOCOL_VERSIONS,fx as PM_MCP_TASKS_EXTENSION,ig as PM_MCP_TASK_STATUSES,he as PM_MCP_TOOL_COMMAND_CONTRACTS,OC as PM_MODE_PAIRED_OUTPUT_PROJECTION_CONTRACTS,md as PM_MUTATION_ACTION_CONTRACTS,Ne as PM_NAMESPACED_COMMAND_ALIASES,Hr as PM_OBSERVATION_SCHEMA,Ln as PM_OUTPUT_BUDGET_CLASSES,Nn as PM_OUTPUT_DEGRADATION_STEPS,kt as PM_OUTPUT_ENVELOPE_KINDS,$t as PM_PACKAGE_CONVENTIONAL_RESOURCE_ROOTS,cn as PM_PACKAGE_ONLY_ACTION_SUBCOMMANDS,Dt as PM_PACKAGE_RESOURCE_KINDS,Be as PM_POSITIONAL_ACTION_CONTRACTS,sc as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA,nc as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION,rS as PM_READ_OUTPUT_COMPOSITION_OPTION_FLAGS,fS as PM_READ_OUTPUT_CONTINUATION_FINGERPRINT_POLICIES,eS as PM_READ_OUTPUT_DIMENSIONS,tS as PM_READ_OUTPUT_OPTION_FLAGS,YC as PM_READ_OUTPUT_SESSION_MAX_SEEN_ITEM_IDS,WC as PM_READ_OUTPUT_SESSION_MIN_TOKENS,LT as PM_READ_OUTPUT_SURFACES,oS as PM_READ_OUTPUT_SURFACE_CONTRACTS,vC as PM_READ_ROW_CONTRACTS,AC as PM_READ_ROW_JQ_SELECTOR,_L as PM_RECOVERY_REFERENCE_FIELDS,ce as PM_RECOVERY_REFERENCE_KINDS,ab as PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE,lo as PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE_V2,SL as PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE,co as PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE_V2,ko as PM_RELOCATED_COMMAND_ALIASES,ad as PM_REPRODUCIBLE_PROCESS_ENV,yP as PM_SUCCESS_EXIT_CODES,un as PM_TOOL_ACTIONS,ec as PM_TOOL_ACTION_PARAMETER_CONTRACTS,ic as PM_TOOL_PARAMETERS_SCHEMA,oc as PM_TOOL_PARAMETERS_SCHEMA_MAJOR,rc as PM_TOOL_PARAMETERS_SCHEMA_VERSION,Xd as PM_TOOL_RESERVED_CUSTOM_FIELD_PROPERTIES,Vr as PM_VERDICT_SCHEMA,Sw as PM_WORKSPACE_HISTORY_OPERATIONS,qr as PM_WORKSPACE_RECIPE_SCHEMA,Ss as PROFILE_FLAG_CONTRACTS,Jt as PROFILE_LINT_CODES,Xt as PROFILE_LINT_DIMENSIONS,qt as PROFILE_NAMES,Xe as PROFILE_SUBCOMMANDS,b as PmCliError,ge as PmClient,aR as PmCompleteListValidationError,y as PmMcpAuthorizationError,or as PmMcpInputRequiredError,Ar as PmMcpIssuerCredentialStore,u as PmMcpProtocolError,nr as PmMcpRequestStateReplayGuard,Ur as PmMcpSkillRegistry,_r as PmMcpSubscriptionRegistry,ot as PmMcpTaskStore,vS as QUERY_CURSOR_CONTRACT,Vs as REINDEX_FLAG_CONTRACTS,kv as REINDEX_LOCK_ID,pt as RELATIONSHIP_GRAPH_SNAPSHOT_VERSION,Qs as RELEASE_FLAG_CONTRACTS,ia as REMIND_FLAG_CONTRACTS,At as RESERVED_ITEM_FIELD_NAMES,Js as RESTORE_FLAG_CONTRACTS,Ho as RISK_VALUES,fA as RelationshipEventLog,_A as RelationshipEventStore,z as RelationshipGraph,De as RelationshipKindRegistry,Cs as SCHEMA_FLAG_CONTRACTS,Za as SEARCH_COMMANDER_STRING_OPTION_CONTRACTS,u0 as SEARCH_EXTENSION_FLAG_DEFINITIONS,La as SEARCH_FLAG_CONTRACTS,Eu as SEMANTIC_ATTRIBUTION_LIMITS,rT as SETTINGS_DEFAULTS,Um as SNAPSHOT_SCHEMA,KP as SOURCE_CONTEXT_ACCESS_ENV,WP as SOURCE_CONTEXT_WRITE_OVERRIDE_ENV,ea as START_TASK_FLAG_CONTRACTS,pa as STATS_FLAG_CONTRACTS,qo as STATUS_VALUES,ss as SUBCOMMAND_GLOBAL_FLAG_CONTRACTS,Li as SUBSTANTIVE_HISTORY_OPERATIONS,iE as SUPPORTED_HISTORY_ITEM_HASH_VERSIONS,aE as SUPPORTED_HISTORY_RECORD_HASH_VERSIONS,nT as SUPPRESS_HOST_OUTPUT_MARKER,da as TELEMETRY_FLAG_CONTRACTS,_f as TELEMETRY_SUBCOMMANDS,aa as TEST_ALL_FLAG_CONTRACTS,sa as TEST_FLAG_CONTRACTS,ca as TEST_RUNS_FLAG_CONTRACTS,lf as TEST_RUN_MEASUREMENT_LIMIT,Vd as TOOL_ACTIVITY_OPTION_CONTRACTS,Nd as TOOL_AGGREGATE_OPTION_CONTRACTS,Bd as TOOL_BULK_MUTATION_FILTER_OPTION_CONTRACT_SOURCE,Hd as TOOL_CALENDAR_OPTION_CONTRACTS,zd as TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS,Kd as TOOL_CONTEXT_OPTION_CONTRACTS,Gd as TOOL_CREATE_OPTION_CONTRACTS,Fd as TOOL_CREATE_OPTION_CONTRACT_SOURCE,Wd as TOOL_DEPS_OPTION_CONTRACTS,Yd as TOOL_GRAPH_OPTION_CONTRACTS,xd as TOOL_LIST_FILTER_OPTION_CONTRACTS,Ld as TOOL_SEARCH_FILTER_OPTION_CONTRACTS,$d as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS,Dd as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACT_SOURCE,qd as TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS,jd as TOOL_UPDATE_OPTION_CONTRACTS,Ud as TOOL_UPDATE_OPTION_CONTRACT_SOURCE,tT as TYPE_TO_FOLDER,nv as UNKNOWN_SUBCOMMAND_COMPATIBILITY_CODES,Rd as UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,Md as UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,Id as UPDATE_COMMANDER_STRING_OPTION_CONTRACTS,Sa as UPDATE_FLAG_CONTRACTS,wa as UPDATE_MANY_FLAG_CONTRACTS,Hs as UPGRADE_FLAG_CONTRACTS,fa as VALIDATE_FLAG_CONTRACTS,ET as WORKFLOW_POLICY_ACTIONS,rR as WORKFLOW_POLICY_DOCUMENT_SCHEMA,tR as WORKFLOW_POLICY_SCHEMA,xa as WORKSPACE_FLAG_CONTRACTS,yE as WORKSPACE_HISTORY_ID,jm as WORKSPACE_SNAPSHOT_ACTIONS,wl as WorkspaceGraphCache,TA as WorkspaceTransactionInterruptedError,Wp as _testOnly,vM as _testOnlyAggregateCommand,Cl as _testOnlyConfigCommand,kM as _testOnlyGetCommand,Np as _testOnlyHealthCommand,tl as _testOnlyInit,Zc as _testOnlyInitAgentGuidance,B0 as _testOnlyItemTransaction,t0 as _testOnlyMutationEvents,wM as _testOnlyNextCommand,KM as _testOnlySearchCommand,yR as _testOnlySimilarity,um as _testOnlyTemplates,Hp as _testOnlyValidateCommand,n0 as _testOnlyWorkspacePosition,ER as acceptAssuranceProposals,qp as acknowledgeLinkedTests,yl as acknowledgeUnknownAuthorHistoryEvents,gl as acknowledgeUnknownAuthorHistoryEventsFromTransport,eA as acquireItemMetadataDerivedIndexLock,je as acquireLock,Xn as acquireLockLease,nk as activateExtensionForTest,eC as activateExtensions,hi as agentSessionEnvironment,h_ as aggregate,Zm as analyzeAgentProvenanceDescriptorCoverage,wO as analyzeDefectChangeRisk,mI as analyzeDefectRecurrenceCoverage,Vl as analyzeDuplicateItems,gA as analyzeGraphImpact,lc as analyzeHierarchyIntegrity,yA as analyzeKnowledgeGraph,TP as analyzePmCommandExitConformance,_n as analyzePmToolActionParity,eI as analyzeReconciliationDiscard,hA as analyzeRelationshipExecution,pp as analyzeRelationshipSchedule,Uh as analyzeSdkActionCoverage,It as analyzeSdkCliParameterCompleteness,P_ as append,Fi as appendHistoryEntry,SE as appendWorkspaceAuditEvent,CE as appendWorkspaceHistoryChange,GA as applyAcceptanceCriteriaMutations,SR as applyAssurancePreset,za as applyBootstrapPagerPolicy,dI as applyClosureTimestampFix,HS as applyContextIntentProjection,Xu as applyContextTagProjection,rP as applyFilterValueEcho,xE as applyHistoryPatch,sd as applyInvocationAuthorOverride,kl as applyPathMigrations,pS as applyReadOutputDimensions,aS as applyReadOutputIncludeModes,JC as applyReadOutputSessionReferences,GE as applyRegisteredItemFieldDefaultsAndValidation,Dl as applyStandaloneNote,ts as applyStoredExtensionMigrationState,jA as applyTagRemovals,xI as applyTerminalOrderingPolicy,$l as artifactKey,mT as asRecordClone,uT as asRecordOrNull,He as assembleWorkspaceRelationshipGraph,pR as assertCompleteListResult,Fk as assertExtensionBlueprint,$k as assertExtensionCapabilityUsage,bk as assertExtensionDeactivated,jk as assertExtensionManifestCompatible,Uk as assertExtensionManifestMatchesBlueprint,Bk as assertExtensionPreflight,mc as assertHierarchyMutationAllowed,CI as assertHistoryCompactTarget,rI as assertHistoryRepairTarget,ei as assertInitializedTracker,xl as assertLinkedArtifactMutationIsUnambiguous,Hk as assertMcpClientCapabilities,zk as assertMcpProtocolHeader,Dy as assertMemoryRelationshipGraphAdapterConformance,zA as assertNoUnknownCsvKeys,ru as assertNonHierarchyCardinalityMutationAllowed,Tk as assertPackageManifest,gv as assertParentReferenceIsNotSelf,Zx as assertPmMcpSkillsCapability,Gk as assertProjectProfile,YE as assertProjectRuntimeCompatibility,VE as assertProjectRuntimeFormatGuard,PC as assertProjectionModeChoice,Qn as assertReadableTrackerRoot,Ck as assertRegisteredCommandContract,Mk as assertRegisteredCommandOverride,Ok as assertRegisteredExporter,Sk as assertRegisteredFlags,wk as assertRegisteredHook,vk as assertRegisteredImporter,Pk as assertRegisteredItemField,Rk as assertRegisteredItemType,Dk as assertRegisteredMigration,kk as assertRegisteredParserOverride,xk as assertRegisteredPreflightOverride,Ik as assertRegisteredProfile,Nk as assertRegisteredRendererOverride,Ek as assertRegisteredSearchProvider,Lk as assertRegisteredServiceOverride,Ak as assertRegisteredVectorStoreAdapter,Wb as assertRelationshipEdgeAllowed,ro as assertRelationshipGraphAdapterConformance,$A as assertSchemaPreviewSupported,yf as assertTestMeasurementRun,IP as assuranceAssertionUpdateIsLoosening,WS as attachContextIntentReceipt,MS as attachContextUsageServingReceipt,Gp as attachLinkedTestMutationProvenance,Fp as attachLinkedTestProvenance,Ze as attachMcpServerInfo,NC as attachOutputOmissionReceipt,XS as attachOutputTokenAccounting,YS as attachReadOutputContracts,ZC as attachReadOutputSessionReceipt,Lc as auditMergeAttributeFence,eR as auditMergeDriverConfiguration,gp as auditWorkspaceRelationshipGraph,$x as authorizeMcpHttpRequest,fi as boundAgentEpisodeIdentity,qC as boundReadOutputRows,Vu as buildChildrenByParent,jM as buildCompactSearchFilterSummary,oP as buildContentFilterEcho,cM as buildContextSignalSnapshot,by as buildCorpusShapeItemPlan,SO as buildDefectRecurrenceIndex,Hc as buildExtensionDescribeResult,Kc as buildExtensionInstallPlan,nP as buildGovernanceMissingFilterEcho,Av as buildInvalidTypeError,RM as buildItemChildrenRollup,U0 as buildItemCompletionMutations,KI as buildItemContextRelevanceCandidates,sA as buildItemNotFoundError,MM as buildItemSchedule,cI as buildLinkedFileRepairReport,Px as buildMcpAuthorizationDiscoveryUrls,zh as buildMcpCompleteResult,Kk as buildMcpDiscoverResult,xx as buildMcpDynamicRegistrationMetadata,Tx as buildMcpHttpRequestHeaders,tx as buildMcpInputRequiredResult,Ox as buildMcpProtectedResourceMetadata,xc as buildMergeAttributePatterns,tc as buildPmActionToolInputSchema,AL as buildPmRefusalClosureCensus,gR as buildRelationshipContext,Dv as buildSearchCorpus,Fv as buildSemanticCorpusInput,iI as buildStatusRoleWarnings,Zn as buildTrackerInitializationRecovery,qv as buildVectorizationEmbeddingIdentity,zv as buildVectorizationEmbeddingMetadata,BM as buildVerboseSearchFilters,oR as buildWorkflowCompletenessCheck,hM as buildWorkspaceMemorySnapshot,mi as canonicalDocument,_T as canonicalizeCommandOptionKey,w0 as canonicalizeCommandSuggestions,HI as canonicalizeContextRecencyCoordinate,Hb as canonicalizeRelationshipKind,hL as censusPmRecoveryReferenceProducers,lR as certifyCompleteListResult,ek as checkExtensionManifestCompatibility,ph as claim,uh as claimNext,mR as classifyHistoryAuthorEvent,Di as classifyHistoryEvent,ZR as classifyHistoryMergeReceiptReferences,UT as classifyHostEnvironmentFault,zM as classifyImplicitSemanticFallbackReason,ai as classifyItemFormatVersion,Tf as classifyLinkedTestCommandSafety,Cf as classifyLinkedTestFailure,gC as clearActiveExtensionHooks,Ap as clearDurableGraphCache,Vw as clearFocusedItem,Pf as clearWorkspaceContractsCache,lh as close,Jp as closeItem,Th as closeTask,Ka as coalesceRepeatedListFlags,IO as collectBlockedByIds,kO as collectBlockedByIdsFromCorpus,xS as collectContextUsageDeliveredItemIds,gc as collectDanglingDependencyReferences,NO as collectDependencyBlockedIds,_c as collectDuplicateDependencyRows,hp as collectDuplicateRelationshipEdgeGroups,qM as collectErrorCauseCodes,cc as collectHierarchyRelations,Cr as collectMcpHeaderAnnotations,yc as collectMissingDependencyTargetIds,tu as collectNewOrderingCycleWarnings,mp as collectOrderingCycles,hc as collectOrderingStorageContradictions,mw as collectPackageContextIntentContracts,Gt as collectPackageExtensionDirectories,$E as collectRegisteredItemFieldNames,Fw as collectRuntimeCreateFieldValues,vv as collectRuntimeFilterValues,Gw as collectRuntimeUpdateFieldValues,ju as collectSubtreeIds,En as collectUsedExtensionCapabilities,hT as commandOptionFlagLabel,b_ as comments,Zf as commitImportedItem,j0 as commitItemCompletion,G0 as commitItemMutations,SA as commitWorkspaceTransaction,is as compactFlagAliasContracts,Bu as compareCriticalItems,qE as comparePmDateVersions,bA as compareRelationshipSnapshots,OS as compareTimestampStrings,BI as compileHistoryProvenanceMatcher,qS as composeContextIntentContracts,K0 as composeExtension,Q0 as composeExtensionPackage,DO as computeActionabilityReport,uv as computeHistoryDiff,cp as computeRelationshipCentrality,dp as computeRelationshipDominators,Sl as computeWorkspaceGraphFingerprint,I_ as config,hC as consumeAfterCommandAffectedItems,l_ as context,KS as contextIntentRowId,fh as copy,Sf as countFailureCategories,jC as countReadOutputRows,ah as create,CR as createAssurancePreset,pI as createAssuranceWorkspaceContext,ev as createCheckpointId,dR as createCompleteListOptions,tC as createCoreCommandHookContext,Zr as createCorpusShapeMeasurement,LP as createEmptyAssuranceDocument,$T as createEmptyExtensionRegistrationRegistry,Zi as createExtensionCommandSdk,Sn as createExtensionContributionInventory,qk as createExtensionTestHarness,$i as createHistoryEntry,dO as createLazyModule,nR as createLifecycleCompletenessPolicies,Fx as createMcpStaticBearerVerifier,_x as createMcpTaskStore,iA as createMutationGuardSdk,RC as createOutputOmissionReceipt,qi as createPmCliExpectedError,Jn as createPmCliProgram,Un as createPmCommandOutputBudget,bS as createQueryFingerprint,Ly as createRelationshipGraphScaleFixture,Z as createRelationshipGraphSnapshot,yt as createRelationshipKindRegistry,cd as createReproducibleProcessRunner,GM as createSearchCursorFingerprint,rC as createSerialQueue,XA as createStdinTokenResolver,iv as createUnknownSubcommandError,NT as createWorkflowPolicyEvaluator,Bm as createWorkspaceSnapshot,ik as deactivateExtensionForTest,mD as declineServiceOverride,VS as decodeContextIntentCursor,aO as decodeHtmlEntitiesInOptions,Tr as decodeMcpHttpHeaderValue,ZS as decodePmTableRows,wS as decodeQueryCursor,CS as decodeQueryCursorEnvelope,SS as decodeQueryCursorState,gS as decodeReadOutputContinuationCursor,rk as decodeToon,qx as decoratePmMcpToolsWithApps,Gl as dedupeLinkedArtifacts,YI as defaultScoreContextCandidates,bD as defineAfterCommandHook,gD as defineBeforeCommandHook,yD as defineBeforeMutationHook,tD as defineCommand,dD as defineCommandOverride,W as defineCorpusShape,dN as defineEpisodeSpecification,hD as defineExporter,H0 as defineExtension,V0 as defineExtensionBlueprint,QL as defineExtensionManifest,rD as defineFlag,_D as defineImporter,nD as defineItemField,oD as defineItemType,iD as defineMigration,cy as defineObservationContract,SD as defineOnIndexHook,CD as defineOnReadHook,TD as defineOnWriteHook,cD as defineParserOverride,jn as definePmCommandOutputBudget,uP as definePmCommandOutputEnvelope,dP as definePmErrorCodeCatalog,lD as definePreflightOverride,eD as defineProjectProfile,fD as defineRendererOverride,sD as defineSearchProvider,pD as defineServiceOverride,aD as defineVectorStoreAdapter,my as defineVerdictContract,ve as defineWorkspaceRecipe,_h as deleteItem,Wm as deleteWorkspaceSnapshot,Yb as dependencyToRelationship,v_ as deps,wR as deriveAssuranceProposals,sI as deriveClosureTimestamp,Y0 as deriveExtensionCapabilities,P0 as deriveMutationTransactionId,CP as derivePmBulkMutationEffect,gL as derivePmRecoveryReferenceObligations,up as deriveRelationshipDeadlines,Gc as deriveSchemaEvolutionMigrationId,Qv as deriveTelemetryCommandResolution,Iv as describeAllowedTransitions,VP as describeExtensionActivation,X0 as describeExtensionBlueprint,WT as describeFlagScalarValueFailure,Ru as describeItemOwnershipConflict,aN as describeObservationCost,Wt as describeProfileComposition,Yt as describeProjectProfile,hw as describeUnknownError,vi as detectAgentIdentity,Ii as detectHarnessIdentity,sp as detectRelationshipCommunities,Oi as diagnoseAgentIdentity,yp as diffRelationshipAuditSnapshots,mf as diffTestRunMeasurements,nx as digestMcpRequestParameters,ZT as discoverExtensions,Xo as discoverNearbyPmRoot,P1 as discoverPmTools,HE as discoverProjectRuntimeVersionPins,A_ as docs,y_ as duplicates,Cp as durableGraphCachePath,vp as durableGraphCacheStatus,ii as effectiveItemFormatVersion,gO as emitTelemetryErrorEvent,Jf as emptyImportedDocument,kR as encodeItemScalarDecisionValue,br as encodeMcpHttpHeaderValue,JS as encodePmTableRows,TS as encodeQueryCursor,hS as encodeReadOutputContinuationCursor,ok as encodeToon,UE as enforceHistoryStreamPolicyForItem,jE as enforceHistoryStreamPolicyForItems,iP as enrichCliFlagInvocationContract,Mt as enrichCliFlagInvocationContracts,LE as ensureMaterializedHistoryTarget,Ic as ensurePmGitignore,Ol as ensureScope,Zv as ensureSentryCommandTracing,Jv as ensureSentryInit,Xf as ensureTrackerInitialized,np as enumerateRelationshipPaths,zn as estimatePmOutputTokens,$P as evaluateAssuranceAssertion,FP as evaluateAssuranceGate,vN as evaluateBoundaryFixtures,QI as evaluateContextRanking,EO as evaluateDefectGateEvidence,DP as evaluateMeasurement,Im as evaluateMetricFloors,_d as evaluateMutationGuard,nf as evaluateProvenanceCoverage,UD as evaluateReliabilityWindow,tf as evaluateSemanticAttributionCoverage,Wl as evaluateSimilarityGovernance,Rv as evaluateTransition,fy as evaluateVerdictContract,xT as evaluateWorkflowPolicies,ud as executeEmbeddingBatchesWithRetry,jv as executeVectorDelete,Bv as executeVectorReset,Uv as executeVectorUpsert,iy as executeWorkspaceRecipe,Ll as expandAddGlobEntries,Xl as explainSourceTraceability,vI as exportAttestation,Ch as extension,wh as extensionActivate,Eh as extensionDeactivate,Sh as extensionList,Tb as extensionMigrate,JR as extractHistoryMergeReceiptDispositions,XR as extractHistoryMergeReceiptReferences,Nx as extractMcpTraceContext,ME as extractPatchFailureContext,Lp as extractReferencedPmItemIdsFromCommand,Ny as federateRelationshipGraphSnapshots,S_ as files,w_ as filesDiscover,E_ as filesLookup,NS as finalizeContextUsageDelivery,Ay as findCoverageDeficits,Kl as findDuplicateClusters,kc as findGitWorkspaceRoot,Xw as findHistoryIdentityDiscontinuities,qc as findInstalledNpmPackageCandidate,Bx as findPmMcpAppByUri,xo as findPmNamespacedCommand,ap as findRedundantRelationshipEdges,lp as findRelationshipCutStructure,Hl as findSimilarItems,hO as finishTelemetryCommand,mA as fitOutputEnvelope,KT as flattenFlagListValue,Sy as flushTelemetryQueue,gh as focus,ip as forEachMatchedRelationshipEdge,_p as formatDuplicateEdgeGroup,pc as formatHierarchyRelation,fp as formatOrderingStorageContradiction,PA as formatPmPositionalActionFlagTip,Em as formatProfileApplyHuman,wm as formatProfileLintHuman,Cm as formatProfileListHuman,Sm as formatProfileShowHuman,Bc as formatSchemaEvolutionMigrationHuman,VM as formatVectorIndexRecoveryWarnings,o0 as formatWorkspacePositionHuman,th as gc,Ki as generateItemId,f_ as get,mC as getActiveCommandResult,jS as getActiveContextIntentContracts,vn as getActiveExtensionRegistrations,Dx as getActiveMcpTraceContext,UP as getAssuranceDeclaration,$h as getContracts,zw as getFocusedItem,Qo as getHistoryPath,pA as getItemAt,Zo as getItemPath,yd as getMutationActionContract,Rc as getPmGitignoreBlock,Jo as getSettingsPath,Rf as getWorkspaceContracts,bE as getWorkspaceHistoryPath,O_ as graph,Sp as graphAuditBaselinePath,rf as groupHistoryByEpisode,uD as handleServiceOverride,Vk as hasMcpClientExtension,jx as hasPmMcpAppsCapability,ze as hasSubcommandFlagContractsForCommand,Hv as hasVectorizationEmbeddingIdentityChanged,Vv as hasVectorizationVectorDimensionChanged,_E as hashDocument,hE as hashDocumentForVersion,gE as hashEmptyDocument,cE as hashHistoryPatch,dE as hashHistoryRecord,lE as hashHistoryStream,xR as hashItemScalarDecisionValue,eh as health,ep as hierarchyAncestors,tp as hierarchyDescendants,ih as historyCompact,sh as historyCompactBulk,xw as historyDigest,jI as historyEntryMatchesProvenance,zE as historyItemHashVersionForRuntime,rh as historyRedact,oh as historyRepair,nh as historyRepairAll,MO as indexBlockedByIds,uc as indexHierarchyRelations,Kv as inferConsistentVectorDimension,Gn as inferPmOutputBudgetClass,R_ as init,cR as inspectCompleteListResult,FT as inspectExtensionManifestSchema,ul as inspectHistoryAuthorStream,jR as inspectMergeReceiptEvidence,WE as inspectProjectRuntimeCompatibility,Ed as inspectStaleInProgressItems,jh as inspectStaticExtensionInventory,nI as inspectStatusRoleAssignments,TE as inspectWorkspaceHistoryState,qm as inspectWorkspaceSnapshot,Fc as installMergeFence,Wk as interpretMcpResultType,Qu as isAlreadyClaimedError,bw as isCommanderError,h0 as isCompatibleRecoveryFlag,al as isErrnoError,yO as isExternalDependencyReference,bO as isExternalDependencySourceKind,fe as isFileMissingError,sT as isHostOutputSuppressed,Bi as isItemAlreadyExistsError,MR as isItemScalarMissingValue,KR as isLegacyMergeReceiptSummary,h as isMcpRecord,hd as isMutationAction,Kb as isOrderingRelationshipKind,_v as isPlaceholderReferenceToken,zi as isPmCliExpectedError,gn as isPmExtensionCapabilityContract,bn as isPmExtensionPolicyModeContract,Tn as isPmExtensionPolicySurfaceContract,yn as isPmExtensionServiceNameContract,bP as isPmKnownExitCode,fP as isPmMutationReceipt,We as isPmSuccessfulExitCode,Ui as isPmTokenBudgetRecovery,hn as isPmToolAction,WR as isPreDurableCloneLocalReceiptSummary,YR as isPreDurableDispositionEligibleReference,KE as isProjectMutatingInvocation,cO as isPureSnakeCaseAlias,uS as isReadOutputBudgetExceeded,KC as isReadOutputSessionReference,_0 as isReadProjectionRecoveryFlag,MC as isReadRowContract,ac as isRuntimeRecord,uO as isTerminalPlanMode,jw as isTerminalStatus,Yn as isTimestampLiteral,x0 as itemDocumentToMutationOptions,IM as itemHasSchedule,Rn as jaccardSimilarity,C_ as learnings,DT as levenshteinDistanceWithinLimit,nl as limitAnnotationEntries,Up as linkedTestTrustFingerprint,J0 as lintExtensionBlueprint,GT as lintExtensionManifestSchema,Zt as lintProjectProfile,p_ as list,Ci as listAgentProvenanceAdapters,Va as listAliasPluralKeys,u_ as listAllComplete,oA as listAllDocumentCandidatesCached,Ji as listAllItemMetadata,nA as listAllItemMetadataLight,GP as listAssuranceDeclarations,HP as listAssuranceVerdicts,gy as listBuiltinCorpusShapes,E0 as listCoreClosedDomainContracts,nw as listGetProjectionFields,PR as listInvalidProvenanceHistoryStreamIds,rw as listListProjectionFields,BR as listMergeReceipts,gd as listMutationActions,ZM as listMutationEvents,fo as listPmCommandFlagBudgets,Sc as listPmCommandsForFamily,Cc as listPmCommandsForTier,Me as listPmFlagLexicon,YL as listPmFlagSpellingInventory,wc as listPmMcpToolsForProfile,FL as listPmRequiredArgumentRefusalContracts,GL as listPmSubcommandRefusalContracts,Kt as listProfiles,BL as listTrackerPreflightRecoveryContracts,D0 as listUpsertKeyCandidates,zm as listWorkspaceSnapshots,fw as loadContextIntentRuntimeLayers,mm as loadCreateTemplateOptions,QT as loadExtensions,Pp as loadGraphAuditBaseline,$0 as loadGuardedRuntimeSchema,rv as loadMutationCheckpoint,x as loadRelationshipGraphAdapter,Yi as locateItem,qA as looksLikeGenericKeyValueEntry,BC as mapReadOutputRows,qR as markMergeReceiptReconciled,Ov as matchesRuntimeFilters,fO as maybeRunFirstUseTelemetryPrompt,Ty as measureCorpusShapePlan,Wi as measureItemMetadataReadWork,UA as mergeAdditiveTags,W0 as mergeExtensionBlueprints,NR as mergeHistoryStreams,FR as mergeItemDocuments,GR as mergeJsonDocuments,Wa as mergeLinkedTestTwoTokenEntries,LR as mergeRelationshipEventStreams,Wu as mergeSortedWarnings,pO as migrateItemFilesToFormat,dA as mutateItem,aA as mutateItemWithHistoryContext,wE as mutateWorkspaceJsonWithHistory,__ as next,wi as normalizeAgentProvenanceAdapterValue,ol as normalizeAnnotationTransportOptions,vP as normalizeAssuranceEvaluation,AP as normalizeAssuranceMutation,Ya as normalizeBootstrapInvocation,cv as normalizeBulkIdsValue,fc as normalizeDependencyGraphTarget,XO as normalizeDependencySeedId,YO as normalizeDependencySourceKind,Cn as normalizeExtensionContributionInventory,Pw as normalizeHistoryOperationForWrite,OR as normalizeInvalidHistoryProvenance,DA as normalizeItemAddressInvocation,si as normalizeItemFormatVersion,Vi as normalizeItemId,li as normalizeItemMetadata,JO as normalizeItemReference,Ha as normalizeLegacyExtensionActionSyntax,Nl as normalizeLinkedPath,fv as normalizeParentReferenceValue,Ht as normalizeProfileName,Hi as normalizeRawItemId,dS as normalizeReadOutputIncludeModeOptions,eE as normalizeReplayPatchOps,bd as normalizeSimilarityText,Uw as normalizeStatusForRegistry,ci as normalizeStatusInput,Lw as normalizeStatusInputWithRegistry,yw as normalizeThrownExitCode,T_ as notes,Wn as nowIso,wp as openDurableGraphCache,ox as openMcpRequestState,cN as openPmEpisode,rp as orderingPredecessors,op as orderingSuccessors,nM as packContextCandidates,qu as packRankedContextItems,Nh as packageActivate,xh as packageCatalog,Lh as packageDeactivate,Mh as packageDescribe,Rh as packageDoctor,Oh as packageInstall,Ah as packageLifecycle,vh as packageList,Ih as packageManage,Cb as packageMigrate,kh as packageReload,Ph as packageUninstall,AS as paginateQueryRows,Pl as parseAddEntries,Rl as parseAddGlobEntries,sl as parseAnnotationTextInput,R0 as parseAtomicMutationControls,qa as parseBootstrapCommandName,Ua as parseBootstrapGlobalOptions,Ba as parseBootstrapHelpRequest,Xa as parseBootstrapTypeValue,dv as parseBulkIdsText,Gu as parseContextDepth,Lu as parseContextFocusFields,pw as parseContextIntentDeclarations,Uu as parseContextSections,dM as parseContextSignalSnapshot,BA as parseCsvKv,OO as parseDefectChangeRiskRequest,uI as parseDefectRecurrenceCoverageRequest,vO as parseDefectRecurrencePolicy,Rm as parseEvalMetricFloors,Nm as parseEvalQuerySet,qT as parseExtensionLongFlagToken,Mp as parseGraphSubcommand,AI as parseHistoryAttestation,GI as parseHistoryProvenanceFilters,$O as parseIntegerLimit,Bw as parseItemDocument,I0 as parseItemMutationBatch,Ev as parseLimit,_u as parseLinkedTestAssertionEqualsMap,hu as parseLinkedTestAssertionGteMap,cu as parseLinkedTestBoolean,lu as parseLinkedTestContextMode,du as parseLinkedTestEnvClear,au as parseLinkedTestEnvSet,gu as parseLinkedTestJsonEntries,fu as parseLinkedTestMinLines,mu as parseLinkedTestRegexList,uu as parseLinkedTestStringList,pu as parseLinkedTestWorkspaceContextMode,Jh as parseMcpCachePolicy,Bh as parseMcpImplementation,tt as parseMcpInputRequests,dr as parseMcpInputResponses,Cg as parseMcpSubscriptionFilter,Ml as parseMigrateEntries,UO as parseMultiValueFilter,_P as parseMutationReceipt,ZA as parseOptionalNonNegativeInteger,JA as parseOptionalNumber,cL as parsePmAgentTaskTranscriptCorpus,O1 as parsePmToolDiscoveryOptions,FO as parsePriority,qO as parsePriorityFilterSet,XC as parseReadOutputSession,FE as parseRegisteredItemFieldAssignments,ae as parseRelationshipGraphSnapshot,Il as parseRemoveEntries,Yl as parseSourceLineRange,Tv as parseStatusFilterCsv,jO as parseStringFilterSet,pd as parseTags,pf as parseTestRunMeasurements,GO as parseType,BO as parseTypeFilterSet,hl as parseUnknownAuthorHistoryEventCoordinates,OT as parseWorkflowPolicy,PT as parseWorkflowPolicyDocument,EM as partitionDecisionEntries,pv as patchPathToChangedField,Fo as pathExists,bh as pauseTask,Ep as persistDurableGraphResult,PE as persistSelectedItemFormat,_R as planAgentIdentityVocabularyMutation,fM as planCompletedAtBackfill,Wc as planExtensionDirectoryCopy,z0 as planItemMutationDocument,Qt as planProfileApplication,mL as planRelationshipEventBackfill,Ip as planRelationshipRemediation,Uc as planSchemaEvolutionMigration,fl as planUnknownAuthorHistoryAcknowledgment,Hm as planWorkspaceSnapshotRestore,MA as positionalShapeKey,kA as positionalSignatureKey,tk as preflightExtension,Cd as prepareSimilarityText,VA as preserveMutationStdinTokenFields,HA as preserveMutationStdinTokenLiterals,q0 as previewItemMutationDocument,F0 as previewItemMutations,cw as printError,dw as printResult,W_ as profile,J_ as profileApply,Z_ as profileLint,Y_ as profileList,X_ as profileShow,_C as projectAfterCommandItemSnapshot,Du as projectContextFocusRows,cf as projectFleetAttributionAnalytics,UI as projectHistoryProvenance,iw as projectPmBriefListEnvelope,Vn as projectPmDiagnosticOutput,Kn as projectPmDiagnosticText,af as projectProvenanceCoverageAnalytics,zp as projectValidateCounts,AR as promoteAssuranceAssertion,kS as propagateContextUsageServingReceipt,kN as pruneCompileCacheGenerations,jP as putAssuranceDeclaration,BP as putAssuranceDeclarationBundle,XE as queryItemMetadataIndex,JE as queryLinkedFileMetadataIndex,ZE as querySimilarItemMetadataIndex,uf as queryTestRunMeasurementsBelow,Mn as quoteCommandArg,In as quoteWindowsCommandArg,S0 as rankCommandPaths,il as readAnnotationEntries,Pi as readAuthorEnvironment,Mf as readBooleanOption,GS as readContextUsageAffinity,kf as readCsvListOption,es as readExtensionMigrationState,Go as readFileIfExists,od as readFirstStringFromCommanderOptions,nd as readFirstValueFromCommanderOptions,of as readHistoryAnalyticsWindow,Yw as readHistoryEntries,ki as readHistorySnapshot,Xm as readImprovementLedger,tA as readItemMetadataDerivedIndexState,Xi as readLocatedItem,UC as readOutputBudgetCollections,_S as readOutputCollectionFingerprint,GC as readOutputContinuationRowCollections,$C as readOutputContinuationRowPaths,sS as readOutputIncludeModeOptions,FC as readOutputRowCollections,DC as readOutputRowPaths,QC as readOutputSessionRemainingTokens,Ft as readPmPackageManifest,Of as readRequiredString,$w as readRuntimeFieldOptionValue,Gi as readSettings,RE as readSettingsWithMetadata,id as readStringArrayFromCommanderOptions,If as readStringOption,gw as readThrownExitCode,Wv as readVectorizationStatusLedger,DE as readWorkflowPolicies,RT as readWorkflowPolicyField,uw as readWorkspaceContextIntentContracts,uM as readWorkspaceContextSignals,gM as readWorkspaceMemory,r0 as readWorkspacePosition,oE as reanchorHistoryEntries,BD as reconcileArtifactLedgers,An as reconcileExtensionCapabilityUsage,AE as reconcileWorkspaceJsonHistory,fC as recordAfterCommandAffectedItem,zP as recordAssuranceVerdict,Cu as recordClaimSemanticAttribution,DS as recordContextUsageDelivery,LS as recordContextUsageServing,$S as recordContextUsageTouch,FS as recordContextUsageTouches,wu as recordFocusSemanticAttribution,Ym as recordImprovementObservation,Su as recordReleaseSemanticAttribution,rA as refreshItemMetadataDerivedIndex,Dc as refreshMergeAttributeFenceIfInstalled,HC as refreshReadOutputDeliveredCounts,Xv as refreshSearchArtifactsForMutation,Si as registerAgentProvenanceAdapters,KO as registerExternalDependencyResolver,Ti as registerHarnessSignalDescriptors,EC as registerOutputMaterialFieldGroups,mh as release,zC as rememberReadOutputFocusRows,qP as removeAssuranceDeclaration,Uo as removeFileIfExists,Bl as renameArtifactsResultKey,Mu as renderCalendarMarkdown,ku as renderCalendarToon,Yu as renderContextMarkdown,Vc as renderExtensionDescribeMarkdown,zc as renderExtensionSurfaceMarkdown,t_ as renderGuideMarkdown,b0 as renderMissingOptionRetry,AM as renderNextMarkdown,A0 as renderPmClosedDomainHelp,kn as renderPmCommand,$o as renderPmCommandAliasMigrationHint,vc as renderPmCommandVisibilityMarkdown,JL as renderPmFlagLexiconMarkdown,zx as renderPmMcpAppHtml,vL as renderPmRefusalClosureCensusMarkdown,Sv as renderRowsAsCsv,wv as renderRowsAsTable,ch as reopen,NE as replayHistoryToTarget,Zw as replayToCanonicalItemDocument,Jw as replayToItemDocument,Ow as requireHistoryOperation,MI as requireTerminalReason,kI as requireTerminalReasonWithRecovery,mE as resealHistoryRewrite,lC as resetActiveExtensionRuntimeState,Al as resetWorkspaceGraphCache,_i as resolveAgentSessionContextFromSignals,pl as resolveAnnotationIndex,dl as resolveAnnotationInput,Ww as resolveAuthor,Mi as resolveAuthorIdentity,mv as resolveBodyFileContent,yy as resolveBuiltinCorpusShape,Iu as resolveCalendarOutputFormat,cP as resolveCanonicalPmErrorCodeContract,Vb as resolveCanonicalRelationshipKind,Kw as resolveClaimPrincipal,lv as resolveCliBulkIdsInput,bT as resolveCommandOptionPolicyState,MN as resolveCompileCacheGeneration,mM as resolveCompletionTimestamp,cT as resolveConfiguredPmPackageRoot,QO as resolveContentFieldFilters,zS as resolveContextIntentContract,$u as resolveContextOutputFormat,Fu as resolveContextTokenBudget,NI as resolveCreateExplicitEmptyFlag,LM as resolveEffectiveSearchMode,Nv as resolveEmbeddingProviders,VT as resolveExtensionFlagValueContract,Yc as resolveExtensionInstallSourceIdentity,zT as resolveExtensionLongFlagName,Qi as resolveExtensionMigrationStatePath,JT as resolveExtensionRoots,WO as resolveExternalDependencyReference,HT as resolveFlagValueKind,ST as resolveGlobalPmRoot,Qf as resolveGuideOutputFormat,Jm as resolveHistoryEpisodeGroupIdentity,kw as resolveHistoryHashAlgorithm,vw as resolveHistoryOperation,FI as resolveHistoryProvenanceDimensions,cA as resolveHistorySubject,kE as resolveHistoryTarget,$M as resolveHybridSemanticWeight,Yo as resolveImplicitPmRoot,PS as resolveIsoOrRelative,xO as resolveItemBlockers,PO as resolveItemExecutionRole,k0 as resolveItemMutationDocument,Wo as resolveItemTypeRegistry,Nw as resolveItemTypesFilePath,m0 as resolveLifecycleVerbRecovery,QA as resolveLinkedResourcePositionalRecovery,wf as resolveLinkedTestFailureExitCode,Dp as resolveLinkedTestSourceRef,$p as resolveLinkedTestSourceWorkspaceRoot,jp as resolveLinkedTestTrust,Bp as resolveLinkedTestTrustBatch,Sg as resolveMcpAcknowledgedSubscriptionFilter,Je as resolveMcpRequestContext,Mc as resolveMergeInstallContext,T0 as resolveMisnestedCommandPath,ZO as resolveMissingMetadataFilters,y0 as resolveMissingOptionPlaceholder,IC as resolveModePairedOutputOmissionReceipt,SM as resolveNextOutputFormat,xC as resolveOutputOmissionReceipt,dT as resolvePmCliVersion,Do as resolvePmCommandAlias,Ve as resolvePmCommandCapabilityFamily,Nt as resolvePmCommandExitContract,L as resolvePmCommandOperation,qn as resolvePmCommandOutputBudget,xt as resolvePmCommandOutputEnvelope,vA as resolvePmCommandPositionalContract,xn as resolvePmCommandScopeArgs,Ke as resolvePmCommandVisibilityTier,Hn as resolvePmDiagnosticOutputBudget,lP as resolvePmErrorCodeContract,hb as resolvePmFlagSemanticConcept,Le as resolvePmHistoryOperation,Jk as resolvePmMcpExecutableInvocation,aT as resolvePmPackageRootFromModule,OA as resolvePmPositionalActionContract,Fa as resolvePmPositionalActionFlagContracts,Fe as resolvePmRoot,Jd as resolvePmToolCustomFieldCollision,yv as resolvePriority,Vt as resolveProfile,Nc as resolveProjectMergeTypeFolders,ES as resolveQueryCursorStart,f0 as resolveReadOptionRetryArgs,cS as resolveReadOutputDimensions,mS as resolveReadOutputEncoding,VC as resolveReadOutputRecoveryBudget,nS as resolveReadOutputSurface,kC as resolveReadRowContract,g0 as resolveRecoveryCommandName,sv as resolveRegisteredSearchProvider,av as resolveRegisteredVectorStoreAdapter,dd as resolveReproducibleProcessEnvironment,ri as resolveRuntimeFieldRegistry,ti as resolveRuntimeStatusRegistry,Lv as resolveSearchCorpusFields,NM as resolveSearchMaxResults,UM as resolveSearchPage,DM as resolveSearchScoreThreshold,FM as resolveSearchTuning,$v as resolveSemanticCorpusCharacterLimit,Tu as resolveSemanticLineageIds,Mv as resolveSettingsWithSemanticRuntimeDefaults,YP as resolveSourceContextWritePolicy,Ou as resolveStartTaskInProgressStatus,ee as resolveSubcommandFlagContractsForCommand,oT as resolveTelemetryErrorCategory,II as resolveTerminalReason,L0 as resolveTransactionSchema,yT as resolveTypeDefinition,gT as resolveTypeName,Cv as resolveTypeSynonym,Pv as resolveTypeWorkflows,_l as resolveUnknownAuthorAcknowledgmentSelector,HM as resolveVectorIndexRecovery,Gv as resolveVectorStores,dc as resolveWorkspaceRelationshipKindRegistry,CT as resolveWorkspaceRoot,hh as restore,ov as restoreCheckpointItems,vE as restoreWorkspaceJsonFromHistory,Km as restoreWorkspaceSnapshot,Vm as restoreWorkspaceSnapshotWithRecovery,Gh as runAction,yC as runActiveBeforeMutationHooks,TC as runActiveCommandHandler,bC as runActiveOnIndexHooks,Pn as runActiveOnReadHooks,On as runActiveOnWriteHooks,CC as runActiveParserOverride,SC as runActivePreflightOverride,wC as runActiveServiceOverride,Nu as runActivity,XT as runAfterCommandHooks,Am as runAggregate,ll as runAnnotationCommand,Xp as runAppend,hI as runAssuranceAction,gI as runAssuranceDispatch,YT as runBeforeCommandHooks,xu as runCalendar,em as runClaim,tm as runClaimNext,Zp as runClose,Qp as runCloseMany,im as runCloseTask,bl as runComments,r_ as runCompletion,Tl as runConfig,Bt as runContext,rM as runContextEvaluationCorpus,eM as runContextEvaluationScenario,eu as runCopy,yu as runCreate,bu as runDelete,vl as runDeps,ql as runDocs,bR as runDuplicates,Dm as runEval,Fm as runEvent,Xc as runExtension,os as runExtensionMigrateAction,rs as runExtensionMigrations,Jl as runFiles,Ql as runFilesDiscover,Zl as runFilesLookup,df as runFleetAttributionAnalytics,vu as runFocus,Kp as runGc,vm as runGet,kp as runGraph,e_ as runGuide,xp as runHealth,xM as runHistory,PI as runHistoryAttest,bI as runHistoryCompact,SI as runHistoryCompactBulk,QR as runHistoryMaintenance,wI as runHistoryRedact,tI as runHistoryRepair,oI as runHistoryRepairAll,rl as runInit,Qc as runInitAgentGuidance,Yp as runLearnings,jl as runLinkedArtifacts,Ef as runLinkedTests,bc as runList,$m as runMeet,YM as runMergeDriver,$c as runMergeInstall,HR as runMergeReceiptEvidenceReport,zR as runMergeReceiptReport,XM as runMergeReconcile,Zu as runNext,pm as runNotes,nm as runPauseTask,dm as runPlan,Tm as runProfileApply,bm as runProfileLint,gm as runProfileList,ym as runProfileShow,sf as runProvenanceCoverageAnalytics,sk as runRegisteredCommandForTest,pk as runRegisteredCommandOverrideForTest,yk as runRegisteredExporterForTest,dk as runRegisteredHookForTest,gk as runRegisteredImporterForTest,hk as runRegisteredMigrationForTest,ak as runRegisteredMutationGuardForTest,ck as runRegisteredParserOverrideForTest,lk as runRegisteredPreflightOverrideForTest,uk as runRegisteredRendererOverrideForTest,fk as runRegisteredSearchProviderForTest,mk as runRegisteredServiceOverrideForTest,_k as runRegisteredVectorStoreAdapterForTest,er as runReindex,rm as runRelease,Gm as runRemind,DI as runReopen,cm as runRestore,jc as runSchemaEvolutionMigration,Om as runSearch,Cy as runSearchRefreshWorkerEntrypoint,o_ as runStartBackgroundRun,om as runStartTask,ff as runStats,hf as runTelemetry,_m as runTemplatesList,fm as runTemplatesSave,hm as runTemplatesShow,Af as runTest,vf as runTestAll,n_ as runTestRunsList,s_ as runTestRunsLogs,d_ as runTestRunsResume,i_ as runTestRunsStatus,a_ as runTestRunsStop,c_ as runTestRunsWorker,Pu as runUpdate,lm as runUpdateMany,Ut as runUpgrade,Vp as runValidate,Fh as runWithActiveExtensions,D as runWithAgentSessionContext,OE as runWithConfigurationOnlySettings,BS as runWithContextIntentContracts,_w as runWithDiscoveredContextIntentContracts,Ei as runWithHarnessDetectionSignals,Lx as runWithMcpTraceContext,ld as runWithReproducibleProcessEnvironment,Ai as runWithWorkspaceHarnessSignalDescriptors,zr as runWithWorkspaceRecipe,iR as runWorkflowPolicyAction,yI as runWorkspaceTransactionGc,Rp as saveGraphAuditBaseline,aI as scanClosureTimestamps,vR as scanExtensionHostVersions,ml as scanHistoryAuthorAttribution,di as scanItemFormatVersions,fd as scanMutationSecrets,RR as scanProvenanceResolverHealth,Ad as scanStaleInProgressItems,lI as scanStorageIntegrity,M_ as schema,F_ as schemaAddField,D_ as schemaAddStatus,N_ as schemaAddType,B_ as schemaApplyPreset,q_ as schemaInferTypes,k_ as schemaList,U_ as schemaListFields,V_ as schemaRemapStatus,G_ as schemaRemoveField,$_ as schemaRemoveStatus,L_ as schemaRemoveType,H_ as schemaRenameField,z_ as schemaRenameType,x_ as schemaShow,j_ as schemaShowField,K_ as schemaShowStatus,C0 as scoreCommandPathMatch,XI as scoreContextCandidates,JI as scoreContextCandidatesWithActiveExtensions,Sd as scoreItemSimilarity,UL as scorePmGrammarRefusalClosure,RL as scorePmRefusalClosure,wd as scorePreparedItemSimilarity,qL as scoreTrackerPreflightRecoveryClosure,pE as sealHistoryRecord,rx as sealMcpRequestState,m_ as search,TM as searchWorkspaceMemory,CM as searchWorkspaceMemoryReadResult,LO as selectActionableEntries,yS as selectCursorSemanticOptions,Yf as selectImportAuthor,Ix as selectMcpClientRegistrationMode,bM as selectWorkspaceMemory,yM as selectWorkspaceMemoryRollups,Au as semanticAttributionAffinity,nO as sentryCaptureCliError,rO as sentryDiscardCommandSpan,oO as sentryFinishCommandSpan,sO as sentryFlush,iO as sentryLogCliUsageError,eO as sentrySetCommandContext,tO as sentryStartCommandSpan,ui as serializeItemDocument,v0 as serializeNdjsonRows,O0 as serializeNdjsonStream,ly as serveDeclaredObservation,pC as setActiveCommandContext,uC as setActiveCommandResult,nC as setActiveExtensionCommands,oC as setActiveExtensionHooks,iC as setActiveExtensionParsers,sC as setActiveExtensionPreflight,cC as setActiveExtensionRegistrations,dC as setActiveExtensionRenderers,aC as setActiveExtensionServices,Hw as setFocusedItem,mO as shouldCompletePlanOnClose,Op as shouldPersistDurableGraphCache,YA as shouldResolveMutationStdinTokenField,WA as shouldResolveMutationStdinTokens,xv as shouldRunSearchRefreshInForeground,zl as similarityAdvisoryWarnings,LC as sliceReadOutputRowCollection,Fl as sortLinkedArtifacts,FA as splitAcceptanceCriteria,lO as splitCommaList,pi as splitFrontMatter,lS as stabilizeReadOutputReceiptEstimates,R as stableStringify,M0 as stableUpsertValue,wT as stableValueEquals,yh as startTask,_O as startTelemetryCommand,g_ as stats,Dw as statusIsTerminal,ja as stripGlobalBootstrapTokens,QM as subscribeMutationEventBatches,e0 as subscribeMutationEvents,fR as summarizeAgentIdentityVocabulary,Qm as summarizeAgentModelProvenance,ef as summarizeAgentProvenance,tM as summarizeContextEvaluationReports,bf as summarizeContextPreflight,qI as summarizeHistoryProvenance,el as summarizeInitResult,UR as summarizeMergeReceipt,LI as supportsCreateExplicitEmpty,LA as supportsItemIdAlias,iT as suppressHostOutput,Pe as syncRelationshipGraphAdapter,Z0 as synthesizeExtensionManifest,Ga as toCompletionFlagString,Ku as toContextFocusItem,zu as toContextPackingSummary,Hu as toContextRankingSummary,pT as toErrorMessage,Nf as toEstimatedMinutesValue,l0 as toExtensionFlagDefinitions,Gf as toImportBoolean,qf as toImportConfidence,Ff as toImportInteger,Kf as toImportLinkedDocs,Vf as toImportLinkedFiles,Wf as toImportLinkedTests,Hf as toImportLogEntries,zf as toImportNormalizedEnum,Bf as toImportNumberMap,Lf as toImportPriority,$f as toImportStatus,Uf as toImportStringList,jf as toImportStringMap,Df as toImportTags,qw as toItemRecord,xf as toNonEmptyImportString,lT as toNonEmptyStringOrUndefined,Qw as toReplayDocument,Td as tokenizeSimilarityText,KA as transferMutationStdinTokenPolicy,jT as translateHostEnvironmentFault,dh as update,gf as updateLinkedTest,Dh as upgrade,Q_ as validate,kP as validateAssertionDefinition,NP as validateAssuranceDocument,xP as validateGateDefinition,N0 as validateItemMutationRows,Ul as validateLinkedPaths,Mx as validateMcpAuthorizationResponseIssuer,Rx as validateMcpAuthorizationServerMetadata,kx as validateMcpClientMetadataDocument,Cx as validateMcpHttpRequestHeaders,sx as validateMcpJsonSchema,MP as validateMeasurementDefinition,hv as validateMissingParentReference,iS as validateReadOutputOptions,bv as validateSprintOrReleaseValue,TT as validateTypeOptions,CA as validateWorkspaceTransactionIdentity,OI as verifyAttestation,sP as verifyCliFlagInvocationParity,IA as verifyExplicitPositionalSlotCensus,rE as verifyHistoryChain,tE as verifyHistoryChainWithVersion,lA as verifyHistoryEntries,uE as verifyHistoryRecordHash,fE as verifyHistoryRewriteEvidence,NA as verifyPmCliGrammar,xA as verifyPmCommandPositionalContracts,XL as verifyPmFlagLexicon,TL as verifyPmRecoveryKindRuntimeCoverage,sb as verifyPmRecoveryProducerRuntimeCoverage,bL as verifyPmRecoveryReferences,EL as verifyPmRefusalClosureIdentityRatchet,wL as verifyPmRefusalClosureRatchet,yL as verifyPmRefusalReachability,kd as verifyToolOptionCliParity,ns as withFlagAliasMetadata,BT as withHostEnvironmentBoundary,ix as withMcpCachePolicy,MT as workflowApprovalFingerprint,kT as workflowPolicyApplies,IT as workflowPolicyFingerprint,El as workspaceGraphCache,cl as wrapOwnershipConflict,Tw as wrapThrownErrorForSentry,Ri as writeAuthorEnvironment,$e as writeFileAtomic,tv as writeMutationCheckpoint,IE as writeSettings,aw as writeStderr,sw as writeStdout,Yv as writeVectorizationStatusLedger,EE as writeWorkspaceJsonWithHistory};
35
35
  //# sourceMappingURL=sdk.js.map