@unbrained/pm-cli 2026.10.22 → 2026.10.23

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 (149) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/CHANGELOG.md +17 -0
  3. package/dist/cli/error-guidance.d.ts +12 -0
  4. package/dist/cli/error-guidance.js +2 -2
  5. package/dist/cli/register-setup.js +1 -1
  6. package/dist/cli-bundle/bundle-manifest.json +1 -1
  7. package/dist/cli-bundle/chunks/{chunk-5LSN7K4N.js → chunk-2LTGJ5DL.js} +2 -2
  8. package/dist/cli-bundle/chunks/{chunk-E3JC3WQL.js → chunk-2UX2TAN2.js} +15 -15
  9. package/dist/cli-bundle/chunks/{chunk-2B5HAZFK.js → chunk-3S5FLCG7.js} +2 -2
  10. package/dist/cli-bundle/chunks/{chunk-J444ZX23.js → chunk-5DKCD4KV.js} +39 -39
  11. package/dist/cli-bundle/chunks/{chunk-LIC5EUQS.js → chunk-5V4HU6GK.js} +48 -48
  12. package/dist/cli-bundle/chunks/{chunk-UYYTV2TX.js → chunk-AAX7CNL7.js} +2 -2
  13. package/dist/cli-bundle/chunks/{chunk-AOAQDCXX.js → chunk-AXGFNNI3.js} +2 -2
  14. package/dist/cli-bundle/chunks/chunk-F76ZUP73.js +113 -0
  15. package/dist/cli-bundle/chunks/chunk-HDKY2YX3.js +3 -0
  16. package/dist/cli-bundle/chunks/{chunk-7OTYULIJ.js → chunk-KY34HTT2.js} +29 -29
  17. package/dist/cli-bundle/chunks/{chunk-TNU3XVPC.js → chunk-MMVX5L32.js} +3 -3
  18. package/dist/cli-bundle/chunks/{chunk-PCPOTFJP.js → chunk-MTRYEVZR.js} +2 -2
  19. package/dist/cli-bundle/chunks/{chunk-O67N62DT.js → chunk-QSY55FTA.js} +2 -2
  20. package/dist/cli-bundle/chunks/{chunk-GWIGZDRS.js → chunk-R7KWBFM2.js} +2 -2
  21. package/dist/cli-bundle/chunks/{chunk-HC2DCGFA.js → chunk-REXCO5AG.js} +2 -2
  22. package/dist/cli-bundle/chunks/chunk-ZDVTXLA6.js +9 -0
  23. package/dist/cli-bundle/chunks/{chunk-MV3KYY2A.js → chunk-ZEI3DC5E.js} +3 -3
  24. package/dist/cli-bundle/chunks/{chunk-URV4VHQ4.js → chunk-ZMJF5HQW.js} +2 -2
  25. package/dist/cli-bundle/chunks/chunk-ZNDYAZZ6.js +6 -0
  26. package/dist/cli-bundle/chunks/{indexed-receipt-blobs-L3BOTMZN.js → indexed-receipt-blobs-XANVELIV.js} +2 -2
  27. package/dist/cli-bundle/chunks/{mutation-admission-TATOFEXF.js → mutation-admission-P6LOBNLO.js} +2 -2
  28. package/dist/cli-bundle/chunks/{register-list-query-GULR2IYO.js → register-list-query-JOB65KDN.js} +2 -2
  29. package/dist/cli-bundle/chunks/{register-mutation-HLSQ4WVW.js → register-mutation-QMNIN3RJ.js} +2 -2
  30. package/dist/cli-bundle/chunks/{register-operations-FE3GGA7O.js → register-operations-Z4VET3I7.js} +2 -2
  31. package/dist/cli-bundle/chunks/register-setup-GNKWL3VL.js +2 -0
  32. package/dist/cli-bundle/chunks/{settlement-hook-UVFYSBMU.js → settlement-hook-YUVCO65H.js} +2 -2
  33. package/dist/cli-bundle/chunks/{stage-QCPZBZRC.js → stage-FW5OXCCR.js} +2 -2
  34. package/dist/cli-bundle/focused-chunks/{chunk-EHPRSWJE.js → chunk-4MNUQCGR.js} +2 -2
  35. package/dist/cli-bundle/focused-chunks/{chunk-CB7TSZ7P.js → chunk-6GTZ24YV.js} +2 -2
  36. package/dist/cli-bundle/focused-chunks/{chunk-2GFTVXKZ.js → chunk-BM652VCB.js} +3 -3
  37. package/dist/cli-bundle/focused-chunks/{chunk-3LWH2RJC.js → chunk-BUZ2Z4P3.js} +2 -2
  38. package/dist/cli-bundle/focused-chunks/{chunk-QGDKWULS.js → chunk-CGL36F6I.js} +2 -2
  39. package/dist/cli-bundle/focused-chunks/{chunk-TMN3RAXZ.js → chunk-DWQMYLFM.js} +2 -2
  40. package/dist/cli-bundle/focused-chunks/{chunk-SXVJRLLP.js → chunk-EDXTOAXP.js} +2 -2
  41. package/dist/cli-bundle/focused-chunks/chunk-FO4U3FIP.js +91 -0
  42. package/dist/cli-bundle/focused-chunks/chunk-GXKP56W7.js +2 -0
  43. package/dist/cli-bundle/focused-chunks/{chunk-46HBJC6J.js → chunk-I2USTQNQ.js} +2 -2
  44. package/dist/cli-bundle/focused-chunks/{chunk-XX5JQCLF.js → chunk-JDN34LEZ.js} +2 -2
  45. package/dist/cli-bundle/focused-chunks/{chunk-GVKYTDOH.js → chunk-KI5YFKNN.js} +2 -2
  46. package/dist/cli-bundle/focused-chunks/{chunk-UQ5JPBY2.js → chunk-LEHGCPZ6.js} +2 -2
  47. package/dist/cli-bundle/focused-chunks/{chunk-KM77WU5U.js → chunk-MLET6I3I.js} +2 -2
  48. package/dist/cli-bundle/focused-chunks/{chunk-25NQRZ7J.js → chunk-NSMZY6IK.js} +2 -2
  49. package/dist/cli-bundle/focused-chunks/chunk-OMXMYTEX.js +26 -0
  50. package/dist/cli-bundle/focused-chunks/{chunk-VYAZND5Q.js → chunk-P7DPS5M4.js} +2 -2
  51. package/dist/cli-bundle/focused-chunks/chunk-R536272H.js +9 -0
  52. package/dist/cli-bundle/focused-chunks/{chunk-CX5FNEFC.js → chunk-UNTCCJPL.js} +3 -3
  53. package/dist/cli-bundle/focused-chunks/{chunk-A52W6GLA.js → chunk-XIZYJDYW.js} +2 -2
  54. package/dist/cli-bundle/focused-chunks/{chunk-25L3L2PF.js → chunk-Z5LDTMZ3.js} +2 -2
  55. package/dist/cli-bundle/focused-chunks/chunk-ZHMF34DT.js +65 -0
  56. package/dist/cli-bundle/focused-chunks/{chunk-GC4VMLXL.js → chunk-ZR6ZKQUK.js} +3 -3
  57. package/dist/cli-bundle/focused-chunks/{indexed-receipt-blobs-AAQOKO5B.js → indexed-receipt-blobs-FVOA3XMI.js} +2 -2
  58. package/dist/cli-bundle/focused-chunks/{mutation-admission-TBKR4KRM.js → mutation-admission-HTFAIHJL.js} +2 -2
  59. package/dist/cli-bundle/focused-chunks/{settlement-hook-MNCHFCAX.js → settlement-hook-2VXEB6PP.js} +2 -2
  60. package/dist/cli-bundle/focused-chunks/{stage-RM6MJIMT.js → stage-X3BUGEJT.js} +2 -2
  61. package/dist/cli-bundle/main.js +21 -21
  62. package/dist/cli-bundle/sdk-authoring.js +1 -1
  63. package/dist/cli-bundle/sdk-contracts.js +5 -2
  64. package/dist/cli-bundle/sdk-core.js +33 -33
  65. package/dist/cli-bundle/sdk-governance.js +1 -1
  66. package/dist/cli-bundle/sdk-graph.js +1 -1
  67. package/dist/cli-bundle/sdk-merge.js +58 -58
  68. package/dist/cli-bundle/sdk-query.js +1 -1
  69. package/dist/cli-bundle/sdk-runtime.js +1 -1
  70. package/dist/cli-bundle/sdk-testing.js +1 -1
  71. package/dist/cli-bundle/sdk.js +12 -9
  72. package/dist/core/config/nested-settings.js +1 -1
  73. package/dist/core/extensions/loader.js +1 -1
  74. package/dist/core/extensions/version-diagnostics.d.ts +2 -0
  75. package/dist/core/extensions/version-diagnostics.js +2 -0
  76. package/dist/core/lock/lock.d.ts +40 -6
  77. package/dist/core/lock/lock.js +3 -3
  78. package/dist/core/shared/errors.d.ts +28 -0
  79. package/dist/core/shared/errors.js +1 -1
  80. package/dist/core/store/item-store.js +1 -1
  81. package/dist/mcp/http-server.js +2 -2
  82. package/dist/mcp/server.js +2 -2
  83. package/dist/sdk/cli-contracts/agent-output-contracts.js +1 -1
  84. package/dist/sdk/contracts.d.ts +1 -0
  85. package/dist/sdk/contracts.js +1 -1
  86. package/dist/sdk/extension/doctor.js +1 -1
  87. package/dist/sdk/extension/install-receipts.js +1 -1
  88. package/dist/sdk/extension/install-snapshot.d.ts +11 -0
  89. package/dist/sdk/extension/install-snapshot.js +1 -1
  90. package/dist/sdk/extension.d.ts +12 -0
  91. package/dist/sdk/extension.js +1 -1
  92. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1 -1
  93. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +1 -1
  94. package/dist/sdk/governance/health.d.ts +1 -0
  95. package/dist/sdk/governance/health.js +2 -2
  96. package/dist/sdk/index.d.ts +3 -2
  97. package/dist/sdk/index.js +1 -1
  98. package/dist/sdk/lifecycle/hierarchy-mutation-lock.js +1 -1
  99. package/dist/sdk/lifecycle/restore.js +1 -1
  100. package/dist/sdk/mcp/executable.d.ts +13 -0
  101. package/dist/sdk/mcp/executable.js +5 -0
  102. package/dist/sdk/public-surface.json +1 -1
  103. package/dist/sdk/runtime-primitives.d.ts +1 -1
  104. package/dist/sdk/runtime-primitives.js +1 -1
  105. package/dist/sdk/runtime.d.ts +1 -1
  106. package/dist/sdk/runtime.js +1 -1
  107. package/dist/sdk/workspace-snapshot.d.ts +5 -1
  108. package/dist/sdk/workspace-snapshot.js +3 -3
  109. package/dist/sdk/workspace.js +2 -2
  110. package/docs/CONFIGURATION.md +19 -3
  111. package/docs/EXTENSION_AUTHOR_CONTRACTS.md +2 -1
  112. package/docs/EXTENSION_LIFECYCLE.md +47 -0
  113. package/docs/MCP_REMOTE_TRANSPORT_SECURITY.md +16 -1
  114. package/docs/RELEASING.md +9 -0
  115. package/docs/SDK.md +39 -5
  116. package/docs/SDK_STORAGE_LIFECYCLE.md +2 -1
  117. package/docs/TESTING.md +11 -7
  118. package/docs/generated/REFUSAL_CLOSURE_CENSUS.md +6 -3
  119. package/marketplace.json +1 -1
  120. package/package.json +1 -1
  121. package/packages/pm-beads/package.json +1 -1
  122. package/packages/pm-calendar/package.json +1 -1
  123. package/packages/pm-command-kit/package.json +1 -1
  124. package/packages/pm-digital-twin/package.json +1 -1
  125. package/packages/pm-governance-audit/package.json +1 -1
  126. package/packages/pm-guide-shell/package.json +1 -1
  127. package/packages/pm-kanban/package.json +1 -1
  128. package/packages/pm-lifecycle-hooks/package.json +1 -1
  129. package/packages/pm-linked-test-adapters/package.json +1 -1
  130. package/packages/pm-search-advanced/package.json +1 -1
  131. package/packages/pm-templates/package.json +1 -1
  132. package/packages/pm-todos/package.json +1 -1
  133. package/packages/pm-vcs/package.json +1 -1
  134. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  135. package/plugins/pm-claude/package.json +1 -1
  136. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  137. package/plugins/pm-codex/package.json +1 -1
  138. package/plugins/pm-codex/plugin.json +1 -1
  139. package/runtime-dependencies.json +1 -1
  140. package/dist/cli-bundle/chunks/chunk-35ISFIPC.js +0 -113
  141. package/dist/cli-bundle/chunks/chunk-BAIVTLJM.js +0 -6
  142. package/dist/cli-bundle/chunks/chunk-C37RDYZI.js +0 -3
  143. package/dist/cli-bundle/chunks/chunk-VO3KDIU7.js +0 -9
  144. package/dist/cli-bundle/chunks/register-setup-XUIKAIZA.js +0 -2
  145. package/dist/cli-bundle/focused-chunks/chunk-DVNUHTVK.js +0 -9
  146. package/dist/cli-bundle/focused-chunks/chunk-QWKCQ5PW.js +0 -91
  147. package/dist/cli-bundle/focused-chunks/chunk-SOVXHW6Z.js +0 -2
  148. package/dist/cli-bundle/focused-chunks/chunk-UUPJ6OZL.js +0 -26
  149. package/dist/cli-bundle/focused-chunks/chunk-W2CND3BD.js +0 -65
@@ -1,5 +1,8 @@
1
- import{a as Fh}from"./chunks/chunk-UYYTV2TX.js";import{a as _0,b as h0,c as g0,d as y0}from"./chunks/chunk-PCPOTFJP.js";import{a as b0,b as T0,c as C0,d as w0,e as S0,f as E0,g as A0,h as v0,i as O0,j as I0,k as R0,l as M0,m as P0,n as k0,o as x0,p as N0,q as L0}from"./chunks/chunk-5LSN7K4N.js";import{A as p0,B as u0,C as m0,D as f0,a as Wn,b as IA,c as RA,d as $a,e as Fa,f as Ga,h as Ua,i as ja,j as Ba,k as qa,l as za,m as Va,n as Ha,o as Ka,p as od,q as nd,r as id,s as sd,t as ad,u as i0,v as s0,w as a0,x as d0,y as c0,z as l0}from"./chunks/chunk-HC2DCGFA.js";import{a as pS,b as uS,c as mS,d as fS,e as _S}from"./chunks/chunk-2B5HAZFK.js";import{A as dk,B as ck,C as lk,D as pk,E as uk,F as mk,G as fk,H as _k,I as hk,J as gk,K as yk,L as bk,M as Tk,N as Ck,O as wk,P as Sk,Q as Ek,R as Ak,S as vk,T as Ok,U as Ik,V as Rk,W as Mk,X as Pk,Y as kk,Z as xk,_ as Nk,a as D0,b as $0,c as F0,d as G0,e as U0,f as j0,g as B0,h as q0,i as z0,j as V0,k as H0,l as K0,m as W0,n as X0,o as Y0,p as J0,q as Z0,r as Q0,s as ek,t as tk,u as rk,v as ok,w as nk,x as ik,y as sk,z as ak}from"./chunks/chunk-URV4VHQ4.js";import{$ as Cm,$a as f_,$b as fh,A as sm,Aa as Df,Ab as j_,B as am,Ba as $f,Bb as B_,C as dm,Ca as Ff,Cb as q_,D as qt,Da as Gf,Db as z_,E as zt,Ea as Uf,Eb as V_,F as Vt,Fa as jf,Fb as H_,G as Ht,Ga as Bf,Gb as K_,H as Kt,Ha as qf,Hb as W_,I as Wt,Ia as zf,Ib as X_,J as Xt,Ja as Vf,Jb as Y_,K as Yt,Ka as Hf,Kb as J_,L as Jt,La as Kf,Lb as Z_,M as Zt,Ma as Wf,Mb as Q_,N as Qt,Na as Xf,Nb as eh,O as cm,Oa as Yf,Ob as th,P as lm,Pa as Jf,Pb as rh,Q as pm,Qa as Zf,Qb as oh,R as um,Ra as Qf,Rb as nh,S as mm,Sa as er,Sb as ih,T as Xe,Ta as he,Tb as sh,U as fm,Ua as a_,Ub as ah,V as _m,Va as d_,Vb as dh,W as hm,Wa as c_,Wb as ch,X as gm,Xa as l_,Xb as lh,Y as ym,Ya as p_,Yb as ph,Z as bm,Za as u_,Zb as uh,_ as Tm,_a as m_,_b as mh,a as iS,aa as UP,ab as __,ac as _h,b as sS,ba as jP,bb as h_,bc as hh,c as aS,ca as BP,cb as g_,cc as gh,d as dS,da as Nm,db as y_,dc as yh,e as cS,ea as Lm,eb as b_,ec as bh,f as lS,fa as Dm,fb as T_,fc as Th,g as aA,ga as Ef,gb as C_,gc as Ch,h as dA,ha as Af,hb as w_,hc as wh,i as Xi,ia as JP,ib as S_,ic as Sh,j as ZI,ja as ZP,jb as E_,jc as Eh,k as QI,ka as QP,kb as A_,kc as Ah,l as eR,la as e0,lb as v_,lc as vh,m as tR,ma as t0,mb as O_,mc as Oh,n as rR,na as r0,nb as I_,nc as Ih,o as oR,oa as o0,ob as R_,oc as Rh,p as hl,pa as n0,pb as M_,pc as Mh,q as Hp,qa as vf,qb as P_,qc as Ph,r as Kp,ra as Of,rb as k_,rc as kh,s as Jp,sa as If,sb as x_,sc as xh,t as Zp,ta as Rf,tb as N_,tc as Nh,u as gu,ua as Mf,ub as L_,uc as Lh,v as Eu,va as Pf,vb as D_,vc as Dh,w as IM,wa as kf,wb as $_,wc as $h,x as We,xa as xf,xb as F_,y as nm,ya as Nf,yb as G_,z as im,za as Lf,zb as U_}from"./chunks/chunk-E3JC3WQL.js";import{e as sR,f as aR,g as gl,h as yl,i as Ut}from"./chunks/chunk-C37RDYZI.js";import{A as RP,B as MP,C as PP,D as kP,E as xP,F as NP,G as LP,H as DP,I as $P,J as FP,K as GP,L as Em,M as Am,N as vm,O as Om,P as Im,Q as Rm,R as Mm,S as Pm,T as km,U as xm,a as pM,b as uM,c as mM,d as fM,e as _M,f as Vp,g as hM,h as gM,i as yM,j as bM,k as TM,m as Yp,n as wm,o as yP,p as bP,q as TP,r as CP,s as wP,t as SP,u as Sm,v as EP,w as AP,x as vP,y as OP,z as IP}from"./chunks/chunk-BAIVTLJM.js";import{$ as PI,$a as Xl,$b as eu,$c as Qm,A as sI,Aa as El,Ab as Np,Ac as Ou,Ad as r_,B as aI,Ba as Al,Bb as Lp,Bc as Ju,Bd as o_,C as dI,Ca as vl,Cb as Dp,Cc as Zu,Cd as n_,D as cI,Da as Ol,Db as $p,Dc as Qu,Dd as i_,E as lI,Ea as Il,Eb as Fp,Ec as em,Ed as s_,F as Ke,Fa as Rl,Fb as Gp,Fc as tm,G as pI,Ga as Ml,Gb as Up,Gc as rm,H as Nt,Ha as Pl,Hb as jp,Hc as om,I as uI,Ia as kl,Ib as Bp,Ic as $m,J as mI,Ja as xl,Jb as qp,Jc as Fm,K as fI,Ka as Nl,Kb as oM,Kc as Gm,L as _I,La as Ll,Lb as nM,Lc as Um,M as hI,Ma as Dl,Mb as iM,Mc as jm,N as gI,Na as $l,Nb as sM,Nc as Bm,O as yI,Oa as Fl,Ob as aM,Oc as qm,P as bI,Pa as Gl,Pb as dM,Pc as zm,Q as TI,Qa as Ul,Qb as cM,Qc as Vm,R as CI,Ra as jl,Rb as lM,Rc as WP,S as wI,Sa as lR,Sb as zp,Sc as XP,T as SI,Ta as Bl,Tb as CM,Tc as YP,U as EI,Ua as ql,Ub as wM,Uc as Hm,V as AI,Va as zl,Vb as SM,Vc as Km,W as vI,Wa as Vl,Wb as EM,Wc as Wm,X as OI,Xa as pR,Xb as AM,Xc as Xm,Y as II,Ya as Hl,Yb as Wp,Yc as Ym,Z as RI,Za as Kl,Zb as Xp,Zc as Jm,_ as MI,_a as Wl,_b as Qp,_c as Zm,a as JO,aa as kI,ab as Yl,ad as ef,b as Pt,ba as xI,bb as uR,bc as tu,bd as tf,c as ZO,ca as NI,cb as mR,cc as ru,cd as rf,d as Ve,da as LI,db as fR,dc as ou,dd as of,e as te,ea as DI,eb as _R,ec as nu,ed as nf,f as gc,fa as $I,fb as hR,fc as iu,fd as sf,gb as gR,gc as su,gd as af,ha as el,hb as yR,hc as au,hd as df,i as He,ia as tl,ib as FR,ic as du,id as cf,j as yc,ja as rl,jb as GR,jc as cu,jd as lf,k as bc,ka as ol,kb as UR,kc as lu,kd as pf,la as nl,lb as jR,lc as pu,ld as uf,m as _e,mb as BR,mc as uu,n as Tc,na as il,nb as qR,nc as mu,nd as mf,o as Cc,oa as sl,ob as zR,oc as fu,od as ff,p as wc,pa as al,pb as YR,pc as _u,pd as _f,q as Sc,qa as dl,qb as JR,qd as hf,r as QO,ra as nR,rb as Mp,rc as vM,rd as gf,s as eI,sa as iR,sb as Pp,sc as OM,sd as yf,t as tI,ta as cl,tb as ZR,tc as hu,td as bf,u as rI,ua as ll,ub as QR,uc as Au,ud as Tf,v as oI,va as pl,vb as eM,vd as Cf,w as kt,wa as ul,wb as tM,wd as wf,x as nI,xa as ml,xb as rM,xd as Sf,y as iI,ya as fl,yb as kp,yc as vu,yd as e_,z as xt,za as _l,zb as xp,zd as t_}from"./chunks/chunk-7OTYULIJ.js";import{f as nc}from"./chunks/chunk-O67N62DT.js";import{A as Fc,Aa as Wc,B as Gc,Ba as Xc,C as Lt,Ca as Yc,Ea as Jc,Fa as Zc,Ga as Qc,a as mA,b as fA,c as _A,d as Yi,e as Ji,f as Zi,g as Qi,h as es,ia as Dt,j as FI,ja as $t,ka as Ft,la as Gt,ma as Uc,oa as jc,pa as Bc,qa as qc,s as KI,t as WI,v as XI,va as zc,w as YI,wa as Vc,x as JI,y as Dc,ya as Hc,z as $c,za as Kc}from"./chunks/chunk-LIC5EUQS.js";import{$ as mc,$b as FM,$c as qP,A as xO,Aa as np,Ac as pP,B as NO,Ba as ip,Bb as VR,Bc as uP,C as LO,Ca as sp,Cb as HR,Cc as mP,Da as ap,Db as KR,Dc as jt,Ea as dp,Eb as WR,Ec as xu,Fa as cp,Fb as XR,Fc as Nu,Ga as lp,Gb as yu,Gc as Lu,Ha as pp,Hb as bu,Hc as Du,Ia as up,Ib as Tu,Ic as $u,Ja as mp,Jb as Cu,Jc as Fu,Ka as fp,Kb as wu,Kc as Gu,L as DO,La as _p,Lb as Su,Lc as Uu,M as $O,Ma as hp,Mb as Iu,Mc as ju,N as FO,Na as gp,Nb as Ru,Nc as Bu,O as GO,Oa as yp,Ob as Mu,Oc as qu,P as UO,Pa as bp,Pb as Pu,Pc as zu,Q as jO,Qa as Tp,Qb as RM,Qc as Vu,R as BO,Ra as Cp,Rb as MM,Rc as Hu,S as qO,Sa as wp,Sb as PM,Sc as Ku,T as ic,Ta as Sp,Tb as kM,Tc as Wu,U as sc,Ua as Ep,Ub as xM,Uc as Bt,V as ac,Va as Ap,Vb as NM,Vc as Xu,W as dc,Wa as vp,Wb as LM,Wc as fP,X as cc,Xa as Op,Xc as _P,Y as lc,Ya as Ip,Yb as ku,Yc as hP,Z as pc,Za as Rp,Zb as DM,Zc as Yu,_ as uc,_b as $M,_c as gP,a as $i,aa as fc,ac as GM,ad as zP,b as Fi,ba as _c,bb as bR,bc as UM,bd as VP,c as Gi,ca as ze,cb as TR,cc as jM,cd as HP,d as Ui,da as zO,db as CR,dc as BM,dd as KP,e as ji,ea as VO,eb as wR,ec as qM,fa as HO,fb as SR,fc as zM,g as nA,ga as KO,gb as ER,gc as VM,h as iA,ha as WO,hb as AR,hc as HM,i as sA,ia as XO,ib as vR,ic as KM,j as cA,ja as YO,jb as OR,jc as WM,k as lA,ka as hc,kb as IR,kc as XM,l as pA,la as bl,lb as RR,lc as YM,m as uA,ma as Tl,mb as MR,mc as JM,n as TO,na as Cl,nb as PR,nc as ZM,o as CO,oa as wl,oc as QM,p as wO,pa as dR,pc as eP,q as SO,qa as cR,qc as tP,r as EO,rb as kR,rc as rP,s as AO,sa as Sl,sc as oP,t as vO,ta as Jl,tb as xR,tc as nP,u as OO,ua as Zl,ub as NR,uc as iP,v as IO,va as Ql,vc as sP,w as RO,wa as ep,wc as aP,x as MO,xa as tp,xb as LR,xc as dP,y as PO,ya as rp,yb as DR,yc as cP,z as kO,za as op,zb as $R,zc as lP}from"./chunks/chunk-TNU3XVPC.js";import"./chunks/chunk-4D25HF3V.js";import{$ as Be,$a as Ks,$b as td,$d as Zv,$e as lO,A as KE,Aa as Ts,Ab as Ta,Ac as XA,Ad as Mv,Ae as dO,B as WE,Ba as Cs,Bb as Ca,Bc as YA,Bd as cd,Be as cO,Ca as ws,Cb as wa,Cd as Pv,Ce as Sd,D as XE,Da as Ss,Db as Sa,Dc as JA,De as Ed,E as YE,Ea as Es,Eb as Ea,Ec as ZA,Ed as kv,Ee as Ad,F as JE,Fa as As,Fb as Aa,Fc as QA,Fd as xv,Fe as vd,G as ZE,Ga as vs,Gb as va,Gc as ev,Gd as Nv,Ge as Od,H as Hi,Ha as Os,Hb as Oa,Hc as tv,Hd as Lv,He as Id,I as Ki,Ia as Is,Ib as Ia,Ic as rv,Id as Dv,Ie as Rd,Ja as Rs,Jb as Ra,Jc as ov,Jd as $v,Je as Md,K as Wi,Ka as Ms,Kb as Ma,Kc as nv,Kd as Fv,Ke as Pd,L as QE,La as Ps,Lb as Pa,Lc as iv,Ld as Gv,Le as kd,Ma as ks,Mb as ka,Md as Uv,Me as xd,N as eA,Na as xs,Nb as xa,Nc as sv,Nd as jv,Ne as Nd,O as tA,Oa as Ns,Ob as Na,Oc as av,Od as It,Oe as Ld,P as rA,Pa as Ls,Pb as La,Pc as dv,Pd as Bv,Pe as Dd,Qa as Ds,Qc as cv,Qe as $d,R as oA,Ra as $s,Rb as qe,Rc as lv,Re as Fd,Sa as Fs,Sb as ee,Sd as qv,Se as Gd,T as hA,Ta as Gs,Tb as Da,Tc as pv,Td as zv,Te as Ud,U as gA,Ua as Us,Ub as Wa,Ud as Vv,Ue as jd,V as yA,Va as js,Vb as Xa,Vc as uv,Vd as Hv,Ve as Bd,W as je,Wa as Bs,Wb as Ya,Wc as mv,Wd as Kv,We as qd,X as bA,Xa as qs,Xb as Ja,Xc as fv,Xd as Wv,Xe as zd,Y as TA,Ya as zs,Yb as Za,Yc as _v,Yd as Xv,Ye as Vd,Z as CA,Za as Vs,Zb as Qa,Zc as hv,Zd as Yv,Ze as Hd,_ as vt,_a as Hs,_b as ed,_d as Jv,aa as wA,ab as Ws,ac as rd,ae as ld,af as pO,b as vE,ba as SA,bb as Xs,bc as MA,be as pd,c as OE,ca as EA,cb as Ys,cc as PA,ce as ud,d as IE,da as AA,db as Js,dc as kA,de as md,df as uO,e as RE,ea as vA,eb as Zs,ec as xA,ee as fd,ef as mO,f as ME,fa as OA,fb as Qs,fc as NA,fe as _d,ff as fO,ga as ts,gb as ea,gc as LA,ge as hd,gf as _O,h as Bi,ha as rs,hb as ta,hc as DA,hd as gv,he as gd,hf as hO,i as qi,ia as os,ib as ra,id as yv,ie as yd,if as gO,j as zi,ja as ns,jb as oa,jc as $A,jd as bv,je as bd,jf as yO,ka as is,kb as na,kc as FA,kd as Tv,ke as Td,kf as bO,la as ss,lb as ia,ld as Cv,le as Cd,m as PE,ma as as,mb as sa,md as wv,me as wd,mf as Kd,na as ds,nb as aa,nc as dd,nd as Sv,ne as Qv,nf as Wd,oa as cs,ob as da,oc as GA,od as Ev,oe as eO,of as Xd,pa as ls,pb as ca,pc as UA,pd as Av,pe as tO,pf as Yd,q as Vi,qa as ps,qb as la,qc as jA,qd as Ot,qe as rO,qf as Jd,ra as us,rb as pa,rc as BA,re as oO,rf as Zd,s as At,sa as ms,sb as ua,sc as qA,sd as vv,se as nO,sf as Qd,t as kE,ta as fs,tb as ma,tc as zA,te as iO,tf as ec,u as xE,ua as _s,ub as fa,ud as Ov,ue as sO,uf as tc,v as NE,va as hs,vb as _a,vc as VA,vf as rc,w as LE,wa as gs,wb as ha,wc as HA,wf as oc,x as DE,xb as ga,xc as KA,xf as Mt,y as VE,ya as ys,yb as ya,yc as WA,yd as Iv,ye as Rt,z as HE,za as bs,zb as ba,zd as Rv,ze as aO}from"./chunks/chunk-J444ZX23.js";import"./chunks/chunk-RUKSEZE7.js";import{a as GI,b as UI,c as jI,d as BI,e as qI,f as zI,g as VI,h as Ic,i as Rc,j as Mc,k as Pc,l as kc,m as HI,n as xc,o as Nc,p as Lc}from"./chunks/chunk-MV3KYY2A.js";import"./chunks/chunk-IB7UB5TE.js";import{$a as IT,$b as jT,$c as On,$d as Bn,$f as OS,$g as gi,$h as lE,A as oT,Aa as Yo,Ac as JT,Ad as Rn,Ae as cw,Af as Xw,Ag as si,Ah as VS,Ai as FE,B as nT,Ba as Jo,Bb as Tn,Bc as wn,Bd as Mn,Be as lw,Bf as Yw,Bg as LS,Bh as HS,Bi as GE,Cb as Cn,Cd as Pn,Ce as pw,Cf as Jw,Cg as DS,Ch as KS,Ci as UE,D as iT,Da as Zo,Db as PT,Dc as Sn,De as uw,Df as Zw,Dh as WS,Di as jE,Ec as En,Ed as MC,Ee as mw,Ef as Qw,Eh as XS,Ei as BE,Fd as PC,Fe as fw,Fg as ai,Fh as YS,Fi as qE,G as sT,Gd as kC,Ge as _w,Gg as di,Gh as JS,Gi as zE,Hc as ZT,Hd as xC,He as hw,Hf as eS,Hg as $S,Hh as ZS,Ic as QT,Id as NC,Ie as gw,If as tS,Ig as ci,Ih as QS,J as aT,Jc as eC,Jd as LC,Je as yw,Jf as rS,Jg as li,Jh as eE,Kc as tC,Kd as DC,Ke as bw,Kg as FS,Kh as tE,Lc as rC,Ld as $C,Le as Tw,Lf as oS,Lg as pi,Lh as rE,M as dT,Mc as oC,Md as FC,Me as Cw,Mf as nS,Mg as ui,Mh as oE,N as Uo,Nc as nC,Nd as GC,Nf as Xn,Ng as D,O as jo,Ob as kT,Oc as An,Od as UC,Oe as St,Of as Yn,Og as mi,Oh as nE,P as Bo,Pa as R,Pc as iC,Pd as jC,Pf as Jn,Ph as Ni,Qa as yT,Qb as xT,Qc as sC,Qe as Et,Qf as hS,Qh as Li,Ra as Tt,Rb as NT,Rd as kn,Rf as gS,Rh as iE,Sa as bT,Sb as LT,Sd as xn,Se as Hn,Sf as yS,T as qo,Ta as TT,Tb as DT,Tc as aC,Td as Nn,Te as Kn,Tf as bS,Ua as CT,Ub as $T,Uc as dC,Ud as Ln,Ue as fe,Uf as TS,V as zo,Va as wT,Vc as cC,Vd as Dn,Vf as CS,Vg as GS,W as Vo,Wa as ST,Wb as FT,Wc as lC,Wd as $n,We as ww,Wf as wS,Wg as US,Wh as sE,X as Ho,Xa as ET,Xb as GT,Xc as pC,Xd as Fn,Xf as SS,Xg as jS,Xh as aE,Ya as AT,Yc as uC,Yd as Gn,Ye as Sw,Yf as ES,Yg as fi,Yh as dE,Za as vT,Zc as vn,Zd as Un,Zf as AS,Zg as _i,Zh as cE,_a as OT,_b as UT,_c as mC,_d as jn,_f as vS,_g as hi,a as Io,ab as RT,ac as BT,ae as qn,af as Ue,ag as IS,ah as yi,ai as pE,b as Ro,bb as Qo,bc as qT,bd as fC,be as zn,bf as Ew,bh as bi,c as Mo,cb as en,cd as _C,ce as Vn,cf as Aw,ch as Ti,ci as uE,d as Po,db as tn,dd as hC,de as BC,df as vw,dh as Ci,e as xe,eb as rn,ed as gC,ee as qC,ef as Ow,eh as wi,ei as mE,f as ko,fb as on,fc as zT,fd as yC,fe as zC,ff as Iw,fh as Si,fi as fE,g as L,gb as nn,ge as VC,gf as Rw,gh as Ei,gi as _E,h as Ne,hb as sn,hc as VT,hd as In,he as HC,hf as Mw,hg as RS,hh as Ai,hi as hE,i as xo,ib as Fe,ie as KC,if as Pw,ih as vi,ii as gE,j as No,jb as Ge,jd as bC,je as WC,jf as kw,jh as Oi,ji as yE,k as Lo,ka as cT,kb as an,kd as TC,kf as xw,kg as Zn,kh as Ii,ki as bE,l as Do,la as lT,lb as dn,ld as CC,lf as Nw,lg as MS,lh as BS,li as TE,m as Gb,ma as pT,mb as cn,md as wC,me as XC,mf as Lw,mg as Qn,mh as qS,mi as CE,n as Le,nb as ln,nd as SC,ne as YC,nf as Dw,nh as Ri,o as yt,ob as pn,od as EC,oe as JC,of as $w,og as PS,oh as zS,p as Ub,pa as Ko,pb as un,pd as AC,pe as ZC,pf as Fw,pg as kS,ph as Mi,q as jb,qa as uT,qb as mn,qd as vC,qe as QC,qf as Gw,qh as Pi,qi as wE,r as Bb,ra as mT,rb as fn,rd as OC,re as ew,rf as Uw,rg as xS,rh as ki,s as qb,sa as fT,sb as _n,sd as IC,se as tw,sf as jw,sg as NS,sh as xi,t as z,ta as _T,tb as hn,tc as HT,td as RC,te as rw,tf as Bw,tg as ei,ti as SE,u as zb,ub as gn,uc as KT,ue as ow,uf as qw,ug as ti,va as Wo,vb as yn,vc as WT,ve as nw,vf as zw,w as Qb,wa as Xo,wb as bn,we as iw,wf as Vw,wg as ri,wi as EE,x as eT,xa as $e,xc as XT,xe as sw,xf as Hw,xg as oi,xi as Di,y as tT,ya as hT,yc as YT,yd as Ct,ye as aw,yf as Kw,yg as ni,yi as AE,z as rT,za as gT,zb as MT,zd as wt,ze as dw,zf as Ww,zg as ii,zi as $E}from"./chunks/chunk-35ISFIPC.js";import{a as Ec,b as Ac,e as vc,f as Oc}from"./chunks/chunk-VO3KDIU7.js";import"./chunks/chunk-VS565KBX.js";import{A as ue,B as Zb,C as b,E as $o,F as bt,G as me,H as Fo,K as De,M as Go,b as Vb,c as Hb,d as Kb,m as Wb,r as Xb,u as Yb,y as Jb}from"./chunks/chunk-GWIGZDRS.js";import"./chunks/chunk-XAWE4EAK.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="8f11e0bf-4115-55a8-bd39-c360f43cdc09")}catch{}})();var V="2026-07-28",Lk=["2025-11-25","2025-06-18"],Ye=[V],m={headerMismatch:-32020,missingRequiredClientCapability:-32021,unsupportedProtocolVersion:-32022,invalidParams:-32602},E={clientCapabilities:"io.modelcontextprotocol/clientCapabilities",clientInfo:"io.modelcontextprotocol/clientInfo",logLevel:"io.modelcontextprotocol/logLevel",protocolVersion:"io.modelcontextprotocol/protocolVersion",serverInfo:"io.modelcontextprotocol/serverInfo"},tr=["debug","info","notice","warning","error","critical","alert","emergency"],u=class extends Error{code;data;constructor(t,r,o={}){super(t),this.name="PmMcpProtocolError",this.code=r,this.data=o}};function h(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Gh(e){if(e===void 0)return;if(!h(e))throw new u("Invalid MCP clientInfo metadata",m.invalidParams,{field:E.clientInfo,expected:"object"});let t=typeof e.name=="string"?e.name.trim():"",r=typeof e.version=="string"?e.version.trim():"";if(t.length===0||r.length===0)throw new u("Invalid MCP clientInfo metadata",m.invalidParams,{field:E.clientInfo,required:["name","version"]});let o={name:t.slice(0,128),version:r.slice(0,128)};return typeof e.description=="string"&&e.description.trim()&&(o.description=e.description.trim().slice(0,1024)),typeof e.websiteUrl=="string"&&e.websiteUrl.trim()&&(o.websiteUrl=e.websiteUrl.trim().slice(0,2048)),o}function Uh(e){if(e!==void 0){if(typeof e!="string"||!tr.includes(e))throw new u("Invalid MCP logLevel metadata",m.invalidParams,{field:E.logLevel,allowed:[...tr]});return e}}function Je(e){let t=h(e)?e._meta:void 0;if(!h(t))throw new u("Missing required MCP request metadata",m.invalidParams,{required:[E.protocolVersion,E.clientCapabilities]});let r=t[E.protocolVersion];if(typeof r!="string"||!Ye.includes(r))throw new u("Unsupported protocol version",m.unsupportedProtocolVersion,{supported:[...Ye],requested:typeof r=="string"?r:null});let o=t[E.clientCapabilities];if(!h(o))throw new u("Invalid MCP client capabilities metadata",m.invalidParams,{field:E.clientCapabilities,expected:"object"});let n=Gh(t[E.clientInfo]),s=Uh(t[E.logLevel]);return{protocolVersion:V,clientCapabilities:o,...n?{clientInfo:n}:{},...s?{logLevel:s}:{}}}function Dk(e,t){if(t!==e.protocolVersion)throw new u("MCP protocol header does not match request metadata",m.headerMismatch,{header:t??null,metadata:e.protocolVersion})}function $k(e,t){let r=t.filter(o=>!Object.prototype.hasOwnProperty.call(e.clientCapabilities,o));if(r.length>0)throw new u("Missing required client capability",m.missingRequiredClientCapability,{requiredCapabilities:Object.fromEntries(r.map(o=>[o,{}]))})}function Fk(e,t){let r=e.clientCapabilities.extensions;return h(r)&&h(r[t])}function Ze(e,t){let r=h(e._meta)?e._meta:{};return{...e,_meta:{...r,[E.serverInfo]:{...t}}}}function jh(e,t){return Ze({...e,resultType:"complete"},t)}function Gk(e){let t=e.ttlMs??6e4;if(!Number.isFinite(t)||t<0)throw new u("Invalid MCP discovery cache TTL",m.invalidParams,{ttlMs:t});return jh({supportedVersions:[...Ye],capabilities:structuredClone(e.capabilities),ttlMs:t,cacheScope:"public",...e.instructions?{instructions:e.instructions}:{}},e.serverInfo)}function Uk(e,t){if(h(e)&&typeof e.resultType=="string")return e.resultType;if(t==="legacy")return"complete";throw new u("Modern MCP result is missing resultType",m.invalidParams,{required:"resultType"})}import{createHash as nr,createHmac as ir,timingSafeEqual as Bh}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="15b81dd0-ef1a-58be-b6ee-5975b6778993")}catch{}})();var qh=["elicitation/create","roots/list","sampling/createMessage"],rr=class extends Error{inputRequests;requestState;constructor(t){super("MCP operation requires additional input"),this.name="PmMcpInputRequiredError",this.inputRequests=t.inputRequests,this.requestState=t.requestState}},sr=/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/u,ge=32,et=64*1024,ye=16*1024,Qe={maxBytes:256*1024,maxDepth:32,maxNodes:4096};function zh(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 u(`Invalid ${r}: value is not JSON serializable`,m.invalidParams,{field:r})}if(Buffer.byteLength(o,"utf8")>t)throw new u(`Invalid ${r}: payload exceeds the protocol bound`,m.invalidParams,{field:r,maximumBytes:t})}function tt(e,t){if(!h(e))throw new u("Invalid MCP inputRequests",m.invalidParams,{field:"inputRequests",expected:"object"});let r=Object.entries(e);if(r.length===0||r.length>ge)throw new u("Invalid MCP inputRequests count",m.invalidParams,{minimum:1,maximum:ge,observed:r.length});let o={};for(let[n,s]of r){if(!sr.test(n)||!h(s))throw new u("Invalid MCP input request entry",m.invalidParams,{field:`inputRequests.${n}`});let i=s.method;if(typeof i!="string"||!qh.includes(i))throw new u("Unsupported MCP input request method",m.invalidParams,{field:`inputRequests.${n}.method`,method:i??null});let a=zh(i);if(!Object.prototype.hasOwnProperty.call(t.clientCapabilities,a))throw new u("Missing required client capability",m.missingRequiredClientCapability,{requiredCapabilities:{[a]:{}}});if(!h(s.params))throw new u("Invalid MCP input request parameters",m.invalidParams,{field:`inputRequests.${n}.params`,expected:"object"});o[n]={method:i,params:structuredClone(s.params)}}return be(o,et,"inputRequests"),o}function ar(e){if(!h(e))throw new u("Invalid MCP inputResponses",m.invalidParams,{field:"inputResponses",expected:"object"});let t=Object.entries(e);if(t.length>ge)throw new u("Invalid MCP inputResponses count",m.invalidParams,{maximum:ge,observed:t.length});let r={};for(let[o,n]of t){if(!sr.test(o)||!h(n))throw new u("Invalid MCP input response entry",m.invalidParams,{field:`inputResponses.${o}`});r[o]=structuredClone(n)}return be(r,et,"inputResponses"),r}function zk(e){let t=e.requestState?.trim();if(t&&Buffer.byteLength(t,"utf8")>ye)throw new u("Invalid MCP requestState: payload exceeds the protocol bound",m.invalidParams,{field:"requestState",maximumBytes:ye});let r=e.inputRequests===void 0?void 0:tt(e.inputRequests,e.requestContext);if(r===void 0&&!t)throw new u("InputRequiredResult requires inputRequests or requestState",m.invalidParams,{requiredAnyOf:["inputRequests","requestState"]});return{resultType:"input_required",...r?{inputRequests:r}:{},...t?{requestState:t}:{},_meta:{[E.serverInfo]:{...e.serverInfo}}}}function dr(e){let t=Buffer.from(e);if(t.byteLength<32)throw new u("MCP requestState signing key must contain at least 32 bytes",m.invalidParams,{minimumBytes:32});return t}function Vk(e,t){if(!Number.isSafeInteger(e.expiresAt)||e.expiresAt<=0||e.method.trim().length===0||e.parameterDigest.trim().length===0||e.principal.trim().length===0)throw new u("Invalid MCP requestState payload",m.invalidParams);let r=Buffer.from(JSON.stringify({version:1,...e}),"utf8");if(r.byteLength>ye/2)throw new u("MCP requestState payload exceeds the protocol bound",m.invalidParams,{maximumBytes:ye/2});let o=r.toString("base64url"),n=ir("sha256",dr(t)).update(o).digest("base64url");return`${o}.${n}`}function Vh(e){if(!h(e)||e.version!==1)throw new u("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});let{expiresAt:t,method:r,parameterDigest:o,principal:n,state:s}=e;if(typeof t!="number"||!Number.isSafeInteger(t))throw new u("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});if(typeof r!="string"||typeof o!="string"||typeof n!="string")throw new u("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});return{expiresAt:t,method:r,parameterDigest:o,principal:n,state:s}}function Hk(e,t,r){let[o,n,s]=e.split(".");if(!o||!n||s!==void 0)throw new u("Invalid MCP requestState encoding",m.invalidParams,{field:"requestState"});let i=Buffer.from(n,"base64url"),a=ir("sha256",dr(t)).update(o).digest();if(i.byteLength!==a.byteLength||!Bh(i,a))throw new u("Invalid MCP requestState signature",m.invalidParams,{field:"requestState"});let d;try{d=JSON.parse(Buffer.from(o,"base64url").toString("utf8"))}catch{d=null}let c=Vh(d),{expiresAt:l,method:p,parameterDigest:f,principal:_}=c;if(l<(r.nowMs??Date.now()))throw new u("Expired MCP requestState",m.invalidParams,{field:"requestState",expiredAt:l});if(p!==r.method||f!==r.parameterDigest||_!==r.principal)throw new u("MCP requestState binding mismatch",m.invalidParams,{field:"requestState"});return c}function Kk(e){return be(e,et,"request parameters"),nr("sha256").update(JSON.stringify(e)).digest("hex")}var or=class{#e=new Set;#t;constructor(t=4096){if(!Number.isSafeInteger(t)||t<1)throw new u("Invalid MCP replay guard capacity",m.invalidParams,{maximumEntries:t});this.#t=t}consume(t){let r=nr("sha256").update(t).digest("hex");if(this.#e.has(r))throw new u("MCP requestState replay detected",m.invalidParams,{field:"requestState"});if(this.#e.size>=this.#t){let o=this.#e.values().next().value;this.#e.delete(o)}this.#e.add(r)}};function Hh(e){if(!Number.isSafeInteger(e.ttlMs)||e.ttlMs<0||e.cacheScope!=="public"&&e.cacheScope!=="private")throw new u("Invalid MCP cache policy",m.invalidParams,{ttlMs:e.ttlMs,cacheScope:e.cacheScope});return{ttlMs:e.ttlMs,cacheScope:e.cacheScope}}function Wk(e,t){return{...e,...Hh(t)}}function Kh(e){return e.replaceAll("~1","/").replaceAll("~0","~")}function Wh(e,t){if(t==="#")return e;if(!t.startsWith("#/"))return;let r=e;for(let o of t.slice(2).split("/").map(Kh)){if(!h(r)&&!Array.isArray(r)||!Object.prototype.hasOwnProperty.call(r,o))return;r=r[o]}return r}function Xh(e){let t=e.maxBytes??Qe.maxBytes,r=e.maxDepth??Qe.maxDepth,o=e.maxNodes??Qe.maxNodes;if(!Number.isSafeInteger(t)||t<2)throw new u("Invalid MCP JSON Schema work bounds",m.invalidParams);if(!Number.isSafeInteger(r)||r<1)throw new u("Invalid MCP JSON Schema work bounds",m.invalidParams);if(!Number.isSafeInteger(o)||o<1)throw new u("Invalid MCP JSON Schema work bounds",m.invalidParams);return{maximumBytes:t,maximumDepth:r,maximumNodes:o}}function Yh(e,t){let r=Array.isArray(e.value)?e.value:h(e.value)?Object.values(e.value):[];for(let o of r)t.push({value:o,depth:e.depth+1})}function Jh(e,t){if(!h(t)||typeof t.$ref!="string")return;let r=t.$ref;if(r.startsWith("#")&&Wh(e,r)===void 0)throw new u("MCP JSON Schema contains an unresolved local reference",m.invalidParams,{reference:r})}function Xk(e,t={}){let{maximumBytes:r,maximumDepth:o,maximumNodes:n}=Xh(t);if(typeof e!="boolean"&&!h(e))throw new u("Invalid MCP JSON Schema root",m.invalidParams,{expected:"object or boolean"});be(e,r,"JSON Schema");let s=[{value:e,depth:0}],i=0;for(;s.length>0;){let a=s.pop();if(i+=1,i>n||a.depth>o)throw new u("MCP JSON Schema exceeds validation work bounds",m.invalidParams,{maximumDepth:o,maximumNodes:n});Jh(e,a.value),Yh(a,s)}return structuredClone(e)}import{randomUUID as Zh}from"node:crypto";import{readFile as Qh}from"node:fs/promises";import cr from"node:path";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="f3e94896-b2a0-561c-902b-71c28ddde2a1")}catch{}})();var ox="io.modelcontextprotocol/tasks",eg=["working","input_required","completed","failed","cancelled"],tg=/^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,rg=3600*1e3,og=1e3,Ce=1024,ng=30,ig=2e3;function rt(e){return new u(e,m.invalidParams,{code:"mcp_task_not_found_or_not_authorized"})}function Te(e){let t=e.trim();if(!tg.test(t))throw rt("Unknown MCP task");return t}function lr(e,t){if(typeof e!="string"||!Number.isFinite(Date.parse(e)))throw new u("Corrupt MCP task record",m.invalidParams,{field:t});return e}function pr(e){if(!h(e)||typeof e.code!="number"||!Number.isFinite(e.code)||typeof e.message!="string")throw new u("Corrupt MCP task error",m.invalidParams);return{code:e.code,message:e.message.slice(0,Ce),...h(e.data)?{data:structuredClone(e.data)}:{}}}function sg(e){if(!eg.includes(e))throw new u("Corrupt MCP task record",m.invalidParams);return e}function ag(e){if(typeof e!="string"||e.length===0)throw new u("Corrupt MCP task record",m.invalidParams);return e}function dg(e){if(typeof e!="number"||!Number.isSafeInteger(e)||e<1)throw new u("Corrupt MCP task record",m.invalidParams);return e}function cg(e){if(e!==null&&(typeof e!="number"||!Number.isSafeInteger(e)||e<0))throw new u("Corrupt MCP task record",m.invalidParams);return e}function lg(e){if(e!==void 0){if(typeof e!="number"||!Number.isSafeInteger(e)||e<0)throw new u("Corrupt MCP task record",m.invalidParams);return e}}function pg(e){if(!Array.isArray(e)||e.some(t=>typeof t!="string"))throw new u("Corrupt MCP task record",m.invalidParams);return[...e]}function ug(e){if(!h(e)||e.version!==1)throw new u("Corrupt MCP task record",m.invalidParams);let t=typeof e.taskId=="string"?Te(e.taskId):"",r=sg(e.status),o=ag(e.principal),n=dg(e.workerPid),s=cg(e.ttlMs),i=lg(e.pollIntervalMs),a={version:1,taskId:t,status:r,principal:o,workerPid:n,createdAt:lr(e.createdAt,"createdAt"),lastUpdatedAt:lr(e.lastUpdatedAt,"lastUpdatedAt"),ttlMs:s,consumedInputKeys:pg(e.consumedInputKeys),...typeof e.statusMessage=="string"?{statusMessage:e.statusMessage.slice(0,Ce)}:{},...typeof i=="number"?{pollIntervalMs:i}:{}};if(h(e.inputRequests)&&(a.inputRequests=structuredClone(e.inputRequests)),h(e.inputResponses)&&(a.inputResponses=structuredClone(e.inputResponses)),h(e.result)&&(a.result=structuredClone(e.result)),e.error!==void 0&&(a.error=pr(e.error)),a.status==="input_required"&&!a.inputRequests||a.status==="completed"&&!a.result||a.status==="failed"&&!a.error)throw new u("Corrupt MCP task status payload",m.invalidParams,{status:a.status});return a}function H(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 re(e){return e==="completed"||e==="failed"||e==="cancelled"}function mg(e){try{return process.kill(e,0),!0}catch(t){return!(typeof t=="object"&&t!==null&&"code"in t&&t.code==="ESRCH")}}var ot=class{#e;#t;#r;#o;#i;constructor(t){this.#e=cr.resolve(t.pmRoot),this.#t=t.owner?.trim()||"pm-mcp",this.#r=t.now??(()=>new Date),this.#o=t.taskIdFactory??(()=>`mcp-task-${Zh()}`),this.#i=t.workerPid??process.pid}#s(t){return cr.join(this.#e,"runtime","mcp-tasks","records",`${Te(t)}.json`)}async#d(t){try{return ug(JSON.parse(await Qh(this.#s(t),"utf8")))}catch(r){throw me(r)||r instanceof SyntaxError?rt("Unknown MCP task"):r}}async#a(t){await De(this.#s(t.taskId),`${JSON.stringify(t,null,2)}
2
- `)}async#n(t,r,o){let n=Te(t),s=await Ue(this.#e,n,ng,this.#t,!1,!1,ig);try{let i=await this.#d(n);if(i.principal!==r)throw rt("Unknown MCP task");let a=o(i);return await this.#a(a),a}finally{await s()}}async create(t){let r=Te(this.#o()),o=t.principal.trim(),n=t.ttlMs===void 0?rg:t.ttlMs,s=t.pollIntervalMs??og;if(o.length===0||n!==null&&(!Number.isSafeInteger(n)||n<0)||!Number.isSafeInteger(s)||s<0)throw new u("Invalid MCP task creation options",m.invalidParams);let i=this.#r().toISOString(),a={version:1,taskId:r,status:"working",createdAt:i,lastUpdatedAt:i,ttlMs:n,pollIntervalMs:s,principal:o,workerPid:this.#i,consumedInputKeys:[],...t.statusMessage?.trim()?{statusMessage:t.statusMessage.trim().slice(0,Ce)}:{}};return await this.#a(a),{...H(a),resultType:"task"}}async get(t,r){return H(await this.#n(t,r,o=>{if(re(o.status))return o;let n=this.#r().getTime(),s=o.ttlMs!==null&&Date.parse(o.createdAt)+o.ttlMs<=n,i=o.workerPid!==this.#i&&!mg(o.workerPid);return!s&&!i?o:{...o,status:"failed",statusMessage:s?"Task retention expired before completion.":"Task worker ended before recording a terminal result.",lastUpdatedAt:this.#r().toISOString(),error:{code:-32603,message:s?"MCP task expired":"MCP task worker unavailable after restart",data:{recoverable:!1,createNewTask:!0}},inputRequests:void 0}}))}async requireInput(t){let r=tt(t.inputRequests,t.requestContext);return H(await this.#n(t.taskId,t.principal,o=>{if(re(o.status))return o;let n=Object.keys(r).filter(s=>o.consumedInputKeys.includes(s));if(n.length>0)throw new u("MCP task input request keys must be unique for the task lifetime",m.invalidParams,{reused:n});return{...o,status:"input_required",statusMessage:t.statusMessage?.trim().slice(0,Ce),lastUpdatedAt:this.#r().toISOString(),inputRequests:r}}))}async update(t,r,o){let n=ar(o),s=[],i=[];return await this.#n(t,r,a=>{if(a.status!=="input_required"||!a.inputRequests)return a;let d={...a.inputRequests},c=a.inputResponses?{...a.inputResponses}:{};for(let[l,p]of Object.entries(n))Object.prototype.hasOwnProperty.call(d,l)&&(c[l]=p,delete d[l],s.push(l));return i=Object.keys(d).sort(),s.length===0?a:{...a,status:i.length===0?"working":"input_required",lastUpdatedAt:this.#r().toISOString(),inputRequests:i.length===0?void 0:d,inputResponses:c,consumedInputKeys:[...new Set([...a.consumedInputKeys,...s])].sort()}}),{acceptedKeys:s.sort(),remainingKeys:i}}async takeInputResponses(t,r){let o={};return await this.#n(t,r,n=>(o=structuredClone(n.inputResponses??{}),Object.keys(o).length===0?n:{...n,inputResponses:void 0})),o}async complete(t,r,o){return H(await this.#n(t,r,n=>re(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=pr(o);return H(await this.#n(t,r,s=>re(s.status)?s:{...s,status:"failed",statusMessage:n.message,lastUpdatedAt:this.#r().toISOString(),error:n,inputRequests:void 0,result:void 0}))}async cancel(t,r){return H(await this.#n(t,r,o=>re(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 nx(e){return new ot(e)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="15cbe26a-5716-5e8c-8700-eb36a1a056d6")}catch{}})();var we="io.modelcontextprotocol/subscriptionId",ur=256,mr=2048,fg=5e3;function _g(e,t){return new Promise((r,o)=>{let n=setTimeout(()=>o(new Error("MCP subscription sink write timed out")),fg);n.unref(),Promise.resolve().then(()=>e(t)).then(()=>{clearTimeout(n),r()},s=>{clearTimeout(n),o(s instanceof Error?s:new Error(String(s)))})})}function nt(e,t){if(e!==void 0){if(typeof e!="boolean")throw new u("Invalid MCP subscription filter",m.invalidParams,{field:`notifications.${t}`,expected:"boolean"});return e||void 0}}function hg(e){if(!h(e))throw new u("Invalid MCP subscription filter",m.invalidParams,{field:"notifications",expected:"object"});let t=nt(e.toolsListChanged,"toolsListChanged"),r=nt(e.promptsListChanged,"promptsListChanged"),o=nt(e.resourcesListChanged,"resourcesListChanged"),n;if(e.resourceSubscriptions!==void 0){if(!Array.isArray(e.resourceSubscriptions)||e.resourceSubscriptions.length>ur)throw new u("Invalid MCP resource subscriptions",m.invalidParams,{field:"notifications.resourceSubscriptions",maximum:ur});let s=new Set;for(let i of e.resourceSubscriptions){if(typeof i!="string"||i.trim().length===0||Buffer.byteLength(i,"utf8")>mr)throw new u("Invalid MCP resource subscription URI",m.invalidParams,{field:"notifications.resourceSubscriptions",maximumBytes:mr});s.add(i)}s.size>0&&(n=[...s].sort())}return{...t?{toolsListChanged:t}:{},...r?{promptsListChanged:r}:{},...o?{resourcesListChanged:o}:{},...n?{resourceSubscriptions:n}:{}}}function gg(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 fr=class{#e;#t=new Map;#r;constructor(t){this.#e=structuredClone(t.capabilities),this.#r={...t.serverInfo}}get size(){return this.#t.size}async open(t){if(this.#t.has(t.id))throw new u("MCP subscription id is already active",m.invalidParams,{subscriptionId:t.id});let r=gg(hg(t.notifications),this.#e),o={filter:r,sink:t.sink,writeQueue:Promise.resolve()};this.#t.set(t.id,o);try{await this.#o(t.id,o,{jsonrpc:"2.0",method:"notifications/subscriptions/acknowledged",params:{_meta:{[we]:t.id},notifications:structuredClone(r)}},!0)}catch(n){throw this.#t.delete(t.id),n}return structuredClone(r)}async emitListChanged(t){let r=`${t}ListChanged`,o=`notifications/${t}/list_changed`,n=[];for(let[s,i]of this.#t)i.filter[r]===!0&&n.push(this.#o(s,i,{jsonrpc:"2.0",method:o,params:{_meta:{[we]:s}}}));return(await Promise.all(n)).filter(Boolean).length}async emitResourceUpdated(t){let r=[];for(let[o,n]of this.#t)n.filter.resourceSubscriptions?.includes(t)&&r.push(this.#o(o,n,{jsonrpc:"2.0",method:"notifications/resources/updated",params:{_meta:{[we]:o},uri:t}}));return(await Promise.all(r)).filter(Boolean).length}async#o(t,r,o,n=!1){let s=r.writeQueue.then(async()=>{if(this.#t.get(t)!==r)return!1;try{return await _g(r.sink,o),!0}catch(i){if(this.#t.get(t)===r&&this.#t.delete(t),n)throw i;return!1}});return r.writeQueue=s.then(()=>{},()=>{}),s}close(t){if(this.#t.delete(t))return{...Ze({resultType:"complete",_meta:{[we]:t}},this.#r)}}closeAll(){let t=[];for(let r of this.#t.keys()){let o=this.close(r);t.push({id:r,result:o})}return t}};(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="3681273a-e101-57a0-9446-982c450e7183")}catch{}})();var _r=/^=\?base64\?([A-Za-z0-9+/]*={0,2})\?=$/u,yg=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/u,hr=/^[\t\x20-\x7E]*$/u,gr=new Set(["prompts/get","resources/read","tools/call"]);function bg(e){let t=new Map;for(let[r,o]of Object.entries(e)){if(o===void 0)continue;let n=typeof o=="string"?o:o.join(", ");t.set(r.toLowerCase(),n)}return t}function A(e,t){throw new u(e,m.headerMismatch,{header:t})}function yr(e){let t=typeof e=="boolean"?String(e).toLowerCase():String(e);return t.length>0&&t.trim()===t&&hr.test(t)&&!_r.test(t)?t:`=?base64?${Buffer.from(t,"utf8").toString("base64")}?=`}function br(e,t){let r=_r.exec(e);if(r){let o=r[1],n=Buffer.from(o,"base64");return n.toString("base64")!==o||n.length===0?A("Malformed MCP Base64 header value",t):n.toString("utf8")}return e.length===0||e.trim()!==e||!hr.test(e)?A("Malformed MCP header value",t):e}function Se(e){return Array.isArray(e)?e.some(Se):h(e)?Object.prototype.hasOwnProperty.call(e,"x-mcp-header")||Object.values(e).some(Se):!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"||!yg.test(o)||!["boolean","integer","string"].includes(String(n))||r.has(o.toLowerCase()))throw new u("Invalid MCP x-mcp-header annotation",m.invalidParams,{field:t.join("."),annotation:o});return r.add(o.toLowerCase()),{name:o,path:t,type:n}}function Tr(e){if(!h(e))throw new u("Invalid MCP tool schema",m.invalidParams,{field:"inputSchema",expected:"object"});let t=[],r=new Set,o=(n,s)=>{let i=n.properties;if(i!==void 0){if(!h(i))throw new u("Invalid MCP tool schema properties",m.invalidParams,{field:"inputSchema.properties"});for(let[a,d]of Object.entries(i)){if(!h(d))continue;let c=[...s,a],l=Tg(d,c,r);l&&t.push(l);for(let[p,f]of Object.entries(d))if(p!=="properties"&&p!=="x-mcp-header"&&Se(f))throw new u("MCP x-mcp-header is not statically reachable",m.invalidParams,{field:c.join("."),keyword:p});o(d,c)}}};for(let[n,s]of Object.entries(e))if(n!=="properties"&&Se(s))throw new u("MCP x-mcp-header is not statically reachable",m.invalidParams,{field:"inputSchema",keyword:n});return o(e,[]),t}function Cr(e,t){let r=e;for(let o of t){if(!h(r))return;r=r[o]}return r}function wr(e,t){let r=e==="resources/read"?t.uri:t.name;return typeof r=="string"?r:void 0}function Cg(e,t){let r=h(e.arguments)?e.arguments:{},o={};for(let n of Tr(t)){let s=Cr(r,n.path);if(s!=null){if(!(n.type==="integer"&&typeof s=="number"&&Number.isSafeInteger(s)||n.type==="boolean"&&typeof s=="boolean"||n.type==="string"&&typeof s=="string"))throw new u("Invalid MCP custom header argument",m.invalidParams,{field:n.path.join("."),expected:n.type});o[`Mcp-Param-${n.name}`]=yr(s)}}return o}function cx(e){let t=h(e.request.params)?e.request.params:void 0,r=Je(t),o=e.request.method;if(typeof o!="string"||o.length===0)return A("Missing MCP request method","Mcp-Method");let n={Accept:"application/json, text/event-stream","Content-Type":"application/json","MCP-Protocol-Version":r.protocolVersion,"Mcp-Method":o},s=wr(o,t);if(gr.has(o)){if(s===void 0)return A("Missing MCP request name","Mcp-Name");n["Mcp-Name"]=yr(s)}return o==="tools/call"&&e.toolSchema!==void 0&&Object.assign(n,Cg(t,e.toolSchema)),n}function wg(e,t){let r=t.method;(typeof r!="string"||r.length===0)&&A("Missing MCP request method","Mcp-Method");let o=h(t.params)?t.params:void 0,n=Je(o).protocolVersion;if(e.get("mcp-protocol-version")!==n&&A("MCP protocol header does not match request metadata","MCP-Protocol-Version"),e.get("mcp-method")!==r&&A("MCP method header does not match request body","Mcp-Method"),gr.has(r)){let s=e.get("mcp-name"),i=wr(r,o);(s===void 0||i===void 0||br(s,"Mcp-Name")!==i)&&A("MCP name header does not match request body","Mcp-Name")}e.has("last-event-id")&&A("MCP SSE resumability is not supported","Last-Event-ID")}function Sg(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 Eg(e){let t=h(e.params.arguments)?e.params.arguments:{};for(let r of Tr(e.toolSchema)){let o=Cr(t,r.path),n=`Mcp-Param-${r.name}`,s=e.headers.get(n.toLowerCase());if(o==null){s!==void 0&&A("Unexpected MCP parameter header",n);continue}s===void 0&&A("Missing MCP parameter header",n),Sg(r,o,br(s,n))||A("MCP parameter header does not match request body",n)}}function lx(e){let t=bg(e.headers),r=typeof e.request.method=="string"?e.request.method:"";wg(t,e.request),!(r!=="tools/call"||e.toolSchema===void 0)&&Eg({headers:t,params:e.request.params,toolSchema:e.toolSchema})}var px=V;import{AsyncLocalStorage as Ag}from"node:async_hooks";import{createHash as Sr,timingSafeEqual as vg}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="a7c30d99-a0e4-552e-be61-0c54a455e211")}catch{}})();var y=class extends Error{httpStatus;challenge;constructor(t,r,o){super(t),this.name="PmMcpAuthorizationError",this.httpStatus=r,this.challenge=o}},Og=/^00-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})$/u,Ig=/^[a-z][a-z0-9_*/-]{0,255}$/u,Rg=/^(?:[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,Ar=/^[\x21\x23-\x5B\x5D-\x7E]+$/u,vr=/^[A-Za-z0-9!#$%&'*+.^_`|~-]+$/u,Pg=/^[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]*$/u,kg=/%(?![0-9A-Fa-f]{2})/u,xg=512,Ng=32,Lg=180,Dg=8192,$g=8192,Or=new Ag;function S(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 Fg(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 hx(e){let t=S(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=>S(n,"authorization server issuer").href.replace(/\/$/u,"")),o=[...new Set(e.scopes??[])];if(o.some(n=>!Ar.test(n)))throw new y("Invalid authorization scope",401);return{resource:t,authorization_servers:r,...o.length>0?{scopes_supported:o.sort()}:{}}}function gx(e){let t=S(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 yx(e,t){if(!h(e)||typeof e.issuer!="string")throw new y("Invalid authorization server metadata",401);let r=S(t,"expected issuer").href.replace(/\/$/u,"");if(S(e.issuer,"metadata issuer").href.replace(/\/$/u,"")!==r)throw new y("Authorization server issuer mismatch",401);if(!Array.isArray(e.code_challenge_methods_supported)||!e.code_challenge_methods_supported.includes("S256"))throw new y("Authorization server does not support required S256 PKCE",401);let o=d=>{let c=e[d];if(typeof c!="string")throw new y(`Authorization server metadata requires ${d}`,401);return S(c,d).href},n=d=>{let c=e[d];return typeof c=="string"?S(c,d).href:void 0},s=o("authorization_endpoint"),i=o("token_endpoint"),a=n("registration_endpoint");return{issuer:r,authorization_endpoint:s,token_endpoint:i,code_challenge_methods_supported:[...new Set(e.code_challenge_methods_supported.filter(d=>typeof d=="string"))],...e.client_id_metadata_document_supported===!0?{client_id_metadata_document_supported:!0}:{},...a?{registration_endpoint:a}:{}}}function bx(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 Tx(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 Cx(e,t){let r=S(t,"client metadata document URL");if(r.pathname==="/"||!h(e)||e.client_id!==r.href||typeof e.client_name!="string"||e.client_name.trim().length===0||!Array.isArray(e.redirect_uris)||e.redirect_uris.length===0)throw new y("Invalid Client ID Metadata Document",401);for(let o of e.redirect_uris){if(typeof o!="string")throw new y("Invalid client redirect URI",401);S(o,"client redirect URI",!0)}return structuredClone(e)}function wx(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=>S(r,"redirect URI",!0).href);return{application_type:e.applicationType,client_name:e.clientName.trim().slice(0,128),redirect_uris:t,grant_types:["authorization_code","refresh_token"],response_types:["code"],token_endpoint_auth_method:"none"}}var Er=class{#e=new Map;set(t,r){let o=S(t,"credential issuer").href;this.#e.set(o,structuredClone(r))}get(t){let r=S(t,"credential issuer").href,o=this.#e.get(r);return o?structuredClone(o):void 0}delete(t){let r=S(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"?Og.exec(t):null;if(!o)throw new y("Invalid MCP traceparent",403);let n=o[1],s=o[2];if(/^0+$/u.test(n)||/^0+$/u.test(s))throw new y("Invalid MCP traceparent",403)}if(r!==void 0&&(typeof r!="string"||!jg(r)))throw new y("Invalid MCP tracestate",403);return{...typeof t=="string"?{traceparent:t}:{},...typeof r=="string"?{tracestate:r}:{}}}function $(e){return e.replace(/^[ \t]*|[ \t]*$/gu,"")}function Ug(e){return Ig.test(e)||Rg.test(e)}function jg(e){if(Buffer.byteLength(e,"utf8")>xg)return!1;let t=e.split(",");if(t.length>Ng)return!1;let r=new Set;for(let o of t){let n=$(o);if(n.length===0)continue;let s=n.indexOf("="),i=s>0?n.slice(0,s):"",a=s>0?n.slice(s+1):"";if(!Ug(i)||!Mg.test(a)||r.has(i))return!1;r.add(i)}return!0}function Ir(e){return Pg.test(e)&&!kg.test(e)}function Bg(e){let t=$(e),r=t.indexOf("="),o=$(r>=0?t.slice(0,r):t),n=r>=0?$(t.slice(r+1)):void 0;return vr.test(o)&&(n===void 0||Ir(n))}function qg(e){let t=$(e),r=t.split(";"),o=r[0],n=r.slice(1),s=o.indexOf("="),i=$(s>0?o.slice(0,s):""),a=s>0?$(o.slice(s+1)):"";if(!(!vr.test(i)||!Ir(a)||!n.every(Bg)))return{key:i,serialized:t}}function zg(e,t){if(e===void 0)return;if(typeof e!="string"||Buffer.byteLength(e,"utf8")>Dg)throw new y("Invalid MCP baggage",403);let r=new Set(t),o=e.split(",");if(o.length>Lg)throw new y("Invalid MCP baggage",403);let n=[];for(let s of o){let i=qg(s);if(!i)throw new y("Invalid MCP baggage",403);r.has(i.key)&&n.push(i.serialized)}return n.length>0?n.join(","):void 0}function Sx(e,t={}){let r=h(e)&&h(e._meta)?e._meta:{},o=zg(r.baggage,t.baggageAllowlist??[]);return{...Gg(r),...o?{baggage:o}:{}}}function Ex(e,t){return Or.run(structuredClone(e),t)}function Ax(){let e=Or.getStore();return e?{...e}:void 0}async function vx(e){let t=S(e.policy.resourceMetadataUrl,"protected resource metadata URL",!0).href,r=[...new Set(e.policy.requiredScopes??[])];if(r.some(c=>!Ar.test(c)))throw new y("Invalid authorization scope",401);let o=`Bearer resource_metadata="${t}"`;if(new URL(e.requestUrl,e.policy.resource).searchParams.has("access_token"))throw new y("Access tokens must not appear in URI query parameters",401,o);let n=Fg(e.headers,"authorization")?.match(/^Bearer ([^\s]+)$/iu);if(!n)throw new y("Missing or malformed bearer token",401,o);let s=n[1];if(Buffer.byteLength(s,"utf8")>$g)throw new y("Missing or malformed bearer token",401,o);let i;try{i=await e.policy.verifyAccessToken(s)}catch{throw new y("Invalid bearer token",401,o)}let a=Array.isArray(i.audience)?i.audience:[i.audience];if(i.issuer!==e.policy.issuer||!a.includes(e.policy.resource))throw new y("Bearer token issuer or audience mismatch",401,o);let d=r.filter(c=>!i.scopes.includes(c));if(d.length>0)throw new y("Bearer token has insufficient scope",403,`${o}, scope="${d.join(" ")}"`);return{...i,audience:[...a],scopes:[...i.scopes]}}function Ox(e){let t=Sr("sha256").update(e.token).digest();return r=>{let o=Sr("sha256").update(r).digest();if(!vg(t,o))throw new y("Invalid bearer token",401);return structuredClone(e.claims)}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="46f5fe59-6b84-5c68-ad07-bb1329f4ea29")}catch{}})();var it="io.modelcontextprotocol/ui",Ee="2026-01-26",Pr="text/html;profile=mcp-app",Rr=Object.freeze({specVersion:Ee,mimeTypes:[Pr]});function Mx(e){let t=e.clientCapabilities.extensions;if(!h(t))return!1;let r=t[it];if(r===void 0)return!1;if(!h(r))throw new u("Invalid MCP Apps client capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[it]:Rr}}});let o=r.mimeTypes,n=r.specVersion;if(!Array.isArray(o)||!o.includes(Pr)||n!==void 0&&n!==Ee)throw new u("Unsupported MCP Apps client capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[it]:Rr}}});return!0}var Vg={csp:{connectDomains:[],resourceDomains:[],frameDomains:[]},permissions:{},prefersBorder:!0},kr=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:Vg})));function Px(e){return kr.find(t=>t.uri===e)}function kx(e){let t=new Map(kr.map(r=>[r.toolName,r]));return e.map(r=>{let o=t.get(r.name);return o?{...r,_meta:{...r._meta,ui:o.toolMeta}}:{...r}})}function Mr(e){return e.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;")}function xx(e){let t=Mr(e.name),r=Mr(e.description),o=JSON.stringify({name:`pm-${e.id}-view`,version:Ee}),n=JSON.stringify(Ee);return`<!doctype html>
1
+ import{a as Uh}from"./chunks/chunk-AAX7CNL7.js";import{a as b0,b as T0,c as C0,d as S0}from"./chunks/chunk-MTRYEVZR.js";import{a as w0,b as E0,c as A0,d as v0,e as O0,f as P0,g as R0,h as I0,i as M0,j as k0,k as x0,l as N0,m as L0,n as D0,o as $0,p as F0,q as G0}from"./chunks/chunk-2LTGJ5DL.js";import{A as _0,B as h0,C as g0,D as y0,a as Xn,b as kA,c as xA,d as Ga,e as Ua,f as ja,h as Ba,i as qa,j as za,k as Ha,l as Va,m as Ka,n as Wa,o as Ya,p as id,q as sd,r as ad,s as dd,t as cd,u as c0,v as l0,w as p0,x as u0,y as m0,z as f0}from"./chunks/chunk-REXCO5AG.js";import{a as _w,b as hw,c as gw,d as yw,e as bw}from"./chunks/chunk-3S5FLCG7.js";import{A as uk,B as mk,C as fk,D as _k,E as hk,F as gk,G as yk,H as bk,I as Tk,J as Ck,K as Sk,L as wk,M as Ek,N as Ak,O as vk,P as Ok,Q as Pk,R as Rk,S as Ik,T as Mk,U as kk,V as xk,W as Nk,X as Lk,Y as Dk,Z as $k,_ as Fk,a as U0,b as j0,c as B0,d as q0,e as z0,f as H0,g as V0,h as K0,i as W0,j as Y0,k as X0,l as J0,m as Z0,n as Q0,o as ek,p as tk,q as rk,r as ok,s as nk,t as ik,u as sk,v as ak,w as dk,x as ck,y as lk,z as pk}from"./chunks/chunk-ZMJF5HQW.js";import{$ as wm,$a as h_,$b as hh,A as dm,Aa as Ff,Ab as q_,B as cm,Ba as Gf,Bb as z_,C as lm,Ca as Uf,Cb as H_,D as qt,Da as jf,Db as V_,E as zt,Ea as Bf,Eb as K_,F as Ht,Fa as qf,Fb as W_,G as Vt,Ga as zf,Gb as Y_,H as Kt,Ha as Hf,Hb as X_,I as Wt,Ia as Vf,Ib as J_,J as Yt,Ja as Kf,Jb as Z_,K as Xt,Ka as Wf,Kb as Q_,L as Jt,La as Yf,Lb as eh,M as Zt,Ma as Xf,Mb as th,N as Qt,Na as Jf,Nb as rh,O as pm,Oa as Zf,Ob as oh,P as um,Pa as Qf,Pb as nh,Q as mm,Qa as e_,Qb as ih,R as fm,Ra as t_,Rb as sh,S as _m,Sa as er,Sb as ah,T as Xe,Ta as ge,Tb as dh,U as hm,Ua as c_,Ub as ch,V as gm,Va as l_,Vb as lh,W as ym,Wa as p_,Wb as ph,X as bm,Xa as u_,Xb as uh,Y as Tm,Ya as m_,Yb as mh,Z as Cm,Za as f_,Zb as fh,_ as Sm,_a as __,_b as _h,a as cw,aa as zM,ab as g_,ac as gh,b as lw,ba as HM,bb as y_,bc as yh,c as pw,ca as VM,cb as b_,cc as bh,d as uw,da as Dm,db as T_,dc as Th,e as mw,ea as $m,eb as C_,ec as Ch,f as fw,fa as Fm,fb as S_,fc as Sh,g as pA,ga as vf,gb as w_,gc as wh,h as uA,ha as Of,hb as E_,hc as Eh,i as Ji,ia as t0,ib as A_,ic as Ah,j as rR,ja as r0,jb as v_,jc as vh,k as oR,ka as o0,kb as O_,kc as Oh,l as nR,la as n0,lb as P_,lc as Ph,m as iR,ma as i0,mb as R_,mc as Rh,n as sR,na as s0,nb as I_,nc as Ih,o as aR,oa as a0,ob as M_,oc as Mh,p as yl,pa as d0,pb as k_,pc as kh,q as Wp,qa as Pf,qb as x_,qc as xh,r as Yp,ra as Rf,rb as N_,rc as Nh,s as Qp,sa as If,sb as L_,sc as Lh,t as eu,ta as Mf,tb as D_,tc as Dh,u as bu,ua as kf,ub as $_,uc as $h,v as vu,va as xf,vb as F_,vc as Fh,w as kI,wa as Nf,wb as G_,wc as Gh,x as Ye,xa as Lf,xb as U_,y as sm,ya as Df,yb as j_,z as am,za as $f,zb as B_}from"./chunks/chunk-2UX2TAN2.js";import{e as lR,f as pR,g as bl,h as Tl,i as Ut}from"./chunks/chunk-HDKY2YX3.js";import{A as xM,B as NM,C as LM,D as DM,E as $M,F as FM,G as GM,H as UM,I as jM,J as BM,K as qM,L as vm,M as Om,N as Pm,O as Rm,P as Im,Q as Mm,R as km,S as xm,T as Nm,U as Lm,a as _I,b as hI,c as gI,d as yI,e as bI,f as Kp,g as TI,h as CI,i as SI,j as wI,k as EI,m as Zp,n as Em,o as SM,p as wM,q as EM,r as AM,s as vM,t as OM,u as Am,v as PM,w as RM,x as IM,y as MM,z as kM}from"./chunks/chunk-ZNDYAZZ6.js";import{$ as LP,$a as Jl,$b as ru,$c as tf,A as lP,Aa as vl,Ab as Dp,Ac as Ru,Ad as n_,B as pP,Ba as Ol,Bb as $p,Bc as Qu,Bd as i_,C as uP,Ca as Pl,Cb as Fp,Cc as em,Cd as s_,D as mP,Da as Rl,Db as Gp,Dc as tm,Dd as a_,E as fP,Ea as Il,Eb as Up,Ec as rm,Ed as d_,F as We,Fa as Ml,Fb as jp,Fc as om,G as _P,Ga as kl,Gb as Bp,Gc as nm,H as Nt,Ha as xl,Hb as qp,Hc as im,I as hP,Ia as Nl,Ib as zp,Ic as Gm,J as gP,Ja as Ll,Jb as Hp,Jc as Um,K as yP,Ka as Dl,Kb as aI,Kc as jm,L as bP,La as $l,Lb as dI,Lc as Bm,M as TP,Ma as Fl,Mb as cI,Mc as qm,N as CP,Na as Gl,Nb as lI,Nc as zm,O as SP,Oa as Ul,Ob as pI,Oc as Hm,P as wP,Pa as jl,Pb as uI,Pc as Vm,Q as EP,Qa as Bl,Qb as mI,Qc as Km,R as AP,Ra as ql,Rb as fI,Rc as ZM,S as vP,Sa as fR,Sb as Vp,Sc as QM,T as OP,Ta as zl,Tb as AI,Tc as e0,U as PP,Ua as Hl,Ub as vI,Uc as Wm,V as RP,Va as Vl,Vb as OI,Vc as Ym,W as IP,Wa as Kl,Wb as PI,Wc as Xm,X as MP,Xa as _R,Xb as RI,Xc as Jm,Y as kP,Ya as Wl,Yb as Xp,Yc as Zm,Z as xP,Za as Yl,Zb as Jp,Zc as Qm,_ as NP,_a as Xl,_b as tu,_c as ef,a as tP,aa as DP,ab as Zl,ad as rf,b as Mt,ba as $P,bb as hR,bc as ou,bd as of,c as rP,ca as FP,cb as gR,cc as nu,cd as nf,d as Ve,da as GP,db as yR,dc as iu,dd as sf,e as te,ea as UP,eb as bR,ec as su,ed as af,f as bc,fa as jP,fb as TR,fc as au,fd as df,gb as CR,gc as du,gd as cf,ha as rl,hb as SR,hc as cu,hd as lf,i as Ke,ia as ol,ib as BR,ic as lu,id as pf,j as Tc,ja as nl,jb as qR,jc as pu,jd as uf,k as Cc,ka as il,kb as zR,kc as uu,kd as mf,la as sl,lb as HR,lc as mu,ld as ff,m as he,mb as VR,mc as fu,n as Sc,na as al,nb as KR,nc as _u,nd as _f,o as wc,oa as dl,ob as WR,oc as hu,od as hf,p as Ec,pa as cl,pb as eI,pc as gu,pd as gf,q as Ac,qa as ll,qb as tI,qd as yf,r as oP,ra as dR,rb as kp,rc as II,rd as bf,s as nP,sa as cR,sb as xp,sc as MI,sd as Tf,t as iP,ta as pl,tb as rI,tc as yu,td as Cf,u as sP,ua as ul,ub as oI,uc as Ou,ud as Sf,v as aP,va as ml,vb as nI,vd as wf,w as kt,wa as fl,wb as iI,wd as Ef,x as dP,xa as _l,xb as sI,xd as Af,y as cP,ya as hl,yb as Np,yc as Pu,yd as r_,z as xt,za as gl,zb as Lp,zd as o_}from"./chunks/chunk-KY34HTT2.js";import{f as sc}from"./chunks/chunk-QSY55FTA.js";import{A as Uc,Aa as Yc,B as jc,Ba as Xc,C as Lt,Ca as Jc,Da as Zc,Fa as Qc,Ga as el,Ha as tl,a as gA,b as yA,c as bA,d as Zi,e as Qi,f as es,g as ts,h as rs,ia as Dt,j as BP,ja as $t,ka as Ft,la as Gt,ma as Bc,oa as qc,pa as zc,qa as Hc,s as JP,t as ZP,v as QP,w as eR,wa as Vc,x as tR,xa as Kc,y as Fc,z as Gc,za as Wc}from"./chunks/chunk-5V4HU6GK.js";import{$ as _c,$b as BI,$c as KM,A as $O,Aa as sp,Ac as _M,B as FO,Ba as ap,Bb as YR,Bc as hM,C as GO,Ca as dp,Cb as XR,Cc as gM,Da as cp,Db as JR,Dc as jt,Ea as lp,Eb as ZR,Ec as Lu,Fa as pp,Fb as QR,Fc as Du,Ga as up,Gb as Tu,Gc as $u,Ha as mp,Hb as Cu,Hc as Fu,Ia as fp,Ib as Su,Ic as Gu,Ja as _p,Jb as wu,Jc as Uu,Ka as hp,Kb as Eu,Kc as ju,L as UO,La as gp,Lb as Au,Lc as Bu,M as jO,Ma as yp,Mb as Iu,Mc as qu,N as BO,Na as bp,Nb as Mu,Nc as zu,O as qO,Oa as Tp,Ob as ku,Oc as Hu,P as zO,Pa as Cp,Pb as xu,Pc as Vu,Q as HO,Qa as Sp,Qb as xI,Qc as Ku,R as VO,Ra as wp,Rb as NI,Rc as Wu,S as KO,Sa as Ep,Sb as LI,Sc as Yu,T as ac,Ta as Ap,Tb as DI,Tc as Xu,U as dc,Ua as vp,Ub as $I,Uc as Bt,V as cc,Va as Op,Vb as FI,Vc as Ju,W as lc,Wa as Pp,Wb as GI,Wc as yM,X as pc,Xa as Rp,Xc as bM,Y as uc,Ya as Ip,Yb as Nu,Yc as TM,Z as mc,Za as Mp,Zb as UI,Zc as Zu,_ as fc,_b as jI,_c as CM,a as Gi,aa as hc,ac as qI,ad as WM,b as Ui,ba as gc,bb as wR,bc as zI,bd as YM,c as ji,ca as He,cb as ER,cc as HI,cd as XM,d as Bi,da as WO,db as AR,dc as VI,dd as JM,e as qi,ea as YO,eb as vR,ec as KI,fa as XO,fb as OR,fc as WI,g as dA,ga as JO,gb as PR,gc as YI,h as cA,ha as ZO,hb as RR,hc as XI,i as lA,ia as QO,ib as IR,ic as JI,j as mA,ja as eP,jb as MR,jc as ZI,k as fA,ka as yc,kb as kR,kc as QI,l as _A,la as Cl,lb as xR,lc as eM,m as hA,ma as Sl,mb as NR,mc as tM,n as EO,na as wl,nb as LR,nc as rM,o as AO,oa as El,oc as oM,p as vO,pa as uR,pc as nM,q as OO,qa as mR,qc as iM,r as PO,rb as DR,rc as sM,s as RO,sa as Al,sc as aM,t as IO,ta as Ql,tb as $R,tc as dM,u as MO,ua as ep,ub as FR,uc as cM,v as kO,va as tp,vc as lM,w as xO,wa as rp,wc as pM,x as NO,xa as op,xb as GR,xc as uM,y as LO,ya as np,yb as UR,yc as mM,z as DO,za as ip,zb as jR,zc as fM}from"./chunks/chunk-MMVX5L32.js";import"./chunks/chunk-4D25HF3V.js";import{$ as qe,$a as Ys,$b as od,$d as rO,$e as fO,A as JE,Aa as Ss,Ab as Sa,Ac as QA,Ad as Nv,Ae as uO,B as ZE,Ba as ws,Bb as wa,Bc as ev,Bd as pd,Be as mO,Ca as Es,Cb as Ea,Cd as Lv,Ce as Ad,D as QE,Da as As,Db as Aa,Dc as tv,De as vd,E as eA,Ea as vs,Eb as va,Ec as rv,Ed as Dv,Ee as Od,F as tA,Fa as Os,Fb as Oa,Fc as ov,Fd as $v,Fe as Pd,G as rA,Ga as Ps,Gb as Pa,Gc as nv,Gd as Fv,Ge as Rd,H as Wi,Ha as Rs,Hb as Ra,Hc as iv,Hd as Gv,He as Id,I as Yi,Ia as Is,Ib as Ia,Ic as sv,Id as Uv,Ie as Md,Ja as Ms,Jb as Ma,Jc as av,Jd as jv,Je as kd,K as Xi,Ka as ks,Kb as ka,Kc as dv,Kd as Bv,Ke as xd,L as oA,La as xs,Lb as xa,Lc as cv,Ld as qv,Le as Nd,Ma as Ns,Mb as Na,Md as zv,Me as Ld,N as nA,Na as Ls,Nb as La,Nc as lv,Nd as Hv,Ne as Dd,O as iA,Oa as Ds,Ob as Da,Oc as pv,Od as Pt,Oe as $d,P as sA,Pa as $s,Pb as $a,Pc as uv,Pd as Vv,Pe as Fd,Qa as Fs,Qc as mv,Qe as Gd,R as aA,Ra as Gs,Rb as ze,Rc as fv,Re as Ud,Sa as Us,Sb as ee,Sd as Kv,Se as jd,T as TA,Ta as js,Tb as Fa,Tc as _v,Td as Wv,Te as Bd,U as CA,Ua as Bs,Ub as Xa,Ud as Yv,Ue as qd,V as SA,Va as qs,Vb as Ja,Vc as hv,Vd as Xv,Ve as zd,W as Be,Wa as zs,Wb as Za,Wc as gv,Wd as Jv,We as Hd,X as wA,Xa as Hs,Xb as Qa,Xc as yv,Xd as Zv,Xe as Vd,Y as EA,Ya as Vs,Yb as ed,Yc as bv,Yd as Qv,Ye as Kd,Z as AA,Za as Ks,Zb as td,Zc as Tv,Zd as eO,Ze as Wd,_ as vt,_a as Ws,_b as rd,_d as tO,aa as vA,ab as Xs,ac as nd,ae as ud,af as _O,b as IE,ba as OA,bb as Js,bc as NA,be as md,c as ME,ca as PA,cb as Zs,cc as LA,ce as fd,d as kE,da as RA,db as Qs,dc as DA,de as _d,df as hO,e as xE,ea as IA,eb as ea,ec as $A,ee as hd,ef as gO,f as NE,fa as MA,fb as ta,fc as FA,fe as gd,ff as yO,ga as os,gb as ra,gc as GA,ge as yd,gf as bO,h as zi,ha as ns,hb as oa,hc as UA,hd as Cv,he as bd,hf as TO,i as Hi,ia as is,ib as na,id as Sv,ie as Td,if as CO,j as Vi,ja as ss,jb as ia,jc as jA,jd as wv,je as Cd,jf as SO,ka as as,kb as sa,kc as BA,kd as Ev,ke as Sd,kf as wO,la as ds,lb as aa,ld as Av,le as wd,m as LE,ma as cs,mb as da,md as vv,me as Ed,mf as Yd,na as ls,nb as ca,nc as ld,nd as Ov,ne as oO,nf as Xd,oa as ps,ob as la,oc as qA,od as Pv,oe as nO,of as Jd,pa as us,pb as pa,pc as zA,pd as Rv,pe as iO,pf as Zd,q as Ki,qa as ms,qb as ua,qc as HA,qd as Ot,qe as sO,qf as Qd,ra as fs,rb as ma,rc as VA,re as aO,rf as ec,s as At,sa as _s,sb as fa,sc as KA,sd as Iv,se as dO,sf as tc,t as DE,ta as hs,tb as _a,tc as WA,te as cO,tf as rc,u as $E,ua as gs,ub as ha,ud as Mv,ue as lO,uf as oc,v as FE,va as ys,vb as ga,vc as YA,vf as nc,w as GE,wa as bs,wb as ya,wc as XA,wf as ic,x as UE,xb as ba,xc as JA,xf as It,y as YE,ya as Ts,yb as Ta,yc as ZA,yd as kv,ye as Rt,z as XE,za as Cs,zb as Ca,zd as xv,ze as pO}from"./chunks/chunk-5DKCD4KV.js";import"./chunks/chunk-RUKSEZE7.js";import{a as qP,b as zP,c as HP,d as VP,e as KP,f as WP,g as YP,h as Ic,i as Mc,j as kc,k as xc,l as Nc,m as XP,n as Lc,o as Dc,p as $c}from"./chunks/chunk-ZEI3DC5E.js";import"./chunks/chunk-IB7UB5TE.js";import{$a as kT,$b as HT,$c as Pn,$d as qn,$f as Rw,$g as gi,$h as mE,A as aT,Aa as Jo,Ac as tC,Ad as In,Ae as mS,Af as JS,Ag as si,Ai as RE,B as dT,Ba as Zo,Bb as Cn,Bc as wn,Bd as Mn,Be as fS,Bf as ZS,Bg as ai,Bi as jE,Cb as Sn,Cd as kn,Ce as _S,Cf as QS,Cg as di,Ch as Yw,Ci as BE,D as cT,Da as Qo,Db as LT,Dc as En,De as hS,Df as ew,Dg as Gw,Dh as Xw,Di as qE,Ec as An,Ed as NC,Ee as gS,Ef as tw,Eg as Uw,Eh as Jw,Ei as zE,Fd as LC,Fe as yS,Ff as rw,Fh as Zw,Fi as HE,G as lT,Gd as DC,Ge as bS,Gf as ow,Gh as Qw,Gi as VE,Hc as rC,Hd as $C,He as TS,Hg as ci,Hh as eE,Hi as KE,Ic as oC,Id as FC,Ie as CS,Ig as li,Ih as tE,Ii as WE,J as pT,Jc as nC,Jd as GC,Je as SS,Jf as nw,Jg as jw,Jh as rE,Kc as iC,Kd as UC,Ke as wS,Kf as iw,Kg as pi,Kh as oE,Lc as sC,Ld as jC,Le as ES,Lf as sw,Lg as ui,Lh as nE,M as uT,Mc as aC,Md as BC,Me as AS,Mg as Bw,Mh as iE,N as jo,Nc as dC,Nd as qC,Nf as aw,Ng as mi,Nh as sE,O as Bo,Ob as DT,Oc as vn,Od as zC,Oe as wt,Of as dw,Og as fi,Oh as aE,P as qo,Pa as R,Pc as cC,Pd as HC,Pf as Jn,Pg as D,Qa as ST,Qb as $T,Qc as lC,Qe as Et,Qf as Zn,Qg as _i,Qh as dE,Ra as Tt,Rb as FT,Rd as xn,Rf as Qn,Rh as Di,Sa as wT,Sb as GT,Sd as Nn,Se as Kn,Sf as Tw,Sh as $i,T as zo,Ta as ET,Tb as UT,Tc as pC,Td as Ln,Te as Wn,Tf as Cw,Th as cE,Ua as AT,Ub as jT,Uc as uC,Ud as Dn,Ue as _e,Uf as Sw,V as Ho,Va as vT,Vc as mC,Vd as $n,Vf as ww,W as Vo,Wa as OT,Wb as BT,Wc as fC,Wd as Fn,We as vS,Wf as Ew,X as Ko,Xa as PT,Xb as qT,Xc as _C,Xd as Gn,Xf as Aw,Xg as qw,Ya as RT,Yc as hC,Yd as Un,Ye as OS,Yf as vw,Yg as zw,Yh as lE,Za as IT,Zc as On,Zd as jn,Zf as Ow,Zg as Hw,Zh as pE,_a as MT,_b as zT,_c as gC,_d as Bn,_f as Pw,_g as hi,_h as uE,a as Ro,ab as xT,ac as VT,ae as zn,ag as Iw,ah as yi,b as Io,bb as en,bc as KT,bd as yC,be as Hn,bf as je,bg as Mw,bh as bi,bi as fE,c as Mo,cb as tn,cd as bC,ce as Vn,cf as Yn,cg as kw,ch as Ti,ci as _E,d as ko,db as rn,dd as TC,de as VC,df as PS,dh as Ci,e as Ne,eb as on,ed as CC,ee as KC,ef as RS,eh as Si,ei as hE,f as xo,fb as nn,fc as WT,fd as SC,fe as WC,ff as IS,fh as wi,g as L,gb as sn,ge as YC,gf as MS,gh as Ei,gi as gE,h as Le,hb as an,hc as YT,hd as Rn,he as XC,hf as kS,hh as Ai,hi as yE,i as No,ib as Ge,ie as JC,if as xS,ih as vi,ii as bE,j as Lo,jb as Ue,jd as wC,je as ZC,jf as NS,jg as xw,jh as Oi,ji as TE,k as Do,ka as mT,kb as dn,kd as EC,kf as LS,kh as Pi,ki as CE,l as $o,la as fT,lb as cn,ld as AC,lf as DS,lh as Ri,li as SE,m as qb,ma as _T,mb as ln,md as vC,me as QC,mf as $S,mg as ei,mh as Ii,mi as wE,n as De,nb as pn,nd as OC,ne as eS,nf as FS,ng as Nw,nh as Vw,ni as EE,o as yt,ob as un,od as PC,oe as tS,of as GS,og as ti,oh as Kw,oi as AE,p as zb,pa as Wo,pb as mn,pd as RC,pe as rS,pf as US,ph as Mi,q as Hb,qa as hT,qb as fn,qd as IC,qe as oS,qf as jS,qg as Lw,qh as Ww,r as Vb,ra as gT,rb as _n,rd as MC,re as nS,rf as BS,rg as Dw,rh as ki,s as Kb,sa as yT,sb as hn,sd as kC,se as iS,sf as qS,sh as xi,si as vE,t as z,ta as bT,tb as gn,tc as XT,td as xC,te as sS,tf as zS,tg as $w,th as Ni,u as Wb,ub as yn,uc as JT,ue as aS,uf as HS,ug as Fw,uh as Li,va as Yo,vb as bn,vc as ZT,ve as dS,vf as VS,vg as ri,vi as OE,w as oT,wa as Xo,wb as Tn,we as cS,wf as KS,wg as oi,x as nT,xa as Fe,xc as QT,xe as lS,xf as WS,y as iT,ya as TT,yc as eC,yd as Ct,ye as pS,yf as YS,yg as ni,yi as PE,z as sT,za as CT,zb as NT,zd as St,ze as uS,zf as XS,zg as ii,zi as Fi}from"./chunks/chunk-F76ZUP73.js";import{a as vc,b as Oc,e as Pc,f as Rc}from"./chunks/chunk-ZDVTXLA6.js";import"./chunks/chunk-VS565KBX.js";import{A as me,B as rT,C as b,E as Fo,F as bt,G as fe,H as Go,K as $e,M as Uo,b as Yb,c as Xb,d as Jb,m as Zb,r as Qb,u as eT,y as tT}from"./chunks/chunk-R7KWBFM2.js";import"./chunks/chunk-XAWE4EAK.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="8f11e0bf-4115-55a8-bd39-c360f43cdc09")}catch{}})();var H="2026-07-28",rr=["2025-11-25","2025-06-18"],re=[H],m={headerMismatch:-32020,missingRequiredClientCapability:-32021,unsupportedProtocolVersion:-32022,invalidParams:-32602},E={clientCapabilities:"io.modelcontextprotocol/clientCapabilities",clientInfo:"io.modelcontextprotocol/clientInfo",logLevel:"io.modelcontextprotocol/logLevel",protocolVersion:"io.modelcontextprotocol/protocolVersion",serverInfo:"io.modelcontextprotocol/serverInfo"},tr=["debug","info","notice","warning","error","critical","alert","emergency"],u=class extends Error{code;data;constructor(t,r,o={}){super(t),this.name="PmMcpProtocolError",this.code=r,this.data=o}};function h(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function jh(e){if(e===void 0)return;if(!h(e))throw new u("Invalid MCP clientInfo metadata",m.invalidParams,{field:E.clientInfo,expected:"object"});let t=typeof e.name=="string"?e.name.trim():"",r=typeof e.version=="string"?e.version.trim():"";if(t.length===0||r.length===0)throw new u("Invalid MCP clientInfo metadata",m.invalidParams,{field:E.clientInfo,required:["name","version"]});let o={name:t.slice(0,128),version:r.slice(0,128)};return typeof e.description=="string"&&e.description.trim()&&(o.description=e.description.trim().slice(0,1024)),typeof e.websiteUrl=="string"&&e.websiteUrl.trim()&&(o.websiteUrl=e.websiteUrl.trim().slice(0,2048)),o}function Bh(e){if(e!==void 0){if(typeof e!="string"||!tr.includes(e))throw new u("Invalid MCP logLevel metadata",m.invalidParams,{field:E.logLevel,allowed:[...tr]});return e}}function Je(e){let t=h(e)?e._meta:void 0;if(!h(t))throw new u("Missing required MCP request metadata",m.invalidParams,{required:[E.protocolVersion,E.clientCapabilities]});let r=t[E.protocolVersion];if(typeof r!="string"||!re.includes(r))throw new u("Unsupported protocol version",m.unsupportedProtocolVersion,{supported:[...re],requested:typeof r=="string"?r:null});let o=t[E.clientCapabilities];if(!h(o))throw new u("Invalid MCP client capabilities metadata",m.invalidParams,{field:E.clientCapabilities,expected:"object"});let n=jh(t[E.clientInfo]),s=Bh(t[E.logLevel]);return{protocolVersion:H,clientCapabilities:o,...n?{clientInfo:n}:{},...s?{logLevel:s}:{}}}function Gk(e,t){if(t!==e.protocolVersion)throw new u("MCP protocol header does not match request metadata",m.headerMismatch,{header:t??null,metadata:e.protocolVersion})}function Uk(e,t){let r=t.filter(o=>!Object.prototype.hasOwnProperty.call(e.clientCapabilities,o));if(r.length>0)throw new u("Missing required client capability",m.missingRequiredClientCapability,{requiredCapabilities:Object.fromEntries(r.map(o=>[o,{}]))})}function jk(e,t){let r=e.clientCapabilities.extensions;return h(r)&&h(r[t])}function Ze(e,t){let r=h(e._meta)?e._meta:{};return{...e,_meta:{...r,[E.serverInfo]:{...t}}}}function qh(e,t){return Ze({...e,resultType:"complete"},t)}function Bk(e){let t=e.ttlMs??6e4;if(!Number.isFinite(t)||t<0)throw new u("Invalid MCP discovery cache TTL",m.invalidParams,{ttlMs:t});return qh({supportedVersions:[...re],capabilities:structuredClone(e.capabilities),ttlMs:t,cacheScope:"public",...e.instructions?{instructions:e.instructions}:{}},e.serverInfo)}function qk(e,t){if(h(e)&&typeof e.resultType=="string")return e.resultType;if(t==="legacy")return"complete";throw new u("Modern MCP result is missing resultType",m.invalidParams,{required:"resultType"})}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="d4a56906-c542-567e-9265-15184a5c330b")}catch{}})();var zh=new Set(["--help","-h","--version","-V"]);function Hh(e,t){let r=[`Usage: ${e==="stdio"?"pm-mcp":"pm-mcp-http"} [--help | --version]`,"",e==="stdio"?"JSON-RPC over stdin/stdout. With no arguments, starts the stdio server.":"Streamable HTTP POST /mcp. With no arguments, starts the HTTP server.","","Options:"," -h, --help Print help and exit before transport startup."," -V, --version Print the package version and exit.","","Environment:"," PM_PATH Tracker root (otherwise discovered from cwd)."," PM_GLOBAL_PATH Global settings root."," PM_MCP_PROFILE core (default), standard, full, or custom."," PM_MCP_TOOLS Comma-separated tool allowlist for custom profile."," PM_MCP_DISCOVERY_CURSOR_KEY Shared discovery cursor secret, at least 32 UTF-8 bytes."," PM_MCP_BAGGAGE_ALLOWLIST Comma-separated permitted trace baggage keys."];return e==="http"&&r.push(" PM_MCP_HTTP_HOST Bind host (default 127.0.0.1)."," PM_MCP_HTTP_PORT Bind port, 0..65535 (default 3000)."," PM_MCP_HTTP_ALLOWED_ORIGINS Comma-separated exact browser origins (default none)."," PM_MCP_HTTP_BEARER_TOKEN Deployment token for the bundled verifier."," PM_MCP_HTTP_AUTH_ISSUER Exact HTTPS authorization-server issuer."," PM_MCP_HTTP_RESOURCE Canonical resource/audience URI."," PM_MCP_HTTP_SCOPES Space-separated scopes (default pm:read pm:write).","","Non-loopback HTTP requires bearer token, issuer, and resource together."),r.push("",`MCP protocol: ${re.join(", ")}.`,e==="stdio"?`Legacy initialize compatibility: ${rr.join(", ")}.`:"HTTP requires modern per-request metadata; legacy initialize is stdio-only.","",e==="stdio"?"Client configuration:":"Example loopback server:",e==="stdio"?JSON.stringify({mcpServers:{pm:{command:"npx",args:["--yes","--package",`@unbrained/pm-cli@${t}`,"pm-mcp"]}}}):`PM_MCP_HTTP_PORT=3000 npx --yes --package @unbrained/pm-cli@${t} pm-mcp-http`,...e==="http"?["HTTP client configuration:",JSON.stringify({mcpServers:{pm:{url:"http://127.0.0.1:3000/mcp"}}})]:[],"","Configuration: https://github.com/unbraind/pm-cli/blob/main/docs/MCP_REMOTE_TRANSPORT_SECURITY.md",""),r.join(`
2
+ `)}function Vk(e,t,r){if(e.length===0)return{kind:"serve"};let o=e.find(n=>!zh.has(n));if(o!==void 0){let n=t==="stdio"?"pm-mcp":"pm-mcp-http";return{kind:"exit",exitCode:64,stdout:"",stderr:`Unsupported argument ${JSON.stringify(o)}. Run ${n} --help.
3
+ `}}return{kind:"exit",exitCode:0,stdout:e.includes("--help")||e.includes("-h")?Hh(t,r):`${r}
4
+ `,stderr:""}}import{createHash as ir,createHmac as sr,timingSafeEqual as Vh}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="15b81dd0-ef1a-58be-b6ee-5975b6778993")}catch{}})();var Kh=["elicitation/create","roots/list","sampling/createMessage"],or=class extends Error{inputRequests;requestState;constructor(t){super("MCP operation requires additional input"),this.name="PmMcpInputRequiredError",this.inputRequests=t.inputRequests,this.requestState=t.requestState}},ar=/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/u,ye=32,et=64*1024,be=16*1024,Qe={maxBytes:256*1024,maxDepth:32,maxNodes:4096};function Wh(e){return e==="elicitation/create"?"elicitation":e==="sampling/createMessage"?"sampling":"roots"}function Te(e,t,r){let o;try{o=JSON.stringify(e)}catch{throw new u(`Invalid ${r}: value is not JSON serializable`,m.invalidParams,{field:r})}if(Buffer.byteLength(o,"utf8")>t)throw new u(`Invalid ${r}: payload exceeds the protocol bound`,m.invalidParams,{field:r,maximumBytes:t})}function tt(e,t){if(!h(e))throw new u("Invalid MCP inputRequests",m.invalidParams,{field:"inputRequests",expected:"object"});let r=Object.entries(e);if(r.length===0||r.length>ye)throw new u("Invalid MCP inputRequests count",m.invalidParams,{minimum:1,maximum:ye,observed:r.length});let o={};for(let[n,s]of r){if(!ar.test(n)||!h(s))throw new u("Invalid MCP input request entry",m.invalidParams,{field:`inputRequests.${n}`});let i=s.method;if(typeof i!="string"||!Kh.includes(i))throw new u("Unsupported MCP input request method",m.invalidParams,{field:`inputRequests.${n}.method`,method:i??null});let a=Wh(i);if(!Object.prototype.hasOwnProperty.call(t.clientCapabilities,a))throw new u("Missing required client capability",m.missingRequiredClientCapability,{requiredCapabilities:{[a]:{}}});if(!h(s.params))throw new u("Invalid MCP input request parameters",m.invalidParams,{field:`inputRequests.${n}.params`,expected:"object"});o[n]={method:i,params:structuredClone(s.params)}}return Te(o,et,"inputRequests"),o}function dr(e){if(!h(e))throw new u("Invalid MCP inputResponses",m.invalidParams,{field:"inputResponses",expected:"object"});let t=Object.entries(e);if(t.length>ye)throw new u("Invalid MCP inputResponses count",m.invalidParams,{maximum:ye,observed:t.length});let r={};for(let[o,n]of t){if(!ar.test(o)||!h(n))throw new u("Invalid MCP input response entry",m.invalidParams,{field:`inputResponses.${o}`});r[o]=structuredClone(n)}return Te(r,et,"inputResponses"),r}function Xk(e){let t=e.requestState?.trim();if(t&&Buffer.byteLength(t,"utf8")>be)throw new u("Invalid MCP requestState: payload exceeds the protocol bound",m.invalidParams,{field:"requestState",maximumBytes:be});let r=e.inputRequests===void 0?void 0:tt(e.inputRequests,e.requestContext);if(r===void 0&&!t)throw new u("InputRequiredResult requires inputRequests or requestState",m.invalidParams,{requiredAnyOf:["inputRequests","requestState"]});return{resultType:"input_required",...r?{inputRequests:r}:{},...t?{requestState:t}:{},_meta:{[E.serverInfo]:{...e.serverInfo}}}}function cr(e){let t=Buffer.from(e);if(t.byteLength<32)throw new u("MCP requestState signing key must contain at least 32 bytes",m.invalidParams,{minimumBytes:32});return t}function Jk(e,t){if(!Number.isSafeInteger(e.expiresAt)||e.expiresAt<=0||e.method.trim().length===0||e.parameterDigest.trim().length===0||e.principal.trim().length===0)throw new u("Invalid MCP requestState payload",m.invalidParams);let r=Buffer.from(JSON.stringify({version:1,...e}),"utf8");if(r.byteLength>be/2)throw new u("MCP requestState payload exceeds the protocol bound",m.invalidParams,{maximumBytes:be/2});let o=r.toString("base64url"),n=sr("sha256",cr(t)).update(o).digest("base64url");return`${o}.${n}`}function Yh(e){if(!h(e)||e.version!==1)throw new u("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});let{expiresAt:t,method:r,parameterDigest:o,principal:n,state:s}=e;if(typeof t!="number"||!Number.isSafeInteger(t))throw new u("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});if(typeof r!="string"||typeof o!="string"||typeof n!="string")throw new u("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});return{expiresAt:t,method:r,parameterDigest:o,principal:n,state:s}}function Zk(e,t,r){let[o,n,s]=e.split(".");if(!o||!n||s!==void 0)throw new u("Invalid MCP requestState encoding",m.invalidParams,{field:"requestState"});let i=Buffer.from(n,"base64url"),a=sr("sha256",cr(t)).update(o).digest();if(i.byteLength!==a.byteLength||!Vh(i,a))throw new u("Invalid MCP requestState signature",m.invalidParams,{field:"requestState"});let d;try{d=JSON.parse(Buffer.from(o,"base64url").toString("utf8"))}catch{d=null}let c=Yh(d),{expiresAt:l,method:p,parameterDigest:f,principal:_}=c;if(l<(r.nowMs??Date.now()))throw new u("Expired MCP requestState",m.invalidParams,{field:"requestState",expiredAt:l});if(p!==r.method||f!==r.parameterDigest||_!==r.principal)throw new u("MCP requestState binding mismatch",m.invalidParams,{field:"requestState"});return c}function Qk(e){return Te(e,et,"request parameters"),ir("sha256").update(JSON.stringify(e)).digest("hex")}var nr=class{#e=new Set;#t;constructor(t=4096){if(!Number.isSafeInteger(t)||t<1)throw new u("Invalid MCP replay guard capacity",m.invalidParams,{maximumEntries:t});this.#t=t}consume(t){let r=ir("sha256").update(t).digest("hex");if(this.#e.has(r))throw new u("MCP requestState replay detected",m.invalidParams,{field:"requestState"});if(this.#e.size>=this.#t){let o=this.#e.values().next().value;this.#e.delete(o)}this.#e.add(r)}};function Xh(e){if(!Number.isSafeInteger(e.ttlMs)||e.ttlMs<0||e.cacheScope!=="public"&&e.cacheScope!=="private")throw new u("Invalid MCP cache policy",m.invalidParams,{ttlMs:e.ttlMs,cacheScope:e.cacheScope});return{ttlMs:e.ttlMs,cacheScope:e.cacheScope}}function ex(e,t){return{...e,...Xh(t)}}function Jh(e){return e.replaceAll("~1","/").replaceAll("~0","~")}function Zh(e,t){if(t==="#")return e;if(!t.startsWith("#/"))return;let r=e;for(let o of t.slice(2).split("/").map(Jh)){if(!h(r)&&!Array.isArray(r)||!Object.prototype.hasOwnProperty.call(r,o))return;r=r[o]}return r}function Qh(e){let t=e.maxBytes??Qe.maxBytes,r=e.maxDepth??Qe.maxDepth,o=e.maxNodes??Qe.maxNodes;if(!Number.isSafeInteger(t)||t<2)throw new u("Invalid MCP JSON Schema work bounds",m.invalidParams);if(!Number.isSafeInteger(r)||r<1)throw new u("Invalid MCP JSON Schema work bounds",m.invalidParams);if(!Number.isSafeInteger(o)||o<1)throw new u("Invalid MCP JSON Schema work bounds",m.invalidParams);return{maximumBytes:t,maximumDepth:r,maximumNodes:o}}function eg(e,t){let r=Array.isArray(e.value)?e.value:h(e.value)?Object.values(e.value):[];for(let o of r)t.push({value:o,depth:e.depth+1})}function tg(e,t){if(!h(t)||typeof t.$ref!="string")return;let r=t.$ref;if(r.startsWith("#")&&Zh(e,r)===void 0)throw new u("MCP JSON Schema contains an unresolved local reference",m.invalidParams,{reference:r})}function tx(e,t={}){let{maximumBytes:r,maximumDepth:o,maximumNodes:n}=Qh(t);if(typeof e!="boolean"&&!h(e))throw new u("Invalid MCP JSON Schema root",m.invalidParams,{expected:"object or boolean"});Te(e,r,"JSON Schema");let s=[{value:e,depth:0}],i=0;for(;s.length>0;){let a=s.pop();if(i+=1,i>n||a.depth>o)throw new u("MCP JSON Schema exceeds validation work bounds",m.invalidParams,{maximumDepth:o,maximumNodes:n});tg(e,a.value),eg(a,s)}return structuredClone(e)}import{randomUUID as rg}from"node:crypto";import{readFile as og}from"node:fs/promises";import lr from"node:path";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="f3e94896-b2a0-561c-902b-71c28ddde2a1")}catch{}})();var cx="io.modelcontextprotocol/tasks",ng=["working","input_required","completed","failed","cancelled"],ig=/^mcp-task-[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/iu,sg=3600*1e3,ag=1e3,Se=1024,dg=30,cg=2e3;function rt(e){return new u(e,m.invalidParams,{code:"mcp_task_not_found_or_not_authorized"})}function Ce(e){let t=e.trim();if(!ig.test(t))throw rt("Unknown MCP task");return t}function pr(e,t){if(typeof e!="string"||!Number.isFinite(Date.parse(e)))throw new u("Corrupt MCP task record",m.invalidParams,{field:t});return e}function ur(e){if(!h(e)||typeof e.code!="number"||!Number.isFinite(e.code)||typeof e.message!="string")throw new u("Corrupt MCP task error",m.invalidParams);return{code:e.code,message:e.message.slice(0,Se),...h(e.data)?{data:structuredClone(e.data)}:{}}}function lg(e){if(!ng.includes(e))throw new u("Corrupt MCP task record",m.invalidParams);return e}function pg(e){if(typeof e!="string"||e.length===0)throw new u("Corrupt MCP task record",m.invalidParams);return e}function ug(e){if(typeof e!="number"||!Number.isSafeInteger(e)||e<1)throw new u("Corrupt MCP task record",m.invalidParams);return e}function mg(e){if(e!==null&&(typeof e!="number"||!Number.isSafeInteger(e)||e<0))throw new u("Corrupt MCP task record",m.invalidParams);return e}function fg(e){if(e!==void 0){if(typeof e!="number"||!Number.isSafeInteger(e)||e<0)throw new u("Corrupt MCP task record",m.invalidParams);return e}}function _g(e){if(!Array.isArray(e)||e.some(t=>typeof t!="string"))throw new u("Corrupt MCP task record",m.invalidParams);return[...e]}function hg(e){if(!h(e)||e.version!==1)throw new u("Corrupt MCP task record",m.invalidParams);let t=typeof e.taskId=="string"?Ce(e.taskId):"",r=lg(e.status),o=pg(e.principal),n=ug(e.workerPid),s=mg(e.ttlMs),i=fg(e.pollIntervalMs),a={version:1,taskId:t,status:r,principal:o,workerPid:n,createdAt:pr(e.createdAt,"createdAt"),lastUpdatedAt:pr(e.lastUpdatedAt,"lastUpdatedAt"),ttlMs:s,consumedInputKeys:_g(e.consumedInputKeys),...typeof e.statusMessage=="string"?{statusMessage:e.statusMessage.slice(0,Se)}:{},...typeof i=="number"?{pollIntervalMs:i}:{}};if(h(e.inputRequests)&&(a.inputRequests=structuredClone(e.inputRequests)),h(e.inputResponses)&&(a.inputResponses=structuredClone(e.inputResponses)),h(e.result)&&(a.result=structuredClone(e.result)),e.error!==void 0&&(a.error=ur(e.error)),a.status==="input_required"&&!a.inputRequests||a.status==="completed"&&!a.result||a.status==="failed"&&!a.error)throw new u("Corrupt MCP task status payload",m.invalidParams,{status:a.status});return a}function V(e){let t={taskId:e.taskId,status:e.status,createdAt:e.createdAt,lastUpdatedAt:e.lastUpdatedAt,ttlMs:e.ttlMs,...e.statusMessage?{statusMessage:e.statusMessage}:{},...e.pollIntervalMs===void 0?{}:{pollIntervalMs:e.pollIntervalMs}};return e.status==="input_required"?{...t,status:"input_required",inputRequests:structuredClone(e.inputRequests)}:e.status==="completed"?{...t,status:"completed",result:structuredClone(e.result)}:e.status==="failed"?{...t,status:"failed",error:structuredClone(e.error)}:e.status==="cancelled"?{...t,status:"cancelled"}:{...t,status:"working"}}function oe(e){return e==="completed"||e==="failed"||e==="cancelled"}function gg(e){try{return process.kill(e,0),!0}catch(t){return!(typeof t=="object"&&t!==null&&"code"in t&&t.code==="ESRCH")}}var ot=class{#e;#t;#r;#o;#i;constructor(t){this.#e=lr.resolve(t.pmRoot),this.#t=t.owner?.trim()||"pm-mcp",this.#r=t.now??(()=>new Date),this.#o=t.taskIdFactory??(()=>`mcp-task-${rg()}`),this.#i=t.workerPid??process.pid}#s(t){return lr.join(this.#e,"runtime","mcp-tasks","records",`${Ce(t)}.json`)}async#d(t){try{return hg(JSON.parse(await og(this.#s(t),"utf8")))}catch(r){throw fe(r)||r instanceof SyntaxError?rt("Unknown MCP task"):r}}async#a(t){await $e(this.#s(t.taskId),`${JSON.stringify(t,null,2)}
5
+ `)}async#n(t,r,o){let n=Ce(t),s=await je(this.#e,n,dg,this.#t,!1,!1,cg);try{let i=await this.#d(n);if(i.principal!==r)throw rt("Unknown MCP task");let a=o(i);return await this.#a(a),a}finally{await s()}}async create(t){let r=Ce(this.#o()),o=t.principal.trim(),n=t.ttlMs===void 0?sg:t.ttlMs,s=t.pollIntervalMs??ag;if(o.length===0||n!==null&&(!Number.isSafeInteger(n)||n<0)||!Number.isSafeInteger(s)||s<0)throw new u("Invalid MCP task creation options",m.invalidParams);let i=this.#r().toISOString(),a={version:1,taskId:r,status:"working",createdAt:i,lastUpdatedAt:i,ttlMs:n,pollIntervalMs:s,principal:o,workerPid:this.#i,consumedInputKeys:[],...t.statusMessage?.trim()?{statusMessage:t.statusMessage.trim().slice(0,Se)}:{}};return await this.#a(a),{...V(a),resultType:"task"}}async get(t,r){return V(await this.#n(t,r,o=>{if(oe(o.status))return o;let n=this.#r().getTime(),s=o.ttlMs!==null&&Date.parse(o.createdAt)+o.ttlMs<=n,i=o.workerPid!==this.#i&&!gg(o.workerPid);return!s&&!i?o:{...o,status:"failed",statusMessage:s?"Task retention expired before completion.":"Task worker ended before recording a terminal result.",lastUpdatedAt:this.#r().toISOString(),error:{code:-32603,message:s?"MCP task expired":"MCP task worker unavailable after restart",data:{recoverable:!1,createNewTask:!0}},inputRequests:void 0}}))}async requireInput(t){let r=tt(t.inputRequests,t.requestContext);return V(await this.#n(t.taskId,t.principal,o=>{if(oe(o.status))return o;let n=Object.keys(r).filter(s=>o.consumedInputKeys.includes(s));if(n.length>0)throw new u("MCP task input request keys must be unique for the task lifetime",m.invalidParams,{reused:n});return{...o,status:"input_required",statusMessage:t.statusMessage?.trim().slice(0,Se),lastUpdatedAt:this.#r().toISOString(),inputRequests:r}}))}async update(t,r,o){let n=dr(o),s=[],i=[];return await this.#n(t,r,a=>{if(a.status!=="input_required"||!a.inputRequests)return a;let d={...a.inputRequests},c=a.inputResponses?{...a.inputResponses}:{};for(let[l,p]of Object.entries(n))Object.prototype.hasOwnProperty.call(d,l)&&(c[l]=p,delete d[l],s.push(l));return i=Object.keys(d).sort(),s.length===0?a:{...a,status:i.length===0?"working":"input_required",lastUpdatedAt:this.#r().toISOString(),inputRequests:i.length===0?void 0:d,inputResponses:c,consumedInputKeys:[...new Set([...a.consumedInputKeys,...s])].sort()}}),{acceptedKeys:s.sort(),remainingKeys:i}}async takeInputResponses(t,r){let o={};return await this.#n(t,r,n=>(o=structuredClone(n.inputResponses??{}),Object.keys(o).length===0?n:{...n,inputResponses:void 0})),o}async complete(t,r,o){return V(await this.#n(t,r,n=>oe(n.status)?n:{...n,status:"completed",statusMessage:"Task completed.",lastUpdatedAt:this.#r().toISOString(),result:structuredClone(o),inputRequests:void 0,error:void 0}))}async fail(t,r,o){let n=ur(o);return V(await this.#n(t,r,s=>oe(s.status)?s:{...s,status:"failed",statusMessage:n.message,lastUpdatedAt:this.#r().toISOString(),error:n,inputRequests:void 0,result:void 0}))}async cancel(t,r){return V(await this.#n(t,r,o=>oe(o.status)?o:{...o,status:"cancelled",statusMessage:"Task cancelled by the client.",lastUpdatedAt:this.#r().toISOString(),inputRequests:void 0,result:void 0,error:void 0}))}};function lx(e){return new ot(e)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="15cbe26a-5716-5e8c-8700-eb36a1a056d6")}catch{}})();var we="io.modelcontextprotocol/subscriptionId",mr=256,fr=2048,yg=5e3;function bg(e,t){return new Promise((r,o)=>{let n=setTimeout(()=>o(new Error("MCP subscription sink write timed out")),yg);n.unref(),Promise.resolve().then(()=>e(t)).then(()=>{clearTimeout(n),r()},s=>{clearTimeout(n),o(s instanceof Error?s:new Error(String(s)))})})}function nt(e,t){if(e!==void 0){if(typeof e!="boolean")throw new u("Invalid MCP subscription filter",m.invalidParams,{field:`notifications.${t}`,expected:"boolean"});return e||void 0}}function Tg(e){if(!h(e))throw new u("Invalid MCP subscription filter",m.invalidParams,{field:"notifications",expected:"object"});let t=nt(e.toolsListChanged,"toolsListChanged"),r=nt(e.promptsListChanged,"promptsListChanged"),o=nt(e.resourcesListChanged,"resourcesListChanged"),n;if(e.resourceSubscriptions!==void 0){if(!Array.isArray(e.resourceSubscriptions)||e.resourceSubscriptions.length>mr)throw new u("Invalid MCP resource subscriptions",m.invalidParams,{field:"notifications.resourceSubscriptions",maximum:mr});let s=new Set;for(let i of e.resourceSubscriptions){if(typeof i!="string"||i.trim().length===0||Buffer.byteLength(i,"utf8")>fr)throw new u("Invalid MCP resource subscription URI",m.invalidParams,{field:"notifications.resourceSubscriptions",maximumBytes:fr});s.add(i)}s.size>0&&(n=[...s].sort())}return{...t?{toolsListChanged:t}:{},...r?{promptsListChanged:r}:{},...o?{resourcesListChanged:o}:{},...n?{resourceSubscriptions:n}:{}}}function Cg(e,t){return{...e.toolsListChanged&&t.tools?.listChanged?{toolsListChanged:!0}:{},...e.promptsListChanged&&t.prompts?.listChanged?{promptsListChanged:!0}:{},...e.resourcesListChanged&&t.resources?.listChanged?{resourcesListChanged:!0}:{},...e.resourceSubscriptions&&t.resources?.subscribe?{resourceSubscriptions:[...e.resourceSubscriptions]}:{}}}var _r=class{#e;#t=new Map;#r;constructor(t){this.#e=structuredClone(t.capabilities),this.#r={...t.serverInfo}}get size(){return this.#t.size}async open(t){if(this.#t.has(t.id))throw new u("MCP subscription id is already active",m.invalidParams,{subscriptionId:t.id});let r=Cg(Tg(t.notifications),this.#e),o={filter:r,sink:t.sink,writeQueue:Promise.resolve()};this.#t.set(t.id,o);try{await this.#o(t.id,o,{jsonrpc:"2.0",method:"notifications/subscriptions/acknowledged",params:{_meta:{[we]:t.id},notifications:structuredClone(r)}},!0)}catch(n){throw this.#t.delete(t.id),n}return structuredClone(r)}async emitListChanged(t){let r=`${t}ListChanged`,o=`notifications/${t}/list_changed`,n=[];for(let[s,i]of this.#t)i.filter[r]===!0&&n.push(this.#o(s,i,{jsonrpc:"2.0",method:o,params:{_meta:{[we]:s}}}));return(await Promise.all(n)).filter(Boolean).length}async emitResourceUpdated(t){let r=[];for(let[o,n]of this.#t)n.filter.resourceSubscriptions?.includes(t)&&r.push(this.#o(o,n,{jsonrpc:"2.0",method:"notifications/resources/updated",params:{_meta:{[we]:o},uri:t}}));return(await Promise.all(r)).filter(Boolean).length}async#o(t,r,o,n=!1){let s=r.writeQueue.then(async()=>{if(this.#t.get(t)!==r)return!1;try{return await bg(r.sink,o),!0}catch(i){if(this.#t.get(t)===r&&this.#t.delete(t),n)throw i;return!1}});return r.writeQueue=s.then(()=>{},()=>{}),s}close(t){if(this.#t.delete(t))return{...Ze({resultType:"complete",_meta:{[we]:t}},this.#r)}}closeAll(){let t=[];for(let r of this.#t.keys()){let o=this.close(r);t.push({id:r,result:o})}return t}};(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="3681273a-e101-57a0-9446-982c450e7183")}catch{}})();var hr=/^=\?base64\?([A-Za-z0-9+/]*={0,2})\?=$/u,Sg=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/u,gr=/^[\t\x20-\x7E]*$/u,yr=new Set(["prompts/get","resources/read","tools/call"]);function wg(e){let t=new Map;for(let[r,o]of Object.entries(e)){if(o===void 0)continue;let n=typeof o=="string"?o:o.join(", ");t.set(r.toLowerCase(),n)}return t}function A(e,t){throw new u(e,m.headerMismatch,{header:t})}function br(e){let t=typeof e=="boolean"?String(e).toLowerCase():String(e);return t.length>0&&t.trim()===t&&gr.test(t)&&!hr.test(t)?t:`=?base64?${Buffer.from(t,"utf8").toString("base64")}?=`}function Tr(e,t){let r=hr.exec(e);if(r){let o=r[1],n=Buffer.from(o,"base64");return n.toString("base64")!==o||n.length===0?A("Malformed MCP Base64 header value",t):n.toString("utf8")}return e.length===0||e.trim()!==e||!gr.test(e)?A("Malformed MCP header value",t):e}function Ee(e){return Array.isArray(e)?e.some(Ee):h(e)?Object.prototype.hasOwnProperty.call(e,"x-mcp-header")||Object.values(e).some(Ee):!1}function Eg(e,t,r){let o=e["x-mcp-header"];if(o===void 0)return;let n=e.type;if(typeof o!="string"||!Sg.test(o)||!["boolean","integer","string"].includes(String(n))||r.has(o.toLowerCase()))throw new u("Invalid MCP x-mcp-header annotation",m.invalidParams,{field:t.join("."),annotation:o});return r.add(o.toLowerCase()),{name:o,path:t,type:n}}function Cr(e){if(!h(e))throw new u("Invalid MCP tool schema",m.invalidParams,{field:"inputSchema",expected:"object"});let t=[],r=new Set,o=(n,s)=>{let i=n.properties;if(i!==void 0){if(!h(i))throw new u("Invalid MCP tool schema properties",m.invalidParams,{field:"inputSchema.properties"});for(let[a,d]of Object.entries(i)){if(!h(d))continue;let c=[...s,a],l=Eg(d,c,r);l&&t.push(l);for(let[p,f]of Object.entries(d))if(p!=="properties"&&p!=="x-mcp-header"&&Ee(f))throw new u("MCP x-mcp-header is not statically reachable",m.invalidParams,{field:c.join("."),keyword:p});o(d,c)}}};for(let[n,s]of Object.entries(e))if(n!=="properties"&&Ee(s))throw new u("MCP x-mcp-header is not statically reachable",m.invalidParams,{field:"inputSchema",keyword:n});return o(e,[]),t}function Sr(e,t){let r=e;for(let o of t){if(!h(r))return;r=r[o]}return r}function wr(e,t){let r=e==="resources/read"?t.uri:t.name;return typeof r=="string"?r:void 0}function Ag(e,t){let r=h(e.arguments)?e.arguments:{},o={};for(let n of Cr(t)){let s=Sr(r,n.path);if(s!=null){if(!(n.type==="integer"&&typeof s=="number"&&Number.isSafeInteger(s)||n.type==="boolean"&&typeof s=="boolean"||n.type==="string"&&typeof s=="string"))throw new u("Invalid MCP custom header argument",m.invalidParams,{field:n.path.join("."),expected:n.type});o[`Mcp-Param-${n.name}`]=br(s)}}return o}function _x(e){let t=h(e.request.params)?e.request.params:void 0,r=Je(t),o=e.request.method;if(typeof o!="string"||o.length===0)return A("Missing MCP request method","Mcp-Method");let n={Accept:"application/json, text/event-stream","Content-Type":"application/json","MCP-Protocol-Version":r.protocolVersion,"Mcp-Method":o},s=wr(o,t);if(yr.has(o)){if(s===void 0)return A("Missing MCP request name","Mcp-Name");n["Mcp-Name"]=br(s)}return o==="tools/call"&&e.toolSchema!==void 0&&Object.assign(n,Ag(t,e.toolSchema)),n}function vg(e,t){let r=t.method;(typeof r!="string"||r.length===0)&&A("Missing MCP request method","Mcp-Method");let o=h(t.params)?t.params:void 0,n=Je(o).protocolVersion;if(e.get("mcp-protocol-version")!==n&&A("MCP protocol header does not match request metadata","MCP-Protocol-Version"),e.get("mcp-method")!==r&&A("MCP method header does not match request body","Mcp-Method"),yr.has(r)){let s=e.get("mcp-name"),i=wr(r,o);(s===void 0||i===void 0||Tr(s,"Mcp-Name")!==i)&&A("MCP name header does not match request body","Mcp-Name")}e.has("last-event-id")&&A("MCP SSE resumability is not supported","Last-Event-ID")}function Og(e,t,r){return e.type==="integer"?typeof t=="number"&&Number.isSafeInteger(t)&&Number(r)===t:e.type==="boolean"?typeof t=="boolean"&&r===String(t):typeof t=="string"&&r===t}function Pg(e){let t=h(e.params.arguments)?e.params.arguments:{};for(let r of Cr(e.toolSchema)){let o=Sr(t,r.path),n=`Mcp-Param-${r.name}`,s=e.headers.get(n.toLowerCase());if(o==null){s!==void 0&&A("Unexpected MCP parameter header",n);continue}s===void 0&&A("Missing MCP parameter header",n),Og(r,o,Tr(s,n))||A("MCP parameter header does not match request body",n)}}function hx(e){let t=wg(e.headers),r=typeof e.request.method=="string"?e.request.method:"";vg(t,e.request),!(r!=="tools/call"||e.toolSchema===void 0)&&Pg({headers:t,params:e.request.params,toolSchema:e.toolSchema})}var gx=H;import{AsyncLocalStorage as Rg}from"node:async_hooks";import{createHash as Er,timingSafeEqual as Ig}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="a7c30d99-a0e4-552e-be61-0c54a455e211")}catch{}})();var y=class extends Error{httpStatus;challenge;constructor(t,r,o){super(t),this.name="PmMcpAuthorizationError",this.httpStatus=r,this.challenge=o}},Mg=/^00-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})$/u,kg=/^[a-z][a-z0-9_*/-]{0,255}$/u,xg=/^(?:[a-z0-9][a-z0-9_*/-]{0,240})@[a-z][a-z0-9_*/-]{0,13}$/u,Ng=/^[\x20-\x2B\x2D-\x3C\x3E-\x7E]{0,255}[\x21-\x2B\x2D-\x3C\x3E-\x7E]$/u,vr=/^[\x21\x23-\x5B\x5D-\x7E]+$/u,Or=/^[A-Za-z0-9!#$%&'*+.^_`|~-]+$/u,Lg=/^[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]*$/u,Dg=/%(?![0-9A-Fa-f]{2})/u,$g=512,Fg=32,Gg=180,Ug=8192,jg=8192,Pr=new Rg;function w(e,t,r=!1){if(new RegExp("\\p{Cc}","u").test(e))throw new y(`Invalid ${t}`,401);let o;try{o=new URL(e)}catch{throw new y(`Invalid ${t}`,401)}let n=o.hostname==="127.0.0.1"||o.hostname==="localhost";if(o.hash.length>0||o.protocol!=="https:"&&!(r&&n&&o.protocol==="http:"))throw new y(`Invalid ${t}`,401);return o}function Bg(e,t){let r=t.toLowerCase();for(let[o,n]of Object.entries(e))if(!(o.toLowerCase()!==r||n===void 0))return typeof n=="string"?n:n.join(", ")}function Sx(e){let t=w(e.resource,"protected resource URI",!0).href.replace(/\/$/u,"");if(e.authorizationServers.length===0)throw new y("Protected resource metadata requires an authorization server",401);let r=e.authorizationServers.map(n=>w(n,"authorization server issuer").href.replace(/\/$/u,"")),o=[...new Set(e.scopes??[])];if(o.some(n=>!vr.test(n)))throw new y("Invalid authorization scope",401);return{resource:t,authorization_servers:r,...o.length>0?{scopes_supported:o.sort()}:{}}}function wx(e){let t=w(e,"authorization server issuer"),r=t.pathname.replace(/^\/+|\/+$/gu,""),o=t.origin;return r?[`${o}/.well-known/oauth-authorization-server/${r}`,`${o}/.well-known/openid-configuration/${r}`,`${o}/${r}/.well-known/openid-configuration`]:[`${o}/.well-known/oauth-authorization-server`,`${o}/.well-known/openid-configuration`]}function Ex(e,t){if(!h(e)||typeof e.issuer!="string")throw new y("Invalid authorization server metadata",401);let r=w(t,"expected issuer").href.replace(/\/$/u,"");if(w(e.issuer,"metadata issuer").href.replace(/\/$/u,"")!==r)throw new y("Authorization server issuer mismatch",401);if(!Array.isArray(e.code_challenge_methods_supported)||!e.code_challenge_methods_supported.includes("S256"))throw new y("Authorization server does not support required S256 PKCE",401);let o=d=>{let c=e[d];if(typeof c!="string")throw new y(`Authorization server metadata requires ${d}`,401);return w(c,d).href},n=d=>{let c=e[d];return typeof c=="string"?w(c,d).href:void 0},s=o("authorization_endpoint"),i=o("token_endpoint"),a=n("registration_endpoint");return{issuer:r,authorization_endpoint:s,token_endpoint:i,code_challenge_methods_supported:[...new Set(e.code_challenge_methods_supported.filter(d=>typeof d=="string"))],...e.client_id_metadata_document_supported===!0?{client_id_metadata_document_supported:!0}:{},...a?{registration_endpoint:a}:{}}}function Ax(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 vx(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 Ox(e,t){let r=w(t,"client metadata document URL");if(r.pathname==="/"||!h(e)||e.client_id!==r.href||typeof e.client_name!="string"||e.client_name.trim().length===0||!Array.isArray(e.redirect_uris)||e.redirect_uris.length===0)throw new y("Invalid Client ID Metadata Document",401);for(let o of e.redirect_uris){if(typeof o!="string")throw new y("Invalid client redirect URI",401);w(o,"client redirect URI",!0)}return structuredClone(e)}function Px(e){if(e.redirectUris.length===0||e.clientName.trim().length===0)throw new y("Invalid dynamic client registration metadata",401);let t=e.redirectUris.map(r=>w(r,"redirect URI",!0).href);return{application_type:e.applicationType,client_name:e.clientName.trim().slice(0,128),redirect_uris:t,grant_types:["authorization_code","refresh_token"],response_types:["code"],token_endpoint_auth_method:"none"}}var Ar=class{#e=new Map;set(t,r){let o=w(t,"credential issuer").href;this.#e.set(o,structuredClone(r))}get(t){let r=w(t,"credential issuer").href,o=this.#e.get(r);return o?structuredClone(o):void 0}delete(t){let r=w(t,"credential issuer").href;return this.#e.delete(r)}};function qg(e){let t=e.traceparent,r=e.tracestate;if(t!==void 0){let o=typeof t=="string"?Mg.exec(t):null;if(!o)throw new y("Invalid MCP traceparent",403);let n=o[1],s=o[2];if(/^0+$/u.test(n)||/^0+$/u.test(s))throw new y("Invalid MCP traceparent",403)}if(r!==void 0&&(typeof r!="string"||!Hg(r)))throw new y("Invalid MCP tracestate",403);return{...typeof t=="string"?{traceparent:t}:{},...typeof r=="string"?{tracestate:r}:{}}}function $(e){return e.replace(/^[ \t]*|[ \t]*$/gu,"")}function zg(e){return kg.test(e)||xg.test(e)}function Hg(e){if(Buffer.byteLength(e,"utf8")>$g)return!1;let t=e.split(",");if(t.length>Fg)return!1;let r=new Set;for(let o of t){let n=$(o);if(n.length===0)continue;let s=n.indexOf("="),i=s>0?n.slice(0,s):"",a=s>0?n.slice(s+1):"";if(!zg(i)||!Ng.test(a)||r.has(i))return!1;r.add(i)}return!0}function Rr(e){return Lg.test(e)&&!Dg.test(e)}function Vg(e){let t=$(e),r=t.indexOf("="),o=$(r>=0?t.slice(0,r):t),n=r>=0?$(t.slice(r+1)):void 0;return Or.test(o)&&(n===void 0||Rr(n))}function Kg(e){let t=$(e),r=t.split(";"),o=r[0],n=r.slice(1),s=o.indexOf("="),i=$(s>0?o.slice(0,s):""),a=s>0?$(o.slice(s+1)):"";if(!(!Or.test(i)||!Rr(a)||!n.every(Vg)))return{key:i,serialized:t}}function Wg(e,t){if(e===void 0)return;if(typeof e!="string"||Buffer.byteLength(e,"utf8")>Ug)throw new y("Invalid MCP baggage",403);let r=new Set(t),o=e.split(",");if(o.length>Gg)throw new y("Invalid MCP baggage",403);let n=[];for(let s of o){let i=Kg(s);if(!i)throw new y("Invalid MCP baggage",403);r.has(i.key)&&n.push(i.serialized)}return n.length>0?n.join(","):void 0}function Rx(e,t={}){let r=h(e)&&h(e._meta)?e._meta:{},o=Wg(r.baggage,t.baggageAllowlist??[]);return{...qg(r),...o?{baggage:o}:{}}}function Ix(e,t){return Pr.run(structuredClone(e),t)}function Mx(){let e=Pr.getStore();return e?{...e}:void 0}async function kx(e){let t=w(e.policy.resourceMetadataUrl,"protected resource metadata URL",!0).href,r=[...new Set(e.policy.requiredScopes??[])];if(r.some(c=>!vr.test(c)))throw new y("Invalid authorization scope",401);let o=`Bearer resource_metadata="${t}"`;if(new URL(e.requestUrl,e.policy.resource).searchParams.has("access_token"))throw new y("Access tokens must not appear in URI query parameters",401,o);let n=Bg(e.headers,"authorization")?.match(/^Bearer ([^\s]+)$/iu);if(!n)throw new y("Missing or malformed bearer token",401,o);let s=n[1];if(Buffer.byteLength(s,"utf8")>jg)throw new y("Missing or malformed bearer token",401,o);let i;try{i=await e.policy.verifyAccessToken(s)}catch{throw new y("Invalid bearer token",401,o)}let a=Array.isArray(i.audience)?i.audience:[i.audience];if(i.issuer!==e.policy.issuer||!a.includes(e.policy.resource))throw new y("Bearer token issuer or audience mismatch",401,o);let d=r.filter(c=>!i.scopes.includes(c));if(d.length>0)throw new y("Bearer token has insufficient scope",403,`${o}, scope="${d.join(" ")}"`);return{...i,audience:[...a],scopes:[...i.scopes]}}function xx(e){let t=Er("sha256").update(e.token).digest();return r=>{let o=Er("sha256").update(r).digest();if(!Ig(t,o))throw new y("Invalid bearer token",401);return structuredClone(e.claims)}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="46f5fe59-6b84-5c68-ad07-bb1329f4ea29")}catch{}})();var it="io.modelcontextprotocol/ui",Ae="2026-01-26",kr="text/html;profile=mcp-app",Ir=Object.freeze({specVersion:Ae,mimeTypes:[kr]});function Dx(e){let t=e.clientCapabilities.extensions;if(!h(t))return!1;let r=t[it];if(r===void 0)return!1;if(!h(r))throw new u("Invalid MCP Apps client capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[it]:Ir}}});let o=r.mimeTypes,n=r.specVersion;if(!Array.isArray(o)||!o.includes(kr)||n!==void 0&&n!==Ae)throw new u("Unsupported MCP Apps client capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[it]:Ir}}});return!0}var Yg={csp:{connectDomains:[],resourceDomains:[],frameDomains:[]},permissions:{},prefersBorder:!0},xr=Object.freeze([{id:"context",name:"Context explorer",description:"Inspect bounded project context, provenance, omissions, and token accounting.",toolName:"pm_context",uri:"ui://pm/context.html"},{id:"graph",name:"Relationship graph",description:"Explore typed relationships, explaining paths, and graph-governance evidence.",toolName:"pm_graph",uri:"ui://pm/graph.html"},{id:"plan",name:"Plan and milestone view",description:"Review durable plan steps, dependencies, decisions, discoveries, and validation state.",toolName:"pm_plan",uri:"ui://pm/plan.html"},{id:"assurance",name:"Assurance dashboard",description:"Inspect validation verdicts, evidence, omissions, and actionable recovery paths.",toolName:"pm_validate",uri:"ui://pm/assurance.html"},{id:"operations",name:"Long-operation view",description:"Inspect durable test and operation results without creating a second task store.",toolName:"pm_test",uri:"ui://pm/operations.html"}].map(e=>({...e,toolMeta:{resourceUri:e.uri,visibility:["model","app"]},resourceMeta:Yg})));function $x(e){return xr.find(t=>t.uri===e)}function Fx(e){let t=new Map(xr.map(r=>[r.toolName,r]));return e.map(r=>{let o=t.get(r.name);return o?{...r,_meta:{...r._meta,ui:o.toolMeta}}:{...r}})}function Mr(e){return e.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;")}function Gx(e){let t=Mr(e.name),r=Mr(e.description),o=JSON.stringify({name:`pm-${e.id}-view`,version:Ae}),n=JSON.stringify(Ae);return`<!doctype html>
3
6
  <html lang="en">
4
7
  <head>
5
8
  <meta charset="utf-8">
@@ -22,11 +25,11 @@ import{a as Fh}from"./chunks/chunk-UYYTV2TX.js";import{a as _0,b as h0,c as g0,d
22
25
  (()=>{"use strict";const MAX=24000,status=document.querySelector("#status"),result=document.querySelector("#result"),input=document.querySelector("#input"),pending=new Map();let nextId=1;const render=(node,value)=>{let text;try{text=typeof value==="string"?value:JSON.stringify(value,null,2)}catch{text="Result could not be serialized."}if(text.length>MAX)text=text.slice(0,MAX)+"\\n\\n[View truncated at "+MAX+" characters; use the authoritative pm tool with a cursor or narrower projection.]";node.textContent=text};const send=(message)=>window.parent.postMessage(message,"*");window.addEventListener("message",event=>{if(event.source!==window.parent||!event.data||event.data.jsonrpc!=="2.0")return;const message=event.data;if(message.id!==undefined&&pending.has(message.id)){pending.get(message.id)(message);pending.delete(message.id);return}if(message.method==="ui/notifications/tool-input"||message.method==="ui/notifications/tool-input-partial"){render(input,message.params?.arguments??message.params);status.textContent="Input received"}else if(message.method==="ui/notifications/tool-result"){render(result,message.params);status.textContent="Current tool result"}else if(message.method==="ui/notifications/tool-cancelled"){status.textContent="Tool call cancelled";status.classList.add("notice")}else if(message.method==="ui/notifications/host-context-changed"&&message.params?.theme){document.documentElement.style.colorScheme=message.params.theme}});const request=(method,params)=>new Promise(resolve=>{const id=nextId++;pending.set(id,resolve);send({jsonrpc:"2.0",id,method,params})});document.querySelector("#copy").addEventListener("click",async()=>{const text=result.textContent+"\\n\\n"+input.textContent;try{await navigator.clipboard.writeText(text);status.textContent="Visible evidence copied"}catch{status.textContent="Clipboard permission unavailable";status.classList.add("notice")}});request("ui/initialize",{appInfo:${o},appCapabilities:{},protocolVersion:${n}}).then(message=>{if(message.error){status.textContent="Host rejected MCP App initialization";status.classList.add("notice");return}send({jsonrpc:"2.0",method:"ui/notifications/initialized"});status.textContent="Connected \u2014 awaiting authoritative result"})})();
23
26
  </script>
24
27
  </body>
25
- </html>`}import{createHash as st}from"node:crypto";import{lstat as Hg,readdir as Ur,readFile as Kg}from"node:fs/promises";import P from"node:path";import{parseDocument as Wg}from"yaml";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="eafd8bc3-0da1-5220-8fb1-6967eecdb6bf")}catch{}})();var xr="io.modelcontextprotocol/skills",at="SEP-2640@a3e147ca2710f68214247aecc729731ee1ae8d03",Xg=Object.freeze({revision:at,status:"draft",directoryRead:!0});function jx(e,t=!1){let r=e.clientCapabilities.extensions,o=h(r)?r[xr]:void 0;if(!h(o)||o.revision!==at||t&&o.directoryRead!==!0)throw new u("Missing or incompatible Skills over MCP draft capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[xr]:Xg}}})}var M=Object.freeze({maxFilesPerSkill:512,maxFileBytes:16*1024*1024,maxSkillBytes:16*1024*1024,defaultPageSize:20,maxPageSize:100}),Nr=100,Yg=32*1024*1024,Jg=/^[a-z0-9]+(?:-[a-z0-9]+)*$/u,Lr=new Set(Array.from({length:M.maxPageSize},(e,t)=>t+1));function C(e,t){throw new u(e,-32602,t)}function Dr(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 Zg(e,t){let r=/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/u.exec(e);r||C(`Skill ${t} is missing YAML frontmatter.`);let o=Wg(r[1],{prettyErrors:!1,strict:!0,uniqueKeys:!0});o.errors.length>0&&C(`Skill ${t} has invalid YAML frontmatter.`,{errors:o.errors.map(s=>s.message)});let n;try{n=o.toJS({maxAliasCount:0})}catch(s){C(`Skill ${t} has unsupported YAML aliases.`,{error:String(s)})}return(typeof n!="object"||n===null||Array.isArray(n))&&C(`Skill ${t} frontmatter must be an object.`),n}async function Qg(e,t,r,o){return r>M.maxFileBytes&&C(`Skill resource exceeds the per-file limit: ${t}.`),o.files+=1,o.files>M.maxFilesPerSkill&&C(`Skill exceeds ${M.maxFilesPerSkill} files.`),o.skillBytes+=r,o.skillBytes>M.maxSkillBytes&&C(`Skill exceeds the aggregate byte limit: ${t}.`),o.originBytes.value+=r,o.originBytes.value>Yg&&C(`Skill origin exceeds the aggregate byte limit: ${t}.`),Kg(e)}async function jr(e,t,r){let o=P.join(e,t),n=await Ur(o,{withFileTypes:!0}),s=[];for(let i of n.sort((a,d)=>a.name.localeCompare(d.name))){let a=P.posix.join(t.split(P.sep).join("/"),i.name),d=P.join(e,...a.split("/")),c=await Hg(d);c.isSymbolicLink()&&C(`Skill resource must not be a symbolic link: ${a}.`),c.isDirectory()?s.push(...await jr(e,a,r)):c.isFile()?s.push({relative:a,bytes:await Qg(d,a,c.size,r)}):C(`Skill resource must be a regular file or directory: ${a}.`)}return s}async function $r(e,t,r){let o=new Map,n;try{n=await Ur(e,{withFileTypes:!0})}catch(a){if(bt(a))return o;throw a}let s=n.filter(a=>a.isDirectory()&&Jg.test(a.name)).sort((a,d)=>a.name.localeCompare(d.name));s.length>Nr&&C(`Skill origin exceeds ${Nr} directories.`);let i={value:0};for(let a of s){let d=await jr(P.join(e,a.name),"",{files:0,skillBytes:0,originBytes:i}),c=d.reduce((g,T)=>g+T.bytes.byteLength,0),l=d.find(g=>g.relative==="SKILL.md");if(!l)continue;let p=Zg(l.bytes.toString("utf8"),a.name);p.name!==a.name&&C(`Skill directory ${a.name} must match frontmatter name.`,{actual:p.name??null,expected:a.name}),(typeof p.description!="string"||p.description.trim().length===0)&&C(`Skill ${a.name} requires a non-empty frontmatter description.`,{required:["description"]});let f=d.map(g=>({uri:`skill://${a.name}/${g.relative}`,digest:`sha256:${st("sha256").update(g.bytes).digest("hex")}`,size:g.bytes.byteLength})),_=st("sha256").update(f.map(g=>`${g.uri}:${g.digest}`).join(`
26
- `)).digest("hex");o.set(a.name,{uri:`skill://${a.name}/SKILL.md`,frontmatter:p,resources:f,_meta:{contractVersion:1,extensionRevision:at,origin:t,packageVersion:r,protocolVersion:V,trust:"untrusted",estimatedTokens:Math.ceil(c/4)},files:new Map(d.map(g=>[g.relative,g.bytes])),fingerprint:_})}return o}function Fr(e){let{files:t,fingerprint:r,...o}=e;return o}var Gr=class e{#e;#t;constructor(t){this.#e=t,this.#t=st("sha256").update([...t.entries()].sort(([r],[o])=>r.localeCompare(o)).map(([r,o])=>`${r}:${o.fingerprint}`).join(`
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)&&C("Skill cursor is invalid or stale."),Number(o.offset)}catch(o){if(o instanceof u)throw o;return C("Skill cursor is invalid or stale.")}}#o(t,r){return Buffer.from(JSON.stringify({fingerprint:this.#t,offset:t,scope:r})).toString("base64url")}static async load(t){let r=await $r(P.join(t.packageRoot,".agents","skills"),"package",t.packageVersion);if(t.workspaceRoot){let o=P.resolve(t.packageRoot,".agents","skills"),n=P.resolve(t.workspaceRoot,".agents","skills");if(n!==o){let s=await $r(n,"workspace",t.packageVersion);for(let[i,a]of s)r.set(i,a)}}return new e(r)}list(t={}){let r=t.limit??M.defaultPageSize;Lr.has(r)||C(`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((d,c)=>d.uri.localeCompare(c.uri)),s=n.slice(o,o+r),i=o+s.length,a=i<n.length;return{skills:s.map(Fr),hasMore:a,...a?{nextCursor:this.#o(i,"skills/list")}:{}}}get(t){let r=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)\/SKILL\.md$/u.exec(t),o=r?this.#e.get(r[1]):void 0;return o||C(`Unknown pm MCP skill: ${t}.`,{field:"uri"}),Fr(o)}read(t){let r=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)\/(.+)$/u.exec(t),o=r?this.#e.get(r[1]):void 0,n=r?.[2]??"",s=o&&n?o.files.get(n):void 0,i=o?.resources.find(c=>c.uri===t);(!o||!s||!i)&&C(`Unknown pm MCP skill resource: ${t}.`,{field:"uri"});let a={digest:i.digest,origin:o._meta.origin,trust:"untrusted"},d=Dr(n,s);return d!=="application/octet-stream"?{contents:[{uri:t,mimeType:d,text:s.toString("utf8"),_meta:a}]}:{contents:[{uri:t,mimeType:d,blob:s.toString("base64"),_meta:a}]}}readDirectory(t,r={}){let o=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)(?:\/(.+))?$/u.exec(t),n=o?this.#e.get(o[1]):void 0;n||C(`Unknown pm MCP skill directory: ${t}.`,{field:"uri"});let s=(o?.[2]??"").replace(/\/$/u,""),i=s.length>0?`${s}/`:"",a=`skill://${o[1]}`,d=new Map;for(let T of n.resources){let w=T.uri.slice(`${a}/`.length);if(!w.startsWith(i))continue;let q=w.slice(i.length),[I,...Ao]=q.split("/"),vo=`${a}/${i}${I}`,Oo=n.files.get(`${i}${I}`);d.set(I,{uri:vo,name:I,mimeType:Ao.length>0?"inode/directory":Dr(I,Oo)})}s.length>0&&d.size===0&&C(`Unknown pm MCP skill directory: ${t}.`,{field:"uri"});let c=r.limit??M.maxPageSize;Lr.has(c)||C(`Skill directory limit must be an integer from 1 to ${M.maxPageSize}.`);let l=this.#r(r.cursor,t),p=[...d.values()].sort((T,w)=>T.uri.localeCompare(w.uri)),f=p.slice(l,l+c),_=l+f.length,g=_<p.length;return{resources:f,hasMore:g,...g?{nextCursor:this.#o(_,t)}:{}}}};(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="38023567-8a5b-5e25-8d71-5112f74d1894")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="2b24276b-948b-50bd-bfd9-f429cd74be70")}catch{}})();var Br="https://schema.unbrained.dev/pm/workspace-recipe/v1";function dt(e,t){if(e===null||typeof e=="boolean"||typeof e=="string")return e;if(typeof e=="number"){if(!Number.isFinite(e))throw new Error(`Workspace recipe JSON number must be finite at ${t}`);return e}if(Array.isArray(e))return Object.freeze(e.map((r,o)=>dt(r,`${t}[${o}]`)));if(typeof e!="object"||Object.getPrototypeOf(e)!==Object.prototype&&Object.getPrototypeOf(e)!==null)throw new Error(`Workspace recipe input must contain JSON values at ${t}`);return Object.freeze(Object.fromEntries(Object.entries(e).map(([r,o])=>[r,dt(o,`${t}.${r}`)])))}function Ae(e){if(e.schema!==Br)throw new Error(`Unsupported workspace recipe schema: ${e.schema}`);let t=St(e);if(e.operations.some(r=>r.action.trim().length===0||r.input===null||Array.isArray(r.input)))throw new Error("Workspace recipe operations require an action and object input");return Object.freeze({...t,operations:Object.freeze(e.operations.map((r,o)=>Object.freeze({action:r.action,input:dt(r.input,`operations[${o}].input`)})))})}async function qr(e,t){let r=Ae(e);return Et(r,t)}async function ey(e,t){return qr(e,async()=>{let r=[];for(let[o,n]of e.operations.entries())r.push(await t(n,o));return r})}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="c234be1c-35b7-5388-8a70-a012e9a34389")}catch{}})();var zr="pm.agent-observation/v1",Vr="pm.agent-verdict/v1",Hr="pm.agent-episode/v1";function O(e,t){if(!Number.isSafeInteger(e)||e<=0)throw new Error(`${t} must be a positive safe integer.`)}function k(e,t){if(e.trim().length===0)throw new Error(`${t} must not be empty.`)}function oe(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let t of Object.values(e))oe(t)}return e}function ty(e){if(e.length===0)throw new Error("observation.reads must declare at least one bounded read.");let t=0;for(let r of e)if(k(r.command,"observation.reads.command"),O(r.budget_tokens,"observation.reads.budget_tokens"),t+=r.budget_tokens,!Number.isSafeInteger(t))throw new Error("observation read ceilings exceed safe integer range.")}function ry(e){if(e.basis!=="emitted_bytes")throw new Error("observation calibration must use emitted_bytes.");for(let r of e.samples)if(!Number.isSafeInteger(r)||r<0)throw new Error("observation calibration samples must be non-negative safe integers.");if(e.samples.length===0)throw new Error("observation calibration must include at least one sample.");if(O(e.expected_emitted_bytes,"observation.calibration.expected_emitted_bytes"),!Number.isSafeInteger(e.tolerance_bytes)||e.tolerance_bytes<0)throw new Error("observation.calibration.tolerance_bytes must be a non-negative safe integer.");let t=e.samples.reduce((r,o)=>r+o,0)/e.samples.length;if(Math.abs(t-e.expected_emitted_bytes)>e.tolerance_bytes)throw new Error("observation expected_emitted_bytes is outside the calibrated sample tolerance.")}function oy(e){if(e.length===0)throw new Error("observation.tiers must declare a degradation ladder.");let t=new Set,r=Number.POSITIVE_INFINITY;for(let o of e){if(k(o.id,"observation.tiers.id"),O(o.max_tokens,"observation.tiers.max_tokens"),t.has(o.id))throw new Error(`Duplicate observation tier: ${o.id}.`);if(t.add(o.id),o.max_tokens>r)throw new Error("observation tiers must be ordered from largest to smallest max_tokens.");r=o.max_tokens;let n=new Set;for(let s of o.fields){if(F(s,"observation.tiers.fields"),n.has(s))throw new Error(`Duplicate observation tier field: ${s}.`);n.add(s)}}}function ny(e){if(e.schema!==zr)throw new Error(`observation.schema must be ${zr}.`);return k(e.id,"observation.id"),O(e.version,"observation.version"),ty(e.reads),ry(e.calibration),e.corpus_dependence.kind==="bounded"&&(k(e.corpus_dependence.dimension,"observation.corpus_dependence.dimension"),O(e.corpus_dependence.maximum,"observation.corpus_dependence.maximum")),oy(e.tiers),oe(structuredClone(e))}function Yx(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 iy(e,t,r){O(r.budget_tokens,"observation request budget_tokens");let o=[];for(let[n,s]of e.tiers.entries()){o.push(s.id);let i=await t(s),a=Buffer.byteLength(R(i),"utf8"),d=Math.ceil(a/4);if(d<=Math.min(r.budget_tokens,s.max_tokens))return{status:"served",payload:i,receipt:{contract_id:e.id,contract_version:e.version,served_tier:s.id,degraded:n>0,attempted_tiers:o,emitted_bytes:a,estimated_tokens:d,calibration_basis:"emitted_bytes"}}}return{status:"refused",reason:"no_declared_tier_fits_budget",receipt:{contract_id:e.id,contract_version:e.version,served_tier:null,degraded:e.tiers.length>1,attempted_tiers:o,emitted_bytes:null,estimated_tokens:null,calibration_basis:"emitted_bytes"}}}function F(e,t){let r=e.split(".");if(r.some(o=>o.length===0||o==="__proto__"||o==="prototype"||o==="constructor"))throw new Error(`${t} must be a safe, non-empty dot-separated path.`);return r}function Kr(e,t){let r=e;for(let o of F(t,"recorded field path")){if(r===null||typeof r!="object"||!Object.hasOwn(r,o))return;r=r[o]}return r}function sy(e){return`/${F(e,"verdict predicate path").map(t=>t.replaceAll("~","~0").replaceAll("/","~1")).join("/")}`}function ay(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!==Vr)throw new Error(`verdict.schema must be ${Vr}.`);k(e.id,"verdict.id"),O(e.version,"verdict.version");let t=new Set;for(let o of e.predicates){k(o.id,"verdict.predicates.id"),F(o.path,"verdict.predicates.path");let n=o.kind;if(n!=="field_equals"&&n!=="field_present"&&n!=="field_absent")throw new Error(`Unsupported verdict predicate kind for ${o.id}.`);if(t.has(o.id))throw new Error(`Duplicate verdict predicate: ${o.id}.`);ay(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 oe(structuredClone(e))}function cy(e,t){if(e.predicates.length===0)return{contract_id:e.id,contract_version:e.version,snapshot_id:t.snapshot_id,outcome:"not_applicable",score:null,policy:"verdict_only_no_reward",reason:"no_predicates_declared",predicates:[]};let r=new Map(e.predicates.map(i=>[i.id,i])),o=e.composition.predicate_ids.map(i=>{let a=r.get(i),d=Kr(t.state,a.path),c=a.kind==="field_present"?d!==void 0:a.kind==="field_absent"?d===void 0:R(d)===R(a.expected);return{id:i,outcome:c?"satisfied":"violated",evidence_pointer:`${t.snapshot_id}#${sy(a.path)}`,evidence_digest:Tt(R(d))}}),n=o.filter(i=>i.outcome==="satisfied").length,s=e.composition.operator==="all"?n===o.length:n>0;return{contract_id:e.id,contract_version:e.version,snapshot_id:t.snapshot_id,outcome:s?"satisfied":"violated",score:n/o.length,policy:"verdict_only_no_reward",predicates:o}}function Jx(e){if(e.schema!==Hr)throw new Error(`episode.schema must be ${Hr}.`);if(k(e.id,"episode.id"),O(e.version,"episode.version"),!["benchmark","evaluation","training","scale_transfer"].includes(e.mode))throw new Error("episode.mode is not supported.");if(e.task_item_ids.length===0)throw new Error("episode.task_item_ids must declare at least one pm item.");for(let t of e.task_item_ids)k(t,"episode.task_item_ids");O(e.limits.max_actions,"episode.limits.max_actions"),O(e.limits.max_observations,"episode.limits.max_observations"),O(e.limits.max_tokens_per_observation,"episode.limits.max_tokens_per_observation");for(let t of e.observable_fields)F(t,"episode.observable_fields");for(let t of e.withheld_fields)F(t,"episode.withheld_fields");for(let t of e.observable_fields){let r=e.withheld_fields.find(o=>t===o||t.startsWith(`${o}.`)||o.startsWith(`${t}.`));if(r!==void 0)throw new Error(`Observable field ${t} overlaps withheld field ${r}.`)}for(let t of e.observation.tiers)for(let r of t.fields)if(!e.observable_fields.includes(r))throw new Error(`Observation tier field ${r} is not declared observable.`);return ny(e.observation),dy(e.verdict),Ae(e.recipe),oe(structuredClone(e))}function ly(e,t,r){let o=F(t,"observation projection field"),n=e;for(let[s,i]of o.entries()){if(s===o.length-1){r!==void 0&&(n[i]=structuredClone(r));return}let a=n[i];(a===null||typeof a!="object"||Array.isArray(a))&&(n[i]={}),n=n[i]}}function py(e,t){let r={};for(let o of t)ly(r,o,Kr(e,o));return r}async function Zx(e,t){let r=[],o=0,n=0,s=!1,i,a={episode:{id:e.id,label:`pm agent environment v${e.version}`},provenance:{role:e.mode,topic:"agent-environment"}},d=await D(a,()=>t.reset(e.recipe));r.push({sequence:1,kind:"reset",state_id:d.state_id});let c=async()=>{if(s)throw new Error("episode is already closed.");if(n>=e.limits.max_observations)throw new Error("episode exceeded limits.max_observations.");n+=1;let p=await t.readRecordedState(),f=await iy(e.observation,async _=>py(p.state,_.fields),{budget_tokens:e.limits.max_tokens_per_observation});return r.push({sequence:r.length+1,kind:"observation",state_id:f.receipt.served_tier??p.snapshot_id}),f},l=async(p=!1)=>{if(s&&!p)throw new Error("episode is already closed.");if(n>=e.limits.max_observations)throw new Error("episode exceeded limits.max_observations.");n+=1;let f=await t.readRecordedState(),_=cy(e.verdict,f);return r.push({sequence:r.length+1,kind:"verdict",state_id:f.snapshot_id}),_};return{observe:()=>D(a,c),step:async p=>{if(s)throw new Error("episode is already closed.");if(o>=e.limits.max_actions)throw new Error("episode exceeded limits.max_actions.");o+=1;let f=await D(a,()=>t.execute(p));return r.push({sequence:r.length+1,kind:"action",state_id:f.state_id}),f},score:()=>D(a,l),close:()=>i!==void 0?i:s?Promise.reject(new Error("episode is already closed.")):(s=!0,i=D(a,()=>l(!0)).then(p=>(r.push({sequence:r.length+1,kind:"close",state_id:p.snapshot_id}),{verdict:p,trajectory:oe(structuredClone(r))})).catch(p=>{throw s=!1,p}).finally(()=>{i=void 0}),i)}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="14472bc2-ebca-5b9c-9462-bd8694b630a0")}catch{}})();var G="https://schema.unbrained.dev/pm/corpus-shape/v1";function K(e,t){if(!Number.isSafeInteger(e)||e<=0)throw new TypeError(`Corpus shape ${t} must be a positive safe integer`);return e}function ne(e,t){if(!Number.isSafeInteger(e)||e<0)throw new TypeError(`Corpus shape ${t} must be a non-negative safe integer`);return e}function Xr(e){if(!(typeof e!="object"||e===null||Object.isFrozen(e))){for(let t of Object.values(e))Xr(t);Object.freeze(e)}}function W(e){if(e.schema!==G)throw new TypeError(`Unsupported corpus shape schema: ${e.schema}`);if(e.name.trim().length===0||e.description.trim().length===0)throw new TypeError("Corpus shape name and description must be non-empty");if(K(e.hierarchy_depth,"hierarchy_depth"),K(e.hierarchy_fanout,"hierarchy_fanout"),ne(e.age_span_days,"age_span_days"),K(e.history_entries_per_item,"history_entries_per_item"),ne(e.comments_per_100_items,"comments_per_100_items"),ne(e.notes_per_100_items,"notes_per_100_items"),ne(e.learnings_per_100_items,"learnings_per_100_items"),K(e.author_cardinality,"author_cardinality"),K(e.component_count,"component_count"),e.edge_kind_mix.length===0||e.edge_kind_mix.some(r=>r.kind.trim().length===0||r.weight<=0))throw new TypeError("Corpus shape edge_kind_mix requires non-empty kinds with positive weights");if(e.terminal_statuses.some(r=>!e.custom_statuses.includes(r)))throw new TypeError("Corpus shape terminal_statuses must be declared in custom_statuses");let t=structuredClone(e);return Xr(t),t}var 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}],X=Object.freeze({scratch:W({schema:G,name:"scratch",description:"Seconds-old, shallow project with minimal history.",hierarchy_depth:2,hierarchy_fanout:50,age_span_days:0,history_entries_per_item:1,comments_per_100_items:2,notes_per_100_items:1,learnings_per_100_items:1,edge_kind_mix:[{kind:"related",weight:1}],author_cardinality:2,component_count:1,include_cycles:!1,custom_types:[],custom_statuses:[],terminal_statuses:[],custom_fields:[]}),representative:W({schema:G,name:"representative",description:"Medium-lived project with rich evidence and typed lineage.",hierarchy_depth:5,hierarchy_fanout:8,age_span_days:730,history_entries_per_item:12,comments_per_100_items:30,notes_per_100_items:12,learnings_per_100_items:10,edge_kind_mix:ve,author_cardinality:32,component_count:1,include_cycles:!1,custom_types:["Experiment"],custom_statuses:["review"],terminal_statuses:[],custom_fields:["domain"]}),"deep-graph":W({schema:G,name:"deep-graph",description:"Deep typed relationship graph with deterministic cycles.",hierarchy_depth:16,hierarchy_fanout:2,age_span_days:3650,history_entries_per_item:6,comments_per_100_items:15,notes_per_100_items:8,learnings_per_100_items:8,edge_kind_mix:ve,author_cardinality:16,component_count:1,include_cycles:!0,custom_types:[],custom_statuses:[],terminal_statuses:[],custom_fields:[]}),"multi-decade":W({schema:G,name:"multi-decade",description:"Thirty-year event history with dense per-item evolution.",hierarchy_depth:6,hierarchy_fanout:6,age_span_days:10958,history_entries_per_item:24,comments_per_100_items:40,notes_per_100_items:20,learnings_per_100_items:16,edge_kind_mix:ve,author_cardinality:64,component_count:1,include_cycles:!1,custom_types:["Program"],custom_statuses:["archived"],terminal_statuses:["archived"],custom_fields:["portfolio"]}),"disconnected-archive":W({schema:G,name:"disconnected-archive",description:"Multiple disconnected historical project components.",hierarchy_depth:4,hierarchy_fanout:10,age_span_days:7305,history_entries_per_item:8,comments_per_100_items:10,notes_per_100_items:5,learnings_per_100_items:6,edge_kind_mix:ve,author_cardinality:24,component_count:5,include_cycles:!1,custom_types:["Archive"],custom_statuses:["archived"],terminal_statuses:["archived"],custom_fields:["archive_source"]})});function uy(){return Object.keys(X).sort().map(e=>X[e])}function my(e){let t=e.trim().toLowerCase();if(!Object.hasOwn(X,t))throw new TypeError(`Unknown corpus shape "${e}". Available: ${Object.keys(X).join(", ")}`);return X[t]}var Wr=new WeakMap;function Yr(e,t){if(e===0)return[];let r=Wr.get(t);r===void 0&&(r=t.edge_kind_mix.flatMap(n=>Array.from({length:n.weight},()=>n.kind)),Wr.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 fy(e,t,r,o=42){if(ne(t,"item index"),K(r,"item count"),t>=r)throw new RangeError(`Corpus item index ${t} exceeds ${r}`);let n=Math.min(e.component_count,r),s=t%n,i=Math.floor(t/n),a=0,d=1;for(let w=0;w<e.hierarchy_depth;w+=1)a=Math.min(Number.MAX_SAFE_INTEGER,a+d),d=Math.min(Number.MAX_SAFE_INTEGER,d*e.hierarchy_fanout);let c=i%a,l=i-c,p=c===0?void 0:s+(l+Math.floor((c-1)/e.hierarchy_fanout))*n,f=Date.UTC(2026,0,1),_=e.age_span_days*864e5,g=new Date(f+(r===1?0:Math.round(t/(r-1)*_))).toISOString(),T=(t*37+o)%100;return{index:t,id:`pm-s${t.toString(36).padStart(7,"0")}`,...p===void 0?{}:{parent:`pm-s${p.toString(36).padStart(7,"0")}`},component:s,timestamp:g,author:`pm-corpus-agent-${(t+o)%Math.min(e.author_cardinality,r)}`,history_entry_count:e.history_entries_per_item,dependency_kinds:Yr(t,e),has_comment:T<e.comments_per_100_items,has_note:T<e.notes_per_100_items,has_learning:T<e.learnings_per_100_items,...e.custom_types.length>0&&t%11===0?{custom_type:e.custom_types[t%e.custom_types.length]}:{},...e.custom_statuses.length>0&&t%13===0?{custom_status:e.custom_statuses[t%e.custom_statuses.length]}:{}}}var ct=class{shape;authors=new Set;components=new Set;depths=new Map;childCounts=new Map;edgeKinds={};expectedEdgeKinds={};annotations={comments:0,notes:0,learnings:0};annotationFields;planMismatches=[];itemCount=0;observedDepth=0;observedFanout=0;historyEntryCount=0;firstTimestamp=null;lastTimestamp=null;constructor(t){this.shape=t,this.annotationFields=[["comments","has_comment",t.comments_per_100_items],["notes","has_note",t.notes_per_100_items],["learnings","has_learning",t.learnings_per_100_items]]}recordMismatch(t,r){t&&this.planMismatches.push(r)}recordEdgeKinds(t,r){for(let o of r)t[o]=(t[o]??0)+1}add(t){this.itemCount+=1,this.authors.add(t.author),this.components.add(t.component),this.recordMismatch(this.depths.has(t.id),`duplicate_id:${t.id}`);let r=1;if(t.parent!==void 0){let o=this.depths.get(t.parent);this.recordMismatch(o===void 0,`parent_missing:${t.parent}`),r=(o??0)+1;let n=(this.childCounts.get(t.parent)??0)+1;this.childCounts.set(t.parent,n),this.observedFanout=Math.max(this.observedFanout,n)}this.depths.set(t.id,r),this.observedDepth=Math.max(this.observedDepth,r),this.historyEntryCount+=t.history_entry_count,this.recordMismatch(t.history_entry_count!==this.shape.history_entries_per_item,"history_entries_per_item:drift"),this.firstTimestamp=this.firstTimestamp===null||t.timestamp<this.firstTimestamp?t.timestamp:this.firstTimestamp,this.lastTimestamp=this.lastTimestamp===null||t.timestamp>this.lastTimestamp?t.timestamp:this.lastTimestamp;for(let[o,n]of this.annotationFields)this.annotations[o]+=Number(t[n]);this.recordEdgeKinds(this.edgeKinds,t.dependency_kinds),this.recordEdgeKinds(this.expectedEdgeKinds,Yr(t.index,this.shape))}finish(){let t=Math.min(this.shape.author_cardinality,this.itemCount),r=Math.min(this.shape.component_count,this.itemCount),o=[...this.planMismatches,...this.itemCount===0?["item_count:empty"]:[],...this.authors.size===t?[]:[`author_count:${this.authors.size}!=${t}`],...this.components.size===r?[]:[`component_count:${this.components.size}!=${r}`],...this.observedDepth<=this.shape.hierarchy_depth?[]:[`hierarchy_depth:${this.observedDepth}>${this.shape.hierarchy_depth}`],...this.observedFanout<=this.shape.hierarchy_fanout?[]:[`hierarchy_fanout:${this.observedFanout}>${this.shape.hierarchy_fanout}`]];for(let[i,,a]of this.annotationFields){let d=Math.floor(this.itemCount/100),c=this.itemCount%100,l=d*a+Math.max(0,a+c-100),p=d*a+Math.min(a,c),f=this.annotations[i];(f<l||f>p)&&o.push(`${i}:${f}!in[${l},${p}]`)}let n=new Set([...Object.keys(this.edgeKinds),...Object.keys(this.expectedEdgeKinds)]);for(let i of[...n].sort()){let a=this.edgeKinds[i]??0,d=this.expectedEdgeKinds[i]??0;a!==d&&o.push(`edge_kind:${i}:${a}!=${d}`)}let s=[...new Set(o)];return{shape:this.shape.name,item_count:this.itemCount,author_count:this.authors.size,component_count:this.components.size,hierarchy_depth:this.observedDepth,hierarchy_fanout:this.observedFanout,timestamp_range:{first:this.firstTimestamp,last:this.lastTimestamp},history_entry_count:this.historyEntryCount,annotations:{...this.annotations},edge_kinds:{...this.edgeKinds},matches_declaration:s.length===0,mismatches:s}}};function Jr(e){return new ct(e)}function _y(e,t){let r=Jr(e);for(let o of t)r.add(o);return r.finish()}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="48d03e9b-14a4-545c-8e5d-5f5f2092a113")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="6a6b2905-b6b7-5b46-b87d-8b8287e37745")}catch{}})();async function hy(){let e=$e(process.cwd(),process.env.PM_PATH);await Ot(e,(t,r)=>It(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 gy(){await Rt()}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="c1cb8d82-20a6-5460-a0ff-f55312911218")}catch{}})();var Zr=["lines","branches","functions","statements"];function yy(e,t){if(typeof t!="object"||t===null||Array.isArray(t))throw new TypeError(`Coverage entry for ${e} must be an object.`)}function by(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)){yy(r,o);for(let n of Zr){let s=by(r,n,o[n]),i=s.total-s.covered;i>0&&t.push({file:r,metric:n,uncovered:i,...s})}}return t}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="7e55d416-9cc3-51c5-8e56-6b5fd5c836a9")}catch{}})();var Cy=["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 v(e){return typeof e=="string"&&e.trim().length>0}function Sy(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||!Cy.includes(r.capture_source)||!v(r.capture_provenance)||!Array.isArray(r.redactions)||!r.redactions.every(v)||!("input"in r)||!("observed"in r))&&o.push({boundary_id:e.id,kind:"invalid_fixture",detail:`${e.fixture_path} lacks captured provenance, redaction metadata, input, or observed output.`});let n=JSON.stringify(t);for(let s of wy)s.pattern.test(n)&&o.push({boundary_id:e.id,kind:"unsafe_fixture",detail:`${e.fixture_path} contains a possible ${s.label}.`});return o}function Ey(e,t){let r=Date.parse(e.waiver_expires_at),o=v(e.waiver_reason)&&v(e.waiver_owner)&&e.waiver_expires_at.endsWith("Z")&&fe(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 Ay(e,t,r){if(!v(e.id)||!v(e.producer)||!v(e.consumer)||!v(e.format))return{captured:0,waived:0,findings:[{boundary_id:v(e.id)?e.id:"unknown",kind:"invalid_boundary",detail:"Each boundary requires non-empty id, producer, consumer, and format."}]};if("fixture_path"in e){let o=t[e.fixture_path],n=v(e.fixture_path)&&e.fixture_path in t?Sy(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 Ey(e,r)}function _N(e,t,r=new Date){let o=[];if(e.version!==1||!v(e.inventory_scope)||!Array.isArray(e.boundaries))return{ok:!1,boundary_count:0,captured_count:0,waived_count:0,findings:[{boundary_id:"registry",kind:"invalid_registry",detail:"Boundary registry requires version 1, inventory_scope, and boundaries."}]};let n=new Set,s=0,i=0;for(let a of e.boundaries){if(typeof a!="object"||a===null||Array.isArray(a)){o.push({boundary_id:"unknown",kind:"invalid_boundary",detail:"Each boundary must be a JSON object."});continue}let d=a,c=v(d.id)?d.id:void 0;if(c!==void 0&&n.has(c)){o.push({boundary_id:c,kind:"duplicate_boundary",detail:`Boundary ${c} is inventoried more than once.`});continue}c!==void 0&&n.add(c);let l=Ay(d,t,r.getTime());s+=l.captured,i+=l.waived,o.push(...l.findings)}return o.sort((a,d)=>a.boundary_id!==d.boundary_id?a.boundary_id.localeCompare(d.boundary_id):a.kind.localeCompare(d.kind)),{ok:o.length===0,boundary_count:e.boundaries.length,captured_count:s,waived_count:i,findings:o}}import Y from"node:fs";import lt from"node:path";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="aacf5738-098d-50f9-b619-19e472b577ea")}catch{}})();var Qr=300*1e3,vy=3;function TN(e){return(e?.trim()||"development").replace(/[^a-zA-Z0-9._-]/g,"_").replace(/^\./,"_")}function CN(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.");Y.mkdirSync(e,{recursive:!0});let o=lt.join(e,r);Y.mkdirSync(o,{recursive:!0});let n=new Date;Y.utimesSync(o,n,n);let s=Y.readdirSync(e).filter(c=>c!==r).flatMap(c=>{try{return[{name:c,mtimeMs:Y.statSync(lt.join(e,c)).mtimeMs}]}catch(l){if(l instanceof Error&&"code"in l&&me(l))return[];throw l}}).sort((c,l)=>l.mtimeMs-c.mtimeMs||c.name.localeCompare(l.name)),i=s.filter(c=>n.getTime()-c.mtimeMs<Qr),a=Math.max(0,vy-1-i.length),d=s.filter(c=>n.getTime()-c.mtimeMs>=Qr).slice(a).map(c=>c.name).sort((c,l)=>c.localeCompare(l));for(let c of d)Y.rmSync(lt.join(e,c),{recursive:!0,force:!0,maxRetries:3,retryDelay:50});return{retained:r,removed:d}}import{createHash as Oy}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="ff60bc5b-bd85-5b3c-9a55-21e7e72477ac")}catch{}})();var pt=1;function J(e){e?.throwIfAborted()}function U(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship graph ${t} must be non-empty`);return e.trim()}function Z(e,t,r={}){let o=Date.parse(r.createdAt??new Date().toISOString());if(!Number.isFinite(o))throw new TypeError("Relationship graph createdAt must be a valid timestamp");let n=e.nodes(),s=e.edges(),i=t.list();return Object.freeze({version:pt,fingerprint:Oy("sha256").update(R({nodes:n,edges:s,kinds:i})).digest("hex"),created_at:new Date(o).toISOString(),nodes:n,edges:s,kinds:i})}function Iy(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function se(e){if(!Iy(e))throw new TypeError("Relationship graph snapshot must be an object");if(e.version!==pt)throw new TypeError(`Unsupported relationship graph snapshot version: ${String(e.version)}`);if(!Array.isArray(e.nodes)||e.nodes.some(n=>typeof n!="string"))throw new TypeError("Relationship graph snapshot nodes must be strings");if(!Array.isArray(e.edges)||!Array.isArray(e.kinds))throw new TypeError("Relationship graph snapshot edges and kinds must be arrays");if(typeof e.created_at!="string"||!Number.isFinite(Date.parse(e.created_at)))throw new TypeError("Relationship graph snapshot created_at must be valid");if(typeof e.fingerprint!="string")throw new TypeError("Relationship graph snapshot fingerprint must be a string");let t=new Le([]);for(let n of e.kinds)t.register(n);let r=new z(e.nodes,e.edges,t),o=Z(r,t,{createdAt:e.created_at});if(o.fingerprint!==e.fingerprint)throw new TypeError("Relationship graph snapshot fingerprint mismatch");return{snapshot:o,registry:t,graph:r}}async function x(e,t){U(e.name,"adapter name");let r=U(t.workspace,"workspace");J(t.signal);let o=await e.read({...t,workspace:r});return J(t.signal),o===null?null:se(o)}async function Oe(e,t){let r=U(t.workspace,"workspace"),o=se(t.snapshot).snapshot,n=await x(e,{workspace:r,signal:t.signal});if(n?.snapshot.fingerprint===o.fingerprint)return{adapter:e.name,workspace:r,disposition:"current",fingerprint:o.fingerprint,previous_fingerprint:n.snapshot.fingerprint,node_count:o.nodes.length,edge_count:o.edges.length};if(J(t.signal),await e.replace({workspace:r,signal:t.signal,snapshot:o,expected_fingerprint:n?.snapshot.fingerprint??null}),(await x(e,{workspace:r,signal:t.signal}))?.snapshot.fingerprint!==o.fingerprint)throw new Error(`Relationship graph adapter "${e.name}" did not expose the replaced snapshot`);return{adapter:e.name,workspace:r,disposition:"written",fingerprint:o.fingerprint,...n?{previous_fingerprint:n.snapshot.fingerprint}:{},node_count:o.nodes.length,edge_count:o.edges.length}}function Ry(e,t={}){let r=e.map(se),o=new Map;for(let i of r)for(let a of i.snapshot.kinds){let d=o.get(a.kind);if(d&&R(d)!==R(a))throw new TypeError(`Conflicting federated relationship kind: ${a.kind}`);o.set(a.kind,a)}let n=new Le([...o.values()].sort((i,a)=>i.kind.localeCompare(a.kind))),s=new z(new Set(r.flatMap(i=>[...i.snapshot.nodes])),r.flatMap(i=>[...i.snapshot.edges]),n);return Z(s,n,t)}var ie=class{name;#e=new Map;constructor(t="memory"){this.name=U(t,"adapter name")}async read(t){J(t.signal);let r=this.#e.get(U(t.workspace,"workspace"));return r?structuredClone(r):null}async replace(t){J(t.signal);let r=U(t.workspace,"workspace"),o=this.#e.get(r);if(t.expected_fingerprint!==void 0&&(o?.fingerprint??null)!==t.expected_fingerprint)throw new Error(`Relationship graph adapter conflict for ${r}`);this.#e.set(r,structuredClone(se(t.snapshot).snapshot))}async clear(t){J(t.signal);let r=U(t.workspace,"workspace"),o=this.#e.get(r);if(t.expected_fingerprint!==void 0&&(o?.fingerprint??null)!==t.expected_fingerprint)throw new Error(`Relationship graph adapter conflict for ${r}`);this.#e.delete(r)}};(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="e47f9bb8-f98e-5159-9116-29c3e6fedfc3")}catch{}})();function eo(e,t){if(!Number.isInteger(e)||e<1)throw new TypeError(`Relationship graph ${t} must be a positive integer`);return e}function My(e){let t=eo(e.nodeCount,"nodeCount"),r=eo(e.edgeStride??1,"edgeStride"),o=e.topology??"chain";if(!["chain","star","disconnected"].includes(o))throw new TypeError(`Unsupported relationship graph topology: ${o}`);let n=(e.kind??"related").trim(),s=(e.idPrefix??"node").trim();if(!n||!s)throw new TypeError("Relationship graph kind and idPrefix must be non-empty");let i=o==="disconnected"?0:Math.floor((t-1)/r);return{node_count:t,edge_count:i,edge_basis:"fixture_generated",nodes:{*[Symbol.iterator](){for(let a=0;a<t;a+=1)yield`${s}-${a}`}},edges:{*[Symbol.iterator](){if(o!=="disconnected")for(let a=r;a<t;a+=r)yield{source:`${s}-${o==="star"?0:a-r}`,target:`${s}-${a}`,kind:n}}}}}function j(e,t){if(!e)throw new Error(`Relationship graph adapter conformance: ${t}`)}async function to(e,t={}){let r=t.workspace?.trim()||"pm-graph-conformance",o=yt(),n=Z(new z(["a","b"],[{source:"a",target:"b",kind:"related"}],o),o,{createdAt:"2026-01-01T00:00:00.000Z"}),s=Z(new z(["a","b","c"],[{source:"a",target:"b",kind:"related"},{source:"b",target:"c",kind:"blocked_by"}],o),o,{createdAt:"2026-01-02T00:00:00.000Z"}),i=[];j(await x(e,{workspace:r})===null,"workspace must start empty"),i.push({name:"empty-read",passed:!0});let a=await Oe(e,{workspace:r,snapshot:n});j(a.disposition==="written","first sync must write"),i.push({name:"atomic-replace",passed:!0}),(await e.read({workspace:r})).nodes.push("mutated-reader-copy"),j((await x(e,{workspace:r}))?.snapshot.nodes.length===2,"reads must not mutate stored state"),i.push({name:"read-isolation",passed:!0}),j((await Oe(e,{workspace:r,snapshot:n})).disposition==="current","identical sync must be idempotent"),i.push({name:"idempotent-sync",passed:!0}),await e.replace({workspace:r,snapshot:s,expected_fingerprint:n.fingerprint}),j((await x(e,{workspace:r}))?.snapshot.fingerprint===s.fingerprint,"replacement must become visible"),i.push({name:"replacement-visibility",passed:!0});let d=!1;try{await e.replace({workspace:r,snapshot:n,expected_fingerprint:n.fingerprint})}catch{d=!0}return j(d,"stale compare-and-swap must fail"),i.push({name:"stale-cas",passed:!0}),e.clear&&(await e.clear({workspace:r,expected_fingerprint:s.fingerprint}),j(await x(e,{workspace:r})===null,"clear must remove the workspace"),i.push({name:"clear",passed:!0})),{adapter:e.name,workspace:r,cases:Object.freeze(i),clear_supported:e.clear!==void 0}}function Py(e){return to(new ie,e?{workspace:e}:{})}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="58736688-35d0-545d-892e-e0ede7fedc1a")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="d45a8203-4501-5797-a6cc-a2e7844adec9")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="f5567aa1-0268-574d-907b-38d6249538ce")}catch{}})();var ut=2,ky=["self_reported","independent_transport"];function Ie(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ae(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`${t} must be a non-empty string`);return e.trim()}function ro(e,t,r=!1){if(!Array.isArray(e)||e.length===0)throw new TypeError(`${t} must be a non-empty string array`);return e.map((o,n)=>{let s=ae(o,`${t}[${String(n)}]`);return r?o:s})}function mt(e,t){return e===void 0?void 0:ae(e,t)}function xy(e,t){if(e===void 0)return;if(!Ie(e)||Object.keys(e).length===0)throw new TypeError(`${t} must be a non-empty object`);let r=Object.entries(e).map(([o,n])=>{if(o.length===0||o.split(".").some(s=>s.length===0))throw new TypeError(`${t} must use dot-separated own-property paths`);if(n!==null&&typeof n!="string"&&typeof n!="boolean"&&(typeof n!="number"||!Number.isFinite(n)))throw new TypeError(`${t} values must be JSON primitives`);return[o,n]});return Object.fromEntries(r)}function Ny(e,t,r,o,n,s){if(o==="refusal"){if(Ke(r)||n===void 0||s===void 0)throw new TypeError(`${e} refusal steps require a non-success exit, error code, and refusal surface`);return}if(n!==void 0||s!==void 0)throw new TypeError(`${e} only refusal steps may declare expected_error_code or expected_refusal_surface`);let i=Ct(t);if(i===void 0)throw new TypeError(`${e}.args must identify a command after global flags`);let a=t[i].trim().toLowerCase();if(a==="history"){let l=wt(t.slice(i+1));l!==void 0&&(a=Ne(`history ${l}`))}let d=Nt(a);if(!Ke(r)||r!==0&&!d?.exit_codes.some(l=>l===r))throw new TypeError(`${e} successful output must use exit code 0 or a command-declared successful effect exit`);let c=xt(a).kind;if(o!==c)throw new TypeError(`${e} expected ${o}, but ${a} declares ${c}`)}function Ly(e,t,r){if(!Ie(e))throw new TypeError(`tasks.${t}.steps[${String(r)}] must be an object`);let o=`tasks.${t}.steps[${String(r)}]`,n=ae(e.id,`${o}.id`),s=ro(e.args,`${o}.args`,!0),i=e.expected_exit_code;if(typeof i!="number"||!Number.isSafeInteger(i))throw new TypeError(`${o}.expected_exit_code must be a safe integer`);let a=e.expected_output_kind;if(a!=="refusal"&&!kt.includes(a))throw new TypeError(`${o}.expected_output_kind is unsupported`);let d=a,c=e.expected_accounting_mode;if(!ky.includes(c))throw new TypeError(`${o}.expected_accounting_mode is unsupported`);let l=c;if(l==="independent_transport"&&d!=="refusal")throw new TypeError(`${o} independent_transport accounting is supported only for refusal steps`);let p=ro(e.required_fields,`${o}.required_fields`);if(p.some(w=>w.split(".").some(q=>q.length===0)))throw new TypeError(`${o}.required_fields must contain dot-separated own-property paths`);let f=xy(e.expected_field_values,`${o}.expected_field_values`),_=mt(e.expected_error_code,`${o}.expected_error_code`),g=mt(e.expected_refusal_surface,`${o}.expected_refusal_surface`),T=mt(e.recovery_for,`${o}.recovery_for`);return Ny(o,s,i,d,_,g),{id:n,args:s,expected_exit_code:i,expected_output_kind:d,expected_accounting_mode:l,required_fields:p,...f?{expected_field_values:f}:{},..._?{expected_error_code:_}:{},...g?{expected_refusal_surface:g}:{},...T?{recovery_for:T}:{}}}function Dy(e,t){if(!Ie(e))throw new TypeError(`tasks[${String(t)}] must be an object`);let r=ae(e.id,`tasks[${String(t)}].id`),o=ae(e.description,`tasks.${r}.description`);if(!Array.isArray(e.steps)||e.steps.length===0)throw new TypeError(`tasks.${r}.steps must be a non-empty array`);let n=e.steps.map((i,a)=>Ly(i,r,a)),s=new Map;for(let i of n){if(s.has(i.id))throw new TypeError(`tasks.${r} contains duplicate step id ${i.id}`);if(i.recovery_for!==void 0&&(s.get(i.recovery_for)?.expected_output_kind!=="refusal"||i.expected_output_kind==="refusal"))throw new TypeError(`tasks.${r}.${i.id} recovery_for must reference an earlier refusal and declare successful output`);s.set(i.id,i)}if(n.at(-1)?.expected_output_kind==="refusal")throw new TypeError(`tasks.${r} completed task must terminate with successful output`);for(let i of n)if(i.expected_output_kind==="refusal"&&!n.some(a=>a.recovery_for===i.id))throw new TypeError(`tasks.${r}.${i.id} refusal must have a later successful recovery_for step`);return{id:r,description:o,steps:n}}function ZN(e){if(!Ie(e))throw new TypeError("agent-task transcript corpus must be an object");if(e.version!==ut)throw new TypeError(`agent-task transcript corpus version must be ${String(ut)}`);if(!Array.isArray(e.tasks)||e.tasks.length===0)throw new TypeError("agent-task transcript corpus tasks must be non-empty");let t=e.tasks.map((o,n)=>Dy(o,n)),r=new Set;for(let o of t){if(r.has(o.id))throw new TypeError(`duplicate agent-task transcript id ${o.id}`);r.add(o.id)}return{version:ut,tasks:t}}import{createHash as oo}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="7163a078-d8be-5bca-813f-c941fcb8e406")}catch{}})();function no(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship backfill ${t} must be non-empty`);return e.trim()}function rL(e,t){let r=no(t.migrationId,"migrationId"),o=no(t.author,"author"),n=Date.parse(t.timestamp);if(!Number.isFinite(n))throw new TypeError("Relationship backfill timestamp must be valid");let s=new Date(n).toISOString(),i=ze(e,void 0,t.registry),a=i.graph.nodes(),d=i.graph.edges().map(f=>{let _=oo("sha256").update(JSON.stringify([r,f.kind,f.source,f.target,f.createdAt??null,f.author??null,f.payload??null])).digest("hex").slice(0,24);return Object.freeze({eventId:`backfill:${r}:${_}`,relationshipId:`migration:${r}:${_}`,action:"add",edge:f,author:o,timestamp:s,reason:`Backfill ${r} from legacy item metadata`})}),c=oo("sha256").update(JSON.stringify({migrationId:r,nodes:a,events:d})).digest("hex"),l=new Set([...t.existingEventIds??[]].filter(f=>typeof f=="string").map(f=>f.trim()).filter(Boolean)),p=d.filter(f=>!l.has(f.eventId));return Object.freeze({migration_id:r,fingerprint:c,nodes:a,events:Object.freeze(p),edge_count:d.length,skipped_existing_count:d.length-p.length,duplicate_dependency_rows:i.duplicateRows.length,dangling_reference_count:i.dangling.active.length+i.dangling.legacy_terminal.length})}import*as io from"node:module";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="7a1d7194-6ff1-5365-ab64-80b47b0176d7")}catch{}})();var de=["suggested_retry","candidate_command","example","next_step","migration_hint","restore_with"],ft={suggested_retry:{kind:"suggested_retry",semantics:"recovery"},retry_command:{kind:"suggested_retry",semantics:"recovery"},candidate_command:{kind:"candidate_command",semantics:"recovery"},candidate_commands:{kind:"candidate_command",semantics:"recovery"},fallback_candidates:{kind:"candidate_command",semantics:"recovery",nested_value_field:"command"},next_best_command:{kind:"candidate_command",semantics:"recovery"},example:{kind:"example",semantics:"recovery"},examples:{kind:"example",semantics:"recovery"},next_step:{kind:"next_step",semantics:"recovery"},next_steps:{kind:"next_step",semantics:"recovery"},suggested_next_steps:{kind:"next_step",semantics:"recovery"},migration_hint:{kind:"migration_hint",semantics:"replacement"},migration_hints:{kind:"migration_hint",semantics:"replacement"},restore_with:{kind:"restore_with",semantics:"behavior_preserving"}},nL=Object.freeze(Object.keys(ft));function so(e){if(Object.hasOwn(ft,e))return ft[e]}var $y=new Set([..."=([{,:;!?&|+-*%^~<>","=>"]);function Q(e,t){return e<t?-1:e>t?1:0}function Fy(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 Gy(e){return e===void 0||e.kind==="punctuator"&&$y.has(e.value)||e.kind==="identifier"&&["return","case","throw","else","yield"].includes(e.value)}function Uy(e,t){if(/\s/u.test(e[t]))return t+1;if(e.startsWith("//",t)){let r=e.indexOf(`
28
- `,t+2);return r===-1?e.length:r+1}if(e.startsWith("/*",t))return e.indexOf("*/",t+2)+2}function jy(e,t,r){if(e[t]!=="/"||!Gy(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 By(e,t){let r=e[t];if(r==="'"||r==='"'||r==="`"){let n=Fy(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 qy(e){let t=[],r=0;for(;r<e.length;){let o=Uy(e,r);if(o!==void 0){r=o;continue}let n=jy(e,r,t.at(-1));if(n!==void 0){r=n;continue}let s=By(e,r);s.token&&t.push(s.token),r=s.next}return t}var zy=new Set(["object","block","pattern"]),Vy=new Set(["const","let","var"]),Hy=new Set(["}",")","]"]),Ky=new Set(["=","(","[",",",":","?","return"]);function Wy(e,t,r){if([...r].reverse().find(n=>zy.has(n.kind))?.kind==="pattern"||r.at(-1)?.kind==="paren"&&r.at(-1)?.parameter_list)return"pattern";let o=e[t-1];return o?.kind==="identifier"&&Vy.has(o.value)?"pattern":o?.value==="=>"||o?.value===")"?"block":o&&Ky.has(o.value)?"object":"block"}function Xy(e,t,r){let o=e[t];if(o.value==="{"){let i=Wy(e,t,r);return{kind:i,...i==="object"?{member_start:!0,candidates:[]}:{}}}if(o.value==="[")return{kind:"array"};if(o.value!=="(")return;let n=e[t-1],s=e[t-2];return{kind:"paren",...n?.value==="function"||s?.value==="function"?{parameter_list:!0}:{}}}function Yy(e,t,r){if(!(e?.kind!=="object"||!e.member_start||t.kind!=="identifier"&&t.kind!=="string"||r?.value!==":"||!/^[A-Za-z][A-Za-z0-9_]*$/u.test(t.value)))return{field:t.value,offset:t.offset}}function Jy(e,t){return e[t+1]?.value===")"&&e[t+2]?.value==="=>"||e[t+1]?.value==="="}function Zy(e){let t=qy(io.stripTypeScriptTypes(e,{mode:"strip"})),r=[],o=[];for(let[n,s]of t.entries()){let i=o.at(-1),a=Yy(i,s,t[n+1]);a&&i.candidates.push(a);let d=Xy(t,n,o);if(d)o.push(d);else if(Hy.has(s.value)){let c=o.pop();c?.kind==="object"&&!Jy(t,n)&&r.push(...c.candidates)}else s.value===","&&i?.kind==="object"?i.member_start=!0:i?.kind==="object"&&s.value!==":"&&(i.member_start=!1)}return r}function Qy(e){let t=[0];for(let r=0;r<e.length;r+=1)e[r]===`
29
- `&&t.push(r+1);return t}function eb(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 iL(e){let t=[],r=[];for(let n of[...e].sort((s,i)=>Q(s.path,i.path))){let s=Qy(n.content),i;try{i=Zy(n.content)}catch(a){r.push({kind:"invalid_source",subject:n.path,detail:`${n.path} could not be parsed for recovery producers: ${String(a)}.`});continue}for(let a of i){let d=a.field,c=eb(s,a.offset),l=so(d);l?t.push({path:n.path,line:c,field:d,kind:l.kind}):/(?:retry_command|candidate_command|fallback_candidate|next_best_command|example|next_step|migration_hint|restore_with)/u.test(d)&&!/(?:_total|_truncated)$/u.test(d)&&r.push({kind:"unknown_recovery_field",subject:`${n.path}:${c}:${d}`,detail:`${d} resembles a recovery reference but has no typed field contract.`})}}let o=Object.fromEntries(de.map(n=>[n,t.filter(s=>s.kind===n).length]));for(let n of de)o[n]===0&&r.push({kind:"missing_kind_producer",subject:n,detail:`No source producer emits the ${n} recovery-reference kind.`});return t.sort((n,s)=>n.path!==s.path?Q(n.path,s.path):n.line!==s.line?n.line-s.line:Q(n.field,s.field)),r.sort((n,s)=>n.subject!==s.subject?Q(n.subject,s.subject):Q(n.kind,s.kind)),{ok:r.length===0,scanned_file_count:e.length,producer_count:t.length,producer_count_by_kind:o,producers:t,findings:r}}function sL(e,t){let r=[],o=(n,s)=>{if(Array.isArray(n)){n.forEach((i,a)=>o(i,[...s,String(a)]));return}if(!(typeof n!="object"||n===null))for(let[i,a]of Object.entries(n).sort(([d],[c])=>Q(d,c))){let d=so(i),c=d?.kind==="migration_hint"&&n.semantics==="behavior_preserving"?{...d,semantics:"behavior_preserving"}:d,l=[a].flat();c!==void 0&&l.forEach((p,f)=>{let _="nested_value_field"in c&&typeof c.nested_value_field=="string"?c.nested_value_field:void 0,g=_&&typeof p=="object"&&p!==null&&!Array.isArray(p)?p[_]:p;if(typeof g!="string"||g.trim().length===0)return;let T=[...s,i,String(f)].map(w=>encodeURIComponent(w)).join("/");r.push({id:`${e}:${c.kind}:${T}`,probe_id:e,kind:c.kind,semantics:c.semantics,value:g})}),o(a,[...s,i])}};return o(t,[]),r}function aL(e,t){let r=e.flatMap(i=>(i.owned_states??[]).map(a=>({contract:i,state:a}))),o=[],n=new Map;for(let i of t){if(n.has(i.probe_id)){o.push({kind:"duplicate_probe",probe_id:i.probe_id,detail:`Observation ${i.probe_id} was supplied more than once.`});continue}n.set(i.probe_id,i)}let s=new Set(r.map(({state:i})=>i.probe_id));for(let{contract:i,state:a}of r){let d=n.get(a.probe_id);if(!d){o.push({kind:"missing_probe",probe_id:a.probe_id,detail:`No entrypoint observation was recorded for ${i.code}.`});continue}d.code!==i.code&&o.push({kind:"wrong_error_code",probe_id:a.probe_id,detail:`Expected ${i.code}; observed ${d.code}.`}),d.exit_class!==a.expected_exit_class&&o.push({kind:"wrong_exit_class",probe_id:a.probe_id,detail:`Expected ${a.expected_exit_class}; observed ${d.exit_class}.`}),a.entrypoints.includes(d.entrypoint)||o.push({kind:"wrong_entrypoint",probe_id:a.probe_id,detail:`Expected one of ${a.entrypoints.join(", ")}; observed ${d.entrypoint}.`})}for(let i of t)s.has(i.probe_id)||o.push({kind:"undeclared_probe",probe_id:i.probe_id,detail:`Observation ${i.probe_id} has no catalog declaration.`});return o.sort((i,a)=>i.probe_id!==a.probe_id?i.probe_id.localeCompare(a.probe_id):i.kind.localeCompare(a.kind)),{ok:o.length===0,declared_probe_count:r.length,observed_probe_count:t.length,findings:o}}function dL(e,t){let r=[],o=new Set,n=new Set;for(let d of e){if(o.has(d.id)){n.add(d.id),r.push({kind:"duplicate_obligation",reference_id:d.id,detail:`Recovery obligation ${d.id} was declared more than once.`});continue}o.add(d.id)}let s=new Map;for(let d of t){if(s.has(d.id)){r.push({kind:"duplicate_observation",reference_id:d.id,detail:`Recovery reference ${d.id} was observed more than once.`});continue}s.set(d.id,d),o.has(d.id)||r.push({kind:"undeclared_observation",reference_id:d.id,detail:`Recovery observation ${d.id} has no emitted obligation.`})}for(let d of e){if(n.has(d.id))continue;let c=s.get(d.id);c?c.reachable?c.semantics!==d.semantics&&r.push({kind:"wrong_semantics",reference_id:d.id,detail:`Recovery reference ${d.value} promised ${d.semantics}; proof demonstrated ${c.semantics}.`}):r.push({kind:"unreachable_reference",reference_id:d.id,detail:`Recovery reference ${d.value} did not reach its promised target.`}):r.push({kind:"missing_observation",reference_id:d.id,detail:`No reachability proof was recorded for ${d.kind} ${d.value}.`})}let i=de.map(d=>{let c=e.filter(p=>p.kind===d),l=c.filter(p=>!n.has(p.id)).map(p=>s.get(p.id)).filter(p=>p!==void 0);return{kind:d,declared:c.length,observed:l.length,passed:c.filter(p=>{let f=s.get(p.id);return!n.has(p.id)&&f?.reachable===!0&&f.semantics===p.semantics}).length}});r.sort((d,c)=>d.reference_id!==c.reference_id?d.reference_id.localeCompare(c.reference_id):d.kind.localeCompare(c.kind));let a=i.reduce((d,c)=>d+c.passed,0);return{ok:r.length===0,declared_reference_count:e.length,observed_reference_count:t.length,pass_fraction:o.size===0?1:a/o.size,coverage_by_kind:i,findings:r}}function tb(e,t){let r=new Map(de.map(s=>[s,new Set]));for(let s of t)r.get(s.kind).add(s.value);let o=de.map(s=>({kind:s,source_producers:e.producer_count_by_kind[s],runtime_values:r.get(s).size})),n=o.filter(({source_producers:s,runtime_values:i})=>s>0&&i===0).map(({kind:s})=>s);return{ok:e.ok&&n.length===0,source_producer_count:e.producer_count,runtime_value_count:o.reduce((s,{runtime_values:i})=>s+i,0),coverage_by_kind:o,missing_runtime_kinds:n}}var cL=tb;(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="2b2197f3-7203-52c8-9cc7-f714b33a9306")}catch{}})();var pL=16,rb=Object.freeze(["bulk_ids_input_empty","bulk_ids_input_missing_path","bulk_ids_input_unreadable","invalid_argument_value","missing_lifecycle_target","missing_required_argument","projection_options_mutually_exclusive","tracker_not_initialized","tracker_root_missing","tracker_root_not_directory","tracker_root_unreadable","unknown_context_intent","unknown_field_projection","unknown_option","unknown_subcommand"]),ao=18,co=Object.freeze([...rb,"manifest_unknown_key","no_version_bounds_declared"].sort((e,t)=>e.localeCompare(t)));function uL(e,t=ao){return{ok:e.executable_error_code_count>=t,baseline:t,actual:e.executable_error_code_count}}function mL(e,t=co){let r=new Set(e.rows.filter(({disposition:n})=>n==="executable").map(({canonical_code:n})=>n)),o=t.filter(n=>!r.has(n));return{ok:o.length===0,required_canonical_codes:[...t],missing_required_canonical_codes:o}}function _t(e,t){let r=e.get(t);if(r)return r;let o={kinds:new Set,probeIds:new Set};return e.set(t,o),o}function fL(e,t,r){let o=new Map(e.map(l=>[l.code,l.canonical_code??l.code])),n=new Map,s=0,i=0;for(let l of e){let p=_t(n,l.canonical_code??l.code);for(let f of l.owned_states??[])p.kinds.add("owned_state"),p.probeIds.add(f.probe_id)}for(let l of t){let p=o.get(l.error_code);if(p===void 0)continue;s+=1;let f=_t(n,p);f.kinds.add("closed_domain"),f.probeIds.add(l.probe_id)}for(let l of r){let p=o.get(l.error_code);if(p===void 0)continue;i+=1;let f=_t(n,p);f.kinds.add("grammar"),f.probeIds.add(l.probe_id)}let a=e.map(l=>{let p=l.canonical_code??l.code,f=n.get(p),_=[...f.probeIds].sort();return{code:l.code,canonical_code:p,disposition:_.length>0?"executable":"uncovered",evidence_kinds:[...f.kinds].sort(),probe_ids:_}}).sort((l,p)=>l.code<p.code?-1:1),d=a.filter(({disposition:l})=>l==="uncovered").map(({code:l})=>l),c=a.length-d.length;return{ok:d.length===0,catalog_error_code_count:a.length,executable_error_code_count:c,uncovered_error_code_count:d.length,coverage_fraction:a.length===0?1:c/a.length,closed_domain_probe_count:s,grammar_probe_count:i,uncovered_error_codes:d,rows:a}}function _L(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: ${ao}`,`- Required executable canonical codes: ${co.map(r=>`\`${r}\``).join(", ")}`,`- Uncovered error codes: ${e.uncovered_error_code_count}`,`- Coverage fraction: ${e.coverage_fraction.toFixed(6)}`,`- Closed-domain probes: ${e.closed_domain_probe_count}`,`- Grammar probes: ${e.grammar_probe_count}`,"","| Error code | Canonical code | Disposition | Evidence kinds | Probe count |","| --- | --- | --- | --- | --- |",...t,""].join(`
30
- `)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="d252409d-e33e-5c9e-9671-789f0ee87312")}catch{}})();function ob(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 nb(e){return[e.exit_code!==ue.USAGE?{code:"non_refusal_exit",probe_id:e.probe_id,detail:`${e.entrypoint} returned exit code ${e.exit_code}; a structured usage refusal must return ${ue.USAGE}.`}:void 0,e.allowed_values_required!==!1&&e.allowed_values.length===0?{code:"missing_allowed_values",probe_id:e.probe_id,detail:"The refusal omitted its complete accepted value domain."}:void 0,e.allowed_values.includes(e.rejected_value)?{code:"accepted_rejected_value",probe_id:e.probe_id,detail:`${e.rejected_value} is both rejected and advertised as allowed.`}:void 0,e.suggested_retry.trim().length===0?{code:"missing_suggested_retry",probe_id:e.probe_id,detail:"The refusal omitted an executable suggested retry."}:void 0,e.retry_succeeded?void 0:{code:"retry_failed",probe_id:e.probe_id,detail:"The advertised suggested retry did not succeed."},...ob(e)]}function yL(e){let t=[],r=new Set,o=0;e.length===0&&t.push({code:"empty_corpus",probe_id:"corpus",detail:"At least one real refusal observation is required."});for(let n of e){if(r.has(n.probe_id)){t.push({code:"duplicate_probe",probe_id:n.probe_id,detail:`${n.probe_id} was supplied more than once.`});continue}r.add(n.probe_id);let s=t.length;for(let i of nb(n))i!==void 0&&t.push(i);t.length===s&&(o+=1)}return t.sort((n,s)=>n.probe_id!==s.probe_id?n.probe_id.localeCompare(s.probe_id):n.code.localeCompare(s.code)),{ok:t.length===0,probe_count:r.size,closed_probe_count:o,closure_fraction:r.size===0?0:o/r.size,findings:t}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="39b4e1fe-a34a-5ffc-9447-eaf8c46863c7")}catch{}})();var lo="not-a-declared-action";function ib(e,t){if(e.startsWith("assurance ")&&t.name==="kind")return"measurement";switch(t.value_kind){case"integer":return"1";case"item_id":return"pm-domain";case"action":throw new Error(`Cannot synthesize a preceding action value for positional slot ${t.name}.`);default:return"example"}}function ce(e){return e.replaceAll(/[^a-z0-9]+/gu,"-").replaceAll(/^-|-$/gu,"")}function OL(e=Be.filter(t=>vt.some(r=>r.command===t.command&&r.disposition!=="package_owned"))){let t=new Set(e.filter(({command:r})=>!r.includes(" ")).map(({command:r})=>ce(r)));return e.flatMap(r=>r.slots.flatMap((o,n)=>{if(!o.required)return[];let s=r.command.split(" "),i=ce(r.command),a=s.length>1&&t.has(i)?s.map(ce).join("--"):i,d=ee(r.command).flatMap(l=>l.required?[l.flag,...l.value_name?["example"]:[]]:[]),c=je.some(l=>l.command===r.command);return[{probe_id:`required-argument-${a}-${ce(o.name)}`,command:r.command,refusal_args:[...s,...r.slots.slice(0,n).map(l=>ib(r.command,l)),...d],recovery_args:[...s,"--help"],error_code:c&&!r.command.startsWith("assurance ")?"invalid_argument_value":/^extension (?:activate|adopt|deactivate|uninstall)$/u.test(r.command)?"missing_lifecycle_target":"missing_required_argument",missing_argument:o.name,missing_argument_index:n}]})).sort((r,o)=>r.probe_id.localeCompare(o.probe_id))}function sb(e){switch(L(e)){case"assurance":case"workspace snapshot":return je.filter(({parent:t})=>t===e).map(({action:t})=>t);case"graph":return Fe;case"merge":return Ge;case"plan":return We;case"profile":return Xe;case"schema":return Lt;default:throw new Error(`Required positional action family ${e} has no authoritative value domain.`)}}function IL(e=Be){return e.filter(({slots:t})=>t[0]?.required===!0&&t[0].value_kind==="action").map(({command:t})=>{let r=t.split(" ");return{probe_id:`unknown-subcommand-${ce(t)}`,command:t,refusal_args:[...r,lo],recovery_args:[...r,"--help"],error_code:"unknown_subcommand",rejected_value:lo,allowed_values:[...sb(t)].sort()}}).sort((t,r)=>t.probe_id.localeCompare(r.probe_id))}function ab(e,t){let r=[...t].sort();return e.length===t.length&&[...e].sort().every((o,n)=>o===r[n])}function db(e,t){if(!t)return[{code:"refusal_probe_missing",probe_id:e.probe_id,detail:`${e.probe_id} has no runtime observation.`}];let r=[];return t.error_code!==e.error_code&&r.push({code:"refusal_error_code_mismatch",probe_id:e.probe_id,detail:`${e.probe_id} emitted ${t.error_code||"<none>"}; expected ${e.error_code}.`}),t.exit_code!==2&&r.push({code:"refusal_exit_code_mismatch",probe_id:e.probe_id,detail:`${e.probe_id} exited ${t.exit_code}; expected usage exit 2.`}),"allowed_values"in e&&!ab(t.allowed_values,e.allowed_values)&&r.push({code:"refusal_allowed_values_mismatch",probe_id:e.probe_id,detail:`${e.probe_id} did not expose its complete action domain.`}),t.recovery_succeeded||r.push({code:"refusal_recovery_failed",probe_id:e.probe_id,detail:`${e.probe_id} help recovery did not succeed.`}),t.refusal_mutated_state&&r.push({code:"refusal_mutated_state",probe_id:e.probe_id,detail:`${e.probe_id} changed tracker state while refusing input${t.mutated_paths?.length?`: ${t.mutated_paths.join(", ")}`:"."}`}),r}function RL(e,t){let r=new Map(e.map(i=>[i.probe_id,i])),o=new Map(t.map(i=>[i.probe_id,i])),n=[...e.flatMap(i=>db(i,o.get(i.probe_id))),...t.filter(i=>!r.has(i.probe_id)).map(i=>({code:"unexpected_refusal_probe",probe_id:i.probe_id,detail:`${i.probe_id} has no declared grammar refusal contract.`}))];n.sort((i,a)=>i.probe_id.localeCompare(a.probe_id)||i.code.localeCompare(a.code));let s=new Set(n.map(({probe_id:i})=>i));return{ok:n.length===0,probe_count:e.length,closed_probe_count:e.filter(({probe_id:i})=>!s.has(i)).length,findings:n}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="d3795bc4-fbe5-5ca4-bc90-b72a2d469dc7")}catch{}})();var ht=[{probe_id:"tracker-root-missing",failure_kind:"missing_root",expected_error_code:"tracker_root_missing",expected_exit_code:3,recovery_kind:"initialize"},{probe_id:"tracker-root-settings-missing",failure_kind:"settings_missing",expected_error_code:"tracker_not_initialized",expected_exit_code:3,recovery_kind:"initialize"},{probe_id:"tracker-root-not-directory",failure_kind:"not_directory",expected_error_code:"tracker_root_not_directory",expected_exit_code:2,recovery_kind:"select_directory"},{probe_id:"tracker-root-unreadable",failure_kind:"unreadable_root",expected_error_code:"tracker_root_unreadable",expected_exit_code:1,recovery_kind:"repair_permissions"}];function PL(){return ht.map(e=>({...e}))}function cb(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 kL(e){let t=new Map(e.map(n=>[n.probe_id,n])),r=[],o=0;for(let n of ht){let s=t.get(n.probe_id);if(s===void 0){r.push({code:"missing_probe",probe_id:n.probe_id,detail:"No runtime observation was supplied for this contract."});continue}let i=cb(n,s);r.push(...i),i.length===0&&(o+=1)}return r.sort((n,s)=>n.probe_id.localeCompare(s.probe_id)||n.code.localeCompare(s.code)),{ok:r.length===0,probe_count:ht.length,closed_probe_count:o,findings:r}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="1335ff24-7fec-5bc4-8bc3-48ef7767f237")}catch{}})();var Re,lb=Object.freeze({list:"list-item-projection","list-all":"list-item-projection","list-draft":"list-item-projection","list-open":"list-item-projection","list-in-progress":"list-item-projection","list-blocked":"list-item-projection","list-closed":"list-item-projection","list-canceled":"list-item-projection",get:"get-item-projection",graph:"graph-detail-projection",search:"search-result-projection",history:"history-entry-projection",events:"mutation-event-projection",activity:"activity-entry-projection",deps:"dependency-graph-projection",health:"health-diagnostic-projection",validate:"validation-diagnostic-projection",contracts:"contract-catalog-projection"});function pb(e,t){if(t==="--limit")return"result-row-limit";if(t==="--node-limit")return"graph-node-limit";if(t==="--edge-limit")return"graph-edge-limit";if(t==="--output-limit")return"rendered-output-row-limit";if(t==="--output-budget")return"rendered-output-byte-budget";if(t==="--token-budget")return"context-intent-token-budget";if(t==="--full"){let r=lb[L(e)];if(r===void 0)throw new Error(`Command ${e} exposes --full without a registered projection concept.`);return r}return t!=="--file"?t.slice(2):["create","update","update-many"].includes(L(e))?"linked-file-path":["comments","notes","learnings"].includes(L(e))?"entry-file-input":"plan-definition-file"}function Me(){if(Re!==void 0)return Re;let e=te.filter(({command:n})=>qe(n)).flatMap(({command:n,family:s})=>Pt(n,ee(n)).map(i=>({command:n,family:s,concept:pb(n,i.flag),flag:i.flag,aliases:Object.freeze([...i.aliases??[]]),value_kind:i.repeatable?"list":i.flag==="--limit"?"number":i.value_type}))),t=new Set(e.flatMap(n=>n.aliases.map(s=>`${n.command}:${s}`))),r=e.filter(n=>!t.has(`${n.command}:${n.flag}`)),o=new Map;for(let n of r){let s=o.get(n.concept)??new Set;s.add(n.value_kind),o.set(n.concept,s)}return Re=Object.freeze(r.map(n=>Object.freeze({...n,concept:o.get(n.concept)?.size===1?n.concept:`${n.concept}@${n.command}`}))),Re}function FL(){return Object.freeze(Me().map(e=>Object.freeze({command:e.command,canonical_flag:e.flag,accepted_spellings:Object.freeze([...new Set([e.flag,...e.aliases])].sort())})))}var po=Object.freeze({init:30,item:20,config:36,extension:55,package:56,packages:56,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:29,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:56,"test-all":40,telemetry:21,stats:29,health:36,validate:46,assurance:30,gc:22,workspace:23,contracts:29,claim:39,release:25,"start-task":23,"pause-task":23,"close-task":24,meet:33,event:33,remind:29,"test-runs-worker":20}),uo=Object.freeze({...po,...Object.fromEntries(xe.flatMap(({alias:e,canonical:t})=>{let r=po[e];return r===void 0?[]:[[t,r]]}))});function mo(){let e=new Map(Object.keys(uo).map(t=>[t,0]));for(let{command:t}of Me())e.set(t,Number(e.get(t))+1);return Object.freeze(Object.entries(uo).map(([t,r])=>Object.freeze({command:t,current:Number(e.get(t)),maximum:r})))}function ub(e,t,r){for(let o of e)for(let n of o.aliases){let s=t.get(`${o.command}:${n}`);s===void 0||s.flag===o.flag||r.push({code:"alias_collision",command:o.command,detail:`${n} aliases ${o.flag} but is canonical for ${s.flag}.`})}}function mb(e,t,r){let o=new Set(t.map(({command:n})=>n));for(let n of e.keys())o.has(n)||r.push({code:"missing_budget",command:n,detail:`${n} has canonical flags but no persisted budget.`});for(let n of t){let s=e.get(n.command)??0;s===0&&r.push({code:"stale_budget",command:n.command,detail:`${n.command} has a persisted budget but no canonical flags.`}),!(s<=n.maximum)&&r.push({code:"budget_exceeded",command:n.command,detail:`${s} canonical flags exceed the ratcheted maximum ${n.maximum}.`})}}function fb(e,t,r){let o=new Map(e.map(n=>[`${n.command}:${n.flag}`,n]));for(let n of t){let s=`${n.command}:${n.canonical_flag}`,i=o.get(s);if(!i){r.push({code:"removed_canonical_spelling",command:n.command,detail:`${n.canonical_flag} disappeared from the executable spelling inventory.`});continue}let a=new Set([i.flag,...i.aliases]);for(let d of n.accepted_spellings)a.has(d)||r.push({code:"removed_compatibility_spelling",command:n.command,detail:`${d} no longer resolves to ${n.canonical_flag}.`})}}function GL(e=Me(),t=mo(),r=[]){let o=[],n=new Map,s=new Map,i=new Map,a=new Map;for(let d of e){let c=`${d.command}:${d.flag}`;n.has(c)?o.push({code:"duplicate_canonical_flag",command:d.command,detail:`${d.flag} has more than one canonical row.`}):n.set(c,d),a.set(d.command,(a.get(d.command)??0)+1);let l=s.get(d.concept);l!==void 0&&l!==d.value_kind?o.push({code:"inconsistent_concept_kind",command:d.command,detail:`${d.concept} uses both ${l} and ${d.value_kind}.`}):s.set(d.concept,d.value_kind);let p=i.get(d.concept);p!==void 0&&p!==d.flag?o.push({code:"semantic_spelling_collision",command:d.command,detail:`${d.concept} is canonicalized by both ${p} and ${d.flag}.`}):i.set(d.concept,d.flag)}return ub(e,n,o),mb(a,t,o),fb(e,r,o),o.sort((d,c)=>d.command.localeCompare(c.command)||d.code.localeCompare(c.code)||d.detail.localeCompare(c.detail)),{ok:o.length===0,entry_count:e.length,budget_count:t.length,concept_count:new Set(e.map(({concept:d})=>d)).size,baseline_entry_count:r.length,findings:o}}function UL(){let e=Me(),t=mo(),r=new Map(t.map(({command:o})=>[o,"unknown"]));for(let{command:o,family:n}of e)r.set(o,n);return["# Generated flag lexicon budgets","","This file is generated by `listPmFlagLexicon()`. Compatibility aliases do not consume canonical budget.","","| Command | Capability family | Canonical flags | Maximum |","| --- | --- | ---: | ---: |",...t.map(({command:o,current:n,maximum:s})=>{let i=r.get(o);return`| \`${o}\` | ${i} | ${n} | ${s} |`}),""].join(`
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]="4c9a1aa8-05b6-53da-a8b1-f1a7289d39cf")}catch{}})();function BL(e){return e}function qL(e){return e}function zL(e){return e}function VL(e){return e}function HL(e){return e}function KL(e){return e}function WL(e){return e}function XL(e){return e}function YL(e){return e}function JL(e){return e}function ZL(e){return e}function QL(e){return e}function eD(e){return e}function tD(e){return{handled:!0,result:e}}function rD(){return{handled:!1}}function oD(e){return e}function nD(e){return e}function iD(e){return e}function sD(e){return e}function aD(e){return e}function dD(e){return e}function cD(e){return e}function lD(e){return e}function pD(e){return e}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="68ca9ab1-91e0-5020-859e-fc1f1f6dcc56")}catch{}})();function _b(e={},t={}){return new he(t).extension(void 0,{...e,migrate:!0})}function hb(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]="d0b86c6a-67f0-52f2-90b8-d1058e8f2284")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="604d7dcb-9fea-5631-8a72-b2a7ff3278f8")}catch{}})();function N(e){if(typeof e!="string"||!fe(e))throw new TypeError("Invalid reliability timestamp.");return Date.parse(e)}function gb(e){let t=N(e.window_start),r=N(e.window_end);if(t>=r||!Number.isFinite(e.max_failure_rate)||e.max_failure_rate<0||e.max_failure_rate>=1||!Number.isSafeInteger(e.min_completed_attempts)||e.min_completed_attempts<1)throw new TypeError("Invalid reliability window policy.");if(e.families.length===0||e.families.some(o=>typeof o!="string"||o.trim().length===0)||new Set(e.families).size!==e.families.length)throw new TypeError("Expected unique, nonempty reliability families.");return{start:t,end:r}}function yb(e,t,r,o){let n=new Map(t.map(i=>[i,[]])),s=new Set;for(let i of e){if(typeof i.id!="string"||i.id.trim().length===0||s.has(i.id))throw new TypeError("Invalid or duplicate reliability attempt identity.");s.add(i.id);let a=n.get(i.family);if(!a||!["success","failure","pending"].includes(i.outcome)||i.cause!==void 0&&(!["product","infrastructure","unknown"].includes(i.cause)||i.outcome!=="failure"))throw new TypeError("Invalid reliability attempt family, outcome or cause.");let d=N(i.started_at);if(i.repaired_at!==void 0&&(N(i.repaired_at)<d||i.outcome!=="failure"))throw new TypeError("Invalid reliability repair chronology.");d>=r&&d<o&&a.push(i)}return n}function RD(e,t){let{start:r,end:o}=gb(t),n=[...yb(e,t.families,r,o)].map(([s,i])=>{let a=i.filter(_=>_.outcome==="failure"),d=i.filter(_=>_.outcome!=="pending").length,c=d===0?null:a.length/d,l=a.filter(_=>_.repaired_at!==void 0&&N(_.repaired_at)<o),p={product:0,infrastructure:0,unknown:0};for(let _ of a)p[_.cause??"unknown"]+=1;let f=[];return d<t.min_completed_attempts&&f.push("insufficient_completed_attempts"),c!==null&&c>t.max_failure_rate&&f.push("failure_rate"),{family:s,attempts:i.length,completed:d,failed:a.length,pending:i.length-d,failure_rate:c,affected_days:[...new Set(a.map(_=>new Date(N(_.started_at)).toISOString().slice(0,10)))].sort(),repair_minutes:l.map(_=>(N(_.repaired_at)-N(_.started_at))/6e4).sort((_,g)=>_-g),unresolved:a.length-l.length,causes:p,violations:f,ok:f.length===0}});return{schema:"pm-reliability-window/1",window_start:new Date(r).toISOString(),window_end:new Date(o).toISOString(),ok:n.every(s=>s.ok),families:n}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="773ad2b6-326e-5483-bdce-a377f935cb31")}catch{}})();function le(e){return typeof e=="string"&&e.length>0&&e.trim()===e}function bb(e){if(!Array.isArray(e)||e.length<2)throw new TypeError("Expected at least two artifact ledgers.");let t=new Map;for(let r of e){if(r===null||typeof r!="object"||!le(r.name)||t.has(r.name)||r.complete!==!0)throw new TypeError("Expected unique complete artifact ledgers.");if(!Array.isArray(r.identities))throw new TypeError("Invalid or duplicate artifact identity.");let o=new Set(r.identities);if(o.size!==r.identities.length||[...o].some(n=>!le(n)))throw new TypeError("Invalid or duplicate artifact identity.");t.set(r.name,o)}if([...t.values()].every(r=>r.size===0))throw new TypeError("Empty inventories cannot establish artifact reconciliation.");return t}function Tb(e,t){if(!Array.isArray(e))throw new TypeError("Expected unique evidence-backed artifact exceptions.");let r=new Map;for(let o of e){if(o===null||typeof o!="object"||!le(o.identity)||r.has(o.identity)||!le(o.reason)||!le(o.evidence))throw new TypeError("Expected unique evidence-backed artifact exceptions.");let n=o.missing_from;if(!Array.isArray(n)||n.length===0||n.length>=t.length||new Set(n).size!==n.length||[...n].some(s=>!t.includes(s)))throw new TypeError("Invalid artifact exception ledger signature.");r.set(o.identity,o)}return r}function PD(e,t=[]){let r=bb(e),o=[...r.keys()].sort(),n=Tb(t,o),s=[...new Set([...r.values()].flatMap(c=>[...c]))].sort(),i=[],a=new Set;for(let c of s){let l=o.filter(_=>!r.get(_).has(c));if(l.length===0)continue;let p=n.get(c),f=p!==void 0&&JSON.stringify([...p.missing_from].sort())===JSON.stringify(l);f&&a.add(c),i.push({identity:c,present_in:o.filter(_=>r.get(_).has(c)),missing_from:l,disposition:f?{reason:p.reason,evidence:p.evidence}:null})}let d=[...n.keys()].filter(c=>!a.has(c)).sort();return{schema:"pm-artifact-ledgers/1",ok:i.every(c=>c.disposition!==null)&&d.length===0,counts:Object.fromEntries(o.map(c=>[c,r.get(c).size])),findings:i,stale_exceptions:d}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="fca4e9bb-3a30-512e-9929-565ab6c11c54")}catch{}})();import{createHash as _o,createHmac as Cb,randomBytes as wb,timingSafeEqual as Sb}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="837ee381-0838-55d3-bcdf-7352fb76661d")}catch{}})();var f1="dev.unbrained.pm/progressive-tool-discovery",_1=Object.freeze({version:1,discoveryTool:"pm_discover",canonicalResult:"structuredContent.result",compatibilityText:"pointer"}),Eb=Object.freeze(["pm_discover","pm_next","pm_context","pm_search","pm_get"]),B=Object.freeze({lexical:.4,semantic:.2,graph:.1,permission:.15,freshness:.05,usage:.1}),Ab=Object.freeze(["profile_changed","tool_contract_changed","workspace_extension_changed","authorization_changed","ranking_signal_changed","cursor_integrity_key_rotated"]),ho={core:0,standard:1,full:2,internal:3},go=Object.freeze(["core","standard","full"]),vb=new Set(["core","standard","full","custom"]),yo=new Set(te.map(({family:e})=>e)),Ob=wb(32);function ke(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 bo(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 To(e){if(e!=="unbounded"&&(!Number.isInteger(e)||Number(e)<128))throw new b("pm tool discovery outputBudget must be unbounded or an integer of at least 128.",64);return e==="unbounded"?e:Number(e)}function Co(e){if(e!==void 0&&typeof e!="boolean")throw new b("pm tool discovery includeSchema must be a boolean.",64);return e===!0}function wo(e){if(e===null||typeof e!="object"||Array.isArray(e))throw new b("pm tool discovery options must be an object.",64)}function Ib(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 h1(e){if(wo(e),e.family!==void 0&&(typeof e.family!="string"||!yo.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"||!go.includes(e.tier)))throw new b("pm tool discovery tier must be core, standard, or full.",64);return{...e.query!==void 0?{query:ke(e.query,"query")}:{},...e.family!==void 0?{family:e.family}:{},...e.tier!==void 0?{tier:e.tier}:{},...e.limit!==void 0?{limit:bo(e.limit)}:{},...e.cursor!==void 0?{cursor:ke(e.cursor,"cursor")}:{},...e.includeSchema!==void 0?{includeSchema:Co(e.includeSchema)}:{},...e.outputBudget!==void 0?{outputBudget:To(e.outputBudget)}:{}}}function Rb(e){return e===void 0||!Number.isFinite(e)?0:Math.min(1,Math.max(0,e))}function pe(e){return[...new Set(e.toLowerCase().match(/[a-z0-9]+/gu)??[])].sort()}function Mb(e,t){let r=pe(e);if(r.length===0)return 0;let o=new Set(pe(t)),n=r.filter(i=>o.has(i)).length,s=t.toLowerCase().includes(e.toLowerCase())?.25:0;return Math.min(1,n/r.length+s)}function Pb(e,t){let r=pe(e);if(r.length===0)return 0;let o=t.toLowerCase(),n=pe(t),s=r.filter(a=>n.some(d=>d.startsWith(a)||a.startsWith(d))).length,i=o.includes(e.toLowerCase())?.2:0;return Math.min(1,s/r.length+i)}function fo(e){return _o("sha256").update(JSON.stringify(e)).digest("hex").slice(0,24)}function So(e,t,r){return Cb("sha256",r).update(JSON.stringify({version:1,fingerprint:e,offset:t})).digest("base64url")}function kb(e,t,r){let o={version:1,offset:t,signature:So(e,t,r)};return Buffer.from(JSON.stringify(o),"utf8").toString("base64url")}function xb(e,t,r,o){if(e===void 0)return 0;try{let n=JSON.parse(Buffer.from(e,"base64url").toString("utf8"));if(n.version!==1||!Number.isInteger(n.offset)||(n.offset??-1)<0||Number(n.offset)>r||typeof n.signature!="string")throw new Error("cursor fields do not match the request");let s=Buffer.from(So(t,n.offset,o),"base64url"),i=Buffer.from(n.signature,"base64url");if(i.length!==s.length||!Sb(i,s))throw new Error("cursor signature does not match the request");return n.offset}catch(n){throw new b("Invalid or stale pm tool discovery cursor; restart discovery without cursor.",64,{reason:String(n)})}}function gt(e,t,r){return{value:Rb(e),weight:t,available:r!=="unavailable",source:r}}function Pe(e,t,r){return gt(e??t,r,e===void 0?"computed":"host")}function Nb(e,t,r){let o=Object.hasOwn(_e,e.name)?_e[e.name]:"help",n=Ve(o),s=`${e.name} ${e.description} ${o} ${n}`,i=Mb(t,s),a=new Set(pe(t)),d={lexical:gt(i,B.lexical,"computed"),semantic:Pe(e.signals?.semantic,Pb(t,s),B.semantic),graph:Pe(e.signals?.graph,a.has(n)||a.has(o)?1:0,B.graph),permission:gt(1,B.permission,"authorization"),freshness:Pe(e.signals?.freshness,1,B.freshness),usage:Pe(e.signals?.usage,Eb.includes(e.name)?1:0,B.usage)},c=Object.values(d).reduce((l,p)=>l+p.value*p.weight,0);return{name:e.name,description:e.description,command:o,tier:He(o),family:n,score:Number(c.toFixed(6)),signals:d,...r?{input_schema:structuredClone(e.inputSchema)}:{}}}function Lb(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"||!go.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"||!yo.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"||!vb.has(e.profile)))throw new b("pm tool discovery profile must be core, standard, full, or custom.",64)}function Db(e){let t=ke(e.query===void 0?"":e.query,"query").trim().replace(/\s+/gu," ");ke(e.cursor===void 0?"":e.cursor,"cursor");let r=bo(e.limit===void 0?10:e.limit),o=To(e.outputBudget===void 0?1200:e.outputBudget);return Lb(e),{query:t,includeSchema:Co(e.includeSchema),limit:r,budget:o,maximumTier:ho[e.tier??"full"],profile:e.profile===void 0?"core":e.profile}}function Eo(e,t,r){let o=r??e.tools.reduce((i,a,d)=>i+(d===0?0:1)+Buffer.byteLength(JSON.stringify(a),"utf8"),0),n={...e,tools:[]},s=0;for(let i=0;i<4;i+=1){let a=Buffer.byteLength(JSON.stringify({...n,token_cost:{estimated_tokens:s,budget:t,within_budget:!0}}),"utf8"),d=Math.ceil((a+o)/4);if(d===s)break;s=d}return s}function $b(e,t,r){return e.filter(o=>o.authorized!==!1).map(o=>Nb(o,r.query,r.includeSchema)).filter(o=>o.tier!=="internal"&&ho[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 Fb(e,t,r){if(t==="unbounded")return[...e];let o=[],n=0;for(let[s,i]of e.entries()){let a=n+(s===0?0:1)+Buffer.byteLength(JSON.stringify(i),"utf8");if(Eo(r(s+1),t,a)>t)break;o.push(i),n=a}return o}function g1(e,t={}){Ib(e),wo(t);let r=Db(t),o=t.cursorIntegrityKey??Ob,n=$b(e,t,r),s=fo({query:r.query,family:t.family??null,tier:t.tier??"full",includeSchema:r.includeSchema,profile:r.profile,ranked:n}),i=xb(t.cursor,s,n.length,o),a=n.slice(i,i+r.limit),d=[];r.includeSchema||d.push({name:"input_schema",reason:"compact_projection",restore_with:"Set includeSchema=true."}),i+r.limit<n.length&&d.push({name:"tools",reason:"limit",restore_with:"Continue with next_cursor or increase limit."});let c={result_type:"pm_tool_discovery",contract_version:1,query:r.query,profile:r.profile,total:n.length,ranking_policy:{version:1,formula:"weighted_sum_then_name",weights:B},cache:{key:fo({fingerprint:s,cursorIntegrityKey:_o("sha256").update(o).digest("hex"),limit:r.limit,offset:i,budget:r.budget}),ttl_ms:3e4,scope:"private",invalidates_on:Ab}},l=(g,T=g.length)=>{let w=i+T,q=w<n.length,I=[...d];return T<a.length&&I.push({name:"tools",reason:"token_budget",restore_with:"Continue with next_cursor or increase outputBudget."}),{...c,tools:[...g],returned:T,has_more:q,...q?{next_cursor:kb(s,w,o)}:{},omission_receipt:{has_omissions:I.length>0,omitted:I}}},p=g=>{let T=l(g),w=Eo(T,r.budget);return{...T,token_cost:{estimated_tokens:w,budget:r.budget,within_budget:r.budget==="unbounded"||w<=r.budget}}},f=Fb(a,r.budget,g=>l([],g)),_=p(f);if(a.length>0&&f.length===0){let g=p([a[0]]).token_cost.estimated_tokens;throw new b(`pm tool discovery outputBudget is too small to return a tool; increase it to at least ${g}.`,64,{required:String(g)})}if(r.budget!=="unbounded"&&_.token_cost.estimated_tokens>r.budget)throw new b(`pm tool discovery outputBudget is too small; at least ${_.token_cost.estimated_tokens} estimated tokens are required for this page.`,64,{required:String(_.token_cost.estimated_tokens)});return _}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="d007edcb-46f0-5546-b804-27d86afe23e7")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="d5bbe6f5-d674-5c87-b32b-6b31b84736e8")}catch{}})();export{CO as ACTIONABILITY_ORDERING_KINDS,Qa as ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS,wa as ACTIVITY_FLAG_CONTRACTS,fi as AGENT_PROVENANCE_DIMENSIONS,ss as AGGREGATE_FLAG_CONTRACTS,Hs as APPEND_FLAG_CONTRACTS,sM as ASSURANCE_ACTIONS,aM as ASSURANCE_DECLARATION_KINDS,bI as ASSURANCE_DOCUMENT_VERSION,ua as ASSURANCE_FLAG_CONTRACTS,TI as ASSURANCE_GATE_TRIGGERS,CI as ASSURANCE_MEASUREMENT_SOURCE_KINDS,uR as ASSURANCE_PRESET_IDS,_I as AssuranceEvaluationRefusalError,fI as AssuranceMutationRefusalError,hI as AssuranceSourceResolutionError,ei as BASELINE_ITEM_FORMAT_VERSION,Cy as BOUNDARY_FIXTURE_CAPTURE_SOURCES,Xw as BRIEF_LIST_FIELDS,hi as BUILTIN_AGENT_PROVENANCE_ADAPTERS,X as BUILTIN_CORPUS_SHAPES,_i as BUILTIN_HARNESS_SIGNAL_DESCRIPTORS,Uo as BUILTIN_ITEM_TYPE_VALUES,zt as BUILTIN_PROFILES,Gb as BUILTIN_RELATIONSHIP_KINDS,Ya as CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS,Ca as CALENDAR_FLAG_CONTRACTS,Ks as CLAIM_FLAG_CONTRACTS,Yd as CLOSE_ACTION_OPTION_KEYS,zs as CLOSE_FLAG_CONTRACTS,Vs as CLOSE_MANY_FLAG_CONTRACTS,Qs as CLOSE_TASK_FLAG_CONTRACTS,as as COMMENTS_FLAG_CONTRACTS,cT as COMMON_MUTATION_COMMAND_OPTION_KEYS,Na as COMPLETION_FLAG_CONTRACTS,Ho as CONFIDENCE_TEXT_VALUES,ws as CONFIG_FLAG_CONTRACTS,Ja as CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS,zM as CONTEXT_EVALUATION_METRIC_NAMES,Ea as CONTEXT_FLAG_CONTRACTS,jt as CONTEXT_OUTPUT_VALUES,XM as CONTEXT_PACKING_PROFILES,DM as CONTEXT_RECENCY_EPOCH,UM as CONTEXT_RELEVANCE_SERVICE,FM as CONTEXT_RELEVANCE_SIGNAL_NAMES,ZM as CONTEXT_SIGNAL_SET_VERSION,JM as CONTEXT_SIGNAL_STORE_FORMAT_VERSION,QM as CONTEXT_SIGNAL_STORE_WARNING_DETAILS,Ew as CONTEXT_USAGE_LIMITS,xa as CONTRACTS_FLAG_CONTRACTS,ga as COPY_FLAG_CONTRACTS,Sd as CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,Ad as CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,Ed as CREATE_COMMANDER_STRING_OPTION_CONTRACTS,Xb as CREATE_DIRECT_CLOSE_REASON_DEFAULT,ma as CREATE_FLAG_CONTRACTS,vS as CURRENT_HISTORY_HASH_ALGORITHM,VS as CURRENT_HISTORY_ITEM_HASH_VERSION,KS as CURRENT_HISTORY_RECORD_HASH_VERSION,ti as CURRENT_ITEM_FORMAT_VERSION,oP as ContextSignalStore,Aw as ContextUsageValidationError,RM as DEFAULT_AUTHOR_IDENTITY_VOCABULARY,TP as DEFAULT_CHILD_SAMPLE_LIMIT,Ww as DEFAULT_COMPACT_LIST_FIELDS,WE as DEFAULT_DERIVED_INDEX_MINIMUM_ITEMS,km as DEFAULT_EVAL_QUERIES_RELATIVE_PATH,dR as DEFAULT_RELATIONSHIP_CONTEXT_TOKEN_BUDGET,CM as DEFAULT_TERMINAL_TRANSITION_POLICY,aP as DEFAULT_WORKSPACE_MEMORY_MINIMUM_ITEMS,uO as DEFECT_ESCAPE_CLASSES,mO as DEFECT_GATE_EVIDENCE_DISPOSITIONS,Xs as DELETE_FLAG_CONTRACTS,qo as DEPENDENCY_KIND_VALUES,Oa as DEPS_FLAG_CONTRACTS,ps as DOCS_FLAG_CONTRACTS,ca as DUPLICATES_FLAG_CONTRACTS,FR as DURABLE_MERGE_RECEIPT_INTRODUCED_AT,gO as DefectRecurrencePolicyParseError,Ra as EVAL_FLAG_CONTRACTS,Am as EVAL_METRIC_NAMES,Rm as EVAL_QUERY_SET_CONTRACT,Mm as EVAL_QUERY_SET_EXAMPLE,Im as EVAL_QUERY_SET_SCHEMA_ID,Sa as EVENTS_FLAG_CONTRACTS,ta as EVENT_FLAG_CONTRACTS,No as EXECUTABLE_COMMAND_ALIASES,ue as EXIT_CODE,xs as EXTENSION_ACTIVATE_FLAG_CONTRACTS,ks as EXTENSION_ADOPT_ALL_FLAG_CONTRACTS,Us as EXTENSION_ADOPT_FLAG_CONTRACTS,JP as EXTENSION_CAPABILITIES,Kb as EXTENSION_CAPABILITY_CONTRACT,Vb as EXTENSION_CAPABILITY_CONTRACT_VERSION,Hb as EXTENSION_CAPABILITY_LEGACY_ALIASES,wn as EXTENSION_CAPABILITY_REGISTRATION_SURFACES,Gs as EXTENSION_CATALOG_FLAG_CONTRACTS,Ns as EXTENSION_DEACTIVATE_FLAG_CONTRACTS,Ps as EXTENSION_DESCRIBE_FLAG_CONTRACTS,Fs as EXTENSION_DOCTOR_FLAG_CONTRACTS,Ms as EXTENSION_EXPLORE_FLAG_CONTRACTS,Ss as EXTENSION_FLAG_CONTRACTS,As as EXTENSION_INIT_FLAG_CONTRACTS,Is as EXTENSION_INSTALL_FLAG_CONTRACTS,Ds as EXTENSION_MANAGE_FLAG_CONTRACTS,Ls as EXTENSION_MIGRATE_FLAG_CONTRACTS,ZP as EXTENSION_POLICY_MODES,QP as EXTENSION_POLICY_SURFACES,$s as EXTENSION_RELOAD_FLAG_CONTRACTS,t0 as EXTENSION_SANDBOX_PROFILES,Es as EXTENSION_SCOPE_FLAG_CONTRACTS,e0 as EXTENSION_TRUST_MODES,Rs as EXTENSION_UNINSTALL_FLAG_CONTRACTS,FO as EXTERNAL_DEPENDENCY_RESOLUTION_STATUSES,DO as EXTERNAL_DEPENDENCY_SOURCE_KIND,$O as EXTERNAL_DEPENDENCY_SOURCE_KIND_ALIAS,ls as FILES_FLAG_CONTRACTS,ya as FOCUS_FLAG_CONTRACTS,aa as GC_FLAG_CONTRACTS,Zw as GET_DEPTH_VALUES,Aa as GET_FLAG_CONTRACTS,ns as GLOBAL_FLAG_CONTRACTS,gp as GRAPH_DURABLE_CACHE_MIN_ITEMS,hp as GRAPH_DURABLE_CACHE_VERSION,Ia as GRAPH_FLAG_CONTRACTS,hA as GRAPH_QUERY_DEFAULTS,Fe as GRAPH_SUBCOMMAND_VALUES,va as GUIDE_FLAG_CONTRACTS,la as HEALTH_FLAG_CONTRACTS,hs as HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS,nR as HISTORY_AUTHOR_ATTRIBUTION_BASELINE,uM as HISTORY_COMPACT_BULK_DEFAULT_MIN_ENTRIES,gs as HISTORY_COMPACT_FLAG_CONTRACTS,Mi as HISTORY_EVENT_CLASSIFICATION_VERSION,us as HISTORY_FLAG_CONTRACTS,ES as HISTORY_HASH_ALGORITHMS,$E as HISTORY_ITEM_HASH_VERSION_3_INTRODUCED_IN,fs as HISTORY_REDACT_FLAG_CONTRACTS,_s as HISTORY_REPAIR_FLAG_CONTRACTS,Wc as INIT_AGENT_GUIDANCE_MODE_VALUES,Cs as INIT_FLAG_CONTRACTS,js as INSTALL_FLAG_CONTRACTS,Vo as ISSUE_SEVERITY_VALUES,_a as ITEM_COMPLETE_FLAG_CONTRACTS,RR as ITEM_LATEST_TIMESTAMP_FIELDS,Wb as ITEM_METADATA_KEY_ORDER,fa as ITEM_MUTATE_FLAG_CONTRACTS,ha as ITEM_REOPEN_FLAG_CONTRACTS,wR as ITEM_SCALAR_MISSING_VALUE,jo as ITEM_TYPE_VALUES,IR as ITEM_UNION_COLLECTION_FIELDS,rP as JsonFileContextSignalStoreAdapter,cs as LEARNINGS_FLAG_CONTRACTS,AS as LEGACY_HISTORY_HASH_ALGORITHM,ru as LINKED_TEST_ENV_NAME_PATTERN,ou as LINKED_TEST_PM_CONTEXT_MODE_VALUES,tu as LINKED_TEST_PROTECTED_ENV_KEYS,nu as LINKED_TEST_WORKSPACE_CONTEXT_MODE_VALUES,Wa as LIST_COMMANDER_STRING_OPTION_CONTRACTS,Yw as LIST_COMMAND_DEFAULT_PROJECTIONS,o0 as LIST_FILTER_EXTENSION_FLAG_DEFINITIONS,is as LIST_FILTER_FLAG_CONTRACTS,HO as LIST_SORT_FIELDS,KO as LIST_SORT_ORDER_VALUES,Pi as MAINTENANCE_HISTORY_OPERATIONS,bP as MAX_CHILD_PROJECTION_ITEMS,TT as MAX_WORKFLOW_POLICIES,CT as MAX_WORKFLOW_POLICY_TERMS,ea as MEET_FLAG_CONTRACTS,UP as MERGE_DRIVER_ARTIFACT_VALUES,ms as MERGE_FLAG_CONTRACTS,Ge as MERGE_SUBCOMMAND_VALUES,qP as MUTATION_EVENT_WIRE_BUDGET,ie as MemoryRelationshipGraphAdapter,Za as NEXT_COMMANDER_STRING_OPTION_CONTRACTS,Pa as NEXT_FLAG_CONTRACTS,Xu as NEXT_OUTPUT_VALUES,ds as NOTES_FLAG_CONTRACTS,vs as PACKAGE_FLAG_CONTRACTS,Os as PACKAGE_INIT_FLAG_CONTRACTS,Zs as PAUSE_TASK_FLAG_CONTRACTS,Xd as PLAN_CREATE_METADATA_PARAMETER_KEYS,Ts as PLAN_FLAG_CONTRACTS,nm as PLAN_SHOW_DEPTH_VALUES,We as PLAN_SUBCOMMANDS,im as PLAN_TEMPLATE_NAMES,ky as PM_AGENT_TASK_ACCOUNTING_MODES,ut as PM_AGENT_TASK_TRANSCRIPT_VERSION,Mo as PM_BULK_LIFECYCLE_COMMAND_ALIASES,Fi as PM_CLI_EXPECTED_ERROR_NAME,wA as PM_CLI_GRAMMAR_CONTRACT,gA as PM_CLI_GRAMMAR_NOUNS,ln as PM_CLI_ONLY_TOOL_ACTION_WAIVERS,yA as PM_CLI_SHARED_VERBS,xo as PM_COMMAND_ALIAS_CONTRACTS,te as PM_COMMAND_CAPABILITY_CONTRACTS,vt as PM_COMMAND_DESTINATION_CONTRACTS,cI as PM_COMMAND_EXIT_CONTRACTS,dI as PM_COMMAND_EXIT_OUTCOME_CONTRACTS,Un as PM_COMMAND_OUTPUT_BUDGET_CONTRACTS,iI as PM_COMMAND_OUTPUT_ENVELOPE_CONTRACTS,Be as PM_COMMAND_POSITIONAL_CONTRACTS,gc as PM_COMMAND_VISIBILITY_CONTRACTS,ZI as PM_COMPLETE_LIST_FINDING_CODES,iS as PM_CONTEXT_INTENTS_FILE,Lw as PM_CONTEXT_INTENT_CONTRACTS,Ro as PM_CONTEXT_OPS_COMMAND_ALIASES,sn as PM_CORE_COMMAND_NAMES,G as PM_CORPUS_SHAPE_SCHEMA,un as PM_DEPRECATED_TOOL_ACTIONS,Ln as PM_DIAGNOSTIC_DEGRADATION_STEPS,Dn as PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS,Nn as PM_DIAGNOSTIC_OUTPUT_CLASSES,mn as PM_DISCOVERABLE_TOOL_ACTIONS,Hr as PM_EPISODE_SCHEMA,oI as PM_ERROR_CODE_CATALOG,QO as PM_ERROR_CODE_EXIT_CLASS_CONTRACTS,Zr as PM_EXACT_COVERAGE_METRICS,Qo as PM_EXTENSION_CAPABILITY_CONTRACTS,an as PM_EXTENSION_PACKAGE_ACTION_SUBCOMMANDS,tn as PM_EXTENSION_POLICY_MODE_CONTRACTS,nn as PM_EXTENSION_POLICY_SURFACE_CONTRACTS,on as PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS,en as PM_EXTENSION_SERVICE_NAME_CONTRACTS,rn as PM_EXTENSION_TRUST_MODE_CONTRACTS,qI as PM_GITATTRIBUTES_END,BI as PM_GITATTRIBUTES_START,VI as PM_GITATTRIBUTES_V2_END,zI as PM_GITATTRIBUTES_V2_START,Ac as PM_GITIGNORE_END,Ec as PM_GITIGNORE_START,hM as PM_HISTORY_ATTESTATION_CONTRACT,Io as PM_HISTORY_COMMAND_ALIASES,yS as PM_HISTORY_OPERATION_ALIASES,TS as PM_HISTORY_OPERATION_CONTRACT,bS as PM_HISTORY_OPERATION_PATTERNS,cn as PM_ITEM_ACTION_SUBCOMMANDS,hS as PM_ITEM_HISTORY_OPERATIONS,it as PM_MCP_APPS_EXTENSION,Rr as PM_MCP_APPS_SERVER_CAPABILITY,Ee as PM_MCP_APPS_SPEC_VERSION,kr as PM_MCP_APP_CONTRACTS,Pr as PM_MCP_APP_MIME_TYPE,Eb as PM_MCP_ENTRY_TOOL_NAMES,m as PM_MCP_ERROR_CODES,px as PM_MCP_HTTP_PROTOCOL_VERSION,qh as PM_MCP_INPUT_REQUEST_METHODS,Lk as PM_MCP_LEGACY_PROTOCOL_VERSIONS,tr as PM_MCP_LOG_LEVELS,E as PM_MCP_META_KEYS,f1 as PM_MCP_PROGRESSIVE_DISCOVERY_EXTENSION,_1 as PM_MCP_PROGRESSIVE_DISCOVERY_SERVER_CAPABILITY,wc as PM_MCP_PROMPT_CONTRACTS,V as PM_MCP_PROTOCOL_VERSION,Cc as PM_MCP_RESOURCE_CONTRACTS,at as PM_MCP_SKILLS_DRAFT_REVISION,xr as PM_MCP_SKILLS_EXTENSION,Xg as PM_MCP_SKILLS_SERVER_CAPABILITY,M as PM_MCP_SKILL_LIMITS,we as PM_MCP_SUBSCRIPTION_ID_META_KEY,Ye as PM_MCP_SUPPORTED_PROTOCOL_VERSIONS,ox as PM_MCP_TASKS_EXTENSION,eg as PM_MCP_TASK_STATUSES,_e as PM_MCP_TOOL_COMMAND_CONTRACTS,wC as PM_MODE_PAIRED_OUTPUT_PROJECTION_CONTRACTS,ld as PM_MUTATION_ACTION_CONTRACTS,xe as PM_NAMESPACED_COMMAND_ALIASES,zr as PM_OBSERVATION_SCHEMA,xn as PM_OUTPUT_BUDGET_CLASSES,kn as PM_OUTPUT_DEGRADATION_STEPS,kt as PM_OUTPUT_ENVELOPE_KINDS,$t as PM_PACKAGE_CONVENTIONAL_RESOURCE_ROOTS,dn as PM_PACKAGE_ONLY_ACTION_SUBCOMMANDS,Dt as PM_PACKAGE_RESOURCE_KINDS,je as PM_POSITIONAL_ACTION_CONTRACTS,oc as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA,tc as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION,JC as PM_READ_OUTPUT_COMPOSITION_OPTION_FLAGS,cw as PM_READ_OUTPUT_CONTINUATION_FINGERPRINT_POLICIES,XC as PM_READ_OUTPUT_DIMENSIONS,YC as PM_READ_OUTPUT_OPTION_FLAGS,zC as PM_READ_OUTPUT_SESSION_MAX_SEEN_ITEM_IDS,qC as PM_READ_OUTPUT_SESSION_MIN_TOKENS,MT as PM_READ_OUTPUT_SURFACES,ZC as PM_READ_OUTPUT_SURFACE_CONTRACTS,CC as PM_READ_ROW_CONTRACTS,TC as PM_READ_ROW_JQ_SELECTOR,nL as PM_RECOVERY_REFERENCE_FIELDS,de as PM_RECOVERY_REFERENCE_KINDS,rb as PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE,co as PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE_V2,pL as PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE,ao as PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE_V2,Po as PM_RELOCATED_COMMAND_ALIASES,nd as PM_REPRODUCIBLE_PROCESS_ENV,lI as PM_SUCCESS_EXIT_CODES,pn as PM_TOOL_ACTIONS,Jd as PM_TOOL_ACTION_PARAMETER_CONTRACTS,rc as PM_TOOL_PARAMETERS_SCHEMA,ec as PM_TOOL_PARAMETERS_SCHEMA_MAJOR,Qd as PM_TOOL_PARAMETERS_SCHEMA_VERSION,Kd as PM_TOOL_RESERVED_CUSTOM_FIELD_PROPERTIES,Vr as PM_VERDICT_SCHEMA,gS as PM_WORKSPACE_HISTORY_OPERATIONS,Br as PM_WORKSPACE_RECIPE_SCHEMA,bs as PROFILE_FLAG_CONTRACTS,Jt as PROFILE_LINT_CODES,Yt as PROFILE_LINT_DIMENSIONS,qt as PROFILE_NAMES,Xe as PROFILE_SUBCOMMANDS,b as PmCliError,he as PmClient,QI as PmCompleteListValidationError,y as PmMcpAuthorizationError,rr as PmMcpInputRequiredError,Er as PmMcpIssuerCredentialStore,u as PmMcpProtocolError,or as PmMcpRequestStateReplayGuard,Gr as PmMcpSkillRegistry,fr as PmMcpSubscriptionRegistry,ot as PmMcpTaskStore,Cw as QUERY_CURSOR_CONTRACT,qs as REINDEX_FLAG_CONTRACTS,Ev as REINDEX_LOCK_ID,pt as RELATIONSHIP_GRAPH_SNAPSHOT_VERSION,Ys as RELEASE_FLAG_CONTRACTS,ra as REMIND_FLAG_CONTRACTS,At as RESERVED_ITEM_FIELD_NAMES,Ws as RESTORE_FLAG_CONTRACTS,zo as RISK_VALUES,aA as RelationshipEventLog,dA as RelationshipEventStore,z as RelationshipGraph,Le as RelationshipKindRegistry,ys as SCHEMA_FLAG_CONTRACTS,Xa as SEARCH_COMMANDER_STRING_OPTION_CONTRACTS,n0 as SEARCH_EXTENSION_FLAG_DEFINITIONS,ka as SEARCH_FLAG_CONTRACTS,wu as SEMANTIC_ATTRIBUTION_LIMITS,Jb as SETTINGS_DEFAULTS,$m as SNAPSHOT_SCHEMA,GI as SOURCE_CONTEXT_ACCESS_ENV,UI as SOURCE_CONTEXT_WRITE_OVERRIDE_ENV,Js as START_TASK_FLAG_CONTRACTS,da as STATS_FLAG_CONTRACTS,Bo as STATUS_VALUES,os as SUBCOMMAND_GLOBAL_FLAG_CONTRACTS,ki as SUBSTANTIVE_HISTORY_OPERATIONS,HS as SUPPORTED_HISTORY_ITEM_HASH_VERSIONS,WS as SUPPORTED_HISTORY_RECORD_HASH_VERSIONS,Qb as SUPPRESS_HOST_OUTPUT_MARKER,ia as TELEMETRY_FLAG_CONTRACTS,uf as TELEMETRY_SUBCOMMANDS,na as TEST_ALL_FLAG_CONTRACTS,oa as TEST_FLAG_CONTRACTS,sa as TEST_RUNS_FLAG_CONTRACTS,af as TEST_RUN_MEASUREMENT_LIMIT,qd as TOOL_ACTIVITY_OPTION_CONTRACTS,Pd as TOOL_AGGREGATE_OPTION_CONTRACTS,Gd as TOOL_BULK_MUTATION_FILTER_OPTION_CONTRACT_SOURCE,Bd as TOOL_CALENDAR_OPTION_CONTRACTS,jd as TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS,zd as TOOL_CONTEXT_OPTION_CONTRACTS,Dd as TOOL_CREATE_OPTION_CONTRACTS,Ld as TOOL_CREATE_OPTION_CONTRACT_SOURCE,Vd as TOOL_DEPS_OPTION_CONTRACTS,Hd as TOOL_GRAPH_OPTION_CONTRACTS,Md as TOOL_LIST_FILTER_OPTION_CONTRACTS,kd as TOOL_SEARCH_FILTER_OPTION_CONTRACTS,Nd as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS,xd as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACT_SOURCE,Ud as TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS,Fd as TOOL_UPDATE_OPTION_CONTRACTS,$d as TOOL_UPDATE_OPTION_CONTRACT_SOURCE,Yb as TYPE_TO_FOLDER,LA as UNKNOWN_SUBCOMMAND_COMPATIBILITY_CODES,vd as UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,Id as UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,Od as UPDATE_COMMANDER_STRING_OPTION_CONTRACTS,ba as UPDATE_FLAG_CONTRACTS,Ta as UPDATE_MANY_FLAG_CONTRACTS,Bs as UPGRADE_FLAG_CONTRACTS,pa as VALIDATE_FLAG_CONTRACTS,bT as WORKFLOW_POLICY_ACTIONS,WI as WORKFLOW_POLICY_DOCUMENT_SCHEMA,KI as WORKFLOW_POLICY_SCHEMA,Ma as WORKSPACE_FLAG_CONTRACTS,mE as WORKSPACE_HISTORY_ID,Fm as WORKSPACE_SNAPSHOT_ACTIONS,Tl as WorkspaceGraphCache,mA as WorkspaceTransactionInterruptedError,Vp as _testOnly,yP as _testOnlyAggregateCommand,yl as _testOnlyConfigCommand,EP as _testOnlyGetCommand,Pp as _testOnlyHealthCommand,Zc as _testOnlyInit,Xc as _testOnlyInitAgentGuidance,x0 as _testOnlyItemTransaction,KP as _testOnlyMutationEvents,_P as _testOnlyNextCommand,GP as _testOnlySearchCommand,lR as _testOnlySimilarity,cm as _testOnlyTemplates,Bp as _testOnlyValidateCommand,YP as _testOnlyWorkspacePosition,hR as acceptAssuranceProposals,Up as acknowledgeLinkedTests,_l as acknowledgeUnknownAuthorHistoryEvents,fl as acknowledgeUnknownAuthorHistoryEventsFromTransport,XE as acquireItemMetadataDerivedIndexLock,Ue as acquireLock,X0 as activateExtensionForTest,XT as activateExtensions,mi as agentSessionEnvironment,m_ as aggregate,Xm as analyzeAgentProvenanceDescriptorCoverage,_O as analyzeDefectChangeRisk,iM as analyzeDefectRecurrenceCoverage,ql as analyzeDuplicateItems,lA as analyzeGraphImpact,ac as analyzeHierarchyIntegrity,pA as analyzeKnowledgeGraph,uI as analyzePmCommandExitConformance,fn as analyzePmToolActionParity,HR as analyzeReconciliationDiscard,cA as analyzeRelationshipExecution,dp as analyzeRelationshipSchedule,$h as analyzeSdkActionCoverage,Mt as analyzeSdkCliParameterCompleteness,A_ as append,Li as appendHistoryEntry,gE as appendWorkspaceAuditEvent,hE as appendWorkspaceHistoryChange,UA as applyAcceptanceCriteriaMutations,fR as applyAssurancePreset,ja as applyBootstrapPagerPolicy,eM as applyClosureTimestampFix,Uw as applyContextIntentProjection,Wu as applyContextTagProjection,WO as applyFilterValueEcho,IE as applyHistoryPatch,od as applyInvocationAuthorOverride,Rl as applyPathMigrations,sw as applyReadOutputDimensions,rw as applyReadOutputIncludeModes,HC as applyReadOutputSessionReferences,NE as applyRegisteredItemFieldDefaultsAndValidation,xl as applyStandaloneNote,Zi as applyStoredExtensionMigrationState,BA as applyTagRemovals,AM as applyTerminalOrderingPolicy,Nl as artifactKey,dT as asRecordClone,aT as asRecordOrNull,ze as assembleWorkspaceRelationshipGraph,oR as assertCompleteListResult,Rk as assertExtensionBlueprint,Ik as assertExtensionCapabilityUsage,lk as assertExtensionDeactivated,kk as assertExtensionManifestCompatible,Pk as assertExtensionManifestMatchesBlueprint,xk as assertExtensionPreflight,lc as assertHierarchyMutationAllowed,mM as assertHistoryCompactTarget,WR as assertHistoryRepairTarget,Jn as assertInitializedTracker,Ml as assertLinkedArtifactMutationIsUnambiguous,$k as assertMcpClientCapabilities,Dk as assertMcpProtocolHeader,Py as assertMemoryRelationshipGraphAdapterConformance,VA as assertNoUnknownCsvKeys,eu as assertNonHierarchyCardinalityMutationAllowed,pk as assertPackageManifest,cv as assertParentReferenceIsNotSelf,jx as assertPmMcpSkillsCapability,Mk as assertProjectProfile,zE as assertProjectRuntimeCompatibility,jE as assertProjectRuntimeFormatGuard,SC as assertProjectionModeChoice,Yn as assertReadableTrackerRoot,uk as assertRegisteredCommandContract,wk as assertRegisteredCommandOverride,yk as assertRegisteredExporter,mk as assertRegisteredFlags,fk as assertRegisteredHook,gk as assertRegisteredImporter,bk as assertRegisteredItemField,Tk as assertRegisteredItemType,Ok as assertRegisteredMigration,Sk as assertRegisteredParserOverride,Ek as assertRegisteredPreflightOverride,Ck as assertRegisteredProfile,Ak as assertRegisteredRendererOverride,_k as assertRegisteredSearchProvider,vk as assertRegisteredServiceOverride,hk as assertRegisteredVectorStoreAdapter,qb as assertRelationshipEdgeAllowed,to as assertRelationshipGraphAdapterConformance,MA as assertSchemaPreviewSupported,_f as assertTestMeasurementRun,wI as assuranceAssertionUpdateIsLoosening,qw as attachContextIntentReceipt,vw as attachContextUsageServingReceipt,Dp as attachLinkedTestMutationProvenance,Lp as attachLinkedTestProvenance,Ze as attachMcpServerInfo,RC as attachOutputOmissionReceipt,Vw as attachOutputTokenAccounting,zw as attachReadOutputContracts,KC as attachReadOutputSessionReceipt,kc as auditMergeAttributeFence,HI as auditMergeDriverConfiguration,fp as auditWorkspaceRelationshipGraph,vx as authorizeMcpHttpRequest,pi as boundAgentEpisodeIdentity,FC as boundReadOutputRows,zu as buildChildrenByParent,xP as buildCompactSearchFilterSummary,XO as buildContentFilterEcho,tP as buildContextSignalSnapshot,fy as buildCorpusShapeItemPlan,fO as buildDefectRecurrenceIndex,Bc as buildExtensionDescribeResult,zc as buildExtensionInstallPlan,YO as buildGovernanceMissingFilterEcho,gv as buildInvalidTypeError,CP as buildItemChildrenRollup,P0 as buildItemCompletionMutations,GM as buildItemContextRelevanceCandidates,tA as buildItemNotFoundError,SP as buildItemSchedule,tM as buildLinkedFileRepairReport,gx as buildMcpAuthorizationDiscoveryUrls,jh as buildMcpCompleteResult,Gk as buildMcpDiscoverResult,wx as buildMcpDynamicRegistrationMetadata,cx as buildMcpHttpRequestHeaders,zk as buildMcpInputRequiredResult,hx as buildMcpProtectedResourceMetadata,Mc as buildMergeAttributePatterns,Zd as buildPmActionToolInputSchema,fL as buildPmRefusalClosureCensus,cR as buildRelationshipContext,Iv as buildSearchCorpus,Mv as buildSemanticCorpusInput,JR as buildStatusRoleWarnings,Xn as buildTrackerInitializationRecovery,Lv as buildVectorizationEmbeddingIdentity,Dv as buildVectorizationEmbeddingMetadata,NP as buildVerboseSearchFilters,XI as buildWorkflowCompletenessCheck,dP as buildWorkspaceMemorySnapshot,li as canonicalDocument,lT as canonicalizeCommandOptionKey,f0 as canonicalizeCommandSuggestions,$M as canonicalizeContextRecencyCoordinate,Ub as canonicalizeRelationshipKind,iL as censusPmRecoveryReferenceProducers,rR as certifyCompleteListResult,V0 as checkExtensionManifestCompatibility,dh as claim,ch as claimNext,iR as classifyHistoryAuthorEvent,xi as classifyHistoryEvent,zR as classifyHistoryMergeReceiptReferences,LT as classifyHostEnvironmentFault,DP as classifyImplicitSemanticFallbackReason,ni as classifyItemFormatVersion,gf as classifyLinkedTestCommandSafety,yf as classifyLinkedTestFailure,uC as clearActiveExtensionHooks,wp as clearDurableGraphCache,jS as clearFocusedItem,Af as clearWorkspaceContractsCache,ah as close,Wp as closeItem,gh as closeTask,za as coalesceRepeatedListFlags,wO as collectBlockedByIds,EO as collectBlockedByIdsFromCorpus,Iw as collectContextUsageDeliveredItemIds,fc as collectDanglingDependencyReferences,vO as collectDependencyBlockedIds,uc as collectDuplicateDependencyRows,mp as collectDuplicateRelationshipEdgeGroups,LP as collectErrorCauseCodes,sc as collectHierarchyRelations,Tr as collectMcpHeaderAnnotations,_c as collectMissingDependencyTargetIds,Qp as collectNewOrderingCycleWarnings,lp as collectOrderingCycles,mc as collectOrderingStorageContradictions,dS as collectPackageContextIntentContracts,Gt as collectPackageExtensionDirectories,kE as collectRegisteredItemFieldNames,xS as collectRuntimeCreateFieldValues,yv as collectRuntimeFilterValues,NS as collectRuntimeUpdateFieldValues,Gu as collectSubtreeIds,Sn as collectUsedExtensionCapabilities,pT as commandOptionFlagLabel,h_ as comments,Xf as commitImportedItem,k0 as commitItemCompletion,M0 as commitItemMutations,_A as commitWorkspaceTransaction,rs as compactFlagAliasContracts,Uu as compareCriticalItems,FE as comparePmDateVersions,uA as compareRelationshipSnapshots,ww as compareTimestampStrings,NM as compileHistoryProvenanceMatcher,Fw as composeContextIntentContracts,F0 as composeExtension,z0 as composeExtensionPackage,IO as computeActionabilityReport,nv as computeHistoryDiff,sp as computeRelationshipCentrality,ip as computeRelationshipDominators,bl as computeWorkspaceGraphFingerprint,O_ as config,pC as consumeAfterCommandAffectedItems,a_ as context,Bw as contextIntentRowId,ph as copy,bf as countFailureCategories,DC as countReadOutputRows,nh as create,mR as createAssurancePreset,oM as createAssuranceWorkspaceContext,PA as createCheckpointId,eR as createCompleteListOptions,YT as createCoreCommandHookContext,Jr as createCorpusShapeMeasurement,OI as createEmptyAssuranceDocument,kT as createEmptyExtensionRegistrationRegistry,Xi as createExtensionCommandSdk,Cn as createExtensionContributionInventory,Nk as createExtensionTestHarness,Ni as createHistoryEntry,eO as createLazyModule,YI as createLifecycleCompletenessPolicies,Ox as createMcpStaticBearerVerifier,nx as createMcpTaskStore,eA as createMutationGuardSdk,EC as createOutputOmissionReceipt,Ui as createPmCliExpectedError,Wn as createPmCliProgram,Fn as createPmCommandOutputBudget,fw as createQueryFingerprint,My as createRelationshipGraphScaleFixture,Z as createRelationshipGraphSnapshot,yt as createRelationshipKindRegistry,sd as createReproducibleProcessRunner,PP as createSearchCursorFingerprint,JT as createSerialQueue,JA as createStdinTokenResolver,DA as createUnknownSubcommandError,RT as createWorkflowPolicyEvaluator,Gm as createWorkspaceSnapshot,Y0 as deactivateExtensionForTest,rD as declineServiceOverride,jw as decodeContextIntentCursor,Qv as decodeHtmlEntitiesInOptions,br as decodeMcpHttpHeaderValue,Kw as decodePmTableRows,yw as decodeQueryCursor,hw as decodeQueryCursorEnvelope,gw as decodeQueryCursorState,uw as decodeReadOutputContinuationCursor,K0 as decodeToon,kx as decoratePmMcpToolsWithApps,Dl as dedupeLinkedArtifacts,jM as defaultScoreContextCandidates,dD as defineAfterCommandHook,sD as defineBeforeCommandHook,aD as defineBeforeMutationHook,zL as defineCommand,JL as defineCommandOverride,W as defineCorpusShape,Jx as defineEpisodeSpecification,iD as defineExporter,D0 as defineExtension,$0 as defineExtensionBlueprint,BL as defineExtensionManifest,VL as defineFlag,nD as defineImporter,KL as defineItemField,HL as defineItemType,WL as defineMigration,ny as defineObservationContract,pD as defineOnIndexHook,lD as defineOnReadHook,cD as defineOnWriteHook,ZL as defineParserOverride,Gn as definePmCommandOutputBudget,nI as definePmCommandOutputEnvelope,eI as definePmErrorCodeCatalog,QL as definePreflightOverride,qL as defineProjectProfile,oD as defineRendererOverride,XL as defineSearchProvider,eD as defineServiceOverride,YL as defineVectorStoreAdapter,dy as defineVerdictContract,Ae as defineWorkspaceRecipe,uh as deleteItem,Vm as deleteWorkspaceSnapshot,zb as dependencyToRelationship,S_ as deps,_R as deriveAssuranceProposals,ZR as deriveClosureTimestamp,U0 as deriveExtensionCapabilities,b0 as deriveMutationTransactionId,mI as derivePmBulkMutationEffect,sL as derivePmRecoveryReferenceObligations,cp as deriveRelationshipDeadlines,Dc as deriveSchemaEvolutionMigrationId,Vv as deriveTelemetryCommandResolution,wv as describeAllowedTransitions,FI as describeExtensionActivation,j0 as describeExtensionBlueprint,qT as describeFlagScalarValueFailure,Ou as describeItemOwnershipConflict,Yx as describeObservationCost,Wt as describeProfileComposition,Xt as describeProjectProfile,pS as describeUnknownError,Si as detectAgentIdentity,Oi as detectHarnessIdentity,op as detectRelationshipCommunities,Ei as diagnoseAgentIdentity,_p as diffRelationshipAuditSnapshots,lf as diffTestRunMeasurements,Kk as digestMcpRequestParameters,KT as discoverExtensions,Xo as discoverNearbyPmRoot,g1 as discoverPmTools,UE as discoverProjectRuntimeVersionPins,w_ as docs,__ as duplicates,yp as durableGraphCachePath,Sp as durableGraphCacheStatus,ri as effectiveItemFormatVersion,cO as emitTelemetryErrorEvent,Wf as emptyImportedDocument,ER as encodeItemScalarDecisionValue,yr as encodeMcpHttpHeaderValue,Hw as encodePmTableRows,_w as encodeQueryCursor,pw as encodeReadOutputContinuationCursor,W0 as encodeToon,LE as enforceHistoryStreamPolicyForItem,DE as enforceHistoryStreamPolicyForItems,JO as enrichCliFlagInvocationContract,Pt as enrichCliFlagInvocationContracts,ME as ensureMaterializedHistoryTarget,Oc as ensurePmGitignore,El as ensureScope,zv as ensureSentryCommandTracing,qv as ensureSentryInit,Kf as ensureTrackerInitialized,tp as enumerateRelationshipPaths,Bn as estimatePmOutputTokens,RI as evaluateAssuranceAssertion,MI as evaluateAssuranceGate,_N as evaluateBoundaryFixtures,VM as evaluateContextRanking,hO as evaluateDefectGateEvidence,II as evaluateMeasurement,Om as evaluateMetricFloors,ud as evaluateMutationGuard,tf as evaluateProvenanceCoverage,RD as evaluateReliabilityWindow,Zm as evaluateSemanticAttributionCoverage,Vl as evaluateSimilarityGovernance,Cv as evaluateTransition,cy as evaluateVerdictContract,IT as evaluateWorkflowPolicies,cd as executeEmbeddingBatchesWithRetry,xv as executeVectorDelete,Nv as executeVectorReset,kv as executeVectorUpsert,ey as executeWorkspaceRecipe,kl as expandAddGlobEntries,Kl as explainSourceTraceability,yM as exportAttestation,yh as extension,Th as extensionActivate,Ch as extensionDeactivate,bh as extensionList,_b as extensionMigrate,qR as extractHistoryMergeReceiptDispositions,BR as extractHistoryMergeReceiptReferences,Sx as extractMcpTraceContext,vE as extractPatchFailureContext,kp as extractReferencedPmItemIdsFromCommand,Ry as federateRelationshipGraphSnapshots,b_ as files,T_ as filesDiscover,C_ as filesLookup,Rw as finalizeContextUsageDelivery,Ty as findCoverageDeficits,zl as findDuplicateClusters,Rc as findGitWorkspaceRoot,iE as findHistoryIdentityDiscontinuities,Uc as findInstalledNpmPackageCandidate,Px as findPmMcpAppByUri,ko as findPmNamespacedCommand,np as findRedundantRelationshipEdges,ap as findRelationshipCutStructure,Bl as findSimilarItems,dO as finishTelemetryCommand,BT as flattenFlagListValue,gy as flushTelemetryQueue,fh as focus,rp as forEachMatchedRelationshipEdge,up as formatDuplicateEdgeGroup,dc as formatHierarchyRelation,pp as formatOrderingStorageContradiction,CA as formatPmPositionalActionFlagTip,Cm as formatProfileApplyHuman,Tm as formatProfileLintHuman,ym as formatProfileListHuman,bm as formatProfileShowHuman,Gc as formatSchemaEvolutionMigrationHuman,FP as formatVectorIndexRecoveryWarnings,XP as formatWorkspacePositionHuman,Z_ as gc,zi as generateItemId,p_ as get,dC as getActiveCommandResult,Dw as getActiveContextIntentContracts,An as getActiveExtensionRegistrations,Ax as getActiveMcpTraceContext,kI as getAssuranceDeclaration,Nh as getContracts,GS as getFocusedItem,Zo as getHistoryPath,sA as getItemAt,Jo as getItemPath,_d as getMutationActionContract,vc as getPmGitignoreBlock,Yo as getSettingsPath,vf as getWorkspaceContracts,fE as getWorkspaceHistoryPath,E_ as graph,bp as graphAuditBaselinePath,Qm as groupHistoryByEpisode,tD as handleServiceOverride,Fk as hasMcpClientExtension,Mx as hasPmMcpAppsCapability,qe as hasSubcommandFlagContractsForCommand,$v as hasVectorizationEmbeddingIdentityChanged,Fv as hasVectorizationVectorDimensionChanged,rE as hashDocument,oE as hashDocumentForVersion,nE as hashEmptyDocument,YS as hashHistoryPatch,XS as hashHistoryRecord,JS as hashHistoryStream,AR as hashItemScalarDecisionValue,J_ as health,Jl as hierarchyAncestors,Zl as hierarchyDescendants,rh as historyCompact,oh as historyCompactBulk,IS as historyDigest,xM as historyEntryMatchesProvenance,GE as historyItemHashVersionForRuntime,Q_ as historyRedact,eh as historyRepair,th as historyRepairAll,SO as indexBlockedByIds,cc as indexHierarchyRelations,Gv as inferConsistentVectorDimension,$n as inferPmOutputBudgetClass,v_ as init,tR as inspectCompleteListResult,xT as inspectExtensionManifestSchema,cl as inspectHistoryAuthorStream,xR as inspectMergeReceiptEvidence,qE as inspectProjectRuntimeCompatibility,Cd as inspectStaleInProgressItems,Fh as inspectStaticExtensionInventory,YR as inspectStatusRoleAssignments,_E as inspectWorkspaceHistoryState,Um as inspectWorkspaceSnapshot,Lc as installMergeFence,Uk as interpretMcpResultType,Ju as isAlreadyClaimedError,fS as isCommanderError,a0 as isCompatibleRecoveryFlag,nl as isErrnoError,lO as isExternalDependencyReference,pO as isExternalDependencySourceKind,me as isFileMissingError,tT as isHostOutputSuppressed,Gi as isItemAlreadyExistsError,SR as isItemScalarMissingValue,GR as isLegacyMergeReceiptSummary,h as isMcpRecord,md as isMutationAction,Bb as isOrderingRelationshipKind,av as isPlaceholderReferenceToken,ji as isPmCliExpectedError,hn as isPmExtensionCapabilityContract,yn as isPmExtensionPolicyModeContract,bn as isPmExtensionPolicySurfaceContract,gn as isPmExtensionServiceNameContract,pI as isPmKnownExitCode,sI as isPmMutationReceipt,Ke as isPmSuccessfulExitCode,$i as isPmTokenBudgetRecovery,_n as isPmToolAction,UR as isPreDurableCloneLocalReceiptSummary,jR as isPreDurableDispositionEligibleReference,BE as isProjectMutatingInvocation,tO as isPureSnakeCaseAlias,aw as isReadOutputBudgetExceeded,BC as isReadOutputSessionReference,s0 as isReadProjectionRecoveryFlag,vC as isReadRowContract,nc as isRuntimeRecord,nO as isTerminalPlanMode,DS as isTerminalStatus,Kn as isTimestampLiteral,E0 as itemDocumentToMutationOptions,wP as itemHasSchedule,In as jaccardSimilarity,y_ as learnings,PT as levenshteinDistanceWithinLimit,tl as limitAnnotationEntries,$p as linkedTestTrustFingerprint,B0 as lintExtensionBlueprint,NT as lintExtensionManifestSchema,Zt as lintProjectProfile,d_ as list,yi as listAgentProvenanceAdapters,qa as listAliasPluralKeys,c_ as listAllComplete,ZE as listAllDocumentCandidatesCached,Wi as listAllItemMetadata,QE as listAllItemMetadataLight,PI as listAssuranceDeclarations,$I as listAssuranceVerdicts,uy as listBuiltinCorpusShapes,_0 as listCoreClosedDomainContracts,Qw as listGetProjectionFields,TR as listInvalidProvenanceHistoryStreamIds,Jw as listListProjectionFields,NR as listMergeReceipts,fd as listMutationActions,zP as listMutationEvents,mo as listPmCommandFlagBudgets,bc as listPmCommandsForFamily,yc as listPmCommandsForTier,Me as listPmFlagLexicon,FL as listPmFlagSpellingInventory,Tc as listPmMcpToolsForProfile,OL as listPmRequiredArgumentRefusalContracts,IL as listPmSubcommandRefusalContracts,Kt as listProfiles,PL as listTrackerPreflightRecoveryContracts,O0 as listUpsertKeyCandidates,jm as listWorkspaceSnapshots,cS as loadContextIntentRuntimeLayers,lm as loadCreateTemplateOptions,WT as loadExtensions,Ap as loadGraphAuditBaseline,I0 as loadGuardedRuntimeSchema,xA as loadMutationCheckpoint,x as loadRelationshipGraphAdapter,Hi as locateItem,zA as looksLikeGenericKeyValueEntry,$C as mapReadOutputRows,LR as markMergeReceiptReconciled,bv as matchesRuntimeFilters,sO as maybeRunFirstUseTelemetryPrompt,_y as measureCorpusShapePlan,Vi as measureItemMetadataReadWork,jA as mergeAdditiveTags,G0 as mergeExtensionBlueprints,vR as mergeHistoryStreams,MR as mergeItemDocuments,PR as mergeJsonDocuments,Va as mergeLinkedTestTwoTokenEntries,OR as mergeRelationshipEventStreams,Hu as mergeSortedWarnings,oO as migrateItemFilesToFormat,oA as mutateItem,rA as mutateItemWithHistoryContext,yE as mutateWorkspaceJsonWithHistory,u_ as next,Ti as normalizeAgentProvenanceAdapterValue,el as normalizeAnnotationTransportOptions,yI as normalizeAssuranceEvaluation,gI as normalizeAssuranceMutation,Ha as normalizeBootstrapInvocation,tv as normalizeBulkIdsValue,pc as normalizeDependencyGraphTarget,BO as normalizeDependencySeedId,jO as normalizeDependencySourceKind,Tn as normalizeExtensionContributionInventory,SS as normalizeHistoryOperationForWrite,bR as normalizeInvalidHistoryProvenance,RA as normalizeItemAddressInvocation,oi as normalizeItemFormatVersion,qi as normalizeItemId,ai as normalizeItemMetadata,qO as normalizeItemReference,Ba as normalizeLegacyExtensionActionSyntax,Pl as normalizeLinkedPath,sv as normalizeParentReferenceValue,Vt as normalizeProfileName,Bi as normalizeRawItemId,ow as normalizeReadOutputIncludeModeOptions,cE as normalizeReplayPatchOps,hd as normalizeSimilarityText,LS as normalizeStatusForRegistry,si as normalizeStatusInput,MS as normalizeStatusInputWithRegistry,mS as normalizeThrownExitCode,g_ as notes,Hn as nowIso,Tp as openDurableGraphCache,Hk as openMcpRequestState,Zx as openPmEpisode,Ql as orderingPredecessors,ep as orderingSuccessors,YM as packContextCandidates,ju as packRankedContextItems,Ph as packageActivate,Mh as packageCatalog,kh as packageDeactivate,Ih as packageDescribe,vh as packageDoctor,Eh as packageInstall,wh as packageLifecycle,Sh as packageList,Oh as packageManage,hb as packageMigrate,Rh as packageReload,Ah as packageUninstall,Tw as paginateQueryRows,Al as parseAddEntries,vl as parseAddGlobEntries,ol as parseAnnotationTextInput,T0 as parseAtomicMutationControls,Ua as parseBootstrapCommandName,$a as parseBootstrapGlobalOptions,Ga as parseBootstrapHelpRequest,Ka as parseBootstrapTypeValue,ev as parseBulkIdsText,$u as parseContextDepth,xu as parseContextFocusFields,sS as parseContextIntentDeclarations,Fu as parseContextSections,eP as parseContextSignalSnapshot,qA as parseCsvKv,bO as parseDefectChangeRiskRequest,nM as parseDefectRecurrenceCoverageRequest,yO as parseDefectRecurrencePolicy,vm as parseEvalMetricFloors,Pm as parseEvalQuerySet,FT as parseExtensionLongFlagToken,Ip as parseGraphSubcommand,gM as parseHistoryAttestation,PM as parseHistoryProvenanceFilters,RO as parseIntegerLimit,$S as parseItemDocument,C0 as parseItemMutationBatch,hv as parseLimit,mu as parseLinkedTestAssertionEqualsMap,fu as parseLinkedTestAssertionGteMap,au as parseLinkedTestBoolean,du as parseLinkedTestContextMode,su as parseLinkedTestEnvClear,iu as parseLinkedTestEnvSet,_u as parseLinkedTestJsonEntries,uu as parseLinkedTestMinLines,pu as parseLinkedTestRegexList,lu as parseLinkedTestStringList,cu as parseLinkedTestWorkspaceContextMode,Hh as parseMcpCachePolicy,Gh as parseMcpImplementation,tt as parseMcpInputRequests,ar as parseMcpInputResponses,hg as parseMcpSubscriptionFilter,Il as parseMigrateEntries,kO as parseMultiValueFilter,aI as parseMutationReceipt,QA as parseOptionalNonNegativeInteger,ZA as parseOptionalNumber,ZN as parsePmAgentTaskTranscriptCorpus,h1 as parsePmToolDiscoveryOptions,MO as parsePriority,LO as parsePriorityFilterSet,VC as parseReadOutputSession,xE as parseRegisteredItemFieldAssignments,se as parseRelationshipGraphSnapshot,Ol as parseRemoveEntries,Hl as parseSourceLineRange,uv as parseStatusFilterCsv,xO as parseStringFilterSet,dd as parseTags,df as parseTestRunMeasurements,PO as parseType,NO as parseTypeFilterSet,ml as parseUnknownAuthorHistoryEventCoordinates,wT as parseWorkflowPolicy,ST as parseWorkflowPolicyDocument,hP as partitionDecisionEntries,ov as patchPathToChangedField,$o as pathExists,hh as pauseTask,Cp as persistDurableGraphResult,SE as persistSelectedItemFormat,aR as planAgentIdentityVocabularyMutation,sP as planCompletedAtBackfill,Vc as planExtensionDirectoryCopy,L0 as planItemMutationDocument,Qt as planProfileApplication,rL as planRelationshipEventBackfill,Op as planRelationshipRemediation,$c as planSchemaEvolutionMigration,pl as planUnknownAuthorHistoryAcknowledgment,Bm as planWorkspaceSnapshotRestore,EA as positionalShapeKey,AA as positionalSignatureKey,H0 as preflightExtension,yd as prepareSimilarityText,KA as preserveMutationStdinTokenFields,HA as preserveMutationStdinTokenLiterals,N0 as previewItemMutationDocument,R0 as previewItemMutations,nS as printError,oS as printResult,V_ as profile,W_ as profileApply,X_ as profileLint,H_ as profileList,K_ as profileShow,lC as projectAfterCommandItemSnapshot,Nu as projectContextFocusRows,sf as projectFleetAttributionAnalytics,kM as projectHistoryProvenance,eS as projectPmBriefListEnvelope,zn as projectPmDiagnosticOutput,Vn as projectPmDiagnosticText,of as projectProvenanceCoverageAnalytics,jp as projectValidateCounts,gR as promoteAssuranceAssertion,Ow as propagateContextUsageServingReceipt,CN as pruneCompileCacheGenerations,xI as putAssuranceDeclaration,NI as putAssuranceDeclarationBundle,VE as queryItemMetadataIndex,HE as queryLinkedFileMetadataIndex,KE as querySimilarItemMetadataIndex,cf as queryTestRunMeasurementsBelow,Mn as quoteCommandArg,Rn as quoteWindowsCommandArg,m0 as rankCommandPaths,rl as readAnnotationEntries,Ai as readAuthorEnvironment,If as readBooleanOption,Nw as readContextUsageAffinity,Rf as readCsvListOption,Ji as readExtensionMigrationState,Fo as readFileIfExists,ed as readFirstStringFromCommanderOptions,td as readFirstValueFromCommanderOptions,ef as readHistoryAnalyticsWindow,zS as readHistoryEntries,Ri as readHistorySnapshot,Km as readImprovementLedger,YE as readItemMetadataDerivedIndexState,Ki as readLocatedItem,LC as readOutputBudgetCollections,lw as readOutputCollectionFingerprint,NC as readOutputContinuationRowCollections,kC as readOutputContinuationRowPaths,tw as readOutputIncludeModeOptions,xC as readOutputRowCollections,PC as readOutputRowPaths,WC as readOutputSessionRemainingTokens,Ft as readPmPackageManifest,Ef as readRequiredString,kS as readRuntimeFieldOptionValue,Di as readSettings,EE as readSettingsWithMetadata,rd as readStringArrayFromCommanderOptions,Of as readStringOption,uS as readThrownExitCode,Uv as readVectorizationStatusLedger,PE as readWorkflowPolicies,ET as readWorkflowPolicyField,aS as readWorkspaceContextIntentContracts,nP as readWorkspaceContextSignals,cP as readWorkspaceMemory,WP as readWorkspacePosition,uE as reanchorHistoryEntries,PD as reconcileArtifactLedgers,En as reconcileExtensionCapabilityUsage,TE as reconcileWorkspaceJsonHistory,cC as recordAfterCommandAffectedItem,DI as recordAssuranceVerdict,bu as recordClaimSemanticAttribution,Pw as recordContextUsageDelivery,Mw as recordContextUsageServing,kw as recordContextUsageTouch,xw as recordContextUsageTouches,Cu as recordFocusSemanticAttribution,Hm as recordImprovementObservation,Tu as recordReleaseSemanticAttribution,JE as refreshItemMetadataDerivedIndex,xc as refreshMergeAttributeFenceIfInstalled,UC as refreshReadOutputDeliveredCounts,Bv as refreshSearchArtifactsForMutation,bi as registerAgentProvenanceAdapters,GO as registerExternalDependencyResolver,gi as registerHarnessSignalDescriptors,bC as registerOutputMaterialFieldGroups,lh as release,GC as rememberReadOutputFocusRows,LI as removeAssuranceDeclaration,Go as removeFileIfExists,Gl as renameArtifactsResultKey,Ru as renderCalendarMarkdown,Mu as renderCalendarToon,Ku as renderContextMarkdown,qc as renderExtensionDescribeMarkdown,jc as renderExtensionSurfaceMarkdown,Zf as renderGuideMarkdown,l0 as renderMissingOptionRetry,gP as renderNextMarkdown,h0 as renderPmClosedDomainHelp,Pn as renderPmCommand,Do as renderPmCommandAliasMigrationHint,Sc as renderPmCommandVisibilityMarkdown,UL as renderPmFlagLexiconMarkdown,xx as renderPmMcpAppHtml,_L as renderPmRefusalClosureCensusMarkdown,fv as renderRowsAsCsv,_v as renderRowsAsTable,sh as reopen,RE as replayHistoryToTarget,aE as replayToCanonicalItemDocument,sE as replayToItemDocument,wS as requireHistoryOperation,SM as requireTerminalReason,EM as requireTerminalReasonWithRecovery,eE as resealHistoryRewrite,iC as resetActiveExtensionRuntimeState,wl as resetWorkspaceGraphCache,ui as resolveAgentSessionContextFromSignals,dl as resolveAnnotationIndex,il as resolveAnnotationInput,qS as resolveAuthor,Ii as resolveAuthorIdentity,iv as resolveBodyFileContent,my as resolveBuiltinCorpusShape,Iu as resolveCalendarOutputFormat,tI as resolveCanonicalPmErrorCodeContract,jb as resolveCanonicalRelationshipKind,BS as resolveClaimPrincipal,rv as resolveCliBulkIdsInput,fT as resolveCommandOptionPolicyState,TN as resolveCompileCacheGeneration,iP as resolveCompletionTimestamp,nT as resolveConfiguredPmPackageRoot,VO as resolveContentFieldFilters,Gw as resolveContextIntentContract,Lu as resolveContextOutputFormat,Du as resolveContextTokenBudget,vM as resolveCreateExplicitEmptyFlag,OP as resolveEffectiveSearchMode,vv as resolveEmbeddingProviders,jT as resolveExtensionFlagValueContract,Hc as resolveExtensionInstallSourceIdentity,GT as resolveExtensionLongFlagName,Yi as resolveExtensionMigrationStatePath,HT as resolveExtensionRoots,UO as resolveExternalDependencyReference,UT as resolveFlagValueKind,gT as resolveGlobalPmRoot,Yf as resolveGuideOutputFormat,Wm as resolveHistoryEpisodeGroupIdentity,OS as resolveHistoryHashAlgorithm,CS as resolveHistoryOperation,MM as resolveHistoryProvenanceDimensions,nA as resolveHistorySubject,OE as resolveHistoryTarget,RP as resolveHybridSemanticWeight,Wo as resolveImplicitPmRoot,Sw as resolveIsoOrRelative,AO as resolveItemBlockers,TO as resolveItemExecutionRole,S0 as resolveItemMutationDocument,Ko as resolveItemTypeRegistry,RS as resolveItemTypesFilePath,Tf as resolveLinkedTestFailureExitCode,xp as resolveLinkedTestSourceRef,Np as resolveLinkedTestSourceWorkspaceRoot,Fp as resolveLinkedTestTrust,Gp as resolveLinkedTestTrustBatch,gg as resolveMcpAcknowledgedSubscriptionFilter,Je as resolveMcpRequestContext,Ic as resolveMergeInstallContext,p0 as resolveMisnestedCommandPath,zO as resolveMissingMetadataFilters,c0 as resolveMissingOptionPlaceholder,AC as resolveModePairedOutputOmissionReceipt,fP as resolveNextOutputFormat,IC as resolveOutputOmissionReceipt,oT as resolvePmCliVersion,Lo as resolvePmCommandAlias,Ve as resolvePmCommandCapabilityFamily,Nt as resolvePmCommandExitContract,L as resolvePmCommandOperation,jn as resolvePmCommandOutputBudget,xt as resolvePmCommandOutputEnvelope,bA as resolvePmCommandPositionalContract,He as resolvePmCommandVisibilityTier,qn as resolvePmDiagnosticOutputBudget,rI as resolvePmErrorCodeContract,pb as resolvePmFlagSemanticConcept,Ne as resolvePmHistoryOperation,rT as resolvePmPackageRootFromModule,TA as resolvePmPositionalActionContract,La as resolvePmPositionalActionFlagContracts,$e as resolvePmRoot,Wd as resolvePmToolCustomFieldCollision,lv as resolvePriority,Ht as resolveProfile,Pc as resolveProjectMergeTypeFolders,bw as resolveQueryCursorStart,i0 as resolveReadOptionRetryArgs,nw as resolveReadOutputDimensions,dw as resolveReadOutputEncoding,jC as resolveReadOutputRecoveryBudget,QC as resolveReadOutputSurface,OC as resolveReadRowContract,d0 as resolveRecoveryCommandName,$A as resolveRegisteredSearchProvider,FA as resolveRegisteredVectorStoreAdapter,id as resolveReproducibleProcessEnvironment,Qn as resolveRuntimeFieldRegistry,Zn as resolveRuntimeStatusRegistry,Ov as resolveSearchCorpusFields,vP as resolveSearchMaxResults,kP as resolveSearchPage,IP as resolveSearchScoreThreshold,MP as resolveSearchTuning,Rv as resolveSemanticCorpusCharacterLimit,yu as resolveSemanticLineageIds,Sv as resolveSettingsWithSemanticRuntimeDefaults,jI as resolveSourceContextWritePolicy,Au as resolveStartTaskInProgressStatus,ee as resolveSubcommandFlagContractsForCommand,Zb as resolveTelemetryErrorCategory,wM as resolveTerminalReason,v0 as resolveTransactionSchema,mT as resolveTypeDefinition,uT as resolveTypeName,mv as resolveTypeSynonym,Tv as resolveTypeWorkflows,ul as resolveUnknownAuthorAcknowledgmentSelector,$P as resolveVectorIndexRecovery,Pv as resolveVectorStores,ic as resolveWorkspaceRelationshipKindRegistry,hT as resolveWorkspaceRoot,mh as restore,NA as restoreCheckpointItems,CE as restoreWorkspaceJsonFromHistory,zm as restoreWorkspaceSnapshot,qm as restoreWorkspaceSnapshotWithRecovery,Dh as runAction,mC as runActiveBeforeMutationHooks,_C as runActiveCommandHandler,fC as runActiveOnIndexHooks,On as runActiveOnReadHooks,vn as runActiveOnWriteHooks,hC as runActiveParserOverride,gC as runActivePreflightOverride,yC as runActiveServiceOverride,ku as runActivity,VT as runAfterCommandHooks,wm as runAggregate,al as runAnnotationCommand,Kp as runAppend,dM as runAssuranceAction,cM as runAssuranceDispatch,zT as runBeforeCommandHooks,Pu as runCalendar,Zu as runClaim,Qu as runClaimNext,Xp as runClose,Jp as runCloseMany,om as runCloseTask,hl as runComments,Qf as runCompletion,gl as runConfig,Bt as runContext,WM as runContextEvaluationCorpus,HM as runContextEvaluationScenario,Zp as runCopy,hu as runCreate,gu as runDelete,Sl as runDeps,Ul as runDocs,pR as runDuplicates,xm as runEval,Lm as runEvent,Kc as runExtension,es as runExtensionMigrateAction,Qi as runExtensionMigrations,Wl as runFiles,Yl as runFilesDiscover,Xl as runFilesLookup,nf as runFleetAttributionAnalytics,Eu as runFocus,zp as runGc,Sm as runGet,Rp as runGraph,Jf as runGuide,Mp as runHealth,AP as runHistory,TM as runHistoryAttest,pM as runHistoryCompact,fM as runHistoryCompactBulk,VR as runHistoryMaintenance,_M as runHistoryRedact,KR as runHistoryRepair,XR as runHistoryRepairAll,Qc as runInit,Yc as runInitAgentGuidance,Hp as runLearnings,Fl as runLinkedArtifacts,Cf as runLinkedTests,hc as runList,Nm as runMeet,jP as runMergeDriver,Nc as runMergeInstall,$R as runMergeReceiptEvidenceReport,DR as runMergeReceiptReport,BP as runMergeReconcile,Yu as runNext,dm as runNotes,rm as runPauseTask,sm as runPlan,gm as runProfileApply,hm as runProfileLint,fm as runProfileList,_m as runProfileShow,rf as runProvenanceCoverageAnalytics,J0 as runRegisteredCommandForTest,rk as runRegisteredCommandOverrideForTest,ck as runRegisteredExporterForTest,Q0 as runRegisteredHookForTest,dk as runRegisteredImporterForTest,ak as runRegisteredMigrationForTest,Z0 as runRegisteredMutationGuardForTest,ek as runRegisteredParserOverrideForTest,tk as runRegisteredPreflightOverrideForTest,ok as runRegisteredRendererOverrideForTest,ik as runRegisteredSearchProviderForTest,nk as runRegisteredServiceOverrideForTest,sk as runRegisteredVectorStoreAdapterForTest,er as runReindex,em as runRelease,Dm as runRemind,IM as runReopen,Yp as runRestore,Fc as runSchemaEvolutionMigration,Em as runSearch,hy as runSearchRefreshWorkerEntrypoint,e_ as runStartBackgroundRun,tm as runStartTask,pf as runStats,mf as runTelemetry,um as runTemplatesList,pm as runTemplatesSave,mm as runTemplatesShow,wf as runTest,Sf as runTestAll,t_ as runTestRunsList,o_ as runTestRunsLogs,i_ as runTestRunsResume,r_ as runTestRunsStatus,n_ as runTestRunsStop,s_ as runTestRunsWorker,vu as runUpdate,am as runUpdateMany,Ut as runUpgrade,qp as runValidate,Lh as runWithActiveExtensions,D as runWithAgentSessionContext,wE as runWithConfigurationOnlySettings,$w as runWithContextIntentContracts,lS as runWithDiscoveredContextIntentContracts,Ci as runWithHarnessDetectionSignals,Ex as runWithMcpTraceContext,ad as runWithReproducibleProcessEnvironment,wi as runWithWorkspaceHarnessSignalDescriptors,qr as runWithWorkspaceRecipe,JI as runWorkflowPolicyAction,lM as runWorkspaceTransactionGc,vp as saveGraphAuditBaseline,QR as scanClosureTimestamps,yR as scanExtensionHostVersions,ll as scanHistoryAuthorAttribution,ii as scanItemFormatVersions,pd as scanMutationSecrets,CR as scanProvenanceResolverHealth,wd as scanStaleInProgressItems,rM as scanStorageIntegrity,I_ as schema,L_ as schemaAddField,x_ as schemaAddStatus,P_ as schemaAddType,G_ as schemaApplyPreset,U_ as schemaInferTypes,R_ as schemaList,$_ as schemaListFields,q_ as schemaRemapStatus,D_ as schemaRemoveField,N_ as schemaRemoveStatus,k_ as schemaRemoveType,B_ as schemaRenameField,j_ as schemaRenameType,M_ as schemaShow,F_ as schemaShowField,z_ as schemaShowStatus,u0 as scoreCommandPathMatch,BM as scoreContextCandidates,qM as scoreContextCandidatesWithActiveExtensions,bd as scoreItemSimilarity,RL as scorePmGrammarRefusalClosure,yL as scorePmRefusalClosure,Td as scorePreparedItemSimilarity,kL as scoreTrackerPreflightRecoveryClosure,ZS as sealHistoryRecord,Vk as sealMcpRequestState,l_ as search,uP as searchWorkspaceMemory,mP as searchWorkspaceMemoryReadResult,OO as selectActionableEntries,mw as selectCursorSemanticOptions,Hf as selectImportAuthor,bx as selectMcpClientRegistrationMode,pP as selectWorkspaceMemory,lP as selectWorkspaceMemoryRollups,Su as semanticAttributionAffinity,Yv as sentryCaptureCliError,Wv as sentryDiscardCommandSpan,Xv as sentryFinishCommandSpan,Zv as sentryFlush,Jv as sentryLogCliUsageError,Hv as sentrySetCommandContext,Kv as sentryStartCommandSpan,ci as serializeItemDocument,g0 as serializeNdjsonRows,y0 as serializeNdjsonStream,iy as serveDeclaredObservation,sC as setActiveCommandContext,aC as setActiveCommandResult,QT as setActiveExtensionCommands,ZT as setActiveExtensionHooks,eC as setActiveExtensionParsers,tC as setActiveExtensionPreflight,nC as setActiveExtensionRegistrations,oC as setActiveExtensionRenderers,rC as setActiveExtensionServices,US as setFocusedItem,iO as shouldCompletePlanOnClose,Ep as shouldPersistDurableGraphCache,YA as shouldResolveMutationStdinTokenField,XA as shouldResolveMutationStdinTokens,Av as shouldRunSearchRefreshInForeground,jl as similarityAdvisoryWarnings,MC as sliceReadOutputRowCollection,Ll as sortLinkedArtifacts,GA as splitAcceptanceCriteria,rO as splitCommaList,di as splitFrontMatter,iw as stabilizeReadOutputReceiptEstimates,R as stableStringify,w0 as stableUpsertValue,yT as stableValueEquals,_h as startTask,aO as startTelemetryCommand,f_ as stats,PS as statusIsTerminal,Fa as stripGlobalBootstrapTokens,VP as subscribeMutationEventBatches,HP as subscribeMutationEvents,sR as summarizeAgentIdentityVocabulary,Ym as summarizeAgentModelProvenance,Jm as summarizeAgentProvenance,KM as summarizeContextEvaluationReports,hf as summarizeContextPreflight,LM as summarizeHistoryProvenance,Jc as summarizeInitResult,kR as summarizeMergeReceipt,OM as supportsCreateExplicitEmpty,IA as supportsItemIdAlias,eT as suppressHostOutput,Oe as syncRelationshipGraphAdapter,q0 as synthesizeExtensionManifest,Da as toCompletionFlagString,Vu as toContextFocusItem,Bu as toContextPackingSummary,qu as toContextRankingSummary,sT as toErrorMessage,Pf as toEstimatedMinutesValue,r0 as toExtensionFlagDefinitions,Df as toImportBoolean,Uf as toImportConfidence,Lf as toImportInteger,zf as toImportLinkedDocs,qf as toImportLinkedFiles,Vf as toImportLinkedTests,Bf as toImportLogEntries,jf as toImportNormalizedEnum,Gf as toImportNumberMap,kf as toImportPriority,Nf as toImportStatus,$f as toImportStringList,Ff as toImportStringMap,xf as toImportTags,FS as toItemRecord,Mf as toNonEmptyImportString,iT as toNonEmptyStringOrUndefined,dE as toReplayDocument,gd as tokenizeSimilarityText,WA as transferMutationStdinTokenPolicy,DT as translateHostEnvironmentFault,ih as update,ff as updateLinkedTest,xh as upgrade,Y_ as validate,EI as validateAssertionDefinition,vI as validateAssuranceDocument,AI as validateGateDefinition,A0 as validateItemMutationRows,$l as validateLinkedPaths,Tx as validateMcpAuthorizationResponseIssuer,yx as validateMcpAuthorizationServerMetadata,Cx as validateMcpClientMetadataDocument,lx as validateMcpHttpRequestHeaders,Xk as validateMcpJsonSchema,SI as validateMeasurementDefinition,dv as validateMissingParentReference,ew as validateReadOutputOptions,pv as validateSprintOrReleaseValue,_T as validateTypeOptions,fA as validateWorkspaceTransactionIdentity,bM as verifyAttestation,ZO as verifyCliFlagInvocationParity,SA as verifyExplicitPositionalSlotCensus,pE as verifyHistoryChain,lE as verifyHistoryChainWithVersion,iA as verifyHistoryEntries,QS as verifyHistoryRecordHash,tE as verifyHistoryRewriteEvidence,OA as verifyPmCliGrammar,vA as verifyPmCommandPositionalContracts,GL as verifyPmFlagLexicon,cL as verifyPmRecoveryKindRuntimeCoverage,tb as verifyPmRecoveryProducerRuntimeCoverage,dL as verifyPmRecoveryReferences,mL as verifyPmRefusalClosureIdentityRatchet,uL as verifyPmRefusalClosureRatchet,aL as verifyPmRefusalReachability,Rd as verifyToolOptionCliParity,ts as withFlagAliasMetadata,$T as withHostEnvironmentBoundary,Wk as withMcpCachePolicy,vT as workflowApprovalFingerprint,OT as workflowPolicyApplies,AT as workflowPolicyFingerprint,Cl as workspaceGraphCache,sl as wrapOwnershipConflict,_S as wrapThrownErrorForSentry,vi as writeAuthorEnvironment,De as writeFileAtomic,kA as writeMutationCheckpoint,AE as writeSettings,rS as writeStderr,tS as writeStdout,jv as writeVectorizationStatusLedger,bE as writeWorkspaceJsonWithHistory};
28
+ </html>`}import{createHash as st}from"node:crypto";import{lstat as Xg,readdir as jr,readFile as Jg}from"node:fs/promises";import M from"node:path";import{parseDocument as Zg}from"yaml";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="eafd8bc3-0da1-5220-8fb1-6967eecdb6bf")}catch{}})();var Nr="io.modelcontextprotocol/skills",at="SEP-2640@a3e147ca2710f68214247aecc729731ee1ae8d03",Qg=Object.freeze({revision:at,status:"draft",directoryRead:!0});function Kx(e,t=!1){let r=e.clientCapabilities.extensions,o=h(r)?r[Nr]:void 0;if(!h(o)||o.revision!==at||t&&o.directoryRead!==!0)throw new u("Missing or incompatible Skills over MCP draft capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[Nr]:Qg}}})}var I=Object.freeze({maxFilesPerSkill:512,maxFileBytes:16*1024*1024,maxSkillBytes:16*1024*1024,defaultPageSize:20,maxPageSize:100}),Lr=100,ey=32*1024*1024,ty=/^[a-z0-9]+(?:-[a-z0-9]+)*$/u,Dr=new Set(Array.from({length:I.maxPageSize},(e,t)=>t+1));function C(e,t){throw new u(e,-32602,t)}function $r(e,t){try{return new TextDecoder("utf-8",{fatal:!0}).decode(t),e.endsWith(".md")?"text/markdown":"text/plain"}catch{return"application/octet-stream"}}function ry(e,t){let r=/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/u.exec(e);r||C(`Skill ${t} is missing YAML frontmatter.`);let o=Zg(r[1],{prettyErrors:!1,strict:!0,uniqueKeys:!0});o.errors.length>0&&C(`Skill ${t} has invalid YAML frontmatter.`,{errors:o.errors.map(s=>s.message)});let n;try{n=o.toJS({maxAliasCount:0})}catch(s){C(`Skill ${t} has unsupported YAML aliases.`,{error:String(s)})}return(typeof n!="object"||n===null||Array.isArray(n))&&C(`Skill ${t} frontmatter must be an object.`),n}async function oy(e,t,r,o){return r>I.maxFileBytes&&C(`Skill resource exceeds the per-file limit: ${t}.`),o.files+=1,o.files>I.maxFilesPerSkill&&C(`Skill exceeds ${I.maxFilesPerSkill} files.`),o.skillBytes+=r,o.skillBytes>I.maxSkillBytes&&C(`Skill exceeds the aggregate byte limit: ${t}.`),o.originBytes.value+=r,o.originBytes.value>ey&&C(`Skill origin exceeds the aggregate byte limit: ${t}.`),Jg(e)}async function Br(e,t,r){let o=M.join(e,t),n=await jr(o,{withFileTypes:!0}),s=[];for(let i of n.sort((a,d)=>a.name.localeCompare(d.name))){let a=M.posix.join(t.split(M.sep).join("/"),i.name),d=M.join(e,...a.split("/")),c=await Xg(d);c.isSymbolicLink()&&C(`Skill resource must not be a symbolic link: ${a}.`),c.isDirectory()?s.push(...await Br(e,a,r)):c.isFile()?s.push({relative:a,bytes:await oy(d,a,c.size,r)}):C(`Skill resource must be a regular file or directory: ${a}.`)}return s}async function Fr(e,t,r){let o=new Map,n;try{n=await jr(e,{withFileTypes:!0})}catch(a){if(bt(a))return o;throw a}let s=n.filter(a=>a.isDirectory()&&ty.test(a.name)).sort((a,d)=>a.name.localeCompare(d.name));s.length>Lr&&C(`Skill origin exceeds ${Lr} directories.`);let i={value:0};for(let a of s){let d=await Br(M.join(e,a.name),"",{files:0,skillBytes:0,originBytes:i}),c=d.reduce((g,T)=>g+T.bytes.byteLength,0),l=d.find(g=>g.relative==="SKILL.md");if(!l)continue;let p=ry(l.bytes.toString("utf8"),a.name);p.name!==a.name&&C(`Skill directory ${a.name} must match frontmatter name.`,{actual:p.name??null,expected:a.name}),(typeof p.description!="string"||p.description.trim().length===0)&&C(`Skill ${a.name} requires a non-empty frontmatter description.`,{required:["description"]});let f=d.map(g=>({uri:`skill://${a.name}/${g.relative}`,digest:`sha256:${st("sha256").update(g.bytes).digest("hex")}`,size:g.bytes.byteLength})),_=st("sha256").update(f.map(g=>`${g.uri}:${g.digest}`).join(`
29
+ `)).digest("hex");o.set(a.name,{uri:`skill://${a.name}/SKILL.md`,frontmatter:p,resources:f,_meta:{contractVersion:1,extensionRevision:at,origin:t,packageVersion:r,protocolVersion:H,trust:"untrusted",estimatedTokens:Math.ceil(c/4)},files:new Map(d.map(g=>[g.relative,g.bytes])),fingerprint:_})}return o}function Gr(e){let{files:t,fingerprint:r,...o}=e;return o}var Ur=class e{#e;#t;constructor(t){this.#e=t,this.#t=st("sha256").update([...t.entries()].sort(([r],[o])=>r.localeCompare(o)).map(([r,o])=>`${r}:${o.fingerprint}`).join(`
30
+ `)).digest("hex").slice(0,16)}#r(t,r){if(!t)return 0;try{let o=JSON.parse(Buffer.from(t,"base64url").toString("utf8"));return(typeof o!="object"||o===null||!("fingerprint"in o)||o.fingerprint!==this.#t||!("scope"in o)||o.scope!==r||!("offset"in o)||!Number.isInteger(o.offset)||Number(o.offset)<0)&&C("Skill cursor is invalid or stale."),Number(o.offset)}catch(o){if(o instanceof u)throw o;return C("Skill cursor is invalid or stale.")}}#o(t,r){return Buffer.from(JSON.stringify({fingerprint:this.#t,offset:t,scope:r})).toString("base64url")}static async load(t){let r=await Fr(M.join(t.packageRoot,".agents","skills"),"package",t.packageVersion);if(t.workspaceRoot){let o=M.resolve(t.packageRoot,".agents","skills"),n=M.resolve(t.workspaceRoot,".agents","skills");if(n!==o){let s=await Fr(n,"workspace",t.packageVersion);for(let[i,a]of s)r.set(i,a)}}return new e(r)}list(t={}){let r=t.limit??I.defaultPageSize;Dr.has(r)||C(`Skill list limit must be an integer from 1 to ${I.maxPageSize}.`);let o=this.#r(t.cursor,"skills/list"),n=[...this.#e.values()].sort((d,c)=>d.uri.localeCompare(c.uri)),s=n.slice(o,o+r),i=o+s.length,a=i<n.length;return{skills:s.map(Gr),hasMore:a,...a?{nextCursor:this.#o(i,"skills/list")}:{}}}get(t){let r=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)\/SKILL\.md$/u.exec(t),o=r?this.#e.get(r[1]):void 0;return o||C(`Unknown pm MCP skill: ${t}.`,{field:"uri"}),Gr(o)}read(t){let r=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)\/(.+)$/u.exec(t),o=r?this.#e.get(r[1]):void 0,n=r?.[2]??"",s=o&&n?o.files.get(n):void 0,i=o?.resources.find(c=>c.uri===t);(!o||!s||!i)&&C(`Unknown pm MCP skill resource: ${t}.`,{field:"uri"});let a={digest:i.digest,origin:o._meta.origin,trust:"untrusted"},d=$r(n,s);return d!=="application/octet-stream"?{contents:[{uri:t,mimeType:d,text:s.toString("utf8"),_meta:a}]}:{contents:[{uri:t,mimeType:d,blob:s.toString("base64"),_meta:a}]}}readDirectory(t,r={}){let o=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)(?:\/(.+))?$/u.exec(t),n=o?this.#e.get(o[1]):void 0;n||C(`Unknown pm MCP skill directory: ${t}.`,{field:"uri"});let s=(o?.[2]??"").replace(/\/$/u,""),i=s.length>0?`${s}/`:"",a=`skill://${o[1]}`,d=new Map;for(let T of n.resources){let S=T.uri.slice(`${a}/`.length);if(!S.startsWith(i))continue;let q=S.slice(i.length),[P,...vo]=q.split("/"),Oo=`${a}/${i}${P}`,Po=n.files.get(`${i}${P}`);d.set(P,{uri:Oo,name:P,mimeType:vo.length>0?"inode/directory":$r(P,Po)})}s.length>0&&d.size===0&&C(`Unknown pm MCP skill directory: ${t}.`,{field:"uri"});let c=r.limit??I.maxPageSize;Dr.has(c)||C(`Skill directory limit must be an integer from 1 to ${I.maxPageSize}.`);let l=this.#r(r.cursor,t),p=[...d.values()].sort((T,S)=>T.uri.localeCompare(S.uri)),f=p.slice(l,l+c),_=l+f.length,g=_<p.length;return{resources:f,hasMore:g,...g?{nextCursor:this.#o(_,t)}:{}}}};(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="38023567-8a5b-5e25-8d71-5112f74d1894")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="2b24276b-948b-50bd-bfd9-f429cd74be70")}catch{}})();var qr="https://schema.unbrained.dev/pm/workspace-recipe/v1";function dt(e,t){if(e===null||typeof e=="boolean"||typeof e=="string")return e;if(typeof e=="number"){if(!Number.isFinite(e))throw new Error(`Workspace recipe JSON number must be finite at ${t}`);return e}if(Array.isArray(e))return Object.freeze(e.map((r,o)=>dt(r,`${t}[${o}]`)));if(typeof e!="object"||Object.getPrototypeOf(e)!==Object.prototype&&Object.getPrototypeOf(e)!==null)throw new Error(`Workspace recipe input must contain JSON values at ${t}`);return Object.freeze(Object.fromEntries(Object.entries(e).map(([r,o])=>[r,dt(o,`${t}.${r}`)])))}function ve(e){if(e.schema!==qr)throw new Error(`Unsupported workspace recipe schema: ${e.schema}`);let t=wt(e);if(e.operations.some(r=>r.action.trim().length===0||r.input===null||Array.isArray(r.input)))throw new Error("Workspace recipe operations require an action and object input");return Object.freeze({...t,operations:Object.freeze(e.operations.map((r,o)=>Object.freeze({action:r.action,input:dt(r.input,`operations[${o}].input`)})))})}async function zr(e,t){let r=ve(e);return Et(r,t)}async function ny(e,t){return zr(e,async()=>{let r=[];for(let[o,n]of e.operations.entries())r.push(await t(n,o));return r})}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="c234be1c-35b7-5388-8a70-a012e9a34389")}catch{}})();var Hr="pm.agent-observation/v1",Vr="pm.agent-verdict/v1",Kr="pm.agent-episode/v1";function O(e,t){if(!Number.isSafeInteger(e)||e<=0)throw new Error(`${t} must be a positive safe integer.`)}function k(e,t){if(e.trim().length===0)throw new Error(`${t} must not be empty.`)}function ne(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let t of Object.values(e))ne(t)}return e}function iy(e){if(e.length===0)throw new Error("observation.reads must declare at least one bounded read.");let t=0;for(let r of e)if(k(r.command,"observation.reads.command"),O(r.budget_tokens,"observation.reads.budget_tokens"),t+=r.budget_tokens,!Number.isSafeInteger(t))throw new Error("observation read ceilings exceed safe integer range.")}function sy(e){if(e.basis!=="emitted_bytes")throw new Error("observation calibration must use emitted_bytes.");for(let r of e.samples)if(!Number.isSafeInteger(r)||r<0)throw new Error("observation calibration samples must be non-negative safe integers.");if(e.samples.length===0)throw new Error("observation calibration must include at least one sample.");if(O(e.expected_emitted_bytes,"observation.calibration.expected_emitted_bytes"),!Number.isSafeInteger(e.tolerance_bytes)||e.tolerance_bytes<0)throw new Error("observation.calibration.tolerance_bytes must be a non-negative safe integer.");let t=e.samples.reduce((r,o)=>r+o,0)/e.samples.length;if(Math.abs(t-e.expected_emitted_bytes)>e.tolerance_bytes)throw new Error("observation expected_emitted_bytes is outside the calibrated sample tolerance.")}function ay(e){if(e.length===0)throw new Error("observation.tiers must declare a degradation ladder.");let t=new Set,r=Number.POSITIVE_INFINITY;for(let o of e){if(k(o.id,"observation.tiers.id"),O(o.max_tokens,"observation.tiers.max_tokens"),t.has(o.id))throw new Error(`Duplicate observation tier: ${o.id}.`);if(t.add(o.id),o.max_tokens>r)throw new Error("observation tiers must be ordered from largest to smallest max_tokens.");r=o.max_tokens;let n=new Set;for(let s of o.fields){if(F(s,"observation.tiers.fields"),n.has(s))throw new Error(`Duplicate observation tier field: ${s}.`);n.add(s)}}}function dy(e){if(e.schema!==Hr)throw new Error(`observation.schema must be ${Hr}.`);return k(e.id,"observation.id"),O(e.version,"observation.version"),iy(e.reads),sy(e.calibration),e.corpus_dependence.kind==="bounded"&&(k(e.corpus_dependence.dimension,"observation.corpus_dependence.dimension"),O(e.corpus_dependence.maximum,"observation.corpus_dependence.maximum")),ay(e.tiers),ne(structuredClone(e))}function rN(e){return{contract_id:e.id,contract_version:e.version,guaranteed_ceiling_tokens:e.reads.reduce((t,r)=>t+r.budget_tokens,0),expected_emitted_bytes:e.calibration.expected_emitted_bytes,expected_tokens:Math.ceil(e.calibration.expected_emitted_bytes/4),tolerance_bytes:e.calibration.tolerance_bytes,calibration_basis:"emitted_bytes",corpus_dependence:e.corpus_dependence}}async function cy(e,t,r){O(r.budget_tokens,"observation request budget_tokens");let o=[];for(let[n,s]of e.tiers.entries()){o.push(s.id);let i=await t(s),a=Buffer.byteLength(R(i),"utf8"),d=Math.ceil(a/4);if(d<=Math.min(r.budget_tokens,s.max_tokens))return{status:"served",payload:i,receipt:{contract_id:e.id,contract_version:e.version,served_tier:s.id,degraded:n>0,attempted_tiers:o,emitted_bytes:a,estimated_tokens:d,calibration_basis:"emitted_bytes"}}}return{status:"refused",reason:"no_declared_tier_fits_budget",receipt:{contract_id:e.id,contract_version:e.version,served_tier:null,degraded:e.tiers.length>1,attempted_tiers:o,emitted_bytes:null,estimated_tokens:null,calibration_basis:"emitted_bytes"}}}function F(e,t){let r=e.split(".");if(r.some(o=>o.length===0||o==="__proto__"||o==="prototype"||o==="constructor"))throw new Error(`${t} must be a safe, non-empty dot-separated path.`);return r}function Wr(e,t){let r=e;for(let o of F(t,"recorded field path")){if(r===null||typeof r!="object"||!Object.hasOwn(r,o))return;r=r[o]}return r}function ly(e){return`/${F(e,"verdict predicate path").map(t=>t.replaceAll("~","~0").replaceAll("/","~1")).join("/")}`}function py(e){if(e.kind!=="field_equals")return;let t;try{t=JSON.stringify(e.expected)}catch{throw new Error(`Expected value for verdict predicate ${e.id} must be JSON serializable.`)}if(t===void 0)throw new Error(`Expected value for verdict predicate ${e.id} must be JSON serializable.`)}function uy(e){if(e.schema!==Vr)throw new Error(`verdict.schema must be ${Vr}.`);k(e.id,"verdict.id"),O(e.version,"verdict.version");let t=new Set;for(let o of e.predicates){k(o.id,"verdict.predicates.id"),F(o.path,"verdict.predicates.path");let n=o.kind;if(n!=="field_equals"&&n!=="field_present"&&n!=="field_absent")throw new Error(`Unsupported verdict predicate kind for ${o.id}.`);if(t.has(o.id))throw new Error(`Duplicate verdict predicate: ${o.id}.`);py(o),t.add(o.id)}if(e.composition.operator!=="all"&&e.composition.operator!=="any")throw new Error("verdict composition operator must be all or any.");if(e.composition.predicate_ids.length!==e.predicates.length)throw new Error("verdict composition must reference every predicate exactly once.");let r=new Set(e.composition.predicate_ids);if(r.size!==e.composition.predicate_ids.length||[...r].some(o=>!t.has(o)))throw new Error("verdict composition contains duplicate or unknown predicate ids.");return ne(structuredClone(e))}function my(e,t){if(e.predicates.length===0)return{contract_id:e.id,contract_version:e.version,snapshot_id:t.snapshot_id,outcome:"not_applicable",score:null,policy:"verdict_only_no_reward",reason:"no_predicates_declared",predicates:[]};let r=new Map(e.predicates.map(i=>[i.id,i])),o=e.composition.predicate_ids.map(i=>{let a=r.get(i),d=Wr(t.state,a.path),c=a.kind==="field_present"?d!==void 0:a.kind==="field_absent"?d===void 0:R(d)===R(a.expected);return{id:i,outcome:c?"satisfied":"violated",evidence_pointer:`${t.snapshot_id}#${ly(a.path)}`,evidence_digest:Tt(R(d))}}),n=o.filter(i=>i.outcome==="satisfied").length,s=e.composition.operator==="all"?n===o.length:n>0;return{contract_id:e.id,contract_version:e.version,snapshot_id:t.snapshot_id,outcome:s?"satisfied":"violated",score:n/o.length,policy:"verdict_only_no_reward",predicates:o}}function oN(e){if(e.schema!==Kr)throw new Error(`episode.schema must be ${Kr}.`);if(k(e.id,"episode.id"),O(e.version,"episode.version"),!["benchmark","evaluation","training","scale_transfer"].includes(e.mode))throw new Error("episode.mode is not supported.");if(e.task_item_ids.length===0)throw new Error("episode.task_item_ids must declare at least one pm item.");for(let t of e.task_item_ids)k(t,"episode.task_item_ids");O(e.limits.max_actions,"episode.limits.max_actions"),O(e.limits.max_observations,"episode.limits.max_observations"),O(e.limits.max_tokens_per_observation,"episode.limits.max_tokens_per_observation");for(let t of e.observable_fields)F(t,"episode.observable_fields");for(let t of e.withheld_fields)F(t,"episode.withheld_fields");for(let t of e.observable_fields){let r=e.withheld_fields.find(o=>t===o||t.startsWith(`${o}.`)||o.startsWith(`${t}.`));if(r!==void 0)throw new Error(`Observable field ${t} overlaps withheld field ${r}.`)}for(let t of e.observation.tiers)for(let r of t.fields)if(!e.observable_fields.includes(r))throw new Error(`Observation tier field ${r} is not declared observable.`);return dy(e.observation),uy(e.verdict),ve(e.recipe),ne(structuredClone(e))}function fy(e,t,r){let o=F(t,"observation projection field"),n=e;for(let[s,i]of o.entries()){if(s===o.length-1){r!==void 0&&(n[i]=structuredClone(r));return}let a=n[i];(a===null||typeof a!="object"||Array.isArray(a))&&(n[i]={}),n=n[i]}}function _y(e,t){let r={};for(let o of t)fy(r,o,Wr(e,o));return r}async function nN(e,t){let r=[],o=0,n=0,s=!1,i,a={episode:{id:e.id,label:`pm agent environment v${e.version}`},provenance:{role:e.mode,topic:"agent-environment"}},d=await D(a,()=>t.reset(e.recipe));r.push({sequence:1,kind:"reset",state_id:d.state_id});let c=async()=>{if(s)throw new Error("episode is already closed.");if(n>=e.limits.max_observations)throw new Error("episode exceeded limits.max_observations.");n+=1;let p=await t.readRecordedState(),f=await cy(e.observation,async _=>_y(p.state,_.fields),{budget_tokens:e.limits.max_tokens_per_observation});return r.push({sequence:r.length+1,kind:"observation",state_id:f.receipt.served_tier??p.snapshot_id}),f},l=async(p=!1)=>{if(s&&!p)throw new Error("episode is already closed.");if(n>=e.limits.max_observations)throw new Error("episode exceeded limits.max_observations.");n+=1;let f=await t.readRecordedState(),_=my(e.verdict,f);return r.push({sequence:r.length+1,kind:"verdict",state_id:f.snapshot_id}),_};return{observe:()=>D(a,c),step:async p=>{if(s)throw new Error("episode is already closed.");if(o>=e.limits.max_actions)throw new Error("episode exceeded limits.max_actions.");o+=1;let f=await D(a,()=>t.execute(p));return r.push({sequence:r.length+1,kind:"action",state_id:f.state_id}),f},score:()=>D(a,l),close:()=>i!==void 0?i:s?Promise.reject(new Error("episode is already closed.")):(s=!0,i=D(a,()=>l(!0)).then(p=>(r.push({sequence:r.length+1,kind:"close",state_id:p.snapshot_id}),{verdict:p,trajectory:ne(structuredClone(r))})).catch(p=>{throw s=!1,p}).finally(()=>{i=void 0}),i)}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="14472bc2-ebca-5b9c-9462-bd8694b630a0")}catch{}})();var G="https://schema.unbrained.dev/pm/corpus-shape/v1";function K(e,t){if(!Number.isSafeInteger(e)||e<=0)throw new TypeError(`Corpus shape ${t} must be a positive safe integer`);return e}function ie(e,t){if(!Number.isSafeInteger(e)||e<0)throw new TypeError(`Corpus shape ${t} must be a non-negative safe integer`);return e}function Xr(e){if(!(typeof e!="object"||e===null||Object.isFrozen(e))){for(let t of Object.values(e))Xr(t);Object.freeze(e)}}function W(e){if(e.schema!==G)throw new TypeError(`Unsupported corpus shape schema: ${e.schema}`);if(e.name.trim().length===0||e.description.trim().length===0)throw new TypeError("Corpus shape name and description must be non-empty");if(K(e.hierarchy_depth,"hierarchy_depth"),K(e.hierarchy_fanout,"hierarchy_fanout"),ie(e.age_span_days,"age_span_days"),K(e.history_entries_per_item,"history_entries_per_item"),ie(e.comments_per_100_items,"comments_per_100_items"),ie(e.notes_per_100_items,"notes_per_100_items"),ie(e.learnings_per_100_items,"learnings_per_100_items"),K(e.author_cardinality,"author_cardinality"),K(e.component_count,"component_count"),e.edge_kind_mix.length===0||e.edge_kind_mix.some(r=>r.kind.trim().length===0||r.weight<=0))throw new TypeError("Corpus shape edge_kind_mix requires non-empty kinds with positive weights");if(e.terminal_statuses.some(r=>!e.custom_statuses.includes(r)))throw new TypeError("Corpus shape terminal_statuses must be declared in custom_statuses");let t=structuredClone(e);return Xr(t),t}var Oe=[{kind:"implements",weight:5},{kind:"blocked_by",weight:2},{kind:"discovered_from",weight:2},{kind:"verifies",weight:2},{kind:"supersedes",weight:1},{kind:"related",weight:4}],Y=Object.freeze({scratch:W({schema:G,name:"scratch",description:"Seconds-old, shallow project with minimal history.",hierarchy_depth:2,hierarchy_fanout:50,age_span_days:0,history_entries_per_item:1,comments_per_100_items:2,notes_per_100_items:1,learnings_per_100_items:1,edge_kind_mix:[{kind:"related",weight:1}],author_cardinality:2,component_count:1,include_cycles:!1,custom_types:[],custom_statuses:[],terminal_statuses:[],custom_fields:[]}),representative:W({schema:G,name:"representative",description:"Medium-lived project with rich evidence and typed lineage.",hierarchy_depth:5,hierarchy_fanout:8,age_span_days:730,history_entries_per_item:12,comments_per_100_items:30,notes_per_100_items:12,learnings_per_100_items:10,edge_kind_mix:Oe,author_cardinality:32,component_count:1,include_cycles:!1,custom_types:["Experiment"],custom_statuses:["review"],terminal_statuses:[],custom_fields:["domain"]}),"deep-graph":W({schema:G,name:"deep-graph",description:"Deep typed relationship graph with deterministic cycles.",hierarchy_depth:16,hierarchy_fanout:2,age_span_days:3650,history_entries_per_item:6,comments_per_100_items:15,notes_per_100_items:8,learnings_per_100_items:8,edge_kind_mix:Oe,author_cardinality:16,component_count:1,include_cycles:!0,custom_types:[],custom_statuses:[],terminal_statuses:[],custom_fields:[]}),"multi-decade":W({schema:G,name:"multi-decade",description:"Thirty-year event history with dense per-item evolution.",hierarchy_depth:6,hierarchy_fanout:6,age_span_days:10958,history_entries_per_item:24,comments_per_100_items:40,notes_per_100_items:20,learnings_per_100_items:16,edge_kind_mix:Oe,author_cardinality:64,component_count:1,include_cycles:!1,custom_types:["Program"],custom_statuses:["archived"],terminal_statuses:["archived"],custom_fields:["portfolio"]}),"disconnected-archive":W({schema:G,name:"disconnected-archive",description:"Multiple disconnected historical project components.",hierarchy_depth:4,hierarchy_fanout:10,age_span_days:7305,history_entries_per_item:8,comments_per_100_items:10,notes_per_100_items:5,learnings_per_100_items:6,edge_kind_mix:Oe,author_cardinality:24,component_count:5,include_cycles:!1,custom_types:["Archive"],custom_statuses:["archived"],terminal_statuses:["archived"],custom_fields:["archive_source"]})});function hy(){return Object.keys(Y).sort().map(e=>Y[e])}function gy(e){let t=e.trim().toLowerCase();if(!Object.hasOwn(Y,t))throw new TypeError(`Unknown corpus shape "${e}". Available: ${Object.keys(Y).join(", ")}`);return Y[t]}var Yr=new WeakMap;function Jr(e,t){if(e===0)return[];let r=Yr.get(t);r===void 0&&(r=t.edge_kind_mix.flatMap(n=>Array.from({length:n.weight},()=>n.kind)),Yr.set(t,r));let o=[r[e%r.length]];return t.include_cycles&&e>2&&e%17===0&&o.push("related"),[...new Set(o)]}function yy(e,t,r,o=42){if(ie(t,"item index"),K(r,"item count"),t>=r)throw new RangeError(`Corpus item index ${t} exceeds ${r}`);let n=Math.min(e.component_count,r),s=t%n,i=Math.floor(t/n),a=0,d=1;for(let S=0;S<e.hierarchy_depth;S+=1)a=Math.min(Number.MAX_SAFE_INTEGER,a+d),d=Math.min(Number.MAX_SAFE_INTEGER,d*e.hierarchy_fanout);let c=i%a,l=i-c,p=c===0?void 0:s+(l+Math.floor((c-1)/e.hierarchy_fanout))*n,f=Date.UTC(2026,0,1),_=e.age_span_days*864e5,g=new Date(f+(r===1?0:Math.round(t/(r-1)*_))).toISOString(),T=(t*37+o)%100;return{index:t,id:`pm-s${t.toString(36).padStart(7,"0")}`,...p===void 0?{}:{parent:`pm-s${p.toString(36).padStart(7,"0")}`},component:s,timestamp:g,author:`pm-corpus-agent-${(t+o)%Math.min(e.author_cardinality,r)}`,history_entry_count:e.history_entries_per_item,dependency_kinds:Jr(t,e),has_comment:T<e.comments_per_100_items,has_note:T<e.notes_per_100_items,has_learning:T<e.learnings_per_100_items,...e.custom_types.length>0&&t%11===0?{custom_type:e.custom_types[t%e.custom_types.length]}:{},...e.custom_statuses.length>0&&t%13===0?{custom_status:e.custom_statuses[t%e.custom_statuses.length]}:{}}}var ct=class{shape;authors=new Set;components=new Set;depths=new Map;childCounts=new Map;edgeKinds={};expectedEdgeKinds={};annotations={comments:0,notes:0,learnings:0};annotationFields;planMismatches=[];itemCount=0;observedDepth=0;observedFanout=0;historyEntryCount=0;firstTimestamp=null;lastTimestamp=null;constructor(t){this.shape=t,this.annotationFields=[["comments","has_comment",t.comments_per_100_items],["notes","has_note",t.notes_per_100_items],["learnings","has_learning",t.learnings_per_100_items]]}recordMismatch(t,r){t&&this.planMismatches.push(r)}recordEdgeKinds(t,r){for(let o of r)t[o]=(t[o]??0)+1}add(t){this.itemCount+=1,this.authors.add(t.author),this.components.add(t.component),this.recordMismatch(this.depths.has(t.id),`duplicate_id:${t.id}`);let r=1;if(t.parent!==void 0){let o=this.depths.get(t.parent);this.recordMismatch(o===void 0,`parent_missing:${t.parent}`),r=(o??0)+1;let n=(this.childCounts.get(t.parent)??0)+1;this.childCounts.set(t.parent,n),this.observedFanout=Math.max(this.observedFanout,n)}this.depths.set(t.id,r),this.observedDepth=Math.max(this.observedDepth,r),this.historyEntryCount+=t.history_entry_count,this.recordMismatch(t.history_entry_count!==this.shape.history_entries_per_item,"history_entries_per_item:drift"),this.firstTimestamp=this.firstTimestamp===null||t.timestamp<this.firstTimestamp?t.timestamp:this.firstTimestamp,this.lastTimestamp=this.lastTimestamp===null||t.timestamp>this.lastTimestamp?t.timestamp:this.lastTimestamp;for(let[o,n]of this.annotationFields)this.annotations[o]+=Number(t[n]);this.recordEdgeKinds(this.edgeKinds,t.dependency_kinds),this.recordEdgeKinds(this.expectedEdgeKinds,Jr(t.index,this.shape))}finish(){let t=Math.min(this.shape.author_cardinality,this.itemCount),r=Math.min(this.shape.component_count,this.itemCount),o=[...this.planMismatches,...this.itemCount===0?["item_count:empty"]:[],...this.authors.size===t?[]:[`author_count:${this.authors.size}!=${t}`],...this.components.size===r?[]:[`component_count:${this.components.size}!=${r}`],...this.observedDepth<=this.shape.hierarchy_depth?[]:[`hierarchy_depth:${this.observedDepth}>${this.shape.hierarchy_depth}`],...this.observedFanout<=this.shape.hierarchy_fanout?[]:[`hierarchy_fanout:${this.observedFanout}>${this.shape.hierarchy_fanout}`]];for(let[i,,a]of this.annotationFields){let d=Math.floor(this.itemCount/100),c=this.itemCount%100,l=d*a+Math.max(0,a+c-100),p=d*a+Math.min(a,c),f=this.annotations[i];(f<l||f>p)&&o.push(`${i}:${f}!in[${l},${p}]`)}let n=new Set([...Object.keys(this.edgeKinds),...Object.keys(this.expectedEdgeKinds)]);for(let i of[...n].sort()){let a=this.edgeKinds[i]??0,d=this.expectedEdgeKinds[i]??0;a!==d&&o.push(`edge_kind:${i}:${a}!=${d}`)}let s=[...new Set(o)];return{shape:this.shape.name,item_count:this.itemCount,author_count:this.authors.size,component_count:this.components.size,hierarchy_depth:this.observedDepth,hierarchy_fanout:this.observedFanout,timestamp_range:{first:this.firstTimestamp,last:this.lastTimestamp},history_entry_count:this.historyEntryCount,annotations:{...this.annotations},edge_kinds:{...this.edgeKinds},matches_declaration:s.length===0,mismatches:s}}};function Zr(e){return new ct(e)}function by(e,t){let r=Zr(e);for(let o of t)r.add(o);return r.finish()}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="48d03e9b-14a4-545c-8e5d-5f5f2092a113")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="6a6b2905-b6b7-5b46-b87d-8b8287e37745")}catch{}})();async function Ty(){let e=Fe(process.cwd(),process.env.PM_PATH);await Ot(e,(t,r)=>Pt(t,r,{apply_runtime_defaults:!0}))}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="4534b1c9-de27-5745-88f2-641b00b94714")}catch{}})();async function Cy(){await Rt()}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="c1cb8d82-20a6-5460-a0ff-f55312911218")}catch{}})();var Qr=["lines","branches","functions","statements"];function Sy(e,t){if(typeof t!="object"||t===null||Array.isArray(t))throw new TypeError(`Coverage entry for ${e} must be an object.`)}function wy(e,t,r){if(typeof r!="object"||r===null||Array.isArray(r))throw new TypeError(`Coverage entry ${e} has invalid ${t} counts.`);let o=r;if(typeof o.covered!="number"||typeof o.total!="number"||!Number.isInteger(o.covered)||!Number.isInteger(o.total)||o.covered<0||o.total<o.covered)throw new TypeError(`Coverage entry ${e} has invalid ${t} counts.`);return{covered:o.covered,total:o.total}}function Ey(e){if(typeof e!="object"||e===null||Array.isArray(e))throw new TypeError("Coverage summary must be a JSON object.");if(!("total"in e))throw new TypeError("Coverage summary is missing the total entry.");let t=[];for(let[r,o]of Object.entries(e)){Sy(r,o);for(let n of Qr){let s=wy(r,n,o[n]),i=s.total-s.covered;i>0&&t.push({file:r,metric:n,uncovered:i,...s})}}return t}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="7e55d416-9cc3-51c5-8e56-6b5fd5c836a9")}catch{}})();var Ay=["captured_redacted","captured_verbatim"],vy=[{label:"home directory",pattern:/(?:\/home\/|\/Users\/)[^/\s"']+/u},{label:"GitHub token",pattern:/\b(?:gh[oprsu]_[A-Za-z0-9_]{20,})\b/u},{label:"npm token",pattern:/\bnpm_[A-Za-z0-9]{20,}\b/u},{label:"private key",pattern:/-----BEGIN (?:RSA |EC |OPENSSH )?PRIVATE KEY-----/u}];function v(e){return typeof e=="string"&&e.trim().length>0}function Oy(e,t){if(typeof t!="object"||t===null||Array.isArray(t))return[{boundary_id:e.id,kind:"invalid_fixture",detail:`${e.fixture_path} must contain a JSON object.`}];let r=t,o=[];r.boundary_id!==e.id&&o.push({boundary_id:e.id,kind:"fixture_boundary_mismatch",detail:`${e.fixture_path} names ${String(r.boundary_id)} instead of ${e.id}.`}),(r.version!==1||!Ay.includes(r.capture_source)||!v(r.capture_provenance)||!Array.isArray(r.redactions)||!r.redactions.every(v)||!("input"in r)||!("observed"in r))&&o.push({boundary_id:e.id,kind:"invalid_fixture",detail:`${e.fixture_path} lacks captured provenance, redaction metadata, input, or observed output.`});let n=JSON.stringify(t);for(let s of vy)s.pattern.test(n)&&o.push({boundary_id:e.id,kind:"unsafe_fixture",detail:`${e.fixture_path} contains a possible ${s.label}.`});return o}function Py(e,t){let r=Date.parse(e.waiver_expires_at),o=v(e.waiver_reason)&&v(e.waiver_owner)&&e.waiver_expires_at.endsWith("Z")&&_e(e.waiver_expires_at)&&Number.isFinite(r);return{captured:0,waived:o&&r>=t?1:0,findings:o?r<t?[{boundary_id:e.id,kind:"expired_waiver",detail:`Boundary ${e.id} waiver expired at ${e.waiver_expires_at}.`}]:[]:[{boundary_id:e.id,kind:"invalid_waiver",detail:`Boundary ${e.id} waiver requires reason, owner, and an RFC 3339 UTC expiry.`}]}}function Ry(e,t,r){if(!v(e.id)||!v(e.producer)||!v(e.consumer)||!v(e.format))return{captured:0,waived:0,findings:[{boundary_id:v(e.id)?e.id:"unknown",kind:"invalid_boundary",detail:"Each boundary requires non-empty id, producer, consumer, and format."}]};if("fixture_path"in e){let o=t[e.fixture_path],n=v(e.fixture_path)&&e.fixture_path in t?Oy(e,o):[{boundary_id:e.id,kind:"missing_fixture",detail:`Boundary ${e.id} fixture ${String(e.fixture_path)} is missing.`}];return{captured:n.length===0?1:0,waived:0,findings:n}}return Py(e,r)}function CN(e,t,r=new Date){let o=[];if(e.version!==1||!v(e.inventory_scope)||!Array.isArray(e.boundaries))return{ok:!1,boundary_count:0,captured_count:0,waived_count:0,findings:[{boundary_id:"registry",kind:"invalid_registry",detail:"Boundary registry requires version 1, inventory_scope, and boundaries."}]};let n=new Set,s=0,i=0;for(let a of e.boundaries){if(typeof a!="object"||a===null||Array.isArray(a)){o.push({boundary_id:"unknown",kind:"invalid_boundary",detail:"Each boundary must be a JSON object."});continue}let d=a,c=v(d.id)?d.id:void 0;if(c!==void 0&&n.has(c)){o.push({boundary_id:c,kind:"duplicate_boundary",detail:`Boundary ${c} is inventoried more than once.`});continue}c!==void 0&&n.add(c);let l=Ry(d,t,r.getTime());s+=l.captured,i+=l.waived,o.push(...l.findings)}return o.sort((a,d)=>a.boundary_id!==d.boundary_id?a.boundary_id.localeCompare(d.boundary_id):a.kind.localeCompare(d.kind)),{ok:o.length===0,boundary_count:e.boundaries.length,captured_count:s,waived_count:i,findings:o}}import X from"node:fs";import lt from"node:path";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="aacf5738-098d-50f9-b619-19e472b577ea")}catch{}})();var eo=300*1e3,Iy=3;function vN(e){return(e?.trim()||"development").replace(/[^a-zA-Z0-9._-]/g,"_").replace(/^\./,"_")}function ON(e,t){let r=t.trim();if(!/^[a-zA-Z0-9_-][a-zA-Z0-9._-]*$/.test(r))throw new TypeError("Compile-cache generation must be a safe non-empty filename token.");X.mkdirSync(e,{recursive:!0});let o=lt.join(e,r);X.mkdirSync(o,{recursive:!0});let n=new Date;X.utimesSync(o,n,n);let s=X.readdirSync(e).filter(c=>c!==r).flatMap(c=>{try{return[{name:c,mtimeMs:X.statSync(lt.join(e,c)).mtimeMs}]}catch(l){if(l instanceof Error&&"code"in l&&fe(l))return[];throw l}}).sort((c,l)=>l.mtimeMs-c.mtimeMs||c.name.localeCompare(l.name)),i=s.filter(c=>n.getTime()-c.mtimeMs<eo),a=Math.max(0,Iy-1-i.length),d=s.filter(c=>n.getTime()-c.mtimeMs>=eo).slice(a).map(c=>c.name).sort((c,l)=>c.localeCompare(l));for(let c of d)X.rmSync(lt.join(e,c),{recursive:!0,force:!0,maxRetries:3,retryDelay:50});return{retained:r,removed:d}}import{createHash as My}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="ff60bc5b-bd85-5b3c-9a55-21e7e72477ac")}catch{}})();var pt=1;function J(e){e?.throwIfAborted()}function U(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship graph ${t} must be non-empty`);return e.trim()}function Z(e,t,r={}){let o=Date.parse(r.createdAt??new Date().toISOString());if(!Number.isFinite(o))throw new TypeError("Relationship graph createdAt must be a valid timestamp");let n=e.nodes(),s=e.edges(),i=t.list();return Object.freeze({version:pt,fingerprint:My("sha256").update(R({nodes:n,edges:s,kinds:i})).digest("hex"),created_at:new Date(o).toISOString(),nodes:n,edges:s,kinds:i})}function ky(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ae(e){if(!ky(e))throw new TypeError("Relationship graph snapshot must be an object");if(e.version!==pt)throw new TypeError(`Unsupported relationship graph snapshot version: ${String(e.version)}`);if(!Array.isArray(e.nodes)||e.nodes.some(n=>typeof n!="string"))throw new TypeError("Relationship graph snapshot nodes must be strings");if(!Array.isArray(e.edges)||!Array.isArray(e.kinds))throw new TypeError("Relationship graph snapshot edges and kinds must be arrays");if(typeof e.created_at!="string"||!Number.isFinite(Date.parse(e.created_at)))throw new TypeError("Relationship graph snapshot created_at must be valid");if(typeof e.fingerprint!="string")throw new TypeError("Relationship graph snapshot fingerprint must be a string");let t=new De([]);for(let n of e.kinds)t.register(n);let r=new z(e.nodes,e.edges,t),o=Z(r,t,{createdAt:e.created_at});if(o.fingerprint!==e.fingerprint)throw new TypeError("Relationship graph snapshot fingerprint mismatch");return{snapshot:o,registry:t,graph:r}}async function x(e,t){U(e.name,"adapter name");let r=U(t.workspace,"workspace");J(t.signal);let o=await e.read({...t,workspace:r});return J(t.signal),o===null?null:ae(o)}async function Pe(e,t){let r=U(t.workspace,"workspace"),o=ae(t.snapshot).snapshot,n=await x(e,{workspace:r,signal:t.signal});if(n?.snapshot.fingerprint===o.fingerprint)return{adapter:e.name,workspace:r,disposition:"current",fingerprint:o.fingerprint,previous_fingerprint:n.snapshot.fingerprint,node_count:o.nodes.length,edge_count:o.edges.length};if(J(t.signal),await e.replace({workspace:r,signal:t.signal,snapshot:o,expected_fingerprint:n?.snapshot.fingerprint??null}),(await x(e,{workspace:r,signal:t.signal}))?.snapshot.fingerprint!==o.fingerprint)throw new Error(`Relationship graph adapter "${e.name}" did not expose the replaced snapshot`);return{adapter:e.name,workspace:r,disposition:"written",fingerprint:o.fingerprint,...n?{previous_fingerprint:n.snapshot.fingerprint}:{},node_count:o.nodes.length,edge_count:o.edges.length}}function xy(e,t={}){let r=e.map(ae),o=new Map;for(let i of r)for(let a of i.snapshot.kinds){let d=o.get(a.kind);if(d&&R(d)!==R(a))throw new TypeError(`Conflicting federated relationship kind: ${a.kind}`);o.set(a.kind,a)}let n=new De([...o.values()].sort((i,a)=>i.kind.localeCompare(a.kind))),s=new z(new Set(r.flatMap(i=>[...i.snapshot.nodes])),r.flatMap(i=>[...i.snapshot.edges]),n);return Z(s,n,t)}var se=class{name;#e=new Map;constructor(t="memory"){this.name=U(t,"adapter name")}async read(t){J(t.signal);let r=this.#e.get(U(t.workspace,"workspace"));return r?structuredClone(r):null}async replace(t){J(t.signal);let r=U(t.workspace,"workspace"),o=this.#e.get(r);if(t.expected_fingerprint!==void 0&&(o?.fingerprint??null)!==t.expected_fingerprint)throw new Error(`Relationship graph adapter conflict for ${r}`);this.#e.set(r,structuredClone(ae(t.snapshot).snapshot))}async clear(t){J(t.signal);let r=U(t.workspace,"workspace"),o=this.#e.get(r);if(t.expected_fingerprint!==void 0&&(o?.fingerprint??null)!==t.expected_fingerprint)throw new Error(`Relationship graph adapter conflict for ${r}`);this.#e.delete(r)}};(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="e47f9bb8-f98e-5159-9116-29c3e6fedfc3")}catch{}})();function to(e,t){if(!Number.isInteger(e)||e<1)throw new TypeError(`Relationship graph ${t} must be a positive integer`);return e}function Ny(e){let t=to(e.nodeCount,"nodeCount"),r=to(e.edgeStride??1,"edgeStride"),o=e.topology??"chain";if(!["chain","star","disconnected"].includes(o))throw new TypeError(`Unsupported relationship graph topology: ${o}`);let n=(e.kind??"related").trim(),s=(e.idPrefix??"node").trim();if(!n||!s)throw new TypeError("Relationship graph kind and idPrefix must be non-empty");let i=o==="disconnected"?0:Math.floor((t-1)/r);return{node_count:t,edge_count:i,edge_basis:"fixture_generated",nodes:{*[Symbol.iterator](){for(let a=0;a<t;a+=1)yield`${s}-${a}`}},edges:{*[Symbol.iterator](){if(o!=="disconnected")for(let a=r;a<t;a+=r)yield{source:`${s}-${o==="star"?0:a-r}`,target:`${s}-${a}`,kind:n}}}}}function j(e,t){if(!e)throw new Error(`Relationship graph adapter conformance: ${t}`)}async function ro(e,t={}){let r=t.workspace?.trim()||"pm-graph-conformance",o=yt(),n=Z(new z(["a","b"],[{source:"a",target:"b",kind:"related"}],o),o,{createdAt:"2026-01-01T00:00:00.000Z"}),s=Z(new z(["a","b","c"],[{source:"a",target:"b",kind:"related"},{source:"b",target:"c",kind:"blocked_by"}],o),o,{createdAt:"2026-01-02T00:00:00.000Z"}),i=[];j(await x(e,{workspace:r})===null,"workspace must start empty"),i.push({name:"empty-read",passed:!0});let a=await Pe(e,{workspace:r,snapshot:n});j(a.disposition==="written","first sync must write"),i.push({name:"atomic-replace",passed:!0}),(await e.read({workspace:r})).nodes.push("mutated-reader-copy"),j((await x(e,{workspace:r}))?.snapshot.nodes.length===2,"reads must not mutate stored state"),i.push({name:"read-isolation",passed:!0}),j((await Pe(e,{workspace:r,snapshot:n})).disposition==="current","identical sync must be idempotent"),i.push({name:"idempotent-sync",passed:!0}),await e.replace({workspace:r,snapshot:s,expected_fingerprint:n.fingerprint}),j((await x(e,{workspace:r}))?.snapshot.fingerprint===s.fingerprint,"replacement must become visible"),i.push({name:"replacement-visibility",passed:!0});let d=!1;try{await e.replace({workspace:r,snapshot:n,expected_fingerprint:n.fingerprint})}catch{d=!0}return j(d,"stale compare-and-swap must fail"),i.push({name:"stale-cas",passed:!0}),e.clear&&(await e.clear({workspace:r,expected_fingerprint:s.fingerprint}),j(await x(e,{workspace:r})===null,"clear must remove the workspace"),i.push({name:"clear",passed:!0})),{adapter:e.name,workspace:r,cases:Object.freeze(i),clear_supported:e.clear!==void 0}}function Ly(e){return ro(new se,e?{workspace:e}:{})}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="58736688-35d0-545d-892e-e0ede7fedc1a")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="d45a8203-4501-5797-a6cc-a2e7844adec9")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="f5567aa1-0268-574d-907b-38d6249538ce")}catch{}})();var ut=2,Dy=["self_reported","independent_transport"];function Re(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function de(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`${t} must be a non-empty string`);return e.trim()}function oo(e,t,r=!1){if(!Array.isArray(e)||e.length===0)throw new TypeError(`${t} must be a non-empty string array`);return e.map((o,n)=>{let s=de(o,`${t}[${String(n)}]`);return r?o:s})}function mt(e,t){return e===void 0?void 0:de(e,t)}function $y(e,t){if(e===void 0)return;if(!Re(e)||Object.keys(e).length===0)throw new TypeError(`${t} must be a non-empty object`);let r=Object.entries(e).map(([o,n])=>{if(o.length===0||o.split(".").some(s=>s.length===0))throw new TypeError(`${t} must use dot-separated own-property paths`);if(n!==null&&typeof n!="string"&&typeof n!="boolean"&&(typeof n!="number"||!Number.isFinite(n)))throw new TypeError(`${t} values must be JSON primitives`);return[o,n]});return Object.fromEntries(r)}function Fy(e,t,r,o,n,s){if(o==="refusal"){if(We(r)||n===void 0||s===void 0)throw new TypeError(`${e} refusal steps require a non-success exit, error code, and refusal surface`);return}if(n!==void 0||s!==void 0)throw new TypeError(`${e} only refusal steps may declare expected_error_code or expected_refusal_surface`);let i=Ct(t);if(i===void 0)throw new TypeError(`${e}.args must identify a command after global flags`);let a=t[i].trim().toLowerCase();if(a==="history"){let l=St(t.slice(i+1));l!==void 0&&(a=Le(`history ${l}`))}let d=Nt(a);if(!We(r)||r!==0&&!d?.exit_codes.some(l=>l===r))throw new TypeError(`${e} successful output must use exit code 0 or a command-declared successful effect exit`);let c=xt(a).kind;if(o!==c)throw new TypeError(`${e} expected ${o}, but ${a} declares ${c}`)}function Gy(e,t,r){if(!Re(e))throw new TypeError(`tasks.${t}.steps[${String(r)}] must be an object`);let o=`tasks.${t}.steps[${String(r)}]`,n=de(e.id,`${o}.id`),s=oo(e.args,`${o}.args`,!0),i=e.expected_exit_code;if(typeof i!="number"||!Number.isSafeInteger(i))throw new TypeError(`${o}.expected_exit_code must be a safe integer`);let a=e.expected_output_kind;if(a!=="refusal"&&!kt.includes(a))throw new TypeError(`${o}.expected_output_kind is unsupported`);let d=a,c=e.expected_accounting_mode;if(!Dy.includes(c))throw new TypeError(`${o}.expected_accounting_mode is unsupported`);let l=c;if(l==="independent_transport"&&d!=="refusal")throw new TypeError(`${o} independent_transport accounting is supported only for refusal steps`);let p=oo(e.required_fields,`${o}.required_fields`);if(p.some(S=>S.split(".").some(q=>q.length===0)))throw new TypeError(`${o}.required_fields must contain dot-separated own-property paths`);let f=$y(e.expected_field_values,`${o}.expected_field_values`),_=mt(e.expected_error_code,`${o}.expected_error_code`),g=mt(e.expected_refusal_surface,`${o}.expected_refusal_surface`),T=mt(e.recovery_for,`${o}.recovery_for`);return Fy(o,s,i,d,_,g),{id:n,args:s,expected_exit_code:i,expected_output_kind:d,expected_accounting_mode:l,required_fields:p,...f?{expected_field_values:f}:{},..._?{expected_error_code:_}:{},...g?{expected_refusal_surface:g}:{},...T?{recovery_for:T}:{}}}function Uy(e,t){if(!Re(e))throw new TypeError(`tasks[${String(t)}] must be an object`);let r=de(e.id,`tasks[${String(t)}].id`),o=de(e.description,`tasks.${r}.description`);if(!Array.isArray(e.steps)||e.steps.length===0)throw new TypeError(`tasks.${r}.steps must be a non-empty array`);let n=e.steps.map((i,a)=>Gy(i,r,a)),s=new Map;for(let i of n){if(s.has(i.id))throw new TypeError(`tasks.${r} contains duplicate step id ${i.id}`);if(i.recovery_for!==void 0&&(s.get(i.recovery_for)?.expected_output_kind!=="refusal"||i.expected_output_kind==="refusal"))throw new TypeError(`tasks.${r}.${i.id} recovery_for must reference an earlier refusal and declare successful output`);s.set(i.id,i)}if(n.at(-1)?.expected_output_kind==="refusal")throw new TypeError(`tasks.${r} completed task must terminate with successful output`);for(let i of n)if(i.expected_output_kind==="refusal"&&!n.some(a=>a.recovery_for===i.id))throw new TypeError(`tasks.${r}.${i.id} refusal must have a later successful recovery_for step`);return{id:r,description:o,steps:n}}function nL(e){if(!Re(e))throw new TypeError("agent-task transcript corpus must be an object");if(e.version!==ut)throw new TypeError(`agent-task transcript corpus version must be ${String(ut)}`);if(!Array.isArray(e.tasks)||e.tasks.length===0)throw new TypeError("agent-task transcript corpus tasks must be non-empty");let t=e.tasks.map((o,n)=>Uy(o,n)),r=new Set;for(let o of t){if(r.has(o.id))throw new TypeError(`duplicate agent-task transcript id ${o.id}`);r.add(o.id)}return{version:ut,tasks:t}}import{createHash as no}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="7163a078-d8be-5bca-813f-c941fcb8e406")}catch{}})();function io(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship backfill ${t} must be non-empty`);return e.trim()}function dL(e,t){let r=io(t.migrationId,"migrationId"),o=io(t.author,"author"),n=Date.parse(t.timestamp);if(!Number.isFinite(n))throw new TypeError("Relationship backfill timestamp must be valid");let s=new Date(n).toISOString(),i=He(e,void 0,t.registry),a=i.graph.nodes(),d=i.graph.edges().map(f=>{let _=no("sha256").update(JSON.stringify([r,f.kind,f.source,f.target,f.createdAt??null,f.author??null,f.payload??null])).digest("hex").slice(0,24);return Object.freeze({eventId:`backfill:${r}:${_}`,relationshipId:`migration:${r}:${_}`,action:"add",edge:f,author:o,timestamp:s,reason:`Backfill ${r} from legacy item metadata`})}),c=no("sha256").update(JSON.stringify({migrationId:r,nodes:a,events:d})).digest("hex"),l=new Set([...t.existingEventIds??[]].filter(f=>typeof f=="string").map(f=>f.trim()).filter(Boolean)),p=d.filter(f=>!l.has(f.eventId));return Object.freeze({migration_id:r,fingerprint:c,nodes:a,events:Object.freeze(p),edge_count:d.length,skipped_existing_count:d.length-p.length,duplicate_dependency_rows:i.duplicateRows.length,dangling_reference_count:i.dangling.active.length+i.dangling.legacy_terminal.length})}import*as so from"node:module";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="7a1d7194-6ff1-5365-ab64-80b47b0176d7")}catch{}})();var ce=["suggested_retry","candidate_command","example","next_step","migration_hint","restore_with"],ft={suggested_retry:{kind:"suggested_retry",semantics:"recovery"},retry_command:{kind:"suggested_retry",semantics:"recovery"},candidate_command:{kind:"candidate_command",semantics:"recovery"},candidate_commands:{kind:"candidate_command",semantics:"recovery"},fallback_candidates:{kind:"candidate_command",semantics:"recovery",nested_value_field:"command"},next_best_command:{kind:"candidate_command",semantics:"recovery"},example:{kind:"example",semantics:"recovery"},examples:{kind:"example",semantics:"recovery"},next_step:{kind:"next_step",semantics:"recovery"},next_steps:{kind:"next_step",semantics:"recovery"},suggested_next_steps:{kind:"next_step",semantics:"recovery"},migration_hint:{kind:"migration_hint",semantics:"replacement"},migration_hints:{kind:"migration_hint",semantics:"replacement"},restore_with:{kind:"restore_with",semantics:"behavior_preserving"}},lL=Object.freeze(Object.keys(ft));function ao(e){if(Object.hasOwn(ft,e))return ft[e]}var jy=new Set([..."=([{,:;!?&|+-*%^~<>","=>"]);function Q(e,t){return e<t?-1:e>t?1:0}function By(e,t){let r=e[t],o=t+1,n="";for(;o<e.length&&e[o]!==r;)e[o]==="\\"?o+=2:(n+=e[o],o+=1);return e[o]===r&&(o+=1),{next:o,value:n}}function qy(e){return e===void 0||e.kind==="punctuator"&&jy.has(e.value)||e.kind==="identifier"&&["return","case","throw","else","yield"].includes(e.value)}function zy(e,t){if(/\s/u.test(e[t]))return t+1;if(e.startsWith("//",t)){let r=e.indexOf(`
31
+ `,t+2);return r===-1?e.length:r+1}if(e.startsWith("/*",t))return e.indexOf("*/",t+2)+2}function Hy(e,t,r){if(e[t]!=="/"||!qy(r))return;let o=t+1,n=!1;for(;o<e.length;)if(e[o]==="\\")o+=2;else if(e[o]==="[")n=!0,o+=1;else if(e[o]==="]")n=!1,o+=1;else if(e[o]==="/"&&!n){for(o+=1;/[A-Za-z]/u.test(e.charAt(o));)o+=1;return o}else o+=1;return o}function Vy(e,t){let r=e[t];if(r==="'"||r==='"'||r==="`"){let n=By(e,t);return r==="`"?{next:n.next}:{next:n.next,token:{kind:"string",value:n.value,offset:t+1}}}if(/[A-Za-z_$]/u.test(r)){let n=t+1;for(;/[A-Za-z0-9_$]/u.test(e[n]??"");)n+=1;return{next:n,token:{kind:"identifier",value:e.slice(t,n),offset:t}}}let o=e.startsWith("=>",t)?"=>":r;return{next:t+o.length,token:{kind:"punctuator",value:o,offset:t}}}function Ky(e){let t=[],r=0;for(;r<e.length;){let o=zy(e,r);if(o!==void 0){r=o;continue}let n=Hy(e,r,t.at(-1));if(n!==void 0){r=n;continue}let s=Vy(e,r);s.token&&t.push(s.token),r=s.next}return t}var Wy=new Set(["object","block","pattern"]),Yy=new Set(["const","let","var"]),Xy=new Set(["}",")","]"]),Jy=new Set(["=","(","[",",",":","?","return"]);function Zy(e,t,r){if([...r].reverse().find(n=>Wy.has(n.kind))?.kind==="pattern"||r.at(-1)?.kind==="paren"&&r.at(-1)?.parameter_list)return"pattern";let o=e[t-1];return o?.kind==="identifier"&&Yy.has(o.value)?"pattern":o?.value==="=>"||o?.value===")"?"block":o&&Jy.has(o.value)?"object":"block"}function Qy(e,t,r){let o=e[t];if(o.value==="{"){let i=Zy(e,t,r);return{kind:i,...i==="object"?{member_start:!0,candidates:[]}:{}}}if(o.value==="[")return{kind:"array"};if(o.value!=="(")return;let n=e[t-1],s=e[t-2];return{kind:"paren",...n?.value==="function"||s?.value==="function"?{parameter_list:!0}:{}}}function eb(e,t,r){if(!(e?.kind!=="object"||!e.member_start||t.kind!=="identifier"&&t.kind!=="string"||r?.value!==":"||!/^[A-Za-z][A-Za-z0-9_]*$/u.test(t.value)))return{field:t.value,offset:t.offset}}function tb(e,t){return e[t+1]?.value===")"&&e[t+2]?.value==="=>"||e[t+1]?.value==="="}function rb(e){let t=Ky(so.stripTypeScriptTypes(e,{mode:"strip"})),r=[],o=[];for(let[n,s]of t.entries()){let i=o.at(-1),a=eb(i,s,t[n+1]);a&&i.candidates.push(a);let d=Qy(t,n,o);if(d)o.push(d);else if(Xy.has(s.value)){let c=o.pop();c?.kind==="object"&&!tb(t,n)&&r.push(...c.candidates)}else s.value===","&&i?.kind==="object"?i.member_start=!0:i?.kind==="object"&&s.value!==":"&&(i.member_start=!1)}return r}function ob(e){let t=[0];for(let r=0;r<e.length;r+=1)e[r]===`
32
+ `&&t.push(r+1);return t}function nb(e,t){let r=0,o=e.length;for(;r<o;){let n=Math.floor((r+o)/2);e[n]<=t?r=n+1:o=n}return r}function pL(e){let t=[],r=[];for(let n of[...e].sort((s,i)=>Q(s.path,i.path))){let s=ob(n.content),i;try{i=rb(n.content)}catch(a){r.push({kind:"invalid_source",subject:n.path,detail:`${n.path} could not be parsed for recovery producers: ${String(a)}.`});continue}for(let a of i){let d=a.field,c=nb(s,a.offset),l=ao(d);l?t.push({path:n.path,line:c,field:d,kind:l.kind}):/(?:retry_command|candidate_command|fallback_candidate|next_best_command|example|next_step|migration_hint|restore_with)/u.test(d)&&!/(?:_total|_truncated)$/u.test(d)&&r.push({kind:"unknown_recovery_field",subject:`${n.path}:${c}:${d}`,detail:`${d} resembles a recovery reference but has no typed field contract.`})}}let o=Object.fromEntries(ce.map(n=>[n,t.filter(s=>s.kind===n).length]));for(let n of ce)o[n]===0&&r.push({kind:"missing_kind_producer",subject:n,detail:`No source producer emits the ${n} recovery-reference kind.`});return t.sort((n,s)=>n.path!==s.path?Q(n.path,s.path):n.line!==s.line?n.line-s.line:Q(n.field,s.field)),r.sort((n,s)=>n.subject!==s.subject?Q(n.subject,s.subject):Q(n.kind,s.kind)),{ok:r.length===0,scanned_file_count:e.length,producer_count:t.length,producer_count_by_kind:o,producers:t,findings:r}}function uL(e,t){let r=[],o=(n,s)=>{if(Array.isArray(n)){n.forEach((i,a)=>o(i,[...s,String(a)]));return}if(!(typeof n!="object"||n===null))for(let[i,a]of Object.entries(n).sort(([d],[c])=>Q(d,c))){let d=ao(i),c=d?.kind==="migration_hint"&&n.semantics==="behavior_preserving"?{...d,semantics:"behavior_preserving"}:d,l=[a].flat();c!==void 0&&l.forEach((p,f)=>{let _="nested_value_field"in c&&typeof c.nested_value_field=="string"?c.nested_value_field:void 0,g=_&&typeof p=="object"&&p!==null&&!Array.isArray(p)?p[_]:p;if(typeof g!="string"||g.trim().length===0)return;let T=[...s,i,String(f)].map(S=>encodeURIComponent(S)).join("/");r.push({id:`${e}:${c.kind}:${T}`,probe_id:e,kind:c.kind,semantics:c.semantics,value:g})}),o(a,[...s,i])}};return o(t,[]),r}function mL(e,t){let r=e.flatMap(i=>(i.owned_states??[]).map(a=>({contract:i,state:a}))),o=[],n=new Map;for(let i of t){if(n.has(i.probe_id)){o.push({kind:"duplicate_probe",probe_id:i.probe_id,detail:`Observation ${i.probe_id} was supplied more than once.`});continue}n.set(i.probe_id,i)}let s=new Set(r.map(({state:i})=>i.probe_id));for(let{contract:i,state:a}of r){let d=n.get(a.probe_id);if(!d){o.push({kind:"missing_probe",probe_id:a.probe_id,detail:`No entrypoint observation was recorded for ${i.code}.`});continue}d.code!==i.code&&o.push({kind:"wrong_error_code",probe_id:a.probe_id,detail:`Expected ${i.code}; observed ${d.code}.`}),d.exit_class!==a.expected_exit_class&&o.push({kind:"wrong_exit_class",probe_id:a.probe_id,detail:`Expected ${a.expected_exit_class}; observed ${d.exit_class}.`}),a.entrypoints.includes(d.entrypoint)||o.push({kind:"wrong_entrypoint",probe_id:a.probe_id,detail:`Expected one of ${a.entrypoints.join(", ")}; observed ${d.entrypoint}.`})}for(let i of t)s.has(i.probe_id)||o.push({kind:"undeclared_probe",probe_id:i.probe_id,detail:`Observation ${i.probe_id} has no catalog declaration.`});return o.sort((i,a)=>i.probe_id!==a.probe_id?i.probe_id.localeCompare(a.probe_id):i.kind.localeCompare(a.kind)),{ok:o.length===0,declared_probe_count:r.length,observed_probe_count:t.length,findings:o}}function fL(e,t){let r=[],o=new Set,n=new Set;for(let d of e){if(o.has(d.id)){n.add(d.id),r.push({kind:"duplicate_obligation",reference_id:d.id,detail:`Recovery obligation ${d.id} was declared more than once.`});continue}o.add(d.id)}let s=new Map;for(let d of t){if(s.has(d.id)){r.push({kind:"duplicate_observation",reference_id:d.id,detail:`Recovery reference ${d.id} was observed more than once.`});continue}s.set(d.id,d),o.has(d.id)||r.push({kind:"undeclared_observation",reference_id:d.id,detail:`Recovery observation ${d.id} has no emitted obligation.`})}for(let d of e){if(n.has(d.id))continue;let c=s.get(d.id);c?c.reachable?c.semantics!==d.semantics&&r.push({kind:"wrong_semantics",reference_id:d.id,detail:`Recovery reference ${d.value} promised ${d.semantics}; proof demonstrated ${c.semantics}.`}):r.push({kind:"unreachable_reference",reference_id:d.id,detail:`Recovery reference ${d.value} did not reach its promised target.`}):r.push({kind:"missing_observation",reference_id:d.id,detail:`No reachability proof was recorded for ${d.kind} ${d.value}.`})}let i=ce.map(d=>{let c=e.filter(p=>p.kind===d),l=c.filter(p=>!n.has(p.id)).map(p=>s.get(p.id)).filter(p=>p!==void 0);return{kind:d,declared:c.length,observed:l.length,passed:c.filter(p=>{let f=s.get(p.id);return!n.has(p.id)&&f?.reachable===!0&&f.semantics===p.semantics}).length}});r.sort((d,c)=>d.reference_id!==c.reference_id?d.reference_id.localeCompare(c.reference_id):d.kind.localeCompare(c.kind));let a=i.reduce((d,c)=>d+c.passed,0);return{ok:r.length===0,declared_reference_count:e.length,observed_reference_count:t.length,pass_fraction:o.size===0?1:a/o.size,coverage_by_kind:i,findings:r}}function ib(e,t){let r=new Map(ce.map(s=>[s,new Set]));for(let s of t)r.get(s.kind).add(s.value);let o=ce.map(s=>({kind:s,source_producers:e.producer_count_by_kind[s],runtime_values:r.get(s).size})),n=o.filter(({source_producers:s,runtime_values:i})=>s>0&&i===0).map(({kind:s})=>s);return{ok:e.ok&&n.length===0,source_producer_count:e.producer_count,runtime_value_count:o.reduce((s,{runtime_values:i})=>s+i,0),coverage_by_kind:o,missing_runtime_kinds:n}}var _L=ib;(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="2b2197f3-7203-52c8-9cc7-f714b33a9306")}catch{}})();var gL=16,sb=Object.freeze(["bulk_ids_input_empty","bulk_ids_input_missing_path","bulk_ids_input_unreadable","invalid_argument_value","missing_lifecycle_target","missing_required_argument","projection_options_mutually_exclusive","tracker_not_initialized","tracker_root_missing","tracker_root_not_directory","tracker_root_unreadable","unknown_context_intent","unknown_field_projection","unknown_option","unknown_subcommand"]),co=18,lo=Object.freeze([...sb,"manifest_unknown_key","no_version_bounds_declared"].sort((e,t)=>e.localeCompare(t)));function yL(e,t=co){return{ok:e.executable_error_code_count>=t,baseline:t,actual:e.executable_error_code_count}}function bL(e,t=lo){let r=new Set(e.rows.filter(({disposition:n})=>n==="executable").map(({canonical_code:n})=>n)),o=t.filter(n=>!r.has(n));return{ok:o.length===0,required_canonical_codes:[...t],missing_required_canonical_codes:o}}function _t(e,t){let r=e.get(t);if(r)return r;let o={kinds:new Set,probeIds:new Set};return e.set(t,o),o}function TL(e,t,r){let o=new Map(e.map(l=>[l.code,l.canonical_code??l.code])),n=new Map,s=0,i=0;for(let l of e){let p=_t(n,l.canonical_code??l.code);for(let f of l.owned_states??[])p.kinds.add("owned_state"),p.probeIds.add(f.probe_id)}for(let l of t){let p=o.get(l.error_code);if(p===void 0)continue;s+=1;let f=_t(n,p);f.kinds.add("closed_domain"),f.probeIds.add(l.probe_id)}for(let l of r){let p=o.get(l.error_code);if(p===void 0)continue;i+=1;let f=_t(n,p);f.kinds.add("grammar"),f.probeIds.add(l.probe_id)}let a=e.map(l=>{let p=l.canonical_code??l.code,f=n.get(p),_=[...f.probeIds].sort();return{code:l.code,canonical_code:p,disposition:_.length>0?"executable":"uncovered",evidence_kinds:[...f.kinds].sort(),probe_ids:_}}).sort((l,p)=>l.code<p.code?-1:1),d=a.filter(({disposition:l})=>l==="uncovered").map(({code:l})=>l),c=a.length-d.length;return{ok:d.length===0,catalog_error_code_count:a.length,executable_error_code_count:c,uncovered_error_code_count:d.length,coverage_fraction:a.length===0?1:c/a.length,closed_domain_probe_count:s,grammar_probe_count:i,uncovered_error_codes:d,rows:a}}function CL(e){let t=e.rows.map(r=>`| \`${r.code}\` | \`${r.canonical_code}\` | ${r.disposition} | ${r.evidence_kinds.join(", ")||"none"} | ${r.probe_ids.length} |`);return["# Generated refusal closure census","","Tracker: `pm-f05lsg`.","","Every catalog code is listed. An `uncovered` row is an explicit closure obligation, never an omission or implied approval.","",`- Catalog error codes: ${e.catalog_error_code_count}`,`- Executable error codes: ${e.executable_error_code_count}`,`- Executable-code ratchet floor: ${co}`,`- Required executable canonical codes: ${lo.map(r=>`\`${r}\``).join(", ")}`,`- Uncovered error codes: ${e.uncovered_error_code_count}`,`- Coverage fraction: ${e.coverage_fraction.toFixed(6)}`,`- Closed-domain probes: ${e.closed_domain_probe_count}`,`- Grammar probes: ${e.grammar_probe_count}`,"","| Error code | Canonical code | Disposition | Evidence kinds | Probe count |","| --- | --- | --- | --- | --- |",...t,""].join(`
33
+ `)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="d252409d-e33e-5c9e-9671-789f0ee87312")}catch{}})();function ab(e){return[e.expected_error_code!==void 0&&e.error_code!==e.expected_error_code?{code:"error_code_mismatch",probe_id:e.probe_id,detail:`Expected error code ${e.expected_error_code}, received ${e.error_code??"<missing>"}.`}:void 0,e.expected_allowed_values!==void 0&&JSON.stringify([...e.allowed_values].sort())!==JSON.stringify([...e.expected_allowed_values].sort())?{code:"incomplete_allowed_values",probe_id:e.probe_id,detail:"The refusal's accepted domain differs from the SDK-owned domain contract."}:void 0,e.expected_suggested_retry_args!==void 0&&(e.suggested_retry_args?.length??0)===0?{code:"missing_suggested_retry_args",probe_id:e.probe_id,detail:"The refusal omitted shell-free suggested retry arguments."}:void 0,e.expected_suggested_retry_args!==void 0&&(e.suggested_retry_args?.length??0)>0&&JSON.stringify(e.suggested_retry_args)!==JSON.stringify(e.expected_suggested_retry_args)?{code:"suggested_retry_args_mismatch",probe_id:e.probe_id,detail:"The refusal's suggested retry arguments differ from the SDK-owned contract."}:void 0]}function db(e){return[e.exit_code!==me.USAGE?{code:"non_refusal_exit",probe_id:e.probe_id,detail:`${e.entrypoint} returned exit code ${e.exit_code}; a structured usage refusal must return ${me.USAGE}.`}:void 0,e.allowed_values_required!==!1&&e.allowed_values.length===0?{code:"missing_allowed_values",probe_id:e.probe_id,detail:"The refusal omitted its complete accepted value domain."}:void 0,e.allowed_values.includes(e.rejected_value)?{code:"accepted_rejected_value",probe_id:e.probe_id,detail:`${e.rejected_value} is both rejected and advertised as allowed.`}:void 0,e.suggested_retry.trim().length===0?{code:"missing_suggested_retry",probe_id:e.probe_id,detail:"The refusal omitted an executable suggested retry."}:void 0,e.retry_succeeded?void 0:{code:"retry_failed",probe_id:e.probe_id,detail:"The advertised suggested retry did not succeed."},...ab(e)]}function EL(e){let t=[],r=new Set,o=0;e.length===0&&t.push({code:"empty_corpus",probe_id:"corpus",detail:"At least one real refusal observation is required."});for(let n of e){if(r.has(n.probe_id)){t.push({code:"duplicate_probe",probe_id:n.probe_id,detail:`${n.probe_id} was supplied more than once.`});continue}r.add(n.probe_id);let s=t.length;for(let i of db(n))i!==void 0&&t.push(i);t.length===s&&(o+=1)}return t.sort((n,s)=>n.probe_id!==s.probe_id?n.probe_id.localeCompare(s.probe_id):n.code.localeCompare(s.code)),{ok:t.length===0,probe_count:r.size,closed_probe_count:o,closure_fraction:r.size===0?0:o/r.size,findings:t}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="39b4e1fe-a34a-5ffc-9447-eaf8c46863c7")}catch{}})();var po="not-a-declared-action";function cb(e,t){if(e.startsWith("assurance ")&&t.name==="kind")return"measurement";switch(t.value_kind){case"integer":return"1";case"item_id":return"pm-domain";case"action":throw new Error(`Cannot synthesize a preceding action value for positional slot ${t.name}.`);default:return"example"}}function le(e){return e.replaceAll(/[^a-z0-9]+/gu,"-").replaceAll(/^-|-$/gu,"")}function xL(e=qe.filter(t=>vt.some(r=>r.command===t.command&&r.disposition!=="package_owned"))){let t=new Set(e.filter(({command:r})=>!r.includes(" ")).map(({command:r})=>le(r)));return e.flatMap(r=>r.slots.flatMap((o,n)=>{if(!o.required)return[];let s=r.command.split(" "),i=le(r.command),a=s.length>1&&t.has(i)?s.map(le).join("--"):i,d=ee(r.command).flatMap(l=>l.required?[l.flag,...l.value_name?["example"]:[]]:[]),c=Be.some(l=>l.command===r.command);return[{probe_id:`required-argument-${a}-${le(o.name)}`,command:r.command,refusal_args:[...s,...r.slots.slice(0,n).map(l=>cb(r.command,l)),...d],recovery_args:[...s,"--help"],error_code:c&&!r.command.startsWith("assurance ")?"invalid_argument_value":/^extension (?:activate|adopt|deactivate|uninstall)$/u.test(r.command)?"missing_lifecycle_target":"missing_required_argument",missing_argument:o.name,missing_argument_index:n}]})).sort((r,o)=>r.probe_id.localeCompare(o.probe_id))}function lb(e){switch(L(e)){case"assurance":case"workspace snapshot":return Be.filter(({parent:t})=>t===e).map(({action:t})=>t);case"graph":return Ge;case"merge":return Ue;case"plan":return Ye;case"profile":return Xe;case"schema":return Lt;default:throw new Error(`Required positional action family ${e} has no authoritative value domain.`)}}function NL(e=qe){return e.filter(({slots:t})=>t[0]?.required===!0&&t[0].value_kind==="action").map(({command:t})=>{let r=t.split(" ");return{probe_id:`unknown-subcommand-${le(t)}`,command:t,refusal_args:[...r,po],recovery_args:[...r,"--help"],error_code:"unknown_subcommand",rejected_value:po,allowed_values:[...lb(t)].sort()}}).sort((t,r)=>t.probe_id.localeCompare(r.probe_id))}function pb(e,t){let r=[...t].sort();return e.length===t.length&&[...e].sort().every((o,n)=>o===r[n])}function ub(e,t){if(!t)return[{code:"refusal_probe_missing",probe_id:e.probe_id,detail:`${e.probe_id} has no runtime observation.`}];let r=[];return t.error_code!==e.error_code&&r.push({code:"refusal_error_code_mismatch",probe_id:e.probe_id,detail:`${e.probe_id} emitted ${t.error_code||"<none>"}; expected ${e.error_code}.`}),t.exit_code!==2&&r.push({code:"refusal_exit_code_mismatch",probe_id:e.probe_id,detail:`${e.probe_id} exited ${t.exit_code}; expected usage exit 2.`}),"allowed_values"in e&&!pb(t.allowed_values,e.allowed_values)&&r.push({code:"refusal_allowed_values_mismatch",probe_id:e.probe_id,detail:`${e.probe_id} did not expose its complete action domain.`}),t.recovery_succeeded||r.push({code:"refusal_recovery_failed",probe_id:e.probe_id,detail:`${e.probe_id} help recovery did not succeed.`}),t.refusal_mutated_state&&r.push({code:"refusal_mutated_state",probe_id:e.probe_id,detail:`${e.probe_id} changed tracker state while refusing input${t.mutated_paths?.length?`: ${t.mutated_paths.join(", ")}`:"."}`}),r}function LL(e,t){let r=new Map(e.map(i=>[i.probe_id,i])),o=new Map(t.map(i=>[i.probe_id,i])),n=[...e.flatMap(i=>ub(i,o.get(i.probe_id))),...t.filter(i=>!r.has(i.probe_id)).map(i=>({code:"unexpected_refusal_probe",probe_id:i.probe_id,detail:`${i.probe_id} has no declared grammar refusal contract.`}))];n.sort((i,a)=>i.probe_id.localeCompare(a.probe_id)||i.code.localeCompare(a.code));let s=new Set(n.map(({probe_id:i})=>i));return{ok:n.length===0,probe_count:e.length,closed_probe_count:e.filter(({probe_id:i})=>!s.has(i)).length,findings:n}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="d3795bc4-fbe5-5ca4-bc90-b72a2d469dc7")}catch{}})();var ht=[{probe_id:"tracker-root-missing",failure_kind:"missing_root",expected_error_code:"tracker_root_missing",expected_exit_code:3,recovery_kind:"initialize"},{probe_id:"tracker-root-settings-missing",failure_kind:"settings_missing",expected_error_code:"tracker_not_initialized",expected_exit_code:3,recovery_kind:"initialize"},{probe_id:"tracker-root-not-directory",failure_kind:"not_directory",expected_error_code:"tracker_root_not_directory",expected_exit_code:2,recovery_kind:"select_directory"},{probe_id:"tracker-root-unreadable",failure_kind:"unreadable_root",expected_error_code:"tracker_root_unreadable",expected_exit_code:1,recovery_kind:"repair_permissions"}];function $L(){return ht.map(e=>({...e}))}function mb(e,t){let r=[];t.error_code!==e.expected_error_code&&r.push({code:"error_code_mismatch",probe_id:e.probe_id,detail:`Expected ${e.expected_error_code}, received ${t.error_code}.`}),t.exit_code!==e.expected_exit_code&&r.push({code:"exit_code_mismatch",probe_id:e.probe_id,detail:`Expected exit ${e.expected_exit_code}, received ${t.exit_code}.`}),t.recovery_kind!==e.recovery_kind&&r.push({code:"recovery_kind_mismatch",probe_id:e.probe_id,detail:`Expected ${e.recovery_kind}, received ${t.recovery_kind}.`});let o=t.suggested_retry_args.indexOf("init"),n=o===0||o===2&&t.suggested_retry_args[0]==="--pm-path"&&t.suggested_retry_args[1]?.length>0;return e.recovery_kind==="initialize"&&!n&&r.push({code:"missing_init_recovery",probe_id:e.probe_id,detail:"Missing and uninitialized roots must emit a tokenized init retry."}),(t.unsafe_init_recommended||e.recovery_kind!=="initialize"&&t.suggested_retry_args.includes("init"))&&r.push({code:"unsafe_init_recovery",probe_id:e.probe_id,detail:"A tracker root that cannot be initialized safely must not recommend initialization."}),t.retry_succeeded||r.push({code:"retry_failed",probe_id:e.probe_id,detail:"The emitted retry or safe alternate-root recovery did not execute successfully."}),r}function FL(e){let t=new Map(e.map(n=>[n.probe_id,n])),r=[],o=0;for(let n of ht){let s=t.get(n.probe_id);if(s===void 0){r.push({code:"missing_probe",probe_id:n.probe_id,detail:"No runtime observation was supplied for this contract."});continue}let i=mb(n,s);r.push(...i),i.length===0&&(o+=1)}return r.sort((n,s)=>n.probe_id.localeCompare(s.probe_id)||n.code.localeCompare(s.code)),{ok:r.length===0,probe_count:ht.length,closed_probe_count:o,findings:r}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="1335ff24-7fec-5bc4-8bc3-48ef7767f237")}catch{}})();var Ie,fb=Object.freeze({list:"list-item-projection","list-all":"list-item-projection","list-draft":"list-item-projection","list-open":"list-item-projection","list-in-progress":"list-item-projection","list-blocked":"list-item-projection","list-closed":"list-item-projection","list-canceled":"list-item-projection",get:"get-item-projection",graph:"graph-detail-projection",search:"search-result-projection",history:"history-entry-projection",events:"mutation-event-projection",activity:"activity-entry-projection",deps:"dependency-graph-projection",health:"health-diagnostic-projection",validate:"validation-diagnostic-projection",contracts:"contract-catalog-projection"});function _b(e,t){if(t==="--limit")return"result-row-limit";if(t==="--node-limit")return"graph-node-limit";if(t==="--edge-limit")return"graph-edge-limit";if(t==="--output-limit")return"rendered-output-row-limit";if(t==="--output-budget")return"rendered-output-byte-budget";if(t==="--token-budget")return"context-intent-token-budget";if(t==="--full"){let r=fb[L(e)];if(r===void 0)throw new Error(`Command ${e} exposes --full without a registered projection concept.`);return r}return t!=="--file"?t.slice(2):["create","update","update-many"].includes(L(e))?"linked-file-path":["comments","notes","learnings"].includes(L(e))?"entry-file-input":"plan-definition-file"}function Me(){if(Ie!==void 0)return Ie;let e=te.filter(({command:n})=>ze(n)).flatMap(({command:n,family:s})=>Mt(n,ee(n)).map(i=>({command:n,family:s,concept:_b(n,i.flag),flag:i.flag,aliases:Object.freeze([...i.aliases??[]]),value_kind:i.repeatable?"list":i.flag==="--limit"?"number":i.value_type}))),t=new Set(e.flatMap(n=>n.aliases.map(s=>`${n.command}:${s}`))),r=e.filter(n=>!t.has(`${n.command}:${n.flag}`)),o=new Map;for(let n of r){let s=o.get(n.concept)??new Set;s.add(n.value_kind),o.set(n.concept,s)}return Ie=Object.freeze(r.map(n=>Object.freeze({...n,concept:o.get(n.concept)?.size===1?n.concept:`${n.concept}@${n.command}`}))),Ie}function zL(){return Object.freeze(Me().map(e=>Object.freeze({command:e.command,canonical_flag:e.flag,accepted_spellings:Object.freeze([...new Set([e.flag,...e.aliases])].sort())})))}var uo=Object.freeze({init:30,item:20,config:36,extension:55,package:56,packages:56,install:27,upgrade:29,create: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:29,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:56,"test-all":40,telemetry:21,stats:29,health:36,validate:46,assurance:30,gc:22,workspace:23,contracts:29,claim:39,release:25,"start-task":23,"pause-task":23,"close-task":24,meet:33,event:33,remind:29,"test-runs-worker":20}),mo=Object.freeze({...uo,...Object.fromEntries(Ne.flatMap(({alias:e,canonical:t})=>{let r=uo[e];return r===void 0?[]:[[t,r]]}))});function fo(){let e=new Map(Object.keys(mo).map(t=>[t,0]));for(let{command:t}of Me())e.set(t,Number(e.get(t))+1);return Object.freeze(Object.entries(mo).map(([t,r])=>Object.freeze({command:t,current:Number(e.get(t)),maximum:r})))}function hb(e,t,r){for(let o of e)for(let n of o.aliases){let s=t.get(`${o.command}:${n}`);s===void 0||s.flag===o.flag||r.push({code:"alias_collision",command:o.command,detail:`${n} aliases ${o.flag} but is canonical for ${s.flag}.`})}}function gb(e,t,r){let o=new Set(t.map(({command:n})=>n));for(let n of e.keys())o.has(n)||r.push({code:"missing_budget",command:n,detail:`${n} has canonical flags but no persisted budget.`});for(let n of t){let s=e.get(n.command)??0;s===0&&r.push({code:"stale_budget",command:n.command,detail:`${n.command} has a persisted budget but no canonical flags.`}),!(s<=n.maximum)&&r.push({code:"budget_exceeded",command:n.command,detail:`${s} canonical flags exceed the ratcheted maximum ${n.maximum}.`})}}function yb(e,t,r){let o=new Map(e.map(n=>[`${n.command}:${n.flag}`,n]));for(let n of t){let s=`${n.command}:${n.canonical_flag}`,i=o.get(s);if(!i){r.push({code:"removed_canonical_spelling",command:n.command,detail:`${n.canonical_flag} disappeared from the executable spelling inventory.`});continue}let a=new Set([i.flag,...i.aliases]);for(let d of n.accepted_spellings)a.has(d)||r.push({code:"removed_compatibility_spelling",command:n.command,detail:`${d} no longer resolves to ${n.canonical_flag}.`})}}function HL(e=Me(),t=fo(),r=[]){let o=[],n=new Map,s=new Map,i=new Map,a=new Map;for(let d of e){let c=`${d.command}:${d.flag}`;n.has(c)?o.push({code:"duplicate_canonical_flag",command:d.command,detail:`${d.flag} has more than one canonical row.`}):n.set(c,d),a.set(d.command,(a.get(d.command)??0)+1);let l=s.get(d.concept);l!==void 0&&l!==d.value_kind?o.push({code:"inconsistent_concept_kind",command:d.command,detail:`${d.concept} uses both ${l} and ${d.value_kind}.`}):s.set(d.concept,d.value_kind);let p=i.get(d.concept);p!==void 0&&p!==d.flag?o.push({code:"semantic_spelling_collision",command:d.command,detail:`${d.concept} is canonicalized by both ${p} and ${d.flag}.`}):i.set(d.concept,d.flag)}return hb(e,n,o),gb(a,t,o),yb(e,r,o),o.sort((d,c)=>d.command.localeCompare(c.command)||d.code.localeCompare(c.code)||d.detail.localeCompare(c.detail)),{ok:o.length===0,entry_count:e.length,budget_count:t.length,concept_count:new Set(e.map(({concept:d})=>d)).size,baseline_entry_count:r.length,findings:o}}function VL(){let e=Me(),t=fo(),r=new Map(t.map(({command:o})=>[o,"unknown"]));for(let{command:o,family:n}of e)r.set(o,n);return["# Generated flag lexicon budgets","","This file is generated by `listPmFlagLexicon()`. Compatibility aliases do not consume canonical budget.","","| Command | Capability family | Canonical flags | Maximum |","| --- | --- | ---: | ---: |",...t.map(({command:o,current:n,maximum:s})=>{let i=r.get(o);return`| \`${o}\` | ${i} | ${n} | ${s} |`}),""].join(`
34
+ `)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="4c9a1aa8-05b6-53da-a8b1-f1a7289d39cf")}catch{}})();function WL(e){return e}function YL(e){return e}function XL(e){return e}function JL(e){return e}function ZL(e){return e}function QL(e){return e}function eD(e){return e}function tD(e){return e}function rD(e){return e}function oD(e){return e}function nD(e){return e}function iD(e){return e}function sD(e){return e}function aD(e){return{handled:!0,result:e}}function dD(){return{handled:!1}}function cD(e){return e}function lD(e){return e}function pD(e){return e}function uD(e){return e}function mD(e){return e}function fD(e){return e}function _D(e){return e}function hD(e){return e}function gD(e){return e}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="68ca9ab1-91e0-5020-859e-fc1f1f6dcc56")}catch{}})();function bb(e={},t={}){return new ge(t).extension(void 0,{...e,migrate:!0})}function Tb(e={},t={}){return new ge(t).packageMigrate(e)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="d0b86c6a-67f0-52f2-90b8-d1058e8f2284")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="604d7dcb-9fea-5631-8a72-b2a7ff3278f8")}catch{}})();function N(e){if(typeof e!="string"||!_e(e))throw new TypeError("Invalid reliability timestamp.");return Date.parse(e)}function Cb(e){let t=N(e.window_start),r=N(e.window_end);if(t>=r||!Number.isFinite(e.max_failure_rate)||e.max_failure_rate<0||e.max_failure_rate>=1||!Number.isSafeInteger(e.min_completed_attempts)||e.min_completed_attempts<1)throw new TypeError("Invalid reliability window policy.");if(e.families.length===0||e.families.some(o=>typeof o!="string"||o.trim().length===0)||new Set(e.families).size!==e.families.length)throw new TypeError("Expected unique, nonempty reliability families.");return{start:t,end:r}}function Sb(e,t,r,o){let n=new Map(t.map(i=>[i,[]])),s=new Set;for(let i of e){if(typeof i.id!="string"||i.id.trim().length===0||s.has(i.id))throw new TypeError("Invalid or duplicate reliability attempt identity.");s.add(i.id);let a=n.get(i.family);if(!a||!["success","failure","pending"].includes(i.outcome)||i.cause!==void 0&&(!["product","infrastructure","unknown"].includes(i.cause)||i.outcome!=="failure"))throw new TypeError("Invalid reliability attempt family, outcome or cause.");let d=N(i.started_at);if(i.repaired_at!==void 0&&(N(i.repaired_at)<d||i.outcome!=="failure"))throw new TypeError("Invalid reliability repair chronology.");d>=r&&d<o&&a.push(i)}return n}function LD(e,t){let{start:r,end:o}=Cb(t),n=[...Sb(e,t.families,r,o)].map(([s,i])=>{let a=i.filter(_=>_.outcome==="failure"),d=i.filter(_=>_.outcome!=="pending").length,c=d===0?null:a.length/d,l=a.filter(_=>_.repaired_at!==void 0&&N(_.repaired_at)<o),p={product:0,infrastructure:0,unknown:0};for(let _ of a)p[_.cause??"unknown"]+=1;let f=[];return d<t.min_completed_attempts&&f.push("insufficient_completed_attempts"),c!==null&&c>t.max_failure_rate&&f.push("failure_rate"),{family:s,attempts:i.length,completed:d,failed:a.length,pending:i.length-d,failure_rate:c,affected_days:[...new Set(a.map(_=>new Date(N(_.started_at)).toISOString().slice(0,10)))].sort(),repair_minutes:l.map(_=>(N(_.repaired_at)-N(_.started_at))/6e4).sort((_,g)=>_-g),unresolved:a.length-l.length,causes:p,violations:f,ok:f.length===0}});return{schema:"pm-reliability-window/1",window_start:new Date(r).toISOString(),window_end:new Date(o).toISOString(),ok:n.every(s=>s.ok),families:n}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="773ad2b6-326e-5483-bdce-a377f935cb31")}catch{}})();function pe(e){return typeof e=="string"&&e.length>0&&e.trim()===e}function wb(e){if(!Array.isArray(e)||e.length<2)throw new TypeError("Expected at least two artifact ledgers.");let t=new Map;for(let r of e){if(r===null||typeof r!="object"||!pe(r.name)||t.has(r.name)||r.complete!==!0)throw new TypeError("Expected unique complete artifact ledgers.");if(!Array.isArray(r.identities))throw new TypeError("Invalid or duplicate artifact identity.");let o=new Set(r.identities);if(o.size!==r.identities.length||[...o].some(n=>!pe(n)))throw new TypeError("Invalid or duplicate artifact identity.");t.set(r.name,o)}if([...t.values()].every(r=>r.size===0))throw new TypeError("Empty inventories cannot establish artifact reconciliation.");return t}function Eb(e,t){if(!Array.isArray(e))throw new TypeError("Expected unique evidence-backed artifact exceptions.");let r=new Map;for(let o of e){if(o===null||typeof o!="object"||!pe(o.identity)||r.has(o.identity)||!pe(o.reason)||!pe(o.evidence))throw new TypeError("Expected unique evidence-backed artifact exceptions.");let n=o.missing_from;if(!Array.isArray(n)||n.length===0||n.length>=t.length||new Set(n).size!==n.length||[...n].some(s=>!t.includes(s)))throw new TypeError("Invalid artifact exception ledger signature.");r.set(o.identity,o)}return r}function $D(e,t=[]){let r=wb(e),o=[...r.keys()].sort(),n=Eb(t,o),s=[...new Set([...r.values()].flatMap(c=>[...c]))].sort(),i=[],a=new Set;for(let c of s){let l=o.filter(_=>!r.get(_).has(c));if(l.length===0)continue;let p=n.get(c),f=p!==void 0&&JSON.stringify([...p.missing_from].sort())===JSON.stringify(l);f&&a.add(c),i.push({identity:c,present_in:o.filter(_=>r.get(_).has(c)),missing_from:l,disposition:f?{reason:p.reason,evidence:p.evidence}:null})}let d=[...n.keys()].filter(c=>!a.has(c)).sort();return{schema:"pm-artifact-ledgers/1",ok:i.every(c=>c.disposition!==null)&&d.length===0,counts:Object.fromEntries(o.map(c=>[c,r.get(c).size])),findings:i,stale_exceptions:d}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="fca4e9bb-3a30-512e-9929-565ab6c11c54")}catch{}})();import{createHash as ho,createHmac as Ab,randomBytes as vb,timingSafeEqual as Ob}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="837ee381-0838-55d3-bcdf-7352fb76661d")}catch{}})();var T1="dev.unbrained.pm/progressive-tool-discovery",C1=Object.freeze({version:1,discoveryTool:"pm_discover",canonicalResult:"structuredContent.result",compatibilityText:"pointer"}),Pb=Object.freeze(["pm_discover","pm_next","pm_context","pm_search","pm_get"]),B=Object.freeze({lexical:.4,semantic:.2,graph:.1,permission:.15,freshness:.05,usage:.1}),Rb=Object.freeze(["profile_changed","tool_contract_changed","workspace_extension_changed","authorization_changed","ranking_signal_changed","cursor_integrity_key_rotated"]),go={core:0,standard:1,full:2,internal:3},yo=Object.freeze(["core","standard","full"]),Ib=new Set(["core","standard","full","custom"]),bo=new Set(te.map(({family:e})=>e)),Mb=vb(32);function xe(e,t){if(typeof e!="string")throw new b(`pm tool discovery ${t} must be a string of at most 4096 Unicode characters.`,64);let r=e[Symbol.iterator](),o=0;for(let n=r.next();!n.done;n=r.next())if(o+=1,o>4096)throw new b(`pm tool discovery ${t} must be a string of at most 4096 Unicode characters.`,64);return e}function To(e){if(!Number.isInteger(e)||Number(e)<1||Number(e)>100)throw new b("pm tool discovery limit must be from 1 through 100.",64);return Number(e)}function Co(e){if(e!=="unbounded"&&(!Number.isInteger(e)||Number(e)<128))throw new b("pm tool discovery outputBudget must be unbounded or an integer of at least 128.",64);return e==="unbounded"?e:Number(e)}function So(e){if(e!==void 0&&typeof e!="boolean")throw new b("pm tool discovery includeSchema must be a boolean.",64);return e===!0}function wo(e){if(e===null||typeof e!="object"||Array.isArray(e))throw new b("pm tool discovery options must be an object.",64)}function kb(e){if(!Array.isArray(e))throw new b("pm tool discovery candidates must be an array.",64);for(let[t,r]of e.entries()){if(r===null||typeof r!="object"||Array.isArray(r))throw new b(`pm tool discovery candidate ${t} must be an object.`,64);if(typeof r.name!="string"||r.name.trim().length===0)throw new b(`pm tool discovery candidate ${t} name must be a non-empty string.`,64);if(typeof r.description!="string"||r.description.trim().length===0)throw new b(`pm tool discovery candidate ${t} description must be a non-empty string.`,64);if(r.inputSchema===null||typeof r.inputSchema!="object"||Array.isArray(r.inputSchema))throw new b(`pm tool discovery candidate ${t} inputSchema must be an object.`,64);if(r.authorized!==void 0&&typeof r.authorized!="boolean")throw new b(`pm tool discovery candidate ${t} authorized must be a boolean.`,64)}}function S1(e){if(wo(e),e.family!==void 0&&(typeof e.family!="string"||!bo.has(e.family)))throw new b("pm tool discovery family must be a declared capability family.",64);if(e.tier!==void 0&&(typeof e.tier!="string"||!yo.includes(e.tier)))throw new b("pm tool discovery tier must be core, standard, or full.",64);return{...e.query!==void 0?{query:xe(e.query,"query")}:{},...e.family!==void 0?{family:e.family}:{},...e.tier!==void 0?{tier:e.tier}:{},...e.limit!==void 0?{limit:To(e.limit)}:{},...e.cursor!==void 0?{cursor:xe(e.cursor,"cursor")}:{},...e.includeSchema!==void 0?{includeSchema:So(e.includeSchema)}:{},...e.outputBudget!==void 0?{outputBudget:Co(e.outputBudget)}:{}}}function xb(e){return e===void 0||!Number.isFinite(e)?0:Math.min(1,Math.max(0,e))}function ue(e){return[...new Set(e.toLowerCase().match(/[a-z0-9]+/gu)??[])].sort()}function Nb(e,t){let r=ue(e);if(r.length===0)return 0;let o=new Set(ue(t)),n=r.filter(i=>o.has(i)).length,s=t.toLowerCase().includes(e.toLowerCase())?.25:0;return Math.min(1,n/r.length+s)}function Lb(e,t){let r=ue(e);if(r.length===0)return 0;let o=t.toLowerCase(),n=ue(t),s=r.filter(a=>n.some(d=>d.startsWith(a)||a.startsWith(d))).length,i=o.includes(e.toLowerCase())?.2:0;return Math.min(1,s/r.length+i)}function _o(e){return ho("sha256").update(JSON.stringify(e)).digest("hex").slice(0,24)}function Eo(e,t,r){return Ab("sha256",r).update(JSON.stringify({version:1,fingerprint:e,offset:t})).digest("base64url")}function Db(e,t,r){let o={version:1,offset:t,signature:Eo(e,t,r)};return Buffer.from(JSON.stringify(o),"utf8").toString("base64url")}function $b(e,t,r,o){if(e===void 0)return 0;try{let n=JSON.parse(Buffer.from(e,"base64url").toString("utf8"));if(n.version!==1||!Number.isInteger(n.offset)||(n.offset??-1)<0||Number(n.offset)>r||typeof n.signature!="string")throw new Error("cursor fields do not match the request");let s=Buffer.from(Eo(t,n.offset,o),"base64url"),i=Buffer.from(n.signature,"base64url");if(i.length!==s.length||!Ob(i,s))throw new Error("cursor signature does not match the request");return n.offset}catch(n){throw new b("Invalid or stale pm tool discovery cursor; restart discovery without cursor.",64,{reason:String(n)})}}function gt(e,t,r){return{value:xb(e),weight:t,available:r!=="unavailable",source:r}}function ke(e,t,r){return gt(e??t,r,e===void 0?"computed":"host")}function Fb(e,t,r){let o=Object.hasOwn(he,e.name)?he[e.name]:"help",n=Ve(o),s=`${e.name} ${e.description} ${o} ${n}`,i=Nb(t,s),a=new Set(ue(t)),d={lexical:gt(i,B.lexical,"computed"),semantic:ke(e.signals?.semantic,Lb(t,s),B.semantic),graph:ke(e.signals?.graph,a.has(n)||a.has(o)?1:0,B.graph),permission:gt(1,B.permission,"authorization"),freshness:ke(e.signals?.freshness,1,B.freshness),usage:ke(e.signals?.usage,Pb.includes(e.name)?1:0,B.usage)},c=Object.values(d).reduce((l,p)=>l+p.value*p.weight,0);return{name:e.name,description:e.description,command:o,tier:Ke(o),family:n,score:Number(c.toFixed(6)),signals:d,...r?{input_schema:structuredClone(e.inputSchema)}:{}}}function Gb(e){if(e.cursorIntegrityKey!==void 0&&(!(e.cursorIntegrityKey instanceof Uint8Array)||e.cursorIntegrityKey.byteLength<32))throw new b("pm tool discovery cursorIntegrityKey must contain at least 32 bytes.",64);if(e.tier!==void 0&&(typeof e.tier!="string"||!yo.includes(e.tier)))throw new b("pm tool discovery tier must be core, standard, or full.",64);if(e.family!==void 0&&(typeof e.family!="string"||!bo.has(e.family)))throw new b("pm tool discovery family must be a declared capability family.",64);if(e.profile!==void 0&&(typeof e.profile!="string"||!Ib.has(e.profile)))throw new b("pm tool discovery profile must be core, standard, full, or custom.",64)}function Ub(e){let t=xe(e.query===void 0?"":e.query,"query").trim().replace(/\s+/gu," ");xe(e.cursor===void 0?"":e.cursor,"cursor");let r=To(e.limit===void 0?10:e.limit),o=Co(e.outputBudget===void 0?1200:e.outputBudget);return Gb(e),{query:t,includeSchema:So(e.includeSchema),limit:r,budget:o,maximumTier:go[e.tier??"full"],profile:e.profile===void 0?"core":e.profile}}function Ao(e,t,r){let o=r??e.tools.reduce((i,a,d)=>i+(d===0?0:1)+Buffer.byteLength(JSON.stringify(a),"utf8"),0),n={...e,tools:[]},s=0;for(let i=0;i<4;i+=1){let a=Buffer.byteLength(JSON.stringify({...n,token_cost:{estimated_tokens:s,budget:t,within_budget:!0}}),"utf8"),d=Math.ceil((a+o)/4);if(d===s)break;s=d}return s}function jb(e,t,r){return e.filter(o=>o.authorized!==!1).map(o=>Fb(o,r.query,r.includeSchema)).filter(o=>o.tier!=="internal"&&go[o.tier]<=r.maximumTier&&(t.family===void 0||o.family===t.family)).sort((o,n)=>n.score-o.score||(o.name<n.name?-1:o.name>n.name?1:0))}function Bb(e,t,r){if(t==="unbounded")return[...e];let o=[],n=0;for(let[s,i]of e.entries()){let a=n+(s===0?0:1)+Buffer.byteLength(JSON.stringify(i),"utf8");if(Ao(r(s+1),t,a)>t)break;o.push(i),n=a}return o}function w1(e,t={}){kb(e),wo(t);let r=Ub(t),o=t.cursorIntegrityKey??Mb,n=jb(e,t,r),s=_o({query:r.query,family:t.family??null,tier:t.tier??"full",includeSchema:r.includeSchema,profile:r.profile,ranked:n}),i=$b(t.cursor,s,n.length,o),a=n.slice(i,i+r.limit),d=[];r.includeSchema||d.push({name:"input_schema",reason:"compact_projection",restore_with:"Set includeSchema=true."}),i+r.limit<n.length&&d.push({name:"tools",reason:"limit",restore_with:"Continue with next_cursor or increase limit."});let c={result_type:"pm_tool_discovery",contract_version:1,query:r.query,profile:r.profile,total:n.length,ranking_policy:{version:1,formula:"weighted_sum_then_name",weights:B},cache:{key:_o({fingerprint:s,cursorIntegrityKey:ho("sha256").update(o).digest("hex"),limit:r.limit,offset:i,budget:r.budget}),ttl_ms:3e4,scope:"private",invalidates_on:Rb}},l=(g,T=g.length)=>{let S=i+T,q=S<n.length,P=[...d];return T<a.length&&P.push({name:"tools",reason:"token_budget",restore_with:"Continue with next_cursor or increase outputBudget."}),{...c,tools:[...g],returned:T,has_more:q,...q?{next_cursor:Db(s,S,o)}:{},omission_receipt:{has_omissions:P.length>0,omitted:P}}},p=g=>{let T=l(g),S=Ao(T,r.budget);return{...T,token_cost:{estimated_tokens:S,budget:r.budget,within_budget:r.budget==="unbounded"||S<=r.budget}}},f=Bb(a,r.budget,g=>l([],g)),_=p(f);if(a.length>0&&f.length===0){let g=p([a[0]]).token_cost.estimated_tokens;throw new b(`pm tool discovery outputBudget is too small to return a tool; increase it to at least ${g}.`,64,{required:String(g)})}if(r.budget!=="unbounded"&&_.token_cost.estimated_tokens>r.budget)throw new b(`pm tool discovery outputBudget is too small; at least ${_.token_cost.estimated_tokens} estimated tokens are required for this page.`,64,{required:String(_.token_cost.estimated_tokens)});return _}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="d007edcb-46f0-5546-b804-27d86afe23e7")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="f8af03b4-701d-578d-ac85-fd3bf30dadff")}catch{}})();export{AO as ACTIONABILITY_ORDERING_KINDS,td as ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS,Ea as ACTIVITY_FLAG_CONTRACTS,hi as AGENT_PROVENANCE_DIMENSIONS,ds as AGGREGATE_FLAG_CONTRACTS,Ws as APPEND_FLAG_CONTRACTS,lI as ASSURANCE_ACTIONS,pI as ASSURANCE_DECLARATION_KINDS,wP as ASSURANCE_DOCUMENT_VERSION,fa as ASSURANCE_FLAG_CONTRACTS,EP as ASSURANCE_GATE_TRIGGERS,AP as ASSURANCE_MEASUREMENT_SOURCE_KINDS,hR as ASSURANCE_PRESET_IDS,bP as AssuranceEvaluationRefusalError,yP as AssuranceMutationRefusalError,TP as AssuranceSourceResolutionError,ri as BASELINE_ITEM_FORMAT_VERSION,Ay as BOUNDARY_FIXTURE_CAPTURE_SOURCES,QS as BRIEF_LIST_FIELDS,yi as BUILTIN_AGENT_PROVENANCE_ADAPTERS,Y as BUILTIN_CORPUS_SHAPES,gi as BUILTIN_HARNESS_SIGNAL_DESCRIPTORS,jo as BUILTIN_ITEM_TYPE_VALUES,zt as BUILTIN_PROFILES,qb as BUILTIN_RELATIONSHIP_KINDS,Za as CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS,wa as CALENDAR_FLAG_CONTRACTS,Ys as CLAIM_FLAG_CONTRACTS,Zd as CLOSE_ACTION_OPTION_KEYS,Vs as CLOSE_FLAG_CONTRACTS,Ks as CLOSE_MANY_FLAG_CONTRACTS,ta as CLOSE_TASK_FLAG_CONTRACTS,cs as COMMENTS_FLAG_CONTRACTS,mT as COMMON_MUTATION_COMMAND_OPTION_KEYS,Da as COMPLETION_FLAG_CONTRACTS,Ko as CONFIDENCE_TEXT_VALUES,Es as CONFIG_FLAG_CONTRACTS,Qa as CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS,WI as CONTEXT_EVALUATION_METRIC_NAMES,va as CONTEXT_FLAG_CONTRACTS,jt as CONTEXT_OUTPUT_VALUES,QI as CONTEXT_PACKING_PROFILES,UI as CONTEXT_RECENCY_EPOCH,zI as CONTEXT_RELEVANCE_SERVICE,BI as CONTEXT_RELEVANCE_SIGNAL_NAMES,rM as CONTEXT_SIGNAL_SET_VERSION,tM as CONTEXT_SIGNAL_STORE_FORMAT_VERSION,oM as CONTEXT_SIGNAL_STORE_WARNING_DETAILS,PS as CONTEXT_USAGE_LIMITS,La as CONTRACTS_FLAG_CONTRACTS,ba as COPY_FLAG_CONTRACTS,Ad as CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,Od as CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,vd as CREATE_COMMANDER_STRING_OPTION_CONTRACTS,Qb as CREATE_DIRECT_CLOSE_REASON_DEFAULT,_a as CREATE_FLAG_CONTRACTS,Iw as CURRENT_HISTORY_HASH_ALGORITHM,Yw as CURRENT_HISTORY_ITEM_HASH_VERSION,Jw as CURRENT_HISTORY_RECORD_HASH_VERSION,oi as CURRENT_ITEM_FORMAT_VERSION,aM as ContextSignalStore,RS as ContextUsageValidationError,xI as DEFAULT_AUTHOR_IDENTITY_VOCABULARY,EM as DEFAULT_CHILD_SAMPLE_LIMIT,ZS as DEFAULT_COMPACT_LIST_FIELDS,ZE as DEFAULT_DERIVED_INDEX_MINIMUM_ITEMS,Nm as DEFAULT_EVAL_QUERIES_RELATIVE_PATH,uR as DEFAULT_RELATIONSHIP_CONTEXT_TOKEN_BUDGET,AI as DEFAULT_TERMINAL_TRANSITION_POLICY,pM as DEFAULT_WORKSPACE_MEMORY_MINIMUM_ITEMS,hO as DEFECT_ESCAPE_CLASSES,gO as DEFECT_GATE_EVIDENCE_DISPOSITIONS,Js as DELETE_FLAG_CONTRACTS,zo as DEPENDENCY_KIND_VALUES,Ra as DEPS_FLAG_CONTRACTS,ms as DOCS_FLAG_CONTRACTS,pa as DUPLICATES_FLAG_CONTRACTS,BR as DURABLE_MERGE_RECEIPT_INTRODUCED_AT,CO as DefectRecurrencePolicyParseError,Ma as EVAL_FLAG_CONTRACTS,Om as EVAL_METRIC_NAMES,Mm as EVAL_QUERY_SET_CONTRACT,km as EVAL_QUERY_SET_EXAMPLE,Im as EVAL_QUERY_SET_SCHEMA_ID,Aa as EVENTS_FLAG_CONTRACTS,oa as EVENT_FLAG_CONTRACTS,Lo as EXECUTABLE_COMMAND_ALIASES,me as EXIT_CODE,Ls as EXTENSION_ACTIVATE_FLAG_CONTRACTS,Ns as EXTENSION_ADOPT_ALL_FLAG_CONTRACTS,Bs as EXTENSION_ADOPT_FLAG_CONTRACTS,t0 as EXTENSION_CAPABILITIES,Jb as EXTENSION_CAPABILITY_CONTRACT,Yb as EXTENSION_CAPABILITY_CONTRACT_VERSION,Xb as EXTENSION_CAPABILITY_LEGACY_ALIASES,wn as EXTENSION_CAPABILITY_REGISTRATION_SURFACES,js as EXTENSION_CATALOG_FLAG_CONTRACTS,Ds as EXTENSION_DEACTIVATE_FLAG_CONTRACTS,xs as EXTENSION_DESCRIBE_FLAG_CONTRACTS,Us as EXTENSION_DOCTOR_FLAG_CONTRACTS,ks as EXTENSION_EXPLORE_FLAG_CONTRACTS,As as EXTENSION_FLAG_CONTRACTS,Os as EXTENSION_INIT_FLAG_CONTRACTS,Is as EXTENSION_INSTALL_FLAG_CONTRACTS,Fs as EXTENSION_MANAGE_FLAG_CONTRACTS,$s as EXTENSION_MIGRATE_FLAG_CONTRACTS,r0 as EXTENSION_POLICY_MODES,o0 as EXTENSION_POLICY_SURFACES,Gs as EXTENSION_RELOAD_FLAG_CONTRACTS,i0 as EXTENSION_SANDBOX_PROFILES,vs as EXTENSION_SCOPE_FLAG_CONTRACTS,n0 as EXTENSION_TRUST_MODES,Ms as EXTENSION_UNINSTALL_FLAG_CONTRACTS,BO as EXTERNAL_DEPENDENCY_RESOLUTION_STATUSES,UO as EXTERNAL_DEPENDENCY_SOURCE_KIND,jO as EXTERNAL_DEPENDENCY_SOURCE_KIND_ALIAS,us as FILES_FLAG_CONTRACTS,Ta as FOCUS_FLAG_CONTRACTS,ca as GC_FLAG_CONTRACTS,rw as GET_DEPTH_VALUES,Oa as GET_FLAG_CONTRACTS,ss as GLOBAL_FLAG_CONTRACTS,bp as GRAPH_DURABLE_CACHE_MIN_ITEMS,yp as GRAPH_DURABLE_CACHE_VERSION,Ia as GRAPH_FLAG_CONTRACTS,TA as GRAPH_QUERY_DEFAULTS,Ge as GRAPH_SUBCOMMAND_VALUES,Pa as GUIDE_FLAG_CONTRACTS,ua as HEALTH_FLAG_CONTRACTS,ys as HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS,dR as HISTORY_AUTHOR_ATTRIBUTION_BASELINE,hI as HISTORY_COMPACT_BULK_DEFAULT_MIN_ENTRIES,bs as HISTORY_COMPACT_FLAG_CONTRACTS,ki as HISTORY_EVENT_CLASSIFICATION_VERSION,fs as HISTORY_FLAG_CONTRACTS,Pw as HISTORY_HASH_ALGORITHMS,jE as HISTORY_ITEM_HASH_VERSION_3_INTRODUCED_IN,hs as HISTORY_REDACT_FLAG_CONTRACTS,gs as HISTORY_REPAIR_FLAG_CONTRACTS,Xc as INIT_AGENT_GUIDANCE_MODE_VALUES,ws as INIT_FLAG_CONTRACTS,qs as INSTALL_FLAG_CONTRACTS,Vo as ISSUE_SEVERITY_VALUES,ga as ITEM_COMPLETE_FLAG_CONTRACTS,xR as ITEM_LATEST_TIMESTAMP_FIELDS,Zb as ITEM_METADATA_KEY_ORDER,ha as ITEM_MUTATE_FLAG_CONTRACTS,ya as ITEM_REOPEN_FLAG_CONTRACTS,vR as ITEM_SCALAR_MISSING_VALUE,Bo as ITEM_TYPE_VALUES,kR as ITEM_UNION_COLLECTION_FIELDS,sM as JsonFileContextSignalStoreAdapter,ps as LEARNINGS_FLAG_CONTRACTS,Rw as LEGACY_HISTORY_HASH_ALGORITHM,nu as LINKED_TEST_ENV_NAME_PATTERN,iu as LINKED_TEST_PM_CONTEXT_MODE_VALUES,ou as LINKED_TEST_PROTECTED_ENV_KEYS,su as LINKED_TEST_WORKSPACE_CONTEXT_MODE_VALUES,Xa as LIST_COMMANDER_STRING_OPTION_CONTRACTS,ew as LIST_COMMAND_DEFAULT_PROJECTIONS,a0 as LIST_FILTER_EXTENSION_FLAG_DEFINITIONS,as as LIST_FILTER_FLAG_CONTRACTS,XO as LIST_SORT_FIELDS,JO as LIST_SORT_ORDER_VALUES,xi as MAINTENANCE_HISTORY_OPERATIONS,wM as MAX_CHILD_PROJECTION_ITEMS,ET as MAX_WORKFLOW_POLICIES,AT as MAX_WORKFLOW_POLICY_TERMS,ra as MEET_FLAG_CONTRACTS,zM as MERGE_DRIVER_ARTIFACT_VALUES,_s as MERGE_FLAG_CONTRACTS,Ue as MERGE_SUBCOMMAND_VALUES,KM as MUTATION_EVENT_WIRE_BUDGET,se as MemoryRelationshipGraphAdapter,ed as NEXT_COMMANDER_STRING_OPTION_CONTRACTS,xa as NEXT_FLAG_CONTRACTS,Ju as NEXT_OUTPUT_VALUES,ls as NOTES_FLAG_CONTRACTS,Ps as PACKAGE_FLAG_CONTRACTS,Rs as PACKAGE_INIT_FLAG_CONTRACTS,ea as PAUSE_TASK_FLAG_CONTRACTS,Jd as PLAN_CREATE_METADATA_PARAMETER_KEYS,Ss as PLAN_FLAG_CONTRACTS,sm as PLAN_SHOW_DEPTH_VALUES,Ye as PLAN_SUBCOMMANDS,am as PLAN_TEMPLATE_NAMES,Dy as PM_AGENT_TASK_ACCOUNTING_MODES,ut as PM_AGENT_TASK_TRANSCRIPT_VERSION,Mo as PM_BULK_LIFECYCLE_COMMAND_ALIASES,Ui as PM_CLI_EXPECTED_ERROR_NAME,vA as PM_CLI_GRAMMAR_CONTRACT,CA as PM_CLI_GRAMMAR_NOUNS,pn as PM_CLI_ONLY_TOOL_ACTION_WAIVERS,SA as PM_CLI_SHARED_VERBS,No as PM_COMMAND_ALIAS_CONTRACTS,te as PM_COMMAND_CAPABILITY_CONTRACTS,vt as PM_COMMAND_DESTINATION_CONTRACTS,mP as PM_COMMAND_EXIT_CONTRACTS,uP as PM_COMMAND_EXIT_OUTCOME_CONTRACTS,jn as PM_COMMAND_OUTPUT_BUDGET_CONTRACTS,cP as PM_COMMAND_OUTPUT_ENVELOPE_CONTRACTS,qe as PM_COMMAND_POSITIONAL_CONTRACTS,bc as PM_COMMAND_VISIBILITY_CONTRACTS,rR as PM_COMPLETE_LIST_FINDING_CODES,cw as PM_CONTEXT_INTENTS_FILE,GS as PM_CONTEXT_INTENT_CONTRACTS,Io as PM_CONTEXT_OPS_COMMAND_ALIASES,an as PM_CORE_COMMAND_NAMES,G as PM_CORPUS_SHAPE_SCHEMA,mn as PM_DEPRECATED_TOOL_ACTIONS,Dn as PM_DIAGNOSTIC_DEGRADATION_STEPS,$n as PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS,Ln as PM_DIAGNOSTIC_OUTPUT_CLASSES,fn as PM_DISCOVERABLE_TOOL_ACTIONS,Kr as PM_EPISODE_SCHEMA,aP as PM_ERROR_CODE_CATALOG,oP as PM_ERROR_CODE_EXIT_CLASS_CONTRACTS,Qr as PM_EXACT_COVERAGE_METRICS,en as PM_EXTENSION_CAPABILITY_CONTRACTS,dn as PM_EXTENSION_PACKAGE_ACTION_SUBCOMMANDS,rn as PM_EXTENSION_POLICY_MODE_CONTRACTS,sn as PM_EXTENSION_POLICY_SURFACE_CONTRACTS,nn as PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS,tn as PM_EXTENSION_SERVICE_NAME_CONTRACTS,on as PM_EXTENSION_TRUST_MODE_CONTRACTS,KP as PM_GITATTRIBUTES_END,VP as PM_GITATTRIBUTES_START,YP as PM_GITATTRIBUTES_V2_END,WP as PM_GITATTRIBUTES_V2_START,Oc as PM_GITIGNORE_END,vc as PM_GITIGNORE_START,TI as PM_HISTORY_ATTESTATION_CONTRACT,Ro as PM_HISTORY_COMMAND_ALIASES,Sw as PM_HISTORY_OPERATION_ALIASES,Ew as PM_HISTORY_OPERATION_CONTRACT,ww as PM_HISTORY_OPERATION_PATTERNS,ln as PM_ITEM_ACTION_SUBCOMMANDS,Tw as PM_ITEM_HISTORY_OPERATIONS,it as PM_MCP_APPS_EXTENSION,Ir as PM_MCP_APPS_SERVER_CAPABILITY,Ae as PM_MCP_APPS_SPEC_VERSION,xr as PM_MCP_APP_CONTRACTS,kr as PM_MCP_APP_MIME_TYPE,Pb as PM_MCP_ENTRY_TOOL_NAMES,m as PM_MCP_ERROR_CODES,gx as PM_MCP_HTTP_PROTOCOL_VERSION,Kh as PM_MCP_INPUT_REQUEST_METHODS,rr as PM_MCP_LEGACY_PROTOCOL_VERSIONS,tr as PM_MCP_LOG_LEVELS,E as PM_MCP_META_KEYS,T1 as PM_MCP_PROGRESSIVE_DISCOVERY_EXTENSION,C1 as PM_MCP_PROGRESSIVE_DISCOVERY_SERVER_CAPABILITY,Ec as PM_MCP_PROMPT_CONTRACTS,H as PM_MCP_PROTOCOL_VERSION,wc as PM_MCP_RESOURCE_CONTRACTS,at as PM_MCP_SKILLS_DRAFT_REVISION,Nr as PM_MCP_SKILLS_EXTENSION,Qg as PM_MCP_SKILLS_SERVER_CAPABILITY,I as PM_MCP_SKILL_LIMITS,we as PM_MCP_SUBSCRIPTION_ID_META_KEY,re as PM_MCP_SUPPORTED_PROTOCOL_VERSIONS,cx as PM_MCP_TASKS_EXTENSION,ng as PM_MCP_TASK_STATUSES,he as PM_MCP_TOOL_COMMAND_CONTRACTS,vC as PM_MODE_PAIRED_OUTPUT_PROJECTION_CONTRACTS,ud as PM_MUTATION_ACTION_CONTRACTS,Ne as PM_NAMESPACED_COMMAND_ALIASES,Hr as PM_OBSERVATION_SCHEMA,Nn as PM_OUTPUT_BUDGET_CLASSES,xn as PM_OUTPUT_DEGRADATION_STEPS,kt as PM_OUTPUT_ENVELOPE_KINDS,$t as PM_PACKAGE_CONVENTIONAL_RESOURCE_ROOTS,cn as PM_PACKAGE_ONLY_ACTION_SUBCOMMANDS,Dt as PM_PACKAGE_RESOURCE_KINDS,Be as PM_POSITIONAL_ACTION_CONTRACTS,ic as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA,oc as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION,tS as PM_READ_OUTPUT_COMPOSITION_OPTION_FLAGS,mS as PM_READ_OUTPUT_CONTINUATION_FINGERPRINT_POLICIES,QC as PM_READ_OUTPUT_DIMENSIONS,eS as PM_READ_OUTPUT_OPTION_FLAGS,WC as PM_READ_OUTPUT_SESSION_MAX_SEEN_ITEM_IDS,KC as PM_READ_OUTPUT_SESSION_MIN_TOKENS,NT as PM_READ_OUTPUT_SURFACES,rS as PM_READ_OUTPUT_SURFACE_CONTRACTS,AC as PM_READ_ROW_CONTRACTS,EC as PM_READ_ROW_JQ_SELECTOR,lL as PM_RECOVERY_REFERENCE_FIELDS,ce as PM_RECOVERY_REFERENCE_KINDS,sb as PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE,lo as PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE_V2,gL as PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE,co as PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE_V2,ko as PM_RELOCATED_COMMAND_ALIASES,sd as PM_REPRODUCIBLE_PROCESS_ENV,fP as PM_SUCCESS_EXIT_CODES,un as PM_TOOL_ACTIONS,Qd as PM_TOOL_ACTION_PARAMETER_CONTRACTS,nc as PM_TOOL_PARAMETERS_SCHEMA,rc as PM_TOOL_PARAMETERS_SCHEMA_MAJOR,tc as PM_TOOL_PARAMETERS_SCHEMA_VERSION,Yd as PM_TOOL_RESERVED_CUSTOM_FIELD_PROPERTIES,Vr as PM_VERDICT_SCHEMA,Cw as PM_WORKSPACE_HISTORY_OPERATIONS,qr as PM_WORKSPACE_RECIPE_SCHEMA,Cs as PROFILE_FLAG_CONTRACTS,Jt as PROFILE_LINT_CODES,Xt as PROFILE_LINT_DIMENSIONS,qt as PROFILE_NAMES,Xe as PROFILE_SUBCOMMANDS,b as PmCliError,ge as PmClient,oR as PmCompleteListValidationError,y as PmMcpAuthorizationError,or as PmMcpInputRequiredError,Ar as PmMcpIssuerCredentialStore,u as PmMcpProtocolError,nr as PmMcpRequestStateReplayGuard,Ur as PmMcpSkillRegistry,_r as PmMcpSubscriptionRegistry,ot as PmMcpTaskStore,AS as QUERY_CURSOR_CONTRACT,Hs as REINDEX_FLAG_CONTRACTS,Pv as REINDEX_LOCK_ID,pt as RELATIONSHIP_GRAPH_SNAPSHOT_VERSION,Zs as RELEASE_FLAG_CONTRACTS,na as REMIND_FLAG_CONTRACTS,At as RESERVED_ITEM_FIELD_NAMES,Xs as RESTORE_FLAG_CONTRACTS,Ho as RISK_VALUES,pA as RelationshipEventLog,uA as RelationshipEventStore,z as RelationshipGraph,De as RelationshipKindRegistry,Ts as SCHEMA_FLAG_CONTRACTS,Ja as SEARCH_COMMANDER_STRING_OPTION_CONTRACTS,d0 as SEARCH_EXTENSION_FLAG_DEFINITIONS,Na as SEARCH_FLAG_CONTRACTS,Eu as SEMANTIC_ATTRIBUTION_LIMITS,tT as SETTINGS_DEFAULTS,Gm as SNAPSHOT_SCHEMA,qP as SOURCE_CONTEXT_ACCESS_ENV,zP as SOURCE_CONTEXT_WRITE_OVERRIDE_ENV,Qs as START_TASK_FLAG_CONTRACTS,la as STATS_FLAG_CONTRACTS,qo as STATUS_VALUES,is as SUBCOMMAND_GLOBAL_FLAG_CONTRACTS,Ni as SUBSTANTIVE_HISTORY_OPERATIONS,Xw as SUPPORTED_HISTORY_ITEM_HASH_VERSIONS,Zw as SUPPORTED_HISTORY_RECORD_HASH_VERSIONS,oT as SUPPRESS_HOST_OUTPUT_MARKER,aa as TELEMETRY_FLAG_CONTRACTS,ff as TELEMETRY_SUBCOMMANDS,sa as TEST_ALL_FLAG_CONTRACTS,ia as TEST_FLAG_CONTRACTS,da as TEST_RUNS_FLAG_CONTRACTS,cf as TEST_RUN_MEASUREMENT_LIMIT,Hd as TOOL_ACTIVITY_OPTION_CONTRACTS,xd as TOOL_AGGREGATE_OPTION_CONTRACTS,jd as TOOL_BULK_MUTATION_FILTER_OPTION_CONTRACT_SOURCE,zd as TOOL_CALENDAR_OPTION_CONTRACTS,qd as TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS,Vd as TOOL_CONTEXT_OPTION_CONTRACTS,Fd as TOOL_CREATE_OPTION_CONTRACTS,$d as TOOL_CREATE_OPTION_CONTRACT_SOURCE,Kd as TOOL_DEPS_OPTION_CONTRACTS,Wd as TOOL_GRAPH_OPTION_CONTRACTS,kd as TOOL_LIST_FILTER_OPTION_CONTRACTS,Nd as TOOL_SEARCH_FILTER_OPTION_CONTRACTS,Dd as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS,Ld as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACT_SOURCE,Bd as TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS,Ud as TOOL_UPDATE_OPTION_CONTRACTS,Gd as TOOL_UPDATE_OPTION_CONTRACT_SOURCE,eT as TYPE_TO_FOLDER,GA as UNKNOWN_SUBCOMMAND_COMPATIBILITY_CODES,Pd as UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,Id as UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,Rd as UPDATE_COMMANDER_STRING_OPTION_CONTRACTS,Ca as UPDATE_FLAG_CONTRACTS,Sa as UPDATE_MANY_FLAG_CONTRACTS,zs as UPGRADE_FLAG_CONTRACTS,ma as VALIDATE_FLAG_CONTRACTS,wT as WORKFLOW_POLICY_ACTIONS,ZP as WORKFLOW_POLICY_DOCUMENT_SCHEMA,JP as WORKFLOW_POLICY_SCHEMA,ka as WORKSPACE_FLAG_CONTRACTS,gE as WORKSPACE_HISTORY_ID,Um as WORKSPACE_SNAPSHOT_ACTIONS,Sl as WorkspaceGraphCache,gA as WorkspaceTransactionInterruptedError,Kp as _testOnly,SM as _testOnlyAggregateCommand,Tl as _testOnlyConfigCommand,PM as _testOnlyGetCommand,xp as _testOnlyHealthCommand,el as _testOnlyInit,Jc as _testOnlyInitAgentGuidance,$0 as _testOnlyItemTransaction,JM as _testOnlyMutationEvents,bM as _testOnlyNextCommand,qM as _testOnlySearchCommand,fR as _testOnlySimilarity,pm as _testOnlyTemplates,zp as _testOnlyValidateCommand,e0 as _testOnlyWorkspacePosition,TR as acceptAssuranceProposals,Bp as acknowledgeLinkedTests,gl as acknowledgeUnknownAuthorHistoryEvents,hl as acknowledgeUnknownAuthorHistoryEventsFromTransport,QE as acquireItemMetadataDerivedIndexLock,je as acquireLock,Yn as acquireLockLease,Q0 as activateExtensionForTest,QT as activateExtensions,_i as agentSessionEnvironment,__ as aggregate,Jm as analyzeAgentProvenanceDescriptorCoverage,bO as analyzeDefectChangeRisk,cI as analyzeDefectRecurrenceCoverage,Hl as analyzeDuplicateItems,fA as analyzeGraphImpact,cc as analyzeHierarchyIntegrity,_A as analyzeKnowledgeGraph,hP as analyzePmCommandExitConformance,_n as analyzePmToolActionParity,XR as analyzeReconciliationDiscard,mA as analyzeRelationshipExecution,lp as analyzeRelationshipSchedule,Gh as analyzeSdkActionCoverage,It as analyzeSdkCliParameterCompleteness,O_ as append,$i as appendHistoryEntry,CE as appendWorkspaceAuditEvent,TE as appendWorkspaceHistoryChange,zA as applyAcceptanceCriteriaMutations,yR as applyAssurancePreset,qa as applyBootstrapPagerPolicy,nI as applyClosureTimestampFix,zS as applyContextIntentProjection,Xu as applyContextTagProjection,ZO as applyFilterValueEcho,kE as applyHistoryPatch,id as applyInvocationAuthorOverride,Ml as applyPathMigrations,lS as applyReadOutputDimensions,sS as applyReadOutputIncludeModes,XC as applyReadOutputSessionReferences,FE as applyRegisteredItemFieldDefaultsAndValidation,Ll as applyStandaloneNote,es as applyStoredExtensionMigrationState,VA as applyTagRemovals,RI as applyTerminalOrderingPolicy,Dl as artifactKey,uT as asRecordClone,pT as asRecordOrNull,He as assembleWorkspaceRelationshipGraph,aR as assertCompleteListResult,xk as assertExtensionBlueprint,kk as assertExtensionCapabilityUsage,fk as assertExtensionDeactivated,Dk as assertExtensionManifestCompatible,Lk as assertExtensionManifestMatchesBlueprint,$k as assertExtensionPreflight,uc as assertHierarchyMutationAllowed,gI as assertHistoryCompactTarget,ZR as assertHistoryRepairTarget,Qn as assertInitializedTracker,kl as assertLinkedArtifactMutationIsUnambiguous,Uk as assertMcpClientCapabilities,Gk as assertMcpProtocolHeader,Ly as assertMemoryRelationshipGraphAdapterConformance,YA as assertNoUnknownCsvKeys,ru as assertNonHierarchyCardinalityMutationAllowed,_k as assertPackageManifest,mv as assertParentReferenceIsNotSelf,Kx as assertPmMcpSkillsCapability,Nk as assertProjectProfile,WE as assertProjectRuntimeCompatibility,HE as assertProjectRuntimeFormatGuard,OC as assertProjectionModeChoice,Zn as assertReadableTrackerRoot,hk as assertRegisteredCommandContract,vk as assertRegisteredCommandOverride,Sk as assertRegisteredExporter,gk as assertRegisteredFlags,yk as assertRegisteredHook,Ck as assertRegisteredImporter,wk as assertRegisteredItemField,Ek as assertRegisteredItemType,Mk as assertRegisteredMigration,Ok as assertRegisteredParserOverride,Pk as assertRegisteredPreflightOverride,Ak as assertRegisteredProfile,Rk as assertRegisteredRendererOverride,bk as assertRegisteredSearchProvider,Ik as assertRegisteredServiceOverride,Tk as assertRegisteredVectorStoreAdapter,Kb as assertRelationshipEdgeAllowed,ro as assertRelationshipGraphAdapterConformance,NA as assertSchemaPreviewSupported,gf as assertTestMeasurementRun,vP as assuranceAssertionUpdateIsLoosening,KS as attachContextIntentReceipt,IS as attachContextUsageServingReceipt,Fp as attachLinkedTestMutationProvenance,$p as attachLinkedTestProvenance,Ze as attachMcpServerInfo,xC as attachOutputOmissionReceipt,YS as attachOutputTokenAccounting,WS as attachReadOutputContracts,JC as attachReadOutputSessionReceipt,Nc as auditMergeAttributeFence,XP as auditMergeDriverConfiguration,hp as auditWorkspaceRelationshipGraph,kx as authorizeMcpHttpRequest,mi as boundAgentEpisodeIdentity,BC as boundReadOutputRows,Vu as buildChildrenByParent,$M as buildCompactSearchFilterSummary,QO as buildContentFilterEcho,iM as buildContextSignalSnapshot,yy as buildCorpusShapeItemPlan,yO as buildDefectRecurrenceIndex,zc as buildExtensionDescribeResult,Vc as buildExtensionInstallPlan,eP as buildGovernanceMissingFilterEcho,Cv as buildInvalidTypeError,AM as buildItemChildrenRollup,L0 as buildItemCompletionMutations,qI as buildItemContextRelevanceCandidates,iA as buildItemNotFoundError,OM as buildItemSchedule,iI as buildLinkedFileRepairReport,wx as buildMcpAuthorizationDiscoveryUrls,qh as buildMcpCompleteResult,Bk as buildMcpDiscoverResult,Px as buildMcpDynamicRegistrationMetadata,_x as buildMcpHttpRequestHeaders,Xk as buildMcpInputRequiredResult,Sx as buildMcpProtectedResourceMetadata,kc as buildMergeAttributePatterns,ec as buildPmActionToolInputSchema,TL as buildPmRefusalClosureCensus,mR as buildRelationshipContext,kv as buildSearchCorpus,Nv as buildSemanticCorpusInput,tI as buildStatusRoleWarnings,Jn as buildTrackerInitializationRecovery,Gv as buildVectorizationEmbeddingIdentity,Uv as buildVectorizationEmbeddingMetadata,FM as buildVerboseSearchFilters,QP as buildWorkflowCompletenessCheck,uM as buildWorkspaceMemorySnapshot,ui as canonicalDocument,fT as canonicalizeCommandOptionKey,y0 as canonicalizeCommandSuggestions,jI as canonicalizeContextRecencyCoordinate,zb as canonicalizeRelationshipKind,pL as censusPmRecoveryReferenceProducers,sR as certifyCompleteListResult,Y0 as checkExtensionManifestCompatibility,lh as claim,ph as claimNext,cR as classifyHistoryAuthorEvent,Li as classifyHistoryEvent,WR as classifyHistoryMergeReceiptReferences,GT as classifyHostEnvironmentFault,UM as classifyImplicitSemanticFallbackReason,si as classifyItemFormatVersion,bf as classifyLinkedTestCommandSafety,Tf as classifyLinkedTestFailure,hC as clearActiveExtensionHooks,Ep as clearDurableGraphCache,Hw as clearFocusedItem,Of as clearWorkspaceContractsCache,ch as close,Xp as closeItem,bh as closeTask,Va as coalesceRepeatedListFlags,vO as collectBlockedByIds,PO as collectBlockedByIdsFromCorpus,kS as collectContextUsageDeliveredItemIds,hc as collectDanglingDependencyReferences,IO as collectDependencyBlockedIds,fc as collectDuplicateDependencyRows,_p as collectDuplicateRelationshipEdgeGroups,GM as collectErrorCauseCodes,dc as collectHierarchyRelations,Cr as collectMcpHeaderAnnotations,gc as collectMissingDependencyTargetIds,tu as collectNewOrderingCycleWarnings,up as collectOrderingCycles,_c as collectOrderingStorageContradictions,uw as collectPackageContextIntentContracts,Gt as collectPackageExtensionDirectories,DE as collectRegisteredItemFieldNames,$w as collectRuntimeCreateFieldValues,Sv as collectRuntimeFilterValues,Fw as collectRuntimeUpdateFieldValues,ju as collectSubtreeIds,En as collectUsedExtensionCapabilities,_T as commandOptionFlagLabel,y_ as comments,Jf as commitImportedItem,D0 as commitItemCompletion,N0 as commitItemMutations,bA as commitWorkspaceTransaction,ns as compactFlagAliasContracts,Bu as compareCriticalItems,BE as comparePmDateVersions,hA as compareRelationshipSnapshots,vS as compareTimestampStrings,FI as compileHistoryProvenanceMatcher,BS as composeContextIntentContracts,B0 as composeExtension,W0 as composeExtensionPackage,kO as computeActionabilityReport,dv as computeHistoryDiff,dp as computeRelationshipCentrality,ap as computeRelationshipDominators,Cl as computeWorkspaceGraphFingerprint,R_ as config,_C as consumeAfterCommandAffectedItems,c_ as context,VS as contextIntentRowId,mh as copy,Cf as countFailureCategories,UC as countReadOutputRows,sh as create,gR as createAssurancePreset,aI as createAssuranceWorkspaceContext,LA as createCheckpointId,nR as createCompleteListOptions,eC as createCoreCommandHookContext,Zr as createCorpusShapeMeasurement,MP as createEmptyAssuranceDocument,DT as createEmptyExtensionRegistrationRegistry,Ji as createExtensionCommandSdk,Sn as createExtensionContributionInventory,Fk as createExtensionTestHarness,Di as createHistoryEntry,nO as createLazyModule,eR as createLifecycleCompletenessPolicies,xx as createMcpStaticBearerVerifier,lx as createMcpTaskStore,nA as createMutationGuardSdk,PC as createOutputOmissionReceipt,Bi as createPmCliExpectedError,Xn as createPmCliProgram,Gn as createPmCommandOutputBudget,yS as createQueryFingerprint,Ny as createRelationshipGraphScaleFixture,Z as createRelationshipGraphSnapshot,yt as createRelationshipKindRegistry,dd as createReproducibleProcessRunner,LM as createSearchCursorFingerprint,tC as createSerialQueue,tv as createStdinTokenResolver,UA as createUnknownSubcommandError,xT as createWorkflowPolicyEvaluator,jm as createWorkspaceSnapshot,ek as deactivateExtensionForTest,dD as declineServiceOverride,HS as decodeContextIntentCursor,oO as decodeHtmlEntitiesInOptions,Tr as decodeMcpHttpHeaderValue,JS as decodePmTableRows,SS as decodeQueryCursor,TS as decodeQueryCursorEnvelope,CS as decodeQueryCursorState,hS as decodeReadOutputContinuationCursor,J0 as decodeToon,Fx as decoratePmMcpToolsWithApps,Fl as dedupeLinkedArtifacts,HI as defaultScoreContextCandidates,fD as defineAfterCommandHook,uD as defineBeforeCommandHook,mD as defineBeforeMutationHook,XL as defineCommand,oD as defineCommandOverride,W as defineCorpusShape,oN as defineEpisodeSpecification,pD as defineExporter,U0 as defineExtension,j0 as defineExtensionBlueprint,WL as defineExtensionManifest,JL as defineFlag,lD as defineImporter,QL as defineItemField,ZL as defineItemType,eD as defineMigration,dy as defineObservationContract,gD as defineOnIndexHook,hD as defineOnReadHook,_D as defineOnWriteHook,nD as defineParserOverride,Un as definePmCommandOutputBudget,dP as definePmCommandOutputEnvelope,nP as definePmErrorCodeCatalog,iD as definePreflightOverride,YL as defineProjectProfile,cD as defineRendererOverride,tD as defineSearchProvider,sD as defineServiceOverride,rD as defineVectorStoreAdapter,uy as defineVerdictContract,ve as defineWorkspaceRecipe,fh as deleteItem,Km as deleteWorkspaceSnapshot,Wb as dependencyToRelationship,A_ as deps,bR as deriveAssuranceProposals,rI as deriveClosureTimestamp,z0 as deriveExtensionCapabilities,w0 as deriveMutationTransactionId,gP as derivePmBulkMutationEffect,uL as derivePmRecoveryReferenceObligations,pp as deriveRelationshipDeadlines,Fc as deriveSchemaEvolutionMigrationId,Yv as deriveTelemetryCommandResolution,vv as describeAllowedTransitions,BP as describeExtensionActivation,H0 as describeExtensionBlueprint,KT as describeFlagScalarValueFailure,Ru as describeItemOwnershipConflict,rN as describeObservationCost,Wt as describeProfileComposition,Yt as describeProjectProfile,_w as describeUnknownError,Ai as detectAgentIdentity,Ri as detectHarnessIdentity,ip as detectRelationshipCommunities,vi as diagnoseAgentIdentity,gp as diffRelationshipAuditSnapshots,uf as diffTestRunMeasurements,Qk as digestMcpRequestParameters,JT as discoverExtensions,Xo as discoverNearbyPmRoot,w1 as discoverPmTools,zE as discoverProjectRuntimeVersionPins,E_ as docs,g_ as duplicates,Tp as durableGraphCachePath,Ap as durableGraphCacheStatus,ni as effectiveItemFormatVersion,mO as emitTelemetryErrorEvent,Xf as emptyImportedDocument,PR as encodeItemScalarDecisionValue,br as encodeMcpHttpHeaderValue,XS as encodePmTableRows,bS as encodeQueryCursor,_S as encodeReadOutputContinuationCursor,Z0 as encodeToon,GE as enforceHistoryStreamPolicyForItem,UE as enforceHistoryStreamPolicyForItems,tP as enrichCliFlagInvocationContract,Mt as enrichCliFlagInvocationContracts,NE as ensureMaterializedHistoryTarget,Rc as ensurePmGitignore,vl as ensureScope,Wv as ensureSentryCommandTracing,Kv as ensureSentryInit,Yf as ensureTrackerInitialized,op as enumerateRelationshipPaths,qn as estimatePmOutputTokens,xP as evaluateAssuranceAssertion,NP as evaluateAssuranceGate,CN as evaluateBoundaryFixtures,YI as evaluateContextRanking,TO as evaluateDefectGateEvidence,kP as evaluateMeasurement,Rm as evaluateMetricFloors,fd as evaluateMutationGuard,of as evaluateProvenanceCoverage,LD as evaluateReliabilityWindow,ef as evaluateSemanticAttributionCoverage,Kl as evaluateSimilarityGovernance,Av as evaluateTransition,my as evaluateVerdictContract,kT as evaluateWorkflowPolicies,pd as executeEmbeddingBatchesWithRetry,$v as executeVectorDelete,Fv as executeVectorReset,Dv as executeVectorUpsert,ny as executeWorkspaceRecipe,Nl as expandAddGlobEntries,Yl as explainSourceTraceability,SI as exportAttestation,Th as extension,Sh as extensionActivate,wh as extensionDeactivate,Ch as extensionList,bb as extensionMigrate,KR as extractHistoryMergeReceiptDispositions,VR as extractHistoryMergeReceiptReferences,Rx as extractMcpTraceContext,IE as extractPatchFailureContext,Np as extractReferencedPmItemIdsFromCommand,xy as federateRelationshipGraphSnapshots,C_ as files,S_ as filesDiscover,w_ as filesLookup,xS as finalizeContextUsageDelivery,Ey as findCoverageDeficits,Vl as findDuplicateClusters,Mc as findGitWorkspaceRoot,cE as findHistoryIdentityDiscontinuities,Bc as findInstalledNpmPackageCandidate,$x as findPmMcpAppByUri,xo as findPmNamespacedCommand,sp as findRedundantRelationshipEdges,cp as findRelationshipCutStructure,zl as findSimilarItems,uO as finishTelemetryCommand,VT as flattenFlagListValue,Cy as flushTelemetryQueue,hh as focus,np as forEachMatchedRelationshipEdge,fp as formatDuplicateEdgeGroup,lc as formatHierarchyRelation,mp as formatOrderingStorageContradiction,AA as formatPmPositionalActionFlagTip,wm as formatProfileApplyHuman,Sm as formatProfileLintHuman,Tm as formatProfileListHuman,Cm as formatProfileShowHuman,jc as formatSchemaEvolutionMigrationHuman,BM as formatVectorIndexRecoveryWarnings,QM as formatWorkspacePositionHuman,eh as gc,Vi as generateItemId,m_ as get,uC as getActiveCommandResult,US as getActiveContextIntentContracts,vn as getActiveExtensionRegistrations,Mx as getActiveMcpTraceContext,DP as getAssuranceDeclaration,Dh as getContracts,qw as getFocusedItem,Qo as getHistoryPath,lA as getItemAt,Zo as getItemPath,gd as getMutationActionContract,Pc as getPmGitignoreBlock,Jo as getSettingsPath,Pf as getWorkspaceContracts,yE as getWorkspaceHistoryPath,v_ as graph,Cp as graphAuditBaselinePath,tf as groupHistoryByEpisode,aD as handleServiceOverride,jk as hasMcpClientExtension,Dx as hasPmMcpAppsCapability,ze as hasSubcommandFlagContractsForCommand,jv as hasVectorizationEmbeddingIdentityChanged,Bv as hasVectorizationVectorDimensionChanged,sE as hashDocument,aE as hashDocumentForVersion,dE as hashEmptyDocument,eE as hashHistoryPatch,Qw as hashHistoryRecord,tE as hashHistoryStream,RR as hashItemScalarDecisionValue,Q_ as health,Ql as hierarchyAncestors,ep as hierarchyDescendants,nh as historyCompact,ih as historyCompactBulk,kw as historyDigest,$I as historyEntryMatchesProvenance,qE as historyItemHashVersionForRuntime,th as historyRedact,rh as historyRepair,oh as historyRepairAll,OO as indexBlockedByIds,pc as indexHierarchyRelations,qv as inferConsistentVectorDimension,Fn as inferPmOutputBudgetClass,P_ as init,iR as inspectCompleteListResult,$T as inspectExtensionManifestSchema,pl as inspectHistoryAuthorStream,$R as inspectMergeReceiptEvidence,KE as inspectProjectRuntimeCompatibility,wd as inspectStaleInProgressItems,Uh as inspectStaticExtensionInventory,eI as inspectStatusRoleAssignments,bE as inspectWorkspaceHistoryState,Bm as inspectWorkspaceSnapshot,$c as installMergeFence,qk as interpretMcpResultType,Qu as isAlreadyClaimedError,yw as isCommanderError,p0 as isCompatibleRecoveryFlag,sl as isErrnoError,fO as isExternalDependencyReference,_O as isExternalDependencySourceKind,fe as isFileMissingError,iT as isHostOutputSuppressed,ji as isItemAlreadyExistsError,OR as isItemScalarMissingValue,qR as isLegacyMergeReceiptSummary,h as isMcpRecord,_d as isMutationAction,Vb as isOrderingRelationshipKind,pv as isPlaceholderReferenceToken,qi as isPmCliExpectedError,gn as isPmExtensionCapabilityContract,bn as isPmExtensionPolicyModeContract,Tn as isPmExtensionPolicySurfaceContract,yn as isPmExtensionServiceNameContract,_P as isPmKnownExitCode,lP as isPmMutationReceipt,We as isPmSuccessfulExitCode,Gi as isPmTokenBudgetRecovery,hn as isPmToolAction,zR as isPreDurableCloneLocalReceiptSummary,HR as isPreDurableDispositionEligibleReference,VE as isProjectMutatingInvocation,iO as isPureSnakeCaseAlias,pS as isReadOutputBudgetExceeded,VC as isReadOutputSessionReference,l0 as isReadProjectionRecoveryFlag,IC as isReadRowContract,sc as isRuntimeRecord,dO as isTerminalPlanMode,Uw as isTerminalStatus,Wn as isTimestampLiteral,P0 as itemDocumentToMutationOptions,vM as itemHasSchedule,Rn as jaccardSimilarity,T_ as learnings,LT as levenshteinDistanceWithinLimit,ol as limitAnnotationEntries,Gp as linkedTestTrustFingerprint,V0 as lintExtensionBlueprint,FT as lintExtensionManifestSchema,Zt as lintProjectProfile,l_ as list,Ti as listAgentProvenanceAdapters,Ha as listAliasPluralKeys,p_ as listAllComplete,rA as listAllDocumentCandidatesCached,Xi as listAllItemMetadata,oA as listAllItemMetadataLight,LP as listAssuranceDeclarations,jP as listAssuranceVerdicts,hy as listBuiltinCorpusShapes,b0 as listCoreClosedDomainContracts,ow as listGetProjectionFields,ER as listInvalidProvenanceHistoryStreamIds,tw as listListProjectionFields,FR as listMergeReceipts,hd as listMutationActions,WM as listMutationEvents,fo as listPmCommandFlagBudgets,Cc as listPmCommandsForFamily,Tc as listPmCommandsForTier,Me as listPmFlagLexicon,zL as listPmFlagSpellingInventory,Sc as listPmMcpToolsForProfile,xL as listPmRequiredArgumentRefusalContracts,NL as listPmSubcommandRefusalContracts,Kt as listProfiles,$L as listTrackerPreflightRecoveryContracts,M0 as listUpsertKeyCandidates,qm as listWorkspaceSnapshots,mw as loadContextIntentRuntimeLayers,um as loadCreateTemplateOptions,ZT as loadExtensions,Op as loadGraphAuditBaseline,k0 as loadGuardedRuntimeSchema,$A as loadMutationCheckpoint,x as loadRelationshipGraphAdapter,Wi as locateItem,WA as looksLikeGenericKeyValueEntry,jC as mapReadOutputRows,GR as markMergeReceiptReconciled,wv as matchesRuntimeFilters,lO as maybeRunFirstUseTelemetryPrompt,by as measureCorpusShapePlan,Ki as measureItemMetadataReadWork,HA as mergeAdditiveTags,q0 as mergeExtensionBlueprints,IR as mergeHistoryStreams,NR as mergeItemDocuments,LR as mergeJsonDocuments,Ka as mergeLinkedTestTwoTokenEntries,MR as mergeRelationshipEventStreams,Wu as mergeSortedWarnings,aO as migrateItemFilesToFormat,aA as mutateItem,sA as mutateItemWithHistoryContext,SE as mutateWorkspaceJsonWithHistory,f_ as next,Si as normalizeAgentProvenanceAdapterValue,rl as normalizeAnnotationTransportOptions,SP as normalizeAssuranceEvaluation,CP as normalizeAssuranceMutation,Wa as normalizeBootstrapInvocation,iv as normalizeBulkIdsValue,mc as normalizeDependencyGraphTarget,VO as normalizeDependencySeedId,HO as normalizeDependencySourceKind,Cn as normalizeExtensionContributionInventory,Ow as normalizeHistoryOperationForWrite,wR as normalizeInvalidHistoryProvenance,xA as normalizeItemAddressInvocation,ii as normalizeItemFormatVersion,Hi as normalizeItemId,ci as normalizeItemMetadata,KO as normalizeItemReference,za as normalizeLegacyExtensionActionSyntax,xl as normalizeLinkedPath,lv as normalizeParentReferenceValue,Ht as normalizeProfileName,zi as normalizeRawItemId,aS as normalizeReadOutputIncludeModeOptions,mE as normalizeReplayPatchOps,yd as normalizeSimilarityText,Gw as normalizeStatusForRegistry,di as normalizeStatusInput,Nw as normalizeStatusInputWithRegistry,gw as normalizeThrownExitCode,b_ as notes,Kn as nowIso,Sp as openDurableGraphCache,Zk as openMcpRequestState,nN as openPmEpisode,tp as orderingPredecessors,rp as orderingSuccessors,eM as packContextCandidates,qu as packRankedContextItems,xh as packageActivate,kh as packageCatalog,Nh as packageDeactivate,Ih as packageDescribe,Ph as packageDoctor,vh as packageInstall,Eh as packageLifecycle,Ah as packageList,Rh as packageManage,Tb as packageMigrate,Mh as packageReload,Oh as packageUninstall,ES as paginateQueryRows,Ol as parseAddEntries,Pl as parseAddGlobEntries,il as parseAnnotationTextInput,E0 as parseAtomicMutationControls,Ba as parseBootstrapCommandName,Ga as parseBootstrapGlobalOptions,ja as parseBootstrapHelpRequest,Ya as parseBootstrapTypeValue,nv as parseBulkIdsText,Gu as parseContextDepth,Lu as parseContextFocusFields,lw as parseContextIntentDeclarations,Uu as parseContextSections,nM as parseContextSignalSnapshot,KA as parseCsvKv,wO as parseDefectChangeRiskRequest,dI as parseDefectRecurrenceCoverageRequest,SO as parseDefectRecurrencePolicy,Pm as parseEvalMetricFloors,xm as parseEvalQuerySet,BT as parseExtensionLongFlagToken,Ip as parseGraphSubcommand,CI as parseHistoryAttestation,LI as parseHistoryProvenanceFilters,xO as parseIntegerLimit,jw as parseItemDocument,A0 as parseItemMutationBatch,Tv as parseLimit,_u as parseLinkedTestAssertionEqualsMap,hu as parseLinkedTestAssertionGteMap,cu as parseLinkedTestBoolean,lu as parseLinkedTestContextMode,du as parseLinkedTestEnvClear,au as parseLinkedTestEnvSet,gu as parseLinkedTestJsonEntries,fu as parseLinkedTestMinLines,mu as parseLinkedTestRegexList,uu as parseLinkedTestStringList,pu as parseLinkedTestWorkspaceContextMode,Xh as parseMcpCachePolicy,jh as parseMcpImplementation,tt as parseMcpInputRequests,dr as parseMcpInputResponses,Tg as parseMcpSubscriptionFilter,Il as parseMigrateEntries,DO as parseMultiValueFilter,pP as parseMutationReceipt,ov as parseOptionalNonNegativeInteger,rv as parseOptionalNumber,nL as parsePmAgentTaskTranscriptCorpus,S1 as parsePmToolDiscoveryOptions,NO as parsePriority,GO as parsePriorityFilterSet,YC as parseReadOutputSession,$E as parseRegisteredItemFieldAssignments,ae as parseRelationshipGraphSnapshot,Rl as parseRemoveEntries,Wl as parseSourceLineRange,hv as parseStatusFilterCsv,$O as parseStringFilterSet,ld as parseTags,lf as parseTestRunMeasurements,LO as parseType,FO as parseTypeFilterSet,_l as parseUnknownAuthorHistoryEventCoordinates,vT as parseWorkflowPolicy,OT as parseWorkflowPolicyDocument,TM as partitionDecisionEntries,av as patchPathToChangedField,Fo as pathExists,yh as pauseTask,wp as persistDurableGraphResult,OE as persistSelectedItemFormat,pR as planAgentIdentityVocabularyMutation,lM as planCompletedAtBackfill,Kc as planExtensionDirectoryCopy,G0 as planItemMutationDocument,Qt as planProfileApplication,dL as planRelationshipEventBackfill,Rp as planRelationshipRemediation,Gc as planSchemaEvolutionMigration,ml as planUnknownAuthorHistoryAcknowledgment,zm as planWorkspaceSnapshotRestore,PA as positionalShapeKey,RA as positionalSignatureKey,X0 as preflightExtension,Td as prepareSimilarityText,JA as preserveMutationStdinTokenFields,XA as preserveMutationStdinTokenLiterals,F0 as previewItemMutationDocument,x0 as previewItemMutations,dw as printError,aw as printResult,K_ as profile,X_ as profileApply,J_ as profileLint,W_ as profileList,Y_ as profileShow,fC as projectAfterCommandItemSnapshot,Du as projectContextFocusRows,df as projectFleetAttributionAnalytics,DI as projectHistoryProvenance,nw as projectPmBriefListEnvelope,Hn as projectPmDiagnosticOutput,Vn as projectPmDiagnosticText,sf as projectProvenanceCoverageAnalytics,qp as projectValidateCounts,CR as promoteAssuranceAssertion,MS as propagateContextUsageServingReceipt,ON as pruneCompileCacheGenerations,$P as putAssuranceDeclaration,FP as putAssuranceDeclarationBundle,YE as queryItemMetadataIndex,XE as queryLinkedFileMetadataIndex,JE as querySimilarItemMetadataIndex,pf as queryTestRunMeasurementsBelow,Mn as quoteCommandArg,In as quoteWindowsCommandArg,g0 as rankCommandPaths,nl as readAnnotationEntries,Oi as readAuthorEnvironment,If as readBooleanOption,FS as readContextUsageAffinity,Mf as readCsvListOption,Qi as readExtensionMigrationState,Go as readFileIfExists,rd as readFirstStringFromCommanderOptions,od as readFirstValueFromCommanderOptions,rf as readHistoryAnalyticsWindow,Ww as readHistoryEntries,Mi as readHistorySnapshot,Ym as readImprovementLedger,eA as readItemMetadataDerivedIndexState,Yi as readLocatedItem,GC as readOutputBudgetCollections,fS as readOutputCollectionFingerprint,FC as readOutputContinuationRowCollections,DC as readOutputContinuationRowPaths,iS as readOutputIncludeModeOptions,$C as readOutputRowCollections,LC as readOutputRowPaths,ZC as readOutputSessionRemainingTokens,Ft as readPmPackageManifest,vf as readRequiredString,Dw as readRuntimeFieldOptionValue,Fi as readSettings,PE as readSettingsWithMetadata,nd as readStringArrayFromCommanderOptions,Rf as readStringOption,hw as readThrownExitCode,zv as readVectorizationStatusLedger,LE as readWorkflowPolicies,PT as readWorkflowPolicyField,pw as readWorkspaceContextIntentContracts,dM as readWorkspaceContextSignals,mM as readWorkspaceMemory,ZM as readWorkspacePosition,hE as reanchorHistoryEntries,$D as reconcileArtifactLedgers,An as reconcileExtensionCapabilityUsage,EE as reconcileWorkspaceJsonHistory,mC as recordAfterCommandAffectedItem,UP as recordAssuranceVerdict,Cu as recordClaimSemanticAttribution,LS as recordContextUsageDelivery,NS as recordContextUsageServing,DS as recordContextUsageTouch,$S as recordContextUsageTouches,wu as recordFocusSemanticAttribution,Wm as recordImprovementObservation,Su as recordReleaseSemanticAttribution,tA as refreshItemMetadataDerivedIndex,Lc as refreshMergeAttributeFenceIfInstalled,zC as refreshReadOutputDeliveredCounts,Vv as refreshSearchArtifactsForMutation,Ci as registerAgentProvenanceAdapters,qO as registerExternalDependencyResolver,bi as registerHarnessSignalDescriptors,wC as registerOutputMaterialFieldGroups,uh as release,qC as rememberReadOutputFocusRows,GP as removeAssuranceDeclaration,Uo as removeFileIfExists,jl as renameArtifactsResultKey,Mu as renderCalendarMarkdown,ku as renderCalendarToon,Yu as renderContextMarkdown,Hc as renderExtensionDescribeMarkdown,qc as renderExtensionSurfaceMarkdown,e_ as renderGuideMarkdown,f0 as renderMissingOptionRetry,CM as renderNextMarkdown,T0 as renderPmClosedDomainHelp,kn as renderPmCommand,$o as renderPmCommandAliasMigrationHint,Ac as renderPmCommandVisibilityMarkdown,VL as renderPmFlagLexiconMarkdown,Gx as renderPmMcpAppHtml,CL as renderPmRefusalClosureCensusMarkdown,yv as renderRowsAsCsv,bv as renderRowsAsTable,dh as reopen,xE as replayHistoryToTarget,pE as replayToCanonicalItemDocument,lE as replayToItemDocument,vw as requireHistoryOperation,OI as requireTerminalReason,PI as requireTerminalReasonWithRecovery,nE as resealHistoryRewrite,cC as resetActiveExtensionRuntimeState,El as resetWorkspaceGraphCache,fi as resolveAgentSessionContextFromSignals,ll as resolveAnnotationIndex,al as resolveAnnotationInput,Kw as resolveAuthor,Ii as resolveAuthorIdentity,cv as resolveBodyFileContent,gy as resolveBuiltinCorpusShape,Iu as resolveCalendarOutputFormat,iP as resolveCanonicalPmErrorCodeContract,Hb as resolveCanonicalRelationshipKind,Vw as resolveClaimPrincipal,sv as resolveCliBulkIdsInput,yT as resolveCommandOptionPolicyState,vN as resolveCompileCacheGeneration,cM as resolveCompletionTimestamp,dT as resolveConfiguredPmPackageRoot,YO as resolveContentFieldFilters,qS as resolveContextIntentContract,$u as resolveContextOutputFormat,Fu as resolveContextTokenBudget,II as resolveCreateExplicitEmptyFlag,MM as resolveEffectiveSearchMode,Iv as resolveEmbeddingProviders,HT as resolveExtensionFlagValueContract,Wc as resolveExtensionInstallSourceIdentity,qT as resolveExtensionLongFlagName,Zi as resolveExtensionMigrationStatePath,XT as resolveExtensionRoots,zO as resolveExternalDependencyReference,zT as resolveFlagValueKind,CT as resolveGlobalPmRoot,Zf as resolveGuideOutputFormat,Xm as resolveHistoryEpisodeGroupIdentity,Mw as resolveHistoryHashAlgorithm,Aw as resolveHistoryOperation,NI as resolveHistoryProvenanceDimensions,dA as resolveHistorySubject,ME as resolveHistoryTarget,xM as resolveHybridSemanticWeight,Yo as resolveImplicitPmRoot,OS as resolveIsoOrRelative,RO as resolveItemBlockers,EO as resolveItemExecutionRole,O0 as resolveItemMutationDocument,Wo as resolveItemTypeRegistry,xw as resolveItemTypesFilePath,Sf as resolveLinkedTestFailureExitCode,Lp as resolveLinkedTestSourceRef,Dp as resolveLinkedTestSourceWorkspaceRoot,Up as resolveLinkedTestTrust,jp as resolveLinkedTestTrustBatch,Cg as resolveMcpAcknowledgedSubscriptionFilter,Je as resolveMcpRequestContext,Ic as resolveMergeInstallContext,_0 as resolveMisnestedCommandPath,WO as resolveMissingMetadataFilters,m0 as resolveMissingOptionPlaceholder,RC as resolveModePairedOutputOmissionReceipt,yM as resolveNextOutputFormat,kC as resolveOutputOmissionReceipt,aT as resolvePmCliVersion,Do as resolvePmCommandAlias,Ve as resolvePmCommandCapabilityFamily,Nt as resolvePmCommandExitContract,L as resolvePmCommandOperation,Bn as resolvePmCommandOutputBudget,xt as resolvePmCommandOutputEnvelope,wA as resolvePmCommandPositionalContract,Ke as resolvePmCommandVisibilityTier,zn as resolvePmDiagnosticOutputBudget,sP as resolvePmErrorCodeContract,_b as resolvePmFlagSemanticConcept,Le as resolvePmHistoryOperation,Vk as resolvePmMcpExecutableInvocation,sT as resolvePmPackageRootFromModule,EA as resolvePmPositionalActionContract,$a as resolvePmPositionalActionFlagContracts,Fe as resolvePmRoot,Xd as resolvePmToolCustomFieldCollision,fv as resolvePriority,Vt as resolveProfile,xc as resolveProjectMergeTypeFolders,wS as resolveQueryCursorStart,c0 as resolveReadOptionRetryArgs,dS as resolveReadOutputDimensions,uS as resolveReadOutputEncoding,HC as resolveReadOutputRecoveryBudget,oS as resolveReadOutputSurface,MC as resolveReadRowContract,u0 as resolveRecoveryCommandName,jA as resolveRegisteredSearchProvider,BA as resolveRegisteredVectorStoreAdapter,ad as resolveReproducibleProcessEnvironment,ti as resolveRuntimeFieldRegistry,ei as resolveRuntimeStatusRegistry,Mv as resolveSearchCorpusFields,IM as resolveSearchMaxResults,DM as resolveSearchPage,kM as resolveSearchScoreThreshold,NM as resolveSearchTuning,xv as resolveSemanticCorpusCharacterLimit,Tu as resolveSemanticLineageIds,Ov as resolveSettingsWithSemanticRuntimeDefaults,HP as resolveSourceContextWritePolicy,Ou as resolveStartTaskInProgressStatus,ee as resolveSubcommandFlagContractsForCommand,rT as resolveTelemetryErrorCategory,vI as resolveTerminalReason,I0 as resolveTransactionSchema,gT as resolveTypeDefinition,hT as resolveTypeName,gv as resolveTypeSynonym,Ev as resolveTypeWorkflows,fl as resolveUnknownAuthorAcknowledgmentSelector,jM as resolveVectorIndexRecovery,Lv as resolveVectorStores,ac as resolveWorkspaceRelationshipKindRegistry,TT as resolveWorkspaceRoot,_h as restore,FA as restoreCheckpointItems,AE as restoreWorkspaceJsonFromHistory,Vm as restoreWorkspaceSnapshot,Hm as restoreWorkspaceSnapshotWithRecovery,Fh as runAction,gC as runActiveBeforeMutationHooks,bC as runActiveCommandHandler,yC as runActiveOnIndexHooks,Pn as runActiveOnReadHooks,On as runActiveOnWriteHooks,TC as runActiveParserOverride,CC as runActivePreflightOverride,SC as runActiveServiceOverride,Nu as runActivity,YT as runAfterCommandHooks,Em as runAggregate,cl as runAnnotationCommand,Yp as runAppend,uI as runAssuranceAction,mI as runAssuranceDispatch,WT as runBeforeCommandHooks,xu as runCalendar,em as runClaim,tm as runClaimNext,Jp as runClose,Qp as runCloseMany,im as runCloseTask,yl as runComments,t_ as runCompletion,bl as runConfig,Bt as runContext,ZI as runContextEvaluationCorpus,XI as runContextEvaluationScenario,eu as runCopy,yu as runCreate,bu as runDelete,Al as runDeps,Bl as runDocs,_R as runDuplicates,Lm as runEval,$m as runEvent,Yc as runExtension,rs as runExtensionMigrateAction,ts as runExtensionMigrations,Xl as runFiles,Zl as runFilesDiscover,Jl as runFilesLookup,af as runFleetAttributionAnalytics,vu as runFocus,Vp as runGc,Am as runGet,Mp as runGraph,Qf as runGuide,kp as runHealth,RM as runHistory,EI as runHistoryAttest,_I as runHistoryCompact,yI as runHistoryCompactBulk,YR as runHistoryMaintenance,bI as runHistoryRedact,JR as runHistoryRepair,QR as runHistoryRepairAll,tl as runInit,Zc as runInitAgentGuidance,Wp as runLearnings,Ul as runLinkedArtifacts,wf as runLinkedTests,yc as runList,Dm as runMeet,HM as runMergeDriver,Dc as runMergeInstall,jR as runMergeReceiptEvidenceReport,UR as runMergeReceiptReport,VM as runMergeReconcile,Zu as runNext,lm as runNotes,nm as runPauseTask,dm as runPlan,bm as runProfileApply,ym as runProfileLint,hm as runProfileList,gm as runProfileShow,nf as runProvenanceCoverageAnalytics,tk as runRegisteredCommandForTest,sk as runRegisteredCommandOverrideForTest,mk as runRegisteredExporterForTest,ok as runRegisteredHookForTest,uk as runRegisteredImporterForTest,pk as runRegisteredMigrationForTest,rk as runRegisteredMutationGuardForTest,nk as runRegisteredParserOverrideForTest,ik as runRegisteredPreflightOverrideForTest,ak as runRegisteredRendererOverrideForTest,ck as runRegisteredSearchProviderForTest,dk as runRegisteredServiceOverrideForTest,lk as runRegisteredVectorStoreAdapterForTest,er as runReindex,rm as runRelease,Fm as runRemind,kI as runReopen,Zp as runRestore,Uc as runSchemaEvolutionMigration,vm as runSearch,Ty as runSearchRefreshWorkerEntrypoint,r_ as runStartBackgroundRun,om as runStartTask,mf as runStats,_f as runTelemetry,fm as runTemplatesList,mm as runTemplatesSave,_m as runTemplatesShow,Ef as runTest,Af as runTestAll,o_ as runTestRunsList,i_ as runTestRunsLogs,a_ as runTestRunsResume,n_ as runTestRunsStatus,s_ as runTestRunsStop,d_ as runTestRunsWorker,Pu as runUpdate,cm as runUpdateMany,Ut as runUpgrade,Hp as runValidate,$h as runWithActiveExtensions,D as runWithAgentSessionContext,vE as runWithConfigurationOnlySettings,jS as runWithContextIntentContracts,fw as runWithDiscoveredContextIntentContracts,wi as runWithHarnessDetectionSignals,Ix as runWithMcpTraceContext,cd as runWithReproducibleProcessEnvironment,Ei as runWithWorkspaceHarnessSignalDescriptors,zr as runWithWorkspaceRecipe,tR as runWorkflowPolicyAction,fI as runWorkspaceTransactionGc,Pp as saveGraphAuditBaseline,oI as scanClosureTimestamps,SR as scanExtensionHostVersions,ul as scanHistoryAuthorAttribution,ai as scanItemFormatVersions,md as scanMutationSecrets,AR as scanProvenanceResolverHealth,Ed as scanStaleInProgressItems,sI as scanStorageIntegrity,I_ as schema,$_ as schemaAddField,L_ as schemaAddStatus,x_ as schemaAddType,j_ as schemaApplyPreset,B_ as schemaInferTypes,M_ as schemaList,G_ as schemaListFields,H_ as schemaRemapStatus,F_ as schemaRemoveField,D_ as schemaRemoveStatus,N_ as schemaRemoveType,z_ as schemaRenameField,q_ as schemaRenameType,k_ as schemaShow,U_ as schemaShowField,V_ as schemaShowStatus,h0 as scoreCommandPathMatch,VI as scoreContextCandidates,KI as scoreContextCandidatesWithActiveExtensions,Cd as scoreItemSimilarity,LL as scorePmGrammarRefusalClosure,EL as scorePmRefusalClosure,Sd as scorePreparedItemSimilarity,FL as scoreTrackerPreflightRecoveryClosure,rE as sealHistoryRecord,Jk as sealMcpRequestState,u_ as search,hM as searchWorkspaceMemory,gM as searchWorkspaceMemoryReadResult,MO as selectActionableEntries,gS as selectCursorSemanticOptions,Wf as selectImportAuthor,Ax as selectMcpClientRegistrationMode,_M as selectWorkspaceMemory,fM as selectWorkspaceMemoryRollups,Au as semanticAttributionAffinity,eO as sentryCaptureCliError,Zv as sentryDiscardCommandSpan,Qv as sentryFinishCommandSpan,rO as sentryFlush,tO as sentryLogCliUsageError,Xv as sentrySetCommandContext,Jv as sentryStartCommandSpan,pi as serializeItemDocument,C0 as serializeNdjsonRows,S0 as serializeNdjsonStream,cy as serveDeclaredObservation,lC as setActiveCommandContext,pC as setActiveCommandResult,oC as setActiveExtensionCommands,rC as setActiveExtensionHooks,nC as setActiveExtensionParsers,iC as setActiveExtensionPreflight,dC as setActiveExtensionRegistrations,aC as setActiveExtensionRenderers,sC as setActiveExtensionServices,zw as setFocusedItem,cO as shouldCompletePlanOnClose,vp as shouldPersistDurableGraphCache,ev as shouldResolveMutationStdinTokenField,QA as shouldResolveMutationStdinTokens,Rv as shouldRunSearchRefreshInForeground,ql as similarityAdvisoryWarnings,NC as sliceReadOutputRowCollection,$l as sortLinkedArtifacts,qA as splitAcceptanceCriteria,sO as splitCommaList,li as splitFrontMatter,cS as stabilizeReadOutputReceiptEstimates,R as stableStringify,v0 as stableUpsertValue,ST as stableValueEquals,gh as startTask,pO as startTelemetryCommand,h_ as stats,Lw as statusIsTerminal,Ua as stripGlobalBootstrapTokens,YM as subscribeMutationEventBatches,XM as subscribeMutationEvents,lR as summarizeAgentIdentityVocabulary,Zm as summarizeAgentModelProvenance,Qm as summarizeAgentProvenance,JI as summarizeContextEvaluationReports,yf as summarizeContextPreflight,GI as summarizeHistoryProvenance,Qc as summarizeInitResult,DR as summarizeMergeReceipt,MI as supportsCreateExplicitEmpty,kA as supportsItemIdAlias,nT as suppressHostOutput,Pe as syncRelationshipGraphAdapter,K0 as synthesizeExtensionManifest,Fa as toCompletionFlagString,Ku as toContextFocusItem,zu as toContextPackingSummary,Hu as toContextRankingSummary,lT as toErrorMessage,xf as toEstimatedMinutesValue,s0 as toExtensionFlagDefinitions,Ff as toImportBoolean,Bf as toImportConfidence,$f as toImportInteger,Vf as toImportLinkedDocs,Hf as toImportLinkedFiles,Kf as toImportLinkedTests,zf as toImportLogEntries,qf as toImportNormalizedEnum,jf as toImportNumberMap,Nf as toImportPriority,Df as toImportStatus,Gf as toImportStringList,Uf as toImportStringMap,Lf as toImportTags,Bw as toItemRecord,kf as toNonEmptyImportString,cT as toNonEmptyStringOrUndefined,uE as toReplayDocument,bd as tokenizeSimilarityText,ZA as transferMutationStdinTokenPolicy,UT as translateHostEnvironmentFault,ah as update,hf as updateLinkedTest,Lh as upgrade,Z_ as validate,PP as validateAssertionDefinition,IP as validateAssuranceDocument,RP as validateGateDefinition,R0 as validateItemMutationRows,Gl as validateLinkedPaths,vx as validateMcpAuthorizationResponseIssuer,Ex as validateMcpAuthorizationServerMetadata,Ox as validateMcpClientMetadataDocument,hx as validateMcpHttpRequestHeaders,tx as validateMcpJsonSchema,OP as validateMeasurementDefinition,uv as validateMissingParentReference,nS as validateReadOutputOptions,_v as validateSprintOrReleaseValue,bT as validateTypeOptions,yA as validateWorkspaceTransactionIdentity,wI as verifyAttestation,rP as verifyCliFlagInvocationParity,OA as verifyExplicitPositionalSlotCensus,_E as verifyHistoryChain,fE as verifyHistoryChainWithVersion,cA as verifyHistoryEntries,oE as verifyHistoryRecordHash,iE as verifyHistoryRewriteEvidence,MA as verifyPmCliGrammar,IA as verifyPmCommandPositionalContracts,HL as verifyPmFlagLexicon,_L as verifyPmRecoveryKindRuntimeCoverage,ib as verifyPmRecoveryProducerRuntimeCoverage,fL as verifyPmRecoveryReferences,bL as verifyPmRefusalClosureIdentityRatchet,yL as verifyPmRefusalClosureRatchet,mL as verifyPmRefusalReachability,Md as verifyToolOptionCliParity,os as withFlagAliasMetadata,jT as withHostEnvironmentBoundary,ex as withMcpCachePolicy,IT as workflowApprovalFingerprint,MT as workflowPolicyApplies,RT as workflowPolicyFingerprint,wl as workspaceGraphCache,dl as wrapOwnershipConflict,bw as wrapThrownErrorForSentry,Pi as writeAuthorEnvironment,$e as writeFileAtomic,DA as writeMutationCheckpoint,RE as writeSettings,sw as writeStderr,iw as writeStdout,Hv as writeVectorizationStatusLedger,wE as writeWorkspaceJsonWithHistory};
32
35
  //# sourceMappingURL=sdk.js.map