@unbrained/pm-cli 2026.9.13 → 2026.9.15

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 (97) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +34 -0
  3. package/dist/cli/commander-usage.js +2 -2
  4. package/dist/cli/error-guidance.js +1 -1
  5. package/dist/cli/extension-command-help.d.ts +2 -2
  6. package/dist/cli/extension-command-help.js +2 -2
  7. package/dist/cli-bundle/bundle-manifest.json +144 -144
  8. package/dist/cli-bundle/chunks/{chunk-KM4XVZR7.js → chunk-3AHONKLL.js} +2 -2
  9. package/dist/cli-bundle/chunks/{chunk-ZZI7IHMM.js → chunk-3RB6Z7XE.js} +2 -2
  10. package/dist/cli-bundle/chunks/{chunk-GQQR6JAL.js → chunk-5P5PYCZX.js} +2 -2
  11. package/dist/cli-bundle/chunks/{chunk-XM7RWQLM.js → chunk-BOZ4HVYL.js} +2 -2
  12. package/dist/cli-bundle/chunks/chunk-J4DRE3WN.js +237 -0
  13. package/dist/cli-bundle/chunks/{chunk-LA44JECQ.js → chunk-RKPUO75B.js} +2 -2
  14. package/dist/cli-bundle/chunks/{chunk-XEZOGC3P.js → chunk-RM2OGG65.js} +2 -2
  15. package/dist/cli-bundle/chunks/{chunk-YQTJACN5.js → chunk-UKLOSZV6.js} +2 -2
  16. package/dist/cli-bundle/chunks/{chunk-GBK5MV6N.js → chunk-WDF7PP4P.js} +26 -26
  17. package/dist/cli-bundle/chunks/chunk-WLJJ4MAU.js +2 -0
  18. package/dist/cli-bundle/chunks/{chunk-YDSV4QIQ.js → chunk-Y2P3DSSO.js} +2 -2
  19. package/dist/cli-bundle/chunks/{chunk-3DWX3CKN.js → chunk-YMMLKKEP.js} +2 -2
  20. package/dist/cli-bundle/chunks/{register-list-query-WMJTBWNW.js → register-list-query-IWSPNFFD.js} +2 -2
  21. package/dist/cli-bundle/chunks/{register-mutation-EXGOXP3D.js → register-mutation-3DVF4R64.js} +2 -2
  22. package/dist/cli-bundle/chunks/{register-operations-2H4CDRGU.js → register-operations-LXP3MECQ.js} +2 -2
  23. package/dist/cli-bundle/chunks/{register-setup-NYBWGPOS.js → register-setup-KFQSNBDX.js} +2 -2
  24. package/dist/cli-bundle/focused-chunks/chunk-4YTDKIPF.js +30 -0
  25. package/dist/cli-bundle/focused-chunks/{chunk-LQ67C7ZO.js → chunk-533DCWPY.js} +2 -2
  26. package/dist/cli-bundle/focused-chunks/{chunk-B6JAANOH.js → chunk-5SBU4QDC.js} +2 -2
  27. package/dist/cli-bundle/focused-chunks/{chunk-SDQCJF4H.js → chunk-63YRRGKX.js} +2 -2
  28. package/dist/cli-bundle/focused-chunks/{chunk-KP3N6PVZ.js → chunk-6C3CUU2G.js} +3 -3
  29. package/dist/cli-bundle/focused-chunks/{chunk-TUHRUFID.js → chunk-AXDAIBT3.js} +2 -2
  30. package/dist/cli-bundle/focused-chunks/{chunk-FBCLVOBE.js → chunk-BMATJLPT.js} +2 -2
  31. package/dist/cli-bundle/focused-chunks/{chunk-DSJYL4VP.js → chunk-JKJYXCT6.js} +2 -2
  32. package/dist/cli-bundle/focused-chunks/{chunk-V7PSTKHD.js → chunk-MD7ADLME.js} +2 -2
  33. package/dist/cli-bundle/focused-chunks/{chunk-OENAWWP4.js → chunk-OGGF2RBL.js} +2 -2
  34. package/dist/cli-bundle/focused-chunks/{chunk-FPNI4U2B.js → chunk-PBJC2ZNA.js} +2 -2
  35. package/dist/cli-bundle/focused-chunks/chunk-SHF57M2H.js +2 -0
  36. package/dist/cli-bundle/focused-chunks/{chunk-F66QJWI4.js → chunk-UACMCSCC.js} +2 -2
  37. package/dist/cli-bundle/focused-chunks/{chunk-XCCM7P7V.js → chunk-YBQTVE5S.js} +2 -2
  38. package/dist/cli-bundle/focused-chunks/{chunk-ZAMG7HBB.js → chunk-ZHX3433X.js} +2 -2
  39. package/dist/cli-bundle/focused-chunks/chunk-ZOE2NSJB.js +20 -0
  40. package/dist/cli-bundle/main.js +19 -19
  41. package/dist/cli-bundle/sdk-authoring.js +1 -1
  42. package/dist/cli-bundle/sdk-contracts.js +1 -1
  43. package/dist/cli-bundle/sdk-core.js +24 -24
  44. package/dist/cli-bundle/sdk-governance.js +1 -1
  45. package/dist/cli-bundle/sdk-graph.js +1 -1
  46. package/dist/cli-bundle/sdk-merge.js +40 -40
  47. package/dist/cli-bundle/sdk-query.js +1 -1
  48. package/dist/cli-bundle/sdk-runtime.js +1 -1
  49. package/dist/cli-bundle/sdk-testing.js +1 -1
  50. package/dist/cli-bundle/sdk.js +8 -8
  51. package/dist/core/extensions/index.d.ts +7 -0
  52. package/dist/core/extensions/index.js +1 -1
  53. package/dist/core/lock/lock.js +2 -2
  54. package/dist/core/output/output.js +3 -3
  55. package/dist/core/telemetry/policy.d.ts +2 -0
  56. package/dist/core/telemetry/policy.js +1 -1
  57. package/dist/core/telemetry/read-sampling.d.ts +8 -0
  58. package/dist/core/telemetry/read-sampling.js +3 -0
  59. package/dist/core/telemetry/runtime.d.ts +35 -8
  60. package/dist/core/telemetry/runtime.js +5 -4
  61. package/dist/sdk/agent/command-suggestions.d.ts +6 -0
  62. package/dist/sdk/agent/command-suggestions.js +1 -1
  63. package/dist/sdk/cli-contracts/command-aliases.js +1 -1
  64. package/dist/sdk/cli-contracts/grammar-contracts.d.ts +2 -2
  65. package/dist/sdk/cli-contracts/grammar-contracts.js +1 -1
  66. package/dist/sdk/cli-contracts/runtime-contracts.d.ts +7 -3
  67. package/dist/sdk/cli-contracts/runtime-contracts.js +1 -1
  68. package/dist/sdk/public-surface.json +1 -1
  69. package/dist/sdk/telemetry.js +1 -1
  70. package/docs/AGENT_UX_CONTRACTS.md +10 -2
  71. package/docs/CLI_GRAMMAR.md +28 -0
  72. package/docs/CONFIGURATION.md +41 -3
  73. package/docs/generated/AGENT_CAPABILITY_ROUTING.md +1 -1
  74. package/docs/generated/AGENT_COMMAND_SURFACE.md +1 -0
  75. package/docs/generated/FLAG_LEXICON_BUDGETS.md +1 -0
  76. package/marketplace.json +2 -2
  77. package/package.json +5 -5
  78. package/packages/pm-beads/package.json +1 -1
  79. package/packages/pm-calendar/package.json +1 -1
  80. package/packages/pm-command-kit/package.json +1 -1
  81. package/packages/pm-digital-twin/package.json +1 -1
  82. package/packages/pm-governance-audit/package.json +1 -1
  83. package/packages/pm-guide-shell/package.json +1 -1
  84. package/packages/pm-kanban/package.json +1 -1
  85. package/packages/pm-lifecycle-hooks/package.json +1 -1
  86. package/packages/pm-linked-test-adapters/package.json +1 -1
  87. package/packages/pm-search-advanced/package.json +1 -1
  88. package/packages/pm-templates/package.json +1 -1
  89. package/packages/pm-todos/package.json +1 -1
  90. package/packages/pm-vcs/package.json +1 -1
  91. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  92. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  93. package/dist/cli-bundle/chunks/chunk-6KHYW3FH.js +0 -235
  94. package/dist/cli-bundle/chunks/chunk-AKTBOX6U.js +0 -2
  95. package/dist/cli-bundle/focused-chunks/chunk-7JR6M2JR.js +0 -30
  96. package/dist/cli-bundle/focused-chunks/chunk-YUXBHIUV.js +0 -20
  97. package/dist/cli-bundle/focused-chunks/chunk-ZF5PXK6A.js +0 -2
@@ -1,5 +1,5 @@
1
- import{A as Fh,B as jh,C as GM,D as UM,a as fs,b as _s,c as hs,d as gs,e as PM,f as MM,g as Oh,h as Ih,i as Rh,k as Ph,l as Mh,m as kh,n as xh,o as Nh,p as Lh,q as Dh,r as $h,s as kM,t as xM,u as NM,v as LM,w as DM,x as $M,y as FM,z as jM}from"./chunks/chunk-AKTBOX6U.js";import{A as Ok,B as Ik,C as Rk,D as Pk,E as Mk,F as kk,G as xk,H as Nk,I as Lk,J as Dk,K as $k,L as Fk,M as jk,N as Gk,O as Uk,P as Bk,Q as qk,R as zk,S as Vk,T as Hk,U as Kk,V as Wk,W as Xk,X as Yk,Y as Jk,a as tk,b as rk,c as ok,d as nk,e as ik,f as sk,g as ak,h as ck,i as dk,j as lk,k as uk,l as pk,m as mk,n as fk,o as _k,p as hk,q as gk,r as yk,s as bk,t as Ck,u as Tk,v as Sk,w as wk,x as Ek,y as Ak,z as vk}from"./chunks/chunk-GQQR6JAL.js";import{a as BM,b as qM,c as zM,d as VM}from"./chunks/chunk-LA44JECQ.js";import{a as HM,b as KM,c as WM,d as XM,e as YM,f as JM,g as ZM,h as QM,i as ek}from"./chunks/chunk-ZZI7IHMM.js";import{$ as nr,$a as o_,$b as oh,A as tO,Aa as Af,Ab as P_,B as rO,Ba as vf,Bb as M_,C as mu,Ca as Of,Cb as k_,D as kp,Da as If,Db as x_,E as xp,Ea as Rf,Eb as N_,F as Np,Fa as Pf,Fb as L_,G as Lp,Ga as Mf,Gb as D_,H as Dp,Ha as kf,Hb as $_,I as Ye,Ia as xf,Ib as F_,J as $p,Ja as Nf,Jb as j_,K as Fp,Ka as Lf,Kb as G_,L as jp,La as Df,Lb as U_,M as Gp,Ma as $f,Mb as B_,N as Up,Na as Ff,Nb as q_,O as Bp,Oa as jf,Ob as z_,P as tM,Pa as Gf,Pb as V_,Q as rM,Qa as Uf,Qb as H_,R as oM,Ra as dr,Rb as K_,S as Xt,Sa as he,Sb as W_,T as Yt,Ta as Xf,Tb as X_,U as Jt,Ua as Yf,Ub as Y_,V as Zt,Va as Jf,Vb as J_,W as Qt,Wa as Zf,Wb as Z_,X as er,Xa as Qf,Xb as Q_,Y as tr,Ya as e_,Yb as eh,Z as rr,Za as t_,Zb as th,_ as or,_a as r_,_b as rh,a as zc,aa as ir,ab as n_,ac as nh,b as Vc,ba as ym,bb as i_,bc as ih,c as Hc,ca as bm,cb as s_,cc as sh,d as Rv,da as Cm,db as a_,dc as ah,e as Pv,ea as Tm,eb as c_,ec as ch,f as Kc,fa as Sm,fb as d_,fc as dh,g as $v,ga as Je,gb as l_,gc as lh,h as Fv,ha as wm,hb as u_,hc as uh,i as jv,ia as Em,ib as p_,ic as ph,j as Gv,ja as Am,jb as m_,jc as mh,k as Uv,ka as vm,kb as f_,kc as fh,l as Bv,la as Om,lb as __,lc as _h,m as qv,ma as Im,mb as h_,mc as hh,n as zv,na as Rm,nb as g_,nc as gh,o as Vv,oa as Pm,ob as y_,oc as yh,p as Hv,pa as gM,pb as b_,pc as bh,q as Kv,qa as _f,qb as C_,qc as Ch,r as Wv,ra as hf,rb as T_,rc as Th,s as Xv,sa as gf,sb as S_,sc as Sh,t as Yv,ta as yf,tb as w_,tc as wh,u as Zc,ua as bf,ub as E_,uc as Eh,v as Qc,va as Cf,vb as A_,vc as Ah,w as Jv,wa as Tf,wb as v_,wc as vh,x as Zv,xa as Sf,xb as O_,y as Qv,ya as wf,yb as I_,z as eO,za as Ef,zb as R_}from"./chunks/chunk-XM7RWQLM.js";import{a as Wt,f as jP,g as GP,h as Vp,i as Hp}from"./chunks/chunk-3DWX3CKN.js";import{A as HP,B as KP,C as WP,D as XP,E as YP,F as JP,G as ZP,H as QP,I as eM,J as om,K as nm,L as im,M as pM,N as Mm,O as mM,P as fM,Q as _M,R as hM,b as pu,c as RR,d as Mp,e as vP,f as OP,g as IP,h as RP,i as PP,j as MP,k as kP,l as xP,m as NP,n as LP,o as DP,p as qp,q as $P,r as Qp,s as em,t as tm,u as rm,v as UP,w as BP,x as qP,y as zP,z as VP}from"./chunks/chunk-YDSV4QIQ.js";import{$a as cu,$b as Ep,$c as Fm,A as jO,Aa as Ll,Ab as fP,Ac as lm,Ad as Qm,B as GO,Ba as Dl,Bb as _P,Bc as um,Bd as ef,C as UO,Ca as $l,Cb as hP,Cc as pm,Cd as tf,D as BO,Da as Fl,Db as rp,Dc as mm,Dd as rf,E as ZO,Ea as jl,Eb as op,Ec as fm,Ed as of,Fa as Gl,Fc as _m,Fd as RM,Ga as Ul,Gb as np,Gc as hm,Gd as nf,Ha as Bl,Hb as ip,Hc as gm,Hd as sf,Ia as ql,Ib as gP,Ic as dM,Id as af,J as Yd,Ja as zl,Jb as sp,Jc as lM,Jd as cf,Ka as Vl,Kb as ap,Kc as uM,Kd as df,La as Hl,Lb as cp,Lc as yM,Ld as lf,Ma as Kl,Mb as dp,Mc as sr,Md as uf,Na as Wl,Nb as lp,Nc as bM,Nd as pf,Oa as Xl,Ob as up,Oc as Ze,Od as mf,Pa as Yl,Pb as pp,Pc as oe,Pd as ff,Qa as Jl,Qb as mp,Qc as km,Qd as Bf,Ra as Zl,Rb as fp,Rd as qf,Sa as Ql,Sb as _p,Sd as zf,Ta as eu,Tb as hp,Tc as Qe,Td as Vf,Ua as tu,Ub as gp,Uc as xm,Ud as Hf,Va as ru,Vb as yp,Vc as Nm,Vd as Kf,Wa as ou,Wb as bp,Wd as Wf,Xa as nu,Xb as Cp,Xc as _e,Ya as iu,Yb as Tp,Yc as Lm,Za as su,Zb as Sp,Zc as Dm,_a as au,_b as wp,_c as $m,a as mO,aa as QO,ab as du,ac as yP,ad as CM,b as fO,ba as eI,bb as lu,bc as bP,bd as TM,c as _O,ca as Jd,cb as SR,cc as Ap,cd as SM,d as hO,da as Zd,db as wR,dd as wM,e as gO,ea as Qd,eb as ER,ed as EM,f as yO,fa as el,fb as AR,fd as ar,g as bO,ga as tl,gb as vR,gc as vp,gd as AM,h as CO,ha as rl,hb as OR,hd as vM,i as TO,ia as ol,ib as IR,ic as Op,id as cr,j as SO,ja as NI,jb as fu,jc as Ip,jd as OM,k as wO,ka as LI,kb as _u,kc as Rp,kd as IM,l as EO,la as DI,lb as hu,lc as Pp,m as AO,ma as $I,mb as gu,mc as CP,md as jm,n as vO,na as FI,nb as yu,nc as TP,nd as Gm,o as OO,oa as jI,oc as SP,od as Um,p as IO,pa as GI,pb as bu,pc as Xe,pd as Bm,q as RO,qa as HI,qb as Cu,qc as wP,qd as qm,r as PO,ra as KI,rb as Tu,rc as Kt,rd as zm,s as MO,sa as Rl,sb as Su,sc as EP,sd as Vm,t as kO,ta as Pl,tb as wu,tc as AP,td as Hm,u as xO,ua as WI,ub as Zu,uc as FP,ud as Km,v as NO,va as XI,vb as Qu,vc as zp,vd as Wm,w as LO,wa as Ml,wb as ep,wc as sm,wd as Xm,x as DO,xa as kl,xb as tp,xc as am,xd as Ym,y as $O,ya as xl,yb as pP,yc as cm,yd as Jm,z as FO,za as Nl,zb as mP,zc as dm,zd as Zm}from"./chunks/chunk-GBK5MV6N.js";import{Aa as gl,Ba as yl,Ca as bl,H as lI,Ha as Cl,I as uI,Ia as Tl,Ja as Sl,K as pI,Ka as wl,L as mI,La as El,M as fI,Ma as Al,N as pl,Na as vl,O as ml,P as fl,Pa as Ol,Q as _l,Qa as Il,R as Gt,Ra as Kp,Sa as Wp,Ta as Xp,Va as Yp,Wa as Jp,Xa as Zp,a as Lv,b as Dv,c as Wc,d as Xc,f as Yc,g as Jc,h as tI,i as rI,j as oI,k as nI,l as iI,m as sI,n as aI,o as cI,p as nl,q as il,r as sl,s as al,t as cl,u as dI,ua as Ut,v as dl,va as Bt,w as ll,wa as qt,x as ul,xa as zt,ya as hl}from"./chunks/chunk-KM4XVZR7.js";import{$ as wd,$a as UI,$b as FR,$c as nM,A as XO,Ab as lR,Ac as Mu,B as YO,Bb as uR,Bc as ku,C as td,Ca as _I,Cb as pR,Cc as xu,D as rd,Da as hI,Db as mR,Dc as Vt,E as od,Ea as gI,Eb as fR,Ec as Nu,F as nd,Fa as yI,Fc as Lu,G as id,Ga as bI,Gc as Du,H as sd,Ha as CI,Hb as _R,Hc as $u,I as ad,Ia as TI,Ib as hR,Ic as Fu,J as cd,Ja as SI,Jb as gR,Jc as ju,K as dd,Ka as wI,Kb as yR,Kc as Gu,L as ld,La as EI,Lb as bR,Lc as Uu,M as ud,Ma as AI,Mb as CR,Mc as Bu,N as We,Na as vI,Nb as TR,Nc as qu,O as pd,Oa as OI,Ob as uu,Oc as zu,P as md,Pb as Eu,Pc as Vu,Q as fd,Qb as Au,Qc as Hu,R as _d,Rb as vu,Rc as Ku,S as JO,Sa as II,Sb as Ou,Sc as Wu,Tb as PR,Tc as Xu,U as hd,Ua as RI,Ub as MR,Uc as Ht,V as gd,Va as PI,Vb as kR,Vc as Yu,W as yd,Wb as xR,Wc as cP,X as bd,Xa as MI,Xb as NR,Xc as dP,Y as Cd,Ya as kI,Yb as LR,Yc as lP,Z as Td,Za as xI,Zb as DR,Zc as Ju,_ as Sd,_b as $R,_c as uP,aa as Ed,ab as BI,ac as jR,ad as iM,b as vv,ba as Ad,bb as qI,bc as GR,bd as sM,c as Ov,ca as vd,cb as zI,cc as UR,cd as aM,d as Iv,da as Od,db as VI,dc as BR,dd as cM,e as Mv,ea as Id,eb as YI,ec as qR,f as kv,fa as Rd,fb as JI,fc as zR,g as xv,ga as Pd,gb as ZI,gc as VR,h as Nv,ha as Md,hb as QI,hc as HR,i as oO,ia as kd,ib as eR,ic as KR,j as nO,ja as xd,jb as tR,jc as WR,k as iO,ka as Nd,kb as rR,kc as XR,l as sO,la as Ld,lb as oR,lc as YR,m as aO,ma as Dd,mb as nR,mc as JR,n as cO,na as $d,nb as iR,nc as ZR,o as dO,oa as Fd,ob as sR,oc as QR,p as lO,pa as jd,pb as aR,pc as eP,q as uO,qa as Gd,qb as cR,qc as tP,r as pO,ra as Ud,rc as rP,sa as Bd,sc as oP,t as ed,ta as qd,tc as nP,u as qO,ua as zd,uc as iP,v as zO,va as Vd,vc as sP,w as VO,wa as Hd,wc as aP,x as HO,xa as Kd,xc as Iu,y as KO,ya as Wd,yc as Ru,z as WO,za as Xd,zb as dR,zc as Pu}from"./chunks/chunk-YQTJACN5.js";import{$b as jC,$c as pT,$d as wn,$e as Jn,$f as zS,$g as cw,$h as iE,$i as qE,$j as Ji,$k as ss,$l as Ys,$m as La,$n as kc,Aa as tn,Ab as PC,Ac as WC,Ad as MT,Ae as cS,Af as gS,Ag as bi,Ah as Lw,Ai as wE,Aj as oA,Ak as kA,Al as ws,Am as da,An as cc,Bb as MC,Bc as XC,Bd as kT,Be as dS,Bf as yS,Bg as Ci,Bh as Dw,Bi as EE,Bj as Lt,Bk as xA,Bl as Es,Bm as la,Bn as dc,Cb as kC,Ce as Ln,Cf as bS,Cg as Ti,Ch as $w,Ci as AE,Ck as NA,Cl as As,Cm as ua,Cn as lc,Dc as YC,Dd as xT,De as Dn,Df as CS,Dg as Si,Dh as Fw,Di as vE,Dj as nA,Dk as LA,Dl as vs,Dm as pa,Dn as uc,E as Yb,Ea as rn,Ec as _n,Ed as NT,Ee as $,Ef as TS,Eg as wi,Eh as jw,Ei as OE,Ej as iA,Ek as DA,El as Os,Em as ma,En as pc,Fe as $n,Ff as SS,Fg as Ei,Fh as Gw,Fi as IE,Fj as sA,Fk as $A,Fl as Is,Fn as mc,G as Jb,Ga as on,Gc as hn,Gd as LT,Gf as wS,Gg as Ai,Gh as Uw,Gi as RE,Gj as aA,Gk as FA,Gl as Rs,Gm as fa,Gn as fc,Ha as nn,Hc as gn,Hd as DT,Hf as ES,Hg as vi,Hh as Bw,Hi as PE,Hj as cA,Hk as jA,Hl as Ps,Hm as _a,Hn as _c,Ia as sn,Ib as xC,Id as $T,If as AS,Ig as Oi,Ih as qw,Ii as ME,Ik as Dt,Il as Ms,Im as ha,In as hc,J as Zb,Jb as Ue,Jd as FT,Jf as vS,Jg as Ii,Jh as zw,Ji as kE,Jk as GA,Jl as ks,Jm as ga,Jn as gc,Kb as Pt,Kc as JC,Kd as jT,Kf as OS,Kg as Ri,Kh as Vw,Ki as xE,Kj as dA,Kl as xs,Km as ya,Kn as yc,Lb as NC,Lc as ZC,Ld as GT,Le as lS,Lf as IS,Lg as Pi,Lh as Hw,Li as NE,Ll as Ns,Lm as ba,Ln as bc,Mb as LC,Mc as QC,Md as UT,Me as uS,Mf as RS,Mg as Mi,Mh as Kw,Mk as UA,Ml as Ls,Mm as Ca,Mn as Cc,N as Qb,Nb as DC,Nc as eT,Nd as BT,Ne as pS,Nf as PS,Ng as ki,Nh as Ww,Ni as qi,Nk as BA,Nl as Ds,Nm as Ta,Nn as Tc,O as D,Ob as $C,Oc as tT,Od as qT,Oe as Fn,Of as MS,Og as xi,Oh as Xw,Oi as zi,Oj as Ki,Ok as qA,Ol as $s,Om as Sa,On as Sc,P as eC,Pb as H,Pc as rT,Pd as zT,Pe as jn,Pf as kS,Pg as Ni,Ph as Yw,Pi as Vi,Pj as lA,Pk as zA,Pl as Fs,Pm as wa,Pn as wc,Q as b,Qb as FC,Qc as oT,Qd as VT,Qe as Gn,Qf as xS,Qg as Li,Qh as Jw,Qj as uA,Qk as VA,Ql as js,Qm as Ea,Qn as Ec,Rc as yn,Rd as HT,Re as Un,Rf as NS,Rg as Di,Ri as LE,Rj as pA,Rk as HA,Rl as Gs,Rm as Aa,Rn as Ac,S as tC,Sc as nT,Se as Bn,Sf as LS,Sg as $i,Sh as Zw,Si as DE,Sj as mA,Sk as KA,Sl as Us,Sm as va,Sn as vc,T as rC,Tc as iT,Te as qn,Tf as DS,Tg as Fi,Th as Qw,Ti as $E,Tk as WA,Tl as Bs,Tm as Oa,Tn as Oc,Uc as sT,Ue as zn,Uf as $S,Ug as ji,Ui as FE,Uj as fA,Uk as es,Ul as qs,Um as Ia,Un as Ic,Vc as aT,Ve as Vn,Vf as FS,Vg as Gi,Vi as jE,Vj as _A,Vk as ts,Vl as zs,Vm as Ra,Vn as Rc,W as oC,Wc as cT,We as Hn,Wf as jS,Wg as ow,Wh as eE,Wj as hA,Wk as rs,Wl as Vs,Wm as Pa,Wn as Pc,Xa as SC,Xc as dT,Xd as KT,Xe as Kn,Xf as GS,Xg as nw,Xh as tE,Xi as GE,Xj as gA,Xk as os,Xl as Hs,Xm as Ma,Xn as Mc,Ya as wC,Yc as lT,Ye as Wn,Yf as US,Yg as iw,Yh as rE,Yj as Wi,Yk as ns,Yl as Ks,Ym as ka,Z as nC,Za as EC,Zc as uT,Zd as Sn,Ze as Xn,Zf as BS,Zg as sw,Zh as oE,Zi as UE,Zj as Xi,Zk as is,Zl as Ws,Zm as xa,Zn as Ke,_ as Ot,_c as bn,_d as WT,_e as Yn,_f as qS,_g as aw,_h as nE,_i as BE,_j as Yi,_l as Xs,_m as Na,_n as re,aa as It,ab as an,ac as mn,ad as Cn,af as Zn,ag as VS,ah as dw,ai as sE,aj as zE,ak as Zi,al as as,am as sv,an as Da,b as jo,ba as Jo,bb as AC,bc as fn,be as XT,bf as mS,bg as HS,bh as lw,bi as aE,bj as VE,bl as cs,bm as av,bn as $a,bo as gv,c as Go,ca as Zo,cb as vC,cc as GC,cd as mT,ce as YT,cf as fS,cg as KS,ch as uw,ci as cE,ck as Qi,cl as ds,cm as Ve,cn as Fa,co as yv,d as Uo,da as Rt,db as OC,dc as UC,dd as fT,de as JT,df as Be,dg as WS,dh as pw,di as dE,dk as yA,dl as ls,dm as cv,dn as ja,e as Bo,eb as IC,ec as P,ed as _T,ee as En,ef as Qn,eg as XS,eh as mw,ei as lE,el as us,em as dv,en as Ga,f as $e,fa as iC,fc as BC,fd as hT,fe as An,ff as _S,fg as YS,fh as fw,fi as uE,fk as bA,fl as ps,fm as lv,fn as Ua,fo as bv,g as qo,gb as cn,gc as Mt,gd as gT,ge as vn,gf as ei,gg as JS,gh as _w,gi as pE,gk as CA,gl as ms,gm as Ft,gn as Ba,go as Cv,h as L,ha as sC,hb as dn,hc as qC,hd as kt,he as On,hf as ti,hg as ZS,hh as hw,hk as TA,hl as XA,hm as He,hn as qa,ho as Tv,i as Fe,ia as aC,ib as Ge,id as yT,ie as In,if as ri,ig as QS,ih as gw,ii as mE,il as YA,im as uv,in as za,io as Sv,j as zo,ja as cC,jb as RC,jc as zC,jd as bT,je as Rn,jf as oi,jg as ew,jh as yw,ji as Ui,jk as SA,jl as JA,jm as pv,jn as Va,jo as wv,k as Vo,ka as dC,kd as CT,ke as Pn,kg as tw,kh as bw,ki as Bi,kl as ZA,km as mv,kn as Ha,ko as Ev,l as Ho,la as lC,lb as ln,le as ZT,lg as rw,lh as Cw,ll as QA,lm as fv,ln as Ka,lo as Av,m as Ko,ma as uC,mb as un,md as TT,me as QT,mg as ai,mh as Tw,mj as HE,mk as wA,ml as ev,mm as _v,mn as Wa,mo as xc,na as pC,nd as ST,ng as ci,nh as Sw,nj as KE,nl as tv,nm as hv,nn as Xa,no as Nc,o as Wo,oa as mC,ob as pn,oe as Mn,og as di,oh as ww,oj as WE,ok as EA,ol as rv,om as Js,on as Ya,oo as Lc,p as vt,pa as fC,pe as kn,pg as li,ph as Ew,pi as fE,pj as XE,pm as Zs,pn as Ja,po as Dc,q as fe,qa as _C,qd as Tn,qe as eS,qg as ui,qh as Aw,qi as _E,qj as YE,qm as Qs,qn as Za,qo as $c,r as Xo,rd as wT,re as xn,rg as pi,rh as vw,ri as hE,rj as JE,rl as $t,rm as ea,rn as Qa,ro as Fc,s as je,sa as hC,sd as ET,se as Nn,sg as mi,sh as Ow,si as gE,sk as AA,sl as ov,sm as ta,sn as ec,so as jc,t as Yo,ta as gC,td as AT,te as tS,tf as xt,tg as qe,th as Iw,ti as yE,tk as vA,tl as nv,tm as ra,tn as tc,to as Gc,ua as yC,ud as vT,ue as rS,uf as Nt,ug as ze,uh as Rw,ui as bE,uj as ZE,uk as OA,ul as iv,um as oa,un as rc,uo as Uc,v as Kb,va as bC,vd as OT,ve as oS,vf as ni,vg as fi,vh as Pw,vj as QE,vk as IA,vl as ys,vm as na,vn as oc,vo as Bc,w as Wb,wa as CC,wc as VC,wd as IT,we as nS,wf as ii,wg as _i,wh as Mw,wi as CE,wj as Hi,wk as RA,wl as bs,wm as ia,wn as nc,wo as qc,x as Xb,xa as TC,xc as HC,xe as iS,xf as si,xg as hi,xh as kw,xj as eA,xl as Cs,xm as sa,xn as ic,xo as jt,ya as Qo,yc as KC,yd as RT,ye as sS,yg as gi,yh as xw,yi as TE,yj as tA,yk as PA,yl as Ts,ym as aa,yn as sc,za as en,zd as PT,ze as aS,zf as hS,zg as yi,zh as Nw,zi as SE,zj as rA,zk as MA,zl as Ss,zm as ca,zn as ac}from"./chunks/chunk-6KHYW3FH.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="08485124-a2f1-5bb5-9316-533a3f7888bc")}catch{}})();var K="2026-07-28",Zk=["2025-11-25","2025-06-18"],et=[K],m={headerMismatch:-32020,missingRequiredClientCapability:-32021,unsupportedProtocolVersion:-32022,invalidParams:-32602},A={clientCapabilities:"io.modelcontextprotocol/clientCapabilities",clientInfo:"io.modelcontextprotocol/clientInfo",logLevel:"io.modelcontextprotocol/logLevel",protocolVersion:"io.modelcontextprotocol/protocolVersion",serverInfo:"io.modelcontextprotocol/serverInfo"},lr=["debug","info","notice","warning","error","critical","alert","emergency"],p=class extends Error{code;data;constructor(t,r,o={}){super(t),this.name="PmMcpProtocolError",this.code=r,this.data=o}};function _(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Gh(e){if(e===void 0)return;if(!_(e))throw new p("Invalid MCP clientInfo metadata",m.invalidParams,{field:A.clientInfo,expected:"object"});let t=typeof e.name=="string"?e.name.trim():"",r=typeof e.version=="string"?e.version.trim():"";if(t.length===0||r.length===0)throw new p("Invalid MCP clientInfo metadata",m.invalidParams,{field:A.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 Uh(e){if(e!==void 0){if(typeof e!="string"||!lr.includes(e))throw new p("Invalid MCP logLevel metadata",m.invalidParams,{field:A.logLevel,allowed:[...lr]});return e}}function tt(e){let t=_(e)?e._meta:void 0;if(!_(t))throw new p("Missing required MCP request metadata",m.invalidParams,{required:[A.protocolVersion,A.clientCapabilities]});let r=t[A.protocolVersion];if(typeof r!="string"||!et.includes(r))throw new p("Unsupported protocol version",m.unsupportedProtocolVersion,{supported:[...et],requested:typeof r=="string"?r:null});let o=t[A.clientCapabilities];if(!_(o))throw new p("Invalid MCP client capabilities metadata",m.invalidParams,{field:A.clientCapabilities,expected:"object"});let n=Gh(t[A.clientInfo]),i=Uh(t[A.logLevel]);return{protocolVersion:K,clientCapabilities:o,...n?{clientInfo:n}:{},...i?{logLevel:i}:{}}}function Qk(e,t){if(t!==e.protocolVersion)throw new p("MCP protocol header does not match request metadata",m.headerMismatch,{header:t??null,metadata:e.protocolVersion})}function e0(e,t){let r=t.filter(o=>!Object.prototype.hasOwnProperty.call(e.clientCapabilities,o));if(r.length>0)throw new p("Missing required client capability",m.missingRequiredClientCapability,{requiredCapabilities:Object.fromEntries(r.map(o=>[o,{}]))})}function t0(e,t){let r=e.clientCapabilities.extensions;return _(r)&&_(r[t])}function rt(e,t){let r=_(e._meta)?e._meta:{};return{...e,_meta:{...r,[A.serverInfo]:{...t}}}}function Bh(e,t){return rt({...e,resultType:"complete"},t)}function r0(e){let t=e.ttlMs??6e4;if(!Number.isFinite(t)||t<0)throw new p("Invalid MCP discovery cache TTL",m.invalidParams,{ttlMs:t});return Bh({supportedVersions:[...et],capabilities:structuredClone(e.capabilities),ttlMs:t,cacheScope:"public",...e.instructions?{instructions:e.instructions}:{}},e.serverInfo)}function o0(e,t){if(_(e)&&typeof e.resultType=="string")return e.resultType;if(t==="legacy")return"complete";throw new p("Modern MCP result is missing resultType",m.invalidParams,{required:"resultType"})}import{createHash as mr,createHmac as fr,timingSafeEqual as qh}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="6505e714-d1f3-5794-88c8-51c1644acec9")}catch{}})();var zh=["elicitation/create","roots/list","sampling/createMessage"],ur=class extends Error{inputRequests;requestState;constructor(t){super("MCP operation requires additional input"),this.name="PmMcpInputRequiredError",this.inputRequests=t.inputRequests,this.requestState=t.requestState}},_r=/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/u,ge=32,nt=64*1024,ye=16*1024,ot={maxBytes:256*1024,maxDepth:32,maxNodes:4096};function Vh(e){return e==="elicitation/create"?"elicitation":e==="sampling/createMessage"?"sampling":"roots"}function be(e,t,r){let o;try{o=JSON.stringify(e)}catch{throw new p(`Invalid ${r}: value is not JSON serializable`,m.invalidParams,{field:r})}if(Buffer.byteLength(o,"utf8")>t)throw new p(`Invalid ${r}: payload exceeds the protocol bound`,m.invalidParams,{field:r,maximumBytes:t})}function it(e,t){if(!_(e))throw new p("Invalid MCP inputRequests",m.invalidParams,{field:"inputRequests",expected:"object"});let r=Object.entries(e);if(r.length===0||r.length>ge)throw new p("Invalid MCP inputRequests count",m.invalidParams,{minimum:1,maximum:ge,observed:r.length});let o={};for(let[n,i]of r){if(!_r.test(n)||!_(i))throw new p("Invalid MCP input request entry",m.invalidParams,{field:`inputRequests.${n}`});let s=i.method;if(typeof s!="string"||!zh.includes(s))throw new p("Unsupported MCP input request method",m.invalidParams,{field:`inputRequests.${n}.method`,method:s??null});let a=Vh(s);if(!Object.prototype.hasOwnProperty.call(t.clientCapabilities,a))throw new p("Missing required client capability",m.missingRequiredClientCapability,{requiredCapabilities:{[a]:{}}});if(!_(i.params))throw new p("Invalid MCP input request parameters",m.invalidParams,{field:`inputRequests.${n}.params`,expected:"object"});o[n]={method:s,params:structuredClone(i.params)}}return be(o,nt,"inputRequests"),o}function hr(e){if(!_(e))throw new p("Invalid MCP inputResponses",m.invalidParams,{field:"inputResponses",expected:"object"});let t=Object.entries(e);if(t.length>ge)throw new p("Invalid MCP inputResponses count",m.invalidParams,{maximum:ge,observed:t.length});let r={};for(let[o,n]of t){if(!_r.test(o)||!_(n))throw new p("Invalid MCP input response entry",m.invalidParams,{field:`inputResponses.${o}`});r[o]=structuredClone(n)}return be(r,nt,"inputResponses"),r}function a0(e){let t=e.requestState?.trim();if(t&&Buffer.byteLength(t,"utf8")>ye)throw new p("Invalid MCP requestState: payload exceeds the protocol bound",m.invalidParams,{field:"requestState",maximumBytes:ye});let r=e.inputRequests===void 0?void 0:it(e.inputRequests,e.requestContext);if(r===void 0&&!t)throw new p("InputRequiredResult requires inputRequests or requestState",m.invalidParams,{requiredAnyOf:["inputRequests","requestState"]});return{resultType:"input_required",...r?{inputRequests:r}:{},...t?{requestState:t}:{},_meta:{[A.serverInfo]:{...e.serverInfo}}}}function gr(e){let t=Buffer.from(e);if(t.byteLength<32)throw new p("MCP requestState signing key must contain at least 32 bytes",m.invalidParams,{minimumBytes:32});return t}function c0(e,t){if(!Number.isSafeInteger(e.expiresAt)||e.expiresAt<=0||e.method.trim().length===0||e.parameterDigest.trim().length===0||e.principal.trim().length===0)throw new p("Invalid MCP requestState payload",m.invalidParams);let r=Buffer.from(JSON.stringify({version:1,...e}),"utf8");if(r.byteLength>ye/2)throw new p("MCP requestState payload exceeds the protocol bound",m.invalidParams,{maximumBytes:ye/2});let o=r.toString("base64url"),n=fr("sha256",gr(t)).update(o).digest("base64url");return`${o}.${n}`}function Hh(e){if(!_(e)||e.version!==1)throw new p("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});let{expiresAt:t,method:r,parameterDigest:o,principal:n,state:i}=e;if(typeof t!="number"||!Number.isSafeInteger(t))throw new p("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});if(typeof r!="string"||typeof o!="string"||typeof n!="string")throw new p("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});return{expiresAt:t,method:r,parameterDigest:o,principal:n,state:i}}function d0(e,t,r){let[o,n,i]=e.split(".");if(!o||!n||i!==void 0)throw new p("Invalid MCP requestState encoding",m.invalidParams,{field:"requestState"});let s=Buffer.from(n,"base64url"),a=fr("sha256",gr(t)).update(o).digest();if(s.byteLength!==a.byteLength||!qh(s,a))throw new p("Invalid MCP requestState signature",m.invalidParams,{field:"requestState"});let c;try{c=JSON.parse(Buffer.from(o,"base64url").toString("utf8"))}catch{c=null}let d=Hh(c),{expiresAt:l,method:u,parameterDigest:f,principal:g}=d;if(l<(r.nowMs??Date.now()))throw new p("Expired MCP requestState",m.invalidParams,{field:"requestState",expiredAt:l});if(u!==r.method||f!==r.parameterDigest||g!==r.principal)throw new p("MCP requestState binding mismatch",m.invalidParams,{field:"requestState"});return d}function l0(e){return be(e,nt,"request parameters"),mr("sha256").update(JSON.stringify(e)).digest("hex")}var pr=class{#e=new Set;#t;constructor(t=4096){if(!Number.isSafeInteger(t)||t<1)throw new p("Invalid MCP replay guard capacity",m.invalidParams,{maximumEntries:t});this.#t=t}consume(t){let r=mr("sha256").update(t).digest("hex");if(this.#e.has(r))throw new p("MCP requestState replay detected",m.invalidParams,{field:"requestState"});if(this.#e.size>=this.#t){let o=this.#e.values().next().value;this.#e.delete(o)}this.#e.add(r)}};function Kh(e){if(!Number.isSafeInteger(e.ttlMs)||e.ttlMs<0||e.cacheScope!=="public"&&e.cacheScope!=="private")throw new p("Invalid MCP cache policy",m.invalidParams,{ttlMs:e.ttlMs,cacheScope:e.cacheScope});return{ttlMs:e.ttlMs,cacheScope:e.cacheScope}}function u0(e,t){return{...e,...Kh(t)}}function Wh(e){return e.replaceAll("~1","/").replaceAll("~0","~")}function Xh(e,t){if(t==="#")return e;if(!t.startsWith("#/"))return;let r=e;for(let o of t.slice(2).split("/").map(Wh)){if(!_(r)&&!Array.isArray(r)||!Object.prototype.hasOwnProperty.call(r,o))return;r=r[o]}return r}function Yh(e){let t=e.maxBytes??ot.maxBytes,r=e.maxDepth??ot.maxDepth,o=e.maxNodes??ot.maxNodes;if(!Number.isSafeInteger(t)||t<2)throw new p("Invalid MCP JSON Schema work bounds",m.invalidParams);if(!Number.isSafeInteger(r)||r<1)throw new p("Invalid MCP JSON Schema work bounds",m.invalidParams);if(!Number.isSafeInteger(o)||o<1)throw new p("Invalid MCP JSON Schema work bounds",m.invalidParams);return{maximumBytes:t,maximumDepth:r,maximumNodes:o}}function Jh(e,t){let r=Array.isArray(e.value)?e.value:_(e.value)?Object.values(e.value):[];for(let o of r)t.push({value:o,depth:e.depth+1})}function Zh(e,t){if(!_(t)||typeof t.$ref!="string")return;let r=t.$ref;if(r.startsWith("#")&&Xh(e,r)===void 0)throw new p("MCP JSON Schema contains an unresolved local reference",m.invalidParams,{reference:r})}function p0(e,t={}){let{maximumBytes:r,maximumDepth:o,maximumNodes:n}=Yh(t);if(typeof e!="boolean"&&!_(e))throw new p("Invalid MCP JSON Schema root",m.invalidParams,{expected:"object or boolean"});be(e,r,"JSON Schema");let i=[{value:e,depth:0}],s=0;for(;i.length>0;){let a=i.pop();if(s+=1,s>n||a.depth>o)throw new p("MCP JSON Schema exceeds validation work bounds",m.invalidParams,{maximumDepth:o,maximumNodes:n});Zh(e,a.value),Jh(a,i)}return structuredClone(e)}import{randomUUID as Qh}from"node:crypto";import{readFile as eg}from"node:fs/promises";import yr from"node:path";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="7f5b3ba6-07cf-5317-8f62-63e84f561232")}catch{}})();var C0="io.modelcontextprotocol/tasks",tg=["working","input_required","completed","failed","cancelled"],rg=/^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,og=3600*1e3,ng=1e3,Te=1024,ig=30,sg=2e3;function st(e){return new p(e,m.invalidParams,{code:"mcp_task_not_found_or_not_authorized"})}function Ce(e){let t=e.trim();if(!rg.test(t))throw st("Unknown MCP task");return t}function br(e,t){if(typeof e!="string"||!Number.isFinite(Date.parse(e)))throw new p("Corrupt MCP task record",m.invalidParams,{field:t});return e}function Cr(e){if(!_(e)||typeof e.code!="number"||!Number.isFinite(e.code)||typeof e.message!="string")throw new p("Corrupt MCP task error",m.invalidParams);return{code:e.code,message:e.message.slice(0,Te),..._(e.data)?{data:structuredClone(e.data)}:{}}}function ag(e){if(!tg.includes(e))throw new p("Corrupt MCP task record",m.invalidParams);return e}function cg(e){if(typeof e!="string"||e.length===0)throw new p("Corrupt MCP task record",m.invalidParams);return e}function dg(e){if(typeof e!="number"||!Number.isSafeInteger(e)||e<1)throw new p("Corrupt MCP task record",m.invalidParams);return e}function lg(e){if(e!==null&&(typeof e!="number"||!Number.isSafeInteger(e)||e<0))throw new p("Corrupt MCP task record",m.invalidParams);return e}function ug(e){if(e!==void 0){if(typeof e!="number"||!Number.isSafeInteger(e)||e<0)throw new p("Corrupt MCP task record",m.invalidParams);return e}}function pg(e){if(!Array.isArray(e)||e.some(t=>typeof t!="string"))throw new p("Corrupt MCP task record",m.invalidParams);return[...e]}function mg(e){if(!_(e)||e.version!==1)throw new p("Corrupt MCP task record",m.invalidParams);let t=typeof e.taskId=="string"?Ce(e.taskId):"",r=ag(e.status),o=cg(e.principal),n=dg(e.workerPid),i=lg(e.ttlMs),s=ug(e.pollIntervalMs),a={version:1,taskId:t,status:r,principal:o,workerPid:n,createdAt:br(e.createdAt,"createdAt"),lastUpdatedAt:br(e.lastUpdatedAt,"lastUpdatedAt"),ttlMs:i,consumedInputKeys:pg(e.consumedInputKeys),...typeof e.statusMessage=="string"?{statusMessage:e.statusMessage.slice(0,Te)}:{},...typeof s=="number"?{pollIntervalMs:s}:{}};if(_(e.inputRequests)&&(a.inputRequests=structuredClone(e.inputRequests)),_(e.inputResponses)&&(a.inputResponses=structuredClone(e.inputResponses)),_(e.result)&&(a.result=structuredClone(e.result)),e.error!==void 0&&(a.error=Cr(e.error)),a.status==="input_required"&&!a.inputRequests||a.status==="completed"&&!a.result||a.status==="failed"&&!a.error)throw new p("Corrupt MCP task status payload",m.invalidParams,{status:a.status});return a}function W(e){let t={taskId:e.taskId,status:e.status,createdAt:e.createdAt,lastUpdatedAt:e.lastUpdatedAt,ttlMs:e.ttlMs,...e.statusMessage?{statusMessage:e.statusMessage}:{},...e.pollIntervalMs===void 0?{}:{pollIntervalMs:e.pollIntervalMs}};return e.status==="input_required"?{...t,status:"input_required",inputRequests:structuredClone(e.inputRequests)}:e.status==="completed"?{...t,status:"completed",result:structuredClone(e.result)}:e.status==="failed"?{...t,status:"failed",error:structuredClone(e.error)}:e.status==="cancelled"?{...t,status:"cancelled"}:{...t,status:"working"}}function ne(e){return e==="completed"||e==="failed"||e==="cancelled"}function fg(e){try{return process.kill(e,0),!0}catch(t){return!(typeof t=="object"&&t!==null&&"code"in t&&t.code==="ESRCH")}}var at=class{#e;#t;#r;#o;#i;constructor(t){this.#e=yr.resolve(t.pmRoot),this.#t=t.owner?.trim()||"pm-mcp",this.#r=t.now??(()=>new Date),this.#o=t.taskIdFactory??(()=>`mcp-task-${Qh()}`),this.#i=t.workerPid??process.pid}#s(t){return yr.join(this.#e,"runtime","mcp-tasks","records",`${Ce(t)}.json`)}async#c(t){try{return mg(JSON.parse(await eg(this.#s(t),"utf8")))}catch(r){throw fe(r)||r instanceof SyntaxError?st("Unknown MCP task"):r}}async#a(t){await je(this.#s(t.taskId),`${JSON.stringify(t,null,2)}
2
- `)}async#n(t,r,o){let n=Ce(t),i=await Be(this.#e,n,ig,this.#t,!1,!1,sg);try{let s=await this.#c(n);if(s.principal!==r)throw st("Unknown MCP task");let a=o(s);return await this.#a(a),a}finally{await i()}}async create(t){let r=Ce(this.#o()),o=t.principal.trim(),n=t.ttlMs===void 0?og:t.ttlMs,i=t.pollIntervalMs??ng;if(o.length===0||n!==null&&(!Number.isSafeInteger(n)||n<0)||!Number.isSafeInteger(i)||i<0)throw new p("Invalid MCP task creation options",m.invalidParams);let s=this.#r().toISOString(),a={version:1,taskId:r,status:"working",createdAt:s,lastUpdatedAt:s,ttlMs:n,pollIntervalMs:i,principal:o,workerPid:this.#i,consumedInputKeys:[],...t.statusMessage?.trim()?{statusMessage:t.statusMessage.trim().slice(0,Te)}:{}};return await this.#a(a),{...W(a),resultType:"task"}}async get(t,r){return W(await this.#n(t,r,o=>{if(ne(o.status))return o;let n=this.#r().getTime(),i=o.ttlMs!==null&&Date.parse(o.createdAt)+o.ttlMs<=n,s=o.workerPid!==this.#i&&!fg(o.workerPid);return!i&&!s?o:{...o,status:"failed",statusMessage:i?"Task retention expired before completion.":"Task worker ended before recording a terminal result.",lastUpdatedAt:this.#r().toISOString(),error:{code:-32603,message:i?"MCP task expired":"MCP task worker unavailable after restart",data:{recoverable:!1,createNewTask:!0}},inputRequests:void 0}}))}async requireInput(t){let r=it(t.inputRequests,t.requestContext);return W(await this.#n(t.taskId,t.principal,o=>{if(ne(o.status))return o;let n=Object.keys(r).filter(i=>o.consumedInputKeys.includes(i));if(n.length>0)throw new p("MCP task input request keys must be unique for the task lifetime",m.invalidParams,{reused:n});return{...o,status:"input_required",statusMessage:t.statusMessage?.trim().slice(0,Te),lastUpdatedAt:this.#r().toISOString(),inputRequests:r}}))}async update(t,r,o){let n=hr(o),i=[],s=[];return await this.#n(t,r,a=>{if(a.status!=="input_required"||!a.inputRequests)return a;let c={...a.inputRequests},d=a.inputResponses?{...a.inputResponses}:{};for(let[l,u]of Object.entries(n))Object.prototype.hasOwnProperty.call(c,l)&&(d[l]=u,delete c[l],i.push(l));return s=Object.keys(c).sort(),i.length===0?a:{...a,status:s.length===0?"working":"input_required",lastUpdatedAt:this.#r().toISOString(),inputRequests:s.length===0?void 0:c,inputResponses:d,consumedInputKeys:[...new Set([...a.consumedInputKeys,...i])].sort()}}),{acceptedKeys:i.sort(),remainingKeys:s}}async takeInputResponses(t,r){let o={};return await this.#n(t,r,n=>(o=structuredClone(n.inputResponses??{}),Object.keys(o).length===0?n:{...n,inputResponses:void 0})),o}async complete(t,r,o){return W(await this.#n(t,r,n=>ne(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=Cr(o);return W(await this.#n(t,r,i=>ne(i.status)?i:{...i,status:"failed",statusMessage:n.message,lastUpdatedAt:this.#r().toISOString(),error:n,inputRequests:void 0,result:void 0}))}async cancel(t,r){return W(await this.#n(t,r,o=>ne(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 T0(e){return new at(e)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="f87864d3-e499-57f7-b1e3-4ea3f30b7725")}catch{}})();var Se="io.modelcontextprotocol/subscriptionId",Tr=256,Sr=2048,_g=5e3;function hg(e,t){return new Promise((r,o)=>{let n=setTimeout(()=>o(new Error("MCP subscription sink write timed out")),_g);n.unref(),Promise.resolve().then(()=>e(t)).then(()=>{clearTimeout(n),r()},i=>{clearTimeout(n),o(i instanceof Error?i:new Error(String(i)))})})}function ct(e,t){if(e!==void 0){if(typeof e!="boolean")throw new p("Invalid MCP subscription filter",m.invalidParams,{field:`notifications.${t}`,expected:"boolean"});return e||void 0}}function gg(e){if(!_(e))throw new p("Invalid MCP subscription filter",m.invalidParams,{field:"notifications",expected:"object"});let t=ct(e.toolsListChanged,"toolsListChanged"),r=ct(e.promptsListChanged,"promptsListChanged"),o=ct(e.resourcesListChanged,"resourcesListChanged"),n;if(e.resourceSubscriptions!==void 0){if(!Array.isArray(e.resourceSubscriptions)||e.resourceSubscriptions.length>Tr)throw new p("Invalid MCP resource subscriptions",m.invalidParams,{field:"notifications.resourceSubscriptions",maximum:Tr});let i=new Set;for(let s of e.resourceSubscriptions){if(typeof s!="string"||s.trim().length===0||Buffer.byteLength(s,"utf8")>Sr)throw new p("Invalid MCP resource subscription URI",m.invalidParams,{field:"notifications.resourceSubscriptions",maximumBytes:Sr});i.add(s)}i.size>0&&(n=[...i].sort())}return{...t?{toolsListChanged:t}:{},...r?{promptsListChanged:r}:{},...o?{resourcesListChanged:o}:{},...n?{resourceSubscriptions:n}:{}}}function yg(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 wr=class{#e;#t=new Map;#r;constructor(t){this.#e=structuredClone(t.capabilities),this.#r={...t.serverInfo}}get size(){return this.#t.size}async open(t){if(this.#t.has(t.id))throw new p("MCP subscription id is already active",m.invalidParams,{subscriptionId:t.id});let r=yg(gg(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:{[Se]:t.id},notifications:structuredClone(r)}},!0)}catch(n){throw this.#t.delete(t.id),n}return structuredClone(r)}async emitListChanged(t){let r=`${t}ListChanged`,o=`notifications/${t}/list_changed`,n=[];for(let[i,s]of this.#t)s.filter[r]===!0&&n.push(this.#o(i,s,{jsonrpc:"2.0",method:o,params:{_meta:{[Se]:i}}}));return(await Promise.all(n)).filter(Boolean).length}async emitResourceUpdated(t){let r=[];for(let[o,n]of this.#t)n.filter.resourceSubscriptions?.includes(t)&&r.push(this.#o(o,n,{jsonrpc:"2.0",method:"notifications/resources/updated",params:{_meta:{[Se]:o},uri:t}}));return(await Promise.all(r)).filter(Boolean).length}async#o(t,r,o,n=!1){let i=r.writeQueue.then(async()=>{if(this.#t.get(t)!==r)return!1;try{return await hg(r.sink,o),!0}catch(s){if(this.#t.get(t)===r&&this.#t.delete(t),n)throw s;return!1}});return r.writeQueue=i.then(()=>{},()=>{}),i}close(t){if(this.#t.delete(t))return{...rt({resultType:"complete",_meta:{[Se]:t}},this.#r)}}closeAll(){let t=[];for(let r of this.#t.keys()){let o=this.close(r);t.push({id:r,result:o})}return t}};(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="7d591d0b-f009-519c-8024-c6fa18effb8e")}catch{}})();var Er=/^=\?base64\?([A-Za-z0-9+/]*={0,2})\?=$/u,bg=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/u,Ar=/^[\t\x20-\x7E]*$/u,vr=new Set(["prompts/get","resources/read","tools/call"]);function Cg(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 v(e,t){throw new p(e,m.headerMismatch,{header:t})}function Or(e){let t=typeof e=="boolean"?String(e).toLowerCase():String(e);return t.length>0&&t.trim()===t&&Ar.test(t)&&!Er.test(t)?t:`=?base64?${Buffer.from(t,"utf8").toString("base64")}?=`}function Ir(e,t){let r=Er.exec(e);if(r){let o=r[1],n=Buffer.from(o,"base64");return n.toString("base64")!==o||n.length===0?v("Malformed MCP Base64 header value",t):n.toString("utf8")}return e.length===0||e.trim()!==e||!Ar.test(e)?v("Malformed MCP header value",t):e}function we(e){return Array.isArray(e)?e.some(we):_(e)?Object.prototype.hasOwnProperty.call(e,"x-mcp-header")||Object.values(e).some(we):!1}function Tg(e,t,r){let o=e["x-mcp-header"];if(o===void 0)return;let n=e.type;if(typeof o!="string"||!bg.test(o)||!["boolean","integer","string"].includes(String(n))||r.has(o.toLowerCase()))throw new p("Invalid MCP x-mcp-header annotation",m.invalidParams,{field:t.join("."),annotation:o});return r.add(o.toLowerCase()),{name:o,path:t,type:n}}function Rr(e){if(!_(e))throw new p("Invalid MCP tool schema",m.invalidParams,{field:"inputSchema",expected:"object"});let t=[],r=new Set,o=(n,i)=>{let s=n.properties;if(s!==void 0){if(!_(s))throw new p("Invalid MCP tool schema properties",m.invalidParams,{field:"inputSchema.properties"});for(let[a,c]of Object.entries(s)){if(!_(c))continue;let d=[...i,a],l=Tg(c,d,r);l&&t.push(l);for(let[u,f]of Object.entries(c))if(u!=="properties"&&u!=="x-mcp-header"&&we(f))throw new p("MCP x-mcp-header is not statically reachable",m.invalidParams,{field:d.join("."),keyword:u});o(c,d)}}};for(let[n,i]of Object.entries(e))if(n!=="properties"&&we(i))throw new p("MCP x-mcp-header is not statically reachable",m.invalidParams,{field:"inputSchema",keyword:n});return o(e,[]),t}function Pr(e,t){let r=e;for(let o of t){if(!_(r))return;r=r[o]}return r}function Mr(e,t){let r=e==="resources/read"?t.uri:t.name;return typeof r=="string"?r:void 0}function Sg(e,t){let r=_(e.arguments)?e.arguments:{},o={};for(let n of Rr(t)){let i=Pr(r,n.path);if(i==null)continue;if(!(n.type==="integer"&&typeof i=="number"&&Number.isSafeInteger(i)||n.type==="boolean"&&typeof i=="boolean"||n.type==="string"&&typeof i=="string"))throw new p("Invalid MCP custom header argument",m.invalidParams,{field:n.path.join("."),expected:n.type});o[`Mcp-Param-${n.name}`]=Or(i)}return o}function v0(e){let t=_(e.request.params)?e.request.params:void 0,r=tt(t),o=e.request.method;if(typeof o!="string"||o.length===0)return v("Missing MCP request method","Mcp-Method");let n={Accept:"application/json, text/event-stream","Content-Type":"application/json","MCP-Protocol-Version":r.protocolVersion,"Mcp-Method":o},i=Mr(o,t);if(vr.has(o)){if(i===void 0)return v("Missing MCP request name","Mcp-Name");n["Mcp-Name"]=Or(i)}return o==="tools/call"&&e.toolSchema!==void 0&&Object.assign(n,Sg(t,e.toolSchema)),n}function wg(e,t){let r=t.method;(typeof r!="string"||r.length===0)&&v("Missing MCP request method","Mcp-Method");let o=_(t.params)?t.params:void 0,n=tt(o).protocolVersion;if(e.get("mcp-protocol-version")!==n&&v("MCP protocol header does not match request metadata","MCP-Protocol-Version"),e.get("mcp-method")!==r&&v("MCP method header does not match request body","Mcp-Method"),vr.has(r)){let i=e.get("mcp-name"),s=Mr(r,o);(i===void 0||s===void 0||Ir(i,"Mcp-Name")!==s)&&v("MCP name header does not match request body","Mcp-Name")}e.has("last-event-id")&&v("MCP SSE resumability is not supported","Last-Event-ID")}function Eg(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 Ag(e){let t=_(e.params.arguments)?e.params.arguments:{};for(let r of Rr(e.toolSchema)){let o=Pr(t,r.path),n=`Mcp-Param-${r.name}`,i=e.headers.get(n.toLowerCase());if(o==null){i!==void 0&&v("Unexpected MCP parameter header",n);continue}i===void 0&&v("Missing MCP parameter header",n),Eg(r,o,Ir(i,n))||v("MCP parameter header does not match request body",n)}}function O0(e){let t=Cg(e.headers),r=typeof e.request.method=="string"?e.request.method:"";wg(t,e.request),!(r!=="tools/call"||e.toolSchema===void 0)&&Ag({headers:t,params:e.request.params,toolSchema:e.toolSchema})}var I0=K;import{AsyncLocalStorage as vg}from"node:async_hooks";import{createHash as kr,timingSafeEqual as Og}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="6a5310f6-3add-5108-b39f-61607918dc9f")}catch{}})();var y=class extends Error{httpStatus;challenge;constructor(t,r,o){super(t),this.name="PmMcpAuthorizationError",this.httpStatus=r,this.challenge=o}},Ig=/^00-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})$/u,Rg=/^[a-z][a-z0-9_*/-]{0,255}$/u,Pg=/^(?:[a-z0-9][a-z0-9_*/-]{0,240})@[a-z][a-z0-9_*/-]{0,13}$/u,Mg=/^[\x20-\x2B\x2D-\x3C\x3E-\x7E]{0,255}[\x21-\x2B\x2D-\x3C\x3E-\x7E]$/u,Nr=/^[\x21\x23-\x5B\x5D-\x7E]+$/u,Lr=/^[A-Za-z0-9!#$%&'*+.^_`|~-]+$/u,kg=/^[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]*$/u,xg=/%(?![0-9A-Fa-f]{2})/u,Ng=512,Lg=32,Dg=180,$g=8192,Fg=8192,Dr=new vg;function E(e,t,r=!1){if(new RegExp("\\p{Cc}","u").test(e))throw new y(`Invalid ${t}`,401);let o;try{o=new URL(e)}catch{throw new y(`Invalid ${t}`,401)}let n=o.hostname==="127.0.0.1"||o.hostname==="localhost";if(o.hash.length>0||o.protocol!=="https:"&&!(r&&n&&o.protocol==="http:"))throw new y(`Invalid ${t}`,401);return o}function jg(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 x0(e){let t=E(e.resource,"protected resource URI",!0).href.replace(/\/$/u,"");if(e.authorizationServers.length===0)throw new y("Protected resource metadata requires an authorization server",401);let r=e.authorizationServers.map(n=>E(n,"authorization server issuer").href.replace(/\/$/u,"")),o=[...new Set(e.scopes??[])];if(o.some(n=>!Nr.test(n)))throw new y("Invalid authorization scope",401);return{resource:t,authorization_servers:r,...o.length>0?{scopes_supported:o.sort()}:{}}}function N0(e){let t=E(e,"authorization server issuer"),r=t.pathname.replace(/^\/+|\/+$/gu,""),o=t.origin;return r?[`${o}/.well-known/oauth-authorization-server/${r}`,`${o}/.well-known/openid-configuration/${r}`,`${o}/${r}/.well-known/openid-configuration`]:[`${o}/.well-known/oauth-authorization-server`,`${o}/.well-known/openid-configuration`]}function L0(e,t){if(!_(e)||typeof e.issuer!="string")throw new y("Invalid authorization server metadata",401);let r=E(t,"expected issuer").href.replace(/\/$/u,"");if(E(e.issuer,"metadata issuer").href.replace(/\/$/u,"")!==r)throw new y("Authorization server issuer mismatch",401);if(!Array.isArray(e.code_challenge_methods_supported)||!e.code_challenge_methods_supported.includes("S256"))throw new y("Authorization server does not support required S256 PKCE",401);let n=d=>{let l=e[d];if(typeof l!="string")throw new y(`Authorization server metadata requires ${d}`,401);return E(l,d).href},i=d=>{let l=e[d];return typeof l=="string"?E(l,d).href:void 0},s=n("authorization_endpoint"),a=n("token_endpoint"),c=i("registration_endpoint");return{issuer:r,authorization_endpoint:s,token_endpoint:a,code_challenge_methods_supported:[...new Set(e.code_challenge_methods_supported.filter(d=>typeof d=="string"))],...e.client_id_metadata_document_supported===!0?{client_id_metadata_document_supported:!0}:{},...c?{registration_endpoint:c}:{}}}function D0(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 $0(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 F0(e,t){let r=E(t,"client metadata document URL");if(r.pathname==="/"||!_(e)||e.client_id!==r.href||typeof e.client_name!="string"||e.client_name.trim().length===0||!Array.isArray(e.redirect_uris)||e.redirect_uris.length===0)throw new y("Invalid Client ID Metadata Document",401);for(let o of e.redirect_uris){if(typeof o!="string")throw new y("Invalid client redirect URI",401);E(o,"client redirect URI",!0)}return structuredClone(e)}function j0(e){if(e.redirectUris.length===0||e.clientName.trim().length===0)throw new y("Invalid dynamic client registration metadata",401);let t=e.redirectUris.map(r=>E(r,"redirect URI",!0).href);return{application_type:e.applicationType,client_name:e.clientName.trim().slice(0,128),redirect_uris:t,grant_types:["authorization_code","refresh_token"],response_types:["code"],token_endpoint_auth_method:"none"}}var xr=class{#e=new Map;set(t,r){let o=E(t,"credential issuer").href;this.#e.set(o,structuredClone(r))}get(t){let r=E(t,"credential issuer").href,o=this.#e.get(r);return o?structuredClone(o):void 0}delete(t){let r=E(t,"credential issuer").href;return this.#e.delete(r)}};function Gg(e){let t=e.traceparent,r=e.tracestate;if(t!==void 0){let o=typeof t=="string"?Ig.exec(t):null;if(!o)throw new y("Invalid MCP traceparent",403);let n=o[1],i=o[2];if(/^0+$/u.test(n)||/^0+$/u.test(i))throw new y("Invalid MCP traceparent",403)}if(r!==void 0&&(typeof r!="string"||!Bg(r)))throw new y("Invalid MCP tracestate",403);return{...typeof t=="string"?{traceparent:t}:{},...typeof r=="string"?{tracestate:r}:{}}}function F(e){return e.replace(/^[ \t]*|[ \t]*$/gu,"")}function Ug(e){return Rg.test(e)||Pg.test(e)}function Bg(e){if(Buffer.byteLength(e,"utf8")>Ng)return!1;let t=e.split(",");if(t.length>Lg)return!1;let r=new Set;for(let o of t){let n=F(o);if(n.length===0)continue;let i=n.indexOf("="),s=i>0?n.slice(0,i):"",a=i>0?n.slice(i+1):"";if(!Ug(s)||!Mg.test(a)||r.has(s))return!1;r.add(s)}return!0}function $r(e){return kg.test(e)&&!xg.test(e)}function qg(e){let t=F(e),r=t.indexOf("="),o=F(r>=0?t.slice(0,r):t),n=r>=0?F(t.slice(r+1)):void 0;return Lr.test(o)&&(n===void 0||$r(n))}function zg(e){let t=F(e),r=t.split(";"),o=r[0],n=r.slice(1),i=o.indexOf("="),s=F(i>0?o.slice(0,i):""),a=i>0?F(o.slice(i+1)):"";if(!(!Lr.test(s)||!$r(a)||!n.every(qg)))return{key:s,serialized:t}}function Vg(e,t){if(e===void 0)return;if(typeof e!="string"||Buffer.byteLength(e,"utf8")>$g)throw new y("Invalid MCP baggage",403);let r=new Set(t),o=e.split(",");if(o.length>Dg)throw new y("Invalid MCP baggage",403);let n=[];for(let i of o){let s=zg(i);if(!s)throw new y("Invalid MCP baggage",403);r.has(s.key)&&n.push(s.serialized)}return n.length>0?n.join(","):void 0}function G0(e,t={}){let r=_(e)&&_(e._meta)?e._meta:{},o=Vg(r.baggage,t.baggageAllowlist??[]);return{...Gg(r),...o?{baggage:o}:{}}}function U0(e,t){return Dr.run(structuredClone(e),t)}function B0(){let e=Dr.getStore();return e?{...e}:void 0}async function q0(e){let t=E(e.policy.resourceMetadataUrl,"protected resource metadata URL",!0).href,r=[...new Set(e.policy.requiredScopes??[])];if(r.some(u=>!Nr.test(u)))throw new y("Invalid authorization scope",401);let o=`Bearer resource_metadata="${t}"`;if(new URL(e.requestUrl,e.policy.resource).searchParams.has("access_token"))throw new y("Access tokens must not appear in URI query parameters",401,o);let s=jg(e.headers,"authorization")?.match(/^Bearer ([^\s]+)$/iu);if(!s)throw new y("Missing or malformed bearer token",401,o);let a=s[1];if(Buffer.byteLength(a,"utf8")>Fg)throw new y("Missing or malformed bearer token",401,o);let c;try{c=await e.policy.verifyAccessToken(a)}catch{throw new y("Invalid bearer token",401,o)}let d=Array.isArray(c.audience)?c.audience:[c.audience];if(c.issuer!==e.policy.issuer||!d.includes(e.policy.resource))throw new y("Bearer token issuer or audience mismatch",401,o);let l=r.filter(u=>!c.scopes.includes(u));if(l.length>0)throw new y("Bearer token has insufficient scope",403,`${o}, scope="${l.join(" ")}"`);return{...c,audience:[...d],scopes:[...c.scopes]}}function z0(e){let t=kr("sha256").update(e.token).digest();return r=>{let o=kr("sha256").update(r).digest();if(!Og(t,o))throw new y("Invalid bearer token",401);return structuredClone(e.claims)}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="4f17095e-2dba-530c-935c-1803ed359510")}catch{}})();var dt="io.modelcontextprotocol/ui",Ee="2026-01-26",Gr="text/html;profile=mcp-app",Fr=Object.freeze({specVersion:Ee,mimeTypes:[Gr]});function K0(e){let t=e.clientCapabilities.extensions;if(!_(t))return!1;let r=t[dt];if(r===void 0)return!1;if(!_(r))throw new p("Invalid MCP Apps client capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[dt]:Fr}}});let o=r.mimeTypes,n=r.specVersion;if(!Array.isArray(o)||!o.includes(Gr)||n!==void 0&&n!==Ee)throw new p("Unsupported MCP Apps client capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[dt]:Fr}}});return!0}var Hg={csp:{connectDomains:[],resourceDomains:[],frameDomains:[]},permissions:{},prefersBorder:!0},Ur=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:Hg})));function W0(e){return Ur.find(t=>t.uri===e)}function X0(e){let t=new Map(Ur.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 jr(e){return e.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;")}function Y0(e){let t=jr(e.name),r=jr(e.description),o=JSON.stringify({name:`pm-${e.id}-view`,version:Ee}),n=JSON.stringify(Ee);return`<!doctype html>
1
+ import{A as Fh,B as jh,C as GM,D as UM,E as BM,a as fs,b as _s,c as hs,d as gs,e as PM,f as MM,g as Oh,h as Ih,i as Rh,k as Ph,l as Mh,m as kh,n as xh,o as Nh,p as Lh,q as Dh,r as $h,s as kM,t as xM,u as NM,v as LM,w as DM,x as $M,y as FM,z as jM}from"./chunks/chunk-WLJJ4MAU.js";import{A as Ik,B as Rk,C as Pk,D as Mk,E as kk,F as xk,G as Nk,H as Lk,I as Dk,J as $k,K as Fk,L as jk,M as Gk,N as Uk,O as Bk,P as qk,Q as zk,R as Vk,S as Hk,T as Kk,U as Wk,V as Xk,W as Yk,X as Jk,Y as Zk,a as rk,b as ok,c as nk,d as ik,e as sk,f as ak,g as ck,h as dk,i as lk,j as uk,k as pk,l as mk,m as fk,n as _k,o as hk,p as gk,q as yk,r as bk,s as Ck,t as Tk,u as Sk,v as wk,w as Ek,x as Ak,y as vk,z as Ok}from"./chunks/chunk-5P5PYCZX.js";import{a as qM,b as zM,c as VM,d as HM}from"./chunks/chunk-RKPUO75B.js";import{a as KM,b as WM,c as XM,d as YM,e as JM,f as ZM,g as QM,h as ek,i as tk}from"./chunks/chunk-3RB6Z7XE.js";import{$ as nr,$a as o_,$b as oh,A as tO,Aa as Af,Ab as P_,B as rO,Ba as vf,Bb as M_,C as mu,Ca as Of,Cb as k_,D as kp,Da as If,Db as x_,E as xp,Ea as Rf,Eb as N_,F as Np,Fa as Pf,Fb as L_,G as Lp,Ga as Mf,Gb as D_,H as Dp,Ha as kf,Hb as $_,I as Ye,Ia as xf,Ib as F_,J as $p,Ja as Nf,Jb as j_,K as Fp,Ka as Lf,Kb as G_,L as jp,La as Df,Lb as U_,M as Gp,Ma as $f,Mb as B_,N as Up,Na as Ff,Nb as q_,O as Bp,Oa as jf,Ob as z_,P as tM,Pa as Gf,Pb as V_,Q as rM,Qa as Uf,Qb as H_,R as oM,Ra as dr,Rb as K_,S as Xt,Sa as he,Sb as W_,T as Yt,Ta as Xf,Tb as X_,U as Jt,Ua as Yf,Ub as Y_,V as Zt,Va as Jf,Vb as J_,W as Qt,Wa as Zf,Wb as Z_,X as er,Xa as Qf,Xb as Q_,Y as tr,Ya as e_,Yb as eh,Z as rr,Za as t_,Zb as th,_ as or,_a as r_,_b as rh,a as zc,aa as ir,ab as n_,ac as nh,b as Vc,ba as ym,bb as i_,bc as ih,c as Hc,ca as bm,cb as s_,cc as sh,d as Rv,da as Cm,db as a_,dc as ah,e as Pv,ea as Tm,eb as c_,ec as ch,f as Kc,fa as Sm,fb as d_,fc as dh,g as $v,ga as Je,gb as l_,gc as lh,h as Fv,ha as wm,hb as u_,hc as uh,i as jv,ia as Em,ib as p_,ic as ph,j as Gv,ja as Am,jb as m_,jc as mh,k as Uv,ka as vm,kb as f_,kc as fh,l as Bv,la as Om,lb as __,lc as _h,m as qv,ma as Im,mb as h_,mc as hh,n as zv,na as Rm,nb as g_,nc as gh,o as Vv,oa as Pm,ob as y_,oc as yh,p as Hv,pa as gM,pb as b_,pc as bh,q as Kv,qa as _f,qb as C_,qc as Ch,r as Wv,ra as hf,rb as T_,rc as Th,s as Xv,sa as gf,sb as S_,sc as Sh,t as Yv,ta as yf,tb as w_,tc as wh,u as Zc,ua as bf,ub as E_,uc as Eh,v as Qc,va as Cf,vb as A_,vc as Ah,w as Jv,wa as Tf,wb as v_,wc as vh,x as Zv,xa as Sf,xb as O_,y as Qv,ya as wf,yb as I_,z as eO,za as Ef,zb as R_}from"./chunks/chunk-BOZ4HVYL.js";import{a as Wt,f as jP,g as GP,h as Vp,i as Hp}from"./chunks/chunk-YMMLKKEP.js";import{A as HP,B as KP,C as WP,D as XP,E as YP,F as JP,G as ZP,H as QP,I as eM,J as om,K as nm,L as im,M as pM,N as Mm,O as mM,P as fM,Q as _M,R as hM,b as pu,c as RR,d as Mp,e as vP,f as OP,g as IP,h as RP,i as PP,j as MP,k as kP,l as xP,m as NP,n as LP,o as DP,p as qp,q as $P,r as Qp,s as em,t as tm,u as rm,v as UP,w as BP,x as qP,y as zP,z as VP}from"./chunks/chunk-Y2P3DSSO.js";import{$a as cu,$b as Ep,$c as Fm,A as jO,Aa as Ll,Ab as fP,Ac as lm,Ad as Qm,B as GO,Ba as Dl,Bb as _P,Bc as um,Bd as ef,C as UO,Ca as $l,Cb as hP,Cc as pm,Cd as tf,D as BO,Da as Fl,Db as rp,Dc as mm,Dd as rf,E as ZO,Ea as jl,Eb as op,Ec as fm,Ed as of,Fa as Gl,Fc as _m,Fd as RM,Ga as Ul,Gb as np,Gc as hm,Gd as nf,Ha as Bl,Hb as ip,Hc as gm,Hd as sf,Ia as ql,Ib as gP,Ic as dM,Id as af,J as Yd,Ja as zl,Jb as sp,Jc as lM,Jd as cf,Ka as Vl,Kb as ap,Kc as uM,Kd as df,La as Hl,Lb as cp,Lc as yM,Ld as lf,Ma as Kl,Mb as dp,Mc as sr,Md as uf,Na as Wl,Nb as lp,Nc as bM,Nd as pf,Oa as Xl,Ob as up,Oc as Ze,Od as mf,Pa as Yl,Pb as pp,Pc as oe,Pd as ff,Qa as Jl,Qb as mp,Qc as km,Qd as Bf,Ra as Zl,Rb as fp,Rd as qf,Sa as Ql,Sb as _p,Sd as zf,Ta as eu,Tb as hp,Tc as Qe,Td as Vf,Ua as tu,Ub as gp,Uc as xm,Ud as Hf,Va as ru,Vb as yp,Vc as Nm,Vd as Kf,Wa as ou,Wb as bp,Wd as Wf,Xa as nu,Xb as Cp,Xc as _e,Ya as iu,Yb as Tp,Yc as Lm,Za as su,Zb as Sp,Zc as Dm,_a as au,_b as wp,_c as $m,a as mO,aa as QO,ab as du,ac as yP,ad as CM,b as fO,ba as eI,bb as lu,bc as bP,bd as TM,c as _O,ca as Jd,cb as SR,cc as Ap,cd as SM,d as hO,da as Zd,db as wR,dd as wM,e as gO,ea as Qd,eb as ER,ed as EM,f as yO,fa as el,fb as AR,fd as ar,g as bO,ga as tl,gb as vR,gc as vp,gd as AM,h as CO,ha as rl,hb as OR,hd as vM,i as TO,ia as ol,ib as IR,ic as Op,id as cr,j as SO,ja as NI,jb as fu,jc as Ip,jd as OM,k as wO,ka as LI,kb as _u,kc as Rp,kd as IM,l as EO,la as DI,lb as hu,lc as Pp,m as AO,ma as $I,mb as gu,mc as CP,md as jm,n as vO,na as FI,nb as yu,nc as TP,nd as Gm,o as OO,oa as jI,oc as SP,od as Um,p as IO,pa as GI,pb as bu,pc as Xe,pd as Bm,q as RO,qa as HI,qb as Cu,qc as wP,qd as qm,r as PO,ra as KI,rb as Tu,rc as Kt,rd as zm,s as MO,sa as Rl,sb as Su,sc as EP,sd as Vm,t as kO,ta as Pl,tb as wu,tc as AP,td as Hm,u as xO,ua as WI,ub as Zu,uc as FP,ud as Km,v as NO,va as XI,vb as Qu,vc as zp,vd as Wm,w as LO,wa as Ml,wb as ep,wc as sm,wd as Xm,x as DO,xa as kl,xb as tp,xc as am,xd as Ym,y as $O,ya as xl,yb as pP,yc as cm,yd as Jm,z as FO,za as Nl,zb as mP,zc as dm,zd as Zm}from"./chunks/chunk-WDF7PP4P.js";import{Aa as gl,Ba as yl,Ca as bl,H as lI,Ha as Cl,I as uI,Ia as Tl,Ja as Sl,K as pI,Ka as wl,L as mI,La as El,M as fI,Ma as Al,N as pl,Na as vl,O as ml,P as fl,Pa as Ol,Q as _l,Qa as Il,R as Gt,Ra as Kp,Sa as Wp,Ta as Xp,Va as Yp,Wa as Jp,Xa as Zp,a as Lv,b as Dv,c as Wc,d as Xc,f as Yc,g as Jc,h as tI,i as rI,j as oI,k as nI,l as iI,m as sI,n as aI,o as cI,p as nl,q as il,r as sl,s as al,t as cl,u as dI,ua as Ut,v as dl,va as Bt,w as ll,wa as qt,x as ul,xa as zt,ya as hl}from"./chunks/chunk-3AHONKLL.js";import{$ as wd,$a as UI,$b as FR,$c as nM,A as XO,Ab as lR,Ac as Mu,B as YO,Bb as uR,Bc as ku,C as td,Ca as _I,Cb as pR,Cc as xu,D as rd,Da as hI,Db as mR,Dc as Vt,E as od,Ea as gI,Eb as fR,Ec as Nu,F as nd,Fa as yI,Fc as Lu,G as id,Ga as bI,Gc as Du,H as sd,Ha as CI,Hb as _R,Hc as $u,I as ad,Ia as TI,Ib as hR,Ic as Fu,J as cd,Ja as SI,Jb as gR,Jc as ju,K as dd,Ka as wI,Kb as yR,Kc as Gu,L as ld,La as EI,Lb as bR,Lc as Uu,M as ud,Ma as AI,Mb as CR,Mc as Bu,N as We,Na as vI,Nb as TR,Nc as qu,O as pd,Oa as OI,Ob as uu,Oc as zu,P as md,Pb as Eu,Pc as Vu,Q as fd,Qb as Au,Qc as Hu,R as _d,Rb as vu,Rc as Ku,S as JO,Sa as II,Sb as Ou,Sc as Wu,Tb as PR,Tc as Xu,U as hd,Ua as RI,Ub as MR,Uc as Ht,V as gd,Va as PI,Vb as kR,Vc as Yu,W as yd,Wb as xR,Wc as cP,X as bd,Xa as MI,Xb as NR,Xc as dP,Y as Cd,Ya as kI,Yb as LR,Yc as lP,Z as Td,Za as xI,Zb as DR,Zc as Ju,_ as Sd,_b as $R,_c as uP,aa as Ed,ab as BI,ac as jR,ad as iM,b as vv,ba as Ad,bb as qI,bc as GR,bd as sM,c as Ov,ca as vd,cb as zI,cc as UR,cd as aM,d as Iv,da as Od,db as VI,dc as BR,dd as cM,e as Mv,ea as Id,eb as YI,ec as qR,f as kv,fa as Rd,fb as JI,fc as zR,g as xv,ga as Pd,gb as ZI,gc as VR,h as Nv,ha as Md,hb as QI,hc as HR,i as oO,ia as kd,ib as eR,ic as KR,j as nO,ja as xd,jb as tR,jc as WR,k as iO,ka as Nd,kb as rR,kc as XR,l as sO,la as Ld,lb as oR,lc as YR,m as aO,ma as Dd,mb as nR,mc as JR,n as cO,na as $d,nb as iR,nc as ZR,o as dO,oa as Fd,ob as sR,oc as QR,p as lO,pa as jd,pb as aR,pc as eP,q as uO,qa as Gd,qb as cR,qc as tP,r as pO,ra as Ud,rc as rP,sa as Bd,sc as oP,t as ed,ta as qd,tc as nP,u as qO,ua as zd,uc as iP,v as zO,va as Vd,vc as sP,w as VO,wa as Hd,wc as aP,x as HO,xa as Kd,xc as Iu,y as KO,ya as Wd,yc as Ru,z as WO,za as Xd,zb as dR,zc as Pu}from"./chunks/chunk-UKLOSZV6.js";import{$b as jC,$c as pT,$d as wn,$e as Jn,$f as zS,$g as cw,$h as iE,$i as qE,$j as Ji,$k as ss,$l as Xs,$m as Na,$n as re,Aa as tn,Ab as PC,Ac as WC,Ad as MT,Ae as cS,Af as gS,Ag as bi,Ah as Lw,Ai as wE,Aj as oA,Ak as kA,Al as Ss,Am as ca,An as ac,Bb as MC,Bc as XC,Bd as kT,Be as dS,Bf as yS,Bg as Ci,Bh as Dw,Bi as EE,Bj as Lt,Bk as xA,Bl as ws,Bm as da,Bn as cc,Cb as kC,Ce as Ln,Cf as bS,Cg as Ti,Ch as $w,Ci as AE,Ck as NA,Cl as Es,Cm as la,Cn as dc,Dc as YC,Dd as xT,De as Dn,Df as CS,Dg as Si,Dh as Fw,Di as vE,Dj as nA,Dk as LA,Dl as As,Dm as ua,Dn as lc,E as Yb,Ea as rn,Ec as _n,Ed as NT,Ee as $,Ef as TS,Eg as wi,Eh as jw,Ei as OE,Ej as iA,Ek as DA,El as vs,Em as pa,En as uc,Fe as $n,Ff as SS,Fg as Ei,Fh as Gw,Fi as IE,Fj as sA,Fk as $A,Fl as Os,Fm as ma,Fn as pc,G as Jb,Ga as on,Gc as hn,Gd as LT,Gf as wS,Gg as Ai,Gh as Uw,Gi as RE,Gj as aA,Gk as FA,Gl as Is,Gn as mc,Ha as nn,Hc as gn,Hd as DT,Hf as ES,Hg as vi,Hh as Bw,Hi as PE,Hj as cA,Hk as jA,Hl as Rs,Hm as fa,Hn as fc,Ia as sn,Ib as xC,Id as $T,If as AS,Ig as Oi,Ih as qw,Ii as ME,Ik as Dt,Il as Ps,Im as _a,In as _c,J as Zb,Jb as Ue,Jd as FT,Jf as vS,Jg as Ii,Jh as zw,Ji as kE,Jk as GA,Jl as Ms,Jm as ha,Jn as hc,Kb as Pt,Kc as JC,Kd as jT,Kf as OS,Kg as Ri,Kh as Vw,Ki as xE,Kj as dA,Kl as ks,Km as ga,Kn as gc,Lb as NC,Lc as ZC,Ld as GT,Le as lS,Lf as IS,Lg as Pi,Lh as Hw,Li as NE,Ll as xs,Lm as ya,Ln as yc,Mb as LC,Mc as QC,Md as UT,Me as uS,Mf as RS,Mg as Mi,Mh as Kw,Mk as UA,Ml as Ns,Mm as ba,Mn as bc,N as Qb,Nb as DC,Nc as eT,Nd as BT,Ne as pS,Nf as PS,Ng as ki,Nh as Ww,Ni as qi,Nk as BA,Nl as Ls,Nm as Ca,Nn as Cc,O as D,Ob as $C,Oc as tT,Od as qT,Oe as Fn,Of as MS,Og as xi,Oh as Xw,Oi as zi,Oj as Ki,Ok as qA,Ol as Ds,Om as Ta,On as Tc,P as eC,Pb as H,Pc as rT,Pd as zT,Pe as jn,Pf as kS,Pg as Ni,Ph as Yw,Pi as Vi,Pj as lA,Pk as zA,Pl as $s,Pm as Sa,Pn as Sc,Q as b,Qb as FC,Qc as oT,Qd as VT,Qe as Gn,Qf as xS,Qg as Li,Qh as Jw,Qj as uA,Qk as VA,Ql as Fs,Qm as wa,Qn as wc,Rc as yn,Rd as HT,Re as Un,Rf as NS,Rg as Di,Ri as LE,Rj as pA,Rk as HA,Rl as js,Rm as Ea,Rn as Ec,S as tC,Sc as nT,Se as Bn,Sf as LS,Sg as $i,Sh as Zw,Si as DE,Sj as mA,Sk as KA,Sl as Gs,Sm as Aa,Sn as Ac,T as rC,Tc as iT,Te as qn,Tf as DS,Tg as Fi,Th as Qw,Ti as $E,Tk as WA,Tl as Us,Tm as va,Tn as vc,Uc as sT,Ue as zn,Uf as $S,Ug as ji,Ui as FE,Uj as fA,Uk as es,Ul as Bs,Um as Oa,Un as Oc,Vc as aT,Ve as Vn,Vf as FS,Vg as Gi,Vi as jE,Vj as _A,Vk as ts,Vl as qs,Vm as Ia,Vn as Ic,W as oC,Wc as cT,We as Hn,Wf as jS,Wg as ow,Wh as eE,Wj as hA,Wk as rs,Wl as zs,Wm as Ra,Wn as Rc,Xa as SC,Xc as dT,Xd as KT,Xe as Kn,Xf as GS,Xg as nw,Xh as tE,Xi as GE,Xj as gA,Xk as os,Xl as Vs,Xm as Pa,Xn as Pc,Ya as wC,Yc as lT,Ye as Wn,Yf as US,Yg as iw,Yh as rE,Yj as Wi,Yk as ns,Yl as Hs,Ym as Ma,Yn as Mc,Z as nC,Za as EC,Zc as uT,Zd as Sn,Ze as Xn,Zf as BS,Zg as sw,Zh as oE,Zi as UE,Zj as Xi,Zk as is,Zl as Ks,Zm as ka,_ as Ot,_c as bn,_d as WT,_e as Yn,_f as qS,_g as aw,_h as nE,_i as BE,_j as Yi,_l as Ws,_m as xa,_n as Ke,aa as It,ab as an,ac as mn,ad as Cn,af as Zn,ag as VS,ah as dw,ai as sE,aj as zE,ak as Zi,al as as,am as Ys,an as La,ao as kc,b as jo,ba as Jo,bb as AC,bc as fn,be as XT,bf as mS,bg as HS,bh as lw,bi as aE,bj as VE,bl as cs,bm as sv,bn as Da,c as Go,ca as Zo,cb as vC,cc as GC,cd as mT,ce as YT,cf as fS,cg as KS,ch as uw,ci as cE,ck as Qi,cl as ds,cm as av,cn as $a,co as gv,d as Uo,da as Rt,db as OC,dc as UC,dd as fT,de as JT,df as Be,dg as WS,dh as pw,di as dE,dk as yA,dl as ls,dm as Ve,dn as Fa,do as yv,e as Bo,eb as IC,ec as P,ed as _T,ee as En,ef as Qn,eg as XS,eh as mw,ei as lE,el as us,em as cv,en as ja,f as $e,fa as iC,fc as BC,fd as hT,fe as An,ff as _S,fg as YS,fh as fw,fi as uE,fk as bA,fl as ps,fm as dv,fn as Ga,g as qo,gb as cn,gc as Mt,gd as gT,ge as vn,gf as ei,gg as JS,gh as _w,gi as pE,gk as CA,gl as ms,gm as lv,gn as Ua,go as bv,h as L,ha as sC,hb as dn,hc as qC,hd as kt,he as On,hf as ti,hg as ZS,hh as hw,hk as TA,hl as XA,hm as Ft,hn as Ba,ho as Cv,i as Fe,ia as aC,ib as Ge,id as yT,ie as In,if as ri,ig as QS,ih as gw,ii as mE,il as YA,im as He,in as qa,io as Tv,j as zo,ja as cC,jb as RC,jc as zC,jd as bT,je as Rn,jf as oi,jg as ew,jh as yw,ji as Ui,jk as SA,jl as JA,jm as uv,jn as za,jo as Sv,k as Vo,ka as dC,kd as CT,ke as Pn,kg as tw,kh as bw,ki as Bi,kl as ZA,km as pv,kn as Va,ko as wv,l as Ho,la as lC,lb as ln,le as ZT,lg as rw,lh as Cw,ll as QA,lm as mv,ln as Ha,lo as Ev,m as Ko,ma as uC,mb as un,md as TT,me as QT,mg as ai,mh as Tw,mj as HE,mk as wA,ml as ev,mm as fv,mn as Ka,mo as Av,na as pC,nd as ST,ng as ci,nh as Sw,nj as KE,nl as tv,nm as _v,nn as Wa,no as xc,o as Wo,oa as mC,ob as pn,oe as Mn,og as di,oh as ww,oj as WE,ok as EA,ol as rv,om as hv,on as Xa,oo as Nc,p as vt,pa as fC,pe as kn,pg as li,ph as Ew,pi as fE,pj as XE,pm as Js,pn as Ya,po as Lc,q as fe,qa as _C,qd as Tn,qe as eS,qg as ui,qh as Aw,qi as _E,qj as YE,qm as Zs,qn as Ja,qo as Dc,r as Xo,rd as wT,re as xn,rg as pi,rh as vw,ri as hE,rj as JE,rm as Qs,rn as Za,ro as $c,s as je,sa as hC,sd as ET,se as Nn,sg as mi,sh as Ow,si as gE,sk as AA,sl as $t,sm as ea,sn as Qa,so as Fc,t as Yo,ta as gC,td as AT,te as tS,tf as xt,tg as qe,th as Iw,ti as yE,tk as vA,tl as ov,tm as ta,tn as ec,to as jc,ua as yC,ud as vT,ue as rS,uf as Nt,ug as ze,uh as Rw,ui as bE,uj as ZE,uk as OA,ul as nv,um as ra,un as tc,uo as Gc,v as Kb,va as bC,vd as OT,ve as oS,vf as ni,vg as fi,vh as Pw,vj as QE,vk as IA,vl as iv,vm as oa,vn as rc,vo as Uc,w as Wb,wa as CC,wc as VC,wd as IT,we as nS,wf as ii,wg as _i,wh as Mw,wi as CE,wj as Hi,wk as RA,wl as ys,wm as na,wn as oc,wo as Bc,x as Xb,xa as TC,xc as HC,xe as iS,xf as si,xg as hi,xh as kw,xj as eA,xl as bs,xm as ia,xn as nc,xo as qc,ya as Qo,yc as KC,yd as RT,ye as sS,yg as gi,yh as xw,yi as TE,yj as tA,yk as PA,yl as Cs,ym as sa,yn as ic,yo as jt,za as en,zd as PT,ze as aS,zf as hS,zg as yi,zh as Nw,zi as SE,zj as rA,zk as MA,zl as Ts,zm as aa,zn as sc}from"./chunks/chunk-J4DRE3WN.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="08485124-a2f1-5bb5-9316-533a3f7888bc")}catch{}})();var K="2026-07-28",Qk=["2025-11-25","2025-06-18"],et=[K],m={headerMismatch:-32020,missingRequiredClientCapability:-32021,unsupportedProtocolVersion:-32022,invalidParams:-32602},A={clientCapabilities:"io.modelcontextprotocol/clientCapabilities",clientInfo:"io.modelcontextprotocol/clientInfo",logLevel:"io.modelcontextprotocol/logLevel",protocolVersion:"io.modelcontextprotocol/protocolVersion",serverInfo:"io.modelcontextprotocol/serverInfo"},lr=["debug","info","notice","warning","error","critical","alert","emergency"],p=class extends Error{code;data;constructor(t,r,o={}){super(t),this.name="PmMcpProtocolError",this.code=r,this.data=o}};function _(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Gh(e){if(e===void 0)return;if(!_(e))throw new p("Invalid MCP clientInfo metadata",m.invalidParams,{field:A.clientInfo,expected:"object"});let t=typeof e.name=="string"?e.name.trim():"",r=typeof e.version=="string"?e.version.trim():"";if(t.length===0||r.length===0)throw new p("Invalid MCP clientInfo metadata",m.invalidParams,{field:A.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 Uh(e){if(e!==void 0){if(typeof e!="string"||!lr.includes(e))throw new p("Invalid MCP logLevel metadata",m.invalidParams,{field:A.logLevel,allowed:[...lr]});return e}}function tt(e){let t=_(e)?e._meta:void 0;if(!_(t))throw new p("Missing required MCP request metadata",m.invalidParams,{required:[A.protocolVersion,A.clientCapabilities]});let r=t[A.protocolVersion];if(typeof r!="string"||!et.includes(r))throw new p("Unsupported protocol version",m.unsupportedProtocolVersion,{supported:[...et],requested:typeof r=="string"?r:null});let o=t[A.clientCapabilities];if(!_(o))throw new p("Invalid MCP client capabilities metadata",m.invalidParams,{field:A.clientCapabilities,expected:"object"});let n=Gh(t[A.clientInfo]),i=Uh(t[A.logLevel]);return{protocolVersion:K,clientCapabilities:o,...n?{clientInfo:n}:{},...i?{logLevel:i}:{}}}function e0(e,t){if(t!==e.protocolVersion)throw new p("MCP protocol header does not match request metadata",m.headerMismatch,{header:t??null,metadata:e.protocolVersion})}function t0(e,t){let r=t.filter(o=>!Object.prototype.hasOwnProperty.call(e.clientCapabilities,o));if(r.length>0)throw new p("Missing required client capability",m.missingRequiredClientCapability,{requiredCapabilities:Object.fromEntries(r.map(o=>[o,{}]))})}function r0(e,t){let r=e.clientCapabilities.extensions;return _(r)&&_(r[t])}function rt(e,t){let r=_(e._meta)?e._meta:{};return{...e,_meta:{...r,[A.serverInfo]:{...t}}}}function Bh(e,t){return rt({...e,resultType:"complete"},t)}function o0(e){let t=e.ttlMs??6e4;if(!Number.isFinite(t)||t<0)throw new p("Invalid MCP discovery cache TTL",m.invalidParams,{ttlMs:t});return Bh({supportedVersions:[...et],capabilities:structuredClone(e.capabilities),ttlMs:t,cacheScope:"public",...e.instructions?{instructions:e.instructions}:{}},e.serverInfo)}function n0(e,t){if(_(e)&&typeof e.resultType=="string")return e.resultType;if(t==="legacy")return"complete";throw new p("Modern MCP result is missing resultType",m.invalidParams,{required:"resultType"})}import{createHash as mr,createHmac as fr,timingSafeEqual as qh}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="6505e714-d1f3-5794-88c8-51c1644acec9")}catch{}})();var zh=["elicitation/create","roots/list","sampling/createMessage"],ur=class extends Error{inputRequests;requestState;constructor(t){super("MCP operation requires additional input"),this.name="PmMcpInputRequiredError",this.inputRequests=t.inputRequests,this.requestState=t.requestState}},_r=/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/u,ge=32,nt=64*1024,ye=16*1024,ot={maxBytes:256*1024,maxDepth:32,maxNodes:4096};function Vh(e){return e==="elicitation/create"?"elicitation":e==="sampling/createMessage"?"sampling":"roots"}function be(e,t,r){let o;try{o=JSON.stringify(e)}catch{throw new p(`Invalid ${r}: value is not JSON serializable`,m.invalidParams,{field:r})}if(Buffer.byteLength(o,"utf8")>t)throw new p(`Invalid ${r}: payload exceeds the protocol bound`,m.invalidParams,{field:r,maximumBytes:t})}function it(e,t){if(!_(e))throw new p("Invalid MCP inputRequests",m.invalidParams,{field:"inputRequests",expected:"object"});let r=Object.entries(e);if(r.length===0||r.length>ge)throw new p("Invalid MCP inputRequests count",m.invalidParams,{minimum:1,maximum:ge,observed:r.length});let o={};for(let[n,i]of r){if(!_r.test(n)||!_(i))throw new p("Invalid MCP input request entry",m.invalidParams,{field:`inputRequests.${n}`});let s=i.method;if(typeof s!="string"||!zh.includes(s))throw new p("Unsupported MCP input request method",m.invalidParams,{field:`inputRequests.${n}.method`,method:s??null});let a=Vh(s);if(!Object.prototype.hasOwnProperty.call(t.clientCapabilities,a))throw new p("Missing required client capability",m.missingRequiredClientCapability,{requiredCapabilities:{[a]:{}}});if(!_(i.params))throw new p("Invalid MCP input request parameters",m.invalidParams,{field:`inputRequests.${n}.params`,expected:"object"});o[n]={method:s,params:structuredClone(i.params)}}return be(o,nt,"inputRequests"),o}function hr(e){if(!_(e))throw new p("Invalid MCP inputResponses",m.invalidParams,{field:"inputResponses",expected:"object"});let t=Object.entries(e);if(t.length>ge)throw new p("Invalid MCP inputResponses count",m.invalidParams,{maximum:ge,observed:t.length});let r={};for(let[o,n]of t){if(!_r.test(o)||!_(n))throw new p("Invalid MCP input response entry",m.invalidParams,{field:`inputResponses.${o}`});r[o]=structuredClone(n)}return be(r,nt,"inputResponses"),r}function c0(e){let t=e.requestState?.trim();if(t&&Buffer.byteLength(t,"utf8")>ye)throw new p("Invalid MCP requestState: payload exceeds the protocol bound",m.invalidParams,{field:"requestState",maximumBytes:ye});let r=e.inputRequests===void 0?void 0:it(e.inputRequests,e.requestContext);if(r===void 0&&!t)throw new p("InputRequiredResult requires inputRequests or requestState",m.invalidParams,{requiredAnyOf:["inputRequests","requestState"]});return{resultType:"input_required",...r?{inputRequests:r}:{},...t?{requestState:t}:{},_meta:{[A.serverInfo]:{...e.serverInfo}}}}function gr(e){let t=Buffer.from(e);if(t.byteLength<32)throw new p("MCP requestState signing key must contain at least 32 bytes",m.invalidParams,{minimumBytes:32});return t}function d0(e,t){if(!Number.isSafeInteger(e.expiresAt)||e.expiresAt<=0||e.method.trim().length===0||e.parameterDigest.trim().length===0||e.principal.trim().length===0)throw new p("Invalid MCP requestState payload",m.invalidParams);let r=Buffer.from(JSON.stringify({version:1,...e}),"utf8");if(r.byteLength>ye/2)throw new p("MCP requestState payload exceeds the protocol bound",m.invalidParams,{maximumBytes:ye/2});let o=r.toString("base64url"),n=fr("sha256",gr(t)).update(o).digest("base64url");return`${o}.${n}`}function Hh(e){if(!_(e)||e.version!==1)throw new p("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});let{expiresAt:t,method:r,parameterDigest:o,principal:n,state:i}=e;if(typeof t!="number"||!Number.isSafeInteger(t))throw new p("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});if(typeof r!="string"||typeof o!="string"||typeof n!="string")throw new p("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});return{expiresAt:t,method:r,parameterDigest:o,principal:n,state:i}}function l0(e,t,r){let[o,n,i]=e.split(".");if(!o||!n||i!==void 0)throw new p("Invalid MCP requestState encoding",m.invalidParams,{field:"requestState"});let s=Buffer.from(n,"base64url"),a=fr("sha256",gr(t)).update(o).digest();if(s.byteLength!==a.byteLength||!qh(s,a))throw new p("Invalid MCP requestState signature",m.invalidParams,{field:"requestState"});let c;try{c=JSON.parse(Buffer.from(o,"base64url").toString("utf8"))}catch{c=null}let d=Hh(c),{expiresAt:l,method:u,parameterDigest:f,principal:g}=d;if(l<(r.nowMs??Date.now()))throw new p("Expired MCP requestState",m.invalidParams,{field:"requestState",expiredAt:l});if(u!==r.method||f!==r.parameterDigest||g!==r.principal)throw new p("MCP requestState binding mismatch",m.invalidParams,{field:"requestState"});return d}function u0(e){return be(e,nt,"request parameters"),mr("sha256").update(JSON.stringify(e)).digest("hex")}var pr=class{#e=new Set;#t;constructor(t=4096){if(!Number.isSafeInteger(t)||t<1)throw new p("Invalid MCP replay guard capacity",m.invalidParams,{maximumEntries:t});this.#t=t}consume(t){let r=mr("sha256").update(t).digest("hex");if(this.#e.has(r))throw new p("MCP requestState replay detected",m.invalidParams,{field:"requestState"});if(this.#e.size>=this.#t){let o=this.#e.values().next().value;this.#e.delete(o)}this.#e.add(r)}};function Kh(e){if(!Number.isSafeInteger(e.ttlMs)||e.ttlMs<0||e.cacheScope!=="public"&&e.cacheScope!=="private")throw new p("Invalid MCP cache policy",m.invalidParams,{ttlMs:e.ttlMs,cacheScope:e.cacheScope});return{ttlMs:e.ttlMs,cacheScope:e.cacheScope}}function p0(e,t){return{...e,...Kh(t)}}function Wh(e){return e.replaceAll("~1","/").replaceAll("~0","~")}function Xh(e,t){if(t==="#")return e;if(!t.startsWith("#/"))return;let r=e;for(let o of t.slice(2).split("/").map(Wh)){if(!_(r)&&!Array.isArray(r)||!Object.prototype.hasOwnProperty.call(r,o))return;r=r[o]}return r}function Yh(e){let t=e.maxBytes??ot.maxBytes,r=e.maxDepth??ot.maxDepth,o=e.maxNodes??ot.maxNodes;if(!Number.isSafeInteger(t)||t<2)throw new p("Invalid MCP JSON Schema work bounds",m.invalidParams);if(!Number.isSafeInteger(r)||r<1)throw new p("Invalid MCP JSON Schema work bounds",m.invalidParams);if(!Number.isSafeInteger(o)||o<1)throw new p("Invalid MCP JSON Schema work bounds",m.invalidParams);return{maximumBytes:t,maximumDepth:r,maximumNodes:o}}function Jh(e,t){let r=Array.isArray(e.value)?e.value:_(e.value)?Object.values(e.value):[];for(let o of r)t.push({value:o,depth:e.depth+1})}function Zh(e,t){if(!_(t)||typeof t.$ref!="string")return;let r=t.$ref;if(r.startsWith("#")&&Xh(e,r)===void 0)throw new p("MCP JSON Schema contains an unresolved local reference",m.invalidParams,{reference:r})}function m0(e,t={}){let{maximumBytes:r,maximumDepth:o,maximumNodes:n}=Yh(t);if(typeof e!="boolean"&&!_(e))throw new p("Invalid MCP JSON Schema root",m.invalidParams,{expected:"object or boolean"});be(e,r,"JSON Schema");let i=[{value:e,depth:0}],s=0;for(;i.length>0;){let a=i.pop();if(s+=1,s>n||a.depth>o)throw new p("MCP JSON Schema exceeds validation work bounds",m.invalidParams,{maximumDepth:o,maximumNodes:n});Zh(e,a.value),Jh(a,i)}return structuredClone(e)}import{randomUUID as Qh}from"node:crypto";import{readFile as eg}from"node:fs/promises";import yr from"node:path";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="7f5b3ba6-07cf-5317-8f62-63e84f561232")}catch{}})();var T0="io.modelcontextprotocol/tasks",tg=["working","input_required","completed","failed","cancelled"],rg=/^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,og=3600*1e3,ng=1e3,Te=1024,ig=30,sg=2e3;function st(e){return new p(e,m.invalidParams,{code:"mcp_task_not_found_or_not_authorized"})}function Ce(e){let t=e.trim();if(!rg.test(t))throw st("Unknown MCP task");return t}function br(e,t){if(typeof e!="string"||!Number.isFinite(Date.parse(e)))throw new p("Corrupt MCP task record",m.invalidParams,{field:t});return e}function Cr(e){if(!_(e)||typeof e.code!="number"||!Number.isFinite(e.code)||typeof e.message!="string")throw new p("Corrupt MCP task error",m.invalidParams);return{code:e.code,message:e.message.slice(0,Te),..._(e.data)?{data:structuredClone(e.data)}:{}}}function ag(e){if(!tg.includes(e))throw new p("Corrupt MCP task record",m.invalidParams);return e}function cg(e){if(typeof e!="string"||e.length===0)throw new p("Corrupt MCP task record",m.invalidParams);return e}function dg(e){if(typeof e!="number"||!Number.isSafeInteger(e)||e<1)throw new p("Corrupt MCP task record",m.invalidParams);return e}function lg(e){if(e!==null&&(typeof e!="number"||!Number.isSafeInteger(e)||e<0))throw new p("Corrupt MCP task record",m.invalidParams);return e}function ug(e){if(e!==void 0){if(typeof e!="number"||!Number.isSafeInteger(e)||e<0)throw new p("Corrupt MCP task record",m.invalidParams);return e}}function pg(e){if(!Array.isArray(e)||e.some(t=>typeof t!="string"))throw new p("Corrupt MCP task record",m.invalidParams);return[...e]}function mg(e){if(!_(e)||e.version!==1)throw new p("Corrupt MCP task record",m.invalidParams);let t=typeof e.taskId=="string"?Ce(e.taskId):"",r=ag(e.status),o=cg(e.principal),n=dg(e.workerPid),i=lg(e.ttlMs),s=ug(e.pollIntervalMs),a={version:1,taskId:t,status:r,principal:o,workerPid:n,createdAt:br(e.createdAt,"createdAt"),lastUpdatedAt:br(e.lastUpdatedAt,"lastUpdatedAt"),ttlMs:i,consumedInputKeys:pg(e.consumedInputKeys),...typeof e.statusMessage=="string"?{statusMessage:e.statusMessage.slice(0,Te)}:{},...typeof s=="number"?{pollIntervalMs:s}:{}};if(_(e.inputRequests)&&(a.inputRequests=structuredClone(e.inputRequests)),_(e.inputResponses)&&(a.inputResponses=structuredClone(e.inputResponses)),_(e.result)&&(a.result=structuredClone(e.result)),e.error!==void 0&&(a.error=Cr(e.error)),a.status==="input_required"&&!a.inputRequests||a.status==="completed"&&!a.result||a.status==="failed"&&!a.error)throw new p("Corrupt MCP task status payload",m.invalidParams,{status:a.status});return a}function W(e){let t={taskId:e.taskId,status:e.status,createdAt:e.createdAt,lastUpdatedAt:e.lastUpdatedAt,ttlMs:e.ttlMs,...e.statusMessage?{statusMessage:e.statusMessage}:{},...e.pollIntervalMs===void 0?{}:{pollIntervalMs:e.pollIntervalMs}};return e.status==="input_required"?{...t,status:"input_required",inputRequests:structuredClone(e.inputRequests)}:e.status==="completed"?{...t,status:"completed",result:structuredClone(e.result)}:e.status==="failed"?{...t,status:"failed",error:structuredClone(e.error)}:e.status==="cancelled"?{...t,status:"cancelled"}:{...t,status:"working"}}function ne(e){return e==="completed"||e==="failed"||e==="cancelled"}function fg(e){try{return process.kill(e,0),!0}catch(t){return!(typeof t=="object"&&t!==null&&"code"in t&&t.code==="ESRCH")}}var at=class{#e;#t;#r;#o;#i;constructor(t){this.#e=yr.resolve(t.pmRoot),this.#t=t.owner?.trim()||"pm-mcp",this.#r=t.now??(()=>new Date),this.#o=t.taskIdFactory??(()=>`mcp-task-${Qh()}`),this.#i=t.workerPid??process.pid}#s(t){return yr.join(this.#e,"runtime","mcp-tasks","records",`${Ce(t)}.json`)}async#c(t){try{return mg(JSON.parse(await eg(this.#s(t),"utf8")))}catch(r){throw fe(r)||r instanceof SyntaxError?st("Unknown MCP task"):r}}async#a(t){await je(this.#s(t.taskId),`${JSON.stringify(t,null,2)}
2
+ `)}async#n(t,r,o){let n=Ce(t),i=await Be(this.#e,n,ig,this.#t,!1,!1,sg);try{let s=await this.#c(n);if(s.principal!==r)throw st("Unknown MCP task");let a=o(s);return await this.#a(a),a}finally{await i()}}async create(t){let r=Ce(this.#o()),o=t.principal.trim(),n=t.ttlMs===void 0?og:t.ttlMs,i=t.pollIntervalMs??ng;if(o.length===0||n!==null&&(!Number.isSafeInteger(n)||n<0)||!Number.isSafeInteger(i)||i<0)throw new p("Invalid MCP task creation options",m.invalidParams);let s=this.#r().toISOString(),a={version:1,taskId:r,status:"working",createdAt:s,lastUpdatedAt:s,ttlMs:n,pollIntervalMs:i,principal:o,workerPid:this.#i,consumedInputKeys:[],...t.statusMessage?.trim()?{statusMessage:t.statusMessage.trim().slice(0,Te)}:{}};return await this.#a(a),{...W(a),resultType:"task"}}async get(t,r){return W(await this.#n(t,r,o=>{if(ne(o.status))return o;let n=this.#r().getTime(),i=o.ttlMs!==null&&Date.parse(o.createdAt)+o.ttlMs<=n,s=o.workerPid!==this.#i&&!fg(o.workerPid);return!i&&!s?o:{...o,status:"failed",statusMessage:i?"Task retention expired before completion.":"Task worker ended before recording a terminal result.",lastUpdatedAt:this.#r().toISOString(),error:{code:-32603,message:i?"MCP task expired":"MCP task worker unavailable after restart",data:{recoverable:!1,createNewTask:!0}},inputRequests:void 0}}))}async requireInput(t){let r=it(t.inputRequests,t.requestContext);return W(await this.#n(t.taskId,t.principal,o=>{if(ne(o.status))return o;let n=Object.keys(r).filter(i=>o.consumedInputKeys.includes(i));if(n.length>0)throw new p("MCP task input request keys must be unique for the task lifetime",m.invalidParams,{reused:n});return{...o,status:"input_required",statusMessage:t.statusMessage?.trim().slice(0,Te),lastUpdatedAt:this.#r().toISOString(),inputRequests:r}}))}async update(t,r,o){let n=hr(o),i=[],s=[];return await this.#n(t,r,a=>{if(a.status!=="input_required"||!a.inputRequests)return a;let c={...a.inputRequests},d=a.inputResponses?{...a.inputResponses}:{};for(let[l,u]of Object.entries(n))Object.prototype.hasOwnProperty.call(c,l)&&(d[l]=u,delete c[l],i.push(l));return s=Object.keys(c).sort(),i.length===0?a:{...a,status:s.length===0?"working":"input_required",lastUpdatedAt:this.#r().toISOString(),inputRequests:s.length===0?void 0:c,inputResponses:d,consumedInputKeys:[...new Set([...a.consumedInputKeys,...i])].sort()}}),{acceptedKeys:i.sort(),remainingKeys:s}}async takeInputResponses(t,r){let o={};return await this.#n(t,r,n=>(o=structuredClone(n.inputResponses??{}),Object.keys(o).length===0?n:{...n,inputResponses:void 0})),o}async complete(t,r,o){return W(await this.#n(t,r,n=>ne(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=Cr(o);return W(await this.#n(t,r,i=>ne(i.status)?i:{...i,status:"failed",statusMessage:n.message,lastUpdatedAt:this.#r().toISOString(),error:n,inputRequests:void 0,result:void 0}))}async cancel(t,r){return W(await this.#n(t,r,o=>ne(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 S0(e){return new at(e)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="f87864d3-e499-57f7-b1e3-4ea3f30b7725")}catch{}})();var Se="io.modelcontextprotocol/subscriptionId",Tr=256,Sr=2048,_g=5e3;function hg(e,t){return new Promise((r,o)=>{let n=setTimeout(()=>o(new Error("MCP subscription sink write timed out")),_g);n.unref(),Promise.resolve().then(()=>e(t)).then(()=>{clearTimeout(n),r()},i=>{clearTimeout(n),o(i instanceof Error?i:new Error(String(i)))})})}function ct(e,t){if(e!==void 0){if(typeof e!="boolean")throw new p("Invalid MCP subscription filter",m.invalidParams,{field:`notifications.${t}`,expected:"boolean"});return e||void 0}}function gg(e){if(!_(e))throw new p("Invalid MCP subscription filter",m.invalidParams,{field:"notifications",expected:"object"});let t=ct(e.toolsListChanged,"toolsListChanged"),r=ct(e.promptsListChanged,"promptsListChanged"),o=ct(e.resourcesListChanged,"resourcesListChanged"),n;if(e.resourceSubscriptions!==void 0){if(!Array.isArray(e.resourceSubscriptions)||e.resourceSubscriptions.length>Tr)throw new p("Invalid MCP resource subscriptions",m.invalidParams,{field:"notifications.resourceSubscriptions",maximum:Tr});let i=new Set;for(let s of e.resourceSubscriptions){if(typeof s!="string"||s.trim().length===0||Buffer.byteLength(s,"utf8")>Sr)throw new p("Invalid MCP resource subscription URI",m.invalidParams,{field:"notifications.resourceSubscriptions",maximumBytes:Sr});i.add(s)}i.size>0&&(n=[...i].sort())}return{...t?{toolsListChanged:t}:{},...r?{promptsListChanged:r}:{},...o?{resourcesListChanged:o}:{},...n?{resourceSubscriptions:n}:{}}}function yg(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 wr=class{#e;#t=new Map;#r;constructor(t){this.#e=structuredClone(t.capabilities),this.#r={...t.serverInfo}}get size(){return this.#t.size}async open(t){if(this.#t.has(t.id))throw new p("MCP subscription id is already active",m.invalidParams,{subscriptionId:t.id});let r=yg(gg(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:{[Se]:t.id},notifications:structuredClone(r)}},!0)}catch(n){throw this.#t.delete(t.id),n}return structuredClone(r)}async emitListChanged(t){let r=`${t}ListChanged`,o=`notifications/${t}/list_changed`,n=[];for(let[i,s]of this.#t)s.filter[r]===!0&&n.push(this.#o(i,s,{jsonrpc:"2.0",method:o,params:{_meta:{[Se]:i}}}));return(await Promise.all(n)).filter(Boolean).length}async emitResourceUpdated(t){let r=[];for(let[o,n]of this.#t)n.filter.resourceSubscriptions?.includes(t)&&r.push(this.#o(o,n,{jsonrpc:"2.0",method:"notifications/resources/updated",params:{_meta:{[Se]:o},uri:t}}));return(await Promise.all(r)).filter(Boolean).length}async#o(t,r,o,n=!1){let i=r.writeQueue.then(async()=>{if(this.#t.get(t)!==r)return!1;try{return await hg(r.sink,o),!0}catch(s){if(this.#t.get(t)===r&&this.#t.delete(t),n)throw s;return!1}});return r.writeQueue=i.then(()=>{},()=>{}),i}close(t){if(this.#t.delete(t))return{...rt({resultType:"complete",_meta:{[Se]:t}},this.#r)}}closeAll(){let t=[];for(let r of this.#t.keys()){let o=this.close(r);t.push({id:r,result:o})}return t}};(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="7d591d0b-f009-519c-8024-c6fa18effb8e")}catch{}})();var Er=/^=\?base64\?([A-Za-z0-9+/]*={0,2})\?=$/u,bg=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/u,Ar=/^[\t\x20-\x7E]*$/u,vr=new Set(["prompts/get","resources/read","tools/call"]);function Cg(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 v(e,t){throw new p(e,m.headerMismatch,{header:t})}function Or(e){let t=typeof e=="boolean"?String(e).toLowerCase():String(e);return t.length>0&&t.trim()===t&&Ar.test(t)&&!Er.test(t)?t:`=?base64?${Buffer.from(t,"utf8").toString("base64")}?=`}function Ir(e,t){let r=Er.exec(e);if(r){let o=r[1],n=Buffer.from(o,"base64");return n.toString("base64")!==o||n.length===0?v("Malformed MCP Base64 header value",t):n.toString("utf8")}return e.length===0||e.trim()!==e||!Ar.test(e)?v("Malformed MCP header value",t):e}function we(e){return Array.isArray(e)?e.some(we):_(e)?Object.prototype.hasOwnProperty.call(e,"x-mcp-header")||Object.values(e).some(we):!1}function Tg(e,t,r){let o=e["x-mcp-header"];if(o===void 0)return;let n=e.type;if(typeof o!="string"||!bg.test(o)||!["boolean","integer","string"].includes(String(n))||r.has(o.toLowerCase()))throw new p("Invalid MCP x-mcp-header annotation",m.invalidParams,{field:t.join("."),annotation:o});return r.add(o.toLowerCase()),{name:o,path:t,type:n}}function Rr(e){if(!_(e))throw new p("Invalid MCP tool schema",m.invalidParams,{field:"inputSchema",expected:"object"});let t=[],r=new Set,o=(n,i)=>{let s=n.properties;if(s!==void 0){if(!_(s))throw new p("Invalid MCP tool schema properties",m.invalidParams,{field:"inputSchema.properties"});for(let[a,c]of Object.entries(s)){if(!_(c))continue;let d=[...i,a],l=Tg(c,d,r);l&&t.push(l);for(let[u,f]of Object.entries(c))if(u!=="properties"&&u!=="x-mcp-header"&&we(f))throw new p("MCP x-mcp-header is not statically reachable",m.invalidParams,{field:d.join("."),keyword:u});o(c,d)}}};for(let[n,i]of Object.entries(e))if(n!=="properties"&&we(i))throw new p("MCP x-mcp-header is not statically reachable",m.invalidParams,{field:"inputSchema",keyword:n});return o(e,[]),t}function Pr(e,t){let r=e;for(let o of t){if(!_(r))return;r=r[o]}return r}function Mr(e,t){let r=e==="resources/read"?t.uri:t.name;return typeof r=="string"?r:void 0}function Sg(e,t){let r=_(e.arguments)?e.arguments:{},o={};for(let n of Rr(t)){let i=Pr(r,n.path);if(i==null)continue;if(!(n.type==="integer"&&typeof i=="number"&&Number.isSafeInteger(i)||n.type==="boolean"&&typeof i=="boolean"||n.type==="string"&&typeof i=="string"))throw new p("Invalid MCP custom header argument",m.invalidParams,{field:n.path.join("."),expected:n.type});o[`Mcp-Param-${n.name}`]=Or(i)}return o}function O0(e){let t=_(e.request.params)?e.request.params:void 0,r=tt(t),o=e.request.method;if(typeof o!="string"||o.length===0)return v("Missing MCP request method","Mcp-Method");let n={Accept:"application/json, text/event-stream","Content-Type":"application/json","MCP-Protocol-Version":r.protocolVersion,"Mcp-Method":o},i=Mr(o,t);if(vr.has(o)){if(i===void 0)return v("Missing MCP request name","Mcp-Name");n["Mcp-Name"]=Or(i)}return o==="tools/call"&&e.toolSchema!==void 0&&Object.assign(n,Sg(t,e.toolSchema)),n}function wg(e,t){let r=t.method;(typeof r!="string"||r.length===0)&&v("Missing MCP request method","Mcp-Method");let o=_(t.params)?t.params:void 0,n=tt(o).protocolVersion;if(e.get("mcp-protocol-version")!==n&&v("MCP protocol header does not match request metadata","MCP-Protocol-Version"),e.get("mcp-method")!==r&&v("MCP method header does not match request body","Mcp-Method"),vr.has(r)){let i=e.get("mcp-name"),s=Mr(r,o);(i===void 0||s===void 0||Ir(i,"Mcp-Name")!==s)&&v("MCP name header does not match request body","Mcp-Name")}e.has("last-event-id")&&v("MCP SSE resumability is not supported","Last-Event-ID")}function Eg(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 Ag(e){let t=_(e.params.arguments)?e.params.arguments:{};for(let r of Rr(e.toolSchema)){let o=Pr(t,r.path),n=`Mcp-Param-${r.name}`,i=e.headers.get(n.toLowerCase());if(o==null){i!==void 0&&v("Unexpected MCP parameter header",n);continue}i===void 0&&v("Missing MCP parameter header",n),Eg(r,o,Ir(i,n))||v("MCP parameter header does not match request body",n)}}function I0(e){let t=Cg(e.headers),r=typeof e.request.method=="string"?e.request.method:"";wg(t,e.request),!(r!=="tools/call"||e.toolSchema===void 0)&&Ag({headers:t,params:e.request.params,toolSchema:e.toolSchema})}var R0=K;import{AsyncLocalStorage as vg}from"node:async_hooks";import{createHash as kr,timingSafeEqual as Og}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="6a5310f6-3add-5108-b39f-61607918dc9f")}catch{}})();var y=class extends Error{httpStatus;challenge;constructor(t,r,o){super(t),this.name="PmMcpAuthorizationError",this.httpStatus=r,this.challenge=o}},Ig=/^00-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})$/u,Rg=/^[a-z][a-z0-9_*/-]{0,255}$/u,Pg=/^(?:[a-z0-9][a-z0-9_*/-]{0,240})@[a-z][a-z0-9_*/-]{0,13}$/u,Mg=/^[\x20-\x2B\x2D-\x3C\x3E-\x7E]{0,255}[\x21-\x2B\x2D-\x3C\x3E-\x7E]$/u,Nr=/^[\x21\x23-\x5B\x5D-\x7E]+$/u,Lr=/^[A-Za-z0-9!#$%&'*+.^_`|~-]+$/u,kg=/^[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]*$/u,xg=/%(?![0-9A-Fa-f]{2})/u,Ng=512,Lg=32,Dg=180,$g=8192,Fg=8192,Dr=new vg;function E(e,t,r=!1){if(new RegExp("\\p{Cc}","u").test(e))throw new y(`Invalid ${t}`,401);let o;try{o=new URL(e)}catch{throw new y(`Invalid ${t}`,401)}let n=o.hostname==="127.0.0.1"||o.hostname==="localhost";if(o.hash.length>0||o.protocol!=="https:"&&!(r&&n&&o.protocol==="http:"))throw new y(`Invalid ${t}`,401);return o}function jg(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 N0(e){let t=E(e.resource,"protected resource URI",!0).href.replace(/\/$/u,"");if(e.authorizationServers.length===0)throw new y("Protected resource metadata requires an authorization server",401);let r=e.authorizationServers.map(n=>E(n,"authorization server issuer").href.replace(/\/$/u,"")),o=[...new Set(e.scopes??[])];if(o.some(n=>!Nr.test(n)))throw new y("Invalid authorization scope",401);return{resource:t,authorization_servers:r,...o.length>0?{scopes_supported:o.sort()}:{}}}function L0(e){let t=E(e,"authorization server issuer"),r=t.pathname.replace(/^\/+|\/+$/gu,""),o=t.origin;return r?[`${o}/.well-known/oauth-authorization-server/${r}`,`${o}/.well-known/openid-configuration/${r}`,`${o}/${r}/.well-known/openid-configuration`]:[`${o}/.well-known/oauth-authorization-server`,`${o}/.well-known/openid-configuration`]}function D0(e,t){if(!_(e)||typeof e.issuer!="string")throw new y("Invalid authorization server metadata",401);let r=E(t,"expected issuer").href.replace(/\/$/u,"");if(E(e.issuer,"metadata issuer").href.replace(/\/$/u,"")!==r)throw new y("Authorization server issuer mismatch",401);if(!Array.isArray(e.code_challenge_methods_supported)||!e.code_challenge_methods_supported.includes("S256"))throw new y("Authorization server does not support required S256 PKCE",401);let n=d=>{let l=e[d];if(typeof l!="string")throw new y(`Authorization server metadata requires ${d}`,401);return E(l,d).href},i=d=>{let l=e[d];return typeof l=="string"?E(l,d).href:void 0},s=n("authorization_endpoint"),a=n("token_endpoint"),c=i("registration_endpoint");return{issuer:r,authorization_endpoint:s,token_endpoint:a,code_challenge_methods_supported:[...new Set(e.code_challenge_methods_supported.filter(d=>typeof d=="string"))],...e.client_id_metadata_document_supported===!0?{client_id_metadata_document_supported:!0}:{},...c?{registration_endpoint:c}:{}}}function $0(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 F0(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 j0(e,t){let r=E(t,"client metadata document URL");if(r.pathname==="/"||!_(e)||e.client_id!==r.href||typeof e.client_name!="string"||e.client_name.trim().length===0||!Array.isArray(e.redirect_uris)||e.redirect_uris.length===0)throw new y("Invalid Client ID Metadata Document",401);for(let o of e.redirect_uris){if(typeof o!="string")throw new y("Invalid client redirect URI",401);E(o,"client redirect URI",!0)}return structuredClone(e)}function G0(e){if(e.redirectUris.length===0||e.clientName.trim().length===0)throw new y("Invalid dynamic client registration metadata",401);let t=e.redirectUris.map(r=>E(r,"redirect URI",!0).href);return{application_type:e.applicationType,client_name:e.clientName.trim().slice(0,128),redirect_uris:t,grant_types:["authorization_code","refresh_token"],response_types:["code"],token_endpoint_auth_method:"none"}}var xr=class{#e=new Map;set(t,r){let o=E(t,"credential issuer").href;this.#e.set(o,structuredClone(r))}get(t){let r=E(t,"credential issuer").href,o=this.#e.get(r);return o?structuredClone(o):void 0}delete(t){let r=E(t,"credential issuer").href;return this.#e.delete(r)}};function Gg(e){let t=e.traceparent,r=e.tracestate;if(t!==void 0){let o=typeof t=="string"?Ig.exec(t):null;if(!o)throw new y("Invalid MCP traceparent",403);let n=o[1],i=o[2];if(/^0+$/u.test(n)||/^0+$/u.test(i))throw new y("Invalid MCP traceparent",403)}if(r!==void 0&&(typeof r!="string"||!Bg(r)))throw new y("Invalid MCP tracestate",403);return{...typeof t=="string"?{traceparent:t}:{},...typeof r=="string"?{tracestate:r}:{}}}function F(e){return e.replace(/^[ \t]*|[ \t]*$/gu,"")}function Ug(e){return Rg.test(e)||Pg.test(e)}function Bg(e){if(Buffer.byteLength(e,"utf8")>Ng)return!1;let t=e.split(",");if(t.length>Lg)return!1;let r=new Set;for(let o of t){let n=F(o);if(n.length===0)continue;let i=n.indexOf("="),s=i>0?n.slice(0,i):"",a=i>0?n.slice(i+1):"";if(!Ug(s)||!Mg.test(a)||r.has(s))return!1;r.add(s)}return!0}function $r(e){return kg.test(e)&&!xg.test(e)}function qg(e){let t=F(e),r=t.indexOf("="),o=F(r>=0?t.slice(0,r):t),n=r>=0?F(t.slice(r+1)):void 0;return Lr.test(o)&&(n===void 0||$r(n))}function zg(e){let t=F(e),r=t.split(";"),o=r[0],n=r.slice(1),i=o.indexOf("="),s=F(i>0?o.slice(0,i):""),a=i>0?F(o.slice(i+1)):"";if(!(!Lr.test(s)||!$r(a)||!n.every(qg)))return{key:s,serialized:t}}function Vg(e,t){if(e===void 0)return;if(typeof e!="string"||Buffer.byteLength(e,"utf8")>$g)throw new y("Invalid MCP baggage",403);let r=new Set(t),o=e.split(",");if(o.length>Dg)throw new y("Invalid MCP baggage",403);let n=[];for(let i of o){let s=zg(i);if(!s)throw new y("Invalid MCP baggage",403);r.has(s.key)&&n.push(s.serialized)}return n.length>0?n.join(","):void 0}function U0(e,t={}){let r=_(e)&&_(e._meta)?e._meta:{},o=Vg(r.baggage,t.baggageAllowlist??[]);return{...Gg(r),...o?{baggage:o}:{}}}function B0(e,t){return Dr.run(structuredClone(e),t)}function q0(){let e=Dr.getStore();return e?{...e}:void 0}async function z0(e){let t=E(e.policy.resourceMetadataUrl,"protected resource metadata URL",!0).href,r=[...new Set(e.policy.requiredScopes??[])];if(r.some(u=>!Nr.test(u)))throw new y("Invalid authorization scope",401);let o=`Bearer resource_metadata="${t}"`;if(new URL(e.requestUrl,e.policy.resource).searchParams.has("access_token"))throw new y("Access tokens must not appear in URI query parameters",401,o);let s=jg(e.headers,"authorization")?.match(/^Bearer ([^\s]+)$/iu);if(!s)throw new y("Missing or malformed bearer token",401,o);let a=s[1];if(Buffer.byteLength(a,"utf8")>Fg)throw new y("Missing or malformed bearer token",401,o);let c;try{c=await e.policy.verifyAccessToken(a)}catch{throw new y("Invalid bearer token",401,o)}let d=Array.isArray(c.audience)?c.audience:[c.audience];if(c.issuer!==e.policy.issuer||!d.includes(e.policy.resource))throw new y("Bearer token issuer or audience mismatch",401,o);let l=r.filter(u=>!c.scopes.includes(u));if(l.length>0)throw new y("Bearer token has insufficient scope",403,`${o}, scope="${l.join(" ")}"`);return{...c,audience:[...d],scopes:[...c.scopes]}}function V0(e){let t=kr("sha256").update(e.token).digest();return r=>{let o=kr("sha256").update(r).digest();if(!Og(t,o))throw new y("Invalid bearer token",401);return structuredClone(e.claims)}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="4f17095e-2dba-530c-935c-1803ed359510")}catch{}})();var dt="io.modelcontextprotocol/ui",Ee="2026-01-26",Gr="text/html;profile=mcp-app",Fr=Object.freeze({specVersion:Ee,mimeTypes:[Gr]});function W0(e){let t=e.clientCapabilities.extensions;if(!_(t))return!1;let r=t[dt];if(r===void 0)return!1;if(!_(r))throw new p("Invalid MCP Apps client capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[dt]:Fr}}});let o=r.mimeTypes,n=r.specVersion;if(!Array.isArray(o)||!o.includes(Gr)||n!==void 0&&n!==Ee)throw new p("Unsupported MCP Apps client capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[dt]:Fr}}});return!0}var Hg={csp:{connectDomains:[],resourceDomains:[],frameDomains:[]},permissions:{},prefersBorder:!0},Ur=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:Hg})));function X0(e){return Ur.find(t=>t.uri===e)}function Y0(e){let t=new Map(Ur.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 jr(e){return e.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;")}function J0(e){let t=jr(e.name),r=jr(e.description),o=JSON.stringify({name:`pm-${e.id}-view`,version:Ee}),n=JSON.stringify(Ee);return`<!doctype html>
3
3
  <html lang="en">
4
4
  <head>
5
5
  <meta charset="utf-8">
@@ -22,12 +22,12 @@ import{A as Fh,B as jh,C as GM,D as UM,a as fs,b as _s,c as hs,d as gs,e as PM,f
22
22
  (()=>{"use strict";const MAX=24000,status=document.querySelector("#status"),result=document.querySelector("#result"),input=document.querySelector("#input"),pending=new Map();let nextId=1;const render=(node,value)=>{let text;try{text=typeof value==="string"?value:JSON.stringify(value,null,2)}catch{text="Result could not be serialized."}if(text.length>MAX)text=text.slice(0,MAX)+"\\n\\n[View truncated at "+MAX+" characters; use the authoritative pm tool with a cursor or narrower projection.]";node.textContent=text};const send=(message)=>window.parent.postMessage(message,"*");window.addEventListener("message",event=>{if(event.source!==window.parent||!event.data||event.data.jsonrpc!=="2.0")return;const message=event.data;if(message.id!==undefined&&pending.has(message.id)){pending.get(message.id)(message);pending.delete(message.id);return}if(message.method==="ui/notifications/tool-input"||message.method==="ui/notifications/tool-input-partial"){render(input,message.params?.arguments??message.params);status.textContent="Input received"}else if(message.method==="ui/notifications/tool-result"){render(result,message.params);status.textContent="Current tool result"}else if(message.method==="ui/notifications/tool-cancelled"){status.textContent="Tool call cancelled";status.classList.add("notice")}else if(message.method==="ui/notifications/host-context-changed"&&message.params?.theme){document.documentElement.style.colorScheme=message.params.theme}});const request=(method,params)=>new Promise(resolve=>{const id=nextId++;pending.set(id,resolve);send({jsonrpc:"2.0",id,method,params})});document.querySelector("#copy").addEventListener("click",async()=>{const text=result.textContent+"\\n\\n"+input.textContent;try{await navigator.clipboard.writeText(text);status.textContent="Visible evidence copied"}catch{status.textContent="Clipboard permission unavailable";status.classList.add("notice")}});request("ui/initialize",{appInfo:${o},appCapabilities:{},protocolVersion:${n}}).then(message=>{if(message.error){status.textContent="Host rejected MCP App initialization";status.classList.add("notice");return}send({jsonrpc:"2.0",method:"ui/notifications/initialized"});status.textContent="Connected \u2014 awaiting authoritative result"})})();
23
23
  </script>
24
24
  </body>
25
- </html>`}import{createHash as lt}from"node:crypto";import{lstat as Kg,readdir as Xr,readFile as Wg}from"node:fs/promises";import k from"node:path";import{parseDocument as Xg}from"yaml";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="6bfbe073-3869-5451-9d65-499960a28af9")}catch{}})();var Br="io.modelcontextprotocol/skills",ut="SEP-2640@a3e147ca2710f68214247aecc729731ee1ae8d03",Yg=Object.freeze({revision:ut,status:"draft",directoryRead:!0});function nx(e,t=!1){let r=e.clientCapabilities.extensions,o=_(r)?r[Br]:void 0;if(!_(o)||o.revision!==ut||t&&o.directoryRead!==!0)throw new p("Missing or incompatible Skills over MCP draft capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[Br]:Yg}}})}var M=Object.freeze({maxFilesPerSkill:512,maxFileBytes:16*1024*1024,maxSkillBytes:16*1024*1024,defaultPageSize:20,maxPageSize:100}),qr=100,Jg=32*1024*1024,Zg=/^[a-z0-9]+(?:-[a-z0-9]+)*$/u,zr=new Set(Array.from({length:M.maxPageSize},(e,t)=>t+1));function T(e,t){throw new p(e,-32602,t)}function Vr(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 Qg(e,t){let r=/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/u.exec(e);r||T(`Skill ${t} is missing YAML frontmatter.`);let o=Xg(r[1],{prettyErrors:!1,strict:!0,uniqueKeys:!0});o.errors.length>0&&T(`Skill ${t} has invalid YAML frontmatter.`,{errors:o.errors.map(i=>i.message)});let n;try{n=o.toJS({maxAliasCount:0})}catch(i){T(`Skill ${t} has unsupported YAML aliases.`,{error:String(i)})}return(typeof n!="object"||n===null||Array.isArray(n))&&T(`Skill ${t} frontmatter must be an object.`),n}async function ey(e,t,r,o){return r>M.maxFileBytes&&T(`Skill resource exceeds the per-file limit: ${t}.`),o.files+=1,o.files>M.maxFilesPerSkill&&T(`Skill exceeds ${M.maxFilesPerSkill} files.`),o.skillBytes+=r,o.skillBytes>M.maxSkillBytes&&T(`Skill exceeds the aggregate byte limit: ${t}.`),o.originBytes.value+=r,o.originBytes.value>Jg&&T(`Skill origin exceeds the aggregate byte limit: ${t}.`),Wg(e)}async function Yr(e,t,r){let o=k.join(e,t),n=await Xr(o,{withFileTypes:!0}),i=[];for(let s of n.sort((a,c)=>a.name.localeCompare(c.name))){let a=k.posix.join(t.split(k.sep).join("/"),s.name),c=k.join(e,...a.split("/")),d=await Kg(c);d.isSymbolicLink()&&T(`Skill resource must not be a symbolic link: ${a}.`),d.isDirectory()?i.push(...await Yr(e,a,r)):d.isFile()?i.push({relative:a,bytes:await ey(c,a,d.size,r)}):T(`Skill resource must be a regular file or directory: ${a}.`)}return i}async function Hr(e,t,r){let o=new Map,n;try{n=await Xr(e,{withFileTypes:!0})}catch(a){if(vt(a))return o;throw a}let i=n.filter(a=>a.isDirectory()&&Zg.test(a.name)).sort((a,c)=>a.name.localeCompare(c.name));i.length>qr&&T(`Skill origin exceeds ${qr} directories.`);let s={value:0};for(let a of i){let c=await Yr(k.join(e,a.name),"",{files:0,skillBytes:0,originBytes:s}),d=c.reduce((h,C)=>h+C.bytes.byteLength,0),l=c.find(h=>h.relative==="SKILL.md");if(!l)continue;let u=Qg(l.bytes.toString("utf8"),a.name);u.name!==a.name&&T(`Skill directory ${a.name} must match frontmatter name.`,{actual:u.name??null,expected:a.name}),(typeof u.description!="string"||u.description.trim().length===0)&&T(`Skill ${a.name} requires a non-empty frontmatter description.`,{required:["description"]});let f=c.map(h=>({uri:`skill://${a.name}/${h.relative}`,digest:`sha256:${lt("sha256").update(h.bytes).digest("hex")}`,size:h.bytes.byteLength})),g=lt("sha256").update(f.map(h=>`${h.uri}:${h.digest}`).join(`
25
+ </html>`}import{createHash as lt}from"node:crypto";import{lstat as Kg,readdir as Xr,readFile as Wg}from"node:fs/promises";import k from"node:path";import{parseDocument as Xg}from"yaml";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="6bfbe073-3869-5451-9d65-499960a28af9")}catch{}})();var Br="io.modelcontextprotocol/skills",ut="SEP-2640@a3e147ca2710f68214247aecc729731ee1ae8d03",Yg=Object.freeze({revision:ut,status:"draft",directoryRead:!0});function ix(e,t=!1){let r=e.clientCapabilities.extensions,o=_(r)?r[Br]:void 0;if(!_(o)||o.revision!==ut||t&&o.directoryRead!==!0)throw new p("Missing or incompatible Skills over MCP draft capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[Br]:Yg}}})}var M=Object.freeze({maxFilesPerSkill:512,maxFileBytes:16*1024*1024,maxSkillBytes:16*1024*1024,defaultPageSize:20,maxPageSize:100}),qr=100,Jg=32*1024*1024,Zg=/^[a-z0-9]+(?:-[a-z0-9]+)*$/u,zr=new Set(Array.from({length:M.maxPageSize},(e,t)=>t+1));function T(e,t){throw new p(e,-32602,t)}function Vr(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 Qg(e,t){let r=/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/u.exec(e);r||T(`Skill ${t} is missing YAML frontmatter.`);let o=Xg(r[1],{prettyErrors:!1,strict:!0,uniqueKeys:!0});o.errors.length>0&&T(`Skill ${t} has invalid YAML frontmatter.`,{errors:o.errors.map(i=>i.message)});let n;try{n=o.toJS({maxAliasCount:0})}catch(i){T(`Skill ${t} has unsupported YAML aliases.`,{error:String(i)})}return(typeof n!="object"||n===null||Array.isArray(n))&&T(`Skill ${t} frontmatter must be an object.`),n}async function ey(e,t,r,o){return r>M.maxFileBytes&&T(`Skill resource exceeds the per-file limit: ${t}.`),o.files+=1,o.files>M.maxFilesPerSkill&&T(`Skill exceeds ${M.maxFilesPerSkill} files.`),o.skillBytes+=r,o.skillBytes>M.maxSkillBytes&&T(`Skill exceeds the aggregate byte limit: ${t}.`),o.originBytes.value+=r,o.originBytes.value>Jg&&T(`Skill origin exceeds the aggregate byte limit: ${t}.`),Wg(e)}async function Yr(e,t,r){let o=k.join(e,t),n=await Xr(o,{withFileTypes:!0}),i=[];for(let s of n.sort((a,c)=>a.name.localeCompare(c.name))){let a=k.posix.join(t.split(k.sep).join("/"),s.name),c=k.join(e,...a.split("/")),d=await Kg(c);d.isSymbolicLink()&&T(`Skill resource must not be a symbolic link: ${a}.`),d.isDirectory()?i.push(...await Yr(e,a,r)):d.isFile()?i.push({relative:a,bytes:await ey(c,a,d.size,r)}):T(`Skill resource must be a regular file or directory: ${a}.`)}return i}async function Hr(e,t,r){let o=new Map,n;try{n=await Xr(e,{withFileTypes:!0})}catch(a){if(vt(a))return o;throw a}let i=n.filter(a=>a.isDirectory()&&Zg.test(a.name)).sort((a,c)=>a.name.localeCompare(c.name));i.length>qr&&T(`Skill origin exceeds ${qr} directories.`);let s={value:0};for(let a of i){let c=await Yr(k.join(e,a.name),"",{files:0,skillBytes:0,originBytes:s}),d=c.reduce((h,C)=>h+C.bytes.byteLength,0),l=c.find(h=>h.relative==="SKILL.md");if(!l)continue;let u=Qg(l.bytes.toString("utf8"),a.name);u.name!==a.name&&T(`Skill directory ${a.name} must match frontmatter name.`,{actual:u.name??null,expected:a.name}),(typeof u.description!="string"||u.description.trim().length===0)&&T(`Skill ${a.name} requires a non-empty frontmatter description.`,{required:["description"]});let f=c.map(h=>({uri:`skill://${a.name}/${h.relative}`,digest:`sha256:${lt("sha256").update(h.bytes).digest("hex")}`,size:h.bytes.byteLength})),g=lt("sha256").update(f.map(h=>`${h.uri}:${h.digest}`).join(`
26
26
  `)).digest("hex");o.set(a.name,{uri:`skill://${a.name}/SKILL.md`,frontmatter:u,resources:f,_meta:{contractVersion:1,extensionRevision:ut,origin:t,packageVersion:r,protocolVersion:K,trust:"untrusted",estimatedTokens:Math.ceil(d/4)},files:new Map(c.map(h=>[h.relative,h.bytes])),fingerprint:g})}return o}function Kr(e){let{files:t,fingerprint:r,...o}=e;return o}var Wr=class e{#e;#t;constructor(t){this.#e=t,this.#t=lt("sha256").update([...t.entries()].sort(([r],[o])=>r.localeCompare(o)).map(([r,o])=>`${r}:${o.fingerprint}`).join(`
27
- `)).digest("hex").slice(0,16)}#r(t,r){if(!t)return 0;try{let o=JSON.parse(Buffer.from(t,"base64url").toString("utf8"));return(typeof o!="object"||o===null||!("fingerprint"in o)||o.fingerprint!==this.#t||!("scope"in o)||o.scope!==r||!("offset"in o)||!Number.isInteger(o.offset)||Number(o.offset)<0)&&T("Skill cursor is invalid or stale."),Number(o.offset)}catch(o){if(o instanceof p)throw o;return T("Skill cursor is invalid or stale.")}}#o(t,r){return Buffer.from(JSON.stringify({fingerprint:this.#t,offset:t,scope:r})).toString("base64url")}static async load(t){let r=await Hr(k.join(t.packageRoot,".agents","skills"),"package",t.packageVersion);if(t.workspaceRoot){let o=k.resolve(t.packageRoot,".agents","skills"),n=k.resolve(t.workspaceRoot,".agents","skills");if(n!==o){let i=await Hr(n,"workspace",t.packageVersion);for(let[s,a]of i)r.set(s,a)}}return new e(r)}list(t={}){let r=t.limit??M.defaultPageSize;zr.has(r)||T(`Skill list limit must be an integer from 1 to ${M.maxPageSize}.`);let o=this.#r(t.cursor,"skills/list"),n=[...this.#e.values()].sort((c,d)=>c.uri.localeCompare(d.uri)),i=n.slice(o,o+r),s=o+i.length,a=s<n.length;return{skills:i.map(Kr),hasMore:a,...a?{nextCursor:this.#o(s,"skills/list")}:{}}}get(t){let r=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)\/SKILL\.md$/u.exec(t),o=r?this.#e.get(r[1]):void 0;return o||T(`Unknown pm MCP skill: ${t}.`,{field:"uri"}),Kr(o)}read(t){let r=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)\/(.+)$/u.exec(t),o=r?this.#e.get(r[1]):void 0,n=r?.[2]??"",i=o&&n?o.files.get(n):void 0,s=o?.resources.find(d=>d.uri===t);(!o||!i||!s)&&T(`Unknown pm MCP skill resource: ${t}.`,{field:"uri"});let a={digest:s.digest,origin:o._meta.origin,trust:"untrusted"},c=Vr(n,i);return c!=="application/octet-stream"?{contents:[{uri:t,mimeType:c,text:i.toString("utf8"),_meta:a}]}:{contents:[{uri:t,mimeType:c,blob:i.toString("base64"),_meta:a}]}}readDirectory(t,r={}){let o=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)(?:\/(.+))?$/u.exec(t),n=o?this.#e.get(o[1]):void 0;n||T(`Unknown pm MCP skill directory: ${t}.`,{field:"uri"});let i=(o?.[2]??"").replace(/\/$/u,""),s=i.length>0?`${i}/`:"",a=`skill://${o[1]}`,c=new Map;for(let C of n.resources){let S=C.uri.slice(`${a}/`.length);if(!S.startsWith(s))continue;let V=S.slice(s.length),[R,...At]=V.split("/"),$o=`${a}/${s}${R}`,Fo=n.files.get(`${s}${R}`);c.set(R,{uri:$o,name:R,mimeType:At.length>0?"inode/directory":Vr(R,Fo)})}i.length>0&&c.size===0&&T(`Unknown pm MCP skill directory: ${t}.`,{field:"uri"});let d=r.limit??M.maxPageSize;zr.has(d)||T(`Skill directory limit must be an integer from 1 to ${M.maxPageSize}.`);let l=this.#r(r.cursor,t),u=[...c.values()].sort((C,S)=>C.uri.localeCompare(S.uri)),f=u.slice(l,l+d),g=l+f.length,h=g<u.length;return{resources:f,hasMore:h,...h?{nextCursor:this.#o(g,t)}:{}}}};(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="38023567-8a5b-5e25-8d71-5112f74d1894")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="76fdc288-42b3-52b9-adc7-81e504f23ae3")}catch{}})();var Jr="https://schema.unbrained.dev/pm/workspace-recipe/v1";function pt(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)=>pt(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,pt(o,`${t}.${r}`)])))}function Ae(e){if(e.schema!==Jr)throw new Error(`Unsupported workspace recipe schema: ${e.schema}`);let t=Ot(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:pt(r.input,`operations[${o}].input`)})))})}async function Zr(e,t){let r=Ae(e);return It(r,t)}async function ty(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]="6e293af6-ee81-59b4-8d80-05e5c20bdcf1")}catch{}})();var Qr="pm.agent-observation/v1",eo="pm.agent-verdict/v1",to="pm.agent-episode/v1";function I(e,t){if(!Number.isSafeInteger(e)||e<=0)throw new Error(`${t} must be a positive safe integer.`)}function x(e,t){if(e.trim().length===0)throw new Error(`${t} must not be empty.`)}function ie(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let t of Object.values(e))ie(t)}return e}function ry(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(x(r.command,"observation.reads.command"),I(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 oy(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(I(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 ny(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(x(o.id,"observation.tiers.id"),I(o.max_tokens,"observation.tiers.max_tokens"),t.has(o.id))throw new Error(`Duplicate observation tier: ${o.id}.`);if(t.add(o.id),o.max_tokens>r)throw new Error("observation tiers must be ordered from largest to smallest max_tokens.");r=o.max_tokens;let n=new Set;for(let i of o.fields){if(j(i,"observation.tiers.fields"),n.has(i))throw new Error(`Duplicate observation tier field: ${i}.`);n.add(i)}}}function iy(e){if(e.schema!==Qr)throw new Error(`observation.schema must be ${Qr}.`);return x(e.id,"observation.id"),I(e.version,"observation.version"),ry(e.reads),oy(e.calibration),e.corpus_dependence.kind==="bounded"&&(x(e.corpus_dependence.dimension,"observation.corpus_dependence.dimension"),I(e.corpus_dependence.maximum,"observation.corpus_dependence.maximum")),ny(e.tiers),ie(structuredClone(e))}function mx(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 sy(e,t,r){I(r.budget_tokens,"observation request budget_tokens");let o=[];for(let[n,i]of e.tiers.entries()){o.push(i.id);let s=await t(i),a=Buffer.byteLength(P(s),"utf8"),c=Math.ceil(a/4);if(c<=Math.min(r.budget_tokens,i.max_tokens))return{status:"served",payload:s,receipt:{contract_id:e.id,contract_version:e.version,served_tier:i.id,degraded:n>0,attempted_tiers:o,emitted_bytes:a,estimated_tokens:c,calibration_basis:"emitted_bytes"}}}return{status:"refused",reason:"no_declared_tier_fits_budget",receipt:{contract_id:e.id,contract_version:e.version,served_tier:null,degraded:e.tiers.length>1,attempted_tiers:o,emitted_bytes:null,estimated_tokens:null,calibration_basis:"emitted_bytes"}}}function j(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 ro(e,t){let r=e;for(let o of j(t,"recorded field path")){if(r===null||typeof r!="object"||!Object.hasOwn(r,o))return;r=r[o]}return r}function ay(e){return`/${j(e,"verdict predicate path").map(t=>t.replaceAll("~","~0").replaceAll("/","~1")).join("/")}`}function cy(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 dy(e){if(e.schema!==eo)throw new Error(`verdict.schema must be ${eo}.`);x(e.id,"verdict.id"),I(e.version,"verdict.version");let t=new Set;for(let o of e.predicates){x(o.id,"verdict.predicates.id"),j(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}.`);cy(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 ie(structuredClone(e))}function ly(e,t){if(e.predicates.length===0)return{contract_id:e.id,contract_version:e.version,snapshot_id:t.snapshot_id,outcome:"not_applicable",score:null,policy:"verdict_only_no_reward",reason:"no_predicates_declared",predicates:[]};let r=new Map(e.predicates.map(s=>[s.id,s])),o=e.composition.predicate_ids.map(s=>{let a=r.get(s),c=ro(t.state,a.path),d=a.kind==="field_present"?c!==void 0:a.kind==="field_absent"?c===void 0:P(c)===P(a.expected);return{id:s,outcome:d?"satisfied":"violated",evidence_pointer:`${t.snapshot_id}#${ay(a.path)}`,evidence_digest:Mt(P(c))}}),n=o.filter(s=>s.outcome==="satisfied").length,i=e.composition.operator==="all"?n===o.length:n>0;return{contract_id:e.id,contract_version:e.version,snapshot_id:t.snapshot_id,outcome:i?"satisfied":"violated",score:n/o.length,policy:"verdict_only_no_reward",predicates:o}}function fx(e){if(e.schema!==to)throw new Error(`episode.schema must be ${to}.`);if(x(e.id,"episode.id"),I(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)x(t,"episode.task_item_ids");I(e.limits.max_actions,"episode.limits.max_actions"),I(e.limits.max_observations,"episode.limits.max_observations"),I(e.limits.max_tokens_per_observation,"episode.limits.max_tokens_per_observation");for(let t of e.observable_fields)j(t,"episode.observable_fields");for(let t of e.withheld_fields)j(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 iy(e.observation),dy(e.verdict),Ae(e.recipe),ie(structuredClone(e))}function uy(e,t,r){let o=j(t,"observation projection field"),n=e;for(let[i,s]of o.entries()){if(i===o.length-1){r!==void 0&&(n[s]=structuredClone(r));return}let a=n[s];(a===null||typeof a!="object"||Array.isArray(a))&&(n[s]={}),n=n[s]}}function py(e,t){let r={};for(let o of t)uy(r,o,ro(e,o));return r}async function _x(e,t){let r=[],o=0,n=0,i=!1,s,a={episode:{id:e.id,label:`pm agent environment v${e.version}`},provenance:{role:e.mode,topic:"agent-environment"}},c=await $(a,()=>t.reset(e.recipe));r.push({sequence:1,kind:"reset",state_id:c.state_id});let d=async()=>{if(i)throw new Error("episode is already closed.");if(n>=e.limits.max_observations)throw new Error("episode exceeded limits.max_observations.");n+=1;let u=await t.readRecordedState(),f=await sy(e.observation,async g=>py(u.state,g.fields),{budget_tokens:e.limits.max_tokens_per_observation});return r.push({sequence:r.length+1,kind:"observation",state_id:f.receipt.served_tier??u.snapshot_id}),f},l=async(u=!1)=>{if(i&&!u)throw new Error("episode is already closed.");if(n>=e.limits.max_observations)throw new Error("episode exceeded limits.max_observations.");n+=1;let f=await t.readRecordedState(),g=ly(e.verdict,f);return r.push({sequence:r.length+1,kind:"verdict",state_id:f.snapshot_id}),g};return{observe:()=>$(a,d),step:async u=>{if(i)throw new Error("episode is already closed.");if(o>=e.limits.max_actions)throw new Error("episode exceeded limits.max_actions.");o+=1;let f=await $(a,()=>t.execute(u));return r.push({sequence:r.length+1,kind:"action",state_id:f.state_id}),f},score:()=>$(a,l),close:()=>s!==void 0?s:i?Promise.reject(new Error("episode is already closed.")):(i=!0,s=$(a,()=>l(!0)).then(f=>(r.push({sequence:r.length+1,kind:"close",state_id:f.snapshot_id}),{verdict:f,trajectory:ie(structuredClone(r))})).catch(f=>{throw i=!1,f}).finally(()=>{s=void 0}),s)}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="9394fb87-fb36-5886-b262-ce2787326053")}catch{}})();var G="https://schema.unbrained.dev/pm/corpus-shape/v1";function X(e,t){if(!Number.isSafeInteger(e)||e<=0)throw new TypeError(`Corpus shape ${t} must be a positive safe integer`);return e}function se(e,t){if(!Number.isSafeInteger(e)||e<0)throw new TypeError(`Corpus shape ${t} must be a non-negative safe integer`);return e}function no(e){if(!(typeof e!="object"||e===null||Object.isFrozen(e))){for(let t of Object.values(e))no(t);Object.freeze(e)}}function Y(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(X(e.hierarchy_depth,"hierarchy_depth"),X(e.hierarchy_fanout,"hierarchy_fanout"),se(e.age_span_days,"age_span_days"),X(e.history_entries_per_item,"history_entries_per_item"),se(e.comments_per_100_items,"comments_per_100_items"),se(e.notes_per_100_items,"notes_per_100_items"),se(e.learnings_per_100_items,"learnings_per_100_items"),X(e.author_cardinality,"author_cardinality"),X(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 no(t),t}var ve=[{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}],J=Object.freeze({scratch:Y({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:Y({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:ve,author_cardinality:32,component_count:1,include_cycles:!1,custom_types:["Experiment"],custom_statuses:["review"],terminal_statuses:[],custom_fields:["domain"]}),"deep-graph":Y({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:ve,author_cardinality:16,component_count:1,include_cycles:!0,custom_types:[],custom_statuses:[],terminal_statuses:[],custom_fields:[]}),"multi-decade":Y({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:ve,author_cardinality:64,component_count:1,include_cycles:!1,custom_types:["Program"],custom_statuses:["archived"],terminal_statuses:["archived"],custom_fields:["portfolio"]}),"disconnected-archive":Y({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:ve,author_cardinality:24,component_count:5,include_cycles:!1,custom_types:["Archive"],custom_statuses:["archived"],terminal_statuses:["archived"],custom_fields:["archive_source"]})});function my(){return Object.keys(J).sort().map(e=>J[e])}function fy(e){let t=e.trim().toLowerCase();if(!Object.hasOwn(J,t))throw new TypeError(`Unknown corpus shape "${e}". Available: ${Object.keys(J).join(", ")}`);return J[t]}var oo=new WeakMap;function io(e,t){if(e===0)return[];let r=oo.get(t);r===void 0&&(r=t.edge_kind_mix.flatMap(n=>Array.from({length:n.weight},()=>n.kind)),oo.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 _y(e,t,r,o=42){if(se(t,"item index"),X(r,"item count"),t>=r)throw new RangeError(`Corpus item index ${t} exceeds ${r}`);let n=Math.min(e.component_count,r),i=t%n,s=Math.floor(t/n),a=0,c=1;for(let S=0;S<e.hierarchy_depth;S+=1)a=Math.min(Number.MAX_SAFE_INTEGER,a+c),c=Math.min(Number.MAX_SAFE_INTEGER,c*e.hierarchy_fanout);let d=s%a,l=s-d,u=d===0?void 0:i+(l+Math.floor((d-1)/e.hierarchy_fanout))*n,f=Date.UTC(2026,0,1),g=e.age_span_days*864e5,h=new Date(f+(r===1?0:Math.round(t/(r-1)*g))).toISOString(),C=(t*37+o)%100;return{index:t,id:`pm-s${t.toString(36).padStart(7,"0")}`,...u===void 0?{}:{parent:`pm-s${u.toString(36).padStart(7,"0")}`},component:i,timestamp:h,author:`pm-corpus-agent-${(t+o)%Math.min(e.author_cardinality,r)}`,history_entry_count:e.history_entries_per_item,dependency_kinds:io(t,e),has_comment:C<e.comments_per_100_items,has_note:C<e.notes_per_100_items,has_learning:C<e.learnings_per_100_items,...e.custom_types.length>0&&t%11===0?{custom_type:e.custom_types[t%e.custom_types.length]}:{},...e.custom_statuses.length>0&&t%13===0?{custom_status:e.custom_statuses[t%e.custom_statuses.length]}:{}}}var mt=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,io(t.index,this.shape))}finish(){let t=Math.min(this.shape.author_cardinality,this.itemCount),r=Math.min(this.shape.component_count,this.itemCount),o=[...this.planMismatches,...this.itemCount===0?["item_count:empty"]:[],...this.authors.size===t?[]:[`author_count:${this.authors.size}!=${t}`],...this.components.size===r?[]:[`component_count:${this.components.size}!=${r}`],...this.observedDepth<=this.shape.hierarchy_depth?[]:[`hierarchy_depth:${this.observedDepth}>${this.shape.hierarchy_depth}`],...this.observedFanout<=this.shape.hierarchy_fanout?[]:[`hierarchy_fanout:${this.observedFanout}>${this.shape.hierarchy_fanout}`]];for(let[s,,a]of this.annotationFields){let c=Math.floor(this.itemCount/100),d=this.itemCount%100,l=c*a+Math.max(0,a+d-100),u=c*a+Math.min(a,d),f=this.annotations[s];(f<l||f>u)&&o.push(`${s}:${f}!in[${l},${u}]`)}let n=new Set([...Object.keys(this.edgeKinds),...Object.keys(this.expectedEdgeKinds)]);for(let s of[...n].sort()){let a=this.edgeKinds[s]??0,c=this.expectedEdgeKinds[s]??0;a!==c&&o.push(`edge_kind:${s}:${a}!=${c}`)}let i=[...new Set(o)];return{shape:this.shape.name,item_count:this.itemCount,author_count:this.authors.size,component_count:this.components.size,hierarchy_depth:this.observedDepth,hierarchy_fanout:this.observedFanout,timestamp_range:{first:this.firstTimestamp,last:this.lastTimestamp},history_entry_count:this.historyEntryCount,annotations:{...this.annotations},edge_kinds:{...this.edgeKinds},matches_declaration:i.length===0,mismatches:i}}};function so(e){return new mt(e)}function hy(e,t){let r=so(e);for(let o of t)r.add(o);return r.finish()}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="48d03e9b-14a4-545c-8e5d-5f5f2092a113")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="dd1a948a-2fa2-5d2e-a41c-31f75297f17e")}catch{}})();async function gy(){let e=Ge(process.cwd(),process.env.PM_PATH);await Lt(e,(t,r)=>Dt(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 yy(){await $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]="b84b220f-cad0-5861-b3ed-07453179706e")}catch{}})();var ao=["lines","branches","functions","statements"];function by(e,t){if(typeof t!="object"||t===null||Array.isArray(t))throw new TypeError(`Coverage entry for ${e} must be an object.`)}function Cy(e,t,r){if(typeof r!="object"||r===null||Array.isArray(r))throw new TypeError(`Coverage entry ${e} has invalid ${t} counts.`);let 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 Ty(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)){by(r,o);for(let n of ao){let i=Cy(r,n,o[n]),s=i.total-i.covered;s>0&&t.push({file:r,metric:n,uncovered:s,...i})}}return t}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="aa6b9997-a4c6-5bfb-8804-45b34afd9e01")}catch{}})();var Sy=["captured_redacted","captured_verbatim"],wy=[{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 O(e){return typeof e=="string"&&e.trim().length>0}function Ey(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||!Sy.includes(r.capture_source)||!O(r.capture_provenance)||!Array.isArray(r.redactions)||!r.redactions.every(O)||!("input"in r)||!("observed"in r))&&o.push({boundary_id:e.id,kind:"invalid_fixture",detail:`${e.fixture_path} lacks captured provenance, redaction metadata, input, or observed output.`});let n=JSON.stringify(t);for(let i of wy)i.pattern.test(n)&&o.push({boundary_id:e.id,kind:"unsafe_fixture",detail:`${e.fixture_path} contains a possible ${i.label}.`});return o}function Ay(e,t){let r=Date.parse(e.waiver_expires_at),o=O(e.waiver_reason)&&O(e.waiver_owner)&&e.waiver_expires_at.endsWith("Z")&&Rt(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 vy(e,t,r){if(!O(e.id)||!O(e.producer)||!O(e.consumer)||!O(e.format))return{captured:0,waived:0,findings:[{boundary_id:O(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=O(e.fixture_path)&&e.fixture_path in t?Ey(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 Ay(e,r)}function kx(e,t,r=new Date){let o=[];if(e.version!==1||!O(e.inventory_scope)||!Array.isArray(e.boundaries))return{ok:!1,boundary_count:0,captured_count:0,waived_count:0,findings:[{boundary_id:"registry",kind:"invalid_registry",detail:"Boundary registry requires version 1, inventory_scope, and boundaries."}]};let n=new Set,i=0,s=0;for(let a of e.boundaries){if(typeof a!="object"||a===null||Array.isArray(a)){o.push({boundary_id:"unknown",kind:"invalid_boundary",detail:"Each boundary must be a JSON object."});continue}let c=a,d=O(c.id)?c.id:void 0;if(d!==void 0&&n.has(d)){o.push({boundary_id:d,kind:"duplicate_boundary",detail:`Boundary ${d} is inventoried more than once.`});continue}d!==void 0&&n.add(d);let l=vy(c,t,r.getTime());i+=l.captured,s+=l.waived,o.push(...l.findings)}return o.sort((a,c)=>a.boundary_id!==c.boundary_id?a.boundary_id.localeCompare(c.boundary_id):a.kind.localeCompare(c.kind)),{ok:o.length===0,boundary_count:e.boundaries.length,captured_count:i,waived_count:s,findings:o}}import Z from"node:fs";import ft from"node:path";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="9c9e4ac4-51b2-5920-bb27-a4f239f6b429")}catch{}})();var co=300*1e3,Oy=3;function $x(e){return(e?.trim()||"development").replace(/[^a-zA-Z0-9._-]/g,"_").replace(/^\./,"_")}function Fx(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.");Z.mkdirSync(e,{recursive:!0});let o=ft.join(e,r);Z.mkdirSync(o,{recursive:!0});let n=new Date;Z.utimesSync(o,n,n);let i=Z.readdirSync(e).filter(d=>d!==r).flatMap(d=>{try{return[{name:d,mtimeMs:Z.statSync(ft.join(e,d)).mtimeMs}]}catch(l){if(l instanceof Error&&"code"in l&&fe(l))return[];throw l}}).sort((d,l)=>l.mtimeMs-d.mtimeMs||d.name.localeCompare(l.name)),s=i.filter(d=>n.getTime()-d.mtimeMs<co),a=Math.max(0,Oy-1-s.length),c=i.filter(d=>n.getTime()-d.mtimeMs>=co).slice(a).map(d=>d.name).sort((d,l)=>d.localeCompare(l));for(let d of c)Z.rmSync(ft.join(e,d),{recursive:!0,force:!0,maxRetries:3,retryDelay:50});return{retained:r,removed:c}}import lo from"node:fs";import Ie 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]="7ab9180f-dfcb-579d-bc0c-dbba2e4ad77e")}catch{}})();var ae="@unbrained/pm-cli",Iy=new Set(["append","claim","changelog","close","close-many","close-task","comments","config","copy","create","dedupe-merge","delete","deps","docs","extension","event","events","files","focus","gc","history-author-acknowledge","history-compact","history-redact","history-repair","init","install","item","learnings","meet","merge","normalize","notes","package","packages","pause-task","plan","profile","reindex","release","remind","restore","schema","start-task","test","test-all","test-runs","test-runs-worker","telemetry","templates","twin","update","update-many","upgrade","vcs","workspace"]),uo=new Set(["--author","--output-budget","--output-format","--output-include","--output-limit","--output-session","--path","--pm-path"]),gt=/\b(\d{4})\.(\d{1,2})\.(\d{1,2})(?:-(\d+))?\b/u,Pe="2026.8.31";function w(e,t){return e.some(r=>t.includes(r.split("=",1)[0]))}function _t(e,t){return["activate","adopt","adopt-all","deactivate","init","install","migrate","reload","uninstall"].includes(t[0]??"")||w(e,["--activate","--adopt","--adopt-all","--deactivate","--fix-managed-state","--init","--install","--output","--reload","--scaffold","--uninstall"])}var Ry={changelog:(e,t)=>{if(t[0]==="generate")return!w(e,["--check"]);let r=e.indexOf("export");return t[0]==="export"&&(w(e,["--output"])||r>=0&&e[r+1]!==void 0&&!e[r+1].startsWith("-"))},comments:e=>w(e,["--add","--delete","--edit","--file","--stdin"]),config:(e,t)=>(t[0]==="project"||t[0]==="global"?t[1]:t[0])==="set",deps:()=>!1,docs:e=>w(e,["--add","--add-glob","--migrate","--remove"]),duplicates:()=>!1,events:()=>!1,extension:_t,files:(e,t)=>w(e,["--add","--add-glob","--migrate","--remove"])||t[0]==="discover"&&w(e,["--apply"]),health:e=>!w(e,["--check-only","--no-refresh","--skip-vectors"]),learnings:e=>w(e,["--add","--delete","--edit","--file","--stdin"]),merge:(e,t)=>t[0]!=="report",notes:e=>w(e,["--add","--delete","--edit","--file","--stdin"]),package:_t,packages:_t,profile:(e,t)=>t[0]==="apply",schema:(e,t)=>["add-field","add-status","add-type","remove-field","remove-status","remove-type","remap-status","rename-field","rename-type"].includes(t[0]??"")&&!(w(e,["--infer"])&&!w(e,["--apply"])),telemetry:(e,t)=>t.slice(0,2).some(r=>["clear","flush"].includes(r)),templates:(e,t)=>t[0]==="save",test:e=>w(e,["--add","--add-json","--background","--measure","--remove","--resume","--run","--stop"]),validate:e=>w(e,["--auto-fix","--prune-missing"]),vcs:(e,t)=>["abandon","create","merge","propose","ref-create"].includes(t[0]??""),workspace:(e,t)=>t[0]==="snapshot"&&["create","delete","restore"].includes(t[1]??"")};function Re(e){let t=e.match(gt);return t?[Number(t[1]),Number(t[2]),Number(t[3]),Number(t[4]??0)]:null}function U(e,t){let r=Re(e),o=Re(t);if(!r||!o)return null;for(let n=0;n<r.length;n+=1){let i=r[n]-o[n];if(i!==0)return Math.sign(i)}return 0}function Oe(e){return U(e,Pe)!==-1?3:2}function Py(e,t){if(t===3)return e.filter(r=>r.history_epoch_compatible===!1).map(r=>({...r,declaration:r.declaration??r.version})).sort((r,o)=>U(r.version,o.version))[0]}function ht(e){try{let t=JSON.parse(lo.readFileSync(e,"utf8"));return typeof t=="object"&&t!==null&&!Array.isArray(t)?t:null}catch{return null}}function My(e){let t=[...e.matchAll(/(<=|<)\s*v?(\d{4}\.\d{1,2}\.\d{1,2}(?:-\d+)?)/gu)].map(o=>({inclusive:o[1]==="<=",version:o[2]})),r=e.match(/\b\d{4}\.\d{1,2}\.\d{1,2}(?:-\d+)?\s+-\s+v?(\d{4}\.\d{1,2}\.\d{1,2}(?:-\d+)?)/u);return r?[...t,{inclusive:!0,version:r[1]}]:t}function ky(e){let t=e.split("||").map(r=>My(r));return{bounded:t.some(r=>r.length>0),compatible:t.some(r=>r.every(o=>{let n=U(Pe,o.version);return n!==null&&(o.inclusive?n!==1:n===-1)}))}}function xy(e){return["dependencies","devDependencies","optionalDependencies","peerDependencies"].flatMap(t=>{let r=e[t];if(typeof r!="object"||r===null)return[];let o=r[ae],n=typeof o=="string"?o.trim():"",i=/^[<!]/u.test(n)?void 0:n.match(gt)?.[0];if(!i)return[];let s=/^(?:=|v)?\d{4}\.\d{1,2}\.\d{1,2}(?:-\d+)?$/u.test(n),a=ky(n);return[{version:i,constraint:s?"exact":a.bounded?"range":"minimum",...s?{}:{declaration:n},history_epoch_compatible:s?U(i,Pe)!==-1:a.compatible}]})}function Ny(e){let r=ht(Ie.join(e,"package-lock.json"))?.packages;if(typeof r!="object"||r===null)return;let o=r["node_modules/@unbrained/pm-cli"];if(typeof o!="object"||o===null)return;let n=o.version;return typeof n=="string"?n:void 0}function Ly(e,t){try{let r=lo.readFileSync(Ie.join(e,t),"utf8").split(/\r?\n/u),o=r.findIndex(c=>c.includes(ae));if(o<0)return;let n=r[o].match(/^\s*/u)[0].length,i=[r[o]];for(let c=o+1;c<r.length;c+=1){let d=r[c],l=d.trim(),u=d.match(/^\s*/u)[0].length;if(l.length>0&&u<=n)break;i.push(d)}return i.join(`
28
- `).match(/^\s*version(?::\s*|\s+)["']?(\d{4}\.\d{1,2}\.\d{1,2}(?:-\d+)?)/mu)?.[1]??i[0].match(gt)?.[0]}catch{return}}function Dy(e){let t=[],r=ht(Ie.join(e,"package.json"));r&&t.push(...xy(r).map(s=>({...s,source:"package.json"})));let n=ht(Ie.join(e,"node_modules","@unbrained","pm-cli","package.json"))?.version;typeof n=="string"&&Re(n)&&t.push({version:n,source:"installed-package",constraint:"exact",history_epoch_compatible:Oe(n)===3});let i=Ny(e);i&&Re(i)&&t.push({version:i,source:"package-lock.json",constraint:"exact",history_epoch_compatible:Oe(i)===3});for(let s of["pnpm-lock.yaml","yarn.lock"]){let a=Ly(e,s);a&&t.push({version:a,source:s,constraint:"exact",history_epoch_compatible:Oe(a)===3})}return t}function po(e){for(let t=0;t<e.length;t+=1){let r=e[t];if(uo.has(r)){t+=1;continue}if(!r.startsWith("-"))return{command:r.toLowerCase(),index:t}}}function $y(e){let t=po(e);if(!t||w(e,["--help","-h","--dry-run"]))return!1;let{command:r,index:o}=t,n=[];for(let s=o+1;s<e.length;s+=1){let a=e[s];if(uo.has(a)){s+=1;continue}a.startsWith("-")||n.push(a.toLowerCase())}let i=Ry[r];return i?i(e,n):Iy.has(r)}function Fy(e){let t=po(e.argv)?.command,r=$y(e.argv),o=Dy(e.projectRoot).filter(l=>U(l.version,e.executingVersion)!==null).sort((l,u)=>U(u.version,l.version)),n=o[0],i=n!==void 0&&U(e.executingVersion,n.version)===-1,s=Oe(e.executingVersion),a=Py(o,s),c=r&&a!==void 0,d=i&&!r?{code:"project_runtime_stale_read",executing_version:e.executingVersion,project_version:n.version,source:n.source,message:"This read is using an older pm runtime than the project requires.",next_steps:[`Run the command through the project's installed ${ae} ${n.version}.`,"Install the project dependencies with its declared package manager if the local executable is missing."]}:void 0;return{compatible:!r||!i&&!c||e.allowStale===!0,executing_version:e.executingVersion,...n?{project_version:n.version,source:n.source}:{},...t?{command:t}:{},mutating:r,stale:i,history_epoch_incompatible:c,writer_item_hash_version:s,...a?{incompatible_project_version:a.declaration,incompatible_source:a.source}:{},...d?{warning:d}:{},override_applied:r&&(i||c)&&e.allowStale===!0}}function zx(e){let t=Fy(e);if(t.compatible)return t;throw t.history_epoch_incompatible?new b(`pm ${t.executing_version} cannot write item-hash epoch ${t.writer_item_hash_version} into a project pinned to pm ${t.incompatible_project_version}.`,D.CONFLICT,{code:"project_runtime_history_epoch_incompatible",reason:t.incompatible_source,why:`The pinned runtime cannot read item_hash_version ${t.writer_item_hash_version}; allowing the write would break its health and validation gates.`,nextSteps:[`Upgrade the project's ${ae} pin to ${Pe} or newer before mutating tracker history.`,"For an intentional coordinated migration only, set PM_ALLOW_STALE_CLI=1 for this invocation and record why.","Read-only commands remain available without an override."]}):new b(`pm ${t.executing_version} cannot mutate a project pinned to newer pm ${t.project_version}.`,D.CONFLICT,{code:"project_runtime_stale_mutation",reason:t.source,why:"An older runtime can write storage, history, and merge contracts it does not understand.",nextSteps:[`Run this command through the project's installed ${ae} ${t.project_version}.`,"For an intentional recovery only, set PM_ALLOW_STALE_CLI=1 for this invocation and record why.","Read-only commands remain available without an override."]})}import{createHash as jy}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="eb475dcd-d16c-51fb-b248-b14cf5ade4de")}catch{}})();var yt=1;function Q(e){e?.throwIfAborted()}function B(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship graph ${t} must be non-empty`);return e.trim()}function ee(e,t,r={}){let o=Date.parse(r.createdAt??new Date().toISOString());if(!Number.isFinite(o))throw new TypeError("Relationship graph createdAt must be a valid timestamp");let n=e.nodes(),i=e.edges(),s=t.list();return Object.freeze({version:yt,fingerprint:jy("sha256").update(P({nodes:n,edges:i,kinds:s})).digest("hex"),created_at:new Date(o).toISOString(),nodes:n,edges:i,kinds:s})}function Gy(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function de(e){if(!Gy(e))throw new TypeError("Relationship graph snapshot must be an object");if(e.version!==yt)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 Ue([]);for(let n of e.kinds)t.register(n);let r=new H(e.nodes,e.edges,t),o=ee(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 N(e,t){B(e.name,"adapter name");let r=B(t.workspace,"workspace");Q(t.signal);let o=await e.read({...t,workspace:r});return Q(t.signal),o===null?null:de(o)}async function Me(e,t){let r=B(t.workspace,"workspace"),o=de(t.snapshot).snapshot,n=await N(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(Q(t.signal),await e.replace({workspace:r,signal:t.signal,snapshot:o,expected_fingerprint:n?.snapshot.fingerprint??null}),(await N(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 Uy(e,t={}){let r=e.map(de),o=new Map;for(let s of r)for(let a of s.snapshot.kinds){let c=o.get(a.kind);if(c&&P(c)!==P(a))throw new TypeError(`Conflicting federated relationship kind: ${a.kind}`);o.set(a.kind,a)}let n=new Ue([...o.values()].sort((s,a)=>s.kind.localeCompare(a.kind))),i=new H(new Set(r.flatMap(s=>[...s.snapshot.nodes])),r.flatMap(s=>[...s.snapshot.edges]),n);return ee(i,n,t)}var ce=class{name;#e=new Map;constructor(t="memory"){this.name=B(t,"adapter name")}async read(t){Q(t.signal);let r=this.#e.get(B(t.workspace,"workspace"));return r?structuredClone(r):null}async replace(t){Q(t.signal);let r=B(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(de(t.snapshot).snapshot))}async clear(t){Q(t.signal);let r=B(t.workspace,"workspace"),o=this.#e.get(r);if(t.expected_fingerprint!==void 0&&(o?.fingerprint??null)!==t.expected_fingerprint)throw new Error(`Relationship graph adapter conflict for ${r}`);this.#e.delete(r)}};(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="9a60b8c0-37d1-5c04-a079-e1351caf6e09")}catch{}})();function mo(e,t){if(!Number.isInteger(e)||e<1)throw new TypeError(`Relationship graph ${t} must be a positive integer`);return e}function By(e){let t=mo(e.nodeCount,"nodeCount"),r=mo(e.edgeStride??1,"edgeStride"),o=e.topology??"chain";if(!["chain","star","disconnected"].includes(o))throw new TypeError(`Unsupported relationship graph topology: ${o}`);let n=(e.kind??"related").trim(),i=(e.idPrefix??"node").trim();if(!n||!i)throw new TypeError("Relationship graph kind and idPrefix must be non-empty");let s=o==="disconnected"?0:Math.floor((t-1)/r);return{node_count:t,edge_count:s,edge_basis:"fixture_generated",nodes:{*[Symbol.iterator](){for(let a=0;a<t;a+=1)yield`${i}-${a}`}},edges:{*[Symbol.iterator](){if(o!=="disconnected")for(let a=r;a<t;a+=r)yield{source:`${i}-${o==="star"?0:a-r}`,target:`${i}-${a}`,kind:n}}}}}function q(e,t){if(!e)throw new Error(`Relationship graph adapter conformance: ${t}`)}async function fo(e,t={}){let r=t.workspace?.trim()||"pm-graph-conformance",o=Pt(),n=ee(new H(["a","b"],[{source:"a",target:"b",kind:"related"}],o),o,{createdAt:"2026-01-01T00:00:00.000Z"}),i=ee(new H(["a","b","c"],[{source:"a",target:"b",kind:"related"},{source:"b",target:"c",kind:"blocked_by"}],o),o,{createdAt:"2026-01-02T00:00:00.000Z"}),s=[];q(await N(e,{workspace:r})===null,"workspace must start empty"),s.push({name:"empty-read",passed:!0});let a=await Me(e,{workspace:r,snapshot:n});q(a.disposition==="written","first sync must write"),s.push({name:"atomic-replace",passed:!0}),(await e.read({workspace:r})).nodes.push("mutated-reader-copy"),q((await N(e,{workspace:r}))?.snapshot.nodes.length===2,"reads must not mutate stored state"),s.push({name:"read-isolation",passed:!0}),q((await Me(e,{workspace:r,snapshot:n})).disposition==="current","identical sync must be idempotent"),s.push({name:"idempotent-sync",passed:!0}),await e.replace({workspace:r,snapshot:i,expected_fingerprint:n.fingerprint}),q((await N(e,{workspace:r}))?.snapshot.fingerprint===i.fingerprint,"replacement must become visible"),s.push({name:"replacement-visibility",passed:!0});let d=!1;try{await e.replace({workspace:r,snapshot:n,expected_fingerprint:n.fingerprint})}catch{d=!0}return q(d,"stale compare-and-swap must fail"),s.push({name:"stale-cas",passed:!0}),e.clear&&(await e.clear({workspace:r,expected_fingerprint:i.fingerprint}),q(await N(e,{workspace:r})===null,"clear must remove the workspace"),s.push({name:"clear",passed:!0})),{adapter:e.name,workspace:r,cases:Object.freeze(s),clear_supported:e.clear!==void 0}}function qy(e){return fo(new ce,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]="c59413c4-8955-5560-8bc6-f1dc9c8c5042")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="d45a8203-4501-5797-a6cc-a2e7844adec9")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="4d2bee02-8003-578c-9d25-32755534f8ff")}catch{}})();var bt=2,zy=["self_reported","independent_transport"];function ke(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function le(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`${t} must be a non-empty string`);return e.trim()}function _o(e,t,r=!1){if(!Array.isArray(e)||e.length===0)throw new TypeError(`${t} must be a non-empty string array`);return e.map((o,n)=>{let i=le(o,`${t}[${String(n)}]`);return r?o:i})}function Ct(e,t){return e===void 0?void 0:le(e,t)}function Vy(e,t){if(e===void 0)return;if(!ke(e)||Object.keys(e).length===0)throw new TypeError(`${t} must be a non-empty object`);let r=Object.entries(e).map(([o,n])=>{if(o.length===0||o.split(".").some(i=>i.length===0))throw new TypeError(`${t} must use dot-separated own-property paths`);if(n!==null&&typeof n!="string"&&typeof n!="boolean"&&(typeof n!="number"||!Number.isFinite(n)))throw new TypeError(`${t} values must be JSON primitives`);return[o,n]});return Object.fromEntries(r)}function Hy(e,t,r,o,n,i){if(o==="refusal"){if(Xe(r)||n===void 0||i===void 0)throw new TypeError(`${e} refusal steps require a non-success exit, error code, and refusal surface`);return}if(n!==void 0||i!==void 0)throw new TypeError(`${e} only refusal steps may declare expected_error_code or expected_refusal_surface`);let s=xt(t);if(s===void 0)throw new TypeError(`${e}.args must identify a command after global flags`);let a=t[s].trim().toLowerCase();if(a==="history"){let l=Nt(t.slice(s+1));l!==void 0&&(a=Fe(`history ${l}`))}let c=Kt(a);if(!Xe(r)||r!==0&&!c?.exit_codes.some(l=>l===r))throw new TypeError(`${e} successful output must use exit code 0 or a command-declared successful effect exit`);let d=cr(a).kind;if(o!==d)throw new TypeError(`${e} expected ${o}, but ${a} declares ${d}`)}function Ky(e,t,r){if(!ke(e))throw new TypeError(`tasks.${t}.steps[${String(r)}] must be an object`);let o=`tasks.${t}.steps[${String(r)}]`,n=le(e.id,`${o}.id`),i=_o(e.args,`${o}.args`,!0),s=e.expected_exit_code;if(typeof s!="number"||!Number.isSafeInteger(s))throw new TypeError(`${o}.expected_exit_code must be a safe integer`);let a=e.expected_output_kind;if(a!=="refusal"&&!ar.includes(a))throw new TypeError(`${o}.expected_output_kind is unsupported`);let c=a,d=e.expected_accounting_mode;if(!zy.includes(d))throw new TypeError(`${o}.expected_accounting_mode is unsupported`);let l=d;if(l==="independent_transport"&&c!=="refusal")throw new TypeError(`${o} independent_transport accounting is supported only for refusal steps`);let u=_o(e.required_fields,`${o}.required_fields`);if(u.some(S=>S.split(".").some(V=>V.length===0)))throw new TypeError(`${o}.required_fields must contain dot-separated own-property paths`);let f=Vy(e.expected_field_values,`${o}.expected_field_values`),g=Ct(e.expected_error_code,`${o}.expected_error_code`),h=Ct(e.expected_refusal_surface,`${o}.expected_refusal_surface`),C=Ct(e.recovery_for,`${o}.recovery_for`);return Hy(o,i,s,c,g,h),{id:n,args:i,expected_exit_code:s,expected_output_kind:c,expected_accounting_mode:l,required_fields:u,...f?{expected_field_values:f}:{},...g?{expected_error_code:g}:{},...h?{expected_refusal_surface:h}:{},...C?{recovery_for:C}:{}}}function Wy(e,t){if(!ke(e))throw new TypeError(`tasks[${String(t)}] must be an object`);let r=le(e.id,`tasks[${String(t)}].id`),o=le(e.description,`tasks.${r}.description`);if(!Array.isArray(e.steps)||e.steps.length===0)throw new TypeError(`tasks.${r}.steps must be a non-empty array`);let n=e.steps.map((s,a)=>Ky(s,r,a)),i=new Map;for(let s of n){if(i.has(s.id))throw new TypeError(`tasks.${r} contains duplicate step id ${s.id}`);if(s.recovery_for!==void 0&&(i.get(s.recovery_for)?.expected_output_kind!=="refusal"||s.expected_output_kind==="refusal"))throw new TypeError(`tasks.${r}.${s.id} recovery_for must reference an earlier refusal and declare successful output`);i.set(s.id,s)}if(n.at(-1)?.expected_output_kind==="refusal")throw new TypeError(`tasks.${r} completed task must terminate with successful output`);for(let s of n)if(s.expected_output_kind==="refusal"&&!n.some(a=>a.recovery_for===s.id))throw new TypeError(`tasks.${r}.${s.id} refusal must have a later successful recovery_for step`);return{id:r,description:o,steps:n}}function bN(e){if(!ke(e))throw new TypeError("agent-task transcript corpus must be an object");if(e.version!==bt)throw new TypeError(`agent-task transcript corpus version must be ${String(bt)}`);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)=>Wy(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:bt,tasks:t}}import{createHash as ho}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="41ef1735-c534-5b84-8367-1278007cb7c6")}catch{}})();function go(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship backfill ${t} must be non-empty`);return e.trim()}function wN(e,t){let r=go(t.migrationId,"migrationId"),o=go(t.author,"author"),n=Date.parse(t.timestamp);if(!Number.isFinite(n))throw new TypeError("Relationship backfill timestamp must be valid");let i=new Date(n).toISOString(),s=We(e,void 0,t.registry),a=s.graph.nodes(),c=s.graph.edges().map(f=>{let g=ho("sha256").update(JSON.stringify([r,f.kind,f.source,f.target,f.createdAt??null,f.author??null,f.payload??null])).digest("hex").slice(0,24);return Object.freeze({eventId:`backfill:${r}:${g}`,relationshipId:`migration:${r}:${g}`,action:"add",edge:f,author:o,timestamp:i,reason:`Backfill ${r} from legacy item metadata`})}),d=ho("sha256").update(JSON.stringify({migrationId:r,nodes:a,events:c})).digest("hex"),l=new Set([...t.existingEventIds??[]].filter(f=>typeof f=="string").map(f=>f.trim()).filter(Boolean)),u=c.filter(f=>!l.has(f.eventId));return Object.freeze({migration_id:r,fingerprint:d,nodes:a,events:Object.freeze(u),edge_count:c.length,skipped_existing_count:c.length-u.length,duplicate_dependency_rows:s.duplicateRows.length,dangling_reference_count:s.dangling.active.length+s.dangling.legacy_terminal.length})}import*as yo from"node:module";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="81067f95-115f-5aee-b649-55d86c3915d4")}catch{}})();var ue=["suggested_retry","candidate_command","example","next_step","migration_hint","restore_with"],Tt={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"}},AN=Object.freeze(Object.keys(Tt));function bo(e){if(Object.hasOwn(Tt,e))return Tt[e]}var Xy=new Set([..."=([{,:;!?&|+-*%^~<>","=>"]);function te(e,t){return e<t?-1:e>t?1:0}function Yy(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 Jy(e){return e===void 0||e.kind==="punctuator"&&Xy.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(`
27
+ `)).digest("hex").slice(0,16)}#r(t,r){if(!t)return 0;try{let o=JSON.parse(Buffer.from(t,"base64url").toString("utf8"));return(typeof o!="object"||o===null||!("fingerprint"in o)||o.fingerprint!==this.#t||!("scope"in o)||o.scope!==r||!("offset"in o)||!Number.isInteger(o.offset)||Number(o.offset)<0)&&T("Skill cursor is invalid or stale."),Number(o.offset)}catch(o){if(o instanceof p)throw o;return T("Skill cursor is invalid or stale.")}}#o(t,r){return Buffer.from(JSON.stringify({fingerprint:this.#t,offset:t,scope:r})).toString("base64url")}static async load(t){let r=await Hr(k.join(t.packageRoot,".agents","skills"),"package",t.packageVersion);if(t.workspaceRoot){let o=k.resolve(t.packageRoot,".agents","skills"),n=k.resolve(t.workspaceRoot,".agents","skills");if(n!==o){let i=await Hr(n,"workspace",t.packageVersion);for(let[s,a]of i)r.set(s,a)}}return new e(r)}list(t={}){let r=t.limit??M.defaultPageSize;zr.has(r)||T(`Skill list limit must be an integer from 1 to ${M.maxPageSize}.`);let o=this.#r(t.cursor,"skills/list"),n=[...this.#e.values()].sort((c,d)=>c.uri.localeCompare(d.uri)),i=n.slice(o,o+r),s=o+i.length,a=s<n.length;return{skills:i.map(Kr),hasMore:a,...a?{nextCursor:this.#o(s,"skills/list")}:{}}}get(t){let r=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)\/SKILL\.md$/u.exec(t),o=r?this.#e.get(r[1]):void 0;return o||T(`Unknown pm MCP skill: ${t}.`,{field:"uri"}),Kr(o)}read(t){let r=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)\/(.+)$/u.exec(t),o=r?this.#e.get(r[1]):void 0,n=r?.[2]??"",i=o&&n?o.files.get(n):void 0,s=o?.resources.find(d=>d.uri===t);(!o||!i||!s)&&T(`Unknown pm MCP skill resource: ${t}.`,{field:"uri"});let a={digest:s.digest,origin:o._meta.origin,trust:"untrusted"},c=Vr(n,i);return c!=="application/octet-stream"?{contents:[{uri:t,mimeType:c,text:i.toString("utf8"),_meta:a}]}:{contents:[{uri:t,mimeType:c,blob:i.toString("base64"),_meta:a}]}}readDirectory(t,r={}){let o=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)(?:\/(.+))?$/u.exec(t),n=o?this.#e.get(o[1]):void 0;n||T(`Unknown pm MCP skill directory: ${t}.`,{field:"uri"});let i=(o?.[2]??"").replace(/\/$/u,""),s=i.length>0?`${i}/`:"",a=`skill://${o[1]}`,c=new Map;for(let C of n.resources){let S=C.uri.slice(`${a}/`.length);if(!S.startsWith(s))continue;let V=S.slice(s.length),[R,...At]=V.split("/"),$o=`${a}/${s}${R}`,Fo=n.files.get(`${s}${R}`);c.set(R,{uri:$o,name:R,mimeType:At.length>0?"inode/directory":Vr(R,Fo)})}i.length>0&&c.size===0&&T(`Unknown pm MCP skill directory: ${t}.`,{field:"uri"});let d=r.limit??M.maxPageSize;zr.has(d)||T(`Skill directory limit must be an integer from 1 to ${M.maxPageSize}.`);let l=this.#r(r.cursor,t),u=[...c.values()].sort((C,S)=>C.uri.localeCompare(S.uri)),f=u.slice(l,l+d),g=l+f.length,h=g<u.length;return{resources:f,hasMore:h,...h?{nextCursor:this.#o(g,t)}:{}}}};(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="38023567-8a5b-5e25-8d71-5112f74d1894")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="76fdc288-42b3-52b9-adc7-81e504f23ae3")}catch{}})();var Jr="https://schema.unbrained.dev/pm/workspace-recipe/v1";function pt(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)=>pt(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,pt(o,`${t}.${r}`)])))}function Ae(e){if(e.schema!==Jr)throw new Error(`Unsupported workspace recipe schema: ${e.schema}`);let t=Ot(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:pt(r.input,`operations[${o}].input`)})))})}async function Zr(e,t){let r=Ae(e);return It(r,t)}async function ty(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]="6e293af6-ee81-59b4-8d80-05e5c20bdcf1")}catch{}})();var Qr="pm.agent-observation/v1",eo="pm.agent-verdict/v1",to="pm.agent-episode/v1";function I(e,t){if(!Number.isSafeInteger(e)||e<=0)throw new Error(`${t} must be a positive safe integer.`)}function x(e,t){if(e.trim().length===0)throw new Error(`${t} must not be empty.`)}function ie(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let t of Object.values(e))ie(t)}return e}function ry(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(x(r.command,"observation.reads.command"),I(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 oy(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(I(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 ny(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(x(o.id,"observation.tiers.id"),I(o.max_tokens,"observation.tiers.max_tokens"),t.has(o.id))throw new Error(`Duplicate observation tier: ${o.id}.`);if(t.add(o.id),o.max_tokens>r)throw new Error("observation tiers must be ordered from largest to smallest max_tokens.");r=o.max_tokens;let n=new Set;for(let i of o.fields){if(j(i,"observation.tiers.fields"),n.has(i))throw new Error(`Duplicate observation tier field: ${i}.`);n.add(i)}}}function iy(e){if(e.schema!==Qr)throw new Error(`observation.schema must be ${Qr}.`);return x(e.id,"observation.id"),I(e.version,"observation.version"),ry(e.reads),oy(e.calibration),e.corpus_dependence.kind==="bounded"&&(x(e.corpus_dependence.dimension,"observation.corpus_dependence.dimension"),I(e.corpus_dependence.maximum,"observation.corpus_dependence.maximum")),ny(e.tiers),ie(structuredClone(e))}function fx(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 sy(e,t,r){I(r.budget_tokens,"observation request budget_tokens");let o=[];for(let[n,i]of e.tiers.entries()){o.push(i.id);let s=await t(i),a=Buffer.byteLength(P(s),"utf8"),c=Math.ceil(a/4);if(c<=Math.min(r.budget_tokens,i.max_tokens))return{status:"served",payload:s,receipt:{contract_id:e.id,contract_version:e.version,served_tier:i.id,degraded:n>0,attempted_tiers:o,emitted_bytes:a,estimated_tokens:c,calibration_basis:"emitted_bytes"}}}return{status:"refused",reason:"no_declared_tier_fits_budget",receipt:{contract_id:e.id,contract_version:e.version,served_tier:null,degraded:e.tiers.length>1,attempted_tiers:o,emitted_bytes:null,estimated_tokens:null,calibration_basis:"emitted_bytes"}}}function j(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 ro(e,t){let r=e;for(let o of j(t,"recorded field path")){if(r===null||typeof r!="object"||!Object.hasOwn(r,o))return;r=r[o]}return r}function ay(e){return`/${j(e,"verdict predicate path").map(t=>t.replaceAll("~","~0").replaceAll("/","~1")).join("/")}`}function cy(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 dy(e){if(e.schema!==eo)throw new Error(`verdict.schema must be ${eo}.`);x(e.id,"verdict.id"),I(e.version,"verdict.version");let t=new Set;for(let o of e.predicates){x(o.id,"verdict.predicates.id"),j(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}.`);cy(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 ie(structuredClone(e))}function ly(e,t){if(e.predicates.length===0)return{contract_id:e.id,contract_version:e.version,snapshot_id:t.snapshot_id,outcome:"not_applicable",score:null,policy:"verdict_only_no_reward",reason:"no_predicates_declared",predicates:[]};let r=new Map(e.predicates.map(s=>[s.id,s])),o=e.composition.predicate_ids.map(s=>{let a=r.get(s),c=ro(t.state,a.path),d=a.kind==="field_present"?c!==void 0:a.kind==="field_absent"?c===void 0:P(c)===P(a.expected);return{id:s,outcome:d?"satisfied":"violated",evidence_pointer:`${t.snapshot_id}#${ay(a.path)}`,evidence_digest:Mt(P(c))}}),n=o.filter(s=>s.outcome==="satisfied").length,i=e.composition.operator==="all"?n===o.length:n>0;return{contract_id:e.id,contract_version:e.version,snapshot_id:t.snapshot_id,outcome:i?"satisfied":"violated",score:n/o.length,policy:"verdict_only_no_reward",predicates:o}}function _x(e){if(e.schema!==to)throw new Error(`episode.schema must be ${to}.`);if(x(e.id,"episode.id"),I(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)x(t,"episode.task_item_ids");I(e.limits.max_actions,"episode.limits.max_actions"),I(e.limits.max_observations,"episode.limits.max_observations"),I(e.limits.max_tokens_per_observation,"episode.limits.max_tokens_per_observation");for(let t of e.observable_fields)j(t,"episode.observable_fields");for(let t of e.withheld_fields)j(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 iy(e.observation),dy(e.verdict),Ae(e.recipe),ie(structuredClone(e))}function uy(e,t,r){let o=j(t,"observation projection field"),n=e;for(let[i,s]of o.entries()){if(i===o.length-1){r!==void 0&&(n[s]=structuredClone(r));return}let a=n[s];(a===null||typeof a!="object"||Array.isArray(a))&&(n[s]={}),n=n[s]}}function py(e,t){let r={};for(let o of t)uy(r,o,ro(e,o));return r}async function hx(e,t){let r=[],o=0,n=0,i=!1,s,a={episode:{id:e.id,label:`pm agent environment v${e.version}`},provenance:{role:e.mode,topic:"agent-environment"}},c=await $(a,()=>t.reset(e.recipe));r.push({sequence:1,kind:"reset",state_id:c.state_id});let d=async()=>{if(i)throw new Error("episode is already closed.");if(n>=e.limits.max_observations)throw new Error("episode exceeded limits.max_observations.");n+=1;let u=await t.readRecordedState(),f=await sy(e.observation,async g=>py(u.state,g.fields),{budget_tokens:e.limits.max_tokens_per_observation});return r.push({sequence:r.length+1,kind:"observation",state_id:f.receipt.served_tier??u.snapshot_id}),f},l=async(u=!1)=>{if(i&&!u)throw new Error("episode is already closed.");if(n>=e.limits.max_observations)throw new Error("episode exceeded limits.max_observations.");n+=1;let f=await t.readRecordedState(),g=ly(e.verdict,f);return r.push({sequence:r.length+1,kind:"verdict",state_id:f.snapshot_id}),g};return{observe:()=>$(a,d),step:async u=>{if(i)throw new Error("episode is already closed.");if(o>=e.limits.max_actions)throw new Error("episode exceeded limits.max_actions.");o+=1;let f=await $(a,()=>t.execute(u));return r.push({sequence:r.length+1,kind:"action",state_id:f.state_id}),f},score:()=>$(a,l),close:()=>s!==void 0?s:i?Promise.reject(new Error("episode is already closed.")):(i=!0,s=$(a,()=>l(!0)).then(f=>(r.push({sequence:r.length+1,kind:"close",state_id:f.snapshot_id}),{verdict:f,trajectory:ie(structuredClone(r))})).catch(f=>{throw i=!1,f}).finally(()=>{s=void 0}),s)}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="9394fb87-fb36-5886-b262-ce2787326053")}catch{}})();var G="https://schema.unbrained.dev/pm/corpus-shape/v1";function X(e,t){if(!Number.isSafeInteger(e)||e<=0)throw new TypeError(`Corpus shape ${t} must be a positive safe integer`);return e}function se(e,t){if(!Number.isSafeInteger(e)||e<0)throw new TypeError(`Corpus shape ${t} must be a non-negative safe integer`);return e}function no(e){if(!(typeof e!="object"||e===null||Object.isFrozen(e))){for(let t of Object.values(e))no(t);Object.freeze(e)}}function Y(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(X(e.hierarchy_depth,"hierarchy_depth"),X(e.hierarchy_fanout,"hierarchy_fanout"),se(e.age_span_days,"age_span_days"),X(e.history_entries_per_item,"history_entries_per_item"),se(e.comments_per_100_items,"comments_per_100_items"),se(e.notes_per_100_items,"notes_per_100_items"),se(e.learnings_per_100_items,"learnings_per_100_items"),X(e.author_cardinality,"author_cardinality"),X(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 no(t),t}var ve=[{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}],J=Object.freeze({scratch:Y({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:Y({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:ve,author_cardinality:32,component_count:1,include_cycles:!1,custom_types:["Experiment"],custom_statuses:["review"],terminal_statuses:[],custom_fields:["domain"]}),"deep-graph":Y({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:ve,author_cardinality:16,component_count:1,include_cycles:!0,custom_types:[],custom_statuses:[],terminal_statuses:[],custom_fields:[]}),"multi-decade":Y({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:ve,author_cardinality:64,component_count:1,include_cycles:!1,custom_types:["Program"],custom_statuses:["archived"],terminal_statuses:["archived"],custom_fields:["portfolio"]}),"disconnected-archive":Y({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:ve,author_cardinality:24,component_count:5,include_cycles:!1,custom_types:["Archive"],custom_statuses:["archived"],terminal_statuses:["archived"],custom_fields:["archive_source"]})});function my(){return Object.keys(J).sort().map(e=>J[e])}function fy(e){let t=e.trim().toLowerCase();if(!Object.hasOwn(J,t))throw new TypeError(`Unknown corpus shape "${e}". Available: ${Object.keys(J).join(", ")}`);return J[t]}var oo=new WeakMap;function io(e,t){if(e===0)return[];let r=oo.get(t);r===void 0&&(r=t.edge_kind_mix.flatMap(n=>Array.from({length:n.weight},()=>n.kind)),oo.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 _y(e,t,r,o=42){if(se(t,"item index"),X(r,"item count"),t>=r)throw new RangeError(`Corpus item index ${t} exceeds ${r}`);let n=Math.min(e.component_count,r),i=t%n,s=Math.floor(t/n),a=0,c=1;for(let S=0;S<e.hierarchy_depth;S+=1)a=Math.min(Number.MAX_SAFE_INTEGER,a+c),c=Math.min(Number.MAX_SAFE_INTEGER,c*e.hierarchy_fanout);let d=s%a,l=s-d,u=d===0?void 0:i+(l+Math.floor((d-1)/e.hierarchy_fanout))*n,f=Date.UTC(2026,0,1),g=e.age_span_days*864e5,h=new Date(f+(r===1?0:Math.round(t/(r-1)*g))).toISOString(),C=(t*37+o)%100;return{index:t,id:`pm-s${t.toString(36).padStart(7,"0")}`,...u===void 0?{}:{parent:`pm-s${u.toString(36).padStart(7,"0")}`},component:i,timestamp:h,author:`pm-corpus-agent-${(t+o)%Math.min(e.author_cardinality,r)}`,history_entry_count:e.history_entries_per_item,dependency_kinds:io(t,e),has_comment:C<e.comments_per_100_items,has_note:C<e.notes_per_100_items,has_learning:C<e.learnings_per_100_items,...e.custom_types.length>0&&t%11===0?{custom_type:e.custom_types[t%e.custom_types.length]}:{},...e.custom_statuses.length>0&&t%13===0?{custom_status:e.custom_statuses[t%e.custom_statuses.length]}:{}}}var mt=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,io(t.index,this.shape))}finish(){let t=Math.min(this.shape.author_cardinality,this.itemCount),r=Math.min(this.shape.component_count,this.itemCount),o=[...this.planMismatches,...this.itemCount===0?["item_count:empty"]:[],...this.authors.size===t?[]:[`author_count:${this.authors.size}!=${t}`],...this.components.size===r?[]:[`component_count:${this.components.size}!=${r}`],...this.observedDepth<=this.shape.hierarchy_depth?[]:[`hierarchy_depth:${this.observedDepth}>${this.shape.hierarchy_depth}`],...this.observedFanout<=this.shape.hierarchy_fanout?[]:[`hierarchy_fanout:${this.observedFanout}>${this.shape.hierarchy_fanout}`]];for(let[s,,a]of this.annotationFields){let c=Math.floor(this.itemCount/100),d=this.itemCount%100,l=c*a+Math.max(0,a+d-100),u=c*a+Math.min(a,d),f=this.annotations[s];(f<l||f>u)&&o.push(`${s}:${f}!in[${l},${u}]`)}let n=new Set([...Object.keys(this.edgeKinds),...Object.keys(this.expectedEdgeKinds)]);for(let s of[...n].sort()){let a=this.edgeKinds[s]??0,c=this.expectedEdgeKinds[s]??0;a!==c&&o.push(`edge_kind:${s}:${a}!=${c}`)}let i=[...new Set(o)];return{shape:this.shape.name,item_count:this.itemCount,author_count:this.authors.size,component_count:this.components.size,hierarchy_depth:this.observedDepth,hierarchy_fanout:this.observedFanout,timestamp_range:{first:this.firstTimestamp,last:this.lastTimestamp},history_entry_count:this.historyEntryCount,annotations:{...this.annotations},edge_kinds:{...this.edgeKinds},matches_declaration:i.length===0,mismatches:i}}};function so(e){return new mt(e)}function hy(e,t){let r=so(e);for(let o of t)r.add(o);return r.finish()}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="48d03e9b-14a4-545c-8e5d-5f5f2092a113")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="dd1a948a-2fa2-5d2e-a41c-31f75297f17e")}catch{}})();async function gy(){let e=Ge(process.cwd(),process.env.PM_PATH);await Lt(e,(t,r)=>Dt(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 yy(){await $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]="b84b220f-cad0-5861-b3ed-07453179706e")}catch{}})();var ao=["lines","branches","functions","statements"];function by(e,t){if(typeof t!="object"||t===null||Array.isArray(t))throw new TypeError(`Coverage entry for ${e} must be an object.`)}function Cy(e,t,r){if(typeof r!="object"||r===null||Array.isArray(r))throw new TypeError(`Coverage entry ${e} has invalid ${t} counts.`);let 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 Ty(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)){by(r,o);for(let n of ao){let i=Cy(r,n,o[n]),s=i.total-i.covered;s>0&&t.push({file:r,metric:n,uncovered:s,...i})}}return t}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="aa6b9997-a4c6-5bfb-8804-45b34afd9e01")}catch{}})();var Sy=["captured_redacted","captured_verbatim"],wy=[{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 O(e){return typeof e=="string"&&e.trim().length>0}function Ey(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||!Sy.includes(r.capture_source)||!O(r.capture_provenance)||!Array.isArray(r.redactions)||!r.redactions.every(O)||!("input"in r)||!("observed"in r))&&o.push({boundary_id:e.id,kind:"invalid_fixture",detail:`${e.fixture_path} lacks captured provenance, redaction metadata, input, or observed output.`});let n=JSON.stringify(t);for(let i of wy)i.pattern.test(n)&&o.push({boundary_id:e.id,kind:"unsafe_fixture",detail:`${e.fixture_path} contains a possible ${i.label}.`});return o}function Ay(e,t){let r=Date.parse(e.waiver_expires_at),o=O(e.waiver_reason)&&O(e.waiver_owner)&&e.waiver_expires_at.endsWith("Z")&&Rt(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 vy(e,t,r){if(!O(e.id)||!O(e.producer)||!O(e.consumer)||!O(e.format))return{captured:0,waived:0,findings:[{boundary_id:O(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=O(e.fixture_path)&&e.fixture_path in t?Ey(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 Ay(e,r)}function xx(e,t,r=new Date){let o=[];if(e.version!==1||!O(e.inventory_scope)||!Array.isArray(e.boundaries))return{ok:!1,boundary_count:0,captured_count:0,waived_count:0,findings:[{boundary_id:"registry",kind:"invalid_registry",detail:"Boundary registry requires version 1, inventory_scope, and boundaries."}]};let n=new Set,i=0,s=0;for(let a of e.boundaries){if(typeof a!="object"||a===null||Array.isArray(a)){o.push({boundary_id:"unknown",kind:"invalid_boundary",detail:"Each boundary must be a JSON object."});continue}let c=a,d=O(c.id)?c.id:void 0;if(d!==void 0&&n.has(d)){o.push({boundary_id:d,kind:"duplicate_boundary",detail:`Boundary ${d} is inventoried more than once.`});continue}d!==void 0&&n.add(d);let l=vy(c,t,r.getTime());i+=l.captured,s+=l.waived,o.push(...l.findings)}return o.sort((a,c)=>a.boundary_id!==c.boundary_id?a.boundary_id.localeCompare(c.boundary_id):a.kind.localeCompare(c.kind)),{ok:o.length===0,boundary_count:e.boundaries.length,captured_count:i,waived_count:s,findings:o}}import Z from"node:fs";import ft from"node:path";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="9c9e4ac4-51b2-5920-bb27-a4f239f6b429")}catch{}})();var co=300*1e3,Oy=3;function Fx(e){return(e?.trim()||"development").replace(/[^a-zA-Z0-9._-]/g,"_").replace(/^\./,"_")}function jx(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.");Z.mkdirSync(e,{recursive:!0});let o=ft.join(e,r);Z.mkdirSync(o,{recursive:!0});let n=new Date;Z.utimesSync(o,n,n);let i=Z.readdirSync(e).filter(d=>d!==r).flatMap(d=>{try{return[{name:d,mtimeMs:Z.statSync(ft.join(e,d)).mtimeMs}]}catch(l){if(l instanceof Error&&"code"in l&&fe(l))return[];throw l}}).sort((d,l)=>l.mtimeMs-d.mtimeMs||d.name.localeCompare(l.name)),s=i.filter(d=>n.getTime()-d.mtimeMs<co),a=Math.max(0,Oy-1-s.length),c=i.filter(d=>n.getTime()-d.mtimeMs>=co).slice(a).map(d=>d.name).sort((d,l)=>d.localeCompare(l));for(let d of c)Z.rmSync(ft.join(e,d),{recursive:!0,force:!0,maxRetries:3,retryDelay:50});return{retained:r,removed:c}}import lo from"node:fs";import Ie 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]="7ab9180f-dfcb-579d-bc0c-dbba2e4ad77e")}catch{}})();var ae="@unbrained/pm-cli",Iy=new Set(["append","claim","changelog","close","close-many","close-task","comments","config","copy","create","dedupe-merge","delete","deps","docs","extension","event","events","files","focus","gc","history-author-acknowledge","history-compact","history-redact","history-repair","init","install","item","learnings","meet","merge","normalize","notes","package","packages","pause-task","plan","profile","reindex","release","remind","restore","schema","start-task","test","test-all","test-runs","test-runs-worker","telemetry","templates","twin","update","update-many","upgrade","vcs","workspace"]),uo=new Set(["--author","--output-budget","--output-format","--output-include","--output-limit","--output-session","--path","--pm-path"]),gt=/\b(\d{4})\.(\d{1,2})\.(\d{1,2})(?:-(\d+))?\b/u,Pe="2026.8.31";function w(e,t){return e.some(r=>t.includes(r.split("=",1)[0]))}function _t(e,t){return["activate","adopt","adopt-all","deactivate","init","install","migrate","reload","uninstall"].includes(t[0]??"")||w(e,["--activate","--adopt","--adopt-all","--deactivate","--fix-managed-state","--init","--install","--output","--reload","--scaffold","--uninstall"])}var Ry={changelog:(e,t)=>{if(t[0]==="generate")return!w(e,["--check"]);let r=e.indexOf("export");return t[0]==="export"&&(w(e,["--output"])||r>=0&&e[r+1]!==void 0&&!e[r+1].startsWith("-"))},comments:e=>w(e,["--add","--delete","--edit","--file","--stdin"]),config:(e,t)=>(t[0]==="project"||t[0]==="global"?t[1]:t[0])==="set",deps:()=>!1,docs:e=>w(e,["--add","--add-glob","--migrate","--remove"]),duplicates:()=>!1,events:()=>!1,extension:_t,files:(e,t)=>w(e,["--add","--add-glob","--migrate","--remove"])||t[0]==="discover"&&w(e,["--apply"]),health:e=>!w(e,["--check-only","--no-refresh","--skip-vectors"]),learnings:e=>w(e,["--add","--delete","--edit","--file","--stdin"]),merge:(e,t)=>t[0]!=="report",notes:e=>w(e,["--add","--delete","--edit","--file","--stdin"]),package:_t,packages:_t,profile:(e,t)=>t[0]==="apply",schema:(e,t)=>["add-field","add-status","add-type","remove-field","remove-status","remove-type","remap-status","rename-field","rename-type"].includes(t[0]??"")&&!(w(e,["--infer"])&&!w(e,["--apply"])),telemetry:(e,t)=>t.slice(0,2).some(r=>["clear","flush"].includes(r)),templates:(e,t)=>t[0]==="save",test:e=>w(e,["--add","--add-json","--background","--measure","--remove","--resume","--run","--stop"]),validate:e=>w(e,["--auto-fix","--prune-missing"]),vcs:(e,t)=>["abandon","create","merge","propose","ref-create"].includes(t[0]??""),workspace:(e,t)=>t[0]==="snapshot"&&["create","delete","restore"].includes(t[1]??"")};function Re(e){let t=e.match(gt);return t?[Number(t[1]),Number(t[2]),Number(t[3]),Number(t[4]??0)]:null}function U(e,t){let r=Re(e),o=Re(t);if(!r||!o)return null;for(let n=0;n<r.length;n+=1){let i=r[n]-o[n];if(i!==0)return Math.sign(i)}return 0}function Oe(e){return U(e,Pe)!==-1?3:2}function Py(e,t){if(t===3)return e.filter(r=>r.history_epoch_compatible===!1).map(r=>({...r,declaration:r.declaration??r.version})).sort((r,o)=>U(r.version,o.version))[0]}function ht(e){try{let t=JSON.parse(lo.readFileSync(e,"utf8"));return typeof t=="object"&&t!==null&&!Array.isArray(t)?t:null}catch{return null}}function My(e){let t=[...e.matchAll(/(<=|<)\s*v?(\d{4}\.\d{1,2}\.\d{1,2}(?:-\d+)?)/gu)].map(o=>({inclusive:o[1]==="<=",version:o[2]})),r=e.match(/\b\d{4}\.\d{1,2}\.\d{1,2}(?:-\d+)?\s+-\s+v?(\d{4}\.\d{1,2}\.\d{1,2}(?:-\d+)?)/u);return r?[...t,{inclusive:!0,version:r[1]}]:t}function ky(e){let t=e.split("||").map(r=>My(r));return{bounded:t.some(r=>r.length>0),compatible:t.some(r=>r.every(o=>{let n=U(Pe,o.version);return n!==null&&(o.inclusive?n!==1:n===-1)}))}}function xy(e){return["dependencies","devDependencies","optionalDependencies","peerDependencies"].flatMap(t=>{let r=e[t];if(typeof r!="object"||r===null)return[];let o=r[ae],n=typeof o=="string"?o.trim():"",i=/^[<!]/u.test(n)?void 0:n.match(gt)?.[0];if(!i)return[];let s=/^(?:=|v)?\d{4}\.\d{1,2}\.\d{1,2}(?:-\d+)?$/u.test(n),a=ky(n);return[{version:i,constraint:s?"exact":a.bounded?"range":"minimum",...s?{}:{declaration:n},history_epoch_compatible:s?U(i,Pe)!==-1:a.compatible}]})}function Ny(e){let r=ht(Ie.join(e,"package-lock.json"))?.packages;if(typeof r!="object"||r===null)return;let o=r["node_modules/@unbrained/pm-cli"];if(typeof o!="object"||o===null)return;let n=o.version;return typeof n=="string"?n:void 0}function Ly(e,t){try{let r=lo.readFileSync(Ie.join(e,t),"utf8").split(/\r?\n/u),o=r.findIndex(c=>c.includes(ae));if(o<0)return;let n=r[o].match(/^\s*/u)[0].length,i=[r[o]];for(let c=o+1;c<r.length;c+=1){let d=r[c],l=d.trim(),u=d.match(/^\s*/u)[0].length;if(l.length>0&&u<=n)break;i.push(d)}return i.join(`
28
+ `).match(/^\s*version(?::\s*|\s+)["']?(\d{4}\.\d{1,2}\.\d{1,2}(?:-\d+)?)/mu)?.[1]??i[0].match(gt)?.[0]}catch{return}}function Dy(e){let t=[],r=ht(Ie.join(e,"package.json"));r&&t.push(...xy(r).map(s=>({...s,source:"package.json"})));let n=ht(Ie.join(e,"node_modules","@unbrained","pm-cli","package.json"))?.version;typeof n=="string"&&Re(n)&&t.push({version:n,source:"installed-package",constraint:"exact",history_epoch_compatible:Oe(n)===3});let i=Ny(e);i&&Re(i)&&t.push({version:i,source:"package-lock.json",constraint:"exact",history_epoch_compatible:Oe(i)===3});for(let s of["pnpm-lock.yaml","yarn.lock"]){let a=Ly(e,s);a&&t.push({version:a,source:s,constraint:"exact",history_epoch_compatible:Oe(a)===3})}return t}function po(e){for(let t=0;t<e.length;t+=1){let r=e[t];if(uo.has(r)){t+=1;continue}if(!r.startsWith("-"))return{command:r.toLowerCase(),index:t}}}function $y(e){let t=po(e);if(!t||w(e,["--help","-h","--dry-run"]))return!1;let{command:r,index:o}=t,n=[];for(let s=o+1;s<e.length;s+=1){let a=e[s];if(uo.has(a)){s+=1;continue}a.startsWith("-")||n.push(a.toLowerCase())}let i=Ry[r];return i?i(e,n):Iy.has(r)}function Fy(e){let t=po(e.argv)?.command,r=$y(e.argv),o=Dy(e.projectRoot).filter(l=>U(l.version,e.executingVersion)!==null).sort((l,u)=>U(u.version,l.version)),n=o[0],i=n!==void 0&&U(e.executingVersion,n.version)===-1,s=Oe(e.executingVersion),a=Py(o,s),c=r&&a!==void 0,d=i&&!r?{code:"project_runtime_stale_read",executing_version:e.executingVersion,project_version:n.version,source:n.source,message:"This read is using an older pm runtime than the project requires.",next_steps:[`Run the command through the project's installed ${ae} ${n.version}.`,"Install the project dependencies with its declared package manager if the local executable is missing."]}:void 0;return{compatible:!r||!i&&!c||e.allowStale===!0,executing_version:e.executingVersion,...n?{project_version:n.version,source:n.source}:{},...t?{command:t}:{},mutating:r,stale:i,history_epoch_incompatible:c,writer_item_hash_version:s,...a?{incompatible_project_version:a.declaration,incompatible_source:a.source}:{},...d?{warning:d}:{},override_applied:r&&(i||c)&&e.allowStale===!0}}function Vx(e){let t=Fy(e);if(t.compatible)return t;throw t.history_epoch_incompatible?new b(`pm ${t.executing_version} cannot write item-hash epoch ${t.writer_item_hash_version} into a project pinned to pm ${t.incompatible_project_version}.`,D.CONFLICT,{code:"project_runtime_history_epoch_incompatible",reason:t.incompatible_source,why:`The pinned runtime cannot read item_hash_version ${t.writer_item_hash_version}; allowing the write would break its health and validation gates.`,nextSteps:[`Upgrade the project's ${ae} pin to ${Pe} or newer before mutating tracker history.`,"For an intentional coordinated migration only, set PM_ALLOW_STALE_CLI=1 for this invocation and record why.","Read-only commands remain available without an override."]}):new b(`pm ${t.executing_version} cannot mutate a project pinned to newer pm ${t.project_version}.`,D.CONFLICT,{code:"project_runtime_stale_mutation",reason:t.source,why:"An older runtime can write storage, history, and merge contracts it does not understand.",nextSteps:[`Run this command through the project's installed ${ae} ${t.project_version}.`,"For an intentional recovery only, set PM_ALLOW_STALE_CLI=1 for this invocation and record why.","Read-only commands remain available without an override."]})}import{createHash as jy}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="eb475dcd-d16c-51fb-b248-b14cf5ade4de")}catch{}})();var yt=1;function Q(e){e?.throwIfAborted()}function B(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship graph ${t} must be non-empty`);return e.trim()}function ee(e,t,r={}){let o=Date.parse(r.createdAt??new Date().toISOString());if(!Number.isFinite(o))throw new TypeError("Relationship graph createdAt must be a valid timestamp");let n=e.nodes(),i=e.edges(),s=t.list();return Object.freeze({version:yt,fingerprint:jy("sha256").update(P({nodes:n,edges:i,kinds:s})).digest("hex"),created_at:new Date(o).toISOString(),nodes:n,edges:i,kinds:s})}function Gy(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function de(e){if(!Gy(e))throw new TypeError("Relationship graph snapshot must be an object");if(e.version!==yt)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 Ue([]);for(let n of e.kinds)t.register(n);let r=new H(e.nodes,e.edges,t),o=ee(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 N(e,t){B(e.name,"adapter name");let r=B(t.workspace,"workspace");Q(t.signal);let o=await e.read({...t,workspace:r});return Q(t.signal),o===null?null:de(o)}async function Me(e,t){let r=B(t.workspace,"workspace"),o=de(t.snapshot).snapshot,n=await N(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(Q(t.signal),await e.replace({workspace:r,signal:t.signal,snapshot:o,expected_fingerprint:n?.snapshot.fingerprint??null}),(await N(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 Uy(e,t={}){let r=e.map(de),o=new Map;for(let s of r)for(let a of s.snapshot.kinds){let c=o.get(a.kind);if(c&&P(c)!==P(a))throw new TypeError(`Conflicting federated relationship kind: ${a.kind}`);o.set(a.kind,a)}let n=new Ue([...o.values()].sort((s,a)=>s.kind.localeCompare(a.kind))),i=new H(new Set(r.flatMap(s=>[...s.snapshot.nodes])),r.flatMap(s=>[...s.snapshot.edges]),n);return ee(i,n,t)}var ce=class{name;#e=new Map;constructor(t="memory"){this.name=B(t,"adapter name")}async read(t){Q(t.signal);let r=this.#e.get(B(t.workspace,"workspace"));return r?structuredClone(r):null}async replace(t){Q(t.signal);let r=B(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(de(t.snapshot).snapshot))}async clear(t){Q(t.signal);let r=B(t.workspace,"workspace"),o=this.#e.get(r);if(t.expected_fingerprint!==void 0&&(o?.fingerprint??null)!==t.expected_fingerprint)throw new Error(`Relationship graph adapter conflict for ${r}`);this.#e.delete(r)}};(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="9a60b8c0-37d1-5c04-a079-e1351caf6e09")}catch{}})();function mo(e,t){if(!Number.isInteger(e)||e<1)throw new TypeError(`Relationship graph ${t} must be a positive integer`);return e}function By(e){let t=mo(e.nodeCount,"nodeCount"),r=mo(e.edgeStride??1,"edgeStride"),o=e.topology??"chain";if(!["chain","star","disconnected"].includes(o))throw new TypeError(`Unsupported relationship graph topology: ${o}`);let n=(e.kind??"related").trim(),i=(e.idPrefix??"node").trim();if(!n||!i)throw new TypeError("Relationship graph kind and idPrefix must be non-empty");let s=o==="disconnected"?0:Math.floor((t-1)/r);return{node_count:t,edge_count:s,edge_basis:"fixture_generated",nodes:{*[Symbol.iterator](){for(let a=0;a<t;a+=1)yield`${i}-${a}`}},edges:{*[Symbol.iterator](){if(o!=="disconnected")for(let a=r;a<t;a+=r)yield{source:`${i}-${o==="star"?0:a-r}`,target:`${i}-${a}`,kind:n}}}}}function q(e,t){if(!e)throw new Error(`Relationship graph adapter conformance: ${t}`)}async function fo(e,t={}){let r=t.workspace?.trim()||"pm-graph-conformance",o=Pt(),n=ee(new H(["a","b"],[{source:"a",target:"b",kind:"related"}],o),o,{createdAt:"2026-01-01T00:00:00.000Z"}),i=ee(new H(["a","b","c"],[{source:"a",target:"b",kind:"related"},{source:"b",target:"c",kind:"blocked_by"}],o),o,{createdAt:"2026-01-02T00:00:00.000Z"}),s=[];q(await N(e,{workspace:r})===null,"workspace must start empty"),s.push({name:"empty-read",passed:!0});let a=await Me(e,{workspace:r,snapshot:n});q(a.disposition==="written","first sync must write"),s.push({name:"atomic-replace",passed:!0}),(await e.read({workspace:r})).nodes.push("mutated-reader-copy"),q((await N(e,{workspace:r}))?.snapshot.nodes.length===2,"reads must not mutate stored state"),s.push({name:"read-isolation",passed:!0}),q((await Me(e,{workspace:r,snapshot:n})).disposition==="current","identical sync must be idempotent"),s.push({name:"idempotent-sync",passed:!0}),await e.replace({workspace:r,snapshot:i,expected_fingerprint:n.fingerprint}),q((await N(e,{workspace:r}))?.snapshot.fingerprint===i.fingerprint,"replacement must become visible"),s.push({name:"replacement-visibility",passed:!0});let d=!1;try{await e.replace({workspace:r,snapshot:n,expected_fingerprint:n.fingerprint})}catch{d=!0}return q(d,"stale compare-and-swap must fail"),s.push({name:"stale-cas",passed:!0}),e.clear&&(await e.clear({workspace:r,expected_fingerprint:i.fingerprint}),q(await N(e,{workspace:r})===null,"clear must remove the workspace"),s.push({name:"clear",passed:!0})),{adapter:e.name,workspace:r,cases:Object.freeze(s),clear_supported:e.clear!==void 0}}function qy(e){return fo(new ce,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]="c59413c4-8955-5560-8bc6-f1dc9c8c5042")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="d45a8203-4501-5797-a6cc-a2e7844adec9")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="4d2bee02-8003-578c-9d25-32755534f8ff")}catch{}})();var bt=2,zy=["self_reported","independent_transport"];function ke(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function le(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`${t} must be a non-empty string`);return e.trim()}function _o(e,t,r=!1){if(!Array.isArray(e)||e.length===0)throw new TypeError(`${t} must be a non-empty string array`);return e.map((o,n)=>{let i=le(o,`${t}[${String(n)}]`);return r?o:i})}function Ct(e,t){return e===void 0?void 0:le(e,t)}function Vy(e,t){if(e===void 0)return;if(!ke(e)||Object.keys(e).length===0)throw new TypeError(`${t} must be a non-empty object`);let r=Object.entries(e).map(([o,n])=>{if(o.length===0||o.split(".").some(i=>i.length===0))throw new TypeError(`${t} must use dot-separated own-property paths`);if(n!==null&&typeof n!="string"&&typeof n!="boolean"&&(typeof n!="number"||!Number.isFinite(n)))throw new TypeError(`${t} values must be JSON primitives`);return[o,n]});return Object.fromEntries(r)}function Hy(e,t,r,o,n,i){if(o==="refusal"){if(Xe(r)||n===void 0||i===void 0)throw new TypeError(`${e} refusal steps require a non-success exit, error code, and refusal surface`);return}if(n!==void 0||i!==void 0)throw new TypeError(`${e} only refusal steps may declare expected_error_code or expected_refusal_surface`);let s=xt(t);if(s===void 0)throw new TypeError(`${e}.args must identify a command after global flags`);let a=t[s].trim().toLowerCase();if(a==="history"){let l=Nt(t.slice(s+1));l!==void 0&&(a=Fe(`history ${l}`))}let c=Kt(a);if(!Xe(r)||r!==0&&!c?.exit_codes.some(l=>l===r))throw new TypeError(`${e} successful output must use exit code 0 or a command-declared successful effect exit`);let d=cr(a).kind;if(o!==d)throw new TypeError(`${e} expected ${o}, but ${a} declares ${d}`)}function Ky(e,t,r){if(!ke(e))throw new TypeError(`tasks.${t}.steps[${String(r)}] must be an object`);let o=`tasks.${t}.steps[${String(r)}]`,n=le(e.id,`${o}.id`),i=_o(e.args,`${o}.args`,!0),s=e.expected_exit_code;if(typeof s!="number"||!Number.isSafeInteger(s))throw new TypeError(`${o}.expected_exit_code must be a safe integer`);let a=e.expected_output_kind;if(a!=="refusal"&&!ar.includes(a))throw new TypeError(`${o}.expected_output_kind is unsupported`);let c=a,d=e.expected_accounting_mode;if(!zy.includes(d))throw new TypeError(`${o}.expected_accounting_mode is unsupported`);let l=d;if(l==="independent_transport"&&c!=="refusal")throw new TypeError(`${o} independent_transport accounting is supported only for refusal steps`);let u=_o(e.required_fields,`${o}.required_fields`);if(u.some(S=>S.split(".").some(V=>V.length===0)))throw new TypeError(`${o}.required_fields must contain dot-separated own-property paths`);let f=Vy(e.expected_field_values,`${o}.expected_field_values`),g=Ct(e.expected_error_code,`${o}.expected_error_code`),h=Ct(e.expected_refusal_surface,`${o}.expected_refusal_surface`),C=Ct(e.recovery_for,`${o}.recovery_for`);return Hy(o,i,s,c,g,h),{id:n,args:i,expected_exit_code:s,expected_output_kind:c,expected_accounting_mode:l,required_fields:u,...f?{expected_field_values:f}:{},...g?{expected_error_code:g}:{},...h?{expected_refusal_surface:h}:{},...C?{recovery_for:C}:{}}}function Wy(e,t){if(!ke(e))throw new TypeError(`tasks[${String(t)}] must be an object`);let r=le(e.id,`tasks[${String(t)}].id`),o=le(e.description,`tasks.${r}.description`);if(!Array.isArray(e.steps)||e.steps.length===0)throw new TypeError(`tasks.${r}.steps must be a non-empty array`);let n=e.steps.map((s,a)=>Ky(s,r,a)),i=new Map;for(let s of n){if(i.has(s.id))throw new TypeError(`tasks.${r} contains duplicate step id ${s.id}`);if(s.recovery_for!==void 0&&(i.get(s.recovery_for)?.expected_output_kind!=="refusal"||s.expected_output_kind==="refusal"))throw new TypeError(`tasks.${r}.${s.id} recovery_for must reference an earlier refusal and declare successful output`);i.set(s.id,s)}if(n.at(-1)?.expected_output_kind==="refusal")throw new TypeError(`tasks.${r} completed task must terminate with successful output`);for(let s of n)if(s.expected_output_kind==="refusal"&&!n.some(a=>a.recovery_for===s.id))throw new TypeError(`tasks.${r}.${s.id} refusal must have a later successful recovery_for step`);return{id:r,description:o,steps:n}}function CN(e){if(!ke(e))throw new TypeError("agent-task transcript corpus must be an object");if(e.version!==bt)throw new TypeError(`agent-task transcript corpus version must be ${String(bt)}`);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)=>Wy(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:bt,tasks:t}}import{createHash as ho}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="41ef1735-c534-5b84-8367-1278007cb7c6")}catch{}})();function go(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship backfill ${t} must be non-empty`);return e.trim()}function EN(e,t){let r=go(t.migrationId,"migrationId"),o=go(t.author,"author"),n=Date.parse(t.timestamp);if(!Number.isFinite(n))throw new TypeError("Relationship backfill timestamp must be valid");let i=new Date(n).toISOString(),s=We(e,void 0,t.registry),a=s.graph.nodes(),c=s.graph.edges().map(f=>{let g=ho("sha256").update(JSON.stringify([r,f.kind,f.source,f.target,f.createdAt??null,f.author??null,f.payload??null])).digest("hex").slice(0,24);return Object.freeze({eventId:`backfill:${r}:${g}`,relationshipId:`migration:${r}:${g}`,action:"add",edge:f,author:o,timestamp:i,reason:`Backfill ${r} from legacy item metadata`})}),d=ho("sha256").update(JSON.stringify({migrationId:r,nodes:a,events:c})).digest("hex"),l=new Set([...t.existingEventIds??[]].filter(f=>typeof f=="string").map(f=>f.trim()).filter(Boolean)),u=c.filter(f=>!l.has(f.eventId));return Object.freeze({migration_id:r,fingerprint:d,nodes:a,events:Object.freeze(u),edge_count:c.length,skipped_existing_count:c.length-u.length,duplicate_dependency_rows:s.duplicateRows.length,dangling_reference_count:s.dangling.active.length+s.dangling.legacy_terminal.length})}import*as yo from"node:module";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="81067f95-115f-5aee-b649-55d86c3915d4")}catch{}})();var ue=["suggested_retry","candidate_command","example","next_step","migration_hint","restore_with"],Tt={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"}},vN=Object.freeze(Object.keys(Tt));function bo(e){if(Object.hasOwn(Tt,e))return Tt[e]}var Xy=new Set([..."=([{,:;!?&|+-*%^~<>","=>"]);function te(e,t){return e<t?-1:e>t?1:0}function Yy(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 Jy(e){return e===void 0||e.kind==="punctuator"&&Xy.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(`
29
29
  `,t+2);return r===-1?e.length:r+1}if(e.startsWith("/*",t))return e.indexOf("*/",t+2)+2}function Qy(e,t,r){if(e[t]!=="/"||!Jy(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 eb(e,t){let r=e[t];if(r==="'"||r==='"'||r==="`"){let n=Yy(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 tb(e){let t=[],r=0;for(;r<e.length;){let o=Zy(e,r);if(o!==void 0){r=o;continue}let n=Qy(e,r,t.at(-1));if(n!==void 0){r=n;continue}let i=eb(e,r);i.token&&t.push(i.token),r=i.next}return t}var rb=new Set(["object","block","pattern"]),ob=new Set(["const","let","var"]),nb=new Set(["}",")","]"]),ib=new Set(["=","(","[",",",":","?","return"]);function sb(e,t,r){if([...r].reverse().find(i=>rb.has(i.kind))?.kind==="pattern"||r.at(-1)?.kind==="paren"&&r.at(-1)?.parameter_list)return"pattern";let n=e[t-1];return n?.kind==="identifier"&&ob.has(n.value)?"pattern":n?.value==="=>"||n?.value===")"?"block":n&&ib.has(n.value)?"object":"block"}function ab(e,t,r){let o=e[t];if(o.value==="{"){let a=sb(e,t,r);return{kind:a,...a==="object"?{member_start:!0,candidates:[]}:{}}}if(o.value==="[")return{kind:"array"};if(o.value!=="(")return;let n=e[t-1],i=e[t-2];return{kind:"paren",...n?.value==="function"||i?.value==="function"?{parameter_list:!0}:{}}}function cb(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 db(e,t){return e[t+1]?.value===")"&&e[t+2]?.value==="=>"||e[t+1]?.value==="="}function lb(e){let t=tb(yo.stripTypeScriptTypes(e,{mode:"strip"})),r=[],o=[];for(let[n,i]of t.entries()){let s=o.at(-1),a=cb(s,i,t[n+1]);a&&s.candidates.push(a);let c=ab(t,n,o);if(c)o.push(c);else if(nb.has(i.value)){let d=o.pop();d?.kind==="object"&&!db(t,n)&&r.push(...d.candidates)}else i.value===","&&s?.kind==="object"?s.member_start=!0:s?.kind==="object"&&i.value!==":"&&(s.member_start=!1)}return r}function ub(e){let t=[0];for(let r=0;r<e.length;r+=1)e[r]===`
30
- `&&t.push(r+1);return t}function pb(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 vN(e){let t=[],r=[];for(let n of[...e].sort((i,s)=>te(i.path,s.path))){let i=ub(n.content),s;try{s=lb(n.content)}catch(a){r.push({kind:"invalid_source",subject:n.path,detail:`${n.path} could not be parsed for recovery producers: ${String(a)}.`});continue}for(let a of s){let c=a.field,d=pb(i,a.offset),l=bo(c);l?t.push({path:n.path,line:d,field:c,kind:l.kind}):/(?:retry_command|candidate_command|fallback_candidate|next_best_command|example|next_step|migration_hint|restore_with)/u.test(c)&&!/(?:_total|_truncated)$/u.test(c)&&r.push({kind:"unknown_recovery_field",subject:`${n.path}:${d}:${c}`,detail:`${c} resembles a recovery reference but has no typed field contract.`})}}let o=Object.fromEntries(ue.map(n=>[n,t.filter(i=>i.kind===n).length]));for(let n of ue)o[n]===0&&r.push({kind:"missing_kind_producer",subject:n,detail:`No source producer emits the ${n} recovery-reference kind.`});return t.sort((n,i)=>n.path!==i.path?te(n.path,i.path):n.line!==i.line?n.line-i.line:te(n.field,i.field)),r.sort((n,i)=>n.subject!==i.subject?te(n.subject,i.subject):te(n.kind,i.kind)),{ok:r.length===0,scanned_file_count:e.length,producer_count:t.length,producer_count_by_kind:o,producers:t,findings:r}}function ON(e,t){let r=[],o=(n,i)=>{if(Array.isArray(n)){n.forEach((s,a)=>o(s,[...i,String(a)]));return}if(!(typeof n!="object"||n===null))for(let[s,a]of Object.entries(n).sort(([c],[d])=>te(c,d))){let c=bo(s),d=c?.kind==="migration_hint"&&n.semantics==="behavior_preserving"?{...c,semantics:"behavior_preserving"}:c,l=[a].flat();d!==void 0&&l.forEach((u,f)=>{let g="nested_value_field"in d&&typeof d.nested_value_field=="string"?d.nested_value_field:void 0,h=g&&typeof u=="object"&&u!==null&&!Array.isArray(u)?u[g]:u;if(typeof h!="string"||h.trim().length===0)return;let C=[...i,s,String(f)].map(S=>encodeURIComponent(S)).join("/");r.push({id:`${e}:${d.kind}:${C}`,probe_id:e,kind:d.kind,semantics:d.semantics,value:h})}),o(a,[...i,s])}};return o(t,[]),r}function IN(e,t){let r=e.flatMap(s=>(s.owned_states??[]).map(a=>({contract:s,state:a}))),o=[],n=new Map;for(let s of t){if(n.has(s.probe_id)){o.push({kind:"duplicate_probe",probe_id:s.probe_id,detail:`Observation ${s.probe_id} was supplied more than once.`});continue}n.set(s.probe_id,s)}let i=new Set(r.map(({state:s})=>s.probe_id));for(let{contract:s,state:a}of r){let c=n.get(a.probe_id);if(!c){o.push({kind:"missing_probe",probe_id:a.probe_id,detail:`No entrypoint observation was recorded for ${s.code}.`});continue}c.code!==s.code&&o.push({kind:"wrong_error_code",probe_id:a.probe_id,detail:`Expected ${s.code}; observed ${c.code}.`}),c.exit_class!==a.expected_exit_class&&o.push({kind:"wrong_exit_class",probe_id:a.probe_id,detail:`Expected ${a.expected_exit_class}; observed ${c.exit_class}.`}),a.entrypoints.includes(c.entrypoint)||o.push({kind:"wrong_entrypoint",probe_id:a.probe_id,detail:`Expected one of ${a.entrypoints.join(", ")}; observed ${c.entrypoint}.`})}for(let s of t)i.has(s.probe_id)||o.push({kind:"undeclared_probe",probe_id:s.probe_id,detail:`Observation ${s.probe_id} has no catalog declaration.`});return o.sort((s,a)=>s.probe_id!==a.probe_id?s.probe_id.localeCompare(a.probe_id):s.kind.localeCompare(a.kind)),{ok:o.length===0,declared_probe_count:r.length,observed_probe_count:t.length,findings:o}}function RN(e,t){let r=[],o=new Set,n=new Set;for(let c of e){if(o.has(c.id)){n.add(c.id),r.push({kind:"duplicate_obligation",reference_id:c.id,detail:`Recovery obligation ${c.id} was declared more than once.`});continue}o.add(c.id)}let i=new Map;for(let c of t){if(i.has(c.id)){r.push({kind:"duplicate_observation",reference_id:c.id,detail:`Recovery reference ${c.id} was observed more than once.`});continue}i.set(c.id,c),o.has(c.id)||r.push({kind:"undeclared_observation",reference_id:c.id,detail:`Recovery observation ${c.id} has no emitted obligation.`})}for(let c of e){if(n.has(c.id))continue;let d=i.get(c.id);d?d.reachable?d.semantics!==c.semantics&&r.push({kind:"wrong_semantics",reference_id:c.id,detail:`Recovery reference ${c.value} promised ${c.semantics}; proof demonstrated ${d.semantics}.`}):r.push({kind:"unreachable_reference",reference_id:c.id,detail:`Recovery reference ${c.value} did not reach its promised target.`}):r.push({kind:"missing_observation",reference_id:c.id,detail:`No reachability proof was recorded for ${c.kind} ${c.value}.`})}let s=ue.map(c=>{let d=e.filter(u=>u.kind===c),l=d.filter(u=>!n.has(u.id)).map(u=>i.get(u.id)).filter(u=>u!==void 0);return{kind:c,declared:d.length,observed:l.length,passed:d.filter(u=>{let f=i.get(u.id);return!n.has(u.id)&&f?.reachable===!0&&f.semantics===u.semantics}).length}});r.sort((c,d)=>c.reference_id!==d.reference_id?c.reference_id.localeCompare(d.reference_id):c.kind.localeCompare(d.kind));let a=s.reduce((c,d)=>c+d.passed,0);return{ok:r.length===0,declared_reference_count:e.length,observed_reference_count:t.length,pass_fraction:o.size===0?1:a/o.size,coverage_by_kind:s,findings:r}}function mb(e,t){let r=new Map(ue.map(i=>[i,new Set]));for(let i of t)r.get(i.kind).add(i.value);let o=ue.map(i=>({kind:i,source_producers:e.producer_count_by_kind[i],runtime_values:r.get(i).size})),n=o.filter(({source_producers:i,runtime_values:s})=>i>0&&s===0).map(({kind:i})=>i);return{ok:e.ok&&n.length===0,source_producer_count:e.producer_count,runtime_value_count:o.reduce((i,{runtime_values:s})=>i+s,0),coverage_by_kind:o,missing_runtime_kinds:n}}var PN=mb;(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="ae22de89-8bac-5728-a6e2-29b342383abe")}catch{}})();var kN=16,fb=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,To=Object.freeze([...fb,"manifest_unknown_key","no_version_bounds_declared"].sort((e,t)=>e.localeCompare(t)));function xN(e,t=Co){return{ok:e.executable_error_code_count>=t,baseline:t,actual:e.executable_error_code_count}}function NN(e,t=To){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 St(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 LN(e,t,r){let o=new Map(e.map(l=>[l.code,l.canonical_code??l.code])),n=new Map,i=0,s=0;for(let l of e){let u=St(n,l.canonical_code??l.code);for(let f of l.owned_states??[])u.kinds.add("owned_state"),u.probeIds.add(f.probe_id)}for(let l of t){let u=o.get(l.error_code);if(u===void 0)continue;i+=1;let f=St(n,u);f.kinds.add("closed_domain"),f.probeIds.add(l.probe_id)}for(let l of r){let u=o.get(l.error_code);if(u===void 0)continue;s+=1;let f=St(n,u);f.kinds.add("grammar"),f.probeIds.add(l.probe_id)}let a=e.map(l=>{let u=l.canonical_code??l.code,f=n.get(u),g=[...f.probeIds].sort();return{code:l.code,canonical_code:u,disposition:g.length>0?"executable":"uncovered",evidence_kinds:[...f.kinds].sort(),probe_ids:g}}).sort((l,u)=>l.code<u.code?-1:1),c=a.filter(({disposition:l})=>l==="uncovered").map(({code:l})=>l),d=a.length-c.length;return{ok:c.length===0,catalog_error_code_count:a.length,executable_error_code_count:d,uncovered_error_code_count:c.length,coverage_fraction:a.length===0?1:d/a.length,closed_domain_probe_count:i,grammar_probe_count:s,uncovered_error_codes:c,rows:a}}function DN(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: ${To.map(r=>`\`${r}\``).join(", ")}`,`- Uncovered error codes: ${e.uncovered_error_code_count}`,`- Coverage fraction: ${e.coverage_fraction.toFixed(6)}`,`- Closed-domain probes: ${e.closed_domain_probe_count}`,`- Grammar probes: ${e.grammar_probe_count}`,"","| Error code | Canonical code | Disposition | Evidence kinds | Probe count |","| --- | --- | --- | --- | --- |",...t,""].join(`
31
- `)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="6ecdd8cf-3153-5ed9-abd4-e8a73da6662a")}catch{}})();function _b(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 hb(e){return[e.exit_code!==D.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 ${D.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."},..._b(e)]}function jN(e){let t=[],r=new Set,o=0;e.length===0&&t.push({code:"empty_corpus",probe_id:"corpus",detail:"At least one real refusal observation is required."});for(let n of e){if(r.has(n.probe_id)){t.push({code:"duplicate_probe",probe_id:n.probe_id,detail:`${n.probe_id} was supplied more than once.`});continue}r.add(n.probe_id);let i=t.length;for(let s of hb(n))s!==void 0&&t.push(s);t.length===i&&(o+=1)}return t.sort((n,i)=>n.probe_id!==i.probe_id?n.probe_id.localeCompare(i.probe_id):n.code.localeCompare(i.code)),{ok:t.length===0,probe_count:r.size,closed_probe_count:o,closure_fraction:r.size===0?0:o/r.size,findings:t}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="41d33f0e-f925-54da-a75d-52a73dd76f38")}catch{}})();var So="not-a-declared-action";function gb(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 pe(e){return e.replaceAll(/[^a-z0-9]+/gu,"-").replaceAll(/^-|-$/gu,"")}function WN(e=He.filter(t=>Ft.some(r=>r.command===t.command&&r.disposition!=="package_owned"))){let t=new Set(e.filter(({command:r})=>!r.includes(" ")).map(({command:r})=>pe(r)));return e.flatMap(r=>r.slots.flatMap((o,n)=>{if(!o.required)return[];let i=r.command.split(" "),s=pe(r.command),a=i.length>1&&t.has(s)?i.map(pe).join("--"):s,c=re(r.command).flatMap(l=>l.required?[l.flag,...l.value_name?["example"]:[]]:[]),d=Ve.some(l=>l.command===r.command);return[{probe_id:`required-argument-${a}-${pe(o.name)}`,command:r.command,refusal_args:[...i,...r.slots.slice(0,n).map(l=>gb(r.command,l)),...c],recovery_args:[...i,"--help"],error_code:d&&!r.command.startsWith("assurance ")?"invalid_argument_value":/^extension (?:activate|adopt|deactivate|uninstall)$/u.test(r.command)?"missing_lifecycle_target":"missing_required_argument",missing_argument:o.name,missing_argument_index:n}]})).sort((r,o)=>r.probe_id.localeCompare(o.probe_id))}function yb(e){switch(L(e)){case"assurance":case"workspace snapshot":return Ve.filter(({parent:t})=>t===e).map(({action:t})=>t);case"graph":return qe;case"merge":return ze;case"plan":return Ye;case"profile":return Je;case"schema":return Gt;default:throw new Error(`Required positional action family ${e} has no authoritative value domain.`)}}function XN(e=He){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-${pe(t)}`,command:t,refusal_args:[...r,So],recovery_args:[...r,"--help"],error_code:"unknown_subcommand",rejected_value:So,allowed_values:[...yb(t)].sort()}}).sort((t,r)=>t.probe_id.localeCompare(r.probe_id))}function bb(e,t){let r=[...t].sort();return e.length===t.length&&[...e].sort().every((o,n)=>o===r[n])}function Cb(e,t){if(!t)return[{code:"refusal_probe_missing",probe_id:e.probe_id,detail:`${e.probe_id} has no runtime observation.`}];let r=[];return t.error_code!==e.error_code&&r.push({code:"refusal_error_code_mismatch",probe_id:e.probe_id,detail:`${e.probe_id} emitted ${t.error_code||"<none>"}; expected ${e.error_code}.`}),t.exit_code!==2&&r.push({code:"refusal_exit_code_mismatch",probe_id:e.probe_id,detail:`${e.probe_id} exited ${t.exit_code}; expected usage exit 2.`}),"allowed_values"in e&&!bb(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 YN(e,t){let r=new Map(e.map(s=>[s.probe_id,s])),o=new Map(t.map(s=>[s.probe_id,s])),n=[...e.flatMap(s=>Cb(s,o.get(s.probe_id))),...t.filter(s=>!r.has(s.probe_id)).map(s=>({code:"unexpected_refusal_probe",probe_id:s.probe_id,detail:`${s.probe_id} has no declared grammar refusal contract.`}))];n.sort((s,a)=>s.probe_id.localeCompare(a.probe_id)||s.code.localeCompare(a.code));let i=new Set(n.map(({probe_id:s})=>s));return{ok:n.length===0,probe_count:e.length,closed_probe_count:e.filter(({probe_id:s})=>!i.has(s)).length,findings:n}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="5053cc84-63e5-50d3-9a4c-00c2a485ed69")}catch{}})();var wt=[{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 ZN(){return wt.map(e=>({...e}))}function Tb(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 QN(e){let t=new Map(e.map(n=>[n.probe_id,n])),r=[],o=0;for(let n of wt){let i=t.get(n.probe_id);if(i===void 0){r.push({code:"missing_probe",probe_id:n.probe_id,detail:"No runtime observation was supplied for this contract."});continue}let s=Tb(n,i);r.push(...s),s.length===0&&(o+=1)}return r.sort((n,i)=>n.probe_id.localeCompare(i.probe_id)||n.code.localeCompare(i.code)),{ok:r.length===0,probe_count:wt.length,closed_probe_count:o,findings:r}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="3bb9b0da-78ce-5793-96e2-2de27b8f18fa")}catch{}})();var xe,Sb=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 wb(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=Sb[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 Ne(){if(xe!==void 0)return xe;let t=oe.filter(({command:i})=>Ke(i)).flatMap(({command:i,family:s})=>sr(i,re(i)).map(a=>({command:i,family:s,concept:wb(i,a.flag),flag:a.flag,aliases:Object.freeze([...a.aliases??[]]),value_kind:a.repeatable?"list":a.flag==="--limit"?"number":a.value_type}))),r=new Set(t.flatMap(i=>i.aliases.map(s=>`${i.command}:${s}`))),o=t.filter(i=>!r.has(`${i.command}:${i.flag}`)),n=new Map;for(let i of o){let s=n.get(i.concept)??new Set;s.add(i.value_kind),n.set(i.concept,s)}return xe=Object.freeze(o.map(i=>Object.freeze({...i,concept:n.get(i.concept)?.size===1?i.concept:`${i.concept}@${i.command}`}))),xe}function iL(){return Object.freeze(Ne().map(e=>Object.freeze({command:e.command,canonical_flag:e.flag,accepted_spellings:Object.freeze([...new Set([e.flag,...e.aliases])].sort())})))}var wo=Object.freeze({init:30,item:20,config:36,extension:54,package:55,packages:55,install:27,upgrade:29,create:100,copy:24,focus:22,list:86,"list-all":86,"list-draft":84,"list-open":84,"list-in-progress":84,"list-blocked":84,"list-closed":84,"list-canceled":84,aggregate:40,context:45,ctx:45,get:30,graph:34,search:78,duplicates:25,eval:25,next:38,history:35,events:33,"history-attest":23,"history-redact":27,"history-repair":27,"history-compact":30,"history-author-acknowledge":28,merge:27,schema:43,profile:22,activity:35,restore:23,update:105,"update-many":146,close:32,"close-many":72,delete:24,append:25,comments:31,notes:35,learnings:31,files:39,docs:30,deps:32,plan:109,test:53,"test-all":40,telemetry:21,stats:29,health:36,validate:46,assurance:30,gc:22,workspace:23,contracts:29,claim:39,release:24,"start-task":23,"pause-task":23,"close-task":24,meet:33,event:33,remind:29,"test-runs-worker":20}),Eo=Object.freeze({...wo,...Object.fromEntries($e.flatMap(({alias:e,canonical:t})=>{let r=wo[e];return r===void 0?[]:[[t,r]]}))});function Ao(){let e=new Map(Object.keys(Eo).map(t=>[t,0]));for(let{command:t}of Ne())e.set(t,Number(e.get(t))+1);return Object.freeze(Object.entries(Eo).map(([t,r])=>Object.freeze({command:t,current:Number(e.get(t)),maximum:r})))}function Eb(e,t,r){for(let o of e)for(let n of o.aliases){let i=t.get(`${o.command}:${n}`);i===void 0||i.flag===o.flag||r.push({code:"alias_collision",command:o.command,detail:`${n} aliases ${o.flag} but is canonical for ${i.flag}.`})}}function Ab(e,t,r){let o=new Set(t.map(({command:n})=>n));for(let n of e.keys())o.has(n)||r.push({code:"missing_budget",command:n,detail:`${n} has canonical flags but no persisted budget.`});for(let n of t){let i=e.get(n.command)??0;i===0&&r.push({code:"stale_budget",command:n.command,detail:`${n.command} has a persisted budget but no canonical flags.`}),!(i<=n.maximum)&&r.push({code:"budget_exceeded",command:n.command,detail:`${i} canonical flags exceed the ratcheted maximum ${n.maximum}.`})}}function vb(e,t,r){let o=new Map(e.map(n=>[`${n.command}:${n.flag}`,n]));for(let n of t){let i=`${n.command}:${n.canonical_flag}`,s=o.get(i);if(!s){r.push({code:"removed_canonical_spelling",command:n.command,detail:`${n.canonical_flag} disappeared from the executable spelling inventory.`});continue}let a=new Set([s.flag,...s.aliases]);for(let c of n.accepted_spellings)a.has(c)||r.push({code:"removed_compatibility_spelling",command:n.command,detail:`${c} no longer resolves to ${n.canonical_flag}.`})}}function sL(e=Ne(),t=Ao(),r=[]){let o=[],n=new Map,i=new Map,s=new Map,a=new Map;for(let c of e){let d=`${c.command}:${c.flag}`;n.has(d)?o.push({code:"duplicate_canonical_flag",command:c.command,detail:`${c.flag} has more than one canonical row.`}):n.set(d,c),a.set(c.command,(a.get(c.command)??0)+1);let l=i.get(c.concept);l!==void 0&&l!==c.value_kind?o.push({code:"inconsistent_concept_kind",command:c.command,detail:`${c.concept} uses both ${l} and ${c.value_kind}.`}):i.set(c.concept,c.value_kind);let u=s.get(c.concept);u!==void 0&&u!==c.flag?o.push({code:"semantic_spelling_collision",command:c.command,detail:`${c.concept} is canonicalized by both ${u} and ${c.flag}.`}):s.set(c.concept,c.flag)}return Eb(e,n,o),Ab(a,t,o),vb(e,r,o),o.sort((c,d)=>c.command.localeCompare(d.command)||c.code.localeCompare(d.code)||c.detail.localeCompare(d.detail)),{ok:o.length===0,entry_count:e.length,budget_count:t.length,concept_count:new Set(e.map(({concept:c})=>c)).size,baseline_entry_count:r.length,findings:o}}function aL(){let e=Ne(),t=Ao(),r=new Map(t.map(({command:n})=>[n,"unknown"]));for(let{command:n,family:i}of e)r.set(n,i);return["# Generated flag lexicon budgets","","This file is generated by `listPmFlagLexicon()`. Compatibility aliases do not consume canonical budget.","","| Command | Capability family | Canonical flags | Maximum |","| --- | --- | ---: | ---: |",...t.map(({command:n,current:i,maximum:s})=>{let a=r.get(n);return`| \`${n}\` | ${a} | ${i} | ${s} |`}),""].join(`
32
- `)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="a169a68c-13d0-5a3a-b231-abdf1a34ef6a")}catch{}})();function dL(e){return e}function lL(e){return e}function uL(e){return e}function pL(e){return e}function mL(e){return e}function fL(e){return e}function _L(e){return e}function hL(e){return e}function gL(e){return e}function yL(e){return e}function bL(e){return e}function CL(e){return e}function TL(e){return e}function SL(e){return{handled:!0,result:e}}function wL(){return{handled:!1}}function EL(e){return e}function AL(e){return e}function vL(e){return e}function OL(e){return e}function IL(e){return e}function RL(e){return e}function PL(e){return e}function ML(e){return e}function kL(e){return e}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="14bbf3be-03a5-5ff3-888f-6e8b9a68ac73")}catch{}})();function Ob(e={},t={}){return new he(t).extension(void 0,{...e,migrate:!0})}function Ib(e={},t={}){return new he(t).packageMigrate(e)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="af4da99c-f557-5bf7-a439-c14878e4970d")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="ae8f06a0-a2e6-5f91-99f7-e822270b491d")}catch{}})();import{createHash as Oo,createHmac as Rb,randomBytes as Pb,timingSafeEqual as Mb}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="31eda153-a06e-51ef-a62f-f6dce09064d3")}catch{}})();var OD="dev.unbrained.pm/progressive-tool-discovery",ID=Object.freeze({version:1,discoveryTool:"pm_discover",canonicalResult:"structuredContent.result",compatibilityText:"pointer"}),kb=Object.freeze(["pm_discover","pm_next","pm_context","pm_search","pm_get"]),z=Object.freeze({lexical:.4,semantic:.2,graph:.1,permission:.15,freshness:.05,usage:.1}),xb=Object.freeze(["profile_changed","tool_contract_changed","workspace_extension_changed","authorization_changed","ranking_signal_changed","cursor_integrity_key_rotated"]),Io={core:0,standard:1,full:2,internal:3},Ro=Object.freeze(["core","standard","full"]),Nb=new Set(["core","standard","full","custom"]),Po=new Set(oe.map(({family:e})=>e)),Lb=Pb(32);function De(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 Mo(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 ko(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 xo(e){if(e!==void 0&&typeof e!="boolean")throw new b("pm tool discovery includeSchema must be a boolean.",64);return e===!0}function No(e){if(e===null||typeof e!="object"||Array.isArray(e))throw new b("pm tool discovery options must be an object.",64)}function Db(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 RD(e){if(No(e),e.family!==void 0&&(typeof e.family!="string"||!Po.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"||!Ro.includes(e.tier)))throw new b("pm tool discovery tier must be core, standard, or full.",64);return{...e.query!==void 0?{query:De(e.query,"query")}:{},...e.family!==void 0?{family:e.family}:{},...e.tier!==void 0?{tier:e.tier}:{},...e.limit!==void 0?{limit:Mo(e.limit)}:{},...e.cursor!==void 0?{cursor:De(e.cursor,"cursor")}:{},...e.includeSchema!==void 0?{includeSchema:xo(e.includeSchema)}:{},...e.outputBudget!==void 0?{outputBudget:ko(e.outputBudget)}:{}}}function $b(e){return e===void 0||!Number.isFinite(e)?0:Math.min(1,Math.max(0,e))}function me(e){return[...new Set(e.toLowerCase().match(/[a-z0-9]+/gu)??[])].sort()}function Fb(e,t){let r=me(e);if(r.length===0)return 0;let o=new Set(me(t)),n=r.filter(s=>o.has(s)).length,i=t.toLowerCase().includes(e.toLowerCase())?.25:0;return Math.min(1,n/r.length+i)}function jb(e,t){let r=me(e);if(r.length===0)return 0;let o=t.toLowerCase(),n=me(t),i=r.filter(a=>n.some(c=>c.startsWith(a)||a.startsWith(c))).length,s=o.includes(e.toLowerCase())?.2:0;return Math.min(1,i/r.length+s)}function vo(e){return Oo("sha256").update(JSON.stringify(e)).digest("hex").slice(0,24)}function Lo(e,t,r){return Rb("sha256",r).update(JSON.stringify({version:1,fingerprint:e,offset:t})).digest("base64url")}function Gb(e,t,r){let o={version:1,offset:t,signature:Lo(e,t,r)};return Buffer.from(JSON.stringify(o),"utf8").toString("base64url")}function Ub(e,t,r,o){if(e===void 0)return 0;try{let n=JSON.parse(Buffer.from(e,"base64url").toString("utf8"));if(n.version!==1||!Number.isInteger(n.offset)||(n.offset??-1)<0||Number(n.offset)>r||typeof n.signature!="string")throw new Error("cursor fields do not match the request");let i=Buffer.from(Lo(t,n.offset,o),"base64url"),s=Buffer.from(n.signature,"base64url");if(s.length!==i.length||!Mb(s,i))throw new Error("cursor signature does not match the request");return n.offset}catch(n){throw new b("Invalid or stale pm tool discovery cursor; restart discovery without cursor.",64,{reason:String(n)})}}function Et(e,t,r){return{value:$b(e),weight:t,available:r!=="unavailable",source:r}}function Le(e,t,r){return Et(e??t,r,e===void 0?"computed":"host")}function Bb(e,t,r){let o=Object.hasOwn(_e,e.name)?_e[e.name]:"help",n=Ze(o),i=`${e.name} ${e.description} ${o} ${n}`,s=Fb(t,i),a=new Set(me(t)),c={lexical:Et(s,z.lexical,"computed"),semantic:Le(e.signals?.semantic,jb(t,i),z.semantic),graph:Le(e.signals?.graph,a.has(n)||a.has(o)?1:0,z.graph),permission:Et(1,z.permission,"authorization"),freshness:Le(e.signals?.freshness,1,z.freshness),usage:Le(e.signals?.usage,kb.includes(e.name)?1:0,z.usage)},d=Object.values(c).reduce((l,u)=>l+u.value*u.weight,0);return{name:e.name,description:e.description,command:o,tier:Qe(o),family:n,score:Number(d.toFixed(6)),signals:c,...r?{input_schema:structuredClone(e.inputSchema)}:{}}}function qb(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"||!Ro.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"||!Po.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"||!Nb.has(e.profile)))throw new b("pm tool discovery profile must be core, standard, full, or custom.",64)}function zb(e){let r=De(e.query===void 0?"":e.query,"query").trim().replace(/\s+/gu," ");De(e.cursor===void 0?"":e.cursor,"cursor");let o=Mo(e.limit===void 0?10:e.limit),n=ko(e.outputBudget===void 0?1200:e.outputBudget);return qb(e),{query:r,includeSchema:xo(e.includeSchema),limit:o,budget:n,maximumTier:Io[e.tier??"full"],profile:e.profile===void 0?"core":e.profile}}function Do(e,t,r){let o=r??e.tools.reduce((s,a,c)=>s+(c===0?0:1)+Buffer.byteLength(JSON.stringify(a),"utf8"),0),n={...e,tools:[]},i=0;for(let s=0;s<4;s+=1){let a=Buffer.byteLength(JSON.stringify({...n,token_cost:{estimated_tokens:i,budget:t,within_budget:!0}}),"utf8"),c=Math.ceil((a+o)/4);if(c===i)break;i=c}return i}function Vb(e,t,r){return e.filter(o=>o.authorized!==!1).map(o=>Bb(o,r.query,r.includeSchema)).filter(o=>o.tier!=="internal"&&Io[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 Hb(e,t,r){if(t==="unbounded")return[...e];let o=[],n=0;for(let[i,s]of e.entries()){let a=n+(i===0?0:1)+Buffer.byteLength(JSON.stringify(s),"utf8");if(Do(r(i+1),t,a)>t)break;o.push(s),n=a}return o}function PD(e,t={}){Db(e),No(t);let r=zb(t),o=t.cursorIntegrityKey??Lb,n=Vb(e,t,r),i=vo({query:r.query,family:t.family??null,tier:t.tier??"full",includeSchema:r.includeSchema,profile:r.profile,ranked:n}),s=Ub(t.cursor,i,n.length,o),a=n.slice(s,s+r.limit),c=[];r.includeSchema||c.push({name:"input_schema",reason:"compact_projection",restore_with:"Set includeSchema=true."}),s+r.limit<n.length&&c.push({name:"tools",reason:"limit",restore_with:"Continue with next_cursor or increase limit."});let d={result_type:"pm_tool_discovery",contract_version:1,query:r.query,profile:r.profile,total:n.length,ranking_policy:{version:1,formula:"weighted_sum_then_name",weights:z},cache:{key:vo({fingerprint:i,cursorIntegrityKey:Oo("sha256").update(o).digest("hex"),limit:r.limit,offset:s,budget:r.budget}),ttl_ms:3e4,scope:"private",invalidates_on:xb}},l=(h,C=h.length)=>{let S=s+C,V=S<n.length,R=[...c];return C<a.length&&R.push({name:"tools",reason:"token_budget",restore_with:"Continue with next_cursor or increase outputBudget."}),{...d,tools:[...h],returned:C,has_more:V,...V?{next_cursor:Gb(i,S,o)}:{},omission_receipt:{has_omissions:R.length>0,omitted:R}}},u=h=>{let C=l(h),S=Do(C,r.budget);return{...C,token_cost:{estimated_tokens:S,budget:r.budget,within_budget:r.budget==="unbounded"||S<=r.budget}}},f=Hb(a,r.budget,h=>l([],h)),g=u(f);if(a.length>0&&f.length===0){let h=u([a[0]]).token_cost.estimated_tokens;throw new b(`pm tool discovery outputBudget is too small to return a tool; increase it to at least ${h}.`,64,{required:String(h)})}if(r.budget!=="unbounded"&&g.token_cost.estimated_tokens>r.budget)throw new b(`pm tool discovery outputBudget is too small; at least ${g.token_cost.estimated_tokens} estimated tokens are required for this page.`,64,{required:String(g.token_cost.estimated_tokens)});return g}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="87fb8085-4f16-58a9-9de7-c871fb90be5b")}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]="f5d5516b-01ec-51b3-a7a0-e611b4622581")}catch{}})();export{JI as ACTIONABILITY_ORDERING_KINDS,ws as ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS,yc as ACTIVITY_FLAG_CONTRACTS,Fn as AGENT_PROVENANCE_DIMENSIONS,ra as AGGREGATE_FLAG_CONTRACTS,Ba as APPEND_FLAG_CONTRACTS,AR as ASSURANCE_ACTIONS,vR as ASSURANCE_DECLARATION_KINDS,yO as ASSURANCE_DOCUMENT_VERSION,cc as ASSURANCE_FLAG_CONTRACTS,bO as ASSURANCE_GATE_TRIGGERS,CO as ASSURANCE_MEASUREMENT_SOURCE_KINDS,$O as ASSURANCE_PRESET_IDS,fO as AssuranceEvaluationRefusalError,mO as AssuranceMutationRefusalError,_O as AssuranceSourceResolutionError,En as BASELINE_ITEM_FORMAT_VERSION,Sy as BOUNDARY_FIXTURE_CAPTURE_SOURCES,lR as BRIEF_LIST_FIELDS,Gn as BUILTIN_AGENT_PROVENANCE_ADAPTERS,J as BUILTIN_CORPUS_SHAPES,jn as BUILTIN_HARNESS_SIGNAL_DESCRIPTORS,Qo as BUILTIN_ITEM_TYPE_VALUES,Yt as BUILTIN_PROFILES,xC as BUILTIN_RELATIONSHIP_KINDS,Cs as CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS,gc as CALENDAR_FLAG_CONTRACTS,qa as CLAIM_FLAG_CONTRACTS,Dc as CLOSE_ACTION_OPTION_KEYS,Ga as CLOSE_FLAG_CONTRACTS,Ua as CLOSE_MANY_FLAG_CONTRACTS,Xa as CLOSE_TASK_FLAG_CONTRACTS,oa as COMMENTS_FLAG_CONTRACTS,SC as COMMON_MUTATION_COMMAND_OPTION_KEYS,Pc as COMPLETION_FLAG_CONTRACTS,sn as CONFIDENCE_TEXT_VALUES,ya as CONFIG_FLAG_CONTRACTS,Ts as CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS,FR as CONTEXT_EVALUATION_METRIC_NAMES,Cc as CONTEXT_FLAG_CONTRACTS,Vt as CONTEXT_OUTPUT_VALUES,qR as CONTEXT_PACKING_PROFILES,PR as CONTEXT_RECENCY_EPOCH,NR as CONTEXT_RELEVANCE_SERVICE,kR as CONTEXT_RELEVANCE_SIGNAL_NAMES,HR as CONTEXT_SIGNAL_SET_VERSION,VR as CONTEXT_SIGNAL_STORE_FORMAT_VERSION,KR as CONTEXT_SIGNAL_STORE_WARNING_DETAILS,Iw as CONTEXT_USAGE_LIMITS,Rc as CONTRACTS_FLAG_CONTRACTS,mc as COPY_FLAG_CONTRACTS,Os as CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,Rs as CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,Is as CREATE_COMMANDER_STRING_OPTION_CONTRACTS,Jb as CREATE_DIRECT_CLOSE_REASON_DEFAULT,dc as CREATE_FLAG_CONTRACTS,qT as CURRENT_HISTORY_HASH_ALGORITHM,eE as CURRENT_HISTORY_ITEM_HASH_VERSION,rE as CURRENT_HISTORY_RECORD_HASH_VERSION,An as CURRENT_ITEM_FORMAT_VERSION,JR as ContextSignalStore,Rw as ContextUsageValidationError,sO as DEFAULT_AUTHOR_IDENTITY_VOCABULARY,xP as DEFAULT_CHILD_SAMPLE_LIMIT,dR as DEFAULT_COMPACT_LIST_FIELDS,mA as DEFAULT_DERIVED_INDEX_MINIMUM_ITEMS,nm as DEFAULT_EVAL_QUERIES_RELATIVE_PATH,pP as DEFAULT_TERMINAL_TRANSITION_POLICY,tP as DEFAULT_WORKSPACE_MEMORY_MINIMUM_ITEMS,bv as DEFECT_ESCAPE_CLASSES,Cv as DEFECT_GATE_EVIDENCE_DISPOSITIONS,Va as DELETE_FLAG_CONTRACTS,rn as DEPENDENCY_KIND_VALUES,wc as DEPS_FLAG_CONTRACTS,aa as DOCS_FLAG_CONTRACTS,ic as DUPLICATES_FLAG_CONTRACTS,NI as DURABLE_MERGE_RECEIPT_INTRODUCED_AT,Ac as EVAL_FLAG_CONTRACTS,em as EVAL_QUERY_SET_CONTRACT,tm as EVAL_QUERY_SET_EXAMPLE,Qp as EVAL_QUERY_SET_SCHEMA_ID,bc as EVENTS_FLAG_CONTRACTS,Ja as EVENT_FLAG_CONTRACTS,Vo as EXECUTABLE_COMMAND_ALIASES,D as EXIT_CODE,Ra as EXTENSION_ACTIVATE_FLAG_CONTRACTS,Ia as EXTENSION_ADOPT_ALL_FLAG_CONTRACTS,Da as EXTENSION_ADOPT_FLAG_CONTRACTS,$v as EXTENSION_CAPABILITIES,Xb as EXTENSION_CAPABILITY_CONTRACT,Kb as EXTENSION_CAPABILITY_CONTRACT_VERSION,Wb as EXTENSION_CAPABILITY_LEGACY_ALIASES,_n as EXTENSION_CAPABILITY_REGISTRATION_SURFACES,La as EXTENSION_CATALOG_FLAG_CONTRACTS,Pa as EXTENSION_DEACTIVATE_FLAG_CONTRACTS,Oa as EXTENSION_DESCRIBE_FLAG_CONTRACTS,Na as EXTENSION_DOCTOR_FLAG_CONTRACTS,va as EXTENSION_EXPLORE_FLAG_CONTRACTS,ba as EXTENSION_FLAG_CONTRACTS,Ta as EXTENSION_INIT_FLAG_CONTRACTS,Ea as EXTENSION_INSTALL_FLAG_CONTRACTS,ka as EXTENSION_MANAGE_FLAG_CONTRACTS,Ma as EXTENSION_MIGRATE_FLAG_CONTRACTS,Fv as EXTENSION_POLICY_MODES,jv as EXTENSION_POLICY_SURFACES,xa as EXTENSION_RELOAD_FLAG_CONTRACTS,Uv as EXTENSION_SANDBOX_PROFILES,Ca as EXTENSION_SCOPE_FLAG_CONTRACTS,Gv as EXTENSION_TRUST_MODES,Aa as EXTENSION_UNINSTALL_FLAG_CONTRACTS,VO as EXTERNAL_DEPENDENCY_RESOLUTION_STATUSES,qO as EXTERNAL_DEPENDENCY_SOURCE_KIND,zO as EXTERNAL_DEPENDENCY_SOURCE_KIND_ALIAS,sa as FILES_FLAG_CONTRACTS,fc as FOCUS_FLAG_CONTRACTS,oc as GC_FLAG_CONTRACTS,mR as GET_DEPTH_VALUES,Tc as GET_FLAG_CONTRACTS,ea as GLOBAL_FLAG_CONTRACTS,$d as GRAPH_DURABLE_CACHE_MIN_ITEMS,Dd as GRAPH_DURABLE_CACHE_VERSION,Ec as GRAPH_FLAG_CONTRACTS,qe as GRAPH_SUBCOMMAND_VALUES,Sc as GUIDE_FLAG_CONTRACTS,sc as HEALTH_FLAG_CONTRACTS,pa as HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS,QO as HISTORY_AUTHOR_ATTRIBUTION_BASELINE,fM as HISTORY_COMPACT_BULK_DEFAULT_MIN_ENTRIES,ma as HISTORY_COMPACT_FLAG_CONTRACTS,ei as HISTORY_EVENT_CLASSIFICATION_VERSION,ca as HISTORY_FLAG_CONTRACTS,UT as HISTORY_HASH_ALGORITHMS,Pe as HISTORY_ITEM_HASH_VERSION_3_INTRODUCED_IN,la as HISTORY_REDACT_FLAG_CONTRACTS,ua as HISTORY_REPAIR_FLAG_CONTRACTS,Kp as INIT_AGENT_GUIDANCE_MODE_VALUES,ga as INIT_FLAG_CONTRACTS,$a as INSTALL_FLAG_CONTRACTS,nn as ISSUE_SEVERITY_VALUES,uc as ITEM_COMPLETE_FLAG_CONTRACTS,AI as ITEM_LATEST_TIMESTAMP_FIELDS,Yb as ITEM_METADATA_KEY_ORDER,lc as ITEM_MUTATE_FLAG_CONTRACTS,pc as ITEM_REOPEN_FLAG_CONTRACTS,yI as ITEM_SCALAR_MISSING_VALUE,en as ITEM_TYPE_VALUES,EI as ITEM_UNION_COLLECTION_FIELDS,YR as JsonFileContextSignalStoreAdapter,ia as LEARNINGS_FLAG_CONTRACTS,BT as LEGACY_HISTORY_HASH_ALGORITHM,up as LINKED_TEST_ENV_NAME_PATTERN,pp as LINKED_TEST_PM_CONTEXT_MODE_VALUES,lp as LINKED_TEST_PROTECTED_ENV_KEYS,mp as LINKED_TEST_WORKSPACE_CONTEXT_MODE_VALUES,ys as LIST_COMMANDER_STRING_OPTION_CONTRACTS,uR as LIST_COMMAND_DEFAULT_PROJECTIONS,qv as LIST_FILTER_EXTENSION_FLAG_DEFINITIONS,ta as LIST_FILTER_FLAG_CONTRACTS,gR as LIST_SORT_FIELDS,yR as LIST_SORT_ORDER_VALUES,ti as MAINTENANCE_HISTORY_OPERATIONS,kP as MAX_CHILD_PROJECTION_ITEMS,KS as MAX_WORKFLOW_POLICIES,WS as MAX_WORKFLOW_POLICY_TERMS,Ya as MEET_FLAG_CONTRACTS,tM as MERGE_DRIVER_ARTIFACT_VALUES,da as MERGE_FLAG_CONTRACTS,ze as MERGE_SUBCOMMAND_VALUES,nM as MUTATION_EVENT_WIRE_BUDGET,ce as MemoryRelationshipGraphAdapter,Ss as NEXT_COMMANDER_STRING_OPTION_CONTRACTS,Oc as NEXT_FLAG_CONTRACTS,Yu as NEXT_OUTPUT_VALUES,na as NOTES_FLAG_CONTRACTS,Sa as PACKAGE_FLAG_CONTRACTS,wa as PACKAGE_INIT_FLAG_CONTRACTS,Wa as PAUSE_TASK_FLAG_CONTRACTS,Lc as PLAN_CREATE_METADATA_PARAMETER_KEYS,ha as PLAN_FLAG_CONTRACTS,$p as PLAN_SHOW_DEPTH_VALUES,Ye as PLAN_SUBCOMMANDS,Fp as PLAN_TEMPLATE_NAMES,zy as PM_AGENT_TASK_ACCOUNTING_MODES,bt as PM_AGENT_TASK_TRANSCRIPT_VERSION,Uo as PM_BULK_LIFECYCLE_COMMAND_ALIASES,zc as PM_CLI_EXPECTED_ERROR_NAME,uv as PM_CLI_GRAMMAR_CONTRACT,sv as PM_CLI_GRAMMAR_NOUNS,gi as PM_CLI_ONLY_TOOL_ACTION_WAIVERS,av as PM_CLI_SHARED_VERBS,zo as PM_COMMAND_ALIAS_CONTRACTS,oe as PM_COMMAND_CAPABILITY_CONTRACTS,Ft as PM_COMMAND_DESTINATION_CONTRACTS,TP as PM_COMMAND_EXIT_CONTRACTS,CP as PM_COMMAND_EXIT_OUTCOME_CONTRACTS,Li as PM_COMMAND_OUTPUT_BUDGET_CONTRACTS,vM as PM_COMMAND_OUTPUT_ENVELOPE_CONTRACTS,He as PM_COMMAND_POSITIONAL_CONTRACTS,km as PM_COMMAND_VISIBILITY_CONTRACTS,Vv as PM_COMPLETE_LIST_FINDING_CODES,Jv as PM_CONTEXT_INTENTS_FILE,jw as PM_CONTEXT_INTENT_CONTRACTS,Go as PM_CONTEXT_OPS_COMMAND_ALIASES,mi as PM_CORE_COMMAND_NAMES,G as PM_CORPUS_SHAPE_SCHEMA,bi as PM_DEPRECATED_TOOL_ACTIONS,Pi as PM_DIAGNOSTIC_DEGRADATION_STEPS,Mi as PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS,Ri as PM_DIAGNOSTIC_OUTPUT_CLASSES,Ci as PM_DISCOVERABLE_TOOL_ACTIONS,to as PM_EPISODE_SCHEMA,EM as PM_ERROR_CODE_CATALOG,CM as PM_ERROR_CODE_EXIT_CLASS_CONTRACTS,ao as PM_EXACT_COVERAGE_METRICS,ai as PM_EXTENSION_CAPABILITY_CONTRACTS,fi as PM_EXTENSION_PACKAGE_ACTION_SUBCOMMANDS,di as PM_EXTENSION_POLICY_MODE_CONTRACTS,pi as PM_EXTENSION_POLICY_SURFACE_CONTRACTS,ui as PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS,ci as PM_EXTENSION_SERVICE_NAME_CONTRACTS,li as PM_EXTENSION_TRUST_MODE_CONTRACTS,sI as PM_GITATTRIBUTES_END,iI as PM_GITATTRIBUTES_START,cI as PM_GITATTRIBUTES_V2_END,aI as PM_GITATTRIBUTES_V2_START,Xc as PM_GITIGNORE_END,Wc as PM_GITIGNORE_START,OP as PM_HISTORY_ATTESTATION_CONTRACT,jo as PM_HISTORY_COMMAND_ALIASES,nS as PM_HISTORY_OPERATION_ALIASES,sS as PM_HISTORY_OPERATION_CONTRACT,iS as PM_HISTORY_OPERATION_PATTERNS,hi as PM_ITEM_ACTION_SUBCOMMANDS,rS as PM_ITEM_HISTORY_OPERATIONS,dt as PM_MCP_APPS_EXTENSION,Fr as PM_MCP_APPS_SERVER_CAPABILITY,Ee as PM_MCP_APPS_SPEC_VERSION,Ur as PM_MCP_APP_CONTRACTS,Gr as PM_MCP_APP_MIME_TYPE,kb as PM_MCP_ENTRY_TOOL_NAMES,m as PM_MCP_ERROR_CODES,I0 as PM_MCP_HTTP_PROTOCOL_VERSION,zh as PM_MCP_INPUT_REQUEST_METHODS,Zk as PM_MCP_LEGACY_PROTOCOL_VERSIONS,lr as PM_MCP_LOG_LEVELS,A as PM_MCP_META_KEYS,OD as PM_MCP_PROGRESSIVE_DISCOVERY_EXTENSION,ID as PM_MCP_PROGRESSIVE_DISCOVERY_SERVER_CAPABILITY,$m as PM_MCP_PROMPT_CONTRACTS,K as PM_MCP_PROTOCOL_VERSION,Dm as PM_MCP_RESOURCE_CONTRACTS,ut as PM_MCP_SKILLS_DRAFT_REVISION,Br as PM_MCP_SKILLS_EXTENSION,Yg as PM_MCP_SKILLS_SERVER_CAPABILITY,M as PM_MCP_SKILL_LIMITS,Se as PM_MCP_SUBSCRIPTION_ID_META_KEY,et as PM_MCP_SUPPORTED_PROTOCOL_VERSIONS,C0 as PM_MCP_TASKS_EXTENSION,tg as PM_MCP_TASK_STATUSES,_e as PM_MCP_TOOL_COMMAND_CONTRACTS,bS as PM_MODE_PAIRED_OUTPUT_PROJECTION_CONTRACTS,es as PM_MUTATION_ACTION_CONTRACTS,$e as PM_NAMESPACED_COMMAND_ALIASES,Qr as PM_OBSERVATION_SCHEMA,Ii as PM_OUTPUT_BUDGET_CLASSES,Oi as PM_OUTPUT_DEGRADATION_STEPS,ar as PM_OUTPUT_ENVELOPE_KINDS,Bt as PM_PACKAGE_CONVENTIONAL_RESOURCE_ROOTS,_i as PM_PACKAGE_ONLY_ACTION_SUBCOMMANDS,Ut as PM_PACKAGE_RESOURCE_KINDS,Ve as PM_POSITIONAL_ACTION_CONTRACTS,qc as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA,Uc as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION,hw as PM_READ_OUTPUT_COMPOSITION_OPTION_FLAGS,ow as PM_READ_OUTPUT_CONTINUATION_FINGERPRINT_POLICIES,mw as PM_READ_OUTPUT_DIMENSIONS,_w as PM_READ_OUTPUT_OPTION_FLAGS,cw as PM_READ_OUTPUT_SESSION_MAX_SEEN_ITEM_IDS,aw as PM_READ_OUTPUT_SESSION_MIN_TOKENS,fw as PM_READ_OUTPUT_SURFACES,gw as PM_READ_OUTPUT_SURFACE_CONTRACTS,yS as PM_READ_ROW_CONTRACTS,gS as PM_READ_ROW_JQ_SELECTOR,AN as PM_RECOVERY_REFERENCE_FIELDS,ue as PM_RECOVERY_REFERENCE_KINDS,fb as PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE,To as PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE_V2,kN as PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE,Co as PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE_V2,Bo as PM_RELOCATED_COMMAND_ALIASES,fs as PM_REPRODUCIBLE_PROCESS_ENV,SP as PM_SUCCESS_EXIT_CODES,yi as PM_TOOL_ACTIONS,$c as PM_TOOL_ACTION_PARAMETER_CONTRACTS,Bc as PM_TOOL_PARAMETERS_SCHEMA,Gc as PM_TOOL_PARAMETERS_SCHEMA_MAJOR,jc as PM_TOOL_PARAMETERS_SCHEMA_VERSION,xc as PM_TOOL_RESERVED_CUSTOM_FIELD_PROPERTIES,eo as PM_VERDICT_SCHEMA,oS as PM_WORKSPACE_HISTORY_OPERATIONS,Jr as PM_WORKSPACE_RECIPE_SCHEMA,_a as PROFILE_FLAG_CONTRACTS,or as PROFILE_LINT_CODES,rr as PROFILE_LINT_DIMENSIONS,Xt as PROFILE_NAMES,Je as PROFILE_SUBCOMMANDS,b as PmCliError,he as PmClient,Hv as PmCompleteListValidationError,y as PmMcpAuthorizationError,ur as PmMcpInputRequiredError,xr as PmMcpIssuerCredentialStore,p as PmMcpProtocolError,pr as PmMcpRequestStateReplayGuard,Wr as PmMcpSkillRegistry,wr as PmMcpSubscriptionRegistry,at as PmMcpTaskStore,LS as QUERY_CURSOR_CONTRACT,ja as REINDEX_FLAG_CONTRACTS,rA as REINDEX_LOCK_ID,yt as RELATIONSHIP_GRAPH_SNAPSHOT_VERSION,Ha as RELEASE_FLAG_CONTRACTS,Za as REMIND_FLAG_CONTRACTS,kt as RESERVED_ITEM_FIELD_NAMES,za as RESTORE_FLAG_CONTRACTS,on as RISK_VALUES,Rv as RelationshipEventLog,Pv as RelationshipEventStore,H as RelationshipGraph,Ue as RelationshipKindRegistry,fa as SCHEMA_FLAG_CONTRACTS,bs as SEARCH_COMMANDER_STRING_OPTION_CONTRACTS,zv as SEARCH_EXTENSION_FLAG_DEFINITIONS,Ic as SEARCH_FLAG_CONTRACTS,ku as SEMANTIC_ATTRIBUTION_LIMITS,Qb as SETTINGS_DEFAULTS,dm as SNAPSHOT_SCHEMA,rI as SOURCE_CONTEXT_ACCESS_ENV,oI as SOURCE_CONTEXT_WRITE_OVERRIDE_ENV,Ka as START_TASK_FLAG_CONTRACTS,nc as STATS_FLAG_CONTRACTS,tn as STATUS_VALUES,Qs as SUBCOMMAND_GLOBAL_FLAG_CONTRACTS,ri as SUBSTANTIVE_HISTORY_OPERATIONS,tE as SUPPORTED_HISTORY_ITEM_HASH_VERSIONS,oE as SUPPORTED_HISTORY_RECORD_HASH_VERSIONS,hC as SUPPRESS_HOST_OUTPUT_MARKER,tc as TELEMETRY_FLAG_CONTRACTS,nf as TELEMETRY_SUBCOMMANDS,ec as TEST_ALL_FLAG_CONTRACTS,Qa as TEST_FLAG_CONTRACTS,rc as TEST_RUNS_FLAG_CONTRACTS,Qm as TEST_RUN_MEASUREMENT_LIMIT,Ks as TOOL_ACTIVITY_OPTION_CONTRACTS,Ls as TOOL_AGGREGATE_OPTION_CONTRACTS,qs as TOOL_BULK_MUTATION_FILTER_OPTION_CONTRACT_SOURCE,Hs as TOOL_CALENDAR_OPTION_CONTRACTS,Vs as TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS,Ws as TOOL_CONTEXT_OPTION_CONTRACTS,Gs as TOOL_CREATE_OPTION_CONTRACTS,js as TOOL_CREATE_OPTION_CONTRACT_SOURCE,Xs as TOOL_DEPS_OPTION_CONTRACTS,Ys as TOOL_GRAPH_OPTION_CONTRACTS,Ns as TOOL_LIST_FILTER_OPTION_CONTRACTS,Ds as TOOL_SEARCH_FILTER_OPTION_CONTRACTS,Fs as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS,$s as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACT_SOURCE,zs as TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS,Bs as TOOL_UPDATE_OPTION_CONTRACTS,Us as TOOL_UPDATE_OPTION_CONTRACT_SOURCE,Zb as TYPE_TO_FOLDER,fC as UNKNOWN_SUBCOMMAND_COMPATIBILITY_CODES,Ps as UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,ks as UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,Ms as UPDATE_COMMANDER_STRING_OPTION_CONTRACTS,_c as UPDATE_FLAG_CONTRACTS,hc as UPDATE_MANY_FLAG_CONTRACTS,Fa as UPGRADE_FLAG_CONTRACTS,ac as VALIDATE_FLAG_CONTRACTS,HS as WORKFLOW_POLICY_ACTIONS,uI as WORKFLOW_POLICY_DOCUMENT_SCHEMA,lI as WORKFLOW_POLICY_SCHEMA,vc as WORKSPACE_FLAG_CONTRACTS,AE as WORKSPACE_HISTORY_ID,lm as WORKSPACE_SNAPSHOT_ACTIONS,md as WorkspaceGraphCache,Lv as WorkspaceTransactionInterruptedError,Mm as _testOnly,RR as _testOnlyAggregateCommand,Hp as _testOnlyConfigCommand,$P as _testOnlyGetCommand,Pl as _testOnlyHealthCommand,Jp as _testOnlyInit,Wp as _testOnlyInitAgentGuidance,ek as _testOnlyItemTransaction,cM as _testOnlyMutationEvents,dP as _testOnlyNextCommand,eM as _testOnlySearchCommand,gP as _testOnlySimilarity,ym as _testOnlyTemplates,du as _testOnlyValidateCommand,uM as _testOnlyWorkspacePosition,UO as acceptAssuranceProposals,au as acknowledgeLinkedTests,ol as acknowledgeUnknownAuthorHistoryEvents,rl as acknowledgeUnknownAuthorHistoryEventsFromTransport,fA as acquireItemMetadataDerivedIndexLock,Be as acquireLock,pk as activateExtensionForTest,WC as activateExtensions,$n as agentSessionEnvironment,t_ as aggregate,Bm as analyzeAgentProvenanceDescriptorCoverage,Sv as analyzeDefectChangeRisk,ER as analyzeDefectRecurrenceCoverage,ap as analyzeDuplicateItems,kv as analyzeGraphImpact,od as analyzeHierarchyIntegrity,xv as analyzeKnowledgeGraph,EP as analyzePmCommandExitConformance,Ti as analyzePmToolActionParity,BI as analyzeReconciliationDiscard,Mv as analyzeRelationshipExecution,Id as analyzeRelationshipSchedule,vh as analyzeSdkActionCoverage,jt as analyzeSdkCliParameterCompleteness,m_ as append,Bi as appendHistoryEntry,RE as appendWorkspaceAuditEvent,IE as appendWorkspaceHistoryChange,ET as applyAcceptanceCriteriaMutations,jO as applyAssurancePreset,Mh as applyBootstrapPagerPolicy,zw as applyContextIntentProjection,Xu as applyContextTagProjection,bR as applyFilterValueEcho,sA as applyHistoryPatch,Fh as applyInvocationAuthorOverride,Dl as applyPathMigrations,Aw as applyReadOutputDimensions,Tw as applyReadOutputIncludeModes,lw as applyReadOutputSessionReferences,CT as applyRegisteredItemFieldDefaultsAndValidation,Gl as applyStandaloneNote,Sl as applyStoredExtensionMigrationState,vT as applyTagRemovals,hP as applyTerminalOrderingPolicy,Ul as artifactKey,nC as asRecordClone,oC as asRecordOrNull,We as assembleWorkspaceRelationshipGraph,Yv as assertCompleteListResult,Hk as assertExtensionBlueprint,Vk as assertExtensionCapabilityUsage,Ok as assertExtensionDeactivated,Xk as assertExtensionManifestCompatible,Wk as assertExtensionManifestMatchesBlueprint,Yk as assertExtensionPreflight,sd as assertHierarchyMutationAllowed,_M as assertHistoryCompactTarget,zI as assertHistoryRepairTarget,Yi as assertInitializedTracker,$l as assertLinkedArtifactMutationIsUnambiguous,e0 as assertMcpClientCapabilities,Qk as assertMcpProtocolHeader,qy as assertMemoryRelationshipGraphAdapterConformance,RT as assertNoUnknownCsvKeys,Ik as assertPackageManifest,FE as assertParentReferenceIsNotSelf,nx as assertPmMcpSkillsCapability,Kk as assertProjectProfile,zx as assertProjectRuntimeCompatibility,CS as assertProjectionModeChoice,Xi as assertReadableTrackerRoot,Rk as assertRegisteredCommandContract,jk as assertRegisteredCommandOverride,Lk as assertRegisteredExporter,Pk as assertRegisteredFlags,Mk as assertRegisteredHook,Nk as assertRegisteredImporter,Dk as assertRegisteredItemField,$k as assertRegisteredItemType,zk as assertRegisteredMigration,Gk as assertRegisteredParserOverride,Uk as assertRegisteredPreflightOverride,Fk as assertRegisteredProfile,Bk as assertRegisteredRendererOverride,kk as assertRegisteredSearchProvider,qk as assertRegisteredServiceOverride,xk as assertRegisteredVectorStoreAdapter,$C as assertRelationshipEdgeAllowed,fo as assertRelationshipGraphAdapterConformance,TO as assuranceAssertionUpdateIsLoosening,Kw as attachContextIntentReceipt,Pw as attachContextUsageServingReceipt,ou as attachLinkedTestMutationProvenance,ru as attachLinkedTestProvenance,rt as attachMcpServerInfo,vS as attachOutputOmissionReceipt,Xw as attachOutputTokenAccounting,Ww as attachReadOutputContracts,uw as attachReadOutputSessionReceipt,cl as auditMergeAttributeFence,dI as auditMergeDriverConfiguration,Nd as auditWorkspaceRelationshipGraph,q0 as authorizeMcpHttpRequest,Ln as boundAgentEpisodeIdentity,zS as boundReadOutputRows,Vu as buildChildrenByParent,UP as buildCompactSearchFilterSummary,CR as buildContentFilterEcho,XR as buildContextSignalSnapshot,_y as buildCorpusShapeItemPlan,Tv as buildDefectRecurrenceIndex,yl as buildExtensionDescribeResult,Al as buildExtensionInstallPlan,TR as buildGovernanceMissingFilterEcho,HE as buildInvalidTypeError,NP as buildItemChildrenRollup,ZM as buildItemCompletionMutations,xR as buildItemContextRelevanceCandidates,CA as buildItemNotFoundError,DP as buildItemSchedule,WI as buildLinkedFileRepairReport,N0 as buildMcpAuthorizationDiscoveryUrls,Bh as buildMcpCompleteResult,r0 as buildMcpDiscoverResult,j0 as buildMcpDynamicRegistrationMetadata,v0 as buildMcpHttpRequestHeaders,a0 as buildMcpInputRequiredResult,x0 as buildMcpProtectedResourceMetadata,sl as buildMergeAttributePatterns,Fc as buildPmActionToolInputSchema,LN as buildPmRefusalClosureCensus,JO as buildRelationshipContext,AA as buildSearchCorpus,OA as buildSemanticCorpusInput,KI as buildStatusRoleWarnings,Wi as buildTrackerInitializationRecovery,xA as buildVectorizationEmbeddingIdentity,NA as buildVectorizationEmbeddingMetadata,BP as buildVerboseSearchFilters,pI as buildWorkflowCompletenessCheck,rP as buildWorkspaceMemorySnapshot,Nn as canonicalDocument,wC as canonicalizeCommandOptionKey,MR as canonicalizeContextRecencyCoordinate,NC as canonicalizeRelationshipKind,vN as censusPmRecoveryReferenceProducers,Xv as certifyCompleteListResult,lk as checkExtensionManifestCompatibility,Y_ as claim,J_ as claimNext,eI as classifyHistoryAuthorEvent,oi as classifyHistoryEvent,GI as classifyHistoryMergeReceiptReferences,PC as classifyHostEnvironmentFault,JP as classifyImplicitSemanticFallbackReason,In as classifyItemFormatVersion,cf as classifyLinkedTestCommandSafety,df as classifyLinkedTestFailure,uT as clearActiveExtensionHooks,Bd as clearDurableGraphCache,pS as clearFocusedItem,Zc as clearWorkspaceContractsCache,X_ as close,rp as closeItem,ih as closeTask,Nh as coalesceRepeatedListFlags,ZI as collectBlockedByIds,eR as collectBlockedByIdsFromCorpus,kw as collectContextUsageDeliveredItemIds,ld as collectDanglingDependencyReferences,rR as collectDependencyBlockedIds,cd as collectDuplicateDependencyRows,xd as collectDuplicateRelationshipEdgeGroups,YP as collectErrorCauseCodes,rd as collectHierarchyRelations,Rr as collectMcpHeaderAnnotations,ud as collectMissingDependencyTargetIds,np as collectNewOrderingCycleWarnings,Pd as collectOrderingCycles,dd as collectOrderingStorageContradictions,eO as collectPackageContextIntentContracts,zt as collectPackageExtensionDirectories,yT as collectRegisteredItemFieldNames,YT as collectRuntimeCreateFieldValues,KE as collectRuntimeFilterValues,JT as collectRuntimeUpdateFieldValues,Gu as collectSubtreeIds,hn as collectUsedExtensionCapabilities,EC as commandOptionFlagLabel,n_ as comments,$f as commitImportedItem,QM as commitItemCompletion,JM as commitItemMutations,Dv as commitWorkspaceTransaction,Zs as compactFlagAliasContracts,Uu as compareCriticalItems,U as comparePmDateVersions,Nv as compareRelationshipSnapshots,iC as compareTimestampStrings,uO as compileHistoryProvenanceMatcher,Bw as composeContextIntentContracts,ok as composeExtension,dk as composeExtensionPackage,nR as computeActionabilityReport,SE as computeHistoryDiff,vd as computeRelationshipCentrality,Ad as computeRelationshipDominators,pd as computeWorkspaceGraphFingerprint,__ as config,lT as consumeAfterCommandAffectedItems,Xf as context,Hw as contextIntentRowId,Q_ as copy,lf as countFailureCategories,BS as countReadOutputRows,H_ as create,FO as createAssurancePreset,SR as createAssuranceWorkspaceContext,aC as createCheckpointId,Kv as createCompleteListOptions,XC as createCoreCommandHookContext,so as createCorpusShapeMeasurement,vO as createEmptyAssuranceDocument,jC as createEmptyExtensionRegistrationRegistry,Kc as createExtensionCommandSdk,fn as createExtensionContributionInventory,Jk as createExtensionTestHarness,Ui as createHistoryEntry,YA as createLazyModule,mI as createLifecycleCompletenessPolicies,z0 as createMcpStaticBearerVerifier,T0 as createMcpTaskStore,bA as createMutationGuardSdk,TS as createOutputOmissionReceipt,Vc as createPmCliExpectedError,jh as createPmCliProgram,xi as createPmCommandOutputBudget,IS as createQueryFingerprint,By as createRelationshipGraphScaleFixture,ee as createRelationshipGraphSnapshot,Pt as createRelationshipKindRegistry,hs as createReproducibleProcessRunner,qP as createSearchCursorFingerprint,YC as createSerialQueue,LT as createStdinTokenResolver,_C as createUnknownSubcommandError,rw as createWorkflowPolicyEvaluator,um as createWorkspaceSnapshot,mk as deactivateExtensionForTest,wL as declineServiceOverride,Vw as decodeContextIntentCursor,XA as decodeHtmlEntitiesInOptions,Ir as decodeMcpHttpHeaderValue,kS as decodeQueryCursor,PS as decodeQueryCursorEnvelope,MS as decodeQueryCursorState,sw as decodeReadOutputContinuationCursor,X0 as decoratePmMcpToolsWithApps,ql as dedupeLinkedArtifacts,LR as defaultScoreContextCandidates,RL as defineAfterCommandHook,OL as defineBeforeCommandHook,IL as defineBeforeMutationHook,uL as defineCommand,yL as defineCommandOverride,Y as defineCorpusShape,fx as defineEpisodeSpecification,vL as defineExporter,tk as defineExtension,rk as defineExtensionBlueprint,dL as defineExtensionManifest,pL as defineFlag,AL as defineImporter,fL as defineItemField,mL as defineItemType,_L as defineMigration,iy as defineObservationContract,kL as defineOnIndexHook,ML as defineOnReadHook,PL as defineOnWriteHook,bL as defineParserOverride,Ni as definePmCommandOutputBudget,AM as definePmCommandOutputEnvelope,TM as definePmErrorCodeCatalog,CL as definePreflightOverride,lL as defineProjectProfile,EL as defineRendererOverride,hL as defineSearchProvider,TL as defineServiceOverride,gL as defineVectorStoreAdapter,dy as defineVerdictContract,Ae as defineWorkspaceRecipe,eh as deleteItem,gm as deleteWorkspaceSnapshot,FC as dependencyToRelationship,u_ as deps,GO as deriveAssuranceProposals,ik as deriveExtensionCapabilities,AP as derivePmBulkMutationEffect,ON as derivePmRecoveryReferenceObligations,Rd as deriveRelationshipDeadlines,pl as deriveSchemaEvolutionMigrationId,BA as deriveTelemetryCommandResolution,JE as describeAllowedTransitions,tI as describeExtensionActivation,sk as describeExtensionBlueprint,wu as describeItemOwnershipConflict,mx as describeObservationCost,er as describeProfileComposition,tr as describeProjectProfile,LM as describeUnknownError,Kn as detectAgentIdentity,Jn as detectHarnessIdentity,wd as detectRelationshipCommunities,Wn as diagnoseAgentIdentity,Ld as diffRelationshipAuditSnapshots,rf as diffTestRunMeasurements,l0 as digestMcpRequestParameters,HC as discoverExtensions,dn as discoverNearbyPmRoot,PD as discoverPmTools,Dy as discoverProjectRuntimeVersionPins,l_ as docs,o_ as duplicates,Fd as durableGraphCachePath,qd as durableGraphCacheStatus,vn as effectiveItemFormatVersion,iv as emitTelemetryErrorEvent,Df as emptyImportedDocument,CI as encodeItemScalarDecisionValue,Or as encodeMcpHttpHeaderValue,RS as encodeQueryCursor,iw as encodeReadOutputContinuationCursor,wE as enforceHistoryStreamPolicyForItem,EE as enforceHistoryStreamPolicyForItems,yM as enrichCliFlagInvocationContract,sr as enrichCliFlagInvocationContracts,cA as ensureMaterializedHistoryTarget,Jc as ensurePmGitignore,Ml as ensureScope,UA as ensureSentryInit,Lf as ensureTrackerInitialized,Td as enumerateRelationshipPaths,$i as estimatePmOutputTokens,IO as evaluateAssuranceAssertion,RO as evaluateAssuranceGate,kx as evaluateBoundaryFixtures,jR as evaluateContextRanking,wv as evaluateDefectGateEvidence,OO as evaluateMeasurement,rs as evaluateMutationGuard,Wm as evaluateProvenanceCoverage,Vm as evaluateSemanticAttributionCoverage,dp as evaluateSimilarityGovernance,YE as evaluateTransition,ly as evaluateVerdictContract,tw as evaluateWorkflowPolicies,IA as executeEmbeddingBatchesWithRetry,MA as executeVectorDelete,kA as executeVectorReset,PA as executeVectorUpsert,ty as executeWorkspaceRecipe,jl as expandAddGlobEntries,Xl as explainSourceTraceability,RP as exportAttestation,sh as extension,ch as extensionActivate,dh as extensionDeactivate,ah as extensionList,Ob as extensionMigrate,jI as extractHistoryMergeReceiptDispositions,FI as extractHistoryMergeReceiptReferences,G0 as extractMcpTraceContext,nA as extractPatchFailureContext,Ql as extractReferencedPmItemIdsFromCommand,Uy as federateRelationshipGraphSnapshots,a_ as files,c_ as filesDiscover,d_ as filesLookup,xw as finalizeContextUsageDelivery,Ty as findCoverageDeficits,cp as findDuplicateClusters,il as findGitWorkspaceRoot,HT as findHistoryIdentityDiscontinuities,hl as findInstalledNpmPackageCandidate,W0 as findPmMcpAppByUri,qo as findPmNamespacedCommand,Ed as findRedundantRelationshipEdges,Od as findRelationshipCutStructure,sp as findSimilarItems,nv as finishTelemetryCommand,pC as flattenFlagListValue,yy as flushTelemetryQueue,rh as focus,Sd as forEachMatchedRelationshipEdge,kd as formatDuplicateEdgeGroup,nd as formatHierarchyRelation,Md as formatOrderingStorageContradiction,lv as formatPmPositionalActionFlagTip,Pm as formatProfileApplyHuman,Rm as formatProfileLintHuman,Om as formatProfileListHuman,Im as formatProfileShowHuman,_l as formatSchemaEvolutionMigrationHuman,QP as formatVectorIndexRecoveryWarnings,lM as formatWorkspacePositionHuman,G_ as gc,Vi as generateItemId,Qf as get,aT as getActiveCommandResult,Gw as getActiveContextIntentContracts,yn as getActiveExtensionRegistrations,B0 as getActiveMcpTraceContext,MO as getAssuranceDeclaration,Sh as getContracts,lS as getFocusedItem,pn as getHistoryPath,Iv as getItemAt,un as getItemPath,is as getMutationActionContract,Yc as getPmGitignoreBlock,ln as getSettingsPath,Qc as getWorkspaceContracts,vE as getWorkspaceHistoryPath,p_ as graph,jd as graphAuditBaselinePath,Hm as groupHistoryByEpisode,SL as handleServiceOverride,t0 as hasMcpClientExtension,K0 as hasPmMcpAppsCapability,Ke as hasSubcommandFlagContractsForCommand,LA as hasVectorizationEmbeddingIdentityChanged,DA as hasVectorizationVectorDimensionChanged,uE as hashDocument,pE as hashDocumentForVersion,mE as hashEmptyDocument,iE as hashHistoryPatch,nE as hashHistoryRecord,sE as hashHistoryStream,TI as hashItemScalarDecisionValue,j_ as health,gd as hierarchyAncestors,yd as hierarchyDescendants,z_ as historyCompact,V_ as historyCompactBulk,VT as historyDigest,lO as historyEntryMatchesProvenance,Oe as historyItemHashVersionForRuntime,U_ as historyRedact,B_ as historyRepair,q_ as historyRepairAll,QI as indexBlockedByIds,id as indexHierarchyRelations,$A as inferConsistentVectorDimension,ki as inferPmOutputBudgetClass,f_ as init,Wv as inspectCompleteListResult,GC as inspectExtensionManifestSchema,Jd as inspectHistoryAuthorStream,RI as inspectMergeReceiptEvidence,Fy as inspectProjectRuntimeCompatibility,ps as inspectStaleInProgressItems,HI as inspectStatusRoleAssignments,OE as inspectWorkspaceHistoryState,pm as inspectWorkspaceSnapshot,ul as installMergeFence,o0 as interpretMcpResultType,Zu as isAlreadyClaimedError,FM as isCommanderError,yu as isErrnoError,gv as isExternalDependencyReference,yv as isExternalDependencySourceKind,fe as isFileMissingError,yC as isHostOutputSuppressed,bI as isItemScalarMissingValue,LI as isLegacyMergeReceiptSummary,_ as isMcpRecord,os as isMutationAction,DC as isOrderingRelationshipKind,DE as isPlaceholderReferenceToken,Hc as isPmCliExpectedError,wi as isPmExtensionCapabilityContract,Ai as isPmExtensionPolicyModeContract,vi as isPmExtensionPolicySurfaceContract,Ei as isPmExtensionServiceNameContract,wP as isPmKnownExitCode,OM as isPmMutationReceipt,Xe as isPmSuccessfulExitCode,Si as isPmToolAction,DI as isPreDurableCloneLocalReceiptSummary,$I as isPreDurableDispositionEligibleReference,$y as isProjectMutatingInvocation,JA as isPureSnakeCaseAlias,vw as isReadOutputBudgetExceeded,wS as isReadRowContract,Yd as isRuntimeRecord,ev as isTerminalPlanMode,QT as isTerminalStatus,Zo as isTimestampLiteral,XM as itemDocumentToMutationOptions,LP as itemHasSchedule,ss as jaccardSimilarity,s_ as learnings,mC as levenshteinDistanceWithinLimit,_u as limitAnnotationEntries,nu as linkedTestTrustFingerprint,ak as lintExtensionBlueprint,UC as lintExtensionManifestSchema,nr as lintProjectProfile,Yf as list,Bn as listAgentProvenanceAdapters,xh as listAliasPluralKeys,Jf as listAllComplete,gA as listAllDocumentCandidatesCached,Qi as listAllItemMetadata,yA as listAllItemMetadataLight,PO as listAssuranceDeclarations,DO as listAssuranceVerdicts,my as listBuiltinCorpusShapes,BM as listCoreClosedDomainContracts,fR as listGetProjectionFields,hI as listInvalidProvenanceHistoryStreamIds,pR as listListProjectionFields,PI as listMergeReceipts,ns as listMutationActions,iM as listMutationEvents,Ao as listPmCommandFlagBudgets,Nm as listPmCommandsForFamily,xm as listPmCommandsForTier,Ne as listPmFlagLexicon,iL as listPmFlagSpellingInventory,Lm as listPmMcpToolsForProfile,WN as listPmRequiredArgumentRefusalContracts,XN as listPmSubcommandRefusalContracts,Qt as listProfiles,ZN as listTrackerPreflightRecoveryContracts,mm as listWorkspaceSnapshots,tO as loadContextIntentRuntimeLayers,bm as loadCreateTemplateOptions,KC as loadExtensions,Vd as loadGraphAuditBaseline,dC as loadMutationCheckpoint,N as loadRelationshipGraphAdapter,Ji as locateItem,IT as looksLikeGenericKeyValueEntry,qS as mapReadOutputRows,MI as markMergeReceiptReconciled,WE as matchesRuntimeFilters,rv as maybeRunFirstUseTelemetryPrompt,hy as measureCorpusShapePlan,Ki as measureItemMetadataReadWork,AT as mergeAdditiveTags,nk as mergeExtensionBlueprints,SI as mergeHistoryStreams,vI as mergeItemDocuments,OI as mergeJsonDocuments,Lh as mergeLinkedTestTwoTokenEntries,wI as mergeRelationshipEventStreams,Ku as mergeSortedWarnings,QA as migrateItemFilesToFormat,SA as mutateItem,TA as mutateItemWithHistoryContext,PE as mutateWorkspaceJsonWithHistory,e_ as next,zn as normalizeAgentProvenanceAdapterValue,fu as normalizeAnnotationTransportOptions,gO as normalizeAssuranceEvaluation,hO as normalizeAssuranceMutation,Dh as normalizeBootstrapInvocation,jT as normalizeBulkIdsValue,ad as normalizeDependencyGraphTarget,XO as normalizeDependencySeedId,WO as normalizeDependencySourceKind,mn as normalizeExtensionContributionInventory,dS as normalizeHistoryOperationForWrite,_I as normalizeInvalidHistoryProvenance,MM as normalizeItemAddressInvocation,On as normalizeItemFormatVersion,zi as normalizeItemId,Mn as normalizeItemMetadata,YO as normalizeItemReference,kh as normalizeLegacyExtensionActionSyntax,Fl as normalizeLinkedPath,LE as normalizeParentReferenceValue,Jt as normalizeProfileName,qi as normalizeRawItemId,Sw as normalizeReadOutputIncludeModeOptions,gE as normalizeReplayPatchOps,as as normalizeSimilarityText,ZT as normalizeStatusForRegistry,Pn as normalizeStatusInput,WT as normalizeStatusInputWithRegistry,$M as normalizeThrownExitCode,i_ as notes,Jo as nowIso,Gd as openDurableGraphCache,d0 as openMcpRequestState,_x as openPmEpisode,bd as orderingPredecessors,Cd as orderingSuccessors,zR as packContextCandidates,Bu as packRankedContextItems,bh as packageActivate,yh as packageCatalog,Ch as packageDeactivate,hh as packageDescribe,fh as packageDoctor,ph as packageInstall,lh as packageLifecycle,uh as packageList,_h as packageManage,Ib as packageMigrate,gh as packageReload,mh as packageUninstall,NS as paginateQueryRows,kl as parseAddEntries,xl as parseAddGlobEntries,gu as parseAnnotationTextInput,HM as parseAtomicMutationControls,Ph as parseBootstrapCommandName,Oh as parseBootstrapGlobalOptions,Rh as parseBootstrapHelpRequest,$h as parseBootstrapTypeValue,FT as parseBulkIdsText,Fu as parseContextDepth,Nu as parseContextFocusFields,Zv as parseContextIntentDeclarations,ju as parseContextSections,WR as parseContextSignalSnapshot,OT as parseCsvKv,Av as parseDefectChangeRiskRequest,wR as parseDefectRecurrenceCoverageRequest,Ev as parseDefectRecurrencePolicy,rm as parseEvalQuerySet,Wd as parseGraphSubcommand,IP as parseHistoryAttestation,cO as parseHistoryProvenanceFilters,oO as parseIntegerLimit,eS as parseItemDocument,KM as parseItemMutationBatch,VE as parseLimit,Sp as parseLinkedTestAssertionEqualsMap,wp as parseLinkedTestAssertionGteMap,hp as parseLinkedTestBoolean,gp as parseLinkedTestContextMode,_p as parseLinkedTestEnvClear,fp as parseLinkedTestEnvSet,Ep as parseLinkedTestJsonEntries,Tp as parseLinkedTestMinLines,Cp as parseLinkedTestRegexList,bp as parseLinkedTestStringList,yp as parseLinkedTestWorkspaceContextMode,Kh as parseMcpCachePolicy,Gh as parseMcpImplementation,it as parseMcpInputRequests,hr as parseMcpInputResponses,gg as parseMcpSubscriptionFilter,Ll as parseMigrateEntries,iR as parseMultiValueFilter,IM as parseMutationReceipt,$T as parseOptionalNonNegativeInteger,DT as parseOptionalNumber,bN as parsePmAgentTaskTranscriptCorpus,RD as parsePmToolDiscoveryOptions,nO as parsePriority,cR as parsePriorityFilterSet,dw as parseReadOutputSession,bT as parseRegisteredItemFieldAssignments,de as parseRelationshipGraphSnapshot,Nl as parseRemoveEntries,Wl as parseSourceLineRange,UE as parseStatusFilterCsv,sR as parseStringFilterSet,Tn as parseTags,ef as parseTestRunMeasurements,iO as parseType,aR as parseTypeFilterSet,tl as parseUnknownAuthorHistoryEventCoordinates,XS as parseWorkflowPolicy,YS as parseWorkflowPolicyDocument,lP as partitionDecisionEntries,TE as patchPathToChangedField,Wo as pathExists,nh as pauseTask,Ud as persistDurableGraphResult,ZE as persistSelectedItemFormat,GP as planAgentIdentityVocabularyMutation,eP as planCompletedAtBackfill,vl as planExtensionDirectoryCopy,ir as planProfileApplication,wN as planRelationshipEventBackfill,Kd as planRelationshipRemediation,ml as planSchemaEvolutionMigration,Qd as planUnknownAuthorHistoryAcknowledgment,fm as planWorkspaceSnapshotRestore,mv as positionalShapeKey,fv as positionalSignatureKey,uk as preflightExtension,ds as prepareSimilarityText,MT as preserveMutationStdinTokenFields,PT as preserveMutationStdinTokenLiterals,Qw as printError,Zw as printResult,x_ as profile,D_ as profileApply,$_ as profileLint,N_ as profileList,L_ as profileShow,dT as projectAfterCommandItemSnapshot,Lu as projectContextFocusRows,Zm as projectFleetAttributionAnalytics,dO as projectHistoryProvenance,ji as projectPmDiagnosticOutput,Gi as projectPmDiagnosticText,Ym as projectProvenanceCoverageAnalytics,cu as projectValidateCounts,BO as promoteAssuranceAssertion,Mw as propagateContextUsageServingReceipt,Fx as pruneCompileCacheGenerations,kO as putAssuranceDeclaration,xO as putAssuranceDeclarationBundle,lA as queryItemMetadataIndex,uA as queryLinkedFileMetadataIndex,pA as querySimilarItemMetadataIndex,tf as queryTestRunMeasurementsBelow,ii as quoteCommandArg,ni as quoteWindowsCommandArg,UM as rankCommandPaths,hu as readAnnotationEntries,Xn as readAuthorEnvironment,hf as readBooleanOption,Fw as readContextUsageAffinity,gf as readCsvListOption,Tl as readExtensionMigrationState,Xo as readFileIfExists,Es as readFirstStringFromCommanderOptions,As as readFirstValueFromCommanderOptions,Km as readHistoryAnalyticsWindow,_S as readHistoryEntries,Qn as readHistorySnapshot,Gm as readImprovementLedger,_A as readItemMetadataDerivedIndexState,Zi as readLocatedItem,US as readOutputBudgetCollections,nw as readOutputCollectionFingerprint,GS as readOutputContinuationRowCollections,FS as readOutputContinuationRowPaths,Cw as readOutputIncludeModeOptions,jS as readOutputRowCollections,$S as readOutputRowPaths,pw as readOutputSessionRemainingTokens,qt as readPmPackageManifest,wh as readRequiredString,Hi as readSettings,QE as readSettingsWithMetadata,vs as readStringArrayFromCommanderOptions,_f as readStringOption,DM as readThrownExitCode,FA as readVectorizationStatusLedger,dA as readWorkflowPolicies,JS as readWorkflowPolicyField,Qv as readWorkspaceContextIntentContracts,ZR as readWorkspaceContextSignals,oP as readWorkspaceMemory,dM as readWorkspacePosition,CE as reanchorHistoryEntries,gn as reconcileExtensionCapabilityUsage,kE as reconcileWorkspaceJsonHistory,cT as recordAfterCommandAffectedItem,LO as recordAssuranceVerdict,Ru as recordClaimSemanticAttribution,Lw as recordContextUsageDelivery,Nw as recordContextUsageServing,Dw as recordContextUsageTouch,$w as recordContextUsageTouches,Mu as recordFocusSemanticAttribution,jm as recordImprovementObservation,Pu as recordReleaseSemanticAttribution,hA as refreshItemMetadataDerivedIndex,dl as refreshMergeAttributeFenceIfInstalled,GA as refreshSearchArtifactsForMutation,qn as registerAgentProvenanceAdapters,HO as registerExternalDependencyResolver,Un as registerHarnessSignalDescriptors,hS as registerOutputMaterialFieldGroups,Z_ as release,NO as removeAssuranceDeclaration,Yo as removeFileIfExists,Hl as renameArtifactsResultKey,Au as renderCalendarMarkdown,vu as renderCalendarToon,Wu as renderContextMarkdown,bl as renderExtensionDescribeMarkdown,gl as renderExtensionSurfaceMarkdown,Gf as renderGuideMarkdown,NM as renderMissingOptionRetry,uP as renderNextMarkdown,qM as renderPmClosedDomainHelp,si as renderPmCommand,Ko as renderPmCommandAliasMigrationHint,Fm as renderPmCommandVisibilityMarkdown,aL as renderPmFlagLexiconMarkdown,Y0 as renderPmMcpAppHtml,DN as renderPmRefusalClosureCensusMarkdown,qE as renderRowsAsCsv,zE as renderRowsAsTable,W_ as reopen,aA as replayHistoryToTarget,_E as replayToCanonicalItemDocument,fE as replayToItemDocument,cS as requireHistoryOperation,fP as requireTerminalReason,_P as requireTerminalReasonWithRecovery,dE as resealHistoryRewrite,nT as resetActiveExtensionRuntimeState,_d as resetWorkspaceGraphCache,Dn as resolveAgentSessionContextFromSignals,Su as resolveAnnotationIndex,bu as resolveAnnotationInput,fS as resolveAuthor,Zn as resolveAuthorIdentity,NE as resolveBodyFileContent,fy as resolveBuiltinCorpusShape,Eu as resolveCalendarOutputFormat,SM as resolveCanonicalPmErrorCodeContract,LC as resolveCanonicalRelationshipKind,mS as resolveClaimPrincipal,GT as resolveCliBulkIdsInput,OC as resolveCommandOptionPolicyState,$x as resolveCompileCacheGeneration,QR as resolveCompletionTimestamp,TC as resolveConfiguredPmPackageRoot,hR as resolveContentFieldFilters,qw as resolveContextIntentContract,Du as resolveContextOutputFormat,$u as resolveContextTokenBudget,yP as resolveCreateExplicitEmptyFlag,HP as resolveEffectiveSearchMode,wA as resolveEmbeddingProviders,Ol as resolveExtensionInstallSourceIdentity,Cl as resolveExtensionMigrationStatePath,VC as resolveExtensionRoots,KO as resolveExternalDependencyReference,uC as resolveFlagValueKind,Ff as resolveGuideOutputFormat,Um as resolveHistoryEpisodeGroupIdentity,zT as resolveHistoryHashAlgorithm,aS as resolveHistoryOperation,aO as resolveHistoryProvenanceDimensions,vv as resolveHistorySubject,iA as resolveHistoryTarget,WP as resolveHybridSemanticWeight,cn as resolveImplicitPmRoot,sC as resolveIsoOrRelative,tR as resolveItemBlockers,YI as resolveItemExecutionRole,WM as resolveItemMutationDocument,an as resolveItemTypeRegistry,KT as resolveItemTypesFilePath,uf as resolveLinkedTestFailureExitCode,eu as resolveLinkedTestSourceRef,tu as resolveLinkedTestSourceWorkspaceRoot,iu as resolveLinkedTestTrust,su as resolveLinkedTestTrustBatch,yg as resolveMcpAcknowledgedSubscriptionFilter,tt as resolveMcpRequestContext,nl as resolveMergeInstallContext,_R as resolveMissingMetadataFilters,xM as resolveMissingOptionPlaceholder,SS as resolveModePairedOutputOmissionReceipt,cP as resolveNextOutputFormat,AS as resolveOutputOmissionReceipt,CC as resolvePmCliVersion,Ho as resolvePmCommandAlias,Ze as resolvePmCommandCapabilityFamily,Kt as resolvePmCommandExitContract,L as resolvePmCommandOperation,Di as resolvePmCommandOutputBudget,cr as resolvePmCommandOutputEnvelope,cv as resolvePmCommandPositionalContract,Qe as resolvePmCommandVisibilityTier,Fi as resolvePmDiagnosticOutputBudget,wM as resolvePmErrorCodeContract,wb as resolvePmFlagSemanticConcept,Fe as resolvePmHistoryOperation,bC as resolvePmPackageRootFromModule,dv as resolvePmPositionalActionContract,Mc as resolvePmPositionalActionFlagContracts,Ge as resolvePmRoot,Nc as resolvePmToolCustomFieldCollision,jE as resolvePriority,Zt as resolveProfile,al as resolveProjectMergeTypeFolders,xS as resolveQueryCursorStart,ww as resolveReadOutputDimensions,Ow as resolveReadOutputEncoding,VS as resolveReadOutputRecoveryBudget,yw as resolveReadOutputSurface,ES as resolveReadRowContract,kM as resolveRecoveryCommandName,TT as resolveRegisteredSearchProvider,ST as resolveRegisteredVectorStoreAdapter,_s as resolveReproducibleProcessEnvironment,wn as resolveRuntimeFieldRegistry,Sn as resolveRuntimeStatusRegistry,EA as resolveSearchCorpusFields,VP as resolveSearchMaxResults,zP as resolveSearchPage,KP as resolveSearchScoreThreshold,XP as resolveSearchTuning,vA as resolveSemanticCorpusCharacterLimit,Iu as resolveSemanticLineageIds,tA as resolveSettingsWithSemanticRuntimeDefaults,nI as resolveSourceContextWritePolicy,Op as resolveStartTaskInProgressStatus,re as resolveSubcommandFlagContractsForCommand,eC as resolveTelemetryErrorCategory,mP as resolveTerminalReason,vC as resolveTypeDefinition,AC as resolveTypeName,BE as resolveTypeSynonym,XE as resolveTypeWorkflows,el as resolveUnknownAuthorAcknowledgmentSelector,ZP as resolveVectorIndexRecovery,RA as resolveVectorStores,td as resolveWorkspaceRelationshipKindRegistry,RC as resolveWorkspaceRoot,th as restore,lC as restoreCheckpointItems,xE as restoreWorkspaceJsonFromHistory,hm as restoreWorkspaceSnapshot,_m as restoreWorkspaceSnapshotWithRecovery,Ah as runAction,pT as runActiveBeforeMutationHooks,fT as runActiveCommandHandler,mT as runActiveOnIndexHooks,Cn as runActiveOnReadHooks,bn as runActiveOnWriteHooks,_T as runActiveParserOverride,hT as runActivePreflightOverride,gT as runActiveServiceOverride,ed as runActivity,zC as runAfterCommandHooks,pu as runAggregate,Tu as runAnnotationCommand,mu as runAppend,OR as runAssuranceAction,IR as runAssuranceDispatch,qC as runBeforeCommandHooks,Ou as runCalendar,Qu as runClaim,ep as runClaimNext,op as runClose,kp as runCloseMany,Pp as runCloseTask,xp as runComments,Uf as runCompletion,Vp as runConfig,Ht as runContext,BR as runContextEvaluationCorpus,GR as runContextEvaluationScenario,Gp as runCopy,Ap as runCreate,Up as runDelete,hd as runDeps,Kl as runDocs,RM as runDuplicates,im as runEval,am as runEvent,Il as runExtension,El as runExtensionMigrateAction,wl as runExtensionMigrations,Yl as runFiles,Zl as runFilesDiscover,Jl as runFilesLookup,Jm as runFleetAttributionAnalytics,Bp as runFocus,zp as runGc,qp as runGet,Xd as runGraph,jf as runGuide,Rl as runHealth,vP as runHistory,MP as runHistoryAttest,mM as runHistoryCompact,hM as runHistoryCompactBulk,UI as runHistoryMaintenance,pM as runHistoryRedact,qI as runHistoryRepair,VI as runHistoryRepairAll,Zp as runInit,Xp as runInitAgentGuidance,Np as runLearnings,Vl as runLinkedArtifacts,pf as runLinkedTests,uu as runList,sm as runMeet,rM as runMergeDriver,ll as runMergeInstall,xI as runMergeReceiptEvidenceReport,kI as runMergeReceiptReport,oM as runMergeReconcile,Ju as runNext,Lp as runNotes,Rp as runPauseTask,jp as runPlan,vm as runProfileApply,Am as runProfileLint,wm as runProfileList,Em as runProfileShow,Xm as runProvenanceCoverageAnalytics,fk as runRegisteredCommandForTest,bk as runRegisteredCommandOverrideForTest,vk as runRegisteredExporterForTest,hk as runRegisteredHookForTest,Ak as runRegisteredImporterForTest,Ek as runRegisteredMigrationForTest,_k as runRegisteredMutationGuardForTest,gk as runRegisteredParserOverrideForTest,yk as runRegisteredPreflightOverrideForTest,Ck as runRegisteredRendererOverrideForTest,Sk as runRegisteredSearchProviderForTest,Tk as runRegisteredServiceOverrideForTest,wk as runRegisteredVectorStoreAdapterForTest,dr as runReindex,tp as runRelease,cm as runRemind,gM as runReopen,Mp as runRestore,fl as runSchemaEvolutionMigration,om as runSearch,gy as runSearchRefreshWorkerEntrypoint,Bf as runStartBackgroundRun,Ip as runStartTask,of as runStats,sf as runTelemetry,Tm as runTemplatesList,Cm as runTemplatesSave,Sm as runTemplatesShow,mf as runTest,ff as runTestAll,qf as runTestRunsList,Vf as runTestRunsLogs,Kf as runTestRunsResume,zf as runTestRunsStatus,Hf as runTestRunsStop,Wf as runTestRunsWorker,vp as runUpdate,Dp as runUpdateMany,Wt as runUpgrade,lu as runValidate,Eh as runWithActiveExtensions,$ as runWithAgentSessionContext,Uw as runWithContextIntentContracts,rO as runWithDiscoveredContextIntentContracts,Vn as runWithHarnessDetectionSignals,U0 as runWithMcpTraceContext,gs as runWithReproducibleProcessEnvironment,Hn as runWithWorkspaceHarnessSignalDescriptors,Zr as runWithWorkspaceRecipe,fI as runWorkflowPolicyAction,FP as runWorkspaceTransactionGc,Hd as saveGraphAuditBaseline,ZO as scanExtensionHostVersions,Zd as scanHistoryAuthorAttribution,Rn as scanItemFormatVersions,ts as scanMutationSecrets,gI as scanProvenanceResolverHealth,ms as scanStaleInProgressItems,XI as scanStorageIntegrity,h_ as schema,w_ as schemaAddField,T_ as schemaAddStatus,b_ as schemaAddType,O_ as schemaApplyPreset,I_ as schemaInferTypes,g_ as schemaList,A_ as schemaListFields,M_ as schemaRemapStatus,E_ as schemaRemoveField,S_ as schemaRemoveStatus,C_ as schemaRemoveType,P_ as schemaRenameField,R_ as schemaRenameType,y_ as schemaShow,v_ as schemaShowField,k_ as schemaShowStatus,GM as scoreCommandPathMatch,DR as scoreContextCandidates,$R as scoreContextCandidatesWithActiveExtensions,ls as scoreItemSimilarity,YN as scorePmGrammarRefusalClosure,jN as scorePmRefusalClosure,us as scorePreparedItemSimilarity,QN as scoreTrackerPreflightRecoveryClosure,aE as sealHistoryRecord,c0 as sealMcpRequestState,Zf as search,sP as searchWorkspaceMemory,aP as searchWorkspaceMemoryReadResult,oR as selectActionableEntries,OS as selectCursorSemanticOptions,Nf as selectImportAuthor,D0 as selectMcpClientRegistrationMode,iP as selectWorkspaceMemory,nP as selectWorkspaceMemoryRollups,xu as semanticAttributionAffinity,HA as sentryCaptureCliError,VA as sentryFinishCommandSpan,WA as sentryFlush,KA as sentryLogCliUsageError,qA as sentrySetCommandContext,zA as sentryStartCommandSpan,xn as serializeItemDocument,zM as serializeNdjsonRows,VM as serializeNdjsonStream,sy as serveDeclaredObservation,iT as setActiveCommandContext,sT as setActiveCommandResult,ZC as setActiveExtensionCommands,JC as setActiveExtensionHooks,QC as setActiveExtensionParsers,eT as setActiveExtensionPreflight,oT as setActiveExtensionRegistrations,rT as setActiveExtensionRenderers,tT as setActiveExtensionServices,uS as setFocusedItem,tv as shouldCompletePlanOnClose,zd as shouldPersistDurableGraphCache,NT as shouldResolveMutationStdinTokenField,xT as shouldResolveMutationStdinTokens,oA as shouldRunSearchRefreshInForeground,ip as similarityAdvisoryWarnings,DS as sliceReadOutputRowCollection,Bl as sortLinkedArtifacts,wT as splitAcceptanceCriteria,ZA as splitCommaList,kn as splitFrontMatter,Ew as stabilizeReadOutputReceiptEstimates,P as stableStringify,BC as stableValueEquals,oh as startTask,ov as startTelemetryCommand,r_ as stats,XT as statusIsTerminal,Ih as stripGlobalBootstrapTokens,sM as subscribeMutationEventBatches,aM as subscribeMutationEvents,jP as summarizeAgentIdentityVocabulary,qm as summarizeAgentModelProvenance,zm as summarizeAgentProvenance,UR as summarizeContextEvaluationReports,af as summarizeContextPreflight,pO as summarizeHistoryProvenance,Yp as summarizeInitResult,II as summarizeMergeReceipt,bP as supportsCreateExplicitEmpty,PM as supportsItemIdAlias,gC as suppressHostOutput,Me as syncRelationshipGraphAdapter,ck as synthesizeExtensionManifest,kc as toCompletionFlagString,Hu as toContextFocusItem,qu as toContextPackingSummary,zu as toContextRankingSummary,rC as toErrorMessage,bf as toEstimatedMinutesValue,Bv as toExtensionFlagDefinitions,Ef as toImportBoolean,If as toImportConfidence,wf as toImportInteger,kf as toImportLinkedDocs,Mf as toImportLinkedFiles,xf as toImportLinkedTests,Pf as toImportLogEntries,Rf as toImportNormalizedEnum,Of as toImportNumberMap,Cf as toImportPriority,Sf as toImportStatus,Af as toImportStringList,vf as toImportStringMap,Tf as toImportTags,tS as toItemRecord,yf as toNonEmptyImportString,tC as toNonEmptyStringOrUndefined,hE as toReplayDocument,cs as tokenizeSimilarityText,kT as transferMutationStdinTokenPolicy,MC as translateHostEnvironmentFault,K_ as update,Th as upgrade,F_ as validate,wO as validateAssertionDefinition,AO as validateAssuranceDocument,EO as validateGateDefinition,YM as validateItemMutationRows,zl as validateLinkedPaths,$0 as validateMcpAuthorizationResponseIssuer,L0 as validateMcpAuthorizationServerMetadata,F0 as validateMcpClientMetadataDocument,O0 as validateMcpHttpRequestHeaders,p0 as validateMcpJsonSchema,SO as validateMeasurementDefinition,$E as validateMissingParentReference,bw as validateReadOutputOptions,GE as validateSprintOrReleaseValue,IC as validateTypeOptions,PP as verifyAttestation,bM as verifyCliFlagInvocationParity,pv as verifyExplicitPositionalSlotCensus,bE as verifyHistoryChain,yE as verifyHistoryChainWithVersion,Ov as verifyHistoryEntries,cE as verifyHistoryRecordHash,lE as verifyHistoryRewriteEvidence,hv as verifyPmCliGrammar,_v as verifyPmCommandPositionalContracts,sL as verifyPmFlagLexicon,PN as verifyPmRecoveryKindRuntimeCoverage,mb as verifyPmRecoveryProducerRuntimeCoverage,RN as verifyPmRecoveryReferences,NN as verifyPmRefusalClosureIdentityRatchet,xN as verifyPmRefusalClosureRatchet,IN as verifyPmRefusalReachability,xs as verifyToolOptionCliParity,Js as withFlagAliasMetadata,kC as withHostEnvironmentBoundary,u0 as withMcpCachePolicy,QS as workflowApprovalFingerprint,ew as workflowPolicyApplies,ZS as workflowPolicyFingerprint,fd as workspaceGraphCache,Cu as wrapOwnershipConflict,jM as wrapThrownErrorForSentry,Yn as writeAuthorEnvironment,je as writeFileAtomic,cC as writeMutationCheckpoint,eA as writeSettings,Jw as writeStderr,Yw as writeStdout,jA as writeVectorizationStatusLedger,ME as writeWorkspaceJsonWithHistory};
30
+ `&&t.push(r+1);return t}function pb(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 ON(e){let t=[],r=[];for(let n of[...e].sort((i,s)=>te(i.path,s.path))){let i=ub(n.content),s;try{s=lb(n.content)}catch(a){r.push({kind:"invalid_source",subject:n.path,detail:`${n.path} could not be parsed for recovery producers: ${String(a)}.`});continue}for(let a of s){let c=a.field,d=pb(i,a.offset),l=bo(c);l?t.push({path:n.path,line:d,field:c,kind:l.kind}):/(?:retry_command|candidate_command|fallback_candidate|next_best_command|example|next_step|migration_hint|restore_with)/u.test(c)&&!/(?:_total|_truncated)$/u.test(c)&&r.push({kind:"unknown_recovery_field",subject:`${n.path}:${d}:${c}`,detail:`${c} resembles a recovery reference but has no typed field contract.`})}}let o=Object.fromEntries(ue.map(n=>[n,t.filter(i=>i.kind===n).length]));for(let n of ue)o[n]===0&&r.push({kind:"missing_kind_producer",subject:n,detail:`No source producer emits the ${n} recovery-reference kind.`});return t.sort((n,i)=>n.path!==i.path?te(n.path,i.path):n.line!==i.line?n.line-i.line:te(n.field,i.field)),r.sort((n,i)=>n.subject!==i.subject?te(n.subject,i.subject):te(n.kind,i.kind)),{ok:r.length===0,scanned_file_count:e.length,producer_count:t.length,producer_count_by_kind:o,producers:t,findings:r}}function IN(e,t){let r=[],o=(n,i)=>{if(Array.isArray(n)){n.forEach((s,a)=>o(s,[...i,String(a)]));return}if(!(typeof n!="object"||n===null))for(let[s,a]of Object.entries(n).sort(([c],[d])=>te(c,d))){let c=bo(s),d=c?.kind==="migration_hint"&&n.semantics==="behavior_preserving"?{...c,semantics:"behavior_preserving"}:c,l=[a].flat();d!==void 0&&l.forEach((u,f)=>{let g="nested_value_field"in d&&typeof d.nested_value_field=="string"?d.nested_value_field:void 0,h=g&&typeof u=="object"&&u!==null&&!Array.isArray(u)?u[g]:u;if(typeof h!="string"||h.trim().length===0)return;let C=[...i,s,String(f)].map(S=>encodeURIComponent(S)).join("/");r.push({id:`${e}:${d.kind}:${C}`,probe_id:e,kind:d.kind,semantics:d.semantics,value:h})}),o(a,[...i,s])}};return o(t,[]),r}function RN(e,t){let r=e.flatMap(s=>(s.owned_states??[]).map(a=>({contract:s,state:a}))),o=[],n=new Map;for(let s of t){if(n.has(s.probe_id)){o.push({kind:"duplicate_probe",probe_id:s.probe_id,detail:`Observation ${s.probe_id} was supplied more than once.`});continue}n.set(s.probe_id,s)}let i=new Set(r.map(({state:s})=>s.probe_id));for(let{contract:s,state:a}of r){let c=n.get(a.probe_id);if(!c){o.push({kind:"missing_probe",probe_id:a.probe_id,detail:`No entrypoint observation was recorded for ${s.code}.`});continue}c.code!==s.code&&o.push({kind:"wrong_error_code",probe_id:a.probe_id,detail:`Expected ${s.code}; observed ${c.code}.`}),c.exit_class!==a.expected_exit_class&&o.push({kind:"wrong_exit_class",probe_id:a.probe_id,detail:`Expected ${a.expected_exit_class}; observed ${c.exit_class}.`}),a.entrypoints.includes(c.entrypoint)||o.push({kind:"wrong_entrypoint",probe_id:a.probe_id,detail:`Expected one of ${a.entrypoints.join(", ")}; observed ${c.entrypoint}.`})}for(let s of t)i.has(s.probe_id)||o.push({kind:"undeclared_probe",probe_id:s.probe_id,detail:`Observation ${s.probe_id} has no catalog declaration.`});return o.sort((s,a)=>s.probe_id!==a.probe_id?s.probe_id.localeCompare(a.probe_id):s.kind.localeCompare(a.kind)),{ok:o.length===0,declared_probe_count:r.length,observed_probe_count:t.length,findings:o}}function PN(e,t){let r=[],o=new Set,n=new Set;for(let c of e){if(o.has(c.id)){n.add(c.id),r.push({kind:"duplicate_obligation",reference_id:c.id,detail:`Recovery obligation ${c.id} was declared more than once.`});continue}o.add(c.id)}let i=new Map;for(let c of t){if(i.has(c.id)){r.push({kind:"duplicate_observation",reference_id:c.id,detail:`Recovery reference ${c.id} was observed more than once.`});continue}i.set(c.id,c),o.has(c.id)||r.push({kind:"undeclared_observation",reference_id:c.id,detail:`Recovery observation ${c.id} has no emitted obligation.`})}for(let c of e){if(n.has(c.id))continue;let d=i.get(c.id);d?d.reachable?d.semantics!==c.semantics&&r.push({kind:"wrong_semantics",reference_id:c.id,detail:`Recovery reference ${c.value} promised ${c.semantics}; proof demonstrated ${d.semantics}.`}):r.push({kind:"unreachable_reference",reference_id:c.id,detail:`Recovery reference ${c.value} did not reach its promised target.`}):r.push({kind:"missing_observation",reference_id:c.id,detail:`No reachability proof was recorded for ${c.kind} ${c.value}.`})}let s=ue.map(c=>{let d=e.filter(u=>u.kind===c),l=d.filter(u=>!n.has(u.id)).map(u=>i.get(u.id)).filter(u=>u!==void 0);return{kind:c,declared:d.length,observed:l.length,passed:d.filter(u=>{let f=i.get(u.id);return!n.has(u.id)&&f?.reachable===!0&&f.semantics===u.semantics}).length}});r.sort((c,d)=>c.reference_id!==d.reference_id?c.reference_id.localeCompare(d.reference_id):c.kind.localeCompare(d.kind));let a=s.reduce((c,d)=>c+d.passed,0);return{ok:r.length===0,declared_reference_count:e.length,observed_reference_count:t.length,pass_fraction:o.size===0?1:a/o.size,coverage_by_kind:s,findings:r}}function mb(e,t){let r=new Map(ue.map(i=>[i,new Set]));for(let i of t)r.get(i.kind).add(i.value);let o=ue.map(i=>({kind:i,source_producers:e.producer_count_by_kind[i],runtime_values:r.get(i).size})),n=o.filter(({source_producers:i,runtime_values:s})=>i>0&&s===0).map(({kind:i})=>i);return{ok:e.ok&&n.length===0,source_producer_count:e.producer_count,runtime_value_count:o.reduce((i,{runtime_values:s})=>i+s,0),coverage_by_kind:o,missing_runtime_kinds:n}}var MN=mb;(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="ae22de89-8bac-5728-a6e2-29b342383abe")}catch{}})();var xN=16,fb=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,To=Object.freeze([...fb,"manifest_unknown_key","no_version_bounds_declared"].sort((e,t)=>e.localeCompare(t)));function NN(e,t=Co){return{ok:e.executable_error_code_count>=t,baseline:t,actual:e.executable_error_code_count}}function LN(e,t=To){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 St(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 DN(e,t,r){let o=new Map(e.map(l=>[l.code,l.canonical_code??l.code])),n=new Map,i=0,s=0;for(let l of e){let u=St(n,l.canonical_code??l.code);for(let f of l.owned_states??[])u.kinds.add("owned_state"),u.probeIds.add(f.probe_id)}for(let l of t){let u=o.get(l.error_code);if(u===void 0)continue;i+=1;let f=St(n,u);f.kinds.add("closed_domain"),f.probeIds.add(l.probe_id)}for(let l of r){let u=o.get(l.error_code);if(u===void 0)continue;s+=1;let f=St(n,u);f.kinds.add("grammar"),f.probeIds.add(l.probe_id)}let a=e.map(l=>{let u=l.canonical_code??l.code,f=n.get(u),g=[...f.probeIds].sort();return{code:l.code,canonical_code:u,disposition:g.length>0?"executable":"uncovered",evidence_kinds:[...f.kinds].sort(),probe_ids:g}}).sort((l,u)=>l.code<u.code?-1:1),c=a.filter(({disposition:l})=>l==="uncovered").map(({code:l})=>l),d=a.length-c.length;return{ok:c.length===0,catalog_error_code_count:a.length,executable_error_code_count:d,uncovered_error_code_count:c.length,coverage_fraction:a.length===0?1:d/a.length,closed_domain_probe_count:i,grammar_probe_count:s,uncovered_error_codes:c,rows:a}}function $N(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: ${To.map(r=>`\`${r}\``).join(", ")}`,`- Uncovered error codes: ${e.uncovered_error_code_count}`,`- Coverage fraction: ${e.coverage_fraction.toFixed(6)}`,`- Closed-domain probes: ${e.closed_domain_probe_count}`,`- Grammar probes: ${e.grammar_probe_count}`,"","| Error code | Canonical code | Disposition | Evidence kinds | Probe count |","| --- | --- | --- | --- | --- |",...t,""].join(`
31
+ `)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="6ecdd8cf-3153-5ed9-abd4-e8a73da6662a")}catch{}})();function _b(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 hb(e){return[e.exit_code!==D.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 ${D.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."},..._b(e)]}function GN(e){let t=[],r=new Set,o=0;e.length===0&&t.push({code:"empty_corpus",probe_id:"corpus",detail:"At least one real refusal observation is required."});for(let n of e){if(r.has(n.probe_id)){t.push({code:"duplicate_probe",probe_id:n.probe_id,detail:`${n.probe_id} was supplied more than once.`});continue}r.add(n.probe_id);let i=t.length;for(let s of hb(n))s!==void 0&&t.push(s);t.length===i&&(o+=1)}return t.sort((n,i)=>n.probe_id!==i.probe_id?n.probe_id.localeCompare(i.probe_id):n.code.localeCompare(i.code)),{ok:t.length===0,probe_count:r.size,closed_probe_count:o,closure_fraction:r.size===0?0:o/r.size,findings:t}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="41d33f0e-f925-54da-a75d-52a73dd76f38")}catch{}})();var So="not-a-declared-action";function gb(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 pe(e){return e.replaceAll(/[^a-z0-9]+/gu,"-").replaceAll(/^-|-$/gu,"")}function XN(e=He.filter(t=>Ft.some(r=>r.command===t.command&&r.disposition!=="package_owned"))){let t=new Set(e.filter(({command:r})=>!r.includes(" ")).map(({command:r})=>pe(r)));return e.flatMap(r=>r.slots.flatMap((o,n)=>{if(!o.required)return[];let i=r.command.split(" "),s=pe(r.command),a=i.length>1&&t.has(s)?i.map(pe).join("--"):s,c=re(r.command).flatMap(l=>l.required?[l.flag,...l.value_name?["example"]:[]]:[]),d=Ve.some(l=>l.command===r.command);return[{probe_id:`required-argument-${a}-${pe(o.name)}`,command:r.command,refusal_args:[...i,...r.slots.slice(0,n).map(l=>gb(r.command,l)),...c],recovery_args:[...i,"--help"],error_code:d&&!r.command.startsWith("assurance ")?"invalid_argument_value":/^extension (?:activate|adopt|deactivate|uninstall)$/u.test(r.command)?"missing_lifecycle_target":"missing_required_argument",missing_argument:o.name,missing_argument_index:n}]})).sort((r,o)=>r.probe_id.localeCompare(o.probe_id))}function yb(e){switch(L(e)){case"assurance":case"workspace snapshot":return Ve.filter(({parent:t})=>t===e).map(({action:t})=>t);case"graph":return qe;case"merge":return ze;case"plan":return Ye;case"profile":return Je;case"schema":return Gt;default:throw new Error(`Required positional action family ${e} has no authoritative value domain.`)}}function YN(e=He){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-${pe(t)}`,command:t,refusal_args:[...r,So],recovery_args:[...r,"--help"],error_code:"unknown_subcommand",rejected_value:So,allowed_values:[...yb(t)].sort()}}).sort((t,r)=>t.probe_id.localeCompare(r.probe_id))}function bb(e,t){let r=[...t].sort();return e.length===t.length&&[...e].sort().every((o,n)=>o===r[n])}function Cb(e,t){if(!t)return[{code:"refusal_probe_missing",probe_id:e.probe_id,detail:`${e.probe_id} has no runtime observation.`}];let r=[];return t.error_code!==e.error_code&&r.push({code:"refusal_error_code_mismatch",probe_id:e.probe_id,detail:`${e.probe_id} emitted ${t.error_code||"<none>"}; expected ${e.error_code}.`}),t.exit_code!==2&&r.push({code:"refusal_exit_code_mismatch",probe_id:e.probe_id,detail:`${e.probe_id} exited ${t.exit_code}; expected usage exit 2.`}),"allowed_values"in e&&!bb(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 JN(e,t){let r=new Map(e.map(s=>[s.probe_id,s])),o=new Map(t.map(s=>[s.probe_id,s])),n=[...e.flatMap(s=>Cb(s,o.get(s.probe_id))),...t.filter(s=>!r.has(s.probe_id)).map(s=>({code:"unexpected_refusal_probe",probe_id:s.probe_id,detail:`${s.probe_id} has no declared grammar refusal contract.`}))];n.sort((s,a)=>s.probe_id.localeCompare(a.probe_id)||s.code.localeCompare(a.code));let i=new Set(n.map(({probe_id:s})=>s));return{ok:n.length===0,probe_count:e.length,closed_probe_count:e.filter(({probe_id:s})=>!i.has(s)).length,findings:n}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="5053cc84-63e5-50d3-9a4c-00c2a485ed69")}catch{}})();var wt=[{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 QN(){return wt.map(e=>({...e}))}function Tb(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 eL(e){let t=new Map(e.map(n=>[n.probe_id,n])),r=[],o=0;for(let n of wt){let i=t.get(n.probe_id);if(i===void 0){r.push({code:"missing_probe",probe_id:n.probe_id,detail:"No runtime observation was supplied for this contract."});continue}let s=Tb(n,i);r.push(...s),s.length===0&&(o+=1)}return r.sort((n,i)=>n.probe_id.localeCompare(i.probe_id)||n.code.localeCompare(i.code)),{ok:r.length===0,probe_count:wt.length,closed_probe_count:o,findings:r}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="3bb9b0da-78ce-5793-96e2-2de27b8f18fa")}catch{}})();var xe,Sb=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 wb(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=Sb[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 Ne(){if(xe!==void 0)return xe;let t=oe.filter(({command:i})=>Ke(i)).flatMap(({command:i,family:s})=>sr(i,re(i)).map(a=>({command:i,family:s,concept:wb(i,a.flag),flag:a.flag,aliases:Object.freeze([...a.aliases??[]]),value_kind:a.repeatable?"list":a.flag==="--limit"?"number":a.value_type}))),r=new Set(t.flatMap(i=>i.aliases.map(s=>`${i.command}:${s}`))),o=t.filter(i=>!r.has(`${i.command}:${i.flag}`)),n=new Map;for(let i of o){let s=n.get(i.concept)??new Set;s.add(i.value_kind),n.set(i.concept,s)}return xe=Object.freeze(o.map(i=>Object.freeze({...i,concept:n.get(i.concept)?.size===1?i.concept:`${i.concept}@${i.command}`}))),xe}function sL(){return Object.freeze(Ne().map(e=>Object.freeze({command:e.command,canonical_flag:e.flag,accepted_spellings:Object.freeze([...new Set([e.flag,...e.aliases])].sort())})))}var wo=Object.freeze({init:30,item:20,config:36,extension:54,package:55,packages:55,install:27,upgrade:29,create:100,copy:24,focus:22,list:86,"list-all":86,"list-draft":84,"list-open":84,"list-in-progress":84,"list-blocked":84,"list-closed":84,"list-canceled":84,aggregate:40,context:45,ctx:45,get:30,graph:34,search:78,duplicates:25,eval:25,next:38,history:35,events:33,"history-attest":23,"history-redact":27,"history-repair":27,"history-compact":30,"history-author-acknowledge":28,merge:27,schema:43,profile:22,activity:35,restore:23,update:105,"update-many":146,close:32,"close-many":72,delete:24,append:25,comments:31,notes:35,learnings:31,files:39,docs:30,deps:32,plan:109,test:53,"test-all":40,telemetry:21,stats:29,health:36,validate:46,assurance:30,gc:22,workspace:23,contracts:29,claim:39,release:24,"start-task":23,"pause-task":23,"close-task":24,meet:33,event:33,remind:29,"test-runs-worker":20}),Eo=Object.freeze({...wo,...Object.fromEntries($e.flatMap(({alias:e,canonical:t})=>{let r=wo[e];return r===void 0?[]:[[t,r]]}))});function Ao(){let e=new Map(Object.keys(Eo).map(t=>[t,0]));for(let{command:t}of Ne())e.set(t,Number(e.get(t))+1);return Object.freeze(Object.entries(Eo).map(([t,r])=>Object.freeze({command:t,current:Number(e.get(t)),maximum:r})))}function Eb(e,t,r){for(let o of e)for(let n of o.aliases){let i=t.get(`${o.command}:${n}`);i===void 0||i.flag===o.flag||r.push({code:"alias_collision",command:o.command,detail:`${n} aliases ${o.flag} but is canonical for ${i.flag}.`})}}function Ab(e,t,r){let o=new Set(t.map(({command:n})=>n));for(let n of e.keys())o.has(n)||r.push({code:"missing_budget",command:n,detail:`${n} has canonical flags but no persisted budget.`});for(let n of t){let i=e.get(n.command)??0;i===0&&r.push({code:"stale_budget",command:n.command,detail:`${n.command} has a persisted budget but no canonical flags.`}),!(i<=n.maximum)&&r.push({code:"budget_exceeded",command:n.command,detail:`${i} canonical flags exceed the ratcheted maximum ${n.maximum}.`})}}function vb(e,t,r){let o=new Map(e.map(n=>[`${n.command}:${n.flag}`,n]));for(let n of t){let i=`${n.command}:${n.canonical_flag}`,s=o.get(i);if(!s){r.push({code:"removed_canonical_spelling",command:n.command,detail:`${n.canonical_flag} disappeared from the executable spelling inventory.`});continue}let a=new Set([s.flag,...s.aliases]);for(let c of n.accepted_spellings)a.has(c)||r.push({code:"removed_compatibility_spelling",command:n.command,detail:`${c} no longer resolves to ${n.canonical_flag}.`})}}function aL(e=Ne(),t=Ao(),r=[]){let o=[],n=new Map,i=new Map,s=new Map,a=new Map;for(let c of e){let d=`${c.command}:${c.flag}`;n.has(d)?o.push({code:"duplicate_canonical_flag",command:c.command,detail:`${c.flag} has more than one canonical row.`}):n.set(d,c),a.set(c.command,(a.get(c.command)??0)+1);let l=i.get(c.concept);l!==void 0&&l!==c.value_kind?o.push({code:"inconsistent_concept_kind",command:c.command,detail:`${c.concept} uses both ${l} and ${c.value_kind}.`}):i.set(c.concept,c.value_kind);let u=s.get(c.concept);u!==void 0&&u!==c.flag?o.push({code:"semantic_spelling_collision",command:c.command,detail:`${c.concept} is canonicalized by both ${u} and ${c.flag}.`}):s.set(c.concept,c.flag)}return Eb(e,n,o),Ab(a,t,o),vb(e,r,o),o.sort((c,d)=>c.command.localeCompare(d.command)||c.code.localeCompare(d.code)||c.detail.localeCompare(d.detail)),{ok:o.length===0,entry_count:e.length,budget_count:t.length,concept_count:new Set(e.map(({concept:c})=>c)).size,baseline_entry_count:r.length,findings:o}}function cL(){let e=Ne(),t=Ao(),r=new Map(t.map(({command:n})=>[n,"unknown"]));for(let{command:n,family:i}of e)r.set(n,i);return["# Generated flag lexicon budgets","","This file is generated by `listPmFlagLexicon()`. Compatibility aliases do not consume canonical budget.","","| Command | Capability family | Canonical flags | Maximum |","| --- | --- | ---: | ---: |",...t.map(({command:n,current:i,maximum:s})=>{let a=r.get(n);return`| \`${n}\` | ${a} | ${i} | ${s} |`}),""].join(`
32
+ `)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="a169a68c-13d0-5a3a-b231-abdf1a34ef6a")}catch{}})();function lL(e){return e}function uL(e){return e}function pL(e){return e}function mL(e){return e}function fL(e){return e}function _L(e){return e}function hL(e){return e}function gL(e){return e}function yL(e){return e}function bL(e){return e}function CL(e){return e}function TL(e){return e}function SL(e){return e}function wL(e){return{handled:!0,result:e}}function EL(){return{handled:!1}}function AL(e){return e}function vL(e){return e}function OL(e){return e}function IL(e){return e}function RL(e){return e}function PL(e){return e}function ML(e){return e}function kL(e){return e}function xL(e){return e}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="14bbf3be-03a5-5ff3-888f-6e8b9a68ac73")}catch{}})();function Ob(e={},t={}){return new he(t).extension(void 0,{...e,migrate:!0})}function Ib(e={},t={}){return new he(t).packageMigrate(e)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="af4da99c-f557-5bf7-a439-c14878e4970d")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="ae8f06a0-a2e6-5f91-99f7-e822270b491d")}catch{}})();import{createHash as Oo,createHmac as Rb,randomBytes as Pb,timingSafeEqual as Mb}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="31eda153-a06e-51ef-a62f-f6dce09064d3")}catch{}})();var ID="dev.unbrained.pm/progressive-tool-discovery",RD=Object.freeze({version:1,discoveryTool:"pm_discover",canonicalResult:"structuredContent.result",compatibilityText:"pointer"}),kb=Object.freeze(["pm_discover","pm_next","pm_context","pm_search","pm_get"]),z=Object.freeze({lexical:.4,semantic:.2,graph:.1,permission:.15,freshness:.05,usage:.1}),xb=Object.freeze(["profile_changed","tool_contract_changed","workspace_extension_changed","authorization_changed","ranking_signal_changed","cursor_integrity_key_rotated"]),Io={core:0,standard:1,full:2,internal:3},Ro=Object.freeze(["core","standard","full"]),Nb=new Set(["core","standard","full","custom"]),Po=new Set(oe.map(({family:e})=>e)),Lb=Pb(32);function De(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 Mo(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 ko(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 xo(e){if(e!==void 0&&typeof e!="boolean")throw new b("pm tool discovery includeSchema must be a boolean.",64);return e===!0}function No(e){if(e===null||typeof e!="object"||Array.isArray(e))throw new b("pm tool discovery options must be an object.",64)}function Db(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 PD(e){if(No(e),e.family!==void 0&&(typeof e.family!="string"||!Po.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"||!Ro.includes(e.tier)))throw new b("pm tool discovery tier must be core, standard, or full.",64);return{...e.query!==void 0?{query:De(e.query,"query")}:{},...e.family!==void 0?{family:e.family}:{},...e.tier!==void 0?{tier:e.tier}:{},...e.limit!==void 0?{limit:Mo(e.limit)}:{},...e.cursor!==void 0?{cursor:De(e.cursor,"cursor")}:{},...e.includeSchema!==void 0?{includeSchema:xo(e.includeSchema)}:{},...e.outputBudget!==void 0?{outputBudget:ko(e.outputBudget)}:{}}}function $b(e){return e===void 0||!Number.isFinite(e)?0:Math.min(1,Math.max(0,e))}function me(e){return[...new Set(e.toLowerCase().match(/[a-z0-9]+/gu)??[])].sort()}function Fb(e,t){let r=me(e);if(r.length===0)return 0;let o=new Set(me(t)),n=r.filter(s=>o.has(s)).length,i=t.toLowerCase().includes(e.toLowerCase())?.25:0;return Math.min(1,n/r.length+i)}function jb(e,t){let r=me(e);if(r.length===0)return 0;let o=t.toLowerCase(),n=me(t),i=r.filter(a=>n.some(c=>c.startsWith(a)||a.startsWith(c))).length,s=o.includes(e.toLowerCase())?.2:0;return Math.min(1,i/r.length+s)}function vo(e){return Oo("sha256").update(JSON.stringify(e)).digest("hex").slice(0,24)}function Lo(e,t,r){return Rb("sha256",r).update(JSON.stringify({version:1,fingerprint:e,offset:t})).digest("base64url")}function Gb(e,t,r){let o={version:1,offset:t,signature:Lo(e,t,r)};return Buffer.from(JSON.stringify(o),"utf8").toString("base64url")}function Ub(e,t,r,o){if(e===void 0)return 0;try{let n=JSON.parse(Buffer.from(e,"base64url").toString("utf8"));if(n.version!==1||!Number.isInteger(n.offset)||(n.offset??-1)<0||Number(n.offset)>r||typeof n.signature!="string")throw new Error("cursor fields do not match the request");let i=Buffer.from(Lo(t,n.offset,o),"base64url"),s=Buffer.from(n.signature,"base64url");if(s.length!==i.length||!Mb(s,i))throw new Error("cursor signature does not match the request");return n.offset}catch(n){throw new b("Invalid or stale pm tool discovery cursor; restart discovery without cursor.",64,{reason:String(n)})}}function Et(e,t,r){return{value:$b(e),weight:t,available:r!=="unavailable",source:r}}function Le(e,t,r){return Et(e??t,r,e===void 0?"computed":"host")}function Bb(e,t,r){let o=Object.hasOwn(_e,e.name)?_e[e.name]:"help",n=Ze(o),i=`${e.name} ${e.description} ${o} ${n}`,s=Fb(t,i),a=new Set(me(t)),c={lexical:Et(s,z.lexical,"computed"),semantic:Le(e.signals?.semantic,jb(t,i),z.semantic),graph:Le(e.signals?.graph,a.has(n)||a.has(o)?1:0,z.graph),permission:Et(1,z.permission,"authorization"),freshness:Le(e.signals?.freshness,1,z.freshness),usage:Le(e.signals?.usage,kb.includes(e.name)?1:0,z.usage)},d=Object.values(c).reduce((l,u)=>l+u.value*u.weight,0);return{name:e.name,description:e.description,command:o,tier:Qe(o),family:n,score:Number(d.toFixed(6)),signals:c,...r?{input_schema:structuredClone(e.inputSchema)}:{}}}function qb(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"||!Ro.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"||!Po.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"||!Nb.has(e.profile)))throw new b("pm tool discovery profile must be core, standard, full, or custom.",64)}function zb(e){let r=De(e.query===void 0?"":e.query,"query").trim().replace(/\s+/gu," ");De(e.cursor===void 0?"":e.cursor,"cursor");let o=Mo(e.limit===void 0?10:e.limit),n=ko(e.outputBudget===void 0?1200:e.outputBudget);return qb(e),{query:r,includeSchema:xo(e.includeSchema),limit:o,budget:n,maximumTier:Io[e.tier??"full"],profile:e.profile===void 0?"core":e.profile}}function Do(e,t,r){let o=r??e.tools.reduce((s,a,c)=>s+(c===0?0:1)+Buffer.byteLength(JSON.stringify(a),"utf8"),0),n={...e,tools:[]},i=0;for(let s=0;s<4;s+=1){let a=Buffer.byteLength(JSON.stringify({...n,token_cost:{estimated_tokens:i,budget:t,within_budget:!0}}),"utf8"),c=Math.ceil((a+o)/4);if(c===i)break;i=c}return i}function Vb(e,t,r){return e.filter(o=>o.authorized!==!1).map(o=>Bb(o,r.query,r.includeSchema)).filter(o=>o.tier!=="internal"&&Io[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 Hb(e,t,r){if(t==="unbounded")return[...e];let o=[],n=0;for(let[i,s]of e.entries()){let a=n+(i===0?0:1)+Buffer.byteLength(JSON.stringify(s),"utf8");if(Do(r(i+1),t,a)>t)break;o.push(s),n=a}return o}function MD(e,t={}){Db(e),No(t);let r=zb(t),o=t.cursorIntegrityKey??Lb,n=Vb(e,t,r),i=vo({query:r.query,family:t.family??null,tier:t.tier??"full",includeSchema:r.includeSchema,profile:r.profile,ranked:n}),s=Ub(t.cursor,i,n.length,o),a=n.slice(s,s+r.limit),c=[];r.includeSchema||c.push({name:"input_schema",reason:"compact_projection",restore_with:"Set includeSchema=true."}),s+r.limit<n.length&&c.push({name:"tools",reason:"limit",restore_with:"Continue with next_cursor or increase limit."});let d={result_type:"pm_tool_discovery",contract_version:1,query:r.query,profile:r.profile,total:n.length,ranking_policy:{version:1,formula:"weighted_sum_then_name",weights:z},cache:{key:vo({fingerprint:i,cursorIntegrityKey:Oo("sha256").update(o).digest("hex"),limit:r.limit,offset:s,budget:r.budget}),ttl_ms:3e4,scope:"private",invalidates_on:xb}},l=(h,C=h.length)=>{let S=s+C,V=S<n.length,R=[...c];return C<a.length&&R.push({name:"tools",reason:"token_budget",restore_with:"Continue with next_cursor or increase outputBudget."}),{...d,tools:[...h],returned:C,has_more:V,...V?{next_cursor:Gb(i,S,o)}:{},omission_receipt:{has_omissions:R.length>0,omitted:R}}},u=h=>{let C=l(h),S=Do(C,r.budget);return{...C,token_cost:{estimated_tokens:S,budget:r.budget,within_budget:r.budget==="unbounded"||S<=r.budget}}},f=Hb(a,r.budget,h=>l([],h)),g=u(f);if(a.length>0&&f.length===0){let h=u([a[0]]).token_cost.estimated_tokens;throw new b(`pm tool discovery outputBudget is too small to return a tool; increase it to at least ${h}.`,64,{required:String(h)})}if(r.budget!=="unbounded"&&g.token_cost.estimated_tokens>r.budget)throw new b(`pm tool discovery outputBudget is too small; at least ${g.token_cost.estimated_tokens} estimated tokens are required for this page.`,64,{required:String(g.token_cost.estimated_tokens)});return g}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="87fb8085-4f16-58a9-9de7-c871fb90be5b")}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]="f5d5516b-01ec-51b3-a7a0-e611b4622581")}catch{}})();export{JI as ACTIONABILITY_ORDERING_KINDS,ws as ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS,yc as ACTIVITY_FLAG_CONTRACTS,Fn as AGENT_PROVENANCE_DIMENSIONS,ra as AGGREGATE_FLAG_CONTRACTS,Ba as APPEND_FLAG_CONTRACTS,AR as ASSURANCE_ACTIONS,vR as ASSURANCE_DECLARATION_KINDS,yO as ASSURANCE_DOCUMENT_VERSION,cc as ASSURANCE_FLAG_CONTRACTS,bO as ASSURANCE_GATE_TRIGGERS,CO as ASSURANCE_MEASUREMENT_SOURCE_KINDS,$O as ASSURANCE_PRESET_IDS,fO as AssuranceEvaluationRefusalError,mO as AssuranceMutationRefusalError,_O as AssuranceSourceResolutionError,En as BASELINE_ITEM_FORMAT_VERSION,Sy as BOUNDARY_FIXTURE_CAPTURE_SOURCES,lR as BRIEF_LIST_FIELDS,Gn as BUILTIN_AGENT_PROVENANCE_ADAPTERS,J as BUILTIN_CORPUS_SHAPES,jn as BUILTIN_HARNESS_SIGNAL_DESCRIPTORS,Qo as BUILTIN_ITEM_TYPE_VALUES,Yt as BUILTIN_PROFILES,xC as BUILTIN_RELATIONSHIP_KINDS,Cs as CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS,gc as CALENDAR_FLAG_CONTRACTS,qa as CLAIM_FLAG_CONTRACTS,Dc as CLOSE_ACTION_OPTION_KEYS,Ga as CLOSE_FLAG_CONTRACTS,Ua as CLOSE_MANY_FLAG_CONTRACTS,Xa as CLOSE_TASK_FLAG_CONTRACTS,oa as COMMENTS_FLAG_CONTRACTS,SC as COMMON_MUTATION_COMMAND_OPTION_KEYS,Pc as COMPLETION_FLAG_CONTRACTS,sn as CONFIDENCE_TEXT_VALUES,ya as CONFIG_FLAG_CONTRACTS,Ts as CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS,FR as CONTEXT_EVALUATION_METRIC_NAMES,Cc as CONTEXT_FLAG_CONTRACTS,Vt as CONTEXT_OUTPUT_VALUES,qR as CONTEXT_PACKING_PROFILES,PR as CONTEXT_RECENCY_EPOCH,NR as CONTEXT_RELEVANCE_SERVICE,kR as CONTEXT_RELEVANCE_SIGNAL_NAMES,HR as CONTEXT_SIGNAL_SET_VERSION,VR as CONTEXT_SIGNAL_STORE_FORMAT_VERSION,KR as CONTEXT_SIGNAL_STORE_WARNING_DETAILS,Iw as CONTEXT_USAGE_LIMITS,Rc as CONTRACTS_FLAG_CONTRACTS,mc as COPY_FLAG_CONTRACTS,Os as CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,Rs as CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,Is as CREATE_COMMANDER_STRING_OPTION_CONTRACTS,Jb as CREATE_DIRECT_CLOSE_REASON_DEFAULT,dc as CREATE_FLAG_CONTRACTS,qT as CURRENT_HISTORY_HASH_ALGORITHM,eE as CURRENT_HISTORY_ITEM_HASH_VERSION,rE as CURRENT_HISTORY_RECORD_HASH_VERSION,An as CURRENT_ITEM_FORMAT_VERSION,JR as ContextSignalStore,Rw as ContextUsageValidationError,sO as DEFAULT_AUTHOR_IDENTITY_VOCABULARY,xP as DEFAULT_CHILD_SAMPLE_LIMIT,dR as DEFAULT_COMPACT_LIST_FIELDS,mA as DEFAULT_DERIVED_INDEX_MINIMUM_ITEMS,nm as DEFAULT_EVAL_QUERIES_RELATIVE_PATH,pP as DEFAULT_TERMINAL_TRANSITION_POLICY,tP as DEFAULT_WORKSPACE_MEMORY_MINIMUM_ITEMS,bv as DEFECT_ESCAPE_CLASSES,Cv as DEFECT_GATE_EVIDENCE_DISPOSITIONS,Va as DELETE_FLAG_CONTRACTS,rn as DEPENDENCY_KIND_VALUES,wc as DEPS_FLAG_CONTRACTS,aa as DOCS_FLAG_CONTRACTS,ic as DUPLICATES_FLAG_CONTRACTS,NI as DURABLE_MERGE_RECEIPT_INTRODUCED_AT,Ac as EVAL_FLAG_CONTRACTS,em as EVAL_QUERY_SET_CONTRACT,tm as EVAL_QUERY_SET_EXAMPLE,Qp as EVAL_QUERY_SET_SCHEMA_ID,bc as EVENTS_FLAG_CONTRACTS,Ja as EVENT_FLAG_CONTRACTS,Vo as EXECUTABLE_COMMAND_ALIASES,D as EXIT_CODE,Ra as EXTENSION_ACTIVATE_FLAG_CONTRACTS,Ia as EXTENSION_ADOPT_ALL_FLAG_CONTRACTS,Da as EXTENSION_ADOPT_FLAG_CONTRACTS,$v as EXTENSION_CAPABILITIES,Xb as EXTENSION_CAPABILITY_CONTRACT,Kb as EXTENSION_CAPABILITY_CONTRACT_VERSION,Wb as EXTENSION_CAPABILITY_LEGACY_ALIASES,_n as EXTENSION_CAPABILITY_REGISTRATION_SURFACES,La as EXTENSION_CATALOG_FLAG_CONTRACTS,Pa as EXTENSION_DEACTIVATE_FLAG_CONTRACTS,Oa as EXTENSION_DESCRIBE_FLAG_CONTRACTS,Na as EXTENSION_DOCTOR_FLAG_CONTRACTS,va as EXTENSION_EXPLORE_FLAG_CONTRACTS,ba as EXTENSION_FLAG_CONTRACTS,Ta as EXTENSION_INIT_FLAG_CONTRACTS,Ea as EXTENSION_INSTALL_FLAG_CONTRACTS,ka as EXTENSION_MANAGE_FLAG_CONTRACTS,Ma as EXTENSION_MIGRATE_FLAG_CONTRACTS,Fv as EXTENSION_POLICY_MODES,jv as EXTENSION_POLICY_SURFACES,xa as EXTENSION_RELOAD_FLAG_CONTRACTS,Uv as EXTENSION_SANDBOX_PROFILES,Ca as EXTENSION_SCOPE_FLAG_CONTRACTS,Gv as EXTENSION_TRUST_MODES,Aa as EXTENSION_UNINSTALL_FLAG_CONTRACTS,VO as EXTERNAL_DEPENDENCY_RESOLUTION_STATUSES,qO as EXTERNAL_DEPENDENCY_SOURCE_KIND,zO as EXTERNAL_DEPENDENCY_SOURCE_KIND_ALIAS,sa as FILES_FLAG_CONTRACTS,fc as FOCUS_FLAG_CONTRACTS,oc as GC_FLAG_CONTRACTS,mR as GET_DEPTH_VALUES,Tc as GET_FLAG_CONTRACTS,ea as GLOBAL_FLAG_CONTRACTS,$d as GRAPH_DURABLE_CACHE_MIN_ITEMS,Dd as GRAPH_DURABLE_CACHE_VERSION,Ec as GRAPH_FLAG_CONTRACTS,qe as GRAPH_SUBCOMMAND_VALUES,Sc as GUIDE_FLAG_CONTRACTS,sc as HEALTH_FLAG_CONTRACTS,pa as HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS,QO as HISTORY_AUTHOR_ATTRIBUTION_BASELINE,fM as HISTORY_COMPACT_BULK_DEFAULT_MIN_ENTRIES,ma as HISTORY_COMPACT_FLAG_CONTRACTS,ei as HISTORY_EVENT_CLASSIFICATION_VERSION,ca as HISTORY_FLAG_CONTRACTS,UT as HISTORY_HASH_ALGORITHMS,Pe as HISTORY_ITEM_HASH_VERSION_3_INTRODUCED_IN,la as HISTORY_REDACT_FLAG_CONTRACTS,ua as HISTORY_REPAIR_FLAG_CONTRACTS,Kp as INIT_AGENT_GUIDANCE_MODE_VALUES,ga as INIT_FLAG_CONTRACTS,$a as INSTALL_FLAG_CONTRACTS,nn as ISSUE_SEVERITY_VALUES,uc as ITEM_COMPLETE_FLAG_CONTRACTS,AI as ITEM_LATEST_TIMESTAMP_FIELDS,Yb as ITEM_METADATA_KEY_ORDER,lc as ITEM_MUTATE_FLAG_CONTRACTS,pc as ITEM_REOPEN_FLAG_CONTRACTS,yI as ITEM_SCALAR_MISSING_VALUE,en as ITEM_TYPE_VALUES,EI as ITEM_UNION_COLLECTION_FIELDS,YR as JsonFileContextSignalStoreAdapter,ia as LEARNINGS_FLAG_CONTRACTS,BT as LEGACY_HISTORY_HASH_ALGORITHM,up as LINKED_TEST_ENV_NAME_PATTERN,pp as LINKED_TEST_PM_CONTEXT_MODE_VALUES,lp as LINKED_TEST_PROTECTED_ENV_KEYS,mp as LINKED_TEST_WORKSPACE_CONTEXT_MODE_VALUES,ys as LIST_COMMANDER_STRING_OPTION_CONTRACTS,uR as LIST_COMMAND_DEFAULT_PROJECTIONS,qv as LIST_FILTER_EXTENSION_FLAG_DEFINITIONS,ta as LIST_FILTER_FLAG_CONTRACTS,gR as LIST_SORT_FIELDS,yR as LIST_SORT_ORDER_VALUES,ti as MAINTENANCE_HISTORY_OPERATIONS,kP as MAX_CHILD_PROJECTION_ITEMS,KS as MAX_WORKFLOW_POLICIES,WS as MAX_WORKFLOW_POLICY_TERMS,Ya as MEET_FLAG_CONTRACTS,tM as MERGE_DRIVER_ARTIFACT_VALUES,da as MERGE_FLAG_CONTRACTS,ze as MERGE_SUBCOMMAND_VALUES,nM as MUTATION_EVENT_WIRE_BUDGET,ce as MemoryRelationshipGraphAdapter,Ss as NEXT_COMMANDER_STRING_OPTION_CONTRACTS,Oc as NEXT_FLAG_CONTRACTS,Yu as NEXT_OUTPUT_VALUES,na as NOTES_FLAG_CONTRACTS,Sa as PACKAGE_FLAG_CONTRACTS,wa as PACKAGE_INIT_FLAG_CONTRACTS,Wa as PAUSE_TASK_FLAG_CONTRACTS,Lc as PLAN_CREATE_METADATA_PARAMETER_KEYS,ha as PLAN_FLAG_CONTRACTS,$p as PLAN_SHOW_DEPTH_VALUES,Ye as PLAN_SUBCOMMANDS,Fp as PLAN_TEMPLATE_NAMES,zy as PM_AGENT_TASK_ACCOUNTING_MODES,bt as PM_AGENT_TASK_TRANSCRIPT_VERSION,Uo as PM_BULK_LIFECYCLE_COMMAND_ALIASES,zc as PM_CLI_EXPECTED_ERROR_NAME,uv as PM_CLI_GRAMMAR_CONTRACT,sv as PM_CLI_GRAMMAR_NOUNS,gi as PM_CLI_ONLY_TOOL_ACTION_WAIVERS,av as PM_CLI_SHARED_VERBS,zo as PM_COMMAND_ALIAS_CONTRACTS,oe as PM_COMMAND_CAPABILITY_CONTRACTS,Ft as PM_COMMAND_DESTINATION_CONTRACTS,TP as PM_COMMAND_EXIT_CONTRACTS,CP as PM_COMMAND_EXIT_OUTCOME_CONTRACTS,Li as PM_COMMAND_OUTPUT_BUDGET_CONTRACTS,vM as PM_COMMAND_OUTPUT_ENVELOPE_CONTRACTS,He as PM_COMMAND_POSITIONAL_CONTRACTS,km as PM_COMMAND_VISIBILITY_CONTRACTS,Vv as PM_COMPLETE_LIST_FINDING_CODES,Jv as PM_CONTEXT_INTENTS_FILE,jw as PM_CONTEXT_INTENT_CONTRACTS,Go as PM_CONTEXT_OPS_COMMAND_ALIASES,mi as PM_CORE_COMMAND_NAMES,G as PM_CORPUS_SHAPE_SCHEMA,bi as PM_DEPRECATED_TOOL_ACTIONS,Pi as PM_DIAGNOSTIC_DEGRADATION_STEPS,Mi as PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS,Ri as PM_DIAGNOSTIC_OUTPUT_CLASSES,Ci as PM_DISCOVERABLE_TOOL_ACTIONS,to as PM_EPISODE_SCHEMA,EM as PM_ERROR_CODE_CATALOG,CM as PM_ERROR_CODE_EXIT_CLASS_CONTRACTS,ao as PM_EXACT_COVERAGE_METRICS,ai as PM_EXTENSION_CAPABILITY_CONTRACTS,fi as PM_EXTENSION_PACKAGE_ACTION_SUBCOMMANDS,di as PM_EXTENSION_POLICY_MODE_CONTRACTS,pi as PM_EXTENSION_POLICY_SURFACE_CONTRACTS,ui as PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS,ci as PM_EXTENSION_SERVICE_NAME_CONTRACTS,li as PM_EXTENSION_TRUST_MODE_CONTRACTS,sI as PM_GITATTRIBUTES_END,iI as PM_GITATTRIBUTES_START,cI as PM_GITATTRIBUTES_V2_END,aI as PM_GITATTRIBUTES_V2_START,Xc as PM_GITIGNORE_END,Wc as PM_GITIGNORE_START,OP as PM_HISTORY_ATTESTATION_CONTRACT,jo as PM_HISTORY_COMMAND_ALIASES,nS as PM_HISTORY_OPERATION_ALIASES,sS as PM_HISTORY_OPERATION_CONTRACT,iS as PM_HISTORY_OPERATION_PATTERNS,hi as PM_ITEM_ACTION_SUBCOMMANDS,rS as PM_ITEM_HISTORY_OPERATIONS,dt as PM_MCP_APPS_EXTENSION,Fr as PM_MCP_APPS_SERVER_CAPABILITY,Ee as PM_MCP_APPS_SPEC_VERSION,Ur as PM_MCP_APP_CONTRACTS,Gr as PM_MCP_APP_MIME_TYPE,kb as PM_MCP_ENTRY_TOOL_NAMES,m as PM_MCP_ERROR_CODES,R0 as PM_MCP_HTTP_PROTOCOL_VERSION,zh as PM_MCP_INPUT_REQUEST_METHODS,Qk as PM_MCP_LEGACY_PROTOCOL_VERSIONS,lr as PM_MCP_LOG_LEVELS,A as PM_MCP_META_KEYS,ID as PM_MCP_PROGRESSIVE_DISCOVERY_EXTENSION,RD as PM_MCP_PROGRESSIVE_DISCOVERY_SERVER_CAPABILITY,$m as PM_MCP_PROMPT_CONTRACTS,K as PM_MCP_PROTOCOL_VERSION,Dm as PM_MCP_RESOURCE_CONTRACTS,ut as PM_MCP_SKILLS_DRAFT_REVISION,Br as PM_MCP_SKILLS_EXTENSION,Yg as PM_MCP_SKILLS_SERVER_CAPABILITY,M as PM_MCP_SKILL_LIMITS,Se as PM_MCP_SUBSCRIPTION_ID_META_KEY,et as PM_MCP_SUPPORTED_PROTOCOL_VERSIONS,T0 as PM_MCP_TASKS_EXTENSION,tg as PM_MCP_TASK_STATUSES,_e as PM_MCP_TOOL_COMMAND_CONTRACTS,bS as PM_MODE_PAIRED_OUTPUT_PROJECTION_CONTRACTS,es as PM_MUTATION_ACTION_CONTRACTS,$e as PM_NAMESPACED_COMMAND_ALIASES,Qr as PM_OBSERVATION_SCHEMA,Ii as PM_OUTPUT_BUDGET_CLASSES,Oi as PM_OUTPUT_DEGRADATION_STEPS,ar as PM_OUTPUT_ENVELOPE_KINDS,Bt as PM_PACKAGE_CONVENTIONAL_RESOURCE_ROOTS,_i as PM_PACKAGE_ONLY_ACTION_SUBCOMMANDS,Ut as PM_PACKAGE_RESOURCE_KINDS,Ve as PM_POSITIONAL_ACTION_CONTRACTS,qc as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA,Uc as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION,hw as PM_READ_OUTPUT_COMPOSITION_OPTION_FLAGS,ow as PM_READ_OUTPUT_CONTINUATION_FINGERPRINT_POLICIES,mw as PM_READ_OUTPUT_DIMENSIONS,_w as PM_READ_OUTPUT_OPTION_FLAGS,cw as PM_READ_OUTPUT_SESSION_MAX_SEEN_ITEM_IDS,aw as PM_READ_OUTPUT_SESSION_MIN_TOKENS,fw as PM_READ_OUTPUT_SURFACES,gw as PM_READ_OUTPUT_SURFACE_CONTRACTS,yS as PM_READ_ROW_CONTRACTS,gS as PM_READ_ROW_JQ_SELECTOR,vN as PM_RECOVERY_REFERENCE_FIELDS,ue as PM_RECOVERY_REFERENCE_KINDS,fb as PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE,To as PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE_V2,xN as PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE,Co as PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE_V2,Bo as PM_RELOCATED_COMMAND_ALIASES,fs as PM_REPRODUCIBLE_PROCESS_ENV,SP as PM_SUCCESS_EXIT_CODES,yi as PM_TOOL_ACTIONS,$c as PM_TOOL_ACTION_PARAMETER_CONTRACTS,Bc as PM_TOOL_PARAMETERS_SCHEMA,Gc as PM_TOOL_PARAMETERS_SCHEMA_MAJOR,jc as PM_TOOL_PARAMETERS_SCHEMA_VERSION,xc as PM_TOOL_RESERVED_CUSTOM_FIELD_PROPERTIES,eo as PM_VERDICT_SCHEMA,oS as PM_WORKSPACE_HISTORY_OPERATIONS,Jr as PM_WORKSPACE_RECIPE_SCHEMA,_a as PROFILE_FLAG_CONTRACTS,or as PROFILE_LINT_CODES,rr as PROFILE_LINT_DIMENSIONS,Xt as PROFILE_NAMES,Je as PROFILE_SUBCOMMANDS,b as PmCliError,he as PmClient,Hv as PmCompleteListValidationError,y as PmMcpAuthorizationError,ur as PmMcpInputRequiredError,xr as PmMcpIssuerCredentialStore,p as PmMcpProtocolError,pr as PmMcpRequestStateReplayGuard,Wr as PmMcpSkillRegistry,wr as PmMcpSubscriptionRegistry,at as PmMcpTaskStore,LS as QUERY_CURSOR_CONTRACT,ja as REINDEX_FLAG_CONTRACTS,rA as REINDEX_LOCK_ID,yt as RELATIONSHIP_GRAPH_SNAPSHOT_VERSION,Ha as RELEASE_FLAG_CONTRACTS,Za as REMIND_FLAG_CONTRACTS,kt as RESERVED_ITEM_FIELD_NAMES,za as RESTORE_FLAG_CONTRACTS,on as RISK_VALUES,Rv as RelationshipEventLog,Pv as RelationshipEventStore,H as RelationshipGraph,Ue as RelationshipKindRegistry,fa as SCHEMA_FLAG_CONTRACTS,bs as SEARCH_COMMANDER_STRING_OPTION_CONTRACTS,zv as SEARCH_EXTENSION_FLAG_DEFINITIONS,Ic as SEARCH_FLAG_CONTRACTS,ku as SEMANTIC_ATTRIBUTION_LIMITS,Qb as SETTINGS_DEFAULTS,dm as SNAPSHOT_SCHEMA,rI as SOURCE_CONTEXT_ACCESS_ENV,oI as SOURCE_CONTEXT_WRITE_OVERRIDE_ENV,Ka as START_TASK_FLAG_CONTRACTS,nc as STATS_FLAG_CONTRACTS,tn as STATUS_VALUES,Qs as SUBCOMMAND_GLOBAL_FLAG_CONTRACTS,ri as SUBSTANTIVE_HISTORY_OPERATIONS,tE as SUPPORTED_HISTORY_ITEM_HASH_VERSIONS,oE as SUPPORTED_HISTORY_RECORD_HASH_VERSIONS,hC as SUPPRESS_HOST_OUTPUT_MARKER,tc as TELEMETRY_FLAG_CONTRACTS,nf as TELEMETRY_SUBCOMMANDS,ec as TEST_ALL_FLAG_CONTRACTS,Qa as TEST_FLAG_CONTRACTS,rc as TEST_RUNS_FLAG_CONTRACTS,Qm as TEST_RUN_MEASUREMENT_LIMIT,Ks as TOOL_ACTIVITY_OPTION_CONTRACTS,Ls as TOOL_AGGREGATE_OPTION_CONTRACTS,qs as TOOL_BULK_MUTATION_FILTER_OPTION_CONTRACT_SOURCE,Hs as TOOL_CALENDAR_OPTION_CONTRACTS,Vs as TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS,Ws as TOOL_CONTEXT_OPTION_CONTRACTS,Gs as TOOL_CREATE_OPTION_CONTRACTS,js as TOOL_CREATE_OPTION_CONTRACT_SOURCE,Xs as TOOL_DEPS_OPTION_CONTRACTS,Ys as TOOL_GRAPH_OPTION_CONTRACTS,Ns as TOOL_LIST_FILTER_OPTION_CONTRACTS,Ds as TOOL_SEARCH_FILTER_OPTION_CONTRACTS,Fs as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS,$s as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACT_SOURCE,zs as TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS,Bs as TOOL_UPDATE_OPTION_CONTRACTS,Us as TOOL_UPDATE_OPTION_CONTRACT_SOURCE,Zb as TYPE_TO_FOLDER,fC as UNKNOWN_SUBCOMMAND_COMPATIBILITY_CODES,Ps as UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,ks as UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,Ms as UPDATE_COMMANDER_STRING_OPTION_CONTRACTS,_c as UPDATE_FLAG_CONTRACTS,hc as UPDATE_MANY_FLAG_CONTRACTS,Fa as UPGRADE_FLAG_CONTRACTS,ac as VALIDATE_FLAG_CONTRACTS,HS as WORKFLOW_POLICY_ACTIONS,uI as WORKFLOW_POLICY_DOCUMENT_SCHEMA,lI as WORKFLOW_POLICY_SCHEMA,vc as WORKSPACE_FLAG_CONTRACTS,AE as WORKSPACE_HISTORY_ID,lm as WORKSPACE_SNAPSHOT_ACTIONS,md as WorkspaceGraphCache,Lv as WorkspaceTransactionInterruptedError,Mm as _testOnly,RR as _testOnlyAggregateCommand,Hp as _testOnlyConfigCommand,$P as _testOnlyGetCommand,Pl as _testOnlyHealthCommand,Jp as _testOnlyInit,Wp as _testOnlyInitAgentGuidance,tk as _testOnlyItemTransaction,cM as _testOnlyMutationEvents,dP as _testOnlyNextCommand,eM as _testOnlySearchCommand,gP as _testOnlySimilarity,ym as _testOnlyTemplates,du as _testOnlyValidateCommand,uM as _testOnlyWorkspacePosition,UO as acceptAssuranceProposals,au as acknowledgeLinkedTests,ol as acknowledgeUnknownAuthorHistoryEvents,rl as acknowledgeUnknownAuthorHistoryEventsFromTransport,fA as acquireItemMetadataDerivedIndexLock,Be as acquireLock,mk as activateExtensionForTest,WC as activateExtensions,$n as agentSessionEnvironment,t_ as aggregate,Bm as analyzeAgentProvenanceDescriptorCoverage,Sv as analyzeDefectChangeRisk,ER as analyzeDefectRecurrenceCoverage,ap as analyzeDuplicateItems,kv as analyzeGraphImpact,od as analyzeHierarchyIntegrity,xv as analyzeKnowledgeGraph,EP as analyzePmCommandExitConformance,Ti as analyzePmToolActionParity,BI as analyzeReconciliationDiscard,Mv as analyzeRelationshipExecution,Id as analyzeRelationshipSchedule,vh as analyzeSdkActionCoverage,jt as analyzeSdkCliParameterCompleteness,m_ as append,Bi as appendHistoryEntry,RE as appendWorkspaceAuditEvent,IE as appendWorkspaceHistoryChange,ET as applyAcceptanceCriteriaMutations,jO as applyAssurancePreset,Mh as applyBootstrapPagerPolicy,zw as applyContextIntentProjection,Xu as applyContextTagProjection,bR as applyFilterValueEcho,sA as applyHistoryPatch,Fh as applyInvocationAuthorOverride,Dl as applyPathMigrations,Aw as applyReadOutputDimensions,Tw as applyReadOutputIncludeModes,lw as applyReadOutputSessionReferences,CT as applyRegisteredItemFieldDefaultsAndValidation,Gl as applyStandaloneNote,Sl as applyStoredExtensionMigrationState,vT as applyTagRemovals,hP as applyTerminalOrderingPolicy,Ul as artifactKey,nC as asRecordClone,oC as asRecordOrNull,We as assembleWorkspaceRelationshipGraph,Yv as assertCompleteListResult,Kk as assertExtensionBlueprint,Hk as assertExtensionCapabilityUsage,Ik as assertExtensionDeactivated,Yk as assertExtensionManifestCompatible,Xk as assertExtensionManifestMatchesBlueprint,Jk as assertExtensionPreflight,sd as assertHierarchyMutationAllowed,_M as assertHistoryCompactTarget,zI as assertHistoryRepairTarget,Yi as assertInitializedTracker,$l as assertLinkedArtifactMutationIsUnambiguous,t0 as assertMcpClientCapabilities,e0 as assertMcpProtocolHeader,qy as assertMemoryRelationshipGraphAdapterConformance,RT as assertNoUnknownCsvKeys,Rk as assertPackageManifest,FE as assertParentReferenceIsNotSelf,ix as assertPmMcpSkillsCapability,Wk as assertProjectProfile,Vx as assertProjectRuntimeCompatibility,CS as assertProjectionModeChoice,Xi as assertReadableTrackerRoot,Pk as assertRegisteredCommandContract,Gk as assertRegisteredCommandOverride,Dk as assertRegisteredExporter,Mk as assertRegisteredFlags,kk as assertRegisteredHook,Lk as assertRegisteredImporter,$k as assertRegisteredItemField,Fk as assertRegisteredItemType,Vk as assertRegisteredMigration,Uk as assertRegisteredParserOverride,Bk as assertRegisteredPreflightOverride,jk as assertRegisteredProfile,qk as assertRegisteredRendererOverride,xk as assertRegisteredSearchProvider,zk as assertRegisteredServiceOverride,Nk as assertRegisteredVectorStoreAdapter,$C as assertRelationshipEdgeAllowed,fo as assertRelationshipGraphAdapterConformance,TO as assuranceAssertionUpdateIsLoosening,Kw as attachContextIntentReceipt,Pw as attachContextUsageServingReceipt,ou as attachLinkedTestMutationProvenance,ru as attachLinkedTestProvenance,rt as attachMcpServerInfo,vS as attachOutputOmissionReceipt,Xw as attachOutputTokenAccounting,Ww as attachReadOutputContracts,uw as attachReadOutputSessionReceipt,cl as auditMergeAttributeFence,dI as auditMergeDriverConfiguration,Nd as auditWorkspaceRelationshipGraph,z0 as authorizeMcpHttpRequest,Ln as boundAgentEpisodeIdentity,zS as boundReadOutputRows,Vu as buildChildrenByParent,UP as buildCompactSearchFilterSummary,CR as buildContentFilterEcho,XR as buildContextSignalSnapshot,_y as buildCorpusShapeItemPlan,Tv as buildDefectRecurrenceIndex,yl as buildExtensionDescribeResult,Al as buildExtensionInstallPlan,TR as buildGovernanceMissingFilterEcho,HE as buildInvalidTypeError,NP as buildItemChildrenRollup,QM as buildItemCompletionMutations,xR as buildItemContextRelevanceCandidates,CA as buildItemNotFoundError,DP as buildItemSchedule,WI as buildLinkedFileRepairReport,L0 as buildMcpAuthorizationDiscoveryUrls,Bh as buildMcpCompleteResult,o0 as buildMcpDiscoverResult,G0 as buildMcpDynamicRegistrationMetadata,O0 as buildMcpHttpRequestHeaders,c0 as buildMcpInputRequiredResult,N0 as buildMcpProtectedResourceMetadata,sl as buildMergeAttributePatterns,Fc as buildPmActionToolInputSchema,DN as buildPmRefusalClosureCensus,JO as buildRelationshipContext,AA as buildSearchCorpus,OA as buildSemanticCorpusInput,KI as buildStatusRoleWarnings,Wi as buildTrackerInitializationRecovery,xA as buildVectorizationEmbeddingIdentity,NA as buildVectorizationEmbeddingMetadata,BP as buildVerboseSearchFilters,pI as buildWorkflowCompletenessCheck,rP as buildWorkspaceMemorySnapshot,Nn as canonicalDocument,wC as canonicalizeCommandOptionKey,BM as canonicalizeCommandSuggestions,MR as canonicalizeContextRecencyCoordinate,NC as canonicalizeRelationshipKind,ON as censusPmRecoveryReferenceProducers,Xv as certifyCompleteListResult,uk as checkExtensionManifestCompatibility,Y_ as claim,J_ as claimNext,eI as classifyHistoryAuthorEvent,oi as classifyHistoryEvent,GI as classifyHistoryMergeReceiptReferences,PC as classifyHostEnvironmentFault,JP as classifyImplicitSemanticFallbackReason,In as classifyItemFormatVersion,cf as classifyLinkedTestCommandSafety,df as classifyLinkedTestFailure,uT as clearActiveExtensionHooks,Bd as clearDurableGraphCache,pS as clearFocusedItem,Zc as clearWorkspaceContractsCache,X_ as close,rp as closeItem,ih as closeTask,Nh as coalesceRepeatedListFlags,ZI as collectBlockedByIds,eR as collectBlockedByIdsFromCorpus,kw as collectContextUsageDeliveredItemIds,ld as collectDanglingDependencyReferences,rR as collectDependencyBlockedIds,cd as collectDuplicateDependencyRows,xd as collectDuplicateRelationshipEdgeGroups,YP as collectErrorCauseCodes,rd as collectHierarchyRelations,Rr as collectMcpHeaderAnnotations,ud as collectMissingDependencyTargetIds,np as collectNewOrderingCycleWarnings,Pd as collectOrderingCycles,dd as collectOrderingStorageContradictions,eO as collectPackageContextIntentContracts,zt as collectPackageExtensionDirectories,yT as collectRegisteredItemFieldNames,YT as collectRuntimeCreateFieldValues,KE as collectRuntimeFilterValues,JT as collectRuntimeUpdateFieldValues,Gu as collectSubtreeIds,hn as collectUsedExtensionCapabilities,EC as commandOptionFlagLabel,n_ as comments,$f as commitImportedItem,ek as commitItemCompletion,ZM as commitItemMutations,Dv as commitWorkspaceTransaction,Zs as compactFlagAliasContracts,Uu as compareCriticalItems,U as comparePmDateVersions,Nv as compareRelationshipSnapshots,iC as compareTimestampStrings,uO as compileHistoryProvenanceMatcher,Bw as composeContextIntentContracts,nk as composeExtension,lk as composeExtensionPackage,nR as computeActionabilityReport,SE as computeHistoryDiff,vd as computeRelationshipCentrality,Ad as computeRelationshipDominators,pd as computeWorkspaceGraphFingerprint,__ as config,lT as consumeAfterCommandAffectedItems,Xf as context,Hw as contextIntentRowId,Q_ as copy,lf as countFailureCategories,BS as countReadOutputRows,H_ as create,FO as createAssurancePreset,SR as createAssuranceWorkspaceContext,aC as createCheckpointId,Kv as createCompleteListOptions,XC as createCoreCommandHookContext,so as createCorpusShapeMeasurement,vO as createEmptyAssuranceDocument,jC as createEmptyExtensionRegistrationRegistry,Kc as createExtensionCommandSdk,fn as createExtensionContributionInventory,Zk as createExtensionTestHarness,Ui as createHistoryEntry,YA as createLazyModule,mI as createLifecycleCompletenessPolicies,V0 as createMcpStaticBearerVerifier,S0 as createMcpTaskStore,bA as createMutationGuardSdk,TS as createOutputOmissionReceipt,Vc as createPmCliExpectedError,jh as createPmCliProgram,xi as createPmCommandOutputBudget,IS as createQueryFingerprint,By as createRelationshipGraphScaleFixture,ee as createRelationshipGraphSnapshot,Pt as createRelationshipKindRegistry,hs as createReproducibleProcessRunner,qP as createSearchCursorFingerprint,YC as createSerialQueue,LT as createStdinTokenResolver,_C as createUnknownSubcommandError,rw as createWorkflowPolicyEvaluator,um as createWorkspaceSnapshot,fk as deactivateExtensionForTest,EL as declineServiceOverride,Vw as decodeContextIntentCursor,XA as decodeHtmlEntitiesInOptions,Ir as decodeMcpHttpHeaderValue,kS as decodeQueryCursor,PS as decodeQueryCursorEnvelope,MS as decodeQueryCursorState,sw as decodeReadOutputContinuationCursor,Y0 as decoratePmMcpToolsWithApps,ql as dedupeLinkedArtifacts,LR as defaultScoreContextCandidates,PL as defineAfterCommandHook,IL as defineBeforeCommandHook,RL as defineBeforeMutationHook,pL as defineCommand,bL as defineCommandOverride,Y as defineCorpusShape,_x as defineEpisodeSpecification,OL as defineExporter,rk as defineExtension,ok as defineExtensionBlueprint,lL as defineExtensionManifest,mL as defineFlag,vL as defineImporter,_L as defineItemField,fL as defineItemType,hL as defineMigration,iy as defineObservationContract,xL as defineOnIndexHook,kL as defineOnReadHook,ML as defineOnWriteHook,CL as defineParserOverride,Ni as definePmCommandOutputBudget,AM as definePmCommandOutputEnvelope,TM as definePmErrorCodeCatalog,TL as definePreflightOverride,uL as defineProjectProfile,AL as defineRendererOverride,gL as defineSearchProvider,SL as defineServiceOverride,yL as defineVectorStoreAdapter,dy as defineVerdictContract,Ae as defineWorkspaceRecipe,eh as deleteItem,gm as deleteWorkspaceSnapshot,FC as dependencyToRelationship,u_ as deps,GO as deriveAssuranceProposals,sk as deriveExtensionCapabilities,AP as derivePmBulkMutationEffect,IN as derivePmRecoveryReferenceObligations,Rd as deriveRelationshipDeadlines,pl as deriveSchemaEvolutionMigrationId,BA as deriveTelemetryCommandResolution,JE as describeAllowedTransitions,tI as describeExtensionActivation,ak as describeExtensionBlueprint,wu as describeItemOwnershipConflict,fx as describeObservationCost,er as describeProfileComposition,tr as describeProjectProfile,LM as describeUnknownError,Kn as detectAgentIdentity,Jn as detectHarnessIdentity,wd as detectRelationshipCommunities,Wn as diagnoseAgentIdentity,Ld as diffRelationshipAuditSnapshots,rf as diffTestRunMeasurements,u0 as digestMcpRequestParameters,HC as discoverExtensions,dn as discoverNearbyPmRoot,MD as discoverPmTools,Dy as discoverProjectRuntimeVersionPins,l_ as docs,o_ as duplicates,Fd as durableGraphCachePath,qd as durableGraphCacheStatus,vn as effectiveItemFormatVersion,iv as emitTelemetryErrorEvent,Df as emptyImportedDocument,CI as encodeItemScalarDecisionValue,Or as encodeMcpHttpHeaderValue,RS as encodeQueryCursor,iw as encodeReadOutputContinuationCursor,wE as enforceHistoryStreamPolicyForItem,EE as enforceHistoryStreamPolicyForItems,yM as enrichCliFlagInvocationContract,sr as enrichCliFlagInvocationContracts,cA as ensureMaterializedHistoryTarget,Jc as ensurePmGitignore,Ml as ensureScope,UA as ensureSentryInit,Lf as ensureTrackerInitialized,Td as enumerateRelationshipPaths,$i as estimatePmOutputTokens,IO as evaluateAssuranceAssertion,RO as evaluateAssuranceGate,xx as evaluateBoundaryFixtures,jR as evaluateContextRanking,wv as evaluateDefectGateEvidence,OO as evaluateMeasurement,rs as evaluateMutationGuard,Wm as evaluateProvenanceCoverage,Vm as evaluateSemanticAttributionCoverage,dp as evaluateSimilarityGovernance,YE as evaluateTransition,ly as evaluateVerdictContract,tw as evaluateWorkflowPolicies,IA as executeEmbeddingBatchesWithRetry,MA as executeVectorDelete,kA as executeVectorReset,PA as executeVectorUpsert,ty as executeWorkspaceRecipe,jl as expandAddGlobEntries,Xl as explainSourceTraceability,RP as exportAttestation,sh as extension,ch as extensionActivate,dh as extensionDeactivate,ah as extensionList,Ob as extensionMigrate,jI as extractHistoryMergeReceiptDispositions,FI as extractHistoryMergeReceiptReferences,U0 as extractMcpTraceContext,nA as extractPatchFailureContext,Ql as extractReferencedPmItemIdsFromCommand,Uy as federateRelationshipGraphSnapshots,a_ as files,c_ as filesDiscover,d_ as filesLookup,xw as finalizeContextUsageDelivery,Ty as findCoverageDeficits,cp as findDuplicateClusters,il as findGitWorkspaceRoot,HT as findHistoryIdentityDiscontinuities,hl as findInstalledNpmPackageCandidate,X0 as findPmMcpAppByUri,qo as findPmNamespacedCommand,Ed as findRedundantRelationshipEdges,Od as findRelationshipCutStructure,sp as findSimilarItems,nv as finishTelemetryCommand,pC as flattenFlagListValue,yy as flushTelemetryQueue,rh as focus,Sd as forEachMatchedRelationshipEdge,kd as formatDuplicateEdgeGroup,nd as formatHierarchyRelation,Md as formatOrderingStorageContradiction,lv as formatPmPositionalActionFlagTip,Pm as formatProfileApplyHuman,Rm as formatProfileLintHuman,Om as formatProfileListHuman,Im as formatProfileShowHuman,_l as formatSchemaEvolutionMigrationHuman,QP as formatVectorIndexRecoveryWarnings,lM as formatWorkspacePositionHuman,G_ as gc,Vi as generateItemId,Qf as get,aT as getActiveCommandResult,Gw as getActiveContextIntentContracts,yn as getActiveExtensionRegistrations,q0 as getActiveMcpTraceContext,MO as getAssuranceDeclaration,Sh as getContracts,lS as getFocusedItem,pn as getHistoryPath,Iv as getItemAt,un as getItemPath,is as getMutationActionContract,Yc as getPmGitignoreBlock,ln as getSettingsPath,Qc as getWorkspaceContracts,vE as getWorkspaceHistoryPath,p_ as graph,jd as graphAuditBaselinePath,Hm as groupHistoryByEpisode,wL as handleServiceOverride,r0 as hasMcpClientExtension,W0 as hasPmMcpAppsCapability,Ke as hasSubcommandFlagContractsForCommand,LA as hasVectorizationEmbeddingIdentityChanged,DA as hasVectorizationVectorDimensionChanged,uE as hashDocument,pE as hashDocumentForVersion,mE as hashEmptyDocument,iE as hashHistoryPatch,nE as hashHistoryRecord,sE as hashHistoryStream,TI as hashItemScalarDecisionValue,j_ as health,gd as hierarchyAncestors,yd as hierarchyDescendants,z_ as historyCompact,V_ as historyCompactBulk,VT as historyDigest,lO as historyEntryMatchesProvenance,Oe as historyItemHashVersionForRuntime,U_ as historyRedact,B_ as historyRepair,q_ as historyRepairAll,QI as indexBlockedByIds,id as indexHierarchyRelations,$A as inferConsistentVectorDimension,ki as inferPmOutputBudgetClass,f_ as init,Wv as inspectCompleteListResult,GC as inspectExtensionManifestSchema,Jd as inspectHistoryAuthorStream,RI as inspectMergeReceiptEvidence,Fy as inspectProjectRuntimeCompatibility,ps as inspectStaleInProgressItems,HI as inspectStatusRoleAssignments,OE as inspectWorkspaceHistoryState,pm as inspectWorkspaceSnapshot,ul as installMergeFence,n0 as interpretMcpResultType,Zu as isAlreadyClaimedError,FM as isCommanderError,yu as isErrnoError,gv as isExternalDependencyReference,yv as isExternalDependencySourceKind,fe as isFileMissingError,yC as isHostOutputSuppressed,bI as isItemScalarMissingValue,LI as isLegacyMergeReceiptSummary,_ as isMcpRecord,os as isMutationAction,DC as isOrderingRelationshipKind,DE as isPlaceholderReferenceToken,Hc as isPmCliExpectedError,wi as isPmExtensionCapabilityContract,Ai as isPmExtensionPolicyModeContract,vi as isPmExtensionPolicySurfaceContract,Ei as isPmExtensionServiceNameContract,wP as isPmKnownExitCode,OM as isPmMutationReceipt,Xe as isPmSuccessfulExitCode,Si as isPmToolAction,DI as isPreDurableCloneLocalReceiptSummary,$I as isPreDurableDispositionEligibleReference,$y as isProjectMutatingInvocation,JA as isPureSnakeCaseAlias,vw as isReadOutputBudgetExceeded,wS as isReadRowContract,Yd as isRuntimeRecord,ev as isTerminalPlanMode,QT as isTerminalStatus,Zo as isTimestampLiteral,YM as itemDocumentToMutationOptions,LP as itemHasSchedule,ss as jaccardSimilarity,s_ as learnings,mC as levenshteinDistanceWithinLimit,_u as limitAnnotationEntries,nu as linkedTestTrustFingerprint,ck as lintExtensionBlueprint,UC as lintExtensionManifestSchema,nr as lintProjectProfile,Yf as list,Bn as listAgentProvenanceAdapters,xh as listAliasPluralKeys,Jf as listAllComplete,gA as listAllDocumentCandidatesCached,Qi as listAllItemMetadata,yA as listAllItemMetadataLight,PO as listAssuranceDeclarations,DO as listAssuranceVerdicts,my as listBuiltinCorpusShapes,qM as listCoreClosedDomainContracts,fR as listGetProjectionFields,hI as listInvalidProvenanceHistoryStreamIds,pR as listListProjectionFields,PI as listMergeReceipts,ns as listMutationActions,iM as listMutationEvents,Ao as listPmCommandFlagBudgets,Nm as listPmCommandsForFamily,xm as listPmCommandsForTier,Ne as listPmFlagLexicon,sL as listPmFlagSpellingInventory,Lm as listPmMcpToolsForProfile,XN as listPmRequiredArgumentRefusalContracts,YN as listPmSubcommandRefusalContracts,Qt as listProfiles,QN as listTrackerPreflightRecoveryContracts,mm as listWorkspaceSnapshots,tO as loadContextIntentRuntimeLayers,bm as loadCreateTemplateOptions,KC as loadExtensions,Vd as loadGraphAuditBaseline,dC as loadMutationCheckpoint,N as loadRelationshipGraphAdapter,Ji as locateItem,IT as looksLikeGenericKeyValueEntry,qS as mapReadOutputRows,MI as markMergeReceiptReconciled,WE as matchesRuntimeFilters,rv as maybeRunFirstUseTelemetryPrompt,hy as measureCorpusShapePlan,Ki as measureItemMetadataReadWork,AT as mergeAdditiveTags,ik as mergeExtensionBlueprints,SI as mergeHistoryStreams,vI as mergeItemDocuments,OI as mergeJsonDocuments,Lh as mergeLinkedTestTwoTokenEntries,wI as mergeRelationshipEventStreams,Ku as mergeSortedWarnings,QA as migrateItemFilesToFormat,SA as mutateItem,TA as mutateItemWithHistoryContext,PE as mutateWorkspaceJsonWithHistory,e_ as next,zn as normalizeAgentProvenanceAdapterValue,fu as normalizeAnnotationTransportOptions,gO as normalizeAssuranceEvaluation,hO as normalizeAssuranceMutation,Dh as normalizeBootstrapInvocation,jT as normalizeBulkIdsValue,ad as normalizeDependencyGraphTarget,XO as normalizeDependencySeedId,WO as normalizeDependencySourceKind,mn as normalizeExtensionContributionInventory,dS as normalizeHistoryOperationForWrite,_I as normalizeInvalidHistoryProvenance,MM as normalizeItemAddressInvocation,On as normalizeItemFormatVersion,zi as normalizeItemId,Mn as normalizeItemMetadata,YO as normalizeItemReference,kh as normalizeLegacyExtensionActionSyntax,Fl as normalizeLinkedPath,LE as normalizeParentReferenceValue,Jt as normalizeProfileName,qi as normalizeRawItemId,Sw as normalizeReadOutputIncludeModeOptions,gE as normalizeReplayPatchOps,as as normalizeSimilarityText,ZT as normalizeStatusForRegistry,Pn as normalizeStatusInput,WT as normalizeStatusInputWithRegistry,$M as normalizeThrownExitCode,i_ as notes,Jo as nowIso,Gd as openDurableGraphCache,l0 as openMcpRequestState,hx as openPmEpisode,bd as orderingPredecessors,Cd as orderingSuccessors,zR as packContextCandidates,Bu as packRankedContextItems,bh as packageActivate,yh as packageCatalog,Ch as packageDeactivate,hh as packageDescribe,fh as packageDoctor,ph as packageInstall,lh as packageLifecycle,uh as packageList,_h as packageManage,Ib as packageMigrate,gh as packageReload,mh as packageUninstall,NS as paginateQueryRows,kl as parseAddEntries,xl as parseAddGlobEntries,gu as parseAnnotationTextInput,KM as parseAtomicMutationControls,Ph as parseBootstrapCommandName,Oh as parseBootstrapGlobalOptions,Rh as parseBootstrapHelpRequest,$h as parseBootstrapTypeValue,FT as parseBulkIdsText,Fu as parseContextDepth,Nu as parseContextFocusFields,Zv as parseContextIntentDeclarations,ju as parseContextSections,WR as parseContextSignalSnapshot,OT as parseCsvKv,Av as parseDefectChangeRiskRequest,wR as parseDefectRecurrenceCoverageRequest,Ev as parseDefectRecurrencePolicy,rm as parseEvalQuerySet,Wd as parseGraphSubcommand,IP as parseHistoryAttestation,cO as parseHistoryProvenanceFilters,oO as parseIntegerLimit,eS as parseItemDocument,WM as parseItemMutationBatch,VE as parseLimit,Sp as parseLinkedTestAssertionEqualsMap,wp as parseLinkedTestAssertionGteMap,hp as parseLinkedTestBoolean,gp as parseLinkedTestContextMode,_p as parseLinkedTestEnvClear,fp as parseLinkedTestEnvSet,Ep as parseLinkedTestJsonEntries,Tp as parseLinkedTestMinLines,Cp as parseLinkedTestRegexList,bp as parseLinkedTestStringList,yp as parseLinkedTestWorkspaceContextMode,Kh as parseMcpCachePolicy,Gh as parseMcpImplementation,it as parseMcpInputRequests,hr as parseMcpInputResponses,gg as parseMcpSubscriptionFilter,Ll as parseMigrateEntries,iR as parseMultiValueFilter,IM as parseMutationReceipt,$T as parseOptionalNonNegativeInteger,DT as parseOptionalNumber,CN as parsePmAgentTaskTranscriptCorpus,PD as parsePmToolDiscoveryOptions,nO as parsePriority,cR as parsePriorityFilterSet,dw as parseReadOutputSession,bT as parseRegisteredItemFieldAssignments,de as parseRelationshipGraphSnapshot,Nl as parseRemoveEntries,Wl as parseSourceLineRange,UE as parseStatusFilterCsv,sR as parseStringFilterSet,Tn as parseTags,ef as parseTestRunMeasurements,iO as parseType,aR as parseTypeFilterSet,tl as parseUnknownAuthorHistoryEventCoordinates,XS as parseWorkflowPolicy,YS as parseWorkflowPolicyDocument,lP as partitionDecisionEntries,TE as patchPathToChangedField,Wo as pathExists,nh as pauseTask,Ud as persistDurableGraphResult,ZE as persistSelectedItemFormat,GP as planAgentIdentityVocabularyMutation,eP as planCompletedAtBackfill,vl as planExtensionDirectoryCopy,ir as planProfileApplication,EN as planRelationshipEventBackfill,Kd as planRelationshipRemediation,ml as planSchemaEvolutionMigration,Qd as planUnknownAuthorHistoryAcknowledgment,fm as planWorkspaceSnapshotRestore,mv as positionalShapeKey,fv as positionalSignatureKey,pk as preflightExtension,ds as prepareSimilarityText,MT as preserveMutationStdinTokenFields,PT as preserveMutationStdinTokenLiterals,Qw as printError,Zw as printResult,x_ as profile,D_ as profileApply,$_ as profileLint,N_ as profileList,L_ as profileShow,dT as projectAfterCommandItemSnapshot,Lu as projectContextFocusRows,Zm as projectFleetAttributionAnalytics,dO as projectHistoryProvenance,ji as projectPmDiagnosticOutput,Gi as projectPmDiagnosticText,Ym as projectProvenanceCoverageAnalytics,cu as projectValidateCounts,BO as promoteAssuranceAssertion,Mw as propagateContextUsageServingReceipt,jx as pruneCompileCacheGenerations,kO as putAssuranceDeclaration,xO as putAssuranceDeclarationBundle,lA as queryItemMetadataIndex,uA as queryLinkedFileMetadataIndex,pA as querySimilarItemMetadataIndex,tf as queryTestRunMeasurementsBelow,ii as quoteCommandArg,ni as quoteWindowsCommandArg,UM as rankCommandPaths,hu as readAnnotationEntries,Xn as readAuthorEnvironment,hf as readBooleanOption,Fw as readContextUsageAffinity,gf as readCsvListOption,Tl as readExtensionMigrationState,Xo as readFileIfExists,Es as readFirstStringFromCommanderOptions,As as readFirstValueFromCommanderOptions,Km as readHistoryAnalyticsWindow,_S as readHistoryEntries,Qn as readHistorySnapshot,Gm as readImprovementLedger,_A as readItemMetadataDerivedIndexState,Zi as readLocatedItem,US as readOutputBudgetCollections,nw as readOutputCollectionFingerprint,GS as readOutputContinuationRowCollections,FS as readOutputContinuationRowPaths,Cw as readOutputIncludeModeOptions,jS as readOutputRowCollections,$S as readOutputRowPaths,pw as readOutputSessionRemainingTokens,qt as readPmPackageManifest,wh as readRequiredString,Hi as readSettings,QE as readSettingsWithMetadata,vs as readStringArrayFromCommanderOptions,_f as readStringOption,DM as readThrownExitCode,FA as readVectorizationStatusLedger,dA as readWorkflowPolicies,JS as readWorkflowPolicyField,Qv as readWorkspaceContextIntentContracts,ZR as readWorkspaceContextSignals,oP as readWorkspaceMemory,dM as readWorkspacePosition,CE as reanchorHistoryEntries,gn as reconcileExtensionCapabilityUsage,kE as reconcileWorkspaceJsonHistory,cT as recordAfterCommandAffectedItem,LO as recordAssuranceVerdict,Ru as recordClaimSemanticAttribution,Lw as recordContextUsageDelivery,Nw as recordContextUsageServing,Dw as recordContextUsageTouch,$w as recordContextUsageTouches,Mu as recordFocusSemanticAttribution,jm as recordImprovementObservation,Pu as recordReleaseSemanticAttribution,hA as refreshItemMetadataDerivedIndex,dl as refreshMergeAttributeFenceIfInstalled,GA as refreshSearchArtifactsForMutation,qn as registerAgentProvenanceAdapters,HO as registerExternalDependencyResolver,Un as registerHarnessSignalDescriptors,hS as registerOutputMaterialFieldGroups,Z_ as release,NO as removeAssuranceDeclaration,Yo as removeFileIfExists,Hl as renameArtifactsResultKey,Au as renderCalendarMarkdown,vu as renderCalendarToon,Wu as renderContextMarkdown,bl as renderExtensionDescribeMarkdown,gl as renderExtensionSurfaceMarkdown,Gf as renderGuideMarkdown,NM as renderMissingOptionRetry,uP as renderNextMarkdown,zM as renderPmClosedDomainHelp,si as renderPmCommand,Ko as renderPmCommandAliasMigrationHint,Fm as renderPmCommandVisibilityMarkdown,cL as renderPmFlagLexiconMarkdown,J0 as renderPmMcpAppHtml,$N as renderPmRefusalClosureCensusMarkdown,qE as renderRowsAsCsv,zE as renderRowsAsTable,W_ as reopen,aA as replayHistoryToTarget,_E as replayToCanonicalItemDocument,fE as replayToItemDocument,cS as requireHistoryOperation,fP as requireTerminalReason,_P as requireTerminalReasonWithRecovery,dE as resealHistoryRewrite,nT as resetActiveExtensionRuntimeState,_d as resetWorkspaceGraphCache,Dn as resolveAgentSessionContextFromSignals,Su as resolveAnnotationIndex,bu as resolveAnnotationInput,fS as resolveAuthor,Zn as resolveAuthorIdentity,NE as resolveBodyFileContent,fy as resolveBuiltinCorpusShape,Eu as resolveCalendarOutputFormat,SM as resolveCanonicalPmErrorCodeContract,LC as resolveCanonicalRelationshipKind,mS as resolveClaimPrincipal,GT as resolveCliBulkIdsInput,OC as resolveCommandOptionPolicyState,Fx as resolveCompileCacheGeneration,QR as resolveCompletionTimestamp,TC as resolveConfiguredPmPackageRoot,hR as resolveContentFieldFilters,qw as resolveContextIntentContract,Du as resolveContextOutputFormat,$u as resolveContextTokenBudget,yP as resolveCreateExplicitEmptyFlag,HP as resolveEffectiveSearchMode,wA as resolveEmbeddingProviders,Ol as resolveExtensionInstallSourceIdentity,Cl as resolveExtensionMigrationStatePath,VC as resolveExtensionRoots,KO as resolveExternalDependencyReference,uC as resolveFlagValueKind,Ff as resolveGuideOutputFormat,Um as resolveHistoryEpisodeGroupIdentity,zT as resolveHistoryHashAlgorithm,aS as resolveHistoryOperation,aO as resolveHistoryProvenanceDimensions,vv as resolveHistorySubject,iA as resolveHistoryTarget,WP as resolveHybridSemanticWeight,cn as resolveImplicitPmRoot,sC as resolveIsoOrRelative,tR as resolveItemBlockers,YI as resolveItemExecutionRole,XM as resolveItemMutationDocument,an as resolveItemTypeRegistry,KT as resolveItemTypesFilePath,uf as resolveLinkedTestFailureExitCode,eu as resolveLinkedTestSourceRef,tu as resolveLinkedTestSourceWorkspaceRoot,iu as resolveLinkedTestTrust,su as resolveLinkedTestTrustBatch,yg as resolveMcpAcknowledgedSubscriptionFilter,tt as resolveMcpRequestContext,nl as resolveMergeInstallContext,_R as resolveMissingMetadataFilters,xM as resolveMissingOptionPlaceholder,SS as resolveModePairedOutputOmissionReceipt,cP as resolveNextOutputFormat,AS as resolveOutputOmissionReceipt,CC as resolvePmCliVersion,Ho as resolvePmCommandAlias,Ze as resolvePmCommandCapabilityFamily,Kt as resolvePmCommandExitContract,L as resolvePmCommandOperation,Di as resolvePmCommandOutputBudget,cr as resolvePmCommandOutputEnvelope,cv as resolvePmCommandPositionalContract,Qe as resolvePmCommandVisibilityTier,Fi as resolvePmDiagnosticOutputBudget,wM as resolvePmErrorCodeContract,wb as resolvePmFlagSemanticConcept,Fe as resolvePmHistoryOperation,bC as resolvePmPackageRootFromModule,dv as resolvePmPositionalActionContract,Mc as resolvePmPositionalActionFlagContracts,Ge as resolvePmRoot,Nc as resolvePmToolCustomFieldCollision,jE as resolvePriority,Zt as resolveProfile,al as resolveProjectMergeTypeFolders,xS as resolveQueryCursorStart,ww as resolveReadOutputDimensions,Ow as resolveReadOutputEncoding,VS as resolveReadOutputRecoveryBudget,yw as resolveReadOutputSurface,ES as resolveReadRowContract,kM as resolveRecoveryCommandName,TT as resolveRegisteredSearchProvider,ST as resolveRegisteredVectorStoreAdapter,_s as resolveReproducibleProcessEnvironment,wn as resolveRuntimeFieldRegistry,Sn as resolveRuntimeStatusRegistry,EA as resolveSearchCorpusFields,VP as resolveSearchMaxResults,zP as resolveSearchPage,KP as resolveSearchScoreThreshold,XP as resolveSearchTuning,vA as resolveSemanticCorpusCharacterLimit,Iu as resolveSemanticLineageIds,tA as resolveSettingsWithSemanticRuntimeDefaults,nI as resolveSourceContextWritePolicy,Op as resolveStartTaskInProgressStatus,re as resolveSubcommandFlagContractsForCommand,eC as resolveTelemetryErrorCategory,mP as resolveTerminalReason,vC as resolveTypeDefinition,AC as resolveTypeName,BE as resolveTypeSynonym,XE as resolveTypeWorkflows,el as resolveUnknownAuthorAcknowledgmentSelector,ZP as resolveVectorIndexRecovery,RA as resolveVectorStores,td as resolveWorkspaceRelationshipKindRegistry,RC as resolveWorkspaceRoot,th as restore,lC as restoreCheckpointItems,xE as restoreWorkspaceJsonFromHistory,hm as restoreWorkspaceSnapshot,_m as restoreWorkspaceSnapshotWithRecovery,Ah as runAction,pT as runActiveBeforeMutationHooks,fT as runActiveCommandHandler,mT as runActiveOnIndexHooks,Cn as runActiveOnReadHooks,bn as runActiveOnWriteHooks,_T as runActiveParserOverride,hT as runActivePreflightOverride,gT as runActiveServiceOverride,ed as runActivity,zC as runAfterCommandHooks,pu as runAggregate,Tu as runAnnotationCommand,mu as runAppend,OR as runAssuranceAction,IR as runAssuranceDispatch,qC as runBeforeCommandHooks,Ou as runCalendar,Qu as runClaim,ep as runClaimNext,op as runClose,kp as runCloseMany,Pp as runCloseTask,xp as runComments,Uf as runCompletion,Vp as runConfig,Ht as runContext,BR as runContextEvaluationCorpus,GR as runContextEvaluationScenario,Gp as runCopy,Ap as runCreate,Up as runDelete,hd as runDeps,Kl as runDocs,RM as runDuplicates,im as runEval,am as runEvent,Il as runExtension,El as runExtensionMigrateAction,wl as runExtensionMigrations,Yl as runFiles,Zl as runFilesDiscover,Jl as runFilesLookup,Jm as runFleetAttributionAnalytics,Bp as runFocus,zp as runGc,qp as runGet,Xd as runGraph,jf as runGuide,Rl as runHealth,vP as runHistory,MP as runHistoryAttest,mM as runHistoryCompact,hM as runHistoryCompactBulk,UI as runHistoryMaintenance,pM as runHistoryRedact,qI as runHistoryRepair,VI as runHistoryRepairAll,Zp as runInit,Xp as runInitAgentGuidance,Np as runLearnings,Vl as runLinkedArtifacts,pf as runLinkedTests,uu as runList,sm as runMeet,rM as runMergeDriver,ll as runMergeInstall,xI as runMergeReceiptEvidenceReport,kI as runMergeReceiptReport,oM as runMergeReconcile,Ju as runNext,Lp as runNotes,Rp as runPauseTask,jp as runPlan,vm as runProfileApply,Am as runProfileLint,wm as runProfileList,Em as runProfileShow,Xm as runProvenanceCoverageAnalytics,_k as runRegisteredCommandForTest,Ck as runRegisteredCommandOverrideForTest,Ok as runRegisteredExporterForTest,gk as runRegisteredHookForTest,vk as runRegisteredImporterForTest,Ak as runRegisteredMigrationForTest,hk as runRegisteredMutationGuardForTest,yk as runRegisteredParserOverrideForTest,bk as runRegisteredPreflightOverrideForTest,Tk as runRegisteredRendererOverrideForTest,wk as runRegisteredSearchProviderForTest,Sk as runRegisteredServiceOverrideForTest,Ek as runRegisteredVectorStoreAdapterForTest,dr as runReindex,tp as runRelease,cm as runRemind,gM as runReopen,Mp as runRestore,fl as runSchemaEvolutionMigration,om as runSearch,gy as runSearchRefreshWorkerEntrypoint,Bf as runStartBackgroundRun,Ip as runStartTask,of as runStats,sf as runTelemetry,Tm as runTemplatesList,Cm as runTemplatesSave,Sm as runTemplatesShow,mf as runTest,ff as runTestAll,qf as runTestRunsList,Vf as runTestRunsLogs,Kf as runTestRunsResume,zf as runTestRunsStatus,Hf as runTestRunsStop,Wf as runTestRunsWorker,vp as runUpdate,Dp as runUpdateMany,Wt as runUpgrade,lu as runValidate,Eh as runWithActiveExtensions,$ as runWithAgentSessionContext,Uw as runWithContextIntentContracts,rO as runWithDiscoveredContextIntentContracts,Vn as runWithHarnessDetectionSignals,B0 as runWithMcpTraceContext,gs as runWithReproducibleProcessEnvironment,Hn as runWithWorkspaceHarnessSignalDescriptors,Zr as runWithWorkspaceRecipe,fI as runWorkflowPolicyAction,FP as runWorkspaceTransactionGc,Hd as saveGraphAuditBaseline,ZO as scanExtensionHostVersions,Zd as scanHistoryAuthorAttribution,Rn as scanItemFormatVersions,ts as scanMutationSecrets,gI as scanProvenanceResolverHealth,ms as scanStaleInProgressItems,XI as scanStorageIntegrity,h_ as schema,w_ as schemaAddField,T_ as schemaAddStatus,b_ as schemaAddType,O_ as schemaApplyPreset,I_ as schemaInferTypes,g_ as schemaList,A_ as schemaListFields,M_ as schemaRemapStatus,E_ as schemaRemoveField,S_ as schemaRemoveStatus,C_ as schemaRemoveType,P_ as schemaRenameField,R_ as schemaRenameType,y_ as schemaShow,v_ as schemaShowField,k_ as schemaShowStatus,GM as scoreCommandPathMatch,DR as scoreContextCandidates,$R as scoreContextCandidatesWithActiveExtensions,ls as scoreItemSimilarity,JN as scorePmGrammarRefusalClosure,GN as scorePmRefusalClosure,us as scorePreparedItemSimilarity,eL as scoreTrackerPreflightRecoveryClosure,aE as sealHistoryRecord,d0 as sealMcpRequestState,Zf as search,sP as searchWorkspaceMemory,aP as searchWorkspaceMemoryReadResult,oR as selectActionableEntries,OS as selectCursorSemanticOptions,Nf as selectImportAuthor,$0 as selectMcpClientRegistrationMode,iP as selectWorkspaceMemory,nP as selectWorkspaceMemoryRollups,xu as semanticAttributionAffinity,HA as sentryCaptureCliError,VA as sentryFinishCommandSpan,WA as sentryFlush,KA as sentryLogCliUsageError,qA as sentrySetCommandContext,zA as sentryStartCommandSpan,xn as serializeItemDocument,VM as serializeNdjsonRows,HM as serializeNdjsonStream,sy as serveDeclaredObservation,iT as setActiveCommandContext,sT as setActiveCommandResult,ZC as setActiveExtensionCommands,JC as setActiveExtensionHooks,QC as setActiveExtensionParsers,eT as setActiveExtensionPreflight,oT as setActiveExtensionRegistrations,rT as setActiveExtensionRenderers,tT as setActiveExtensionServices,uS as setFocusedItem,tv as shouldCompletePlanOnClose,zd as shouldPersistDurableGraphCache,NT as shouldResolveMutationStdinTokenField,xT as shouldResolveMutationStdinTokens,oA as shouldRunSearchRefreshInForeground,ip as similarityAdvisoryWarnings,DS as sliceReadOutputRowCollection,Bl as sortLinkedArtifacts,wT as splitAcceptanceCriteria,ZA as splitCommaList,kn as splitFrontMatter,Ew as stabilizeReadOutputReceiptEstimates,P as stableStringify,BC as stableValueEquals,oh as startTask,ov as startTelemetryCommand,r_ as stats,XT as statusIsTerminal,Ih as stripGlobalBootstrapTokens,sM as subscribeMutationEventBatches,aM as subscribeMutationEvents,jP as summarizeAgentIdentityVocabulary,qm as summarizeAgentModelProvenance,zm as summarizeAgentProvenance,UR as summarizeContextEvaluationReports,af as summarizeContextPreflight,pO as summarizeHistoryProvenance,Yp as summarizeInitResult,II as summarizeMergeReceipt,bP as supportsCreateExplicitEmpty,PM as supportsItemIdAlias,gC as suppressHostOutput,Me as syncRelationshipGraphAdapter,dk as synthesizeExtensionManifest,kc as toCompletionFlagString,Hu as toContextFocusItem,qu as toContextPackingSummary,zu as toContextRankingSummary,rC as toErrorMessage,bf as toEstimatedMinutesValue,Bv as toExtensionFlagDefinitions,Ef as toImportBoolean,If as toImportConfidence,wf as toImportInteger,kf as toImportLinkedDocs,Mf as toImportLinkedFiles,xf as toImportLinkedTests,Pf as toImportLogEntries,Rf as toImportNormalizedEnum,Of as toImportNumberMap,Cf as toImportPriority,Sf as toImportStatus,Af as toImportStringList,vf as toImportStringMap,Tf as toImportTags,tS as toItemRecord,yf as toNonEmptyImportString,tC as toNonEmptyStringOrUndefined,hE as toReplayDocument,cs as tokenizeSimilarityText,kT as transferMutationStdinTokenPolicy,MC as translateHostEnvironmentFault,K_ as update,Th as upgrade,F_ as validate,wO as validateAssertionDefinition,AO as validateAssuranceDocument,EO as validateGateDefinition,JM as validateItemMutationRows,zl as validateLinkedPaths,F0 as validateMcpAuthorizationResponseIssuer,D0 as validateMcpAuthorizationServerMetadata,j0 as validateMcpClientMetadataDocument,I0 as validateMcpHttpRequestHeaders,m0 as validateMcpJsonSchema,SO as validateMeasurementDefinition,$E as validateMissingParentReference,bw as validateReadOutputOptions,GE as validateSprintOrReleaseValue,IC as validateTypeOptions,PP as verifyAttestation,bM as verifyCliFlagInvocationParity,pv as verifyExplicitPositionalSlotCensus,bE as verifyHistoryChain,yE as verifyHistoryChainWithVersion,Ov as verifyHistoryEntries,cE as verifyHistoryRecordHash,lE as verifyHistoryRewriteEvidence,hv as verifyPmCliGrammar,_v as verifyPmCommandPositionalContracts,aL as verifyPmFlagLexicon,MN as verifyPmRecoveryKindRuntimeCoverage,mb as verifyPmRecoveryProducerRuntimeCoverage,PN as verifyPmRecoveryReferences,LN as verifyPmRefusalClosureIdentityRatchet,NN as verifyPmRefusalClosureRatchet,RN as verifyPmRefusalReachability,xs as verifyToolOptionCliParity,Js as withFlagAliasMetadata,kC as withHostEnvironmentBoundary,p0 as withMcpCachePolicy,QS as workflowApprovalFingerprint,ew as workflowPolicyApplies,ZS as workflowPolicyFingerprint,fd as workspaceGraphCache,Cu as wrapOwnershipConflict,jM as wrapThrownErrorForSentry,Yn as writeAuthorEnvironment,je as writeFileAtomic,cC as writeMutationCheckpoint,eA as writeSettings,Jw as writeStderr,Yw as writeStdout,jA as writeVectorizationStatusLedger,ME as writeWorkspaceJsonWithHistory};
33
33
  //# sourceMappingURL=sdk.js.map