@unbrained/pm-cli 2026.12.2 → 2026.12.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (157) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/dist/cli/commander-usage.js +4 -4
  3. package/dist/cli/expected-revisions.js +1 -1
  4. package/dist/cli/extension-command-help.js +4 -4
  5. package/dist/cli/main.js +5 -5
  6. package/dist/cli/runtime/invocation-rewrites.js +1 -1
  7. package/dist/cli/runtime-field-commands.js +2 -0
  8. package/dist/cli-bundle/bundle-manifest.json +1 -1
  9. package/dist/cli-bundle/chunks/chunk-3ESBFEQC.js +2 -0
  10. package/dist/cli-bundle/chunks/chunk-46AZP5QW.js +2 -0
  11. package/dist/cli-bundle/chunks/{chunk-OBPO6V7H.js → chunk-5WTBF4M4.js} +2 -2
  12. package/dist/cli-bundle/chunks/{chunk-3KEMIPKG.js → chunk-6TOZQ5BQ.js} +2 -2
  13. package/dist/cli-bundle/chunks/{chunk-4YYFY33T.js → chunk-AHVOEE7F.js} +2 -2
  14. package/dist/cli-bundle/chunks/chunk-CQHB3ZZH.js +2 -0
  15. package/dist/cli-bundle/chunks/chunk-DZPOS3YT.js +2 -0
  16. package/dist/cli-bundle/chunks/{chunk-ROTEELDL.js → chunk-E5ADC3HT.js} +65 -65
  17. package/dist/cli-bundle/chunks/{chunk-SY5C3U32.js → chunk-E5HO7HWP.js} +2 -2
  18. package/dist/cli-bundle/chunks/{chunk-3HKPVOAN.js → chunk-EDJ3KR2H.js} +2 -2
  19. package/dist/cli-bundle/chunks/{chunk-TKUG2X24.js → chunk-FWQNWPIV.js} +2 -2
  20. package/dist/cli-bundle/chunks/{chunk-7NAO7I75.js → chunk-H4U3LEOD.js} +2 -2
  21. package/dist/cli-bundle/chunks/{chunk-MZZ4ZJ5Z.js → chunk-HNMED75Y.js} +2 -2
  22. package/dist/cli-bundle/chunks/{chunk-SDXCJZKB.js → chunk-HPCMM74Q.js} +22 -22
  23. package/dist/cli-bundle/chunks/{chunk-WSEIEDEK.js → chunk-ITM4AMVM.js} +2 -2
  24. package/dist/cli-bundle/chunks/{chunk-Q6K7HWZ7.js → chunk-IW4A3I4N.js} +2 -2
  25. package/dist/cli-bundle/chunks/{chunk-7V65VACG.js → chunk-JJ73G5UT.js} +2 -2
  26. package/dist/cli-bundle/chunks/chunk-L4HMFRHB.js +2 -0
  27. package/dist/cli-bundle/chunks/{chunk-GOEQXVOI.js → chunk-LTQWPQ7H.js} +2 -2
  28. package/dist/cli-bundle/chunks/{chunk-UNBW2LF3.js → chunk-MRT3ADO4.js} +2 -2
  29. package/dist/cli-bundle/chunks/{chunk-ZL6J6JYT.js → chunk-PBMLIV74.js} +2 -2
  30. package/dist/cli-bundle/chunks/{chunk-G6TARHFK.js → chunk-PJMGWJKU.js} +2 -2
  31. package/dist/cli-bundle/chunks/chunk-Q2HMDV56.js +9 -0
  32. package/dist/cli-bundle/chunks/{chunk-OXC5KBIQ.js → chunk-RRBNCL63.js} +2 -2
  33. package/dist/cli-bundle/chunks/{chunk-CBUC4X7Q.js → chunk-TDOF7BKO.js} +3 -3
  34. package/dist/cli-bundle/chunks/chunk-UXEZXGAD.js +113 -0
  35. package/dist/cli-bundle/chunks/{chunk-PCDTWL6V.js → chunk-W7HA65EO.js} +2 -2
  36. package/dist/cli-bundle/chunks/{chunk-I4SPJQQI.js → chunk-XGNUDSCG.js} +3 -3
  37. package/dist/cli-bundle/chunks/{chunk-AHV3CSQG.js → chunk-XKJ5NWQ7.js} +2 -2
  38. package/dist/cli-bundle/chunks/{field-option-collisions-BBGTV7AD.js → field-option-collisions-DXKTKW6J.js} +2 -2
  39. package/dist/cli-bundle/chunks/item-revision-DXEF4XBU.js +2 -0
  40. package/dist/cli-bundle/chunks/item-transaction-EANA7V4W.js +2 -0
  41. package/dist/cli-bundle/chunks/{linked-resource-value-list-ZBIY4H23.js → linked-resource-value-list-5JRGUDUB.js} +2 -2
  42. package/dist/cli-bundle/chunks/{mutation-actor-NHN33ITJ.js → mutation-actor-S5G7FMNG.js} +2 -2
  43. package/dist/cli-bundle/chunks/{mutation-admission-PGKJTCG6.js → mutation-admission-HQVNPOXV.js} +2 -2
  44. package/dist/cli-bundle/chunks/{register-list-query-7S5QWDTI.js → register-list-query-SQF5PSJ4.js} +2 -2
  45. package/dist/cli-bundle/chunks/{register-mutation-EK6DVIQK.js → register-mutation-4AQ4CEBL.js} +2 -2
  46. package/dist/cli-bundle/chunks/{register-operations-6MURXE4V.js → register-operations-76P7OM4P.js} +2 -2
  47. package/dist/cli-bundle/chunks/{register-setup-RW26X3GJ.js → register-setup-T6OEOZK3.js} +2 -2
  48. package/dist/cli-bundle/chunks/{stage-4ZCF74G4.js → stage-KUICZHSF.js} +2 -2
  49. package/dist/cli-bundle/focused-chunks/{chunk-4SCFAWAW.js → chunk-3LHBKFPD.js} +2 -2
  50. package/dist/cli-bundle/focused-chunks/chunk-4DDXERKN.js +2 -0
  51. package/dist/cli-bundle/focused-chunks/{chunk-JPZGC3W4.js → chunk-4YU75CWI.js} +2 -2
  52. package/dist/cli-bundle/focused-chunks/{chunk-TXTPAFHJ.js → chunk-5JQVPQMN.js} +2 -2
  53. package/dist/cli-bundle/focused-chunks/{chunk-KNBGHCIP.js → chunk-5Z4DXYBZ.js} +2 -2
  54. package/dist/cli-bundle/focused-chunks/chunk-7DOP5HEZ.js +44 -0
  55. package/dist/cli-bundle/focused-chunks/{chunk-TR22GU7M.js → chunk-AX4RBJ7B.js} +2 -2
  56. package/dist/cli-bundle/focused-chunks/{chunk-7A6SEZEY.js → chunk-BEHQCHQV.js} +2 -2
  57. package/dist/cli-bundle/focused-chunks/chunk-BUIF6CMZ.js +2 -0
  58. package/dist/cli-bundle/focused-chunks/chunk-E2IWEJL5.js +3 -0
  59. package/dist/cli-bundle/focused-chunks/chunk-GBU7GKNJ.js +2 -0
  60. package/dist/cli-bundle/focused-chunks/{chunk-EQCQTYKO.js → chunk-K35KTBDZ.js} +2 -2
  61. package/dist/cli-bundle/focused-chunks/{chunk-VQIC3UZB.js → chunk-KNST4PGF.js} +2 -2
  62. package/dist/cli-bundle/focused-chunks/{chunk-P2H3GTJK.js → chunk-L2XJB5PK.js} +2 -2
  63. package/dist/cli-bundle/focused-chunks/chunk-L6NOGC4N.js +100 -0
  64. package/dist/cli-bundle/focused-chunks/{chunk-VK3IE3TS.js → chunk-LWIIDPAV.js} +2 -2
  65. package/dist/cli-bundle/focused-chunks/{chunk-6IY5CVGJ.js → chunk-M54BMYG4.js} +2 -2
  66. package/dist/cli-bundle/focused-chunks/{chunk-6BKT6XQN.js → chunk-NEK7RX3N.js} +2 -2
  67. package/dist/cli-bundle/focused-chunks/{chunk-BHNBPCHP.js → chunk-OKGWIW6C.js} +2 -2
  68. package/dist/cli-bundle/focused-chunks/{chunk-2DGKVXFT.js → chunk-RFDSSOTZ.js} +2 -2
  69. package/dist/cli-bundle/focused-chunks/chunk-SSX5YBDC.js +2 -0
  70. package/dist/cli-bundle/focused-chunks/{chunk-OG57ESZK.js → chunk-TIEQVIFN.js} +2 -2
  71. package/dist/cli-bundle/focused-chunks/{chunk-3COWDIPX.js → chunk-VEUBDQDP.js} +2 -2
  72. package/dist/cli-bundle/focused-chunks/{chunk-2UWKU2BQ.js → chunk-WDHNPNHX.js} +3 -3
  73. package/dist/cli-bundle/focused-chunks/{field-option-collisions-2C6DLUC4.js → field-option-collisions-32X7FP3H.js} +2 -2
  74. package/dist/cli-bundle/focused-chunks/item-revision-GUYSVVQD.js +2 -0
  75. package/dist/cli-bundle/focused-chunks/{item-transaction-LQLQLZE7.js → item-transaction-MLKHZPL7.js} +2 -2
  76. package/dist/cli-bundle/focused-chunks/{mutation-actor-DJMZUIZI.js → mutation-actor-RDZJTRW2.js} +2 -2
  77. package/dist/cli-bundle/focused-chunks/{mutation-admission-SDWQVVHN.js → mutation-admission-IQB6XL75.js} +2 -2
  78. package/dist/cli-bundle/focused-chunks/{stage-QBZIK3T5.js → stage-AA7LORZ2.js} +2 -2
  79. package/dist/cli-bundle/main.js +27 -27
  80. package/dist/cli-bundle/sdk-authoring.js +1 -1
  81. package/dist/cli-bundle/sdk-contracts.js +1 -1
  82. package/dist/cli-bundle/sdk-core.js +1 -1
  83. package/dist/cli-bundle/sdk-governance.js +1 -1
  84. package/dist/cli-bundle/sdk-graph.js +1 -1
  85. package/dist/cli-bundle/sdk-merge.js +63 -63
  86. package/dist/cli-bundle/sdk-query.js +1 -1
  87. package/dist/cli-bundle/sdk-runtime.js +1 -1
  88. package/dist/cli-bundle/sdk-testing.js +1 -1
  89. package/dist/cli-bundle/sdk.js +9 -9
  90. package/dist/core/extensions/loader.d.ts +8 -0
  91. package/dist/core/extensions/loader.js +1 -1
  92. package/dist/core/item/actionability.js +1 -1
  93. package/dist/core/output/output.js +16 -16
  94. package/dist/mcp/server.js +1 -1
  95. package/dist/sdk/cli-contracts/enum-contracts.d.ts +25 -1
  96. package/dist/sdk/cli-contracts/enum-contracts.js +1 -1
  97. package/dist/sdk/cli-contracts/flag-contracts.d.ts +1 -1
  98. package/dist/sdk/cli-contracts/flag-contracts.js +1 -1
  99. package/dist/sdk/cli-contracts/runtime-contracts.js +1 -1
  100. package/dist/sdk/cli-contracts/tool-parameter-tables.js +1 -1
  101. package/dist/sdk/cli-contracts/tool-schema.js +1 -1
  102. package/dist/sdk/context-intent-contracts.js +1 -1
  103. package/dist/sdk/lifecycle/expect-hash-admission.d.ts +27 -8
  104. package/dist/sdk/lifecycle/expect-hash-admission.js +1 -1
  105. package/dist/sdk/lifecycle/item-revision.d.ts +12 -4
  106. package/dist/sdk/lifecycle/item-revision.js +1 -1
  107. package/dist/sdk/output-projection.d.ts +1 -1
  108. package/dist/sdk/output-projection.js +1 -1
  109. package/dist/sdk/public-surface.json +1 -1
  110. package/dist/sdk/read-output/surfaces.js +1 -1
  111. package/dist/sdk/runtime/schema.js +1 -1
  112. package/dist/sdk/runtime-input.d.ts +6 -0
  113. package/dist/sdk/runtime-input.js +1 -1
  114. package/dist/sdk/runtime-primitives.d.ts +1 -1
  115. package/dist/sdk/runtime-primitives.js +1 -1
  116. package/dist/sdk/runtime.js +1 -1
  117. package/docs/COMMANDS.md +23 -5
  118. package/docs/EXTENSIONS.md +1 -1
  119. package/docs/SDK.md +15 -2
  120. package/marketplace.json +1 -1
  121. package/package.json +1 -1
  122. package/packages/pm-beads/package.json +1 -1
  123. package/packages/pm-calendar/package.json +1 -1
  124. package/packages/pm-command-kit/package.json +1 -1
  125. package/packages/pm-digital-twin/package.json +1 -1
  126. package/packages/pm-governance-audit/package.json +1 -1
  127. package/packages/pm-guide-shell/package.json +1 -1
  128. package/packages/pm-kanban/package.json +1 -1
  129. package/packages/pm-lifecycle-hooks/package.json +1 -1
  130. package/packages/pm-linked-test-adapters/package.json +1 -1
  131. package/packages/pm-search-advanced/package.json +1 -1
  132. package/packages/pm-templates/package.json +1 -1
  133. package/packages/pm-todos/package.json +1 -1
  134. package/packages/pm-vcs/package.json +1 -1
  135. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  136. package/plugins/pm-claude/package.json +1 -1
  137. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  138. package/plugins/pm-codex/package.json +1 -1
  139. package/plugins/pm-codex/plugin.json +1 -1
  140. package/runtime-dependencies.json +1 -1
  141. package/dist/cli-bundle/chunks/chunk-A5ZEMOVR.js +0 -2
  142. package/dist/cli-bundle/chunks/chunk-C6WM6ZN4.js +0 -9
  143. package/dist/cli-bundle/chunks/chunk-HZZLSBIJ.js +0 -2
  144. package/dist/cli-bundle/chunks/chunk-L2ZSSMYY.js +0 -2
  145. package/dist/cli-bundle/chunks/chunk-NRQCBUYD.js +0 -113
  146. package/dist/cli-bundle/chunks/chunk-QDV7S2QS.js +0 -2
  147. package/dist/cli-bundle/chunks/chunk-V2S4XAX3.js +0 -2
  148. package/dist/cli-bundle/chunks/item-revision-3LENTXYF.js +0 -2
  149. package/dist/cli-bundle/chunks/item-transaction-56J5OCHA.js +0 -2
  150. package/dist/cli-bundle/focused-chunks/chunk-HTDYNY4L.js +0 -2
  151. package/dist/cli-bundle/focused-chunks/chunk-J72TRWR5.js +0 -44
  152. package/dist/cli-bundle/focused-chunks/chunk-N64AC5G6.js +0 -100
  153. package/dist/cli-bundle/focused-chunks/chunk-QZRYGYTI.js +0 -2
  154. package/dist/cli-bundle/focused-chunks/chunk-SQMOF65W.js +0 -2
  155. package/dist/cli-bundle/focused-chunks/chunk-T3ILWAEV.js +0 -2
  156. package/dist/cli-bundle/focused-chunks/chunk-W4JMV7GF.js +0 -3
  157. package/dist/cli-bundle/focused-chunks/item-revision-723XCQPS.js +0 -2
@@ -1,8 +1,8 @@
1
- import{f as Bg}from"./chunks/chunk-3KEMIPKG.js";import{a as vN,b as kN,c as NN,d as LN}from"./chunks/chunk-4YYFY33T.js";import{a as $N,b as DN}from"./chunks/chunk-7NAO7I75.js";import{b as rN,c as nN,d as oN,e as iN,f as sN,g as aN,h as cN,i as dN,j as pN,k as lN,l as uN,m as mN,n as fN,o as _N,p as hN,q as gN,r as CN}from"./chunks/chunk-UNBW2LF3.js";import{a as kc,b as _d,c as hd,d as gd,e as Cd,f as yd,g as yN,h as SN,i as TN,j as EN,k as AN,l as xN,m as bN,n as wN,o as ON,p as RN,q as PN,r as MN,s as IN}from"./chunks/chunk-OBPO6V7H.js";import{a as aP,b as cP,c as Uc,d as jc,e as Bc,g as qc,h as zc,i as Hc,j as Vc,k as Kc,l as Wc,m as Yc,p as Xc}from"./chunks/chunk-MZZ4ZJ5Z.js";import{A as p0,B as l0,C as u0,D as m0,E as f0,F as _0,G as h0,H as g0,I as C0,J as y0,K as S0,L as T0,M as E0,N as A0,O as x0,P as b0,Q as w0,R as O0,S as R0,T as P0,U as M0,V as I0,W as v0,X as k0,Y as N0,Z as L0,_ as $0,a as FN,b as GN,c as UN,d as jN,e as BN,f as qN,g as zN,h as HN,i as VN,j as KN,k as WN,l as YN,m as XN,n as JN,o as QN,p as ZN,q as e0,r as t0,s as r0,t as n0,u as o0,v as i0,w as s0,x as a0,y as c0,z as d0}from"./chunks/chunk-TKUG2X24.js";import{$ as Af,$a as fh,$b as fg,A as Ke,Aa as $_,Ab as jh,Ac as jg,B as cf,Ba as D_,Bb as Bh,C as df,Ca as F_,Cb as qh,D as lf,Da as G_,Db as zh,E as uf,Ea as U_,Eb as Hh,F as Ht,Fa as j_,Fb as Vh,G as Vt,Ga as B_,Gb as Kh,H as Kt,Ha as q_,Hb as Wh,I as Wt,Ia as z_,Ib as Yh,J as Yt,Ja as H_,Jb as Xh,K as Xt,Ka as V_,Kb as Jh,L as Jt,La as K_,Lb as Qh,M as Qt,Ma as W_,Mb as Zh,N as Zt,Na as Y_,Nb as eg,O as er,Oa as X_,Ob as tg,P as tr,Pa as J_,Pb as rg,Q as mf,Qa as Q_,Qb as ng,R as ff,Ra as Z_,Rb as og,S as _f,Sa as eh,Sb as ig,T as hf,Ta as th,Tb as sg,U as gf,Ua as rh,Ub as ag,V as We,Va as rr,Vb as cg,W as Cf,Wa as _e,Wb as dg,X as yf,Xa as ph,Xb as pg,Y as Sf,Ya as lh,Yb as lg,Z as Tf,Za as uh,Zb as ug,_ as Ef,_a as mh,_b as mg,a as GR,aa as xf,ab as _h,ac as _g,b as UR,ba as bf,bb as hh,bc as hg,c as jR,ca as Dk,cb as gh,cc as gg,d as BR,da as Fk,db as Ch,dc as Cg,e as qR,ea as Gk,eb as yh,ec as yg,f as zR,fa as Ff,fb as Sh,fc as Sg,g as KR,ga as Gf,gb as Th,gc as Tg,h as WR,ha as Uf,hb as Eh,hc as Eg,i as YR,ia as w_,ib as Ah,ic as Ag,j as XR,ja as O_,jb as xh,jc as xg,k as Nc,ka as Wk,kb as bh,kc as bg,la as Yk,lb as wh,lc as wg,m as VM,ma as Xk,mb as Oh,mc as Og,n as KM,na as Jk,nb as Rh,nc as Rg,o as WM,oa as Qk,ob as Ph,oc as Pg,p as YM,pa as Zk,pb as Mh,pc as Mg,q as XM,qa as eN,qb as Ih,qc as Ig,r as JM,ra as tN,rb as vh,rc as vg,s as ol,sa as R_,sb as kh,sc as kg,t as Gu,ta as P_,tb as Nh,tc as Ng,u as Uu,ua as M_,ub as Lh,uc as Lg,v as qu,va as I_,vb as $h,vc as $g,w as zu,wa as v_,wb as Dh,wc as Dg,x as pm,xa as k_,xb as Fh,xc as Fg,y as gm,ya as N_,yb as Gh,yc as Gg,z as xv,za as L_,zb as Uh,zc as Ug}from"./chunks/chunk-ROTEELDL.js";import{e as eI,f as tI,g as il,h as sl,i as Bt}from"./chunks/chunk-G6TARHFK.js";import{A as wk,B as Ok,C as Rk,D as Pk,E as Mk,F as Ik,G as vk,H as kk,I as Nk,J as Lk,K as $k,L as Rf,M as Pf,N as Mf,O as If,P as vf,Q as kf,R as Nf,S as Lf,T as $f,U as Df,a as av,b as cv,c as dv,d as pv,e as lv,f as Fu,g as uv,h as mv,i as fv,j as _v,k as hv,m as pf,n as wf,o as _k,p as hk,q as gk,r as Ck,s as yk,t as Sk,u as Of,v as Tk,w as Ek,x as Ak,y as xk,z as bk}from"./chunks/chunk-SY5C3U32.js";import{$ as rM,$a as jl,$b as dm,$c as ih,Aa as OM,Ab as QI,Ac as Kf,Ba as RM,Bb as Nu,Bc as Wf,C as ze,Ca as PM,Cb as Lu,Cc as Yf,D as ee,Da as MM,Db as $u,Dc as Hk,E as fp,Ea as IM,Eb as ZI,Ec as Vk,Fb as ev,Fc as Kk,Gb as tv,Gc as Xf,H as He,Ha as QM,Hb as rv,Hc as Jf,I as _p,Ia as ZM,Ib as nv,Ic as Qf,J as hp,Ja as Jp,Jb as ov,Jc as Zf,Ka as Qp,Kb as iv,Kc as e_,L as fe,La as Zp,Lb as sv,Lc as t_,M as gp,Ma as el,Mb as Du,Mc as r_,N as Cp,Na as tl,Nb as gv,Nc as n_,O as yp,Oa as rl,Ob as Cv,Oc as o_,P as Sp,Pa as nl,Pb as yv,Pc as i_,Q as KP,Qa as vl,Qb as Sv,Qc as s_,R as WP,Ra as kl,Rb as Tv,Rc as a_,S as YP,Sa as oI,Sc as c_,T as XP,Ta as Nl,Tb as ju,Tc as d_,U as JP,Ua as Ll,Ub as Bu,Uc as f_,V as Nt,Va as $l,Vb as Hu,Vc as __,W as QP,Wa as Dl,Wb as Vu,X as ZP,Xa as iI,Xc as h_,Y as Lt,Ya as Fl,Yc as b_,Z as eM,Za as Gl,Zb as Ev,Zc as nh,_ as tM,_a as Ul,_b as Av,_c as oh,a as dP,aa as nM,ab as Bl,ac as Cm,ad as sh,b as Mt,ba as oM,bb as sI,bc as ym,bd as ah,c as pP,ca as Ve,cb as aI,cc as Sm,cd as ch,d as sd,da as iM,db as cI,dc as Tm,dd as dh,e as ad,ea as $t,eb as dI,ec as Em,f as cd,fa as sM,fb as pI,g as dd,ga as aM,gb as lI,h as pd,ha as cM,hb as uI,ia as dM,ib as hI,j as ld,ja as pM,jb as Eu,jc as Am,k as ud,ka as lM,kb as gI,la as uM,lb as NI,lc as Zm,ma as mM,mb as LI,mc as ef,na as fM,nb as $I,nc as tf,o as md,oa as _M,ob as DI,p as fd,pa as hM,pb as FI,pc as rf,qa as gM,qb as GI,qc as nf,ra as CM,rb as UI,rc as of,sa as yM,sb as VI,sc as sf,ta as SM,tb as KI,tc as af,ua as TM,ub as Au,uc as jf,va as EM,vb as xu,vc as Bf,w as vt,wa as AM,wb as WI,wc as qf,xa as xM,xb as YI,xc as zf,y as kt,ya as bM,yb as XI,yc as Hf,za as wM,zb as JI,zc as Vf}from"./chunks/chunk-SDXCJZKB.js";import{$a as RI,$b as Vv,A as GP,Aa as fu,Ab as Pm,Ac as Bm,B as rp,Ba as _u,Bb as Mm,Bc as qm,C as np,Ca as hu,Cb as Im,Cc as zm,D as op,Da as gu,Db as vm,Dc as Hm,E as ip,Ea as Cu,Eb as wv,Ec as Vm,F as sp,Fa as yu,Fb as Ov,Fc as Km,G as ap,Ga as Su,Gb as Rv,Gc as Wm,H as cp,Ha as Tu,Hb as Pv,Hc as Ym,I as dp,Ib as Mv,Ic as Xm,J as pp,Jb as Iv,Jc as zt,K as lp,Kb as vv,Kc as Jm,L as up,La as mI,Lc as lk,M as qe,Ma as fI,Mb as km,Mc as uk,N as UP,Na as _I,Nb as Nm,Nc as mk,O as jP,Oa as CI,Ob as kv,Oc as Qm,P as BP,Pa as yI,Pb as Nv,Pc as fk,Q as qP,Qa as SI,Qb as Lv,Qc as Uk,R as zP,Ra as TI,Rb as $v,Rc as jk,S as HP,Sa as EI,Sb as Dv,Sc as Bk,T as VP,Ta as AI,Tb as Fv,Tc as qk,U as mp,Ua as xI,Ub as Gv,Uc as zk,V as al,Va as bI,Vb as Uv,W as cl,Wa as wI,Wb as jv,X as dl,Xa as OI,Xb as Bv,Y as pl,Yb as qv,Z as rI,Zb as zv,_ as nI,_b as Hv,a as JR,aa as ll,ac as Kv,b as QR,ba as ql,bb as PI,bc as Wv,c as ZR,ca as zl,cb as MI,cc as Yv,d as eP,da as Hl,dc as Xv,e as bP,ea as Vl,ec as Jv,f as wP,fa as Kl,fb as II,fc as Qv,g as OP,ga as Wl,gb as vI,gc as Zv,h as RP,ha as Yl,hb as kI,hc as ek,i as PP,ia as Xl,ic as tk,j as MP,ja as Jl,jb as jI,jc as rk,k as IP,ka as Ql,kb as BI,kc as nk,la as Zl,lb as qI,lc as ok,ma as eu,mb as zI,mc as ik,na as tu,nb as HI,nc as sk,oa as ru,ob as lm,oc as ak,pa as nu,pb as um,pc as ck,qa as ou,qb as mm,qc as dk,ra as iu,rb as fm,rc as pk,sa as su,sb as _m,sc as qt,t as vP,ta as au,tb as hm,tc as Lm,u as kP,ua as cu,ub as xm,uc as $m,v as NP,va as du,vb as bm,vc as Dm,w as LP,wa as pu,wb as wm,wc as Fm,x as $P,xa as lu,xb as Om,xc as Gm,y as DP,ya as uu,yb as Rm,yc as Um,z as FP,za as mu,zb as bv,zc as jm}from"./chunks/chunk-ZL6J6JYT.js";import"./chunks/chunk-X5D5YUHR.js";import"./chunks/chunk-4QA5O64H.js";import{x as tp}from"./chunks/chunk-L2ZSSMYY.js";import{$ as m_,A as Mu,B as Iu,C as vu,D as ku,I as Ku,J as Wu,K as Yu,L as Xu,M as Ju,N as Qu,O as Zu,P as em,Q as tm,R as rm,S as nm,T as om,U as im,V as sm,W as am,X as cm,Y as p_,Z as l_,_ as u_,b as ul,ba as g_,c as ml,ca as C_,d as fl,da as y_,e as _l,ea as S_,f as hl,g as gl,ga as T_,h as Cl,ha as E_,i as yl,ia as A_,j as Sl,ja as x_,k as Tl,l as El,m as Al,n as xl,o as bl,p as wl,q as Ol,r as Rl,s as Pl,t as Ml,u as Il,v as bu,w as wu,x as Ou,y as Ru,z as Pu}from"./chunks/chunk-GOEQXVOI.js";import{A as Lp,Aa as Kp,B as $p,C as Dt,Ca as Wp,Da as Yp,Ea as Xp,b as tP,c as rP,d as nP,da as Ft,e as oP,ea as Gt,f as iP,fa as Ut,g as sP,ga as jt,h as Lc,i as $c,j as Dc,ja as Dp,k as Fc,l as Gc,la as Fp,ma as Gp,n as vM,na as Up,s as jM,t as BM,ta as jp,ua as Bp,v as qM,w as zM,wa as qp,x as HM,xa as zp,y as kp,ya as Hp,z as Np,za as Vp}from"./chunks/chunk-7V65VACG.js";import{a as HR,b as VR}from"./chunks/chunk-3HKPVOAN.js";import"./chunks/chunk-6H36ZHMI.js";import{a as kM,b as NM,c as LM,d as $M,e as DM,f as FM,g as GM,h as bp,i as wp,j as Op,k as Rp,l as Pp,m as UM,n as Mp,o as Ip,p as vp}from"./chunks/chunk-Q6K7HWZ7.js";import{a as Tp,b as Ep,e as Ap,f as xp}from"./chunks/chunk-OGVSGXQX.js";import"./chunks/chunk-AA52P34H.js";import{$ as Vd,A as Dd,B as Fd,C as Gd,D as Ud,E as jd,F as Bd,G as qd,H as lP,I as uP,J as mP,K as fP,L as _P,M as hP,Q as gP,R as CP,S as yP,T as SP,U as TP,V as EP,W as AP,X as xP,Z as zd,_ as Hd,a as Jc,aa as Kd,b as Qc,ba as Wd,c as Zc,ca as Yd,d as ed,da as Xd,e as td,ea as Jd,f as rd,fa as Qd,g as nd,ga as Zd,h as od,ha as ep,i as id,ia as It,j as Sd,k as Td,l as Ed,m as Ad,n as xd,o as bd,p as wd,q as Od,r as Rd,s as Pd,t as Md,u as Id,v as vd,w as kd,x as Nd,y as Ld,z as $d}from"./chunks/chunk-C6WM6ZN4.js";import{b as MR,c as IR,d as vR,e as kR,f as NR,g as LR,h as $R,i as DR,j as FR,k as xc,l as bc,m as wc,n as Oc,o as Rc,p as Pc,r as Mc,t as Ic,z as vc}from"./chunks/chunk-QDV7S2QS.js";import{b as OR}from"./chunks/chunk-AHV3CSQG.js";import"./chunks/chunk-PZA7QECY.js";import{$ as jb,$c as BO,A as ST,Ac as NO,Ad as PR,B as TT,Bb as nO,Bc as LO,C as ET,Cc as $O,Dc as Ss,Ec as Ts,Fb as oO,Fc as Es,Gb as iO,Gc as As,Ha as fw,Hb as sO,Hc as xs,Ia as _w,Ib as ds,Ic as bs,Ja as hw,Jb as aO,Jc as ws,K as vT,Ka as gw,Kc as Os,La as Cw,Lb as cO,Lc as Rs,M as jT,Ma as yw,Mb as dO,Mc as Ps,N as BT,Na as bw,Nb as pO,Nc as Ms,O as qT,Oa as ww,Ob as lO,Oc as Is,P as zT,Pa as Ow,Pb as uO,Pc as vs,Q as XT,Qa as wt,Qb as mO,Qc as ks,R as JT,Rb as fO,Sa as Rw,Sb as _O,Sc as Ns,T as Lb,Ta as Pw,Tb as hO,Tc as DO,Ua as Mw,Ub as gO,Uc as FO,V as $b,Va as Iw,Vb as Ot,Vc as Ls,W as Db,Wa as vw,Wb as CO,Wc as GO,Xb as yO,Xc as UO,Y as Fb,Yc as $s,Z as Gb,Za as kw,Zc as Ds,_ as Ub,_c as jO,a as aT,aa as Bb,ad as qO,ba as qb,bb as rs,bc as ps,bd as zO,ca as zb,cc as ls,cd as HO,da as ew,db as qw,dc as us,dd as VO,eb as zw,ec as ms,ed as KO,fa as Qi,fb as Hw,fd as Fs,ga as Zi,gb as Vw,gc as fs,gd as Gs,ha as es,hc as _s,hd as WO,i as io,ib as Kw,ic as hs,id as YO,j as cT,ja as tw,jb as Ww,jc as gs,jd as XO,k as dT,ka as rw,kb as Yw,kc as Cs,kd as JO,l as pT,la as nw,lb as Xw,lc as ys,ld as QO,m as lT,ma as ow,mb as ss,mc as SO,md as ZO,na as iw,nb as as,nc as TO,nd as eR,o as uT,oa as sw,oc as EO,od as tR,p as mT,pa as aw,pb as cs,pc as AO,pd as rR,qb as Jw,qc as xO,qd as nR,r as fT,ra as cw,rc as bO,rd as oR,sb as Qw,sc as wO,t as _T,ta as dw,tb as Zw,tc as OO,u as hT,ua as pw,ub as eO,uc as RO,v as gT,va as lw,vc as PO,vd as Rt,wa as uw,wb as tO,wc as MO,wd as iR,x as CT,xa as mw,xc as IO,xd as sR,y as yT,yc as vO,yd as aR,zb as rO,zc as kO,zd as RR}from"./chunks/chunk-CBUC4X7Q.js";import{A as Fw,B as Gw,C as Uw,D as jw,E as Bw,F as ns,G as os,H as is,a as Hb,b as Vb,c as Kb,d as Wb,e as Yb,f as Xb,g as Jb,h as Qb,i as Zb,l as Sw,o as Tw,p as Ew,t as Aw,u as ts,v as xw,w as Nw,x as Lw,y as $w,z as Dw}from"./chunks/chunk-OXC5KBIQ.js";import"./chunks/chunk-3AZOATC2.js";import{$a as Zo,$c as bi,$d as qA,A as Qn,Aa as Bo,Ab as li,Ac as GE,Ae as hx,B as Zn,Ba as qo,Bb as ui,Bc as UE,Bd as gA,Be as gx,C as eo,Ca as zo,Cb as mi,Cc as jE,Cd as CA,Cg as cb,D as to,Da as Ho,Db as fi,Dc as BE,Dd as yA,Df as Bx,Dg as db,E as ro,Ea as Vo,Eb as _i,Ec as qE,Ed as SA,Ee as Cx,Ef as Ge,Eg as pb,F as no,Fa as gE,Fc as zE,Fd as TA,Fe as yx,Ff as xt,G as oo,Ga as CE,Gc as HE,Gd as EA,Ge as Sx,Gf as qx,Gg as lb,Hb as xE,Hc as VE,Hd as AA,He as Tx,Hf as zx,Hg as ub,Ib as bE,Ic as KE,Id as xA,Ie as Ex,If as Hx,Jb as hi,Jc as WE,Jd as bA,Je as Ax,Jf as Vx,Jg as mb,Kc as YE,Kd as wA,Ke as xx,Kf as q,Kg as Vi,Lc as XE,Ld as OA,Le as bx,Lf as Kx,M as Ct,Mc as JE,Md as RA,Mf as Wx,Mg as Ki,N as yt,Nb as wE,Nc as QE,Nd as PA,Nf as Yx,Ng as Wi,Ob as OE,Oc as ZE,Od as MA,Of as Xx,Pc as eA,Pd as IA,Pe as wx,Q as No,Qc as tA,Qd as vA,Qe as Ox,Qf as zi,Qg as fb,Rc as rA,Rd as kA,Rf as Hi,Rg as _b,S as kT,Sa as Ko,Sc as nA,Sd as NA,Sg as hb,T as NT,Ta as Wo,Tc as oA,Td as LA,Te as Rx,Tg as gb,Ua as yE,Uc as iA,Ud as $A,Ue as Px,Ug as Cb,Va as Yo,Vc as sA,Vd as DA,Ve as Mx,Vg as yb,Wa as Xo,Wc as aA,Wd as FA,We as Ix,Wg as Sb,X as LT,Xa as SE,Xb as RE,Xd as GA,Xe as vx,Xg as Yi,Ya as Jo,Yb as PE,Yc as Ei,Yd as UA,Ye as kx,Yg as Tb,Za as Qo,Zb as ME,Zc as Ai,Zd as jA,Ze as Nx,Zg as Eb,_ as $T,_a as L,_b as IE,_c as xi,_d as BA,_e as Lx,a as XS,ac as vE,ad as wi,ae as zA,af as $x,ag as Jx,ah as Ab,b as JS,ba as DT,bc as kE,bd as Oi,be as HA,bf as Dx,bg as bt,bh as xb,c as QS,cd as Ri,ce as VA,cf as Fx,cg as Qx,ch as bb,d as ZS,dd as Pi,de as KA,df as Gx,dg as Zx,dh as wb,e as eT,ea as FT,ed as Mi,ee as WA,ef as Ux,eg as eb,eh as Ob,f as tT,fa as HT,fb as Fe,fd as Ii,fe as YA,fh as Rb,g as rT,ga as VT,gb as ei,gd as vi,ge as XA,gf as jx,gh as Xi,h as nT,ha as KT,hc as NE,hd as ki,he as JA,hf as Bi,hg as tb,i as oT,ia as WT,id as Ni,ie as QA,if as qi,ig as rb,j as iT,ja as YT,jc as gi,jd as Li,je as ZA,jg as nb,jh as Pb,k as sT,ka as QT,kc as Ci,kd as $i,ke as ex,kg as ob,kh as Ji,l as Gn,la as ZT,lc as yi,ld as Di,le as tx,lg as ib,m as Un,ma as eE,mc as Si,md as Fi,me as rx,n as jn,na as tE,nb as TE,nd as Gi,ne as nx,nh as Mb,o as Bn,oa as rE,ob as EE,od as Ui,oe as ox,og as sb,oh as Ib,p as qn,pa as nE,pb as AE,pd as ji,pe as ix,ph as vb,q as zn,qa as oE,qb as ti,qd as cA,qe as sx,qg as ab,qh as kb,r as Hn,ra as iE,rb as ri,rd as dA,re as ax,rh as Nb,s as Ne,sa as sE,sb as ni,sc as LE,sd as pA,se as cx,t as Le,ta as aE,tb as oi,tc as $E,td as lA,te as dx,u as Vn,ua as cE,ub as ii,uc as DE,ud as uA,ue as px,v as Kn,va as dE,vb as si,vd as mA,ve as lx,w as Wn,wa as pE,wb as ai,wd as fA,we as ux,x as Yn,xa as Uo,xb as ci,xd as _A,xe as mx,y as Xn,ya as jo,yb as di,yc as Ti,yd as hA,ye as fx,z as Jn,zb as pi,ze as _x}from"./chunks/chunk-NRQCBUYD.js";import{b as AT,c as xT,d as bT,g as go,h as wT,i as OT,j as RT,k as PT,m as Co,n as yo,o as De,p as MT,q as IT,r as So,s as To,u as Eo}from"./chunks/chunk-GSLOAEY2.js";import"./chunks/chunk-WSEIEDEK.js";import{$ as oa,$a as oc,A as wR,Aa as Ia,B as js,Ba as va,C as Bs,Ca as ka,D as qs,Da as Na,Ea as La,Fa as $a,Ga as Da,Ha as Fa,Ia as Ga,Ja as Ua,K as zs,Ka as ja,L as Hs,La as Ba,M as Vs,Ma as qa,N as Ks,Na as za,O as Ws,Oa as Ha,P as Ys,Pa as Va,Q as Xs,Qa as Ka,Ra as Wa,Sa as Ya,T as Js,Ta as Xa,U as Qs,Ua as Ja,V as Zs,Va as Qa,W as ea,Wa as Za,X as ta,Xa as ec,Y as ra,Ya as tc,Z as na,Za as rc,_a as nc,aa as ia,ab as ic,b as cR,ba as sa,bb as sc,c as dR,ca as aa,cb as ac,d as pR,da as ca,db as cc,e as lR,ea as da,eb as dc,f as uR,fa as pa,fb as pc,ga as la,gb as lc,h as mR,ha as ua,hb as uc,i as fR,ia as ma,ib as mc,j as Us,ja as fa,jb as fc,k as _R,ka as _a,kb as _c,la as ha,lb as hc,ma as ga,mb as gc,n as hR,na as Ca,nb as Cc,o as gR,oa as ya,ob as yc,p as Ue,pa as Sa,pb as Sc,q as CR,qa as Ta,qb as Tc,r as yR,ra as Ea,rb as Ec,s as SR,sa as Aa,t as Pt,ta as xa,tb as Be,u as je,ua as ba,v as TR,va as wa,vb as Z,w as ER,wa as Oa,wb as Ac,x as AR,xa as Ra,y as xR,ya as Pa,z as bR,za as Ma}from"./chunks/chunk-A5ZEMOVR.js";import{I as ko,L as Tt,N as Et,Q as Lo,R as $o,S as At,U as GT,W as UT,Y as Go,a as R,b as YS,c as gt,da as fE,e as Mn,f as In,g as vn,ga as _E,h as kn,ha as hE,i as ve,j as Nn,k as N,ka as FE,l as ke,m as Ln,n as $n,o as Dn,p as Fn,q as Ao,r as xo,s as bo,t as wo,u as Oo,v as Ro,w as Po,x as Mo,y as Io,z as vo}from"./chunks/chunk-I4SPJQQI.js";import{_ as lE,a as po,b as lo,ba as Do,c as uo,ca as uE,da as Fo,fa as mE,h as mo,j as fo,k as _o,l as ho}from"./chunks/chunk-TE6FBDHP.js";import{A as ue,B as WS,C as S,E as so,F as St,G as me,H as ao,L as $e,N as co,b as jS,c as BS,d as qS,m as zS,r as HS,u as VS,y as KS}from"./chunks/chunk-K672XXGQ.js";import"./chunks/chunk-XAWE4EAK.js";var z="2026-07-28",or=["2025-11-25","2025-06-18"],te=[z],m={headerMismatch:-32020,missingRequiredClientCapability:-32021,unsupportedProtocolVersion:-32022,invalidParams:-32602},x={clientCapabilities:"io.modelcontextprotocol/clientCapabilities",clientInfo:"io.modelcontextprotocol/clientInfo",logLevel:"io.modelcontextprotocol/logLevel",protocolVersion:"io.modelcontextprotocol/protocolVersion",serverInfo:"io.modelcontextprotocol/serverInfo"},nr=["debug","info","notice","warning","error","critical","alert","emergency"],u=class extends Error{code;data;constructor(t,r,n={}){super(t),this.name="PmMcpProtocolError",this.code=r,this.data=n}};function h(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function qg(e){if(e===void 0)return;if(!h(e))throw new u("Invalid MCP clientInfo metadata",m.invalidParams,{field:x.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:x.clientInfo,required:["name","version"]});let n={name:t.slice(0,128),version:r.slice(0,128)};return typeof e.description=="string"&&e.description.trim()&&(n.description=e.description.trim().slice(0,1024)),typeof e.websiteUrl=="string"&&e.websiteUrl.trim()&&(n.websiteUrl=e.websiteUrl.trim().slice(0,2048)),n}function zg(e){if(e!==void 0){if(typeof e!="string"||!nr.includes(e))throw new u("Invalid MCP logLevel metadata",m.invalidParams,{field:x.logLevel,allowed:[...nr]});return e}}function Ye(e){let t=h(e)?e._meta:void 0;if(!h(t))throw new u("Missing required MCP request metadata",m.invalidParams,{required:[x.protocolVersion,x.clientCapabilities]});let r=t[x.protocolVersion];if(typeof r!="string"||!te.includes(r))throw new u("Unsupported protocol version",m.unsupportedProtocolVersion,{supported:[...te],requested:typeof r=="string"?r:null});let n=t[x.clientCapabilities];if(!h(n))throw new u("Invalid MCP client capabilities metadata",m.invalidParams,{field:x.clientCapabilities,expected:"object"});let o=qg(t[x.clientInfo]),i=zg(t[x.logLevel]);return{protocolVersion:z,clientCapabilities:n,...o?{clientInfo:o}:{},...i?{logLevel:i}:{}}}function D0(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 F0(e,t){let r=t.filter(n=>!Object.prototype.hasOwnProperty.call(e.clientCapabilities,n));if(r.length>0)throw new u("Missing required client capability",m.missingRequiredClientCapability,{requiredCapabilities:Object.fromEntries(r.map(n=>[n,{}]))})}function G0(e,t){let r=e.clientCapabilities.extensions;return h(r)&&h(r[t])}function Xe(e,t){let r=h(e._meta)?e._meta:{};return{...e,_meta:{...r,[x.serverInfo]:{...t}}}}function Hg(e,t){return Xe({...e,resultType:"complete"},t)}function U0(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 Hg({supportedVersions:[...te],capabilities:structuredClone(e.capabilities),ttlMs:t,cacheScope:"public",...e.instructions?{instructions:e.instructions}:{}},e.serverInfo)}function j0(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"})}var Vg=new Set(["--help","-h","--version","-V"]);function Kg(e,t){let n=[`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"&&n.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."),n.push("",`MCP protocol: ${te.join(", ")}.`,e==="stdio"?`Legacy initialize compatibility: ${or.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",""),n.join(`
2
- `)}function z0(e,t,r){if(e.length===0)return{kind:"serve"};let n=e.find(i=>!Vg.has(i));if(n!==void 0){let i=t==="stdio"?"pm-mcp":"pm-mcp-http";return{kind:"exit",exitCode:64,stdout:"",stderr:`Unsupported argument ${JSON.stringify(n)}. Run ${i} --help.
1
+ import{f as Bg}from"./chunks/chunk-6TOZQ5BQ.js";import{a as kN,b as NN,c as LN,d as $N}from"./chunks/chunk-AHVOEE7F.js";import{a as DN,b as FN}from"./chunks/chunk-H4U3LEOD.js";import{b as nN,c as oN,d as iN,e as sN,f as aN,g as cN,h as dN,i as pN,j as lN,k as uN,l as mN,m as fN,n as _N,o as hN,p as gN,q as CN,r as yN}from"./chunks/chunk-MRT3ADO4.js";import{a as kc,b as _d,c as hd,d as gd,e as Cd,f as yd,g as SN,h as TN,i as EN,j as AN,k as xN,l as bN,m as wN,n as ON,o as RN,p as PN,q as MN,r as IN,s as vN}from"./chunks/chunk-5WTBF4M4.js";import{a as cP,b as dP,c as Uc,d as jc,e as Bc,g as qc,h as zc,i as Hc,j as Vc,k as Kc,l as Wc,m as Yc,p as Xc}from"./chunks/chunk-HNMED75Y.js";import{A as l0,B as u0,C as m0,D as f0,E as _0,F as h0,G as g0,H as C0,I as y0,J as S0,K as T0,L as E0,M as A0,N as x0,O as b0,P as w0,Q as O0,R as R0,S as P0,T as M0,U as I0,V as v0,W as k0,X as N0,Y as L0,Z as $0,_ as D0,a as GN,b as UN,c as jN,d as BN,e as qN,f as zN,g as HN,h as VN,i as KN,j as WN,k as YN,l as XN,m as JN,n as QN,o as ZN,p as e0,q as t0,r as r0,s as n0,t as o0,u as i0,v as s0,w as a0,x as c0,y as d0,z as p0}from"./chunks/chunk-FWQNWPIV.js";import{$ as Af,$a as fh,$b as fg,A as Ke,Aa as $_,Ab as jh,Ac as jg,B as cf,Ba as D_,Bb as Bh,C as df,Ca as F_,Cb as qh,D as lf,Da as G_,Db as zh,E as uf,Ea as U_,Eb as Hh,F as Ht,Fa as j_,Fb as Vh,G as Vt,Ga as B_,Gb as Kh,H as Kt,Ha as q_,Hb as Wh,I as Wt,Ia as z_,Ib as Yh,J as Yt,Ja as H_,Jb as Xh,K as Xt,Ka as V_,Kb as Jh,L as Jt,La as K_,Lb as Qh,M as Qt,Ma as W_,Mb as Zh,N as Zt,Na as Y_,Nb as eg,O as er,Oa as X_,Ob as tg,P as tr,Pa as J_,Pb as rg,Q as mf,Qa as Q_,Qb as ng,R as ff,Ra as Z_,Rb as og,S as _f,Sa as eh,Sb as ig,T as hf,Ta as th,Tb as sg,U as gf,Ua as rh,Ub as ag,V as We,Va as rr,Vb as cg,W as Cf,Wa as _e,Wb as dg,X as yf,Xa as ph,Xb as pg,Y as Sf,Ya as lh,Yb as lg,Z as Tf,Za as uh,Zb as ug,_ as Ef,_a as mh,_b as mg,a as UR,aa as xf,ab as _h,ac as _g,b as jR,ba as bf,bb as hh,bc as hg,c as BR,ca as Fk,cb as gh,cc as gg,d as qR,da as Gk,db as Ch,dc as Cg,e as zR,ea as Uk,eb as yh,ec as yg,f as HR,fa as Ff,fb as Sh,fc as Sg,g as WR,ga as Gf,gb as Th,gc as Tg,h as YR,ha as Uf,hb as Eh,hc as Eg,i as XR,ia as w_,ib as Ah,ic as Ag,j as JR,ja as O_,jb as xh,jc as xg,k as Nc,ka as Yk,kb as bh,kc as bg,la as Xk,lb as wh,lc as wg,m as KM,ma as Jk,mb as Oh,mc as Og,n as WM,na as Qk,nb as Rh,nc as Rg,o as YM,oa as Zk,ob as Ph,oc as Pg,p as XM,pa as eN,pb as Mh,pc as Mg,q as JM,qa as tN,qb as Ih,qc as Ig,r as QM,ra as rN,rb as vh,rc as vg,s as ol,sa as R_,sb as kh,sc as kg,t as Gu,ta as P_,tb as Nh,tc as Ng,u as Uu,ua as M_,ub as Lh,uc as Lg,v as qu,va as I_,vb as $h,vc as $g,w as zu,wa as v_,wb as Dh,wc as Dg,x as pm,xa as k_,xb as Fh,xc as Fg,y as gm,ya as N_,yb as Gh,yc as Gg,z as bv,za as L_,zb as Uh,zc as Ug}from"./chunks/chunk-E5ADC3HT.js";import{e as tI,f as rI,g as il,h as sl,i as Bt}from"./chunks/chunk-PJMGWJKU.js";import{A as Ok,B as Rk,C as Pk,D as Mk,E as Ik,F as vk,G as kk,H as Nk,I as Lk,J as $k,K as Dk,L as Rf,M as Pf,N as Mf,O as If,P as vf,Q as kf,R as Nf,S as Lf,T as $f,U as Df,a as cv,b as dv,c as pv,d as lv,e as uv,f as Fu,g as mv,h as fv,i as _v,j as hv,k as gv,m as pf,n as wf,o as hk,p as gk,q as Ck,r as yk,s as Sk,t as Tk,u as Of,v as Ek,w as Ak,x as xk,y as bk,z as wk}from"./chunks/chunk-E5HO7HWP.js";import{$ as nM,$a as jl,$b as dm,$c as ih,Aa as RM,Ab as ZI,Ac as Kf,Ba as PM,Bb as Nu,Bc as Wf,C as ze,Ca as MM,Cb as Lu,Cc as Yf,D as ee,Da as IM,Db as $u,Dc as Vk,E as fp,Ea as vM,Eb as ev,Ec as Kk,Fb as tv,Fc as Wk,Gb as rv,Gc as Xf,H as He,Ha as ZM,Hb as nv,Hc as Jf,I as _p,Ia as eI,Ib as ov,Ic as Qf,J as hp,Ja as Jp,Jb as iv,Jc as Zf,Ka as Qp,Kb as sv,Kc as e_,L as fe,La as Zp,Lb as av,Lc as t_,M as gp,Ma as el,Mb as Du,Mc as r_,N as Cp,Na as tl,Nb as Cv,Nc as n_,O as yp,Oa as rl,Ob as yv,Oc as o_,P as Sp,Pa as nl,Pb as Sv,Pc as i_,Q as WP,Qa as vl,Qb as Tv,Qc as s_,R as YP,Ra as kl,Rb as Ev,Rc as a_,S as XP,Sa as iI,Sc as c_,T as JP,Ta as Nl,Tb as ju,Tc as d_,U as QP,Ua as Ll,Ub as Bu,Uc as f_,V as Nt,Va as $l,Vb as Hu,Vc as __,W as ZP,Wa as Dl,Wb as Vu,X as eM,Xa as sI,Xc as h_,Y as Lt,Ya as Fl,Yc as b_,Z as tM,Za as Gl,Zb as Av,Zc as nh,_ as rM,_a as Ul,_b as xv,_c as oh,a as pP,aa as oM,ab as Bl,ac as Cm,ad as sh,b as Mt,ba as iM,bb as aI,bc as ym,bd as ah,c as lP,ca as Ve,cb as cI,cc as Sm,cd as ch,d as sd,da as sM,db as dI,dc as Tm,dd as dh,e as ad,ea as $t,eb as pI,ec as Em,f as cd,fa as aM,fb as lI,g as dd,ga as cM,gb as uI,h as pd,ha as dM,hb as mI,ia as pM,ib as gI,j as ld,ja as lM,jb as Eu,jc as Am,k as ud,ka as uM,kb as CI,la as mM,lb as LI,lc as Zm,ma as fM,mb as $I,mc as ef,na as _M,nb as DI,nc as tf,o as md,oa as hM,ob as FI,p as fd,pa as gM,pb as GI,pc as rf,qa as CM,qb as UI,qc as nf,ra as yM,rb as jI,rc as of,sa as SM,sb as KI,sc as sf,ta as TM,tb as WI,tc as af,ua as EM,ub as Au,uc as jf,va as AM,vb as xu,vc as Bf,w as vt,wa as xM,wb as YI,wc as qf,xa as bM,xb as XI,xc as zf,y as kt,ya as wM,yb as JI,yc as Hf,za as OM,zb as QI,zc as Vf}from"./chunks/chunk-HPCMM74Q.js";import{$a as PI,$b as Kv,A as UP,Aa as fu,Ab as Pm,Ac as Bm,B as rp,Ba as _u,Bb as Mm,Bc as qm,C as np,Ca as hu,Cb as Im,Cc as zm,D as op,Da as gu,Db as vm,Dc as Hm,E as ip,Ea as Cu,Eb as Ov,Ec as Vm,F as sp,Fa as yu,Fb as Rv,Fc as Km,G as ap,Ga as Su,Gb as Pv,Gc as Wm,H as cp,Ha as Tu,Hb as Mv,Hc as Ym,I as dp,Ib as Iv,Ic as Xm,J as pp,Jb as vv,Jc as zt,K as lp,Kb as kv,Kc as Jm,L as up,La as fI,Lc as uk,M as qe,Ma as _I,Mb as km,Mc as mk,N as jP,Na as hI,Nb as Nm,Nc as fk,O as BP,Oa as yI,Ob as Nv,Oc as Qm,P as qP,Pa as SI,Pb as Lv,Pc as _k,Q as zP,Qa as TI,Qb as $v,Qc as jk,R as HP,Ra as EI,Rb as Dv,Rc as Bk,S as VP,Sa as AI,Sb as Fv,Sc as qk,T as KP,Ta as xI,Tb as Gv,Tc as zk,U as mp,Ua as bI,Ub as Uv,Uc as Hk,V as al,Va as wI,Vb as jv,W as cl,Wa as OI,Wb as Bv,X as dl,Xa as RI,Xb as qv,Y as pl,Yb as zv,Z as nI,Zb as Hv,_ as oI,_b as Vv,a as QR,aa as ll,ac as Wv,b as ZR,ba as ql,bb as MI,bc as Yv,c as eP,ca as zl,cb as II,cc as Xv,d as tP,da as Hl,dc as Jv,e as wP,ea as Vl,ec as Qv,f as OP,fa as Kl,fb as vI,fc as Zv,g as RP,ga as Wl,gb as kI,gc as ek,h as PP,ha as Yl,hb as NI,hc as tk,i as MP,ia as Xl,ic as rk,j as IP,ja as Jl,jb as BI,jc as nk,k as vP,ka as Ql,kb as qI,kc as ok,la as Zl,lb as zI,lc as ik,ma as eu,mb as HI,mc as sk,na as tu,nb as VI,nc as ak,oa as ru,ob as lm,oc as ck,pa as nu,pb as um,pc as dk,qa as ou,qb as mm,qc as pk,ra as iu,rb as fm,rc as lk,sa as su,sb as _m,sc as qt,t as kP,ta as au,tb as hm,tc as Lm,u as NP,ua as cu,ub as xm,uc as $m,v as LP,va as du,vb as bm,vc as Dm,w as $P,wa as pu,wb as wm,wc as Fm,x as DP,xa as lu,xb as Om,xc as Gm,y as FP,ya as uu,yb as Rm,yc as Um,z as GP,za as mu,zb as wv,zc as jm}from"./chunks/chunk-PBMLIV74.js";import"./chunks/chunk-X5D5YUHR.js";import"./chunks/chunk-4QA5O64H.js";import{x as tp}from"./chunks/chunk-L4HMFRHB.js";import{$ as m_,A as Mu,B as Iu,C as vu,D as ku,I as Ku,J as Wu,K as Yu,L as Xu,M as Ju,N as Qu,O as Zu,P as em,Q as tm,R as rm,S as nm,T as om,U as im,V as sm,W as am,X as cm,Y as p_,Z as l_,_ as u_,b as ul,ba as g_,c as ml,ca as C_,d as fl,da as y_,e as _l,ea as S_,f as hl,g as gl,ga as T_,h as Cl,ha as E_,i as yl,ia as A_,j as Sl,ja as x_,k as Tl,l as El,m as Al,n as xl,o as bl,p as wl,q as Ol,r as Rl,s as Pl,t as Ml,u as Il,v as bu,w as wu,x as Ou,y as Ru,z as Pu}from"./chunks/chunk-LTQWPQ7H.js";import{A as Lp,Aa as Kp,B as $p,C as Dt,Ca as Wp,Da as Yp,Ea as Xp,b as rP,c as nP,d as oP,da as Ft,e as iP,ea as Gt,f as sP,fa as Ut,g as aP,ga as jt,h as Lc,i as $c,j as Dc,ja as Dp,k as Fc,l as Gc,la as Fp,ma as Gp,n as kM,na as Up,s as BM,t as qM,ta as jp,ua as Bp,v as zM,w as HM,wa as qp,x as VM,xa as zp,y as kp,ya as Hp,z as Np,za as Vp}from"./chunks/chunk-JJ73G5UT.js";import{a as VR,b as KR}from"./chunks/chunk-EDJ3KR2H.js";import"./chunks/chunk-6H36ZHMI.js";import{a as NM,b as LM,c as $M,d as DM,e as FM,f as GM,g as UM,h as bp,i as wp,j as Op,k as Rp,l as Pp,m as jM,n as Mp,o as Ip,p as vp}from"./chunks/chunk-IW4A3I4N.js";import{a as Tp,b as Ep,e as Ap,f as xp}from"./chunks/chunk-OGVSGXQX.js";import"./chunks/chunk-AA52P34H.js";import{$ as Vd,A as Dd,B as Fd,C as Gd,D as Ud,E as jd,F as Bd,G as qd,H as uP,I as mP,J as fP,K as _P,L as hP,M as gP,Q as CP,R as yP,S as SP,T as TP,U as EP,V as AP,W as xP,X as bP,Z as zd,_ as Hd,a as Jc,aa as Kd,b as Qc,ba as Wd,c as Zc,ca as Yd,d as ed,da as Xd,e as td,ea as Jd,f as rd,fa as Qd,g as nd,ga as Zd,h as od,ha as ep,i as id,ia as It,j as Sd,k as Td,l as Ed,m as Ad,n as xd,o as bd,p as wd,q as Od,r as Rd,s as Pd,t as Md,u as Id,v as vd,w as kd,x as Nd,y as Ld,z as $d}from"./chunks/chunk-Q2HMDV56.js";import{A as vc,c as IR,d as vR,e as kR,f as NR,g as LR,h as $R,i as DR,j as FR,k as GR,l as xc,m as bc,n as wc,o as Oc,p as Rc,q as Pc,s as Mc,u as Ic}from"./chunks/chunk-CQHB3ZZH.js";import{b as RR}from"./chunks/chunk-XKJ5NWQ7.js";import"./chunks/chunk-PZA7QECY.js";import{$ as Bb,$c as qO,A as ST,Ac as LO,Ad as MR,B as TT,Bb as oO,Bc as $O,C as ET,Cc as DO,Dc as Ss,Ec as Ts,Fb as iO,Fc as Es,Gb as sO,Gc as As,Ha as _w,Hb as aO,Hc as xs,Ia as hw,Ib as ds,Ic as bs,Ja as gw,Jb as cO,Jc as ws,K as vT,Ka as Cw,Kc as Os,La as yw,Lb as dO,Lc as Rs,M as jT,Ma as Sw,Mb as pO,Mc as Ps,N as BT,Na as ww,Nb as lO,Nc as Ms,O as qT,Oa as Ow,Ob as uO,Oc as Is,P as zT,Pa as Rw,Pb as mO,Pc as vs,Q as XT,Qa as wt,Qb as fO,Qc as ks,R as JT,Rb as _O,Sa as Pw,Sb as hO,Sc as Ns,T as $b,Ta as Mw,Tb as gO,Tc as FO,Ua as Iw,Ub as CO,Uc as GO,V as Db,Va as vw,Vb as Ot,Vc as Ls,W as Fb,Wa as kw,Wb as yO,Wc as UO,Xb as SO,Xc as jO,Y as Gb,Yc as $s,Z as Ub,Za as Nw,Zc as Ds,_ as jb,_c as BO,a as aT,aa as qb,ad as zO,ba as zb,bb as rs,bc as ps,bd as HO,ca as Hb,cc as ls,cd as VO,da as tw,db as zw,dc as us,dd as KO,eb as Hw,ec as ms,ed as WO,fa as Qi,fb as Vw,fd as Fs,ga as Zi,gb as Kw,gc as fs,gd as Gs,ha as es,hc as _s,hd as YO,i as io,ib as Ww,ic as hs,id as XO,j as cT,ja as rw,jb as Yw,jc as gs,jd as JO,k as dT,ka as nw,kb as Xw,kc as Cs,kd as QO,l as pT,la as ow,lb as Jw,lc as ys,ld as ZO,m as lT,ma as iw,mb as ss,mc as TO,md as eR,na as sw,nb as as,nc as EO,nd as tR,o as uT,oa as aw,oc as AO,od as rR,p as mT,pa as cw,pb as cs,pc as xO,pd as nR,qb as Qw,qc as bO,qd as oR,r as fT,ra as dw,rc as wO,rd as iR,sb as Zw,sc as OO,t as _T,ta as pw,tb as eO,tc as RO,u as hT,ua as lw,ub as tO,uc as PO,v as gT,va as uw,vc as MO,vd as Rt,wa as mw,wb as rO,wc as IO,wd as sR,x as CT,xa as fw,xc as vO,xd as aR,y as yT,yc as kO,yd as cR,zb as nO,zc as NO,zd as PR}from"./chunks/chunk-TDOF7BKO.js";import{A as Gw,B as Uw,C as jw,D as Bw,E as qw,F as ns,G as os,H as is,a as Vb,b as Kb,c as Wb,d as Yb,e as Xb,f as Jb,g as Qb,h as Zb,i as ew,l as Tw,o as Ew,p as Aw,t as xw,u as ts,v as bw,w as Lw,x as $w,y as Dw,z as Fw}from"./chunks/chunk-RRBNCL63.js";import"./chunks/chunk-3AZOATC2.js";import{$a as Jo,$b as PE,$c as Ei,$d as UA,$e as kx,$g as Yi,A as Qn,Aa as Uo,Ab as ci,Ad as _A,Ae as mx,B as Zn,Ba as jo,Bb as di,Bc as Ti,Bd as hA,Be as fx,C as eo,Cb as pi,Ce as _x,D as to,Da as Bo,Db as li,Dc as GE,De as hx,E as ro,Ea as qo,Eb as ui,Ec as UE,Ed as gA,Ee as gx,F as no,Fa as zo,Fb as mi,Fc as jE,Fd as CA,Fg as cb,G as oo,Ga as Ho,Gb as fi,Gc as BE,Gd as yA,Gf as Bx,Gg as db,Ha as Vo,Hb as _i,Hc as qE,Hd as SA,He as Cx,Hf as Ge,Hg as pb,Ia as gE,Ic as zE,Id as TA,Ie as yx,If as xt,Ig as lb,Ja as CE,Jc as HE,Jd as EA,Je as Sx,Jf as qx,Kb as xE,Kc as VE,Kd as AA,Ke as Tx,Kf as zx,Kg as ub,Lb as bE,Lc as KE,Ld as xA,Le as Ex,Lf as Hx,Lg as mb,Mb as hi,Mc as WE,Md as bA,Me as Ax,Mf as Vx,Nc as YE,Nd as wA,Ne as xx,Nf as q,Ng as fb,Oc as XE,Od as OA,Oe as bx,Of as Kx,Og as Vi,P as Ct,Pc as JE,Pd as RA,Pf as Wx,Q as yt,Qb as wE,Qc as QE,Qd as PA,Qf as Yx,Qg as Ki,Rb as OE,Rc as ZE,Rd as MA,Rf as Xx,Rg as Wi,Sc as eA,Sd as IA,Se as wx,T as No,Tc as tA,Td as vA,Te as Ox,Tf as zi,Uc as rA,Ud as kA,Uf as Hi,Ug as _b,V as kT,Va as Ko,Vc as nA,Vd as NA,Vg as hb,W as NT,Wa as Wo,Wc as oA,Wd as LA,We as Rx,Wg as gb,Xa as yE,Xc as iA,Xd as $A,Xe as Px,Xg as Cb,Ya as Yo,Yc as sA,Yd as DA,Ye as Mx,Yg as yb,Za as Xo,Zc as aA,Zd as FA,Ze as Ix,Zg as Sb,_ as LT,_a as SE,_b as RE,_d as GA,_e as vx,_g as Tb,a as XS,ab as Qo,ac as ME,ad as Ai,ae as jA,af as Nx,ah as Eb,b as JS,ba as $T,bb as L,bc as IE,bd as xi,be as BA,bf as Lx,bh as Ab,c as QS,cb as Zo,cd as bi,ce as qA,d as ZS,dc as vE,dd as wi,de as zA,df as $x,dg as Jx,e as eT,ea as DT,ec as kE,ed as Oi,ee as HA,ef as Dx,eg as bt,eh as xb,f as tT,fd as Ri,fe as VA,ff as Fx,fg as Qx,fh as bb,g as rT,gd as Pi,ge as KA,gf as Gx,gg as Zx,gh as wb,h as nT,ha as FT,hd as Mi,he as WA,hf as Ux,hg as eb,hh as Ob,i as oT,ia as HT,ib as Fe,id as Ii,ie as YA,ih as Rb,j as iT,ja as VT,jb as ei,jd as vi,je as XA,jf as jx,jh as Pb,k as sT,ka as KT,kc as NE,kd as ki,ke as JA,kf as Bi,kg as tb,kh as Xi,l as Gn,la as WT,ld as Ni,le as QA,lf as qi,lg as rb,m as Un,ma as YT,mc as gi,md as Li,me as ZA,mg as nb,n as jn,na as QT,nc as Ci,nd as $i,ne as ex,ng as ob,nh as Mb,o as Bn,oa as ZT,oc as yi,od as Di,oe as tx,og as ib,oh as Ji,p as qn,pa as eE,pc as Si,pd as Fi,pe as rx,q as zn,qa as tE,qb as TE,qd as Gi,qe as nx,r as Hn,ra as rE,rb as EE,rd as Ui,re as ox,rg as sb,rh as Ib,s as Ne,sa as nE,sb as AE,sd as ji,se as ix,sh as vb,t as Le,ta as oE,tb as ti,td as cA,te as sx,tg as ab,th as kb,u as Vn,ua as iE,ub as ri,ud as dA,ue as ax,uh as Nb,v as Kn,va as sE,vb as ni,vc as LE,vd as pA,ve as cx,vh as Lb,w as Wn,wa as aE,wb as oi,wc as $E,wd as lA,we as dx,x as Yn,xa as cE,xb as ii,xc as DE,xd as uA,xe as px,y as Xn,ya as dE,yb as si,yd as mA,ye as lx,z as Jn,za as pE,zb as ai,zd as fA,ze as ux}from"./chunks/chunk-UXEZXGAD.js";import{b as AT,c as xT,d as bT,g as go,h as wT,i as OT,j as RT,k as PT,m as Co,n as yo,o as De,p as MT,q as IT,r as So,s as To,u as Eo}from"./chunks/chunk-GSLOAEY2.js";import"./chunks/chunk-ITM4AMVM.js";import{$ as oa,$a as oc,A as OR,Aa as Ia,B as js,Ba as va,C as Bs,Ca as ka,D as qs,Da as Na,Ea as La,Fa as $a,Ga as Da,Ha as Fa,Ia as Ga,Ja as Ua,K as zs,Ka as ja,L as Hs,La as Ba,M as Vs,Ma as qa,N as Ks,Na as za,O as Ws,Oa as Ha,P as Ys,Pa as Va,Q as Xs,Qa as Ka,Ra as Wa,Sa as Ya,T as Js,Ta as Xa,U as Qs,Ua as Ja,V as Zs,Va as Qa,W as ea,Wa as Za,X as ta,Xa as ec,Y as ra,Ya as tc,Z as na,Za as rc,_a as nc,aa as ia,ab as ic,b as dR,ba as sa,bb as sc,c as pR,ca as aa,cb as ac,d as lR,da as ca,db as cc,e as uR,ea as da,eb as dc,f as mR,fa as pa,fb as pc,ga as la,gb as lc,h as fR,ha as ua,hb as uc,i as _R,ia as ma,ib as mc,j as Us,ja as fa,jb as fc,k as hR,ka as _a,kb as _c,la as ha,lb as hc,ma as ga,mb as gc,n as gR,na as Ca,nb as Cc,o as CR,oa as ya,ob as yc,p as Ue,pa as Sa,pb as Sc,q as yR,qa as Ta,qb as Tc,r as SR,ra as Ea,rb as Ec,s as TR,sa as Aa,t as Pt,ta as xa,tb as Be,u as je,ua as ba,v as ER,va as wa,vb as Z,w as AR,wa as Oa,wb as Ac,x as xR,xa as Ra,y as bR,ya as Pa,z as wR,za as Ma}from"./chunks/chunk-3ESBFEQC.js";import{I as ko,L as Tt,N as Et,Q as Lo,R as $o,S as At,U as GT,W as UT,Y as Go,a as R,b as YS,c as gt,da as fE,e as Mn,f as In,g as vn,ga as _E,h as kn,ha as hE,i as ve,j as Nn,k as N,ka as FE,l as ke,m as Ln,n as $n,o as Dn,p as Fn,q as Ao,r as xo,s as bo,t as wo,u as Oo,v as Ro,w as Po,x as Mo,y as Io,z as vo}from"./chunks/chunk-XGNUDSCG.js";import{_ as lE,a as po,b as lo,ba as Do,c as uo,ca as uE,da as Fo,fa as mE,h as mo,j as fo,k as _o,l as ho}from"./chunks/chunk-TE6FBDHP.js";import{A as ue,B as WS,C as S,E as so,F as St,G as me,H as ao,L as $e,N as co,b as jS,c as BS,d as qS,m as zS,r as HS,u as VS,y as KS}from"./chunks/chunk-K672XXGQ.js";import"./chunks/chunk-XAWE4EAK.js";var z="2026-07-28",or=["2025-11-25","2025-06-18"],te=[z],m={headerMismatch:-32020,missingRequiredClientCapability:-32021,unsupportedProtocolVersion:-32022,invalidParams:-32602},x={clientCapabilities:"io.modelcontextprotocol/clientCapabilities",clientInfo:"io.modelcontextprotocol/clientInfo",logLevel:"io.modelcontextprotocol/logLevel",protocolVersion:"io.modelcontextprotocol/protocolVersion",serverInfo:"io.modelcontextprotocol/serverInfo"},nr=["debug","info","notice","warning","error","critical","alert","emergency"],u=class extends Error{code;data;constructor(t,r,n={}){super(t),this.name="PmMcpProtocolError",this.code=r,this.data=n}};function h(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function qg(e){if(e===void 0)return;if(!h(e))throw new u("Invalid MCP clientInfo metadata",m.invalidParams,{field:x.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:x.clientInfo,required:["name","version"]});let n={name:t.slice(0,128),version:r.slice(0,128)};return typeof e.description=="string"&&e.description.trim()&&(n.description=e.description.trim().slice(0,1024)),typeof e.websiteUrl=="string"&&e.websiteUrl.trim()&&(n.websiteUrl=e.websiteUrl.trim().slice(0,2048)),n}function zg(e){if(e!==void 0){if(typeof e!="string"||!nr.includes(e))throw new u("Invalid MCP logLevel metadata",m.invalidParams,{field:x.logLevel,allowed:[...nr]});return e}}function Ye(e){let t=h(e)?e._meta:void 0;if(!h(t))throw new u("Missing required MCP request metadata",m.invalidParams,{required:[x.protocolVersion,x.clientCapabilities]});let r=t[x.protocolVersion];if(typeof r!="string"||!te.includes(r))throw new u("Unsupported protocol version",m.unsupportedProtocolVersion,{supported:[...te],requested:typeof r=="string"?r:null});let n=t[x.clientCapabilities];if(!h(n))throw new u("Invalid MCP client capabilities metadata",m.invalidParams,{field:x.clientCapabilities,expected:"object"});let o=qg(t[x.clientInfo]),i=zg(t[x.logLevel]);return{protocolVersion:z,clientCapabilities:n,...o?{clientInfo:o}:{},...i?{logLevel:i}:{}}}function F0(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 G0(e,t){let r=t.filter(n=>!Object.prototype.hasOwnProperty.call(e.clientCapabilities,n));if(r.length>0)throw new u("Missing required client capability",m.missingRequiredClientCapability,{requiredCapabilities:Object.fromEntries(r.map(n=>[n,{}]))})}function U0(e,t){let r=e.clientCapabilities.extensions;return h(r)&&h(r[t])}function Xe(e,t){let r=h(e._meta)?e._meta:{};return{...e,_meta:{...r,[x.serverInfo]:{...t}}}}function Hg(e,t){return Xe({...e,resultType:"complete"},t)}function j0(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 Hg({supportedVersions:[...te],capabilities:structuredClone(e.capabilities),ttlMs:t,cacheScope:"public",...e.instructions?{instructions:e.instructions}:{}},e.serverInfo)}function B0(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"})}var Vg=new Set(["--help","-h","--version","-V"]);function Kg(e,t){let n=[`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"&&n.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."),n.push("",`MCP protocol: ${te.join(", ")}.`,e==="stdio"?`Legacy initialize compatibility: ${or.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",""),n.join(`
2
+ `)}function H0(e,t,r){if(e.length===0)return{kind:"serve"};let n=e.find(i=>!Vg.has(i));if(n!==void 0){let i=t==="stdio"?"pm-mcp":"pm-mcp-http";return{kind:"exit",exitCode:64,stdout:"",stderr:`Unsupported argument ${JSON.stringify(n)}. Run ${i} --help.
3
3
  `}}return{kind:"exit",exitCode:0,stdout:e.includes("--help")||e.includes("-h")?Kg(t,r):`${r}
4
- `,stderr:""}}import{createHash as ar,createHmac as cr,timingSafeEqual as Wg}from"node:crypto";var Yg=["elicitation/create","roots/list","sampling/createMessage"],ir=class extends Error{inputRequests;requestState;constructor(t){super("MCP operation requires additional input"),this.name="PmMcpInputRequiredError",this.inputRequests=t.inputRequests,this.requestState=t.requestState}},dr=/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/u,he=32,Qe=64*1024,ge=16*1024,Je={maxBytes:256*1024,maxDepth:32,maxNodes:4096};function Xg(e){return e==="elicitation/create"?"elicitation":e==="sampling/createMessage"?"sampling":"roots"}function Ce(e,t,r){let n;try{n=JSON.stringify(e)}catch{throw new u(`Invalid ${r}: value is not JSON serializable`,m.invalidParams,{field:r})}if(Buffer.byteLength(n,"utf8")>t)throw new u(`Invalid ${r}: payload exceeds the protocol bound`,m.invalidParams,{field:r,maximumBytes:t})}function Ze(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>he)throw new u("Invalid MCP inputRequests count",m.invalidParams,{minimum:1,maximum:he,observed:r.length});let n={};for(let[o,i]of r){if(!dr.test(o)||!h(i))throw new u("Invalid MCP input request entry",m.invalidParams,{field:`inputRequests.${o}`});let s=i.method;if(typeof s!="string"||!Yg.includes(s))throw new u("Unsupported MCP input request method",m.invalidParams,{field:`inputRequests.${o}.method`,method:s??null});let a=Xg(s);if(!Object.prototype.hasOwnProperty.call(t.clientCapabilities,a))throw new u("Missing required client capability",m.missingRequiredClientCapability,{requiredCapabilities:{[a]:{}}});if(!h(i.params))throw new u("Invalid MCP input request parameters",m.invalidParams,{field:`inputRequests.${o}.params`,expected:"object"});n[o]={method:s,params:structuredClone(i.params)}}return Ce(n,Qe,"inputRequests"),n}function pr(e){if(!h(e))throw new u("Invalid MCP inputResponses",m.invalidParams,{field:"inputResponses",expected:"object"});let t=Object.entries(e);if(t.length>he)throw new u("Invalid MCP inputResponses count",m.invalidParams,{maximum:he,observed:t.length});let r={};for(let[n,o]of t){if(!dr.test(n)||!h(o))throw new u("Invalid MCP input response entry",m.invalidParams,{field:`inputResponses.${n}`});r[n]=structuredClone(o)}return Ce(r,Qe,"inputResponses"),r}function W0(e){let t=e.requestState?.trim();if(t&&Buffer.byteLength(t,"utf8")>ge)throw new u("Invalid MCP requestState: payload exceeds the protocol bound",m.invalidParams,{field:"requestState",maximumBytes:ge});let r=e.inputRequests===void 0?void 0:Ze(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:{[x.serverInfo]:{...e.serverInfo}}}}function lr(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 Y0(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>ge/2)throw new u("MCP requestState payload exceeds the protocol bound",m.invalidParams,{maximumBytes:ge/2});let n=r.toString("base64url"),o=cr("sha256",lr(t)).update(n).digest("base64url");return`${n}.${o}`}function Jg(e){if(!h(e)||e.version!==1)throw new u("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});let{expiresAt:t,method:r,parameterDigest:n,principal:o,state:i}=e;if(typeof t!="number"||!Number.isSafeInteger(t))throw new u("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});if(typeof r!="string"||typeof n!="string"||typeof o!="string")throw new u("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});return{expiresAt:t,method:r,parameterDigest:n,principal:o,state:i}}function X0(e,t,r){let[n,o,i]=e.split(".");if(!n||!o||i!==void 0)throw new u("Invalid MCP requestState encoding",m.invalidParams,{field:"requestState"});let s=Buffer.from(o,"base64url"),a=cr("sha256",lr(t)).update(n).digest();if(s.byteLength!==a.byteLength||!Wg(s,a))throw new u("Invalid MCP requestState signature",m.invalidParams,{field:"requestState"});let c;try{c=JSON.parse(Buffer.from(n,"base64url").toString("utf8"))}catch{c=null}let d=Jg(c),{expiresAt:p,method:l,parameterDigest:f,principal:g}=d;if(p<(r.nowMs??Date.now()))throw new u("Expired MCP requestState",m.invalidParams,{field:"requestState",expiredAt:p});if(l!==r.method||f!==r.parameterDigest||g!==r.principal)throw new u("MCP requestState binding mismatch",m.invalidParams,{field:"requestState"});return d}function J0(e){return Ce(e,Qe,"request parameters"),ar("sha256").update(JSON.stringify(e)).digest("hex")}var sr=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=ar("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 n=this.#e.values().next().value;this.#e.delete(n)}this.#e.add(r)}};function Qg(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 Q0(e,t){return{...e,...Qg(t)}}function Zg(e){return e.replaceAll("~1","/").replaceAll("~0","~")}function eC(e,t){if(t==="#")return e;if(!t.startsWith("#/"))return;let r=e;for(let n of t.slice(2).split("/").map(Zg)){if(!h(r)&&!Array.isArray(r)||!Object.prototype.hasOwnProperty.call(r,n))return;r=r[n]}return r}function tC(e){let t=e.maxBytes??Je.maxBytes,r=e.maxDepth??Je.maxDepth,n=e.maxNodes??Je.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(n)||n<1)throw new u("Invalid MCP JSON Schema work bounds",m.invalidParams);return{maximumBytes:t,maximumDepth:r,maximumNodes:n}}function rC(e,t){let r=Array.isArray(e.value)?e.value:h(e.value)?Object.values(e.value):[];for(let n of r)t.push({value:n,depth:e.depth+1})}function nC(e,t){if(!h(t)||typeof t.$ref!="string")return;let r=t.$ref;if(r.startsWith("#")&&eC(e,r)===void 0)throw new u("MCP JSON Schema contains an unresolved local reference",m.invalidParams,{reference:r})}function Z0(e,t={}){let{maximumBytes:r,maximumDepth:n,maximumNodes:o}=tC(t);if(typeof e!="boolean"&&!h(e))throw new u("Invalid MCP JSON Schema root",m.invalidParams,{expected:"object or boolean"});Ce(e,r,"JSON Schema");let i=[{value:e,depth:0}],s=0;for(;i.length>0;){let a=i.pop();if(s+=1,s>o||a.depth>n)throw new u("MCP JSON Schema exceeds validation work bounds",m.invalidParams,{maximumDepth:n,maximumNodes:o});nC(e,a.value),rC(a,i)}return structuredClone(e)}import{randomUUID as oC}from"node:crypto";import{readFile as iC}from"node:fs/promises";import ur from"node:path";var aL="io.modelcontextprotocol/tasks",sC=["working","input_required","completed","failed","cancelled"],aC=/^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,cC=3600*1e3,dC=1e3,Se=1024,pC=30,lC=2e3;function et(e){return new u(e,m.invalidParams,{code:"mcp_task_not_found_or_not_authorized"})}function ye(e){let t=e.trim();if(!aC.test(t))throw et("Unknown MCP task");return t}function mr(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 fr(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 uC(e){if(!sC.includes(e))throw new u("Corrupt MCP task record",m.invalidParams);return e}function mC(e){if(typeof e!="string"||e.length===0)throw new u("Corrupt MCP task record",m.invalidParams);return e}function fC(e){if(typeof e!="number"||!Number.isSafeInteger(e)||e<1)throw new u("Corrupt MCP task record",m.invalidParams);return e}function _C(e){if(e!==null&&(typeof e!="number"||!Number.isSafeInteger(e)||e<0))throw new u("Corrupt MCP task record",m.invalidParams);return e}function hC(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 gC(e){if(!Array.isArray(e)||e.some(t=>typeof t!="string"))throw new u("Corrupt MCP task record",m.invalidParams);return[...e]}function CC(e){if(!h(e)||e.version!==1)throw new u("Corrupt MCP task record",m.invalidParams);let t=typeof e.taskId=="string"?ye(e.taskId):"",r=uC(e.status),n=mC(e.principal),o=fC(e.workerPid),i=_C(e.ttlMs),s=hC(e.pollIntervalMs),a={version:1,taskId:t,status:r,principal:n,workerPid:o,createdAt:mr(e.createdAt,"createdAt"),lastUpdatedAt:mr(e.lastUpdatedAt,"lastUpdatedAt"),ttlMs:i,consumedInputKeys:gC(e.consumedInputKeys),...typeof e.statusMessage=="string"?{statusMessage:e.statusMessage.slice(0,Se)}:{},...typeof s=="number"?{pollIntervalMs:s}:{}};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=fr(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 yC(e){try{return process.kill(e,0),!0}catch(t){return!(typeof t=="object"&&t!==null&&"code"in t&&t.code==="ESRCH")}}var tt=class{#e;#t;#r;#n;#i;constructor(t){this.#e=ur.resolve(t.pmRoot),this.#t=t.owner?.trim()||"pm-mcp",this.#r=t.now??(()=>new Date),this.#n=t.taskIdFactory??(()=>`mcp-task-${oC()}`),this.#i=t.workerPid??process.pid}#s(t){return ur.join(this.#e,"runtime","mcp-tasks","records",`${ye(t)}.json`)}async#c(t){try{return CC(JSON.parse(await iC(this.#s(t),"utf8")))}catch(r){throw me(r)||r instanceof SyntaxError?et("Unknown MCP task"):r}}async#a(t){await $e(this.#s(t.taskId),`${JSON.stringify(t,null,2)}
5
- `)}async#o(t,r,n){let o=ye(t),i=await Fe(this.#e,o,pC,this.#t,!1,!1,lC);try{let s=await this.#c(o);if(s.principal!==r)throw et("Unknown MCP task");let a=n(s);return await this.#a(a),a}finally{await i()}}async create(t){let r=ye(this.#n()),n=t.principal.trim(),o=t.ttlMs===void 0?cC:t.ttlMs,i=t.pollIntervalMs??dC;if(n.length===0||o!==null&&(!Number.isSafeInteger(o)||o<0)||!Number.isSafeInteger(i)||i<0)throw new u("Invalid MCP task creation options",m.invalidParams);let s=this.#r().toISOString(),a={version:1,taskId:r,status:"working",createdAt:s,lastUpdatedAt:s,ttlMs:o,pollIntervalMs:i,principal:n,workerPid:this.#i,consumedInputKeys:[],...t.statusMessage?.trim()?{statusMessage:t.statusMessage.trim().slice(0,Se)}:{}};return await this.#a(a),{...H(a),resultType:"task"}}async get(t,r){return H(await this.#o(t,r,n=>{if(re(n.status))return n;let o=this.#r().getTime(),i=n.ttlMs!==null&&Date.parse(n.createdAt)+n.ttlMs<=o,s=n.workerPid!==this.#i&&!yC(n.workerPid);return!i&&!s?n:{...n,status:"failed",statusMessage:i?"Task retention expired before completion.":"Task worker ended before recording a terminal result.",lastUpdatedAt:this.#r().toISOString(),error:{code:-32603,message:i?"MCP task expired":"MCP task worker unavailable after restart",data:{recoverable:!1,createNewTask:!0}},inputRequests:void 0}}))}async requireInput(t){let r=Ze(t.inputRequests,t.requestContext);return H(await this.#o(t.taskId,t.principal,n=>{if(re(n.status))return n;let o=Object.keys(r).filter(i=>n.consumedInputKeys.includes(i));if(o.length>0)throw new u("MCP task input request keys must be unique for the task lifetime",m.invalidParams,{reused:o});return{...n,status:"input_required",statusMessage:t.statusMessage?.trim().slice(0,Se),lastUpdatedAt:this.#r().toISOString(),inputRequests:r}}))}async update(t,r,n){let o=pr(n),i=[],s=[];return await this.#o(t,r,a=>{if(a.status!=="input_required"||!a.inputRequests)return a;let c={...a.inputRequests},d=a.inputResponses?{...a.inputResponses}:{};for(let[p,l]of Object.entries(o))Object.prototype.hasOwnProperty.call(c,p)&&(d[p]=l,delete c[p],i.push(p));return s=Object.keys(c).sort(),i.length===0?a:{...a,status:s.length===0?"working":"input_required",lastUpdatedAt:this.#r().toISOString(),inputRequests:s.length===0?void 0:c,inputResponses:d,consumedInputKeys:[...new Set([...a.consumedInputKeys,...i])].sort()}}),{acceptedKeys:i.sort(),remainingKeys:s}}async takeInputResponses(t,r){let n={};return await this.#o(t,r,o=>(n=structuredClone(o.inputResponses??{}),Object.keys(n).length===0?o:{...o,inputResponses:void 0})),n}async complete(t,r,n){return H(await this.#o(t,r,o=>re(o.status)?o:{...o,status:"completed",statusMessage:"Task completed.",lastUpdatedAt:this.#r().toISOString(),result:structuredClone(n),inputRequests:void 0,error:void 0}))}async fail(t,r,n){let o=fr(n);return H(await this.#o(t,r,i=>re(i.status)?i:{...i,status:"failed",statusMessage:o.message,lastUpdatedAt:this.#r().toISOString(),error:o,inputRequests:void 0,result:void 0}))}async cancel(t,r){return H(await this.#o(t,r,n=>re(n.status)?n:{...n,status:"cancelled",statusMessage:"Task cancelled by the client.",lastUpdatedAt:this.#r().toISOString(),inputRequests:void 0,result:void 0,error:void 0}))}};function cL(e){return new tt(e)}var Te="io.modelcontextprotocol/subscriptionId",_r=256,hr=2048,SC=5e3;function TC(e,t){return new Promise((r,n)=>{let o=setTimeout(()=>n(new Error("MCP subscription sink write timed out")),SC);o.unref(),Promise.resolve().then(()=>e(t)).then(()=>{clearTimeout(o),r()},i=>{clearTimeout(o),n(i instanceof Error?i:new Error(String(i)))})})}function rt(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 EC(e){if(!h(e))throw new u("Invalid MCP subscription filter",m.invalidParams,{field:"notifications",expected:"object"});let t=rt(e.toolsListChanged,"toolsListChanged"),r=rt(e.promptsListChanged,"promptsListChanged"),n=rt(e.resourcesListChanged,"resourcesListChanged"),o;if(e.resourceSubscriptions!==void 0){if(!Array.isArray(e.resourceSubscriptions)||e.resourceSubscriptions.length>_r)throw new u("Invalid MCP resource subscriptions",m.invalidParams,{field:"notifications.resourceSubscriptions",maximum:_r});let i=new Set;for(let s of e.resourceSubscriptions){if(typeof s!="string"||s.trim().length===0||Buffer.byteLength(s,"utf8")>hr)throw new u("Invalid MCP resource subscription URI",m.invalidParams,{field:"notifications.resourceSubscriptions",maximumBytes:hr});i.add(s)}i.size>0&&(o=[...i].sort())}return{...t?{toolsListChanged:t}:{},...r?{promptsListChanged:r}:{},...n?{resourcesListChanged:n}:{},...o?{resourceSubscriptions:o}:{}}}function AC(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 gr=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=AC(EC(t.notifications),this.#e),n={filter:r,sink:t.sink,writeQueue:Promise.resolve()};this.#t.set(t.id,n);try{await this.#n(t.id,n,{jsonrpc:"2.0",method:"notifications/subscriptions/acknowledged",params:{_meta:{[Te]:t.id},notifications:structuredClone(r)}},!0)}catch(o){throw this.#t.delete(t.id),o}return structuredClone(r)}async emitListChanged(t){let r=`${t}ListChanged`,n=`notifications/${t}/list_changed`,o=[];for(let[i,s]of this.#t)s.filter[r]===!0&&o.push(this.#n(i,s,{jsonrpc:"2.0",method:n,params:{_meta:{[Te]:i}}}));return(await Promise.all(o)).filter(Boolean).length}async emitResourceUpdated(t){let r=[];for(let[n,o]of this.#t)o.filter.resourceSubscriptions?.includes(t)&&r.push(this.#n(n,o,{jsonrpc:"2.0",method:"notifications/resources/updated",params:{_meta:{[Te]:n},uri:t}}));return(await Promise.all(r)).filter(Boolean).length}async#n(t,r,n,o=!1){let i=r.writeQueue.then(async()=>{if(this.#t.get(t)!==r)return!1;try{return await TC(r.sink,n),!0}catch(s){if(this.#t.get(t)===r&&this.#t.delete(t),o)throw s;return!1}});return r.writeQueue=i.then(()=>{},()=>{}),i}close(t){if(this.#t.delete(t))return{...Xe({resultType:"complete",_meta:{[Te]:t}},this.#r)}}closeAll(){let t=[];for(let r of this.#t.keys()){let n=this.close(r);t.push({id:r,result:n})}return t}};var Cr=/^=\?base64\?([A-Za-z0-9+/]*={0,2})\?=$/u,xC=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/u,yr=/^[\t\x20-\x7E]*$/u,Sr=new Set(["prompts/get","resources/read","tools/call"]);function bC(e){let t=new Map;for(let[r,n]of Object.entries(e)){if(n===void 0)continue;let o=typeof n=="string"?n:n.join(", ");t.set(r.toLowerCase(),o)}return t}function b(e,t){throw new u(e,m.headerMismatch,{header:t})}function Tr(e){let t=typeof e=="boolean"?String(e).toLowerCase():String(e);return t.length>0&&t.trim()===t&&yr.test(t)&&!Cr.test(t)?t:`=?base64?${Buffer.from(t,"utf8").toString("base64")}?=`}function Er(e,t){let r=Cr.exec(e);if(r){let n=r[1],o=Buffer.from(n,"base64");return o.toString("base64")!==n||o.length===0?b("Malformed MCP Base64 header value",t):o.toString("utf8")}return e.length===0||e.trim()!==e||!yr.test(e)?b("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 wC(e,t,r){let n=e["x-mcp-header"];if(n===void 0)return;let o=e.type;if(typeof n!="string"||!xC.test(n)||!["boolean","integer","string"].includes(String(o))||r.has(n.toLowerCase()))throw new u("Invalid MCP x-mcp-header annotation",m.invalidParams,{field:t.join("."),annotation:n});return r.add(n.toLowerCase()),{name:n,path:t,type:o}}function Ar(e){if(!h(e))throw new u("Invalid MCP tool schema",m.invalidParams,{field:"inputSchema",expected:"object"});let t=[],r=new Set,n=(o,i)=>{let s=o.properties;if(s!==void 0){if(!h(s))throw new u("Invalid MCP tool schema properties",m.invalidParams,{field:"inputSchema.properties"});for(let[a,c]of Object.entries(s)){if(!h(c))continue;let d=[...i,a],p=wC(c,d,r);p&&t.push(p);for(let[l,f]of Object.entries(c))if(l!=="properties"&&l!=="x-mcp-header"&&Ee(f))throw new u("MCP x-mcp-header is not statically reachable",m.invalidParams,{field:d.join("."),keyword:l});n(c,d)}}};for(let[o,i]of Object.entries(e))if(o!=="properties"&&Ee(i))throw new u("MCP x-mcp-header is not statically reachable",m.invalidParams,{field:"inputSchema",keyword:o});return n(e,[]),t}function xr(e,t){let r=e;for(let n of t){if(!h(r))return;r=r[n]}return r}function br(e,t){let r=e==="resources/read"?t.uri:t.name;return typeof r=="string"?r:void 0}function OC(e,t){let r=h(e.arguments)?e.arguments:{},n={};for(let o of Ar(t)){let i=xr(r,o.path);if(i==null)continue;if(!(o.type==="integer"&&typeof i=="number"&&Number.isSafeInteger(i)||o.type==="boolean"&&typeof i=="boolean"||o.type==="string"&&typeof i=="string"))throw new u("Invalid MCP custom header argument",m.invalidParams,{field:o.path.join("."),expected:o.type});n[`Mcp-Param-${o.name}`]=Tr(i)}return n}function mL(e){let t=h(e.request.params)?e.request.params:void 0,r=Ye(t),n=e.request.method;if(typeof n!="string"||n.length===0)return b("Missing MCP request method","Mcp-Method");let o={Accept:"application/json, text/event-stream","Content-Type":"application/json","MCP-Protocol-Version":r.protocolVersion,"Mcp-Method":n},i=br(n,t);if(Sr.has(n)){if(i===void 0)return b("Missing MCP request name","Mcp-Name");o["Mcp-Name"]=Tr(i)}return n==="tools/call"&&e.toolSchema!==void 0&&Object.assign(o,OC(t,e.toolSchema)),o}function RC(e,t){let r=t.method;(typeof r!="string"||r.length===0)&&b("Missing MCP request method","Mcp-Method");let n=h(t.params)?t.params:void 0,o=Ye(n).protocolVersion;if(e.get("mcp-protocol-version")!==o&&b("MCP protocol header does not match request metadata","MCP-Protocol-Version"),e.get("mcp-method")!==r&&b("MCP method header does not match request body","Mcp-Method"),Sr.has(r)){let i=e.get("mcp-name"),s=br(r,n);(i===void 0||s===void 0||Er(i,"Mcp-Name")!==s)&&b("MCP name header does not match request body","Mcp-Name")}e.has("last-event-id")&&b("MCP SSE resumability is not supported","Last-Event-ID")}function PC(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 MC(e){let t=h(e.params.arguments)?e.params.arguments:{};for(let r of Ar(e.toolSchema)){let n=xr(t,r.path),o=`Mcp-Param-${r.name}`,i=e.headers.get(o.toLowerCase());if(n==null){i!==void 0&&b("Unexpected MCP parameter header",o);continue}i===void 0&&b("Missing MCP parameter header",o),PC(r,n,Er(i,o))||b("MCP parameter header does not match request body",o)}}function fL(e){let t=bC(e.headers),r=typeof e.request.method=="string"?e.request.method:"";RC(t,e.request),!(r!=="tools/call"||e.toolSchema===void 0)&&MC({headers:t,params:e.request.params,toolSchema:e.toolSchema})}var _L=z;import{AsyncLocalStorage as IC}from"node:async_hooks";import{createHash as wr,timingSafeEqual as vC}from"node:crypto";var C=class extends Error{httpStatus;challenge;constructor(t,r,n){super(t),this.name="PmMcpAuthorizationError",this.httpStatus=r,this.challenge=n}},kC=/^00-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})$/u,NC=/^[a-z][a-z0-9_*/-]{0,255}$/u,LC=/^(?:[a-z0-9][a-z0-9_*/-]{0,240})@[a-z][a-z0-9_*/-]{0,13}$/u,$C=/^[\x20-\x2B\x2D-\x3C\x3E-\x7E]{0,255}[\x21-\x2B\x2D-\x3C\x3E-\x7E]$/u,Rr=/^[\x21\x23-\x5B\x5D-\x7E]+$/u,Pr=/^[A-Za-z0-9!#$%&'*+.^_`|~-]+$/u,DC=/^[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]*$/u,FC=/%(?![0-9A-Fa-f]{2})/u,GC=512,UC=32,jC=180,BC=8192,qC=8192,Mr=new IC;function A(e,t,r=!1){if(new RegExp("\\p{Cc}","u").test(e))throw new C(`Invalid ${t}`,401);let n;try{n=new URL(e)}catch{throw new C(`Invalid ${t}`,401)}let o=n.hostname==="127.0.0.1"||n.hostname==="localhost";if(n.hash.length>0||n.protocol!=="https:"&&!(r&&o&&n.protocol==="http:"))throw new C(`Invalid ${t}`,401);return n}function zC(e,t){let r=t.toLowerCase();for(let[n,o]of Object.entries(e))if(!(n.toLowerCase()!==r||o===void 0))return typeof o=="string"?o:o.join(", ")}function SL(e){let t=A(e.resource,"protected resource URI",!0).href.replace(/\/$/u,"");if(e.authorizationServers.length===0)throw new C("Protected resource metadata requires an authorization server",401);let r=e.authorizationServers.map(o=>A(o,"authorization server issuer").href.replace(/\/$/u,"")),n=[...new Set(e.scopes??[])];if(n.some(o=>!Rr.test(o)))throw new C("Invalid authorization scope",401);return{resource:t,authorization_servers:r,...n.length>0?{scopes_supported:n.sort()}:{}}}function TL(e){let t=A(e,"authorization server issuer"),r=t.pathname.replace(/^\/+|\/+$/gu,""),n=t.origin;return r?[`${n}/.well-known/oauth-authorization-server/${r}`,`${n}/.well-known/openid-configuration/${r}`,`${n}/${r}/.well-known/openid-configuration`]:[`${n}/.well-known/oauth-authorization-server`,`${n}/.well-known/openid-configuration`]}function EL(e,t){if(!h(e)||typeof e.issuer!="string")throw new C("Invalid authorization server metadata",401);let r=A(t,"expected issuer").href.replace(/\/$/u,"");if(A(e.issuer,"metadata issuer").href.replace(/\/$/u,"")!==r)throw new C("Authorization server issuer mismatch",401);if(!Array.isArray(e.code_challenge_methods_supported)||!e.code_challenge_methods_supported.includes("S256"))throw new C("Authorization server does not support required S256 PKCE",401);let o=d=>{let p=e[d];if(typeof p!="string")throw new C(`Authorization server metadata requires ${d}`,401);return A(p,d).href},i=d=>{let p=e[d];return typeof p=="string"?A(p,d).href:void 0},s=o("authorization_endpoint"),a=o("token_endpoint"),c=i("registration_endpoint");return{issuer:r,authorization_endpoint:s,token_endpoint:a,code_challenge_methods_supported:[...new Set(e.code_challenge_methods_supported.filter(d=>typeof d=="string"))],...e.client_id_metadata_document_supported===!0?{client_id_metadata_document_supported:!0}:{},...c?{registration_endpoint:c}:{}}}function AL(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 xL(e){if(e.responseIssuer===void 0){if(e.issuerParameterSupported)throw new C("Authorization response omitted the advertised issuer",401);return}if(e.responseIssuer!==e.expectedIssuer)throw new C("Authorization response issuer mismatch",401)}function bL(e,t){let r=A(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 C("Invalid Client ID Metadata Document",401);for(let n of e.redirect_uris){if(typeof n!="string")throw new C("Invalid client redirect URI",401);A(n,"client redirect URI",!0)}return structuredClone(e)}function wL(e){if(e.redirectUris.length===0||e.clientName.trim().length===0)throw new C("Invalid dynamic client registration metadata",401);let t=e.redirectUris.map(r=>A(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 Or=class{#e=new Map;set(t,r){let n=A(t,"credential issuer").href;this.#e.set(n,structuredClone(r))}get(t){let r=A(t,"credential issuer").href,n=this.#e.get(r);return n?structuredClone(n):void 0}delete(t){let r=A(t,"credential issuer").href;return this.#e.delete(r)}};function HC(e){let t=e.traceparent,r=e.tracestate;if(t!==void 0){let n=typeof t=="string"?kC.exec(t):null;if(!n)throw new C("Invalid MCP traceparent",403);let o=n[1],i=n[2];if(/^0+$/u.test(o)||/^0+$/u.test(i))throw new C("Invalid MCP traceparent",403)}if(r!==void 0&&(typeof r!="string"||!KC(r)))throw new C("Invalid MCP tracestate",403);return{...typeof t=="string"?{traceparent:t}:{},...typeof r=="string"?{tracestate:r}:{}}}function $(e){return e.replace(/^[ \t]*|[ \t]*$/gu,"")}function VC(e){return NC.test(e)||LC.test(e)}function KC(e){if(Buffer.byteLength(e,"utf8")>GC)return!1;let t=e.split(",");if(t.length>UC)return!1;let r=new Set;for(let n of t){let o=$(n);if(o.length===0)continue;let i=o.indexOf("="),s=i>0?o.slice(0,i):"",a=i>0?o.slice(i+1):"";if(!VC(s)||!$C.test(a)||r.has(s))return!1;r.add(s)}return!0}function Ir(e){return DC.test(e)&&!FC.test(e)}function WC(e){let t=$(e),r=t.indexOf("="),n=$(r>=0?t.slice(0,r):t),o=r>=0?$(t.slice(r+1)):void 0;return Pr.test(n)&&(o===void 0||Ir(o))}function YC(e){let t=$(e),r=t.split(";"),n=r[0],o=r.slice(1),i=n.indexOf("="),s=$(i>0?n.slice(0,i):""),a=i>0?$(n.slice(i+1)):"";if(!(!Pr.test(s)||!Ir(a)||!o.every(WC)))return{key:s,serialized:t}}function XC(e,t){if(e===void 0)return;if(typeof e!="string"||Buffer.byteLength(e,"utf8")>BC)throw new C("Invalid MCP baggage",403);let r=new Set(t),n=e.split(",");if(n.length>jC)throw new C("Invalid MCP baggage",403);let o=[];for(let i of n){let s=YC(i);if(!s)throw new C("Invalid MCP baggage",403);r.has(s.key)&&o.push(s.serialized)}return o.length>0?o.join(","):void 0}function OL(e,t={}){let r=h(e)&&h(e._meta)?e._meta:{},n=XC(r.baggage,t.baggageAllowlist??[]);return{...HC(r),...n?{baggage:n}:{}}}function RL(e,t){return Mr.run(structuredClone(e),t)}function PL(){let e=Mr.getStore();return e?{...e}:void 0}async function ML(e){let t=A(e.policy.resourceMetadataUrl,"protected resource metadata URL",!0).href,r=[...new Set(e.policy.requiredScopes??[])];if(r.some(l=>!Rr.test(l)))throw new C("Invalid authorization scope",401);let n=`Bearer resource_metadata="${t}"`;if(new URL(e.requestUrl,e.policy.resource).searchParams.has("access_token"))throw new C("Access tokens must not appear in URI query parameters",401,n);let s=zC(e.headers,"authorization")?.match(/^Bearer ([^\s]+)$/iu);if(!s)throw new C("Missing or malformed bearer token",401,n);let a=s[1];if(Buffer.byteLength(a,"utf8")>qC)throw new C("Missing or malformed bearer token",401,n);let c;try{c=await e.policy.verifyAccessToken(a)}catch{throw new C("Invalid bearer token",401,n)}let d=Array.isArray(c.audience)?c.audience:[c.audience];if(c.issuer!==e.policy.issuer||!d.includes(e.policy.resource))throw new C("Bearer token issuer or audience mismatch",401,n);let p=r.filter(l=>!c.scopes.includes(l));if(p.length>0)throw new C("Bearer token has insufficient scope",403,`${n}, scope="${p.join(" ")}"`);return{...c,audience:[...d],scopes:[...c.scopes]}}function IL(e){let t=wr("sha256").update(e.token).digest();return r=>{let n=wr("sha256").update(r).digest();if(!vC(t,n))throw new C("Invalid bearer token",401);return structuredClone(e.claims)}}var nt="io.modelcontextprotocol/ui",Ae="2026-01-26",Nr="text/html;profile=mcp-app",vr=Object.freeze({specVersion:Ae,mimeTypes:[Nr]});function NL(e){let t=e.clientCapabilities.extensions;if(!h(t))return!1;let r=t[nt];if(r===void 0)return!1;if(!h(r))throw new u("Invalid MCP Apps client capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[nt]:vr}}});let n=r.mimeTypes,o=r.specVersion;if(!Array.isArray(n)||!n.includes(Nr)||o!==void 0&&o!==Ae)throw new u("Unsupported MCP Apps client capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[nt]:vr}}});return!0}var JC={csp:{connectDomains:[],resourceDomains:[],frameDomains:[]},permissions:{},prefersBorder:!0},Lr=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:JC})));function LL(e){return Lr.find(t=>t.uri===e)}function $L(e){let t=new Map(Lr.map(r=>[r.toolName,r]));return e.map(r=>{let n=t.get(r.name);return n?{...r,_meta:{...r._meta,ui:n.toolMeta}}:{...r}})}function kr(e){return e.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;")}function DL(e){let t=kr(e.name),r=kr(e.description),n=JSON.stringify({name:`pm-${e.id}-view`,version:Ae}),o=JSON.stringify(Ae);return`<!doctype html>
4
+ `,stderr:""}}import{createHash as ar,createHmac as cr,timingSafeEqual as Wg}from"node:crypto";var Yg=["elicitation/create","roots/list","sampling/createMessage"],ir=class extends Error{inputRequests;requestState;constructor(t){super("MCP operation requires additional input"),this.name="PmMcpInputRequiredError",this.inputRequests=t.inputRequests,this.requestState=t.requestState}},dr=/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/u,he=32,Qe=64*1024,ge=16*1024,Je={maxBytes:256*1024,maxDepth:32,maxNodes:4096};function Xg(e){return e==="elicitation/create"?"elicitation":e==="sampling/createMessage"?"sampling":"roots"}function Ce(e,t,r){let n;try{n=JSON.stringify(e)}catch{throw new u(`Invalid ${r}: value is not JSON serializable`,m.invalidParams,{field:r})}if(Buffer.byteLength(n,"utf8")>t)throw new u(`Invalid ${r}: payload exceeds the protocol bound`,m.invalidParams,{field:r,maximumBytes:t})}function Ze(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>he)throw new u("Invalid MCP inputRequests count",m.invalidParams,{minimum:1,maximum:he,observed:r.length});let n={};for(let[o,i]of r){if(!dr.test(o)||!h(i))throw new u("Invalid MCP input request entry",m.invalidParams,{field:`inputRequests.${o}`});let s=i.method;if(typeof s!="string"||!Yg.includes(s))throw new u("Unsupported MCP input request method",m.invalidParams,{field:`inputRequests.${o}.method`,method:s??null});let a=Xg(s);if(!Object.prototype.hasOwnProperty.call(t.clientCapabilities,a))throw new u("Missing required client capability",m.missingRequiredClientCapability,{requiredCapabilities:{[a]:{}}});if(!h(i.params))throw new u("Invalid MCP input request parameters",m.invalidParams,{field:`inputRequests.${o}.params`,expected:"object"});n[o]={method:s,params:structuredClone(i.params)}}return Ce(n,Qe,"inputRequests"),n}function pr(e){if(!h(e))throw new u("Invalid MCP inputResponses",m.invalidParams,{field:"inputResponses",expected:"object"});let t=Object.entries(e);if(t.length>he)throw new u("Invalid MCP inputResponses count",m.invalidParams,{maximum:he,observed:t.length});let r={};for(let[n,o]of t){if(!dr.test(n)||!h(o))throw new u("Invalid MCP input response entry",m.invalidParams,{field:`inputResponses.${n}`});r[n]=structuredClone(o)}return Ce(r,Qe,"inputResponses"),r}function Y0(e){let t=e.requestState?.trim();if(t&&Buffer.byteLength(t,"utf8")>ge)throw new u("Invalid MCP requestState: payload exceeds the protocol bound",m.invalidParams,{field:"requestState",maximumBytes:ge});let r=e.inputRequests===void 0?void 0:Ze(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:{[x.serverInfo]:{...e.serverInfo}}}}function lr(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 X0(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>ge/2)throw new u("MCP requestState payload exceeds the protocol bound",m.invalidParams,{maximumBytes:ge/2});let n=r.toString("base64url"),o=cr("sha256",lr(t)).update(n).digest("base64url");return`${n}.${o}`}function Jg(e){if(!h(e)||e.version!==1)throw new u("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});let{expiresAt:t,method:r,parameterDigest:n,principal:o,state:i}=e;if(typeof t!="number"||!Number.isSafeInteger(t))throw new u("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});if(typeof r!="string"||typeof n!="string"||typeof o!="string")throw new u("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});return{expiresAt:t,method:r,parameterDigest:n,principal:o,state:i}}function J0(e,t,r){let[n,o,i]=e.split(".");if(!n||!o||i!==void 0)throw new u("Invalid MCP requestState encoding",m.invalidParams,{field:"requestState"});let s=Buffer.from(o,"base64url"),a=cr("sha256",lr(t)).update(n).digest();if(s.byteLength!==a.byteLength||!Wg(s,a))throw new u("Invalid MCP requestState signature",m.invalidParams,{field:"requestState"});let c;try{c=JSON.parse(Buffer.from(n,"base64url").toString("utf8"))}catch{c=null}let d=Jg(c),{expiresAt:p,method:l,parameterDigest:f,principal:g}=d;if(p<(r.nowMs??Date.now()))throw new u("Expired MCP requestState",m.invalidParams,{field:"requestState",expiredAt:p});if(l!==r.method||f!==r.parameterDigest||g!==r.principal)throw new u("MCP requestState binding mismatch",m.invalidParams,{field:"requestState"});return d}function Q0(e){return Ce(e,Qe,"request parameters"),ar("sha256").update(JSON.stringify(e)).digest("hex")}var sr=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=ar("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 n=this.#e.values().next().value;this.#e.delete(n)}this.#e.add(r)}};function Qg(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 Z0(e,t){return{...e,...Qg(t)}}function Zg(e){return e.replaceAll("~1","/").replaceAll("~0","~")}function eC(e,t){if(t==="#")return e;if(!t.startsWith("#/"))return;let r=e;for(let n of t.slice(2).split("/").map(Zg)){if(!h(r)&&!Array.isArray(r)||!Object.prototype.hasOwnProperty.call(r,n))return;r=r[n]}return r}function tC(e){let t=e.maxBytes??Je.maxBytes,r=e.maxDepth??Je.maxDepth,n=e.maxNodes??Je.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(n)||n<1)throw new u("Invalid MCP JSON Schema work bounds",m.invalidParams);return{maximumBytes:t,maximumDepth:r,maximumNodes:n}}function rC(e,t){let r=Array.isArray(e.value)?e.value:h(e.value)?Object.values(e.value):[];for(let n of r)t.push({value:n,depth:e.depth+1})}function nC(e,t){if(!h(t)||typeof t.$ref!="string")return;let r=t.$ref;if(r.startsWith("#")&&eC(e,r)===void 0)throw new u("MCP JSON Schema contains an unresolved local reference",m.invalidParams,{reference:r})}function eL(e,t={}){let{maximumBytes:r,maximumDepth:n,maximumNodes:o}=tC(t);if(typeof e!="boolean"&&!h(e))throw new u("Invalid MCP JSON Schema root",m.invalidParams,{expected:"object or boolean"});Ce(e,r,"JSON Schema");let i=[{value:e,depth:0}],s=0;for(;i.length>0;){let a=i.pop();if(s+=1,s>o||a.depth>n)throw new u("MCP JSON Schema exceeds validation work bounds",m.invalidParams,{maximumDepth:n,maximumNodes:o});nC(e,a.value),rC(a,i)}return structuredClone(e)}import{randomUUID as oC}from"node:crypto";import{readFile as iC}from"node:fs/promises";import ur from"node:path";var cL="io.modelcontextprotocol/tasks",sC=["working","input_required","completed","failed","cancelled"],aC=/^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,cC=3600*1e3,dC=1e3,Se=1024,pC=30,lC=2e3;function et(e){return new u(e,m.invalidParams,{code:"mcp_task_not_found_or_not_authorized"})}function ye(e){let t=e.trim();if(!aC.test(t))throw et("Unknown MCP task");return t}function mr(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 fr(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 uC(e){if(!sC.includes(e))throw new u("Corrupt MCP task record",m.invalidParams);return e}function mC(e){if(typeof e!="string"||e.length===0)throw new u("Corrupt MCP task record",m.invalidParams);return e}function fC(e){if(typeof e!="number"||!Number.isSafeInteger(e)||e<1)throw new u("Corrupt MCP task record",m.invalidParams);return e}function _C(e){if(e!==null&&(typeof e!="number"||!Number.isSafeInteger(e)||e<0))throw new u("Corrupt MCP task record",m.invalidParams);return e}function hC(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 gC(e){if(!Array.isArray(e)||e.some(t=>typeof t!="string"))throw new u("Corrupt MCP task record",m.invalidParams);return[...e]}function CC(e){if(!h(e)||e.version!==1)throw new u("Corrupt MCP task record",m.invalidParams);let t=typeof e.taskId=="string"?ye(e.taskId):"",r=uC(e.status),n=mC(e.principal),o=fC(e.workerPid),i=_C(e.ttlMs),s=hC(e.pollIntervalMs),a={version:1,taskId:t,status:r,principal:n,workerPid:o,createdAt:mr(e.createdAt,"createdAt"),lastUpdatedAt:mr(e.lastUpdatedAt,"lastUpdatedAt"),ttlMs:i,consumedInputKeys:gC(e.consumedInputKeys),...typeof e.statusMessage=="string"?{statusMessage:e.statusMessage.slice(0,Se)}:{},...typeof s=="number"?{pollIntervalMs:s}:{}};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=fr(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 yC(e){try{return process.kill(e,0),!0}catch(t){return!(typeof t=="object"&&t!==null&&"code"in t&&t.code==="ESRCH")}}var tt=class{#e;#t;#r;#n;#i;constructor(t){this.#e=ur.resolve(t.pmRoot),this.#t=t.owner?.trim()||"pm-mcp",this.#r=t.now??(()=>new Date),this.#n=t.taskIdFactory??(()=>`mcp-task-${oC()}`),this.#i=t.workerPid??process.pid}#s(t){return ur.join(this.#e,"runtime","mcp-tasks","records",`${ye(t)}.json`)}async#c(t){try{return CC(JSON.parse(await iC(this.#s(t),"utf8")))}catch(r){throw me(r)||r instanceof SyntaxError?et("Unknown MCP task"):r}}async#a(t){await $e(this.#s(t.taskId),`${JSON.stringify(t,null,2)}
5
+ `)}async#o(t,r,n){let o=ye(t),i=await Fe(this.#e,o,pC,this.#t,!1,!1,lC);try{let s=await this.#c(o);if(s.principal!==r)throw et("Unknown MCP task");let a=n(s);return await this.#a(a),a}finally{await i()}}async create(t){let r=ye(this.#n()),n=t.principal.trim(),o=t.ttlMs===void 0?cC:t.ttlMs,i=t.pollIntervalMs??dC;if(n.length===0||o!==null&&(!Number.isSafeInteger(o)||o<0)||!Number.isSafeInteger(i)||i<0)throw new u("Invalid MCP task creation options",m.invalidParams);let s=this.#r().toISOString(),a={version:1,taskId:r,status:"working",createdAt:s,lastUpdatedAt:s,ttlMs:o,pollIntervalMs:i,principal:n,workerPid:this.#i,consumedInputKeys:[],...t.statusMessage?.trim()?{statusMessage:t.statusMessage.trim().slice(0,Se)}:{}};return await this.#a(a),{...H(a),resultType:"task"}}async get(t,r){return H(await this.#o(t,r,n=>{if(re(n.status))return n;let o=this.#r().getTime(),i=n.ttlMs!==null&&Date.parse(n.createdAt)+n.ttlMs<=o,s=n.workerPid!==this.#i&&!yC(n.workerPid);return!i&&!s?n:{...n,status:"failed",statusMessage:i?"Task retention expired before completion.":"Task worker ended before recording a terminal result.",lastUpdatedAt:this.#r().toISOString(),error:{code:-32603,message:i?"MCP task expired":"MCP task worker unavailable after restart",data:{recoverable:!1,createNewTask:!0}},inputRequests:void 0}}))}async requireInput(t){let r=Ze(t.inputRequests,t.requestContext);return H(await this.#o(t.taskId,t.principal,n=>{if(re(n.status))return n;let o=Object.keys(r).filter(i=>n.consumedInputKeys.includes(i));if(o.length>0)throw new u("MCP task input request keys must be unique for the task lifetime",m.invalidParams,{reused:o});return{...n,status:"input_required",statusMessage:t.statusMessage?.trim().slice(0,Se),lastUpdatedAt:this.#r().toISOString(),inputRequests:r}}))}async update(t,r,n){let o=pr(n),i=[],s=[];return await this.#o(t,r,a=>{if(a.status!=="input_required"||!a.inputRequests)return a;let c={...a.inputRequests},d=a.inputResponses?{...a.inputResponses}:{};for(let[p,l]of Object.entries(o))Object.prototype.hasOwnProperty.call(c,p)&&(d[p]=l,delete c[p],i.push(p));return s=Object.keys(c).sort(),i.length===0?a:{...a,status:s.length===0?"working":"input_required",lastUpdatedAt:this.#r().toISOString(),inputRequests:s.length===0?void 0:c,inputResponses:d,consumedInputKeys:[...new Set([...a.consumedInputKeys,...i])].sort()}}),{acceptedKeys:i.sort(),remainingKeys:s}}async takeInputResponses(t,r){let n={};return await this.#o(t,r,o=>(n=structuredClone(o.inputResponses??{}),Object.keys(n).length===0?o:{...o,inputResponses:void 0})),n}async complete(t,r,n){return H(await this.#o(t,r,o=>re(o.status)?o:{...o,status:"completed",statusMessage:"Task completed.",lastUpdatedAt:this.#r().toISOString(),result:structuredClone(n),inputRequests:void 0,error:void 0}))}async fail(t,r,n){let o=fr(n);return H(await this.#o(t,r,i=>re(i.status)?i:{...i,status:"failed",statusMessage:o.message,lastUpdatedAt:this.#r().toISOString(),error:o,inputRequests:void 0,result:void 0}))}async cancel(t,r){return H(await this.#o(t,r,n=>re(n.status)?n:{...n,status:"cancelled",statusMessage:"Task cancelled by the client.",lastUpdatedAt:this.#r().toISOString(),inputRequests:void 0,result:void 0,error:void 0}))}};function dL(e){return new tt(e)}var Te="io.modelcontextprotocol/subscriptionId",_r=256,hr=2048,SC=5e3;function TC(e,t){return new Promise((r,n)=>{let o=setTimeout(()=>n(new Error("MCP subscription sink write timed out")),SC);o.unref(),Promise.resolve().then(()=>e(t)).then(()=>{clearTimeout(o),r()},i=>{clearTimeout(o),n(i instanceof Error?i:new Error(String(i)))})})}function rt(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 EC(e){if(!h(e))throw new u("Invalid MCP subscription filter",m.invalidParams,{field:"notifications",expected:"object"});let t=rt(e.toolsListChanged,"toolsListChanged"),r=rt(e.promptsListChanged,"promptsListChanged"),n=rt(e.resourcesListChanged,"resourcesListChanged"),o;if(e.resourceSubscriptions!==void 0){if(!Array.isArray(e.resourceSubscriptions)||e.resourceSubscriptions.length>_r)throw new u("Invalid MCP resource subscriptions",m.invalidParams,{field:"notifications.resourceSubscriptions",maximum:_r});let i=new Set;for(let s of e.resourceSubscriptions){if(typeof s!="string"||s.trim().length===0||Buffer.byteLength(s,"utf8")>hr)throw new u("Invalid MCP resource subscription URI",m.invalidParams,{field:"notifications.resourceSubscriptions",maximumBytes:hr});i.add(s)}i.size>0&&(o=[...i].sort())}return{...t?{toolsListChanged:t}:{},...r?{promptsListChanged:r}:{},...n?{resourcesListChanged:n}:{},...o?{resourceSubscriptions:o}:{}}}function AC(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 gr=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=AC(EC(t.notifications),this.#e),n={filter:r,sink:t.sink,writeQueue:Promise.resolve()};this.#t.set(t.id,n);try{await this.#n(t.id,n,{jsonrpc:"2.0",method:"notifications/subscriptions/acknowledged",params:{_meta:{[Te]:t.id},notifications:structuredClone(r)}},!0)}catch(o){throw this.#t.delete(t.id),o}return structuredClone(r)}async emitListChanged(t){let r=`${t}ListChanged`,n=`notifications/${t}/list_changed`,o=[];for(let[i,s]of this.#t)s.filter[r]===!0&&o.push(this.#n(i,s,{jsonrpc:"2.0",method:n,params:{_meta:{[Te]:i}}}));return(await Promise.all(o)).filter(Boolean).length}async emitResourceUpdated(t){let r=[];for(let[n,o]of this.#t)o.filter.resourceSubscriptions?.includes(t)&&r.push(this.#n(n,o,{jsonrpc:"2.0",method:"notifications/resources/updated",params:{_meta:{[Te]:n},uri:t}}));return(await Promise.all(r)).filter(Boolean).length}async#n(t,r,n,o=!1){let i=r.writeQueue.then(async()=>{if(this.#t.get(t)!==r)return!1;try{return await TC(r.sink,n),!0}catch(s){if(this.#t.get(t)===r&&this.#t.delete(t),o)throw s;return!1}});return r.writeQueue=i.then(()=>{},()=>{}),i}close(t){if(this.#t.delete(t))return{...Xe({resultType:"complete",_meta:{[Te]:t}},this.#r)}}closeAll(){let t=[];for(let r of this.#t.keys()){let n=this.close(r);t.push({id:r,result:n})}return t}};var Cr=/^=\?base64\?([A-Za-z0-9+/]*={0,2})\?=$/u,xC=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/u,yr=/^[\t\x20-\x7E]*$/u,Sr=new Set(["prompts/get","resources/read","tools/call"]);function bC(e){let t=new Map;for(let[r,n]of Object.entries(e)){if(n===void 0)continue;let o=typeof n=="string"?n:n.join(", ");t.set(r.toLowerCase(),o)}return t}function b(e,t){throw new u(e,m.headerMismatch,{header:t})}function Tr(e){let t=typeof e=="boolean"?String(e).toLowerCase():String(e);return t.length>0&&t.trim()===t&&yr.test(t)&&!Cr.test(t)?t:`=?base64?${Buffer.from(t,"utf8").toString("base64")}?=`}function Er(e,t){let r=Cr.exec(e);if(r){let n=r[1],o=Buffer.from(n,"base64");return o.toString("base64")!==n||o.length===0?b("Malformed MCP Base64 header value",t):o.toString("utf8")}return e.length===0||e.trim()!==e||!yr.test(e)?b("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 wC(e,t,r){let n=e["x-mcp-header"];if(n===void 0)return;let o=e.type;if(typeof n!="string"||!xC.test(n)||!["boolean","integer","string"].includes(String(o))||r.has(n.toLowerCase()))throw new u("Invalid MCP x-mcp-header annotation",m.invalidParams,{field:t.join("."),annotation:n});return r.add(n.toLowerCase()),{name:n,path:t,type:o}}function Ar(e){if(!h(e))throw new u("Invalid MCP tool schema",m.invalidParams,{field:"inputSchema",expected:"object"});let t=[],r=new Set,n=(o,i)=>{let s=o.properties;if(s!==void 0){if(!h(s))throw new u("Invalid MCP tool schema properties",m.invalidParams,{field:"inputSchema.properties"});for(let[a,c]of Object.entries(s)){if(!h(c))continue;let d=[...i,a],p=wC(c,d,r);p&&t.push(p);for(let[l,f]of Object.entries(c))if(l!=="properties"&&l!=="x-mcp-header"&&Ee(f))throw new u("MCP x-mcp-header is not statically reachable",m.invalidParams,{field:d.join("."),keyword:l});n(c,d)}}};for(let[o,i]of Object.entries(e))if(o!=="properties"&&Ee(i))throw new u("MCP x-mcp-header is not statically reachable",m.invalidParams,{field:"inputSchema",keyword:o});return n(e,[]),t}function xr(e,t){let r=e;for(let n of t){if(!h(r))return;r=r[n]}return r}function br(e,t){let r=e==="resources/read"?t.uri:t.name;return typeof r=="string"?r:void 0}function OC(e,t){let r=h(e.arguments)?e.arguments:{},n={};for(let o of Ar(t)){let i=xr(r,o.path);if(i==null)continue;if(!(o.type==="integer"&&typeof i=="number"&&Number.isSafeInteger(i)||o.type==="boolean"&&typeof i=="boolean"||o.type==="string"&&typeof i=="string"))throw new u("Invalid MCP custom header argument",m.invalidParams,{field:o.path.join("."),expected:o.type});n[`Mcp-Param-${o.name}`]=Tr(i)}return n}function fL(e){let t=h(e.request.params)?e.request.params:void 0,r=Ye(t),n=e.request.method;if(typeof n!="string"||n.length===0)return b("Missing MCP request method","Mcp-Method");let o={Accept:"application/json, text/event-stream","Content-Type":"application/json","MCP-Protocol-Version":r.protocolVersion,"Mcp-Method":n},i=br(n,t);if(Sr.has(n)){if(i===void 0)return b("Missing MCP request name","Mcp-Name");o["Mcp-Name"]=Tr(i)}return n==="tools/call"&&e.toolSchema!==void 0&&Object.assign(o,OC(t,e.toolSchema)),o}function RC(e,t){let r=t.method;(typeof r!="string"||r.length===0)&&b("Missing MCP request method","Mcp-Method");let n=h(t.params)?t.params:void 0,o=Ye(n).protocolVersion;if(e.get("mcp-protocol-version")!==o&&b("MCP protocol header does not match request metadata","MCP-Protocol-Version"),e.get("mcp-method")!==r&&b("MCP method header does not match request body","Mcp-Method"),Sr.has(r)){let i=e.get("mcp-name"),s=br(r,n);(i===void 0||s===void 0||Er(i,"Mcp-Name")!==s)&&b("MCP name header does not match request body","Mcp-Name")}e.has("last-event-id")&&b("MCP SSE resumability is not supported","Last-Event-ID")}function PC(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 MC(e){let t=h(e.params.arguments)?e.params.arguments:{};for(let r of Ar(e.toolSchema)){let n=xr(t,r.path),o=`Mcp-Param-${r.name}`,i=e.headers.get(o.toLowerCase());if(n==null){i!==void 0&&b("Unexpected MCP parameter header",o);continue}i===void 0&&b("Missing MCP parameter header",o),PC(r,n,Er(i,o))||b("MCP parameter header does not match request body",o)}}function _L(e){let t=bC(e.headers),r=typeof e.request.method=="string"?e.request.method:"";RC(t,e.request),!(r!=="tools/call"||e.toolSchema===void 0)&&MC({headers:t,params:e.request.params,toolSchema:e.toolSchema})}var hL=z;import{AsyncLocalStorage as IC}from"node:async_hooks";import{createHash as wr,timingSafeEqual as vC}from"node:crypto";var C=class extends Error{httpStatus;challenge;constructor(t,r,n){super(t),this.name="PmMcpAuthorizationError",this.httpStatus=r,this.challenge=n}},kC=/^00-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})$/u,NC=/^[a-z][a-z0-9_*/-]{0,255}$/u,LC=/^(?:[a-z0-9][a-z0-9_*/-]{0,240})@[a-z][a-z0-9_*/-]{0,13}$/u,$C=/^[\x20-\x2B\x2D-\x3C\x3E-\x7E]{0,255}[\x21-\x2B\x2D-\x3C\x3E-\x7E]$/u,Rr=/^[\x21\x23-\x5B\x5D-\x7E]+$/u,Pr=/^[A-Za-z0-9!#$%&'*+.^_`|~-]+$/u,DC=/^[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]*$/u,FC=/%(?![0-9A-Fa-f]{2})/u,GC=512,UC=32,jC=180,BC=8192,qC=8192,Mr=new IC;function A(e,t,r=!1){if(new RegExp("\\p{Cc}","u").test(e))throw new C(`Invalid ${t}`,401);let n;try{n=new URL(e)}catch{throw new C(`Invalid ${t}`,401)}let o=n.hostname==="127.0.0.1"||n.hostname==="localhost";if(n.hash.length>0||n.protocol!=="https:"&&!(r&&o&&n.protocol==="http:"))throw new C(`Invalid ${t}`,401);return n}function zC(e,t){let r=t.toLowerCase();for(let[n,o]of Object.entries(e))if(!(n.toLowerCase()!==r||o===void 0))return typeof o=="string"?o:o.join(", ")}function TL(e){let t=A(e.resource,"protected resource URI",!0).href.replace(/\/$/u,"");if(e.authorizationServers.length===0)throw new C("Protected resource metadata requires an authorization server",401);let r=e.authorizationServers.map(o=>A(o,"authorization server issuer").href.replace(/\/$/u,"")),n=[...new Set(e.scopes??[])];if(n.some(o=>!Rr.test(o)))throw new C("Invalid authorization scope",401);return{resource:t,authorization_servers:r,...n.length>0?{scopes_supported:n.sort()}:{}}}function EL(e){let t=A(e,"authorization server issuer"),r=t.pathname.replace(/^\/+|\/+$/gu,""),n=t.origin;return r?[`${n}/.well-known/oauth-authorization-server/${r}`,`${n}/.well-known/openid-configuration/${r}`,`${n}/${r}/.well-known/openid-configuration`]:[`${n}/.well-known/oauth-authorization-server`,`${n}/.well-known/openid-configuration`]}function AL(e,t){if(!h(e)||typeof e.issuer!="string")throw new C("Invalid authorization server metadata",401);let r=A(t,"expected issuer").href.replace(/\/$/u,"");if(A(e.issuer,"metadata issuer").href.replace(/\/$/u,"")!==r)throw new C("Authorization server issuer mismatch",401);if(!Array.isArray(e.code_challenge_methods_supported)||!e.code_challenge_methods_supported.includes("S256"))throw new C("Authorization server does not support required S256 PKCE",401);let o=d=>{let p=e[d];if(typeof p!="string")throw new C(`Authorization server metadata requires ${d}`,401);return A(p,d).href},i=d=>{let p=e[d];return typeof p=="string"?A(p,d).href:void 0},s=o("authorization_endpoint"),a=o("token_endpoint"),c=i("registration_endpoint");return{issuer:r,authorization_endpoint:s,token_endpoint:a,code_challenge_methods_supported:[...new Set(e.code_challenge_methods_supported.filter(d=>typeof d=="string"))],...e.client_id_metadata_document_supported===!0?{client_id_metadata_document_supported:!0}:{},...c?{registration_endpoint:c}:{}}}function xL(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 bL(e){if(e.responseIssuer===void 0){if(e.issuerParameterSupported)throw new C("Authorization response omitted the advertised issuer",401);return}if(e.responseIssuer!==e.expectedIssuer)throw new C("Authorization response issuer mismatch",401)}function wL(e,t){let r=A(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 C("Invalid Client ID Metadata Document",401);for(let n of e.redirect_uris){if(typeof n!="string")throw new C("Invalid client redirect URI",401);A(n,"client redirect URI",!0)}return structuredClone(e)}function OL(e){if(e.redirectUris.length===0||e.clientName.trim().length===0)throw new C("Invalid dynamic client registration metadata",401);let t=e.redirectUris.map(r=>A(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 Or=class{#e=new Map;set(t,r){let n=A(t,"credential issuer").href;this.#e.set(n,structuredClone(r))}get(t){let r=A(t,"credential issuer").href,n=this.#e.get(r);return n?structuredClone(n):void 0}delete(t){let r=A(t,"credential issuer").href;return this.#e.delete(r)}};function HC(e){let t=e.traceparent,r=e.tracestate;if(t!==void 0){let n=typeof t=="string"?kC.exec(t):null;if(!n)throw new C("Invalid MCP traceparent",403);let o=n[1],i=n[2];if(/^0+$/u.test(o)||/^0+$/u.test(i))throw new C("Invalid MCP traceparent",403)}if(r!==void 0&&(typeof r!="string"||!KC(r)))throw new C("Invalid MCP tracestate",403);return{...typeof t=="string"?{traceparent:t}:{},...typeof r=="string"?{tracestate:r}:{}}}function $(e){return e.replace(/^[ \t]*|[ \t]*$/gu,"")}function VC(e){return NC.test(e)||LC.test(e)}function KC(e){if(Buffer.byteLength(e,"utf8")>GC)return!1;let t=e.split(",");if(t.length>UC)return!1;let r=new Set;for(let n of t){let o=$(n);if(o.length===0)continue;let i=o.indexOf("="),s=i>0?o.slice(0,i):"",a=i>0?o.slice(i+1):"";if(!VC(s)||!$C.test(a)||r.has(s))return!1;r.add(s)}return!0}function Ir(e){return DC.test(e)&&!FC.test(e)}function WC(e){let t=$(e),r=t.indexOf("="),n=$(r>=0?t.slice(0,r):t),o=r>=0?$(t.slice(r+1)):void 0;return Pr.test(n)&&(o===void 0||Ir(o))}function YC(e){let t=$(e),r=t.split(";"),n=r[0],o=r.slice(1),i=n.indexOf("="),s=$(i>0?n.slice(0,i):""),a=i>0?$(n.slice(i+1)):"";if(!(!Pr.test(s)||!Ir(a)||!o.every(WC)))return{key:s,serialized:t}}function XC(e,t){if(e===void 0)return;if(typeof e!="string"||Buffer.byteLength(e,"utf8")>BC)throw new C("Invalid MCP baggage",403);let r=new Set(t),n=e.split(",");if(n.length>jC)throw new C("Invalid MCP baggage",403);let o=[];for(let i of n){let s=YC(i);if(!s)throw new C("Invalid MCP baggage",403);r.has(s.key)&&o.push(s.serialized)}return o.length>0?o.join(","):void 0}function RL(e,t={}){let r=h(e)&&h(e._meta)?e._meta:{},n=XC(r.baggage,t.baggageAllowlist??[]);return{...HC(r),...n?{baggage:n}:{}}}function PL(e,t){return Mr.run(structuredClone(e),t)}function ML(){let e=Mr.getStore();return e?{...e}:void 0}async function IL(e){let t=A(e.policy.resourceMetadataUrl,"protected resource metadata URL",!0).href,r=[...new Set(e.policy.requiredScopes??[])];if(r.some(l=>!Rr.test(l)))throw new C("Invalid authorization scope",401);let n=`Bearer resource_metadata="${t}"`;if(new URL(e.requestUrl,e.policy.resource).searchParams.has("access_token"))throw new C("Access tokens must not appear in URI query parameters",401,n);let s=zC(e.headers,"authorization")?.match(/^Bearer ([^\s]+)$/iu);if(!s)throw new C("Missing or malformed bearer token",401,n);let a=s[1];if(Buffer.byteLength(a,"utf8")>qC)throw new C("Missing or malformed bearer token",401,n);let c;try{c=await e.policy.verifyAccessToken(a)}catch{throw new C("Invalid bearer token",401,n)}let d=Array.isArray(c.audience)?c.audience:[c.audience];if(c.issuer!==e.policy.issuer||!d.includes(e.policy.resource))throw new C("Bearer token issuer or audience mismatch",401,n);let p=r.filter(l=>!c.scopes.includes(l));if(p.length>0)throw new C("Bearer token has insufficient scope",403,`${n}, scope="${p.join(" ")}"`);return{...c,audience:[...d],scopes:[...c.scopes]}}function vL(e){let t=wr("sha256").update(e.token).digest();return r=>{let n=wr("sha256").update(r).digest();if(!vC(t,n))throw new C("Invalid bearer token",401);return structuredClone(e.claims)}}var nt="io.modelcontextprotocol/ui",Ae="2026-01-26",Nr="text/html;profile=mcp-app",vr=Object.freeze({specVersion:Ae,mimeTypes:[Nr]});function LL(e){let t=e.clientCapabilities.extensions;if(!h(t))return!1;let r=t[nt];if(r===void 0)return!1;if(!h(r))throw new u("Invalid MCP Apps client capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[nt]:vr}}});let n=r.mimeTypes,o=r.specVersion;if(!Array.isArray(n)||!n.includes(Nr)||o!==void 0&&o!==Ae)throw new u("Unsupported MCP Apps client capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[nt]:vr}}});return!0}var JC={csp:{connectDomains:[],resourceDomains:[],frameDomains:[]},permissions:{},prefersBorder:!0},Lr=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:JC})));function $L(e){return Lr.find(t=>t.uri===e)}function DL(e){let t=new Map(Lr.map(r=>[r.toolName,r]));return e.map(r=>{let n=t.get(r.name);return n?{...r,_meta:{...r._meta,ui:n.toolMeta}}:{...r}})}function kr(e){return e.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;")}function FL(e){let t=kr(e.name),r=kr(e.description),n=JSON.stringify({name:`pm-${e.id}-view`,version:Ae}),o=JSON.stringify(Ae);return`<!doctype html>
6
6
  <html lang="en">
7
7
  <head>
8
8
  <meta charset="utf-8">
@@ -25,11 +25,11 @@ import{f as Bg}from"./chunks/chunk-3KEMIPKG.js";import{a as vN,b as kN,c as NN,d
25
25
  (()=>{"use strict";const MAX=24000,status=document.querySelector("#status"),result=document.querySelector("#result"),input=document.querySelector("#input"),pending=new Map();let nextId=1;const render=(node,value)=>{let text;try{text=typeof value==="string"?value:JSON.stringify(value,null,2)}catch{text="Result could not be serialized."}if(text.length>MAX)text=text.slice(0,MAX)+"\\n\\n[View truncated at "+MAX+" characters; use the authoritative pm tool with a cursor or narrower projection.]";node.textContent=text};const send=(message)=>window.parent.postMessage(message,"*");window.addEventListener("message",event=>{if(event.source!==window.parent||!event.data||event.data.jsonrpc!=="2.0")return;const message=event.data;if(message.id!==undefined&&pending.has(message.id)){pending.get(message.id)(message);pending.delete(message.id);return}if(message.method==="ui/notifications/tool-input"||message.method==="ui/notifications/tool-input-partial"){render(input,message.params?.arguments??message.params);status.textContent="Input received"}else if(message.method==="ui/notifications/tool-result"){render(result,message.params);status.textContent="Current tool result"}else if(message.method==="ui/notifications/tool-cancelled"){status.textContent="Tool call cancelled";status.classList.add("notice")}else if(message.method==="ui/notifications/host-context-changed"&&message.params?.theme){document.documentElement.style.colorScheme=message.params.theme}});const request=(method,params)=>new Promise(resolve=>{const id=nextId++;pending.set(id,resolve);send({jsonrpc:"2.0",id,method,params})});document.querySelector("#copy").addEventListener("click",async()=>{const text=result.textContent+"\\n\\n"+input.textContent;try{await navigator.clipboard.writeText(text);status.textContent="Visible evidence copied"}catch{status.textContent="Clipboard permission unavailable";status.classList.add("notice")}});request("ui/initialize",{appInfo:${n},appCapabilities:{},protocolVersion:${o}}).then(message=>{if(message.error){status.textContent="Host rejected MCP App initialization";status.classList.add("notice");return}send({jsonrpc:"2.0",method:"ui/notifications/initialized"});status.textContent="Connected \u2014 awaiting authoritative result"})})();
26
26
  </script>
27
27
  </body>
28
- </html>`}import{createHash as ot}from"node:crypto";import{lstat as QC,readdir as qr,readFile as ZC}from"node:fs/promises";import M from"node:path";import{parseDocument as ey}from"yaml";var $r="io.modelcontextprotocol/skills",it="SEP-2640@a3e147ca2710f68214247aecc729731ee1ae8d03",ty=Object.freeze({revision:it,status:"draft",directoryRead:!0});function HL(e,t=!1){let r=e.clientCapabilities.extensions,n=h(r)?r[$r]:void 0;if(!h(n)||n.revision!==it||t&&n.directoryRead!==!0)throw new u("Missing or incompatible Skills over MCP draft capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[$r]:ty}}})}var P=Object.freeze({maxFilesPerSkill:512,maxFileBytes:16*1024*1024,maxSkillBytes:16*1024*1024,defaultPageSize:20,maxPageSize:100}),Dr=100,ry=32*1024*1024,ny=/^[a-z0-9]+(?:-[a-z0-9]+)*$/u,Fr=new Set(Array.from({length:P.maxPageSize},(e,t)=>t+1));function T(e,t){throw new u(e,-32602,t)}function Gr(e,t){try{return new TextDecoder("utf-8",{fatal:!0}).decode(t),e.endsWith(".md")?"text/markdown":"text/plain"}catch{return"application/octet-stream"}}function oy(e,t){let r=/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/u.exec(e);r||T(`Skill ${t} is missing YAML frontmatter.`);let n=ey(r[1],{prettyErrors:!1,strict:!0,uniqueKeys:!0});n.errors.length>0&&T(`Skill ${t} has invalid YAML frontmatter.`,{errors:n.errors.map(i=>i.message)});let o;try{o=n.toJS({maxAliasCount:0})}catch(i){T(`Skill ${t} has unsupported YAML aliases.`,{error:String(i)})}return(typeof o!="object"||o===null||Array.isArray(o))&&T(`Skill ${t} frontmatter must be an object.`),o}async function iy(e,t,r,n){return r>P.maxFileBytes&&T(`Skill resource exceeds the per-file limit: ${t}.`),n.files+=1,n.files>P.maxFilesPerSkill&&T(`Skill exceeds ${P.maxFilesPerSkill} files.`),n.skillBytes+=r,n.skillBytes>P.maxSkillBytes&&T(`Skill exceeds the aggregate byte limit: ${t}.`),n.originBytes.value+=r,n.originBytes.value>ry&&T(`Skill origin exceeds the aggregate byte limit: ${t}.`),ZC(e)}async function zr(e,t,r){let n=M.join(e,t),o=await qr(n,{withFileTypes:!0}),i=[];for(let s of o.sort((a,c)=>a.name.localeCompare(c.name))){let a=M.posix.join(t.split(M.sep).join("/"),s.name),c=M.join(e,...a.split("/")),d=await QC(c);d.isSymbolicLink()&&T(`Skill resource must not be a symbolic link: ${a}.`),d.isDirectory()?i.push(...await zr(e,a,r)):d.isFile()?i.push({relative:a,bytes:await iy(c,a,d.size,r)}):T(`Skill resource must be a regular file or directory: ${a}.`)}return i}async function Ur(e,t,r){let n=new Map,o;try{o=await qr(e,{withFileTypes:!0})}catch(a){if(St(a))return n;throw a}let i=o.filter(a=>a.isDirectory()&&ny.test(a.name)).sort((a,c)=>a.name.localeCompare(c.name));i.length>Dr&&T(`Skill origin exceeds ${Dr} directories.`);let s={value:0};for(let a of i){let c=await zr(M.join(e,a.name),"",{files:0,skillBytes:0,originBytes:s}),d=c.reduce((_,y)=>_+y.bytes.byteLength,0),p=c.find(_=>_.relative==="SKILL.md");if(!p)continue;let l=oy(p.bytes.toString("utf8"),a.name);l.name!==a.name&&T(`Skill directory ${a.name} must match frontmatter name.`,{actual:l.name??null,expected:a.name}),(typeof l.description!="string"||l.description.trim().length===0)&&T(`Skill ${a.name} requires a non-empty frontmatter description.`,{required:["description"]});let f=c.map(_=>({uri:`skill://${a.name}/${_.relative}`,digest:`sha256:${ot("sha256").update(_.bytes).digest("hex")}`,size:_.bytes.byteLength})),g=ot("sha256").update(f.map(_=>`${_.uri}:${_.digest}`).join(`
28
+ </html>`}import{createHash as ot}from"node:crypto";import{lstat as QC,readdir as qr,readFile as ZC}from"node:fs/promises";import M from"node:path";import{parseDocument as ey}from"yaml";var $r="io.modelcontextprotocol/skills",it="SEP-2640@a3e147ca2710f68214247aecc729731ee1ae8d03",ty=Object.freeze({revision:it,status:"draft",directoryRead:!0});function VL(e,t=!1){let r=e.clientCapabilities.extensions,n=h(r)?r[$r]:void 0;if(!h(n)||n.revision!==it||t&&n.directoryRead!==!0)throw new u("Missing or incompatible Skills over MCP draft capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[$r]:ty}}})}var P=Object.freeze({maxFilesPerSkill:512,maxFileBytes:16*1024*1024,maxSkillBytes:16*1024*1024,defaultPageSize:20,maxPageSize:100}),Dr=100,ry=32*1024*1024,ny=/^[a-z0-9]+(?:-[a-z0-9]+)*$/u,Fr=new Set(Array.from({length:P.maxPageSize},(e,t)=>t+1));function T(e,t){throw new u(e,-32602,t)}function Gr(e,t){try{return new TextDecoder("utf-8",{fatal:!0}).decode(t),e.endsWith(".md")?"text/markdown":"text/plain"}catch{return"application/octet-stream"}}function oy(e,t){let r=/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/u.exec(e);r||T(`Skill ${t} is missing YAML frontmatter.`);let n=ey(r[1],{prettyErrors:!1,strict:!0,uniqueKeys:!0});n.errors.length>0&&T(`Skill ${t} has invalid YAML frontmatter.`,{errors:n.errors.map(i=>i.message)});let o;try{o=n.toJS({maxAliasCount:0})}catch(i){T(`Skill ${t} has unsupported YAML aliases.`,{error:String(i)})}return(typeof o!="object"||o===null||Array.isArray(o))&&T(`Skill ${t} frontmatter must be an object.`),o}async function iy(e,t,r,n){return r>P.maxFileBytes&&T(`Skill resource exceeds the per-file limit: ${t}.`),n.files+=1,n.files>P.maxFilesPerSkill&&T(`Skill exceeds ${P.maxFilesPerSkill} files.`),n.skillBytes+=r,n.skillBytes>P.maxSkillBytes&&T(`Skill exceeds the aggregate byte limit: ${t}.`),n.originBytes.value+=r,n.originBytes.value>ry&&T(`Skill origin exceeds the aggregate byte limit: ${t}.`),ZC(e)}async function zr(e,t,r){let n=M.join(e,t),o=await qr(n,{withFileTypes:!0}),i=[];for(let s of o.sort((a,c)=>a.name.localeCompare(c.name))){let a=M.posix.join(t.split(M.sep).join("/"),s.name),c=M.join(e,...a.split("/")),d=await QC(c);d.isSymbolicLink()&&T(`Skill resource must not be a symbolic link: ${a}.`),d.isDirectory()?i.push(...await zr(e,a,r)):d.isFile()?i.push({relative:a,bytes:await iy(c,a,d.size,r)}):T(`Skill resource must be a regular file or directory: ${a}.`)}return i}async function Ur(e,t,r){let n=new Map,o;try{o=await qr(e,{withFileTypes:!0})}catch(a){if(St(a))return n;throw a}let i=o.filter(a=>a.isDirectory()&&ny.test(a.name)).sort((a,c)=>a.name.localeCompare(c.name));i.length>Dr&&T(`Skill origin exceeds ${Dr} directories.`);let s={value:0};for(let a of i){let c=await zr(M.join(e,a.name),"",{files:0,skillBytes:0,originBytes:s}),d=c.reduce((_,y)=>_+y.bytes.byteLength,0),p=c.find(_=>_.relative==="SKILL.md");if(!p)continue;let l=oy(p.bytes.toString("utf8"),a.name);l.name!==a.name&&T(`Skill directory ${a.name} must match frontmatter name.`,{actual:l.name??null,expected:a.name}),(typeof l.description!="string"||l.description.trim().length===0)&&T(`Skill ${a.name} requires a non-empty frontmatter description.`,{required:["description"]});let f=c.map(_=>({uri:`skill://${a.name}/${_.relative}`,digest:`sha256:${ot("sha256").update(_.bytes).digest("hex")}`,size:_.bytes.byteLength})),g=ot("sha256").update(f.map(_=>`${_.uri}:${_.digest}`).join(`
29
29
  `)).digest("hex");n.set(a.name,{uri:`skill://${a.name}/SKILL.md`,frontmatter:l,resources:f,_meta:{contractVersion:1,extensionRevision:it,origin:t,packageVersion:r,protocolVersion:z,trust:"untrusted",estimatedTokens:Math.ceil(d/4)},files:new Map(c.map(_=>[_.relative,_.bytes])),fingerprint:g})}return n}function jr(e){let{files:t,fingerprint:r,...n}=e;return n}var Br=class e{#e;#t;constructor(t){this.#e=t,this.#t=ot("sha256").update([...t.entries()].sort(([r],[n])=>r.localeCompare(n)).map(([r,n])=>`${r}:${n.fingerprint}`).join(`
30
- `)).digest("hex").slice(0,16)}#r(t,r){if(!t)return 0;try{let n=JSON.parse(Buffer.from(t,"base64url").toString("utf8"));return(typeof n!="object"||n===null||!("fingerprint"in n)||n.fingerprint!==this.#t||!("scope"in n)||n.scope!==r||!("offset"in n)||!Number.isInteger(n.offset)||Number(n.offset)<0)&&T("Skill cursor is invalid or stale."),Number(n.offset)}catch(n){if(n instanceof u)throw n;return T("Skill cursor is invalid or stale.")}}#n(t,r){return Buffer.from(JSON.stringify({fingerprint:this.#t,offset:t,scope:r})).toString("base64url")}static async load(t){let r=await Ur(M.join(t.packageRoot,".agents","skills"),"package",t.packageVersion);if(t.workspaceRoot){let n=M.resolve(t.packageRoot,".agents","skills"),o=M.resolve(t.workspaceRoot,".agents","skills");if(o!==n){let i=await Ur(o,"workspace",t.packageVersion);for(let[s,a]of i)r.set(s,a)}}return new e(r)}list(t={}){let r=t.limit??P.defaultPageSize;Fr.has(r)||T(`Skill list limit must be an integer from 1 to ${P.maxPageSize}.`);let n=this.#r(t.cursor,"skills/list"),o=[...this.#e.values()].sort((c,d)=>c.uri.localeCompare(d.uri)),i=o.slice(n,n+r),s=n+i.length,a=s<o.length;return{skills:i.map(jr),hasMore:a,...a?{nextCursor:this.#n(s,"skills/list")}:{}}}get(t){let r=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)\/SKILL\.md$/u.exec(t),n=r?this.#e.get(r[1]):void 0;return n||T(`Unknown pm MCP skill: ${t}.`,{field:"uri"}),jr(n)}read(t){let r=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)\/(.+)$/u.exec(t),n=r?this.#e.get(r[1]):void 0,o=r?.[2]??"",i=n&&o?n.files.get(o):void 0,s=n?.resources.find(d=>d.uri===t);(!n||!i||!s)&&T(`Unknown pm MCP skill resource: ${t}.`,{field:"uri"});let a={digest:s.digest,origin:n._meta.origin,trust:"untrusted"},c=Gr(o,i);return c!=="application/octet-stream"?{contents:[{uri:t,mimeType:c,text:i.toString("utf8"),_meta:a}]}:{contents:[{uri:t,mimeType:c,blob:i.toString("base64"),_meta:a}]}}readDirectory(t,r={}){let n=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)(?:\/(.+))?$/u.exec(t),o=n?this.#e.get(n[1]):void 0;o||T(`Unknown pm MCP skill directory: ${t}.`,{field:"uri"});let i=(n?.[2]??"").replace(/\/$/u,""),s=i.length>0?`${i}/`:"",a=`skill://${n[1]}`,c=new Map;for(let y of o.resources){let E=y.uri.slice(`${a}/`.length);if(!E.startsWith(s))continue;let B=E.slice(s.length),[O,...ht]=B.split("/"),Rn=`${a}/${s}${O}`,Pn=o.files.get(`${s}${O}`);c.set(O,{uri:Rn,name:O,mimeType:ht.length>0?"inode/directory":Gr(O,Pn)})}i.length>0&&c.size===0&&T(`Unknown pm MCP skill directory: ${t}.`,{field:"uri"});let d=r.limit??P.maxPageSize;Fr.has(d)||T(`Skill directory limit must be an integer from 1 to ${P.maxPageSize}.`);let p=this.#r(r.cursor,t),l=[...c.values()].sort((y,E)=>y.uri.localeCompare(E.uri)),f=l.slice(p,p+d),g=p+f.length,_=g<l.length;return{resources:f,hasMore:_,..._?{nextCursor:this.#n(g,t)}:{}}}};var Hr="https://schema.unbrained.dev/pm/workspace-recipe/v1";function st(e,t){if(e===null||typeof e=="boolean"||typeof e=="string")return e;if(typeof e=="number"){if(!Number.isFinite(e))throw new Error(`Workspace recipe JSON number must be finite at ${t}`);return e}if(Array.isArray(e))return Object.freeze(e.map((r,n)=>st(r,`${t}[${n}]`)));if(typeof e!="object"||Object.getPrototypeOf(e)!==Object.prototype&&Object.getPrototypeOf(e)!==null)throw new Error(`Workspace recipe input must contain JSON values at ${t}`);return Object.freeze(Object.fromEntries(Object.entries(e).map(([r,n])=>[r,st(n,`${t}.${r}`)])))}function xe(e){if(e.schema!==Hr)throw new Error(`Unsupported workspace recipe schema: ${e.schema}`);let t=Tt(e);if(e.operations.some(r=>r.action.trim().length===0||r.input===null||Array.isArray(r.input)))throw new Error("Workspace recipe operations require an action and object input");return Object.freeze({...t,operations:Object.freeze(e.operations.map((r,n)=>Object.freeze({action:r.action,input:st(r.input,`operations[${n}].input`)})))})}async function Vr(e,t){let r=xe(e);return Et(r,t)}async function sy(e,t){return Vr(e,async()=>{let r=[];for(let[n,o]of e.operations.entries())r.push(await t(o,n));return r})}var Kr="pm.agent-observation/v1",Wr="pm.agent-verdict/v1",Yr="pm.agent-episode/v1";function w(e,t){if(!Number.isSafeInteger(e)||e<=0)throw new Error(`${t} must be a positive safe integer.`)}function I(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 ay(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(I(r.command,"observation.reads.command"),w(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 cy(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(w(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,n)=>r+n,0)/e.samples.length;if(Math.abs(t-e.expected_emitted_bytes)>e.tolerance_bytes)throw new Error("observation expected_emitted_bytes is outside the calibrated sample tolerance.")}function dy(e){if(e.length===0)throw new Error("observation.tiers must declare a degradation ladder.");let t=new Set,r=Number.POSITIVE_INFINITY;for(let n of e){if(I(n.id,"observation.tiers.id"),w(n.max_tokens,"observation.tiers.max_tokens"),t.has(n.id))throw new Error(`Duplicate observation tier: ${n.id}.`);if(t.add(n.id),n.max_tokens>r)throw new Error("observation tiers must be ordered from largest to smallest max_tokens.");r=n.max_tokens;let o=new Set;for(let i of n.fields){if(D(i,"observation.tiers.fields"),o.has(i))throw new Error(`Duplicate observation tier field: ${i}.`);o.add(i)}}}function py(e){if(e.schema!==Kr)throw new Error(`observation.schema must be ${Kr}.`);return I(e.id,"observation.id"),w(e.version,"observation.version"),ay(e.reads),cy(e.calibration),e.corpus_dependence.kind==="bounded"&&(I(e.corpus_dependence.dimension,"observation.corpus_dependence.dimension"),w(e.corpus_dependence.maximum,"observation.corpus_dependence.maximum")),dy(e.tiers),ne(structuredClone(e))}function e$(e){return{contract_id:e.id,contract_version:e.version,guaranteed_ceiling_tokens:e.reads.reduce((t,r)=>t+r.budget_tokens,0),expected_emitted_bytes:e.calibration.expected_emitted_bytes,expected_tokens:Math.ceil(e.calibration.expected_emitted_bytes/4),tolerance_bytes:e.calibration.tolerance_bytes,calibration_basis:"emitted_bytes",corpus_dependence:e.corpus_dependence}}async function ly(e,t,r){w(r.budget_tokens,"observation request budget_tokens");let n=[];for(let[o,i]of e.tiers.entries()){n.push(i.id);let s=await t(i),a=Buffer.byteLength(R(s),"utf8"),c=Math.ceil(a/4);if(c<=Math.min(r.budget_tokens,i.max_tokens))return{status:"served",payload:s,receipt:{contract_id:e.id,contract_version:e.version,served_tier:i.id,degraded:o>0,attempted_tiers:n,emitted_bytes:a,estimated_tokens:c,calibration_basis:"emitted_bytes"}}}return{status:"refused",reason:"no_declared_tier_fits_budget",receipt:{contract_id:e.id,contract_version:e.version,served_tier:null,degraded:e.tiers.length>1,attempted_tiers:n,emitted_bytes:null,estimated_tokens:null,calibration_basis:"emitted_bytes"}}}function D(e,t){let r=e.split(".");if(r.some(n=>n.length===0||n==="__proto__"||n==="prototype"||n==="constructor"))throw new Error(`${t} must be a safe, non-empty dot-separated path.`);return r}function Xr(e,t){let r=e;for(let n of D(t,"recorded field path")){if(r===null||typeof r!="object"||!Object.hasOwn(r,n))return;r=r[n]}return r}function uy(e){return`/${D(e,"verdict predicate path").map(t=>t.replaceAll("~","~0").replaceAll("/","~1")).join("/")}`}function my(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 fy(e){if(e.schema!==Wr)throw new Error(`verdict.schema must be ${Wr}.`);I(e.id,"verdict.id"),w(e.version,"verdict.version");let t=new Set;for(let n of e.predicates){I(n.id,"verdict.predicates.id"),D(n.path,"verdict.predicates.path");let o=n.kind;if(o!=="field_equals"&&o!=="field_present"&&o!=="field_absent")throw new Error(`Unsupported verdict predicate kind for ${n.id}.`);if(t.has(n.id))throw new Error(`Duplicate verdict predicate: ${n.id}.`);my(n),t.add(n.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(n=>!t.has(n)))throw new Error("verdict composition contains duplicate or unknown predicate ids.");return ne(structuredClone(e))}function _y(e,t){if(e.predicates.length===0)return{contract_id:e.id,contract_version:e.version,snapshot_id:t.snapshot_id,outcome:"not_applicable",score:null,policy:"verdict_only_no_reward",reason:"no_predicates_declared",predicates:[]};let r=new Map(e.predicates.map(s=>[s.id,s])),n=e.composition.predicate_ids.map(s=>{let a=r.get(s),c=Xr(t.state,a.path),d=a.kind==="field_present"?c!==void 0:a.kind==="field_absent"?c===void 0:R(c)===R(a.expected);return{id:s,outcome:d?"satisfied":"violated",evidence_pointer:`${t.snapshot_id}#${uy(a.path)}`,evidence_digest:gt(R(c))}}),o=n.filter(s=>s.outcome==="satisfied").length,i=e.composition.operator==="all"?o===n.length:o>0;return{contract_id:e.id,contract_version:e.version,snapshot_id:t.snapshot_id,outcome:i?"satisfied":"violated",score:o/n.length,policy:"verdict_only_no_reward",predicates:n}}function t$(e){if(e.schema!==Yr)throw new Error(`episode.schema must be ${Yr}.`);if(I(e.id,"episode.id"),w(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)I(t,"episode.task_item_ids");w(e.limits.max_actions,"episode.limits.max_actions"),w(e.limits.max_observations,"episode.limits.max_observations"),w(e.limits.max_tokens_per_observation,"episode.limits.max_tokens_per_observation");for(let t of e.observable_fields)D(t,"episode.observable_fields");for(let t of e.withheld_fields)D(t,"episode.withheld_fields");for(let t of e.observable_fields){let r=e.withheld_fields.find(n=>t===n||t.startsWith(`${n}.`)||n.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 py(e.observation),fy(e.verdict),xe(e.recipe),ne(structuredClone(e))}function hy(e,t,r){let n=D(t,"observation projection field"),o=e;for(let[i,s]of n.entries()){if(i===n.length-1){r!==void 0&&(o[s]=structuredClone(r));return}let a=o[s];(a===null||typeof a!="object"||Array.isArray(a))&&(o[s]={}),o=o[s]}}function gy(e,t){let r={};for(let n of t)hy(r,n,Xr(e,n));return r}async function r$(e,t){let r=[],n=0,o=0,i=!1,s,a={episode:{id:e.id,label:`pm agent environment v${e.version}`},provenance:{role:e.mode,topic:"agent-environment"}},c=await L(a,()=>t.reset(e.recipe));r.push({sequence:1,kind:"reset",state_id:c.state_id});let d=async()=>{if(i)throw new Error("episode is already closed.");if(o>=e.limits.max_observations)throw new Error("episode exceeded limits.max_observations.");o+=1;let l=await t.readRecordedState(),f=await ly(e.observation,async g=>gy(l.state,g.fields),{budget_tokens:e.limits.max_tokens_per_observation});return r.push({sequence:r.length+1,kind:"observation",state_id:f.receipt.served_tier??l.snapshot_id}),f},p=async(l=!1)=>{if(i&&!l)throw new Error("episode is already closed.");if(o>=e.limits.max_observations)throw new Error("episode exceeded limits.max_observations.");o+=1;let f=await t.readRecordedState(),g=_y(e.verdict,f);return r.push({sequence:r.length+1,kind:"verdict",state_id:f.snapshot_id}),g};return{observe:()=>L(a,d),step:async l=>{if(i)throw new Error("episode is already closed.");if(n>=e.limits.max_actions)throw new Error("episode exceeded limits.max_actions.");n+=1;let f=await L(a,()=>t.execute(l));return r.push({sequence:r.length+1,kind:"action",state_id:f.state_id}),f},score:()=>L(a,p),close:()=>s!==void 0?s:i?Promise.reject(new Error("episode is already closed.")):(i=!0,s=L(a,()=>p(!0)).then(f=>(r.push({sequence:r.length+1,kind:"close",state_id:f.snapshot_id}),{verdict:f,trajectory:ne(structuredClone(r))})).catch(f=>{throw i=!1,f}).finally(()=>{s=void 0}),s)}}var F="https://schema.unbrained.dev/pm/corpus-shape/v1";function V(e,t){if(!Number.isSafeInteger(e)||e<=0)throw new TypeError(`Corpus shape ${t} must be a positive safe integer`);return e}function oe(e,t){if(!Number.isSafeInteger(e)||e<0)throw new TypeError(`Corpus shape ${t} must be a non-negative safe integer`);return e}function Qr(e){if(!(typeof e!="object"||e===null||Object.isFrozen(e))){for(let t of Object.values(e))Qr(t);Object.freeze(e)}}function K(e){if(e.schema!==F)throw new TypeError(`Unsupported corpus shape schema: ${e.schema}`);if(e.name.trim().length===0||e.description.trim().length===0)throw new TypeError("Corpus shape name and description must be non-empty");if(V(e.hierarchy_depth,"hierarchy_depth"),V(e.hierarchy_fanout,"hierarchy_fanout"),oe(e.age_span_days,"age_span_days"),V(e.history_entries_per_item,"history_entries_per_item"),oe(e.comments_per_100_items,"comments_per_100_items"),oe(e.notes_per_100_items,"notes_per_100_items"),oe(e.learnings_per_100_items,"learnings_per_100_items"),V(e.author_cardinality,"author_cardinality"),V(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 Qr(t),t}var be=[{kind:"implements",weight:5},{kind:"blocked_by",weight:2},{kind:"discovered_from",weight:2},{kind:"verifies",weight:2},{kind:"supersedes",weight:1},{kind:"related",weight:4}],W=Object.freeze({scratch:K({schema:F,name:"scratch",description:"Seconds-old, shallow project with minimal history.",hierarchy_depth:2,hierarchy_fanout:50,age_span_days:0,history_entries_per_item:1,comments_per_100_items:2,notes_per_100_items:1,learnings_per_100_items:1,edge_kind_mix:[{kind:"related",weight:1}],author_cardinality:2,component_count:1,include_cycles:!1,custom_types:[],custom_statuses:[],terminal_statuses:[],custom_fields:[]}),representative:K({schema:F,name:"representative",description:"Medium-lived project with rich evidence and typed lineage.",hierarchy_depth:5,hierarchy_fanout:8,age_span_days:730,history_entries_per_item:12,comments_per_100_items:30,notes_per_100_items:12,learnings_per_100_items:10,edge_kind_mix:be,author_cardinality:32,component_count:1,include_cycles:!1,custom_types:["Experiment"],custom_statuses:["review"],terminal_statuses:[],custom_fields:["domain"]}),"deep-graph":K({schema:F,name:"deep-graph",description:"Deep typed relationship graph with deterministic cycles.",hierarchy_depth:16,hierarchy_fanout:2,age_span_days:3650,history_entries_per_item:6,comments_per_100_items:15,notes_per_100_items:8,learnings_per_100_items:8,edge_kind_mix:be,author_cardinality:16,component_count:1,include_cycles:!0,custom_types:[],custom_statuses:[],terminal_statuses:[],custom_fields:[]}),"multi-decade":K({schema:F,name:"multi-decade",description:"Thirty-year event history with dense per-item evolution.",hierarchy_depth:6,hierarchy_fanout:6,age_span_days:10958,history_entries_per_item:24,comments_per_100_items:40,notes_per_100_items:20,learnings_per_100_items:16,edge_kind_mix:be,author_cardinality:64,component_count:1,include_cycles:!1,custom_types:["Program"],custom_statuses:["archived"],terminal_statuses:["archived"],custom_fields:["portfolio"]}),"disconnected-archive":K({schema:F,name:"disconnected-archive",description:"Multiple disconnected historical project components.",hierarchy_depth:4,hierarchy_fanout:10,age_span_days:7305,history_entries_per_item:8,comments_per_100_items:10,notes_per_100_items:5,learnings_per_100_items:6,edge_kind_mix:be,author_cardinality:24,component_count:5,include_cycles:!1,custom_types:["Archive"],custom_statuses:["archived"],terminal_statuses:["archived"],custom_fields:["archive_source"]})});function Cy(){return Object.keys(W).sort().map(e=>W[e])}function yy(e){let t=e.trim().toLowerCase();if(!Object.hasOwn(W,t))throw new TypeError(`Unknown corpus shape "${e}". Available: ${Object.keys(W).join(", ")}`);return W[t]}var Jr=new WeakMap;function Zr(e,t){if(e===0)return[];let r=Jr.get(t);r===void 0&&(r=t.edge_kind_mix.flatMap(o=>Array.from({length:o.weight},()=>o.kind)),Jr.set(t,r));let n=[r[e%r.length]];return t.include_cycles&&e>2&&e%17===0&&n.push("related"),[...new Set(n)]}function Sy(e,t,r,n=42){if(oe(t,"item index"),V(r,"item count"),t>=r)throw new RangeError(`Corpus item index ${t} exceeds ${r}`);let o=Math.min(e.component_count,r),i=t%o,s=Math.floor(t/o),a=0,c=1;for(let E=0;E<e.hierarchy_depth;E+=1)a=Math.min(Number.MAX_SAFE_INTEGER,a+c),c=Math.min(Number.MAX_SAFE_INTEGER,c*e.hierarchy_fanout);let d=s%a,p=s-d,l=d===0?void 0:i+(p+Math.floor((d-1)/e.hierarchy_fanout))*o,f=Date.UTC(2026,0,1),g=e.age_span_days*864e5,_=new Date(f+(r===1?0:Math.round(t/(r-1)*g))).toISOString(),y=(t*37+n)%100;return{index:t,id:`pm-s${t.toString(36).padStart(7,"0")}`,...l===void 0?{}:{parent:`pm-s${l.toString(36).padStart(7,"0")}`},component:i,timestamp:_,author:`pm-corpus-agent-${(t+n)%Math.min(e.author_cardinality,r)}`,history_entry_count:e.history_entries_per_item,dependency_kinds:Zr(t,e),has_comment:y<e.comments_per_100_items,has_note:y<e.notes_per_100_items,has_learning:y<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 at=class{shape;authors=new Set;components=new Set;depths=new Map;childCounts=new Map;edgeKinds={};expectedEdgeKinds={};annotations={comments:0,notes:0,learnings:0};annotationFields;planMismatches=[];itemCount=0;observedDepth=0;observedFanout=0;historyEntryCount=0;firstTimestamp=null;lastTimestamp=null;constructor(t){this.shape=t,this.annotationFields=[["comments","has_comment",t.comments_per_100_items],["notes","has_note",t.notes_per_100_items],["learnings","has_learning",t.learnings_per_100_items]]}recordMismatch(t,r){t&&this.planMismatches.push(r)}recordEdgeKinds(t,r){for(let n of r)t[n]=(t[n]??0)+1}add(t){this.itemCount+=1,this.authors.add(t.author),this.components.add(t.component),this.recordMismatch(this.depths.has(t.id),`duplicate_id:${t.id}`);let r=1;if(t.parent!==void 0){let n=this.depths.get(t.parent);this.recordMismatch(n===void 0,`parent_missing:${t.parent}`),r=(n??0)+1;let o=(this.childCounts.get(t.parent)??0)+1;this.childCounts.set(t.parent,o),this.observedFanout=Math.max(this.observedFanout,o)}this.depths.set(t.id,r),this.observedDepth=Math.max(this.observedDepth,r),this.historyEntryCount+=t.history_entry_count,this.recordMismatch(t.history_entry_count!==this.shape.history_entries_per_item,"history_entries_per_item:drift"),this.firstTimestamp=this.firstTimestamp===null||t.timestamp<this.firstTimestamp?t.timestamp:this.firstTimestamp,this.lastTimestamp=this.lastTimestamp===null||t.timestamp>this.lastTimestamp?t.timestamp:this.lastTimestamp;for(let[n,o]of this.annotationFields)this.annotations[n]+=Number(t[o]);this.recordEdgeKinds(this.edgeKinds,t.dependency_kinds),this.recordEdgeKinds(this.expectedEdgeKinds,Zr(t.index,this.shape))}finish(){let t=Math.min(this.shape.author_cardinality,this.itemCount),r=Math.min(this.shape.component_count,this.itemCount),n=[...this.planMismatches,...this.itemCount===0?["item_count:empty"]:[],...this.authors.size===t?[]:[`author_count:${this.authors.size}!=${t}`],...this.components.size===r?[]:[`component_count:${this.components.size}!=${r}`],...this.observedDepth<=this.shape.hierarchy_depth?[]:[`hierarchy_depth:${this.observedDepth}>${this.shape.hierarchy_depth}`],...this.observedFanout<=this.shape.hierarchy_fanout?[]:[`hierarchy_fanout:${this.observedFanout}>${this.shape.hierarchy_fanout}`]];for(let[s,,a]of this.annotationFields){let c=Math.floor(this.itemCount/100),d=this.itemCount%100,p=c*a+Math.max(0,a+d-100),l=c*a+Math.min(a,d),f=this.annotations[s];(f<p||f>l)&&n.push(`${s}:${f}!in[${p},${l}]`)}let o=new Set([...Object.keys(this.edgeKinds),...Object.keys(this.expectedEdgeKinds)]);for(let s of[...o].sort()){let a=this.edgeKinds[s]??0,c=this.expectedEdgeKinds[s]??0;a!==c&&n.push(`edge_kind:${s}:${a}!=${c}`)}let i=[...new Set(n)];return{shape:this.shape.name,item_count:this.itemCount,author_count:this.authors.size,component_count:this.components.size,hierarchy_depth:this.observedDepth,hierarchy_fanout:this.observedFanout,timestamp_range:{first:this.firstTimestamp,last:this.lastTimestamp},history_entry_count:this.historyEntryCount,annotations:{...this.annotations},edge_kinds:{...this.edgeKinds},matches_declaration:i.length===0,mismatches:i}}};function en(e){return new at(e)}function Ty(e,t){let r=en(e);for(let n of t)r.add(n);return r.finish()}async function Ey(){let e=De(process.cwd(),process.env.PM_PATH);await wt(e,(t,r)=>Ot(t,r,{apply_runtime_defaults:!0}))}async function Ay(){await Rt()}var tn=["lines","branches","functions","statements"];function xy(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 n=r;if(typeof n.covered!="number"||typeof n.total!="number"||!Number.isInteger(n.covered)||!Number.isInteger(n.total)||n.covered<0||n.total<n.covered)throw new TypeError(`Coverage entry ${e} has invalid ${t} counts.`);return{covered:n.covered,total:n.total}}function wy(e){if(typeof e!="object"||e===null||Array.isArray(e))throw new TypeError("Coverage summary must be a JSON object.");if(!("total"in e))throw new TypeError("Coverage summary is missing the total entry.");let t=[];for(let[r,n]of Object.entries(e)){xy(r,n);for(let o of tn){let i=by(r,o,n[o]),s=i.total-i.covered;s>0&&t.push({file:r,metric:o,uncovered:s,...i})}}return t}import Y from"node:fs";import ct from"node:path";var rn=300*1e3,Oy=3;function T$(e){return(e?.trim()||"development").replace(/[^a-zA-Z0-9._-]/g,"_").replace(/^\./,"_")}function E$(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 n=ct.join(e,r);Y.mkdirSync(n,{recursive:!0});let o=new Date;Y.utimesSync(n,o,o);let i=Y.readdirSync(e).filter(d=>d!==r).flatMap(d=>{try{return[{name:d,mtimeMs:Y.statSync(ct.join(e,d)).mtimeMs}]}catch(p){if(p instanceof Error&&"code"in p&&me(p))return[];throw p}}).sort((d,p)=>p.mtimeMs-d.mtimeMs||d.name.localeCompare(p.name)),s=i.filter(d=>o.getTime()-d.mtimeMs<rn),a=Math.max(0,Oy-1-s.length),c=i.filter(d=>o.getTime()-d.mtimeMs>=rn).slice(a).map(d=>d.name).sort((d,p)=>d.localeCompare(p));for(let d of c)Y.rmSync(ct.join(e,d),{recursive:!0,force:!0,maxRetries:3,retryDelay:50});return{retained:r,removed:c}}import{createHash as Ry}from"node:crypto";var dt=1;function X(e){e?.throwIfAborted()}function G(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship graph ${t} must be non-empty`);return e.trim()}function J(e,t,r={}){let n=Date.parse(r.createdAt??new Date().toISOString());if(!Number.isFinite(n))throw new TypeError("Relationship graph createdAt must be a valid timestamp");let o=e.nodes(),i=e.edges(),s=t.list();return Object.freeze({version:dt,fingerprint:Ry("sha256").update(R({nodes:o,edges:i,kinds:s})).digest("hex"),created_at:new Date(n).toISOString(),nodes:o,edges:i,kinds:s})}function Py(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function se(e){if(!Py(e))throw new TypeError("Relationship graph snapshot must be an object");if(e.version!==dt)throw new TypeError(`Unsupported relationship graph snapshot version: ${String(e.version)}`);if(!Array.isArray(e.nodes)||e.nodes.some(o=>typeof o!="string"))throw new TypeError("Relationship graph snapshot nodes must be strings");if(!Array.isArray(e.edges)||!Array.isArray(e.kinds))throw new TypeError("Relationship graph snapshot edges and kinds must be arrays");if(typeof e.created_at!="string"||!Number.isFinite(Date.parse(e.created_at)))throw new TypeError("Relationship graph snapshot created_at must be valid");if(typeof e.fingerprint!="string")throw new TypeError("Relationship graph snapshot fingerprint must be a string");let t=new Ge([]);for(let o of e.kinds)t.register(o);let r=new q(e.nodes,e.edges,t),n=J(r,t,{createdAt:e.created_at});if(n.fingerprint!==e.fingerprint)throw new TypeError("Relationship graph snapshot fingerprint mismatch");return{snapshot:n,registry:t,graph:r}}async function v(e,t){G(e.name,"adapter name");let r=G(t.workspace,"workspace");X(t.signal);let n=await e.read({...t,workspace:r});return X(t.signal),n===null?null:se(n)}async function we(e,t){let r=G(t.workspace,"workspace"),n=se(t.snapshot).snapshot,o=await v(e,{workspace:r,signal:t.signal});if(o?.snapshot.fingerprint===n.fingerprint)return{adapter:e.name,workspace:r,disposition:"current",fingerprint:n.fingerprint,previous_fingerprint:o.snapshot.fingerprint,node_count:n.nodes.length,edge_count:n.edges.length};if(X(t.signal),await e.replace({workspace:r,signal:t.signal,snapshot:n,expected_fingerprint:o?.snapshot.fingerprint??null}),(await v(e,{workspace:r,signal:t.signal}))?.snapshot.fingerprint!==n.fingerprint)throw new Error(`Relationship graph adapter "${e.name}" did not expose the replaced snapshot`);return{adapter:e.name,workspace:r,disposition:"written",fingerprint:n.fingerprint,...o?{previous_fingerprint:o.snapshot.fingerprint}:{},node_count:n.nodes.length,edge_count:n.edges.length}}function My(e,t={}){let r=e.map(se),n=new Map;for(let s of r)for(let a of s.snapshot.kinds){let c=n.get(a.kind);if(c&&R(c)!==R(a))throw new TypeError(`Conflicting federated relationship kind: ${a.kind}`);n.set(a.kind,a)}let o=new Ge([...n.values()].sort((s,a)=>s.kind.localeCompare(a.kind))),i=new q(new Set(r.flatMap(s=>[...s.snapshot.nodes])),r.flatMap(s=>[...s.snapshot.edges]),o);return J(i,o,t)}var ie=class{name;#e=new Map;constructor(t="memory"){this.name=G(t,"adapter name")}async read(t){X(t.signal);let r=this.#e.get(G(t.workspace,"workspace"));return r?structuredClone(r):null}async replace(t){X(t.signal);let r=G(t.workspace,"workspace"),n=this.#e.get(r);if(t.expected_fingerprint!==void 0&&(n?.fingerprint??null)!==t.expected_fingerprint)throw new Error(`Relationship graph adapter conflict for ${r}`);this.#e.set(r,structuredClone(se(t.snapshot).snapshot))}async clear(t){X(t.signal);let r=G(t.workspace,"workspace"),n=this.#e.get(r);if(t.expected_fingerprint!==void 0&&(n?.fingerprint??null)!==t.expected_fingerprint)throw new Error(`Relationship graph adapter conflict for ${r}`);this.#e.delete(r)}};function nn(e,t){if(!Number.isInteger(e)||e<1)throw new TypeError(`Relationship graph ${t} must be a positive integer`);return e}function Iy(e){let t=nn(e.nodeCount,"nodeCount"),r=nn(e.edgeStride??1,"edgeStride"),n=e.topology??"chain";if(!["chain","star","disconnected"].includes(n))throw new TypeError(`Unsupported relationship graph topology: ${n}`);let o=(e.kind??"related").trim(),i=(e.idPrefix??"node").trim();if(!o||!i)throw new TypeError("Relationship graph kind and idPrefix must be non-empty");let s=n==="disconnected"?0:Math.floor((t-1)/r);return{node_count:t,edge_count:s,edge_basis:"fixture_generated",nodes:{*[Symbol.iterator](){for(let a=0;a<t;a+=1)yield`${i}-${a}`}},edges:{*[Symbol.iterator](){if(n!=="disconnected")for(let a=r;a<t;a+=r)yield{source:`${i}-${n==="star"?0:a-r}`,target:`${i}-${a}`,kind:o}}}}}function U(e,t){if(!e)throw new Error(`Relationship graph adapter conformance: ${t}`)}async function on(e,t={}){let r=t.workspace?.trim()||"pm-graph-conformance",n=xt(),o=J(new q(["a","b"],[{source:"a",target:"b",kind:"related"}],n),n,{createdAt:"2026-01-01T00:00:00.000Z"}),i=J(new q(["a","b","c"],[{source:"a",target:"b",kind:"related"},{source:"b",target:"c",kind:"blocked_by"}],n),n,{createdAt:"2026-01-02T00:00:00.000Z"}),s=[];U(await v(e,{workspace:r})===null,"workspace must start empty"),s.push({name:"empty-read",passed:!0});let a=await we(e,{workspace:r,snapshot:o});U(a.disposition==="written","first sync must write"),s.push({name:"atomic-replace",passed:!0}),(await e.read({workspace:r})).nodes.push("mutated-reader-copy"),U((await v(e,{workspace:r}))?.snapshot.nodes.length===2,"reads must not mutate stored state"),s.push({name:"read-isolation",passed:!0}),U((await we(e,{workspace:r,snapshot:o})).disposition==="current","identical sync must be idempotent"),s.push({name:"idempotent-sync",passed:!0}),await e.replace({workspace:r,snapshot:i,expected_fingerprint:o.fingerprint}),U((await v(e,{workspace:r}))?.snapshot.fingerprint===i.fingerprint,"replacement must become visible"),s.push({name:"replacement-visibility",passed:!0});let d=!1;try{await e.replace({workspace:r,snapshot:o,expected_fingerprint:o.fingerprint})}catch{d=!0}return U(d,"stale compare-and-swap must fail"),s.push({name:"stale-cas",passed:!0}),e.clear&&(await e.clear({workspace:r,expected_fingerprint:i.fingerprint}),U(await v(e,{workspace:r})===null,"clear must remove the workspace"),s.push({name:"clear",passed:!0})),{adapter:e.name,workspace:r,cases:Object.freeze(s),clear_supported:e.clear!==void 0}}function vy(e){return on(new ie,e?{workspace:e}:{})}var pt=2,ky=["self_reported","independent_transport"];function Oe(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 sn(e,t,r=!1){if(!Array.isArray(e)||e.length===0)throw new TypeError(`${t} must be a non-empty string array`);return e.map((n,o)=>{let i=ae(n,`${t}[${String(o)}]`);return r?n:i})}function lt(e,t){return e===void 0?void 0:ae(e,t)}function Ny(e,t){if(e===void 0)return;if(!Oe(e)||Object.keys(e).length===0)throw new TypeError(`${t} must be a non-empty object`);let r=Object.entries(e).map(([n,o])=>{if(n.length===0||n.split(".").some(i=>i.length===0))throw new TypeError(`${t} must use dot-separated own-property paths`);if(o!==null&&typeof o!="string"&&typeof o!="boolean"&&(typeof o!="number"||!Number.isFinite(o)))throw new TypeError(`${t} values must be JSON primitives`);return[n,o]});return Object.fromEntries(r)}function Ly(e,t,r,n,o,i){if(n==="refusal"){if(Ve(r)||o===void 0||i===void 0)throw new TypeError(`${e} refusal steps require a non-success exit, error code, and refusal surface`);return}if(o!==void 0||i!==void 0)throw new TypeError(`${e} only refusal steps may declare expected_error_code or expected_refusal_surface`);let s=Ct(t);if(s===void 0)throw new TypeError(`${e}.args must identify a command after global flags`);let a=t[s].trim().toLowerCase();if(a==="history"){let p=yt(t.slice(s+1));p!==void 0&&(a=ke(`history ${p}`))}let c=$t(a);if(!Ve(r)||r!==0&&!c?.exit_codes.some(p=>p===r))throw new TypeError(`${e} successful output must use exit code 0 or a command-declared successful effect exit`);let d=Lt(a).kind;if(n!==d)throw new TypeError(`${e} expected ${n}, but ${a} declares ${d}`)}function $y(e,t,r){if(!Oe(e))throw new TypeError(`tasks.${t}.steps[${String(r)}] must be an object`);let n=`tasks.${t}.steps[${String(r)}]`,o=ae(e.id,`${n}.id`),i=sn(e.args,`${n}.args`,!0),s=e.expected_exit_code;if(typeof s!="number"||!Number.isSafeInteger(s))throw new TypeError(`${n}.expected_exit_code must be a safe integer`);let a=e.expected_output_kind;if(a!=="refusal"&&!Nt.includes(a))throw new TypeError(`${n}.expected_output_kind is unsupported`);let c=a,d=e.expected_accounting_mode;if(!ky.includes(d))throw new TypeError(`${n}.expected_accounting_mode is unsupported`);let p=d;if(p==="independent_transport"&&c!=="refusal")throw new TypeError(`${n} independent_transport accounting is supported only for refusal steps`);let l=sn(e.required_fields,`${n}.required_fields`);if(l.some(E=>E.split(".").some(B=>B.length===0)))throw new TypeError(`${n}.required_fields must contain dot-separated own-property paths`);let f=Ny(e.expected_field_values,`${n}.expected_field_values`),g=lt(e.expected_error_code,`${n}.expected_error_code`),_=lt(e.expected_refusal_surface,`${n}.expected_refusal_surface`),y=lt(e.recovery_for,`${n}.recovery_for`);return Ly(n,i,s,c,g,_),{id:o,args:i,expected_exit_code:s,expected_output_kind:c,expected_accounting_mode:p,required_fields:l,...f?{expected_field_values:f}:{},...g?{expected_error_code:g}:{},..._?{expected_refusal_surface:_}:{},...y?{recovery_for:y}:{}}}function Dy(e,t){if(!Oe(e))throw new TypeError(`tasks[${String(t)}] must be an object`);let r=ae(e.id,`tasks[${String(t)}].id`),n=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 o=e.steps.map((s,a)=>$y(s,r,a)),i=new Map;for(let s of o){if(i.has(s.id))throw new TypeError(`tasks.${r} contains duplicate step id ${s.id}`);if(s.recovery_for!==void 0&&(i.get(s.recovery_for)?.expected_output_kind!=="refusal"||s.expected_output_kind==="refusal"))throw new TypeError(`tasks.${r}.${s.id} recovery_for must reference an earlier refusal and declare successful output`);i.set(s.id,s)}if(o.at(-1)?.expected_output_kind==="refusal")throw new TypeError(`tasks.${r} completed task must terminate with successful output`);for(let s of o)if(s.expected_output_kind==="refusal"&&!o.some(a=>a.recovery_for===s.id))throw new TypeError(`tasks.${r}.${s.id} refusal must have a later successful recovery_for step`);return{id:r,description:n,steps:o}}function Z$(e){if(!Oe(e))throw new TypeError("agent-task transcript corpus must be an object");if(e.version!==pt)throw new TypeError(`agent-task transcript corpus version must be ${String(pt)}`);if(!Array.isArray(e.tasks)||e.tasks.length===0)throw new TypeError("agent-task transcript corpus tasks must be non-empty");let t=e.tasks.map((n,o)=>Dy(n,o)),r=new Set;for(let n of t){if(r.has(n.id))throw new TypeError(`duplicate agent-task transcript id ${n.id}`);r.add(n.id)}return{version:pt,tasks:t}}import{createHash as an}from"node:crypto";function cn(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship backfill ${t} must be non-empty`);return e.trim()}function nD(e,t){let r=cn(t.migrationId,"migrationId"),n=cn(t.author,"author"),o=Date.parse(t.timestamp);if(!Number.isFinite(o))throw new TypeError("Relationship backfill timestamp must be valid");let i=new Date(o).toISOString(),s=qe(e,void 0,t.registry),a=s.graph.nodes(),c=s.graph.edges().map(f=>{let g=an("sha256").update(JSON.stringify([r,f.kind,f.source,f.target,f.createdAt??null,f.author??null,f.payload??null])).digest("hex").slice(0,24);return Object.freeze({eventId:`backfill:${r}:${g}`,relationshipId:`migration:${r}:${g}`,action:"add",edge:f,author:n,timestamp:i,reason:`Backfill ${r} from legacy item metadata`})}),d=an("sha256").update(JSON.stringify({migrationId:r,nodes:a,events:c})).digest("hex"),p=new Set([...t.existingEventIds??[]].filter(f=>typeof f=="string").map(f=>f.trim()).filter(Boolean)),l=c.filter(f=>!p.has(f.eventId));return Object.freeze({migration_id:r,fingerprint:d,nodes:a,events:Object.freeze(l),edge_count:c.length,skipped_existing_count:c.length-l.length,duplicate_dependency_rows:s.duplicateRows.length,dangling_reference_count:s.dangling.active.length+s.dangling.legacy_terminal.length})}import*as dn from"node:module";var ce=["suggested_retry","candidate_command","example","next_step","migration_hint","restore_with"],ut={suggested_retry:{kind:"suggested_retry",semantics:"recovery"},retry_command:{kind:"suggested_retry",semantics:"recovery"},candidate_command:{kind:"candidate_command",semantics:"recovery"},candidate_commands:{kind:"candidate_command",semantics:"recovery"},fallback_candidates:{kind:"candidate_command",semantics:"recovery",nested_value_field:"command"},next_best_command:{kind:"candidate_command",semantics:"recovery"},example:{kind:"example",semantics:"recovery"},examples:{kind:"example",semantics:"recovery"},next_step:{kind:"next_step",semantics:"recovery"},next_steps:{kind:"next_step",semantics:"recovery"},suggested_next_steps:{kind:"next_step",semantics:"recovery"},migration_hint:{kind:"migration_hint",semantics:"replacement"},migration_hints:{kind:"migration_hint",semantics:"replacement"},restore_with:{kind:"restore_with",semantics:"behavior_preserving"}},iD=Object.freeze(Object.keys(ut));function pn(e){if(Object.hasOwn(ut,e))return ut[e]}var Fy=new Set([..."=([{,:;!?&|+-*%^~<>","=>"]);function Q(e,t){return e<t?-1:e>t?1:0}function Gy(e,t){let r=e[t],n=t+1,o="";for(;n<e.length&&e[n]!==r;)e[n]==="\\"?n+=2:(o+=e[n],n+=1);return e[n]===r&&(n+=1),{next:n,value:o}}function Uy(e){return e===void 0||e.kind==="punctuator"&&Fy.has(e.value)||e.kind==="identifier"&&["return","case","throw","else","yield"].includes(e.value)}function jy(e,t){if(/\s/u.test(e[t]))return t+1;if(e.startsWith("//",t)){let r=e.indexOf(`
30
+ `)).digest("hex").slice(0,16)}#r(t,r){if(!t)return 0;try{let n=JSON.parse(Buffer.from(t,"base64url").toString("utf8"));return(typeof n!="object"||n===null||!("fingerprint"in n)||n.fingerprint!==this.#t||!("scope"in n)||n.scope!==r||!("offset"in n)||!Number.isInteger(n.offset)||Number(n.offset)<0)&&T("Skill cursor is invalid or stale."),Number(n.offset)}catch(n){if(n instanceof u)throw n;return T("Skill cursor is invalid or stale.")}}#n(t,r){return Buffer.from(JSON.stringify({fingerprint:this.#t,offset:t,scope:r})).toString("base64url")}static async load(t){let r=await Ur(M.join(t.packageRoot,".agents","skills"),"package",t.packageVersion);if(t.workspaceRoot){let n=M.resolve(t.packageRoot,".agents","skills"),o=M.resolve(t.workspaceRoot,".agents","skills");if(o!==n){let i=await Ur(o,"workspace",t.packageVersion);for(let[s,a]of i)r.set(s,a)}}return new e(r)}list(t={}){let r=t.limit??P.defaultPageSize;Fr.has(r)||T(`Skill list limit must be an integer from 1 to ${P.maxPageSize}.`);let n=this.#r(t.cursor,"skills/list"),o=[...this.#e.values()].sort((c,d)=>c.uri.localeCompare(d.uri)),i=o.slice(n,n+r),s=n+i.length,a=s<o.length;return{skills:i.map(jr),hasMore:a,...a?{nextCursor:this.#n(s,"skills/list")}:{}}}get(t){let r=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)\/SKILL\.md$/u.exec(t),n=r?this.#e.get(r[1]):void 0;return n||T(`Unknown pm MCP skill: ${t}.`,{field:"uri"}),jr(n)}read(t){let r=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)\/(.+)$/u.exec(t),n=r?this.#e.get(r[1]):void 0,o=r?.[2]??"",i=n&&o?n.files.get(o):void 0,s=n?.resources.find(d=>d.uri===t);(!n||!i||!s)&&T(`Unknown pm MCP skill resource: ${t}.`,{field:"uri"});let a={digest:s.digest,origin:n._meta.origin,trust:"untrusted"},c=Gr(o,i);return c!=="application/octet-stream"?{contents:[{uri:t,mimeType:c,text:i.toString("utf8"),_meta:a}]}:{contents:[{uri:t,mimeType:c,blob:i.toString("base64"),_meta:a}]}}readDirectory(t,r={}){let n=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)(?:\/(.+))?$/u.exec(t),o=n?this.#e.get(n[1]):void 0;o||T(`Unknown pm MCP skill directory: ${t}.`,{field:"uri"});let i=(n?.[2]??"").replace(/\/$/u,""),s=i.length>0?`${i}/`:"",a=`skill://${n[1]}`,c=new Map;for(let y of o.resources){let E=y.uri.slice(`${a}/`.length);if(!E.startsWith(s))continue;let B=E.slice(s.length),[O,...ht]=B.split("/"),Rn=`${a}/${s}${O}`,Pn=o.files.get(`${s}${O}`);c.set(O,{uri:Rn,name:O,mimeType:ht.length>0?"inode/directory":Gr(O,Pn)})}i.length>0&&c.size===0&&T(`Unknown pm MCP skill directory: ${t}.`,{field:"uri"});let d=r.limit??P.maxPageSize;Fr.has(d)||T(`Skill directory limit must be an integer from 1 to ${P.maxPageSize}.`);let p=this.#r(r.cursor,t),l=[...c.values()].sort((y,E)=>y.uri.localeCompare(E.uri)),f=l.slice(p,p+d),g=p+f.length,_=g<l.length;return{resources:f,hasMore:_,..._?{nextCursor:this.#n(g,t)}:{}}}};var Hr="https://schema.unbrained.dev/pm/workspace-recipe/v1";function st(e,t){if(e===null||typeof e=="boolean"||typeof e=="string")return e;if(typeof e=="number"){if(!Number.isFinite(e))throw new Error(`Workspace recipe JSON number must be finite at ${t}`);return e}if(Array.isArray(e))return Object.freeze(e.map((r,n)=>st(r,`${t}[${n}]`)));if(typeof e!="object"||Object.getPrototypeOf(e)!==Object.prototype&&Object.getPrototypeOf(e)!==null)throw new Error(`Workspace recipe input must contain JSON values at ${t}`);return Object.freeze(Object.fromEntries(Object.entries(e).map(([r,n])=>[r,st(n,`${t}.${r}`)])))}function xe(e){if(e.schema!==Hr)throw new Error(`Unsupported workspace recipe schema: ${e.schema}`);let t=Tt(e);if(e.operations.some(r=>r.action.trim().length===0||r.input===null||Array.isArray(r.input)))throw new Error("Workspace recipe operations require an action and object input");return Object.freeze({...t,operations:Object.freeze(e.operations.map((r,n)=>Object.freeze({action:r.action,input:st(r.input,`operations[${n}].input`)})))})}async function Vr(e,t){let r=xe(e);return Et(r,t)}async function sy(e,t){return Vr(e,async()=>{let r=[];for(let[n,o]of e.operations.entries())r.push(await t(o,n));return r})}var Kr="pm.agent-observation/v1",Wr="pm.agent-verdict/v1",Yr="pm.agent-episode/v1";function w(e,t){if(!Number.isSafeInteger(e)||e<=0)throw new Error(`${t} must be a positive safe integer.`)}function I(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 ay(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(I(r.command,"observation.reads.command"),w(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 cy(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(w(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,n)=>r+n,0)/e.samples.length;if(Math.abs(t-e.expected_emitted_bytes)>e.tolerance_bytes)throw new Error("observation expected_emitted_bytes is outside the calibrated sample tolerance.")}function dy(e){if(e.length===0)throw new Error("observation.tiers must declare a degradation ladder.");let t=new Set,r=Number.POSITIVE_INFINITY;for(let n of e){if(I(n.id,"observation.tiers.id"),w(n.max_tokens,"observation.tiers.max_tokens"),t.has(n.id))throw new Error(`Duplicate observation tier: ${n.id}.`);if(t.add(n.id),n.max_tokens>r)throw new Error("observation tiers must be ordered from largest to smallest max_tokens.");r=n.max_tokens;let o=new Set;for(let i of n.fields){if(D(i,"observation.tiers.fields"),o.has(i))throw new Error(`Duplicate observation tier field: ${i}.`);o.add(i)}}}function py(e){if(e.schema!==Kr)throw new Error(`observation.schema must be ${Kr}.`);return I(e.id,"observation.id"),w(e.version,"observation.version"),ay(e.reads),cy(e.calibration),e.corpus_dependence.kind==="bounded"&&(I(e.corpus_dependence.dimension,"observation.corpus_dependence.dimension"),w(e.corpus_dependence.maximum,"observation.corpus_dependence.maximum")),dy(e.tiers),ne(structuredClone(e))}function t$(e){return{contract_id:e.id,contract_version:e.version,guaranteed_ceiling_tokens:e.reads.reduce((t,r)=>t+r.budget_tokens,0),expected_emitted_bytes:e.calibration.expected_emitted_bytes,expected_tokens:Math.ceil(e.calibration.expected_emitted_bytes/4),tolerance_bytes:e.calibration.tolerance_bytes,calibration_basis:"emitted_bytes",corpus_dependence:e.corpus_dependence}}async function ly(e,t,r){w(r.budget_tokens,"observation request budget_tokens");let n=[];for(let[o,i]of e.tiers.entries()){n.push(i.id);let s=await t(i),a=Buffer.byteLength(R(s),"utf8"),c=Math.ceil(a/4);if(c<=Math.min(r.budget_tokens,i.max_tokens))return{status:"served",payload:s,receipt:{contract_id:e.id,contract_version:e.version,served_tier:i.id,degraded:o>0,attempted_tiers:n,emitted_bytes:a,estimated_tokens:c,calibration_basis:"emitted_bytes"}}}return{status:"refused",reason:"no_declared_tier_fits_budget",receipt:{contract_id:e.id,contract_version:e.version,served_tier:null,degraded:e.tiers.length>1,attempted_tiers:n,emitted_bytes:null,estimated_tokens:null,calibration_basis:"emitted_bytes"}}}function D(e,t){let r=e.split(".");if(r.some(n=>n.length===0||n==="__proto__"||n==="prototype"||n==="constructor"))throw new Error(`${t} must be a safe, non-empty dot-separated path.`);return r}function Xr(e,t){let r=e;for(let n of D(t,"recorded field path")){if(r===null||typeof r!="object"||!Object.hasOwn(r,n))return;r=r[n]}return r}function uy(e){return`/${D(e,"verdict predicate path").map(t=>t.replaceAll("~","~0").replaceAll("/","~1")).join("/")}`}function my(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 fy(e){if(e.schema!==Wr)throw new Error(`verdict.schema must be ${Wr}.`);I(e.id,"verdict.id"),w(e.version,"verdict.version");let t=new Set;for(let n of e.predicates){I(n.id,"verdict.predicates.id"),D(n.path,"verdict.predicates.path");let o=n.kind;if(o!=="field_equals"&&o!=="field_present"&&o!=="field_absent")throw new Error(`Unsupported verdict predicate kind for ${n.id}.`);if(t.has(n.id))throw new Error(`Duplicate verdict predicate: ${n.id}.`);my(n),t.add(n.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(n=>!t.has(n)))throw new Error("verdict composition contains duplicate or unknown predicate ids.");return ne(structuredClone(e))}function _y(e,t){if(e.predicates.length===0)return{contract_id:e.id,contract_version:e.version,snapshot_id:t.snapshot_id,outcome:"not_applicable",score:null,policy:"verdict_only_no_reward",reason:"no_predicates_declared",predicates:[]};let r=new Map(e.predicates.map(s=>[s.id,s])),n=e.composition.predicate_ids.map(s=>{let a=r.get(s),c=Xr(t.state,a.path),d=a.kind==="field_present"?c!==void 0:a.kind==="field_absent"?c===void 0:R(c)===R(a.expected);return{id:s,outcome:d?"satisfied":"violated",evidence_pointer:`${t.snapshot_id}#${uy(a.path)}`,evidence_digest:gt(R(c))}}),o=n.filter(s=>s.outcome==="satisfied").length,i=e.composition.operator==="all"?o===n.length:o>0;return{contract_id:e.id,contract_version:e.version,snapshot_id:t.snapshot_id,outcome:i?"satisfied":"violated",score:o/n.length,policy:"verdict_only_no_reward",predicates:n}}function r$(e){if(e.schema!==Yr)throw new Error(`episode.schema must be ${Yr}.`);if(I(e.id,"episode.id"),w(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)I(t,"episode.task_item_ids");w(e.limits.max_actions,"episode.limits.max_actions"),w(e.limits.max_observations,"episode.limits.max_observations"),w(e.limits.max_tokens_per_observation,"episode.limits.max_tokens_per_observation");for(let t of e.observable_fields)D(t,"episode.observable_fields");for(let t of e.withheld_fields)D(t,"episode.withheld_fields");for(let t of e.observable_fields){let r=e.withheld_fields.find(n=>t===n||t.startsWith(`${n}.`)||n.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 py(e.observation),fy(e.verdict),xe(e.recipe),ne(structuredClone(e))}function hy(e,t,r){let n=D(t,"observation projection field"),o=e;for(let[i,s]of n.entries()){if(i===n.length-1){r!==void 0&&(o[s]=structuredClone(r));return}let a=o[s];(a===null||typeof a!="object"||Array.isArray(a))&&(o[s]={}),o=o[s]}}function gy(e,t){let r={};for(let n of t)hy(r,n,Xr(e,n));return r}async function n$(e,t){let r=[],n=0,o=0,i=!1,s,a={episode:{id:e.id,label:`pm agent environment v${e.version}`},provenance:{role:e.mode,topic:"agent-environment"}},c=await L(a,()=>t.reset(e.recipe));r.push({sequence:1,kind:"reset",state_id:c.state_id});let d=async()=>{if(i)throw new Error("episode is already closed.");if(o>=e.limits.max_observations)throw new Error("episode exceeded limits.max_observations.");o+=1;let l=await t.readRecordedState(),f=await ly(e.observation,async g=>gy(l.state,g.fields),{budget_tokens:e.limits.max_tokens_per_observation});return r.push({sequence:r.length+1,kind:"observation",state_id:f.receipt.served_tier??l.snapshot_id}),f},p=async(l=!1)=>{if(i&&!l)throw new Error("episode is already closed.");if(o>=e.limits.max_observations)throw new Error("episode exceeded limits.max_observations.");o+=1;let f=await t.readRecordedState(),g=_y(e.verdict,f);return r.push({sequence:r.length+1,kind:"verdict",state_id:f.snapshot_id}),g};return{observe:()=>L(a,d),step:async l=>{if(i)throw new Error("episode is already closed.");if(n>=e.limits.max_actions)throw new Error("episode exceeded limits.max_actions.");n+=1;let f=await L(a,()=>t.execute(l));return r.push({sequence:r.length+1,kind:"action",state_id:f.state_id}),f},score:()=>L(a,p),close:()=>s!==void 0?s:i?Promise.reject(new Error("episode is already closed.")):(i=!0,s=L(a,()=>p(!0)).then(f=>(r.push({sequence:r.length+1,kind:"close",state_id:f.snapshot_id}),{verdict:f,trajectory:ne(structuredClone(r))})).catch(f=>{throw i=!1,f}).finally(()=>{s=void 0}),s)}}var F="https://schema.unbrained.dev/pm/corpus-shape/v1";function V(e,t){if(!Number.isSafeInteger(e)||e<=0)throw new TypeError(`Corpus shape ${t} must be a positive safe integer`);return e}function oe(e,t){if(!Number.isSafeInteger(e)||e<0)throw new TypeError(`Corpus shape ${t} must be a non-negative safe integer`);return e}function Qr(e){if(!(typeof e!="object"||e===null||Object.isFrozen(e))){for(let t of Object.values(e))Qr(t);Object.freeze(e)}}function K(e){if(e.schema!==F)throw new TypeError(`Unsupported corpus shape schema: ${e.schema}`);if(e.name.trim().length===0||e.description.trim().length===0)throw new TypeError("Corpus shape name and description must be non-empty");if(V(e.hierarchy_depth,"hierarchy_depth"),V(e.hierarchy_fanout,"hierarchy_fanout"),oe(e.age_span_days,"age_span_days"),V(e.history_entries_per_item,"history_entries_per_item"),oe(e.comments_per_100_items,"comments_per_100_items"),oe(e.notes_per_100_items,"notes_per_100_items"),oe(e.learnings_per_100_items,"learnings_per_100_items"),V(e.author_cardinality,"author_cardinality"),V(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 Qr(t),t}var be=[{kind:"implements",weight:5},{kind:"blocked_by",weight:2},{kind:"discovered_from",weight:2},{kind:"verifies",weight:2},{kind:"supersedes",weight:1},{kind:"related",weight:4}],W=Object.freeze({scratch:K({schema:F,name:"scratch",description:"Seconds-old, shallow project with minimal history.",hierarchy_depth:2,hierarchy_fanout:50,age_span_days:0,history_entries_per_item:1,comments_per_100_items:2,notes_per_100_items:1,learnings_per_100_items:1,edge_kind_mix:[{kind:"related",weight:1}],author_cardinality:2,component_count:1,include_cycles:!1,custom_types:[],custom_statuses:[],terminal_statuses:[],custom_fields:[]}),representative:K({schema:F,name:"representative",description:"Medium-lived project with rich evidence and typed lineage.",hierarchy_depth:5,hierarchy_fanout:8,age_span_days:730,history_entries_per_item:12,comments_per_100_items:30,notes_per_100_items:12,learnings_per_100_items:10,edge_kind_mix:be,author_cardinality:32,component_count:1,include_cycles:!1,custom_types:["Experiment"],custom_statuses:["review"],terminal_statuses:[],custom_fields:["domain"]}),"deep-graph":K({schema:F,name:"deep-graph",description:"Deep typed relationship graph with deterministic cycles.",hierarchy_depth:16,hierarchy_fanout:2,age_span_days:3650,history_entries_per_item:6,comments_per_100_items:15,notes_per_100_items:8,learnings_per_100_items:8,edge_kind_mix:be,author_cardinality:16,component_count:1,include_cycles:!0,custom_types:[],custom_statuses:[],terminal_statuses:[],custom_fields:[]}),"multi-decade":K({schema:F,name:"multi-decade",description:"Thirty-year event history with dense per-item evolution.",hierarchy_depth:6,hierarchy_fanout:6,age_span_days:10958,history_entries_per_item:24,comments_per_100_items:40,notes_per_100_items:20,learnings_per_100_items:16,edge_kind_mix:be,author_cardinality:64,component_count:1,include_cycles:!1,custom_types:["Program"],custom_statuses:["archived"],terminal_statuses:["archived"],custom_fields:["portfolio"]}),"disconnected-archive":K({schema:F,name:"disconnected-archive",description:"Multiple disconnected historical project components.",hierarchy_depth:4,hierarchy_fanout:10,age_span_days:7305,history_entries_per_item:8,comments_per_100_items:10,notes_per_100_items:5,learnings_per_100_items:6,edge_kind_mix:be,author_cardinality:24,component_count:5,include_cycles:!1,custom_types:["Archive"],custom_statuses:["archived"],terminal_statuses:["archived"],custom_fields:["archive_source"]})});function Cy(){return Object.keys(W).sort().map(e=>W[e])}function yy(e){let t=e.trim().toLowerCase();if(!Object.hasOwn(W,t))throw new TypeError(`Unknown corpus shape "${e}". Available: ${Object.keys(W).join(", ")}`);return W[t]}var Jr=new WeakMap;function Zr(e,t){if(e===0)return[];let r=Jr.get(t);r===void 0&&(r=t.edge_kind_mix.flatMap(o=>Array.from({length:o.weight},()=>o.kind)),Jr.set(t,r));let n=[r[e%r.length]];return t.include_cycles&&e>2&&e%17===0&&n.push("related"),[...new Set(n)]}function Sy(e,t,r,n=42){if(oe(t,"item index"),V(r,"item count"),t>=r)throw new RangeError(`Corpus item index ${t} exceeds ${r}`);let o=Math.min(e.component_count,r),i=t%o,s=Math.floor(t/o),a=0,c=1;for(let E=0;E<e.hierarchy_depth;E+=1)a=Math.min(Number.MAX_SAFE_INTEGER,a+c),c=Math.min(Number.MAX_SAFE_INTEGER,c*e.hierarchy_fanout);let d=s%a,p=s-d,l=d===0?void 0:i+(p+Math.floor((d-1)/e.hierarchy_fanout))*o,f=Date.UTC(2026,0,1),g=e.age_span_days*864e5,_=new Date(f+(r===1?0:Math.round(t/(r-1)*g))).toISOString(),y=(t*37+n)%100;return{index:t,id:`pm-s${t.toString(36).padStart(7,"0")}`,...l===void 0?{}:{parent:`pm-s${l.toString(36).padStart(7,"0")}`},component:i,timestamp:_,author:`pm-corpus-agent-${(t+n)%Math.min(e.author_cardinality,r)}`,history_entry_count:e.history_entries_per_item,dependency_kinds:Zr(t,e),has_comment:y<e.comments_per_100_items,has_note:y<e.notes_per_100_items,has_learning:y<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 at=class{shape;authors=new Set;components=new Set;depths=new Map;childCounts=new Map;edgeKinds={};expectedEdgeKinds={};annotations={comments:0,notes:0,learnings:0};annotationFields;planMismatches=[];itemCount=0;observedDepth=0;observedFanout=0;historyEntryCount=0;firstTimestamp=null;lastTimestamp=null;constructor(t){this.shape=t,this.annotationFields=[["comments","has_comment",t.comments_per_100_items],["notes","has_note",t.notes_per_100_items],["learnings","has_learning",t.learnings_per_100_items]]}recordMismatch(t,r){t&&this.planMismatches.push(r)}recordEdgeKinds(t,r){for(let n of r)t[n]=(t[n]??0)+1}add(t){this.itemCount+=1,this.authors.add(t.author),this.components.add(t.component),this.recordMismatch(this.depths.has(t.id),`duplicate_id:${t.id}`);let r=1;if(t.parent!==void 0){let n=this.depths.get(t.parent);this.recordMismatch(n===void 0,`parent_missing:${t.parent}`),r=(n??0)+1;let o=(this.childCounts.get(t.parent)??0)+1;this.childCounts.set(t.parent,o),this.observedFanout=Math.max(this.observedFanout,o)}this.depths.set(t.id,r),this.observedDepth=Math.max(this.observedDepth,r),this.historyEntryCount+=t.history_entry_count,this.recordMismatch(t.history_entry_count!==this.shape.history_entries_per_item,"history_entries_per_item:drift"),this.firstTimestamp=this.firstTimestamp===null||t.timestamp<this.firstTimestamp?t.timestamp:this.firstTimestamp,this.lastTimestamp=this.lastTimestamp===null||t.timestamp>this.lastTimestamp?t.timestamp:this.lastTimestamp;for(let[n,o]of this.annotationFields)this.annotations[n]+=Number(t[o]);this.recordEdgeKinds(this.edgeKinds,t.dependency_kinds),this.recordEdgeKinds(this.expectedEdgeKinds,Zr(t.index,this.shape))}finish(){let t=Math.min(this.shape.author_cardinality,this.itemCount),r=Math.min(this.shape.component_count,this.itemCount),n=[...this.planMismatches,...this.itemCount===0?["item_count:empty"]:[],...this.authors.size===t?[]:[`author_count:${this.authors.size}!=${t}`],...this.components.size===r?[]:[`component_count:${this.components.size}!=${r}`],...this.observedDepth<=this.shape.hierarchy_depth?[]:[`hierarchy_depth:${this.observedDepth}>${this.shape.hierarchy_depth}`],...this.observedFanout<=this.shape.hierarchy_fanout?[]:[`hierarchy_fanout:${this.observedFanout}>${this.shape.hierarchy_fanout}`]];for(let[s,,a]of this.annotationFields){let c=Math.floor(this.itemCount/100),d=this.itemCount%100,p=c*a+Math.max(0,a+d-100),l=c*a+Math.min(a,d),f=this.annotations[s];(f<p||f>l)&&n.push(`${s}:${f}!in[${p},${l}]`)}let o=new Set([...Object.keys(this.edgeKinds),...Object.keys(this.expectedEdgeKinds)]);for(let s of[...o].sort()){let a=this.edgeKinds[s]??0,c=this.expectedEdgeKinds[s]??0;a!==c&&n.push(`edge_kind:${s}:${a}!=${c}`)}let i=[...new Set(n)];return{shape:this.shape.name,item_count:this.itemCount,author_count:this.authors.size,component_count:this.components.size,hierarchy_depth:this.observedDepth,hierarchy_fanout:this.observedFanout,timestamp_range:{first:this.firstTimestamp,last:this.lastTimestamp},history_entry_count:this.historyEntryCount,annotations:{...this.annotations},edge_kinds:{...this.edgeKinds},matches_declaration:i.length===0,mismatches:i}}};function en(e){return new at(e)}function Ty(e,t){let r=en(e);for(let n of t)r.add(n);return r.finish()}async function Ey(){let e=De(process.cwd(),process.env.PM_PATH);await wt(e,(t,r)=>Ot(t,r,{apply_runtime_defaults:!0}))}async function Ay(){await Rt()}var tn=["lines","branches","functions","statements"];function xy(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 n=r;if(typeof n.covered!="number"||typeof n.total!="number"||!Number.isInteger(n.covered)||!Number.isInteger(n.total)||n.covered<0||n.total<n.covered)throw new TypeError(`Coverage entry ${e} has invalid ${t} counts.`);return{covered:n.covered,total:n.total}}function wy(e){if(typeof e!="object"||e===null||Array.isArray(e))throw new TypeError("Coverage summary must be a JSON object.");if(!("total"in e))throw new TypeError("Coverage summary is missing the total entry.");let t=[];for(let[r,n]of Object.entries(e)){xy(r,n);for(let o of tn){let i=by(r,o,n[o]),s=i.total-i.covered;s>0&&t.push({file:r,metric:o,uncovered:s,...i})}}return t}import Y from"node:fs";import ct from"node:path";var rn=300*1e3,Oy=3;function E$(e){return(e?.trim()||"development").replace(/[^a-zA-Z0-9._-]/g,"_").replace(/^\./,"_")}function A$(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 n=ct.join(e,r);Y.mkdirSync(n,{recursive:!0});let o=new Date;Y.utimesSync(n,o,o);let i=Y.readdirSync(e).filter(d=>d!==r).flatMap(d=>{try{return[{name:d,mtimeMs:Y.statSync(ct.join(e,d)).mtimeMs}]}catch(p){if(p instanceof Error&&"code"in p&&me(p))return[];throw p}}).sort((d,p)=>p.mtimeMs-d.mtimeMs||d.name.localeCompare(p.name)),s=i.filter(d=>o.getTime()-d.mtimeMs<rn),a=Math.max(0,Oy-1-s.length),c=i.filter(d=>o.getTime()-d.mtimeMs>=rn).slice(a).map(d=>d.name).sort((d,p)=>d.localeCompare(p));for(let d of c)Y.rmSync(ct.join(e,d),{recursive:!0,force:!0,maxRetries:3,retryDelay:50});return{retained:r,removed:c}}import{createHash as Ry}from"node:crypto";var dt=1;function X(e){e?.throwIfAborted()}function G(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship graph ${t} must be non-empty`);return e.trim()}function J(e,t,r={}){let n=Date.parse(r.createdAt??new Date().toISOString());if(!Number.isFinite(n))throw new TypeError("Relationship graph createdAt must be a valid timestamp");let o=e.nodes(),i=e.edges(),s=t.list();return Object.freeze({version:dt,fingerprint:Ry("sha256").update(R({nodes:o,edges:i,kinds:s})).digest("hex"),created_at:new Date(n).toISOString(),nodes:o,edges:i,kinds:s})}function Py(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function se(e){if(!Py(e))throw new TypeError("Relationship graph snapshot must be an object");if(e.version!==dt)throw new TypeError(`Unsupported relationship graph snapshot version: ${String(e.version)}`);if(!Array.isArray(e.nodes)||e.nodes.some(o=>typeof o!="string"))throw new TypeError("Relationship graph snapshot nodes must be strings");if(!Array.isArray(e.edges)||!Array.isArray(e.kinds))throw new TypeError("Relationship graph snapshot edges and kinds must be arrays");if(typeof e.created_at!="string"||!Number.isFinite(Date.parse(e.created_at)))throw new TypeError("Relationship graph snapshot created_at must be valid");if(typeof e.fingerprint!="string")throw new TypeError("Relationship graph snapshot fingerprint must be a string");let t=new Ge([]);for(let o of e.kinds)t.register(o);let r=new q(e.nodes,e.edges,t),n=J(r,t,{createdAt:e.created_at});if(n.fingerprint!==e.fingerprint)throw new TypeError("Relationship graph snapshot fingerprint mismatch");return{snapshot:n,registry:t,graph:r}}async function v(e,t){G(e.name,"adapter name");let r=G(t.workspace,"workspace");X(t.signal);let n=await e.read({...t,workspace:r});return X(t.signal),n===null?null:se(n)}async function we(e,t){let r=G(t.workspace,"workspace"),n=se(t.snapshot).snapshot,o=await v(e,{workspace:r,signal:t.signal});if(o?.snapshot.fingerprint===n.fingerprint)return{adapter:e.name,workspace:r,disposition:"current",fingerprint:n.fingerprint,previous_fingerprint:o.snapshot.fingerprint,node_count:n.nodes.length,edge_count:n.edges.length};if(X(t.signal),await e.replace({workspace:r,signal:t.signal,snapshot:n,expected_fingerprint:o?.snapshot.fingerprint??null}),(await v(e,{workspace:r,signal:t.signal}))?.snapshot.fingerprint!==n.fingerprint)throw new Error(`Relationship graph adapter "${e.name}" did not expose the replaced snapshot`);return{adapter:e.name,workspace:r,disposition:"written",fingerprint:n.fingerprint,...o?{previous_fingerprint:o.snapshot.fingerprint}:{},node_count:n.nodes.length,edge_count:n.edges.length}}function My(e,t={}){let r=e.map(se),n=new Map;for(let s of r)for(let a of s.snapshot.kinds){let c=n.get(a.kind);if(c&&R(c)!==R(a))throw new TypeError(`Conflicting federated relationship kind: ${a.kind}`);n.set(a.kind,a)}let o=new Ge([...n.values()].sort((s,a)=>s.kind.localeCompare(a.kind))),i=new q(new Set(r.flatMap(s=>[...s.snapshot.nodes])),r.flatMap(s=>[...s.snapshot.edges]),o);return J(i,o,t)}var ie=class{name;#e=new Map;constructor(t="memory"){this.name=G(t,"adapter name")}async read(t){X(t.signal);let r=this.#e.get(G(t.workspace,"workspace"));return r?structuredClone(r):null}async replace(t){X(t.signal);let r=G(t.workspace,"workspace"),n=this.#e.get(r);if(t.expected_fingerprint!==void 0&&(n?.fingerprint??null)!==t.expected_fingerprint)throw new Error(`Relationship graph adapter conflict for ${r}`);this.#e.set(r,structuredClone(se(t.snapshot).snapshot))}async clear(t){X(t.signal);let r=G(t.workspace,"workspace"),n=this.#e.get(r);if(t.expected_fingerprint!==void 0&&(n?.fingerprint??null)!==t.expected_fingerprint)throw new Error(`Relationship graph adapter conflict for ${r}`);this.#e.delete(r)}};function nn(e,t){if(!Number.isInteger(e)||e<1)throw new TypeError(`Relationship graph ${t} must be a positive integer`);return e}function Iy(e){let t=nn(e.nodeCount,"nodeCount"),r=nn(e.edgeStride??1,"edgeStride"),n=e.topology??"chain";if(!["chain","star","disconnected"].includes(n))throw new TypeError(`Unsupported relationship graph topology: ${n}`);let o=(e.kind??"related").trim(),i=(e.idPrefix??"node").trim();if(!o||!i)throw new TypeError("Relationship graph kind and idPrefix must be non-empty");let s=n==="disconnected"?0:Math.floor((t-1)/r);return{node_count:t,edge_count:s,edge_basis:"fixture_generated",nodes:{*[Symbol.iterator](){for(let a=0;a<t;a+=1)yield`${i}-${a}`}},edges:{*[Symbol.iterator](){if(n!=="disconnected")for(let a=r;a<t;a+=r)yield{source:`${i}-${n==="star"?0:a-r}`,target:`${i}-${a}`,kind:o}}}}}function U(e,t){if(!e)throw new Error(`Relationship graph adapter conformance: ${t}`)}async function on(e,t={}){let r=t.workspace?.trim()||"pm-graph-conformance",n=xt(),o=J(new q(["a","b"],[{source:"a",target:"b",kind:"related"}],n),n,{createdAt:"2026-01-01T00:00:00.000Z"}),i=J(new q(["a","b","c"],[{source:"a",target:"b",kind:"related"},{source:"b",target:"c",kind:"blocked_by"}],n),n,{createdAt:"2026-01-02T00:00:00.000Z"}),s=[];U(await v(e,{workspace:r})===null,"workspace must start empty"),s.push({name:"empty-read",passed:!0});let a=await we(e,{workspace:r,snapshot:o});U(a.disposition==="written","first sync must write"),s.push({name:"atomic-replace",passed:!0}),(await e.read({workspace:r})).nodes.push("mutated-reader-copy"),U((await v(e,{workspace:r}))?.snapshot.nodes.length===2,"reads must not mutate stored state"),s.push({name:"read-isolation",passed:!0}),U((await we(e,{workspace:r,snapshot:o})).disposition==="current","identical sync must be idempotent"),s.push({name:"idempotent-sync",passed:!0}),await e.replace({workspace:r,snapshot:i,expected_fingerprint:o.fingerprint}),U((await v(e,{workspace:r}))?.snapshot.fingerprint===i.fingerprint,"replacement must become visible"),s.push({name:"replacement-visibility",passed:!0});let d=!1;try{await e.replace({workspace:r,snapshot:o,expected_fingerprint:o.fingerprint})}catch{d=!0}return U(d,"stale compare-and-swap must fail"),s.push({name:"stale-cas",passed:!0}),e.clear&&(await e.clear({workspace:r,expected_fingerprint:i.fingerprint}),U(await v(e,{workspace:r})===null,"clear must remove the workspace"),s.push({name:"clear",passed:!0})),{adapter:e.name,workspace:r,cases:Object.freeze(s),clear_supported:e.clear!==void 0}}function vy(e){return on(new ie,e?{workspace:e}:{})}var pt=2,ky=["self_reported","independent_transport"];function Oe(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 sn(e,t,r=!1){if(!Array.isArray(e)||e.length===0)throw new TypeError(`${t} must be a non-empty string array`);return e.map((n,o)=>{let i=ae(n,`${t}[${String(o)}]`);return r?n:i})}function lt(e,t){return e===void 0?void 0:ae(e,t)}function Ny(e,t){if(e===void 0)return;if(!Oe(e)||Object.keys(e).length===0)throw new TypeError(`${t} must be a non-empty object`);let r=Object.entries(e).map(([n,o])=>{if(n.length===0||n.split(".").some(i=>i.length===0))throw new TypeError(`${t} must use dot-separated own-property paths`);if(o!==null&&typeof o!="string"&&typeof o!="boolean"&&(typeof o!="number"||!Number.isFinite(o)))throw new TypeError(`${t} values must be JSON primitives`);return[n,o]});return Object.fromEntries(r)}function Ly(e,t,r,n,o,i){if(n==="refusal"){if(Ve(r)||o===void 0||i===void 0)throw new TypeError(`${e} refusal steps require a non-success exit, error code, and refusal surface`);return}if(o!==void 0||i!==void 0)throw new TypeError(`${e} only refusal steps may declare expected_error_code or expected_refusal_surface`);let s=Ct(t);if(s===void 0)throw new TypeError(`${e}.args must identify a command after global flags`);let a=t[s].trim().toLowerCase();if(a==="history"){let p=yt(t.slice(s+1));p!==void 0&&(a=ke(`history ${p}`))}let c=$t(a);if(!Ve(r)||r!==0&&!c?.exit_codes.some(p=>p===r))throw new TypeError(`${e} successful output must use exit code 0 or a command-declared successful effect exit`);let d=Lt(a).kind;if(n!==d)throw new TypeError(`${e} expected ${n}, but ${a} declares ${d}`)}function $y(e,t,r){if(!Oe(e))throw new TypeError(`tasks.${t}.steps[${String(r)}] must be an object`);let n=`tasks.${t}.steps[${String(r)}]`,o=ae(e.id,`${n}.id`),i=sn(e.args,`${n}.args`,!0),s=e.expected_exit_code;if(typeof s!="number"||!Number.isSafeInteger(s))throw new TypeError(`${n}.expected_exit_code must be a safe integer`);let a=e.expected_output_kind;if(a!=="refusal"&&!Nt.includes(a))throw new TypeError(`${n}.expected_output_kind is unsupported`);let c=a,d=e.expected_accounting_mode;if(!ky.includes(d))throw new TypeError(`${n}.expected_accounting_mode is unsupported`);let p=d;if(p==="independent_transport"&&c!=="refusal")throw new TypeError(`${n} independent_transport accounting is supported only for refusal steps`);let l=sn(e.required_fields,`${n}.required_fields`);if(l.some(E=>E.split(".").some(B=>B.length===0)))throw new TypeError(`${n}.required_fields must contain dot-separated own-property paths`);let f=Ny(e.expected_field_values,`${n}.expected_field_values`),g=lt(e.expected_error_code,`${n}.expected_error_code`),_=lt(e.expected_refusal_surface,`${n}.expected_refusal_surface`),y=lt(e.recovery_for,`${n}.recovery_for`);return Ly(n,i,s,c,g,_),{id:o,args:i,expected_exit_code:s,expected_output_kind:c,expected_accounting_mode:p,required_fields:l,...f?{expected_field_values:f}:{},...g?{expected_error_code:g}:{},..._?{expected_refusal_surface:_}:{},...y?{recovery_for:y}:{}}}function Dy(e,t){if(!Oe(e))throw new TypeError(`tasks[${String(t)}] must be an object`);let r=ae(e.id,`tasks[${String(t)}].id`),n=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 o=e.steps.map((s,a)=>$y(s,r,a)),i=new Map;for(let s of o){if(i.has(s.id))throw new TypeError(`tasks.${r} contains duplicate step id ${s.id}`);if(s.recovery_for!==void 0&&(i.get(s.recovery_for)?.expected_output_kind!=="refusal"||s.expected_output_kind==="refusal"))throw new TypeError(`tasks.${r}.${s.id} recovery_for must reference an earlier refusal and declare successful output`);i.set(s.id,s)}if(o.at(-1)?.expected_output_kind==="refusal")throw new TypeError(`tasks.${r} completed task must terminate with successful output`);for(let s of o)if(s.expected_output_kind==="refusal"&&!o.some(a=>a.recovery_for===s.id))throw new TypeError(`tasks.${r}.${s.id} refusal must have a later successful recovery_for step`);return{id:r,description:n,steps:o}}function eD(e){if(!Oe(e))throw new TypeError("agent-task transcript corpus must be an object");if(e.version!==pt)throw new TypeError(`agent-task transcript corpus version must be ${String(pt)}`);if(!Array.isArray(e.tasks)||e.tasks.length===0)throw new TypeError("agent-task transcript corpus tasks must be non-empty");let t=e.tasks.map((n,o)=>Dy(n,o)),r=new Set;for(let n of t){if(r.has(n.id))throw new TypeError(`duplicate agent-task transcript id ${n.id}`);r.add(n.id)}return{version:pt,tasks:t}}import{createHash as an}from"node:crypto";function cn(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship backfill ${t} must be non-empty`);return e.trim()}function oD(e,t){let r=cn(t.migrationId,"migrationId"),n=cn(t.author,"author"),o=Date.parse(t.timestamp);if(!Number.isFinite(o))throw new TypeError("Relationship backfill timestamp must be valid");let i=new Date(o).toISOString(),s=qe(e,void 0,t.registry),a=s.graph.nodes(),c=s.graph.edges().map(f=>{let g=an("sha256").update(JSON.stringify([r,f.kind,f.source,f.target,f.createdAt??null,f.author??null,f.payload??null])).digest("hex").slice(0,24);return Object.freeze({eventId:`backfill:${r}:${g}`,relationshipId:`migration:${r}:${g}`,action:"add",edge:f,author:n,timestamp:i,reason:`Backfill ${r} from legacy item metadata`})}),d=an("sha256").update(JSON.stringify({migrationId:r,nodes:a,events:c})).digest("hex"),p=new Set([...t.existingEventIds??[]].filter(f=>typeof f=="string").map(f=>f.trim()).filter(Boolean)),l=c.filter(f=>!p.has(f.eventId));return Object.freeze({migration_id:r,fingerprint:d,nodes:a,events:Object.freeze(l),edge_count:c.length,skipped_existing_count:c.length-l.length,duplicate_dependency_rows:s.duplicateRows.length,dangling_reference_count:s.dangling.active.length+s.dangling.legacy_terminal.length})}import*as dn from"node:module";var ce=["suggested_retry","candidate_command","example","next_step","migration_hint","restore_with"],ut={suggested_retry:{kind:"suggested_retry",semantics:"recovery"},retry_command:{kind:"suggested_retry",semantics:"recovery"},candidate_command:{kind:"candidate_command",semantics:"recovery"},candidate_commands:{kind:"candidate_command",semantics:"recovery"},fallback_candidates:{kind:"candidate_command",semantics:"recovery",nested_value_field:"command"},next_best_command:{kind:"candidate_command",semantics:"recovery"},example:{kind:"example",semantics:"recovery"},examples:{kind:"example",semantics:"recovery"},next_step:{kind:"next_step",semantics:"recovery"},next_steps:{kind:"next_step",semantics:"recovery"},suggested_next_steps:{kind:"next_step",semantics:"recovery"},migration_hint:{kind:"migration_hint",semantics:"replacement"},migration_hints:{kind:"migration_hint",semantics:"replacement"},restore_with:{kind:"restore_with",semantics:"behavior_preserving"}},sD=Object.freeze(Object.keys(ut));function pn(e){if(Object.hasOwn(ut,e))return ut[e]}var Fy=new Set([..."=([{,:;!?&|+-*%^~<>","=>"]);function Q(e,t){return e<t?-1:e>t?1:0}function Gy(e,t){let r=e[t],n=t+1,o="";for(;n<e.length&&e[n]!==r;)e[n]==="\\"?n+=2:(o+=e[n],n+=1);return e[n]===r&&(n+=1),{next:n,value:o}}function Uy(e){return e===void 0||e.kind==="punctuator"&&Fy.has(e.value)||e.kind==="identifier"&&["return","case","throw","else","yield"].includes(e.value)}function jy(e,t){if(/\s/u.test(e[t]))return t+1;if(e.startsWith("//",t)){let r=e.indexOf(`
31
31
  `,t+2);return r===-1?e.length:r+1}if(e.startsWith("/*",t))return e.indexOf("*/",t+2)+2}function By(e,t,r){if(e[t]!=="/"||!Uy(r))return;let n=t+1,o=!1;for(;n<e.length;)if(e[n]==="\\")n+=2;else if(e[n]==="[")o=!0,n+=1;else if(e[n]==="]")o=!1,n+=1;else if(e[n]==="/"&&!o){for(n+=1;/[A-Za-z]/u.test(e.charAt(n));)n+=1;return n}else n+=1;return n}function qy(e,t){let r=e[t];if(r==="'"||r==='"'||r==="`"){let o=Gy(e,t);return r==="`"?{next:o.next}:{next:o.next,token:{kind:"string",value:o.value,offset:t+1}}}if(/[A-Za-z_$]/u.test(r)){let o=t+1;for(;/[A-Za-z0-9_$]/u.test(e[o]??"");)o+=1;return{next:o,token:{kind:"identifier",value:e.slice(t,o),offset:t}}}let n=e.startsWith("=>",t)?"=>":r;return{next:t+n.length,token:{kind:"punctuator",value:n,offset:t}}}function zy(e){let t=[],r=0;for(;r<e.length;){let n=jy(e,r);if(n!==void 0){r=n;continue}let o=By(e,r,t.at(-1));if(o!==void 0){r=o;continue}let i=qy(e,r);i.token&&t.push(i.token),r=i.next}return t}var Hy=new Set(["object","block","pattern"]),Vy=new Set(["const","let","var"]),Ky=new Set(["}",")","]"]),Wy=new Set(["=","(","[",",",":","?","return"]);function Yy(e,t,r){if([...r].reverse().find(i=>Hy.has(i.kind))?.kind==="pattern"||r.at(-1)?.kind==="paren"&&r.at(-1)?.parameter_list)return"pattern";let o=e[t-1];return o?.kind==="identifier"&&Vy.has(o.value)?"pattern":o?.value==="=>"||o?.value===")"?"block":o&&Wy.has(o.value)?"object":"block"}function Xy(e,t,r){let n=e[t];if(n.value==="{"){let a=Yy(e,t,r);return{kind:a,...a==="object"?{member_start:!0,candidates:[]}:{}}}if(n.value==="[")return{kind:"array"};if(n.value!=="(")return;let o=e[t-1],i=e[t-2];return{kind:"paren",...o?.value==="function"||i?.value==="function"?{parameter_list:!0}:{}}}function Jy(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 Qy(e,t){return e[t+1]?.value===")"&&e[t+2]?.value==="=>"||e[t+1]?.value==="="}function Zy(e){let t=zy(dn.stripTypeScriptTypes(e,{mode:"strip"})),r=[],n=[];for(let[o,i]of t.entries()){let s=n.at(-1),a=Jy(s,i,t[o+1]);a&&s.candidates.push(a);let c=Xy(t,o,n);if(c)n.push(c);else if(Ky.has(i.value)){let d=n.pop();d?.kind==="object"&&!Qy(t,o)&&r.push(...d.candidates)}else i.value===","&&s?.kind==="object"?s.member_start=!0:s?.kind==="object"&&i.value!==":"&&(s.member_start=!1)}return r}function eS(e){let t=[0];for(let r=0;r<e.length;r+=1)e[r]===`
32
- `&&t.push(r+1);return t}function tS(e,t){let r=0,n=e.length;for(;r<n;){let o=Math.floor((r+n)/2);e[o]<=t?r=o+1:n=o}return r}function sD(e){let t=[],r=[];for(let o of[...e].sort((i,s)=>Q(i.path,s.path))){let i=eS(o.content),s;try{s=Zy(o.content)}catch(a){r.push({kind:"invalid_source",subject:o.path,detail:`${o.path} could not be parsed for recovery producers: ${String(a)}.`});continue}for(let a of s){let c=a.field,d=tS(i,a.offset),p=pn(c);p?t.push({path:o.path,line:d,field:c,kind:p.kind}):/(?:retry_command|candidate_command|fallback_candidate|next_best_command|example|next_step|migration_hint|restore_with)/u.test(c)&&!/(?:_total|_truncated)$/u.test(c)&&r.push({kind:"unknown_recovery_field",subject:`${o.path}:${d}:${c}`,detail:`${c} resembles a recovery reference but has no typed field contract.`})}}let n=Object.fromEntries(ce.map(o=>[o,t.filter(i=>i.kind===o).length]));for(let o of ce)n[o]===0&&r.push({kind:"missing_kind_producer",subject:o,detail:`No source producer emits the ${o} recovery-reference kind.`});return t.sort((o,i)=>o.path!==i.path?Q(o.path,i.path):o.line!==i.line?o.line-i.line:Q(o.field,i.field)),r.sort((o,i)=>o.subject!==i.subject?Q(o.subject,i.subject):Q(o.kind,i.kind)),{ok:r.length===0,scanned_file_count:e.length,producer_count:t.length,producer_count_by_kind:n,producers:t,findings:r}}function aD(e,t){let r=[],n=(o,i)=>{if(Array.isArray(o)){o.forEach((s,a)=>n(s,[...i,String(a)]));return}if(!(typeof o!="object"||o===null))for(let[s,a]of Object.entries(o).sort(([c],[d])=>Q(c,d))){let c=pn(s),d=c?.kind==="migration_hint"&&o.semantics==="behavior_preserving"?{...c,semantics:"behavior_preserving"}:c,p=[a].flat();d!==void 0&&p.forEach((l,f)=>{let g="nested_value_field"in d&&typeof d.nested_value_field=="string"?d.nested_value_field:void 0,_=g&&typeof l=="object"&&l!==null&&!Array.isArray(l)?l[g]:l;if(typeof _!="string"||_.trim().length===0)return;let y=[...i,s,String(f)].map(E=>encodeURIComponent(E)).join("/");r.push({id:`${e}:${d.kind}:${y}`,probe_id:e,kind:d.kind,semantics:d.semantics,value:_})}),n(a,[...i,s])}};return n(t,[]),r}function cD(e,t){let r=e.flatMap(s=>(s.owned_states??[]).map(a=>({contract:s,state:a}))),n=[],o=new Map;for(let s of t){if(o.has(s.probe_id)){n.push({kind:"duplicate_probe",probe_id:s.probe_id,detail:`Observation ${s.probe_id} was supplied more than once.`});continue}o.set(s.probe_id,s)}let i=new Set(r.map(({state:s})=>s.probe_id));for(let{contract:s,state:a}of r){let c=o.get(a.probe_id);if(!c){n.push({kind:"missing_probe",probe_id:a.probe_id,detail:`No entrypoint observation was recorded for ${s.code}.`});continue}c.code!==s.code&&n.push({kind:"wrong_error_code",probe_id:a.probe_id,detail:`Expected ${s.code}; observed ${c.code}.`}),c.exit_class!==a.expected_exit_class&&n.push({kind:"wrong_exit_class",probe_id:a.probe_id,detail:`Expected ${a.expected_exit_class}; observed ${c.exit_class}.`}),a.entrypoints.includes(c.entrypoint)||n.push({kind:"wrong_entrypoint",probe_id:a.probe_id,detail:`Expected one of ${a.entrypoints.join(", ")}; observed ${c.entrypoint}.`})}for(let s of t)i.has(s.probe_id)||n.push({kind:"undeclared_probe",probe_id:s.probe_id,detail:`Observation ${s.probe_id} has no catalog declaration.`});return n.sort((s,a)=>s.probe_id!==a.probe_id?s.probe_id.localeCompare(a.probe_id):s.kind.localeCompare(a.kind)),{ok:n.length===0,declared_probe_count:r.length,observed_probe_count:t.length,findings:n}}function dD(e,t){let r=[],n=new Set,o=new Set;for(let c of e){if(n.has(c.id)){o.add(c.id),r.push({kind:"duplicate_obligation",reference_id:c.id,detail:`Recovery obligation ${c.id} was declared more than once.`});continue}n.add(c.id)}let i=new Map;for(let c of t){if(i.has(c.id)){r.push({kind:"duplicate_observation",reference_id:c.id,detail:`Recovery reference ${c.id} was observed more than once.`});continue}i.set(c.id,c),n.has(c.id)||r.push({kind:"undeclared_observation",reference_id:c.id,detail:`Recovery observation ${c.id} has no emitted obligation.`})}for(let c of e){if(o.has(c.id))continue;let d=i.get(c.id);d?d.reachable?d.semantics!==c.semantics&&r.push({kind:"wrong_semantics",reference_id:c.id,detail:`Recovery reference ${c.value} promised ${c.semantics}; proof demonstrated ${d.semantics}.`}):r.push({kind:"unreachable_reference",reference_id:c.id,detail:`Recovery reference ${c.value} did not reach its promised target.`}):r.push({kind:"missing_observation",reference_id:c.id,detail:`No reachability proof was recorded for ${c.kind} ${c.value}.`})}let s=ce.map(c=>{let d=e.filter(l=>l.kind===c),p=d.filter(l=>!o.has(l.id)).map(l=>i.get(l.id)).filter(l=>l!==void 0);return{kind:c,declared:d.length,observed:p.length,passed:d.filter(l=>{let f=i.get(l.id);return!o.has(l.id)&&f?.reachable===!0&&f.semantics===l.semantics}).length}});r.sort((c,d)=>c.reference_id!==d.reference_id?c.reference_id.localeCompare(d.reference_id):c.kind.localeCompare(d.kind));let a=s.reduce((c,d)=>c+d.passed,0);return{ok:r.length===0,declared_reference_count:e.length,observed_reference_count:t.length,pass_fraction:n.size===0?1:a/n.size,coverage_by_kind:s,findings:r}}function rS(e,t){let r=new Map(ce.map(i=>[i,new Set]));for(let i of t)r.get(i.kind).add(i.value);let n=ce.map(i=>({kind:i,source_producers:e.producer_count_by_kind[i],runtime_values:r.get(i).size})),o=n.filter(({source_producers:i,runtime_values:s})=>i>0&&s===0).map(({kind:i})=>i);return{ok:e.ok&&o.length===0,source_producer_count:e.producer_count,runtime_value_count:n.reduce((i,{runtime_values:s})=>i+s,0),coverage_by_kind:n,missing_runtime_kinds:o}}var pD=rS;var uD=16,nS=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"]),ln=18,un=Object.freeze([...nS,"manifest_unknown_key","no_version_bounds_declared"].sort((e,t)=>e.localeCompare(t)));function mD(e,t=ln){return{ok:e.executable_error_code_count>=t,baseline:t,actual:e.executable_error_code_count}}function fD(e,t=un){let r=new Set(e.rows.filter(({disposition:o})=>o==="executable").map(({canonical_code:o})=>o)),n=t.filter(o=>!r.has(o));return{ok:n.length===0,required_canonical_codes:[...t],missing_required_canonical_codes:n}}function mt(e,t){let r=e.get(t);if(r)return r;let n={kinds:new Set,probeIds:new Set};return e.set(t,n),n}function _D(e,t,r){let n=new Map(e.map(p=>[p.code,p.canonical_code??p.code])),o=new Map,i=0,s=0;for(let p of e){let l=mt(o,p.canonical_code??p.code);for(let f of p.owned_states??[])l.kinds.add("owned_state"),l.probeIds.add(f.probe_id)}for(let p of t){let l=n.get(p.error_code);if(l===void 0)continue;i+=1;let f=mt(o,l);f.kinds.add("closed_domain"),f.probeIds.add(p.probe_id)}for(let p of r){let l=n.get(p.error_code);if(l===void 0)continue;s+=1;let f=mt(o,l);f.kinds.add("grammar"),f.probeIds.add(p.probe_id)}let a=e.map(p=>{let l=p.canonical_code??p.code,f=o.get(l),g=[...f.probeIds].sort();return{code:p.code,canonical_code:l,disposition:g.length>0?"executable":"uncovered",evidence_kinds:[...f.kinds].sort(),probe_ids:g}}).sort((p,l)=>p.code<l.code?-1:1),c=a.filter(({disposition:p})=>p==="uncovered").map(({code:p})=>p),d=a.length-c.length;return{ok:c.length===0,catalog_error_code_count:a.length,executable_error_code_count:d,uncovered_error_code_count:c.length,coverage_fraction:a.length===0?1:d/a.length,closed_domain_probe_count:i,grammar_probe_count:s,uncovered_error_codes:c,rows:a}}function hD(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: ${ln}`,`- Required executable canonical codes: ${un.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 oS(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 iS(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."},...oS(e)]}function yD(e){let t=[],r=new Set,n=0;e.length===0&&t.push({code:"empty_corpus",probe_id:"corpus",detail:"At least one real refusal observation is required."});for(let o of e){if(r.has(o.probe_id)){t.push({code:"duplicate_probe",probe_id:o.probe_id,detail:`${o.probe_id} was supplied more than once.`});continue}r.add(o.probe_id);let i=t.length;for(let s of iS(o))s!==void 0&&t.push(s);t.length===i&&(n+=1)}return t.sort((o,i)=>o.probe_id!==i.probe_id?o.probe_id.localeCompare(i.probe_id):o.code.localeCompare(i.code)),{ok:t.length===0,probe_count:r.size,closed_probe_count:n,closure_fraction:r.size===0?0:n/r.size,findings:t}}var mn="not-a-declared-action";function sS(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 de(e){return e.replaceAll(/[^a-z0-9]+/gu,"-").replaceAll(/^-|-$/gu,"")}function RD(e=je.filter(t=>Pt.some(r=>r.command===t.command&&r.disposition!=="package_owned"))){let t=new Set(e.filter(({command:r})=>!r.includes(" ")).map(({command:r})=>de(r)));return e.flatMap(r=>r.slots.flatMap((n,o)=>{if(!n.required)return[];let i=r.command.split(" "),s=de(r.command),a=i.length>1&&t.has(s)?i.map(de).join("--"):s,c=Z(r.command).flatMap(p=>p.required?[p.flag,...p.value_name?["example"]:[]]:[]),d=Ue.some(p=>p.command===r.command);return[{probe_id:`required-argument-${a}-${de(n.name)}`,command:r.command,refusal_args:[...i,...r.slots.slice(0,o).map(p=>sS(r.command,p)),...c],recovery_args:[...i,"--help"],error_code:d&&!r.command.startsWith("assurance ")?"invalid_argument_value":/^extension (?:activate|adopt|deactivate|uninstall)$/u.test(r.command)?"missing_lifecycle_target":"missing_required_argument",missing_argument:n.name,missing_argument_index:o}]})).sort((r,n)=>r.probe_id.localeCompare(n.probe_id))}function aS(e){switch(N(e)){case"assurance":case"workspace snapshot":return Ue.filter(({parent:t})=>t===e).map(({action:t})=>t);case"graph":return Ne;case"merge":return Le;case"plan":return Ke;case"profile":return We;case"schema":return Dt;default:throw new Error(`Required positional action family ${e} has no authoritative value domain.`)}}function PD(e=je){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-${de(t)}`,command:t,refusal_args:[...r,mn],recovery_args:[...r,"--help"],error_code:"unknown_subcommand",rejected_value:mn,allowed_values:[...aS(t)].sort()}}).sort((t,r)=>t.probe_id.localeCompare(r.probe_id))}function cS(e,t){let r=[...t].sort();return e.length===t.length&&[...e].sort().every((n,o)=>n===r[o])}function dS(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&&!cS(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 MD(e,t){let r=new Map(e.map(s=>[s.probe_id,s])),n=new Map(t.map(s=>[s.probe_id,s])),o=[...e.flatMap(s=>dS(s,n.get(s.probe_id))),...t.filter(s=>!r.has(s.probe_id)).map(s=>({code:"unexpected_refusal_probe",probe_id:s.probe_id,detail:`${s.probe_id} has no declared grammar refusal contract.`}))];o.sort((s,a)=>s.probe_id.localeCompare(a.probe_id)||s.code.localeCompare(a.code));let i=new Set(o.map(({probe_id:s})=>s));return{ok:o.length===0,probe_count:e.length,closed_probe_count:e.filter(({probe_id:s})=>!i.has(s)).length,findings:o}}var ft=[{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 vD(){return ft.map(e=>({...e}))}function pS(e,t){let r=[];t.error_code!==e.expected_error_code&&r.push({code:"error_code_mismatch",probe_id:e.probe_id,detail:`Expected ${e.expected_error_code}, received ${t.error_code}.`}),t.exit_code!==e.expected_exit_code&&r.push({code:"exit_code_mismatch",probe_id:e.probe_id,detail:`Expected exit ${e.expected_exit_code}, received ${t.exit_code}.`}),t.recovery_kind!==e.recovery_kind&&r.push({code:"recovery_kind_mismatch",probe_id:e.probe_id,detail:`Expected ${e.recovery_kind}, received ${t.recovery_kind}.`});let n=t.suggested_retry_args.indexOf("init"),o=n===0||n===2&&t.suggested_retry_args[0]==="--pm-path"&&t.suggested_retry_args[1]?.length>0;return e.recovery_kind==="initialize"&&!o&&r.push({code:"missing_init_recovery",probe_id:e.probe_id,detail:"Missing and uninitialized roots must emit a tokenized init retry."}),(t.unsafe_init_recommended||e.recovery_kind!=="initialize"&&t.suggested_retry_args.includes("init"))&&r.push({code:"unsafe_init_recovery",probe_id:e.probe_id,detail:"A tracker root that cannot be initialized safely must not recommend initialization."}),t.retry_succeeded||r.push({code:"retry_failed",probe_id:e.probe_id,detail:"The emitted retry or safe alternate-root recovery did not execute successfully."}),r}function kD(e){let t=new Map(e.map(o=>[o.probe_id,o])),r=[],n=0;for(let o of ft){let i=t.get(o.probe_id);if(i===void 0){r.push({code:"missing_probe",probe_id:o.probe_id,detail:"No runtime observation was supplied for this contract."});continue}let s=pS(o,i);r.push(...s),s.length===0&&(n+=1)}return r.sort((o,i)=>o.probe_id.localeCompare(i.probe_id)||o.code.localeCompare(i.code)),{ok:r.length===0,probe_count:ft.length,closed_probe_count:n,findings:r}}var Re,lS=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 uS(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=lS[N(e)];if(r===void 0)throw new Error(`Command ${e} exposes --full without a registered projection concept.`);return r}return t!=="--file"?t.slice(2):["create","update","update-many"].includes(N(e))?"linked-file-path":["comments","notes","learnings"].includes(N(e))?"entry-file-input":"plan-definition-file"}function Pe(){if(Re!==void 0)return Re;let t=ee.filter(({command:i})=>Be(i)).flatMap(({command:i,family:s})=>Mt(i,Z(i)).map(a=>({command:i,family:s,concept:uS(i,a.flag),flag:a.flag,aliases:Object.freeze([...a.aliases??[]]),value_kind:a.repeatable?"list":a.flag==="--limit"?"number":a.value_type}))),r=new Set(t.flatMap(i=>i.aliases.map(s=>`${i.command}:${s}`))),n=t.filter(i=>!r.has(`${i.command}:${i.flag}`)),o=new Map;for(let i of n){let s=o.get(i.concept)??new Set;s.add(i.value_kind),o.set(i.concept,s)}return Re=Object.freeze(n.map(i=>Object.freeze({...i,concept:o.get(i.concept)?.size===1?i.concept:`${i.concept}@${i.command}`}))),Re}function GD(){return Object.freeze(Pe().map(e=>Object.freeze({command:e.command,canonical_flag:e.flag,accepted_spellings:Object.freeze([...new Set([e.flag,...e.aliases])].sort())})))}var fn=Object.freeze({init:30,item:20,config:36,extension:55,package:56,packages:56,install:27,upgrade:29,create:104,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:36,events:34,"history-attest":23,"history-redact":27,"history-repair":28,"history-compact":30,"history-author-acknowledge":28,merge:29,schema:43,profile:22,activity:36,restore:23,update:105,"update-many":146,close:32,"close-many":72,delete:24,append:25,comments:32,notes:36,learnings:32,files:41,docs:32,deps:32,plan:111,test:58,"test-all":41,telemetry:21,stats:29,health:36,validate:46,assurance:30,gc:22,workspace:23,contracts:29,claim:40,release:25,"start-task":24,"pause-task":23,"close-task":24,meet:33,event:33,remind:29,"test-runs-worker":20}),mS=1,_n=Object.freeze(Object.fromEntries(Object.entries({...fn,...Object.fromEntries(ve.flatMap(({alias:e,canonical:t})=>{let r=fn[e];return r===void 0?[]:[[t,r]]}))}).map(([e,t])=>[e,t+mS])));function hn(){let e=new Map(Object.keys(_n).map(t=>[t,0]));for(let{command:t}of Pe())e.set(t,Number(e.get(t))+1);return Object.freeze(Object.entries(_n).map(([t,r])=>Object.freeze({command:t,current:Number(e.get(t)),maximum:r})))}function fS(e,t,r){for(let n of e)for(let o of n.aliases){let i=t.get(`${n.command}:${o}`);i===void 0||i.flag===n.flag||r.push({code:"alias_collision",command:n.command,detail:`${o} aliases ${n.flag} but is canonical for ${i.flag}.`})}}function _S(e,t,r){let n=new Set(t.map(({command:o})=>o));for(let o of e.keys())n.has(o)||r.push({code:"missing_budget",command:o,detail:`${o} has canonical flags but no persisted budget.`});for(let o of t){let i=e.get(o.command)??0;i===0&&r.push({code:"stale_budget",command:o.command,detail:`${o.command} has a persisted budget but no canonical flags.`}),!(i<=o.maximum)&&r.push({code:"budget_exceeded",command:o.command,detail:`${i} canonical flags exceed the ratcheted maximum ${o.maximum}.`})}}function hS(e,t,r){let n=new Map(e.map(o=>[`${o.command}:${o.flag}`,o]));for(let o of t){let i=`${o.command}:${o.canonical_flag}`,s=n.get(i);if(!s){r.push({code:"removed_canonical_spelling",command:o.command,detail:`${o.canonical_flag} disappeared from the executable spelling inventory.`});continue}let a=new Set([s.flag,...s.aliases]);for(let c of o.accepted_spellings)a.has(c)||r.push({code:"removed_compatibility_spelling",command:o.command,detail:`${c} no longer resolves to ${o.canonical_flag}.`})}}function UD(e=Pe(),t=hn(),r=[]){let n=[],o=new Map,i=new Map,s=new Map,a=new Map;for(let c of e){let d=`${c.command}:${c.flag}`;o.has(d)?n.push({code:"duplicate_canonical_flag",command:c.command,detail:`${c.flag} has more than one canonical row.`}):o.set(d,c),a.set(c.command,(a.get(c.command)??0)+1);let p=i.get(c.concept);p!==void 0&&p!==c.value_kind?n.push({code:"inconsistent_concept_kind",command:c.command,detail:`${c.concept} uses both ${p} and ${c.value_kind}.`}):i.set(c.concept,c.value_kind);let l=s.get(c.concept);l!==void 0&&l!==c.flag?n.push({code:"semantic_spelling_collision",command:c.command,detail:`${c.concept} is canonicalized by both ${l} and ${c.flag}.`}):s.set(c.concept,c.flag)}return fS(e,o,n),_S(a,t,n),hS(e,r,n),n.sort((c,d)=>c.command.localeCompare(d.command)||c.code.localeCompare(d.code)||c.detail.localeCompare(d.detail)),{ok:n.length===0,entry_count:e.length,budget_count:t.length,concept_count:new Set(e.map(({concept:c})=>c)).size,baseline_entry_count:r.length,findings:n}}function jD(){let e=Pe(),t=hn(),r=new Map(t.map(({command:o})=>[o,"unknown"]));for(let{command:o,family:i}of e)r.set(o,i);return["# Generated flag lexicon budgets","","This file is generated by `listPmFlagLexicon()`. Compatibility aliases do not consume canonical budget.","","| Command | Capability family | Canonical flags | Maximum |","| --- | --- | ---: | ---: |",...t.map(({command:o,current:i,maximum:s})=>{let a=r.get(o);return`| \`${o}\` | ${a} | ${i} | ${s} |`}),""].join(`
34
- `)}function qD(e){return e}function zD(e){return e}function HD(e){return e}function VD(e){return e}function KD(e){return e}function WD(e){return e}function YD(e){return e}function XD(e){return e}function JD(e){return e}function QD(e){return e}function ZD(e){return e}function eF(e){return e}function tF(e){return e}function rF(e){return{handled:!0,result:e}}function nF(){return{handled:!1}}function oF(e){return e}function iF(e){return e}function sF(e){return e}function aF(e){return e}function cF(e){return e}function dF(e){return e}function pF(e){return e}function lF(e){return e}function uF(e){return e}function gS(e={},t={}){return new _e(t).extension(void 0,{...e,migrate:!0})}function CS(e={},t={}){return new _e(t).packageMigrate(e)}function k(e){if(typeof e!="string"||!At(e))throw new TypeError("Invalid reliability timestamp.");return Date.parse(e)}function yS(e){let t=k(e.window_start),r=k(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(n=>typeof n!="string"||n.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 SS(e,t,r,n){let o=new Map(t.map(s=>[s,[]])),i=new Set;for(let s of e){if(typeof s.id!="string"||s.id.trim().length===0||i.has(s.id))throw new TypeError("Invalid or duplicate reliability attempt identity.");i.add(s.id);let a=o.get(s.family);if(!a||!["success","failure","pending"].includes(s.outcome)||s.cause!==void 0&&(!["product","infrastructure","unknown"].includes(s.cause)||s.outcome!=="failure"))throw new TypeError("Invalid reliability attempt family, outcome or cause.");let c=k(s.started_at);if(s.repaired_at!==void 0&&(k(s.repaired_at)<c||s.outcome!=="failure"))throw new TypeError("Invalid reliability repair chronology.");c>=r&&c<n&&a.push(s)}return o}function IF(e,t){let{start:r,end:n}=yS(t),i=[...SS(e,t.families,r,n)].map(([s,a])=>{let c=a.filter(_=>_.outcome==="failure"),d=a.filter(_=>_.outcome!=="pending").length,p=d===0?null:c.length/d,l=c.filter(_=>_.repaired_at!==void 0&&k(_.repaired_at)<n),f={product:0,infrastructure:0,unknown:0};for(let _ of c)f[_.cause??"unknown"]+=1;let g=[];return d<t.min_completed_attempts&&g.push("insufficient_completed_attempts"),p!==null&&p>t.max_failure_rate&&g.push("failure_rate"),{family:s,attempts:a.length,completed:d,failed:c.length,pending:a.length-d,failure_rate:p,affected_days:[...new Set(c.map(_=>new Date(k(_.started_at)).toISOString().slice(0,10)))].sort(),repair_minutes:l.map(_=>(k(_.repaired_at)-k(_.started_at))/6e4).sort((_,y)=>_-y),unresolved:c.length-l.length,causes:f,violations:g,ok:g.length===0}});return{schema:"pm-reliability-window/1",window_start:new Date(r).toISOString(),window_end:new Date(n).toISOString(),ok:i.every(s=>s.ok),families:i}}function pe(e){return typeof e=="string"&&e.length>0&&e.trim()===e}function TS(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 n=new Set(r.identities);if(n.size!==r.identities.length||[...n].some(o=>!pe(o)))throw new TypeError("Invalid or duplicate artifact identity.");t.set(r.name,n)}if([...t.values()].every(r=>r.size===0))throw new TypeError("Empty inventories cannot establish artifact reconciliation.");return t}function ES(e,t){if(!Array.isArray(e))throw new TypeError("Expected unique evidence-backed artifact exceptions.");let r=new Map;for(let n of e){if(n===null||typeof n!="object"||!pe(n.identity)||r.has(n.identity)||!pe(n.reason)||!pe(n.evidence))throw new TypeError("Expected unique evidence-backed artifact exceptions.");let o=n.missing_from;if(!Array.isArray(o)||o.length===0||o.length>=t.length||new Set(o).size!==o.length||[...o].some(i=>!t.includes(i)))throw new TypeError("Invalid artifact exception ledger signature.");r.set(n.identity,n)}return r}function kF(e,t=[]){let r=TS(e),n=[...r.keys()].sort(),o=ES(t,n),i=[...new Set([...r.values()].flatMap(d=>[...d]))].sort(),s=[],a=new Set;for(let d of i){let p=n.filter(g=>!r.get(g).has(d));if(p.length===0)continue;let l=o.get(d),f=l!==void 0&&JSON.stringify([...l.missing_from].sort())===JSON.stringify(p);f&&a.add(d),s.push({identity:d,present_in:n.filter(g=>r.get(g).has(d)),missing_from:p,disposition:f?{reason:l.reason,evidence:l.evidence}:null})}let c=[...o.keys()].filter(d=>!a.has(d)).sort();return{schema:"pm-artifact-ledgers/1",ok:s.every(d=>d.disposition!==null)&&c.length===0,counts:Object.fromEntries(n.map(d=>[d,r.get(d).size])),findings:s,stale_exceptions:c}}import{createHash as Cn,createHmac as AS,randomBytes as xS,timingSafeEqual as bS}from"node:crypto";var g1="dev.unbrained.pm/progressive-tool-discovery",C1=Object.freeze({version:1,discoveryTool:"pm_discover",canonicalResult:"structuredContent.result",compatibilityText:"pointer"}),wS=Object.freeze(["pm_discover","pm_next","pm_context","pm_search","pm_get"]),j=Object.freeze({lexical:.4,semantic:.2,graph:.1,permission:.15,freshness:.05,usage:.1}),OS=Object.freeze(["profile_changed","tool_contract_changed","workspace_extension_changed","authorization_changed","ranking_signal_changed","cursor_integrity_key_rotated"]),yn={core:0,standard:1,full:2,internal:3},Sn=Object.freeze(["core","standard","full"]),RS=new Set(["core","standard","full","custom"]),Tn=new Set(ee.map(({family:e})=>e)),PS=xS(32);function Ie(e,t){if(typeof e!="string")throw new S(`pm tool discovery ${t} must be a string of at most 4096 Unicode characters.`,64);let r=e[Symbol.iterator](),n=0;for(let o=r.next();!o.done;o=r.next())if(n+=1,n>4096)throw new S(`pm tool discovery ${t} must be a string of at most 4096 Unicode characters.`,64);return e}function En(e){if(!Number.isInteger(e)||Number(e)<1||Number(e)>100)throw new S("pm tool discovery limit must be from 1 through 100.",64);return Number(e)}function An(e){if(e!=="unbounded"&&(!Number.isInteger(e)||Number(e)<128))throw new S("pm tool discovery outputBudget must be unbounded or an integer of at least 128.",64);return e==="unbounded"?e:Number(e)}function xn(e){if(e!==void 0&&typeof e!="boolean")throw new S("pm tool discovery includeSchema must be a boolean.",64);return e===!0}function bn(e){if(e===null||typeof e!="object"||Array.isArray(e))throw new S("pm tool discovery options must be an object.",64)}function MS(e){if(!Array.isArray(e))throw new S("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 S(`pm tool discovery candidate ${t} must be an object.`,64);if(typeof r.name!="string"||r.name.trim().length===0)throw new S(`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 S(`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 S(`pm tool discovery candidate ${t} inputSchema must be an object.`,64);if(r.authorized!==void 0&&typeof r.authorized!="boolean")throw new S(`pm tool discovery candidate ${t} authorized must be a boolean.`,64)}}function y1(e){if(bn(e),e.family!==void 0&&(typeof e.family!="string"||!Tn.has(e.family)))throw new S("pm tool discovery family must be a declared capability family.",64);if(e.tier!==void 0&&(typeof e.tier!="string"||!Sn.includes(e.tier)))throw new S("pm tool discovery tier must be core, standard, or full.",64);return{...e.query!==void 0?{query:Ie(e.query,"query")}:{},...e.family!==void 0?{family:e.family}:{},...e.tier!==void 0?{tier:e.tier}:{},...e.limit!==void 0?{limit:En(e.limit)}:{},...e.cursor!==void 0?{cursor:Ie(e.cursor,"cursor")}:{},...e.includeSchema!==void 0?{includeSchema:xn(e.includeSchema)}:{},...e.outputBudget!==void 0?{outputBudget:An(e.outputBudget)}:{}}}function IS(e){return e===void 0||!Number.isFinite(e)?0:Math.min(1,Math.max(0,e))}function le(e){return[...new Set(e.toLowerCase().match(/[a-z0-9]+/gu)??[])].sort()}function vS(e,t){let r=le(e);if(r.length===0)return 0;let n=new Set(le(t)),o=r.filter(s=>n.has(s)).length,i=t.toLowerCase().includes(e.toLowerCase())?.25:0;return Math.min(1,o/r.length+i)}function kS(e,t){let r=le(e);if(r.length===0)return 0;let n=t.toLowerCase(),o=le(t),i=r.filter(a=>o.some(c=>c.startsWith(a)||a.startsWith(c))).length,s=n.includes(e.toLowerCase())?.2:0;return Math.min(1,i/r.length+s)}function gn(e){return Cn("sha256").update(JSON.stringify(e)).digest("hex").slice(0,24)}function wn(e,t,r){return AS("sha256",r).update(JSON.stringify({version:1,fingerprint:e,offset:t})).digest("base64url")}function NS(e,t,r){let n={version:1,offset:t,signature:wn(e,t,r)};return Buffer.from(JSON.stringify(n),"utf8").toString("base64url")}function LS(e,t,r,n){if(e===void 0)return 0;try{let o=JSON.parse(Buffer.from(e,"base64url").toString("utf8")),i=o.offset;if(o.version!==1||typeof i!="number"||!Number.isInteger(i)||i<0||i>r||typeof o.signature!="string")throw new Error("cursor fields do not match the request");let s=Buffer.from(wn(t,i,n),"base64url"),a=Buffer.from(o.signature,"base64url");if(a.length!==s.length||!bS(a,s))throw new Error("cursor signature does not match the request");return i}catch(o){throw new S("Invalid or stale pm tool discovery cursor; restart discovery without cursor.",64,{reason:String(o)})}}function _t(e,t,r){return{value:IS(e),weight:t,available:r!=="unavailable",source:r}}function Me(e,t,r){return _t(e??t,r,e===void 0?"computed":"host")}function $S(e,t,r){let n=Object.hasOwn(fe,e.name)?fe[e.name]:"help",o=ze(n),i=`${e.name} ${e.description} ${n} ${o}`,s=vS(t,i),a=new Set(le(t)),c={lexical:_t(s,j.lexical,"computed"),semantic:Me(e.signals?.semantic,kS(t,i),j.semantic),graph:Me(e.signals?.graph,a.has(o)||a.has(n)?1:0,j.graph),permission:_t(1,j.permission,"authorization"),freshness:Me(e.signals?.freshness,1,j.freshness),usage:Me(e.signals?.usage,wS.includes(e.name)?1:0,j.usage)},d=Object.values(c).reduce((p,l)=>p+l.value*l.weight,0);return{name:e.name,description:e.description,command:n,tier:He(n),family:o,score:Number(d.toFixed(6)),signals:c,...r?{input_schema:structuredClone(e.inputSchema)}:{}}}function DS(e){if(e.cursorIntegrityKey!==void 0&&(!(e.cursorIntegrityKey instanceof Uint8Array)||e.cursorIntegrityKey.byteLength<32))throw new S("pm tool discovery cursorIntegrityKey must contain at least 32 bytes.",64);if(e.tier!==void 0&&(typeof e.tier!="string"||!Sn.includes(e.tier)))throw new S("pm tool discovery tier must be core, standard, or full.",64);if(e.family!==void 0&&(typeof e.family!="string"||!Tn.has(e.family)))throw new S("pm tool discovery family must be a declared capability family.",64);if(e.profile!==void 0&&(typeof e.profile!="string"||!RS.has(e.profile)))throw new S("pm tool discovery profile must be core, standard, full, or custom.",64)}function FS(e){let r=Ie(e.query===void 0?"":e.query,"query").trim().replace(/\s+/gu," ");Ie(e.cursor===void 0?"":e.cursor,"cursor");let n=En(e.limit===void 0?10:e.limit),o=An(e.outputBudget===void 0?1200:e.outputBudget);return DS(e),{query:r,includeSchema:xn(e.includeSchema),limit:n,budget:o,maximumTier:yn[e.tier??"full"],profile:e.profile===void 0?"core":e.profile}}function On(e,t,r){let n=r??e.tools.reduce((s,a,c)=>s+(c===0?0:1)+Buffer.byteLength(JSON.stringify(a),"utf8"),0),o={...e,tools:[]},i=0;for(let s=0;s<4;s+=1){let a=Buffer.byteLength(JSON.stringify({...o,token_cost:{estimated_tokens:i,budget:t,within_budget:!0}}),"utf8"),c=Math.ceil((a+n)/4);if(c===i)break;i=c}return i}function GS(e,t,r){return e.filter(n=>n.authorized!==!1).map(n=>$S(n,r.query,r.includeSchema)).filter(n=>n.tier!=="internal"&&yn[n.tier]<=r.maximumTier&&(t.family===void 0||n.family===t.family)).sort((n,o)=>o.score-n.score||(n.name<o.name?-1:n.name>o.name?1:0))}function US(e,t,r){if(t==="unbounded")return[...e];let n=[],o=0;for(let[i,s]of e.entries()){let a=o+(i===0?0:1)+Buffer.byteLength(JSON.stringify(s),"utf8");if(On(r(i+1),t,a)>t)break;n.push(s),o=a}return n}function S1(e,t={}){MS(e),bn(t);let r=FS(t),n=t.cursorIntegrityKey??PS,o=GS(e,t,r),i=gn({query:r.query,family:t.family??null,tier:t.tier??"full",includeSchema:r.includeSchema,profile:r.profile,ranked:o}),s=LS(t.cursor,i,o.length,n),a=o.slice(s,s+r.limit),c=[];r.includeSchema||c.push({name:"input_schema",reason:"compact_projection",restore_with:"Set includeSchema=true."}),s+r.limit<o.length&&c.push({name:"tools",reason:"limit",restore_with:"Continue with next_cursor or increase limit."});let d={result_type:"pm_tool_discovery",contract_version:1,query:r.query,profile:r.profile,total:o.length,ranking_policy:{version:1,formula:"weighted_sum_then_name",weights:j},cache:{key:gn({fingerprint:i,cursorIntegrityKey:Cn("sha256").update(n).digest("hex"),limit:r.limit,offset:s,budget:r.budget}),ttl_ms:3e4,scope:"private",invalidates_on:OS}},p=(_,y=_.length)=>{let E=s+y,B=E<o.length,O=[...c];return y<a.length&&O.push({name:"tools",reason:"token_budget",restore_with:"Continue with next_cursor or increase outputBudget."}),{...d,tools:[..._],returned:y,has_more:B,...B?{next_cursor:NS(i,E,n)}:{},omission_receipt:{has_omissions:O.length>0,omitted:O}}},l=_=>{let y=p(_),E=On(y,r.budget);return{...y,token_cost:{estimated_tokens:E,budget:r.budget,within_budget:r.budget==="unbounded"||E<=r.budget}}},f=US(a,r.budget,_=>p([],_)),g=l(f);if(a.length>0&&f.length===0){let _=l([a[0]]).token_cost.estimated_tokens;throw new S(`pm tool discovery outputBudget is too small to return a tool; increase it to at least ${_}.`,64,{required:String(_)})}if(r.budget!=="unbounded"&&g.token_cost.estimated_tokens>r.budget)throw new S(`pm tool discovery outputBudget is too small; at least ${g.token_cost.estimated_tokens} estimated tokens are required for this page.`,64,{required:String(g.token_cost.estimated_tokens)});return g}export{IR as ACTIONABILITY_ORDERING_KINDS,rd as ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS,dc as ACTIVITY_FLAG_CONTRACTS,ti as AGENT_PROVENANCE_DIMENSIONS,Vs as AGGREGATE_FLAG_CONTRACTS,ka as APPEND_FLAG_CONTRACTS,rv as ASSURANCE_ACTIONS,nv as ASSURANCE_DECLARATION_KINDS,mM as ASSURANCE_DOCUMENT_VERSION,Za as ASSURANCE_FLAG_CONTRACTS,fM as ASSURANCE_GATE_TRIGGERS,_M as ASSURANCE_MEASUREMENT_SOURCE_KINDS,sI as ASSURANCE_PRESET_IDS,dM as AssuranceEvaluationRefusalError,cM as AssuranceMutationRefusalError,pM as AssuranceSourceResolutionError,Uo as BASELINE_ITEM_FORMAT_VERSION,lP as BOUNDARY_FIXTURE_CAPTURE_SOURCES,pR as BRIEF_LIST_FIELDS,ni as BUILTIN_AGENT_PROVENANCE_ADAPTERS,W as BUILTIN_CORPUS_SHAPES,ri as BUILTIN_HARNESS_SIGNAL_DESCRIPTORS,po as BUILTIN_ITEM_TYPE_VALUES,Vt as BUILTIN_PROFILES,Bx as BUILTIN_RELATIONSHIP_KINDS,Zc as CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS,cc as CALENDAR_FLAG_CONTRACTS,Na as CLAIM_FLAG_CONTRACTS,Kd as CLOSE_ACTION_OPTION_KEYS,Ia as CLOSE_FLAG_CONTRACTS,va as CLOSE_MANY_FLAG_CONTRACTS,Ua as CLOSE_TASK_FLAG_CONTRACTS,Ao as COMMAND_SHELL_ENV,Ks as COMMENTS_FLAG_CONTRACTS,AT as COMMON_MUTATION_COMMAND_OPTION_KEYS,Tc as COMPLETION_FLAG_CONTRACTS,ho as CONFIDENCE_TEXT_VALUES,ca as CONFIG_FLAG_CONTRACTS,ed as CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS,jv as CONTEXT_EVALUATION_METRIC_NAMES,lc as CONTEXT_FLAG_CONTRACTS,sx as CONTEXT_INTENT_LIMIT_OVERRIDE_WARNING,qt as CONTEXT_OUTPUT_VALUES,Vv as CONTEXT_PACKING_PROFILES,kv as CONTEXT_RECENCY_EPOCH,Dv as CONTEXT_RELEVANCE_SERVICE,Lv as CONTEXT_RELEVANCE_SIGNAL_NAMES,Yv as CONTEXT_SIGNAL_SET_VERSION,Wv as CONTEXT_SIGNAL_STORE_FORMAT_VERSION,Xv as CONTEXT_SIGNAL_STORE_WARNING_DETAILS,YA as CONTEXT_USAGE_LIMITS,Sc as CONTRACTS_FLAG_CONTRACTS,oc as COPY_FLAG_CONTRACTS,Sd as CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,Ed as CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,Td as CREATE_COMMANDER_STRING_OPTION_CONTRACTS,HS as CREATE_DIRECT_CLOSE_REASON_DEFAULT,ec as CREATE_FLAG_CONTRACTS,cE as CURRENT_HISTORY_HASH_ALGORITHM,Rx as CURRENT_HISTORY_ITEM_HASH_VERSION,Mx as CURRENT_HISTORY_RECORD_HASH_VERSION,jo as CURRENT_ITEM_FORMAT_VERSION,ek as ContextSignalStore,XA as ContextUsageValidationError,wv as DEFAULT_AUTHOR_IDENTITY_VOCABULARY,gk as DEFAULT_CHILD_SAMPLE_LIMIT,dR as DEFAULT_COMPACT_LIST_FIELDS,Vw as DEFAULT_DERIVED_INDEX_MINIMUM_ITEMS,$f as DEFAULT_EVAL_QUERIES_RELATIVE_PATH,rI as DEFAULT_RELATIONSHIP_CONTEXT_TOKEN_BUDGET,gv as DEFAULT_TERMINAL_TRANSITION_POLICY,ok as DEFAULT_WORKSPACE_MEMORY_MINIMUM_ITEMS,gP as DEFECT_ESCAPE_CLASSES,CP as DEFECT_GATE_EVIDENCE_DISPOSITIONS,$a as DELETE_FLAG_CONTRACTS,mo as DEPENDENCY_KIND_VALUES,fc as DEPS_FLAG_CONTRACTS,Js as DOCS_FLAG_CONTRACTS,Xa as DUPLICATES_FLAG_CONTRACTS,NI as DURABLE_MERGE_RECEIPT_INTRODUCED_AT,EP as DefectRecurrencePolicyParseError,hc as EVAL_FLAG_CONTRACTS,Pf as EVAL_METRIC_NAMES,kf as EVAL_QUERY_SET_CONTRACT,Nf as EVAL_QUERY_SET_EXAMPLE,vf as EVAL_QUERY_SET_SCHEMA_ID,pc as EVENTS_FLAG_CONTRACTS,Ba as EVENT_FLAG_CONTRACTS,$n as EXECUTABLE_COMMAND_ALIASES,ue as EXIT_CODE,Sa as EXTENSION_ACTIVATE_FLAG_CONTRACTS,ya as EXTENSION_ADOPT_ALL_FLAG_CONTRACTS,Oa as EXTENSION_ADOPT_FLAG_CONTRACTS,Wk as EXTENSION_CAPABILITIES,qS as EXTENSION_CAPABILITY_CONTRACT,jS as EXTENSION_CAPABILITY_CONTRACT_VERSION,BS as EXTENSION_CAPABILITY_LEGACY_ALIASES,Vi as EXTENSION_CAPABILITY_REGISTRATION_SURFACES,wa as EXTENSION_CATALOG_FLAG_CONTRACTS,Ta as EXTENSION_DEACTIVATE_FLAG_CONTRACTS,Ca as EXTENSION_DESCRIBE_FLAG_CONTRACTS,ba as EXTENSION_DOCTOR_FLAG_CONTRACTS,ha as EXTENSION_EXPLORE_FLAG_CONTRACTS,da as EXTENSION_FLAG_CONTRACTS,la as EXTENSION_INIT_FLAG_CONTRACTS,fa as EXTENSION_INSTALL_FLAG_CONTRACTS,ga as EXTENSION_INVENTORY_FLAG_CONTRACTS,Aa as EXTENSION_MANAGE_FLAG_CONTRACTS,Ea as EXTENSION_MIGRATE_FLAG_CONTRACTS,Yk as EXTENSION_POLICY_MODES,Xk as EXTENSION_POLICY_SURFACES,xa as EXTENSION_RELOAD_FLAG_CONTRACTS,Qk as EXTENSION_SANDBOX_PROFILES,pa as EXTENSION_SCOPE_FLAG_CONTRACTS,Jk as EXTENSION_TRUST_MODES,_a as EXTENSION_UNINSTALL_FLAG_CONTRACTS,NP as EXTERNAL_DEPENDENCY_RESOLUTION_STATUSES,vP as EXTERNAL_DEPENDENCY_SOURCE_KIND,kP as EXTERNAL_DEPENDENCY_SOURCE_KIND_ALIAS,EO as ExtensionCommandError,Xs as FILES_FLAG_CONTRACTS,ic as FOCUS_FLAG_CONTRACTS,Wa as GC_FLAG_CONTRACTS,fR as GET_DEPTH_INPUT_VALUES,mR as GET_DEPTH_VALUES,uc as GET_FLAG_CONTRACTS,zs as GLOBAL_FLAG_CONTRACTS,du as GRAPH_DURABLE_CACHE_MIN_ITEMS,cu as GRAPH_DURABLE_CACHE_VERSION,_c as GRAPH_FLAG_CONTRACTS,cR as GRAPH_QUERY_DEFAULTS,Ne as GRAPH_SUBCOMMAND_VALUES,mc as GUIDE_FLAG_CONTRACTS,Ja as HEALTH_FLAG_CONTRACTS,ra as HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS,QM as HISTORY_AUTHOR_ATTRIBUTION_BASELINE,cv as HISTORY_COMPACT_BULK_DEFAULT_MIN_ENTRIES,na as HISTORY_COMPACT_FLAG_CONTRACTS,gi as HISTORY_EVENT_CLASSIFICATION_VERSION,Qs as HISTORY_FLAG_CONTRACTS,sE as HISTORY_HASH_ALGORITHMS,Nw as HISTORY_ITEM_HASH_VERSION_3_INTRODUCED_IN,ea as HISTORY_REDACT_FLAG_CONTRACTS,ta as HISTORY_REPAIR_FLAG_CONTRACTS,Hp as INIT_AGENT_GUIDANCE_MODE_VALUES,aa as INIT_FLAG_CONTRACTS,Ra as INSTALL_FLAG_CONTRACTS,hI as IN_PROGRESS_WORK_DETAIL_LIMIT,_o as ISSUE_SEVERITY_VALUES,rc as ITEM_COMPLETE_FLAG_CONTRACTS,bI as ITEM_LATEST_TIMESTAMP_FIELDS,zS as ITEM_METADATA_KEY_ORDER,tc as ITEM_MUTATE_FLAG_CONTRACTS,nc as ITEM_REOPEN_FLAG_CONTRACTS,wc as ITEM_REVISION_CONFLICT_CHANGE_LIMIT,bc as ITEM_REVISION_CONFLICT_CODE,CI as ITEM_SCALAR_MISSING_VALUE,lo as ITEM_TYPE_VALUES,xI as ITEM_UNION_COLLECTION_FIELDS,Zv as JsonFileContextSignalStoreAdapter,Ys as LEARNINGS_FLAG_CONTRACTS,aE as LEGACY_HISTORY_HASH_ALGORITHM,ul as LINKED_ARTIFACT_NOTE_CONFLICT_MODES,Yu as LINKED_TEST_ENV_NAME_PATTERN,Xu as LINKED_TEST_PM_CONTEXT_MODE_VALUES,Wu as LINKED_TEST_PROTECTED_ENV_KEYS,Ju as LINKED_TEST_WORKSPACE_CONTEXT_MODE_VALUES,Jc as LIST_COMMANDER_STRING_OPTION_CONTRACTS,lR as LIST_COMMAND_DEFAULT_PROJECTIONS,eN as LIST_FILTER_EXTENSION_FLAG_DEFINITIONS,Hs as LIST_FILTER_FLAG_CONTRACTS,BP as LIST_SORT_FIELDS,qP as LIST_SORT_ORDER_VALUES,Ci as MAINTENANCE_HISTORY_OPERATIONS,hk as MAX_CHILD_PROJECTION_ITEMS,uP as MAX_WAIVER_NOTICE_DAYS,JS as MAX_WORKFLOW_POLICIES,QS as MAX_WORKFLOW_POLICY_TERMS,ja as MEET_FLAG_CONTRACTS,Dk as MERGE_DRIVER_ARTIFACT_VALUES,Zs as MERGE_FLAG_CONTRACTS,Le as MERGE_SUBCOMMAND_VALUES,Uk as MUTATION_EVENT_WIRE_BUDGET,ie as MemoryRelationshipGraphAdapter,td as NEXT_COMMANDER_STRING_OPTION_CONTRACTS,Cc as NEXT_FLAG_CONTRACTS,Jm as NEXT_OUTPUT_VALUES,bv as NEXT_RANKING_POLICIES,Ws as NOTES_FLAG_CONTRACTS,KR as OutputEnvelopeFitError,ua as PACKAGE_FLAG_CONTRACTS,ma as PACKAGE_INIT_FLAG_CONTRACTS,Ga as PAUSE_TASK_FLAG_CONTRACTS,Vd as PLAN_CREATE_METADATA_PARAMETER_KEYS,sa as PLAN_FLAG_CONTRACTS,Us as PLAN_SHOW_DEPTH_VALUES,Ke as PLAN_SUBCOMMANDS,cf as PLAN_TEMPLATE_NAMES,ky as PM_AGENT_TASK_ACCOUNTING_MODES,pt as PM_AGENT_TASK_TRANSCRIPT_VERSION,vn as PM_BULK_LIFECYCLE_COMMAND_ALIASES,ps as PM_CLI_ERROR_DETAILS_LIMITS,hs as PM_CLI_EXPECTED_ERROR_NAME,TR as PM_CLI_GRAMMAR_CONTRACT,hR as PM_CLI_GRAMMAR_NOUNS,Yn as PM_CLI_ONLY_TOOL_ACTION_WAIVERS,gR as PM_CLI_SHARED_VERBS,Ln as PM_COMMAND_ALIAS_CONTRACTS,ee as PM_COMMAND_CAPABILITY_CONTRACTS,Pt as PM_COMMAND_DESTINATION_CONTRACTS,nM as PM_COMMAND_EXIT_CONTRACTS,rM as PM_COMMAND_EXIT_OUTCOME_CONTRACTS,Mi as PM_COMMAND_OUTPUT_BUDGET_CONTRACTS,ZP as PM_COMMAND_OUTPUT_ENVELOPE_CONTRACTS,je as PM_COMMAND_POSITIONAL_CONTRACTS,fp as PM_COMMAND_VISIBILITY_CONTRACTS,VM as PM_COMPLETE_LIST_FINDING_CODES,GR as PM_CONTEXT_INTENTS_FILE,ax as PM_CONTEXT_INTENT_CONTRACTS,In as PM_CONTEXT_OPS_COMMAND_ALIASES,Hn as PM_CORE_COMMAND_NAMES,F as PM_CORPUS_SHAPE_SCHEMA,Jn as PM_DEPRECATED_TOOL_ACTIONS,bi as PM_DIAGNOSTIC_DEGRADATION_STEPS,wi as PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS,xi as PM_DIAGNOSTIC_OUTPUT_CLASSES,Qn as PM_DISCOVERABLE_TOOL_ACTIONS,Yr as PM_EPISODE_SCHEMA,JP as PM_ERROR_CODE_CATALOG,KP as PM_ERROR_CODE_EXIT_CLASS_CONTRACTS,tn as PM_EXACT_COVERAGE_METRICS,Gn as PM_EXTENSION_CAPABILITY_CONTRACTS,Vn as PM_EXTENSION_PACKAGE_ACTION_SUBCOMMANDS,jn as PM_EXTENSION_POLICY_MODE_CONTRACTS,zn as PM_EXTENSION_POLICY_SURFACE_CONTRACTS,qn as PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS,Un as PM_EXTENSION_SERVICE_NAME_CONTRACTS,Bn as PM_EXTENSION_TRUST_MODE_CONTRACTS,$i as PM_GENERIC_REFUSAL_GUIDANCE,DM as PM_GITATTRIBUTES_END,$M as PM_GITATTRIBUTES_START,GM as PM_GITATTRIBUTES_V2_END,FM as PM_GITATTRIBUTES_V2_START,Ep as PM_GITIGNORE_END,Tp as PM_GITIGNORE_START,uv as PM_HISTORY_ATTESTATION_CONTRACT,Mn as PM_HISTORY_COMMAND_ALIASES,eE as PM_HISTORY_OPERATION_ALIASES,rE as PM_HISTORY_OPERATION_CONTRACT,tE as PM_HISTORY_OPERATION_PATTERNS,Wn as PM_ITEM_ACTION_SUBCOMMANDS,QT as PM_ITEM_HISTORY_OPERATIONS,nt as PM_MCP_APPS_EXTENSION,vr as PM_MCP_APPS_SERVER_CAPABILITY,Ae as PM_MCP_APPS_SPEC_VERSION,Lr as PM_MCP_APP_CONTRACTS,Nr as PM_MCP_APP_MIME_TYPE,wS as PM_MCP_ENTRY_TOOL_NAMES,m as PM_MCP_ERROR_CODES,_L as PM_MCP_HTTP_PROTOCOL_VERSION,Yg as PM_MCP_INPUT_REQUEST_METHODS,or as PM_MCP_LEGACY_PROTOCOL_VERSIONS,nr as PM_MCP_LOG_LEVELS,x as PM_MCP_META_KEYS,g1 as PM_MCP_PROGRESSIVE_DISCOVERY_EXTENSION,C1 as PM_MCP_PROGRESSIVE_DISCOVERY_SERVER_CAPABILITY,yp as PM_MCP_PROMPT_CONTRACTS,z as PM_MCP_PROTOCOL_VERSION,Cp as PM_MCP_RESOURCE_CONTRACTS,it as PM_MCP_SKILLS_DRAFT_REVISION,$r as PM_MCP_SKILLS_EXTENSION,ty as PM_MCP_SKILLS_SERVER_CAPABILITY,P as PM_MCP_SKILL_LIMITS,Te as PM_MCP_SUBSCRIPTION_ID_META_KEY,te as PM_MCP_SUPPORTED_PROTOCOL_VERSIONS,aL as PM_MCP_TASKS_EXTENSION,sC as PM_MCP_TASK_STATUSES,fe as PM_MCP_TOOL_COMMAND_CONTRACTS,BE as PM_MODE_PAIRED_OUTPUT_PROJECTION_CONTRACTS,Ss as PM_MUTATION_ACTION_CONTRACTS,ve as PM_NAMESPACED_COMMAND_ALIASES,Kr as PM_OBSERVATION_SCHEMA,Ai as PM_OUTPUT_BUDGET_CLASSES,Ei as PM_OUTPUT_DEGRADATION_STEPS,Nt as PM_OUTPUT_ENVELOPE_KINDS,Gt as PM_PACKAGE_CONVENTIONAL_RESOURCE_ROOTS,Kn as PM_PACKAGE_ONLY_ACTION_SUBCOMMANDS,Ft as PM_PACKAGE_RESOURCE_KINDS,Ue as PM_POSITIONAL_ACTION_CONTRACTS,ep as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA,Qd as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION,yA as PM_READ_OUTPUT_COMPOSITION_OPTION_FLAGS,$A as PM_READ_OUTPUT_CONTINUATION_FINGERPRINT_POLICIES,gA as PM_READ_OUTPUT_DIMENSIONS,CA as PM_READ_OUTPUT_OPTION_FLAGS,uA as PM_READ_OUTPUT_SESSION_MAX_SEEN_ITEM_IDS,lA as PM_READ_OUTPUT_SESSION_MIN_TOKENS,FE as PM_READ_OUTPUT_SURFACES,SA as PM_READ_OUTPUT_SURFACE_CONTRACTS,cA as PM_READ_OUTPUT_TAIL_RETENTION_POLICIES,jE as PM_READ_ROW_CONTRACTS,UE as PM_READ_ROW_JQ_SELECTOR,Ui as PM_RECOVERY_ECHO_FIELDS,iD as PM_RECOVERY_REFERENCE_FIELDS,ce as PM_RECOVERY_REFERENCE_KINDS,nS as PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE,un as PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE_V2,uD as PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE,ln as PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE_V2,kn as PM_RELOCATED_COMMAND_ALIASES,hd as PM_REPRODUCIBLE_PROCESS_ENV,oM as PM_SUCCESS_EXIT_CODES,Xn as PM_TOOL_ACTIONS,Wd as PM_TOOL_ACTION_PARAMETER_CONTRACTS,Zd as PM_TOOL_PARAMETERS_SCHEMA,Jd as PM_TOOL_PARAMETERS_SCHEMA_MAJOR,Xd as PM_TOOL_PARAMETERS_SCHEMA_VERSION,zd as PM_TOOL_RESERVED_CUSTOM_FIELD_PROPERTIES,Wr as PM_VERDICT_SCHEMA,ZT as PM_WORKSPACE_HISTORY_OPERATIONS,Hr as PM_WORKSPACE_RECIPE_SCHEMA,ia as PROFILE_FLAG_CONTRACTS,Zt as PROFILE_LINT_CODES,Qt as PROFILE_LINT_DIMENSIONS,Ht as PROFILE_NAMES,We as PROFILE_SUBCOMMANDS,S as PmCliError,_e as PmClient,KM as PmCompleteListValidationError,C as PmMcpAuthorizationError,ir as PmMcpInputRequiredError,Or as PmMcpIssuerCredentialStore,u as PmMcpProtocolError,sr as PmMcpRequestStateReplayGuard,Br as PmMcpSkillRegistry,gr as PmMcpSubscriptionRegistry,tt as PmMcpTaskStore,WA as QUERY_CURSOR_CONTRACT,AA as READ_OUTPUT_MUTATION_CONFLICT_CODE,xA as READ_OUTPUT_SHAPING_CONTROL_FLAGS,EA as READ_OUTPUT_SURFACE_UNSUPPORTED_CODE,Ma as REINDEX_FLAG_CONTRACTS,ww as REINDEX_LOCK_ID,dt as RELATIONSHIP_GRAPH_SNAPSHOT_VERSION,Da as RELEASE_FLAG_CONTRACTS,qa as REMIND_FLAG_CONTRACTS,bt as RESERVED_ITEM_FIELD_NAMES,La as RESTORE_FLAG_CONTRACTS,fo as RISK_VALUES,YR as RelationshipEventLog,XR as RelationshipEventStore,q as RelationshipGraph,Ge as RelationshipKindRegistry,oa as SCHEMA_FLAG_CONTRACTS,Qc as SEARCH_COMMANDER_STRING_OPTION_CONTRACTS,tN as SEARCH_EXTENSION_FLAG_DEFINITIONS,yc as SEARCH_FLAG_CONTRACTS,As as SECRET_GUARD_RULE_CATEGORIES,_m as SEMANTIC_ATTRIBUTION_LIMITS,KS as SETTINGS_DEFAULTS,jf as SNAPSHOT_SCHEMA,kM as SOURCE_CONTEXT_ACCESS_ENV,NM as SOURCE_CONTEXT_WRITE_OVERRIDE_ENV,Zm as STALE_CLAIM_TAKEOVER_REFUSED_CODE,Ns as STALE_WORK_THRESHOLD_SETTING,Sm as START_BLOCKED_REFUSAL_CODE,ym as START_BLOCKER_ENFORCEMENT_DEFAULT,Fa as START_TASK_FLAG_CONTRACTS,Ya as STATS_FLAG_CONTRACTS,uo as STATUS_VALUES,qs as SUBCOMMAND_GLOBAL_FLAG_CONTRACTS,yi as SUBSTANTIVE_HISTORY_OPERATIONS,Px as SUPPORTED_HISTORY_ITEM_HASH_VERSIONS,Ix as SUPPORTED_HISTORY_RECORD_HASH_VERSIONS,LE as SUPPRESS_HOST_OUTPUT_MARKER,Va as TELEMETRY_FLAG_CONTRACTS,__ as TELEMETRY_SUBCOMMANDS,Ha as TEST_ALL_FLAG_CONTRACTS,za as TEST_FLAG_CONTRACTS,Ka as TEST_RUNS_FLAG_CONTRACTS,p_ as TEST_RUN_MEASUREMENT_LIMIT,Ud as TOOL_ACTIVITY_OPTION_CONTRACTS,Rd as TOOL_AGGREGATE_OPTION_CONTRACTS,$d as TOOL_BULK_MUTATION_FILTER_OPTION_CONTRACT_SOURCE,Gd as TOOL_CALENDAR_OPTION_CONTRACTS,Fd as TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS,jd as TOOL_CONTEXT_OPTION_CONTRACTS,kd as TOOL_CREATE_OPTION_CONTRACTS,vd as TOOL_CREATE_OPTION_CONTRACT_SOURCE,Bd as TOOL_DEPS_OPTION_CONTRACTS,qd as TOOL_GRAPH_OPTION_CONTRACTS,Od as TOOL_LIST_FILTER_OPTION_CONTRACTS,Pd as TOOL_SEARCH_FILTER_OPTION_CONTRACTS,Id as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS,Md as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACT_SOURCE,Dd as TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS,Ld as TOOL_UPDATE_OPTION_CONTRACTS,Nd as TOOL_UPDATE_OPTION_CONTRACT_SOURCE,VS as TYPE_TO_FOLDER,XT as UNKNOWN_SUBCOMMAND_COMPATIBILITY_CODES,DO as UNPROVEN_ACTIVITY_REASONS,Ad as UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,bd as UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,xd as UPDATE_COMMANDER_STRING_OPTION_CONTRACTS,sc as UPDATE_FLAG_CONTRACTS,ac as UPDATE_MANY_FLAG_CONTRACTS,Pa as UPGRADE_FLAG_CONTRACTS,Io as URL_CREDENTIAL_PLACEHOLDER,Qa as VALIDATE_FLAG_CONTRACTS,XS as WORKFLOW_POLICY_ACTIONS,BM as WORKFLOW_POLICY_DOCUMENT_SCHEMA,jM as WORKFLOW_POLICY_SCHEMA,gc as WORKSPACE_FLAG_CONTRACTS,Hb as WORKSPACE_HISTORY_ID,Bf as WORKSPACE_SNAPSHOT_ACTIONS,cl as WorkspaceGraphCache,tP as WorkspaceTransactionInterruptedError,Fu as _testOnly,_k as _testOnlyAggregateCommand,sl as _testOnlyConfigCommand,Tk as _testOnlyGetCommand,xu as _testOnlyHealthCommand,Yp as _testOnlyInit,Vp as _testOnlyInitAgentGuidance,hN as _testOnlyItemTransaction,zk as _testOnlyMutationEvents,uk as _testOnlyNextCommand,$k as _testOnlySearchCommand,oI as _testOnlySimilarity,mf as _testOnlyTemplates,Lu as _testOnlyValidateCommand,Kk as _testOnlyWorkspacePosition,CN as abandonItemTransaction,sP as abandonWorkspaceTransaction,pI as acceptAssuranceProposals,ku as acknowledgeLinkedTests,nl as acknowledgeUnknownAuthorHistoryEvents,rl as acknowledgeUnknownAuthorHistoryEventsFromTransport,Kw as acquireItemMetadataDerivedIndexLock,Fe as acquireLock,ei as acquireLockLease,YN as activateExtensionForTest,lb as activateExtensions,Em as admitStartWithOpenBlockers,Zo as agentSessionEnvironment,hh as aggregate,Zf as analyzeAgentProvenanceDescriptorCoverage,SP as analyzeDefectChangeRisk,tv as analyzeDefectRecurrenceCoverage,Ll as analyzeDuplicateItems,QR as analyzeGraphImpact,op as analyzeHierarchyIntegrity,ZR as analyzeKnowledgeGraph,sM as analyzePmCommandExitConformance,Zn as analyzePmToolActionParity,BI as analyzeReconciliationDiscard,JR as analyzeRelationshipExecution,eu as analyzeRelationshipSchedule,jg as analyzeSdkActionCoverage,It as analyzeSdkCliParameterCompleteness,bA as annotationPositionalMutationOptions,Rh as append,qi as appendHistoryEntry,Yb as appendWorkspaceAuditEvent,Wb as appendWorkspaceHistoryChange,dT as applyAcceptanceCriteriaMutations,cI as applyAssurancePreset,zc as applyBootstrapPagerPolicy,XI as applyClosureTimestampFix,ux as applyContextIntentProjection,Xm as applyContextTagProjection,zP as applyFilterValueEcho,Mw as applyHistoryPatch,_d as applyInvocationAuthorOverride,Tl as applyPathMigrations,vA as applyReadOutputDimensions,RA as applyReadOutputIncludeModes,fA as applyReadOutputSessionReferences,eb as applyRegisteredItemFieldDefaultsAndValidation,bl as applyStandaloneNote,Dc as applyStoredExtensionMigrationState,lT as applyTagRemovals,Tv as applyTerminalOrderingPolicy,wl as artifactKey,FT as asRecordClone,DT as asRecordOrNull,qe as assembleWorkspaceRelationshipGraph,JM as assertCompleteListResult,P0 as assertExtensionBlueprint,R0 as assertExtensionCapabilityUsage,p0 as assertExtensionDeactivated,v0 as assertExtensionManifestCompatible,I0 as assertExtensionManifestMatchesBlueprint,k0 as assertExtensionPreflight,ap as assertHierarchyMutationAllowed,dv as assertHistoryCompactTarget,zI as assertHistoryRepairTarget,is as assertInitializedTracker,El as assertLinkedArtifactMutationIsUnambiguous,F0 as assertMcpClientCapabilities,D0 as assertMcpProtocolHeader,vy as assertMemoryRelationshipGraphAdapterConformance,fT as assertNoUnknownCsvKeys,Vu as assertNonHierarchyCardinalityMutationAllowed,l0 as assertPackageManifest,ow as assertParentReferenceIsNotSelf,HL as assertPmMcpSkillsCapability,M0 as assertProjectProfile,Bw as assertProjectRuntimeCompatibility,Fw as assertProjectRuntimeFormatGuard,qE as assertProjectionModeChoice,os as assertReadableTrackerRoot,u0 as assertRegisteredCommandContract,E0 as assertRegisteredCommandOverride,C0 as assertRegisteredExporter,m0 as assertRegisteredFlags,f0 as assertRegisteredHook,g0 as assertRegisteredImporter,y0 as assertRegisteredItemField,S0 as assertRegisteredItemType,O0 as assertRegisteredMigration,A0 as assertRegisteredParserOverride,x0 as assertRegisteredPreflightOverride,T0 as assertRegisteredProfile,b0 as assertRegisteredRendererOverride,_0 as assertRegisteredSearchProvider,w0 as assertRegisteredServiceOverride,h0 as assertRegisteredVectorStoreAdapter,Vx as assertRelationshipEdgeAllowed,on as assertRelationshipGraphAdapterConformance,aT as assertSchemaPreviewSupported,C_ as assertTestMeasurementRun,Ax as assertWellFormedOutputText,hM as assuranceAssertionUpdateIsLoosening,_x as attachContextIntentReceipt,JA as attachContextUsageServingReceipt,Pu as attachLinkedTestMutationProvenance,Ru as attachLinkedTestProvenance,Xe as attachMcpServerInfo,YE as attachOutputOmissionReceipt,gx as attachOutputTokenAccounting,hx as attachReadOutputContracts,_A as attachReadOutputSessionReceipt,Pp as auditMergeAttributeFence,UM as auditMergeDriverConfiguration,su as auditWorkspaceRelationshipGraph,ML as authorizeMcpHttpRequest,Jo as boundAgentEpisodeIdentity,oA as boundReadOutputRows,Vm as buildChildrenByParent,Mk as buildCompactSearchFilterSummary,HP as buildContentFilterEcho,Qv as buildContextSignalSnapshot,Sy as buildCorpusShapeItemPlan,yP as buildDefectRecurrenceIndex,Gp as buildExtensionDescribeResult,jp as buildExtensionInstallPlan,VP as buildGovernanceMissingFilterEcho,Eu as buildInProgressSweepCommands,gI as buildInProgressWorkHealthSummary,fw as buildInvalidTypeError,Ck as buildItemChildrenRollup,fN as buildItemCompletionMutations,$v as buildItemContextRelevanceCandidates,Zw as buildItemNotFoundError,Sk as buildItemSchedule,JI as buildLinkedFileRepairReport,TL as buildMcpAuthorizationDiscoveryUrls,Hg as buildMcpCompleteResult,U0 as buildMcpDiscoverResult,wL as buildMcpDynamicRegistrationMetadata,mL as buildMcpHttpRequestHeaders,W0 as buildMcpInputRequiredResult,SL as buildMcpProtectedResourceMetadata,Op as buildMergeAttributePatterns,Yd as buildPmActionToolInputSchema,_D as buildPmRefusalClosureCensus,nI as buildRelationshipContext,oO as buildSearchCorpus,sO as buildSemanticCorpusInput,KI as buildStatusRoleWarnings,ns as buildTrackerInitializationRecovery,lO as buildVectorizationEmbeddingIdentity,uO as buildVectorizationEmbeddingMetadata,Ik as buildVerboseSearchFilters,qM as buildWorkflowCompletenessCheck,ik as buildWorkspaceMemorySnapshot,Rm as callerClaimEndedByClose,Xo as canonicalDocument,xT as canonicalizeCommandOptionKey,IN as canonicalizeCommandSuggestions,Nv as canonicalizeContextRecencyCoordinate,qx as canonicalizeRelationshipKind,sD as censusPmRecoveryReferenceProducers,XM as certifyCompleteListResult,KN as checkExtensionManifestCompatibility,lg as claim,ug as claimNext,ZM as classifyHistoryAuthorEvent,Si as classifyHistoryEvent,UI as classifyHistoryMergeReceiptReferences,nb as classifyHostEnvironmentFault,kk as classifyImplicitSemanticFallbackReason,zo as classifyItemFormatVersion,S_ as classifyLinkedTestCommandSafety,T_ as classifyLinkedTestFailure,Rb as clearActiveExtensionHooks,fu as clearDurableGraphCache,AE as clearFocusedItem,O_ as clearWorkspaceContractsCache,pg as close,ju as closeItem,Sg as closeTask,Kc as coalesceRepeatedListFlags,vR as collectBlockedByIds,NR as collectBlockedByIdsFromCorpus,ZA as collectContextUsageDeliveredItemIds,lp as collectDanglingDependencyReferences,$R as collectDependencyBlockedIds,dp as collectDuplicateDependencyRows,iu as collectDuplicateRelationshipEdgeGroups,vk as collectErrorCauseCodes,np as collectHierarchyRelations,Ar as collectMcpHeaderAnnotations,up as collectMissingDependencyTargetIds,Hu as collectNewOrderingCycleWarnings,ru as collectOrderingCycles,pp as collectOrderingStorageContradictions,BR as collectPackageContextIntentContracts,jt as collectPackageExtensionDirectories,Qx as collectRegisteredItemFieldNames,_E as collectRuntimeCreateFieldValues,_w as collectRuntimeFilterValues,hE as collectRuntimeUpdateFieldValues,jm as collectSubtreeIds,Ki as collectUsedExtensionCapabilities,bT as commandOptionFlagLabel,yh as comments,Q_ as commitImportedItem,_N as commitItemCompletion,mN as commitItemMutations,nP as commitWorkspaceTransaction,Bs as compactFlagAliasContracts,Bm as compareCriticalItems,Lw as comparePmDateVersions,eP as compareRelationshipSnapshots,GT as compareTimestampStrings,Iv as compileHistoryProvenanceMatcher,px as composeContextIntentContracts,UN as composeExtension,VN as composeExtensionPackage,FR as computeActionabilityReport,Bb as computeHistoryDiff,Ql as computeRelationshipCentrality,Jl as computeRelationshipDominators,al as computeWorkspaceGraphFingerprint,Mh as config,Ob as consumeAfterCommandAffectedItems,ph as context,fx as contextIntentRowId,fg as copy,Ku as countFailureCategories,rA as countReadOutputRows,ag as create,aI as createAssurancePreset,ZI as createAssuranceWorkspaceContext,jT as createCheckpointId,WM as createCompleteListOptions,ub as createCoreCommandHookContext,en as createCorpusShapeMeasurement,TM as createEmptyAssuranceDocument,Jx as createEmptyExtensionRegistrationRegistry,AO as createExtensionCommandError,Nc as createExtensionCommandSdk,Hi as createExtensionContributionInventory,N0 as createExtensionTestHarness,Bi as createHistoryEntry,YO as createLazyModule,zM as createLifecycleCompletenessPolicies,IL as createMcpStaticBearerVerifier,cL as createMcpTaskStore,Qw as createMutationGuardSdk,zE as createOutputOmissionReceipt,Cs as createPmCliExpectedError,kc as createPmCliProgram,Ri as createPmCommandOutputBudget,jA as createQueryFingerprint,Iy as createRelationshipGraphScaleFixture,J as createRelationshipGraphSnapshot,xt as createRelationshipKindRegistry,Cd as createReproducibleProcessRunner,Rk as createSearchCursorFingerprint,mb as createSerialQueue,ST as createStdinTokenResolver,JT as createUnknownSubcommandError,sT as createWorkflowPolicyEvaluator,qf as createWorkspaceSnapshot,XN as deactivateExtensionForTest,bs as decideSecretGuardFinding,nF as declineServiceOverride,mx as decodeContextIntentCursor,WO as decodeHtmlEntitiesInOptions,Er as decodeMcpHttpHeaderValue,yx as decodePmTableRows,HA as decodeQueryCursor,qA as decodeQueryCursorEnvelope,zA as decodeQueryCursorState,GA as decodeReadOutputContinuationCursor,L0 as decodeToon,$L as decoratePmMcpToolsWithApps,Rl as dedupeLinkedArtifacts,Lb as defaultConfigScope,Fv as defaultScoreContextCandidates,dF as defineAfterCommandHook,aF as defineBeforeCommandHook,cF as defineBeforeMutationHook,HD as defineCommand,QD as defineCommandOverride,K as defineCorpusShape,t$ as defineEpisodeSpecification,sF as defineExporter,FN as defineExtension,GN as defineExtensionBlueprint,qD as defineExtensionManifest,VD as defineFlag,iF as defineImporter,WD as defineItemField,KD as defineItemType,YD as defineMigration,py as defineObservationContract,uF as defineOnIndexHook,lF as defineOnReadHook,pF as defineOnWriteHook,ZD as defineParserOverride,Pi as definePmCommandOutputBudget,QP as definePmCommandOutputEnvelope,WP as definePmErrorCodeCatalog,eF as definePreflightOverride,zD as defineProjectProfile,oF as defineRendererOverride,XD as defineSearchProvider,tF as defineServiceOverride,JD as defineVectorStoreAdapter,fy as defineVerdictContract,xe as defineWorkspaceRecipe,_g as deleteItem,Yf as deleteWorkspaceSnapshot,Kx as dependencyToRelationship,wh as deps,dI as deriveAssuranceProposals,WI as deriveClosureTimestamp,BN as deriveExtensionCapabilities,rN as deriveMutationTransactionId,aM as derivePmBulkMutationEffect,aD as derivePmRecoveryReferenceObligations,tu as deriveRelationshipDeadlines,kp as deriveSchemaEvolutionMigrationId,PO as deriveTelemetryCommandResolution,yw as describeAllowedTransitions,vM as describeExtensionActivation,qN as describeExtensionBlueprint,Go as describeFieldFlagSpellingDefect,WT as describeFlagScalarValueFailure,Om as describeItemOwnershipConflict,Mc as describeItemRevisionChanges,e$ as describeObservationCost,Xt as describeProfileComposition,Jt as describeProjectProfile,TN as describeReadCompletenessControls,xO as describeUnknownError,pi as detectAgentIdentity,fi as detectHarnessIdentity,Yl as detectRelationshipCommunities,li as diagnoseAgentIdentity,au as diffRelationshipAuditSnapshots,m_ as diffTestRunMeasurements,J0 as digestMcpRequestParameters,db as discoverExtensions,yo as discoverNearbyPmRoot,S1 as discoverPmTools,Dw as discoverProjectRuntimeVersionPins,bh as docs,Ch as duplicates,pu as durableGraphCachePath,_u as durableGraphCacheStatus,Bo as effectiveItemFormatVersion,aR as emitTelemetryErrorEvent,J_ as emptyImportedDocument,SI as encodeItemScalarDecisionValue,Tr as encodeMcpHttpHeaderValue,Cx as encodePmTableRows,BA as encodeQueryCursor,FA as encodeReadOutputContinuationCursor,$0 as encodeToon,qb as enforceHistoryStreamPolicyForItem,zb as enforceHistoryStreamPolicyForItems,dP as enrichCliFlagInvocationContract,Mt as enrichCliFlagInvocationContracts,vw as ensureMaterializedHistoryTarget,xp as ensurePmGitignore,hl as ensureScope,TO as ensureSentryCommandTracing,SO as ensureSentryInit,X_ as ensureTrackerInitialized,Kl as enumerateRelationshipPaths,vi as estimatePmOutputTokens,AM as evaluateAssuranceAssertion,xM as evaluateAssuranceGate,hP as evaluateBoundaryFixtures,xm as evaluateClaimActivity,Bv as evaluateContextRanking,TP as evaluateDefectGateEvidence,EM as evaluateMeasurement,If as evaluateMetricFloors,Es as evaluateMutationGuard,i_ as evaluateProvenanceCoverage,IF as evaluateReliabilityWindow,r_ as evaluateSemanticAttributionCoverage,Dl as evaluateSimilarityGovernance,Cw as evaluateTransition,_y as evaluateVerdictContract,iT as evaluateWorkflowPolicies,ds as executeEmbeddingBatchesWithRetry,dO as executeVectorDelete,pO as executeVectorReset,cO as executeVectorUpsert,sy as executeWorkspaceRecipe,xl as expandAddGlobEntries,Gl as explainSourceTraceability,fv as exportAttestation,Tg as extension,Ag as extensionActivate,xg as extensionDeactivate,Eg as extensionList,gS as extensionMigrate,GI as extractHistoryMergeReceiptDispositions,FI as extractHistoryMergeReceiptReferences,OL as extractMcpTraceContext,Rw as extractPatchFailureContext,bu as extractReferencedPmItemIdsFromCommand,My as federateRelationshipGraphSnapshots,Eh as files,Ah as filesDiscover,xh as filesLookup,ex as finalizeContextUsageDelivery,wy as findCoverageDeficits,$l as findDuplicateClusters,wp as findGitWorkspaceRoot,OE as findHistoryIdentityDiscontinuities,Dp as findInstalledNpmPackageCandidate,LL as findPmMcpAppByUri,Nn as findPmNamespacedCommand,Xl as findRedundantRelationshipEdges,Zl as findRelationshipCutStructure,Nl as findSimilarItems,sR as finishTelemetryCommand,WR as fitOutputEnvelope,KT as flattenFlagListValue,Ay as flushTelemetryQueue,gg as focus,Wl as forEachMatchedRelationshipEdge,ou as formatDuplicateEdgeGroup,ip as formatHierarchyRelation,nu as formatOrderingStorageContradiction,SR as formatPmPositionalActionFlagTip,bf as formatProfileApplyHuman,xf as formatProfileLintHuman,Ef as formatProfileListHuman,Af as formatProfileShowHuman,$p as formatSchemaEvolutionMigrationHuman,Lk as formatVectorIndexRecoveryWarnings,Vk as formatWorkspacePositionHuman,tg as gc,es as generateItemId,fh as get,xb as getActiveCommandResult,cx as getActiveContextIntentContracts,Yi as getActiveExtensionRegistrations,PL as getActiveMcpTraceContext,wM as getAssuranceDeclaration,Dg as getContracts,TE as getFocusedItem,Eo as getHistoryPath,VR as getItemAt,To as getItemPath,Rs as getMutationActionContract,Ap as getPmGitignoreBlock,So as getSettingsPath,R_ as getWorkspaceContracts,Vb as getWorkspaceHistoryPath,Oh as graph,lu as graphAuditBaselinePath,n_ as groupHistoryByEpisode,rF as handleServiceOverride,G0 as hasMcpClientExtension,NL as hasPmMcpAppsCapability,Be as hasSubcommandFlagContractsForCommand,mO as hasVectorizationEmbeddingIdentityChanged,fO as hasVectorizationVectorDimensionChanged,Gx as hashDocument,Ux as hashDocumentForVersion,jx as hashEmptyDocument,kx as hashHistoryPatch,vx as hashHistoryRecord,Nx as hashHistoryStream,TI as hashItemScalarDecisionValue,eg as health,ql as hierarchyAncestors,zl as hierarchyDescendants,ig as historyCompact,sg as historyCompactBulk,pE as historyDigest,Mv as historyEntryMatchesProvenance,$w as historyItemHashVersionForRuntime,rg as historyRedact,ng as historyRepair,og as historyRepairAll,kR as indexBlockedByIds,sp as indexHierarchyRelations,_O as inferConsistentVectorDimension,Oi as inferPmOutputBudgetClass,Ph as init,YM as inspectCompleteListResult,tb as inspectExtensionManifestSchema,Jp as inspectHistoryAuthorStream,$s as inspectInProgressWork,PI as inspectMergeReceiptEvidence,jw as inspectProjectRuntimeCompatibility,Ds as inspectStaleInProgressItems,Bg as inspectStaticExtensionInventory,VI as inspectStatusRoleAssignments,Kb as inspectWorkspaceHistoryState,zf as inspectWorkspaceSnapshot,vp as installMergeFence,j0 as interpretMcpResultType,ef as isAlreadyClaimedError,OO as isCommanderError,xN as isCompatibleRecoveryFlag,pd as isErrnoError,RR as isExternalDependencyReference,PR as isExternalDependencySourceKind,me as isFileMissingError,Di as isGenericRefusalRequired,Fi as isGenericRefusalWhy,DE as isHostOutputSuppressed,gs as isItemAlreadyExistsError,Ic as isItemRevisionConflict,yI as isItemScalarMissingValue,BO as isJudgeableHistoryRecord,LI as isLegacyMergeReceiptSummary,h as isMcpRecord,ws as isMutationAction,Hx as isOrderingRelationshipKind,rw as isPlaceholderReferenceToken,ls as isPmCliErrorDetails,ys as isPmCliExpectedError,to as isPmExtensionCapabilityContract,no as isPmExtensionPolicyModeContract,oo as isPmExtensionPolicySurfaceContract,ro as isPmExtensionServiceNameContract,iM as isPmKnownExitCode,eM as isPmMutationReceipt,Ve as isPmSuccessfulExitCode,_s as isPmTokenBudgetRecovery,eo as isPmToolAction,$I as isPreDurableCloneLocalReceiptSummary,DI as isPreDurableDispositionEligibleReference,Uw as isProjectMutatingInvocation,XO as isPureSnakeCaseAlias,NA as isReadOutputBudgetExceeded,pA as isReadOutputSessionReference,AN as isReadProjectionRecoveryFlag,kA as isReadResultOmittedForBudget,VE as isReadRowContract,tp as isRuntimeRecord,Ew as isSettingsReadFallback,Tm as isStartTransition,ZO as isTerminalPlanMode,CE as isTerminalStatus,$o as isTimestampLiteral,mP as isWaiverNoticeDays,jO as isWellFormedHistoryRecord,aN as itemDocumentToMutationOptions,yk as itemHasSchedule,Ti as jaccardSimilarity,HO as latestHistoryTimestamp,Th as learnings,YT as levenshteinDistanceWithinLimit,ad as limitAnnotationEntries,Mu as linkedTestTrustFingerprint,zN as lintExtensionBlueprint,rb as lintExtensionManifestSchema,er as lintProjectProfile,lh as list,ii as listAgentProvenanceAdapters,Vc as listAliasPluralKeys,uh as listAllComplete,Xw as listAllDocumentCandidatesCached,cs as listAllItemMetadata,Jw as listAllItemMetadataLight,bM as listAssuranceDeclarations,IM as listAssuranceVerdicts,Cy as listBuiltinCorpusShapes,vN as listCoreClosedDomainContracts,_R as listGetProjectionFields,fI as listInvalidProvenanceHistoryStreamIds,uR as listListProjectionFields,MI as listMergeReceipts,Os as listMutationActions,jk as listMutationEvents,hn as listPmCommandFlagBudgets,hp as listPmCommandsForFamily,_p as listPmCommandsForTier,Pe as listPmFlagLexicon,GD as listPmFlagSpellingInventory,gp as listPmMcpToolsForProfile,RD as listPmRequiredArgumentRefusalContracts,PD as listPmSubcommandRefusalContracts,Yt as listProfiles,vD as listTrackerPreflightRecoveryContracts,pN as listUpsertKeyCandidates,Hf as listWorkspaceSnapshots,qR as loadContextIntentRuntimeLayers,ff as loadCreateTemplateOptions,pb as loadExtensions,gu as loadGraphAuditBaseline,lN as loadGuardedRuntimeSchema,qT as loadMutationCheckpoint,v as loadRelationshipGraphAdapter,ss as locateItem,mT as looksLikeGenericKeyValueEntry,nA as mapReadOutputRows,II as markMergeReceiptReconciled,hw as matchesRuntimeFilters,oR as maybeRunFirstUseTelemetryPrompt,Ty as measureCorpusShapePlan,rs as measureItemMetadataReadWork,pT as mergeAdditiveTags,jN as mergeExtensionBlueprints,EI as mergeHistoryStreams,wI as mergeItemDocuments,OI as mergeJsonDocuments,Wc as mergeLinkedTestTwoTokenEntries,AI as mergeRelationshipEventStreams,Wm as mergeSortedWarnings,QO as migrateItemFilesToFormat,tO as mutateItem,eO as mutateItemWithHistoryContext,Xb as mutateWorkspaceJsonWithHistory,_h as next,ai as normalizeAgentProvenanceAdapterValue,sd as normalizeAnnotationTransportOptions,uM as normalizeAssuranceEvaluation,lM as normalizeAssuranceMutation,Yc as normalizeBootstrapInvocation,Gb as normalizeBulkIdsValue,cp as normalizeDependencyGraphTarget,FP as normalizeDependencySeedId,DP as normalizeDependencySourceKind,kt as normalizeDirectExtensionCommandOptions,Oc as normalizeExpectedItemHash,zi as normalizeExtensionContributionInventory,iE as normalizeHistoryOperationForWrite,mI as normalizeInvalidHistoryProvenance,cP as normalizeItemAddressInvocation,qo as normalizeItemFormatVersion,Zi as normalizeItemId,Ko as normalizeItemMetadata,GP as normalizeItemReference,Hc as normalizeLegacyExtensionActionSyntax,Al as normalizeLinkedPath,tw as normalizeParentReferenceValue,Kt as normalizeProfileName,Qi as normalizeRawItemId,PA as normalizeReadOutputIncludeModeOptions,IE as normalizeReplayPatchOps,Ps as normalizeSimilarityText,FO as normalizeStaleWorkThresholdHours,gE as normalizeStatusForRegistry,Vo as normalizeStatusInput,uE as normalizeStatusInputWithRegistry,wO as normalizeThrownExitCode,Sh as notes,Lo as nowIso,uu as openDurableGraphCache,X0 as openMcpRequestState,r$ as openPmEpisode,Hl as orderingPredecessors,Vl as orderingSuccessors,Kv as packContextCandidates,qm as packRankedContextItems,Ng as packageActivate,kg as packageCatalog,Lg as packageDeactivate,Ig as packageDescribe,Pg as packageDoctor,Og as packageInstall,bg as packageLifecycle,wg as packageList,Mg as packageManage,CS as packageMigrate,vg as packageReload,Rg as packageUninstall,KA as paginateQueryRows,gl as parseAddEntries,Cl as parseAddGlobEntries,dd as parseAnnotationTextInput,nN as parseAtomicMutationControls,qc as parseBootstrapCommandName,Uc as parseBootstrapGlobalOptions,Bc as parseBootstrapHelpRequest,Xc as parseBootstrapTypeValue,Fb as parseBulkIdsText,Gm as parseContextDepth,Lm as parseContextFocusFields,UR as parseContextIntentDeclarations,Um as parseContextSections,Jv as parseContextSignalSnapshot,uT as parseCsvKv,xP as parseDefectChangeRiskRequest,ev as parseDefectRecurrenceCoverageRequest,AP as parseDefectRecurrencePolicy,Mf as parseEvalMetricFloors,Lf as parseEvalQuerySet,Rc as parseExpectHashSpecs,kT as parseExtensionLongFlagToken,Su as parseGraphSubcommand,mv as parseHistoryAttestation,Rv as parseHistoryProvenanceFilters,bP as parseIntegerLimit,yE as parseItemDocument,oN as parseItemMutationBatch,mw as parseLimit,sm as parseLinkedTestAssertionEqualsMap,am as parseLinkedTestAssertionGteMap,em as parseLinkedTestBoolean,tm as parseLinkedTestContextMode,Zu as parseLinkedTestEnvClear,Qu as parseLinkedTestEnvSet,cm as parseLinkedTestJsonEntries,im as parseLinkedTestMinLines,om as parseLinkedTestRegexList,nm as parseLinkedTestStringList,rm as parseLinkedTestWorkspaceContextMode,Qg as parseMcpCachePolicy,qg as parseMcpImplementation,Ze as parseMcpInputRequests,pr as parseMcpInputResponses,EC as parseMcpSubscriptionFilter,Sl as parseMigrateEntries,RP as parseMultiValueFilter,tM as parseMutationReceipt,ET as parseOptionalNonNegativeInteger,TT as parseOptionalNumber,Z$ as parsePmAgentTaskTranscriptCorpus,y1 as parsePmToolDiscoveryOptions,wP as parsePriority,IP as parsePriorityFilterSet,mA as parseReadOutputSession,Zx as parseRegisteredItemFieldAssignments,se as parseRelationshipGraphSnapshot,yl as parseRemoveEntries,Fl as parseSourceLineRange,dw as parseStatusFilterCsv,PP as parseStringFilterSet,io as parseTags,l_ as parseTestRunMeasurements,OP as parseType,MP as parseTypeFilterSet,tl as parseUnknownAuthorHistoryEventCoordinates,ZS as parseWorkflowPolicy,eT as parseWorkflowPolicyDocument,mk as partitionDecisionEntries,jb as patchPathToChangedField,so as pathExists,yg as pauseTask,mu as persistDurableGraphResult,Tw as persistSelectedItemFormat,tI as planAgentIdentityVocabularyMutation,nk as planCompletedAtBackfill,Bp as planExtensionDirectoryCopy,DN as planItemMutationDocument,tr as planProfileApplication,nD as planRelationshipEventBackfill,yu as planRelationshipRemediation,Np as planSchemaEvolutionMigration,Zp as planUnknownAuthorHistoryAcknowledgment,Vf as planWorkspaceSnapshotRestore,AR as positionalShapeKey,xR as positionalSignatureKey,WN as preflightExtension,Is as prepareSimilarityText,hT as preserveMutationStdinTokenFields,_T as preserveMutationStdinTokenLiterals,$N as previewItemMutationDocument,uN as previewItemMutations,Ox as printError,wx as printResult,Wh as profile,Jh as profileApply,Qh as profileLint,Yh as profileList,Xh as profileShow,wb as projectAfterCommandItemSnapshot,$m as projectContextFocusRows,d_ as projectFleetAttributionAnalytics,Pv as projectHistoryProvenance,ji as projectLeanRecoveryPayload,_l as projectLinkedCollectionMutation,Sx as projectPmBriefListEnvelope,Tx as projectPmBriefSearchEnvelope,fs as projectPmCliErrorContextDetails,us as projectPmCliErrorDetails,Ni as projectPmDiagnosticOutput,Li as projectPmDiagnosticText,a_ as projectProvenanceCoverageAnalytics,Nu as projectValidateCounts,lI as promoteAssuranceAssertion,QA as propagateContextUsageServingReceipt,E$ as pruneCompileCacheGenerations,OM as putAssuranceDeclaration,RM as putAssuranceDeclarationBundle,qw as queryItemMetadataIndex,zw as queryLinkedFileMetadataIndex,Hw as querySimilarItemMetadataIndex,u_ as queryTestRunMeasurementsBelow,wo as quoteCmdCommandArg,Ro as quoteCommandArg,Po as quotePosixCommandArg,Oo as quotePowerShellCommandArg,bo as quoteWindowsCommandArg,MN as rankCommandPaths,cd as readAnnotationEntries,ui as readAuthorEnvironment,M_ as readBooleanOption,ix as readContextUsageAffinity,I_ as readCsvListOption,$c as readExtensionMigrationState,ao as readFileIfExists,nd as readFirstStringFromCommanderOptions,od as readFirstValueFromCommanderOptions,o_ as readHistoryAnalyticsWindow,wE as readHistoryEntries,hi as readHistorySnapshot,Jf as readImprovementLedger,Ww as readItemMetadataDerivedIndexState,Pc as readItemRevision,gN as readItemTransaction,KO as readLatestHistoryActivity,as as readLocatedItem,tA as readOutputBudgetCollections,DA as readOutputCollectionFingerprint,eA as readOutputContinuationRowCollections,QE as readOutputContinuationRowPaths,OA as readOutputIncludeModeOptions,dA as readOutputRetainsTail,ZE as readOutputRowCollections,JE as readOutputRowPaths,hA as readOutputSessionRemainingTokens,Ut as readPmPackageManifest,Nm as readRecentActivity,w_ as readRequiredString,fE as readRuntimeFieldOptionValue,ts as readSettings,rR as readSettingsSection,Aw as readSettingsWithMetadata,id as readStringArrayFromCommanderOptions,P_ as readStringOption,bO as readThrownExitCode,hO as readVectorizationStatusLedger,kw as readWorkflowPolicies,tT as readWorkflowPolicyField,jR as readWorkspaceContextIntentContracts,tk as readWorkspaceContextSignals,sk as readWorkspaceMemory,Hk as readWorkspacePosition,oP as readWorkspaceTransaction,NE as reanchorHistoryEntries,kF as reconcileArtifactLedgers,Wi as reconcileExtensionCapabilityUsage,Qb as reconcileWorkspaceJsonHistory,bb as recordAfterCommandAffectedItem,MM as recordAssuranceVerdict,um as recordClaimSemanticAttribution,rx as recordContextUsageDelivery,tx as recordContextUsageServing,nx as recordContextUsageTouch,ox as recordContextUsageTouches,fm as recordFocusSemanticAttribution,Xf as recordImprovementObservation,mm as recordReleaseSemanticAttribution,zO as recordedBaselineActivity,VO as recordedPrefixActivity,ko as redactUrlCredentialsInText,vo as redactUrlCredentialsInToken,Yw as refreshItemMetadataDerivedIndex,Mp as refreshMergeAttributeFenceIfInstalled,sA as refreshReadOutputDeliveredCounts,CO as refreshSearchArtifactsForMutation,si as registerAgentProvenanceAdapters,LP as registerExternalDependencyResolver,oi as registerHarnessSignalDescriptors,GE as registerOutputMaterialFieldGroups,mg as release,iA as rememberReadOutputFocusRows,PM as removeAssuranceDeclaration,co as removeFileIfExists,Il as renameArtifactsResultKey,Mm as renderCalendarMarkdown,Im as renderCalendarToon,Ym as renderContextMarkdown,Up as renderExtensionDescribeMarkdown,Fp as renderExtensionSurfaceMarkdown,th as renderGuideMarkdown,ON as renderMissingOptionRetry,fk as renderNextMarkdown,kN as renderPmClosedDomainHelp,Mo as renderPmCommand,Fn as renderPmCommandAliasMigrationHint,Sp as renderPmCommandVisibilityMarkdown,jD as renderPmFlagLexiconMarkdown,DL as renderPmMcpAppHtml,hD as renderPmRefusalClosureCensusMarkdown,lw as renderRowsAsCsv,uw as renderRowsAsTable,dg as reopen,Iw as replayHistoryToTarget,PE as replayToCanonicalItemDocument,RE as replayToItemDocument,oE as requireHistoryOperation,yv as requireTerminalReason,Sv as requireTerminalReasonWithRecovery,Dx as resealHistoryRewrite,Tb as resetActiveExtensionRuntimeState,pl as resetWorkspaceGraphCache,Qo as resolveAgentSessionContextFromSignals,fd as resolveAnnotationIndex,ld as resolveAnnotationInput,bE as resolveAuthor,_i as resolveAuthorIdentity,ew as resolveBodyFileContent,yy as resolveBuiltinCorpusShape,Pm as resolveCalendarOutputFormat,YP as resolveCanonicalPmErrorCodeContract,zx as resolveCanonicalRelationshipKind,xE as resolveClaimPrincipal,Ub as resolveCliBulkIdsInput,RT as resolveCommandOptionPolicyState,xo as resolveCommandShellDialect,T$ as resolveCompileCacheGeneration,rk as resolveCompletionTimestamp,Xx as resolveConfiguredPmPackageRoot,jP as resolveContentFieldFilters,lx as resolveContextIntentContract,Dm as resolveContextOutputFormat,Fm as resolveContextTokenBudget,Ev as resolveCreateExplicitEmptyFlag,xc as resolveDeclaredBlockers,xk as resolveEffectiveSearchMode,rO as resolveEmbeddingProviders,vt as resolveExtensionFlagOptionKey,VT as resolveExtensionFlagValueContract,qp as resolveExtensionInstallSourceIdentity,NT as resolveExtensionLongFlagName,Lc as resolveExtensionMigrationStatePath,cb as resolveExtensionRoots,$P as resolveExternalDependencyReference,HT as resolveFlagValueKind,IT as resolveGlobalPmRoot,Z_ as resolveGuideOutputFormat,Qf as resolveHistoryEpisodeGroupIdentity,dE as resolveHistoryHashAlgorithm,nE as resolveHistoryOperation,Ov as resolveHistoryProvenanceDimensions,OR as resolveHistorySubject,Pw as resolveHistoryTarget,wk as resolveHybridSemanticWeight,Co as resolveImplicitPmRoot,UT as resolveIsoOrRelative,LR as resolveItemBlockers,MR as resolveItemExecutionRole,sN as resolveItemMutationDocument,wm as resolveItemOwnershipActivity,bm as resolveItemOwnershipConflict,go as resolveItemTypeRegistry,lE as resolveItemTypesFilePath,Ls as resolveLastActivityAt,yN as resolveLifecycleVerbRecovery,vT as resolveLinkedResourcePositionalRecovery,E_ as resolveLinkedTestFailureExitCode,wu as resolveLinkedTestSourceRef,Ou as resolveLinkedTestSourceWorkspaceRoot,Iu as resolveLinkedTestTrust,vu as resolveLinkedTestTrustBatch,AC as resolveMcpAcknowledgedSubscriptionFilter,Ye as resolveMcpRequestContext,bp as resolveMergeInstallContext,RN as resolveMisnestedCommandPath,UP as resolveMissingMetadataFilters,wN as resolveMissingOptionPlaceholder,HE as resolveModePairedOutputOmissionReceipt,lk as resolveNextOutputFormat,WE as resolveOutputOmissionReceipt,Yx as resolvePmCliVersion,Dn as resolvePmCommandAlias,ze as resolvePmCommandCapabilityFamily,$t as resolvePmCommandExitContract,N as resolvePmCommandOperation,Ii as resolvePmCommandOutputBudget,Lt as resolvePmCommandOutputEnvelope,CR as resolvePmCommandPositionalContract,No as resolvePmCommandScopeArgs,He as resolvePmCommandVisibilityTier,ki as resolvePmDiagnosticOutputBudget,XP as resolvePmErrorCodeContract,uS as resolvePmFlagSemanticConcept,ke as resolvePmHistoryOperation,z0 as resolvePmMcpExecutableInvocation,Wx as resolvePmPackageRootFromModule,yR as resolvePmPositionalActionContract,Ec as resolvePmPositionalActionFlagContracts,De as resolvePmRoot,Hd as resolvePmToolCustomFieldCollision,iw as resolvePriority,Wt as resolveProfile,Rp as resolveProjectMergeTypeFolders,VA as resolveQueryCursorStart,SN as resolveReadCompletenessControls,EN as resolveReadOptionRetryArgs,MA as resolveReadOutputDimensions,LA as resolveReadOutputEncoding,aA as resolveReadOutputRecoveryBudget,TA as resolveReadOutputSurface,KE as resolveReadRowContract,bN as resolveRecoveryCommandName,$b as resolveRegisteredSearchProvider,Db as resolveRegisteredVectorStoreAdapter,gd as resolveReproducibleProcessEnvironment,Fo as resolveRuntimeFieldRegistry,Do as resolveRuntimeStatusRegistry,nO as resolveSearchCorpusFields,Ak as resolveSearchMaxResults,Pk as resolveSearchPage,bk as resolveSearchScoreThreshold,Ok as resolveSearchTuning,iO as resolveSemanticCorpusCharacterLimit,lm as resolveSemanticLineageIds,bw as resolveSettingsWithSemanticRuntimeDefaults,LM as resolveSourceContextWritePolicy,Cm as resolveStartTaskInProgressStatus,Z as resolveSubcommandFlagContractsForCommand,WS as resolveTelemetryErrorCategory,yO as resolveTelemetrySourceAttribution,Cv as resolveTerminalReason,dN as resolveTransactionSchema,OT as resolveTypeDefinition,wT as resolveTypeName,pw as resolveTypeSynonym,gw as resolveTypeWorkflows,el as resolveUnknownAuthorAcknowledgmentSelector,Nk as resolveVectorIndexRecovery,aO as resolveVectorStores,rp as resolveWorkspaceRelationshipKindRegistry,MT as resolveWorkspaceRoot,hg as restore,zT as restoreCheckpointItems,Zb as restoreWorkspaceJsonFromHistory,Wf as restoreWorkspaceSnapshot,Kf as restoreWorkspaceSnapshotWithRecovery,ml as reviseLinkedNote,Ug as runAction,Pb as runActiveBeforeMutationHooks,Ib as runActiveCommandHandler,Mb as runActiveOnIndexHooks,Ji as runActiveOnReadHooks,Xi as runActiveOnWriteHooks,vb as runActiveParserOverride,kb as runActivePreflightOverride,Nb as runActiveServiceOverride,km as runActivity,ab as runAfterCommandHooks,wf as runAggregate,md as runAnnotationCommand,Uu as runAppend,ov as runAssuranceAction,iv as runAssuranceDispatch,sb as runBeforeCommandHooks,vm as runCalendar,tf as runClaim,rf as runClaimNext,Bu as runClose,qu as runCloseMany,af as runCloseTask,ol as runComments,rh as runCompletion,il as runConfig,zt as runContext,Hv as runContextEvaluationCorpus,qv as runContextEvaluationScenario,zu as runCopy,dm as runCreate,pm as runDelete,ll as runDeps,vl as runDocs,iI as runDuplicates,Df as runEval,Gf as runEvent,zp as runExtension,Gc as runExtensionMigrateAction,Fc as runExtensionMigrations,Ul as runFiles,Bl as runFilesDiscover,jl as runFilesLookup,c_ as runFleetAttributionAnalytics,gm as runFocus,Du as runGc,Of as runGet,Tu as runGraph,eh as runGuide,Au as runHealth,Ek as runHistory,hv as runHistoryAttest,av as runHistoryCompact,pv as runHistoryCompactBulk,jI as runHistoryMaintenance,lv as runHistoryRedact,qI as runHistoryRepair,HI as runHistoryRepairAll,Gg as runInActiveExtensionScope,Xp as runInit,Kp as runInitAgentGuidance,Gu as runLearnings,Ml as runLinkedArtifacts,A_ as runLinkedTests,mp as runList,Ff as runMeet,Fk as runMergeDriver,Ip as runMergeInstall,kI as runMergeReceiptEvidenceReport,vI as runMergeReceiptReport,Gk as runMergeReconcile,Qm as runNext,uf as runNotes,sf as runPauseTask,df as runPlan,Tf as runProfileApply,Sf as runProfileLint,Cf as runProfileList,yf as runProfileShow,s_ as runProvenanceCoverageAnalytics,JN as runRegisteredCommandForTest,r0 as runRegisteredCommandOverrideForTest,d0 as runRegisteredExporterForTest,ZN as runRegisteredHookForTest,c0 as runRegisteredImporterForTest,a0 as runRegisteredMigrationForTest,QN as runRegisteredMutationGuardForTest,e0 as runRegisteredParserOverrideForTest,t0 as runRegisteredPreflightOverrideForTest,n0 as runRegisteredRendererOverrideForTest,i0 as runRegisteredSearchProviderForTest,o0 as runRegisteredServiceOverrideForTest,s0 as runRegisteredVectorStoreAdapterForTest,rr as runReindex,nf as runRelease,Uf as runRemind,xv as runReopen,pf as runRestore,Lp as runSchemaEvolutionMigration,Rf as runSearch,Ey as runSearchRefreshWorkerEntrypoint,nh as runStartBackgroundRun,of as runStartTask,f_ as runStats,h_ as runTelemetry,hf as runTemplatesList,_f as runTemplatesSave,gf as runTemplatesShow,x_ as runTest,b_ as runTestAll,oh as runTestRunsList,sh as runTestRunsLogs,ch as runTestRunsResume,ih as runTestRunsStatus,ah as runTestRunsStop,dh as runTestRunsWorker,Am as runUpdate,lf as runUpdateMany,Bt as runUpgrade,$u as runValidate,Fg as runWithActiveExtensions,L as runWithAgentSessionContext,Sw as runWithConfigurationOnlySettings,dx as runWithContextIntentContracts,zR as runWithDiscoveredContextIntentContracts,ci as runWithHarnessDetectionSignals,RL as runWithMcpTraceContext,yd as runWithReproducibleProcessEnvironment,di as runWithWorkspaceHarnessSignalDescriptors,Vr as runWithWorkspaceRecipe,HM as runWorkflowPolicyAction,sv as runWorkspaceTransactionGc,Cu as saveGraphAuditBaseline,YI as scanClosureTimestamps,uI as scanExtensionHostVersions,Qp as scanHistoryAuthorAttribution,Fs as scanInProgressWork,Ho as scanItemFormatVersions,Ts as scanMutationSecrets,_I as scanProvenanceResolverHealth,Gs as scanStaleInProgressItems,QI as scanStorageIntegrity,Ih as schema,Fh as schemaAddField,$h as schemaAddStatus,Nh as schemaAddType,Bh as schemaApplyPreset,qh as schemaInferTypes,vh as schemaList,Uh as schemaListFields,Vh as schemaRemapStatus,Gh as schemaRemoveField,Dh as schemaRemoveStatus,Lh as schemaRemoveType,Hh as schemaRenameField,zh as schemaRenameType,kh as schemaShow,jh as schemaShowField,Kh as schemaShowStatus,PN as scoreCommandPathMatch,Gv as scoreContextCandidates,Uv as scoreContextCandidatesWithActiveExtensions,vs as scoreItemSimilarity,MD as scorePmGrammarRefusalClosure,yD as scorePmRefusalClosure,ks as scorePreparedItemSimilarity,kD as scoreTrackerPreflightRecoveryClosure,Lx as sealHistoryRecord,Y0 as sealMcpRequestState,mh as search,dk as searchWorkspaceMemory,pk as searchWorkspaceMemoryReadResult,xs as secretGuardRuleCategory,DR as selectActionableEntries,UA as selectCursorSemanticOptions,Y_ as selectImportAuthor,AL as selectMcpClientRegistrationMode,ck as selectWorkspaceMemory,ak as selectWorkspaceMemoryRollups,hm as semanticAttributionAffinity,NO as sentryCaptureCliError,vO as sentryDiscardCommandSpan,kO as sentryFinishCommandSpan,$O as sentryFlush,LO as sentryLogCliUsageError,MO as sentrySetCommandContext,IO as sentryStartCommandSpan,Yo as serializeItemDocument,NN as serializeNdjsonRows,LN as serializeNdjsonStream,ly as serveDeclaredObservation,Eb as setActiveCommandContext,Ab as setActiveCommandResult,_b as setActiveExtensionCommands,fb as setActiveExtensionHooks,hb as setActiveExtensionParsers,gb as setActiveExtensionPreflight,Sb as setActiveExtensionRegistrations,yb as setActiveExtensionRenderers,Cb as setActiveExtensionServices,EE as setFocusedItem,tR as settingsSectionRevision,eR as shouldCompletePlanOnClose,hu as shouldPersistDurableGraphCache,yT as shouldResolveMutationStdinTokenField,CT as shouldResolveMutationStdinTokens,Ow as shouldRunSearchRefreshInForeground,kl as similarityAdvisoryWarnings,XE as sliceReadOutputRowCollection,ms as snapshotPmCliErrorContext,Ol as sortLinkedArtifacts,_P as sortWaiverNotices,cT as splitAcceptanceCriteria,JO as splitCommaList,Wo as splitFrontMatter,IA as stabilizeReadOutputReceiptEstimates,R as stableStringify,iN as stableUpsertValue,YS as stableValueEquals,UO as staleEligibleAt,Gw as stampRequiredItemFormat,Cg as startTask,iR as startTelemetryCommand,gh as stats,mE as statusIsTerminal,jc as stripGlobalBootstrapTokens,Bk as subscribeMutationEventBatches,qk as subscribeMutationEvents,eI as summarizeAgentIdentityVocabulary,e_ as summarizeAgentModelProvenance,t_ as summarizeAgentProvenance,zv as summarizeContextEvaluationReports,y_ as summarizeContextPreflight,vv as summarizeHistoryProvenance,Wp as summarizeInitResult,RI as summarizeMergeReceipt,Av as supportsCreateExplicitEmpty,aP as supportsItemIdAlias,$E as suppressHostOutput,we as syncRelationshipGraphAdapter,HN as synthesizeExtensionManifest,Ac as toCompletionFlagString,Km as toContextFocusItem,zm as toContextPackingSummary,Hm as toContextRankingSummary,$T as toErrorMessage,k_ as toEstimatedMinutesValue,Zk as toExtensionFlagDefinitions,F_ as toImportBoolean,B_ as toImportConfidence,K_ as toImportDeferredFields,D_ as toImportInteger,V_ as toImportLinkedDocs,H_ as toImportLinkedFiles,W_ as toImportLinkedTests,z_ as toImportLogEntries,q_ as toImportNormalizedEnum,j_ as toImportNumberMap,N_ as toImportPriority,$_ as toImportStatus,G_ as toImportStringList,U_ as toImportStringMap,L_ as toImportTags,SE as toItemRecord,v_ as toNonEmptyImportString,LT as toNonEmptyStringOrUndefined,ME as toReplayDocument,Ex as toWellFormedText,Ms as tokenizeSimilarityText,gT as transferMutationStdinTokenPolicy,ob as translateHostEnvironmentFault,qO as unprovenClaimActivity,cg as update,g_ as updateLinkedTest,$g as upgrade,Zh as validate,CM as validateAssertionDefinition,SM as validateAssuranceDocument,yM as validateGateDefinition,cN as validateItemMutationRows,Pl as validateLinkedPaths,xL as validateMcpAuthorizationResponseIssuer,EL as validateMcpAuthorizationServerMetadata,bL as validateMcpClientMetadataDocument,fL as validateMcpHttpRequestHeaders,Z0 as validateMcpJsonSchema,gM as validateMeasurementDefinition,nw as validateMissingParentReference,wA as validateReadOutputOptions,cw as validateSprintOrReleaseValue,PT as validateTypeOptions,rP as validateWorkspaceTransactionIdentity,_v as verifyAttestation,pP as verifyCliFlagInvocationParity,ER as verifyExplicitPositionalSlotCensus,kE as verifyHistoryChain,vE as verifyHistoryChainWithVersion,HR as verifyHistoryEntries,$x as verifyHistoryRecordHash,Fx as verifyHistoryRewriteEvidence,wR as verifyPmCliGrammar,bR as verifyPmCommandPositionalContracts,UD as verifyPmFlagLexicon,pD as verifyPmRecoveryKindRuntimeCoverage,rS as verifyPmRecoveryProducerRuntimeCoverage,dD as verifyPmRecoveryReferences,fD as verifyPmRefusalClosureIdentityRatchet,mD as verifyPmRefusalClosureRatchet,cD as verifyPmRefusalReachability,wd as verifyToolOptionCliParity,fP as waiverNoticeFor,GO as wholeHoursSince,sw as withCliMutationInput,vc as withExpectedItemRevisions,js as withFlagAliasMetadata,ib as withHostEnvironmentBoundary,aw as withLiteralMutationInput,Q0 as withMcpCachePolicy,Gi as withoutGenericRefusalExamples,nT as workflowApprovalFingerprint,oT as workflowPolicyApplies,rT as workflowPolicyFingerprint,dl as workspaceGraphCache,iP as workspaceTransactionPlanDigest,ud as wrapOwnershipConflict,RO as wrapThrownErrorForSentry,mi as writeAuthorEnvironment,$e as writeFileAtomic,BT as writeMutationCheckpoint,xw as writeSettings,nR as writeSettingsSection,bx as writeStderr,xx as writeStdout,gO as writeVectorizationStatusLedger,Jb as writeWorkspaceJsonWithHistory,fl as writtenLinkedEntries};
32
+ `&&t.push(r+1);return t}function tS(e,t){let r=0,n=e.length;for(;r<n;){let o=Math.floor((r+n)/2);e[o]<=t?r=o+1:n=o}return r}function aD(e){let t=[],r=[];for(let o of[...e].sort((i,s)=>Q(i.path,s.path))){let i=eS(o.content),s;try{s=Zy(o.content)}catch(a){r.push({kind:"invalid_source",subject:o.path,detail:`${o.path} could not be parsed for recovery producers: ${String(a)}.`});continue}for(let a of s){let c=a.field,d=tS(i,a.offset),p=pn(c);p?t.push({path:o.path,line:d,field:c,kind:p.kind}):/(?:retry_command|candidate_command|fallback_candidate|next_best_command|example|next_step|migration_hint|restore_with)/u.test(c)&&!/(?:_total|_truncated)$/u.test(c)&&r.push({kind:"unknown_recovery_field",subject:`${o.path}:${d}:${c}`,detail:`${c} resembles a recovery reference but has no typed field contract.`})}}let n=Object.fromEntries(ce.map(o=>[o,t.filter(i=>i.kind===o).length]));for(let o of ce)n[o]===0&&r.push({kind:"missing_kind_producer",subject:o,detail:`No source producer emits the ${o} recovery-reference kind.`});return t.sort((o,i)=>o.path!==i.path?Q(o.path,i.path):o.line!==i.line?o.line-i.line:Q(o.field,i.field)),r.sort((o,i)=>o.subject!==i.subject?Q(o.subject,i.subject):Q(o.kind,i.kind)),{ok:r.length===0,scanned_file_count:e.length,producer_count:t.length,producer_count_by_kind:n,producers:t,findings:r}}function cD(e,t){let r=[],n=(o,i)=>{if(Array.isArray(o)){o.forEach((s,a)=>n(s,[...i,String(a)]));return}if(!(typeof o!="object"||o===null))for(let[s,a]of Object.entries(o).sort(([c],[d])=>Q(c,d))){let c=pn(s),d=c?.kind==="migration_hint"&&o.semantics==="behavior_preserving"?{...c,semantics:"behavior_preserving"}:c,p=[a].flat();d!==void 0&&p.forEach((l,f)=>{let g="nested_value_field"in d&&typeof d.nested_value_field=="string"?d.nested_value_field:void 0,_=g&&typeof l=="object"&&l!==null&&!Array.isArray(l)?l[g]:l;if(typeof _!="string"||_.trim().length===0)return;let y=[...i,s,String(f)].map(E=>encodeURIComponent(E)).join("/");r.push({id:`${e}:${d.kind}:${y}`,probe_id:e,kind:d.kind,semantics:d.semantics,value:_})}),n(a,[...i,s])}};return n(t,[]),r}function dD(e,t){let r=e.flatMap(s=>(s.owned_states??[]).map(a=>({contract:s,state:a}))),n=[],o=new Map;for(let s of t){if(o.has(s.probe_id)){n.push({kind:"duplicate_probe",probe_id:s.probe_id,detail:`Observation ${s.probe_id} was supplied more than once.`});continue}o.set(s.probe_id,s)}let i=new Set(r.map(({state:s})=>s.probe_id));for(let{contract:s,state:a}of r){let c=o.get(a.probe_id);if(!c){n.push({kind:"missing_probe",probe_id:a.probe_id,detail:`No entrypoint observation was recorded for ${s.code}.`});continue}c.code!==s.code&&n.push({kind:"wrong_error_code",probe_id:a.probe_id,detail:`Expected ${s.code}; observed ${c.code}.`}),c.exit_class!==a.expected_exit_class&&n.push({kind:"wrong_exit_class",probe_id:a.probe_id,detail:`Expected ${a.expected_exit_class}; observed ${c.exit_class}.`}),a.entrypoints.includes(c.entrypoint)||n.push({kind:"wrong_entrypoint",probe_id:a.probe_id,detail:`Expected one of ${a.entrypoints.join(", ")}; observed ${c.entrypoint}.`})}for(let s of t)i.has(s.probe_id)||n.push({kind:"undeclared_probe",probe_id:s.probe_id,detail:`Observation ${s.probe_id} has no catalog declaration.`});return n.sort((s,a)=>s.probe_id!==a.probe_id?s.probe_id.localeCompare(a.probe_id):s.kind.localeCompare(a.kind)),{ok:n.length===0,declared_probe_count:r.length,observed_probe_count:t.length,findings:n}}function pD(e,t){let r=[],n=new Set,o=new Set;for(let c of e){if(n.has(c.id)){o.add(c.id),r.push({kind:"duplicate_obligation",reference_id:c.id,detail:`Recovery obligation ${c.id} was declared more than once.`});continue}n.add(c.id)}let i=new Map;for(let c of t){if(i.has(c.id)){r.push({kind:"duplicate_observation",reference_id:c.id,detail:`Recovery reference ${c.id} was observed more than once.`});continue}i.set(c.id,c),n.has(c.id)||r.push({kind:"undeclared_observation",reference_id:c.id,detail:`Recovery observation ${c.id} has no emitted obligation.`})}for(let c of e){if(o.has(c.id))continue;let d=i.get(c.id);d?d.reachable?d.semantics!==c.semantics&&r.push({kind:"wrong_semantics",reference_id:c.id,detail:`Recovery reference ${c.value} promised ${c.semantics}; proof demonstrated ${d.semantics}.`}):r.push({kind:"unreachable_reference",reference_id:c.id,detail:`Recovery reference ${c.value} did not reach its promised target.`}):r.push({kind:"missing_observation",reference_id:c.id,detail:`No reachability proof was recorded for ${c.kind} ${c.value}.`})}let s=ce.map(c=>{let d=e.filter(l=>l.kind===c),p=d.filter(l=>!o.has(l.id)).map(l=>i.get(l.id)).filter(l=>l!==void 0);return{kind:c,declared:d.length,observed:p.length,passed:d.filter(l=>{let f=i.get(l.id);return!o.has(l.id)&&f?.reachable===!0&&f.semantics===l.semantics}).length}});r.sort((c,d)=>c.reference_id!==d.reference_id?c.reference_id.localeCompare(d.reference_id):c.kind.localeCompare(d.kind));let a=s.reduce((c,d)=>c+d.passed,0);return{ok:r.length===0,declared_reference_count:e.length,observed_reference_count:t.length,pass_fraction:n.size===0?1:a/n.size,coverage_by_kind:s,findings:r}}function rS(e,t){let r=new Map(ce.map(i=>[i,new Set]));for(let i of t)r.get(i.kind).add(i.value);let n=ce.map(i=>({kind:i,source_producers:e.producer_count_by_kind[i],runtime_values:r.get(i).size})),o=n.filter(({source_producers:i,runtime_values:s})=>i>0&&s===0).map(({kind:i})=>i);return{ok:e.ok&&o.length===0,source_producer_count:e.producer_count,runtime_value_count:n.reduce((i,{runtime_values:s})=>i+s,0),coverage_by_kind:n,missing_runtime_kinds:o}}var lD=rS;var mD=16,nS=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"]),ln=18,un=Object.freeze([...nS,"manifest_unknown_key","no_version_bounds_declared"].sort((e,t)=>e.localeCompare(t)));function fD(e,t=ln){return{ok:e.executable_error_code_count>=t,baseline:t,actual:e.executable_error_code_count}}function _D(e,t=un){let r=new Set(e.rows.filter(({disposition:o})=>o==="executable").map(({canonical_code:o})=>o)),n=t.filter(o=>!r.has(o));return{ok:n.length===0,required_canonical_codes:[...t],missing_required_canonical_codes:n}}function mt(e,t){let r=e.get(t);if(r)return r;let n={kinds:new Set,probeIds:new Set};return e.set(t,n),n}function hD(e,t,r){let n=new Map(e.map(p=>[p.code,p.canonical_code??p.code])),o=new Map,i=0,s=0;for(let p of e){let l=mt(o,p.canonical_code??p.code);for(let f of p.owned_states??[])l.kinds.add("owned_state"),l.probeIds.add(f.probe_id)}for(let p of t){let l=n.get(p.error_code);if(l===void 0)continue;i+=1;let f=mt(o,l);f.kinds.add("closed_domain"),f.probeIds.add(p.probe_id)}for(let p of r){let l=n.get(p.error_code);if(l===void 0)continue;s+=1;let f=mt(o,l);f.kinds.add("grammar"),f.probeIds.add(p.probe_id)}let a=e.map(p=>{let l=p.canonical_code??p.code,f=o.get(l),g=[...f.probeIds].sort();return{code:p.code,canonical_code:l,disposition:g.length>0?"executable":"uncovered",evidence_kinds:[...f.kinds].sort(),probe_ids:g}}).sort((p,l)=>p.code<l.code?-1:1),c=a.filter(({disposition:p})=>p==="uncovered").map(({code:p})=>p),d=a.length-c.length;return{ok:c.length===0,catalog_error_code_count:a.length,executable_error_code_count:d,uncovered_error_code_count:c.length,coverage_fraction:a.length===0?1:d/a.length,closed_domain_probe_count:i,grammar_probe_count:s,uncovered_error_codes:c,rows:a}}function gD(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: ${ln}`,`- Required executable canonical codes: ${un.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 oS(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 iS(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."},...oS(e)]}function SD(e){let t=[],r=new Set,n=0;e.length===0&&t.push({code:"empty_corpus",probe_id:"corpus",detail:"At least one real refusal observation is required."});for(let o of e){if(r.has(o.probe_id)){t.push({code:"duplicate_probe",probe_id:o.probe_id,detail:`${o.probe_id} was supplied more than once.`});continue}r.add(o.probe_id);let i=t.length;for(let s of iS(o))s!==void 0&&t.push(s);t.length===i&&(n+=1)}return t.sort((o,i)=>o.probe_id!==i.probe_id?o.probe_id.localeCompare(i.probe_id):o.code.localeCompare(i.code)),{ok:t.length===0,probe_count:r.size,closed_probe_count:n,closure_fraction:r.size===0?0:n/r.size,findings:t}}var mn="not-a-declared-action";function sS(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 de(e){return e.replaceAll(/[^a-z0-9]+/gu,"-").replaceAll(/^-|-$/gu,"")}function PD(e=je.filter(t=>Pt.some(r=>r.command===t.command&&r.disposition!=="package_owned"))){let t=new Set(e.filter(({command:r})=>!r.includes(" ")).map(({command:r})=>de(r)));return e.flatMap(r=>r.slots.flatMap((n,o)=>{if(!n.required)return[];let i=r.command.split(" "),s=de(r.command),a=i.length>1&&t.has(s)?i.map(de).join("--"):s,c=Z(r.command).flatMap(p=>p.required?[p.flag,...p.value_name?["example"]:[]]:[]),d=Ue.some(p=>p.command===r.command);return[{probe_id:`required-argument-${a}-${de(n.name)}`,command:r.command,refusal_args:[...i,...r.slots.slice(0,o).map(p=>sS(r.command,p)),...c],recovery_args:[...i,"--help"],error_code:d&&!r.command.startsWith("assurance ")?"invalid_argument_value":/^extension (?:activate|adopt|deactivate|uninstall)$/u.test(r.command)?"missing_lifecycle_target":"missing_required_argument",missing_argument:n.name,missing_argument_index:o}]})).sort((r,n)=>r.probe_id.localeCompare(n.probe_id))}function aS(e){switch(N(e)){case"assurance":case"workspace snapshot":return Ue.filter(({parent:t})=>t===e).map(({action:t})=>t);case"graph":return Ne;case"merge":return Le;case"plan":return Ke;case"profile":return We;case"schema":return Dt;default:throw new Error(`Required positional action family ${e} has no authoritative value domain.`)}}function MD(e=je){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-${de(t)}`,command:t,refusal_args:[...r,mn],recovery_args:[...r,"--help"],error_code:"unknown_subcommand",rejected_value:mn,allowed_values:[...aS(t)].sort()}}).sort((t,r)=>t.probe_id.localeCompare(r.probe_id))}function cS(e,t){let r=[...t].sort();return e.length===t.length&&[...e].sort().every((n,o)=>n===r[o])}function dS(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&&!cS(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 ID(e,t){let r=new Map(e.map(s=>[s.probe_id,s])),n=new Map(t.map(s=>[s.probe_id,s])),o=[...e.flatMap(s=>dS(s,n.get(s.probe_id))),...t.filter(s=>!r.has(s.probe_id)).map(s=>({code:"unexpected_refusal_probe",probe_id:s.probe_id,detail:`${s.probe_id} has no declared grammar refusal contract.`}))];o.sort((s,a)=>s.probe_id.localeCompare(a.probe_id)||s.code.localeCompare(a.code));let i=new Set(o.map(({probe_id:s})=>s));return{ok:o.length===0,probe_count:e.length,closed_probe_count:e.filter(({probe_id:s})=>!i.has(s)).length,findings:o}}var ft=[{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 kD(){return ft.map(e=>({...e}))}function pS(e,t){let r=[];t.error_code!==e.expected_error_code&&r.push({code:"error_code_mismatch",probe_id:e.probe_id,detail:`Expected ${e.expected_error_code}, received ${t.error_code}.`}),t.exit_code!==e.expected_exit_code&&r.push({code:"exit_code_mismatch",probe_id:e.probe_id,detail:`Expected exit ${e.expected_exit_code}, received ${t.exit_code}.`}),t.recovery_kind!==e.recovery_kind&&r.push({code:"recovery_kind_mismatch",probe_id:e.probe_id,detail:`Expected ${e.recovery_kind}, received ${t.recovery_kind}.`});let n=t.suggested_retry_args.indexOf("init"),o=n===0||n===2&&t.suggested_retry_args[0]==="--pm-path"&&t.suggested_retry_args[1]?.length>0;return e.recovery_kind==="initialize"&&!o&&r.push({code:"missing_init_recovery",probe_id:e.probe_id,detail:"Missing and uninitialized roots must emit a tokenized init retry."}),(t.unsafe_init_recommended||e.recovery_kind!=="initialize"&&t.suggested_retry_args.includes("init"))&&r.push({code:"unsafe_init_recovery",probe_id:e.probe_id,detail:"A tracker root that cannot be initialized safely must not recommend initialization."}),t.retry_succeeded||r.push({code:"retry_failed",probe_id:e.probe_id,detail:"The emitted retry or safe alternate-root recovery did not execute successfully."}),r}function ND(e){let t=new Map(e.map(o=>[o.probe_id,o])),r=[],n=0;for(let o of ft){let i=t.get(o.probe_id);if(i===void 0){r.push({code:"missing_probe",probe_id:o.probe_id,detail:"No runtime observation was supplied for this contract."});continue}let s=pS(o,i);r.push(...s),s.length===0&&(n+=1)}return r.sort((o,i)=>o.probe_id.localeCompare(i.probe_id)||o.code.localeCompare(i.code)),{ok:r.length===0,probe_count:ft.length,closed_probe_count:n,findings:r}}var Re,lS=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 uS(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=lS[N(e)];if(r===void 0)throw new Error(`Command ${e} exposes --full without a registered projection concept.`);return r}return t!=="--file"?t.slice(2):["create","update","update-many"].includes(N(e))?"linked-file-path":["comments","notes","learnings"].includes(N(e))?"entry-file-input":"plan-definition-file"}function Pe(){if(Re!==void 0)return Re;let t=ee.filter(({command:i})=>Be(i)).flatMap(({command:i,family:s})=>Mt(i,Z(i)).map(a=>({command:i,family:s,concept:uS(i,a.flag),flag:a.flag,aliases:Object.freeze([...a.aliases??[]]),value_kind:a.repeatable?"list":a.flag==="--limit"?"number":a.value_type}))),r=new Set(t.flatMap(i=>i.aliases.map(s=>`${i.command}:${s}`))),n=t.filter(i=>!r.has(`${i.command}:${i.flag}`)),o=new Map;for(let i of n){let s=o.get(i.concept)??new Set;s.add(i.value_kind),o.set(i.concept,s)}return Re=Object.freeze(n.map(i=>Object.freeze({...i,concept:o.get(i.concept)?.size===1?i.concept:`${i.concept}@${i.command}`}))),Re}function UD(){return Object.freeze(Pe().map(e=>Object.freeze({command:e.command,canonical_flag:e.flag,accepted_spellings:Object.freeze([...new Set([e.flag,...e.aliases])].sort())})))}var fn=Object.freeze({init:30,item:20,config:36,extension:55,package:56,packages:56,install:27,upgrade:29,create:104,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:36,events:34,"history-attest":23,"history-redact":27,"history-repair":28,"history-compact":30,"history-author-acknowledge":28,merge:29,schema:43,profile:22,activity:36,restore:23,update:105,"update-many":146,close:32,"close-many":72,delete:24,append:25,comments:32,notes:36,learnings:32,files:41,docs:32,deps:32,plan:111,test:58,"test-all":41,telemetry:21,stats:29,health:36,validate:46,assurance:30,gc:22,workspace:23,contracts:29,claim:40,release:25,"start-task":24,"pause-task":23,"close-task":24,meet:33,event:33,remind:29,"test-runs-worker":20}),mS=1,_n=Object.freeze(Object.fromEntries(Object.entries({...fn,...Object.fromEntries(ve.flatMap(({alias:e,canonical:t})=>{let r=fn[e];return r===void 0?[]:[[t,r]]}))}).map(([e,t])=>[e,t+mS])));function hn(){let e=new Map(Object.keys(_n).map(t=>[t,0]));for(let{command:t}of Pe())e.set(t,Number(e.get(t))+1);return Object.freeze(Object.entries(_n).map(([t,r])=>Object.freeze({command:t,current:Number(e.get(t)),maximum:r})))}function fS(e,t,r){for(let n of e)for(let o of n.aliases){let i=t.get(`${n.command}:${o}`);i===void 0||i.flag===n.flag||r.push({code:"alias_collision",command:n.command,detail:`${o} aliases ${n.flag} but is canonical for ${i.flag}.`})}}function _S(e,t,r){let n=new Set(t.map(({command:o})=>o));for(let o of e.keys())n.has(o)||r.push({code:"missing_budget",command:o,detail:`${o} has canonical flags but no persisted budget.`});for(let o of t){let i=e.get(o.command)??0;i===0&&r.push({code:"stale_budget",command:o.command,detail:`${o.command} has a persisted budget but no canonical flags.`}),!(i<=o.maximum)&&r.push({code:"budget_exceeded",command:o.command,detail:`${i} canonical flags exceed the ratcheted maximum ${o.maximum}.`})}}function hS(e,t,r){let n=new Map(e.map(o=>[`${o.command}:${o.flag}`,o]));for(let o of t){let i=`${o.command}:${o.canonical_flag}`,s=n.get(i);if(!s){r.push({code:"removed_canonical_spelling",command:o.command,detail:`${o.canonical_flag} disappeared from the executable spelling inventory.`});continue}let a=new Set([s.flag,...s.aliases]);for(let c of o.accepted_spellings)a.has(c)||r.push({code:"removed_compatibility_spelling",command:o.command,detail:`${c} no longer resolves to ${o.canonical_flag}.`})}}function jD(e=Pe(),t=hn(),r=[]){let n=[],o=new Map,i=new Map,s=new Map,a=new Map;for(let c of e){let d=`${c.command}:${c.flag}`;o.has(d)?n.push({code:"duplicate_canonical_flag",command:c.command,detail:`${c.flag} has more than one canonical row.`}):o.set(d,c),a.set(c.command,(a.get(c.command)??0)+1);let p=i.get(c.concept);p!==void 0&&p!==c.value_kind?n.push({code:"inconsistent_concept_kind",command:c.command,detail:`${c.concept} uses both ${p} and ${c.value_kind}.`}):i.set(c.concept,c.value_kind);let l=s.get(c.concept);l!==void 0&&l!==c.flag?n.push({code:"semantic_spelling_collision",command:c.command,detail:`${c.concept} is canonicalized by both ${l} and ${c.flag}.`}):s.set(c.concept,c.flag)}return fS(e,o,n),_S(a,t,n),hS(e,r,n),n.sort((c,d)=>c.command.localeCompare(d.command)||c.code.localeCompare(d.code)||c.detail.localeCompare(d.detail)),{ok:n.length===0,entry_count:e.length,budget_count:t.length,concept_count:new Set(e.map(({concept:c})=>c)).size,baseline_entry_count:r.length,findings:n}}function BD(){let e=Pe(),t=hn(),r=new Map(t.map(({command:o})=>[o,"unknown"]));for(let{command:o,family:i}of e)r.set(o,i);return["# Generated flag lexicon budgets","","This file is generated by `listPmFlagLexicon()`. Compatibility aliases do not consume canonical budget.","","| Command | Capability family | Canonical flags | Maximum |","| --- | --- | ---: | ---: |",...t.map(({command:o,current:i,maximum:s})=>{let a=r.get(o);return`| \`${o}\` | ${a} | ${i} | ${s} |`}),""].join(`
34
+ `)}function zD(e){return e}function HD(e){return e}function VD(e){return e}function KD(e){return e}function WD(e){return e}function YD(e){return e}function XD(e){return e}function JD(e){return e}function QD(e){return e}function ZD(e){return e}function eF(e){return e}function tF(e){return e}function rF(e){return e}function nF(e){return{handled:!0,result:e}}function oF(){return{handled:!1}}function iF(e){return e}function sF(e){return e}function aF(e){return e}function cF(e){return e}function dF(e){return e}function pF(e){return e}function lF(e){return e}function uF(e){return e}function mF(e){return e}function gS(e={},t={}){return new _e(t).extension(void 0,{...e,migrate:!0})}function CS(e={},t={}){return new _e(t).packageMigrate(e)}function k(e){if(typeof e!="string"||!At(e))throw new TypeError("Invalid reliability timestamp.");return Date.parse(e)}function yS(e){let t=k(e.window_start),r=k(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(n=>typeof n!="string"||n.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 SS(e,t,r,n){let o=new Map(t.map(s=>[s,[]])),i=new Set;for(let s of e){if(typeof s.id!="string"||s.id.trim().length===0||i.has(s.id))throw new TypeError("Invalid or duplicate reliability attempt identity.");i.add(s.id);let a=o.get(s.family);if(!a||!["success","failure","pending"].includes(s.outcome)||s.cause!==void 0&&(!["product","infrastructure","unknown"].includes(s.cause)||s.outcome!=="failure"))throw new TypeError("Invalid reliability attempt family, outcome or cause.");let c=k(s.started_at);if(s.repaired_at!==void 0&&(k(s.repaired_at)<c||s.outcome!=="failure"))throw new TypeError("Invalid reliability repair chronology.");c>=r&&c<n&&a.push(s)}return o}function vF(e,t){let{start:r,end:n}=yS(t),i=[...SS(e,t.families,r,n)].map(([s,a])=>{let c=a.filter(_=>_.outcome==="failure"),d=a.filter(_=>_.outcome!=="pending").length,p=d===0?null:c.length/d,l=c.filter(_=>_.repaired_at!==void 0&&k(_.repaired_at)<n),f={product:0,infrastructure:0,unknown:0};for(let _ of c)f[_.cause??"unknown"]+=1;let g=[];return d<t.min_completed_attempts&&g.push("insufficient_completed_attempts"),p!==null&&p>t.max_failure_rate&&g.push("failure_rate"),{family:s,attempts:a.length,completed:d,failed:c.length,pending:a.length-d,failure_rate:p,affected_days:[...new Set(c.map(_=>new Date(k(_.started_at)).toISOString().slice(0,10)))].sort(),repair_minutes:l.map(_=>(k(_.repaired_at)-k(_.started_at))/6e4).sort((_,y)=>_-y),unresolved:c.length-l.length,causes:f,violations:g,ok:g.length===0}});return{schema:"pm-reliability-window/1",window_start:new Date(r).toISOString(),window_end:new Date(n).toISOString(),ok:i.every(s=>s.ok),families:i}}function pe(e){return typeof e=="string"&&e.length>0&&e.trim()===e}function TS(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 n=new Set(r.identities);if(n.size!==r.identities.length||[...n].some(o=>!pe(o)))throw new TypeError("Invalid or duplicate artifact identity.");t.set(r.name,n)}if([...t.values()].every(r=>r.size===0))throw new TypeError("Empty inventories cannot establish artifact reconciliation.");return t}function ES(e,t){if(!Array.isArray(e))throw new TypeError("Expected unique evidence-backed artifact exceptions.");let r=new Map;for(let n of e){if(n===null||typeof n!="object"||!pe(n.identity)||r.has(n.identity)||!pe(n.reason)||!pe(n.evidence))throw new TypeError("Expected unique evidence-backed artifact exceptions.");let o=n.missing_from;if(!Array.isArray(o)||o.length===0||o.length>=t.length||new Set(o).size!==o.length||[...o].some(i=>!t.includes(i)))throw new TypeError("Invalid artifact exception ledger signature.");r.set(n.identity,n)}return r}function NF(e,t=[]){let r=TS(e),n=[...r.keys()].sort(),o=ES(t,n),i=[...new Set([...r.values()].flatMap(d=>[...d]))].sort(),s=[],a=new Set;for(let d of i){let p=n.filter(g=>!r.get(g).has(d));if(p.length===0)continue;let l=o.get(d),f=l!==void 0&&JSON.stringify([...l.missing_from].sort())===JSON.stringify(p);f&&a.add(d),s.push({identity:d,present_in:n.filter(g=>r.get(g).has(d)),missing_from:p,disposition:f?{reason:l.reason,evidence:l.evidence}:null})}let c=[...o.keys()].filter(d=>!a.has(d)).sort();return{schema:"pm-artifact-ledgers/1",ok:s.every(d=>d.disposition!==null)&&c.length===0,counts:Object.fromEntries(n.map(d=>[d,r.get(d).size])),findings:s,stale_exceptions:c}}import{createHash as Cn,createHmac as AS,randomBytes as xS,timingSafeEqual as bS}from"node:crypto";var C1="dev.unbrained.pm/progressive-tool-discovery",y1=Object.freeze({version:1,discoveryTool:"pm_discover",canonicalResult:"structuredContent.result",compatibilityText:"pointer"}),wS=Object.freeze(["pm_discover","pm_next","pm_context","pm_search","pm_get"]),j=Object.freeze({lexical:.4,semantic:.2,graph:.1,permission:.15,freshness:.05,usage:.1}),OS=Object.freeze(["profile_changed","tool_contract_changed","workspace_extension_changed","authorization_changed","ranking_signal_changed","cursor_integrity_key_rotated"]),yn={core:0,standard:1,full:2,internal:3},Sn=Object.freeze(["core","standard","full"]),RS=new Set(["core","standard","full","custom"]),Tn=new Set(ee.map(({family:e})=>e)),PS=xS(32);function Ie(e,t){if(typeof e!="string")throw new S(`pm tool discovery ${t} must be a string of at most 4096 Unicode characters.`,64);let r=e[Symbol.iterator](),n=0;for(let o=r.next();!o.done;o=r.next())if(n+=1,n>4096)throw new S(`pm tool discovery ${t} must be a string of at most 4096 Unicode characters.`,64);return e}function En(e){if(!Number.isInteger(e)||Number(e)<1||Number(e)>100)throw new S("pm tool discovery limit must be from 1 through 100.",64);return Number(e)}function An(e){if(e!=="unbounded"&&(!Number.isInteger(e)||Number(e)<128))throw new S("pm tool discovery outputBudget must be unbounded or an integer of at least 128.",64);return e==="unbounded"?e:Number(e)}function xn(e){if(e!==void 0&&typeof e!="boolean")throw new S("pm tool discovery includeSchema must be a boolean.",64);return e===!0}function bn(e){if(e===null||typeof e!="object"||Array.isArray(e))throw new S("pm tool discovery options must be an object.",64)}function MS(e){if(!Array.isArray(e))throw new S("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 S(`pm tool discovery candidate ${t} must be an object.`,64);if(typeof r.name!="string"||r.name.trim().length===0)throw new S(`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 S(`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 S(`pm tool discovery candidate ${t} inputSchema must be an object.`,64);if(r.authorized!==void 0&&typeof r.authorized!="boolean")throw new S(`pm tool discovery candidate ${t} authorized must be a boolean.`,64)}}function S1(e){if(bn(e),e.family!==void 0&&(typeof e.family!="string"||!Tn.has(e.family)))throw new S("pm tool discovery family must be a declared capability family.",64);if(e.tier!==void 0&&(typeof e.tier!="string"||!Sn.includes(e.tier)))throw new S("pm tool discovery tier must be core, standard, or full.",64);return{...e.query!==void 0?{query:Ie(e.query,"query")}:{},...e.family!==void 0?{family:e.family}:{},...e.tier!==void 0?{tier:e.tier}:{},...e.limit!==void 0?{limit:En(e.limit)}:{},...e.cursor!==void 0?{cursor:Ie(e.cursor,"cursor")}:{},...e.includeSchema!==void 0?{includeSchema:xn(e.includeSchema)}:{},...e.outputBudget!==void 0?{outputBudget:An(e.outputBudget)}:{}}}function IS(e){return e===void 0||!Number.isFinite(e)?0:Math.min(1,Math.max(0,e))}function le(e){return[...new Set(e.toLowerCase().match(/[a-z0-9]+/gu)??[])].sort()}function vS(e,t){let r=le(e);if(r.length===0)return 0;let n=new Set(le(t)),o=r.filter(s=>n.has(s)).length,i=t.toLowerCase().includes(e.toLowerCase())?.25:0;return Math.min(1,o/r.length+i)}function kS(e,t){let r=le(e);if(r.length===0)return 0;let n=t.toLowerCase(),o=le(t),i=r.filter(a=>o.some(c=>c.startsWith(a)||a.startsWith(c))).length,s=n.includes(e.toLowerCase())?.2:0;return Math.min(1,i/r.length+s)}function gn(e){return Cn("sha256").update(JSON.stringify(e)).digest("hex").slice(0,24)}function wn(e,t,r){return AS("sha256",r).update(JSON.stringify({version:1,fingerprint:e,offset:t})).digest("base64url")}function NS(e,t,r){let n={version:1,offset:t,signature:wn(e,t,r)};return Buffer.from(JSON.stringify(n),"utf8").toString("base64url")}function LS(e,t,r,n){if(e===void 0)return 0;try{let o=JSON.parse(Buffer.from(e,"base64url").toString("utf8")),i=o.offset;if(o.version!==1||typeof i!="number"||!Number.isInteger(i)||i<0||i>r||typeof o.signature!="string")throw new Error("cursor fields do not match the request");let s=Buffer.from(wn(t,i,n),"base64url"),a=Buffer.from(o.signature,"base64url");if(a.length!==s.length||!bS(a,s))throw new Error("cursor signature does not match the request");return i}catch(o){throw new S("Invalid or stale pm tool discovery cursor; restart discovery without cursor.",64,{reason:String(o)})}}function _t(e,t,r){return{value:IS(e),weight:t,available:r!=="unavailable",source:r}}function Me(e,t,r){return _t(e??t,r,e===void 0?"computed":"host")}function $S(e,t,r){let n=Object.hasOwn(fe,e.name)?fe[e.name]:"help",o=ze(n),i=`${e.name} ${e.description} ${n} ${o}`,s=vS(t,i),a=new Set(le(t)),c={lexical:_t(s,j.lexical,"computed"),semantic:Me(e.signals?.semantic,kS(t,i),j.semantic),graph:Me(e.signals?.graph,a.has(o)||a.has(n)?1:0,j.graph),permission:_t(1,j.permission,"authorization"),freshness:Me(e.signals?.freshness,1,j.freshness),usage:Me(e.signals?.usage,wS.includes(e.name)?1:0,j.usage)},d=Object.values(c).reduce((p,l)=>p+l.value*l.weight,0);return{name:e.name,description:e.description,command:n,tier:He(n),family:o,score:Number(d.toFixed(6)),signals:c,...r?{input_schema:structuredClone(e.inputSchema)}:{}}}function DS(e){if(e.cursorIntegrityKey!==void 0&&(!(e.cursorIntegrityKey instanceof Uint8Array)||e.cursorIntegrityKey.byteLength<32))throw new S("pm tool discovery cursorIntegrityKey must contain at least 32 bytes.",64);if(e.tier!==void 0&&(typeof e.tier!="string"||!Sn.includes(e.tier)))throw new S("pm tool discovery tier must be core, standard, or full.",64);if(e.family!==void 0&&(typeof e.family!="string"||!Tn.has(e.family)))throw new S("pm tool discovery family must be a declared capability family.",64);if(e.profile!==void 0&&(typeof e.profile!="string"||!RS.has(e.profile)))throw new S("pm tool discovery profile must be core, standard, full, or custom.",64)}function FS(e){let r=Ie(e.query===void 0?"":e.query,"query").trim().replace(/\s+/gu," ");Ie(e.cursor===void 0?"":e.cursor,"cursor");let n=En(e.limit===void 0?10:e.limit),o=An(e.outputBudget===void 0?1200:e.outputBudget);return DS(e),{query:r,includeSchema:xn(e.includeSchema),limit:n,budget:o,maximumTier:yn[e.tier??"full"],profile:e.profile===void 0?"core":e.profile}}function On(e,t,r){let n=r??e.tools.reduce((s,a,c)=>s+(c===0?0:1)+Buffer.byteLength(JSON.stringify(a),"utf8"),0),o={...e,tools:[]},i=0;for(let s=0;s<4;s+=1){let a=Buffer.byteLength(JSON.stringify({...o,token_cost:{estimated_tokens:i,budget:t,within_budget:!0}}),"utf8"),c=Math.ceil((a+n)/4);if(c===i)break;i=c}return i}function GS(e,t,r){return e.filter(n=>n.authorized!==!1).map(n=>$S(n,r.query,r.includeSchema)).filter(n=>n.tier!=="internal"&&yn[n.tier]<=r.maximumTier&&(t.family===void 0||n.family===t.family)).sort((n,o)=>o.score-n.score||(n.name<o.name?-1:n.name>o.name?1:0))}function US(e,t,r){if(t==="unbounded")return[...e];let n=[],o=0;for(let[i,s]of e.entries()){let a=o+(i===0?0:1)+Buffer.byteLength(JSON.stringify(s),"utf8");if(On(r(i+1),t,a)>t)break;n.push(s),o=a}return n}function T1(e,t={}){MS(e),bn(t);let r=FS(t),n=t.cursorIntegrityKey??PS,o=GS(e,t,r),i=gn({query:r.query,family:t.family??null,tier:t.tier??"full",includeSchema:r.includeSchema,profile:r.profile,ranked:o}),s=LS(t.cursor,i,o.length,n),a=o.slice(s,s+r.limit),c=[];r.includeSchema||c.push({name:"input_schema",reason:"compact_projection",restore_with:"Set includeSchema=true."}),s+r.limit<o.length&&c.push({name:"tools",reason:"limit",restore_with:"Continue with next_cursor or increase limit."});let d={result_type:"pm_tool_discovery",contract_version:1,query:r.query,profile:r.profile,total:o.length,ranking_policy:{version:1,formula:"weighted_sum_then_name",weights:j},cache:{key:gn({fingerprint:i,cursorIntegrityKey:Cn("sha256").update(n).digest("hex"),limit:r.limit,offset:s,budget:r.budget}),ttl_ms:3e4,scope:"private",invalidates_on:OS}},p=(_,y=_.length)=>{let E=s+y,B=E<o.length,O=[...c];return y<a.length&&O.push({name:"tools",reason:"token_budget",restore_with:"Continue with next_cursor or increase outputBudget."}),{...d,tools:[..._],returned:y,has_more:B,...B?{next_cursor:NS(i,E,n)}:{},omission_receipt:{has_omissions:O.length>0,omitted:O}}},l=_=>{let y=p(_),E=On(y,r.budget);return{...y,token_cost:{estimated_tokens:E,budget:r.budget,within_budget:r.budget==="unbounded"||E<=r.budget}}},f=US(a,r.budget,_=>p([],_)),g=l(f);if(a.length>0&&f.length===0){let _=l([a[0]]).token_cost.estimated_tokens;throw new S(`pm tool discovery outputBudget is too small to return a tool; increase it to at least ${_}.`,64,{required:String(_)})}if(r.budget!=="unbounded"&&g.token_cost.estimated_tokens>r.budget)throw new S(`pm tool discovery outputBudget is too small; at least ${g.token_cost.estimated_tokens} estimated tokens are required for this page.`,64,{required:String(g.token_cost.estimated_tokens)});return g}export{vR as ACTIONABILITY_ORDERING_KINDS,rd as ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS,dc as ACTIVITY_FLAG_CONTRACTS,ti as AGENT_PROVENANCE_DIMENSIONS,Vs as AGGREGATE_FLAG_CONTRACTS,ka as APPEND_FLAG_CONTRACTS,nv as ASSURANCE_ACTIONS,ov as ASSURANCE_DECLARATION_KINDS,fM as ASSURANCE_DOCUMENT_VERSION,Za as ASSURANCE_FLAG_CONTRACTS,_M as ASSURANCE_GATE_TRIGGERS,hM as ASSURANCE_MEASUREMENT_SOURCE_KINDS,aI as ASSURANCE_PRESET_IDS,pM as AssuranceEvaluationRefusalError,dM as AssuranceMutationRefusalError,lM as AssuranceSourceResolutionError,Uo as BASELINE_ITEM_FORMAT_VERSION,uP as BOUNDARY_FIXTURE_CAPTURE_SOURCES,lR as BRIEF_LIST_FIELDS,ni as BUILTIN_AGENT_PROVENANCE_ADAPTERS,W as BUILTIN_CORPUS_SHAPES,ri as BUILTIN_HARNESS_SIGNAL_DESCRIPTORS,po as BUILTIN_ITEM_TYPE_VALUES,Vt as BUILTIN_PROFILES,Bx as BUILTIN_RELATIONSHIP_KINDS,Zc as CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS,cc as CALENDAR_FLAG_CONTRACTS,Na as CLAIM_FLAG_CONTRACTS,Kd as CLOSE_ACTION_OPTION_KEYS,Ia as CLOSE_FLAG_CONTRACTS,va as CLOSE_MANY_FLAG_CONTRACTS,Ua as CLOSE_TASK_FLAG_CONTRACTS,Ao as COMMAND_SHELL_ENV,Ks as COMMENTS_FLAG_CONTRACTS,AT as COMMON_MUTATION_COMMAND_OPTION_KEYS,Tc as COMPLETION_FLAG_CONTRACTS,ho as CONFIDENCE_TEXT_VALUES,ca as CONFIG_FLAG_CONTRACTS,ed as CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS,Bv as CONTEXT_EVALUATION_METRIC_NAMES,lc as CONTEXT_FLAG_CONTRACTS,sx as CONTEXT_INTENT_LIMIT_OVERRIDE_WARNING,qt as CONTEXT_OUTPUT_VALUES,Kv as CONTEXT_PACKING_PROFILES,Nv as CONTEXT_RECENCY_EPOCH,Fv as CONTEXT_RELEVANCE_SERVICE,$v as CONTEXT_RELEVANCE_SIGNAL_NAMES,Xv as CONTEXT_SIGNAL_SET_VERSION,Yv as CONTEXT_SIGNAL_STORE_FORMAT_VERSION,Jv as CONTEXT_SIGNAL_STORE_WARNING_DETAILS,YA as CONTEXT_USAGE_LIMITS,Sc as CONTRACTS_FLAG_CONTRACTS,oc as COPY_FLAG_CONTRACTS,Sd as CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,Ed as CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,Td as CREATE_COMMANDER_STRING_OPTION_CONTRACTS,HS as CREATE_DIRECT_CLOSE_REASON_DEFAULT,ec as CREATE_FLAG_CONTRACTS,cE as CURRENT_HISTORY_HASH_ALGORITHM,Rx as CURRENT_HISTORY_ITEM_HASH_VERSION,Mx as CURRENT_HISTORY_RECORD_HASH_VERSION,jo as CURRENT_ITEM_FORMAT_VERSION,tk as ContextSignalStore,XA as ContextUsageValidationError,Ov as DEFAULT_AUTHOR_IDENTITY_VOCABULARY,Ck as DEFAULT_CHILD_SAMPLE_LIMIT,pR as DEFAULT_COMPACT_LIST_FIELDS,Kw as DEFAULT_DERIVED_INDEX_MINIMUM_ITEMS,$f as DEFAULT_EVAL_QUERIES_RELATIVE_PATH,nI as DEFAULT_RELATIONSHIP_CONTEXT_TOKEN_BUDGET,Cv as DEFAULT_TERMINAL_TRANSITION_POLICY,ik as DEFAULT_WORKSPACE_MEMORY_MINIMUM_ITEMS,CP as DEFECT_ESCAPE_CLASSES,yP as DEFECT_GATE_EVIDENCE_DISPOSITIONS,$a as DELETE_FLAG_CONTRACTS,mo as DEPENDENCY_KIND_VALUES,fc as DEPS_FLAG_CONTRACTS,Js as DOCS_FLAG_CONTRACTS,Xa as DUPLICATES_FLAG_CONTRACTS,LI as DURABLE_MERGE_RECEIPT_INTRODUCED_AT,AP as DefectRecurrencePolicyParseError,hc as EVAL_FLAG_CONTRACTS,Pf as EVAL_METRIC_NAMES,kf as EVAL_QUERY_SET_CONTRACT,Nf as EVAL_QUERY_SET_EXAMPLE,vf as EVAL_QUERY_SET_SCHEMA_ID,pc as EVENTS_FLAG_CONTRACTS,Ba as EVENT_FLAG_CONTRACTS,$n as EXECUTABLE_COMMAND_ALIASES,ue as EXIT_CODE,Sa as EXTENSION_ACTIVATE_FLAG_CONTRACTS,ya as EXTENSION_ADOPT_ALL_FLAG_CONTRACTS,Oa as EXTENSION_ADOPT_FLAG_CONTRACTS,Yk as EXTENSION_CAPABILITIES,qS as EXTENSION_CAPABILITY_CONTRACT,jS as EXTENSION_CAPABILITY_CONTRACT_VERSION,BS as EXTENSION_CAPABILITY_LEGACY_ALIASES,Vi as EXTENSION_CAPABILITY_REGISTRATION_SURFACES,wa as EXTENSION_CATALOG_FLAG_CONTRACTS,Ta as EXTENSION_DEACTIVATE_FLAG_CONTRACTS,Ca as EXTENSION_DESCRIBE_FLAG_CONTRACTS,ba as EXTENSION_DOCTOR_FLAG_CONTRACTS,ha as EXTENSION_EXPLORE_FLAG_CONTRACTS,da as EXTENSION_FLAG_CONTRACTS,la as EXTENSION_INIT_FLAG_CONTRACTS,fa as EXTENSION_INSTALL_FLAG_CONTRACTS,ga as EXTENSION_INVENTORY_FLAG_CONTRACTS,Aa as EXTENSION_MANAGE_FLAG_CONTRACTS,Ea as EXTENSION_MIGRATE_FLAG_CONTRACTS,Xk as EXTENSION_POLICY_MODES,Jk as EXTENSION_POLICY_SURFACES,xa as EXTENSION_RELOAD_FLAG_CONTRACTS,Zk as EXTENSION_SANDBOX_PROFILES,pa as EXTENSION_SCOPE_FLAG_CONTRACTS,Qk as EXTENSION_TRUST_MODES,_a as EXTENSION_UNINSTALL_FLAG_CONTRACTS,LP as EXTERNAL_DEPENDENCY_RESOLUTION_STATUSES,kP as EXTERNAL_DEPENDENCY_SOURCE_KIND,NP as EXTERNAL_DEPENDENCY_SOURCE_KIND_ALIAS,AO as ExtensionCommandError,Xs as FILES_FLAG_CONTRACTS,ic as FOCUS_FLAG_CONTRACTS,Wa as GC_FLAG_CONTRACTS,_R as GET_DEPTH_INPUT_VALUES,fR as GET_DEPTH_VALUES,uc as GET_FLAG_CONTRACTS,zs as GLOBAL_FLAG_CONTRACTS,du as GRAPH_DURABLE_CACHE_MIN_ITEMS,cu as GRAPH_DURABLE_CACHE_VERSION,_c as GRAPH_FLAG_CONTRACTS,dR as GRAPH_QUERY_DEFAULTS,Ne as GRAPH_SUBCOMMAND_VALUES,mc as GUIDE_FLAG_CONTRACTS,Ja as HEALTH_FLAG_CONTRACTS,ra as HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS,ZM as HISTORY_AUTHOR_ATTRIBUTION_BASELINE,dv as HISTORY_COMPACT_BULK_DEFAULT_MIN_ENTRIES,na as HISTORY_COMPACT_FLAG_CONTRACTS,gi as HISTORY_EVENT_CLASSIFICATION_VERSION,Qs as HISTORY_FLAG_CONTRACTS,sE as HISTORY_HASH_ALGORITHMS,Lw as HISTORY_ITEM_HASH_VERSION_3_INTRODUCED_IN,ea as HISTORY_REDACT_FLAG_CONTRACTS,ta as HISTORY_REPAIR_FLAG_CONTRACTS,Hp as INIT_AGENT_GUIDANCE_MODE_VALUES,aa as INIT_FLAG_CONTRACTS,Ra as INSTALL_FLAG_CONTRACTS,gI as IN_PROGRESS_WORK_DETAIL_LIMIT,_o as ISSUE_SEVERITY_VALUES,rc as ITEM_COMPLETE_FLAG_CONTRACTS,wI as ITEM_LATEST_TIMESTAMP_FIELDS,zS as ITEM_METADATA_KEY_ORDER,tc as ITEM_MUTATE_FLAG_CONTRACTS,nc as ITEM_REOPEN_FLAG_CONTRACTS,wc as ITEM_REVISION_CONFLICT_CHANGE_LIMIT,bc as ITEM_REVISION_CONFLICT_CODE,yI as ITEM_SCALAR_MISSING_VALUE,lo as ITEM_TYPE_VALUES,bI as ITEM_UNION_COLLECTION_FIELDS,ek as JsonFileContextSignalStoreAdapter,Ys as LEARNINGS_FLAG_CONTRACTS,aE as LEGACY_HISTORY_HASH_ALGORITHM,ul as LINKED_ARTIFACT_NOTE_CONFLICT_MODES,Yu as LINKED_TEST_ENV_NAME_PATTERN,Xu as LINKED_TEST_PM_CONTEXT_MODE_VALUES,Wu as LINKED_TEST_PROTECTED_ENV_KEYS,Ju as LINKED_TEST_WORKSPACE_CONTEXT_MODE_VALUES,Jc as LIST_COMMANDER_STRING_OPTION_CONTRACTS,uR as LIST_COMMAND_DEFAULT_PROJECTIONS,tN as LIST_FILTER_EXTENSION_FLAG_DEFINITIONS,Hs as LIST_FILTER_FLAG_CONTRACTS,qP as LIST_SORT_FIELDS,zP as LIST_SORT_ORDER_VALUES,Ci as MAINTENANCE_HISTORY_OPERATIONS,gk as MAX_CHILD_PROJECTION_ITEMS,mP as MAX_WAIVER_NOTICE_DAYS,JS as MAX_WORKFLOW_POLICIES,QS as MAX_WORKFLOW_POLICY_TERMS,ja as MEET_FLAG_CONTRACTS,Fk as MERGE_DRIVER_ARTIFACT_VALUES,Zs as MERGE_FLAG_CONTRACTS,Le as MERGE_SUBCOMMAND_VALUES,jk as MUTATION_EVENT_WIRE_BUDGET,ie as MemoryRelationshipGraphAdapter,td as NEXT_COMMANDER_STRING_OPTION_CONTRACTS,Cc as NEXT_FLAG_CONTRACTS,Jm as NEXT_OUTPUT_VALUES,wv as NEXT_RANKING_POLICIES,Ws as NOTES_FLAG_CONTRACTS,WR as OutputEnvelopeFitError,ua as PACKAGE_FLAG_CONTRACTS,ma as PACKAGE_INIT_FLAG_CONTRACTS,Ga as PAUSE_TASK_FLAG_CONTRACTS,Vd as PLAN_CREATE_METADATA_PARAMETER_KEYS,sa as PLAN_FLAG_CONTRACTS,Us as PLAN_SHOW_DEPTH_VALUES,Ke as PLAN_SUBCOMMANDS,cf as PLAN_TEMPLATE_NAMES,ky as PM_AGENT_TASK_ACCOUNTING_MODES,pt as PM_AGENT_TASK_TRANSCRIPT_VERSION,vn as PM_BULK_LIFECYCLE_COMMAND_ALIASES,ps as PM_CLI_ERROR_DETAILS_LIMITS,hs as PM_CLI_EXPECTED_ERROR_NAME,ER as PM_CLI_GRAMMAR_CONTRACT,gR as PM_CLI_GRAMMAR_NOUNS,Yn as PM_CLI_ONLY_TOOL_ACTION_WAIVERS,CR as PM_CLI_SHARED_VERBS,Ln as PM_COMMAND_ALIAS_CONTRACTS,ee as PM_COMMAND_CAPABILITY_CONTRACTS,Pt as PM_COMMAND_DESTINATION_CONTRACTS,oM as PM_COMMAND_EXIT_CONTRACTS,nM as PM_COMMAND_EXIT_OUTCOME_CONTRACTS,Mi as PM_COMMAND_OUTPUT_BUDGET_CONTRACTS,eM as PM_COMMAND_OUTPUT_ENVELOPE_CONTRACTS,je as PM_COMMAND_POSITIONAL_CONTRACTS,fp as PM_COMMAND_VISIBILITY_CONTRACTS,KM as PM_COMPLETE_LIST_FINDING_CODES,UR as PM_CONTEXT_INTENTS_FILE,ax as PM_CONTEXT_INTENT_CONTRACTS,In as PM_CONTEXT_OPS_COMMAND_ALIASES,Hn as PM_CORE_COMMAND_NAMES,F as PM_CORPUS_SHAPE_SCHEMA,Jn as PM_DEPRECATED_TOOL_ACTIONS,bi as PM_DIAGNOSTIC_DEGRADATION_STEPS,wi as PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS,xi as PM_DIAGNOSTIC_OUTPUT_CLASSES,Qn as PM_DISCOVERABLE_TOOL_ACTIONS,Yr as PM_EPISODE_SCHEMA,QP as PM_ERROR_CODE_CATALOG,WP as PM_ERROR_CODE_EXIT_CLASS_CONTRACTS,tn as PM_EXACT_COVERAGE_METRICS,Gn as PM_EXTENSION_CAPABILITY_CONTRACTS,Vn as PM_EXTENSION_PACKAGE_ACTION_SUBCOMMANDS,jn as PM_EXTENSION_POLICY_MODE_CONTRACTS,zn as PM_EXTENSION_POLICY_SURFACE_CONTRACTS,qn as PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS,Un as PM_EXTENSION_SERVICE_NAME_CONTRACTS,Bn as PM_EXTENSION_TRUST_MODE_CONTRACTS,$i as PM_GENERIC_REFUSAL_GUIDANCE,FM as PM_GITATTRIBUTES_END,DM as PM_GITATTRIBUTES_START,UM as PM_GITATTRIBUTES_V2_END,GM as PM_GITATTRIBUTES_V2_START,Ep as PM_GITIGNORE_END,Tp as PM_GITIGNORE_START,mv as PM_HISTORY_ATTESTATION_CONTRACT,Mn as PM_HISTORY_COMMAND_ALIASES,eE as PM_HISTORY_OPERATION_ALIASES,rE as PM_HISTORY_OPERATION_CONTRACT,tE as PM_HISTORY_OPERATION_PATTERNS,Wn as PM_ITEM_ACTION_SUBCOMMANDS,QT as PM_ITEM_HISTORY_OPERATIONS,nt as PM_MCP_APPS_EXTENSION,vr as PM_MCP_APPS_SERVER_CAPABILITY,Ae as PM_MCP_APPS_SPEC_VERSION,Lr as PM_MCP_APP_CONTRACTS,Nr as PM_MCP_APP_MIME_TYPE,wS as PM_MCP_ENTRY_TOOL_NAMES,m as PM_MCP_ERROR_CODES,hL as PM_MCP_HTTP_PROTOCOL_VERSION,Yg as PM_MCP_INPUT_REQUEST_METHODS,or as PM_MCP_LEGACY_PROTOCOL_VERSIONS,nr as PM_MCP_LOG_LEVELS,x as PM_MCP_META_KEYS,C1 as PM_MCP_PROGRESSIVE_DISCOVERY_EXTENSION,y1 as PM_MCP_PROGRESSIVE_DISCOVERY_SERVER_CAPABILITY,yp as PM_MCP_PROMPT_CONTRACTS,z as PM_MCP_PROTOCOL_VERSION,Cp as PM_MCP_RESOURCE_CONTRACTS,it as PM_MCP_SKILLS_DRAFT_REVISION,$r as PM_MCP_SKILLS_EXTENSION,ty as PM_MCP_SKILLS_SERVER_CAPABILITY,P as PM_MCP_SKILL_LIMITS,Te as PM_MCP_SUBSCRIPTION_ID_META_KEY,te as PM_MCP_SUPPORTED_PROTOCOL_VERSIONS,cL as PM_MCP_TASKS_EXTENSION,sC as PM_MCP_TASK_STATUSES,fe as PM_MCP_TOOL_COMMAND_CONTRACTS,BE as PM_MODE_PAIRED_OUTPUT_PROJECTION_CONTRACTS,Ss as PM_MUTATION_ACTION_CONTRACTS,ve as PM_NAMESPACED_COMMAND_ALIASES,Kr as PM_OBSERVATION_SCHEMA,Ai as PM_OUTPUT_BUDGET_CLASSES,Ei as PM_OUTPUT_DEGRADATION_STEPS,Nt as PM_OUTPUT_ENVELOPE_KINDS,Gt as PM_PACKAGE_CONVENTIONAL_RESOURCE_ROOTS,Kn as PM_PACKAGE_ONLY_ACTION_SUBCOMMANDS,Ft as PM_PACKAGE_RESOURCE_KINDS,Ue as PM_POSITIONAL_ACTION_CONTRACTS,ep as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA,Qd as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION,yA as PM_READ_OUTPUT_COMPOSITION_OPTION_FLAGS,$A as PM_READ_OUTPUT_CONTINUATION_FINGERPRINT_POLICIES,gA as PM_READ_OUTPUT_DIMENSIONS,CA as PM_READ_OUTPUT_OPTION_FLAGS,uA as PM_READ_OUTPUT_SESSION_MAX_SEEN_ITEM_IDS,lA as PM_READ_OUTPUT_SESSION_MIN_TOKENS,FE as PM_READ_OUTPUT_SURFACES,SA as PM_READ_OUTPUT_SURFACE_CONTRACTS,cA as PM_READ_OUTPUT_TAIL_RETENTION_POLICIES,jE as PM_READ_ROW_CONTRACTS,UE as PM_READ_ROW_JQ_SELECTOR,Ui as PM_RECOVERY_ECHO_FIELDS,sD as PM_RECOVERY_REFERENCE_FIELDS,ce as PM_RECOVERY_REFERENCE_KINDS,nS as PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE,un as PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE_V2,mD as PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE,ln as PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE_V2,kn as PM_RELOCATED_COMMAND_ALIASES,hd as PM_REPRODUCIBLE_PROCESS_ENV,iM as PM_SUCCESS_EXIT_CODES,Xn as PM_TOOL_ACTIONS,Wd as PM_TOOL_ACTION_PARAMETER_CONTRACTS,Zd as PM_TOOL_PARAMETERS_SCHEMA,Jd as PM_TOOL_PARAMETERS_SCHEMA_MAJOR,Xd as PM_TOOL_PARAMETERS_SCHEMA_VERSION,zd as PM_TOOL_RESERVED_CUSTOM_FIELD_PROPERTIES,Wr as PM_VERDICT_SCHEMA,ZT as PM_WORKSPACE_HISTORY_OPERATIONS,Hr as PM_WORKSPACE_RECIPE_SCHEMA,ia as PROFILE_FLAG_CONTRACTS,Zt as PROFILE_LINT_CODES,Qt as PROFILE_LINT_DIMENSIONS,Ht as PROFILE_NAMES,We as PROFILE_SUBCOMMANDS,S as PmCliError,_e as PmClient,WM as PmCompleteListValidationError,C as PmMcpAuthorizationError,ir as PmMcpInputRequiredError,Or as PmMcpIssuerCredentialStore,u as PmMcpProtocolError,sr as PmMcpRequestStateReplayGuard,Br as PmMcpSkillRegistry,gr as PmMcpSubscriptionRegistry,tt as PmMcpTaskStore,WA as QUERY_CURSOR_CONTRACT,AA as READ_OUTPUT_MUTATION_CONFLICT_CODE,xA as READ_OUTPUT_SHAPING_CONTROL_FLAGS,EA as READ_OUTPUT_SURFACE_UNSUPPORTED_CODE,Ma as REINDEX_FLAG_CONTRACTS,Ow as REINDEX_LOCK_ID,dt as RELATIONSHIP_GRAPH_SNAPSHOT_VERSION,Da as RELEASE_FLAG_CONTRACTS,qa as REMIND_FLAG_CONTRACTS,bt as RESERVED_ITEM_FIELD_NAMES,La as RESTORE_FLAG_CONTRACTS,fo as RISK_VALUES,XR as RelationshipEventLog,JR as RelationshipEventStore,q as RelationshipGraph,Ge as RelationshipKindRegistry,oa as SCHEMA_FLAG_CONTRACTS,Qc as SEARCH_COMMANDER_STRING_OPTION_CONTRACTS,rN as SEARCH_EXTENSION_FLAG_DEFINITIONS,yc as SEARCH_FLAG_CONTRACTS,As as SECRET_GUARD_RULE_CATEGORIES,_m as SEMANTIC_ATTRIBUTION_LIMITS,KS as SETTINGS_DEFAULTS,jf as SNAPSHOT_SCHEMA,NM as SOURCE_CONTEXT_ACCESS_ENV,LM as SOURCE_CONTEXT_WRITE_OVERRIDE_ENV,Zm as STALE_CLAIM_TAKEOVER_REFUSED_CODE,Ns as STALE_WORK_THRESHOLD_SETTING,Sm as START_BLOCKED_REFUSAL_CODE,ym as START_BLOCKER_ENFORCEMENT_DEFAULT,Fa as START_TASK_FLAG_CONTRACTS,Ya as STATS_FLAG_CONTRACTS,uo as STATUS_VALUES,qs as SUBCOMMAND_GLOBAL_FLAG_CONTRACTS,yi as SUBSTANTIVE_HISTORY_OPERATIONS,Px as SUPPORTED_HISTORY_ITEM_HASH_VERSIONS,Ix as SUPPORTED_HISTORY_RECORD_HASH_VERSIONS,LE as SUPPRESS_HOST_OUTPUT_MARKER,Va as TELEMETRY_FLAG_CONTRACTS,__ as TELEMETRY_SUBCOMMANDS,Ha as TEST_ALL_FLAG_CONTRACTS,za as TEST_FLAG_CONTRACTS,Ka as TEST_RUNS_FLAG_CONTRACTS,p_ as TEST_RUN_MEASUREMENT_LIMIT,Ud as TOOL_ACTIVITY_OPTION_CONTRACTS,Rd as TOOL_AGGREGATE_OPTION_CONTRACTS,$d as TOOL_BULK_MUTATION_FILTER_OPTION_CONTRACT_SOURCE,Gd as TOOL_CALENDAR_OPTION_CONTRACTS,Fd as TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS,jd as TOOL_CONTEXT_OPTION_CONTRACTS,kd as TOOL_CREATE_OPTION_CONTRACTS,vd as TOOL_CREATE_OPTION_CONTRACT_SOURCE,Bd as TOOL_DEPS_OPTION_CONTRACTS,qd as TOOL_GRAPH_OPTION_CONTRACTS,Od as TOOL_LIST_FILTER_OPTION_CONTRACTS,Pd as TOOL_SEARCH_FILTER_OPTION_CONTRACTS,Id as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS,Md as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACT_SOURCE,Dd as TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS,Ld as TOOL_UPDATE_OPTION_CONTRACTS,Nd as TOOL_UPDATE_OPTION_CONTRACT_SOURCE,VS as TYPE_TO_FOLDER,XT as UNKNOWN_SUBCOMMAND_COMPATIBILITY_CODES,FO as UNPROVEN_ACTIVITY_REASONS,Ad as UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,bd as UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,xd as UPDATE_COMMANDER_STRING_OPTION_CONTRACTS,sc as UPDATE_FLAG_CONTRACTS,ac as UPDATE_MANY_FLAG_CONTRACTS,Pa as UPGRADE_FLAG_CONTRACTS,Io as URL_CREDENTIAL_PLACEHOLDER,Qa as VALIDATE_FLAG_CONTRACTS,XS as WORKFLOW_POLICY_ACTIONS,qM as WORKFLOW_POLICY_DOCUMENT_SCHEMA,BM as WORKFLOW_POLICY_SCHEMA,gc as WORKSPACE_FLAG_CONTRACTS,Vb as WORKSPACE_HISTORY_ID,Bf as WORKSPACE_SNAPSHOT_ACTIONS,cl as WorkspaceGraphCache,rP as WorkspaceTransactionInterruptedError,Fu as _testOnly,hk as _testOnlyAggregateCommand,sl as _testOnlyConfigCommand,Ek as _testOnlyGetCommand,xu as _testOnlyHealthCommand,Yp as _testOnlyInit,Vp as _testOnlyInitAgentGuidance,gN as _testOnlyItemTransaction,Hk as _testOnlyMutationEvents,mk as _testOnlyNextCommand,Dk as _testOnlySearchCommand,iI as _testOnlySimilarity,mf as _testOnlyTemplates,Lu as _testOnlyValidateCommand,Wk as _testOnlyWorkspacePosition,yN as abandonItemTransaction,aP as abandonWorkspaceTransaction,lI as acceptAssuranceProposals,ku as acknowledgeLinkedTests,nl as acknowledgeUnknownAuthorHistoryEvents,rl as acknowledgeUnknownAuthorHistoryEventsFromTransport,Ww as acquireItemMetadataDerivedIndexLock,Fe as acquireLock,ei as acquireLockLease,XN as activateExtensionForTest,ub as activateExtensions,Em as admitStartWithOpenBlockers,Zo as agentSessionEnvironment,hh as aggregate,Zf as analyzeAgentProvenanceDescriptorCoverage,TP as analyzeDefectChangeRisk,rv as analyzeDefectRecurrenceCoverage,Ll as analyzeDuplicateItems,ZR as analyzeGraphImpact,op as analyzeHierarchyIntegrity,eP as analyzeKnowledgeGraph,aM as analyzePmCommandExitConformance,Zn as analyzePmToolActionParity,qI as analyzeReconciliationDiscard,QR as analyzeRelationshipExecution,eu as analyzeRelationshipSchedule,jg as analyzeSdkActionCoverage,It as analyzeSdkCliParameterCompleteness,bA as annotationPositionalMutationOptions,Rh as append,qi as appendHistoryEntry,Xb as appendWorkspaceAuditEvent,Yb as appendWorkspaceHistoryChange,dT as applyAcceptanceCriteriaMutations,dI as applyAssurancePreset,zc as applyBootstrapPagerPolicy,JI as applyClosureTimestampFix,ux as applyContextIntentProjection,Xm as applyContextTagProjection,HP as applyFilterValueEcho,Iw as applyHistoryPatch,_d as applyInvocationAuthorOverride,Tl as applyPathMigrations,vA as applyReadOutputDimensions,RA as applyReadOutputIncludeModes,fA as applyReadOutputSessionReferences,eb as applyRegisteredItemFieldDefaultsAndValidation,bl as applyStandaloneNote,Dc as applyStoredExtensionMigrationState,lT as applyTagRemovals,Ev as applyTerminalOrderingPolicy,wl as artifactKey,FT as asRecordClone,DT as asRecordOrNull,qe as assembleWorkspaceRelationshipGraph,QM as assertCompleteListResult,M0 as assertExtensionBlueprint,P0 as assertExtensionCapabilityUsage,l0 as assertExtensionDeactivated,k0 as assertExtensionManifestCompatible,v0 as assertExtensionManifestMatchesBlueprint,N0 as assertExtensionPreflight,ap as assertHierarchyMutationAllowed,pv as assertHistoryCompactTarget,HI as assertHistoryRepairTarget,is as assertInitializedTracker,El as assertLinkedArtifactMutationIsUnambiguous,G0 as assertMcpClientCapabilities,F0 as assertMcpProtocolHeader,vy as assertMemoryRelationshipGraphAdapterConformance,fT as assertNoUnknownCsvKeys,Vu as assertNonHierarchyCardinalityMutationAllowed,u0 as assertPackageManifest,iw as assertParentReferenceIsNotSelf,VL as assertPmMcpSkillsCapability,I0 as assertProjectProfile,qw as assertProjectRuntimeCompatibility,Gw as assertProjectRuntimeFormatGuard,qE as assertProjectionModeChoice,os as assertReadableTrackerRoot,m0 as assertRegisteredCommandContract,A0 as assertRegisteredCommandOverride,y0 as assertRegisteredExporter,f0 as assertRegisteredFlags,_0 as assertRegisteredHook,C0 as assertRegisteredImporter,S0 as assertRegisteredItemField,T0 as assertRegisteredItemType,R0 as assertRegisteredMigration,x0 as assertRegisteredParserOverride,b0 as assertRegisteredPreflightOverride,E0 as assertRegisteredProfile,w0 as assertRegisteredRendererOverride,h0 as assertRegisteredSearchProvider,O0 as assertRegisteredServiceOverride,g0 as assertRegisteredVectorStoreAdapter,Vx as assertRelationshipEdgeAllowed,on as assertRelationshipGraphAdapterConformance,aT as assertSchemaPreviewSupported,C_ as assertTestMeasurementRun,Ax as assertWellFormedOutputText,gM as assuranceAssertionUpdateIsLoosening,_x as attachContextIntentReceipt,JA as attachContextUsageServingReceipt,Pu as attachLinkedTestMutationProvenance,Ru as attachLinkedTestProvenance,Xe as attachMcpServerInfo,YE as attachOutputOmissionReceipt,gx as attachOutputTokenAccounting,hx as attachReadOutputContracts,_A as attachReadOutputSessionReceipt,Pp as auditMergeAttributeFence,jM as auditMergeDriverConfiguration,su as auditWorkspaceRelationshipGraph,IL as authorizeMcpHttpRequest,Jo as boundAgentEpisodeIdentity,oA as boundReadOutputRows,Vm as buildChildrenByParent,Ik as buildCompactSearchFilterSummary,VP as buildContentFilterEcho,Zv as buildContextSignalSnapshot,Sy as buildCorpusShapeItemPlan,SP as buildDefectRecurrenceIndex,Gp as buildExtensionDescribeResult,jp as buildExtensionInstallPlan,KP as buildGovernanceMissingFilterEcho,Eu as buildInProgressSweepCommands,CI as buildInProgressWorkHealthSummary,_w as buildInvalidTypeError,yk as buildItemChildrenRollup,_N as buildItemCompletionMutations,Dv as buildItemContextRelevanceCandidates,eO as buildItemNotFoundError,Tk as buildItemSchedule,QI as buildLinkedFileRepairReport,EL as buildMcpAuthorizationDiscoveryUrls,Hg as buildMcpCompleteResult,j0 as buildMcpDiscoverResult,OL as buildMcpDynamicRegistrationMetadata,fL as buildMcpHttpRequestHeaders,Y0 as buildMcpInputRequiredResult,TL as buildMcpProtectedResourceMetadata,Op as buildMergeAttributePatterns,Yd as buildPmActionToolInputSchema,hD as buildPmRefusalClosureCensus,oI as buildRelationshipContext,iO as buildSearchCorpus,aO as buildSemanticCorpusInput,WI as buildStatusRoleWarnings,ns as buildTrackerInitializationRecovery,uO as buildVectorizationEmbeddingIdentity,mO as buildVectorizationEmbeddingMetadata,vk as buildVerboseSearchFilters,zM as buildWorkflowCompletenessCheck,sk as buildWorkspaceMemorySnapshot,Rm as callerClaimEndedByClose,Xo as canonicalDocument,xT as canonicalizeCommandOptionKey,vN as canonicalizeCommandSuggestions,Lv as canonicalizeContextRecencyCoordinate,qx as canonicalizeRelationshipKind,aD as censusPmRecoveryReferenceProducers,JM as certifyCompleteListResult,WN as checkExtensionManifestCompatibility,lg as claim,ug as claimNext,eI as classifyHistoryAuthorEvent,Si as classifyHistoryEvent,jI as classifyHistoryMergeReceiptReferences,nb as classifyHostEnvironmentFault,Nk as classifyImplicitSemanticFallbackReason,zo as classifyItemFormatVersion,S_ as classifyLinkedTestCommandSafety,T_ as classifyLinkedTestFailure,Pb as clearActiveExtensionHooks,fu as clearDurableGraphCache,AE as clearFocusedItem,O_ as clearWorkspaceContractsCache,pg as close,ju as closeItem,Sg as closeTask,Kc as coalesceRepeatedListFlags,kR as collectBlockedByIds,LR as collectBlockedByIdsFromCorpus,ZA as collectContextUsageDeliveredItemIds,lp as collectDanglingDependencyReferences,DR as collectDependencyBlockedIds,dp as collectDuplicateDependencyRows,iu as collectDuplicateRelationshipEdgeGroups,kk as collectErrorCauseCodes,np as collectHierarchyRelations,Ar as collectMcpHeaderAnnotations,up as collectMissingDependencyTargetIds,Hu as collectNewOrderingCycleWarnings,ru as collectOrderingCycles,pp as collectOrderingStorageContradictions,qR as collectPackageContextIntentContracts,jt as collectPackageExtensionDirectories,Qx as collectRegisteredItemFieldNames,_E as collectRuntimeCreateFieldValues,hw as collectRuntimeFilterValues,hE as collectRuntimeUpdateFieldValues,jm as collectSubtreeIds,Ki as collectUsedExtensionCapabilities,bT as commandOptionFlagLabel,yh as comments,Q_ as commitImportedItem,hN as commitItemCompletion,fN as commitItemMutations,oP as commitWorkspaceTransaction,Bs as compactFlagAliasContracts,Bm as compareCriticalItems,$w as comparePmDateVersions,tP as compareRelationshipSnapshots,GT as compareTimestampStrings,vv as compileHistoryProvenanceMatcher,px as composeContextIntentContracts,jN as composeExtension,KN as composeExtensionPackage,GR as computeActionabilityReport,qb as computeHistoryDiff,Ql as computeRelationshipCentrality,Jl as computeRelationshipDominators,al as computeWorkspaceGraphFingerprint,Mh as config,Rb as consumeAfterCommandAffectedItems,ph as context,fx as contextIntentRowId,fg as copy,Ku as countFailureCategories,rA as countReadOutputRows,ag as create,cI as createAssurancePreset,ev as createAssuranceWorkspaceContext,jT as createCheckpointId,YM as createCompleteListOptions,mb as createCoreCommandHookContext,en as createCorpusShapeMeasurement,EM as createEmptyAssuranceDocument,Jx as createEmptyExtensionRegistrationRegistry,xO as createExtensionCommandError,Nc as createExtensionCommandSdk,Hi as createExtensionContributionInventory,L0 as createExtensionTestHarness,Bi as createHistoryEntry,XO as createLazyModule,HM as createLifecycleCompletenessPolicies,vL as createMcpStaticBearerVerifier,dL as createMcpTaskStore,Zw as createMutationGuardSdk,zE as createOutputOmissionReceipt,Cs as createPmCliExpectedError,kc as createPmCliProgram,Ri as createPmCommandOutputBudget,jA as createQueryFingerprint,Iy as createRelationshipGraphScaleFixture,J as createRelationshipGraphSnapshot,xt as createRelationshipKindRegistry,Cd as createReproducibleProcessRunner,Pk as createSearchCursorFingerprint,fb as createSerialQueue,ST as createStdinTokenResolver,JT as createUnknownSubcommandError,sT as createWorkflowPolicyEvaluator,qf as createWorkspaceSnapshot,JN as deactivateExtensionForTest,bs as decideSecretGuardFinding,oF as declineServiceOverride,mx as decodeContextIntentCursor,YO as decodeHtmlEntitiesInOptions,Er as decodeMcpHttpHeaderValue,yx as decodePmTableRows,HA as decodeQueryCursor,qA as decodeQueryCursorEnvelope,zA as decodeQueryCursorState,GA as decodeReadOutputContinuationCursor,$0 as decodeToon,DL as decoratePmMcpToolsWithApps,Rl as dedupeLinkedArtifacts,$b as defaultConfigScope,Gv as defaultScoreContextCandidates,pF as defineAfterCommandHook,cF as defineBeforeCommandHook,dF as defineBeforeMutationHook,VD as defineCommand,ZD as defineCommandOverride,K as defineCorpusShape,r$ as defineEpisodeSpecification,aF as defineExporter,GN as defineExtension,UN as defineExtensionBlueprint,zD as defineExtensionManifest,KD as defineFlag,sF as defineImporter,YD as defineItemField,WD as defineItemType,XD as defineMigration,py as defineObservationContract,mF as defineOnIndexHook,uF as defineOnReadHook,lF as defineOnWriteHook,eF as defineParserOverride,Pi as definePmCommandOutputBudget,ZP as definePmCommandOutputEnvelope,YP as definePmErrorCodeCatalog,tF as definePreflightOverride,HD as defineProjectProfile,iF as defineRendererOverride,JD as defineSearchProvider,rF as defineServiceOverride,QD as defineVectorStoreAdapter,fy as defineVerdictContract,xe as defineWorkspaceRecipe,_g as deleteItem,Yf as deleteWorkspaceSnapshot,Kx as dependencyToRelationship,wh as deps,pI as deriveAssuranceProposals,YI as deriveClosureTimestamp,qN as deriveExtensionCapabilities,nN as deriveMutationTransactionId,cM as derivePmBulkMutationEffect,cD as derivePmRecoveryReferenceObligations,tu as deriveRelationshipDeadlines,kp as deriveSchemaEvolutionMigrationId,MO as deriveTelemetryCommandResolution,Sw as describeAllowedTransitions,kM as describeExtensionActivation,zN as describeExtensionBlueprint,Go as describeFieldFlagSpellingDefect,WT as describeFlagScalarValueFailure,Om as describeItemOwnershipConflict,Mc as describeItemRevisionChanges,t$ as describeObservationCost,Xt as describeProfileComposition,Jt as describeProjectProfile,EN as describeReadCompletenessControls,bO as describeUnknownError,pi as detectAgentIdentity,fi as detectHarnessIdentity,Yl as detectRelationshipCommunities,li as diagnoseAgentIdentity,au as diffRelationshipAuditSnapshots,m_ as diffTestRunMeasurements,Q0 as digestMcpRequestParameters,pb as discoverExtensions,yo as discoverNearbyPmRoot,T1 as discoverPmTools,Fw as discoverProjectRuntimeVersionPins,bh as docs,Ch as duplicates,pu as durableGraphCachePath,_u as durableGraphCacheStatus,Bo as effectiveItemFormatVersion,cR as emitTelemetryErrorEvent,J_ as emptyImportedDocument,TI as encodeItemScalarDecisionValue,Tr as encodeMcpHttpHeaderValue,Cx as encodePmTableRows,BA as encodeQueryCursor,FA as encodeReadOutputContinuationCursor,D0 as encodeToon,zb as enforceHistoryStreamPolicyForItem,Hb as enforceHistoryStreamPolicyForItems,pP as enrichCliFlagInvocationContract,Mt as enrichCliFlagInvocationContracts,kw as ensureMaterializedHistoryTarget,xp as ensurePmGitignore,hl as ensureScope,EO as ensureSentryCommandTracing,TO as ensureSentryInit,X_ as ensureTrackerInitialized,Kl as enumerateRelationshipPaths,vi as estimatePmOutputTokens,xM as evaluateAssuranceAssertion,bM as evaluateAssuranceGate,gP as evaluateBoundaryFixtures,xm as evaluateClaimActivity,qv as evaluateContextRanking,EP as evaluateDefectGateEvidence,AM as evaluateMeasurement,If as evaluateMetricFloors,Es as evaluateMutationGuard,i_ as evaluateProvenanceCoverage,vF as evaluateReliabilityWindow,r_ as evaluateSemanticAttributionCoverage,Dl as evaluateSimilarityGovernance,yw as evaluateTransition,_y as evaluateVerdictContract,iT as evaluateWorkflowPolicies,ds as executeEmbeddingBatchesWithRetry,pO as executeVectorDelete,lO as executeVectorReset,dO as executeVectorUpsert,sy as executeWorkspaceRecipe,xl as expandAddGlobEntries,Gl as explainSourceTraceability,_v as exportAttestation,Tg as extension,Ag as extensionActivate,xg as extensionDeactivate,Eg as extensionList,gS as extensionMigrate,UI as extractHistoryMergeReceiptDispositions,GI as extractHistoryMergeReceiptReferences,RL as extractMcpTraceContext,Pw as extractPatchFailureContext,bu as extractReferencedPmItemIdsFromCommand,My as federateRelationshipGraphSnapshots,Eh as files,Ah as filesDiscover,xh as filesLookup,ex as finalizeContextUsageDelivery,wy as findCoverageDeficits,$l as findDuplicateClusters,wp as findGitWorkspaceRoot,OE as findHistoryIdentityDiscontinuities,Dp as findInstalledNpmPackageCandidate,$L as findPmMcpAppByUri,Nn as findPmNamespacedCommand,Xl as findRedundantRelationshipEdges,Zl as findRelationshipCutStructure,Nl as findSimilarItems,aR as finishTelemetryCommand,YR as fitOutputEnvelope,KT as flattenFlagListValue,Ay as flushTelemetryQueue,gg as focus,Wl as forEachMatchedRelationshipEdge,ou as formatDuplicateEdgeGroup,ip as formatHierarchyRelation,nu as formatOrderingStorageContradiction,TR as formatPmPositionalActionFlagTip,bf as formatProfileApplyHuman,xf as formatProfileLintHuman,Ef as formatProfileListHuman,Af as formatProfileShowHuman,$p as formatSchemaEvolutionMigrationHuman,$k as formatVectorIndexRecoveryWarnings,Kk as formatWorkspacePositionHuman,tg as gc,es as generateItemId,fh as get,bb as getActiveCommandResult,cx as getActiveContextIntentContracts,Yi as getActiveExtensionRegistrations,ML as getActiveMcpTraceContext,OM as getAssuranceDeclaration,Dg as getContracts,TE as getFocusedItem,Eo as getHistoryPath,KR as getItemAt,To as getItemPath,Rs as getMutationActionContract,Ap as getPmGitignoreBlock,So as getSettingsPath,R_ as getWorkspaceContracts,Kb as getWorkspaceHistoryPath,Oh as graph,lu as graphAuditBaselinePath,n_ as groupHistoryByEpisode,nF as handleServiceOverride,U0 as hasMcpClientExtension,LL as hasPmMcpAppsCapability,Be as hasSubcommandFlagContractsForCommand,fO as hasVectorizationEmbeddingIdentityChanged,_O as hasVectorizationVectorDimensionChanged,Gx as hashDocument,Ux as hashDocumentForVersion,jx as hashEmptyDocument,kx as hashHistoryPatch,vx as hashHistoryRecord,Nx as hashHistoryStream,EI as hashItemScalarDecisionValue,eg as health,ql as hierarchyAncestors,zl as hierarchyDescendants,ig as historyCompact,sg as historyCompactBulk,pE as historyDigest,Iv as historyEntryMatchesProvenance,Dw as historyItemHashVersionForRuntime,rg as historyRedact,ng as historyRepair,og as historyRepairAll,NR as indexBlockedByIds,sp as indexHierarchyRelations,hO as inferConsistentVectorDimension,Oi as inferPmOutputBudgetClass,Ph as init,XM as inspectCompleteListResult,tb as inspectExtensionManifestSchema,Jp as inspectHistoryAuthorStream,$s as inspectInProgressWork,MI as inspectMergeReceiptEvidence,Bw as inspectProjectRuntimeCompatibility,Ds as inspectStaleInProgressItems,Bg as inspectStaticExtensionInventory,KI as inspectStatusRoleAssignments,Wb as inspectWorkspaceHistoryState,zf as inspectWorkspaceSnapshot,vp as installMergeFence,B0 as interpretMcpResultType,ef as isAlreadyClaimedError,RO as isCommanderError,bN as isCompatibleRecoveryFlag,pd as isErrnoError,PR as isExternalDependencyReference,MR as isExternalDependencySourceKind,me as isFileMissingError,Di as isGenericRefusalRequired,Fi as isGenericRefusalWhy,DE as isHostOutputSuppressed,gs as isItemAlreadyExistsError,Ic as isItemRevisionConflict,SI as isItemScalarMissingValue,qO as isJudgeableHistoryRecord,$I as isLegacyMergeReceiptSummary,h as isMcpRecord,ws as isMutationAction,Hx as isOrderingRelationshipKind,nw as isPlaceholderReferenceToken,ls as isPmCliErrorDetails,ys as isPmCliExpectedError,to as isPmExtensionCapabilityContract,no as isPmExtensionPolicyModeContract,oo as isPmExtensionPolicySurfaceContract,ro as isPmExtensionServiceNameContract,sM as isPmKnownExitCode,tM as isPmMutationReceipt,Ve as isPmSuccessfulExitCode,_s as isPmTokenBudgetRecovery,eo as isPmToolAction,DI as isPreDurableCloneLocalReceiptSummary,FI as isPreDurableDispositionEligibleReference,jw as isProjectMutatingInvocation,JO as isPureSnakeCaseAlias,NA as isReadOutputBudgetExceeded,pA as isReadOutputSessionReference,xN as isReadProjectionRecoveryFlag,kA as isReadResultOmittedForBudget,VE as isReadRowContract,tp as isRuntimeRecord,Aw as isSettingsReadFallback,Tm as isStartTransition,eR as isTerminalPlanMode,CE as isTerminalStatus,$o as isTimestampLiteral,fP as isWaiverNoticeDays,BO as isWellFormedHistoryRecord,cN as itemDocumentToMutationOptions,Sk as itemHasSchedule,Ti as jaccardSimilarity,VO as latestHistoryTimestamp,Th as learnings,YT as levenshteinDistanceWithinLimit,ad as limitAnnotationEntries,Mu as linkedTestTrustFingerprint,HN as lintExtensionBlueprint,rb as lintExtensionManifestSchema,er as lintProjectProfile,lh as list,ii as listAgentProvenanceAdapters,Vc as listAliasPluralKeys,uh as listAllComplete,Jw as listAllDocumentCandidatesCached,cs as listAllItemMetadata,Qw as listAllItemMetadataLight,wM as listAssuranceDeclarations,vM as listAssuranceVerdicts,Cy as listBuiltinCorpusShapes,kN as listCoreClosedDomainContracts,hR as listGetProjectionFields,_I as listInvalidProvenanceHistoryStreamIds,mR as listListProjectionFields,II as listMergeReceipts,Os as listMutationActions,Bk as listMutationEvents,hn as listPmCommandFlagBudgets,hp as listPmCommandsForFamily,_p as listPmCommandsForTier,Pe as listPmFlagLexicon,UD as listPmFlagSpellingInventory,gp as listPmMcpToolsForProfile,PD as listPmRequiredArgumentRefusalContracts,MD as listPmSubcommandRefusalContracts,Yt as listProfiles,kD as listTrackerPreflightRecoveryContracts,lN as listUpsertKeyCandidates,Hf as listWorkspaceSnapshots,zR as loadContextIntentRuntimeLayers,ff as loadCreateTemplateOptions,lb as loadExtensions,gu as loadGraphAuditBaseline,uN as loadGuardedRuntimeSchema,qT as loadMutationCheckpoint,v as loadRelationshipGraphAdapter,ss as locateItem,mT as looksLikeGenericKeyValueEntry,nA as mapReadOutputRows,vI as markMergeReceiptReconciled,gw as matchesRuntimeFilters,iR as maybeRunFirstUseTelemetryPrompt,Ty as measureCorpusShapePlan,rs as measureItemMetadataReadWork,pT as mergeAdditiveTags,BN as mergeExtensionBlueprints,AI as mergeHistoryStreams,OI as mergeItemDocuments,RI as mergeJsonDocuments,Wc as mergeLinkedTestTwoTokenEntries,xI as mergeRelationshipEventStreams,Wm as mergeSortedWarnings,ZO as migrateItemFilesToFormat,rO as mutateItem,tO as mutateItemWithHistoryContext,Jb as mutateWorkspaceJsonWithHistory,_h as next,ai as normalizeAgentProvenanceAdapterValue,sd as normalizeAnnotationTransportOptions,mM as normalizeAssuranceEvaluation,uM as normalizeAssuranceMutation,Yc as normalizeBootstrapInvocation,Ub as normalizeBulkIdsValue,cp as normalizeDependencyGraphTarget,GP as normalizeDependencySeedId,FP as normalizeDependencySourceKind,kt as normalizeDirectExtensionCommandOptions,Oc as normalizeExpectedItemHash,zi as normalizeExtensionContributionInventory,iE as normalizeHistoryOperationForWrite,fI as normalizeInvalidHistoryProvenance,dP as normalizeItemAddressInvocation,qo as normalizeItemFormatVersion,Zi as normalizeItemId,Ko as normalizeItemMetadata,UP as normalizeItemReference,Hc as normalizeLegacyExtensionActionSyntax,Al as normalizeLinkedPath,rw as normalizeParentReferenceValue,Kt as normalizeProfileName,Qi as normalizeRawItemId,PA as normalizeReadOutputIncludeModeOptions,IE as normalizeReplayPatchOps,Ps as normalizeSimilarityText,GO as normalizeStaleWorkThresholdHours,gE as normalizeStatusForRegistry,Vo as normalizeStatusInput,uE as normalizeStatusInputWithRegistry,OO as normalizeThrownExitCode,Sh as notes,Lo as nowIso,uu as openDurableGraphCache,J0 as openMcpRequestState,n$ as openPmEpisode,Hl as orderingPredecessors,Vl as orderingSuccessors,Wv as packContextCandidates,qm as packRankedContextItems,Ng as packageActivate,kg as packageCatalog,Lg as packageDeactivate,Ig as packageDescribe,Pg as packageDoctor,Og as packageInstall,bg as packageLifecycle,wg as packageList,Mg as packageManage,CS as packageMigrate,vg as packageReload,Rg as packageUninstall,KA as paginateQueryRows,gl as parseAddEntries,Cl as parseAddGlobEntries,dd as parseAnnotationTextInput,oN as parseAtomicMutationControls,qc as parseBootstrapCommandName,Uc as parseBootstrapGlobalOptions,Bc as parseBootstrapHelpRequest,Xc as parseBootstrapTypeValue,Gb as parseBulkIdsText,Gm as parseContextDepth,Lm as parseContextFocusFields,jR as parseContextIntentDeclarations,Um as parseContextSections,Qv as parseContextSignalSnapshot,uT as parseCsvKv,bP as parseDefectChangeRiskRequest,tv as parseDefectRecurrenceCoverageRequest,xP as parseDefectRecurrencePolicy,Mf as parseEvalMetricFloors,Lf as parseEvalQuerySet,Rc as parseExpectHashSpecs,kT as parseExtensionLongFlagToken,Su as parseGraphSubcommand,fv as parseHistoryAttestation,Pv as parseHistoryProvenanceFilters,wP as parseIntegerLimit,yE as parseItemDocument,iN as parseItemMutationBatch,fw as parseLimit,sm as parseLinkedTestAssertionEqualsMap,am as parseLinkedTestAssertionGteMap,em as parseLinkedTestBoolean,tm as parseLinkedTestContextMode,Zu as parseLinkedTestEnvClear,Qu as parseLinkedTestEnvSet,cm as parseLinkedTestJsonEntries,im as parseLinkedTestMinLines,om as parseLinkedTestRegexList,nm as parseLinkedTestStringList,rm as parseLinkedTestWorkspaceContextMode,Qg as parseMcpCachePolicy,qg as parseMcpImplementation,Ze as parseMcpInputRequests,pr as parseMcpInputResponses,EC as parseMcpSubscriptionFilter,Sl as parseMigrateEntries,PP as parseMultiValueFilter,rM as parseMutationReceipt,ET as parseOptionalNonNegativeInteger,TT as parseOptionalNumber,eD as parsePmAgentTaskTranscriptCorpus,S1 as parsePmToolDiscoveryOptions,OP as parsePriority,vP as parsePriorityFilterSet,mA as parseReadOutputSession,Zx as parseRegisteredItemFieldAssignments,se as parseRelationshipGraphSnapshot,yl as parseRemoveEntries,Fl as parseSourceLineRange,pw as parseStatusFilterCsv,MP as parseStringFilterSet,io as parseTags,l_ as parseTestRunMeasurements,RP as parseType,IP as parseTypeFilterSet,tl as parseUnknownAuthorHistoryEventCoordinates,ZS as parseWorkflowPolicy,eT as parseWorkflowPolicyDocument,fk as partitionDecisionEntries,Bb as patchPathToChangedField,so as pathExists,yg as pauseTask,mu as persistDurableGraphResult,Ew as persistSelectedItemFormat,rI as planAgentIdentityVocabularyMutation,ok as planCompletedAtBackfill,Bp as planExtensionDirectoryCopy,FN as planItemMutationDocument,tr as planProfileApplication,oD as planRelationshipEventBackfill,yu as planRelationshipRemediation,Np as planSchemaEvolutionMigration,Zp as planUnknownAuthorHistoryAcknowledgment,Vf as planWorkspaceSnapshotRestore,xR as positionalShapeKey,bR as positionalSignatureKey,YN as preflightExtension,Is as prepareSimilarityText,hT as preserveMutationStdinTokenFields,_T as preserveMutationStdinTokenLiterals,DN as previewItemMutationDocument,mN as previewItemMutations,Ox as printError,wx as printResult,Wh as profile,Jh as profileApply,Qh as profileLint,Yh as profileList,Xh as profileShow,Ob as projectAfterCommandItemSnapshot,$m as projectContextFocusRows,d_ as projectFleetAttributionAnalytics,Mv as projectHistoryProvenance,ji as projectLeanRecoveryPayload,_l as projectLinkedCollectionMutation,Sx as projectPmBriefListEnvelope,Tx as projectPmBriefSearchEnvelope,fs as projectPmCliErrorContextDetails,us as projectPmCliErrorDetails,Ni as projectPmDiagnosticOutput,Li as projectPmDiagnosticText,a_ as projectProvenanceCoverageAnalytics,Nu as projectValidateCounts,uI as promoteAssuranceAssertion,QA as propagateContextUsageServingReceipt,A$ as pruneCompileCacheGenerations,RM as putAssuranceDeclaration,PM as putAssuranceDeclarationBundle,zw as queryItemMetadataIndex,Hw as queryLinkedFileMetadataIndex,Vw as querySimilarItemMetadataIndex,u_ as queryTestRunMeasurementsBelow,wo as quoteCmdCommandArg,Ro as quoteCommandArg,Po as quotePosixCommandArg,Oo as quotePowerShellCommandArg,bo as quoteWindowsCommandArg,IN as rankCommandPaths,cd as readAnnotationEntries,ui as readAuthorEnvironment,M_ as readBooleanOption,ix as readContextUsageAffinity,I_ as readCsvListOption,$c as readExtensionMigrationState,ao as readFileIfExists,nd as readFirstStringFromCommanderOptions,od as readFirstValueFromCommanderOptions,o_ as readHistoryAnalyticsWindow,wE as readHistoryEntries,hi as readHistorySnapshot,Jf as readImprovementLedger,Yw as readItemMetadataDerivedIndexState,Pc as readItemRevision,CN as readItemTransaction,WO as readLatestHistoryActivity,as as readLocatedItem,tA as readOutputBudgetCollections,DA as readOutputCollectionFingerprint,eA as readOutputContinuationRowCollections,QE as readOutputContinuationRowPaths,OA as readOutputIncludeModeOptions,dA as readOutputRetainsTail,ZE as readOutputRowCollections,JE as readOutputRowPaths,hA as readOutputSessionRemainingTokens,Ut as readPmPackageManifest,Nm as readRecentActivity,w_ as readRequiredString,fE as readRuntimeFieldOptionValue,ts as readSettings,nR as readSettingsSection,xw as readSettingsWithMetadata,id as readStringArrayFromCommanderOptions,P_ as readStringOption,wO as readThrownExitCode,gO as readVectorizationStatusLedger,Nw as readWorkflowPolicies,tT as readWorkflowPolicyField,BR as readWorkspaceContextIntentContracts,rk as readWorkspaceContextSignals,ak as readWorkspaceMemory,Vk as readWorkspacePosition,iP as readWorkspaceTransaction,NE as reanchorHistoryEntries,NF as reconcileArtifactLedgers,Wi as reconcileExtensionCapabilityUsage,Zb as reconcileWorkspaceJsonHistory,wb as recordAfterCommandAffectedItem,IM as recordAssuranceVerdict,um as recordClaimSemanticAttribution,rx as recordContextUsageDelivery,tx as recordContextUsageServing,nx as recordContextUsageTouch,ox as recordContextUsageTouches,fm as recordFocusSemanticAttribution,Xf as recordImprovementObservation,mm as recordReleaseSemanticAttribution,HO as recordedBaselineActivity,KO as recordedPrefixActivity,ko as redactUrlCredentialsInText,vo as redactUrlCredentialsInToken,Xw as refreshItemMetadataDerivedIndex,Mp as refreshMergeAttributeFenceIfInstalled,sA as refreshReadOutputDeliveredCounts,yO as refreshSearchArtifactsForMutation,si as registerAgentProvenanceAdapters,$P as registerExternalDependencyResolver,oi as registerHarnessSignalDescriptors,GE as registerOutputMaterialFieldGroups,mg as release,iA as rememberReadOutputFocusRows,MM as removeAssuranceDeclaration,co as removeFileIfExists,Il as renameArtifactsResultKey,Mm as renderCalendarMarkdown,Im as renderCalendarToon,Ym as renderContextMarkdown,Up as renderExtensionDescribeMarkdown,Fp as renderExtensionSurfaceMarkdown,th as renderGuideMarkdown,RN as renderMissingOptionRetry,_k as renderNextMarkdown,NN as renderPmClosedDomainHelp,Mo as renderPmCommand,Fn as renderPmCommandAliasMigrationHint,Sp as renderPmCommandVisibilityMarkdown,BD as renderPmFlagLexiconMarkdown,FL as renderPmMcpAppHtml,gD as renderPmRefusalClosureCensusMarkdown,uw as renderRowsAsCsv,mw as renderRowsAsTable,dg as reopen,vw as replayHistoryToTarget,PE as replayToCanonicalItemDocument,RE as replayToItemDocument,oE as requireHistoryOperation,Sv as requireTerminalReason,Tv as requireTerminalReasonWithRecovery,Dx as resealHistoryRewrite,Eb as resetActiveExtensionRuntimeState,pl as resetWorkspaceGraphCache,Qo as resolveAgentSessionContextFromSignals,fd as resolveAnnotationIndex,ld as resolveAnnotationInput,bE as resolveAuthor,_i as resolveAuthorIdentity,tw as resolveBodyFileContent,yy as resolveBuiltinCorpusShape,Pm as resolveCalendarOutputFormat,XP as resolveCanonicalPmErrorCodeContract,zx as resolveCanonicalRelationshipKind,xE as resolveClaimPrincipal,jb as resolveCliBulkIdsInput,RT as resolveCommandOptionPolicyState,xo as resolveCommandShellDialect,E$ as resolveCompileCacheGeneration,nk as resolveCompletionTimestamp,Xx as resolveConfiguredPmPackageRoot,BP as resolveContentFieldFilters,lx as resolveContextIntentContract,Dm as resolveContextOutputFormat,Fm as resolveContextTokenBudget,Av as resolveCreateExplicitEmptyFlag,xc as resolveDeclaredBlockers,bk as resolveEffectiveSearchMode,nO as resolveEmbeddingProviders,vt as resolveExtensionFlagOptionKey,VT as resolveExtensionFlagValueContract,qp as resolveExtensionInstallSourceIdentity,NT as resolveExtensionLongFlagName,Lc as resolveExtensionMigrationStatePath,cb as resolveExtensionRoots,DP as resolveExternalDependencyReference,HT as resolveFlagValueKind,IT as resolveGlobalPmRoot,Z_ as resolveGuideOutputFormat,Qf as resolveHistoryEpisodeGroupIdentity,dE as resolveHistoryHashAlgorithm,nE as resolveHistoryOperation,Rv as resolveHistoryProvenanceDimensions,RR as resolveHistorySubject,Mw as resolveHistoryTarget,Ok as resolveHybridSemanticWeight,Co as resolveImplicitPmRoot,UT as resolveIsoOrRelative,$R as resolveItemBlockers,IR as resolveItemExecutionRole,aN as resolveItemMutationDocument,wm as resolveItemOwnershipActivity,bm as resolveItemOwnershipConflict,go as resolveItemTypeRegistry,lE as resolveItemTypesFilePath,Ls as resolveLastActivityAt,SN as resolveLifecycleVerbRecovery,vT as resolveLinkedResourcePositionalRecovery,E_ as resolveLinkedTestFailureExitCode,wu as resolveLinkedTestSourceRef,Ou as resolveLinkedTestSourceWorkspaceRoot,Iu as resolveLinkedTestTrust,vu as resolveLinkedTestTrustBatch,AC as resolveMcpAcknowledgedSubscriptionFilter,Ye as resolveMcpRequestContext,bp as resolveMergeInstallContext,PN as resolveMisnestedCommandPath,jP as resolveMissingMetadataFilters,ON as resolveMissingOptionPlaceholder,HE as resolveModePairedOutputOmissionReceipt,uk as resolveNextOutputFormat,WE as resolveOutputOmissionReceipt,Yx as resolvePmCliVersion,Dn as resolvePmCommandAlias,ze as resolvePmCommandCapabilityFamily,$t as resolvePmCommandExitContract,N as resolvePmCommandOperation,Ii as resolvePmCommandOutputBudget,Lt as resolvePmCommandOutputEnvelope,yR as resolvePmCommandPositionalContract,No as resolvePmCommandScopeArgs,He as resolvePmCommandVisibilityTier,ki as resolvePmDiagnosticOutputBudget,JP as resolvePmErrorCodeContract,uS as resolvePmFlagSemanticConcept,ke as resolvePmHistoryOperation,H0 as resolvePmMcpExecutableInvocation,Wx as resolvePmPackageRootFromModule,SR as resolvePmPositionalActionContract,Ec as resolvePmPositionalActionFlagContracts,De as resolvePmRoot,Hd as resolvePmToolCustomFieldCollision,sw as resolvePriority,Wt as resolveProfile,Rp as resolveProjectMergeTypeFolders,VA as resolveQueryCursorStart,TN as resolveReadCompletenessControls,AN as resolveReadOptionRetryArgs,MA as resolveReadOutputDimensions,LA as resolveReadOutputEncoding,aA as resolveReadOutputRecoveryBudget,TA as resolveReadOutputSurface,KE as resolveReadRowContract,wN as resolveRecoveryCommandName,Db as resolveRegisteredSearchProvider,Fb as resolveRegisteredVectorStoreAdapter,db as resolveRegistrableExtensionCommands,gd as resolveReproducibleProcessEnvironment,Fo as resolveRuntimeFieldRegistry,Do as resolveRuntimeStatusRegistry,oO as resolveSearchCorpusFields,xk as resolveSearchMaxResults,Mk as resolveSearchPage,wk as resolveSearchScoreThreshold,Rk as resolveSearchTuning,sO as resolveSemanticCorpusCharacterLimit,lm as resolveSemanticLineageIds,ww as resolveSettingsWithSemanticRuntimeDefaults,$M as resolveSourceContextWritePolicy,Cm as resolveStartTaskInProgressStatus,Z as resolveSubcommandFlagContractsForCommand,WS as resolveTelemetryErrorCategory,SO as resolveTelemetrySourceAttribution,yv as resolveTerminalReason,pN as resolveTransactionSchema,OT as resolveTypeDefinition,wT as resolveTypeName,lw as resolveTypeSynonym,Cw as resolveTypeWorkflows,el as resolveUnknownAuthorAcknowledgmentSelector,Lk as resolveVectorIndexRecovery,cO as resolveVectorStores,rp as resolveWorkspaceRelationshipKindRegistry,MT as resolveWorkspaceRoot,hg as restore,zT as restoreCheckpointItems,ew as restoreWorkspaceJsonFromHistory,Wf as restoreWorkspaceSnapshot,Kf as restoreWorkspaceSnapshotWithRecovery,ml as reviseLinkedNote,Ug as runAction,Mb as runActiveBeforeMutationHooks,vb as runActiveCommandHandler,Ib as runActiveOnIndexHooks,Ji as runActiveOnReadHooks,Xi as runActiveOnWriteHooks,kb as runActiveParserOverride,Nb as runActivePreflightOverride,Lb as runActiveServiceOverride,km as runActivity,ab as runAfterCommandHooks,wf as runAggregate,md as runAnnotationCommand,Uu as runAppend,iv as runAssuranceAction,sv as runAssuranceDispatch,sb as runBeforeCommandHooks,vm as runCalendar,tf as runClaim,rf as runClaimNext,Bu as runClose,qu as runCloseMany,af as runCloseTask,ol as runComments,rh as runCompletion,il as runConfig,zt as runContext,Vv as runContextEvaluationCorpus,zv as runContextEvaluationScenario,zu as runCopy,dm as runCreate,pm as runDelete,ll as runDeps,vl as runDocs,sI as runDuplicates,Df as runEval,Gf as runEvent,zp as runExtension,Gc as runExtensionMigrateAction,Fc as runExtensionMigrations,Ul as runFiles,Bl as runFilesDiscover,jl as runFilesLookup,c_ as runFleetAttributionAnalytics,gm as runFocus,Du as runGc,Of as runGet,Tu as runGraph,eh as runGuide,Au as runHealth,Ak as runHistory,gv as runHistoryAttest,cv as runHistoryCompact,lv as runHistoryCompactBulk,BI as runHistoryMaintenance,uv as runHistoryRedact,zI as runHistoryRepair,VI as runHistoryRepairAll,Gg as runInActiveExtensionScope,Xp as runInit,Kp as runInitAgentGuidance,Gu as runLearnings,Ml as runLinkedArtifacts,A_ as runLinkedTests,mp as runList,Ff as runMeet,Gk as runMergeDriver,Ip as runMergeInstall,NI as runMergeReceiptEvidenceReport,kI as runMergeReceiptReport,Uk as runMergeReconcile,Qm as runNext,uf as runNotes,sf as runPauseTask,df as runPlan,Tf as runProfileApply,Sf as runProfileLint,Cf as runProfileList,yf as runProfileShow,s_ as runProvenanceCoverageAnalytics,QN as runRegisteredCommandForTest,n0 as runRegisteredCommandOverrideForTest,p0 as runRegisteredExporterForTest,e0 as runRegisteredHookForTest,d0 as runRegisteredImporterForTest,c0 as runRegisteredMigrationForTest,ZN as runRegisteredMutationGuardForTest,t0 as runRegisteredParserOverrideForTest,r0 as runRegisteredPreflightOverrideForTest,o0 as runRegisteredRendererOverrideForTest,s0 as runRegisteredSearchProviderForTest,i0 as runRegisteredServiceOverrideForTest,a0 as runRegisteredVectorStoreAdapterForTest,rr as runReindex,nf as runRelease,Uf as runRemind,bv as runReopen,pf as runRestore,Lp as runSchemaEvolutionMigration,Rf as runSearch,Ey as runSearchRefreshWorkerEntrypoint,nh as runStartBackgroundRun,of as runStartTask,f_ as runStats,h_ as runTelemetry,hf as runTemplatesList,_f as runTemplatesSave,gf as runTemplatesShow,x_ as runTest,b_ as runTestAll,oh as runTestRunsList,sh as runTestRunsLogs,ch as runTestRunsResume,ih as runTestRunsStatus,ah as runTestRunsStop,dh as runTestRunsWorker,Am as runUpdate,lf as runUpdateMany,Bt as runUpgrade,$u as runValidate,Fg as runWithActiveExtensions,L as runWithAgentSessionContext,Tw as runWithConfigurationOnlySettings,dx as runWithContextIntentContracts,HR as runWithDiscoveredContextIntentContracts,ci as runWithHarnessDetectionSignals,PL as runWithMcpTraceContext,yd as runWithReproducibleProcessEnvironment,di as runWithWorkspaceHarnessSignalDescriptors,Vr as runWithWorkspaceRecipe,VM as runWorkflowPolicyAction,av as runWorkspaceTransactionGc,Cu as saveGraphAuditBaseline,XI as scanClosureTimestamps,mI as scanExtensionHostVersions,Qp as scanHistoryAuthorAttribution,Fs as scanInProgressWork,Ho as scanItemFormatVersions,Ts as scanMutationSecrets,hI as scanProvenanceResolverHealth,Gs as scanStaleInProgressItems,ZI as scanStorageIntegrity,Ih as schema,Fh as schemaAddField,$h as schemaAddStatus,Nh as schemaAddType,Bh as schemaApplyPreset,qh as schemaInferTypes,vh as schemaList,Uh as schemaListFields,Vh as schemaRemapStatus,Gh as schemaRemoveField,Dh as schemaRemoveStatus,Lh as schemaRemoveType,Hh as schemaRenameField,zh as schemaRenameType,kh as schemaShow,jh as schemaShowField,Kh as schemaShowStatus,MN as scoreCommandPathMatch,Uv as scoreContextCandidates,jv as scoreContextCandidatesWithActiveExtensions,vs as scoreItemSimilarity,ID as scorePmGrammarRefusalClosure,SD as scorePmRefusalClosure,ks as scorePreparedItemSimilarity,ND as scoreTrackerPreflightRecoveryClosure,Lx as sealHistoryRecord,X0 as sealMcpRequestState,mh as search,pk as searchWorkspaceMemory,lk as searchWorkspaceMemoryReadResult,xs as secretGuardRuleCategory,FR as selectActionableEntries,UA as selectCursorSemanticOptions,Y_ as selectImportAuthor,xL as selectMcpClientRegistrationMode,dk as selectWorkspaceMemory,ck as selectWorkspaceMemoryRollups,hm as semanticAttributionAffinity,LO as sentryCaptureCliError,kO as sentryDiscardCommandSpan,NO as sentryFinishCommandSpan,DO as sentryFlush,$O as sentryLogCliUsageError,IO as sentrySetCommandContext,vO as sentryStartCommandSpan,Yo as serializeItemDocument,LN as serializeNdjsonRows,$N as serializeNdjsonStream,ly as serveDeclaredObservation,Ab as setActiveCommandContext,xb as setActiveCommandResult,hb as setActiveExtensionCommands,_b as setActiveExtensionHooks,gb as setActiveExtensionParsers,Cb as setActiveExtensionPreflight,Tb as setActiveExtensionRegistrations,Sb as setActiveExtensionRenderers,yb as setActiveExtensionServices,EE as setFocusedItem,rR as settingsSectionRevision,tR as shouldCompletePlanOnClose,hu as shouldPersistDurableGraphCache,yT as shouldResolveMutationStdinTokenField,CT as shouldResolveMutationStdinTokens,Rw as shouldRunSearchRefreshInForeground,kl as similarityAdvisoryWarnings,XE as sliceReadOutputRowCollection,ms as snapshotPmCliErrorContext,Ol as sortLinkedArtifacts,hP as sortWaiverNotices,cT as splitAcceptanceCriteria,QO as splitCommaList,Wo as splitFrontMatter,IA as stabilizeReadOutputReceiptEstimates,R as stableStringify,sN as stableUpsertValue,YS as stableValueEquals,jO as staleEligibleAt,Uw as stampRequiredItemFormat,Cg as startTask,sR as startTelemetryCommand,gh as stats,mE as statusIsTerminal,jc as stripGlobalBootstrapTokens,qk as subscribeMutationEventBatches,zk as subscribeMutationEvents,tI as summarizeAgentIdentityVocabulary,e_ as summarizeAgentModelProvenance,t_ as summarizeAgentProvenance,Hv as summarizeContextEvaluationReports,y_ as summarizeContextPreflight,kv as summarizeHistoryProvenance,Wp as summarizeInitResult,PI as summarizeMergeReceipt,xv as supportsCreateExplicitEmpty,cP as supportsItemIdAlias,$E as suppressHostOutput,we as syncRelationshipGraphAdapter,VN as synthesizeExtensionManifest,Ac as toCompletionFlagString,Km as toContextFocusItem,zm as toContextPackingSummary,Hm as toContextRankingSummary,$T as toErrorMessage,k_ as toEstimatedMinutesValue,eN as toExtensionFlagDefinitions,F_ as toImportBoolean,B_ as toImportConfidence,K_ as toImportDeferredFields,D_ as toImportInteger,V_ as toImportLinkedDocs,H_ as toImportLinkedFiles,W_ as toImportLinkedTests,z_ as toImportLogEntries,q_ as toImportNormalizedEnum,j_ as toImportNumberMap,N_ as toImportPriority,$_ as toImportStatus,G_ as toImportStringList,U_ as toImportStringMap,L_ as toImportTags,SE as toItemRecord,v_ as toNonEmptyImportString,LT as toNonEmptyStringOrUndefined,ME as toReplayDocument,Ex as toWellFormedText,Ms as tokenizeSimilarityText,gT as transferMutationStdinTokenPolicy,ob as translateHostEnvironmentFault,zO as unprovenClaimActivity,cg as update,g_ as updateLinkedTest,$g as upgrade,Zh as validate,yM as validateAssertionDefinition,TM as validateAssuranceDocument,SM as validateGateDefinition,dN as validateItemMutationRows,Pl as validateLinkedPaths,bL as validateMcpAuthorizationResponseIssuer,AL as validateMcpAuthorizationServerMetadata,wL as validateMcpClientMetadataDocument,_L as validateMcpHttpRequestHeaders,eL as validateMcpJsonSchema,CM as validateMeasurementDefinition,ow as validateMissingParentReference,wA as validateReadOutputOptions,dw as validateSprintOrReleaseValue,PT as validateTypeOptions,nP as validateWorkspaceTransactionIdentity,hv as verifyAttestation,lP as verifyCliFlagInvocationParity,AR as verifyExplicitPositionalSlotCensus,kE as verifyHistoryChain,vE as verifyHistoryChainWithVersion,VR as verifyHistoryEntries,$x as verifyHistoryRecordHash,Fx as verifyHistoryRewriteEvidence,OR as verifyPmCliGrammar,wR as verifyPmCommandPositionalContracts,jD as verifyPmFlagLexicon,lD as verifyPmRecoveryKindRuntimeCoverage,rS as verifyPmRecoveryProducerRuntimeCoverage,pD as verifyPmRecoveryReferences,_D as verifyPmRefusalClosureIdentityRatchet,fD as verifyPmRefusalClosureRatchet,dD as verifyPmRefusalReachability,wd as verifyToolOptionCliParity,_P as waiverNoticeFor,UO as wholeHoursSince,aw as withCliMutationInput,vc as withExpectedItemRevisions,js as withFlagAliasMetadata,ib as withHostEnvironmentBoundary,cw as withLiteralMutationInput,Z0 as withMcpCachePolicy,Gi as withoutGenericRefusalExamples,nT as workflowApprovalFingerprint,oT as workflowPolicyApplies,rT as workflowPolicyFingerprint,dl as workspaceGraphCache,sP as workspaceTransactionPlanDigest,ud as wrapOwnershipConflict,PO as wrapThrownErrorForSentry,mi as writeAuthorEnvironment,$e as writeFileAtomic,BT as writeMutationCheckpoint,bw as writeSettings,oR as writeSettingsSection,bx as writeStderr,xx as writeStdout,CO as writeVectorizationStatusLedger,Qb as writeWorkspaceJsonWithHistory,fl as writtenLinkedEntries};
35
35
  //# sourceMappingURL=sdk.js.map