@unbrained/pm-cli 2026.11.10 → 2026.11.12

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 (190) hide show
  1. package/.agents/skills/pm-test-audit/SKILL.md +2 -1
  2. package/.agents/skills/pm-user/references/ECOSYSTEM_PLANNING.md +2 -1
  3. package/.claude-plugin/marketplace.json +1 -1
  4. package/AGENTS.md +2 -2
  5. package/CHANGELOG.md +31 -0
  6. package/CONTRIBUTING.md +1 -1
  7. package/README.md +1 -1
  8. package/dist/cli/commander-usage.js +2 -2
  9. package/dist/cli/error-guidance.js +3 -3
  10. package/dist/cli/help-json-payload.js +1 -1
  11. package/dist/cli/main.js +4 -4
  12. package/dist/cli/register-mutation.js +2 -2
  13. package/dist/cli/register-operations.js +1 -1
  14. package/dist/cli/runtime/refusal-credential-redaction.js +2 -0
  15. package/dist/cli-bundle/bundle-manifest.json +1 -1
  16. package/dist/cli-bundle/chunks/{chunk-BSJSGDA3.js → chunk-2DUUL53Z.js} +2 -2
  17. package/dist/cli-bundle/chunks/{chunk-YSWD2NXB.js → chunk-2K6GJUW7.js} +2 -2
  18. package/dist/cli-bundle/chunks/{chunk-TBBWPEF5.js → chunk-3DWEBVIK.js} +2 -2
  19. package/dist/cli-bundle/chunks/{chunk-L4WWG2H6.js → chunk-5NGGI7JC.js} +2 -2
  20. package/dist/cli-bundle/chunks/{chunk-U7LILCUN.js → chunk-5NY6EQSX.js} +2 -2
  21. package/dist/cli-bundle/chunks/{chunk-X7NM5HVQ.js → chunk-6ESY4Y2B.js} +2 -2
  22. package/dist/cli-bundle/chunks/{chunk-CZETQYKO.js → chunk-A7L5IEYV.js} +2 -2
  23. package/dist/cli-bundle/chunks/{chunk-5CAMQHEW.js → chunk-EALO2FPM.js} +2 -2
  24. package/dist/cli-bundle/chunks/{chunk-7NAAW5EX.js → chunk-FJNHTBJ2.js} +2 -2
  25. package/dist/cli-bundle/chunks/chunk-FOT5K5OM.js +124 -0
  26. package/dist/cli-bundle/chunks/{chunk-F7P2NZEG.js → chunk-GDS4DC5A.js} +47 -43
  27. package/dist/cli-bundle/chunks/{chunk-F6FBGLR7.js → chunk-GLPUIQDB.js} +2 -2
  28. package/dist/cli-bundle/chunks/{chunk-4FLAKTZW.js → chunk-KJL42AN5.js} +2 -2
  29. package/dist/cli-bundle/chunks/{chunk-FYD6LSJA.js → chunk-L3SA3354.js} +2 -2
  30. package/dist/cli-bundle/chunks/chunk-MR3CRLA7.js +2 -0
  31. package/dist/cli-bundle/chunks/{chunk-NZAFLDSH.js → chunk-OBTU2BHJ.js} +2 -2
  32. package/dist/cli-bundle/chunks/{chunk-4AASUCHO.js → chunk-OFIXSWJS.js} +2 -2
  33. package/dist/cli-bundle/chunks/chunk-PS2YAPXC.js +9 -0
  34. package/dist/cli-bundle/chunks/{chunk-WNEUWDUE.js → chunk-PZI6CR24.js} +46 -46
  35. package/dist/cli-bundle/chunks/{chunk-NNE63MSM.js → chunk-T4UC3ZKL.js} +2 -2
  36. package/dist/cli-bundle/chunks/{chunk-EHDGHFMJ.js → chunk-U7MZIX3D.js} +2 -2
  37. package/dist/cli-bundle/chunks/chunk-UTNPDAID.js +31 -0
  38. package/dist/cli-bundle/chunks/{chunk-OJ2KEDUX.js → chunk-UY7Z3ZHQ.js} +2 -2
  39. package/dist/cli-bundle/chunks/{item-revision-M7KXLQXF.js → item-revision-SYJT6TVZ.js} +2 -2
  40. package/dist/cli-bundle/chunks/item-transaction-YXZ27UC6.js +2 -0
  41. package/dist/cli-bundle/chunks/{mutation-admission-374UR7NI.js → mutation-admission-T57TAVWI.js} +2 -2
  42. package/dist/cli-bundle/chunks/{register-list-query-GSB7PP5P.js → register-list-query-5XZXTPNG.js} +2 -2
  43. package/dist/cli-bundle/chunks/register-mutation-V6WJFL77.js +20 -0
  44. package/dist/cli-bundle/chunks/register-operations-5RAWXY2F.js +2 -0
  45. package/dist/cli-bundle/chunks/{register-setup-QDZ2Y3CI.js → register-setup-HCKCSQWQ.js} +2 -2
  46. package/dist/cli-bundle/chunks/{stage-67WGPKPH.js → stage-VIDXGF3T.js} +2 -2
  47. package/dist/cli-bundle/focused-chunks/{chunk-PAGW6A2X.js → chunk-3FN4ON2Z.js} +2 -2
  48. package/dist/cli-bundle/focused-chunks/chunk-5OCUNAQN.js +2 -0
  49. package/dist/cli-bundle/focused-chunks/chunk-AIYJHVKV.js +44 -0
  50. package/dist/cli-bundle/focused-chunks/{chunk-QHGGO7SY.js → chunk-AXPRCCYM.js} +2 -2
  51. package/dist/cli-bundle/focused-chunks/chunk-BB2GMKRB.js +2 -0
  52. package/dist/cli-bundle/focused-chunks/{chunk-QCHCEFTO.js → chunk-BHYGUVAU.js} +2 -2
  53. package/dist/cli-bundle/focused-chunks/chunk-GAXO2UQX.js +2 -0
  54. package/dist/cli-bundle/focused-chunks/{chunk-3K2MYE7R.js → chunk-GB2N4OM7.js} +2 -2
  55. package/dist/cli-bundle/focused-chunks/{chunk-HTMQDNVC.js → chunk-GBW2EAAG.js} +2 -2
  56. package/dist/cli-bundle/focused-chunks/{chunk-ZBOCYFBE.js → chunk-HIKZYZ26.js} +2 -2
  57. package/dist/cli-bundle/focused-chunks/chunk-IPIFI4NT.js +3 -0
  58. package/dist/cli-bundle/focused-chunks/chunk-KN7RBRRH.js +26 -0
  59. package/dist/cli-bundle/focused-chunks/{chunk-3DWNH72D.js → chunk-LAIN47EJ.js} +2 -2
  60. package/dist/cli-bundle/focused-chunks/{chunk-2SQUWQP3.js → chunk-MK7UQEE5.js} +18 -18
  61. package/dist/cli-bundle/focused-chunks/{chunk-LY3JXL25.js → chunk-NP5C2TQM.js} +2 -2
  62. package/dist/cli-bundle/focused-chunks/{chunk-RFMKS7VD.js → chunk-NSOXVVQX.js} +2 -2
  63. package/dist/cli-bundle/focused-chunks/{chunk-WJHDUON5.js → chunk-NY65XTX7.js} +2 -2
  64. package/dist/cli-bundle/focused-chunks/{chunk-67M7E2Z3.js → chunk-P6KYUJD4.js} +2 -2
  65. package/dist/cli-bundle/focused-chunks/chunk-RXY6BFRW.js +2 -0
  66. package/dist/cli-bundle/focused-chunks/{chunk-2Y4H4LIX.js → chunk-SPAEZKVA.js} +2 -2
  67. package/dist/cli-bundle/focused-chunks/chunk-TZO6L523.js +2 -0
  68. package/dist/cli-bundle/focused-chunks/{chunk-BE2GK2G7.js → chunk-VUNX6NBR.js} +53 -53
  69. package/dist/cli-bundle/focused-chunks/{item-revision-XC4ZJ7MY.js → item-revision-PWJNBW3F.js} +2 -2
  70. package/dist/cli-bundle/focused-chunks/{item-transaction-CVGK4RJP.js → item-transaction-T6HXC3NS.js} +2 -2
  71. package/dist/cli-bundle/focused-chunks/{mutation-admission-N27D5H64.js → mutation-admission-CLPOLSXZ.js} +2 -2
  72. package/dist/cli-bundle/focused-chunks/{stage-KPK2UHVO.js → stage-EKYWEU2Y.js} +2 -2
  73. package/dist/cli-bundle/main.js +32 -32
  74. package/dist/cli-bundle/sdk-authoring.js +1 -1
  75. package/dist/cli-bundle/sdk-contracts.js +2 -2
  76. package/dist/cli-bundle/sdk-core.js +1 -1
  77. package/dist/cli-bundle/sdk-governance.js +1 -1
  78. package/dist/cli-bundle/sdk-graph.js +1 -1
  79. package/dist/cli-bundle/sdk-merge.js +57 -57
  80. package/dist/cli-bundle/sdk-query.js +1 -1
  81. package/dist/cli-bundle/sdk-runtime.js +1 -1
  82. package/dist/cli-bundle/sdk-testing.js +1 -1
  83. package/dist/cli-bundle/sdk.js +12 -12
  84. package/dist/core/item/parse.d.ts +13 -1
  85. package/dist/core/item/parse.js +4 -4
  86. package/dist/core/sentry/instrument.js +1 -1
  87. package/dist/core/shared/secret-rules.d.ts +18 -2
  88. package/dist/core/shared/secret-rules.js +4 -2
  89. package/dist/core/shared/url-credentials.d.ts +37 -0
  90. package/dist/core/shared/url-credentials.js +2 -0
  91. package/dist/core/telemetry/runtime.js +2 -2
  92. package/dist/sdk/agent/command-recovery.js +1 -1
  93. package/dist/sdk/cli-contracts/commander-mutation-options.js +1 -1
  94. package/dist/sdk/cli-contracts/completeness.js +1 -1
  95. package/dist/sdk/cli-contracts/flag-contracts.js +1 -1
  96. package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +1 -1
  97. package/dist/sdk/cli-contracts/tool-schema.d.ts +1 -1
  98. package/dist/sdk/cli-contracts/tool-schema.js +1 -1
  99. package/dist/sdk/command-line.d.ts +1 -1
  100. package/dist/sdk/command-line.js +1 -1
  101. package/dist/sdk/completion/bash.js +1 -1
  102. package/dist/sdk/completion/fish.js +3 -1
  103. package/dist/sdk/completion/zsh.js +3 -1
  104. package/dist/sdk/docs.d.ts +14 -2
  105. package/dist/sdk/docs.js +1 -1
  106. package/dist/sdk/files.d.ts +14 -2
  107. package/dist/sdk/files.js +1 -1
  108. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1 -1
  109. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +1 -1
  110. package/dist/sdk/governance/boundary-fixtures.d.ts +25 -0
  111. package/dist/sdk/governance/boundary-fixtures.js +1 -1
  112. package/dist/sdk/governance/defect-recurrence.d.ts +8 -1
  113. package/dist/sdk/governance/defect-recurrence.js +2 -2
  114. package/dist/sdk/guide-topics.js +1 -1
  115. package/dist/sdk/index.d.ts +1 -1
  116. package/dist/sdk/index.js +1 -1
  117. package/dist/sdk/lifecycle/dependency-removal.js +2 -0
  118. package/dist/sdk/lifecycle/item-revision.js +1 -1
  119. package/dist/sdk/lifecycle/start-blockers.d.ts +9 -0
  120. package/dist/sdk/lifecycle/start-blockers.js +1 -1
  121. package/dist/sdk/lifecycle/update.d.ts +10 -4
  122. package/dist/sdk/lifecycle/update.js +2 -2
  123. package/dist/sdk/linked-artifacts.d.ts +73 -3
  124. package/dist/sdk/linked-artifacts.js +2 -2
  125. package/dist/sdk/public-surface.json +1 -1
  126. package/dist/sdk/runtime/actions.js +1 -1
  127. package/dist/sdk/test/command-args.js +1 -1
  128. package/dist/sdk/test/execution.d.ts +15 -3
  129. package/dist/sdk/test/execution.js +2 -2
  130. package/docs/AGENT_GUIDE.md +2 -2
  131. package/docs/AGENT_UX_CONTRACTS.md +7 -1
  132. package/docs/BUILD_AND_RELEASE_ACCEPTANCE.md +1 -1
  133. package/docs/CODEX_PLUGIN.md +2 -1
  134. package/docs/COMMANDS.md +16 -9
  135. package/docs/CONFIGURATION.md +16 -0
  136. package/docs/CORPUS_SHAPES.md +1 -1
  137. package/docs/DEFECT_RECURRENCE.md +20 -1
  138. package/docs/MUTATION_INTEGRITY.md +65 -0
  139. package/docs/ONBOARDING.md +1 -1
  140. package/docs/README.md +8 -8
  141. package/docs/SDK.md +46 -0
  142. package/docs/SDK_CONTEXT_INTEGRITY.md +2 -0
  143. package/docs/TESTING.md +1 -1
  144. package/docs/generated/FLAG_LEXICON_BUDGETS.md +6 -6
  145. package/marketplace.json +1 -1
  146. package/package.json +9 -1
  147. package/packages/pm-beads/package.json +1 -1
  148. package/packages/pm-calendar/package.json +1 -1
  149. package/packages/pm-command-kit/package.json +1 -1
  150. package/packages/pm-digital-twin/package.json +1 -1
  151. package/packages/pm-governance-audit/package.json +1 -1
  152. package/packages/pm-guide-shell/package.json +1 -1
  153. package/packages/pm-kanban/package.json +1 -1
  154. package/packages/pm-lifecycle-hooks/package.json +1 -1
  155. package/packages/pm-linked-test-adapters/package.json +1 -1
  156. package/packages/pm-search-advanced/package.json +1 -1
  157. package/packages/pm-templates/package.json +1 -1
  158. package/packages/pm-todos/package.json +1 -1
  159. package/packages/pm-vcs/package.json +1 -1
  160. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  161. package/plugins/pm-claude/package.json +1 -1
  162. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  163. package/plugins/pm-codex/package.json +1 -1
  164. package/plugins/pm-codex/plugin.json +1 -1
  165. package/runtime-dependencies.json +1 -1
  166. package/dist/cli-bundle/chunks/chunk-D727C4RO.js +0 -122
  167. package/dist/cli-bundle/chunks/chunk-T2MNRM3S.js +0 -9
  168. package/dist/cli-bundle/chunks/chunk-UFPLZ6LZ.js +0 -2
  169. package/dist/cli-bundle/chunks/chunk-UL64P6MR.js +0 -31
  170. package/dist/cli-bundle/chunks/item-transaction-4N5P34GO.js +0 -2
  171. package/dist/cli-bundle/chunks/register-mutation-ZBF6ITYK.js +0 -20
  172. package/dist/cli-bundle/chunks/register-operations-PWF6GOHE.js +0 -2
  173. package/dist/cli-bundle/focused-chunks/chunk-56MIAFEN.js +0 -24
  174. package/dist/cli-bundle/focused-chunks/chunk-ALLOWZSH.js +0 -2
  175. package/dist/cli-bundle/focused-chunks/chunk-LWMPQRJT.js +0 -2
  176. package/dist/cli-bundle/focused-chunks/chunk-NZQYHPUN.js +0 -3
  177. package/dist/cli-bundle/focused-chunks/chunk-QK7FX4O5.js +0 -44
  178. package/dist/cli-bundle/focused-chunks/chunk-U7HWWEJ2.js +0 -2
  179. package/dist/cli-bundle/focused-chunks/chunk-UIZVD36C.js +0 -2
  180. package/dist/cli-bundle/focused-chunks/chunk-WK773UVA.js +0 -2
  181. package/docs/CHATGPT_CODEX_PLUGIN_IMPLEMENTATION.md +0 -776
  182. package/docs/CONTEXT_ALGORITHM_PORTFOLIO.md +0 -167
  183. package/docs/DEVELOPMENT_DEPENDENCY_SECURITY.md +0 -246
  184. package/docs/PR_REVIEW_LOOP.md +0 -96
  185. package/docs/RELEASE_LEDGER_RECONCILIATION.md +0 -148
  186. package/docs/RELEASE_RELIABILITY.md +0 -147
  187. package/docs/RELEASING.md +0 -805
  188. package/docs/performance/corpus-shape-comparison.json +0 -1
  189. package/docs/performance/latest-scale-report.json +0 -1
  190. package/docs/performance/scale-100k-report.json +0 -1
@@ -1,8 +1,8 @@
1
- import{a as fg}from"./chunks/chunk-F6FBGLR7.js";import{a as jk,b as Bk,c as qk,d as zk}from"./chunks/chunk-YSWD2NXB.js";import{a as Hk,b as Vk}from"./chunks/chunk-OJ2KEDUX.js";import{b as pk,c as uk,d as mk,e as fk,f as _k,g as hk,h as gk,i as yk,j as bk,k as Tk,l as Ck,m as Ek,n as Sk,o as wk,p as Ak,q as vk,r as Ok}from"./chunks/chunk-U7LILCUN.js";import{A as Nk,B as Lk,C as Dk,D as $k,E as Fk,F as Gk,G as Uk,a as Ns,b as wR,c as AR,d as wd,e as Ad,f as vd,h as Od,i as Rd,j as Id,k as Pd,l as Md,m as kd,n as xd,o as Nd,p as $c,q as Fc,r as Gc,s as Uc,t as jc,u as Rk,v as Ik,w as Pk,x as Mk,y as kk,z as xk}from"./chunks/chunk-4FLAKTZW.js";import{A as bx,B as Tx,C as Cx,D as Ex,E as Sx,F as wx,G as Ax,H as vx,I as Ox,J as Rx,K as Ix,L as Px,M as Mx,N as kx,O as xx,P as Nx,Q as Lx,R as Dx,S as $x,T as Fx,U as Gx,V as Ux,W as jx,X as Bx,Y as qx,Z as zx,_ as Hx,a as Kk,b as Wk,c as Yk,d as Xk,e as Jk,f as Zk,g as Qk,h as ex,i as tx,j as rx,k as ox,l as nx,m as ix,n as sx,o as ax,p as dx,q as cx,r as lx,s as px,t as ux,u as mx,v as fx,w as _x,x as hx,y as gx,z as yx}from"./chunks/chunk-7NAAW5EX.js";import{$ as Xm,$a as q_,$b as qh,A as Ye,Aa as p_,Ab as hh,B as Lm,Ba as u_,Bb as gh,C as Dm,Ca as m_,Cb as yh,D as Fm,Da as f_,Db as bh,E as Ht,Ea as __,Eb as Th,F as Vt,Fa as h_,Fb as Ch,G as Kt,Ga as g_,Gb as Eh,H as Wt,Ha as y_,Hb as Sh,I as Yt,Ia as b_,Ib as wh,J as Xt,Ja as T_,Jb as Ah,K as Jt,Ka as C_,Kb as vh,L as Zt,La as E_,Lb as Oh,M as Qt,Ma as S_,Mb as Rh,N as er,Na as w_,Nb as Ih,O as tr,Oa as A_,Ob as Ph,P as Gm,Pa as v_,Pb as Mh,Q as Um,Qa as O_,Qb as kh,R as jm,Ra as R_,Rb as xh,S as Bm,Sa as I_,Sb as Nh,T as qm,Ta as rr,Tb as Lh,U as Xe,Ua as ge,Ub as Dh,V as zm,Va as $_,Vb as $h,W as Hm,Wa as F_,Wb as Fh,X as Vm,Xa as G_,Xb as Gh,Y as Km,Ya as U_,Yb as Uh,Z as Wm,Za as j_,Zb as jh,_ as Ym,_a as B_,_b as Bh,a as $O,aa as Jm,ab as z_,ac as zh,b as FO,ba as V0,bb as H_,bc as Hh,c as GO,ca as K0,cb as V_,cc as Vh,d as UO,da as W0,db as K_,dc as Kh,e as jO,ea as pf,eb as W_,ec as Wh,f as BO,fa as uf,fb as Y_,fc as Yh,g as HO,ga as mf,gb as X_,gc as Xh,h as VO,ha as e_,hb as J_,hc as Jh,i as KO,ia as t_,ib as Z_,ic as Zh,j as WO,ja as ok,jb as Q_,jc as Qh,k as Ls,ka as nk,kb as eh,kc as eg,l as Qd,la as ik,lb as th,lc as tg,m as ec,ma as sk,mb as rh,mc as rg,n as tc,na as ak,nb as oh,nc as og,o as oP,oa as dk,ob as nh,oc as ng,p as nP,pa as ck,pb as ih,pc as ig,q as iP,qa as lk,qb as sh,qc as sg,r as sP,ra as r_,rb as ah,rc as ag,s as aP,sa as o_,sb as dh,sc as dg,t as dP,ta as n_,tb as ch,tc as cg,u as Tu,ua as i_,ub as lh,uc as lg,v as Su,va as s_,vb as ph,vc as pg,w as wu,wa as a_,wb as uh,wc as ug,x as qu,xa as d_,xb as mh,xc as mg,y as Xu,ya as c_,yb as fh,z as xM,za as l_,zb as _h}from"./chunks/chunk-F7P2NZEG.js";import{e as pP,f as uP,g as Hl,h as Vl,i as Bt}from"./chunks/chunk-5CAMQHEW.js";import{A as L0,B as D0,C as $0,D as F0,E as G0,F as U0,G as j0,H as B0,I as q0,J as z0,K as H0,L as ef,M as tf,N as rf,O as of,P as nf,Q as sf,R as af,S as df,T as cf,U as lf,a as hM,b as gM,c as yM,d as bM,e as TM,f as bu,g as CM,h as EM,i as SM,j as wM,k as AM,m as $m,n as Zm,o as w0,p as A0,q as v0,r as O0,s as R0,t as I0,u as Qm,v as P0,w as M0,x as k0,y as x0,z as N0}from"./chunks/chunk-L4WWG2H6.js";import{$ as _I,$a as up,$b as uM,$c as xm,A as Ve,Aa as UI,Ab as WP,Ac as Fu,Ad as Df,B as te,Ba as jI,Bb as YP,Bc as Gu,Bd as $f,C as tl,Ca as BI,Cb as tM,Cc as Uu,Cd as Ff,Db as rM,Dc as ju,Dd as Gf,Ea as cP,Eb as nu,Ed as Uf,F as Ke,Fa as lP,Fb as iu,Fc as MM,Fd as jf,G as rl,Ga as Fl,Gb as oM,Gc as kM,Gd as Bf,H as ol,Ha as Gl,Hb as nM,Hc as Bu,Ia as Ul,Ib as iM,Ic as Ju,Id as qf,J as he,Ja as jl,Jb as sM,Jc as Zu,Jd as zf,K as nl,Ka as Bl,Kb as aM,Kc as Qu,Kd as Hf,L as il,La as ql,Lb as su,Lc as em,Ld as Vf,M as sl,Ma as zl,Mb as au,Mc as tm,Md as Kf,N as al,Na as Zl,Nb as du,Nd as Wf,O as nI,Oa as Ql,Ob as cu,Od as Yf,P as iI,Pa as ep,Pb as lu,Pd as Xf,Q as sI,Qa as tp,Qb as pu,Qd as Jf,R as aI,Ra as rp,Rb as uu,Rc as rm,Rd as Zf,S as dI,Sa as op,Sb as mu,Sd as Qf,T as Nt,Ta as np,Tb as fu,Tc as om,Td as P_,U as cI,Ua as ip,Ub as _u,Uc as nm,Ud as M_,V as lI,Va as sp,Vb as hu,Vc as Rm,Vd as k_,W as Lt,Wa as ap,Wb as gu,Wc as Im,Wd as x_,X as pI,Xa as dp,Xb as dM,Xd as N_,Y as uI,Ya as cp,Yb as cM,Yc as Pm,Yd as L_,Z as mI,Za as lp,Zb as lM,Zc as Mm,Zd as D_,_ as fI,_a as pp,_b as pM,_c as km,a as vR,aa as We,ab as mp,ac as mM,ad as Nm,b as Pt,ba as hI,bb as fp,bc as fM,bd as ff,c as OR,ca as Dt,cb as _p,cc as _M,cd as _f,d as zd,da as gI,db as _P,dc as yu,dd as hf,e as Hd,ea as yI,eb as hp,ec as vM,ed as gf,f as Vd,fa as bI,fb as gp,fc as OM,fd as yf,g as Kd,ga as TI,gb as yp,gc as RM,gd as bf,h as Wd,ha as CI,hb as bp,hc as IM,hd as Tf,ia as EI,ib as hP,ic as PM,id as Cf,j as Yd,ja as SI,jb as Tp,jd as Ef,k as Xd,ka as wI,kb as Cp,kc as Cu,kd as ek,la as AI,lb as Ep,lc as Eu,ld as tk,ma as vI,mb as Sp,mc as Au,md as rk,na as OI,nb as wp,nc as vu,nd as Sf,o as Jd,oa as RI,ob as gP,od as wf,p as Zd,pa as II,pb as yP,pc as Ou,pd as Af,qa as PI,qb as bP,qc as Ru,qd as vf,ra as MI,rb as TP,rc as Iu,rd as Of,sa as kI,sb as CP,sc as Pu,sd as Rf,ta as xI,tb as EP,tc as Mu,td as If,ua as NI,ub as SP,uc as ku,ud as Pf,va as LI,vb as qP,vc as xu,vd as Mf,w as kt,wa as DI,wb as zP,wc as Nu,wd as kf,xa as $I,xb as HP,xc as Lu,xd as xf,y as xt,ya as FI,yb as VP,yc as Du,yd as Nf,za as GI,zb as KP,zc as $u,zd as Lf}from"./chunks/chunk-UL64P6MR.js";import"./chunks/chunk-UJMQP2HP.js";import{w as Bc}from"./chunks/chunk-TBBWPEF5.js";import{A as rP,Aa as Il,B as Tl,C as Cl,Ca as Pl,D as El,Da as Ml,E as Sl,Ea as kl,F as $t,Fa as xl,Ga as Nl,Ia as Ll,Ja as Dl,Ka as $l,a as QO,b as eR,c as tR,d as rR,e as oR,f as nR,g as Ds,h as $s,i as Fs,j as Gs,k as Us,la as Ft,m as qI,ma as Gt,na as Ut,oa as jt,pa as wl,ra as Al,sa as vl,ta as Ol,v as ZI,w as QI,y as eP,z as tP,za as Rl}from"./chunks/chunk-NZAFLDSH.js";import{a as zI,b as HI,c as VI,d as KI,e as WI,f as YI,g as XI,h as ul,i as ml,j as fl,k as _l,l as hl,m as JI,n as gl,o as yl,p as bl}from"./chunks/chunk-FYD6LSJA.js";import{$a as $P,$b as a0,A as XR,Aa as Xp,Ab as DM,Ac as Sm,B as qc,Ba as Jp,Bb as $M,Bc as wm,C as zc,Ca as Zp,Cb as FM,Cc as Am,D as Hc,Da as Qp,Db as GM,Dc as zt,E as Vc,Ea as eu,Eb as UM,Ec as vm,F as Kc,Fa as tu,Fb as jM,Fc as T0,G as Wc,Ga as ru,Gc as C0,H as Yc,Ha as ou,Hb as cm,Hc as E0,I as Xc,Ib as BM,Ic as Om,J as Jc,Jb as qM,Jc as S0,K as Zc,Kb as zM,Kc as Y0,L as Qc,La as wP,Lb as HM,Lc as X0,M as He,Ma as AP,Mb as VM,Mc as J0,N as JR,Na as vP,Nb as KM,Nc as Z0,O as ZR,Oa as OP,Ob as WM,Oc as Q0,P as QR,Pa as RP,Pb as YM,Q as eI,Qa as IP,Qb as XM,R as tI,Ra as PP,Rb as JM,S as rI,Sa as MP,Sb as ZM,T as oI,Ta as kP,Tb as QM,U as el,Ua as xP,Ub as e0,V as Kl,Va as NP,Vb as t0,W as Wl,Wa as LP,Wb as r0,X as Yl,Xa as DP,Xb as o0,Y as Xl,Yb as n0,Z as mP,Zb as i0,_ as fP,_b as s0,a as YO,aa as Jl,ac as d0,b as XO,ba as Ap,bb as FP,bc as c0,c as JO,ca as vp,cb as GP,cc as l0,d as ZO,da as Op,dc as p0,e as DR,ea as Rp,ec as u0,f as $R,fa as Ip,fb as UP,fc as m0,g as FR,ga as Pp,gb as jP,gc as f0,h as GR,ha as Mp,hb as BP,hc as _0,i as UR,ia as kp,ic as h0,j as jR,ja as xp,jb as XP,jc as g0,k as BR,ka as Np,kb as JP,kc as y0,la as Lp,lb as ZP,lc as b0,ma as Dp,mb as QP,mc as qt,na as $p,nb as eM,nc as lm,oa as Fp,ob as zu,oc as pm,pa as Gp,pb as Hu,pc as um,qa as Up,qb as Vu,qc as mm,ra as jp,rb as Ku,rc as fm,sa as Bp,sb as Wu,sc as _m,t as qR,ta as qp,tb as Yu,tc as hm,u as zR,ua as zp,ub as NM,uc as gm,v as HR,va as Hp,vb as im,vc as ym,w as VR,wa as Vp,wb as sm,wc as bm,x as KR,xa as Kp,xb as am,xc as Tm,y as WR,ya as Wp,yb as dm,yc as Cm,z as YR,za as Yp,zb as LM,zc as Em}from"./chunks/chunk-CZETQYKO.js";import{a as qO,b as zO}from"./chunks/chunk-EHDGHFMJ.js";import{$ as fa,$a as fd,$b as xR,A as qs,Aa as ja,Ab as ac,B as zs,Ba,Bb as dc,Ca as qa,Cb as cc,D as Hs,Da as za,Db as lc,E as Vs,Ea as Ha,Eb as pc,F as Ks,Fa as Va,Fb as uc,G as Ws,Ga as Ka,Gb as mc,H as Ys,Ha as Wa,Hb as fc,I as Xs,Ia as Ya,Ib as _c,J as Js,Ja as Xa,Jb as hc,K as Zs,Ka as Ja,Kb as gc,L as Qs,La as Za,Lb as yc,M as ea,Ma as Qa,Mb as bc,N as ta,Na as ed,Nb as Tc,O as ra,Oa as td,Ob as Cc,P as oa,Pa as rd,Pb as Ec,Q as na,Qa as od,Qb as Sc,Ra as nd,Rb as wc,S as ia,Sa as id,Sb as Ac,T as sa,Ta as sd,U as aa,Ua as ad,V as da,Va as dd,W as ca,Wa as cd,Wb as RR,X as la,Xa as ld,Xb as IR,Y as pa,Ya as pd,Yb as PR,Z as ua,Za as ud,Zb as MR,_ as ma,_a as md,_b as kR,a as iR,aa as _a,ab as _d,ac as NR,b as sR,ba as ha,bb as hd,bc as LR,c as aR,ca as ga,cb as gd,d as dR,da as ya,db as yd,dc as vc,e as cR,ea as ba,eb as bd,ec as Oc,f as lR,fa as Ta,fb as Td,fc as Rc,g as pR,ga as Ca,gb as Cd,gc as Ic,h as js,ha as Ea,hb as Ed,hc as Pc,i as uR,ia as Sa,ic as Mc,ja as wa,jb as ze,jc as kc,ka as Aa,kb as ee,kc as xc,l as mR,la as va,lb as Sd,lc as Nc,m as fR,ma as Oa,mb as Ld,mc as Lc,n as Be,na as Ra,nb as Dd,nc as Dc,o as _R,oa as Ia,ob as $d,oc as Mt,p as hR,pa as Pa,pb as Fd,q as gR,qa as Ma,qb as Gd,r as It,ra as ka,rb as Ud,s as qe,sa as xa,sb as jd,t as yR,ta as Na,tb as Bd,u as bR,ua as La,ub as qd,v as TR,va as Da,vb as rc,w as CR,wa as $a,wb as oc,x as ER,xa as Fa,xb as nc,y as SR,ya as Ga,yb as ic,z as Bs,za as Ua,zb as sc}from"./chunks/chunk-T2MNRM3S.js";import{a as RO,b as IO,c as PO,d as MO,e as kO,f as xO,g as NO,h as LO,i as DO,j as As,k as vs,l as Os,m as Rs,n as Is,o as Ps,q as Ms,s as ks,y as xs}from"./chunks/chunk-UFPLZ6LZ.js";import{b as AO}from"./chunks/chunk-4AASUCHO.js";import"./chunks/chunk-IB7UB5TE.js";import{$ as IE,$b as Nv,$c as _s,A as ZT,Aa as BA,Ab as Tv,Ad as wO,B as QT,Bc as ss,Bd as vO,Cb as Cv,Cc as as,Cd as OO,Db as Ev,Dc as ds,Eb as Sv,Ec as cs,Fb as wv,Fc as ls,Gb as Zi,Gc as ps,Hb as Qi,Hc as Wv,Ic as Yv,J as cC,Jb as es,Jc as Xv,Ka as qA,Kb as Av,Kc as Jv,L as yC,La as zA,Lc as Zv,M as bC,Ma as HA,Mb as vv,Mc as Qv,N as TC,Na as VA,Nb as Ov,Nc as eO,O as CC,Oa as KA,Ob as Rv,Oc as tO,P as OC,Pa as WA,Pc as rO,Q as RC,Qa as ev,Qb as Iv,Qc as oO,R as At,Ra as tv,Rc as nO,S as SE,Sa as rv,Sc as iO,T as wE,Ta as vt,Tb as Pv,Tc as sO,U as AE,Uc as aO,Va as ov,Vb as Mv,Vc as dO,W as vE,Wa as nv,Wc as cO,Xa as iv,Xc as lO,Y as OE,Ya as sv,Yc as us,Z as RE,Za as av,Zb as kv,Zc as ms,_b as xv,_c as fs,a as FT,aa as PE,ab as dv,ac as ts,ad as hs,ba as ME,bc as Lv,bd as gs,ca as hA,cd as ys,da as gA,dc as Dv,dd as bs,ea as yA,eb as Wi,ec as $v,ed as Ts,fa as bA,fc as Fv,fd as Cs,ga as IA,gc as Gv,gd as Es,hc as Uv,hd as Ss,i as an,ia as zi,ic as jv,id as ws,j as GT,ja as Hi,jc as Bv,jd as pO,k as UT,ka as Vi,kc as qv,kd as uO,l as jT,lc as zv,ld as mO,m as BT,ma as PA,mc as Hv,md as fO,n as qT,na as MA,nc as Ot,nd as _O,o as zT,oa as kA,oc as Vv,od as hO,pa as xA,pd as gO,q as HT,qa as NA,qc as Kv,qd as yO,ra as LA,rd as bO,s as VT,sa as DA,sd as TO,t as KT,td as CO,u as WT,ua as $A,w as YT,wa as FA,wc as rs,x as XT,xa as GA,xb as gv,xc as os,xd as Rt,ya as UA,yb as yv,yc as ns,yd as EO,z as JT,za as jA,zb as bv,zc as is,zd as SO}from"./chunks/chunk-D727C4RO.js";import{$ as bt,$b as LC,$c as eE,$d as UE,$e as rS,$f as RS,$g as iw,$h as eA,$i as fv,A as Uo,Aa as eC,Ab as _C,Ac as VC,Ad as $n,Ae as Jn,Ag as NS,Ah as kw,Ai as CA,B as jo,Ba as tC,Bc as KC,Bd as gE,Be as KE,Bg as LS,Bh as xw,Bi as EA,C as Bo,Ca as rC,Cb as Et,Cd as Fn,Ce as WE,Cg as DS,Ch as Nw,Ci as SA,D as qo,De as YE,Dg as $S,Dh as Lw,Di as wA,E as zo,Eb as St,Ed as yE,Ee as XE,Eg as FS,Eh as Dw,Ei as AA,F as Ho,Fa as yn,Fd as bE,Fe as JE,Ff as dS,Fg as GS,Fh as $w,Fi as vA,G as Vo,Ga as oC,Gb as Rn,Gd as TE,Ge as ZE,Gf as cS,Gh as Fw,Gi as OA,H as De,Ha as nC,Hb as In,Hc as kn,Hd as CE,He as QE,Hf as lS,Hi as RA,I as $e,Ia as iC,Ib as _e,Ic as WC,Id as EE,Ie as eS,If as pS,Ig as US,J as Ko,Ja as sC,Jd as kE,Je as tS,Jf as uS,Jg as jS,Jh as Gw,K as Wo,Kb as hC,Kc as YC,Kd as xE,Ke as Zn,Kf as mS,Kg as BS,Kh as Uw,L as Yo,La as bn,Ld as NE,Le as Qn,Lf as fS,Lg as qS,Lh as jw,M as Xo,Ma as Tn,Mb as gC,Md as LE,Me as D,Mf as _S,Mg as zS,Mh as Bw,Mi as YA,N as Jo,Na as Ge,Nb as EC,Nd as DE,Ne as ei,Nf as hS,Ng as HS,Nh as qw,O as Zo,Oa as aC,Ob as SC,Od as $E,Of as gS,Og as VS,Oh as zw,P as Qo,Pa as dC,Pb as wC,Pf as yS,Pg as KS,Ph as Hw,Pi as XA,Q as en,Qa as Cn,Qb as AC,Qg as WS,Qh as Vw,Qi as JA,R as tn,Ra as En,Rb as vC,Rg as YS,S as rn,Sb as IC,Sf as bS,Sg as XS,Sh as Kw,T as on,Ta as Sn,Tb as Ue,Te as je,Tf as TS,Tg as JS,Th as Ww,Ti as ZA,U as nn,Ub as wt,Ud as FE,Ue as ti,Uf as CS,Ug as ZS,Ui as Ki,V as sn,Vb as PC,Vf as ES,Vg as QS,Vi as QA,Wb as MC,Wc as XC,Wf as SS,Wg as ew,Wh as Yw,Wi as cv,Xb as kC,Xc as JC,Xd as Gn,Xf as wS,Xg as tw,Xh as Xw,Xi as lv,Yb as xC,Yc as ZC,Yd as GE,Yf as AS,Yg as rw,Yh as Jw,Yi as pv,Zb as z,Zd as Un,Zf as vS,Zg as ow,Zh as Zw,Zi as uv,_b as NC,_c as QC,_f as OS,_g as nw,_h as Qw,_i as mv,a as I,aa as Tt,ac as DC,af as oS,ag as IS,ah as sw,ai as tA,aj as _v,b as vT,ba as pn,bc as $C,bd as tE,bf as nS,bg as PS,bh as aw,bi as rA,bj as hv,c as yt,ca as un,cc as FC,cd as xn,cf as ri,ch as dw,ci as oA,cj as Yi,d as OT,da as mn,dc as GC,df as oi,dg as Ei,dh as cw,di as nA,dj as Xi,e as RT,eb as wn,ec as UC,ed as Nn,ee as jE,ef as ni,eg as Si,eh as lw,ei as iA,ej as Ji,f as IT,fb as An,fd as Ln,ff as ii,fg as wi,fh as pw,fi as sA,g as PT,gb as vn,ge as BE,gf as si,gg as Ai,gh as uw,gi as aA,h as MT,ha as fn,hc as jC,he as qE,hf as ai,hg as vi,hh as mw,i as kT,ib as On,id as rE,ie as jn,if as di,ig as Oi,ih as fw,ii as dA,j as xT,ja as _n,jc as Pn,jd as oE,je as Bn,jf as ci,jg as Ri,jh as _w,ji as Bi,k as NT,ka as hn,kc as Mn,kd as nE,kf as li,kg as Ii,kh as hw,ki as qi,l as LT,la as gn,lb as lC,ld as iE,le as qn,lf as pi,lg as Pi,lh as gw,m as DT,mb as pC,md as sE,me as zn,mf as ui,mg as Mi,mh as yw,n as $T,nd as aE,ne as Hn,nf as mi,ng as ki,nh as bw,o as Mo,od as dE,oe as Vn,of as fi,og as xi,oh as Tw,p as ko,pd as Dn,pe as Kn,pf as _i,pg as Ni,ph as Cw,pi as cA,q as xo,qd as cE,qe as zE,qf as hi,qg as Li,qh as Ew,qi as lA,r as No,rb as uC,rd as lE,re as HE,rf as iS,rg as Di,rh as Sw,ri as pA,s as Ne,sf as sS,sg as $i,sh as ww,si as uA,t as Lo,tf as gi,tg as Fi,th as Aw,u as L,ub as mC,ud as pE,uf as aS,ug as Gi,uh as vw,ui as mA,v as Le,vc as BC,vd as uE,vf as yi,vg as Ui,vh as Ow,vi as fA,w as Do,wd as mE,we as Wn,wf as bi,wg as ji,wh as Rw,x as $o,xb as fC,xc as qC,xd as fE,xe as Yn,xf as Ti,xg as MS,xh as Iw,xi as _A,y as Fo,yc as zC,yd as _E,ye as VE,yf as Ci,yg as kS,yh as Pw,z as Go,zc as HC,zd as hE,ze as Xn,zg as xS,zh as Mw,zi as TA}from"./chunks/chunk-WNEUWDUE.js";import"./chunks/chunk-SPPHDVZE.js";import{a as dl,b as cl,e as ll,f as pl}from"./chunks/chunk-RSAN2YUU.js";import"./chunks/chunk-VS565KBX.js";import{A as me,B as AT,C as b,E as dn,F as Ct,G as fe,H as cn,K as Fe,M as ln,b as yT,c as bT,d as TT,m as CT,r as ET,u as ST,y as wT}from"./chunks/chunk-O4ZLEN4T.js";import"./chunks/chunk-XAWE4EAK.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="8f11e0bf-4115-55a8-bd39-c360f43cdc09")}catch{}})();var H="2026-07-28",nr=["2025-11-25","2025-06-18"],re=[H],m={headerMismatch:-32020,missingRequiredClientCapability:-32021,unsupportedProtocolVersion:-32022,invalidParams:-32602},w={clientCapabilities:"io.modelcontextprotocol/clientCapabilities",clientInfo:"io.modelcontextprotocol/clientInfo",logLevel:"io.modelcontextprotocol/logLevel",protocolVersion:"io.modelcontextprotocol/protocolVersion",serverInfo:"io.modelcontextprotocol/serverInfo"},or=["debug","info","notice","warning","error","critical","alert","emergency"],u=class extends Error{code;data;constructor(t,r,o={}){super(t),this.name="PmMcpProtocolError",this.code=r,this.data=o}};function h(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function _g(e){if(e===void 0)return;if(!h(e))throw new u("Invalid MCP clientInfo metadata",m.invalidParams,{field:w.clientInfo,expected:"object"});let t=typeof e.name=="string"?e.name.trim():"",r=typeof e.version=="string"?e.version.trim():"";if(t.length===0||r.length===0)throw new u("Invalid MCP clientInfo metadata",m.invalidParams,{field:w.clientInfo,required:["name","version"]});let o={name:t.slice(0,128),version:r.slice(0,128)};return typeof e.description=="string"&&e.description.trim()&&(o.description=e.description.trim().slice(0,1024)),typeof e.websiteUrl=="string"&&e.websiteUrl.trim()&&(o.websiteUrl=e.websiteUrl.trim().slice(0,2048)),o}function hg(e){if(e!==void 0){if(typeof e!="string"||!or.includes(e))throw new u("Invalid MCP logLevel metadata",m.invalidParams,{field:w.logLevel,allowed:[...or]});return e}}function Je(e){let t=h(e)?e._meta:void 0;if(!h(t))throw new u("Missing required MCP request metadata",m.invalidParams,{required:[w.protocolVersion,w.clientCapabilities]});let r=t[w.protocolVersion];if(typeof r!="string"||!re.includes(r))throw new u("Unsupported protocol version",m.unsupportedProtocolVersion,{supported:[...re],requested:typeof r=="string"?r:null});let o=t[w.clientCapabilities];if(!h(o))throw new u("Invalid MCP client capabilities metadata",m.invalidParams,{field:w.clientCapabilities,expected:"object"});let n=_g(t[w.clientInfo]),s=hg(t[w.logLevel]);return{protocolVersion:H,clientCapabilities:o,...n?{clientInfo:n}:{},...s?{logLevel:s}:{}}}function Vx(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 Kx(e,t){let r=t.filter(o=>!Object.prototype.hasOwnProperty.call(e.clientCapabilities,o));if(r.length>0)throw new u("Missing required client capability",m.missingRequiredClientCapability,{requiredCapabilities:Object.fromEntries(r.map(o=>[o,{}]))})}function Wx(e,t){let r=e.clientCapabilities.extensions;return h(r)&&h(r[t])}function Ze(e,t){let r=h(e._meta)?e._meta:{};return{...e,_meta:{...r,[w.serverInfo]:{...t}}}}function gg(e,t){return Ze({...e,resultType:"complete"},t)}function Yx(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 gg({supportedVersions:[...re],capabilities:structuredClone(e.capabilities),ttlMs:t,cacheScope:"public",...e.instructions?{instructions:e.instructions}:{}},e.serverInfo)}function Xx(e,t){if(h(e)&&typeof e.resultType=="string")return e.resultType;if(t==="legacy")return"complete";throw new u("Modern MCP result is missing resultType",m.invalidParams,{required:"resultType"})}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="d4a56906-c542-567e-9265-15184a5c330b")}catch{}})();var yg=new Set(["--help","-h","--version","-V"]);function bg(e,t){let r=[`Usage: ${e==="stdio"?"pm-mcp":"pm-mcp-http"} [--help | --version]`,"",e==="stdio"?"JSON-RPC over stdin/stdout. With no arguments, starts the stdio server.":"Streamable HTTP POST /mcp. With no arguments, starts the HTTP server.","","Options:"," -h, --help Print help and exit before transport startup."," -V, --version Print the package version and exit.","","Environment:"," PM_PATH Tracker root (otherwise discovered from cwd)."," PM_GLOBAL_PATH Global settings root."," PM_MCP_PROFILE core (default), standard, full, or custom."," PM_MCP_TOOLS Comma-separated tool allowlist for custom profile."," PM_MCP_DISCOVERY_CURSOR_KEY Shared discovery cursor secret, at least 32 UTF-8 bytes."," PM_MCP_BAGGAGE_ALLOWLIST Comma-separated permitted trace baggage keys."];return e==="http"&&r.push(" PM_MCP_HTTP_HOST Bind host (default 127.0.0.1)."," PM_MCP_HTTP_PORT Bind port, 0..65535 (default 3000)."," PM_MCP_HTTP_ALLOWED_ORIGINS Comma-separated exact browser origins (default none)."," PM_MCP_HTTP_BEARER_TOKEN Deployment token for the bundled verifier."," PM_MCP_HTTP_AUTH_ISSUER Exact HTTPS authorization-server issuer."," PM_MCP_HTTP_RESOURCE Canonical resource/audience URI."," PM_MCP_HTTP_SCOPES Space-separated scopes (default pm:read pm:write).","","Non-loopback HTTP requires bearer token, issuer, and resource together."),r.push("",`MCP protocol: ${re.join(", ")}.`,e==="stdio"?`Legacy initialize compatibility: ${nr.join(", ")}.`:"HTTP requires modern per-request metadata; legacy initialize is stdio-only.","",e==="stdio"?"Client configuration:":"Example loopback server:",e==="stdio"?JSON.stringify({mcpServers:{pm:{command:"npx",args:["--yes","--package",`@unbrained/pm-cli@${t}`,"pm-mcp"]}}}):`PM_MCP_HTTP_PORT=3000 npx --yes --package @unbrained/pm-cli@${t} pm-mcp-http`,...e==="http"?["HTTP client configuration:",JSON.stringify({mcpServers:{pm:{url:"http://127.0.0.1:3000/mcp"}}})]:[],"","Configuration: https://github.com/unbraind/pm-cli/blob/main/docs/MCP_REMOTE_TRANSPORT_SECURITY.md",""),r.join(`
2
- `)}function Qx(e,t,r){if(e.length===0)return{kind:"serve"};let o=e.find(n=>!yg.has(n));if(o!==void 0){let n=t==="stdio"?"pm-mcp":"pm-mcp-http";return{kind:"exit",exitCode:64,stdout:"",stderr:`Unsupported argument ${JSON.stringify(o)}. Run ${n} --help.
3
- `}}return{kind:"exit",exitCode:0,stdout:e.includes("--help")||e.includes("-h")?bg(t,r):`${r}
4
- `,stderr:""}}import{createHash as ar,createHmac as dr,timingSafeEqual as Tg}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="15b81dd0-ef1a-58be-b6ee-5975b6778993")}catch{}})();var Cg=["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}},cr=/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/u,ye=32,et=64*1024,be=16*1024,Qe={maxBytes:256*1024,maxDepth:32,maxNodes:4096};function Eg(e){return e==="elicitation/create"?"elicitation":e==="sampling/createMessage"?"sampling":"roots"}function Te(e,t,r){let o;try{o=JSON.stringify(e)}catch{throw new u(`Invalid ${r}: value is not JSON serializable`,m.invalidParams,{field:r})}if(Buffer.byteLength(o,"utf8")>t)throw new u(`Invalid ${r}: payload exceeds the protocol bound`,m.invalidParams,{field:r,maximumBytes:t})}function tt(e,t){if(!h(e))throw new u("Invalid MCP inputRequests",m.invalidParams,{field:"inputRequests",expected:"object"});let r=Object.entries(e);if(r.length===0||r.length>ye)throw new u("Invalid MCP inputRequests count",m.invalidParams,{minimum:1,maximum:ye,observed:r.length});let o={};for(let[n,s]of r){if(!cr.test(n)||!h(s))throw new u("Invalid MCP input request entry",m.invalidParams,{field:`inputRequests.${n}`});let i=s.method;if(typeof i!="string"||!Cg.includes(i))throw new u("Unsupported MCP input request method",m.invalidParams,{field:`inputRequests.${n}.method`,method:i??null});let a=Eg(i);if(!Object.prototype.hasOwnProperty.call(t.clientCapabilities,a))throw new u("Missing required client capability",m.missingRequiredClientCapability,{requiredCapabilities:{[a]:{}}});if(!h(s.params))throw new u("Invalid MCP input request parameters",m.invalidParams,{field:`inputRequests.${n}.params`,expected:"object"});o[n]={method:i,params:structuredClone(s.params)}}return Te(o,et,"inputRequests"),o}function lr(e){if(!h(e))throw new u("Invalid MCP inputResponses",m.invalidParams,{field:"inputResponses",expected:"object"});let t=Object.entries(e);if(t.length>ye)throw new u("Invalid MCP inputResponses count",m.invalidParams,{maximum:ye,observed:t.length});let r={};for(let[o,n]of t){if(!cr.test(o)||!h(n))throw new u("Invalid MCP input response entry",m.invalidParams,{field:`inputResponses.${o}`});r[o]=structuredClone(n)}return Te(r,et,"inputResponses"),r}function oN(e){let t=e.requestState?.trim();if(t&&Buffer.byteLength(t,"utf8")>be)throw new u("Invalid MCP requestState: payload exceeds the protocol bound",m.invalidParams,{field:"requestState",maximumBytes:be});let r=e.inputRequests===void 0?void 0:tt(e.inputRequests,e.requestContext);if(r===void 0&&!t)throw new u("InputRequiredResult requires inputRequests or requestState",m.invalidParams,{requiredAnyOf:["inputRequests","requestState"]});return{resultType:"input_required",...r?{inputRequests:r}:{},...t?{requestState:t}:{},_meta:{[w.serverInfo]:{...e.serverInfo}}}}function pr(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 nN(e,t){if(!Number.isSafeInteger(e.expiresAt)||e.expiresAt<=0||e.method.trim().length===0||e.parameterDigest.trim().length===0||e.principal.trim().length===0)throw new u("Invalid MCP requestState payload",m.invalidParams);let r=Buffer.from(JSON.stringify({version:1,...e}),"utf8");if(r.byteLength>be/2)throw new u("MCP requestState payload exceeds the protocol bound",m.invalidParams,{maximumBytes:be/2});let o=r.toString("base64url"),n=dr("sha256",pr(t)).update(o).digest("base64url");return`${o}.${n}`}function Sg(e){if(!h(e)||e.version!==1)throw new u("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});let{expiresAt:t,method:r,parameterDigest:o,principal:n,state:s}=e;if(typeof t!="number"||!Number.isSafeInteger(t))throw new u("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});if(typeof r!="string"||typeof o!="string"||typeof n!="string")throw new u("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});return{expiresAt:t,method:r,parameterDigest:o,principal:n,state:s}}function iN(e,t,r){let[o,n,s]=e.split(".");if(!o||!n||s!==void 0)throw new u("Invalid MCP requestState encoding",m.invalidParams,{field:"requestState"});let i=Buffer.from(n,"base64url"),a=dr("sha256",pr(t)).update(o).digest();if(i.byteLength!==a.byteLength||!Tg(i,a))throw new u("Invalid MCP requestState signature",m.invalidParams,{field:"requestState"});let d;try{d=JSON.parse(Buffer.from(o,"base64url").toString("utf8"))}catch{d=null}let c=Sg(d),{expiresAt:l,method:p,parameterDigest:f,principal:_}=c;if(l<(r.nowMs??Date.now()))throw new u("Expired MCP requestState",m.invalidParams,{field:"requestState",expiredAt:l});if(p!==r.method||f!==r.parameterDigest||_!==r.principal)throw new u("MCP requestState binding mismatch",m.invalidParams,{field:"requestState"});return c}function sN(e){return Te(e,et,"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 o=this.#e.values().next().value;this.#e.delete(o)}this.#e.add(r)}};function wg(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 aN(e,t){return{...e,...wg(t)}}function Ag(e){return e.replaceAll("~1","/").replaceAll("~0","~")}function vg(e,t){if(t==="#")return e;if(!t.startsWith("#/"))return;let r=e;for(let o of t.slice(2).split("/").map(Ag)){if(!h(r)&&!Array.isArray(r)||!Object.prototype.hasOwnProperty.call(r,o))return;r=r[o]}return r}function Og(e){let t=e.maxBytes??Qe.maxBytes,r=e.maxDepth??Qe.maxDepth,o=e.maxNodes??Qe.maxNodes;if(!Number.isSafeInteger(t)||t<2)throw new u("Invalid MCP JSON Schema work bounds",m.invalidParams);if(!Number.isSafeInteger(r)||r<1)throw new u("Invalid MCP JSON Schema work bounds",m.invalidParams);if(!Number.isSafeInteger(o)||o<1)throw new u("Invalid MCP JSON Schema work bounds",m.invalidParams);return{maximumBytes:t,maximumDepth:r,maximumNodes:o}}function Rg(e,t){let r=Array.isArray(e.value)?e.value:h(e.value)?Object.values(e.value):[];for(let o of r)t.push({value:o,depth:e.depth+1})}function Ig(e,t){if(!h(t)||typeof t.$ref!="string")return;let r=t.$ref;if(r.startsWith("#")&&vg(e,r)===void 0)throw new u("MCP JSON Schema contains an unresolved local reference",m.invalidParams,{reference:r})}function dN(e,t={}){let{maximumBytes:r,maximumDepth:o,maximumNodes:n}=Og(t);if(typeof e!="boolean"&&!h(e))throw new u("Invalid MCP JSON Schema root",m.invalidParams,{expected:"object or boolean"});Te(e,r,"JSON Schema");let s=[{value:e,depth:0}],i=0;for(;s.length>0;){let a=s.pop();if(i+=1,i>n||a.depth>o)throw new u("MCP JSON Schema exceeds validation work bounds",m.invalidParams,{maximumDepth:o,maximumNodes:n});Ig(e,a.value),Rg(a,s)}return structuredClone(e)}import{randomUUID as Pg}from"node:crypto";import{readFile as Mg}from"node:fs/promises";import ur from"node:path";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="f3e94896-b2a0-561c-902b-71c28ddde2a1")}catch{}})();var hN="io.modelcontextprotocol/tasks",kg=["working","input_required","completed","failed","cancelled"],xg=/^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,Ng=3600*1e3,Lg=1e3,Ee=1024,Dg=30,$g=2e3;function rt(e){return new u(e,m.invalidParams,{code:"mcp_task_not_found_or_not_authorized"})}function Ce(e){let t=e.trim();if(!xg.test(t))throw rt("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,Ee),...h(e.data)?{data:structuredClone(e.data)}:{}}}function Fg(e){if(!kg.includes(e))throw new u("Corrupt MCP task record",m.invalidParams);return e}function Gg(e){if(typeof e!="string"||e.length===0)throw new u("Corrupt MCP task record",m.invalidParams);return e}function Ug(e){if(typeof e!="number"||!Number.isSafeInteger(e)||e<1)throw new u("Corrupt MCP task record",m.invalidParams);return e}function jg(e){if(e!==null&&(typeof e!="number"||!Number.isSafeInteger(e)||e<0))throw new u("Corrupt MCP task record",m.invalidParams);return e}function Bg(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 qg(e){if(!Array.isArray(e)||e.some(t=>typeof t!="string"))throw new u("Corrupt MCP task record",m.invalidParams);return[...e]}function zg(e){if(!h(e)||e.version!==1)throw new u("Corrupt MCP task record",m.invalidParams);let t=typeof e.taskId=="string"?Ce(e.taskId):"",r=Fg(e.status),o=Gg(e.principal),n=Ug(e.workerPid),s=jg(e.ttlMs),i=Bg(e.pollIntervalMs),a={version:1,taskId:t,status:r,principal:o,workerPid:n,createdAt:mr(e.createdAt,"createdAt"),lastUpdatedAt:mr(e.lastUpdatedAt,"lastUpdatedAt"),ttlMs:s,consumedInputKeys:qg(e.consumedInputKeys),...typeof e.statusMessage=="string"?{statusMessage:e.statusMessage.slice(0,Ee)}:{},...typeof i=="number"?{pollIntervalMs:i}:{}};if(h(e.inputRequests)&&(a.inputRequests=structuredClone(e.inputRequests)),h(e.inputResponses)&&(a.inputResponses=structuredClone(e.inputResponses)),h(e.result)&&(a.result=structuredClone(e.result)),e.error!==void 0&&(a.error=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 V(e){let t={taskId:e.taskId,status:e.status,createdAt:e.createdAt,lastUpdatedAt:e.lastUpdatedAt,ttlMs:e.ttlMs,...e.statusMessage?{statusMessage:e.statusMessage}:{},...e.pollIntervalMs===void 0?{}:{pollIntervalMs:e.pollIntervalMs}};return e.status==="input_required"?{...t,status:"input_required",inputRequests:structuredClone(e.inputRequests)}:e.status==="completed"?{...t,status:"completed",result:structuredClone(e.result)}:e.status==="failed"?{...t,status:"failed",error:structuredClone(e.error)}:e.status==="cancelled"?{...t,status:"cancelled"}:{...t,status:"working"}}function oe(e){return e==="completed"||e==="failed"||e==="cancelled"}function Hg(e){try{return process.kill(e,0),!0}catch(t){return!(typeof t=="object"&&t!==null&&"code"in t&&t.code==="ESRCH")}}var ot=class{#e;#t;#r;#o;#i;constructor(t){this.#e=ur.resolve(t.pmRoot),this.#t=t.owner?.trim()||"pm-mcp",this.#r=t.now??(()=>new Date),this.#o=t.taskIdFactory??(()=>`mcp-task-${Pg()}`),this.#i=t.workerPid??process.pid}#s(t){return ur.join(this.#e,"runtime","mcp-tasks","records",`${Ce(t)}.json`)}async#d(t){try{return zg(JSON.parse(await Mg(this.#s(t),"utf8")))}catch(r){throw fe(r)||r instanceof SyntaxError?rt("Unknown MCP task"):r}}async#a(t){await Fe(this.#s(t.taskId),`${JSON.stringify(t,null,2)}
5
- `)}async#n(t,r,o){let n=Ce(t),s=await je(this.#e,n,Dg,this.#t,!1,!1,$g);try{let i=await this.#d(n);if(i.principal!==r)throw rt("Unknown MCP task");let a=o(i);return await this.#a(a),a}finally{await s()}}async create(t){let r=Ce(this.#o()),o=t.principal.trim(),n=t.ttlMs===void 0?Ng:t.ttlMs,s=t.pollIntervalMs??Lg;if(o.length===0||n!==null&&(!Number.isSafeInteger(n)||n<0)||!Number.isSafeInteger(s)||s<0)throw new u("Invalid MCP task creation options",m.invalidParams);let i=this.#r().toISOString(),a={version:1,taskId:r,status:"working",createdAt:i,lastUpdatedAt:i,ttlMs:n,pollIntervalMs:s,principal:o,workerPid:this.#i,consumedInputKeys:[],...t.statusMessage?.trim()?{statusMessage:t.statusMessage.trim().slice(0,Ee)}:{}};return await this.#a(a),{...V(a),resultType:"task"}}async get(t,r){return V(await this.#n(t,r,o=>{if(oe(o.status))return o;let n=this.#r().getTime(),s=o.ttlMs!==null&&Date.parse(o.createdAt)+o.ttlMs<=n,i=o.workerPid!==this.#i&&!Hg(o.workerPid);return!s&&!i?o:{...o,status:"failed",statusMessage:s?"Task retention expired before completion.":"Task worker ended before recording a terminal result.",lastUpdatedAt:this.#r().toISOString(),error:{code:-32603,message:s?"MCP task expired":"MCP task worker unavailable after restart",data:{recoverable:!1,createNewTask:!0}},inputRequests:void 0}}))}async requireInput(t){let r=tt(t.inputRequests,t.requestContext);return V(await this.#n(t.taskId,t.principal,o=>{if(oe(o.status))return o;let n=Object.keys(r).filter(s=>o.consumedInputKeys.includes(s));if(n.length>0)throw new u("MCP task input request keys must be unique for the task lifetime",m.invalidParams,{reused:n});return{...o,status:"input_required",statusMessage:t.statusMessage?.trim().slice(0,Ee),lastUpdatedAt:this.#r().toISOString(),inputRequests:r}}))}async update(t,r,o){let n=lr(o),s=[],i=[];return await this.#n(t,r,a=>{if(a.status!=="input_required"||!a.inputRequests)return a;let d={...a.inputRequests},c=a.inputResponses?{...a.inputResponses}:{};for(let[l,p]of Object.entries(n))Object.prototype.hasOwnProperty.call(d,l)&&(c[l]=p,delete d[l],s.push(l));return i=Object.keys(d).sort(),s.length===0?a:{...a,status:i.length===0?"working":"input_required",lastUpdatedAt:this.#r().toISOString(),inputRequests:i.length===0?void 0:d,inputResponses:c,consumedInputKeys:[...new Set([...a.consumedInputKeys,...s])].sort()}}),{acceptedKeys:s.sort(),remainingKeys:i}}async takeInputResponses(t,r){let o={};return await this.#n(t,r,n=>(o=structuredClone(n.inputResponses??{}),Object.keys(o).length===0?n:{...n,inputResponses:void 0})),o}async complete(t,r,o){return V(await this.#n(t,r,n=>oe(n.status)?n:{...n,status:"completed",statusMessage:"Task completed.",lastUpdatedAt:this.#r().toISOString(),result:structuredClone(o),inputRequests:void 0,error:void 0}))}async fail(t,r,o){let n=fr(o);return V(await this.#n(t,r,s=>oe(s.status)?s:{...s,status:"failed",statusMessage:n.message,lastUpdatedAt:this.#r().toISOString(),error:n,inputRequests:void 0,result:void 0}))}async cancel(t,r){return V(await this.#n(t,r,o=>oe(o.status)?o:{...o,status:"cancelled",statusMessage:"Task cancelled by the client.",lastUpdatedAt:this.#r().toISOString(),inputRequests:void 0,result:void 0,error:void 0}))}};function gN(e){return new ot(e)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="15cbe26a-5716-5e8c-8700-eb36a1a056d6")}catch{}})();var Se="io.modelcontextprotocol/subscriptionId",_r=256,hr=2048,Vg=5e3;function Kg(e,t){return new Promise((r,o)=>{let n=setTimeout(()=>o(new Error("MCP subscription sink write timed out")),Vg);n.unref(),Promise.resolve().then(()=>e(t)).then(()=>{clearTimeout(n),r()},s=>{clearTimeout(n),o(s instanceof Error?s:new Error(String(s)))})})}function nt(e,t){if(e!==void 0){if(typeof e!="boolean")throw new u("Invalid MCP subscription filter",m.invalidParams,{field:`notifications.${t}`,expected:"boolean"});return e||void 0}}function Wg(e){if(!h(e))throw new u("Invalid MCP subscription filter",m.invalidParams,{field:"notifications",expected:"object"});let t=nt(e.toolsListChanged,"toolsListChanged"),r=nt(e.promptsListChanged,"promptsListChanged"),o=nt(e.resourcesListChanged,"resourcesListChanged"),n;if(e.resourceSubscriptions!==void 0){if(!Array.isArray(e.resourceSubscriptions)||e.resourceSubscriptions.length>_r)throw new u("Invalid MCP resource subscriptions",m.invalidParams,{field:"notifications.resourceSubscriptions",maximum:_r});let s=new Set;for(let i of e.resourceSubscriptions){if(typeof i!="string"||i.trim().length===0||Buffer.byteLength(i,"utf8")>hr)throw new u("Invalid MCP resource subscription URI",m.invalidParams,{field:"notifications.resourceSubscriptions",maximumBytes:hr});s.add(i)}s.size>0&&(n=[...s].sort())}return{...t?{toolsListChanged:t}:{},...r?{promptsListChanged:r}:{},...o?{resourcesListChanged:o}:{},...n?{resourceSubscriptions:n}:{}}}function Yg(e,t){return{...e.toolsListChanged&&t.tools?.listChanged?{toolsListChanged:!0}:{},...e.promptsListChanged&&t.prompts?.listChanged?{promptsListChanged:!0}:{},...e.resourcesListChanged&&t.resources?.listChanged?{resourcesListChanged:!0}:{},...e.resourceSubscriptions&&t.resources?.subscribe?{resourceSubscriptions:[...e.resourceSubscriptions]}:{}}}var 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=Yg(Wg(t.notifications),this.#e),o={filter:r,sink:t.sink,writeQueue:Promise.resolve()};this.#t.set(t.id,o);try{await this.#o(t.id,o,{jsonrpc:"2.0",method:"notifications/subscriptions/acknowledged",params:{_meta:{[Se]:t.id},notifications:structuredClone(r)}},!0)}catch(n){throw this.#t.delete(t.id),n}return structuredClone(r)}async emitListChanged(t){let r=`${t}ListChanged`,o=`notifications/${t}/list_changed`,n=[];for(let[s,i]of this.#t)i.filter[r]===!0&&n.push(this.#o(s,i,{jsonrpc:"2.0",method:o,params:{_meta:{[Se]:s}}}));return(await Promise.all(n)).filter(Boolean).length}async emitResourceUpdated(t){let r=[];for(let[o,n]of this.#t)n.filter.resourceSubscriptions?.includes(t)&&r.push(this.#o(o,n,{jsonrpc:"2.0",method:"notifications/resources/updated",params:{_meta:{[Se]:o},uri:t}}));return(await Promise.all(r)).filter(Boolean).length}async#o(t,r,o,n=!1){let s=r.writeQueue.then(async()=>{if(this.#t.get(t)!==r)return!1;try{return await Kg(r.sink,o),!0}catch(i){if(this.#t.get(t)===r&&this.#t.delete(t),n)throw i;return!1}});return r.writeQueue=s.then(()=>{},()=>{}),s}close(t){if(this.#t.delete(t))return{...Ze({resultType:"complete",_meta:{[Se]:t}},this.#r)}}closeAll(){let t=[];for(let r of this.#t.keys()){let o=this.close(r);t.push({id:r,result:o})}return t}};(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="3681273a-e101-57a0-9446-982c450e7183")}catch{}})();var yr=/^=\?base64\?([A-Za-z0-9+/]*={0,2})\?=$/u,Xg=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/u,br=/^[\t\x20-\x7E]*$/u,Tr=new Set(["prompts/get","resources/read","tools/call"]);function Jg(e){let t=new Map;for(let[r,o]of Object.entries(e)){if(o===void 0)continue;let n=typeof o=="string"?o:o.join(", ");t.set(r.toLowerCase(),n)}return t}function A(e,t){throw new u(e,m.headerMismatch,{header:t})}function Cr(e){let t=typeof e=="boolean"?String(e).toLowerCase():String(e);return t.length>0&&t.trim()===t&&br.test(t)&&!yr.test(t)?t:`=?base64?${Buffer.from(t,"utf8").toString("base64")}?=`}function Er(e,t){let r=yr.exec(e);if(r){let o=r[1],n=Buffer.from(o,"base64");return n.toString("base64")!==o||n.length===0?A("Malformed MCP Base64 header value",t):n.toString("utf8")}return e.length===0||e.trim()!==e||!br.test(e)?A("Malformed MCP header value",t):e}function we(e){return Array.isArray(e)?e.some(we):h(e)?Object.prototype.hasOwnProperty.call(e,"x-mcp-header")||Object.values(e).some(we):!1}function Zg(e,t,r){let o=e["x-mcp-header"];if(o===void 0)return;let n=e.type;if(typeof o!="string"||!Xg.test(o)||!["boolean","integer","string"].includes(String(n))||r.has(o.toLowerCase()))throw new u("Invalid MCP x-mcp-header annotation",m.invalidParams,{field:t.join("."),annotation:o});return r.add(o.toLowerCase()),{name:o,path:t,type:n}}function Sr(e){if(!h(e))throw new u("Invalid MCP tool schema",m.invalidParams,{field:"inputSchema",expected:"object"});let t=[],r=new Set,o=(n,s)=>{let i=n.properties;if(i!==void 0){if(!h(i))throw new u("Invalid MCP tool schema properties",m.invalidParams,{field:"inputSchema.properties"});for(let[a,d]of Object.entries(i)){if(!h(d))continue;let c=[...s,a],l=Zg(d,c,r);l&&t.push(l);for(let[p,f]of Object.entries(d))if(p!=="properties"&&p!=="x-mcp-header"&&we(f))throw new u("MCP x-mcp-header is not statically reachable",m.invalidParams,{field:c.join("."),keyword:p});o(d,c)}}};for(let[n,s]of Object.entries(e))if(n!=="properties"&&we(s))throw new u("MCP x-mcp-header is not statically reachable",m.invalidParams,{field:"inputSchema",keyword:n});return o(e,[]),t}function wr(e,t){let r=e;for(let o of t){if(!h(r))return;r=r[o]}return r}function Ar(e,t){let r=e==="resources/read"?t.uri:t.name;return typeof r=="string"?r:void 0}function Qg(e,t){let r=h(e.arguments)?e.arguments:{},o={};for(let n of Sr(t)){let s=wr(r,n.path);if(s!=null){if(!(n.type==="integer"&&typeof s=="number"&&Number.isSafeInteger(s)||n.type==="boolean"&&typeof s=="boolean"||n.type==="string"&&typeof s=="string"))throw new u("Invalid MCP custom header argument",m.invalidParams,{field:n.path.join("."),expected:n.type});o[`Mcp-Param-${n.name}`]=Cr(s)}}return o}function EN(e){let t=h(e.request.params)?e.request.params:void 0,r=Je(t),o=e.request.method;if(typeof o!="string"||o.length===0)return A("Missing MCP request method","Mcp-Method");let n={Accept:"application/json, text/event-stream","Content-Type":"application/json","MCP-Protocol-Version":r.protocolVersion,"Mcp-Method":o},s=Ar(o,t);if(Tr.has(o)){if(s===void 0)return A("Missing MCP request name","Mcp-Name");n["Mcp-Name"]=Cr(s)}return o==="tools/call"&&e.toolSchema!==void 0&&Object.assign(n,Qg(t,e.toolSchema)),n}function ey(e,t){let r=t.method;(typeof r!="string"||r.length===0)&&A("Missing MCP request method","Mcp-Method");let o=h(t.params)?t.params:void 0,n=Je(o).protocolVersion;if(e.get("mcp-protocol-version")!==n&&A("MCP protocol header does not match request metadata","MCP-Protocol-Version"),e.get("mcp-method")!==r&&A("MCP method header does not match request body","Mcp-Method"),Tr.has(r)){let s=e.get("mcp-name"),i=Ar(r,o);(s===void 0||i===void 0||Er(s,"Mcp-Name")!==i)&&A("MCP name header does not match request body","Mcp-Name")}e.has("last-event-id")&&A("MCP SSE resumability is not supported","Last-Event-ID")}function ty(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 ry(e){let t=h(e.params.arguments)?e.params.arguments:{};for(let r of Sr(e.toolSchema)){let o=wr(t,r.path),n=`Mcp-Param-${r.name}`,s=e.headers.get(n.toLowerCase());if(o==null){s!==void 0&&A("Unexpected MCP parameter header",n);continue}s===void 0&&A("Missing MCP parameter header",n),ty(r,o,Er(s,n))||A("MCP parameter header does not match request body",n)}}function SN(e){let t=Jg(e.headers),r=typeof e.request.method=="string"?e.request.method:"";ey(t,e.request),!(r!=="tools/call"||e.toolSchema===void 0)&&ry({headers:t,params:e.request.params,toolSchema:e.toolSchema})}var wN=H;import{AsyncLocalStorage as oy}from"node:async_hooks";import{createHash as vr,timingSafeEqual as ny}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="a7c30d99-a0e4-552e-be61-0c54a455e211")}catch{}})();var y=class extends Error{httpStatus;challenge;constructor(t,r,o){super(t),this.name="PmMcpAuthorizationError",this.httpStatus=r,this.challenge=o}},iy=/^00-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})$/u,sy=/^[a-z][a-z0-9_*/-]{0,255}$/u,ay=/^(?:[a-z0-9][a-z0-9_*/-]{0,240})@[a-z][a-z0-9_*/-]{0,13}$/u,dy=/^[\x20-\x2B\x2D-\x3C\x3E-\x7E]{0,255}[\x21-\x2B\x2D-\x3C\x3E-\x7E]$/u,Rr=/^[\x21\x23-\x5B\x5D-\x7E]+$/u,Ir=/^[A-Za-z0-9!#$%&'*+.^_`|~-]+$/u,cy=/^[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]*$/u,ly=/%(?![0-9A-Fa-f]{2})/u,py=512,uy=32,my=180,fy=8192,_y=8192,Pr=new oy;function S(e,t,r=!1){if(new RegExp("\\p{Cc}","u").test(e))throw new y(`Invalid ${t}`,401);let o;try{o=new URL(e)}catch{throw new y(`Invalid ${t}`,401)}let n=o.hostname==="127.0.0.1"||o.hostname==="localhost";if(o.hash.length>0||o.protocol!=="https:"&&!(r&&n&&o.protocol==="http:"))throw new y(`Invalid ${t}`,401);return o}function hy(e,t){let r=t.toLowerCase();for(let[o,n]of Object.entries(e))if(!(o.toLowerCase()!==r||n===void 0))return typeof n=="string"?n:n.join(", ")}function IN(e){let t=S(e.resource,"protected resource URI",!0).href.replace(/\/$/u,"");if(e.authorizationServers.length===0)throw new y("Protected resource metadata requires an authorization server",401);let r=e.authorizationServers.map(n=>S(n,"authorization server issuer").href.replace(/\/$/u,"")),o=[...new Set(e.scopes??[])];if(o.some(n=>!Rr.test(n)))throw new y("Invalid authorization scope",401);return{resource:t,authorization_servers:r,...o.length>0?{scopes_supported:o.sort()}:{}}}function PN(e){let t=S(e,"authorization server issuer"),r=t.pathname.replace(/^\/+|\/+$/gu,""),o=t.origin;return r?[`${o}/.well-known/oauth-authorization-server/${r}`,`${o}/.well-known/openid-configuration/${r}`,`${o}/${r}/.well-known/openid-configuration`]:[`${o}/.well-known/oauth-authorization-server`,`${o}/.well-known/openid-configuration`]}function MN(e,t){if(!h(e)||typeof e.issuer!="string")throw new y("Invalid authorization server metadata",401);let r=S(t,"expected issuer").href.replace(/\/$/u,"");if(S(e.issuer,"metadata issuer").href.replace(/\/$/u,"")!==r)throw new y("Authorization server issuer mismatch",401);if(!Array.isArray(e.code_challenge_methods_supported)||!e.code_challenge_methods_supported.includes("S256"))throw new y("Authorization server does not support required S256 PKCE",401);let o=d=>{let c=e[d];if(typeof c!="string")throw new y(`Authorization server metadata requires ${d}`,401);return S(c,d).href},n=d=>{let c=e[d];return typeof c=="string"?S(c,d).href:void 0},s=o("authorization_endpoint"),i=o("token_endpoint"),a=n("registration_endpoint");return{issuer:r,authorization_endpoint:s,token_endpoint:i,code_challenge_methods_supported:[...new Set(e.code_challenge_methods_supported.filter(d=>typeof d=="string"))],...e.client_id_metadata_document_supported===!0?{client_id_metadata_document_supported:!0}:{},...a?{registration_endpoint:a}:{}}}function kN(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 xN(e){if(e.responseIssuer===void 0){if(e.issuerParameterSupported)throw new y("Authorization response omitted the advertised issuer",401);return}if(e.responseIssuer!==e.expectedIssuer)throw new y("Authorization response issuer mismatch",401)}function NN(e,t){let r=S(t,"client metadata document URL");if(r.pathname==="/"||!h(e)||e.client_id!==r.href||typeof e.client_name!="string"||e.client_name.trim().length===0||!Array.isArray(e.redirect_uris)||e.redirect_uris.length===0)throw new y("Invalid Client ID Metadata Document",401);for(let o of e.redirect_uris){if(typeof o!="string")throw new y("Invalid client redirect URI",401);S(o,"client redirect URI",!0)}return structuredClone(e)}function LN(e){if(e.redirectUris.length===0||e.clientName.trim().length===0)throw new y("Invalid dynamic client registration metadata",401);let t=e.redirectUris.map(r=>S(r,"redirect URI",!0).href);return{application_type:e.applicationType,client_name:e.clientName.trim().slice(0,128),redirect_uris:t,grant_types:["authorization_code","refresh_token"],response_types:["code"],token_endpoint_auth_method:"none"}}var Or=class{#e=new Map;set(t,r){let o=S(t,"credential issuer").href;this.#e.set(o,structuredClone(r))}get(t){let r=S(t,"credential issuer").href,o=this.#e.get(r);return o?structuredClone(o):void 0}delete(t){let r=S(t,"credential issuer").href;return this.#e.delete(r)}};function gy(e){let t=e.traceparent,r=e.tracestate;if(t!==void 0){let o=typeof t=="string"?iy.exec(t):null;if(!o)throw new y("Invalid MCP traceparent",403);let n=o[1],s=o[2];if(/^0+$/u.test(n)||/^0+$/u.test(s))throw new y("Invalid MCP traceparent",403)}if(r!==void 0&&(typeof r!="string"||!by(r)))throw new y("Invalid MCP tracestate",403);return{...typeof t=="string"?{traceparent:t}:{},...typeof r=="string"?{tracestate:r}:{}}}function $(e){return e.replace(/^[ \t]*|[ \t]*$/gu,"")}function yy(e){return sy.test(e)||ay.test(e)}function by(e){if(Buffer.byteLength(e,"utf8")>py)return!1;let t=e.split(",");if(t.length>uy)return!1;let r=new Set;for(let o of t){let n=$(o);if(n.length===0)continue;let s=n.indexOf("="),i=s>0?n.slice(0,s):"",a=s>0?n.slice(s+1):"";if(!yy(i)||!dy.test(a)||r.has(i))return!1;r.add(i)}return!0}function Mr(e){return cy.test(e)&&!ly.test(e)}function Ty(e){let t=$(e),r=t.indexOf("="),o=$(r>=0?t.slice(0,r):t),n=r>=0?$(t.slice(r+1)):void 0;return Ir.test(o)&&(n===void 0||Mr(n))}function Cy(e){let t=$(e),r=t.split(";"),o=r[0],n=r.slice(1),s=o.indexOf("="),i=$(s>0?o.slice(0,s):""),a=s>0?$(o.slice(s+1)):"";if(!(!Ir.test(i)||!Mr(a)||!n.every(Ty)))return{key:i,serialized:t}}function Ey(e,t){if(e===void 0)return;if(typeof e!="string"||Buffer.byteLength(e,"utf8")>fy)throw new y("Invalid MCP baggage",403);let r=new Set(t),o=e.split(",");if(o.length>my)throw new y("Invalid MCP baggage",403);let n=[];for(let s of o){let i=Cy(s);if(!i)throw new y("Invalid MCP baggage",403);r.has(i.key)&&n.push(i.serialized)}return n.length>0?n.join(","):void 0}function DN(e,t={}){let r=h(e)&&h(e._meta)?e._meta:{},o=Ey(r.baggage,t.baggageAllowlist??[]);return{...gy(r),...o?{baggage:o}:{}}}function $N(e,t){return Pr.run(structuredClone(e),t)}function FN(){let e=Pr.getStore();return e?{...e}:void 0}async function GN(e){let t=S(e.policy.resourceMetadataUrl,"protected resource metadata URL",!0).href,r=[...new Set(e.policy.requiredScopes??[])];if(r.some(c=>!Rr.test(c)))throw new y("Invalid authorization scope",401);let o=`Bearer resource_metadata="${t}"`;if(new URL(e.requestUrl,e.policy.resource).searchParams.has("access_token"))throw new y("Access tokens must not appear in URI query parameters",401,o);let n=hy(e.headers,"authorization")?.match(/^Bearer ([^\s]+)$/iu);if(!n)throw new y("Missing or malformed bearer token",401,o);let s=n[1];if(Buffer.byteLength(s,"utf8")>_y)throw new y("Missing or malformed bearer token",401,o);let i;try{i=await e.policy.verifyAccessToken(s)}catch{throw new y("Invalid bearer token",401,o)}let a=Array.isArray(i.audience)?i.audience:[i.audience];if(i.issuer!==e.policy.issuer||!a.includes(e.policy.resource))throw new y("Bearer token issuer or audience mismatch",401,o);let d=r.filter(c=>!i.scopes.includes(c));if(d.length>0)throw new y("Bearer token has insufficient scope",403,`${o}, scope="${d.join(" ")}"`);return{...i,audience:[...a],scopes:[...i.scopes]}}function UN(e){let t=vr("sha256").update(e.token).digest();return r=>{let o=vr("sha256").update(r).digest();if(!ny(t,o))throw new y("Invalid bearer token",401);return structuredClone(e.claims)}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="46f5fe59-6b84-5c68-ad07-bb1329f4ea29")}catch{}})();var it="io.modelcontextprotocol/ui",Ae="2026-01-26",Nr="text/html;profile=mcp-app",kr=Object.freeze({specVersion:Ae,mimeTypes:[Nr]});function qN(e){let t=e.clientCapabilities.extensions;if(!h(t))return!1;let r=t[it];if(r===void 0)return!1;if(!h(r))throw new u("Invalid MCP Apps client capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[it]:kr}}});let o=r.mimeTypes,n=r.specVersion;if(!Array.isArray(o)||!o.includes(Nr)||n!==void 0&&n!==Ae)throw new u("Unsupported MCP Apps client capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[it]:kr}}});return!0}var Sy={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:Sy})));function zN(e){return Lr.find(t=>t.uri===e)}function HN(e){let t=new Map(Lr.map(r=>[r.toolName,r]));return e.map(r=>{let o=t.get(r.name);return o?{...r,_meta:{...r._meta,ui:o.toolMeta}}:{...r}})}function xr(e){return e.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;")}function VN(e){let t=xr(e.name),r=xr(e.description),o=JSON.stringify({name:`pm-${e.id}-view`,version:Ae}),n=JSON.stringify(Ae);return`<!doctype html>
1
+ import{a as yg}from"./chunks/chunk-GLPUIQDB.js";import{a as Vk,b as Kk,c as Wk,d as Yk}from"./chunks/chunk-2K6GJUW7.js";import{a as Xk,b as Jk}from"./chunks/chunk-UY7Z3ZHQ.js";import{b as hk,c as gk,d as yk,e as bk,f as Tk,g as Ck,h as Ek,i as Sk,j as wk,k as Ak,l as Ok,m as vk,n as Rk,o as Ik,p as Pk,q as Mk,r as kk}from"./chunks/chunk-5NY6EQSX.js";import{A as Gk,B as Uk,C as jk,D as Bk,E as qk,F as zk,G as Hk,a as Ds,b as SR,c as wR,d as Oc,e as vc,f as Rc,h as Ic,i as Pc,j as Mc,k as kc,l as xc,m as Nc,n as Lc,o as Dc,p as Gd,q as Ud,r as jd,s as Bd,t as qd,u as xk,v as Nk,w as Lk,x as Dk,y as $k,z as Fk}from"./chunks/chunk-KJL42AN5.js";import{A as wx,B as Ax,C as Ox,D as vx,E as Rx,F as Ix,G as Px,H as Mx,I as kx,J as xx,K as Nx,L as Lx,M as Dx,N as $x,O as Fx,P as Gx,Q as Ux,R as jx,S as Bx,T as qx,U as zx,V as Hx,W as Vx,X as Kx,Y as Wx,Z as Yx,_ as Xx,a as Qk,b as Zk,c as ex,d as tx,e as rx,f as ox,g as nx,h as ix,i as sx,j as ax,k as cx,l as dx,m as lx,n as px,o as ux,p as mx,q as fx,r as _x,s as hx,t as gx,u as yx,v as bx,w as Tx,x as Cx,y as Ex,z as Sx}from"./chunks/chunk-FJNHTBJ2.js";import{$ as ef,$a as K_,$b as Kh,A as Ke,Aa as __,Ab as Th,B as Gm,Ba as h_,Bb as Ch,C as Um,Ca as g_,Cb as Eh,D as Bm,Da as y_,Db as Sh,E as zt,Ea as b_,Eb as wh,F as Ht,Fa as T_,Fb as Ah,G as Vt,Ga as C_,Gb as Oh,H as Kt,Ha as E_,Hb as vh,I as Wt,Ia as S_,Ib as Rh,J as Yt,Ja as w_,Jb as Ih,K as Xt,Ka as A_,Kb as Ph,L as Jt,La as O_,Lb as Mh,M as Qt,Ma as v_,Mb as kh,N as Zt,Na as R_,Nb as xh,O as er,Oa as I_,Ob as Nh,P as qm,Pa as P_,Pb as Lh,Q as zm,Qa as M_,Qb as Dh,R as Hm,Ra as k_,Rb as $h,S as Vm,Sa as x_,Sb as Fh,T as Km,Ta as tr,Tb as Gh,U as We,Ua as _e,Ub as Uh,V as Wm,Va as j_,Vb as jh,W as Ym,Wa as B_,Wb as Bh,X as Xm,Xa as q_,Xb as qh,Y as Jm,Ya as z_,Yb as zh,Z as Qm,Za as H_,Zb as Hh,_ as Zm,_a as V_,_b as Vh,a as Dv,aa as tf,ab as W_,ac as Wh,b as $v,ba as J0,bb as Y_,bc as Yh,c as Fv,ca as Q0,cb as X_,cc as Xh,d as Gv,da as Z0,db as J_,dc as Jh,e as Uv,ea as _f,eb as Q_,ec as Qh,f as jv,fa as hf,fb as Z_,fc as Zh,g as zv,ga as gf,gb as eh,gc as eg,h as Hv,ha as n_,hb as th,hc as tg,i as Vv,ia as i_,ib as rh,ic as rg,j as Kv,ja as ck,jb as oh,jc as og,k as $s,ka as dk,kb as nh,kc as ng,l as td,la as lk,lb as ih,lc as ig,m as rd,ma as pk,mb as sh,mc as sg,n as od,na as uk,nb as ah,nc as ag,o as cP,oa as mk,ob as ch,oc as cg,p as dP,pa as fk,pb as dh,pc as dg,q as lP,qa as _k,qb as lh,qc as lg,r as pP,ra as s_,rb as ph,rc as pg,s as uP,sa as a_,sb as uh,sc as ug,t as mP,ta as c_,tb as mh,tc as mg,u as wu,ua as d_,ub as fh,uc as fg,v as vu,va as l_,vb as _h,vc as _g,w as Ru,wa as p_,wb as hh,wc as hg,x as Ku,xa as u_,xb as gh,xc as gg,y as em,ya as m_,yb as yh,z as FM,za as f_,zb as bh}from"./chunks/chunk-GDS4DC5A.js";import{e as hP,f as gP,g as Kl,h as Wl,i as jt}from"./chunks/chunk-EALO2FPM.js";import{A as U0,B as j0,C as B0,D as q0,E as z0,F as H0,G as V0,H as K0,I as W0,J as Y0,K as X0,L as nf,M as sf,N as af,O as cf,P as df,Q as lf,R as pf,S as uf,T as mf,U as ff,a as CM,b as EM,c as SM,d as wM,e as AM,f as Su,g as OM,h as vM,i as RM,j as IM,k as PM,m as jm,n as rf,o as I0,p as P0,q as M0,r as k0,s as x0,t as N0,u as of,v as L0,w as D0,x as $0,y as F0,z as G0}from"./chunks/chunk-5NGGI7JC.js";import{$ as TI,$a as fp,$b as _M,$c as Lm,$d as U_,A as ze,Aa as HI,Ab as JP,Ac as Uu,Ad as Ff,B as ee,Ba as VI,Bb as QP,Bc as ju,Bd as Gf,C as ol,Ca as KI,Cb as ZP,Cc as Bu,Cd as Uf,Db as eM,Dc as qu,Dd as jf,Ea as fP,Eb as sM,Ec as zu,Ed as Bf,F as He,Fa as _P,Fb as aM,Fc as Hu,Fd as qf,G as nl,Ga as Ul,Gb as cu,Gd as zf,H as il,Ha as jl,Hb as du,Hc as DM,Hd as Hf,Ia as Bl,Ib as cM,Ic as $M,Id as Vf,J as fe,Ja as ql,Jb as dM,Jc as Vu,K as sl,Ka as zl,Kb as lM,Kc as tm,Kd as Kf,L as al,La as Hl,Lb as pM,Lc as rm,Ld as Wf,M as cl,Ma as Vl,Mb as uM,Mc as om,Md as Yf,N as dl,Na as ep,Nb as lu,Nc as nm,Nd as Xf,O as dI,Oa as tp,Ob as pu,Oc as im,Od as Jf,P as lI,Pa as rp,Pb as uu,Pd as Qf,Q as pI,Qa as op,Qb as mu,Qd as Zf,R as uI,Ra as np,Rb as fu,Rd as e_,S as mI,Sa as ip,Sb as _u,Sd as t_,T as xt,Ta as sp,Tb as hu,Tc as sm,Td as r_,U as fI,Ua as ap,Ub as gu,Ud as o_,V as _I,Va as cp,Vb as yu,Vc as am,Vd as N_,W as Nt,Wa as dp,Wb as bu,Wc as cm,Wd as L_,X as hI,Xa as lp,Xb as Tu,Xc as km,Xd as D_,Y as gI,Ya as pp,Yb as Cu,Yc as xm,Yd as $_,Z as yI,Za as up,Zb as mM,Zd as F_,_ as bI,_a as mp,_b as fM,_c as Nm,_d as G_,a as AR,aa as Ve,ab as _p,ac as hM,ad as Dm,b as It,ba as CI,bb as hp,bc as gM,bd as $m,c as OR,ca as Lt,cb as gp,cc as yM,cd as Fm,d as Vc,da as EI,db as yp,dc as bM,dd as yf,e as Kc,ea as SI,eb as bp,ec as TM,ed as bf,f as Wc,fa as wI,fb as TP,fc as Eu,fd as Tf,g as Yc,ga as AI,gb as Tp,gc as MM,gd as Cf,h as Xc,ha as OI,hb as Cp,hc as kM,hd as Ef,ia as vI,ib as Ep,ic as xM,id as Sf,j as Jc,ja as RI,jb as Sp,jc as NM,jd as wf,k as Qc,ka as II,kb as CP,kc as LM,kd as Af,la as PI,lb as wp,ld as Of,ma as MI,mb as Ap,mc as Au,md as ik,na as kI,nb as Op,nc as Ou,nd as sk,o as Zc,oa as xI,ob as vp,oc as Iu,od as ak,p as ed,pa as NI,pb as Rp,pc as Pu,pd as vf,qa as LI,qb as EP,qd as Rf,ra as DI,rb as SP,rc as Mu,rd as If,sa as $I,sb as wP,sc as ku,sd as Pf,ta as FI,tb as AP,tc as xu,td as Mf,ua as GI,ub as OP,uc as Nu,ud as kf,va as UI,vb as vP,vc as Lu,vd as xf,w as Mt,wa as jI,wb as RP,wc as Du,wd as Nf,xa as BI,xb as WP,xc as $u,xd as Lf,y as kt,ya as qI,yb as YP,yc as Fu,yd as Df,za as zI,zb as XP,zc as Gu,zd as $f}from"./chunks/chunk-UTNPDAID.js";import"./chunks/chunk-UJMQP2HP.js";import{w as zd}from"./chunks/chunk-3DWEBVIK.js";import{A as aP,Aa as Ml,B as El,C as Sl,Ca as kl,D as wl,Da as xl,E as Al,Ea as Nl,F as Dt,Fa as Ll,Ga as Dl,Ia as $l,Ja as Fl,Ka as Gl,a as Qv,b as Zv,c as eR,d as tR,e as rR,f as oR,g as Fs,h as Gs,i as Us,j as js,k as Bs,la as $t,m as WI,ma as Ft,na as Gt,oa as Ut,pa as Ol,ra as vl,sa as Rl,ta as Il,v as oP,w as nP,y as iP,z as sP,za as Pl}from"./chunks/chunk-OBTU2BHJ.js";import{a as YI,b as XI,c as JI,d as QI,e as ZI,f as eP,g as tP,h as fl,i as _l,j as hl,k as gl,l as yl,m as rP,n as bl,o as Tl,p as Cl}from"./chunks/chunk-L3SA3354.js";import{$a as BP,$b as u0,A as tI,Aa as eu,Ab as jM,Ac as vm,B as Hd,Ba as tu,Bb as BM,Bc as Rm,C as Vd,Ca as ru,Cb as qM,Cc as Im,D as Kd,Da as ou,Db as zM,Dc as qt,E as Wd,Ea as nu,Eb as HM,Ec as Pm,F as Yd,Fa as iu,Fb as VM,Fc as A0,G as Xd,Ga as su,Gc as O0,H as Jd,Ha as au,Hb as mm,Hc as v0,I as Qd,Ib as KM,Ic as Mm,J as Zd,Jb as WM,Jc as R0,K as el,Kb as YM,Kc as ek,L as tl,La as IP,Lb as XM,Lc as tk,M as qe,Ma as PP,Mb as JM,Mc as rk,N as rI,Na as MP,Nb as QM,Nc as ok,O as oI,Oa as kP,Ob as ZM,Oc as nk,P as nI,Pa as xP,Pb as e0,Q as iI,Qa as NP,Qb as t0,R as sI,Ra as LP,Rb as r0,S as aI,Sa as DP,Sb as o0,T as cI,Ta as $P,Tb as n0,U as rl,Ua as FP,Ub as i0,V as Yl,Va as GP,Vb as s0,W as Xl,Wa as UP,Wb as a0,X as Jl,Xa as jP,Xb as c0,Y as Ql,Yb as d0,Z as yP,Zb as l0,_ as bP,_b as p0,a as Wv,aa as Zl,ac as m0,b as Yv,ba as Ip,bb as qP,bc as f0,c as Xv,ca as Pp,cb as zP,cc as _0,d as Jv,da as Mp,dc as h0,e as jR,ea as kp,ec as g0,f as BR,fa as xp,fb as HP,fc as y0,g as qR,ga as Np,gb as VP,gc as b0,h as zR,ha as Lp,hb as KP,hc as T0,i as HR,ia as Dp,ic as C0,j as VR,ja as $p,jb as tM,jc as E0,k as KR,ka as Fp,kb as rM,kc as S0,la as Gp,lb as oM,lc as w0,ma as Up,mb as nM,mc as Bt,na as jp,nb as iM,nc as fm,oa as Bp,ob as Wu,oc as _m,pa as qp,pb as Yu,pc as hm,qa as zp,qb as Xu,qc as gm,ra as Hp,rb as Ju,rc as ym,sa as Vp,sb as Qu,sc as bm,t as WR,ta as Kp,tb as Zu,tc as Tm,u as YR,ua as Wp,ub as GM,uc as Cm,v as XR,va as Yp,vb as dm,vc as Em,w as JR,wa as Xp,wb as lm,wc as Sm,x as QR,xa as Jp,xb as pm,xc as wm,y as ZR,ya as Qp,yb as um,yc as Am,z as eI,za as Zp,zb as UM,zc as Om}from"./chunks/chunk-A7L5IEYV.js";import{a as Bv,b as qv}from"./chunks/chunk-U7MZIX3D.js";import{$ as ha,$a as hc,A as Hs,Aa as qa,Ab as dd,B as Vs,Ba as za,Bb as ld,Ca as Ha,Cb as pd,D as Ks,Da as Va,Db as ud,E as Ws,Ea as Ka,Eb as md,F as Ys,Fa as Wa,Fb as fd,G as Xs,Ga as Ya,Gb as _d,H as Js,Ha as Xa,Hb as hd,I as Qs,Ia as Ja,Ib as gd,J as Zs,Ja as Qa,Jb as yd,K as ea,Ka as Za,Kb as bd,L as ta,La as ec,Lb as Td,M as ra,Ma as tc,Mb as Cd,N as oa,Na as rc,Nb as Ed,O as na,Oa as oc,Ob as Sd,P as ia,Pa as nc,Pb as wd,Q as sa,Qa as ic,Qb as Ad,Ra as sc,Rb as Od,S as aa,Sa as ac,Sb as vd,T as ca,Ta as cc,Tb as vR,U as da,Ua as dc,Ub as RR,V as la,Va as lc,Vb as IR,W as pa,Wa as pc,Wb as PR,X as ua,Xa as uc,Xb as MR,Y as ma,Ya as mc,Yb as kR,Z as fa,Za as fc,_ as _a,_a as _c,a as nR,aa as ga,ab as gc,ac as xR,b as iR,ba as ya,bb as yc,bc as NR,c as sR,ca as ba,cb as bc,cc as LR,d as aR,da as Ta,db as Tc,dc as DR,e as cR,ea as Ca,eb as Cc,ec as $R,f as dR,fa as Ea,fb as Ec,fc as FR,g as lR,ga as Sa,gb as Sc,gc as GR,h as qs,ha as wa,hb as wc,hc as UR,i as pR,ia as Aa,ja as Oa,jb as Be,jc as Rd,ka as va,kb as Z,kc as Id,l as uR,la as Ra,lb as Ac,lc as Pd,m as mR,ma as Ia,mb as $c,mc as Md,n as Ue,na as Pa,nb as Fc,nc as kd,o as fR,oa as Ma,ob as Gc,oc as xd,p as _R,pa as ka,pb as Uc,pc as Nd,q as hR,qa as xa,qb as jc,qc as Ld,r as Rt,ra as Na,rb as Bc,rc as Dd,s as je,sa as La,sb as qc,sc as $d,t as gR,ta as Da,tb as zc,tc as Fd,u as yR,ua as $a,ub as Hc,uc as Pt,v as bR,va as Fa,vb as nd,w as TR,wa as Ga,wb as id,x as CR,xa as Ua,xb as sd,y as ER,ya as ja,yb as ad,z as zs,za as Ba,zb as cd}from"./chunks/chunk-PS2YAPXC.js";import{a as vv,b as Rv,c as Iv,d as Pv,e as Mv,f as kv,g as xv,h as Nv,i as Lv,j as vs,k as Rs,l as Is,m as Ps,n as Ms,o as ks,q as xs,s as Ns,y as Ls}from"./chunks/chunk-MR3CRLA7.js";import{b as wv}from"./chunks/chunk-OFIXSWJS.js";import"./chunks/chunk-IB7UB5TE.js";import{$b as kO,$c as hs,A as XT,Aa as UA,Ab as yO,Ac as as,Ad as Ev,B as JT,Ba as jA,Bb as bO,Bd as Sv,C as QT,Cc as cs,Cd as Av,Db as TO,Dc as ds,Dd as Ov,Eb as CO,Ec as ls,Fb as EO,Fc as ps,Gb as SO,Gc as us,Hb as es,Hc as ms,Ib as ts,Ic as KO,Jc as WO,K as cC,Kb as rs,Kc as YO,La as BA,Lb as wO,Lc as XO,M as gC,Ma as qA,Mc as JO,N as yC,Na as zA,Nb as AO,Nc as QO,O as bC,Oa as HA,Ob as OO,Oc as ZO,P as TC,Pa as VA,Pb as vO,Pc as ev,Q as OC,Qa as KA,Qc as tv,R as vC,Ra as ZA,Rb as RO,Rc as rv,S as wt,Sa as eO,Sc as ov,T as EE,Ta as tO,Tc as nv,U as SE,Ua as At,Ub as IO,Uc as iv,V as wE,Vc as sv,Wa as rO,Wb as PO,Wc as av,X as AE,Xa as oO,Xc as cv,Ya as nO,Yc as dv,Z as OE,Za as iO,Zc as fs,_ as vE,_a as sO,_b as MO,_c as _s,a as $T,aa as RE,ac as xO,ad as gs,ba as IE,bb as aO,bc as os,bd as ys,ca as PE,cc as NO,cd as bs,da as _A,dd as Ts,ea as hA,ec as LO,ed as Cs,fa as gA,fb as Xi,fc as DO,fd as Es,ga as yA,gc as $O,gd as Ss,ha as RA,hc as FO,hd as ws,i as sn,ic as GO,id as As,j as FT,ja as Vi,jc as UO,jd as Os,k as GT,ka as Ki,kc as jO,kd as lv,l as UT,la as Wi,lc as BO,ld as pv,m as jT,mc as qO,md as uv,na as IA,nc as zO,nd as mv,o as BT,oa as PA,oc as Ot,od as fv,p as qT,pa as MA,pc as HO,pd as _v,qa as kA,qd as hv,r as zT,ra as xA,rc as VO,rd as gv,sa as NA,sd as yv,t as HT,ta as LA,td as bv,u as VT,ud as Tv,v as KT,va as DA,x as WT,xa as $A,xc as ns,y as YT,ya as FA,yb as hO,yc as is,yd as vt,za as GA,zb as gO,zc as ss,zd as Cv}from"./chunks/chunk-FOT5K5OM.js";import{$ as gt,$b as PC,$c as YC,$f as ES,$g as ZS,$h as Ww,$i as cO,A as Go,Aa as ZT,Ac as jC,Ad as pE,Af as Ti,Ag as Bi,Ah as Ow,Ai as mA,B as Uo,Ba as eC,Bd as uE,Be as Xn,Bf as Ci,Bg as qi,Bh as vw,C as jo,Ca as tC,Cb as mC,Cc as BC,Cd as mE,Ce as Jn,Cf as Ei,Cg as PS,Ch as Rw,Ci as fA,D as Bo,Dc as qC,Dd as fE,De as HE,Df as Si,Dg as MS,Dh as Iw,E as qo,Ec as zC,Ed as _E,Ee as Qn,Eg as kS,Eh as Pw,Ei as bA,F as zo,Fa as gn,Fb as fC,Fc as HC,Fd as Gn,Fe as Zn,Fg as xS,Fh as Mw,Fi as TA,G as Ho,Ga as rC,Gc as VC,Gd as hE,Ge as VE,Gg as NS,Gh as kw,Gi as CA,H as Ne,Ha as oC,Hb as Tt,Hd as Un,He as KE,Hg as LS,Hh as xw,Hi as EA,I as Le,Ia as nC,Ie as WE,Ig as DS,Ih as Nw,Ii as SA,J as Vo,Ja as iC,Jb as Ct,Jd as gE,Je as YE,Jg as $S,Jh as Lw,Ji as wA,K as Ko,Kd as yE,Ke as XE,Kf as aS,Kg as FS,Kh as Dw,Ki as AA,L as Wo,La as yn,Lb as Pn,Ld as bE,Le as JE,Lf as cS,Lh as $w,Li as OA,M as Yo,Ma as bn,Mb as Mn,Mc as Nn,Md as TE,Me as QE,Mf as dS,Mi as vA,N as Xo,Na as $e,Nb as Et,Nc as KC,Nd as CE,Ne as ZE,Nf as lS,Ng as GS,O as Jo,Oa as sC,Od as ME,Oe as eS,Of as pS,Og as US,Oh as Fw,P as Qo,Pa as aC,Pb as _C,Pc as WC,Pd as kE,Pe as ei,Pf as uS,Pg as jS,Ph as Gw,Q as Zo,Qa as Tn,Qd as xE,Qe as ti,Qf as mS,Qg as BS,Qh as Uw,R as en,Ra as Cn,Rb as hC,Rd as NE,Re as L,Rf as fS,Rg as qS,Rh as jw,Ri as WA,S as tn,Sb as CC,Sd as LE,Se as ri,Sf as _S,Sg as zS,Sh as Bw,T as rn,Ta as En,Tb as EC,Td as DE,Tf as hS,Tg as HS,Th as qw,U as on,Ub as SC,Uf as gS,Ug as VS,Uh as zw,Ui as YA,V as nn,Vb as wC,Vg as KS,Vh as Hw,Vi as XA,Wb as AC,Wg as WS,Xb as RC,Xf as yS,Xg as YS,Xh as Vw,Yb as Fe,Ye as Ge,Yf as bS,Yg as XS,Yh as Kw,Yi as JA,Zb as St,Zd as $E,Ze as oi,Zf as TS,Zg as JS,Zi as Yi,_b as IC,_f as CS,_g as QS,_i as QA,a as R,aa as yt,ac as MC,ad as XC,ae as jn,ag as SS,ah as ew,ai as Yw,aj as dO,b as AT,ba as ln,bc as kC,bd as JC,be as FE,bg as wS,bh as tw,bi as Xw,bj as lO,c as ht,ca as pn,cc as q,ce as Bn,cg as AS,ch as rw,ci as Jw,cj as pO,d as OT,da as un,dc as xC,dd as QC,dg as OS,dh as ow,di as Qw,dj as uO,e as vT,eb as Sn,ec as NC,ed as ZC,ee as GE,ef as tS,eg as vS,eh as nw,ei as Zw,ej as mO,f as RT,fb as wn,fc as LC,ff as rS,fg as RS,fh as iw,fi as eA,fj as fO,g as IT,gb as An,gc as DC,gd as eE,gf as oS,gg as IS,gh as sw,gi as tA,gj as _O,h as PT,ha as mn,hb as On,hc as $C,hd as Ln,hf as ni,hh as aw,hi as rA,hj as Ji,i as MT,ib as vn,ic as FC,if as ii,ig as wi,ih as cw,ii as oA,ij as Qi,j as kT,ja as fn,jc as GC,jd as Dn,je as UE,jf as si,jg as Ai,jh as dw,ji as nA,jj as Zi,k as xT,ka as _n,kd as $n,kf as ai,kg as Oi,kh as lw,ki as iA,l as NT,la as hn,lb as Rn,le as jE,lf as ci,lg as vi,lh as pw,li as sA,m as LT,mc as UC,me as BE,mf as di,mg as Ri,mh as uw,n as DT,nb as In,nd as tE,ne as qn,nf as li,ng as Ii,nh as mw,ni as aA,o as Po,oc as kn,od as rE,oe as zn,of as pi,og as Pi,oh as fw,oi as zi,p as Mo,pc as xn,pd as oE,pf as ui,pg as Mi,ph as _w,pi as Hi,q as ko,qb as dC,qd as nE,qe as Hn,qf as mi,qg as ki,qh as hw,r as xo,rb as lC,rd as iE,re as Vn,rf as fi,rg as xi,rh as gw,s as ke,sd as sE,se as Kn,sf as _i,sg as Ni,sh as yw,t as No,td as aE,te as Wn,tf as hi,tg as Li,th as bw,u as N,ud as Fn,ue as Yn,uf as gi,ug as Di,uh as Tw,ui as cA,v as xe,vd as cE,ve as qE,vf as yi,vg as $i,vh as Cw,vi as dA,w as Lo,wb as pC,wd as dE,we as zE,wf as nS,wg as Fi,wh as Ew,wi as lA,x as Do,xf as iS,xg as Gi,xh as Sw,xi as pA,y as $o,yf as bi,yg as Ui,yh as ww,z as Fo,zb as uC,zd as lE,zf as sS,zg as ji,zh as Aw,zi as uA}from"./chunks/chunk-PZI6CR24.js";import"./chunks/chunk-SPPHDVZE.js";import{a as ll,b as pl,e as ul,f as ml}from"./chunks/chunk-RSAN2YUU.js";import"./chunks/chunk-VS565KBX.js";import{A as ue,B as wT,C as b,E as an,F as bt,G as me,H as cn,K as De,M as dn,b as gT,c as yT,d as bT,m as TT,r as CT,u as ET,y as ST}from"./chunks/chunk-O4ZLEN4T.js";import"./chunks/chunk-XAWE4EAK.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="8f11e0bf-4115-55a8-bd39-c360f43cdc09")}catch{}})();var z="2026-07-28",or=["2025-11-25","2025-06-18"],te=[z],m={headerMismatch:-32020,missingRequiredClientCapability:-32021,unsupportedProtocolVersion:-32022,invalidParams:-32602},w={clientCapabilities:"io.modelcontextprotocol/clientCapabilities",clientInfo:"io.modelcontextprotocol/clientInfo",logLevel:"io.modelcontextprotocol/logLevel",protocolVersion:"io.modelcontextprotocol/protocolVersion",serverInfo:"io.modelcontextprotocol/serverInfo"},rr=["debug","info","notice","warning","error","critical","alert","emergency"],u=class extends Error{code;data;constructor(t,r,o={}){super(t),this.name="PmMcpProtocolError",this.code=r,this.data=o}};function h(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function bg(e){if(e===void 0)return;if(!h(e))throw new u("Invalid MCP clientInfo metadata",m.invalidParams,{field:w.clientInfo,expected:"object"});let t=typeof e.name=="string"?e.name.trim():"",r=typeof e.version=="string"?e.version.trim():"";if(t.length===0||r.length===0)throw new u("Invalid MCP clientInfo metadata",m.invalidParams,{field:w.clientInfo,required:["name","version"]});let o={name:t.slice(0,128),version:r.slice(0,128)};return typeof e.description=="string"&&e.description.trim()&&(o.description=e.description.trim().slice(0,1024)),typeof e.websiteUrl=="string"&&e.websiteUrl.trim()&&(o.websiteUrl=e.websiteUrl.trim().slice(0,2048)),o}function Tg(e){if(e!==void 0){if(typeof e!="string"||!rr.includes(e))throw new u("Invalid MCP logLevel metadata",m.invalidParams,{field:w.logLevel,allowed:[...rr]});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:[w.protocolVersion,w.clientCapabilities]});let r=t[w.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 o=t[w.clientCapabilities];if(!h(o))throw new u("Invalid MCP client capabilities metadata",m.invalidParams,{field:w.clientCapabilities,expected:"object"});let n=bg(t[w.clientInfo]),s=Tg(t[w.logLevel]);return{protocolVersion:z,clientCapabilities:o,...n?{clientInfo:n}:{},...s?{logLevel:s}:{}}}function Jx(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 Qx(e,t){let r=t.filter(o=>!Object.prototype.hasOwnProperty.call(e.clientCapabilities,o));if(r.length>0)throw new u("Missing required client capability",m.missingRequiredClientCapability,{requiredCapabilities:Object.fromEntries(r.map(o=>[o,{}]))})}function Zx(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,[w.serverInfo]:{...t}}}}function Cg(e,t){return Xe({...e,resultType:"complete"},t)}function eN(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 Cg({supportedVersions:[...te],capabilities:structuredClone(e.capabilities),ttlMs:t,cacheScope:"public",...e.instructions?{instructions:e.instructions}:{}},e.serverInfo)}function tN(e,t){if(h(e)&&typeof e.resultType=="string")return e.resultType;if(t==="legacy")return"complete";throw new u("Modern MCP result is missing resultType",m.invalidParams,{required:"resultType"})}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="d4a56906-c542-567e-9265-15184a5c330b")}catch{}})();var Eg=new Set(["--help","-h","--version","-V"]);function Sg(e,t){let r=[`Usage: ${e==="stdio"?"pm-mcp":"pm-mcp-http"} [--help | --version]`,"",e==="stdio"?"JSON-RPC over stdin/stdout. With no arguments, starts the stdio server.":"Streamable HTTP POST /mcp. With no arguments, starts the HTTP server.","","Options:"," -h, --help Print help and exit before transport startup."," -V, --version Print the package version and exit.","","Environment:"," PM_PATH Tracker root (otherwise discovered from cwd)."," PM_GLOBAL_PATH Global settings root."," PM_MCP_PROFILE core (default), standard, full, or custom."," PM_MCP_TOOLS Comma-separated tool allowlist for custom profile."," PM_MCP_DISCOVERY_CURSOR_KEY Shared discovery cursor secret, at least 32 UTF-8 bytes."," PM_MCP_BAGGAGE_ALLOWLIST Comma-separated permitted trace baggage keys."];return e==="http"&&r.push(" PM_MCP_HTTP_HOST Bind host (default 127.0.0.1)."," PM_MCP_HTTP_PORT Bind port, 0..65535 (default 3000)."," PM_MCP_HTTP_ALLOWED_ORIGINS Comma-separated exact browser origins (default none)."," PM_MCP_HTTP_BEARER_TOKEN Deployment token for the bundled verifier."," PM_MCP_HTTP_AUTH_ISSUER Exact HTTPS authorization-server issuer."," PM_MCP_HTTP_RESOURCE Canonical resource/audience URI."," PM_MCP_HTTP_SCOPES Space-separated scopes (default pm:read pm:write).","","Non-loopback HTTP requires bearer token, issuer, and resource together."),r.push("",`MCP protocol: ${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",""),r.join(`
2
+ `)}function nN(e,t,r){if(e.length===0)return{kind:"serve"};let o=e.find(n=>!Eg.has(n));if(o!==void 0){let n=t==="stdio"?"pm-mcp":"pm-mcp-http";return{kind:"exit",exitCode:64,stdout:"",stderr:`Unsupported argument ${JSON.stringify(o)}. Run ${n} --help.
3
+ `}}return{kind:"exit",exitCode:0,stdout:e.includes("--help")||e.includes("-h")?Sg(t,r):`${r}
4
+ `,stderr:""}}import{createHash as sr,createHmac as ar,timingSafeEqual as wg}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="15b81dd0-ef1a-58be-b6ee-5975b6778993")}catch{}})();var Ag=["elicitation/create","roots/list","sampling/createMessage"],nr=class extends Error{inputRequests;requestState;constructor(t){super("MCP operation requires additional input"),this.name="PmMcpInputRequiredError",this.inputRequests=t.inputRequests,this.requestState=t.requestState}},cr=/^[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 Og(e){return e==="elicitation/create"?"elicitation":e==="sampling/createMessage"?"sampling":"roots"}function ye(e,t,r){let o;try{o=JSON.stringify(e)}catch{throw new u(`Invalid ${r}: value is not JSON serializable`,m.invalidParams,{field:r})}if(Buffer.byteLength(o,"utf8")>t)throw new u(`Invalid ${r}: payload exceeds the protocol bound`,m.invalidParams,{field:r,maximumBytes:t})}function 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 o={};for(let[n,s]of r){if(!cr.test(n)||!h(s))throw new u("Invalid MCP input request entry",m.invalidParams,{field:`inputRequests.${n}`});let i=s.method;if(typeof i!="string"||!Ag.includes(i))throw new u("Unsupported MCP input request method",m.invalidParams,{field:`inputRequests.${n}.method`,method:i??null});let a=Og(i);if(!Object.prototype.hasOwnProperty.call(t.clientCapabilities,a))throw new u("Missing required client capability",m.missingRequiredClientCapability,{requiredCapabilities:{[a]:{}}});if(!h(s.params))throw new u("Invalid MCP input request parameters",m.invalidParams,{field:`inputRequests.${n}.params`,expected:"object"});o[n]={method:i,params:structuredClone(s.params)}}return ye(o,Qe,"inputRequests"),o}function dr(e){if(!h(e))throw new u("Invalid MCP inputResponses",m.invalidParams,{field:"inputResponses",expected:"object"});let t=Object.entries(e);if(t.length>he)throw new u("Invalid MCP inputResponses count",m.invalidParams,{maximum:he,observed:t.length});let r={};for(let[o,n]of t){if(!cr.test(o)||!h(n))throw new u("Invalid MCP input response entry",m.invalidParams,{field:`inputResponses.${o}`});r[o]=structuredClone(n)}return ye(r,Qe,"inputResponses"),r}function cN(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:{[w.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 dN(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 o=r.toString("base64url"),n=ar("sha256",lr(t)).update(o).digest("base64url");return`${o}.${n}`}function vg(e){if(!h(e)||e.version!==1)throw new u("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});let{expiresAt:t,method:r,parameterDigest:o,principal:n,state:s}=e;if(typeof t!="number"||!Number.isSafeInteger(t))throw new u("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});if(typeof r!="string"||typeof o!="string"||typeof n!="string")throw new u("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});return{expiresAt:t,method:r,parameterDigest:o,principal:n,state:s}}function lN(e,t,r){let[o,n,s]=e.split(".");if(!o||!n||s!==void 0)throw new u("Invalid MCP requestState encoding",m.invalidParams,{field:"requestState"});let i=Buffer.from(n,"base64url"),a=ar("sha256",lr(t)).update(o).digest();if(i.byteLength!==a.byteLength||!wg(i,a))throw new u("Invalid MCP requestState signature",m.invalidParams,{field:"requestState"});let c;try{c=JSON.parse(Buffer.from(o,"base64url").toString("utf8"))}catch{c=null}let d=vg(c),{expiresAt:l,method:p,parameterDigest:f,principal:_}=d;if(l<(r.nowMs??Date.now()))throw new u("Expired MCP requestState",m.invalidParams,{field:"requestState",expiredAt:l});if(p!==r.method||f!==r.parameterDigest||_!==r.principal)throw new u("MCP requestState binding mismatch",m.invalidParams,{field:"requestState"});return d}function pN(e){return ye(e,Qe,"request parameters"),sr("sha256").update(JSON.stringify(e)).digest("hex")}var ir=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=sr("sha256").update(t).digest("hex");if(this.#e.has(r))throw new u("MCP requestState replay detected",m.invalidParams,{field:"requestState"});if(this.#e.size>=this.#t){let o=this.#e.values().next().value;this.#e.delete(o)}this.#e.add(r)}};function Rg(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 uN(e,t){return{...e,...Rg(t)}}function Ig(e){return e.replaceAll("~1","/").replaceAll("~0","~")}function Pg(e,t){if(t==="#")return e;if(!t.startsWith("#/"))return;let r=e;for(let o of t.slice(2).split("/").map(Ig)){if(!h(r)&&!Array.isArray(r)||!Object.prototype.hasOwnProperty.call(r,o))return;r=r[o]}return r}function Mg(e){let t=e.maxBytes??Je.maxBytes,r=e.maxDepth??Je.maxDepth,o=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(o)||o<1)throw new u("Invalid MCP JSON Schema work bounds",m.invalidParams);return{maximumBytes:t,maximumDepth:r,maximumNodes:o}}function kg(e,t){let r=Array.isArray(e.value)?e.value:h(e.value)?Object.values(e.value):[];for(let o of r)t.push({value:o,depth:e.depth+1})}function xg(e,t){if(!h(t)||typeof t.$ref!="string")return;let r=t.$ref;if(r.startsWith("#")&&Pg(e,r)===void 0)throw new u("MCP JSON Schema contains an unresolved local reference",m.invalidParams,{reference:r})}function mN(e,t={}){let{maximumBytes:r,maximumDepth:o,maximumNodes:n}=Mg(t);if(typeof e!="boolean"&&!h(e))throw new u("Invalid MCP JSON Schema root",m.invalidParams,{expected:"object or boolean"});ye(e,r,"JSON Schema");let s=[{value:e,depth:0}],i=0;for(;s.length>0;){let a=s.pop();if(i+=1,i>n||a.depth>o)throw new u("MCP JSON Schema exceeds validation work bounds",m.invalidParams,{maximumDepth:o,maximumNodes:n});xg(e,a.value),kg(a,s)}return structuredClone(e)}import{randomUUID as Ng}from"node:crypto";import{readFile as Lg}from"node:fs/promises";import pr from"node:path";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="f3e94896-b2a0-561c-902b-71c28ddde2a1")}catch{}})();var CN="io.modelcontextprotocol/tasks",Dg=["working","input_required","completed","failed","cancelled"],$g=/^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,Fg=3600*1e3,Gg=1e3,Te=1024,Ug=30,jg=2e3;function et(e){return new u(e,m.invalidParams,{code:"mcp_task_not_found_or_not_authorized"})}function be(e){let t=e.trim();if(!$g.test(t))throw et("Unknown MCP task");return t}function ur(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 mr(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,Te),...h(e.data)?{data:structuredClone(e.data)}:{}}}function Bg(e){if(!Dg.includes(e))throw new u("Corrupt MCP task record",m.invalidParams);return e}function qg(e){if(typeof e!="string"||e.length===0)throw new u("Corrupt MCP task record",m.invalidParams);return e}function zg(e){if(typeof e!="number"||!Number.isSafeInteger(e)||e<1)throw new u("Corrupt MCP task record",m.invalidParams);return e}function Hg(e){if(e!==null&&(typeof e!="number"||!Number.isSafeInteger(e)||e<0))throw new u("Corrupt MCP task record",m.invalidParams);return e}function Vg(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 Kg(e){if(!Array.isArray(e)||e.some(t=>typeof t!="string"))throw new u("Corrupt MCP task record",m.invalidParams);return[...e]}function Wg(e){if(!h(e)||e.version!==1)throw new u("Corrupt MCP task record",m.invalidParams);let t=typeof e.taskId=="string"?be(e.taskId):"",r=Bg(e.status),o=qg(e.principal),n=zg(e.workerPid),s=Hg(e.ttlMs),i=Vg(e.pollIntervalMs),a={version:1,taskId:t,status:r,principal:o,workerPid:n,createdAt:ur(e.createdAt,"createdAt"),lastUpdatedAt:ur(e.lastUpdatedAt,"lastUpdatedAt"),ttlMs:s,consumedInputKeys:Kg(e.consumedInputKeys),...typeof e.statusMessage=="string"?{statusMessage:e.statusMessage.slice(0,Te)}:{},...typeof i=="number"?{pollIntervalMs:i}:{}};if(h(e.inputRequests)&&(a.inputRequests=structuredClone(e.inputRequests)),h(e.inputResponses)&&(a.inputResponses=structuredClone(e.inputResponses)),h(e.result)&&(a.result=structuredClone(e.result)),e.error!==void 0&&(a.error=mr(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 Yg(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;#o;#i;constructor(t){this.#e=pr.resolve(t.pmRoot),this.#t=t.owner?.trim()||"pm-mcp",this.#r=t.now??(()=>new Date),this.#o=t.taskIdFactory??(()=>`mcp-task-${Ng()}`),this.#i=t.workerPid??process.pid}#s(t){return pr.join(this.#e,"runtime","mcp-tasks","records",`${be(t)}.json`)}async#c(t){try{return Wg(JSON.parse(await Lg(this.#s(t),"utf8")))}catch(r){throw me(r)||r instanceof SyntaxError?et("Unknown MCP task"):r}}async#a(t){await De(this.#s(t.taskId),`${JSON.stringify(t,null,2)}
5
+ `)}async#n(t,r,o){let n=be(t),s=await Ge(this.#e,n,Ug,this.#t,!1,!1,jg);try{let i=await this.#c(n);if(i.principal!==r)throw et("Unknown MCP task");let a=o(i);return await this.#a(a),a}finally{await s()}}async create(t){let r=be(this.#o()),o=t.principal.trim(),n=t.ttlMs===void 0?Fg:t.ttlMs,s=t.pollIntervalMs??Gg;if(o.length===0||n!==null&&(!Number.isSafeInteger(n)||n<0)||!Number.isSafeInteger(s)||s<0)throw new u("Invalid MCP task creation options",m.invalidParams);let i=this.#r().toISOString(),a={version:1,taskId:r,status:"working",createdAt:i,lastUpdatedAt:i,ttlMs:n,pollIntervalMs:s,principal:o,workerPid:this.#i,consumedInputKeys:[],...t.statusMessage?.trim()?{statusMessage:t.statusMessage.trim().slice(0,Te)}:{}};return await this.#a(a),{...H(a),resultType:"task"}}async get(t,r){return H(await this.#n(t,r,o=>{if(re(o.status))return o;let n=this.#r().getTime(),s=o.ttlMs!==null&&Date.parse(o.createdAt)+o.ttlMs<=n,i=o.workerPid!==this.#i&&!Yg(o.workerPid);return!s&&!i?o:{...o,status:"failed",statusMessage:s?"Task retention expired before completion.":"Task worker ended before recording a terminal result.",lastUpdatedAt:this.#r().toISOString(),error:{code:-32603,message:s?"MCP task expired":"MCP task worker unavailable after restart",data:{recoverable:!1,createNewTask:!0}},inputRequests:void 0}}))}async requireInput(t){let r=Ze(t.inputRequests,t.requestContext);return H(await this.#n(t.taskId,t.principal,o=>{if(re(o.status))return o;let n=Object.keys(r).filter(s=>o.consumedInputKeys.includes(s));if(n.length>0)throw new u("MCP task input request keys must be unique for the task lifetime",m.invalidParams,{reused:n});return{...o,status:"input_required",statusMessage:t.statusMessage?.trim().slice(0,Te),lastUpdatedAt:this.#r().toISOString(),inputRequests:r}}))}async update(t,r,o){let n=dr(o),s=[],i=[];return await this.#n(t,r,a=>{if(a.status!=="input_required"||!a.inputRequests)return a;let c={...a.inputRequests},d=a.inputResponses?{...a.inputResponses}:{};for(let[l,p]of Object.entries(n))Object.prototype.hasOwnProperty.call(c,l)&&(d[l]=p,delete c[l],s.push(l));return i=Object.keys(c).sort(),s.length===0?a:{...a,status:i.length===0?"working":"input_required",lastUpdatedAt:this.#r().toISOString(),inputRequests:i.length===0?void 0:c,inputResponses:d,consumedInputKeys:[...new Set([...a.consumedInputKeys,...s])].sort()}}),{acceptedKeys:s.sort(),remainingKeys:i}}async takeInputResponses(t,r){let o={};return await this.#n(t,r,n=>(o=structuredClone(n.inputResponses??{}),Object.keys(o).length===0?n:{...n,inputResponses:void 0})),o}async complete(t,r,o){return H(await this.#n(t,r,n=>re(n.status)?n:{...n,status:"completed",statusMessage:"Task completed.",lastUpdatedAt:this.#r().toISOString(),result:structuredClone(o),inputRequests:void 0,error:void 0}))}async fail(t,r,o){let n=mr(o);return H(await this.#n(t,r,s=>re(s.status)?s:{...s,status:"failed",statusMessage:n.message,lastUpdatedAt:this.#r().toISOString(),error:n,inputRequests:void 0,result:void 0}))}async cancel(t,r){return H(await this.#n(t,r,o=>re(o.status)?o:{...o,status:"cancelled",statusMessage:"Task cancelled by the client.",lastUpdatedAt:this.#r().toISOString(),inputRequests:void 0,result:void 0,error:void 0}))}};function EN(e){return new tt(e)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="15cbe26a-5716-5e8c-8700-eb36a1a056d6")}catch{}})();var Ce="io.modelcontextprotocol/subscriptionId",fr=256,_r=2048,Xg=5e3;function Jg(e,t){return new Promise((r,o)=>{let n=setTimeout(()=>o(new Error("MCP subscription sink write timed out")),Xg);n.unref(),Promise.resolve().then(()=>e(t)).then(()=>{clearTimeout(n),r()},s=>{clearTimeout(n),o(s instanceof Error?s:new Error(String(s)))})})}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 Qg(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"),o=rt(e.resourcesListChanged,"resourcesListChanged"),n;if(e.resourceSubscriptions!==void 0){if(!Array.isArray(e.resourceSubscriptions)||e.resourceSubscriptions.length>fr)throw new u("Invalid MCP resource subscriptions",m.invalidParams,{field:"notifications.resourceSubscriptions",maximum:fr});let s=new Set;for(let i of e.resourceSubscriptions){if(typeof i!="string"||i.trim().length===0||Buffer.byteLength(i,"utf8")>_r)throw new u("Invalid MCP resource subscription URI",m.invalidParams,{field:"notifications.resourceSubscriptions",maximumBytes:_r});s.add(i)}s.size>0&&(n=[...s].sort())}return{...t?{toolsListChanged:t}:{},...r?{promptsListChanged:r}:{},...o?{resourcesListChanged:o}:{},...n?{resourceSubscriptions:n}:{}}}function Zg(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 hr=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=Zg(Qg(t.notifications),this.#e),o={filter:r,sink:t.sink,writeQueue:Promise.resolve()};this.#t.set(t.id,o);try{await this.#o(t.id,o,{jsonrpc:"2.0",method:"notifications/subscriptions/acknowledged",params:{_meta:{[Ce]:t.id},notifications:structuredClone(r)}},!0)}catch(n){throw this.#t.delete(t.id),n}return structuredClone(r)}async emitListChanged(t){let r=`${t}ListChanged`,o=`notifications/${t}/list_changed`,n=[];for(let[s,i]of this.#t)i.filter[r]===!0&&n.push(this.#o(s,i,{jsonrpc:"2.0",method:o,params:{_meta:{[Ce]:s}}}));return(await Promise.all(n)).filter(Boolean).length}async emitResourceUpdated(t){let r=[];for(let[o,n]of this.#t)n.filter.resourceSubscriptions?.includes(t)&&r.push(this.#o(o,n,{jsonrpc:"2.0",method:"notifications/resources/updated",params:{_meta:{[Ce]:o},uri:t}}));return(await Promise.all(r)).filter(Boolean).length}async#o(t,r,o,n=!1){let s=r.writeQueue.then(async()=>{if(this.#t.get(t)!==r)return!1;try{return await Jg(r.sink,o),!0}catch(i){if(this.#t.get(t)===r&&this.#t.delete(t),n)throw i;return!1}});return r.writeQueue=s.then(()=>{},()=>{}),s}close(t){if(this.#t.delete(t))return{...Xe({resultType:"complete",_meta:{[Ce]:t}},this.#r)}}closeAll(){let t=[];for(let r of this.#t.keys()){let o=this.close(r);t.push({id:r,result:o})}return t}};(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="3681273a-e101-57a0-9446-982c450e7183")}catch{}})();var gr=/^=\?base64\?([A-Za-z0-9+/]*={0,2})\?=$/u,ey=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/u,yr=/^[\t\x20-\x7E]*$/u,br=new Set(["prompts/get","resources/read","tools/call"]);function ty(e){let t=new Map;for(let[r,o]of Object.entries(e)){if(o===void 0)continue;let n=typeof o=="string"?o:o.join(", ");t.set(r.toLowerCase(),n)}return t}function A(e,t){throw new u(e,m.headerMismatch,{header:t})}function Tr(e){let t=typeof e=="boolean"?String(e).toLowerCase():String(e);return t.length>0&&t.trim()===t&&yr.test(t)&&!gr.test(t)?t:`=?base64?${Buffer.from(t,"utf8").toString("base64")}?=`}function Cr(e,t){let r=gr.exec(e);if(r){let o=r[1],n=Buffer.from(o,"base64");return n.toString("base64")!==o||n.length===0?A("Malformed MCP Base64 header value",t):n.toString("utf8")}return e.length===0||e.trim()!==e||!yr.test(e)?A("Malformed MCP header value",t):e}function Ee(e){return Array.isArray(e)?e.some(Ee):h(e)?Object.prototype.hasOwnProperty.call(e,"x-mcp-header")||Object.values(e).some(Ee):!1}function ry(e,t,r){let o=e["x-mcp-header"];if(o===void 0)return;let n=e.type;if(typeof o!="string"||!ey.test(o)||!["boolean","integer","string"].includes(String(n))||r.has(o.toLowerCase()))throw new u("Invalid MCP x-mcp-header annotation",m.invalidParams,{field:t.join("."),annotation:o});return r.add(o.toLowerCase()),{name:o,path:t,type:n}}function Er(e){if(!h(e))throw new u("Invalid MCP tool schema",m.invalidParams,{field:"inputSchema",expected:"object"});let t=[],r=new Set,o=(n,s)=>{let i=n.properties;if(i!==void 0){if(!h(i))throw new u("Invalid MCP tool schema properties",m.invalidParams,{field:"inputSchema.properties"});for(let[a,c]of Object.entries(i)){if(!h(c))continue;let d=[...s,a],l=ry(c,d,r);l&&t.push(l);for(let[p,f]of Object.entries(c))if(p!=="properties"&&p!=="x-mcp-header"&&Ee(f))throw new u("MCP x-mcp-header is not statically reachable",m.invalidParams,{field:d.join("."),keyword:p});o(c,d)}}};for(let[n,s]of Object.entries(e))if(n!=="properties"&&Ee(s))throw new u("MCP x-mcp-header is not statically reachable",m.invalidParams,{field:"inputSchema",keyword:n});return o(e,[]),t}function Sr(e,t){let r=e;for(let o of t){if(!h(r))return;r=r[o]}return r}function wr(e,t){let r=e==="resources/read"?t.uri:t.name;return typeof r=="string"?r:void 0}function oy(e,t){let r=h(e.arguments)?e.arguments:{},o={};for(let n of Er(t)){let s=Sr(r,n.path);if(s!=null){if(!(n.type==="integer"&&typeof s=="number"&&Number.isSafeInteger(s)||n.type==="boolean"&&typeof s=="boolean"||n.type==="string"&&typeof s=="string"))throw new u("Invalid MCP custom header argument",m.invalidParams,{field:n.path.join("."),expected:n.type});o[`Mcp-Param-${n.name}`]=Tr(s)}}return o}function vN(e){let t=h(e.request.params)?e.request.params:void 0,r=Ye(t),o=e.request.method;if(typeof o!="string"||o.length===0)return A("Missing MCP request method","Mcp-Method");let n={Accept:"application/json, text/event-stream","Content-Type":"application/json","MCP-Protocol-Version":r.protocolVersion,"Mcp-Method":o},s=wr(o,t);if(br.has(o)){if(s===void 0)return A("Missing MCP request name","Mcp-Name");n["Mcp-Name"]=Tr(s)}return o==="tools/call"&&e.toolSchema!==void 0&&Object.assign(n,oy(t,e.toolSchema)),n}function ny(e,t){let r=t.method;(typeof r!="string"||r.length===0)&&A("Missing MCP request method","Mcp-Method");let o=h(t.params)?t.params:void 0,n=Ye(o).protocolVersion;if(e.get("mcp-protocol-version")!==n&&A("MCP protocol header does not match request metadata","MCP-Protocol-Version"),e.get("mcp-method")!==r&&A("MCP method header does not match request body","Mcp-Method"),br.has(r)){let s=e.get("mcp-name"),i=wr(r,o);(s===void 0||i===void 0||Cr(s,"Mcp-Name")!==i)&&A("MCP name header does not match request body","Mcp-Name")}e.has("last-event-id")&&A("MCP SSE resumability is not supported","Last-Event-ID")}function iy(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 sy(e){let t=h(e.params.arguments)?e.params.arguments:{};for(let r of Er(e.toolSchema)){let o=Sr(t,r.path),n=`Mcp-Param-${r.name}`,s=e.headers.get(n.toLowerCase());if(o==null){s!==void 0&&A("Unexpected MCP parameter header",n);continue}s===void 0&&A("Missing MCP parameter header",n),iy(r,o,Cr(s,n))||A("MCP parameter header does not match request body",n)}}function RN(e){let t=ty(e.headers),r=typeof e.request.method=="string"?e.request.method:"";ny(t,e.request),!(r!=="tools/call"||e.toolSchema===void 0)&&sy({headers:t,params:e.request.params,toolSchema:e.toolSchema})}var IN=z;import{AsyncLocalStorage as ay}from"node:async_hooks";import{createHash as Ar,timingSafeEqual as cy}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="a7c30d99-a0e4-552e-be61-0c54a455e211")}catch{}})();var y=class extends Error{httpStatus;challenge;constructor(t,r,o){super(t),this.name="PmMcpAuthorizationError",this.httpStatus=r,this.challenge=o}},dy=/^00-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})$/u,ly=/^[a-z][a-z0-9_*/-]{0,255}$/u,py=/^(?:[a-z0-9][a-z0-9_*/-]{0,240})@[a-z][a-z0-9_*/-]{0,13}$/u,uy=/^[\x20-\x2B\x2D-\x3C\x3E-\x7E]{0,255}[\x21-\x2B\x2D-\x3C\x3E-\x7E]$/u,vr=/^[\x21\x23-\x5B\x5D-\x7E]+$/u,Rr=/^[A-Za-z0-9!#$%&'*+.^_`|~-]+$/u,my=/^[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]*$/u,fy=/%(?![0-9A-Fa-f]{2})/u,_y=512,hy=32,gy=180,yy=8192,by=8192,Ir=new ay;function S(e,t,r=!1){if(new RegExp("\\p{Cc}","u").test(e))throw new y(`Invalid ${t}`,401);let o;try{o=new URL(e)}catch{throw new y(`Invalid ${t}`,401)}let n=o.hostname==="127.0.0.1"||o.hostname==="localhost";if(o.hash.length>0||o.protocol!=="https:"&&!(r&&n&&o.protocol==="http:"))throw new y(`Invalid ${t}`,401);return o}function Ty(e,t){let r=t.toLowerCase();for(let[o,n]of Object.entries(e))if(!(o.toLowerCase()!==r||n===void 0))return typeof n=="string"?n:n.join(", ")}function NN(e){let t=S(e.resource,"protected resource URI",!0).href.replace(/\/$/u,"");if(e.authorizationServers.length===0)throw new y("Protected resource metadata requires an authorization server",401);let r=e.authorizationServers.map(n=>S(n,"authorization server issuer").href.replace(/\/$/u,"")),o=[...new Set(e.scopes??[])];if(o.some(n=>!vr.test(n)))throw new y("Invalid authorization scope",401);return{resource:t,authorization_servers:r,...o.length>0?{scopes_supported:o.sort()}:{}}}function LN(e){let t=S(e,"authorization server issuer"),r=t.pathname.replace(/^\/+|\/+$/gu,""),o=t.origin;return r?[`${o}/.well-known/oauth-authorization-server/${r}`,`${o}/.well-known/openid-configuration/${r}`,`${o}/${r}/.well-known/openid-configuration`]:[`${o}/.well-known/oauth-authorization-server`,`${o}/.well-known/openid-configuration`]}function DN(e,t){if(!h(e)||typeof e.issuer!="string")throw new y("Invalid authorization server metadata",401);let r=S(t,"expected issuer").href.replace(/\/$/u,"");if(S(e.issuer,"metadata issuer").href.replace(/\/$/u,"")!==r)throw new y("Authorization server issuer mismatch",401);if(!Array.isArray(e.code_challenge_methods_supported)||!e.code_challenge_methods_supported.includes("S256"))throw new y("Authorization server does not support required S256 PKCE",401);let o=c=>{let d=e[c];if(typeof d!="string")throw new y(`Authorization server metadata requires ${c}`,401);return S(d,c).href},n=c=>{let d=e[c];return typeof d=="string"?S(d,c).href:void 0},s=o("authorization_endpoint"),i=o("token_endpoint"),a=n("registration_endpoint");return{issuer:r,authorization_endpoint:s,token_endpoint:i,code_challenge_methods_supported:[...new Set(e.code_challenge_methods_supported.filter(c=>typeof c=="string"))],...e.client_id_metadata_document_supported===!0?{client_id_metadata_document_supported:!0}:{},...a?{registration_endpoint:a}:{}}}function $N(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 FN(e){if(e.responseIssuer===void 0){if(e.issuerParameterSupported)throw new y("Authorization response omitted the advertised issuer",401);return}if(e.responseIssuer!==e.expectedIssuer)throw new y("Authorization response issuer mismatch",401)}function GN(e,t){let r=S(t,"client metadata document URL");if(r.pathname==="/"||!h(e)||e.client_id!==r.href||typeof e.client_name!="string"||e.client_name.trim().length===0||!Array.isArray(e.redirect_uris)||e.redirect_uris.length===0)throw new y("Invalid Client ID Metadata Document",401);for(let o of e.redirect_uris){if(typeof o!="string")throw new y("Invalid client redirect URI",401);S(o,"client redirect URI",!0)}return structuredClone(e)}function UN(e){if(e.redirectUris.length===0||e.clientName.trim().length===0)throw new y("Invalid dynamic client registration metadata",401);let t=e.redirectUris.map(r=>S(r,"redirect URI",!0).href);return{application_type:e.applicationType,client_name:e.clientName.trim().slice(0,128),redirect_uris:t,grant_types:["authorization_code","refresh_token"],response_types:["code"],token_endpoint_auth_method:"none"}}var Or=class{#e=new Map;set(t,r){let o=S(t,"credential issuer").href;this.#e.set(o,structuredClone(r))}get(t){let r=S(t,"credential issuer").href,o=this.#e.get(r);return o?structuredClone(o):void 0}delete(t){let r=S(t,"credential issuer").href;return this.#e.delete(r)}};function Cy(e){let t=e.traceparent,r=e.tracestate;if(t!==void 0){let o=typeof t=="string"?dy.exec(t):null;if(!o)throw new y("Invalid MCP traceparent",403);let n=o[1],s=o[2];if(/^0+$/u.test(n)||/^0+$/u.test(s))throw new y("Invalid MCP traceparent",403)}if(r!==void 0&&(typeof r!="string"||!Sy(r)))throw new y("Invalid MCP tracestate",403);return{...typeof t=="string"?{traceparent:t}:{},...typeof r=="string"?{tracestate:r}:{}}}function D(e){return e.replace(/^[ \t]*|[ \t]*$/gu,"")}function Ey(e){return ly.test(e)||py.test(e)}function Sy(e){if(Buffer.byteLength(e,"utf8")>_y)return!1;let t=e.split(",");if(t.length>hy)return!1;let r=new Set;for(let o of t){let n=D(o);if(n.length===0)continue;let s=n.indexOf("="),i=s>0?n.slice(0,s):"",a=s>0?n.slice(s+1):"";if(!Ey(i)||!uy.test(a)||r.has(i))return!1;r.add(i)}return!0}function Pr(e){return my.test(e)&&!fy.test(e)}function wy(e){let t=D(e),r=t.indexOf("="),o=D(r>=0?t.slice(0,r):t),n=r>=0?D(t.slice(r+1)):void 0;return Rr.test(o)&&(n===void 0||Pr(n))}function Ay(e){let t=D(e),r=t.split(";"),o=r[0],n=r.slice(1),s=o.indexOf("="),i=D(s>0?o.slice(0,s):""),a=s>0?D(o.slice(s+1)):"";if(!(!Rr.test(i)||!Pr(a)||!n.every(wy)))return{key:i,serialized:t}}function Oy(e,t){if(e===void 0)return;if(typeof e!="string"||Buffer.byteLength(e,"utf8")>yy)throw new y("Invalid MCP baggage",403);let r=new Set(t),o=e.split(",");if(o.length>gy)throw new y("Invalid MCP baggage",403);let n=[];for(let s of o){let i=Ay(s);if(!i)throw new y("Invalid MCP baggage",403);r.has(i.key)&&n.push(i.serialized)}return n.length>0?n.join(","):void 0}function jN(e,t={}){let r=h(e)&&h(e._meta)?e._meta:{},o=Oy(r.baggage,t.baggageAllowlist??[]);return{...Cy(r),...o?{baggage:o}:{}}}function BN(e,t){return Ir.run(structuredClone(e),t)}function qN(){let e=Ir.getStore();return e?{...e}:void 0}async function zN(e){let t=S(e.policy.resourceMetadataUrl,"protected resource metadata URL",!0).href,r=[...new Set(e.policy.requiredScopes??[])];if(r.some(d=>!vr.test(d)))throw new y("Invalid authorization scope",401);let o=`Bearer resource_metadata="${t}"`;if(new URL(e.requestUrl,e.policy.resource).searchParams.has("access_token"))throw new y("Access tokens must not appear in URI query parameters",401,o);let n=Ty(e.headers,"authorization")?.match(/^Bearer ([^\s]+)$/iu);if(!n)throw new y("Missing or malformed bearer token",401,o);let s=n[1];if(Buffer.byteLength(s,"utf8")>by)throw new y("Missing or malformed bearer token",401,o);let i;try{i=await e.policy.verifyAccessToken(s)}catch{throw new y("Invalid bearer token",401,o)}let a=Array.isArray(i.audience)?i.audience:[i.audience];if(i.issuer!==e.policy.issuer||!a.includes(e.policy.resource))throw new y("Bearer token issuer or audience mismatch",401,o);let c=r.filter(d=>!i.scopes.includes(d));if(c.length>0)throw new y("Bearer token has insufficient scope",403,`${o}, scope="${c.join(" ")}"`);return{...i,audience:[...a],scopes:[...i.scopes]}}function HN(e){let t=Ar("sha256").update(e.token).digest();return r=>{let o=Ar("sha256").update(r).digest();if(!cy(t,o))throw new y("Invalid bearer token",401);return structuredClone(e.claims)}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="46f5fe59-6b84-5c68-ad07-bb1329f4ea29")}catch{}})();var ot="io.modelcontextprotocol/ui",Se="2026-01-26",xr="text/html;profile=mcp-app",Mr=Object.freeze({specVersion:Se,mimeTypes:[xr]});function WN(e){let t=e.clientCapabilities.extensions;if(!h(t))return!1;let r=t[ot];if(r===void 0)return!1;if(!h(r))throw new u("Invalid MCP Apps client capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[ot]:Mr}}});let o=r.mimeTypes,n=r.specVersion;if(!Array.isArray(o)||!o.includes(xr)||n!==void 0&&n!==Se)throw new u("Unsupported MCP Apps client capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[ot]:Mr}}});return!0}var vy={csp:{connectDomains:[],resourceDomains:[],frameDomains:[]},permissions:{},prefersBorder:!0},Nr=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:vy})));function YN(e){return Nr.find(t=>t.uri===e)}function XN(e){let t=new Map(Nr.map(r=>[r.toolName,r]));return e.map(r=>{let o=t.get(r.name);return o?{...r,_meta:{...r._meta,ui:o.toolMeta}}:{...r}})}function kr(e){return e.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;")}function JN(e){let t=kr(e.name),r=kr(e.description),o=JSON.stringify({name:`pm-${e.id}-view`,version:Se}),n=JSON.stringify(Se);return`<!doctype html>
6
6
  <html lang="en">
7
7
  <head>
8
8
  <meta charset="utf-8">
@@ -25,11 +25,11 @@ import{a as fg}from"./chunks/chunk-F6FBGLR7.js";import{a as jk,b as Bk,c as qk,d
25
25
  (()=>{"use strict";const MAX=24000,status=document.querySelector("#status"),result=document.querySelector("#result"),input=document.querySelector("#input"),pending=new Map();let nextId=1;const render=(node,value)=>{let text;try{text=typeof value==="string"?value:JSON.stringify(value,null,2)}catch{text="Result could not be serialized."}if(text.length>MAX)text=text.slice(0,MAX)+"\\n\\n[View truncated at "+MAX+" characters; use the authoritative pm tool with a cursor or narrower projection.]";node.textContent=text};const send=(message)=>window.parent.postMessage(message,"*");window.addEventListener("message",event=>{if(event.source!==window.parent||!event.data||event.data.jsonrpc!=="2.0")return;const message=event.data;if(message.id!==undefined&&pending.has(message.id)){pending.get(message.id)(message);pending.delete(message.id);return}if(message.method==="ui/notifications/tool-input"||message.method==="ui/notifications/tool-input-partial"){render(input,message.params?.arguments??message.params);status.textContent="Input received"}else if(message.method==="ui/notifications/tool-result"){render(result,message.params);status.textContent="Current tool result"}else if(message.method==="ui/notifications/tool-cancelled"){status.textContent="Tool call cancelled";status.classList.add("notice")}else if(message.method==="ui/notifications/host-context-changed"&&message.params?.theme){document.documentElement.style.colorScheme=message.params.theme}});const request=(method,params)=>new Promise(resolve=>{const id=nextId++;pending.set(id,resolve);send({jsonrpc:"2.0",id,method,params})});document.querySelector("#copy").addEventListener("click",async()=>{const text=result.textContent+"\\n\\n"+input.textContent;try{await navigator.clipboard.writeText(text);status.textContent="Visible evidence copied"}catch{status.textContent="Clipboard permission unavailable";status.classList.add("notice")}});request("ui/initialize",{appInfo:${o},appCapabilities:{},protocolVersion:${n}}).then(message=>{if(message.error){status.textContent="Host rejected MCP App initialization";status.classList.add("notice");return}send({jsonrpc:"2.0",method:"ui/notifications/initialized"});status.textContent="Connected \u2014 awaiting authoritative result"})})();
26
26
  </script>
27
27
  </body>
28
- </html>`}import{createHash as st}from"node:crypto";import{lstat as wy,readdir as qr,readFile as Ay}from"node:fs/promises";import M from"node:path";import{parseDocument as vy}from"yaml";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="eafd8bc3-0da1-5220-8fb1-6967eecdb6bf")}catch{}})();var Dr="io.modelcontextprotocol/skills",at="SEP-2640@a3e147ca2710f68214247aecc729731ee1ae8d03",Oy=Object.freeze({revision:at,status:"draft",directoryRead:!0});function eL(e,t=!1){let r=e.clientCapabilities.extensions,o=h(r)?r[Dr]:void 0;if(!h(o)||o.revision!==at||t&&o.directoryRead!==!0)throw new u("Missing or incompatible Skills over MCP draft capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[Dr]:Oy}}})}var P=Object.freeze({maxFilesPerSkill:512,maxFileBytes:16*1024*1024,maxSkillBytes:16*1024*1024,defaultPageSize:20,maxPageSize:100}),$r=100,Ry=32*1024*1024,Iy=/^[a-z0-9]+(?:-[a-z0-9]+)*$/u,Fr=new Set(Array.from({length:P.maxPageSize},(e,t)=>t+1));function C(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 Py(e,t){let r=/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/u.exec(e);r||C(`Skill ${t} is missing YAML frontmatter.`);let o=vy(r[1],{prettyErrors:!1,strict:!0,uniqueKeys:!0});o.errors.length>0&&C(`Skill ${t} has invalid YAML frontmatter.`,{errors:o.errors.map(s=>s.message)});let n;try{n=o.toJS({maxAliasCount:0})}catch(s){C(`Skill ${t} has unsupported YAML aliases.`,{error:String(s)})}return(typeof n!="object"||n===null||Array.isArray(n))&&C(`Skill ${t} frontmatter must be an object.`),n}async function My(e,t,r,o){return r>P.maxFileBytes&&C(`Skill resource exceeds the per-file limit: ${t}.`),o.files+=1,o.files>P.maxFilesPerSkill&&C(`Skill exceeds ${P.maxFilesPerSkill} files.`),o.skillBytes+=r,o.skillBytes>P.maxSkillBytes&&C(`Skill exceeds the aggregate byte limit: ${t}.`),o.originBytes.value+=r,o.originBytes.value>Ry&&C(`Skill origin exceeds the aggregate byte limit: ${t}.`),Ay(e)}async function zr(e,t,r){let o=M.join(e,t),n=await qr(o,{withFileTypes:!0}),s=[];for(let i of n.sort((a,d)=>a.name.localeCompare(d.name))){let a=M.posix.join(t.split(M.sep).join("/"),i.name),d=M.join(e,...a.split("/")),c=await wy(d);c.isSymbolicLink()&&C(`Skill resource must not be a symbolic link: ${a}.`),c.isDirectory()?s.push(...await zr(e,a,r)):c.isFile()?s.push({relative:a,bytes:await My(d,a,c.size,r)}):C(`Skill resource must be a regular file or directory: ${a}.`)}return s}async function Ur(e,t,r){let o=new Map,n;try{n=await qr(e,{withFileTypes:!0})}catch(a){if(Ct(a))return o;throw a}let s=n.filter(a=>a.isDirectory()&&Iy.test(a.name)).sort((a,d)=>a.name.localeCompare(d.name));s.length>$r&&C(`Skill origin exceeds ${$r} directories.`);let i={value:0};for(let a of s){let d=await zr(M.join(e,a.name),"",{files:0,skillBytes:0,originBytes:i}),c=d.reduce((g,T)=>g+T.bytes.byteLength,0),l=d.find(g=>g.relative==="SKILL.md");if(!l)continue;let p=Py(l.bytes.toString("utf8"),a.name);p.name!==a.name&&C(`Skill directory ${a.name} must match frontmatter name.`,{actual:p.name??null,expected:a.name}),(typeof p.description!="string"||p.description.trim().length===0)&&C(`Skill ${a.name} requires a non-empty frontmatter description.`,{required:["description"]});let f=d.map(g=>({uri:`skill://${a.name}/${g.relative}`,digest:`sha256:${st("sha256").update(g.bytes).digest("hex")}`,size:g.bytes.byteLength})),_=st("sha256").update(f.map(g=>`${g.uri}:${g.digest}`).join(`
29
- `)).digest("hex");o.set(a.name,{uri:`skill://${a.name}/SKILL.md`,frontmatter:p,resources:f,_meta:{contractVersion:1,extensionRevision:at,origin:t,packageVersion:r,protocolVersion:H,trust:"untrusted",estimatedTokens:Math.ceil(c/4)},files:new Map(d.map(g=>[g.relative,g.bytes])),fingerprint:_})}return o}function jr(e){let{files:t,fingerprint:r,...o}=e;return o}var Br=class e{#e;#t;constructor(t){this.#e=t,this.#t=st("sha256").update([...t.entries()].sort(([r],[o])=>r.localeCompare(o)).map(([r,o])=>`${r}:${o.fingerprint}`).join(`
30
- `)).digest("hex").slice(0,16)}#r(t,r){if(!t)return 0;try{let o=JSON.parse(Buffer.from(t,"base64url").toString("utf8"));return(typeof o!="object"||o===null||!("fingerprint"in o)||o.fingerprint!==this.#t||!("scope"in o)||o.scope!==r||!("offset"in o)||!Number.isInteger(o.offset)||Number(o.offset)<0)&&C("Skill cursor is invalid or stale."),Number(o.offset)}catch(o){if(o instanceof u)throw o;return C("Skill cursor is invalid or stale.")}}#o(t,r){return Buffer.from(JSON.stringify({fingerprint:this.#t,offset:t,scope:r})).toString("base64url")}static async load(t){let r=await Ur(M.join(t.packageRoot,".agents","skills"),"package",t.packageVersion);if(t.workspaceRoot){let o=M.resolve(t.packageRoot,".agents","skills"),n=M.resolve(t.workspaceRoot,".agents","skills");if(n!==o){let s=await Ur(n,"workspace",t.packageVersion);for(let[i,a]of s)r.set(i,a)}}return new e(r)}list(t={}){let r=t.limit??P.defaultPageSize;Fr.has(r)||C(`Skill list limit must be an integer from 1 to ${P.maxPageSize}.`);let o=this.#r(t.cursor,"skills/list"),n=[...this.#e.values()].sort((d,c)=>d.uri.localeCompare(c.uri)),s=n.slice(o,o+r),i=o+s.length,a=i<n.length;return{skills:s.map(jr),hasMore:a,...a?{nextCursor:this.#o(i,"skills/list")}:{}}}get(t){let r=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)\/SKILL\.md$/u.exec(t),o=r?this.#e.get(r[1]):void 0;return o||C(`Unknown pm MCP skill: ${t}.`,{field:"uri"}),jr(o)}read(t){let r=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)\/(.+)$/u.exec(t),o=r?this.#e.get(r[1]):void 0,n=r?.[2]??"",s=o&&n?o.files.get(n):void 0,i=o?.resources.find(c=>c.uri===t);(!o||!s||!i)&&C(`Unknown pm MCP skill resource: ${t}.`,{field:"uri"});let a={digest:i.digest,origin:o._meta.origin,trust:"untrusted"},d=Gr(n,s);return d!=="application/octet-stream"?{contents:[{uri:t,mimeType:d,text:s.toString("utf8"),_meta:a}]}:{contents:[{uri:t,mimeType:d,blob:s.toString("base64"),_meta:a}]}}readDirectory(t,r={}){let o=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)(?:\/(.+))?$/u.exec(t),n=o?this.#e.get(o[1]):void 0;n||C(`Unknown pm MCP skill directory: ${t}.`,{field:"uri"});let s=(o?.[2]??"").replace(/\/$/u,""),i=s.length>0?`${s}/`:"",a=`skill://${o[1]}`,d=new Map;for(let T of n.resources){let E=T.uri.slice(`${a}/`.length);if(!E.startsWith(i))continue;let q=E.slice(i.length),[R,...Ro]=q.split("/"),Io=`${a}/${i}${R}`,Po=n.files.get(`${i}${R}`);d.set(R,{uri:Io,name:R,mimeType:Ro.length>0?"inode/directory":Gr(R,Po)})}s.length>0&&d.size===0&&C(`Unknown pm MCP skill directory: ${t}.`,{field:"uri"});let c=r.limit??P.maxPageSize;Fr.has(c)||C(`Skill directory limit must be an integer from 1 to ${P.maxPageSize}.`);let l=this.#r(r.cursor,t),p=[...d.values()].sort((T,E)=>T.uri.localeCompare(E.uri)),f=p.slice(l,l+c),_=l+f.length,g=_<p.length;return{resources:f,hasMore:g,...g?{nextCursor:this.#o(_,t)}:{}}}};(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="38023567-8a5b-5e25-8d71-5112f74d1894")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="619dbd55-b854-5e69-b5a5-c0bcada81629")}catch{}})();var Hr="https://schema.unbrained.dev/pm/workspace-recipe/v1";function dt(e,t){if(e===null||typeof e=="boolean"||typeof e=="string")return e;if(typeof e=="number"){if(!Number.isFinite(e))throw new Error(`Workspace recipe JSON number must be finite at ${t}`);return e}if(Array.isArray(e))return Object.freeze(e.map((r,o)=>dt(r,`${t}[${o}]`)));if(typeof e!="object"||Object.getPrototypeOf(e)!==Object.prototype&&Object.getPrototypeOf(e)!==null)throw new Error(`Workspace recipe input must contain JSON values at ${t}`);return Object.freeze(Object.fromEntries(Object.entries(e).map(([r,o])=>[r,dt(o,`${t}.${r}`)])))}function ve(e){if(e.schema!==Hr)throw new Error(`Unsupported workspace recipe schema: ${e.schema}`);let t=Et(e);if(e.operations.some(r=>r.action.trim().length===0||r.input===null||Array.isArray(r.input)))throw new Error("Workspace recipe operations require an action and object input");return Object.freeze({...t,operations:Object.freeze(e.operations.map((r,o)=>Object.freeze({action:r.action,input:dt(r.input,`operations[${o}].input`)})))})}async function Vr(e,t){let r=ve(e);return St(r,t)}async function ky(e,t){return Vr(e,async()=>{let r=[];for(let[o,n]of e.operations.entries())r.push(await t(n,o));return r})}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="c234be1c-35b7-5388-8a70-a012e9a34389")}catch{}})();var Kr="pm.agent-observation/v1",Wr="pm.agent-verdict/v1",Yr="pm.agent-episode/v1";function O(e,t){if(!Number.isSafeInteger(e)||e<=0)throw new Error(`${t} must be a positive safe integer.`)}function k(e,t){if(e.trim().length===0)throw new Error(`${t} must not be empty.`)}function ne(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let t of Object.values(e))ne(t)}return e}function xy(e){if(e.length===0)throw new Error("observation.reads must declare at least one bounded read.");let t=0;for(let r of e)if(k(r.command,"observation.reads.command"),O(r.budget_tokens,"observation.reads.budget_tokens"),t+=r.budget_tokens,!Number.isSafeInteger(t))throw new Error("observation read ceilings exceed safe integer range.")}function Ny(e){if(e.basis!=="emitted_bytes")throw new Error("observation calibration must use emitted_bytes.");for(let r of e.samples)if(!Number.isSafeInteger(r)||r<0)throw new Error("observation calibration samples must be non-negative safe integers.");if(e.samples.length===0)throw new Error("observation calibration must include at least one sample.");if(O(e.expected_emitted_bytes,"observation.calibration.expected_emitted_bytes"),!Number.isSafeInteger(e.tolerance_bytes)||e.tolerance_bytes<0)throw new Error("observation.calibration.tolerance_bytes must be a non-negative safe integer.");let t=e.samples.reduce((r,o)=>r+o,0)/e.samples.length;if(Math.abs(t-e.expected_emitted_bytes)>e.tolerance_bytes)throw new Error("observation expected_emitted_bytes is outside the calibrated sample tolerance.")}function Ly(e){if(e.length===0)throw new Error("observation.tiers must declare a degradation ladder.");let t=new Set,r=Number.POSITIVE_INFINITY;for(let o of e){if(k(o.id,"observation.tiers.id"),O(o.max_tokens,"observation.tiers.max_tokens"),t.has(o.id))throw new Error(`Duplicate observation tier: ${o.id}.`);if(t.add(o.id),o.max_tokens>r)throw new Error("observation tiers must be ordered from largest to smallest max_tokens.");r=o.max_tokens;let n=new Set;for(let s of o.fields){if(F(s,"observation.tiers.fields"),n.has(s))throw new Error(`Duplicate observation tier field: ${s}.`);n.add(s)}}}function Dy(e){if(e.schema!==Kr)throw new Error(`observation.schema must be ${Kr}.`);return k(e.id,"observation.id"),O(e.version,"observation.version"),xy(e.reads),Ny(e.calibration),e.corpus_dependence.kind==="bounded"&&(k(e.corpus_dependence.dimension,"observation.corpus_dependence.dimension"),O(e.corpus_dependence.maximum,"observation.corpus_dependence.maximum")),Ly(e.tiers),ne(structuredClone(e))}function cL(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 $y(e,t,r){O(r.budget_tokens,"observation request budget_tokens");let o=[];for(let[n,s]of e.tiers.entries()){o.push(s.id);let i=await t(s),a=Buffer.byteLength(I(i),"utf8"),d=Math.ceil(a/4);if(d<=Math.min(r.budget_tokens,s.max_tokens))return{status:"served",payload:i,receipt:{contract_id:e.id,contract_version:e.version,served_tier:s.id,degraded:n>0,attempted_tiers:o,emitted_bytes:a,estimated_tokens:d,calibration_basis:"emitted_bytes"}}}return{status:"refused",reason:"no_declared_tier_fits_budget",receipt:{contract_id:e.id,contract_version:e.version,served_tier:null,degraded:e.tiers.length>1,attempted_tiers:o,emitted_bytes:null,estimated_tokens:null,calibration_basis:"emitted_bytes"}}}function F(e,t){let r=e.split(".");if(r.some(o=>o.length===0||o==="__proto__"||o==="prototype"||o==="constructor"))throw new Error(`${t} must be a safe, non-empty dot-separated path.`);return r}function Xr(e,t){let r=e;for(let o of F(t,"recorded field path")){if(r===null||typeof r!="object"||!Object.hasOwn(r,o))return;r=r[o]}return r}function Fy(e){return`/${F(e,"verdict predicate path").map(t=>t.replaceAll("~","~0").replaceAll("/","~1")).join("/")}`}function Gy(e){if(e.kind!=="field_equals")return;let t;try{t=JSON.stringify(e.expected)}catch{throw new Error(`Expected value for verdict predicate ${e.id} must be JSON serializable.`)}if(t===void 0)throw new Error(`Expected value for verdict predicate ${e.id} must be JSON serializable.`)}function Uy(e){if(e.schema!==Wr)throw new Error(`verdict.schema must be ${Wr}.`);k(e.id,"verdict.id"),O(e.version,"verdict.version");let t=new Set;for(let o of e.predicates){k(o.id,"verdict.predicates.id"),F(o.path,"verdict.predicates.path");let n=o.kind;if(n!=="field_equals"&&n!=="field_present"&&n!=="field_absent")throw new Error(`Unsupported verdict predicate kind for ${o.id}.`);if(t.has(o.id))throw new Error(`Duplicate verdict predicate: ${o.id}.`);Gy(o),t.add(o.id)}if(e.composition.operator!=="all"&&e.composition.operator!=="any")throw new Error("verdict composition operator must be all or any.");if(e.composition.predicate_ids.length!==e.predicates.length)throw new Error("verdict composition must reference every predicate exactly once.");let r=new Set(e.composition.predicate_ids);if(r.size!==e.composition.predicate_ids.length||[...r].some(o=>!t.has(o)))throw new Error("verdict composition contains duplicate or unknown predicate ids.");return ne(structuredClone(e))}function jy(e,t){if(e.predicates.length===0)return{contract_id:e.id,contract_version:e.version,snapshot_id:t.snapshot_id,outcome:"not_applicable",score:null,policy:"verdict_only_no_reward",reason:"no_predicates_declared",predicates:[]};let r=new Map(e.predicates.map(i=>[i.id,i])),o=e.composition.predicate_ids.map(i=>{let a=r.get(i),d=Xr(t.state,a.path),c=a.kind==="field_present"?d!==void 0:a.kind==="field_absent"?d===void 0:I(d)===I(a.expected);return{id:i,outcome:c?"satisfied":"violated",evidence_pointer:`${t.snapshot_id}#${Fy(a.path)}`,evidence_digest:yt(I(d))}}),n=o.filter(i=>i.outcome==="satisfied").length,s=e.composition.operator==="all"?n===o.length:n>0;return{contract_id:e.id,contract_version:e.version,snapshot_id:t.snapshot_id,outcome:s?"satisfied":"violated",score:n/o.length,policy:"verdict_only_no_reward",predicates:o}}function lL(e){if(e.schema!==Yr)throw new Error(`episode.schema must be ${Yr}.`);if(k(e.id,"episode.id"),O(e.version,"episode.version"),!["benchmark","evaluation","training","scale_transfer"].includes(e.mode))throw new Error("episode.mode is not supported.");if(e.task_item_ids.length===0)throw new Error("episode.task_item_ids must declare at least one pm item.");for(let t of e.task_item_ids)k(t,"episode.task_item_ids");O(e.limits.max_actions,"episode.limits.max_actions"),O(e.limits.max_observations,"episode.limits.max_observations"),O(e.limits.max_tokens_per_observation,"episode.limits.max_tokens_per_observation");for(let t of e.observable_fields)F(t,"episode.observable_fields");for(let t of e.withheld_fields)F(t,"episode.withheld_fields");for(let t of e.observable_fields){let r=e.withheld_fields.find(o=>t===o||t.startsWith(`${o}.`)||o.startsWith(`${t}.`));if(r!==void 0)throw new Error(`Observable field ${t} overlaps withheld field ${r}.`)}for(let t of e.observation.tiers)for(let r of t.fields)if(!e.observable_fields.includes(r))throw new Error(`Observation tier field ${r} is not declared observable.`);return Dy(e.observation),Uy(e.verdict),ve(e.recipe),ne(structuredClone(e))}function By(e,t,r){let o=F(t,"observation projection field"),n=e;for(let[s,i]of o.entries()){if(s===o.length-1){r!==void 0&&(n[i]=structuredClone(r));return}let a=n[i];(a===null||typeof a!="object"||Array.isArray(a))&&(n[i]={}),n=n[i]}}function qy(e,t){let r={};for(let o of t)By(r,o,Xr(e,o));return r}async function pL(e,t){let r=[],o=0,n=0,s=!1,i,a={episode:{id:e.id,label:`pm agent environment v${e.version}`},provenance:{role:e.mode,topic:"agent-environment"}},d=await D(a,()=>t.reset(e.recipe));r.push({sequence:1,kind:"reset",state_id:d.state_id});let c=async()=>{if(s)throw new Error("episode is already closed.");if(n>=e.limits.max_observations)throw new Error("episode exceeded limits.max_observations.");n+=1;let p=await t.readRecordedState(),f=await $y(e.observation,async _=>qy(p.state,_.fields),{budget_tokens:e.limits.max_tokens_per_observation});return r.push({sequence:r.length+1,kind:"observation",state_id:f.receipt.served_tier??p.snapshot_id}),f},l=async(p=!1)=>{if(s&&!p)throw new Error("episode is already closed.");if(n>=e.limits.max_observations)throw new Error("episode exceeded limits.max_observations.");n+=1;let f=await t.readRecordedState(),_=jy(e.verdict,f);return r.push({sequence:r.length+1,kind:"verdict",state_id:f.snapshot_id}),_};return{observe:()=>D(a,c),step:async p=>{if(s)throw new Error("episode is already closed.");if(o>=e.limits.max_actions)throw new Error("episode exceeded limits.max_actions.");o+=1;let f=await D(a,()=>t.execute(p));return r.push({sequence:r.length+1,kind:"action",state_id:f.state_id}),f},score:()=>D(a,l),close:()=>i!==void 0?i:s?Promise.reject(new Error("episode is already closed.")):(s=!0,i=D(a,()=>l(!0)).then(p=>(r.push({sequence:r.length+1,kind:"close",state_id:p.snapshot_id}),{verdict:p,trajectory:ne(structuredClone(r))})).catch(p=>{throw s=!1,p}).finally(()=>{i=void 0}),i)}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="1202ba19-0bcb-5478-b245-4472e361d4de")}catch{}})();var G="https://schema.unbrained.dev/pm/corpus-shape/v1";function K(e,t){if(!Number.isSafeInteger(e)||e<=0)throw new TypeError(`Corpus shape ${t} must be a positive safe integer`);return e}function ie(e,t){if(!Number.isSafeInteger(e)||e<0)throw new TypeError(`Corpus shape ${t} must be a non-negative safe integer`);return e}function Zr(e){if(!(typeof e!="object"||e===null||Object.isFrozen(e))){for(let t of Object.values(e))Zr(t);Object.freeze(e)}}function W(e){if(e.schema!==G)throw new TypeError(`Unsupported corpus shape schema: ${e.schema}`);if(e.name.trim().length===0||e.description.trim().length===0)throw new TypeError("Corpus shape name and description must be non-empty");if(K(e.hierarchy_depth,"hierarchy_depth"),K(e.hierarchy_fanout,"hierarchy_fanout"),ie(e.age_span_days,"age_span_days"),K(e.history_entries_per_item,"history_entries_per_item"),ie(e.comments_per_100_items,"comments_per_100_items"),ie(e.notes_per_100_items,"notes_per_100_items"),ie(e.learnings_per_100_items,"learnings_per_100_items"),K(e.author_cardinality,"author_cardinality"),K(e.component_count,"component_count"),e.edge_kind_mix.length===0||e.edge_kind_mix.some(r=>r.kind.trim().length===0||r.weight<=0))throw new TypeError("Corpus shape edge_kind_mix requires non-empty kinds with positive weights");if(e.terminal_statuses.some(r=>!e.custom_statuses.includes(r)))throw new TypeError("Corpus shape terminal_statuses must be declared in custom_statuses");let t=structuredClone(e);return Zr(t),t}var Oe=[{kind:"implements",weight:5},{kind:"blocked_by",weight:2},{kind:"discovered_from",weight:2},{kind:"verifies",weight:2},{kind:"supersedes",weight:1},{kind:"related",weight:4}],Y=Object.freeze({scratch:W({schema:G,name:"scratch",description:"Seconds-old, shallow project with minimal history.",hierarchy_depth:2,hierarchy_fanout:50,age_span_days:0,history_entries_per_item:1,comments_per_100_items:2,notes_per_100_items:1,learnings_per_100_items:1,edge_kind_mix:[{kind:"related",weight:1}],author_cardinality:2,component_count:1,include_cycles:!1,custom_types:[],custom_statuses:[],terminal_statuses:[],custom_fields:[]}),representative:W({schema:G,name:"representative",description:"Medium-lived project with rich evidence and typed lineage.",hierarchy_depth:5,hierarchy_fanout:8,age_span_days:730,history_entries_per_item:12,comments_per_100_items:30,notes_per_100_items:12,learnings_per_100_items:10,edge_kind_mix:Oe,author_cardinality:32,component_count:1,include_cycles:!1,custom_types:["Experiment"],custom_statuses:["review"],terminal_statuses:[],custom_fields:["domain"]}),"deep-graph":W({schema:G,name:"deep-graph",description:"Deep typed relationship graph with deterministic cycles.",hierarchy_depth:16,hierarchy_fanout:2,age_span_days:3650,history_entries_per_item:6,comments_per_100_items:15,notes_per_100_items:8,learnings_per_100_items:8,edge_kind_mix:Oe,author_cardinality:16,component_count:1,include_cycles:!0,custom_types:[],custom_statuses:[],terminal_statuses:[],custom_fields:[]}),"multi-decade":W({schema:G,name:"multi-decade",description:"Thirty-year event history with dense per-item evolution.",hierarchy_depth:6,hierarchy_fanout:6,age_span_days:10958,history_entries_per_item:24,comments_per_100_items:40,notes_per_100_items:20,learnings_per_100_items:16,edge_kind_mix:Oe,author_cardinality:64,component_count:1,include_cycles:!1,custom_types:["Program"],custom_statuses:["archived"],terminal_statuses:["archived"],custom_fields:["portfolio"]}),"disconnected-archive":W({schema:G,name:"disconnected-archive",description:"Multiple disconnected historical project components.",hierarchy_depth:4,hierarchy_fanout:10,age_span_days:7305,history_entries_per_item:8,comments_per_100_items:10,notes_per_100_items:5,learnings_per_100_items:6,edge_kind_mix:Oe,author_cardinality:24,component_count:5,include_cycles:!1,custom_types:["Archive"],custom_statuses:["archived"],terminal_statuses:["archived"],custom_fields:["archive_source"]})});function zy(){return Object.keys(Y).sort().map(e=>Y[e])}function Hy(e){let t=e.trim().toLowerCase();if(!Object.hasOwn(Y,t))throw new TypeError(`Unknown corpus shape "${e}". Available: ${Object.keys(Y).join(", ")}`);return Y[t]}var Jr=new WeakMap;function Qr(e,t){if(e===0)return[];let r=Jr.get(t);r===void 0&&(r=t.edge_kind_mix.flatMap(n=>Array.from({length:n.weight},()=>n.kind)),Jr.set(t,r));let o=[r[e%r.length]];return t.include_cycles&&e>2&&e%17===0&&o.push("related"),[...new Set(o)]}function Vy(e,t,r,o=42){if(ie(t,"item index"),K(r,"item count"),t>=r)throw new RangeError(`Corpus item index ${t} exceeds ${r}`);let n=Math.min(e.component_count,r),s=t%n,i=Math.floor(t/n),a=0,d=1;for(let E=0;E<e.hierarchy_depth;E+=1)a=Math.min(Number.MAX_SAFE_INTEGER,a+d),d=Math.min(Number.MAX_SAFE_INTEGER,d*e.hierarchy_fanout);let c=i%a,l=i-c,p=c===0?void 0:s+(l+Math.floor((c-1)/e.hierarchy_fanout))*n,f=Date.UTC(2026,0,1),_=e.age_span_days*864e5,g=new Date(f+(r===1?0:Math.round(t/(r-1)*_))).toISOString(),T=(t*37+o)%100;return{index:t,id:`pm-s${t.toString(36).padStart(7,"0")}`,...p===void 0?{}:{parent:`pm-s${p.toString(36).padStart(7,"0")}`},component:s,timestamp:g,author:`pm-corpus-agent-${(t+o)%Math.min(e.author_cardinality,r)}`,history_entry_count:e.history_entries_per_item,dependency_kinds:Qr(t,e),has_comment:T<e.comments_per_100_items,has_note:T<e.notes_per_100_items,has_learning:T<e.learnings_per_100_items,...e.custom_types.length>0&&t%11===0?{custom_type:e.custom_types[t%e.custom_types.length]}:{},...e.custom_statuses.length>0&&t%13===0?{custom_status:e.custom_statuses[t%e.custom_statuses.length]}:{}}}var ct=class{shape;authors=new Set;components=new Set;depths=new Map;childCounts=new Map;edgeKinds={};expectedEdgeKinds={};annotations={comments:0,notes:0,learnings:0};annotationFields;planMismatches=[];itemCount=0;observedDepth=0;observedFanout=0;historyEntryCount=0;firstTimestamp=null;lastTimestamp=null;constructor(t){this.shape=t,this.annotationFields=[["comments","has_comment",t.comments_per_100_items],["notes","has_note",t.notes_per_100_items],["learnings","has_learning",t.learnings_per_100_items]]}recordMismatch(t,r){t&&this.planMismatches.push(r)}recordEdgeKinds(t,r){for(let o of r)t[o]=(t[o]??0)+1}add(t){this.itemCount+=1,this.authors.add(t.author),this.components.add(t.component),this.recordMismatch(this.depths.has(t.id),`duplicate_id:${t.id}`);let r=1;if(t.parent!==void 0){let o=this.depths.get(t.parent);this.recordMismatch(o===void 0,`parent_missing:${t.parent}`),r=(o??0)+1;let n=(this.childCounts.get(t.parent)??0)+1;this.childCounts.set(t.parent,n),this.observedFanout=Math.max(this.observedFanout,n)}this.depths.set(t.id,r),this.observedDepth=Math.max(this.observedDepth,r),this.historyEntryCount+=t.history_entry_count,this.recordMismatch(t.history_entry_count!==this.shape.history_entries_per_item,"history_entries_per_item:drift"),this.firstTimestamp=this.firstTimestamp===null||t.timestamp<this.firstTimestamp?t.timestamp:this.firstTimestamp,this.lastTimestamp=this.lastTimestamp===null||t.timestamp>this.lastTimestamp?t.timestamp:this.lastTimestamp;for(let[o,n]of this.annotationFields)this.annotations[o]+=Number(t[n]);this.recordEdgeKinds(this.edgeKinds,t.dependency_kinds),this.recordEdgeKinds(this.expectedEdgeKinds,Qr(t.index,this.shape))}finish(){let t=Math.min(this.shape.author_cardinality,this.itemCount),r=Math.min(this.shape.component_count,this.itemCount),o=[...this.planMismatches,...this.itemCount===0?["item_count:empty"]:[],...this.authors.size===t?[]:[`author_count:${this.authors.size}!=${t}`],...this.components.size===r?[]:[`component_count:${this.components.size}!=${r}`],...this.observedDepth<=this.shape.hierarchy_depth?[]:[`hierarchy_depth:${this.observedDepth}>${this.shape.hierarchy_depth}`],...this.observedFanout<=this.shape.hierarchy_fanout?[]:[`hierarchy_fanout:${this.observedFanout}>${this.shape.hierarchy_fanout}`]];for(let[i,,a]of this.annotationFields){let d=Math.floor(this.itemCount/100),c=this.itemCount%100,l=d*a+Math.max(0,a+c-100),p=d*a+Math.min(a,c),f=this.annotations[i];(f<l||f>p)&&o.push(`${i}:${f}!in[${l},${p}]`)}let n=new Set([...Object.keys(this.edgeKinds),...Object.keys(this.expectedEdgeKinds)]);for(let i of[...n].sort()){let a=this.edgeKinds[i]??0,d=this.expectedEdgeKinds[i]??0;a!==d&&o.push(`edge_kind:${i}:${a}!=${d}`)}let s=[...new Set(o)];return{shape:this.shape.name,item_count:this.itemCount,author_count:this.authors.size,component_count:this.components.size,hierarchy_depth:this.observedDepth,hierarchy_fanout:this.observedFanout,timestamp_range:{first:this.firstTimestamp,last:this.lastTimestamp},history_entry_count:this.historyEntryCount,annotations:{...this.annotations},edge_kinds:{...this.edgeKinds},matches_declaration:s.length===0,mismatches:s}}};function eo(e){return new ct(e)}function Ky(e,t){let r=eo(e);for(let o of t)r.add(o);return r.finish()}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="48d03e9b-14a4-545c-8e5d-5f5f2092a113")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="6a6b2905-b6b7-5b46-b87d-8b8287e37745")}catch{}})();async function Wy(){let e=Ge(process.cwd(),process.env.PM_PATH);await vt(e,(t,r)=>Ot(t,r,{apply_runtime_defaults:!0}))}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="4534b1c9-de27-5745-88f2-641b00b94714")}catch{}})();async function Yy(){await Rt()}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="c1cb8d82-20a6-5460-a0ff-f55312911218")}catch{}})();var to=["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 Jy(e,t,r){if(typeof r!="object"||r===null||Array.isArray(r))throw new TypeError(`Coverage entry ${e} has invalid ${t} counts.`);let o=r;if(typeof o.covered!="number"||typeof o.total!="number"||!Number.isInteger(o.covered)||!Number.isInteger(o.total)||o.covered<0||o.total<o.covered)throw new TypeError(`Coverage entry ${e} has invalid ${t} counts.`);return{covered:o.covered,total:o.total}}function Zy(e){if(typeof e!="object"||e===null||Array.isArray(e))throw new TypeError("Coverage summary must be a JSON object.");if(!("total"in e))throw new TypeError("Coverage summary is missing the total entry.");let t=[];for(let[r,o]of Object.entries(e)){Xy(r,o);for(let n of to){let s=Jy(r,n,o[n]),i=s.total-s.covered;i>0&&t.push({file:r,metric:n,uncovered:i,...s})}}return t}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="7e55d416-9cc3-51c5-8e56-6b5fd5c836a9")}catch{}})();var Qy=["captured_redacted","captured_verbatim"],eb=[{label:"home directory",pattern:/(?:\/home\/|\/Users\/)[^/\s"']+/u},{label:"GitHub token",pattern:/\b(?:gh[oprsu]_[A-Za-z0-9_]{20,})\b/u},{label:"npm token",pattern:/\bnpm_[A-Za-z0-9]{20,}\b/u},{label:"private key",pattern:/-----BEGIN (?:RSA |EC |OPENSSH )?PRIVATE KEY-----/u}];function v(e){return typeof e=="string"&&e.trim().length>0}function tb(e,t){if(typeof t!="object"||t===null||Array.isArray(t))return[{boundary_id:e.id,kind:"invalid_fixture",detail:`${e.fixture_path} must contain a JSON object.`}];let r=t,o=[];r.boundary_id!==e.id&&o.push({boundary_id:e.id,kind:"fixture_boundary_mismatch",detail:`${e.fixture_path} names ${String(r.boundary_id)} instead of ${e.id}.`}),(r.version!==1||!Qy.includes(r.capture_source)||!v(r.capture_provenance)||!Array.isArray(r.redactions)||!r.redactions.every(v)||!("input"in r)||!("observed"in r))&&o.push({boundary_id:e.id,kind:"invalid_fixture",detail:`${e.fixture_path} lacks captured provenance, redaction metadata, input, or observed output.`});let n=JSON.stringify(t);for(let s of eb)s.pattern.test(n)&&o.push({boundary_id:e.id,kind:"unsafe_fixture",detail:`${e.fixture_path} contains a possible ${s.label}.`});return o}function rb(e,t){let r=Date.parse(e.waiver_expires_at),o=v(e.waiver_reason)&&v(e.waiver_owner)&&e.waiver_expires_at.endsWith("Z")&&_e(e.waiver_expires_at)&&Number.isFinite(r);return{captured:0,waived:o&&r>=t?1:0,findings:o?r<t?[{boundary_id:e.id,kind:"expired_waiver",detail:`Boundary ${e.id} waiver expired at ${e.waiver_expires_at}.`}]:[]:[{boundary_id:e.id,kind:"invalid_waiver",detail:`Boundary ${e.id} waiver requires reason, owner, and an RFC 3339 UTC expiry.`}]}}function ob(e,t,r){if(!v(e.id)||!v(e.producer)||!v(e.consumer)||!v(e.format))return{captured:0,waived:0,findings:[{boundary_id:v(e.id)?e.id:"unknown",kind:"invalid_boundary",detail:"Each boundary requires non-empty id, producer, consumer, and format."}]};if("fixture_path"in e){let o=t[e.fixture_path],n=v(e.fixture_path)&&e.fixture_path in t?tb(e,o):[{boundary_id:e.id,kind:"missing_fixture",detail:`Boundary ${e.id} fixture ${String(e.fixture_path)} is missing.`}];return{captured:n.length===0?1:0,waived:0,findings:n}}return rb(e,r)}function RL(e,t,r=new Date){let o=[];if(e.version!==1||!v(e.inventory_scope)||!Array.isArray(e.boundaries))return{ok:!1,boundary_count:0,captured_count:0,waived_count:0,findings:[{boundary_id:"registry",kind:"invalid_registry",detail:"Boundary registry requires version 1, inventory_scope, and boundaries."}]};let n=new Set,s=0,i=0;for(let a of e.boundaries){if(typeof a!="object"||a===null||Array.isArray(a)){o.push({boundary_id:"unknown",kind:"invalid_boundary",detail:"Each boundary must be a JSON object."});continue}let d=a,c=v(d.id)?d.id:void 0;if(c!==void 0&&n.has(c)){o.push({boundary_id:c,kind:"duplicate_boundary",detail:`Boundary ${c} is inventoried more than once.`});continue}c!==void 0&&n.add(c);let l=ob(d,t,r.getTime());s+=l.captured,i+=l.waived,o.push(...l.findings)}return o.sort((a,d)=>a.boundary_id!==d.boundary_id?a.boundary_id.localeCompare(d.boundary_id):a.kind.localeCompare(d.kind)),{ok:o.length===0,boundary_count:e.boundaries.length,captured_count:s,waived_count:i,findings:o}}import X from"node:fs";import lt from"node:path";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="aacf5738-098d-50f9-b619-19e472b577ea")}catch{}})();var ro=300*1e3,nb=3;function xL(e){return(e?.trim()||"development").replace(/[^a-zA-Z0-9._-]/g,"_").replace(/^\./,"_")}function NL(e,t){let r=t.trim();if(!/^[a-zA-Z0-9_-][a-zA-Z0-9._-]*$/.test(r))throw new TypeError("Compile-cache generation must be a safe non-empty filename token.");X.mkdirSync(e,{recursive:!0});let o=lt.join(e,r);X.mkdirSync(o,{recursive:!0});let n=new Date;X.utimesSync(o,n,n);let s=X.readdirSync(e).filter(c=>c!==r).flatMap(c=>{try{return[{name:c,mtimeMs:X.statSync(lt.join(e,c)).mtimeMs}]}catch(l){if(l instanceof Error&&"code"in l&&fe(l))return[];throw l}}).sort((c,l)=>l.mtimeMs-c.mtimeMs||c.name.localeCompare(l.name)),i=s.filter(c=>n.getTime()-c.mtimeMs<ro),a=Math.max(0,nb-1-i.length),d=s.filter(c=>n.getTime()-c.mtimeMs>=ro).slice(a).map(c=>c.name).sort((c,l)=>c.localeCompare(l));for(let c of d)X.rmSync(lt.join(e,c),{recursive:!0,force:!0,maxRetries:3,retryDelay:50});return{retained:r,removed:d}}import{createHash as ib}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="ff60bc5b-bd85-5b3c-9a55-21e7e72477ac")}catch{}})();var pt=1;function J(e){e?.throwIfAborted()}function U(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship graph ${t} must be non-empty`);return e.trim()}function Z(e,t,r={}){let o=Date.parse(r.createdAt??new Date().toISOString());if(!Number.isFinite(o))throw new TypeError("Relationship graph createdAt must be a valid timestamp");let n=e.nodes(),s=e.edges(),i=t.list();return Object.freeze({version:pt,fingerprint:ib("sha256").update(I({nodes:n,edges:s,kinds:i})).digest("hex"),created_at:new Date(o).toISOString(),nodes:n,edges:s,kinds:i})}function sb(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ae(e){if(!sb(e))throw new TypeError("Relationship graph snapshot must be an object");if(e.version!==pt)throw new TypeError(`Unsupported relationship graph snapshot version: ${String(e.version)}`);if(!Array.isArray(e.nodes)||e.nodes.some(n=>typeof n!="string"))throw new TypeError("Relationship graph snapshot nodes must be strings");if(!Array.isArray(e.edges)||!Array.isArray(e.kinds))throw new TypeError("Relationship graph snapshot edges and kinds must be arrays");if(typeof e.created_at!="string"||!Number.isFinite(Date.parse(e.created_at)))throw new TypeError("Relationship graph snapshot created_at must be valid");if(typeof e.fingerprint!="string")throw new TypeError("Relationship graph snapshot fingerprint must be a string");let t=new Ue([]);for(let n of e.kinds)t.register(n);let r=new z(e.nodes,e.edges,t),o=Z(r,t,{createdAt:e.created_at});if(o.fingerprint!==e.fingerprint)throw new TypeError("Relationship graph snapshot fingerprint mismatch");return{snapshot:o,registry:t,graph:r}}async function x(e,t){U(e.name,"adapter name");let r=U(t.workspace,"workspace");J(t.signal);let o=await e.read({...t,workspace:r});return J(t.signal),o===null?null:ae(o)}async function Re(e,t){let r=U(t.workspace,"workspace"),o=ae(t.snapshot).snapshot,n=await x(e,{workspace:r,signal:t.signal});if(n?.snapshot.fingerprint===o.fingerprint)return{adapter:e.name,workspace:r,disposition:"current",fingerprint:o.fingerprint,previous_fingerprint:n.snapshot.fingerprint,node_count:o.nodes.length,edge_count:o.edges.length};if(J(t.signal),await e.replace({workspace:r,signal:t.signal,snapshot:o,expected_fingerprint:n?.snapshot.fingerprint??null}),(await x(e,{workspace:r,signal:t.signal}))?.snapshot.fingerprint!==o.fingerprint)throw new Error(`Relationship graph adapter "${e.name}" did not expose the replaced snapshot`);return{adapter:e.name,workspace:r,disposition:"written",fingerprint:o.fingerprint,...n?{previous_fingerprint:n.snapshot.fingerprint}:{},node_count:o.nodes.length,edge_count:o.edges.length}}function ab(e,t={}){let r=e.map(ae),o=new Map;for(let i of r)for(let a of i.snapshot.kinds){let d=o.get(a.kind);if(d&&I(d)!==I(a))throw new TypeError(`Conflicting federated relationship kind: ${a.kind}`);o.set(a.kind,a)}let n=new Ue([...o.values()].sort((i,a)=>i.kind.localeCompare(a.kind))),s=new z(new Set(r.flatMap(i=>[...i.snapshot.nodes])),r.flatMap(i=>[...i.snapshot.edges]),n);return Z(s,n,t)}var se=class{name;#e=new Map;constructor(t="memory"){this.name=U(t,"adapter name")}async read(t){J(t.signal);let r=this.#e.get(U(t.workspace,"workspace"));return r?structuredClone(r):null}async replace(t){J(t.signal);let r=U(t.workspace,"workspace"),o=this.#e.get(r);if(t.expected_fingerprint!==void 0&&(o?.fingerprint??null)!==t.expected_fingerprint)throw new Error(`Relationship graph adapter conflict for ${r}`);this.#e.set(r,structuredClone(ae(t.snapshot).snapshot))}async clear(t){J(t.signal);let r=U(t.workspace,"workspace"),o=this.#e.get(r);if(t.expected_fingerprint!==void 0&&(o?.fingerprint??null)!==t.expected_fingerprint)throw new Error(`Relationship graph adapter conflict for ${r}`);this.#e.delete(r)}};(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="e47f9bb8-f98e-5159-9116-29c3e6fedfc3")}catch{}})();function oo(e,t){if(!Number.isInteger(e)||e<1)throw new TypeError(`Relationship graph ${t} must be a positive integer`);return e}function db(e){let t=oo(e.nodeCount,"nodeCount"),r=oo(e.edgeStride??1,"edgeStride"),o=e.topology??"chain";if(!["chain","star","disconnected"].includes(o))throw new TypeError(`Unsupported relationship graph topology: ${o}`);let n=(e.kind??"related").trim(),s=(e.idPrefix??"node").trim();if(!n||!s)throw new TypeError("Relationship graph kind and idPrefix must be non-empty");let i=o==="disconnected"?0:Math.floor((t-1)/r);return{node_count:t,edge_count:i,edge_basis:"fixture_generated",nodes:{*[Symbol.iterator](){for(let a=0;a<t;a+=1)yield`${s}-${a}`}},edges:{*[Symbol.iterator](){if(o!=="disconnected")for(let a=r;a<t;a+=r)yield{source:`${s}-${o==="star"?0:a-r}`,target:`${s}-${a}`,kind:n}}}}}function j(e,t){if(!e)throw new Error(`Relationship graph adapter conformance: ${t}`)}async function no(e,t={}){let r=t.workspace?.trim()||"pm-graph-conformance",o=wt(),n=Z(new z(["a","b"],[{source:"a",target:"b",kind:"related"}],o),o,{createdAt:"2026-01-01T00:00:00.000Z"}),s=Z(new z(["a","b","c"],[{source:"a",target:"b",kind:"related"},{source:"b",target:"c",kind:"blocked_by"}],o),o,{createdAt:"2026-01-02T00:00:00.000Z"}),i=[];j(await x(e,{workspace:r})===null,"workspace must start empty"),i.push({name:"empty-read",passed:!0});let a=await Re(e,{workspace:r,snapshot:n});j(a.disposition==="written","first sync must write"),i.push({name:"atomic-replace",passed:!0}),(await e.read({workspace:r})).nodes.push("mutated-reader-copy"),j((await x(e,{workspace:r}))?.snapshot.nodes.length===2,"reads must not mutate stored state"),i.push({name:"read-isolation",passed:!0}),j((await Re(e,{workspace:r,snapshot:n})).disposition==="current","identical sync must be idempotent"),i.push({name:"idempotent-sync",passed:!0}),await e.replace({workspace:r,snapshot:s,expected_fingerprint:n.fingerprint}),j((await x(e,{workspace:r}))?.snapshot.fingerprint===s.fingerprint,"replacement must become visible"),i.push({name:"replacement-visibility",passed:!0});let d=!1;try{await e.replace({workspace:r,snapshot:n,expected_fingerprint:n.fingerprint})}catch{d=!0}return j(d,"stale compare-and-swap must fail"),i.push({name:"stale-cas",passed:!0}),e.clear&&(await e.clear({workspace:r,expected_fingerprint:s.fingerprint}),j(await x(e,{workspace:r})===null,"clear must remove the workspace"),i.push({name:"clear",passed:!0})),{adapter:e.name,workspace:r,cases:Object.freeze(i),clear_supported:e.clear!==void 0}}function cb(e){return no(new se,e?{workspace:e}:{})}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="58736688-35d0-545d-892e-e0ede7fedc1a")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="d45a8203-4501-5797-a6cc-a2e7844adec9")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="f5567aa1-0268-574d-907b-38d6249538ce")}catch{}})();var ut=2,lb=["self_reported","independent_transport"];function Ie(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function de(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`${t} must be a non-empty string`);return e.trim()}function io(e,t,r=!1){if(!Array.isArray(e)||e.length===0)throw new TypeError(`${t} must be a non-empty string array`);return e.map((o,n)=>{let s=de(o,`${t}[${String(n)}]`);return r?o:s})}function mt(e,t){return e===void 0?void 0:de(e,t)}function pb(e,t){if(e===void 0)return;if(!Ie(e)||Object.keys(e).length===0)throw new TypeError(`${t} must be a non-empty object`);let r=Object.entries(e).map(([o,n])=>{if(o.length===0||o.split(".").some(s=>s.length===0))throw new TypeError(`${t} must use dot-separated own-property paths`);if(n!==null&&typeof n!="string"&&typeof n!="boolean"&&(typeof n!="number"||!Number.isFinite(n)))throw new TypeError(`${t} values must be JSON primitives`);return[o,n]});return Object.fromEntries(r)}function ub(e,t,r,o,n,s){if(o==="refusal"){if(We(r)||n===void 0||s===void 0)throw new TypeError(`${e} refusal steps require a non-success exit, error code, and refusal surface`);return}if(n!==void 0||s!==void 0)throw new TypeError(`${e} only refusal steps may declare expected_error_code or expected_refusal_surface`);let i=bt(t);if(i===void 0)throw new TypeError(`${e}.args must identify a command after global flags`);let a=t[i].trim().toLowerCase();if(a==="history"){let l=Tt(t.slice(i+1));l!==void 0&&(a=Le(`history ${l}`))}let d=Dt(a);if(!We(r)||r!==0&&!d?.exit_codes.some(l=>l===r))throw new TypeError(`${e} successful output must use exit code 0 or a command-declared successful effect exit`);let c=Lt(a).kind;if(o!==c)throw new TypeError(`${e} expected ${o}, but ${a} declares ${c}`)}function mb(e,t,r){if(!Ie(e))throw new TypeError(`tasks.${t}.steps[${String(r)}] must be an object`);let o=`tasks.${t}.steps[${String(r)}]`,n=de(e.id,`${o}.id`),s=io(e.args,`${o}.args`,!0),i=e.expected_exit_code;if(typeof i!="number"||!Number.isSafeInteger(i))throw new TypeError(`${o}.expected_exit_code must be a safe integer`);let a=e.expected_output_kind;if(a!=="refusal"&&!Nt.includes(a))throw new TypeError(`${o}.expected_output_kind is unsupported`);let d=a,c=e.expected_accounting_mode;if(!lb.includes(c))throw new TypeError(`${o}.expected_accounting_mode is unsupported`);let l=c;if(l==="independent_transport"&&d!=="refusal")throw new TypeError(`${o} independent_transport accounting is supported only for refusal steps`);let p=io(e.required_fields,`${o}.required_fields`);if(p.some(E=>E.split(".").some(q=>q.length===0)))throw new TypeError(`${o}.required_fields must contain dot-separated own-property paths`);let f=pb(e.expected_field_values,`${o}.expected_field_values`),_=mt(e.expected_error_code,`${o}.expected_error_code`),g=mt(e.expected_refusal_surface,`${o}.expected_refusal_surface`),T=mt(e.recovery_for,`${o}.recovery_for`);return ub(o,s,i,d,_,g),{id:n,args:s,expected_exit_code:i,expected_output_kind:d,expected_accounting_mode:l,required_fields:p,...f?{expected_field_values:f}:{},..._?{expected_error_code:_}:{},...g?{expected_refusal_surface:g}:{},...T?{recovery_for:T}:{}}}function fb(e,t){if(!Ie(e))throw new TypeError(`tasks[${String(t)}] must be an object`);let r=de(e.id,`tasks[${String(t)}].id`),o=de(e.description,`tasks.${r}.description`);if(!Array.isArray(e.steps)||e.steps.length===0)throw new TypeError(`tasks.${r}.steps must be a non-empty array`);let n=e.steps.map((i,a)=>mb(i,r,a)),s=new Map;for(let i of n){if(s.has(i.id))throw new TypeError(`tasks.${r} contains duplicate step id ${i.id}`);if(i.recovery_for!==void 0&&(s.get(i.recovery_for)?.expected_output_kind!=="refusal"||i.expected_output_kind==="refusal"))throw new TypeError(`tasks.${r}.${i.id} recovery_for must reference an earlier refusal and declare successful output`);s.set(i.id,i)}if(n.at(-1)?.expected_output_kind==="refusal")throw new TypeError(`tasks.${r} completed task must terminate with successful output`);for(let i of n)if(i.expected_output_kind==="refusal"&&!n.some(a=>a.recovery_for===i.id))throw new TypeError(`tasks.${r}.${i.id} refusal must have a later successful recovery_for step`);return{id:r,description:o,steps:n}}function pD(e){if(!Ie(e))throw new TypeError("agent-task transcript corpus must be an object");if(e.version!==ut)throw new TypeError(`agent-task transcript corpus version must be ${String(ut)}`);if(!Array.isArray(e.tasks)||e.tasks.length===0)throw new TypeError("agent-task transcript corpus tasks must be non-empty");let t=e.tasks.map((o,n)=>fb(o,n)),r=new Set;for(let o of t){if(r.has(o.id))throw new TypeError(`duplicate agent-task transcript id ${o.id}`);r.add(o.id)}return{version:ut,tasks:t}}import{createHash as so}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="7163a078-d8be-5bca-813f-c941fcb8e406")}catch{}})();function ao(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship backfill ${t} must be non-empty`);return e.trim()}function _D(e,t){let r=ao(t.migrationId,"migrationId"),o=ao(t.author,"author"),n=Date.parse(t.timestamp);if(!Number.isFinite(n))throw new TypeError("Relationship backfill timestamp must be valid");let s=new Date(n).toISOString(),i=He(e,void 0,t.registry),a=i.graph.nodes(),d=i.graph.edges().map(f=>{let _=so("sha256").update(JSON.stringify([r,f.kind,f.source,f.target,f.createdAt??null,f.author??null,f.payload??null])).digest("hex").slice(0,24);return Object.freeze({eventId:`backfill:${r}:${_}`,relationshipId:`migration:${r}:${_}`,action:"add",edge:f,author:o,timestamp:s,reason:`Backfill ${r} from legacy item metadata`})}),c=so("sha256").update(JSON.stringify({migrationId:r,nodes:a,events:d})).digest("hex"),l=new Set([...t.existingEventIds??[]].filter(f=>typeof f=="string").map(f=>f.trim()).filter(Boolean)),p=d.filter(f=>!l.has(f.eventId));return Object.freeze({migration_id:r,fingerprint:c,nodes:a,events:Object.freeze(p),edge_count:d.length,skipped_existing_count:d.length-p.length,duplicate_dependency_rows:i.duplicateRows.length,dangling_reference_count:i.dangling.active.length+i.dangling.legacy_terminal.length})}import*as co from"node:module";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="7a1d7194-6ff1-5365-ab64-80b47b0176d7")}catch{}})();var ce=["suggested_retry","candidate_command","example","next_step","migration_hint","restore_with"],ft={suggested_retry:{kind:"suggested_retry",semantics:"recovery"},retry_command:{kind:"suggested_retry",semantics:"recovery"},candidate_command:{kind:"candidate_command",semantics:"recovery"},candidate_commands:{kind:"candidate_command",semantics:"recovery"},fallback_candidates:{kind:"candidate_command",semantics:"recovery",nested_value_field:"command"},next_best_command:{kind:"candidate_command",semantics:"recovery"},example:{kind:"example",semantics:"recovery"},examples:{kind:"example",semantics:"recovery"},next_step:{kind:"next_step",semantics:"recovery"},next_steps:{kind:"next_step",semantics:"recovery"},suggested_next_steps:{kind:"next_step",semantics:"recovery"},migration_hint:{kind:"migration_hint",semantics:"replacement"},migration_hints:{kind:"migration_hint",semantics:"replacement"},restore_with:{kind:"restore_with",semantics:"behavior_preserving"}},gD=Object.freeze(Object.keys(ft));function lo(e){if(Object.hasOwn(ft,e))return ft[e]}var _b=new Set([..."=([{,:;!?&|+-*%^~<>","=>"]);function Q(e,t){return e<t?-1:e>t?1:0}function hb(e,t){let r=e[t],o=t+1,n="";for(;o<e.length&&e[o]!==r;)e[o]==="\\"?o+=2:(n+=e[o],o+=1);return e[o]===r&&(o+=1),{next:o,value:n}}function gb(e){return e===void 0||e.kind==="punctuator"&&_b.has(e.value)||e.kind==="identifier"&&["return","case","throw","else","yield"].includes(e.value)}function yb(e,t){if(/\s/u.test(e[t]))return t+1;if(e.startsWith("//",t)){let r=e.indexOf(`
31
- `,t+2);return r===-1?e.length:r+1}if(e.startsWith("/*",t))return e.indexOf("*/",t+2)+2}function bb(e,t,r){if(e[t]!=="/"||!gb(r))return;let o=t+1,n=!1;for(;o<e.length;)if(e[o]==="\\")o+=2;else if(e[o]==="[")n=!0,o+=1;else if(e[o]==="]")n=!1,o+=1;else if(e[o]==="/"&&!n){for(o+=1;/[A-Za-z]/u.test(e.charAt(o));)o+=1;return o}else o+=1;return o}function Tb(e,t){let r=e[t];if(r==="'"||r==='"'||r==="`"){let n=hb(e,t);return r==="`"?{next:n.next}:{next:n.next,token:{kind:"string",value:n.value,offset:t+1}}}if(/[A-Za-z_$]/u.test(r)){let n=t+1;for(;/[A-Za-z0-9_$]/u.test(e[n]??"");)n+=1;return{next:n,token:{kind:"identifier",value:e.slice(t,n),offset:t}}}let o=e.startsWith("=>",t)?"=>":r;return{next:t+o.length,token:{kind:"punctuator",value:o,offset:t}}}function Cb(e){let t=[],r=0;for(;r<e.length;){let o=yb(e,r);if(o!==void 0){r=o;continue}let n=bb(e,r,t.at(-1));if(n!==void 0){r=n;continue}let s=Tb(e,r);s.token&&t.push(s.token),r=s.next}return t}var Eb=new Set(["object","block","pattern"]),Sb=new Set(["const","let","var"]),wb=new Set(["}",")","]"]),Ab=new Set(["=","(","[",",",":","?","return"]);function vb(e,t,r){if([...r].reverse().find(n=>Eb.has(n.kind))?.kind==="pattern"||r.at(-1)?.kind==="paren"&&r.at(-1)?.parameter_list)return"pattern";let o=e[t-1];return o?.kind==="identifier"&&Sb.has(o.value)?"pattern":o?.value==="=>"||o?.value===")"?"block":o&&Ab.has(o.value)?"object":"block"}function Ob(e,t,r){let o=e[t];if(o.value==="{"){let i=vb(e,t,r);return{kind:i,...i==="object"?{member_start:!0,candidates:[]}:{}}}if(o.value==="[")return{kind:"array"};if(o.value!=="(")return;let n=e[t-1],s=e[t-2];return{kind:"paren",...n?.value==="function"||s?.value==="function"?{parameter_list:!0}:{}}}function Rb(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 Ib(e,t){return e[t+1]?.value===")"&&e[t+2]?.value==="=>"||e[t+1]?.value==="="}function Pb(e){let t=Cb(co.stripTypeScriptTypes(e,{mode:"strip"})),r=[],o=[];for(let[n,s]of t.entries()){let i=o.at(-1),a=Rb(i,s,t[n+1]);a&&i.candidates.push(a);let d=Ob(t,n,o);if(d)o.push(d);else if(wb.has(s.value)){let c=o.pop();c?.kind==="object"&&!Ib(t,n)&&r.push(...c.candidates)}else s.value===","&&i?.kind==="object"?i.member_start=!0:i?.kind==="object"&&s.value!==":"&&(i.member_start=!1)}return r}function Mb(e){let t=[0];for(let r=0;r<e.length;r+=1)e[r]===`
32
- `&&t.push(r+1);return t}function kb(e,t){let r=0,o=e.length;for(;r<o;){let n=Math.floor((r+o)/2);e[n]<=t?r=n+1:o=n}return r}function yD(e){let t=[],r=[];for(let n of[...e].sort((s,i)=>Q(s.path,i.path))){let s=Mb(n.content),i;try{i=Pb(n.content)}catch(a){r.push({kind:"invalid_source",subject:n.path,detail:`${n.path} could not be parsed for recovery producers: ${String(a)}.`});continue}for(let a of i){let d=a.field,c=kb(s,a.offset),l=lo(d);l?t.push({path:n.path,line:c,field:d,kind:l.kind}):/(?:retry_command|candidate_command|fallback_candidate|next_best_command|example|next_step|migration_hint|restore_with)/u.test(d)&&!/(?:_total|_truncated)$/u.test(d)&&r.push({kind:"unknown_recovery_field",subject:`${n.path}:${c}:${d}`,detail:`${d} resembles a recovery reference but has no typed field contract.`})}}let o=Object.fromEntries(ce.map(n=>[n,t.filter(s=>s.kind===n).length]));for(let n of ce)o[n]===0&&r.push({kind:"missing_kind_producer",subject:n,detail:`No source producer emits the ${n} recovery-reference kind.`});return t.sort((n,s)=>n.path!==s.path?Q(n.path,s.path):n.line!==s.line?n.line-s.line:Q(n.field,s.field)),r.sort((n,s)=>n.subject!==s.subject?Q(n.subject,s.subject):Q(n.kind,s.kind)),{ok:r.length===0,scanned_file_count:e.length,producer_count:t.length,producer_count_by_kind:o,producers:t,findings:r}}function bD(e,t){let r=[],o=(n,s)=>{if(Array.isArray(n)){n.forEach((i,a)=>o(i,[...s,String(a)]));return}if(!(typeof n!="object"||n===null))for(let[i,a]of Object.entries(n).sort(([d],[c])=>Q(d,c))){let d=lo(i),c=d?.kind==="migration_hint"&&n.semantics==="behavior_preserving"?{...d,semantics:"behavior_preserving"}:d,l=[a].flat();c!==void 0&&l.forEach((p,f)=>{let _="nested_value_field"in c&&typeof c.nested_value_field=="string"?c.nested_value_field:void 0,g=_&&typeof p=="object"&&p!==null&&!Array.isArray(p)?p[_]:p;if(typeof g!="string"||g.trim().length===0)return;let T=[...s,i,String(f)].map(E=>encodeURIComponent(E)).join("/");r.push({id:`${e}:${c.kind}:${T}`,probe_id:e,kind:c.kind,semantics:c.semantics,value:g})}),o(a,[...s,i])}};return o(t,[]),r}function TD(e,t){let r=e.flatMap(i=>(i.owned_states??[]).map(a=>({contract:i,state:a}))),o=[],n=new Map;for(let i of t){if(n.has(i.probe_id)){o.push({kind:"duplicate_probe",probe_id:i.probe_id,detail:`Observation ${i.probe_id} was supplied more than once.`});continue}n.set(i.probe_id,i)}let s=new Set(r.map(({state:i})=>i.probe_id));for(let{contract:i,state:a}of r){let d=n.get(a.probe_id);if(!d){o.push({kind:"missing_probe",probe_id:a.probe_id,detail:`No entrypoint observation was recorded for ${i.code}.`});continue}d.code!==i.code&&o.push({kind:"wrong_error_code",probe_id:a.probe_id,detail:`Expected ${i.code}; observed ${d.code}.`}),d.exit_class!==a.expected_exit_class&&o.push({kind:"wrong_exit_class",probe_id:a.probe_id,detail:`Expected ${a.expected_exit_class}; observed ${d.exit_class}.`}),a.entrypoints.includes(d.entrypoint)||o.push({kind:"wrong_entrypoint",probe_id:a.probe_id,detail:`Expected one of ${a.entrypoints.join(", ")}; observed ${d.entrypoint}.`})}for(let i of t)s.has(i.probe_id)||o.push({kind:"undeclared_probe",probe_id:i.probe_id,detail:`Observation ${i.probe_id} has no catalog declaration.`});return o.sort((i,a)=>i.probe_id!==a.probe_id?i.probe_id.localeCompare(a.probe_id):i.kind.localeCompare(a.kind)),{ok:o.length===0,declared_probe_count:r.length,observed_probe_count:t.length,findings:o}}function CD(e,t){let r=[],o=new Set,n=new Set;for(let d of e){if(o.has(d.id)){n.add(d.id),r.push({kind:"duplicate_obligation",reference_id:d.id,detail:`Recovery obligation ${d.id} was declared more than once.`});continue}o.add(d.id)}let s=new Map;for(let d of t){if(s.has(d.id)){r.push({kind:"duplicate_observation",reference_id:d.id,detail:`Recovery reference ${d.id} was observed more than once.`});continue}s.set(d.id,d),o.has(d.id)||r.push({kind:"undeclared_observation",reference_id:d.id,detail:`Recovery observation ${d.id} has no emitted obligation.`})}for(let d of e){if(n.has(d.id))continue;let c=s.get(d.id);c?c.reachable?c.semantics!==d.semantics&&r.push({kind:"wrong_semantics",reference_id:d.id,detail:`Recovery reference ${d.value} promised ${d.semantics}; proof demonstrated ${c.semantics}.`}):r.push({kind:"unreachable_reference",reference_id:d.id,detail:`Recovery reference ${d.value} did not reach its promised target.`}):r.push({kind:"missing_observation",reference_id:d.id,detail:`No reachability proof was recorded for ${d.kind} ${d.value}.`})}let i=ce.map(d=>{let c=e.filter(p=>p.kind===d),l=c.filter(p=>!n.has(p.id)).map(p=>s.get(p.id)).filter(p=>p!==void 0);return{kind:d,declared:c.length,observed:l.length,passed:c.filter(p=>{let f=s.get(p.id);return!n.has(p.id)&&f?.reachable===!0&&f.semantics===p.semantics}).length}});r.sort((d,c)=>d.reference_id!==c.reference_id?d.reference_id.localeCompare(c.reference_id):d.kind.localeCompare(c.kind));let a=i.reduce((d,c)=>d+c.passed,0);return{ok:r.length===0,declared_reference_count:e.length,observed_reference_count:t.length,pass_fraction:o.size===0?1:a/o.size,coverage_by_kind:i,findings:r}}function xb(e,t){let r=new Map(ce.map(s=>[s,new Set]));for(let s of t)r.get(s.kind).add(s.value);let o=ce.map(s=>({kind:s,source_producers:e.producer_count_by_kind[s],runtime_values:r.get(s).size})),n=o.filter(({source_producers:s,runtime_values:i})=>s>0&&i===0).map(({kind:s})=>s);return{ok:e.ok&&n.length===0,source_producer_count:e.producer_count,runtime_value_count:o.reduce((s,{runtime_values:i})=>s+i,0),coverage_by_kind:o,missing_runtime_kinds:n}}var ED=xb;(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="2b2197f3-7203-52c8-9cc7-f714b33a9306")}catch{}})();var wD=16,Nb=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"]),po=18,uo=Object.freeze([...Nb,"manifest_unknown_key","no_version_bounds_declared"].sort((e,t)=>e.localeCompare(t)));function AD(e,t=po){return{ok:e.executable_error_code_count>=t,baseline:t,actual:e.executable_error_code_count}}function vD(e,t=uo){let r=new Set(e.rows.filter(({disposition:n})=>n==="executable").map(({canonical_code:n})=>n)),o=t.filter(n=>!r.has(n));return{ok:o.length===0,required_canonical_codes:[...t],missing_required_canonical_codes:o}}function _t(e,t){let r=e.get(t);if(r)return r;let o={kinds:new Set,probeIds:new Set};return e.set(t,o),o}function OD(e,t,r){let o=new Map(e.map(l=>[l.code,l.canonical_code??l.code])),n=new Map,s=0,i=0;for(let l of e){let p=_t(n,l.canonical_code??l.code);for(let f of l.owned_states??[])p.kinds.add("owned_state"),p.probeIds.add(f.probe_id)}for(let l of t){let p=o.get(l.error_code);if(p===void 0)continue;s+=1;let f=_t(n,p);f.kinds.add("closed_domain"),f.probeIds.add(l.probe_id)}for(let l of r){let p=o.get(l.error_code);if(p===void 0)continue;i+=1;let f=_t(n,p);f.kinds.add("grammar"),f.probeIds.add(l.probe_id)}let a=e.map(l=>{let p=l.canonical_code??l.code,f=n.get(p),_=[...f.probeIds].sort();return{code:l.code,canonical_code:p,disposition:_.length>0?"executable":"uncovered",evidence_kinds:[...f.kinds].sort(),probe_ids:_}}).sort((l,p)=>l.code<p.code?-1:1),d=a.filter(({disposition:l})=>l==="uncovered").map(({code:l})=>l),c=a.length-d.length;return{ok:d.length===0,catalog_error_code_count:a.length,executable_error_code_count:c,uncovered_error_code_count:d.length,coverage_fraction:a.length===0?1:c/a.length,closed_domain_probe_count:s,grammar_probe_count:i,uncovered_error_codes:d,rows:a}}function RD(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: ${po}`,`- Required executable canonical codes: ${uo.map(r=>`\`${r}\``).join(", ")}`,`- Uncovered error codes: ${e.uncovered_error_code_count}`,`- Coverage fraction: ${e.coverage_fraction.toFixed(6)}`,`- Closed-domain probes: ${e.closed_domain_probe_count}`,`- Grammar probes: ${e.grammar_probe_count}`,"","| Error code | Canonical code | Disposition | Evidence kinds | Probe count |","| --- | --- | --- | --- | --- |",...t,""].join(`
33
- `)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="d252409d-e33e-5c9e-9671-789f0ee87312")}catch{}})();function Lb(e){return[e.expected_error_code!==void 0&&e.error_code!==e.expected_error_code?{code:"error_code_mismatch",probe_id:e.probe_id,detail:`Expected error code ${e.expected_error_code}, received ${e.error_code??"<missing>"}.`}:void 0,e.expected_allowed_values!==void 0&&JSON.stringify([...e.allowed_values].sort())!==JSON.stringify([...e.expected_allowed_values].sort())?{code:"incomplete_allowed_values",probe_id:e.probe_id,detail:"The refusal's accepted domain differs from the SDK-owned domain contract."}:void 0,e.expected_suggested_retry_args!==void 0&&(e.suggested_retry_args?.length??0)===0?{code:"missing_suggested_retry_args",probe_id:e.probe_id,detail:"The refusal omitted shell-free suggested retry arguments."}:void 0,e.expected_suggested_retry_args!==void 0&&(e.suggested_retry_args?.length??0)>0&&JSON.stringify(e.suggested_retry_args)!==JSON.stringify(e.expected_suggested_retry_args)?{code:"suggested_retry_args_mismatch",probe_id:e.probe_id,detail:"The refusal's suggested retry arguments differ from the SDK-owned contract."}:void 0]}function Db(e){return[e.exit_code!==me.USAGE?{code:"non_refusal_exit",probe_id:e.probe_id,detail:`${e.entrypoint} returned exit code ${e.exit_code}; a structured usage refusal must return ${me.USAGE}.`}:void 0,e.allowed_values_required!==!1&&e.allowed_values.length===0?{code:"missing_allowed_values",probe_id:e.probe_id,detail:"The refusal omitted its complete accepted value domain."}:void 0,e.allowed_values.includes(e.rejected_value)?{code:"accepted_rejected_value",probe_id:e.probe_id,detail:`${e.rejected_value} is both rejected and advertised as allowed.`}:void 0,e.suggested_retry.trim().length===0?{code:"missing_suggested_retry",probe_id:e.probe_id,detail:"The refusal omitted an executable suggested retry."}:void 0,e.retry_succeeded?void 0:{code:"retry_failed",probe_id:e.probe_id,detail:"The advertised suggested retry did not succeed."},...Lb(e)]}function MD(e){let t=[],r=new Set,o=0;e.length===0&&t.push({code:"empty_corpus",probe_id:"corpus",detail:"At least one real refusal observation is required."});for(let n of e){if(r.has(n.probe_id)){t.push({code:"duplicate_probe",probe_id:n.probe_id,detail:`${n.probe_id} was supplied more than once.`});continue}r.add(n.probe_id);let s=t.length;for(let i of Db(n))i!==void 0&&t.push(i);t.length===s&&(o+=1)}return t.sort((n,s)=>n.probe_id!==s.probe_id?n.probe_id.localeCompare(s.probe_id):n.code.localeCompare(s.code)),{ok:t.length===0,probe_count:r.size,closed_probe_count:o,closure_fraction:r.size===0?0:o/r.size,findings:t}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="39b4e1fe-a34a-5ffc-9447-eaf8c46863c7")}catch{}})();var mo="not-a-declared-action";function $b(e,t){if(e.startsWith("assurance ")&&t.name==="kind")return"measurement";switch(t.value_kind){case"integer":return"1";case"item_id":return"pm-domain";case"action":throw new Error(`Cannot synthesize a preceding action value for positional slot ${t.name}.`);default:return"example"}}function le(e){return e.replaceAll(/[^a-z0-9]+/gu,"-").replaceAll(/^-|-$/gu,"")}function UD(e=qe.filter(t=>It.some(r=>r.command===t.command&&r.disposition!=="package_owned"))){let t=new Set(e.filter(({command:r})=>!r.includes(" ")).map(({command:r})=>le(r)));return e.flatMap(r=>r.slots.flatMap((o,n)=>{if(!o.required)return[];let s=r.command.split(" "),i=le(r.command),a=s.length>1&&t.has(i)?s.map(le).join("--"):i,d=ee(r.command).flatMap(l=>l.required?[l.flag,...l.value_name?["example"]:[]]:[]),c=Be.some(l=>l.command===r.command);return[{probe_id:`required-argument-${a}-${le(o.name)}`,command:r.command,refusal_args:[...s,...r.slots.slice(0,n).map(l=>$b(r.command,l)),...d],recovery_args:[...s,"--help"],error_code:c&&!r.command.startsWith("assurance ")?"invalid_argument_value":/^extension (?:activate|adopt|deactivate|uninstall)$/u.test(r.command)?"missing_lifecycle_target":"missing_required_argument",missing_argument:o.name,missing_argument_index:n}]})).sort((r,o)=>r.probe_id.localeCompare(o.probe_id))}function Fb(e){switch(L(e)){case"assurance":case"workspace snapshot":return Be.filter(({parent:t})=>t===e).map(({action:t})=>t);case"graph":return De;case"merge":return $e;case"plan":return Ye;case"profile":return Xe;case"schema":return $t;default:throw new Error(`Required positional action family ${e} has no authoritative value domain.`)}}function jD(e=qe){return e.filter(({slots:t})=>t[0]?.required===!0&&t[0].value_kind==="action").map(({command:t})=>{let r=t.split(" ");return{probe_id:`unknown-subcommand-${le(t)}`,command:t,refusal_args:[...r,mo],recovery_args:[...r,"--help"],error_code:"unknown_subcommand",rejected_value:mo,allowed_values:[...Fb(t)].sort()}}).sort((t,r)=>t.probe_id.localeCompare(r.probe_id))}function Gb(e,t){let r=[...t].sort();return e.length===t.length&&[...e].sort().every((o,n)=>o===r[n])}function Ub(e,t){if(!t)return[{code:"refusal_probe_missing",probe_id:e.probe_id,detail:`${e.probe_id} has no runtime observation.`}];let r=[];return t.error_code!==e.error_code&&r.push({code:"refusal_error_code_mismatch",probe_id:e.probe_id,detail:`${e.probe_id} emitted ${t.error_code||"<none>"}; expected ${e.error_code}.`}),t.exit_code!==2&&r.push({code:"refusal_exit_code_mismatch",probe_id:e.probe_id,detail:`${e.probe_id} exited ${t.exit_code}; expected usage exit 2.`}),"allowed_values"in e&&!Gb(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 BD(e,t){let r=new Map(e.map(i=>[i.probe_id,i])),o=new Map(t.map(i=>[i.probe_id,i])),n=[...e.flatMap(i=>Ub(i,o.get(i.probe_id))),...t.filter(i=>!r.has(i.probe_id)).map(i=>({code:"unexpected_refusal_probe",probe_id:i.probe_id,detail:`${i.probe_id} has no declared grammar refusal contract.`}))];n.sort((i,a)=>i.probe_id.localeCompare(a.probe_id)||i.code.localeCompare(a.code));let s=new Set(n.map(({probe_id:i})=>i));return{ok:n.length===0,probe_count:e.length,closed_probe_count:e.filter(({probe_id:i})=>!s.has(i)).length,findings:n}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="d3795bc4-fbe5-5ca4-bc90-b72a2d469dc7")}catch{}})();var ht=[{probe_id:"tracker-root-missing",failure_kind:"missing_root",expected_error_code:"tracker_root_missing",expected_exit_code:3,recovery_kind:"initialize"},{probe_id:"tracker-root-settings-missing",failure_kind:"settings_missing",expected_error_code:"tracker_not_initialized",expected_exit_code:3,recovery_kind:"initialize"},{probe_id:"tracker-root-not-directory",failure_kind:"not_directory",expected_error_code:"tracker_root_not_directory",expected_exit_code:2,recovery_kind:"select_directory"},{probe_id:"tracker-root-unreadable",failure_kind:"unreadable_root",expected_error_code:"tracker_root_unreadable",expected_exit_code:1,recovery_kind:"repair_permissions"}];function zD(){return ht.map(e=>({...e}))}function jb(e,t){let r=[];t.error_code!==e.expected_error_code&&r.push({code:"error_code_mismatch",probe_id:e.probe_id,detail:`Expected ${e.expected_error_code}, received ${t.error_code}.`}),t.exit_code!==e.expected_exit_code&&r.push({code:"exit_code_mismatch",probe_id:e.probe_id,detail:`Expected exit ${e.expected_exit_code}, received ${t.exit_code}.`}),t.recovery_kind!==e.recovery_kind&&r.push({code:"recovery_kind_mismatch",probe_id:e.probe_id,detail:`Expected ${e.recovery_kind}, received ${t.recovery_kind}.`});let o=t.suggested_retry_args.indexOf("init"),n=o===0||o===2&&t.suggested_retry_args[0]==="--pm-path"&&t.suggested_retry_args[1]?.length>0;return e.recovery_kind==="initialize"&&!n&&r.push({code:"missing_init_recovery",probe_id:e.probe_id,detail:"Missing and uninitialized roots must emit a tokenized init retry."}),(t.unsafe_init_recommended||e.recovery_kind!=="initialize"&&t.suggested_retry_args.includes("init"))&&r.push({code:"unsafe_init_recovery",probe_id:e.probe_id,detail:"A tracker root that cannot be initialized safely must not recommend initialization."}),t.retry_succeeded||r.push({code:"retry_failed",probe_id:e.probe_id,detail:"The emitted retry or safe alternate-root recovery did not execute successfully."}),r}function HD(e){let t=new Map(e.map(n=>[n.probe_id,n])),r=[],o=0;for(let n of ht){let s=t.get(n.probe_id);if(s===void 0){r.push({code:"missing_probe",probe_id:n.probe_id,detail:"No runtime observation was supplied for this contract."});continue}let i=jb(n,s);r.push(...i),i.length===0&&(o+=1)}return r.sort((n,s)=>n.probe_id.localeCompare(s.probe_id)||n.code.localeCompare(s.code)),{ok:r.length===0,probe_count:ht.length,closed_probe_count:o,findings:r}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="41419a34-fcd7-5d1a-a427-4e9e634f9379")}catch{}})();var Pe,Bb=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 qb(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=Bb[L(e)];if(r===void 0)throw new Error(`Command ${e} exposes --full without a registered projection concept.`);return r}return t!=="--file"?t.slice(2):["create","update","update-many"].includes(L(e))?"linked-file-path":["comments","notes","learnings"].includes(L(e))?"entry-file-input":"plan-definition-file"}function Me(){if(Pe!==void 0)return Pe;let e=te.filter(({command:n})=>ze(n)).flatMap(({command:n,family:s})=>Pt(n,ee(n)).map(i=>({command:n,family:s,concept:qb(n,i.flag),flag:i.flag,aliases:Object.freeze([...i.aliases??[]]),value_kind:i.repeatable?"list":i.flag==="--limit"?"number":i.value_type}))),t=new Set(e.flatMap(n=>n.aliases.map(s=>`${n.command}:${s}`))),r=e.filter(n=>!t.has(`${n.command}:${n.flag}`)),o=new Map;for(let n of r){let s=o.get(n.concept)??new Set;s.add(n.value_kind),o.set(n.concept,s)}return Pe=Object.freeze(r.map(n=>Object.freeze({...n,concept:o.get(n.concept)?.size===1?n.concept:`${n.concept}@${n.command}`}))),Pe}function JD(){return Object.freeze(Me().map(e=>Object.freeze({command:e.command,canonical_flag:e.flag,accepted_spellings:Object.freeze([...new Set([e.flag,...e.aliases])].sort())})))}var fo=Object.freeze({init:30,item:20,config:36,extension:55,package:56,packages:56,install:27,upgrade:29,create:102,copy:24,focus:22,list:86,"list-all":86,"list-draft":84,"list-open":84,"list-in-progress":84,"list-blocked":84,"list-closed":84,"list-canceled":84,aggregate:40,context:45,ctx:45,get:30,graph:34,search:78,duplicates:25,eval:25,next:38,history:36,events:34,"history-attest":23,"history-redact":27,"history-repair":27,"history-compact":30,"history-author-acknowledge":28,merge:29,schema:43,profile:22,activity:36,restore:23,update:105,"update-many":146,close:32,"close-many":72,delete:24,append:25,comments:32,notes:36,learnings:32,files:39,docs:30,deps:32,plan:111,test:56,"test-all":40,telemetry:21,stats:29,health:36,validate:46,assurance:30,gc:22,workspace:23,contracts:29,claim:39,release:25,"start-task":23,"pause-task":23,"close-task":24,meet:33,event:33,remind:29,"test-runs-worker":20}),zb=1,_o=Object.freeze(Object.fromEntries(Object.entries({...fo,...Object.fromEntries(Ne.flatMap(({alias:e,canonical:t})=>{let r=fo[e];return r===void 0?[]:[[t,r]]}))}).map(([e,t])=>[e,t+zb])));function ho(){let e=new Map(Object.keys(_o).map(t=>[t,0]));for(let{command:t}of Me())e.set(t,Number(e.get(t))+1);return Object.freeze(Object.entries(_o).map(([t,r])=>Object.freeze({command:t,current:Number(e.get(t)),maximum:r})))}function Hb(e,t,r){for(let o of e)for(let n of o.aliases){let s=t.get(`${o.command}:${n}`);s===void 0||s.flag===o.flag||r.push({code:"alias_collision",command:o.command,detail:`${n} aliases ${o.flag} but is canonical for ${s.flag}.`})}}function Vb(e,t,r){let o=new Set(t.map(({command:n})=>n));for(let n of e.keys())o.has(n)||r.push({code:"missing_budget",command:n,detail:`${n} has canonical flags but no persisted budget.`});for(let n of t){let s=e.get(n.command)??0;s===0&&r.push({code:"stale_budget",command:n.command,detail:`${n.command} has a persisted budget but no canonical flags.`}),!(s<=n.maximum)&&r.push({code:"budget_exceeded",command:n.command,detail:`${s} canonical flags exceed the ratcheted maximum ${n.maximum}.`})}}function Kb(e,t,r){let o=new Map(e.map(n=>[`${n.command}:${n.flag}`,n]));for(let n of t){let s=`${n.command}:${n.canonical_flag}`,i=o.get(s);if(!i){r.push({code:"removed_canonical_spelling",command:n.command,detail:`${n.canonical_flag} disappeared from the executable spelling inventory.`});continue}let a=new Set([i.flag,...i.aliases]);for(let d of n.accepted_spellings)a.has(d)||r.push({code:"removed_compatibility_spelling",command:n.command,detail:`${d} no longer resolves to ${n.canonical_flag}.`})}}function ZD(e=Me(),t=ho(),r=[]){let o=[],n=new Map,s=new Map,i=new Map,a=new Map;for(let d of e){let c=`${d.command}:${d.flag}`;n.has(c)?o.push({code:"duplicate_canonical_flag",command:d.command,detail:`${d.flag} has more than one canonical row.`}):n.set(c,d),a.set(d.command,(a.get(d.command)??0)+1);let l=s.get(d.concept);l!==void 0&&l!==d.value_kind?o.push({code:"inconsistent_concept_kind",command:d.command,detail:`${d.concept} uses both ${l} and ${d.value_kind}.`}):s.set(d.concept,d.value_kind);let p=i.get(d.concept);p!==void 0&&p!==d.flag?o.push({code:"semantic_spelling_collision",command:d.command,detail:`${d.concept} is canonicalized by both ${p} and ${d.flag}.`}):i.set(d.concept,d.flag)}return Hb(e,n,o),Vb(a,t,o),Kb(e,r,o),o.sort((d,c)=>d.command.localeCompare(c.command)||d.code.localeCompare(c.code)||d.detail.localeCompare(c.detail)),{ok:o.length===0,entry_count:e.length,budget_count:t.length,concept_count:new Set(e.map(({concept:d})=>d)).size,baseline_entry_count:r.length,findings:o}}function QD(){let e=Me(),t=ho(),r=new Map(t.map(({command:o})=>[o,"unknown"]));for(let{command:o,family:n}of e)r.set(o,n);return["# Generated flag lexicon budgets","","This file is generated by `listPmFlagLexicon()`. Compatibility aliases do not consume canonical budget.","","| Command | Capability family | Canonical flags | Maximum |","| --- | --- | ---: | ---: |",...t.map(({command:o,current:n,maximum:s})=>{let i=r.get(o);return`| \`${o}\` | ${i} | ${n} | ${s} |`}),""].join(`
34
- `)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="3f3a5dca-8370-52d7-b279-dc6f9f0aeadf")}catch{}})();function t1(e){return e}function r1(e){return e}function o1(e){return e}function n1(e){return e}function i1(e){return e}function s1(e){return e}function a1(e){return e}function d1(e){return e}function c1(e){return e}function l1(e){return e}function p1(e){return e}function u1(e){return e}function m1(e){return e}function f1(e){return{handled:!0,result:e}}function _1(){return{handled:!1}}function h1(e){return e}function g1(e){return e}function y1(e){return e}function b1(e){return e}function T1(e){return e}function C1(e){return e}function E1(e){return e}function S1(e){return e}function w1(e){return e}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="68ca9ab1-91e0-5020-859e-fc1f1f6dcc56")}catch{}})();function Wb(e={},t={}){return new ge(t).extension(void 0,{...e,migrate:!0})}function Yb(e={},t={}){return new ge(t).packageMigrate(e)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="c96e4de9-16ef-581a-aa4b-6450917c2c65")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="604d7dcb-9fea-5631-8a72-b2a7ff3278f8")}catch{}})();function N(e){if(typeof e!="string"||!_e(e))throw new TypeError("Invalid reliability timestamp.");return Date.parse(e)}function Xb(e){let t=N(e.window_start),r=N(e.window_end);if(t>=r||!Number.isFinite(e.max_failure_rate)||e.max_failure_rate<0||e.max_failure_rate>=1||!Number.isSafeInteger(e.min_completed_attempts)||e.min_completed_attempts<1)throw new TypeError("Invalid reliability window policy.");if(e.families.length===0||e.families.some(o=>typeof o!="string"||o.trim().length===0)||new Set(e.families).size!==e.families.length)throw new TypeError("Expected unique, nonempty reliability families.");return{start:t,end:r}}function Jb(e,t,r,o){let n=new Map(t.map(i=>[i,[]])),s=new Set;for(let i of e){if(typeof i.id!="string"||i.id.trim().length===0||s.has(i.id))throw new TypeError("Invalid or duplicate reliability attempt identity.");s.add(i.id);let a=n.get(i.family);if(!a||!["success","failure","pending"].includes(i.outcome)||i.cause!==void 0&&(!["product","infrastructure","unknown"].includes(i.cause)||i.outcome!=="failure"))throw new TypeError("Invalid reliability attempt family, outcome or cause.");let d=N(i.started_at);if(i.repaired_at!==void 0&&(N(i.repaired_at)<d||i.outcome!=="failure"))throw new TypeError("Invalid reliability repair chronology.");d>=r&&d<o&&a.push(i)}return n}function q1(e,t){let{start:r,end:o}=Xb(t),n=[...Jb(e,t.families,r,o)].map(([s,i])=>{let a=i.filter(_=>_.outcome==="failure"),d=i.filter(_=>_.outcome!=="pending").length,c=d===0?null:a.length/d,l=a.filter(_=>_.repaired_at!==void 0&&N(_.repaired_at)<o),p={product:0,infrastructure:0,unknown:0};for(let _ of a)p[_.cause??"unknown"]+=1;let f=[];return d<t.min_completed_attempts&&f.push("insufficient_completed_attempts"),c!==null&&c>t.max_failure_rate&&f.push("failure_rate"),{family:s,attempts:i.length,completed:d,failed:a.length,pending:i.length-d,failure_rate:c,affected_days:[...new Set(a.map(_=>new Date(N(_.started_at)).toISOString().slice(0,10)))].sort(),repair_minutes:l.map(_=>(N(_.repaired_at)-N(_.started_at))/6e4).sort((_,g)=>_-g),unresolved:a.length-l.length,causes:p,violations:f,ok:f.length===0}});return{schema:"pm-reliability-window/1",window_start:new Date(r).toISOString(),window_end:new Date(o).toISOString(),ok:n.every(s=>s.ok),families:n}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="773ad2b6-326e-5483-bdce-a377f935cb31")}catch{}})();function pe(e){return typeof e=="string"&&e.length>0&&e.trim()===e}function Zb(e){if(!Array.isArray(e)||e.length<2)throw new TypeError("Expected at least two artifact ledgers.");let t=new Map;for(let r of e){if(r===null||typeof r!="object"||!pe(r.name)||t.has(r.name)||r.complete!==!0)throw new TypeError("Expected unique complete artifact ledgers.");if(!Array.isArray(r.identities))throw new TypeError("Invalid or duplicate artifact identity.");let o=new Set(r.identities);if(o.size!==r.identities.length||[...o].some(n=>!pe(n)))throw new TypeError("Invalid or duplicate artifact identity.");t.set(r.name,o)}if([...t.values()].every(r=>r.size===0))throw new TypeError("Empty inventories cannot establish artifact reconciliation.");return t}function Qb(e,t){if(!Array.isArray(e))throw new TypeError("Expected unique evidence-backed artifact exceptions.");let r=new Map;for(let o of e){if(o===null||typeof o!="object"||!pe(o.identity)||r.has(o.identity)||!pe(o.reason)||!pe(o.evidence))throw new TypeError("Expected unique evidence-backed artifact exceptions.");let n=o.missing_from;if(!Array.isArray(n)||n.length===0||n.length>=t.length||new Set(n).size!==n.length||[...n].some(s=>!t.includes(s)))throw new TypeError("Invalid artifact exception ledger signature.");r.set(o.identity,o)}return r}function H1(e,t=[]){let r=Zb(e),o=[...r.keys()].sort(),n=Qb(t,o),s=[...new Set([...r.values()].flatMap(c=>[...c]))].sort(),i=[],a=new Set;for(let c of s){let l=o.filter(_=>!r.get(_).has(c));if(l.length===0)continue;let p=n.get(c),f=p!==void 0&&JSON.stringify([...p.missing_from].sort())===JSON.stringify(l);f&&a.add(c),i.push({identity:c,present_in:o.filter(_=>r.get(_).has(c)),missing_from:l,disposition:f?{reason:p.reason,evidence:p.evidence}:null})}let d=[...n.keys()].filter(c=>!a.has(c)).sort();return{schema:"pm-artifact-ledgers/1",ok:i.every(c=>c.disposition!==null)&&d.length===0,counts:Object.fromEntries(o.map(c=>[c,r.get(c).size])),findings:i,stale_exceptions:d}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="15d63d97-9126-59ae-be28-b77fdfd07b9c")}catch{}})();import{createHash as yo,createHmac as eT,randomBytes as tT,timingSafeEqual as rT}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="98283845-5c48-5901-b54c-c8cc8138427b")}catch{}})();var R$="dev.unbrained.pm/progressive-tool-discovery",I$=Object.freeze({version:1,discoveryTool:"pm_discover",canonicalResult:"structuredContent.result",compatibilityText:"pointer"}),oT=Object.freeze(["pm_discover","pm_next","pm_context","pm_search","pm_get"]),B=Object.freeze({lexical:.4,semantic:.2,graph:.1,permission:.15,freshness:.05,usage:.1}),nT=Object.freeze(["profile_changed","tool_contract_changed","workspace_extension_changed","authorization_changed","ranking_signal_changed","cursor_integrity_key_rotated"]),bo={core:0,standard:1,full:2,internal:3},To=Object.freeze(["core","standard","full"]),iT=new Set(["core","standard","full","custom"]),Co=new Set(te.map(({family:e})=>e)),sT=tT(32);function xe(e,t){if(typeof e!="string")throw new b(`pm tool discovery ${t} must be a string of at most 4096 Unicode characters.`,64);let r=e[Symbol.iterator](),o=0;for(let n=r.next();!n.done;n=r.next())if(o+=1,o>4096)throw new b(`pm tool discovery ${t} must be a string of at most 4096 Unicode characters.`,64);return e}function Eo(e){if(!Number.isInteger(e)||Number(e)<1||Number(e)>100)throw new b("pm tool discovery limit must be from 1 through 100.",64);return Number(e)}function So(e){if(e!=="unbounded"&&(!Number.isInteger(e)||Number(e)<128))throw new b("pm tool discovery outputBudget must be unbounded or an integer of at least 128.",64);return e==="unbounded"?e:Number(e)}function wo(e){if(e!==void 0&&typeof e!="boolean")throw new b("pm tool discovery includeSchema must be a boolean.",64);return e===!0}function Ao(e){if(e===null||typeof e!="object"||Array.isArray(e))throw new b("pm tool discovery options must be an object.",64)}function aT(e){if(!Array.isArray(e))throw new b("pm tool discovery candidates must be an array.",64);for(let[t,r]of e.entries()){if(r===null||typeof r!="object"||Array.isArray(r))throw new b(`pm tool discovery candidate ${t} must be an object.`,64);if(typeof r.name!="string"||r.name.trim().length===0)throw new b(`pm tool discovery candidate ${t} name must be a non-empty string.`,64);if(typeof r.description!="string"||r.description.trim().length===0)throw new b(`pm tool discovery candidate ${t} description must be a non-empty string.`,64);if(r.inputSchema===null||typeof r.inputSchema!="object"||Array.isArray(r.inputSchema))throw new b(`pm tool discovery candidate ${t} inputSchema must be an object.`,64);if(r.authorized!==void 0&&typeof r.authorized!="boolean")throw new b(`pm tool discovery candidate ${t} authorized must be a boolean.`,64)}}function P$(e){if(Ao(e),e.family!==void 0&&(typeof e.family!="string"||!Co.has(e.family)))throw new b("pm tool discovery family must be a declared capability family.",64);if(e.tier!==void 0&&(typeof e.tier!="string"||!To.includes(e.tier)))throw new b("pm tool discovery tier must be core, standard, or full.",64);return{...e.query!==void 0?{query:xe(e.query,"query")}:{},...e.family!==void 0?{family:e.family}:{},...e.tier!==void 0?{tier:e.tier}:{},...e.limit!==void 0?{limit:Eo(e.limit)}:{},...e.cursor!==void 0?{cursor:xe(e.cursor,"cursor")}:{},...e.includeSchema!==void 0?{includeSchema:wo(e.includeSchema)}:{},...e.outputBudget!==void 0?{outputBudget:So(e.outputBudget)}:{}}}function dT(e){return e===void 0||!Number.isFinite(e)?0:Math.min(1,Math.max(0,e))}function ue(e){return[...new Set(e.toLowerCase().match(/[a-z0-9]+/gu)??[])].sort()}function cT(e,t){let r=ue(e);if(r.length===0)return 0;let o=new Set(ue(t)),n=r.filter(i=>o.has(i)).length,s=t.toLowerCase().includes(e.toLowerCase())?.25:0;return Math.min(1,n/r.length+s)}function lT(e,t){let r=ue(e);if(r.length===0)return 0;let o=t.toLowerCase(),n=ue(t),s=r.filter(a=>n.some(d=>d.startsWith(a)||a.startsWith(d))).length,i=o.includes(e.toLowerCase())?.2:0;return Math.min(1,s/r.length+i)}function go(e){return yo("sha256").update(JSON.stringify(e)).digest("hex").slice(0,24)}function vo(e,t,r){return eT("sha256",r).update(JSON.stringify({version:1,fingerprint:e,offset:t})).digest("base64url")}function pT(e,t,r){let o={version:1,offset:t,signature:vo(e,t,r)};return Buffer.from(JSON.stringify(o),"utf8").toString("base64url")}function uT(e,t,r,o){if(e===void 0)return 0;try{let n=JSON.parse(Buffer.from(e,"base64url").toString("utf8")),s=n.offset;if(n.version!==1||typeof s!="number"||!Number.isInteger(s)||s<0||s>r||typeof n.signature!="string")throw new Error("cursor fields do not match the request");let i=Buffer.from(vo(t,s,o),"base64url"),a=Buffer.from(n.signature,"base64url");if(a.length!==i.length||!rT(a,i))throw new Error("cursor signature does not match the request");return s}catch(n){throw new b("Invalid or stale pm tool discovery cursor; restart discovery without cursor.",64,{reason:String(n)})}}function gt(e,t,r){return{value:dT(e),weight:t,available:r!=="unavailable",source:r}}function ke(e,t,r){return gt(e??t,r,e===void 0?"computed":"host")}function mT(e,t,r){let o=Object.hasOwn(he,e.name)?he[e.name]:"help",n=Ve(o),s=`${e.name} ${e.description} ${o} ${n}`,i=cT(t,s),a=new Set(ue(t)),d={lexical:gt(i,B.lexical,"computed"),semantic:ke(e.signals?.semantic,lT(t,s),B.semantic),graph:ke(e.signals?.graph,a.has(n)||a.has(o)?1:0,B.graph),permission:gt(1,B.permission,"authorization"),freshness:ke(e.signals?.freshness,1,B.freshness),usage:ke(e.signals?.usage,oT.includes(e.name)?1:0,B.usage)},c=Object.values(d).reduce((l,p)=>l+p.value*p.weight,0);return{name:e.name,description:e.description,command:o,tier:Ke(o),family:n,score:Number(c.toFixed(6)),signals:d,...r?{input_schema:structuredClone(e.inputSchema)}:{}}}function fT(e){if(e.cursorIntegrityKey!==void 0&&(!(e.cursorIntegrityKey instanceof Uint8Array)||e.cursorIntegrityKey.byteLength<32))throw new b("pm tool discovery cursorIntegrityKey must contain at least 32 bytes.",64);if(e.tier!==void 0&&(typeof e.tier!="string"||!To.includes(e.tier)))throw new b("pm tool discovery tier must be core, standard, or full.",64);if(e.family!==void 0&&(typeof e.family!="string"||!Co.has(e.family)))throw new b("pm tool discovery family must be a declared capability family.",64);if(e.profile!==void 0&&(typeof e.profile!="string"||!iT.has(e.profile)))throw new b("pm tool discovery profile must be core, standard, full, or custom.",64)}function _T(e){let t=xe(e.query===void 0?"":e.query,"query").trim().replace(/\s+/gu," ");xe(e.cursor===void 0?"":e.cursor,"cursor");let r=Eo(e.limit===void 0?10:e.limit),o=So(e.outputBudget===void 0?1200:e.outputBudget);return fT(e),{query:t,includeSchema:wo(e.includeSchema),limit:r,budget:o,maximumTier:bo[e.tier??"full"],profile:e.profile===void 0?"core":e.profile}}function Oo(e,t,r){let o=r??e.tools.reduce((i,a,d)=>i+(d===0?0:1)+Buffer.byteLength(JSON.stringify(a),"utf8"),0),n={...e,tools:[]},s=0;for(let i=0;i<4;i+=1){let a=Buffer.byteLength(JSON.stringify({...n,token_cost:{estimated_tokens:s,budget:t,within_budget:!0}}),"utf8"),d=Math.ceil((a+o)/4);if(d===s)break;s=d}return s}function hT(e,t,r){return e.filter(o=>o.authorized!==!1).map(o=>mT(o,r.query,r.includeSchema)).filter(o=>o.tier!=="internal"&&bo[o.tier]<=r.maximumTier&&(t.family===void 0||o.family===t.family)).sort((o,n)=>n.score-o.score||(o.name<n.name?-1:o.name>n.name?1:0))}function gT(e,t,r){if(t==="unbounded")return[...e];let o=[],n=0;for(let[s,i]of e.entries()){let a=n+(s===0?0:1)+Buffer.byteLength(JSON.stringify(i),"utf8");if(Oo(r(s+1),t,a)>t)break;o.push(i),n=a}return o}function M$(e,t={}){aT(e),Ao(t);let r=_T(t),o=t.cursorIntegrityKey??sT,n=hT(e,t,r),s=go({query:r.query,family:t.family??null,tier:t.tier??"full",includeSchema:r.includeSchema,profile:r.profile,ranked:n}),i=uT(t.cursor,s,n.length,o),a=n.slice(i,i+r.limit),d=[];r.includeSchema||d.push({name:"input_schema",reason:"compact_projection",restore_with:"Set includeSchema=true."}),i+r.limit<n.length&&d.push({name:"tools",reason:"limit",restore_with:"Continue with next_cursor or increase limit."});let c={result_type:"pm_tool_discovery",contract_version:1,query:r.query,profile:r.profile,total:n.length,ranking_policy:{version:1,formula:"weighted_sum_then_name",weights:B},cache:{key:go({fingerprint:s,cursorIntegrityKey:yo("sha256").update(o).digest("hex"),limit:r.limit,offset:i,budget:r.budget}),ttl_ms:3e4,scope:"private",invalidates_on:nT}},l=(g,T=g.length)=>{let E=i+T,q=E<n.length,R=[...d];return T<a.length&&R.push({name:"tools",reason:"token_budget",restore_with:"Continue with next_cursor or increase outputBudget."}),{...c,tools:[...g],returned:T,has_more:q,...q?{next_cursor:pT(s,E,o)}:{},omission_receipt:{has_omissions:R.length>0,omitted:R}}},p=g=>{let T=l(g),E=Oo(T,r.budget);return{...T,token_cost:{estimated_tokens:E,budget:r.budget,within_budget:r.budget==="unbounded"||E<=r.budget}}},f=gT(a,r.budget,g=>l([],g)),_=p(f);if(a.length>0&&f.length===0){let g=p([a[0]]).token_cost.estimated_tokens;throw new b(`pm tool discovery outputBudget is too small to return a tool; increase it to at least ${g}.`,64,{required:String(g)})}if(r.budget!=="unbounded"&&_.token_cost.estimated_tokens>r.budget)throw new b(`pm tool discovery outputBudget is too small; at least ${_.token_cost.estimated_tokens} estimated tokens are required for this page.`,64,{required:String(_.token_cost.estimated_tokens)});return _}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="e02d896b-ffa2-5bfa-83dc-d567e1ecd8be")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="438f2063-2307-5945-b1a8-67c0fc24091b")}catch{}})();export{IO as ACTIONABILITY_ORDERING_KINDS,Ud as ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS,cd as ACTIVITY_FLAG_CONTRACTS,ri as AGENT_PROVENANCE_DIMENSIONS,Ks as AGGREGATE_FLAG_CONTRACTS,xa as APPEND_FLAG_CONTRACTS,pM as ASSURANCE_ACTIONS,uM as ASSURANCE_DECLARATION_KINDS,wI as ASSURANCE_DOCUMENT_VERSION,Qa as ASSURANCE_FLAG_CONTRACTS,AI as ASSURANCE_GATE_TRIGGERS,vI as ASSURANCE_MEASUREMENT_SOURCE_KINDS,gP as ASSURANCE_PRESET_IDS,TI as AssuranceEvaluationRefusalError,bI as AssuranceMutationRefusalError,CI as AssuranceSourceResolutionError,jn as BASELINE_ITEM_FORMAT_VERSION,Qy as BOUNDARY_FIXTURE_CAPTURE_SOURCES,aR as BRIEF_LIST_FIELDS,ni as BUILTIN_AGENT_PROVENANCE_ADAPTERS,Y as BUILTIN_CORPUS_SHAPES,oi as BUILTIN_HARNESS_SIGNAL_DESCRIPTORS,pn as BUILTIN_ITEM_TYPE_VALUES,Vt as BUILTIN_PROFILES,IC as BUILTIN_RELATIONSHIP_KINDS,$d as CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS,dd as CALENDAR_FLAG_CONTRACTS,Na as CLAIM_FLAG_CONTRACTS,Ic as CLOSE_ACTION_OPTION_KEYS,Ma as CLOSE_FLAG_CONTRACTS,ka as CLOSE_MANY_FLAG_CONTRACTS,Ua as CLOSE_TASK_FLAG_CONTRACTS,Ws as COMMENTS_FLAG_CONTRACTS,eC as COMMON_MUTATION_COMMAND_OPTION_KEYS,Cd as COMPLETION_FLAG_CONTRACTS,gn as CONFIDENCE_TEXT_VALUES,ca as CONFIG_FLAG_CONTRACTS,Fd as CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS,XM as CONTEXT_EVALUATION_METRIC_NAMES,pd as CONTEXT_FLAG_CONTRACTS,Ow as CONTEXT_INTENT_LIMIT_OVERRIDE_WARNING,qt as CONTEXT_OUTPUT_VALUES,t0 as CONTEXT_PACKING_PROFILES,BM as CONTEXT_RECENCY_EPOCH,VM as CONTEXT_RELEVANCE_SERVICE,zM as CONTEXT_RELEVANCE_SIGNAL_NAMES,n0 as CONTEXT_SIGNAL_SET_VERSION,o0 as CONTEXT_SIGNAL_STORE_FORMAT_VERSION,i0 as CONTEXT_SIGNAL_STORE_WARNING_DETAILS,hw as CONTEXT_USAGE_LIMITS,Td as CONTRACTS_FLAG_CONTRACTS,nd as COPY_FLAG_CONTRACTS,rc as CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,nc as CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,oc as CREATE_COMMANDER_STRING_OPTION_CONTRACTS,ET as CREATE_DIRECT_CLOSE_REASON_DEFAULT,ed as CREATE_FLAG_CONTRACTS,NE as CURRENT_HISTORY_HASH_ALGORITHM,Yw as CURRENT_HISTORY_ITEM_HASH_VERSION,Jw as CURRENT_HISTORY_RECORD_HASH_VERSION,Bn as CURRENT_ITEM_FORMAT_VERSION,c0 as ContextSignalStore,gw as ContextUsageValidationError,LM as DEFAULT_AUTHOR_IDENTITY_VOCABULARY,v0 as DEFAULT_CHILD_SAMPLE_LIMIT,sR as DEFAULT_COMPACT_LIST_FIELDS,Tv as DEFAULT_DERIVED_INDEX_MINIMUM_ITEMS,cf as DEFAULT_EVAL_QUERIES_RELATIVE_PATH,mP as DEFAULT_RELATIONSHIP_CONTEXT_TOKEN_BUDGET,vM as DEFAULT_TERMINAL_TRANSITION_POLICY,m0 as DEFAULT_WORKSPACE_MEMORY_MINIMUM_ITEMS,RR as DEFECT_ESCAPE_CLASSES,IR as DEFECT_GATE_EVIDENCE_DISPOSITIONS,Da as DELETE_FLAG_CONTRACTS,fn as DEPENDENCY_KIND_VALUES,fd as DEPS_FLAG_CONTRACTS,Zs as DOCS_FLAG_CONTRACTS,Xa as DUPLICATES_FLAG_CONTRACTS,qP as DURABLE_MERGE_RECEIPT_INTRODUCED_AT,xR as DefectRecurrencePolicyParseError,hd as EVAL_FLAG_CONTRACTS,tf as EVAL_METRIC_NAMES,sf as EVAL_QUERY_SET_CONTRACT,af as EVAL_QUERY_SET_EXAMPLE,nf as EVAL_QUERY_SET_SCHEMA_ID,ld as EVENTS_FLAG_CONTRACTS,Ba as EVENT_FLAG_CONTRACTS,$o as EXECUTABLE_COMMAND_ALIASES,me as EXIT_CODE,Ta as EXTENSION_ACTIVATE_FLAG_CONTRACTS,ba as EXTENSION_ADOPT_ALL_FLAG_CONTRACTS,Oa as EXTENSION_ADOPT_FLAG_CONTRACTS,ok as EXTENSION_CAPABILITIES,TT as EXTENSION_CAPABILITY_CONTRACT,yT as EXTENSION_CAPABILITY_CONTRACT_VERSION,bT as EXTENSION_CAPABILITY_LEGACY_ALIASES,xn as EXTENSION_CAPABILITY_REGISTRATION_SURFACES,va as EXTENSION_CATALOG_FLAG_CONTRACTS,Ca as EXTENSION_DEACTIVATE_FLAG_CONTRACTS,ya as EXTENSION_DESCRIBE_FLAG_CONTRACTS,Aa as EXTENSION_DOCTOR_FLAG_CONTRACTS,ga as EXTENSION_EXPLORE_FLAG_CONTRACTS,la as EXTENSION_FLAG_CONTRACTS,ua as EXTENSION_INIT_FLAG_CONTRACTS,_a as EXTENSION_INSTALL_FLAG_CONTRACTS,Sa as EXTENSION_MANAGE_FLAG_CONTRACTS,Ea as EXTENSION_MIGRATE_FLAG_CONTRACTS,nk as EXTENSION_POLICY_MODES,ik as EXTENSION_POLICY_SURFACES,wa as EXTENSION_RELOAD_FLAG_CONTRACTS,ak as EXTENSION_SANDBOX_PROFILES,pa as EXTENSION_SCOPE_FLAG_CONTRACTS,sk as EXTENSION_TRUST_MODES,ha as EXTENSION_UNINSTALL_FLAG_CONTRACTS,HR as EXTERNAL_DEPENDENCY_RESOLUTION_STATUSES,qR as EXTERNAL_DEPENDENCY_SOURCE_KIND,zR as EXTERNAL_DEPENDENCY_SOURCE_KIND_ALIAS,Xv as ExtensionCommandError,Js as FILES_FLAG_CONTRACTS,id as FOCUS_FLAG_CONTRACTS,Wa as GC_FLAG_CONTRACTS,pR as GET_DEPTH_INPUT_VALUES,lR as GET_DEPTH_VALUES,ud as GET_FLAG_CONTRACTS,Hs as GLOBAL_FLAG_CONTRACTS,Hp as GRAPH_DURABLE_CACHE_MIN_ITEMS,zp as GRAPH_DURABLE_CACHE_VERSION,_d as GRAPH_FLAG_CONTRACTS,iR as GRAPH_QUERY_DEFAULTS,De as GRAPH_SUBCOMMAND_VALUES,md as GUIDE_FLAG_CONTRACTS,Ja as HEALTH_FLAG_CONTRACTS,oa as HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS,cP as HISTORY_AUTHOR_ATTRIBUTION_BASELINE,gM as HISTORY_COMPACT_BULK_DEFAULT_MIN_ENTRIES,na as HISTORY_COMPACT_FLAG_CONTRACTS,yi as HISTORY_EVENT_CLASSIFICATION_VERSION,Qs as HISTORY_FLAG_CONTRACTS,kE as HISTORY_HASH_ALGORITHMS,cv as HISTORY_ITEM_HASH_VERSION_3_INTRODUCED_IN,ta as HISTORY_REDACT_FLAG_CONTRACTS,ra as HISTORY_REPAIR_FLAG_CONTRACTS,kl as INIT_AGENT_GUIDANCE_MODE_VALUES,da as INIT_FLAG_CONTRACTS,Ra as INSTALL_FLAG_CONTRACTS,hn as ISSUE_SEVERITY_VALUES,rd as ITEM_COMPLETE_FLAG_CONTRACTS,NP as ITEM_LATEST_TIMESTAMP_FIELDS,CT as ITEM_METADATA_KEY_ORDER,td as ITEM_MUTATE_FLAG_CONTRACTS,od as ITEM_REOPEN_FLAG_CONTRACTS,Os as ITEM_REVISION_CONFLICT_CHANGE_LIMIT,vs as ITEM_REVISION_CONFLICT_CODE,OP as ITEM_SCALAR_MISSING_VALUE,un as ITEM_TYPE_VALUES,xP as ITEM_UNION_COLLECTION_FIELDS,d0 as JsonFileContextSignalStoreAdapter,Xs as LEARNINGS_FLAG_CONTRACTS,xE as LEGACY_HISTORY_HASH_ALGORITHM,Ru as LINKED_TEST_ENV_NAME_PATTERN,Iu as LINKED_TEST_PM_CONTEXT_MODE_VALUES,Ou as LINKED_TEST_PROTECTED_ENV_KEYS,Pu as LINKED_TEST_WORKSPACE_CONTEXT_MODE_VALUES,Ld as LIST_COMMANDER_STRING_OPTION_CONTRACTS,dR as LIST_COMMAND_DEFAULT_PROJECTIONS,ck as LIST_FILTER_EXTENSION_FLAG_DEFINITIONS,Vs as LIST_FILTER_FLAG_CONTRACTS,QR as LIST_SORT_FIELDS,eI as LIST_SORT_ORDER_VALUES,bi as MAINTENANCE_HISTORY_OPERATIONS,A0 as MAX_CHILD_PROJECTION_ITEMS,RT as MAX_WORKFLOW_POLICIES,IT as MAX_WORKFLOW_POLICY_TERMS,ja as MEET_FLAG_CONTRACTS,V0 as MERGE_DRIVER_ARTIFACT_VALUES,ea as MERGE_FLAG_CONTRACTS,$e as MERGE_SUBCOMMAND_VALUES,Y0 as MUTATION_EVENT_WIRE_BUDGET,se as MemoryRelationshipGraphAdapter,Gd as NEXT_COMMANDER_STRING_OPTION_CONTRACTS,yd as NEXT_FLAG_CONTRACTS,vm as NEXT_OUTPUT_VALUES,NM as NEXT_RANKING_POLICIES,Ys as NOTES_FLAG_CONTRACTS,HO as OutputEnvelopeFitError,ma as PACKAGE_FLAG_CONTRACTS,fa as PACKAGE_INIT_FLAG_CONTRACTS,Ga as PAUSE_TASK_FLAG_CONTRACTS,Rc as PLAN_CREATE_METADATA_PARAMETER_KEYS,aa as PLAN_FLAG_CONTRACTS,js as PLAN_SHOW_DEPTH_VALUES,Ye as PLAN_SUBCOMMANDS,Lm as PLAN_TEMPLATE_NAMES,lb as PM_AGENT_TASK_ACCOUNTING_MODES,ut as PM_AGENT_TASK_TRANSCRIPT_VERSION,xo as PM_BULK_LIFECYCLE_COMMAND_ALIASES,rs as PM_CLI_ERROR_DETAILS_LIMITS,ds as PM_CLI_EXPECTED_ERROR_NAME,yR as PM_CLI_GRAMMAR_CONTRACT,mR as PM_CLI_GRAMMAR_NOUNS,Xo as PM_CLI_ONLY_TOOL_ACTION_WAIVERS,fR as PM_CLI_SHARED_VERBS,Do as PM_COMMAND_ALIAS_CONTRACTS,te as PM_COMMAND_CAPABILITY_CONTRACTS,It as PM_COMMAND_DESTINATION_CONTRACTS,fI as PM_COMMAND_EXIT_CONTRACTS,mI as PM_COMMAND_EXIT_OUTCOME_CONTRACTS,Pi as PM_COMMAND_OUTPUT_BUDGET_CONTRACTS,lI as PM_COMMAND_OUTPUT_ENVELOPE_CONTRACTS,qe as PM_COMMAND_POSITIONAL_CONTRACTS,tl as PM_COMMAND_VISIBILITY_CONTRACTS,oP as PM_COMPLETE_LIST_FINDING_CODES,$O as PM_CONTEXT_INTENTS_FILE,Rw as PM_CONTEXT_INTENT_CONTRACTS,ko as PM_CONTEXT_OPS_COMMAND_ALIASES,Vo as PM_CORE_COMMAND_NAMES,G as PM_CORPUS_SHAPE_SCHEMA,Zo as PM_DEPRECATED_TOOL_ACTIONS,Ai as PM_DIAGNOSTIC_DEGRADATION_STEPS,vi as PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS,wi as PM_DIAGNOSTIC_OUTPUT_CLASSES,Qo as PM_DISCOVERABLE_TOOL_ACTIONS,Yr as PM_EPISODE_SCHEMA,dI as PM_ERROR_CODE_CATALOG,nI as PM_ERROR_CODE_EXIT_CLASS_CONTRACTS,to as PM_EXACT_COVERAGE_METRICS,Uo as PM_EXTENSION_CAPABILITY_CONTRACTS,Ko as PM_EXTENSION_PACKAGE_ACTION_SUBCOMMANDS,Bo as PM_EXTENSION_POLICY_MODE_CONTRACTS,Ho as PM_EXTENSION_POLICY_SURFACE_CONTRACTS,zo as PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS,jo as PM_EXTENSION_SERVICE_NAME_CONTRACTS,qo as PM_EXTENSION_TRUST_MODE_CONTRACTS,Di as PM_GENERIC_REFUSAL_GUIDANCE,WI as PM_GITATTRIBUTES_END,KI as PM_GITATTRIBUTES_START,XI as PM_GITATTRIBUTES_V2_END,YI as PM_GITATTRIBUTES_V2_START,cl as PM_GITIGNORE_END,dl as PM_GITIGNORE_START,CM as PM_HISTORY_ATTESTATION_CONTRACT,Mo as PM_HISTORY_COMMAND_ALIASES,XE as PM_HISTORY_OPERATION_ALIASES,ZE as PM_HISTORY_OPERATION_CONTRACT,JE as PM_HISTORY_OPERATION_PATTERNS,Yo as PM_ITEM_ACTION_SUBCOMMANDS,WE as PM_ITEM_HISTORY_OPERATIONS,it as PM_MCP_APPS_EXTENSION,kr 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,oT as PM_MCP_ENTRY_TOOL_NAMES,m as PM_MCP_ERROR_CODES,wN as PM_MCP_HTTP_PROTOCOL_VERSION,Cg as PM_MCP_INPUT_REQUEST_METHODS,nr as PM_MCP_LEGACY_PROTOCOL_VERSIONS,or as PM_MCP_LOG_LEVELS,w as PM_MCP_META_KEYS,R$ as PM_MCP_PROGRESSIVE_DISCOVERY_EXTENSION,I$ as PM_MCP_PROGRESSIVE_DISCOVERY_SERVER_CAPABILITY,sl as PM_MCP_PROMPT_CONTRACTS,H as PM_MCP_PROTOCOL_VERSION,il as PM_MCP_RESOURCE_CONTRACTS,at as PM_MCP_SKILLS_DRAFT_REVISION,Dr as PM_MCP_SKILLS_EXTENSION,Oy as PM_MCP_SKILLS_SERVER_CAPABILITY,P as PM_MCP_SKILL_LIMITS,Se as PM_MCP_SUBSCRIPTION_ID_META_KEY,re as PM_MCP_SUPPORTED_PROTOCOL_VERSIONS,hN as PM_MCP_TASKS_EXTENSION,kg as PM_MCP_TASK_STATUSES,he as PM_MCP_TOOL_COMMAND_CONTRACTS,pS as PM_MODE_PAIRED_OUTPUT_PROJECTION_CONTRACTS,us as PM_MUTATION_ACTION_CONTRACTS,Ne as PM_NAMESPACED_COMMAND_ALIASES,Kr as PM_OBSERVATION_SCHEMA,Si as PM_OUTPUT_BUDGET_CLASSES,Ei as PM_OUTPUT_DEGRADATION_STEPS,Nt as PM_OUTPUT_ENVELOPE_KINDS,Gt as PM_PACKAGE_CONVENTIONAL_RESOURCE_ROOTS,Wo as PM_PACKAGE_ONLY_ACTION_SUBCOMMANDS,Ft as PM_PACKAGE_RESOURCE_KINDS,Be as PM_POSITIONAL_ACTION_CONTRACTS,Dc as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA,Nc as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION,BS as PM_READ_OUTPUT_COMPOSITION_OPTION_FLAGS,ow as PM_READ_OUTPUT_CONTINUATION_FINGERPRINT_POLICIES,US as PM_READ_OUTPUT_DIMENSIONS,jS as PM_READ_OUTPUT_OPTION_FLAGS,LS as PM_READ_OUTPUT_SESSION_MAX_SEEN_ITEM_IDS,NS as PM_READ_OUTPUT_SESSION_MIN_TOKENS,jC as PM_READ_OUTPUT_SURFACES,qS as PM_READ_OUTPUT_SURFACE_CONTRACTS,MS as PM_READ_OUTPUT_TAIL_RETENTION_POLICIES,lS as PM_READ_ROW_CONTRACTS,cS as PM_READ_ROW_JQ_SELECTOR,Ui as PM_RECOVERY_ECHO_FIELDS,gD as PM_RECOVERY_REFERENCE_FIELDS,ce as PM_RECOVERY_REFERENCE_KINDS,Nb as PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE,uo as PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE_V2,wD as PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE,po as PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE_V2,No as PM_RELOCATED_COMMAND_ALIASES,Fc as PM_REPRODUCIBLE_PROCESS_ENV,_I as PM_SUCCESS_EXIT_CODES,Jo as PM_TOOL_ACTIONS,Pc as PM_TOOL_ACTION_PARAMETER_CONTRACTS,Lc as PM_TOOL_PARAMETERS_SCHEMA,xc as PM_TOOL_PARAMETERS_SCHEMA_MAJOR,kc as PM_TOOL_PARAMETERS_SCHEMA_VERSION,vc as PM_TOOL_RESERVED_CUSTOM_FIELD_PROPERTIES,Wr as PM_VERDICT_SCHEMA,YE as PM_WORKSPACE_HISTORY_OPERATIONS,Hr as PM_WORKSPACE_RECIPE_SCHEMA,sa as PROFILE_FLAG_CONTRACTS,Qt as PROFILE_LINT_CODES,Zt as PROFILE_LINT_DIMENSIONS,Ht as PROFILE_NAMES,Xe as PROFILE_SUBCOMMANDS,b as PmCliError,ge as PmClient,nP as PmCompleteListValidationError,y as PmMcpAuthorizationError,ir as PmMcpInputRequiredError,Or as PmMcpIssuerCredentialStore,u as PmMcpProtocolError,sr as PmMcpRequestStateReplayGuard,Br as PmMcpSkillRegistry,gr as PmMcpSubscriptionRegistry,ot as PmMcpTaskStore,_w as QUERY_CURSOR_CONTRACT,HS as READ_OUTPUT_MUTATION_CONFLICT_CODE,VS as READ_OUTPUT_SHAPING_CONTROL_FLAGS,Pa as REINDEX_FLAG_CONTRACTS,tv as REINDEX_LOCK_ID,pt as RELATIONSHIP_GRAPH_SNAPSHOT_VERSION,$a as RELEASE_FLAG_CONTRACTS,qa as REMIND_FLAG_CONTRACTS,At as RESERVED_ITEM_FIELD_NAMES,La as RESTORE_FLAG_CONTRACTS,_n as RISK_VALUES,KO as RelationshipEventLog,WO as RelationshipEventStore,z as RelationshipGraph,Ue as RelationshipKindRegistry,ia as SCHEMA_FLAG_CONTRACTS,Dd as SEARCH_COMMANDER_STRING_OPTION_CONTRACTS,lk as SEARCH_EXTENSION_FLAG_DEFINITIONS,bd as SEARCH_FLAG_CONTRACTS,Wu as SEMANTIC_ATTRIBUTION_LIMITS,wT as SETTINGS_DEFAULTS,ff as SNAPSHOT_SCHEMA,zI as SOURCE_CONTEXT_ACCESS_ENV,HI as SOURCE_CONTEXT_WRITE_OVERRIDE_ENV,Qu as START_BLOCKED_REFUSAL_CODE,Zu as START_BLOCKER_ENFORCEMENT_DEFAULT,Fa as START_TASK_FLAG_CONTRACTS,Ya as STATS_FLAG_CONTRACTS,mn as STATUS_VALUES,zs as SUBCOMMAND_GLOBAL_FLAG_CONTRACTS,Ti as SUBSTANTIVE_HISTORY_OPERATIONS,Xw as SUPPORTED_HISTORY_ITEM_HASH_VERSIONS,Zw as SUPPORTED_HISTORY_RECORD_HASH_VERSIONS,LC as SUPPRESS_HOST_OUTPUT_MARKER,Va as TELEMETRY_FLAG_CONTRACTS,Bf as TELEMETRY_SUBCOMMANDS,Ha as TEST_ALL_FLAG_CONTRACTS,za as TEST_FLAG_CONTRACTS,Ka as TEST_RUNS_FLAG_CONTRACTS,$f as TEST_RUN_MEASUREMENT_LIMIT,Ec as TOOL_ACTIVITY_OPTION_CONTRACTS,lc as TOOL_AGGREGATE_OPTION_CONTRACTS,yc as TOOL_BULK_MUTATION_FILTER_OPTION_CONTRACT_SOURCE,Cc as TOOL_CALENDAR_OPTION_CONTRACTS,Tc as TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS,Sc as TOOL_CONTEXT_OPTION_CONTRACTS,_c as TOOL_CREATE_OPTION_CONTRACTS,fc as TOOL_CREATE_OPTION_CONTRACT_SOURCE,wc as TOOL_DEPS_OPTION_CONTRACTS,Ac as TOOL_GRAPH_OPTION_CONTRACTS,cc as TOOL_LIST_FILTER_OPTION_CONTRACTS,pc as TOOL_SEARCH_FILTER_OPTION_CONTRACTS,mc as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS,uc as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACT_SOURCE,bc as TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS,gc as TOOL_UPDATE_OPTION_CONTRACTS,hc as TOOL_UPDATE_OPTION_CONTRACT_SOURCE,ST as TYPE_TO_FOLDER,OC as UNKNOWN_SUBCOMMAND_COMPATIBILITY_CODES,ic as UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,ac as UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,sc as UPDATE_COMMANDER_STRING_OPTION_CONTRACTS,sd as UPDATE_FLAG_CONTRACTS,ad as UPDATE_MANY_FLAG_CONTRACTS,Ia as UPGRADE_FLAG_CONTRACTS,Za as VALIDATE_FLAG_CONTRACTS,OT as WORKFLOW_POLICY_ACTIONS,QI as WORKFLOW_POLICY_DOCUMENT_SCHEMA,ZI as WORKFLOW_POLICY_SCHEMA,gd as WORKSPACE_FLAG_CONTRACTS,TA as WORKSPACE_HISTORY_ID,_f as WORKSPACE_SNAPSHOT_ACTIONS,Wl as WorkspaceGraphCache,QO as WorkspaceTransactionInterruptedError,bu as _testOnly,w0 as _testOnlyAggregateCommand,Vl as _testOnlyConfigCommand,P0 as _testOnlyGetCommand,iu as _testOnlyHealthCommand,Dl as _testOnlyInit,xl as _testOnlyInitAgentGuidance,Ak as _testOnlyItemTransaction,Q0 as _testOnlyMutationEvents,C0 as _testOnlyNextCommand,H0 as _testOnlySearchCommand,_P as _testOnlySimilarity,Gm as _testOnlyTemplates,hu as _testOnlyValidateCommand,rk as _testOnlyWorkspacePosition,Ok as abandonItemTransaction,nR as abandonWorkspaceTransaction,CP as acceptAssuranceProposals,fu as acknowledgeLinkedTests,zl as acknowledgeUnknownAuthorHistoryEvents,ql as acknowledgeUnknownAuthorHistoryEventsFromTransport,Cv as acquireItemMetadataDerivedIndexLock,je as acquireLock,ti as acquireLockLease,sx as activateExtensionForTest,QC as activateExtensions,tm as admitStartWithOpenBlockers,ei as agentSessionEnvironment,q_ as aggregate,vf as analyzeAgentProvenanceDescriptorCoverage,MR as analyzeDefectChangeRisk,lM as analyzeDefectRecurrenceCoverage,gp as analyzeDuplicateItems,XO as analyzeGraphImpact,Hc as analyzeHierarchyIntegrity,JO as analyzeKnowledgeGraph,gI as analyzePmCommandExitConformance,en as analyzePmToolActionParity,JP as analyzeReconciliationDiscard,YO as analyzeRelationshipExecution,Dp as analyzeRelationshipSchedule,mg as analyzeSdkActionCoverage,Mt as analyzeSdkCliParameterCompleteness,th as append,qi as appendHistoryEntry,wA as appendWorkspaceAuditEvent,SA as appendWorkspaceHistoryChange,UT as applyAcceptanceCriteriaMutations,bP as applyAssurancePreset,Rd as applyBootstrapPagerPolicy,iM as applyClosureTimestampFix,xw as applyContextIntentProjection,Am as applyContextTagProjection,tI as applyFilterValueEcho,iv as applyHistoryPatch,$c as applyInvocationAuthorOverride,op as applyPathMigrations,QS as applyReadOutputDimensions,YS as applyReadOutputIncludeModes,$S as applyReadOutputSessionReferences,AE as applyRegisteredItemFieldDefaultsAndValidation,ap as applyStandaloneNote,Fs as applyStoredExtensionMigrationState,BT as applyTagRemovals,PM as applyTerminalOrderingPolicy,dp as artifactKey,_C as asRecordClone,fC as asRecordOrNull,He as assembleWorkspaceRelationshipGraph,dP as assertCompleteListResult,Ux as assertExtensionBlueprint,Gx as assertExtensionCapabilityUsage,Cx as assertExtensionDeactivated,qx as assertExtensionManifestCompatible,Bx as assertExtensionManifestMatchesBlueprint,zx as assertExtensionPreflight,Wc as assertHierarchyMutationAllowed,yM as assertHistoryCompactTarget,QP as assertHistoryRepairTarget,Ji as assertInitializedTracker,np as assertLinkedArtifactMutationIsUnambiguous,Kx as assertMcpClientCapabilities,Vx as assertMcpProtocolHeader,cb as assertMemoryRelationshipGraphAdapterConformance,HT as assertNoUnknownCsvKeys,vu as assertNonHierarchyCardinalityMutationAllowed,Ex as assertPackageManifest,xA as assertParentReferenceIsNotSelf,eL as assertPmMcpSkillsCapability,jx as assertProjectProfile,hv as assertProjectRuntimeCompatibility,mv as assertProjectRuntimeFormatGuard,uS as assertProjectionModeChoice,Xi as assertReadableTrackerRoot,Sx as assertRegisteredCommandContract,xx as assertRegisteredCommandOverride,Ix as assertRegisteredExporter,wx as assertRegisteredFlags,Ax as assertRegisteredHook,Rx as assertRegisteredImporter,Px as assertRegisteredItemField,Mx as assertRegisteredItemType,Fx as assertRegisteredMigration,Nx as assertRegisteredParserOverride,Lx as assertRegisteredPreflightOverride,kx as assertRegisteredProfile,Dx as assertRegisteredRendererOverride,vx as assertRegisteredSearchProvider,$x as assertRegisteredServiceOverride,Ox as assertRegisteredVectorStoreAdapter,xC as assertRelationshipEdgeAllowed,no as assertRelationshipGraphAdapterConformance,FT as assertSchemaPreviewSupported,Hf as assertTestMeasurementRun,zw as assertWellFormedOutputText,OI as assuranceAssertionUpdateIsLoosening,Dw as attachContextIntentReceipt,yw as attachContextUsageServingReceipt,lu as attachLinkedTestMutationProvenance,cu as attachLinkedTestProvenance,Ze as attachMcpServerInfo,yS as attachOutputOmissionReceipt,Fw as attachOutputTokenAccounting,$w as attachReadOutputContracts,FS as attachReadOutputSessionReceipt,hl as auditMergeAttributeFence,JI as auditMergeDriverConfiguration,Bp as auditWorkspaceRelationshipGraph,GN as authorizeMcpHttpRequest,Zn as boundAgentEpisodeIdentity,OS as boundReadOutputRows,Cm as buildChildrenByParent,G0 as buildCompactSearchFilterSummary,rI as buildContentFilterEcho,a0 as buildContextSignalSnapshot,Vy as buildCorpusShapeItemPlan,PR as buildDefectRecurrenceIndex,vl as buildExtensionDescribeResult,Rl as buildExtensionInstallPlan,oI as buildGovernanceMissingFilterEcho,qA as buildInvalidTypeError,O0 as buildItemChildrenRollup,Sk as buildItemCompletionMutations,HM as buildItemContextRelevanceCandidates,Ov as buildItemNotFoundError,I0 as buildItemSchedule,sM as buildLinkedFileRepairReport,PN as buildMcpAuthorizationDiscoveryUrls,gg as buildMcpCompleteResult,Yx as buildMcpDiscoverResult,LN as buildMcpDynamicRegistrationMetadata,EN as buildMcpHttpRequestHeaders,oN as buildMcpInputRequiredResult,IN as buildMcpProtectedResourceMetadata,fl as buildMergeAttributePatterns,Mc as buildPmActionToolInputSchema,OD as buildPmRefusalClosureCensus,fP as buildRelationshipContext,kv as buildSearchCorpus,Nv as buildSemanticCorpusInput,rM as buildStatusRoleWarnings,Yi as buildTrackerInitializationRecovery,Gv as buildVectorizationEmbeddingIdentity,Uv as buildVectorizationEmbeddingMetadata,U0 as buildVerboseSearchFilters,eP as buildWorkflowCompletenessCheck,f0 as buildWorkspaceMemorySnapshot,Jn as canonicalDocument,tC as canonicalizeCommandOptionKey,Uk as canonicalizeCommandSuggestions,qM as canonicalizeContextRecencyCoordinate,PC as canonicalizeRelationshipKind,yD as censusPmRecoveryReferenceProducers,aP as certifyCompleteListResult,rx as checkExtensionManifestCompatibility,Fh as claim,Gh as claimNext,lP as classifyHistoryAuthorEvent,Ci as classifyHistoryEvent,YP as classifyHistoryMergeReceiptReferences,HC as classifyHostEnvironmentFault,B0 as classifyImplicitSemanticFallbackReason,Hn as classifyItemFormatVersion,Kf as classifyLinkedTestCommandSafety,Wf as classifyLinkedTestFailure,hE as clearActiveExtensionHooks,Xp as clearDurableGraphCache,nS as clearFocusedItem,t_ as clearWorkspaceContractsCache,$h as close,Cu as closeItem,Kh as closeTask,Md as coalesceRepeatedListFlags,PO as collectBlockedByIds,kO as collectBlockedByIdsFromCorpus,Tw as collectContextUsageDeliveredItemIds,Zc as collectDanglingDependencyReferences,NO as collectDependencyBlockedIds,Xc as collectDuplicateDependencyRows,jp as collectDuplicateRelationshipEdgeGroups,j0 as collectErrorCauseCodes,zc as collectHierarchyRelations,Sr as collectMcpHeaderAnnotations,Qc as collectMissingDependencyTargetIds,Au as collectNewOrderingCycleWarnings,Fp as collectOrderingCycles,Jc as collectOrderingStorageContradictions,UO as collectPackageContextIntentContracts,jt as collectPackageExtensionDirectories,SE as collectRegisteredItemFieldNames,BE as collectRuntimeCreateFieldValues,zA as collectRuntimeFilterValues,qE as collectRuntimeUpdateFieldValues,hm as collectSubtreeIds,Nn as collectUsedExtensionCapabilities,rC as commandOptionFlagLabel,V_ as comments,A_ as commitImportedItem,wk as commitItemCompletion,Ek as commitItemMutations,tR as commitWorkspaceTransaction,qs as compactFlagAliasContracts,gm as compareCriticalItems,lv as comparePmDateVersions,ZO as compareRelationshipSnapshots,hC as compareTimestampStrings,UM as compileHistoryProvenanceMatcher,Mw as composeContextIntentContracts,Yk as composeExtension,tx as composeExtensionPackage,DO as computeActionabilityReport,gA as computeHistoryDiff,Np as computeRelationshipCentrality,xp as computeRelationshipDominators,Kl as computeWorkspaceGraphFingerprint,oh as config,_E as consumeAfterCommandAffectedItems,$_ as context,Lw as contextIntentRowId,jh as copy,Yf as countFailureCategories,AS as countReadOutputRows,Nh as create,yP as createAssurancePreset,dM as createAssuranceWorkspaceContext,yC as createCheckpointId,iP as createCompleteListOptions,eE as createCoreCommandHookContext,eo as createCorpusShapeMeasurement,kI as createEmptyAssuranceDocument,BC as createEmptyExtensionRegistrationRegistry,Jv as createExtensionCommandError,Ls as createExtensionCommandSdk,Mn as createExtensionContributionInventory,Hx as createExtensionTestHarness,Bi as createHistoryEntry,uO as createLazyModule,tP as createLifecycleCompletenessPolicies,UN as createMcpStaticBearerVerifier,gN as createMcpTaskStore,vv as createMutationGuardSdk,mS as createOutputOmissionReceipt,ls as createPmCliExpectedError,Ns as createPmCliProgram,Ri as createPmCommandOutputBudget,dw as createQueryFingerprint,db as createRelationshipGraphScaleFixture,Z as createRelationshipGraphSnapshot,wt as createRelationshipKindRegistry,Uc as createReproducibleProcessRunner,$0 as createSearchCursorFingerprint,tE as createSerialQueue,JT as createStdinTokenResolver,RC as createUnknownSubcommandError,$T as createWorkflowPolicyEvaluator,hf as createWorkspaceSnapshot,ax as deactivateExtensionForTest,_1 as declineServiceOverride,Nw as decodeContextIntentCursor,pO as decodeHtmlEntitiesInOptions,Er as decodeMcpHttpHeaderValue,Uw as decodePmTableRows,uw as decodeQueryCursor,lw as decodeQueryCursorEnvelope,pw as decodeQueryCursorState,sw as decodeReadOutputContinuationCursor,nx as decodeToon,HN as decoratePmMcpToolsWithApps,lp as dedupeLinkedArtifacts,vE as defaultConfigScope,KM as defaultScoreContextCandidates,C1 as defineAfterCommandHook,b1 as defineBeforeCommandHook,T1 as defineBeforeMutationHook,o1 as defineCommand,l1 as defineCommandOverride,W as defineCorpusShape,lL as defineEpisodeSpecification,y1 as defineExporter,Kk as defineExtension,Wk as defineExtensionBlueprint,t1 as defineExtensionManifest,n1 as defineFlag,g1 as defineImporter,s1 as defineItemField,i1 as defineItemType,a1 as defineMigration,Dy as defineObservationContract,w1 as defineOnIndexHook,S1 as defineOnReadHook,E1 as defineOnWriteHook,p1 as defineParserOverride,Ii as definePmCommandOutputBudget,cI as definePmCommandOutputEnvelope,iI as definePmErrorCodeCatalog,u1 as definePreflightOverride,r1 as defineProjectProfile,h1 as defineRendererOverride,d1 as defineSearchProvider,m1 as defineServiceOverride,c1 as defineVectorStoreAdapter,Uy as defineVerdictContract,ve as defineWorkspaceRecipe,Bh as deleteItem,Ef as deleteWorkspaceSnapshot,NC as dependencyToRelationship,Q_ as deps,TP as deriveAssuranceProposals,oM as deriveClosureTimestamp,Jk as deriveExtensionCapabilities,pk as deriveMutationTransactionId,yI as derivePmBulkMutationEffect,bD as derivePmRecoveryReferenceObligations,$p as deriveRelationshipDeadlines,Tl as deriveSchemaEvolutionMigrationId,oO as deriveTelemetryCommandResolution,WA as describeAllowedTransitions,qI as describeExtensionActivation,Zk as describeExtensionBlueprint,AC as describeFlagScalarValueFailure,nm as describeItemOwnershipConflict,Ms as describeItemRevisionChanges,cL as describeObservationCost,Xt as describeProfileComposition,Jt as describeProjectProfile,Pk as describeReadCompletenessControls,Zv as describeUnknownError,pi as detectAgentIdentity,_i as detectHarnessIdentity,Mp as detectRelationshipCommunities,ui as diagnoseAgentIdentity,qp as diffRelationshipAuditSnapshots,Uf as diffTestRunMeasurements,sN as digestMcpRequestParameters,JC as discoverExtensions,Tn as discoverNearbyPmRoot,M$ as discoverPmTools,uv as discoverProjectRuntimeVersionPins,Z_ as docs,H_ as duplicates,Vp as durableGraphCachePath,Jp as durableGraphCacheStatus,qn as effectiveItemFormatVersion,wO as emitTelemetryErrorEvent,w_ as emptyImportedDocument,IP as encodeItemScalarDecisionValue,Cr as encodeMcpHttpHeaderValue,Gw as encodePmTableRows,cw as encodeQueryCursor,iw as encodeReadOutputContinuationCursor,ix as encodeToon,yA as enforceHistoryStreamPolicyForItem,bA as enforceHistoryStreamPolicyForItems,vR as enrichCliFlagInvocationContract,Pt as enrichCliFlagInvocationContracts,av as ensureMaterializedHistoryTarget,pl as ensurePmGitignore,Zl as ensureScope,Yv as ensureSentryCommandTracing,Wv as ensureSentryInit,S_ as ensureTrackerInitialized,Ip as enumerateRelationshipPaths,ki as estimatePmOutputTokens,NI as evaluateAssuranceAssertion,LI as evaluateAssuranceGate,RL as evaluateBoundaryFixtures,JM as evaluateContextRanking,kR as evaluateDefectGateEvidence,xI as evaluateMeasurement,of as evaluateMetricFloors,fs as evaluateMutationGuard,kf as evaluateProvenanceCoverage,q1 as evaluateReliabilityWindow,If as evaluateSemanticAttributionCoverage,bp as evaluateSimilarityGovernance,KA as evaluateTransition,jy as evaluateVerdictContract,DT as evaluateWorkflowPolicies,ts as executeEmbeddingBatchesWithRetry,$v as executeVectorDelete,Fv as executeVectorReset,Dv as executeVectorUpsert,ky as executeWorkspaceRecipe,sp as expandAddGlobEntries,Cp as explainSourceTraceability,SM as exportAttestation,Wh as extension,Xh as extensionActivate,Jh as extensionDeactivate,Yh as extensionList,Wb as extensionMigrate,WP as extractHistoryMergeReceiptDispositions,KP as extractHistoryMergeReceiptReferences,DN as extractMcpTraceContext,ov as extractPatchFailureContext,su as extractReferencedPmItemIdsFromCommand,ab as federateRelationshipGraphSnapshots,Y_ as files,X_ as filesDiscover,J_ as filesLookup,Cw as finalizeContextUsageDelivery,Zy as findCoverageDeficits,yp as findDuplicateClusters,ml as findGitWorkspaceRoot,$E as findHistoryIdentityDiscontinuities,wl as findInstalledNpmPackageCandidate,zN as findPmMcpAppByUri,Lo as findPmNamespacedCommand,kp as findRedundantRelationshipEdges,Lp as findRelationshipCutStructure,hp as findSimilarItems,SO as finishTelemetryCommand,VO as fitOutputEnvelope,wC as flattenFlagListValue,Yy as flushTelemetryQueue,zh as focus,Pp as forEachMatchedRelationshipEdge,Up as formatDuplicateEdgeGroup,Vc as formatHierarchyRelation,Gp as formatOrderingStorageContradiction,gR as formatPmPositionalActionFlagTip,Jm as formatProfileApplyHuman,Xm as formatProfileLintHuman,Wm as formatProfileListHuman,Ym as formatProfileShowHuman,Sl as formatSchemaEvolutionMigrationHuman,z0 as formatVectorIndexRecoveryWarnings,tk as formatWorkspacePositionHuman,Rh as gc,Vi as generateItemId,j_ as get,uE as getActiveCommandResult,Iw as getActiveContextIntentContracts,Dn as getActiveExtensionRegistrations,FN as getActiveMcpTraceContext,$I as getAssuranceDeclaration,lg as getContracts,rS as getFocusedItem,Sn as getHistoryPath,zO as getItemAt,En as getItemPath,gs as getMutationActionContract,ll as getPmGitignoreBlock,Cn as getSettingsPath,r_ as getWorkspaceContracts,CA as getWorkspaceHistoryPath,eh as graph,Kp as graphAuditBaselinePath,Pf as groupHistoryByEpisode,f1 as handleServiceOverride,Wx as hasMcpClientExtension,qN as hasPmMcpAppsCapability,ze as hasSubcommandFlagContractsForCommand,jv as hasVectorizationEmbeddingIdentityChanged,Bv as hasVectorizationVectorDimensionChanged,sA as hashDocument,aA as hashDocumentForVersion,dA as hashEmptyDocument,eA as hashHistoryPatch,Qw as hashHistoryRecord,tA as hashHistoryStream,PP as hashItemScalarDecisionValue,Oh as health,Ap as hierarchyAncestors,vp as hierarchyDescendants,kh as historyCompact,xh as historyCompactBulk,DE as historyDigest,GM as historyEntryMatchesProvenance,pv as historyItemHashVersionForRuntime,Ih as historyRedact,Ph as historyRepair,Mh as historyRepairAll,MO as indexBlockedByIds,Kc as indexHierarchyRelations,qv as inferConsistentVectorDimension,Oi as inferPmOutputBudgetClass,rh as init,sP as inspectCompleteListResult,qC as inspectExtensionManifestSchema,Fl as inspectHistoryAuthorStream,FP as inspectMergeReceiptEvidence,_v as inspectProjectRuntimeCompatibility,Ss as inspectStaleInProgressItems,fg as inspectStaticExtensionInventory,tM as inspectStatusRoleAssignments,EA as inspectWorkspaceHistoryState,gf as inspectWorkspaceSnapshot,bl as installMergeFence,Xx as interpretMcpResultType,Rm as isAlreadyClaimedError,tO as isCommanderError,xk as isCompatibleRecoveryFlag,Wd as isErrnoError,vO as isExternalDependencyReference,OO as isExternalDependencySourceKind,fe as isFileMissingError,$i as isGenericRefusalRequired,Fi as isGenericRefusalWhy,$C as isHostOutputSuppressed,cs as isItemAlreadyExistsError,ks as isItemRevisionConflict,RP as isItemScalarMissingValue,zP as isLegacyMergeReceiptSummary,h as isMcpRecord,_s as isMutationAction,kC as isOrderingRelationshipKind,MA as isPlaceholderReferenceToken,os as isPmCliErrorDetails,ps as isPmCliExpectedError,rn as isPmExtensionCapabilityContract,nn as isPmExtensionPolicyModeContract,sn as isPmExtensionPolicySurfaceContract,on as isPmExtensionServiceNameContract,hI as isPmKnownExitCode,pI as isPmMutationReceipt,We as isPmSuccessfulExitCode,as as isPmTokenBudgetRecovery,tn as isPmToolAction,HP as isPreDurableCloneLocalReceiptSummary,VP as isPreDurableDispositionEligibleReference,fv as isProjectMutatingInvocation,mO as isPureSnakeCaseAlias,tw as isReadOutputBudgetExceeded,xS as isReadOutputSessionReference,kk as isReadProjectionRecoveryFlag,ew as isReadResultOmittedForBudget,_S as isReadRowContract,Bc as isRuntimeRecord,JA as isSettingsReadFallback,em as isStartTransition,hO as isTerminalPlanMode,HE as isTerminalStatus,In as isTimestampLiteral,hk as itemDocumentToMutationOptions,R0 as itemHasSchedule,kn as jaccardSimilarity,W_ as learnings,vC as levenshteinDistanceWithinLimit,Hd as limitAnnotationEntries,pu as linkedTestTrustFingerprint,Qk as lintExtensionBlueprint,zC as lintExtensionManifestSchema,er as lintProjectProfile,F_ as list,si as listAgentProvenanceAdapters,Pd as listAliasPluralKeys,G_ as listAllComplete,wv as listAllDocumentCandidatesCached,es as listAllItemMetadata,Av as listAllItemMetadataLight,DI as listAssuranceDeclarations,BI as listAssuranceVerdicts,zy as listBuiltinCorpusShapes,jk as listCoreClosedDomainContracts,uR as listGetProjectionFields,AP as listInvalidProvenanceHistoryStreamIds,cR as listListProjectionFields,GP as listMergeReceipts,hs as listMutationActions,X0 as listMutationEvents,ho as listPmCommandFlagBudgets,ol as listPmCommandsForFamily,rl as listPmCommandsForTier,Me as listPmFlagLexicon,JD as listPmFlagSpellingInventory,nl as listPmMcpToolsForProfile,UD as listPmRequiredArgumentRefusalContracts,jD as listPmSubcommandRefusalContracts,Yt as listProfiles,zD as listTrackerPreflightRecoveryContracts,bk as listUpsertKeyCandidates,yf as listWorkspaceSnapshots,jO as loadContextIntentRuntimeLayers,Um as loadCreateTemplateOptions,ZC as loadExtensions,Qp as loadGraphAuditBaseline,Tk as loadGuardedRuntimeSchema,TC as loadMutationCheckpoint,x as loadRelationshipGraphAdapter,Zi as locateItem,zT as looksLikeGenericKeyValueEntry,vS as mapReadOutputRows,UP as markMergeReceiptReconciled,HA as matchesRuntimeFilters,CO as maybeRunFirstUseTelemetryPrompt,Ky as measureCorpusShapePlan,Wi as measureItemMetadataReadWork,jT as mergeAdditiveTags,Xk as mergeExtensionBlueprints,MP as mergeHistoryStreams,LP as mergeItemDocuments,DP as mergeJsonDocuments,kd as mergeLinkedTestTwoTokenEntries,kP as mergeRelationshipEventStreams,Sm as mergeSortedWarnings,_O as migrateItemFilesToFormat,Iv as mutateItem,Rv as mutateItemWithHistoryContext,AA as mutateWorkspaceJsonWithHistory,B_ as next,di as normalizeAgentProvenanceAdapterValue,zd as normalizeAnnotationTransportOptions,SI as normalizeAssuranceEvaluation,EI as normalizeAssuranceMutation,xd as normalizeBootstrapInvocation,PE as normalizeBulkIdsValue,Yc as normalizeDependencyGraphTarget,YR as normalizeDependencySeedId,WR as normalizeDependencySourceKind,xt as normalizeDirectExtensionCommandOptions,Rs as normalizeExpectedItemHash,Pn as normalizeExtensionContributionInventory,tS as normalizeHistoryOperationForWrite,wP as normalizeInvalidHistoryProvenance,AR as normalizeItemAddressInvocation,zn as normalizeItemFormatVersion,Hi as normalizeItemId,Wn as normalizeItemMetadata,XR as normalizeItemReference,Id as normalizeLegacyExtensionActionSyntax,ip as normalizeLinkedPath,PA as normalizeParentReferenceValue,Kt as normalizeProfileName,zi as normalizeRawItemId,XS as normalizeReadOutputIncludeModeOptions,uA as normalizeReplayPatchOps,ys as normalizeSimilarityText,zE as normalizeStatusForRegistry,Kn as normalizeStatusInput,GE as normalizeStatusInputWithRegistry,eO as normalizeThrownExitCode,K_ as notes,Rn as nowIso,Wp as openDurableGraphCache,iN as openMcpRequestState,pL as openPmEpisode,Op as orderingPredecessors,Rp as orderingSuccessors,r0 as packContextCandidates,ym as packRankedContextItems,ag as packageActivate,sg as packageCatalog,dg as packageDeactivate,ng as packageDescribe,rg as packageDoctor,eg as packageInstall,Zh as packageLifecycle,Qh as packageList,og as packageManage,Yb as packageMigrate,ig as packageReload,tg as packageUninstall,fw as paginateQueryRows,Ql as parseAddEntries,ep as parseAddGlobEntries,Kd as parseAnnotationTextInput,uk as parseAtomicMutationControls,Od as parseBootstrapCommandName,wd as parseBootstrapGlobalOptions,vd as parseBootstrapHelpRequest,Nd as parseBootstrapTypeValue,IE as parseBulkIdsText,fm as parseContextDepth,lm as parseContextFocusFields,FO as parseContextIntentDeclarations,_m as parseContextSections,s0 as parseContextSignalSnapshot,qT as parseCsvKv,LR as parseDefectChangeRiskRequest,cM as parseDefectRecurrenceCoverageRequest,NR as parseDefectRecurrencePolicy,rf as parseEvalMetricFloors,df as parseEvalQuerySet,Is as parseExpectHashSpecs,lC as parseExtensionLongFlagToken,ru as parseGraphSubcommand,EM as parseHistoryAttestation,$M as parseHistoryProvenanceFilters,DR as parseIntegerLimit,VE as parseItemDocument,mk as parseItemMutationBatch,BA as parseLimit,Gu as parseLinkedTestAssertionEqualsMap,Uu as parseLinkedTestAssertionGteMap,xu as parseLinkedTestBoolean,Nu as parseLinkedTestContextMode,ku as parseLinkedTestEnvClear,Mu as parseLinkedTestEnvSet,ju as parseLinkedTestJsonEntries,Fu as parseLinkedTestMinLines,$u as parseLinkedTestRegexList,Du as parseLinkedTestStringList,Lu as parseLinkedTestWorkspaceContextMode,wg as parseMcpCachePolicy,_g as parseMcpImplementation,tt as parseMcpInputRequests,lr as parseMcpInputResponses,Wg as parseMcpSubscriptionFilter,rp as parseMigrateEntries,GR as parseMultiValueFilter,uI as parseMutationReceipt,QT as parseOptionalNonNegativeInteger,ZT as parseOptionalNumber,pD as parsePmAgentTaskTranscriptCorpus,P$ as parsePmToolDiscoveryOptions,$R as parsePriority,BR as parsePriorityFilterSet,DS as parseReadOutputSession,wE as parseRegisteredItemFieldAssignments,ae as parseRelationshipGraphSnapshot,tp as parseRemoveEntries,Tp as parseSourceLineRange,FA as parseStatusFilterCsv,UR as parseStringFilterSet,an as parseTags,Ff as parseTestRunMeasurements,FR as parseType,jR as parseTypeFilterSet,Bl as parseUnknownAuthorHistoryEventCoordinates,PT as parseWorkflowPolicy,MT as parseWorkflowPolicyDocument,E0 as partitionDecisionEntries,hA as patchPathToChangedField,dn as pathExists,Vh as pauseTask,Yp as persistDurableGraphResult,XA as persistSelectedItemFormat,uP as planAgentIdentityVocabularyMutation,u0 as planCompletedAtBackfill,Il as planExtensionDirectoryCopy,Vk as planItemMutationDocument,tr as planProfileApplication,_D as planRelationshipEventBackfill,tu as planRelationshipRemediation,Cl as planSchemaEvolutionMigration,Ul as planUnknownAuthorHistoryAcknowledgment,bf as planWorkspaceSnapshotRestore,TR as positionalShapeKey,CR as positionalSignatureKey,ox as preflightExtension,Ts as prepareSimilarityText,KT as preserveMutationStdinTokenFields,VT as preserveMutationStdinTokenLiterals,Hk as previewItemMutationDocument,Ck as previewItemMutations,Ww as printError,Kw as printResult,Ch as profile,wh as profileApply,Ah as profileLint,Eh as profileList,Sh as profileShow,fE as projectAfterCommandItemSnapshot,pm as projectContextFocusRows,Df as projectFleetAttributionAnalytics,FM as projectHistoryProvenance,ji as projectLeanRecoveryPayload,jw as projectPmBriefListEnvelope,Bw as projectPmBriefSearchEnvelope,ss as projectPmCliErrorContextDetails,ns as projectPmCliErrorDetails,Ni as projectPmDiagnosticOutput,Li as projectPmDiagnosticText,Nf as projectProvenanceCoverageAnalytics,_u as projectValidateCounts,EP as promoteAssuranceAssertion,bw as propagateContextUsageServingReceipt,NL as pruneCompileCacheGenerations,FI as putAssuranceDeclaration,GI as putAssuranceDeclarationBundle,gv as queryItemMetadataIndex,yv as queryLinkedFileMetadataIndex,bv as querySimilarItemMetadataIndex,Gf as queryTestRunMeasurementsBelow,An as quoteCommandArg,wn as quoteWindowsCommandArg,Gk as rankCommandPaths,Vd as readAnnotationEntries,mi as readAuthorEnvironment,n_ as readBooleanOption,vw as readContextUsageAffinity,i_ as readCsvListOption,$s as readExtensionMigrationState,cn as readFileIfExists,jd as readFirstStringFromCommanderOptions,Bd as readFirstValueFromCommanderOptions,Mf as readHistoryAnalyticsWindow,aS as readHistoryEntries,gi as readHistorySnapshot,wf as readImprovementLedger,Ev as readItemMetadataDerivedIndexState,Ps as readItemRevision,vk as readItemTransaction,Qi as readLocatedItem,wS as readOutputBudgetCollections,nw as readOutputCollectionFingerprint,SS as readOutputContinuationRowCollections,CS as readOutputContinuationRowPaths,WS as readOutputIncludeModeOptions,kS as readOutputRetainsTail,ES as readOutputRowCollections,TS as readOutputRowPaths,GS as readOutputSessionRemainingTokens,Ut as readPmPackageManifest,e_ as readRequiredString,jE as readRuntimeFieldOptionValue,Ki as readSettings,bO as readSettingsSection,ZA as readSettingsWithMetadata,qd as readStringArrayFromCommanderOptions,o_ as readStringOption,Qv as readThrownExitCode,zv as readVectorizationStatusLedger,dv as readWorkflowPolicies,kT as readWorkflowPolicyField,GO as readWorkspaceContextIntentContracts,l0 as readWorkspaceContextSignals,_0 as readWorkspaceMemory,ek as readWorkspacePosition,rR as readWorkspaceTransaction,_A as reanchorHistoryEntries,H1 as reconcileArtifactLedgers,Ln as reconcileExtensionCapabilityUsage,OA as reconcileWorkspaceJsonHistory,mE as recordAfterCommandAffectedItem,jI as recordAssuranceVerdict,Hu as recordClaimSemanticAttribution,Sw as recordContextUsageDelivery,Ew as recordContextUsageServing,ww as recordContextUsageTouch,Aw as recordContextUsageTouches,Ku as recordFocusSemanticAttribution,Sf as recordImprovementObservation,Vu as recordReleaseSemanticAttribution,Sv as refreshItemMetadataDerivedIndex,gl as refreshMergeAttributeFenceIfInstalled,IS as refreshReadOutputDeliveredCounts,Vv as refreshSearchArtifactsForMutation,ai as registerAgentProvenanceAdapters,VR as registerExternalDependencyResolver,ii as registerHarnessSignalDescriptors,dS as registerOutputMaterialFieldGroups,Uh as release,RS as rememberReadOutputFocusRows,UI as removeAssuranceDeclaration,ln as removeFileIfExists,mp as renameArtifactsResultKey,sm as renderCalendarMarkdown,am as renderCalendarToon,wm as renderContextMarkdown,Ol as renderExtensionDescribeMarkdown,Al as renderExtensionSurfaceMarkdown,R_ as renderGuideMarkdown,Dk as renderMissingOptionRetry,S0 as renderNextMarkdown,Bk as renderPmClosedDomainHelp,vn as renderPmCommand,Go as renderPmCommandAliasMigrationHint,al as renderPmCommandVisibilityMarkdown,QD as renderPmFlagLexiconMarkdown,VN as renderPmMcpAppHtml,RD as renderPmRefusalClosureCensusMarkdown,UA as renderRowsAsCsv,jA as renderRowsAsTable,Dh as reopen,sv as replayHistoryToTarget,lA as replayToCanonicalItemDocument,cA as replayToItemDocument,eS as requireHistoryOperation,RM as requireTerminalReason,IM as requireTerminalReasonWithRecovery,nA as resealHistoryRewrite,cE as resetActiveExtensionRuntimeState,Xl as resetWorkspaceGraphCache,Qn as resolveAgentSessionContextFromSignals,Zd as resolveAnnotationIndex,Yd as resolveAnnotationInput,sS as resolveAuthor,hi as resolveAuthorIdentity,IA as resolveBodyFileContent,Hy as resolveBuiltinCorpusShape,im as resolveCalendarOutputFormat,sI as resolveCanonicalPmErrorCodeContract,MC as resolveCanonicalRelationshipKind,iS as resolveClaimPrincipal,ME as resolveCliBulkIdsInput,iC as resolveCommandOptionPolicyState,xL as resolveCompileCacheGeneration,p0 as resolveCompletionTimestamp,UC as resolveConfiguredPmPackageRoot,ZR as resolveContentFieldFilters,kw as resolveContextIntentContract,um as resolveContextOutputFormat,mm as resolveContextTokenBudget,MM as resolveCreateExplicitEmptyFlag,As as resolveDeclaredBlockers,x0 as resolveEffectiveSearchMode,Pv as resolveEmbeddingProviders,kt as resolveExtensionFlagOptionKey,SC as resolveExtensionFlagValueContract,Pl as resolveExtensionInstallSourceIdentity,pC as resolveExtensionLongFlagName,Ds as resolveExtensionMigrationStatePath,XC as resolveExtensionRoots,KR as resolveExternalDependencyReference,EC as resolveFlagValueKind,dC as resolveGlobalPmRoot,v_ as resolveGuideOutputFormat,Af as resolveHistoryEpisodeGroupIdentity,LE as resolveHistoryHashAlgorithm,QE as resolveHistoryOperation,DM as resolveHistoryProvenanceDimensions,AO as resolveHistorySubject,nv as resolveHistoryTarget,L0 as resolveHybridSemanticWeight,bn as resolveImplicitPmRoot,gC as resolveIsoOrRelative,xO as resolveItemBlockers,RO as resolveItemExecutionRole,_k as resolveItemMutationDocument,om as resolveItemOwnershipConflict,yn as resolveItemTypeRegistry,FE as resolveItemTypesFilePath,Rk as resolveLifecycleVerbRecovery,cC as resolveLinkedResourcePositionalRecovery,Xf as resolveLinkedTestFailureExitCode,au as resolveLinkedTestSourceRef,du as resolveLinkedTestSourceWorkspaceRoot,uu as resolveLinkedTestTrust,mu as resolveLinkedTestTrustBatch,Yg as resolveMcpAcknowledgedSubscriptionFilter,Je as resolveMcpRequestContext,ul as resolveMergeInstallContext,$k as resolveMisnestedCommandPath,JR as resolveMissingMetadataFilters,Lk as resolveMissingOptionPlaceholder,fS as resolveModePairedOutputOmissionReceipt,T0 as resolveNextOutputFormat,gS as resolveOutputOmissionReceipt,GC as resolvePmCliVersion,Fo as resolvePmCommandAlias,Ve as resolvePmCommandCapabilityFamily,Dt as resolvePmCommandExitContract,L as resolvePmCommandOperation,Mi as resolvePmCommandOutputBudget,Lt as resolvePmCommandOutputEnvelope,_R as resolvePmCommandPositionalContract,On as resolvePmCommandScopeArgs,Ke as resolvePmCommandVisibilityTier,xi as resolvePmDiagnosticOutputBudget,aI as resolvePmErrorCodeContract,qb as resolvePmFlagSemanticConcept,Le as resolvePmHistoryOperation,Qx as resolvePmMcpExecutableInvocation,FC as resolvePmPackageRootFromModule,hR as resolvePmPositionalActionContract,Ed as resolvePmPositionalActionFlagContracts,Ge as resolvePmRoot,Oc as resolvePmToolCustomFieldCollision,NA as resolvePriority,Wt as resolveProfile,_l as resolveProjectMergeTypeFolders,mw as resolveQueryCursorStart,Ik as resolveReadCompletenessControls,Mk as resolveReadOptionRetryArgs,JS as resolveReadOutputDimensions,rw as resolveReadOutputEncoding,PS as resolveReadOutputRecoveryBudget,zS as resolveReadOutputSurface,hS as resolveReadRowContract,Nk as resolveRecoveryCommandName,OE as resolveRegisteredSearchProvider,RE as resolveRegisteredVectorStoreAdapter,Gc as resolveReproducibleProcessEnvironment,Un as resolveRuntimeFieldRegistry,Gn as resolveRuntimeStatusRegistry,Mv as resolveSearchCorpusFields,k0 as resolveSearchMaxResults,F0 as resolveSearchPage,N0 as resolveSearchScoreThreshold,D0 as resolveSearchTuning,xv as resolveSemanticCorpusCharacterLimit,zu as resolveSemanticLineageIds,ev as resolveSettingsWithSemanticRuntimeDefaults,VI as resolveSourceContextWritePolicy,Ju as resolveStartTaskInProgressStatus,ee as resolveSubcommandFlagContractsForCommand,AT as resolveTelemetryErrorCategory,Kv as resolveTelemetrySourceAttribution,OM as resolveTerminalReason,yk as resolveTransactionSchema,nC as resolveTypeDefinition,oC as resolveTypeName,GA as resolveTypeSynonym,VA as resolveTypeWorkflows,jl as resolveUnknownAuthorAcknowledgmentSelector,q0 as resolveVectorIndexRecovery,Lv as resolveVectorStores,qc as resolveWorkspaceRelationshipKindRegistry,aC as resolveWorkspaceRoot,qh as restore,CC as restoreCheckpointItems,RA as restoreWorkspaceJsonFromHistory,Cf as restoreWorkspaceSnapshot,Tf as restoreWorkspaceSnapshotWithRecovery,ug as runAction,gE as runActiveBeforeMutationHooks,bE as runActiveCommandHandler,yE as runActiveOnIndexHooks,Fn as runActiveOnReadHooks,$n as runActiveOnWriteHooks,TE as runActiveParserOverride,CE as runActivePreflightOverride,EE as runActiveServiceOverride,cm as runActivity,YC as runAfterCommandHooks,Zm as runAggregate,Jd as runAnnotationCommand,Tu as runAppend,mM as runAssuranceAction,fM as runAssuranceDispatch,WC as runBeforeCommandHooks,dm as runCalendar,Im as runClaim,Pm as runClaimNext,Eu as runClose,Su as runCloseMany,Nm as runCloseTask,Qd as runComments,I_ as runCompletion,Hl as runConfig,zt as runContext,e0 as runContextEvaluationCorpus,ZM as runContextEvaluationScenario,wu as runCopy,Bu as runCreate,qu as runDelete,Jl as runDeps,fp as runDocs,hP as runDuplicates,lf as runEval,uf as runEvent,Ml as runExtension,Us as runExtensionMigrateAction,Gs as runExtensionMigrations,Ep as runFiles,wp as runFilesDiscover,Sp as runFilesLookup,Lf as runFleetAttributionAnalytics,Xu as runFocus,yu as runGc,Qm as runGet,ou as runGraph,O_ as runGuide,nu as runHealth,M0 as runHistory,AM as runHistoryAttest,hM as runHistoryCompact,bM as runHistoryCompactBulk,XP as runHistoryMaintenance,TM as runHistoryRedact,ZP as runHistoryRepair,eM as runHistoryRepairAll,$l as runInit,Nl as runInitAgentGuidance,ec as runLearnings,up as runLinkedArtifacts,Jf as runLinkedTests,el as runList,pf as runMeet,K0 as runMergeDriver,yl as runMergeInstall,BP as runMergeReceiptEvidenceReport,jP as runMergeReceiptReport,W0 as runMergeReconcile,Om as runNext,tc as runNotes,xm as runPauseTask,Dm as runPlan,Km as runProfileApply,Vm as runProfileLint,zm as runProfileList,Hm as runProfileShow,xf as runProvenanceCoverageAnalytics,dx as runRegisteredCommandForTest,mx as runRegisteredCommandOverrideForTest,Tx as runRegisteredExporterForTest,lx as runRegisteredHookForTest,bx as runRegisteredImporterForTest,yx as runRegisteredMigrationForTest,cx as runRegisteredMutationGuardForTest,px as runRegisteredParserOverrideForTest,ux as runRegisteredPreflightOverrideForTest,fx as runRegisteredRendererOverrideForTest,hx as runRegisteredSearchProviderForTest,_x as runRegisteredServiceOverrideForTest,gx as runRegisteredVectorStoreAdapterForTest,rr as runReindex,Mm as runRelease,mf as runRemind,xM as runReopen,$m as runRestore,El as runSchemaEvolutionMigration,ef as runSearch,Wy as runSearchRefreshWorkerEntrypoint,P_ as runStartBackgroundRun,km as runStartTask,jf as runStats,qf as runTelemetry,Bm as runTemplatesList,jm as runTemplatesSave,qm as runTemplatesShow,Zf as runTest,Qf as runTestAll,M_ as runTestRunsList,x_ as runTestRunsLogs,L_ as runTestRunsResume,k_ as runTestRunsStatus,N_ as runTestRunsStop,D_ as runTestRunsWorker,rm as runUpdate,Fm as runUpdateMany,Bt as runUpgrade,gu as runValidate,pg as runWithActiveExtensions,D as runWithAgentSessionContext,YA as runWithConfigurationOnlySettings,Pw as runWithContextIntentContracts,BO as runWithDiscoveredContextIntentContracts,ci as runWithHarnessDetectionSignals,$N as runWithMcpTraceContext,jc as runWithReproducibleProcessEnvironment,li as runWithWorkspaceHarnessSignalDescriptors,Vr as runWithWorkspaceRecipe,rP as runWorkflowPolicyAction,_M as runWorkspaceTransactionGc,eu as saveGraphAuditBaseline,nM as scanClosureTimestamps,SP as scanExtensionHostVersions,Gl as scanHistoryAuthorAttribution,Vn as scanItemFormatVersions,ms as scanMutationSecrets,vP as scanProvenanceResolverHealth,ws as scanStaleInProgressItems,aM as scanStorageIntegrity,nh as schema,ph as schemaAddField,ch as schemaAddStatus,ah as schemaAddType,_h as schemaApplyPreset,hh as schemaInferTypes,ih as schemaList,mh as schemaListFields,bh as schemaRemapStatus,uh as schemaRemoveField,lh as schemaRemoveStatus,dh as schemaRemoveType,yh as schemaRenameField,gh as schemaRenameType,sh as schemaShow,fh as schemaShowField,Th as schemaShowStatus,Fk as scoreCommandPathMatch,WM as scoreContextCandidates,YM as scoreContextCandidatesWithActiveExtensions,Cs as scoreItemSimilarity,BD as scorePmGrammarRefusalClosure,MD as scorePmRefusalClosure,Es as scorePreparedItemSimilarity,HD as scoreTrackerPreflightRecoveryClosure,rA as sealHistoryRecord,nN as sealMcpRequestState,U_ as search,y0 as searchWorkspaceMemory,b0 as searchWorkspaceMemoryReadResult,LO as selectActionableEntries,aw as selectCursorSemanticOptions,E_ as selectImportAuthor,kN as selectMcpClientRegistrationMode,g0 as selectWorkspaceMemory,h0 as selectWorkspaceMemoryRollups,Yu as semanticAttributionAffinity,dO as sentryCaptureCliError,sO as sentryDiscardCommandSpan,aO as sentryFinishCommandSpan,lO as sentryFlush,cO as sentryLogCliUsageError,nO as sentrySetCommandContext,iO as sentryStartCommandSpan,Xn as serializeItemDocument,qk as serializeNdjsonRows,zk as serializeNdjsonStream,$y as serveDeclaredObservation,lE as setActiveCommandContext,pE as setActiveCommandResult,oE as setActiveExtensionCommands,rE as setActiveExtensionHooks,nE as setActiveExtensionParsers,iE as setActiveExtensionPreflight,dE as setActiveExtensionRegistrations,aE as setActiveExtensionRenderers,sE as setActiveExtensionServices,oS as setFocusedItem,yO as settingsSectionRevision,gO as shouldCompletePlanOnClose,Zp as shouldPersistDurableGraphCache,XT as shouldResolveMutationStdinTokenField,YT as shouldResolveMutationStdinTokens,rv as shouldRunSearchRefreshInForeground,_p as similarityAdvisoryWarnings,bS as sliceReadOutputRowCollection,is as snapshotPmCliErrorContext,cp as sortLinkedArtifacts,GT as splitAcceptanceCriteria,fO as splitCommaList,Yn as splitFrontMatter,ZS as stabilizeReadOutputReceiptEstimates,I as stableStringify,fk as stableUpsertValue,vT as stableValueEquals,Hh as startTask,EO as startTelemetryCommand,z_ as stats,UE as statusIsTerminal,Ad as stripGlobalBootstrapTokens,J0 as subscribeMutationEventBatches,Z0 as subscribeMutationEvents,pP as summarizeAgentIdentityVocabulary,Of as summarizeAgentModelProvenance,Rf as summarizeAgentProvenance,QM as summarizeContextEvaluationReports,Vf as summarizeContextPreflight,jM as summarizeHistoryProvenance,Ll as summarizeInitResult,$P as summarizeMergeReceipt,kM as supportsCreateExplicitEmpty,wR as supportsItemIdAlias,DC as suppressHostOutput,Re as syncRelationshipGraphAdapter,ex as synthesizeExtensionManifest,Sd as toCompletionFlagString,Em as toContextFocusItem,bm as toContextPackingSummary,Tm as toContextRankingSummary,mC as toErrorMessage,a_ as toEstimatedMinutesValue,dk as toExtensionFlagDefinitions,u_ as toImportBoolean,h_ as toImportConfidence,p_ as toImportInteger,T_ as toImportLinkedDocs,b_ as toImportLinkedFiles,C_ as toImportLinkedTests,y_ as toImportLogEntries,g_ as toImportNormalizedEnum,__ as toImportNumberMap,d_ as toImportPriority,l_ as toImportStatus,m_ as toImportStringList,f_ as toImportStringMap,c_ as toImportTags,KE as toItemRecord,s_ as toNonEmptyImportString,uC as toNonEmptyStringOrUndefined,pA as toReplayDocument,qw as toWellFormedText,bs as tokenizeSimilarityText,WT as transferMutationStdinTokenPolicy,VC as translateHostEnvironmentFault,Lh as update,zf as updateLinkedTest,cg as upgrade,vh as validate,II as validateAssertionDefinition,MI as validateAssuranceDocument,PI as validateGateDefinition,gk as validateItemMutationRows,pp as validateLinkedPaths,xN as validateMcpAuthorizationResponseIssuer,MN as validateMcpAuthorizationServerMetadata,NN as validateMcpClientMetadataDocument,SN as validateMcpHttpRequestHeaders,dN as validateMcpJsonSchema,RI as validateMeasurementDefinition,kA as validateMissingParentReference,KS as validateReadOutputOptions,$A as validateSprintOrReleaseValue,sC as validateTypeOptions,eR as validateWorkspaceTransactionIdentity,wM as verifyAttestation,OR as verifyCliFlagInvocationParity,bR as verifyExplicitPositionalSlotCensus,fA as verifyHistoryChain,mA as verifyHistoryChainWithVersion,qO as verifyHistoryEntries,oA as verifyHistoryRecordHash,iA as verifyHistoryRewriteEvidence,SR as verifyPmCliGrammar,ER as verifyPmCommandPositionalContracts,ZD as verifyPmFlagLexicon,ED as verifyPmRecoveryKindRuntimeCoverage,xb as verifyPmRecoveryProducerRuntimeCoverage,CD as verifyPmRecoveryReferences,vD as verifyPmRefusalClosureIdentityRatchet,AD as verifyPmRefusalClosureRatchet,TD as verifyPmRefusalReachability,dc as verifyToolOptionCliParity,LA as withCliMutationInput,xs as withExpectedItemRevisions,Bs as withFlagAliasMetadata,KC as withHostEnvironmentBoundary,DA as withLiteralMutationInput,aN as withMcpCachePolicy,Gi as withoutGenericRefusalExamples,NT as workflowApprovalFingerprint,LT as workflowPolicyApplies,xT as workflowPolicyFingerprint,Yl as workspaceGraphCache,oR as workspaceTransactionPlanDigest,Xd as wrapOwnershipConflict,rO as wrapThrownErrorForSentry,fi as writeAuthorEnvironment,Fe as writeFileAtomic,bC as writeMutationCheckpoint,QA as writeSettings,TO as writeSettingsSection,Vw as writeStderr,Hw as writeStdout,Hv as writeVectorizationStatusLedger,vA as writeWorkspaceJsonWithHistory};
28
+ </html>`}import{createHash as nt}from"node:crypto";import{lstat as Ry,readdir as Br,readFile as Iy}from"node:fs/promises";import P from"node:path";import{parseDocument as Py}from"yaml";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="eafd8bc3-0da1-5220-8fb1-6967eecdb6bf")}catch{}})();var Lr="io.modelcontextprotocol/skills",it="SEP-2640@a3e147ca2710f68214247aecc729731ee1ae8d03",My=Object.freeze({revision:it,status:"draft",directoryRead:!0});function iL(e,t=!1){let r=e.clientCapabilities.extensions,o=h(r)?r[Lr]:void 0;if(!h(o)||o.revision!==it||t&&o.directoryRead!==!0)throw new u("Missing or incompatible Skills over MCP draft capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[Lr]:My}}})}var I=Object.freeze({maxFilesPerSkill:512,maxFileBytes:16*1024*1024,maxSkillBytes:16*1024*1024,defaultPageSize:20,maxPageSize:100}),Dr=100,ky=32*1024*1024,xy=/^[a-z0-9]+(?:-[a-z0-9]+)*$/u,$r=new Set(Array.from({length:I.maxPageSize},(e,t)=>t+1));function C(e,t){throw new u(e,-32602,t)}function Fr(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 Ny(e,t){let r=/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/u.exec(e);r||C(`Skill ${t} is missing YAML frontmatter.`);let o=Py(r[1],{prettyErrors:!1,strict:!0,uniqueKeys:!0});o.errors.length>0&&C(`Skill ${t} has invalid YAML frontmatter.`,{errors:o.errors.map(s=>s.message)});let n;try{n=o.toJS({maxAliasCount:0})}catch(s){C(`Skill ${t} has unsupported YAML aliases.`,{error:String(s)})}return(typeof n!="object"||n===null||Array.isArray(n))&&C(`Skill ${t} frontmatter must be an object.`),n}async function Ly(e,t,r,o){return r>I.maxFileBytes&&C(`Skill resource exceeds the per-file limit: ${t}.`),o.files+=1,o.files>I.maxFilesPerSkill&&C(`Skill exceeds ${I.maxFilesPerSkill} files.`),o.skillBytes+=r,o.skillBytes>I.maxSkillBytes&&C(`Skill exceeds the aggregate byte limit: ${t}.`),o.originBytes.value+=r,o.originBytes.value>ky&&C(`Skill origin exceeds the aggregate byte limit: ${t}.`),Iy(e)}async function qr(e,t,r){let o=P.join(e,t),n=await Br(o,{withFileTypes:!0}),s=[];for(let i of n.sort((a,c)=>a.name.localeCompare(c.name))){let a=P.posix.join(t.split(P.sep).join("/"),i.name),c=P.join(e,...a.split("/")),d=await Ry(c);d.isSymbolicLink()&&C(`Skill resource must not be a symbolic link: ${a}.`),d.isDirectory()?s.push(...await qr(e,a,r)):d.isFile()?s.push({relative:a,bytes:await Ly(c,a,d.size,r)}):C(`Skill resource must be a regular file or directory: ${a}.`)}return s}async function Gr(e,t,r){let o=new Map,n;try{n=await Br(e,{withFileTypes:!0})}catch(a){if(bt(a))return o;throw a}let s=n.filter(a=>a.isDirectory()&&xy.test(a.name)).sort((a,c)=>a.name.localeCompare(c.name));s.length>Dr&&C(`Skill origin exceeds ${Dr} directories.`);let i={value:0};for(let a of s){let c=await qr(P.join(e,a.name),"",{files:0,skillBytes:0,originBytes:i}),d=c.reduce((g,T)=>g+T.bytes.byteLength,0),l=c.find(g=>g.relative==="SKILL.md");if(!l)continue;let p=Ny(l.bytes.toString("utf8"),a.name);p.name!==a.name&&C(`Skill directory ${a.name} must match frontmatter name.`,{actual:p.name??null,expected:a.name}),(typeof p.description!="string"||p.description.trim().length===0)&&C(`Skill ${a.name} requires a non-empty frontmatter description.`,{required:["description"]});let f=c.map(g=>({uri:`skill://${a.name}/${g.relative}`,digest:`sha256:${nt("sha256").update(g.bytes).digest("hex")}`,size:g.bytes.byteLength})),_=nt("sha256").update(f.map(g=>`${g.uri}:${g.digest}`).join(`
29
+ `)).digest("hex");o.set(a.name,{uri:`skill://${a.name}/SKILL.md`,frontmatter:p,resources:f,_meta:{contractVersion:1,extensionRevision:it,origin:t,packageVersion:r,protocolVersion:z,trust:"untrusted",estimatedTokens:Math.ceil(d/4)},files:new Map(c.map(g=>[g.relative,g.bytes])),fingerprint:_})}return o}function Ur(e){let{files:t,fingerprint:r,...o}=e;return o}var jr=class e{#e;#t;constructor(t){this.#e=t,this.#t=nt("sha256").update([...t.entries()].sort(([r],[o])=>r.localeCompare(o)).map(([r,o])=>`${r}:${o.fingerprint}`).join(`
30
+ `)).digest("hex").slice(0,16)}#r(t,r){if(!t)return 0;try{let o=JSON.parse(Buffer.from(t,"base64url").toString("utf8"));return(typeof o!="object"||o===null||!("fingerprint"in o)||o.fingerprint!==this.#t||!("scope"in o)||o.scope!==r||!("offset"in o)||!Number.isInteger(o.offset)||Number(o.offset)<0)&&C("Skill cursor is invalid or stale."),Number(o.offset)}catch(o){if(o instanceof u)throw o;return C("Skill cursor is invalid or stale.")}}#o(t,r){return Buffer.from(JSON.stringify({fingerprint:this.#t,offset:t,scope:r})).toString("base64url")}static async load(t){let r=await Gr(P.join(t.packageRoot,".agents","skills"),"package",t.packageVersion);if(t.workspaceRoot){let o=P.resolve(t.packageRoot,".agents","skills"),n=P.resolve(t.workspaceRoot,".agents","skills");if(n!==o){let s=await Gr(n,"workspace",t.packageVersion);for(let[i,a]of s)r.set(i,a)}}return new e(r)}list(t={}){let r=t.limit??I.defaultPageSize;$r.has(r)||C(`Skill list limit must be an integer from 1 to ${I.maxPageSize}.`);let o=this.#r(t.cursor,"skills/list"),n=[...this.#e.values()].sort((c,d)=>c.uri.localeCompare(d.uri)),s=n.slice(o,o+r),i=o+s.length,a=i<n.length;return{skills:s.map(Ur),hasMore:a,...a?{nextCursor:this.#o(i,"skills/list")}:{}}}get(t){let r=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)\/SKILL\.md$/u.exec(t),o=r?this.#e.get(r[1]):void 0;return o||C(`Unknown pm MCP skill: ${t}.`,{field:"uri"}),Ur(o)}read(t){let r=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)\/(.+)$/u.exec(t),o=r?this.#e.get(r[1]):void 0,n=r?.[2]??"",s=o&&n?o.files.get(n):void 0,i=o?.resources.find(d=>d.uri===t);(!o||!s||!i)&&C(`Unknown pm MCP skill resource: ${t}.`,{field:"uri"});let a={digest:i.digest,origin:o._meta.origin,trust:"untrusted"},c=Fr(n,s);return c!=="application/octet-stream"?{contents:[{uri:t,mimeType:c,text:s.toString("utf8"),_meta:a}]}:{contents:[{uri:t,mimeType:c,blob:s.toString("base64"),_meta:a}]}}readDirectory(t,r={}){let o=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)(?:\/(.+))?$/u.exec(t),n=o?this.#e.get(o[1]):void 0;n||C(`Unknown pm MCP skill directory: ${t}.`,{field:"uri"});let s=(o?.[2]??"").replace(/\/$/u,""),i=s.length>0?`${s}/`:"",a=`skill://${o[1]}`,c=new Map;for(let T of n.resources){let E=T.uri.slice(`${a}/`.length);if(!E.startsWith(i))continue;let B=E.slice(i.length),[v,...vo]=B.split("/"),Ro=`${a}/${i}${v}`,Io=n.files.get(`${i}${v}`);c.set(v,{uri:Ro,name:v,mimeType:vo.length>0?"inode/directory":Fr(v,Io)})}s.length>0&&c.size===0&&C(`Unknown pm MCP skill directory: ${t}.`,{field:"uri"});let d=r.limit??I.maxPageSize;$r.has(d)||C(`Skill directory limit must be an integer from 1 to ${I.maxPageSize}.`);let l=this.#r(r.cursor,t),p=[...c.values()].sort((T,E)=>T.uri.localeCompare(E.uri)),f=p.slice(l,l+d),_=l+f.length,g=_<p.length;return{resources:f,hasMore:g,...g?{nextCursor:this.#o(_,t)}:{}}}};(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="38023567-8a5b-5e25-8d71-5112f74d1894")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="619dbd55-b854-5e69-b5a5-c0bcada81629")}catch{}})();var zr="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,o)=>st(r,`${t}[${o}]`)));if(typeof e!="object"||Object.getPrototypeOf(e)!==Object.prototype&&Object.getPrototypeOf(e)!==null)throw new Error(`Workspace recipe input must contain JSON values at ${t}`);return Object.freeze(Object.fromEntries(Object.entries(e).map(([r,o])=>[r,st(o,`${t}.${r}`)])))}function we(e){if(e.schema!==zr)throw new Error(`Unsupported workspace recipe schema: ${e.schema}`);let t=Tt(e);if(e.operations.some(r=>r.action.trim().length===0||r.input===null||Array.isArray(r.input)))throw new Error("Workspace recipe operations require an action and object input");return Object.freeze({...t,operations:Object.freeze(e.operations.map((r,o)=>Object.freeze({action:r.action,input:st(r.input,`operations[${o}].input`)})))})}async function Hr(e,t){let r=we(e);return Ct(r,t)}async function Dy(e,t){return Hr(e,async()=>{let r=[];for(let[o,n]of e.operations.entries())r.push(await t(n,o));return r})}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="c234be1c-35b7-5388-8a70-a012e9a34389")}catch{}})();var Vr="pm.agent-observation/v1",Kr="pm.agent-verdict/v1",Wr="pm.agent-episode/v1";function O(e,t){if(!Number.isSafeInteger(e)||e<=0)throw new Error(`${t} must be a positive safe integer.`)}function M(e,t){if(e.trim().length===0)throw new Error(`${t} must not be empty.`)}function oe(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let t of Object.values(e))oe(t)}return e}function $y(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(M(r.command,"observation.reads.command"),O(r.budget_tokens,"observation.reads.budget_tokens"),t+=r.budget_tokens,!Number.isSafeInteger(t))throw new Error("observation read ceilings exceed safe integer range.")}function Fy(e){if(e.basis!=="emitted_bytes")throw new Error("observation calibration must use emitted_bytes.");for(let r of e.samples)if(!Number.isSafeInteger(r)||r<0)throw new Error("observation calibration samples must be non-negative safe integers.");if(e.samples.length===0)throw new Error("observation calibration must include at least one sample.");if(O(e.expected_emitted_bytes,"observation.calibration.expected_emitted_bytes"),!Number.isSafeInteger(e.tolerance_bytes)||e.tolerance_bytes<0)throw new Error("observation.calibration.tolerance_bytes must be a non-negative safe integer.");let t=e.samples.reduce((r,o)=>r+o,0)/e.samples.length;if(Math.abs(t-e.expected_emitted_bytes)>e.tolerance_bytes)throw new Error("observation expected_emitted_bytes is outside the calibrated sample tolerance.")}function Gy(e){if(e.length===0)throw new Error("observation.tiers must declare a degradation ladder.");let t=new Set,r=Number.POSITIVE_INFINITY;for(let o of e){if(M(o.id,"observation.tiers.id"),O(o.max_tokens,"observation.tiers.max_tokens"),t.has(o.id))throw new Error(`Duplicate observation tier: ${o.id}.`);if(t.add(o.id),o.max_tokens>r)throw new Error("observation tiers must be ordered from largest to smallest max_tokens.");r=o.max_tokens;let n=new Set;for(let s of o.fields){if($(s,"observation.tiers.fields"),n.has(s))throw new Error(`Duplicate observation tier field: ${s}.`);n.add(s)}}}function Uy(e){if(e.schema!==Vr)throw new Error(`observation.schema must be ${Vr}.`);return M(e.id,"observation.id"),O(e.version,"observation.version"),$y(e.reads),Fy(e.calibration),e.corpus_dependence.kind==="bounded"&&(M(e.corpus_dependence.dimension,"observation.corpus_dependence.dimension"),O(e.corpus_dependence.maximum,"observation.corpus_dependence.maximum")),Gy(e.tiers),oe(structuredClone(e))}function fL(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 jy(e,t,r){O(r.budget_tokens,"observation request budget_tokens");let o=[];for(let[n,s]of e.tiers.entries()){o.push(s.id);let i=await t(s),a=Buffer.byteLength(R(i),"utf8"),c=Math.ceil(a/4);if(c<=Math.min(r.budget_tokens,s.max_tokens))return{status:"served",payload:i,receipt:{contract_id:e.id,contract_version:e.version,served_tier:s.id,degraded:n>0,attempted_tiers:o,emitted_bytes:a,estimated_tokens:c,calibration_basis:"emitted_bytes"}}}return{status:"refused",reason:"no_declared_tier_fits_budget",receipt:{contract_id:e.id,contract_version:e.version,served_tier:null,degraded:e.tiers.length>1,attempted_tiers:o,emitted_bytes:null,estimated_tokens:null,calibration_basis:"emitted_bytes"}}}function $(e,t){let r=e.split(".");if(r.some(o=>o.length===0||o==="__proto__"||o==="prototype"||o==="constructor"))throw new Error(`${t} must be a safe, non-empty dot-separated path.`);return r}function Yr(e,t){let r=e;for(let o of $(t,"recorded field path")){if(r===null||typeof r!="object"||!Object.hasOwn(r,o))return;r=r[o]}return r}function By(e){return`/${$(e,"verdict predicate path").map(t=>t.replaceAll("~","~0").replaceAll("/","~1")).join("/")}`}function qy(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 zy(e){if(e.schema!==Kr)throw new Error(`verdict.schema must be ${Kr}.`);M(e.id,"verdict.id"),O(e.version,"verdict.version");let t=new Set;for(let o of e.predicates){M(o.id,"verdict.predicates.id"),$(o.path,"verdict.predicates.path");let n=o.kind;if(n!=="field_equals"&&n!=="field_present"&&n!=="field_absent")throw new Error(`Unsupported verdict predicate kind for ${o.id}.`);if(t.has(o.id))throw new Error(`Duplicate verdict predicate: ${o.id}.`);qy(o),t.add(o.id)}if(e.composition.operator!=="all"&&e.composition.operator!=="any")throw new Error("verdict composition operator must be all or any.");if(e.composition.predicate_ids.length!==e.predicates.length)throw new Error("verdict composition must reference every predicate exactly once.");let r=new Set(e.composition.predicate_ids);if(r.size!==e.composition.predicate_ids.length||[...r].some(o=>!t.has(o)))throw new Error("verdict composition contains duplicate or unknown predicate ids.");return oe(structuredClone(e))}function Hy(e,t){if(e.predicates.length===0)return{contract_id:e.id,contract_version:e.version,snapshot_id:t.snapshot_id,outcome:"not_applicable",score:null,policy:"verdict_only_no_reward",reason:"no_predicates_declared",predicates:[]};let r=new Map(e.predicates.map(i=>[i.id,i])),o=e.composition.predicate_ids.map(i=>{let a=r.get(i),c=Yr(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:i,outcome:d?"satisfied":"violated",evidence_pointer:`${t.snapshot_id}#${By(a.path)}`,evidence_digest:ht(R(c))}}),n=o.filter(i=>i.outcome==="satisfied").length,s=e.composition.operator==="all"?n===o.length:n>0;return{contract_id:e.id,contract_version:e.version,snapshot_id:t.snapshot_id,outcome:s?"satisfied":"violated",score:n/o.length,policy:"verdict_only_no_reward",predicates:o}}function _L(e){if(e.schema!==Wr)throw new Error(`episode.schema must be ${Wr}.`);if(M(e.id,"episode.id"),O(e.version,"episode.version"),!["benchmark","evaluation","training","scale_transfer"].includes(e.mode))throw new Error("episode.mode is not supported.");if(e.task_item_ids.length===0)throw new Error("episode.task_item_ids must declare at least one pm item.");for(let t of e.task_item_ids)M(t,"episode.task_item_ids");O(e.limits.max_actions,"episode.limits.max_actions"),O(e.limits.max_observations,"episode.limits.max_observations"),O(e.limits.max_tokens_per_observation,"episode.limits.max_tokens_per_observation");for(let t of e.observable_fields)$(t,"episode.observable_fields");for(let t of e.withheld_fields)$(t,"episode.withheld_fields");for(let t of e.observable_fields){let r=e.withheld_fields.find(o=>t===o||t.startsWith(`${o}.`)||o.startsWith(`${t}.`));if(r!==void 0)throw new Error(`Observable field ${t} overlaps withheld field ${r}.`)}for(let t of e.observation.tiers)for(let r of t.fields)if(!e.observable_fields.includes(r))throw new Error(`Observation tier field ${r} is not declared observable.`);return Uy(e.observation),zy(e.verdict),we(e.recipe),oe(structuredClone(e))}function Vy(e,t,r){let o=$(t,"observation projection field"),n=e;for(let[s,i]of o.entries()){if(s===o.length-1){r!==void 0&&(n[i]=structuredClone(r));return}let a=n[i];(a===null||typeof a!="object"||Array.isArray(a))&&(n[i]={}),n=n[i]}}function Ky(e,t){let r={};for(let o of t)Vy(r,o,Yr(e,o));return r}async function hL(e,t){let r=[],o=0,n=0,s=!1,i,a={episode:{id:e.id,label:`pm agent environment v${e.version}`},provenance:{role:e.mode,topic:"agent-environment"}},c=await L(a,()=>t.reset(e.recipe));r.push({sequence:1,kind:"reset",state_id:c.state_id});let d=async()=>{if(s)throw new Error("episode is already closed.");if(n>=e.limits.max_observations)throw new Error("episode exceeded limits.max_observations.");n+=1;let p=await t.readRecordedState(),f=await jy(e.observation,async _=>Ky(p.state,_.fields),{budget_tokens:e.limits.max_tokens_per_observation});return r.push({sequence:r.length+1,kind:"observation",state_id:f.receipt.served_tier??p.snapshot_id}),f},l=async(p=!1)=>{if(s&&!p)throw new Error("episode is already closed.");if(n>=e.limits.max_observations)throw new Error("episode exceeded limits.max_observations.");n+=1;let f=await t.readRecordedState(),_=Hy(e.verdict,f);return r.push({sequence:r.length+1,kind:"verdict",state_id:f.snapshot_id}),_};return{observe:()=>L(a,d),step:async p=>{if(s)throw new Error("episode is already closed.");if(o>=e.limits.max_actions)throw new Error("episode exceeded limits.max_actions.");o+=1;let f=await L(a,()=>t.execute(p));return r.push({sequence:r.length+1,kind:"action",state_id:f.state_id}),f},score:()=>L(a,l),close:()=>i!==void 0?i:s?Promise.reject(new Error("episode is already closed.")):(s=!0,i=L(a,()=>l(!0)).then(p=>(r.push({sequence:r.length+1,kind:"close",state_id:p.snapshot_id}),{verdict:p,trajectory:oe(structuredClone(r))})).catch(p=>{throw s=!1,p}).finally(()=>{i=void 0}),i)}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="1202ba19-0bcb-5478-b245-4472e361d4de")}catch{}})();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 ne(e,t){if(!Number.isSafeInteger(e)||e<0)throw new TypeError(`Corpus shape ${t} must be a non-negative safe integer`);return e}function Jr(e){if(!(typeof e!="object"||e===null||Object.isFrozen(e))){for(let t of Object.values(e))Jr(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"),ne(e.age_span_days,"age_span_days"),V(e.history_entries_per_item,"history_entries_per_item"),ne(e.comments_per_100_items,"comments_per_100_items"),ne(e.notes_per_100_items,"notes_per_100_items"),ne(e.learnings_per_100_items,"learnings_per_100_items"),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 Jr(t),t}var Ae=[{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:Ae,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:Ae,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:Ae,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:Ae,author_cardinality:24,component_count:5,include_cycles:!1,custom_types:["Archive"],custom_statuses:["archived"],terminal_statuses:["archived"],custom_fields:["archive_source"]})});function Wy(){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 Xr=new WeakMap;function Qr(e,t){if(e===0)return[];let r=Xr.get(t);r===void 0&&(r=t.edge_kind_mix.flatMap(n=>Array.from({length:n.weight},()=>n.kind)),Xr.set(t,r));let o=[r[e%r.length]];return t.include_cycles&&e>2&&e%17===0&&o.push("related"),[...new Set(o)]}function Xy(e,t,r,o=42){if(ne(t,"item index"),V(r,"item count"),t>=r)throw new RangeError(`Corpus item index ${t} exceeds ${r}`);let n=Math.min(e.component_count,r),s=t%n,i=Math.floor(t/n),a=0,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=i%a,l=i-d,p=d===0?void 0:s+(l+Math.floor((d-1)/e.hierarchy_fanout))*n,f=Date.UTC(2026,0,1),_=e.age_span_days*864e5,g=new Date(f+(r===1?0:Math.round(t/(r-1)*_))).toISOString(),T=(t*37+o)%100;return{index:t,id:`pm-s${t.toString(36).padStart(7,"0")}`,...p===void 0?{}:{parent:`pm-s${p.toString(36).padStart(7,"0")}`},component:s,timestamp:g,author:`pm-corpus-agent-${(t+o)%Math.min(e.author_cardinality,r)}`,history_entry_count:e.history_entries_per_item,dependency_kinds:Qr(t,e),has_comment:T<e.comments_per_100_items,has_note:T<e.notes_per_100_items,has_learning:T<e.learnings_per_100_items,...e.custom_types.length>0&&t%11===0?{custom_type:e.custom_types[t%e.custom_types.length]}:{},...e.custom_statuses.length>0&&t%13===0?{custom_status:e.custom_statuses[t%e.custom_statuses.length]}:{}}}var 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 o of r)t[o]=(t[o]??0)+1}add(t){this.itemCount+=1,this.authors.add(t.author),this.components.add(t.component),this.recordMismatch(this.depths.has(t.id),`duplicate_id:${t.id}`);let r=1;if(t.parent!==void 0){let o=this.depths.get(t.parent);this.recordMismatch(o===void 0,`parent_missing:${t.parent}`),r=(o??0)+1;let n=(this.childCounts.get(t.parent)??0)+1;this.childCounts.set(t.parent,n),this.observedFanout=Math.max(this.observedFanout,n)}this.depths.set(t.id,r),this.observedDepth=Math.max(this.observedDepth,r),this.historyEntryCount+=t.history_entry_count,this.recordMismatch(t.history_entry_count!==this.shape.history_entries_per_item,"history_entries_per_item:drift"),this.firstTimestamp=this.firstTimestamp===null||t.timestamp<this.firstTimestamp?t.timestamp:this.firstTimestamp,this.lastTimestamp=this.lastTimestamp===null||t.timestamp>this.lastTimestamp?t.timestamp:this.lastTimestamp;for(let[o,n]of this.annotationFields)this.annotations[o]+=Number(t[n]);this.recordEdgeKinds(this.edgeKinds,t.dependency_kinds),this.recordEdgeKinds(this.expectedEdgeKinds,Qr(t.index,this.shape))}finish(){let t=Math.min(this.shape.author_cardinality,this.itemCount),r=Math.min(this.shape.component_count,this.itemCount),o=[...this.planMismatches,...this.itemCount===0?["item_count:empty"]:[],...this.authors.size===t?[]:[`author_count:${this.authors.size}!=${t}`],...this.components.size===r?[]:[`component_count:${this.components.size}!=${r}`],...this.observedDepth<=this.shape.hierarchy_depth?[]:[`hierarchy_depth:${this.observedDepth}>${this.shape.hierarchy_depth}`],...this.observedFanout<=this.shape.hierarchy_fanout?[]:[`hierarchy_fanout:${this.observedFanout}>${this.shape.hierarchy_fanout}`]];for(let[i,,a]of this.annotationFields){let c=Math.floor(this.itemCount/100),d=this.itemCount%100,l=c*a+Math.max(0,a+d-100),p=c*a+Math.min(a,d),f=this.annotations[i];(f<l||f>p)&&o.push(`${i}:${f}!in[${l},${p}]`)}let n=new Set([...Object.keys(this.edgeKinds),...Object.keys(this.expectedEdgeKinds)]);for(let i of[...n].sort()){let a=this.edgeKinds[i]??0,c=this.expectedEdgeKinds[i]??0;a!==c&&o.push(`edge_kind:${i}:${a}!=${c}`)}let s=[...new Set(o)];return{shape:this.shape.name,item_count:this.itemCount,author_count:this.authors.size,component_count:this.components.size,hierarchy_depth:this.observedDepth,hierarchy_fanout:this.observedFanout,timestamp_range:{first:this.firstTimestamp,last:this.lastTimestamp},history_entry_count:this.historyEntryCount,annotations:{...this.annotations},edge_kinds:{...this.edgeKinds},matches_declaration:s.length===0,mismatches:s}}};function Zr(e){return new at(e)}function Jy(e,t){let r=Zr(e);for(let o of t)r.add(o);return r.finish()}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="48d03e9b-14a4-545c-8e5d-5f5f2092a113")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="6a6b2905-b6b7-5b46-b87d-8b8287e37745")}catch{}})();async function Qy(){let e=$e(process.cwd(),process.env.PM_PATH);await At(e,(t,r)=>Ot(t,r,{apply_runtime_defaults:!0}))}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="4534b1c9-de27-5745-88f2-641b00b94714")}catch{}})();async function Zy(){await vt()}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="c1cb8d82-20a6-5460-a0ff-f55312911218")}catch{}})();var eo=["lines","branches","functions","statements"];function eb(e,t){if(typeof t!="object"||t===null||Array.isArray(t))throw new TypeError(`Coverage entry for ${e} must be an object.`)}function tb(e,t,r){if(typeof r!="object"||r===null||Array.isArray(r))throw new TypeError(`Coverage entry ${e} has invalid ${t} counts.`);let o=r;if(typeof o.covered!="number"||typeof o.total!="number"||!Number.isInteger(o.covered)||!Number.isInteger(o.total)||o.covered<0||o.total<o.covered)throw new TypeError(`Coverage entry ${e} has invalid ${t} counts.`);return{covered:o.covered,total:o.total}}function rb(e){if(typeof e!="object"||e===null||Array.isArray(e))throw new TypeError("Coverage summary must be a JSON object.");if(!("total"in e))throw new TypeError("Coverage summary is missing the total entry.");let t=[];for(let[r,o]of Object.entries(e)){eb(r,o);for(let n of eo){let s=tb(r,n,o[n]),i=s.total-s.covered;i>0&&t.push({file:r,metric:n,uncovered:i,...s})}}return t}import Y from"node:fs";import ct from"node:path";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="aacf5738-098d-50f9-b619-19e472b577ea")}catch{}})();var to=300*1e3,ob=3;function LL(e){return(e?.trim()||"development").replace(/[^a-zA-Z0-9._-]/g,"_").replace(/^\./,"_")}function DL(e,t){let r=t.trim();if(!/^[a-zA-Z0-9_-][a-zA-Z0-9._-]*$/.test(r))throw new TypeError("Compile-cache generation must be a safe non-empty filename token.");Y.mkdirSync(e,{recursive:!0});let o=ct.join(e,r);Y.mkdirSync(o,{recursive:!0});let n=new Date;Y.utimesSync(o,n,n);let s=Y.readdirSync(e).filter(d=>d!==r).flatMap(d=>{try{return[{name:d,mtimeMs:Y.statSync(ct.join(e,d)).mtimeMs}]}catch(l){if(l instanceof Error&&"code"in l&&me(l))return[];throw l}}).sort((d,l)=>l.mtimeMs-d.mtimeMs||d.name.localeCompare(l.name)),i=s.filter(d=>n.getTime()-d.mtimeMs<to),a=Math.max(0,ob-1-i.length),c=s.filter(d=>n.getTime()-d.mtimeMs>=to).slice(a).map(d=>d.name).sort((d,l)=>d.localeCompare(l));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 nb}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="ff60bc5b-bd85-5b3c-9a55-21e7e72477ac")}catch{}})();var 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 o=Date.parse(r.createdAt??new Date().toISOString());if(!Number.isFinite(o))throw new TypeError("Relationship graph createdAt must be a valid timestamp");let n=e.nodes(),s=e.edges(),i=t.list();return Object.freeze({version:dt,fingerprint:nb("sha256").update(R({nodes:n,edges:s,kinds:i})).digest("hex"),created_at:new Date(o).toISOString(),nodes:n,edges:s,kinds:i})}function ib(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function se(e){if(!ib(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(n=>typeof n!="string"))throw new TypeError("Relationship graph snapshot nodes must be strings");if(!Array.isArray(e.edges)||!Array.isArray(e.kinds))throw new TypeError("Relationship graph snapshot edges and kinds must be arrays");if(typeof e.created_at!="string"||!Number.isFinite(Date.parse(e.created_at)))throw new TypeError("Relationship graph snapshot created_at must be valid");if(typeof e.fingerprint!="string")throw new TypeError("Relationship graph snapshot fingerprint must be a string");let t=new Fe([]);for(let n of e.kinds)t.register(n);let r=new q(e.nodes,e.edges,t),o=J(r,t,{createdAt:e.created_at});if(o.fingerprint!==e.fingerprint)throw new TypeError("Relationship graph snapshot fingerprint mismatch");return{snapshot:o,registry:t,graph:r}}async function k(e,t){G(e.name,"adapter name");let r=G(t.workspace,"workspace");X(t.signal);let o=await e.read({...t,workspace:r});return X(t.signal),o===null?null:se(o)}async function Oe(e,t){let r=G(t.workspace,"workspace"),o=se(t.snapshot).snapshot,n=await k(e,{workspace:r,signal:t.signal});if(n?.snapshot.fingerprint===o.fingerprint)return{adapter:e.name,workspace:r,disposition:"current",fingerprint:o.fingerprint,previous_fingerprint:n.snapshot.fingerprint,node_count:o.nodes.length,edge_count:o.edges.length};if(X(t.signal),await e.replace({workspace:r,signal:t.signal,snapshot:o,expected_fingerprint:n?.snapshot.fingerprint??null}),(await k(e,{workspace:r,signal:t.signal}))?.snapshot.fingerprint!==o.fingerprint)throw new Error(`Relationship graph adapter "${e.name}" did not expose the replaced snapshot`);return{adapter:e.name,workspace:r,disposition:"written",fingerprint:o.fingerprint,...n?{previous_fingerprint:n.snapshot.fingerprint}:{},node_count:o.nodes.length,edge_count:o.edges.length}}function sb(e,t={}){let r=e.map(se),o=new Map;for(let i of r)for(let a of i.snapshot.kinds){let c=o.get(a.kind);if(c&&R(c)!==R(a))throw new TypeError(`Conflicting federated relationship kind: ${a.kind}`);o.set(a.kind,a)}let n=new Fe([...o.values()].sort((i,a)=>i.kind.localeCompare(a.kind))),s=new q(new Set(r.flatMap(i=>[...i.snapshot.nodes])),r.flatMap(i=>[...i.snapshot.edges]),n);return J(s,n,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"),o=this.#e.get(r);if(t.expected_fingerprint!==void 0&&(o?.fingerprint??null)!==t.expected_fingerprint)throw new Error(`Relationship graph adapter conflict for ${r}`);this.#e.set(r,structuredClone(se(t.snapshot).snapshot))}async clear(t){X(t.signal);let r=G(t.workspace,"workspace"),o=this.#e.get(r);if(t.expected_fingerprint!==void 0&&(o?.fingerprint??null)!==t.expected_fingerprint)throw new Error(`Relationship graph adapter conflict for ${r}`);this.#e.delete(r)}};(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="e47f9bb8-f98e-5159-9116-29c3e6fedfc3")}catch{}})();function ro(e,t){if(!Number.isInteger(e)||e<1)throw new TypeError(`Relationship graph ${t} must be a positive integer`);return e}function ab(e){let t=ro(e.nodeCount,"nodeCount"),r=ro(e.edgeStride??1,"edgeStride"),o=e.topology??"chain";if(!["chain","star","disconnected"].includes(o))throw new TypeError(`Unsupported relationship graph topology: ${o}`);let n=(e.kind??"related").trim(),s=(e.idPrefix??"node").trim();if(!n||!s)throw new TypeError("Relationship graph kind and idPrefix must be non-empty");let i=o==="disconnected"?0:Math.floor((t-1)/r);return{node_count:t,edge_count:i,edge_basis:"fixture_generated",nodes:{*[Symbol.iterator](){for(let a=0;a<t;a+=1)yield`${s}-${a}`}},edges:{*[Symbol.iterator](){if(o!=="disconnected")for(let a=r;a<t;a+=r)yield{source:`${s}-${o==="star"?0:a-r}`,target:`${s}-${a}`,kind:n}}}}}function U(e,t){if(!e)throw new Error(`Relationship graph adapter conformance: ${t}`)}async function oo(e,t={}){let r=t.workspace?.trim()||"pm-graph-conformance",o=St(),n=J(new q(["a","b"],[{source:"a",target:"b",kind:"related"}],o),o,{createdAt:"2026-01-01T00:00:00.000Z"}),s=J(new q(["a","b","c"],[{source:"a",target:"b",kind:"related"},{source:"b",target:"c",kind:"blocked_by"}],o),o,{createdAt:"2026-01-02T00:00:00.000Z"}),i=[];U(await k(e,{workspace:r})===null,"workspace must start empty"),i.push({name:"empty-read",passed:!0});let a=await Oe(e,{workspace:r,snapshot:n});U(a.disposition==="written","first sync must write"),i.push({name:"atomic-replace",passed:!0}),(await e.read({workspace:r})).nodes.push("mutated-reader-copy"),U((await k(e,{workspace:r}))?.snapshot.nodes.length===2,"reads must not mutate stored state"),i.push({name:"read-isolation",passed:!0}),U((await Oe(e,{workspace:r,snapshot:n})).disposition==="current","identical sync must be idempotent"),i.push({name:"idempotent-sync",passed:!0}),await e.replace({workspace:r,snapshot:s,expected_fingerprint:n.fingerprint}),U((await k(e,{workspace:r}))?.snapshot.fingerprint===s.fingerprint,"replacement must become visible"),i.push({name:"replacement-visibility",passed:!0});let c=!1;try{await e.replace({workspace:r,snapshot:n,expected_fingerprint:n.fingerprint})}catch{c=!0}return U(c,"stale compare-and-swap must fail"),i.push({name:"stale-cas",passed:!0}),e.clear&&(await e.clear({workspace:r,expected_fingerprint:s.fingerprint}),U(await k(e,{workspace:r})===null,"clear must remove the workspace"),i.push({name:"clear",passed:!0})),{adapter:e.name,workspace:r,cases:Object.freeze(i),clear_supported:e.clear!==void 0}}function cb(e){return oo(new ie,e?{workspace:e}:{})}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="58736688-35d0-545d-892e-e0ede7fedc1a")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="d45a8203-4501-5797-a6cc-a2e7844adec9")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="f5567aa1-0268-574d-907b-38d6249538ce")}catch{}})();var lt=2,db=["self_reported","independent_transport"];function ve(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 no(e,t,r=!1){if(!Array.isArray(e)||e.length===0)throw new TypeError(`${t} must be a non-empty string array`);return e.map((o,n)=>{let s=ae(o,`${t}[${String(n)}]`);return r?o:s})}function pt(e,t){return e===void 0?void 0:ae(e,t)}function lb(e,t){if(e===void 0)return;if(!ve(e)||Object.keys(e).length===0)throw new TypeError(`${t} must be a non-empty object`);let r=Object.entries(e).map(([o,n])=>{if(o.length===0||o.split(".").some(s=>s.length===0))throw new TypeError(`${t} must use dot-separated own-property paths`);if(n!==null&&typeof n!="string"&&typeof n!="boolean"&&(typeof n!="number"||!Number.isFinite(n)))throw new TypeError(`${t} values must be JSON primitives`);return[o,n]});return Object.fromEntries(r)}function pb(e,t,r,o,n,s){if(o==="refusal"){if(Ve(r)||n===void 0||s===void 0)throw new TypeError(`${e} refusal steps require a non-success exit, error code, and refusal surface`);return}if(n!==void 0||s!==void 0)throw new TypeError(`${e} only refusal steps may declare expected_error_code or expected_refusal_surface`);let i=gt(t);if(i===void 0)throw new TypeError(`${e}.args must identify a command after global flags`);let a=t[i].trim().toLowerCase();if(a==="history"){let l=yt(t.slice(i+1));l!==void 0&&(a=xe(`history ${l}`))}let c=Lt(a);if(!Ve(r)||r!==0&&!c?.exit_codes.some(l=>l===r))throw new TypeError(`${e} successful output must use exit code 0 or a command-declared successful effect exit`);let d=Nt(a).kind;if(o!==d)throw new TypeError(`${e} expected ${o}, but ${a} declares ${d}`)}function ub(e,t,r){if(!ve(e))throw new TypeError(`tasks.${t}.steps[${String(r)}] must be an object`);let o=`tasks.${t}.steps[${String(r)}]`,n=ae(e.id,`${o}.id`),s=no(e.args,`${o}.args`,!0),i=e.expected_exit_code;if(typeof i!="number"||!Number.isSafeInteger(i))throw new TypeError(`${o}.expected_exit_code must be a safe integer`);let a=e.expected_output_kind;if(a!=="refusal"&&!xt.includes(a))throw new TypeError(`${o}.expected_output_kind is unsupported`);let c=a,d=e.expected_accounting_mode;if(!db.includes(d))throw new TypeError(`${o}.expected_accounting_mode is unsupported`);let l=d;if(l==="independent_transport"&&c!=="refusal")throw new TypeError(`${o} independent_transport accounting is supported only for refusal steps`);let p=no(e.required_fields,`${o}.required_fields`);if(p.some(E=>E.split(".").some(B=>B.length===0)))throw new TypeError(`${o}.required_fields must contain dot-separated own-property paths`);let f=lb(e.expected_field_values,`${o}.expected_field_values`),_=pt(e.expected_error_code,`${o}.expected_error_code`),g=pt(e.expected_refusal_surface,`${o}.expected_refusal_surface`),T=pt(e.recovery_for,`${o}.recovery_for`);return pb(o,s,i,c,_,g),{id:n,args:s,expected_exit_code:i,expected_output_kind:c,expected_accounting_mode:l,required_fields:p,...f?{expected_field_values:f}:{},..._?{expected_error_code:_}:{},...g?{expected_refusal_surface:g}:{},...T?{recovery_for:T}:{}}}function mb(e,t){if(!ve(e))throw new TypeError(`tasks[${String(t)}] must be an object`);let r=ae(e.id,`tasks[${String(t)}].id`),o=ae(e.description,`tasks.${r}.description`);if(!Array.isArray(e.steps)||e.steps.length===0)throw new TypeError(`tasks.${r}.steps must be a non-empty array`);let n=e.steps.map((i,a)=>ub(i,r,a)),s=new Map;for(let i of n){if(s.has(i.id))throw new TypeError(`tasks.${r} contains duplicate step id ${i.id}`);if(i.recovery_for!==void 0&&(s.get(i.recovery_for)?.expected_output_kind!=="refusal"||i.expected_output_kind==="refusal"))throw new TypeError(`tasks.${r}.${i.id} recovery_for must reference an earlier refusal and declare successful output`);s.set(i.id,i)}if(n.at(-1)?.expected_output_kind==="refusal")throw new TypeError(`tasks.${r} completed task must terminate with successful output`);for(let i of n)if(i.expected_output_kind==="refusal"&&!n.some(a=>a.recovery_for===i.id))throw new TypeError(`tasks.${r}.${i.id} refusal must have a later successful recovery_for step`);return{id:r,description:o,steps:n}}function mD(e){if(!ve(e))throw new TypeError("agent-task transcript corpus must be an object");if(e.version!==lt)throw new TypeError(`agent-task transcript corpus version must be ${String(lt)}`);if(!Array.isArray(e.tasks)||e.tasks.length===0)throw new TypeError("agent-task transcript corpus tasks must be non-empty");let t=e.tasks.map((o,n)=>mb(o,n)),r=new Set;for(let o of t){if(r.has(o.id))throw new TypeError(`duplicate agent-task transcript id ${o.id}`);r.add(o.id)}return{version:lt,tasks:t}}import{createHash as io}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="7163a078-d8be-5bca-813f-c941fcb8e406")}catch{}})();function so(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship backfill ${t} must be non-empty`);return e.trim()}function gD(e,t){let r=so(t.migrationId,"migrationId"),o=so(t.author,"author"),n=Date.parse(t.timestamp);if(!Number.isFinite(n))throw new TypeError("Relationship backfill timestamp must be valid");let s=new Date(n).toISOString(),i=qe(e,void 0,t.registry),a=i.graph.nodes(),c=i.graph.edges().map(f=>{let _=io("sha256").update(JSON.stringify([r,f.kind,f.source,f.target,f.createdAt??null,f.author??null,f.payload??null])).digest("hex").slice(0,24);return Object.freeze({eventId:`backfill:${r}:${_}`,relationshipId:`migration:${r}:${_}`,action:"add",edge:f,author:o,timestamp:s,reason:`Backfill ${r} from legacy item metadata`})}),d=io("sha256").update(JSON.stringify({migrationId:r,nodes:a,events:c})).digest("hex"),l=new Set([...t.existingEventIds??[]].filter(f=>typeof f=="string").map(f=>f.trim()).filter(Boolean)),p=c.filter(f=>!l.has(f.eventId));return Object.freeze({migration_id:r,fingerprint:d,nodes:a,events:Object.freeze(p),edge_count:c.length,skipped_existing_count:c.length-p.length,duplicate_dependency_rows:i.duplicateRows.length,dangling_reference_count:i.dangling.active.length+i.dangling.legacy_terminal.length})}import*as ao from"node:module";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="7a1d7194-6ff1-5365-ab64-80b47b0176d7")}catch{}})();var ce=["suggested_retry","candidate_command","example","next_step","migration_hint","restore_with"],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"}},bD=Object.freeze(Object.keys(ut));function co(e){if(Object.hasOwn(ut,e))return ut[e]}var fb=new Set([..."=([{,:;!?&|+-*%^~<>","=>"]);function Q(e,t){return e<t?-1:e>t?1:0}function _b(e,t){let r=e[t],o=t+1,n="";for(;o<e.length&&e[o]!==r;)e[o]==="\\"?o+=2:(n+=e[o],o+=1);return e[o]===r&&(o+=1),{next:o,value:n}}function hb(e){return e===void 0||e.kind==="punctuator"&&fb.has(e.value)||e.kind==="identifier"&&["return","case","throw","else","yield"].includes(e.value)}function gb(e,t){if(/\s/u.test(e[t]))return t+1;if(e.startsWith("//",t)){let r=e.indexOf(`
31
+ `,t+2);return r===-1?e.length:r+1}if(e.startsWith("/*",t))return e.indexOf("*/",t+2)+2}function yb(e,t,r){if(e[t]!=="/"||!hb(r))return;let o=t+1,n=!1;for(;o<e.length;)if(e[o]==="\\")o+=2;else if(e[o]==="[")n=!0,o+=1;else if(e[o]==="]")n=!1,o+=1;else if(e[o]==="/"&&!n){for(o+=1;/[A-Za-z]/u.test(e.charAt(o));)o+=1;return o}else o+=1;return o}function bb(e,t){let r=e[t];if(r==="'"||r==='"'||r==="`"){let n=_b(e,t);return r==="`"?{next:n.next}:{next:n.next,token:{kind:"string",value:n.value,offset:t+1}}}if(/[A-Za-z_$]/u.test(r)){let n=t+1;for(;/[A-Za-z0-9_$]/u.test(e[n]??"");)n+=1;return{next:n,token:{kind:"identifier",value:e.slice(t,n),offset:t}}}let o=e.startsWith("=>",t)?"=>":r;return{next:t+o.length,token:{kind:"punctuator",value:o,offset:t}}}function Tb(e){let t=[],r=0;for(;r<e.length;){let o=gb(e,r);if(o!==void 0){r=o;continue}let n=yb(e,r,t.at(-1));if(n!==void 0){r=n;continue}let s=bb(e,r);s.token&&t.push(s.token),r=s.next}return t}var Cb=new Set(["object","block","pattern"]),Eb=new Set(["const","let","var"]),Sb=new Set(["}",")","]"]),wb=new Set(["=","(","[",",",":","?","return"]);function Ab(e,t,r){if([...r].reverse().find(n=>Cb.has(n.kind))?.kind==="pattern"||r.at(-1)?.kind==="paren"&&r.at(-1)?.parameter_list)return"pattern";let o=e[t-1];return o?.kind==="identifier"&&Eb.has(o.value)?"pattern":o?.value==="=>"||o?.value===")"?"block":o&&wb.has(o.value)?"object":"block"}function Ob(e,t,r){let o=e[t];if(o.value==="{"){let i=Ab(e,t,r);return{kind:i,...i==="object"?{member_start:!0,candidates:[]}:{}}}if(o.value==="[")return{kind:"array"};if(o.value!=="(")return;let n=e[t-1],s=e[t-2];return{kind:"paren",...n?.value==="function"||s?.value==="function"?{parameter_list:!0}:{}}}function vb(e,t,r){if(!(e?.kind!=="object"||!e.member_start||t.kind!=="identifier"&&t.kind!=="string"||r?.value!==":"||!/^[A-Za-z][A-Za-z0-9_]*$/u.test(t.value)))return{field:t.value,offset:t.offset}}function Rb(e,t){return e[t+1]?.value===")"&&e[t+2]?.value==="=>"||e[t+1]?.value==="="}function Ib(e){let t=Tb(ao.stripTypeScriptTypes(e,{mode:"strip"})),r=[],o=[];for(let[n,s]of t.entries()){let i=o.at(-1),a=vb(i,s,t[n+1]);a&&i.candidates.push(a);let c=Ob(t,n,o);if(c)o.push(c);else if(Sb.has(s.value)){let d=o.pop();d?.kind==="object"&&!Rb(t,n)&&r.push(...d.candidates)}else s.value===","&&i?.kind==="object"?i.member_start=!0:i?.kind==="object"&&s.value!==":"&&(i.member_start=!1)}return r}function Pb(e){let t=[0];for(let r=0;r<e.length;r+=1)e[r]===`
32
+ `&&t.push(r+1);return t}function Mb(e,t){let r=0,o=e.length;for(;r<o;){let n=Math.floor((r+o)/2);e[n]<=t?r=n+1:o=n}return r}function TD(e){let t=[],r=[];for(let n of[...e].sort((s,i)=>Q(s.path,i.path))){let s=Pb(n.content),i;try{i=Ib(n.content)}catch(a){r.push({kind:"invalid_source",subject:n.path,detail:`${n.path} could not be parsed for recovery producers: ${String(a)}.`});continue}for(let a of i){let c=a.field,d=Mb(s,a.offset),l=co(c);l?t.push({path:n.path,line:d,field:c,kind:l.kind}):/(?:retry_command|candidate_command|fallback_candidate|next_best_command|example|next_step|migration_hint|restore_with)/u.test(c)&&!/(?:_total|_truncated)$/u.test(c)&&r.push({kind:"unknown_recovery_field",subject:`${n.path}:${d}:${c}`,detail:`${c} resembles a recovery reference but has no typed field contract.`})}}let o=Object.fromEntries(ce.map(n=>[n,t.filter(s=>s.kind===n).length]));for(let n of ce)o[n]===0&&r.push({kind:"missing_kind_producer",subject:n,detail:`No source producer emits the ${n} recovery-reference kind.`});return t.sort((n,s)=>n.path!==s.path?Q(n.path,s.path):n.line!==s.line?n.line-s.line:Q(n.field,s.field)),r.sort((n,s)=>n.subject!==s.subject?Q(n.subject,s.subject):Q(n.kind,s.kind)),{ok:r.length===0,scanned_file_count:e.length,producer_count:t.length,producer_count_by_kind:o,producers:t,findings:r}}function CD(e,t){let r=[],o=(n,s)=>{if(Array.isArray(n)){n.forEach((i,a)=>o(i,[...s,String(a)]));return}if(!(typeof n!="object"||n===null))for(let[i,a]of Object.entries(n).sort(([c],[d])=>Q(c,d))){let c=co(i),d=c?.kind==="migration_hint"&&n.semantics==="behavior_preserving"?{...c,semantics:"behavior_preserving"}:c,l=[a].flat();d!==void 0&&l.forEach((p,f)=>{let _="nested_value_field"in d&&typeof d.nested_value_field=="string"?d.nested_value_field:void 0,g=_&&typeof p=="object"&&p!==null&&!Array.isArray(p)?p[_]:p;if(typeof g!="string"||g.trim().length===0)return;let T=[...s,i,String(f)].map(E=>encodeURIComponent(E)).join("/");r.push({id:`${e}:${d.kind}:${T}`,probe_id:e,kind:d.kind,semantics:d.semantics,value:g})}),o(a,[...s,i])}};return o(t,[]),r}function ED(e,t){let r=e.flatMap(i=>(i.owned_states??[]).map(a=>({contract:i,state:a}))),o=[],n=new Map;for(let i of t){if(n.has(i.probe_id)){o.push({kind:"duplicate_probe",probe_id:i.probe_id,detail:`Observation ${i.probe_id} was supplied more than once.`});continue}n.set(i.probe_id,i)}let s=new Set(r.map(({state:i})=>i.probe_id));for(let{contract:i,state:a}of r){let c=n.get(a.probe_id);if(!c){o.push({kind:"missing_probe",probe_id:a.probe_id,detail:`No entrypoint observation was recorded for ${i.code}.`});continue}c.code!==i.code&&o.push({kind:"wrong_error_code",probe_id:a.probe_id,detail:`Expected ${i.code}; observed ${c.code}.`}),c.exit_class!==a.expected_exit_class&&o.push({kind:"wrong_exit_class",probe_id:a.probe_id,detail:`Expected ${a.expected_exit_class}; observed ${c.exit_class}.`}),a.entrypoints.includes(c.entrypoint)||o.push({kind:"wrong_entrypoint",probe_id:a.probe_id,detail:`Expected one of ${a.entrypoints.join(", ")}; observed ${c.entrypoint}.`})}for(let i of t)s.has(i.probe_id)||o.push({kind:"undeclared_probe",probe_id:i.probe_id,detail:`Observation ${i.probe_id} has no catalog declaration.`});return o.sort((i,a)=>i.probe_id!==a.probe_id?i.probe_id.localeCompare(a.probe_id):i.kind.localeCompare(a.kind)),{ok:o.length===0,declared_probe_count:r.length,observed_probe_count:t.length,findings:o}}function SD(e,t){let r=[],o=new Set,n=new Set;for(let c of e){if(o.has(c.id)){n.add(c.id),r.push({kind:"duplicate_obligation",reference_id:c.id,detail:`Recovery obligation ${c.id} was declared more than once.`});continue}o.add(c.id)}let s=new Map;for(let c of t){if(s.has(c.id)){r.push({kind:"duplicate_observation",reference_id:c.id,detail:`Recovery reference ${c.id} was observed more than once.`});continue}s.set(c.id,c),o.has(c.id)||r.push({kind:"undeclared_observation",reference_id:c.id,detail:`Recovery observation ${c.id} has no emitted obligation.`})}for(let c of e){if(n.has(c.id))continue;let d=s.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 i=ce.map(c=>{let d=e.filter(p=>p.kind===c),l=d.filter(p=>!n.has(p.id)).map(p=>s.get(p.id)).filter(p=>p!==void 0);return{kind:c,declared:d.length,observed:l.length,passed:d.filter(p=>{let f=s.get(p.id);return!n.has(p.id)&&f?.reachable===!0&&f.semantics===p.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=i.reduce((c,d)=>c+d.passed,0);return{ok:r.length===0,declared_reference_count:e.length,observed_reference_count:t.length,pass_fraction:o.size===0?1:a/o.size,coverage_by_kind:i,findings:r}}function kb(e,t){let r=new Map(ce.map(s=>[s,new Set]));for(let s of t)r.get(s.kind).add(s.value);let o=ce.map(s=>({kind:s,source_producers:e.producer_count_by_kind[s],runtime_values:r.get(s).size})),n=o.filter(({source_producers:s,runtime_values:i})=>s>0&&i===0).map(({kind:s})=>s);return{ok:e.ok&&n.length===0,source_producer_count:e.producer_count,runtime_value_count:o.reduce((s,{runtime_values:i})=>s+i,0),coverage_by_kind:o,missing_runtime_kinds:n}}var wD=kb;(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="2b2197f3-7203-52c8-9cc7-f714b33a9306")}catch{}})();var OD=16,xb=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"]),lo=18,po=Object.freeze([...xb,"manifest_unknown_key","no_version_bounds_declared"].sort((e,t)=>e.localeCompare(t)));function vD(e,t=lo){return{ok:e.executable_error_code_count>=t,baseline:t,actual:e.executable_error_code_count}}function RD(e,t=po){let r=new Set(e.rows.filter(({disposition:n})=>n==="executable").map(({canonical_code:n})=>n)),o=t.filter(n=>!r.has(n));return{ok:o.length===0,required_canonical_codes:[...t],missing_required_canonical_codes:o}}function mt(e,t){let r=e.get(t);if(r)return r;let o={kinds:new Set,probeIds:new Set};return e.set(t,o),o}function ID(e,t,r){let o=new Map(e.map(l=>[l.code,l.canonical_code??l.code])),n=new Map,s=0,i=0;for(let l of e){let p=mt(n,l.canonical_code??l.code);for(let f of l.owned_states??[])p.kinds.add("owned_state"),p.probeIds.add(f.probe_id)}for(let l of t){let p=o.get(l.error_code);if(p===void 0)continue;s+=1;let f=mt(n,p);f.kinds.add("closed_domain"),f.probeIds.add(l.probe_id)}for(let l of r){let p=o.get(l.error_code);if(p===void 0)continue;i+=1;let f=mt(n,p);f.kinds.add("grammar"),f.probeIds.add(l.probe_id)}let a=e.map(l=>{let p=l.canonical_code??l.code,f=n.get(p),_=[...f.probeIds].sort();return{code:l.code,canonical_code:p,disposition:_.length>0?"executable":"uncovered",evidence_kinds:[...f.kinds].sort(),probe_ids:_}}).sort((l,p)=>l.code<p.code?-1:1),c=a.filter(({disposition:l})=>l==="uncovered").map(({code:l})=>l),d=a.length-c.length;return{ok:c.length===0,catalog_error_code_count:a.length,executable_error_code_count:d,uncovered_error_code_count:c.length,coverage_fraction:a.length===0?1:d/a.length,closed_domain_probe_count:s,grammar_probe_count:i,uncovered_error_codes:c,rows:a}}function PD(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: ${lo}`,`- Required executable canonical codes: ${po.map(r=>`\`${r}\``).join(", ")}`,`- Uncovered error codes: ${e.uncovered_error_code_count}`,`- Coverage fraction: ${e.coverage_fraction.toFixed(6)}`,`- Closed-domain probes: ${e.closed_domain_probe_count}`,`- Grammar probes: ${e.grammar_probe_count}`,"","| Error code | Canonical code | Disposition | Evidence kinds | Probe count |","| --- | --- | --- | --- | --- |",...t,""].join(`
33
+ `)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="d252409d-e33e-5c9e-9671-789f0ee87312")}catch{}})();function Nb(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 Lb(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."},...Nb(e)]}function xD(e){let t=[],r=new Set,o=0;e.length===0&&t.push({code:"empty_corpus",probe_id:"corpus",detail:"At least one real refusal observation is required."});for(let n of e){if(r.has(n.probe_id)){t.push({code:"duplicate_probe",probe_id:n.probe_id,detail:`${n.probe_id} was supplied more than once.`});continue}r.add(n.probe_id);let s=t.length;for(let i of Lb(n))i!==void 0&&t.push(i);t.length===s&&(o+=1)}return t.sort((n,s)=>n.probe_id!==s.probe_id?n.probe_id.localeCompare(s.probe_id):n.code.localeCompare(s.code)),{ok:t.length===0,probe_count:r.size,closed_probe_count:o,closure_fraction:r.size===0?0:o/r.size,findings:t}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="39b4e1fe-a34a-5ffc-9447-eaf8c46863c7")}catch{}})();var uo="not-a-declared-action";function Db(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 BD(e=je.filter(t=>Rt.some(r=>r.command===t.command&&r.disposition!=="package_owned"))){let t=new Set(e.filter(({command:r})=>!r.includes(" ")).map(({command:r})=>de(r)));return e.flatMap(r=>r.slots.flatMap((o,n)=>{if(!o.required)return[];let s=r.command.split(" "),i=de(r.command),a=s.length>1&&t.has(i)?s.map(de).join("--"):i,c=Z(r.command).flatMap(l=>l.required?[l.flag,...l.value_name?["example"]:[]]:[]),d=Ue.some(l=>l.command===r.command);return[{probe_id:`required-argument-${a}-${de(o.name)}`,command:r.command,refusal_args:[...s,...r.slots.slice(0,n).map(l=>Db(r.command,l)),...c],recovery_args:[...s,"--help"],error_code:d&&!r.command.startsWith("assurance ")?"invalid_argument_value":/^extension (?:activate|adopt|deactivate|uninstall)$/u.test(r.command)?"missing_lifecycle_target":"missing_required_argument",missing_argument:o.name,missing_argument_index:n}]})).sort((r,o)=>r.probe_id.localeCompare(o.probe_id))}function $b(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 qD(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,uo],recovery_args:[...r,"--help"],error_code:"unknown_subcommand",rejected_value:uo,allowed_values:[...$b(t)].sort()}}).sort((t,r)=>t.probe_id.localeCompare(r.probe_id))}function Fb(e,t){let r=[...t].sort();return e.length===t.length&&[...e].sort().every((o,n)=>o===r[n])}function Gb(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&&!Fb(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 zD(e,t){let r=new Map(e.map(i=>[i.probe_id,i])),o=new Map(t.map(i=>[i.probe_id,i])),n=[...e.flatMap(i=>Gb(i,o.get(i.probe_id))),...t.filter(i=>!r.has(i.probe_id)).map(i=>({code:"unexpected_refusal_probe",probe_id:i.probe_id,detail:`${i.probe_id} has no declared grammar refusal contract.`}))];n.sort((i,a)=>i.probe_id.localeCompare(a.probe_id)||i.code.localeCompare(a.code));let s=new Set(n.map(({probe_id:i})=>i));return{ok:n.length===0,probe_count:e.length,closed_probe_count:e.filter(({probe_id:i})=>!s.has(i)).length,findings:n}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="d3795bc4-fbe5-5ca4-bc90-b72a2d469dc7")}catch{}})();var 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 Ub(e,t){let r=[];t.error_code!==e.expected_error_code&&r.push({code:"error_code_mismatch",probe_id:e.probe_id,detail:`Expected ${e.expected_error_code}, received ${t.error_code}.`}),t.exit_code!==e.expected_exit_code&&r.push({code:"exit_code_mismatch",probe_id:e.probe_id,detail:`Expected exit ${e.expected_exit_code}, received ${t.exit_code}.`}),t.recovery_kind!==e.recovery_kind&&r.push({code:"recovery_kind_mismatch",probe_id:e.probe_id,detail:`Expected ${e.recovery_kind}, received ${t.recovery_kind}.`});let o=t.suggested_retry_args.indexOf("init"),n=o===0||o===2&&t.suggested_retry_args[0]==="--pm-path"&&t.suggested_retry_args[1]?.length>0;return e.recovery_kind==="initialize"&&!n&&r.push({code:"missing_init_recovery",probe_id:e.probe_id,detail:"Missing and uninitialized roots must emit a tokenized init retry."}),(t.unsafe_init_recommended||e.recovery_kind!=="initialize"&&t.suggested_retry_args.includes("init"))&&r.push({code:"unsafe_init_recovery",probe_id:e.probe_id,detail:"A tracker root that cannot be initialized safely must not recommend initialization."}),t.retry_succeeded||r.push({code:"retry_failed",probe_id:e.probe_id,detail:"The emitted retry or safe alternate-root recovery did not execute successfully."}),r}function KD(e){let t=new Map(e.map(n=>[n.probe_id,n])),r=[],o=0;for(let n of ft){let s=t.get(n.probe_id);if(s===void 0){r.push({code:"missing_probe",probe_id:n.probe_id,detail:"No runtime observation was supplied for this contract."});continue}let i=Ub(n,s);r.push(...i),i.length===0&&(o+=1)}return r.sort((n,s)=>n.probe_id.localeCompare(s.probe_id)||n.code.localeCompare(s.code)),{ok:r.length===0,probe_count:ft.length,closed_probe_count:o,findings:r}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="e6e71c2b-9315-5e03-b73e-926261338c01")}catch{}})();var Re,jb=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 Bb(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=jb[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 Ie(){if(Re!==void 0)return Re;let e=ee.filter(({command:n})=>Be(n)).flatMap(({command:n,family:s})=>It(n,Z(n)).map(i=>({command:n,family:s,concept:Bb(n,i.flag),flag:i.flag,aliases:Object.freeze([...i.aliases??[]]),value_kind:i.repeatable?"list":i.flag==="--limit"?"number":i.value_type}))),t=new Set(e.flatMap(n=>n.aliases.map(s=>`${n.command}:${s}`))),r=e.filter(n=>!t.has(`${n.command}:${n.flag}`)),o=new Map;for(let n of r){let s=o.get(n.concept)??new Set;s.add(n.value_kind),o.set(n.concept,s)}return Re=Object.freeze(r.map(n=>Object.freeze({...n,concept:o.get(n.concept)?.size===1?n.concept:`${n.concept}@${n.command}`}))),Re}function ZD(){return Object.freeze(Ie().map(e=>Object.freeze({command:e.command,canonical_flag:e.flag,accepted_spellings:Object.freeze([...new Set([e.flag,...e.aliases])].sort())})))}var mo=Object.freeze({init:30,item:20,config:36,extension:55,package:56,packages:56,install:27,upgrade:29,create:102,copy:24,focus:22,list:86,"list-all":86,"list-draft":84,"list-open":84,"list-in-progress":84,"list-blocked":84,"list-closed":84,"list-canceled":84,aggregate:40,context:45,ctx:45,get:30,graph:34,search:78,duplicates:25,eval:25,next:38,history:36,events:34,"history-attest":23,"history-redact":27,"history-repair":27,"history-compact":30,"history-author-acknowledge":28,merge:29,schema:43,profile:22,activity:36,restore:23,update:105,"update-many":146,close:32,"close-many":72,delete:24,append:25,comments:32,notes:36,learnings:32,files:40,docs:31,deps:32,plan:111,test:57,"test-all":40,telemetry:21,stats:29,health:36,validate:46,assurance:30,gc:22,workspace:23,contracts:29,claim:39,release:25,"start-task":23,"pause-task":23,"close-task":24,meet:33,event:33,remind:29,"test-runs-worker":20}),qb=1,fo=Object.freeze(Object.fromEntries(Object.entries({...mo,...Object.fromEntries(ke.flatMap(({alias:e,canonical:t})=>{let r=mo[e];return r===void 0?[]:[[t,r]]}))}).map(([e,t])=>[e,t+qb])));function _o(){let e=new Map(Object.keys(fo).map(t=>[t,0]));for(let{command:t}of Ie())e.set(t,Number(e.get(t))+1);return Object.freeze(Object.entries(fo).map(([t,r])=>Object.freeze({command:t,current:Number(e.get(t)),maximum:r})))}function zb(e,t,r){for(let o of e)for(let n of o.aliases){let s=t.get(`${o.command}:${n}`);s===void 0||s.flag===o.flag||r.push({code:"alias_collision",command:o.command,detail:`${n} aliases ${o.flag} but is canonical for ${s.flag}.`})}}function Hb(e,t,r){let o=new Set(t.map(({command:n})=>n));for(let n of e.keys())o.has(n)||r.push({code:"missing_budget",command:n,detail:`${n} has canonical flags but no persisted budget.`});for(let n of t){let s=e.get(n.command)??0;s===0&&r.push({code:"stale_budget",command:n.command,detail:`${n.command} has a persisted budget but no canonical flags.`}),!(s<=n.maximum)&&r.push({code:"budget_exceeded",command:n.command,detail:`${s} canonical flags exceed the ratcheted maximum ${n.maximum}.`})}}function Vb(e,t,r){let o=new Map(e.map(n=>[`${n.command}:${n.flag}`,n]));for(let n of t){let s=`${n.command}:${n.canonical_flag}`,i=o.get(s);if(!i){r.push({code:"removed_canonical_spelling",command:n.command,detail:`${n.canonical_flag} disappeared from the executable spelling inventory.`});continue}let a=new Set([i.flag,...i.aliases]);for(let c of n.accepted_spellings)a.has(c)||r.push({code:"removed_compatibility_spelling",command:n.command,detail:`${c} no longer resolves to ${n.canonical_flag}.`})}}function e1(e=Ie(),t=_o(),r=[]){let o=[],n=new Map,s=new Map,i=new Map,a=new Map;for(let c of e){let d=`${c.command}:${c.flag}`;n.has(d)?o.push({code:"duplicate_canonical_flag",command:c.command,detail:`${c.flag} has more than one canonical row.`}):n.set(d,c),a.set(c.command,(a.get(c.command)??0)+1);let l=s.get(c.concept);l!==void 0&&l!==c.value_kind?o.push({code:"inconsistent_concept_kind",command:c.command,detail:`${c.concept} uses both ${l} and ${c.value_kind}.`}):s.set(c.concept,c.value_kind);let p=i.get(c.concept);p!==void 0&&p!==c.flag?o.push({code:"semantic_spelling_collision",command:c.command,detail:`${c.concept} is canonicalized by both ${p} and ${c.flag}.`}):i.set(c.concept,c.flag)}return zb(e,n,o),Hb(a,t,o),Vb(e,r,o),o.sort((c,d)=>c.command.localeCompare(d.command)||c.code.localeCompare(d.code)||c.detail.localeCompare(d.detail)),{ok:o.length===0,entry_count:e.length,budget_count:t.length,concept_count:new Set(e.map(({concept:c})=>c)).size,baseline_entry_count:r.length,findings:o}}function t1(){let e=Ie(),t=_o(),r=new Map(t.map(({command:o})=>[o,"unknown"]));for(let{command:o,family:n}of e)r.set(o,n);return["# Generated flag lexicon budgets","","This file is generated by `listPmFlagLexicon()`. Compatibility aliases do not consume canonical budget.","","| Command | Capability family | Canonical flags | Maximum |","| --- | --- | ---: | ---: |",...t.map(({command:o,current:n,maximum:s})=>{let i=r.get(o);return`| \`${o}\` | ${i} | ${n} | ${s} |`}),""].join(`
34
+ `)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="3f3a5dca-8370-52d7-b279-dc6f9f0aeadf")}catch{}})();function o1(e){return e}function n1(e){return e}function i1(e){return e}function s1(e){return e}function a1(e){return e}function c1(e){return e}function d1(e){return e}function l1(e){return e}function p1(e){return e}function u1(e){return e}function m1(e){return e}function f1(e){return e}function _1(e){return e}function h1(e){return{handled:!0,result:e}}function g1(){return{handled:!1}}function y1(e){return e}function b1(e){return e}function T1(e){return e}function C1(e){return e}function E1(e){return e}function S1(e){return e}function w1(e){return e}function A1(e){return e}function O1(e){return e}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="68ca9ab1-91e0-5020-859e-fc1f1f6dcc56")}catch{}})();function Kb(e={},t={}){return new _e(t).extension(void 0,{...e,migrate:!0})}function Wb(e={},t={}){return new _e(t).packageMigrate(e)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="c96e4de9-16ef-581a-aa4b-6450917c2c65")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="604d7dcb-9fea-5631-8a72-b2a7ff3278f8")}catch{}})();function x(e){if(typeof e!="string"||!Et(e))throw new TypeError("Invalid reliability timestamp.");return Date.parse(e)}function Yb(e){let t=x(e.window_start),r=x(e.window_end);if(t>=r||!Number.isFinite(e.max_failure_rate)||e.max_failure_rate<0||e.max_failure_rate>=1||!Number.isSafeInteger(e.min_completed_attempts)||e.min_completed_attempts<1)throw new TypeError("Invalid reliability window policy.");if(e.families.length===0||e.families.some(o=>typeof o!="string"||o.trim().length===0)||new Set(e.families).size!==e.families.length)throw new TypeError("Expected unique, nonempty reliability families.");return{start:t,end:r}}function Xb(e,t,r,o){let n=new Map(t.map(i=>[i,[]])),s=new Set;for(let i of e){if(typeof i.id!="string"||i.id.trim().length===0||s.has(i.id))throw new TypeError("Invalid or duplicate reliability attempt identity.");s.add(i.id);let a=n.get(i.family);if(!a||!["success","failure","pending"].includes(i.outcome)||i.cause!==void 0&&(!["product","infrastructure","unknown"].includes(i.cause)||i.outcome!=="failure"))throw new TypeError("Invalid reliability attempt family, outcome or cause.");let c=x(i.started_at);if(i.repaired_at!==void 0&&(x(i.repaired_at)<c||i.outcome!=="failure"))throw new TypeError("Invalid reliability repair chronology.");c>=r&&c<o&&a.push(i)}return n}function H1(e,t){let{start:r,end:o}=Yb(t),n=[...Xb(e,t.families,r,o)].map(([s,i])=>{let a=i.filter(_=>_.outcome==="failure"),c=i.filter(_=>_.outcome!=="pending").length,d=c===0?null:a.length/c,l=a.filter(_=>_.repaired_at!==void 0&&x(_.repaired_at)<o),p={product:0,infrastructure:0,unknown:0};for(let _ of a)p[_.cause??"unknown"]+=1;let f=[];return c<t.min_completed_attempts&&f.push("insufficient_completed_attempts"),d!==null&&d>t.max_failure_rate&&f.push("failure_rate"),{family:s,attempts:i.length,completed:c,failed:a.length,pending:i.length-c,failure_rate:d,affected_days:[...new Set(a.map(_=>new Date(x(_.started_at)).toISOString().slice(0,10)))].sort(),repair_minutes:l.map(_=>(x(_.repaired_at)-x(_.started_at))/6e4).sort((_,g)=>_-g),unresolved:a.length-l.length,causes:p,violations:f,ok:f.length===0}});return{schema:"pm-reliability-window/1",window_start:new Date(r).toISOString(),window_end:new Date(o).toISOString(),ok:n.every(s=>s.ok),families:n}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="773ad2b6-326e-5483-bdce-a377f935cb31")}catch{}})();function le(e){return typeof e=="string"&&e.length>0&&e.trim()===e}function Jb(e){if(!Array.isArray(e)||e.length<2)throw new TypeError("Expected at least two artifact ledgers.");let t=new Map;for(let r of e){if(r===null||typeof r!="object"||!le(r.name)||t.has(r.name)||r.complete!==!0)throw new TypeError("Expected unique complete artifact ledgers.");if(!Array.isArray(r.identities))throw new TypeError("Invalid or duplicate artifact identity.");let o=new Set(r.identities);if(o.size!==r.identities.length||[...o].some(n=>!le(n)))throw new TypeError("Invalid or duplicate artifact identity.");t.set(r.name,o)}if([...t.values()].every(r=>r.size===0))throw new TypeError("Empty inventories cannot establish artifact reconciliation.");return t}function Qb(e,t){if(!Array.isArray(e))throw new TypeError("Expected unique evidence-backed artifact exceptions.");let r=new Map;for(let o of e){if(o===null||typeof o!="object"||!le(o.identity)||r.has(o.identity)||!le(o.reason)||!le(o.evidence))throw new TypeError("Expected unique evidence-backed artifact exceptions.");let n=o.missing_from;if(!Array.isArray(n)||n.length===0||n.length>=t.length||new Set(n).size!==n.length||[...n].some(s=>!t.includes(s)))throw new TypeError("Invalid artifact exception ledger signature.");r.set(o.identity,o)}return r}function K1(e,t=[]){let r=Jb(e),o=[...r.keys()].sort(),n=Qb(t,o),s=[...new Set([...r.values()].flatMap(d=>[...d]))].sort(),i=[],a=new Set;for(let d of s){let l=o.filter(_=>!r.get(_).has(d));if(l.length===0)continue;let p=n.get(d),f=p!==void 0&&JSON.stringify([...p.missing_from].sort())===JSON.stringify(l);f&&a.add(d),i.push({identity:d,present_in:o.filter(_=>r.get(_).has(d)),missing_from:l,disposition:f?{reason:p.reason,evidence:p.evidence}:null})}let c=[...n.keys()].filter(d=>!a.has(d)).sort();return{schema:"pm-artifact-ledgers/1",ok:i.every(d=>d.disposition!==null)&&c.length===0,counts:Object.fromEntries(o.map(d=>[d,r.get(d).size])),findings:i,stale_exceptions:c}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="15d63d97-9126-59ae-be28-b77fdfd07b9c")}catch{}})();import{createHash as go,createHmac as Zb,randomBytes as eT,timingSafeEqual as tT}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="98283845-5c48-5901-b54c-c8cc8138427b")}catch{}})();var P$="dev.unbrained.pm/progressive-tool-discovery",M$=Object.freeze({version:1,discoveryTool:"pm_discover",canonicalResult:"structuredContent.result",compatibilityText:"pointer"}),rT=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}),oT=Object.freeze(["profile_changed","tool_contract_changed","workspace_extension_changed","authorization_changed","ranking_signal_changed","cursor_integrity_key_rotated"]),yo={core:0,standard:1,full:2,internal:3},bo=Object.freeze(["core","standard","full"]),nT=new Set(["core","standard","full","custom"]),To=new Set(ee.map(({family:e})=>e)),iT=eT(32);function Me(e,t){if(typeof e!="string")throw new b(`pm tool discovery ${t} must be a string of at most 4096 Unicode characters.`,64);let r=e[Symbol.iterator](),o=0;for(let n=r.next();!n.done;n=r.next())if(o+=1,o>4096)throw new b(`pm tool discovery ${t} must be a string of at most 4096 Unicode characters.`,64);return e}function Co(e){if(!Number.isInteger(e)||Number(e)<1||Number(e)>100)throw new b("pm tool discovery limit must be from 1 through 100.",64);return Number(e)}function Eo(e){if(e!=="unbounded"&&(!Number.isInteger(e)||Number(e)<128))throw new b("pm tool discovery outputBudget must be unbounded or an integer of at least 128.",64);return e==="unbounded"?e:Number(e)}function So(e){if(e!==void 0&&typeof e!="boolean")throw new b("pm tool discovery includeSchema must be a boolean.",64);return e===!0}function wo(e){if(e===null||typeof e!="object"||Array.isArray(e))throw new b("pm tool discovery options must be an object.",64)}function sT(e){if(!Array.isArray(e))throw new b("pm tool discovery candidates must be an array.",64);for(let[t,r]of e.entries()){if(r===null||typeof r!="object"||Array.isArray(r))throw new b(`pm tool discovery candidate ${t} must be an object.`,64);if(typeof r.name!="string"||r.name.trim().length===0)throw new b(`pm tool discovery candidate ${t} name must be a non-empty string.`,64);if(typeof r.description!="string"||r.description.trim().length===0)throw new b(`pm tool discovery candidate ${t} description must be a non-empty string.`,64);if(r.inputSchema===null||typeof r.inputSchema!="object"||Array.isArray(r.inputSchema))throw new b(`pm tool discovery candidate ${t} inputSchema must be an object.`,64);if(r.authorized!==void 0&&typeof r.authorized!="boolean")throw new b(`pm tool discovery candidate ${t} authorized must be a boolean.`,64)}}function k$(e){if(wo(e),e.family!==void 0&&(typeof e.family!="string"||!To.has(e.family)))throw new b("pm tool discovery family must be a declared capability family.",64);if(e.tier!==void 0&&(typeof e.tier!="string"||!bo.includes(e.tier)))throw new b("pm tool discovery tier must be core, standard, or full.",64);return{...e.query!==void 0?{query:Me(e.query,"query")}:{},...e.family!==void 0?{family:e.family}:{},...e.tier!==void 0?{tier:e.tier}:{},...e.limit!==void 0?{limit:Co(e.limit)}:{},...e.cursor!==void 0?{cursor:Me(e.cursor,"cursor")}:{},...e.includeSchema!==void 0?{includeSchema:So(e.includeSchema)}:{},...e.outputBudget!==void 0?{outputBudget:Eo(e.outputBudget)}:{}}}function aT(e){return e===void 0||!Number.isFinite(e)?0:Math.min(1,Math.max(0,e))}function pe(e){return[...new Set(e.toLowerCase().match(/[a-z0-9]+/gu)??[])].sort()}function cT(e,t){let r=pe(e);if(r.length===0)return 0;let o=new Set(pe(t)),n=r.filter(i=>o.has(i)).length,s=t.toLowerCase().includes(e.toLowerCase())?.25:0;return Math.min(1,n/r.length+s)}function dT(e,t){let r=pe(e);if(r.length===0)return 0;let o=t.toLowerCase(),n=pe(t),s=r.filter(a=>n.some(c=>c.startsWith(a)||a.startsWith(c))).length,i=o.includes(e.toLowerCase())?.2:0;return Math.min(1,s/r.length+i)}function ho(e){return go("sha256").update(JSON.stringify(e)).digest("hex").slice(0,24)}function Ao(e,t,r){return Zb("sha256",r).update(JSON.stringify({version:1,fingerprint:e,offset:t})).digest("base64url")}function lT(e,t,r){let o={version:1,offset:t,signature:Ao(e,t,r)};return Buffer.from(JSON.stringify(o),"utf8").toString("base64url")}function pT(e,t,r,o){if(e===void 0)return 0;try{let n=JSON.parse(Buffer.from(e,"base64url").toString("utf8")),s=n.offset;if(n.version!==1||typeof s!="number"||!Number.isInteger(s)||s<0||s>r||typeof n.signature!="string")throw new Error("cursor fields do not match the request");let i=Buffer.from(Ao(t,s,o),"base64url"),a=Buffer.from(n.signature,"base64url");if(a.length!==i.length||!tT(a,i))throw new Error("cursor signature does not match the request");return s}catch(n){throw new b("Invalid or stale pm tool discovery cursor; restart discovery without cursor.",64,{reason:String(n)})}}function _t(e,t,r){return{value:aT(e),weight:t,available:r!=="unavailable",source:r}}function Pe(e,t,r){return _t(e??t,r,e===void 0?"computed":"host")}function uT(e,t,r){let o=Object.hasOwn(fe,e.name)?fe[e.name]:"help",n=ze(o),s=`${e.name} ${e.description} ${o} ${n}`,i=cT(t,s),a=new Set(pe(t)),c={lexical:_t(i,j.lexical,"computed"),semantic:Pe(e.signals?.semantic,dT(t,s),j.semantic),graph:Pe(e.signals?.graph,a.has(n)||a.has(o)?1:0,j.graph),permission:_t(1,j.permission,"authorization"),freshness:Pe(e.signals?.freshness,1,j.freshness),usage:Pe(e.signals?.usage,rT.includes(e.name)?1:0,j.usage)},d=Object.values(c).reduce((l,p)=>l+p.value*p.weight,0);return{name:e.name,description:e.description,command:o,tier:He(o),family:n,score:Number(d.toFixed(6)),signals:c,...r?{input_schema:structuredClone(e.inputSchema)}:{}}}function mT(e){if(e.cursorIntegrityKey!==void 0&&(!(e.cursorIntegrityKey instanceof Uint8Array)||e.cursorIntegrityKey.byteLength<32))throw new b("pm tool discovery cursorIntegrityKey must contain at least 32 bytes.",64);if(e.tier!==void 0&&(typeof e.tier!="string"||!bo.includes(e.tier)))throw new b("pm tool discovery tier must be core, standard, or full.",64);if(e.family!==void 0&&(typeof e.family!="string"||!To.has(e.family)))throw new b("pm tool discovery family must be a declared capability family.",64);if(e.profile!==void 0&&(typeof e.profile!="string"||!nT.has(e.profile)))throw new b("pm tool discovery profile must be core, standard, full, or custom.",64)}function fT(e){let t=Me(e.query===void 0?"":e.query,"query").trim().replace(/\s+/gu," ");Me(e.cursor===void 0?"":e.cursor,"cursor");let r=Co(e.limit===void 0?10:e.limit),o=Eo(e.outputBudget===void 0?1200:e.outputBudget);return mT(e),{query:t,includeSchema:So(e.includeSchema),limit:r,budget:o,maximumTier:yo[e.tier??"full"],profile:e.profile===void 0?"core":e.profile}}function Oo(e,t,r){let o=r??e.tools.reduce((i,a,c)=>i+(c===0?0:1)+Buffer.byteLength(JSON.stringify(a),"utf8"),0),n={...e,tools:[]},s=0;for(let i=0;i<4;i+=1){let a=Buffer.byteLength(JSON.stringify({...n,token_cost:{estimated_tokens:s,budget:t,within_budget:!0}}),"utf8"),c=Math.ceil((a+o)/4);if(c===s)break;s=c}return s}function _T(e,t,r){return e.filter(o=>o.authorized!==!1).map(o=>uT(o,r.query,r.includeSchema)).filter(o=>o.tier!=="internal"&&yo[o.tier]<=r.maximumTier&&(t.family===void 0||o.family===t.family)).sort((o,n)=>n.score-o.score||(o.name<n.name?-1:o.name>n.name?1:0))}function hT(e,t,r){if(t==="unbounded")return[...e];let o=[],n=0;for(let[s,i]of e.entries()){let a=n+(s===0?0:1)+Buffer.byteLength(JSON.stringify(i),"utf8");if(Oo(r(s+1),t,a)>t)break;o.push(i),n=a}return o}function x$(e,t={}){sT(e),wo(t);let r=fT(t),o=t.cursorIntegrityKey??iT,n=_T(e,t,r),s=ho({query:r.query,family:t.family??null,tier:t.tier??"full",includeSchema:r.includeSchema,profile:r.profile,ranked:n}),i=pT(t.cursor,s,n.length,o),a=n.slice(i,i+r.limit),c=[];r.includeSchema||c.push({name:"input_schema",reason:"compact_projection",restore_with:"Set includeSchema=true."}),i+r.limit<n.length&&c.push({name:"tools",reason:"limit",restore_with:"Continue with next_cursor or increase limit."});let d={result_type:"pm_tool_discovery",contract_version:1,query:r.query,profile:r.profile,total:n.length,ranking_policy:{version:1,formula:"weighted_sum_then_name",weights:j},cache:{key:ho({fingerprint:s,cursorIntegrityKey:go("sha256").update(o).digest("hex"),limit:r.limit,offset:i,budget:r.budget}),ttl_ms:3e4,scope:"private",invalidates_on:oT}},l=(g,T=g.length)=>{let E=i+T,B=E<n.length,v=[...c];return T<a.length&&v.push({name:"tools",reason:"token_budget",restore_with:"Continue with next_cursor or increase outputBudget."}),{...d,tools:[...g],returned:T,has_more:B,...B?{next_cursor:lT(s,E,o)}:{},omission_receipt:{has_omissions:v.length>0,omitted:v}}},p=g=>{let T=l(g),E=Oo(T,r.budget);return{...T,token_cost:{estimated_tokens:E,budget:r.budget,within_budget:r.budget==="unbounded"||E<=r.budget}}},f=hT(a,r.budget,g=>l([],g)),_=p(f);if(a.length>0&&f.length===0){let g=p([a[0]]).token_cost.estimated_tokens;throw new b(`pm tool discovery outputBudget is too small to return a tool; increase it to at least ${g}.`,64,{required:String(g)})}if(r.budget!=="unbounded"&&_.token_cost.estimated_tokens>r.budget)throw new b(`pm tool discovery outputBudget is too small; at least ${_.token_cost.estimated_tokens} estimated tokens are required for this page.`,64,{required:String(_.token_cost.estimated_tokens)});return _}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="e02d896b-ffa2-5bfa-83dc-d567e1ecd8be")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="915b1455-1b4d-542a-9287-25fc484eb9ac")}catch{}})();export{Rv as ACTIONABILITY_ORDERING_KINDS,Bc as ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS,pc as ACTIVITY_FLAG_CONTRACTS,ni as AGENT_PROVENANCE_DIMENSIONS,Ys as AGGREGATE_FLAG_CONTRACTS,La as APPEND_FLAG_CONTRACTS,hM as ASSURANCE_ACTIONS,gM as ASSURANCE_DECLARATION_KINDS,II as ASSURANCE_DOCUMENT_VERSION,tc as ASSURANCE_FLAG_CONTRACTS,PI as ASSURANCE_GATE_TRIGGERS,MI as ASSURANCE_MEASUREMENT_SOURCE_KINDS,EP as ASSURANCE_PRESET_IDS,AI as AssuranceEvaluationRefusalError,wI as AssuranceMutationRefusalError,OI as AssuranceSourceResolutionError,qn as BASELINE_ITEM_FORMAT_VERSION,vR as BOUNDARY_FIXTURE_CAPTURE_SOURCES,sR as BRIEF_LIST_FIELDS,si as BUILTIN_AGENT_PROVENANCE_ADAPTERS,W as BUILTIN_CORPUS_SHAPES,ii as BUILTIN_HARNESS_SIGNAL_DESCRIPTORS,ln as BUILTIN_ITEM_TYPE_VALUES,Ht as BUILTIN_PROFILES,RC as BUILTIN_RELATIONSHIP_KINDS,Gc as CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS,lc as CALENDAR_FLAG_CONTRACTS,Da as CLAIM_FLAG_CONTRACTS,Md as CLOSE_ACTION_OPTION_KEYS,xa as CLOSE_FLAG_CONTRACTS,Na as CLOSE_MANY_FLAG_CONTRACTS,Ba as CLOSE_TASK_FLAG_CONTRACTS,Xs as COMMENTS_FLAG_CONTRACTS,ZT as COMMON_MUTATION_COMMAND_OPTION_KEYS,Sc as COMPLETION_FLAG_CONTRACTS,hn as CONFIDENCE_TEXT_VALUES,pa as CONFIG_FLAG_CONTRACTS,Uc as CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS,t0 as CONTEXT_EVALUATION_METRIC_NAMES,mc as CONTEXT_FLAG_CONTRACTS,Ow as CONTEXT_INTENT_LIMIT_OVERRIDE_WARNING,Bt as CONTEXT_OUTPUT_VALUES,s0 as CONTEXT_PACKING_PROFILES,KM as CONTEXT_RECENCY_EPOCH,JM as CONTEXT_RELEVANCE_SERVICE,YM as CONTEXT_RELEVANCE_SIGNAL_NAMES,d0 as CONTEXT_SIGNAL_SET_VERSION,c0 as CONTEXT_SIGNAL_STORE_FORMAT_VERSION,l0 as CONTEXT_SIGNAL_STORE_WARNING_DETAILS,_w as CONTEXT_USAGE_LIMITS,Ec as CONTRACTS_FLAG_CONTRACTS,sc as COPY_FLAG_CONTRACTS,nd as CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,sd as CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,id as CREATE_COMMANDER_STRING_OPTION_CONTRACTS,CT as CREATE_DIRECT_CLOSE_REASON_DEFAULT,rc as CREATE_FLAG_CONTRACTS,xE as CURRENT_HISTORY_HASH_ALGORITHM,Ww as CURRENT_HISTORY_ITEM_HASH_VERSION,Xw as CURRENT_HISTORY_RECORD_HASH_VERSION,zn as CURRENT_ITEM_FORMAT_VERSION,f0 as ContextSignalStore,hw as ContextUsageValidationError,UM as DEFAULT_AUTHOR_IDENTITY_VOCABULARY,M0 as DEFAULT_CHILD_SAMPLE_LIMIT,iR as DEFAULT_COMPACT_LIST_FIELDS,bO as DEFAULT_DERIVED_INDEX_MINIMUM_ITEMS,mf as DEFAULT_EVAL_QUERIES_RELATIVE_PATH,yP as DEFAULT_RELATIONSHIP_CONTEXT_TOKEN_BUDGET,MM as DEFAULT_TERMINAL_TRANSITION_POLICY,y0 as DEFAULT_WORKSPACE_MEMORY_MINIMUM_ITEMS,xR as DEFECT_ESCAPE_CLASSES,NR as DEFECT_GATE_EVIDENCE_DISPOSITIONS,Fa as DELETE_FLAG_CONTRACTS,mn as DEPENDENCY_KIND_VALUES,hc as DEPS_FLAG_CONTRACTS,ea as DOCS_FLAG_CONTRACTS,Qa as DUPLICATES_FLAG_CONTRACTS,WP as DURABLE_MERGE_RECEIPT_INTRODUCED_AT,FR as DefectRecurrencePolicyParseError,yc as EVAL_FLAG_CONTRACTS,sf as EVAL_METRIC_NAMES,lf as EVAL_QUERY_SET_CONTRACT,pf as EVAL_QUERY_SET_EXAMPLE,df as EVAL_QUERY_SET_SCHEMA_ID,uc as EVENTS_FLAG_CONTRACTS,za as EVENT_FLAG_CONTRACTS,Do as EXECUTABLE_COMMAND_ALIASES,ue as EXIT_CODE,Ea as EXTENSION_ACTIVATE_FLAG_CONTRACTS,Ca as EXTENSION_ADOPT_ALL_FLAG_CONTRACTS,Ia as EXTENSION_ADOPT_FLAG_CONTRACTS,ck as EXTENSION_CAPABILITIES,bT as EXTENSION_CAPABILITY_CONTRACT,gT as EXTENSION_CAPABILITY_CONTRACT_VERSION,yT as EXTENSION_CAPABILITY_LEGACY_ALIASES,Ln as EXTENSION_CAPABILITY_REGISTRATION_SURFACES,Ra as EXTENSION_CATALOG_FLAG_CONTRACTS,Sa as EXTENSION_DEACTIVATE_FLAG_CONTRACTS,Ta as EXTENSION_DESCRIBE_FLAG_CONTRACTS,va as EXTENSION_DOCTOR_FLAG_CONTRACTS,ba as EXTENSION_EXPLORE_FLAG_CONTRACTS,ua as EXTENSION_FLAG_CONTRACTS,fa as EXTENSION_INIT_FLAG_CONTRACTS,ga as EXTENSION_INSTALL_FLAG_CONTRACTS,Aa as EXTENSION_MANAGE_FLAG_CONTRACTS,wa as EXTENSION_MIGRATE_FLAG_CONTRACTS,dk as EXTENSION_POLICY_MODES,lk as EXTENSION_POLICY_SURFACES,Oa as EXTENSION_RELOAD_FLAG_CONTRACTS,uk as EXTENSION_SANDBOX_PROFILES,ma as EXTENSION_SCOPE_FLAG_CONTRACTS,pk as EXTENSION_TRUST_MODES,ya as EXTENSION_UNINSTALL_FLAG_CONTRACTS,XR as EXTERNAL_DEPENDENCY_RESOLUTION_STATUSES,WR as EXTERNAL_DEPENDENCY_SOURCE_KIND,YR as EXTERNAL_DEPENDENCY_SOURCE_KIND_ALIAS,YO as ExtensionCommandError,Zs as FILES_FLAG_CONTRACTS,ac as FOCUS_FLAG_CONTRACTS,Xa as GC_FLAG_CONTRACTS,lR as GET_DEPTH_INPUT_VALUES,dR as GET_DEPTH_VALUES,fc as GET_FLAG_CONTRACTS,Ks as GLOBAL_FLAG_CONTRACTS,Yp as GRAPH_DURABLE_CACHE_MIN_ITEMS,Wp as GRAPH_DURABLE_CACHE_VERSION,gc as GRAPH_FLAG_CONTRACTS,nR as GRAPH_QUERY_DEFAULTS,Ne as GRAPH_SUBCOMMAND_VALUES,_c as GUIDE_FLAG_CONTRACTS,Za as HEALTH_FLAG_CONTRACTS,ia as HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS,fP as HISTORY_AUTHOR_ATTRIBUTION_BASELINE,EM as HISTORY_COMPACT_BULK_DEFAULT_MIN_ENTRIES,sa as HISTORY_COMPACT_FLAG_CONTRACTS,Ti as HISTORY_EVENT_CLASSIFICATION_VERSION,ta as HISTORY_FLAG_CONTRACTS,ME as HISTORY_HASH_ALGORITHMS,cO as HISTORY_ITEM_HASH_VERSION_3_INTRODUCED_IN,oa as HISTORY_REDACT_FLAG_CONTRACTS,na as HISTORY_REPAIR_FLAG_CONTRACTS,Nl as INIT_AGENT_GUIDANCE_MODE_VALUES,la as INIT_FLAG_CONTRACTS,Pa as INSTALL_FLAG_CONTRACTS,_n as ISSUE_SEVERITY_VALUES,nc as ITEM_COMPLETE_FLAG_CONTRACTS,GP as ITEM_LATEST_TIMESTAMP_FIELDS,TT as ITEM_METADATA_KEY_ORDER,oc as ITEM_MUTATE_FLAG_CONTRACTS,ic as ITEM_REOPEN_FLAG_CONTRACTS,Is as ITEM_REVISION_CONFLICT_CHANGE_LIMIT,Rs as ITEM_REVISION_CONFLICT_CODE,kP as ITEM_SCALAR_MISSING_VALUE,pn as ITEM_TYPE_VALUES,FP as ITEM_UNION_COLLECTION_FIELDS,m0 as JsonFileContextSignalStoreAdapter,Qs as LEARNINGS_FLAG_CONTRACTS,kE as LEGACY_HISTORY_HASH_ALGORITHM,ku as LINKED_TEST_ENV_NAME_PATTERN,xu as LINKED_TEST_PM_CONTEXT_MODE_VALUES,Mu as LINKED_TEST_PROTECTED_ENV_KEYS,Nu as LINKED_TEST_WORKSPACE_CONTEXT_MODE_VALUES,$c as LIST_COMMANDER_STRING_OPTION_CONTRACTS,aR as LIST_COMMAND_DEFAULT_PROJECTIONS,fk as LIST_FILTER_EXTENSION_FLAG_DEFINITIONS,Ws as LIST_FILTER_FLAG_CONTRACTS,nI as LIST_SORT_FIELDS,iI as LIST_SORT_ORDER_VALUES,Ci as MAINTENANCE_HISTORY_OPERATIONS,P0 as MAX_CHILD_PROJECTION_ITEMS,RR as MAX_WAIVER_NOTICE_DAYS,vT as MAX_WORKFLOW_POLICIES,RT as MAX_WORKFLOW_POLICY_TERMS,qa as MEET_FLAG_CONTRACTS,J0 as MERGE_DRIVER_ARTIFACT_VALUES,ra as MERGE_FLAG_CONTRACTS,Le as MERGE_SUBCOMMAND_VALUES,ek as MUTATION_EVENT_WIRE_BUDGET,ie as MemoryRelationshipGraphAdapter,jc as NEXT_COMMANDER_STRING_OPTION_CONTRACTS,Tc as NEXT_FLAG_CONTRACTS,Pm as NEXT_OUTPUT_VALUES,GM as NEXT_RANKING_POLICIES,Js as NOTES_FLAG_CONTRACTS,zv as OutputEnvelopeFitError,_a as PACKAGE_FLAG_CONTRACTS,ha as PACKAGE_INIT_FLAG_CONTRACTS,ja as PAUSE_TASK_FLAG_CONTRACTS,Pd as PLAN_CREATE_METADATA_PARAMETER_KEYS,da as PLAN_FLAG_CONTRACTS,qs as PLAN_SHOW_DEPTH_VALUES,Ke as PLAN_SUBCOMMANDS,Gm as PLAN_TEMPLATE_NAMES,db as PM_AGENT_TASK_ACCOUNTING_MODES,lt as PM_AGENT_TASK_TRANSCRIPT_VERSION,ko as PM_BULK_LIFECYCLE_COMMAND_ALIASES,ns as PM_CLI_ERROR_DETAILS_LIMITS,ls as PM_CLI_EXPECTED_ERROR_NAME,gR as PM_CLI_GRAMMAR_CONTRACT,uR as PM_CLI_GRAMMAR_NOUNS,Yo as PM_CLI_ONLY_TOOL_ACTION_WAIVERS,mR as PM_CLI_SHARED_VERBS,Lo as PM_COMMAND_ALIAS_CONTRACTS,ee as PM_COMMAND_CAPABILITY_CONTRACTS,Rt as PM_COMMAND_DESTINATION_CONTRACTS,bI as PM_COMMAND_EXIT_CONTRACTS,yI as PM_COMMAND_EXIT_OUTCOME_CONTRACTS,ki as PM_COMMAND_OUTPUT_BUDGET_CONTRACTS,_I as PM_COMMAND_OUTPUT_ENVELOPE_CONTRACTS,je as PM_COMMAND_POSITIONAL_CONTRACTS,ol as PM_COMMAND_VISIBILITY_CONTRACTS,cP as PM_COMPLETE_LIST_FINDING_CODES,Dv as PM_CONTEXT_INTENTS_FILE,vw as PM_CONTEXT_INTENT_CONTRACTS,Mo as PM_CONTEXT_OPS_COMMAND_ALIASES,Ho as PM_CORE_COMMAND_NAMES,F as PM_CORPUS_SHAPE_SCHEMA,Jo as PM_DEPRECATED_TOOL_ACTIONS,vi as PM_DIAGNOSTIC_DEGRADATION_STEPS,Ri as PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS,Oi as PM_DIAGNOSTIC_OUTPUT_CLASSES,Qo as PM_DISCOVERABLE_TOOL_ACTIONS,Wr as PM_EPISODE_SCHEMA,mI as PM_ERROR_CODE_CATALOG,dI as PM_ERROR_CODE_EXIT_CLASS_CONTRACTS,eo as PM_EXACT_COVERAGE_METRICS,Go as PM_EXTENSION_CAPABILITY_CONTRACTS,Vo as PM_EXTENSION_PACKAGE_ACTION_SUBCOMMANDS,jo as PM_EXTENSION_POLICY_MODE_CONTRACTS,zo as PM_EXTENSION_POLICY_SURFACE_CONTRACTS,qo as PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS,Uo as PM_EXTENSION_SERVICE_NAME_CONTRACTS,Bo as PM_EXTENSION_TRUST_MODE_CONTRACTS,Fi as PM_GENERIC_REFUSAL_GUIDANCE,ZI as PM_GITATTRIBUTES_END,QI as PM_GITATTRIBUTES_START,tP as PM_GITATTRIBUTES_V2_END,eP as PM_GITATTRIBUTES_V2_START,pl as PM_GITIGNORE_END,ll as PM_GITIGNORE_START,OM as PM_HISTORY_ATTESTATION_CONTRACT,Po as PM_HISTORY_COMMAND_ALIASES,YE as PM_HISTORY_OPERATION_ALIASES,JE as PM_HISTORY_OPERATION_CONTRACT,XE as PM_HISTORY_OPERATION_PATTERNS,Wo as PM_ITEM_ACTION_SUBCOMMANDS,KE as PM_ITEM_HISTORY_OPERATIONS,ot as PM_MCP_APPS_EXTENSION,Mr as PM_MCP_APPS_SERVER_CAPABILITY,Se as PM_MCP_APPS_SPEC_VERSION,Nr as PM_MCP_APP_CONTRACTS,xr as PM_MCP_APP_MIME_TYPE,rT as PM_MCP_ENTRY_TOOL_NAMES,m as PM_MCP_ERROR_CODES,IN as PM_MCP_HTTP_PROTOCOL_VERSION,Ag as PM_MCP_INPUT_REQUEST_METHODS,or as PM_MCP_LEGACY_PROTOCOL_VERSIONS,rr as PM_MCP_LOG_LEVELS,w as PM_MCP_META_KEYS,P$ as PM_MCP_PROGRESSIVE_DISCOVERY_EXTENSION,M$ as PM_MCP_PROGRESSIVE_DISCOVERY_SERVER_CAPABILITY,cl as PM_MCP_PROMPT_CONTRACTS,z as PM_MCP_PROTOCOL_VERSION,al as PM_MCP_RESOURCE_CONTRACTS,it as PM_MCP_SKILLS_DRAFT_REVISION,Lr as PM_MCP_SKILLS_EXTENSION,My as PM_MCP_SKILLS_SERVER_CAPABILITY,I as PM_MCP_SKILL_LIMITS,Ce as PM_MCP_SUBSCRIPTION_ID_META_KEY,te as PM_MCP_SUPPORTED_PROTOCOL_VERSIONS,CN as PM_MCP_TASKS_EXTENSION,Dg as PM_MCP_TASK_STATUSES,fe as PM_MCP_TOOL_COMMAND_CONTRACTS,lS as PM_MODE_PAIRED_OUTPUT_PROJECTION_CONTRACTS,fs as PM_MUTATION_ACTION_CONTRACTS,ke as PM_NAMESPACED_COMMAND_ALIASES,Vr as PM_OBSERVATION_SCHEMA,Ai as PM_OUTPUT_BUDGET_CLASSES,wi as PM_OUTPUT_DEGRADATION_STEPS,xt as PM_OUTPUT_ENVELOPE_KINDS,Ft as PM_PACKAGE_CONVENTIONAL_RESOURCE_ROOTS,Ko as PM_PACKAGE_ONLY_ACTION_SUBCOMMANDS,$t as PM_PACKAGE_RESOURCE_KINDS,Ue as PM_POSITIONAL_ACTION_CONTRACTS,Fd as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA,Dd as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION,jS as PM_READ_OUTPUT_COMPOSITION_OPTION_FLAGS,rw as PM_READ_OUTPUT_CONTINUATION_FINGERPRINT_POLICIES,GS as PM_READ_OUTPUT_DIMENSIONS,US as PM_READ_OUTPUT_OPTION_FLAGS,NS as PM_READ_OUTPUT_SESSION_MAX_SEEN_ITEM_IDS,xS as PM_READ_OUTPUT_SESSION_MIN_TOKENS,UC as PM_READ_OUTPUT_SURFACES,BS as PM_READ_OUTPUT_SURFACE_CONTRACTS,PS as PM_READ_OUTPUT_TAIL_RETENTION_POLICIES,dS as PM_READ_ROW_CONTRACTS,cS as PM_READ_ROW_JQ_SELECTOR,Bi as PM_RECOVERY_ECHO_FIELDS,bD as PM_RECOVERY_REFERENCE_FIELDS,ce as PM_RECOVERY_REFERENCE_KINDS,xb as PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE,po as PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE_V2,OD as PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE,lo as PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE_V2,xo as PM_RELOCATED_COMMAND_ALIASES,Ud as PM_REPRODUCIBLE_PROCESS_ENV,TI as PM_SUCCESS_EXIT_CODES,Xo as PM_TOOL_ACTIONS,kd as PM_TOOL_ACTION_PARAMETER_CONTRACTS,$d as PM_TOOL_PARAMETERS_SCHEMA,Ld as PM_TOOL_PARAMETERS_SCHEMA_MAJOR,Nd as PM_TOOL_PARAMETERS_SCHEMA_VERSION,Rd as PM_TOOL_RESERVED_CUSTOM_FIELD_PROPERTIES,Kr as PM_VERDICT_SCHEMA,WE as PM_WORKSPACE_HISTORY_OPERATIONS,zr as PM_WORKSPACE_RECIPE_SCHEMA,ca as PROFILE_FLAG_CONTRACTS,Qt as PROFILE_LINT_CODES,Jt as PROFILE_LINT_DIMENSIONS,zt as PROFILE_NAMES,We as PROFILE_SUBCOMMANDS,b as PmCliError,_e as PmClient,dP as PmCompleteListValidationError,y as PmMcpAuthorizationError,nr as PmMcpInputRequiredError,Or as PmMcpIssuerCredentialStore,u as PmMcpProtocolError,ir as PmMcpRequestStateReplayGuard,jr as PmMcpSkillRegistry,hr as PmMcpSubscriptionRegistry,tt as PmMcpTaskStore,fw as QUERY_CURSOR_CONTRACT,zS as READ_OUTPUT_MUTATION_CONFLICT_CODE,HS as READ_OUTPUT_SHAPING_CONTROL_FLAGS,ka as REINDEX_FLAG_CONTRACTS,eO as REINDEX_LOCK_ID,dt as RELATIONSHIP_GRAPH_SNAPSHOT_VERSION,Ga as RELEASE_FLAG_CONTRACTS,Ha as REMIND_FLAG_CONTRACTS,wt as RESERVED_ITEM_FIELD_NAMES,$a as RESTORE_FLAG_CONTRACTS,fn as RISK_VALUES,Vv as RelationshipEventLog,Kv as RelationshipEventStore,q as RelationshipGraph,Fe as RelationshipKindRegistry,aa as SCHEMA_FLAG_CONTRACTS,Fc as SEARCH_COMMANDER_STRING_OPTION_CONTRACTS,_k as SEARCH_EXTENSION_FLAG_DEFINITIONS,Cc as SEARCH_FLAG_CONTRACTS,Qu as SEMANTIC_ATTRIBUTION_LIMITS,ST as SETTINGS_DEFAULTS,yf as SNAPSHOT_SCHEMA,YI as SOURCE_CONTEXT_ACCESS_ENV,XI as SOURCE_CONTEXT_WRITE_OVERRIDE_ENV,om as START_BLOCKED_REFUSAL_CODE,rm as START_BLOCKER_ENFORCEMENT_DEFAULT,Ua as START_TASK_FLAG_CONTRACTS,Ja as STATS_FLAG_CONTRACTS,un as STATUS_VALUES,Vs as SUBCOMMAND_GLOBAL_FLAG_CONTRACTS,Ei as SUBSTANTIVE_HISTORY_OPERATIONS,Yw as SUPPORTED_HISTORY_ITEM_HASH_VERSIONS,Jw as SUPPORTED_HISTORY_RECORD_HASH_VERSIONS,NC as SUPPRESS_HOST_OUTPUT_MARKER,Wa as TELEMETRY_FLAG_CONTRACTS,Vf as TELEMETRY_SUBCOMMANDS,Ka as TEST_ALL_FLAG_CONTRACTS,Va as TEST_FLAG_CONTRACTS,Ya as TEST_RUNS_FLAG_CONTRACTS,jf as TEST_RUN_MEASUREMENT_LIMIT,wd as TOOL_ACTIVITY_OPTION_CONTRACTS,ud as TOOL_AGGREGATE_OPTION_CONTRACTS,Td as TOOL_BULK_MUTATION_FILTER_OPTION_CONTRACT_SOURCE,Sd as TOOL_CALENDAR_OPTION_CONTRACTS,Ed as TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS,Ad as TOOL_CONTEXT_OPTION_CONTRACTS,gd as TOOL_CREATE_OPTION_CONTRACTS,hd as TOOL_CREATE_OPTION_CONTRACT_SOURCE,Od as TOOL_DEPS_OPTION_CONTRACTS,vd as TOOL_GRAPH_OPTION_CONTRACTS,pd as TOOL_LIST_FILTER_OPTION_CONTRACTS,md as TOOL_SEARCH_FILTER_OPTION_CONTRACTS,_d as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS,fd as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACT_SOURCE,Cd as TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS,bd as TOOL_UPDATE_OPTION_CONTRACTS,yd as TOOL_UPDATE_OPTION_CONTRACT_SOURCE,ET as TYPE_TO_FOLDER,OC as UNKNOWN_SUBCOMMAND_COMPATIBILITY_CODES,ad as UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,dd as UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,cd as UPDATE_COMMANDER_STRING_OPTION_CONTRACTS,cc as UPDATE_FLAG_CONTRACTS,dc as UPDATE_MANY_FLAG_CONTRACTS,Ma as UPGRADE_FLAG_CONTRACTS,On as URL_CREDENTIAL_PLACEHOLDER,ec as VALIDATE_FLAG_CONTRACTS,OT as WORKFLOW_POLICY_ACTIONS,nP as WORKFLOW_POLICY_DOCUMENT_SCHEMA,oP as WORKFLOW_POLICY_SCHEMA,bc as WORKSPACE_FLAG_CONTRACTS,bA as WORKSPACE_HISTORY_ID,bf as WORKSPACE_SNAPSHOT_ACTIONS,Xl as WorkspaceGraphCache,Qv as WorkspaceTransactionInterruptedError,Su as _testOnly,I0 as _testOnlyAggregateCommand,Wl as _testOnlyConfigCommand,L0 as _testOnlyGetCommand,du as _testOnlyHealthCommand,Fl as _testOnlyInit,Ll as _testOnlyInitAgentGuidance,Pk as _testOnlyItemTransaction,nk as _testOnlyMutationEvents,O0 as _testOnlyNextCommand,X0 as _testOnlySearchCommand,TP as _testOnlySimilarity,qm as _testOnlyTemplates,Tu as _testOnlyValidateCommand,ak as _testOnlyWorkspacePosition,kk as abandonItemTransaction,oR as abandonWorkspaceTransaction,OP as acceptAssuranceProposals,yu as acknowledgeLinkedTests,Vl as acknowledgeUnknownAuthorHistoryEvents,Hl as acknowledgeUnknownAuthorHistoryEventsFromTransport,TO as acquireItemMetadataDerivedIndexLock,Ge as acquireLock,oi as acquireLockLease,px as activateExtensionForTest,QC as activateExtensions,im as admitStartWithOpenBlockers,ri as agentSessionEnvironment,K_ as aggregate,Pf as analyzeAgentProvenanceDescriptorCoverage,DR as analyzeDefectChangeRisk,_M as analyzeDefectRecurrenceCoverage,Cp as analyzeDuplicateItems,Yv as analyzeGraphImpact,Kd as analyzeHierarchyIntegrity,Xv as analyzeKnowledgeGraph,EI as analyzePmCommandExitConformance,Zo as analyzePmToolActionParity,rM as analyzeReconciliationDiscard,Wv as analyzeRelationshipExecution,Up as analyzeRelationshipSchedule,gg as analyzeSdkActionCoverage,Pt as analyzeSdkCliParameterCompleteness,ih as append,Hi as appendHistoryEntry,SA as appendWorkspaceAuditEvent,EA as appendWorkspaceHistoryChange,GT as applyAcceptanceCriteriaMutations,wP as applyAssurancePreset,Pc as applyBootstrapPagerPolicy,lM as applyClosureTimestampFix,kw as applyContextIntentProjection,Im as applyContextTagProjection,sI as applyFilterValueEcho,nO as applyHistoryPatch,Gd as applyInvocationAuthorOverride,ap as applyPathMigrations,QS as applyReadOutputDimensions,WS as applyReadOutputIncludeModes,DS as applyReadOutputSessionReferences,wE as applyRegisteredItemFieldDefaultsAndValidation,pp as applyStandaloneNote,Us as applyStoredExtensionMigrationState,jT as applyTagRemovals,LM as applyTerminalOrderingPolicy,up as artifactKey,fC as asRecordClone,mC as asRecordOrNull,qe as assembleWorkspaceRelationshipGraph,mP as assertCompleteListResult,Hx as assertExtensionBlueprint,zx as assertExtensionCapabilityUsage,Ox as assertExtensionDeactivated,Wx as assertExtensionManifestCompatible,Kx as assertExtensionManifestMatchesBlueprint,Yx as assertExtensionPreflight,Xd as assertHierarchyMutationAllowed,SM as assertHistoryCompactTarget,nM as assertHistoryRepairTarget,Zi as assertInitializedTracker,cp as assertLinkedArtifactMutationIsUnambiguous,Qx as assertMcpClientCapabilities,Jx as assertMcpProtocolHeader,cb as assertMemoryRelationshipGraphAdapterConformance,zT as assertNoUnknownCsvKeys,Pu as assertNonHierarchyCardinalityMutationAllowed,vx as assertPackageManifest,kA as assertParentReferenceIsNotSelf,iL as assertPmMcpSkillsCapability,Vx as assertProjectProfile,_O as assertProjectRuntimeCompatibility,uO as assertProjectRuntimeFormatGuard,pS as assertProjectionModeChoice,Qi as assertReadableTrackerRoot,Rx as assertRegisteredCommandContract,Fx as assertRegisteredCommandOverride,Nx as assertRegisteredExporter,Ix as assertRegisteredFlags,Px as assertRegisteredHook,xx as assertRegisteredImporter,Lx as assertRegisteredItemField,Dx as assertRegisteredItemType,qx as assertRegisteredMigration,Gx as assertRegisteredParserOverride,Ux as assertRegisteredPreflightOverride,$x as assertRegisteredProfile,jx as assertRegisteredRendererOverride,Mx as assertRegisteredSearchProvider,Bx as assertRegisteredServiceOverride,kx as assertRegisteredVectorStoreAdapter,kC as assertRelationshipEdgeAllowed,oo as assertRelationshipGraphAdapterConformance,$T as assertSchemaPreviewSupported,Yf as assertTestMeasurementRun,qw as assertWellFormedOutputText,kI as assuranceAssertionUpdateIsLoosening,Lw as attachContextIntentReceipt,gw as attachContextUsageServingReceipt,fu as attachLinkedTestMutationProvenance,mu as attachLinkedTestProvenance,Xe as attachMcpServerInfo,gS as attachOutputOmissionReceipt,$w as attachOutputTokenAccounting,Dw as attachReadOutputContracts,$S as attachReadOutputSessionReceipt,yl as auditMergeAttributeFence,rP as auditMergeDriverConfiguration,Vp as auditWorkspaceRelationshipGraph,zN as authorizeMcpHttpRequest,ei as boundAgentEpisodeIdentity,OS as boundReadOutputRows,Am as buildChildrenByParent,z0 as buildCompactSearchFilterSummary,aI as buildContentFilterEcho,u0 as buildContextSignalSnapshot,Xy as buildCorpusShapeItemPlan,LR as buildDefectRecurrenceIndex,Rl as buildExtensionDescribeResult,Pl as buildExtensionInstallPlan,cI as buildGovernanceMissingFilterEcho,BA as buildInvalidTypeError,k0 as buildItemChildrenRollup,Rk as buildItemCompletionMutations,XM as buildItemContextRelevanceCandidates,OO as buildItemNotFoundError,N0 as buildItemSchedule,pM as buildLinkedFileRepairReport,LN as buildMcpAuthorizationDiscoveryUrls,Cg as buildMcpCompleteResult,eN as buildMcpDiscoverResult,UN as buildMcpDynamicRegistrationMetadata,vN as buildMcpHttpRequestHeaders,cN as buildMcpInputRequiredResult,NN as buildMcpProtectedResourceMetadata,hl as buildMergeAttributePatterns,xd as buildPmActionToolInputSchema,ID as buildPmRefusalClosureCensus,bP as buildRelationshipContext,MO as buildSearchCorpus,xO as buildSemanticCorpusInput,aM as buildStatusRoleWarnings,Ji as buildTrackerInitializationRecovery,FO as buildVectorizationEmbeddingIdentity,GO as buildVectorizationEmbeddingMetadata,H0 as buildVerboseSearchFilters,iP as buildWorkflowCompletenessCheck,b0 as buildWorkspaceMemorySnapshot,Zn as canonicalDocument,eC as canonicalizeCommandOptionKey,Hk as canonicalizeCommandSuggestions,WM as canonicalizeContextRecencyCoordinate,IC as canonicalizeRelationshipKind,TD as censusPmRecoveryReferenceProducers,uP as certifyCompleteListResult,ax as checkExtensionManifestCompatibility,Bh as claim,qh as claimNext,_P as classifyHistoryAuthorEvent,Si as classifyHistoryEvent,eM as classifyHistoryMergeReceiptReferences,zC as classifyHostEnvironmentFault,K0 as classifyImplicitSemanticFallbackReason,Kn as classifyItemFormatVersion,Jf as classifyLinkedTestCommandSafety,Qf as classifyLinkedTestFailure,_E as clearActiveExtensionHooks,eu as clearDurableGraphCache,oS as clearFocusedItem,i_ as clearWorkspaceContractsCache,jh as close,Au as closeItem,Jh as closeTask,xc as coalesceRepeatedListFlags,Iv as collectBlockedByIds,Mv as collectBlockedByIdsFromCorpus,bw as collectContextUsageDeliveredItemIds,el as collectDanglingDependencyReferences,xv as collectDependencyBlockedIds,Qd as collectDuplicateDependencyRows,Hp as collectDuplicateRelationshipEdgeGroups,V0 as collectErrorCauseCodes,Vd as collectHierarchyRelations,Er as collectMcpHeaderAnnotations,tl as collectMissingDependencyTargetIds,Iu as collectNewOrderingCycleWarnings,Bp as collectOrderingCycles,Zd as collectOrderingStorageContradictions,Gv as collectPackageContextIntentContracts,Ut as collectPackageExtensionDirectories,EE as collectRegisteredItemFieldNames,jE as collectRuntimeCreateFieldValues,qA as collectRuntimeFilterValues,BE as collectRuntimeUpdateFieldValues,Tm as collectSubtreeIds,Dn as collectUsedExtensionCapabilities,tC as commandOptionFlagLabel,X_ as comments,I_ as commitImportedItem,Ik as commitItemCompletion,vk as commitItemMutations,eR as commitWorkspaceTransaction,Hs as compactFlagAliasContracts,Cm as compareCriticalItems,dO as comparePmDateVersions,Jv as compareRelationshipSnapshots,_C as compareTimestampStrings,HM as compileHistoryProvenanceMatcher,Pw as composeContextIntentContracts,ex as composeExtension,sx as composeExtensionPackage,Lv as computeActionabilityReport,hA as computeHistoryDiff,Fp as computeRelationshipCentrality,$p as computeRelationshipDominators,Yl as computeWorkspaceGraphFingerprint,ah as config,fE as consumeAfterCommandAffectedItems,j_ as context,Nw as contextIntentRowId,Hh as copy,Zf as countFailureCategories,wS as countReadOutputRows,Fh as create,SP as createAssurancePreset,mM as createAssuranceWorkspaceContext,gC as createCheckpointId,lP as createCompleteListOptions,ZC as createCoreCommandHookContext,Zr as createCorpusShapeMeasurement,$I as createEmptyAssuranceDocument,jC as createEmptyExtensionRegistrationRegistry,XO as createExtensionCommandError,$s as createExtensionCommandSdk,xn as createExtensionContributionInventory,Xx as createExtensionTestHarness,zi as createHistoryEntry,pv as createLazyModule,sP as createLifecycleCompletenessPolicies,HN as createMcpStaticBearerVerifier,EN as createMcpTaskStore,AO as createMutationGuardSdk,uS as createOutputOmissionReceipt,us as createPmCliExpectedError,Ds as createPmCliProgram,Pi as createPmCommandOutputBudget,aw as createQueryFingerprint,ab as createRelationshipGraphScaleFixture,J as createRelationshipGraphSnapshot,St as createRelationshipKindRegistry,Bd as createReproducibleProcessRunner,B0 as createSearchCursorFingerprint,eE as createSerialQueue,XT as createStdinTokenResolver,vC as createUnknownSubcommandError,DT as createWorkflowPolicyEvaluator,Tf as createWorkspaceSnapshot,ux as deactivateExtensionForTest,g1 as declineServiceOverride,xw as decodeContextIntentCursor,lv as decodeHtmlEntitiesInOptions,Cr as decodeMcpHttpHeaderValue,Gw as decodePmTableRows,pw as decodeQueryCursor,dw as decodeQueryCursorEnvelope,lw as decodeQueryCursorState,iw as decodeReadOutputContinuationCursor,dx as decodeToon,XN as decoratePmMcpToolsWithApps,fp as dedupeLinkedArtifacts,AE as defaultConfigScope,QM as defaultScoreContextCandidates,S1 as defineAfterCommandHook,C1 as defineBeforeCommandHook,E1 as defineBeforeMutationHook,i1 as defineCommand,u1 as defineCommandOverride,K as defineCorpusShape,_L as defineEpisodeSpecification,T1 as defineExporter,Qk as defineExtension,Zk as defineExtensionBlueprint,o1 as defineExtensionManifest,s1 as defineFlag,b1 as defineImporter,c1 as defineItemField,a1 as defineItemType,d1 as defineMigration,Uy as defineObservationContract,O1 as defineOnIndexHook,A1 as defineOnReadHook,w1 as defineOnWriteHook,m1 as defineParserOverride,Mi as definePmCommandOutputBudget,fI as definePmCommandOutputEnvelope,lI as definePmErrorCodeCatalog,f1 as definePreflightOverride,n1 as defineProjectProfile,y1 as defineRendererOverride,l1 as defineSearchProvider,_1 as defineServiceOverride,p1 as defineVectorStoreAdapter,zy as defineVerdictContract,we as defineWorkspaceRecipe,Vh as deleteItem,Of as deleteWorkspaceSnapshot,xC as dependencyToRelationship,oh as deps,AP as deriveAssuranceProposals,cM as deriveClosureTimestamp,rx as deriveExtensionCapabilities,hk as deriveMutationTransactionId,SI as derivePmBulkMutationEffect,CD as derivePmRecoveryReferenceObligations,jp as deriveRelationshipDeadlines,El as deriveSchemaEvolutionMigrationId,rv as deriveTelemetryCommandResolution,KA as describeAllowedTransitions,WI as describeExtensionActivation,ox as describeExtensionBlueprint,wC as describeFlagScalarValueFailure,cm as describeItemOwnershipConflict,xs as describeItemRevisionChanges,fL as describeObservationCost,Yt as describeProfileComposition,Xt as describeProjectProfile,Lk as describeReadCompletenessControls,JO as describeUnknownError,mi as detectAgentIdentity,gi as detectHarnessIdentity,Lp as detectRelationshipCommunities,fi as diagnoseAgentIdentity,Kp as diffRelationshipAuditSnapshots,zf as diffTestRunMeasurements,pN as digestMcpRequestParameters,XC as discoverExtensions,bn as discoverNearbyPmRoot,x$ as discoverPmTools,pO as discoverProjectRuntimeVersionPins,rh as docs,Y_ as duplicates,Xp as durableGraphCachePath,tu as durableGraphCacheStatus,Hn as effectiveItemFormatVersion,Sv as emitTelemetryErrorEvent,R_ as emptyImportedDocument,NP as encodeItemScalarDecisionValue,Tr as encodeMcpHttpHeaderValue,Fw as encodePmTableRows,cw as encodeQueryCursor,nw as encodeReadOutputContinuationCursor,lx as encodeToon,gA as enforceHistoryStreamPolicyForItem,yA as enforceHistoryStreamPolicyForItems,AR as enrichCliFlagInvocationContract,It as enrichCliFlagInvocationContracts,sO as ensureMaterializedHistoryTarget,ml as ensurePmGitignore,rp as ensureScope,WO as ensureSentryCommandTracing,KO as ensureSentryInit,v_ as ensureTrackerInitialized,xp as enumerateRelationshipPaths,Ni as estimatePmOutputTokens,GI as evaluateAssuranceAssertion,UI as evaluateAssuranceGate,kR as evaluateBoundaryFixtures,r0 as evaluateContextRanking,$R as evaluateDefectGateEvidence,FI as evaluateMeasurement,cf as evaluateMetricFloors,hs as evaluateMutationGuard,Df as evaluateProvenanceCoverage,H1 as evaluateReliabilityWindow,xf as evaluateSemanticAttributionCoverage,Sp as evaluateSimilarityGovernance,VA as evaluateTransition,Hy as evaluateVerdictContract,LT as evaluateWorkflowPolicies,os as executeEmbeddingBatchesWithRetry,DO as executeVectorDelete,$O as executeVectorReset,LO as executeVectorUpsert,Dy as executeWorkspaceRecipe,lp as expandAddGlobEntries,Ap as explainSourceTraceability,RM as exportAttestation,Qh as extension,eg as extensionActivate,tg as extensionDeactivate,Zh as extensionList,Kb as extensionMigrate,ZP as extractHistoryMergeReceiptDispositions,QP as extractHistoryMergeReceiptReferences,jN as extractMcpTraceContext,rO as extractPatchFailureContext,lu as extractReferencedPmItemIdsFromCommand,sb as federateRelationshipGraphSnapshots,Z_ as files,eh as filesDiscover,th as filesLookup,Tw as finalizeContextUsageDelivery,rb as findCoverageDeficits,Ep as findDuplicateClusters,_l as findGitWorkspaceRoot,DE as findHistoryIdentityDiscontinuities,Ol as findInstalledNpmPackageCandidate,YN as findPmMcpAppByUri,No as findPmNamespacedCommand,Dp as findRedundantRelationshipEdges,Gp as findRelationshipCutStructure,Tp as findSimilarItems,Ev as finishTelemetryCommand,Hv as fitOutputEnvelope,SC as flattenFlagListValue,Zy as flushTelemetryQueue,Wh as focus,Np as forEachMatchedRelationshipEdge,zp as formatDuplicateEdgeGroup,Wd as formatHierarchyRelation,qp as formatOrderingStorageContradiction,hR as formatPmPositionalActionFlagTip,tf as formatProfileApplyHuman,ef as formatProfileLintHuman,Qm as formatProfileListHuman,Zm as formatProfileShowHuman,Al as formatSchemaEvolutionMigrationHuman,Y0 as formatVectorIndexRecoveryWarnings,sk as formatWorkspacePositionHuman,kh as gc,Wi as generateItemId,H_ as get,pE as getActiveCommandResult,Rw as getActiveContextIntentContracts,Fn as getActiveExtensionRegistrations,qN as getActiveMcpTraceContext,BI as getAssuranceDeclaration,fg as getContracts,tS as getFocusedItem,En as getHistoryPath,qv as getItemAt,Cn as getItemPath,bs as getMutationActionContract,ul as getPmGitignoreBlock,Tn as getSettingsPath,s_ as getWorkspaceContracts,TA as getWorkspaceHistoryPath,nh as graph,Jp as graphAuditBaselinePath,Nf as groupHistoryByEpisode,h1 as handleServiceOverride,Zx as hasMcpClientExtension,WN as hasPmMcpAppsCapability,Be as hasSubcommandFlagContractsForCommand,UO as hasVectorizationEmbeddingIdentityChanged,jO as hasVectorizationVectorDimensionChanged,iA as hashDocument,sA as hashDocumentForVersion,aA as hashEmptyDocument,Zw as hashHistoryPatch,Qw as hashHistoryRecord,eA as hashHistoryStream,LP as hashItemScalarDecisionValue,Mh as health,Ip as hierarchyAncestors,Pp as hierarchyDescendants,Dh as historyCompact,$h as historyCompactBulk,LE as historyDigest,zM as historyEntryMatchesProvenance,lO as historyItemHashVersionForRuntime,xh as historyRedact,Nh as historyRepair,Lh as historyRepairAll,Pv as indexBlockedByIds,Yd as indexHierarchyRelations,BO as inferConsistentVectorDimension,Ii as inferPmOutputBudgetClass,sh as init,pP as inspectCompleteListResult,BC as inspectExtensionManifestSchema,Ul as inspectHistoryAuthorStream,qP as inspectMergeReceiptEvidence,fO as inspectProjectRuntimeCompatibility,As as inspectStaleInProgressItems,yg as inspectStaticExtensionInventory,sM as inspectStatusRoleAssignments,CA as inspectWorkspaceHistoryState,Cf as inspectWorkspaceSnapshot,Cl as installMergeFence,tN as interpretMcpResultType,km as isAlreadyClaimedError,ev as isCommanderError,Fk as isCompatibleRecoveryFlag,Xc as isErrnoError,Av as isExternalDependencyReference,Ov as isExternalDependencySourceKind,me as isFileMissingError,Gi as isGenericRefusalRequired,Ui as isGenericRefusalWhy,DC as isHostOutputSuppressed,ps as isItemAlreadyExistsError,Ns as isItemRevisionConflict,xP as isItemScalarMissingValue,YP as isLegacyMergeReceiptSummary,h as isMcpRecord,gs as isMutationAction,MC as isOrderingRelationshipKind,PA as isPlaceholderReferenceToken,is as isPmCliErrorDetails,ms as isPmCliExpectedError,tn as isPmExtensionCapabilityContract,on as isPmExtensionPolicyModeContract,nn as isPmExtensionPolicySurfaceContract,rn as isPmExtensionServiceNameContract,CI as isPmKnownExitCode,hI as isPmMutationReceipt,Ve as isPmSuccessfulExitCode,ds as isPmTokenBudgetRecovery,en as isPmToolAction,XP as isPreDurableCloneLocalReceiptSummary,JP as isPreDurableDispositionEligibleReference,mO as isProjectMutatingInvocation,uv as isPureSnakeCaseAlias,ew as isReadOutputBudgetExceeded,kS as isReadOutputSessionReference,$k as isReadProjectionRecoveryFlag,ZS as isReadResultOmittedForBudget,fS as isReadRowContract,zd as isRuntimeRecord,XA as isSettingsReadFallback,nm as isStartTransition,_v as isTerminalPlanMode,zE as isTerminalStatus,Mn as isTimestampLiteral,IR as isWaiverNoticeDays,Ck as itemDocumentToMutationOptions,x0 as itemHasSchedule,Nn as jaccardSimilarity,Q_ as learnings,AC as levenshteinDistanceWithinLimit,Kc as limitAnnotationEntries,_u as linkedTestTrustFingerprint,nx as lintExtensionBlueprint,qC as lintExtensionManifestSchema,Zt as lintProjectProfile,B_ as list,ci as listAgentProvenanceAdapters,kc as listAliasPluralKeys,q_ as listAllComplete,SO as listAllDocumentCandidatesCached,rs as listAllItemMetadata,wO as listAllItemMetadataLight,jI as listAssuranceDeclarations,KI as listAssuranceVerdicts,Wy as listBuiltinCorpusShapes,Vk as listCoreClosedDomainContracts,pR as listGetProjectionFields,PP as listInvalidProvenanceHistoryStreamIds,cR as listListProjectionFields,zP as listMergeReceipts,ys as listMutationActions,tk as listMutationEvents,_o as listPmCommandFlagBudgets,il as listPmCommandsForFamily,nl as listPmCommandsForTier,Ie as listPmFlagLexicon,ZD as listPmFlagSpellingInventory,sl as listPmMcpToolsForProfile,BD as listPmRequiredArgumentRefusalContracts,qD as listPmSubcommandRefusalContracts,Wt as listProfiles,VD as listTrackerPreflightRecoveryContracts,wk as listUpsertKeyCandidates,Ef as listWorkspaceSnapshots,Uv as loadContextIntentRuntimeLayers,zm as loadCreateTemplateOptions,JC as loadExtensions,ou as loadGraphAuditBaseline,Ak as loadGuardedRuntimeSchema,bC as loadMutationCheckpoint,k as loadRelationshipGraphAdapter,es as locateItem,qT as looksLikeGenericKeyValueEntry,AS as mapReadOutputRows,HP as markMergeReceiptReconciled,zA as matchesRuntimeFilters,Tv as maybeRunFirstUseTelemetryPrompt,Jy as measureCorpusShapePlan,Xi as measureItemMetadataReadWork,UT as mergeAdditiveTags,tx as mergeExtensionBlueprints,DP as mergeHistoryStreams,UP as mergeItemDocuments,jP as mergeJsonDocuments,Nc as mergeLinkedTestTwoTokenEntries,$P as mergeRelationshipEventStreams,vm as mergeSortedWarnings,fv as migrateItemFilesToFormat,RO as mutateItem,vO as mutateItemWithHistoryContext,wA as mutateWorkspaceJsonWithHistory,V_ as next,li as normalizeAgentProvenanceAdapterValue,Vc as normalizeAnnotationTransportOptions,RI as normalizeAssuranceEvaluation,vI as normalizeAssuranceMutation,Lc as normalizeBootstrapInvocation,IE as normalizeBulkIdsValue,Jd as normalizeDependencyGraphTarget,eI as normalizeDependencySeedId,ZR as normalizeDependencySourceKind,kt as normalizeDirectExtensionCommandOptions,Ps as normalizeExpectedItemHash,kn as normalizeExtensionContributionInventory,eS as normalizeHistoryOperationForWrite,IP as normalizeInvalidHistoryProvenance,wR as normalizeItemAddressInvocation,Vn as normalizeItemFormatVersion,Ki as normalizeItemId,Xn as normalizeItemMetadata,tI as normalizeItemReference,Mc as normalizeLegacyExtensionActionSyntax,dp as normalizeLinkedPath,IA as normalizeParentReferenceValue,Vt as normalizeProfileName,Vi as normalizeRawItemId,YS as normalizeReadOutputIncludeModeOptions,pA as normalizeReplayPatchOps,Ts as normalizeSimilarityText,qE as normalizeStatusForRegistry,Yn as normalizeStatusInput,FE as normalizeStatusInputWithRegistry,ZO as normalizeThrownExitCode,J_ as notes,Pn as nowIso,Qp as openDurableGraphCache,lN as openMcpRequestState,hL as openPmEpisode,Mp as orderingPredecessors,kp as orderingSuccessors,a0 as packContextCandidates,Em as packRankedContextItems,pg as packageActivate,lg as packageCatalog,ug as packageDeactivate,cg as packageDescribe,sg as packageDoctor,ng as packageInstall,rg as packageLifecycle,og as packageList,ag as packageManage,Wb as packageMigrate,dg as packageReload,ig as packageUninstall,mw as paginateQueryRows,op as parseAddEntries,np as parseAddGlobEntries,Yc as parseAnnotationTextInput,gk as parseAtomicMutationControls,Ic as parseBootstrapCommandName,Oc as parseBootstrapGlobalOptions,Rc as parseBootstrapHelpRequest,Dc as parseBootstrapTypeValue,RE as parseBulkIdsText,ym as parseContextDepth,fm as parseContextFocusFields,$v as parseContextIntentDeclarations,bm as parseContextSections,p0 as parseContextSignalSnapshot,BT as parseCsvKv,UR as parseDefectChangeRiskRequest,fM as parseDefectRecurrenceCoverageRequest,GR as parseDefectRecurrencePolicy,af as parseEvalMetricFloors,uf as parseEvalQuerySet,Ms as parseExpectHashSpecs,dC as parseExtensionLongFlagToken,su as parseGraphSubcommand,vM as parseHistoryAttestation,BM as parseHistoryProvenanceFilters,jR as parseIntegerLimit,HE as parseItemDocument,yk as parseItemMutationBatch,jA as parseLimit,qu as parseLinkedTestAssertionEqualsMap,zu as parseLinkedTestAssertionGteMap,$u as parseLinkedTestBoolean,Fu as parseLinkedTestContextMode,Du as parseLinkedTestEnvClear,Lu as parseLinkedTestEnvSet,Hu as parseLinkedTestJsonEntries,Bu as parseLinkedTestMinLines,ju as parseLinkedTestRegexList,Uu as parseLinkedTestStringList,Gu as parseLinkedTestWorkspaceContextMode,Rg as parseMcpCachePolicy,bg as parseMcpImplementation,Ze as parseMcpInputRequests,dr as parseMcpInputResponses,Qg as parseMcpSubscriptionFilter,sp as parseMigrateEntries,zR as parseMultiValueFilter,gI as parseMutationReceipt,QT as parseOptionalNonNegativeInteger,JT as parseOptionalNumber,mD as parsePmAgentTaskTranscriptCorpus,k$ as parsePmToolDiscoveryOptions,BR as parsePriority,KR as parsePriorityFilterSet,LS as parseReadOutputSession,SE as parseRegisteredItemFieldAssignments,se as parseRelationshipGraphSnapshot,ip as parseRemoveEntries,wp as parseSourceLineRange,$A as parseStatusFilterCsv,HR as parseStringFilterSet,sn as parseTags,Bf as parseTestRunMeasurements,qR as parseType,VR as parseTypeFilterSet,zl as parseUnknownAuthorHistoryEventCoordinates,IT as parseWorkflowPolicy,PT as parseWorkflowPolicyDocument,v0 as partitionDecisionEntries,_A as patchPathToChangedField,an as pathExists,Xh as pauseTask,Zp as persistDurableGraphResult,YA as persistSelectedItemFormat,gP as planAgentIdentityVocabularyMutation,g0 as planCompletedAtBackfill,Ml as planExtensionDirectoryCopy,Jk as planItemMutationDocument,er as planProfileApplication,gD as planRelationshipEventBackfill,iu as planRelationshipRemediation,Sl as planSchemaEvolutionMigration,Bl as planUnknownAuthorHistoryAcknowledgment,Sf as planWorkspaceSnapshotRestore,bR as positionalShapeKey,TR as positionalSignatureKey,cx as preflightExtension,Es as prepareSimilarityText,VT as preserveMutationStdinTokenFields,HT as preserveMutationStdinTokenLiterals,Xk as previewItemMutationDocument,Ok as previewItemMutations,Kw as printError,Vw as printResult,Ah as profile,Rh as profileApply,Ih as profileLint,Oh as profileList,vh as profileShow,mE as projectAfterCommandItemSnapshot,_m as projectContextFocusRows,Uf as projectFleetAttributionAnalytics,qM as projectHistoryProvenance,qi as projectLeanRecoveryPayload,tp as projectLinkedCollectionMutation,Uw as projectPmBriefListEnvelope,jw as projectPmBriefSearchEnvelope,cs as projectPmCliErrorContextDetails,ss as projectPmCliErrorDetails,Di as projectPmDiagnosticOutput,$i as projectPmDiagnosticText,Ff as projectProvenanceCoverageAnalytics,bu as projectValidateCounts,vP as promoteAssuranceAssertion,yw as propagateContextUsageServingReceipt,DL as pruneCompileCacheGenerations,qI as putAssuranceDeclaration,zI as putAssuranceDeclarationBundle,hO as queryItemMetadataIndex,gO as queryLinkedFileMetadataIndex,yO as querySimilarItemMetadataIndex,qf as queryTestRunMeasurementsBelow,wn as quoteCommandArg,Sn as quoteWindowsCommandArg,zk as rankCommandPaths,Wc as readAnnotationEntries,_i as readAuthorEnvironment,c_ as readBooleanOption,Aw as readContextUsageAffinity,d_ as readCsvListOption,Gs as readExtensionMigrationState,cn as readFileIfExists,qc as readFirstStringFromCommanderOptions,zc as readFirstValueFromCommanderOptions,Lf as readHistoryAnalyticsWindow,sS as readHistoryEntries,bi as readHistorySnapshot,Rf as readImprovementLedger,CO as readItemMetadataDerivedIndexState,ks as readItemRevision,Mk as readItemTransaction,ts as readLocatedItem,SS as readOutputBudgetCollections,ow as readOutputCollectionFingerprint,ES as readOutputContinuationRowCollections,TS as readOutputContinuationRowPaths,KS as readOutputIncludeModeOptions,MS as readOutputRetainsTail,CS as readOutputRowCollections,bS as readOutputRowPaths,FS as readOutputSessionRemainingTokens,Gt as readPmPackageManifest,n_ as readRequiredString,UE as readRuntimeFieldOptionValue,Yi as readSettings,yv as readSettingsSection,JA as readSettingsWithMetadata,Hc as readStringArrayFromCommanderOptions,a_ as readStringOption,QO as readThrownExitCode,qO as readVectorizationStatusLedger,aO as readWorkflowPolicies,MT as readWorkflowPolicyField,Fv as readWorkspaceContextIntentContracts,_0 as readWorkspaceContextSignals,T0 as readWorkspaceMemory,ik as readWorkspacePosition,tR as readWorkspaceTransaction,fA as reanchorHistoryEntries,K1 as reconcileArtifactLedgers,$n as reconcileExtensionCapabilityUsage,OA as reconcileWorkspaceJsonHistory,uE as recordAfterCommandAffectedItem,VI as recordAssuranceVerdict,Yu as recordClaimSemanticAttribution,Ew as recordContextUsageDelivery,Cw as recordContextUsageServing,Sw as recordContextUsageTouch,ww as recordContextUsageTouches,Ju as recordFocusSemanticAttribution,vf as recordImprovementObservation,Xu as recordReleaseSemanticAttribution,Rn as redactUrlCredentialsInText,vn as redactUrlCredentialsInToken,EO as refreshItemMetadataDerivedIndex,bl as refreshMergeAttributeFenceIfInstalled,RS as refreshReadOutputDeliveredCounts,HO as refreshSearchArtifactsForMutation,di as registerAgentProvenanceAdapters,JR as registerExternalDependencyResolver,ai as registerHarnessSignalDescriptors,aS as registerOutputMaterialFieldGroups,zh as release,vS as rememberReadOutputFocusRows,HI as removeAssuranceDeclaration,dn as removeFileIfExists,gp as renameArtifactsResultKey,lm as renderCalendarMarkdown,pm as renderCalendarToon,Rm as renderContextMarkdown,Il as renderExtensionDescribeMarkdown,vl as renderExtensionSurfaceMarkdown,k_ as renderGuideMarkdown,jk as renderMissingOptionRetry,R0 as renderNextMarkdown,Kk as renderPmClosedDomainHelp,An as renderPmCommand,Fo as renderPmCommandAliasMigrationHint,dl as renderPmCommandVisibilityMarkdown,t1 as renderPmFlagLexiconMarkdown,JN as renderPmMcpAppHtml,PD as renderPmRefusalClosureCensusMarkdown,GA as renderRowsAsCsv,UA as renderRowsAsTable,Uh as reopen,iO as replayHistoryToTarget,dA as replayToCanonicalItemDocument,cA as replayToItemDocument,ZE as requireHistoryOperation,xM as requireTerminalReason,NM as requireTerminalReasonWithRecovery,oA as resealHistoryRewrite,cE as resetActiveExtensionRuntimeState,Ql as resetWorkspaceGraphCache,ti as resolveAgentSessionContextFromSignals,ed as resolveAnnotationIndex,Jc as resolveAnnotationInput,iS as resolveAuthor,yi as resolveAuthorIdentity,RA as resolveBodyFileContent,Yy as resolveBuiltinCorpusShape,dm as resolveCalendarOutputFormat,pI as resolveCanonicalPmErrorCodeContract,PC as resolveCanonicalRelationshipKind,nS as resolveClaimPrincipal,PE as resolveCliBulkIdsInput,nC as resolveCommandOptionPolicyState,LL as resolveCompileCacheGeneration,h0 as resolveCompletionTimestamp,GC as resolveConfiguredPmPackageRoot,oI as resolveContentFieldFilters,Mw as resolveContextIntentContract,hm as resolveContextOutputFormat,gm as resolveContextTokenBudget,DM as resolveCreateExplicitEmptyFlag,vs as resolveDeclaredBlockers,F0 as resolveEffectiveSearchMode,IO as resolveEmbeddingProviders,Mt as resolveExtensionFlagOptionKey,EC as resolveExtensionFlagValueContract,kl as resolveExtensionInstallSourceIdentity,lC as resolveExtensionLongFlagName,Fs as resolveExtensionMigrationStatePath,YC as resolveExtensionRoots,QR as resolveExternalDependencyReference,CC as resolveFlagValueKind,aC as resolveGlobalPmRoot,P_ as resolveGuideOutputFormat,If as resolveHistoryEpisodeGroupIdentity,NE as resolveHistoryHashAlgorithm,QE as resolveHistoryOperation,jM as resolveHistoryProvenanceDimensions,wv as resolveHistorySubject,oO as resolveHistoryTarget,U0 as resolveHybridSemanticWeight,yn as resolveImplicitPmRoot,hC as resolveIsoOrRelative,kv as resolveItemBlockers,vv as resolveItemExecutionRole,Tk as resolveItemMutationDocument,am as resolveItemOwnershipConflict,gn as resolveItemTypeRegistry,$E as resolveItemTypesFilePath,xk as resolveLifecycleVerbRecovery,cC as resolveLinkedResourcePositionalRecovery,e_ as resolveLinkedTestFailureExitCode,pu as resolveLinkedTestSourceRef,uu as resolveLinkedTestSourceWorkspaceRoot,hu as resolveLinkedTestTrust,gu as resolveLinkedTestTrustBatch,Zg as resolveMcpAcknowledgedSubscriptionFilter,Ye as resolveMcpRequestContext,fl as resolveMergeInstallContext,Bk as resolveMisnestedCommandPath,rI as resolveMissingMetadataFilters,Uk as resolveMissingOptionPlaceholder,mS as resolveModePairedOutputOmissionReceipt,A0 as resolveNextOutputFormat,hS as resolveOutputOmissionReceipt,FC as resolvePmCliVersion,$o as resolvePmCommandAlias,ze as resolvePmCommandCapabilityFamily,Lt as resolvePmCommandExitContract,N as resolvePmCommandOperation,xi as resolvePmCommandOutputBudget,Nt as resolvePmCommandOutputEnvelope,fR as resolvePmCommandPositionalContract,In as resolvePmCommandScopeArgs,He as resolvePmCommandVisibilityTier,Li as resolvePmDiagnosticOutputBudget,uI as resolvePmErrorCodeContract,Bb as resolvePmFlagSemanticConcept,xe as resolvePmHistoryOperation,nN as resolvePmMcpExecutableInvocation,$C as resolvePmPackageRootFromModule,_R as resolvePmPositionalActionContract,wc as resolvePmPositionalActionFlagContracts,$e as resolvePmRoot,Id as resolvePmToolCustomFieldCollision,xA as resolvePriority,Kt as resolveProfile,gl as resolveProjectMergeTypeFolders,uw as resolveQueryCursorStart,Nk as resolveReadCompletenessControls,Dk as resolveReadOptionRetryArgs,XS as resolveReadOutputDimensions,tw as resolveReadOutputEncoding,IS as resolveReadOutputRecoveryBudget,qS as resolveReadOutputSurface,_S as resolveReadRowContract,Gk as resolveRecoveryCommandName,OE as resolveRegisteredSearchProvider,vE as resolveRegisteredVectorStoreAdapter,jd as resolveReproducibleProcessEnvironment,Bn as resolveRuntimeFieldRegistry,jn as resolveRuntimeStatusRegistry,PO as resolveSearchCorpusFields,$0 as resolveSearchMaxResults,q0 as resolveSearchPage,G0 as resolveSearchScoreThreshold,j0 as resolveSearchTuning,kO as resolveSemanticCorpusCharacterLimit,Wu as resolveSemanticLineageIds,ZA as resolveSettingsWithSemanticRuntimeDefaults,JI as resolveSourceContextWritePolicy,tm as resolveStartTaskInProgressStatus,Z as resolveSubcommandFlagContractsForCommand,wT as resolveTelemetryErrorCategory,VO as resolveTelemetrySourceAttribution,kM as resolveTerminalReason,Sk as resolveTransactionSchema,oC as resolveTypeDefinition,rC as resolveTypeName,FA as resolveTypeSynonym,HA as resolveTypeWorkflows,ql as resolveUnknownAuthorAcknowledgmentSelector,W0 as resolveVectorIndexRecovery,NO as resolveVectorStores,Hd as resolveWorkspaceRelationshipKindRegistry,sC as resolveWorkspaceRoot,Kh as restore,TC as restoreCheckpointItems,vA as restoreWorkspaceJsonFromHistory,Af as restoreWorkspaceSnapshot,wf as restoreWorkspaceSnapshotWithRecovery,hg as runAction,hE as runActiveBeforeMutationHooks,yE as runActiveCommandHandler,gE as runActiveOnIndexHooks,Un as runActiveOnReadHooks,Gn as runActiveOnWriteHooks,bE as runActiveParserOverride,TE as runActivePreflightOverride,CE as runActiveServiceOverride,mm as runActivity,WC as runAfterCommandHooks,rf as runAggregate,Zc as runAnnotationCommand,wu as runAppend,yM as runAssuranceAction,bM as runAssuranceDispatch,KC as runBeforeCommandHooks,um as runCalendar,xm as runClaim,Nm as runClaimNext,Ou as runClose,vu as runCloseMany,Fm as runCloseTask,td as runComments,x_ as runCompletion,Kl as runConfig,qt as runContext,i0 as runContextEvaluationCorpus,o0 as runContextEvaluationScenario,Ru as runCopy,Vu as runCreate,Ku as runDelete,Zl as runDeps,yp as runDocs,CP as runDuplicates,ff as runEval,hf as runEvent,xl as runExtension,Bs as runExtensionMigrateAction,js as runExtensionMigrations,Op as runFiles,Rp as runFilesDiscover,vp as runFilesLookup,Gf as runFleetAttributionAnalytics,em as runFocus,Eu as runGc,of as runGet,au as runGraph,M_ as runGuide,cu as runHealth,D0 as runHistory,PM as runHistoryAttest,CM as runHistoryCompact,wM as runHistoryCompactBulk,tM as runHistoryMaintenance,AM as runHistoryRedact,oM as runHistoryRepair,iM as runHistoryRepairAll,Gl as runInit,Dl as runInitAgentGuidance,rd as runLearnings,hp as runLinkedArtifacts,t_ as runLinkedTests,rl as runList,_f as runMeet,Q0 as runMergeDriver,Tl as runMergeInstall,KP as runMergeReceiptEvidenceReport,VP as runMergeReceiptReport,Z0 as runMergeReconcile,Mm as runNext,od as runNotes,$m as runPauseTask,Um as runPlan,Jm as runProfileApply,Xm as runProfileLint,Wm as runProfileList,Ym as runProfileShow,$f as runProvenanceCoverageAnalytics,mx as runRegisteredCommandForTest,yx as runRegisteredCommandOverrideForTest,Ax as runRegisteredExporterForTest,_x as runRegisteredHookForTest,wx as runRegisteredImporterForTest,Sx as runRegisteredMigrationForTest,fx as runRegisteredMutationGuardForTest,hx as runRegisteredParserOverrideForTest,gx as runRegisteredPreflightOverrideForTest,bx as runRegisteredRendererOverrideForTest,Cx as runRegisteredSearchProviderForTest,Tx as runRegisteredServiceOverrideForTest,Ex as runRegisteredVectorStoreAdapterForTest,tr as runReindex,Lm as runRelease,gf as runRemind,FM as runReopen,jm as runRestore,wl as runSchemaEvolutionMigration,nf as runSearch,Qy as runSearchRefreshWorkerEntrypoint,N_ as runStartBackgroundRun,Dm as runStartTask,Hf as runStats,Kf as runTelemetry,Vm as runTemplatesList,Hm as runTemplatesSave,Km as runTemplatesShow,r_ as runTest,o_ as runTestAll,L_ as runTestRunsList,$_ as runTestRunsLogs,G_ as runTestRunsResume,D_ as runTestRunsStatus,F_ as runTestRunsStop,U_ as runTestRunsWorker,sm as runUpdate,Bm as runUpdateMany,jt as runUpgrade,Cu as runValidate,_g as runWithActiveExtensions,L as runWithAgentSessionContext,WA as runWithConfigurationOnlySettings,Iw as runWithContextIntentContracts,jv as runWithDiscoveredContextIntentContracts,pi as runWithHarnessDetectionSignals,BN as runWithMcpTraceContext,qd as runWithReproducibleProcessEnvironment,ui as runWithWorkspaceHarnessSignalDescriptors,Hr as runWithWorkspaceRecipe,aP as runWorkflowPolicyAction,TM as runWorkspaceTransactionGc,nu as saveGraphAuditBaseline,dM as scanClosureTimestamps,RP as scanExtensionHostVersions,jl as scanHistoryAuthorAttribution,Wn as scanItemFormatVersions,_s as scanMutationSecrets,MP as scanProvenanceResolverHealth,Os as scanStaleInProgressItems,uM as scanStorageIntegrity,ch as schema,_h as schemaAddField,mh as schemaAddStatus,ph as schemaAddType,bh as schemaApplyPreset,Th as schemaInferTypes,dh as schemaList,gh as schemaListFields,Sh as schemaRemapStatus,hh as schemaRemoveField,fh as schemaRemoveStatus,uh as schemaRemoveType,Eh as schemaRenameField,Ch as schemaRenameType,lh as schemaShow,yh as schemaShowField,wh as schemaShowStatus,qk as scoreCommandPathMatch,ZM as scoreContextCandidates,e0 as scoreContextCandidatesWithActiveExtensions,Ss as scoreItemSimilarity,zD as scorePmGrammarRefusalClosure,xD as scorePmRefusalClosure,ws as scorePreparedItemSimilarity,KD as scoreTrackerPreflightRecoveryClosure,tA as sealHistoryRecord,dN as sealMcpRequestState,z_ as search,S0 as searchWorkspaceMemory,w0 as searchWorkspaceMemoryReadResult,Nv as selectActionableEntries,sw as selectCursorSemanticOptions,O_ as selectImportAuthor,$N as selectMcpClientRegistrationMode,E0 as selectWorkspaceMemory,C0 as selectWorkspaceMemoryRollups,Zu as semanticAttributionAffinity,av as sentryCaptureCliError,iv as sentryDiscardCommandSpan,sv as sentryFinishCommandSpan,dv as sentryFlush,cv as sentryLogCliUsageError,ov as sentrySetCommandContext,nv as sentryStartCommandSpan,Qn as serializeItemDocument,Wk as serializeNdjsonRows,Yk as serializeNdjsonStream,jy as serveDeclaredObservation,dE as setActiveCommandContext,lE as setActiveCommandResult,rE as setActiveExtensionCommands,tE as setActiveExtensionHooks,oE as setActiveExtensionParsers,nE as setActiveExtensionPreflight,aE as setActiveExtensionRegistrations,sE as setActiveExtensionRenderers,iE as setActiveExtensionServices,rS as setFocusedItem,gv as settingsSectionRevision,hv as shouldCompletePlanOnClose,ru as shouldPersistDurableGraphCache,YT as shouldResolveMutationStdinTokenField,WT as shouldResolveMutationStdinTokens,tO as shouldRunSearchRefreshInForeground,bp as similarityAdvisoryWarnings,yS as sliceReadOutputRowCollection,as as snapshotPmCliErrorContext,mp as sortLinkedArtifacts,MR as sortWaiverNotices,FT as splitAcceptanceCriteria,mv as splitCommaList,Jn as splitFrontMatter,JS as stabilizeReadOutputReceiptEstimates,R as stableStringify,bk as stableUpsertValue,AT as stableValueEquals,Yh as startTask,Cv as startTelemetryCommand,W_ as stats,GE as statusIsTerminal,vc as stripGlobalBootstrapTokens,rk as subscribeMutationEventBatches,ok as subscribeMutationEvents,hP as summarizeAgentIdentityVocabulary,Mf as summarizeAgentModelProvenance,kf as summarizeAgentProvenance,n0 as summarizeContextEvaluationReports,Xf as summarizeContextPreflight,VM as summarizeHistoryProvenance,$l as summarizeInitResult,BP as summarizeMergeReceipt,$M as supportsCreateExplicitEmpty,SR as supportsItemIdAlias,LC as suppressHostOutput,Oe as syncRelationshipGraphAdapter,ix as synthesizeExtensionManifest,Ac as toCompletionFlagString,Om as toContextFocusItem,Sm as toContextPackingSummary,wm as toContextRankingSummary,uC as toErrorMessage,p_ as toEstimatedMinutesValue,mk as toExtensionFlagDefinitions,h_ as toImportBoolean,T_ as toImportConfidence,__ as toImportInteger,w_ as toImportLinkedDocs,S_ as toImportLinkedFiles,A_ as toImportLinkedTests,E_ as toImportLogEntries,C_ as toImportNormalizedEnum,b_ as toImportNumberMap,u_ as toImportPriority,f_ as toImportStatus,g_ as toImportStringList,y_ as toImportStringMap,m_ as toImportTags,VE as toItemRecord,l_ as toNonEmptyImportString,pC as toNonEmptyStringOrUndefined,lA as toReplayDocument,Bw as toWellFormedText,Cs as tokenizeSimilarityText,KT as transferMutationStdinTokenPolicy,HC as translateHostEnvironmentFault,Gh as update,Wf as updateLinkedTest,mg as upgrade,Ph as validate,NI as validateAssertionDefinition,DI as validateAssuranceDocument,LI as validateGateDefinition,Ek as validateItemMutationRows,_p as validateLinkedPaths,FN as validateMcpAuthorizationResponseIssuer,DN as validateMcpAuthorizationServerMetadata,GN as validateMcpClientMetadataDocument,RN as validateMcpHttpRequestHeaders,mN as validateMcpJsonSchema,xI as validateMeasurementDefinition,MA as validateMissingParentReference,VS as validateReadOutputOptions,DA as validateSprintOrReleaseValue,iC as validateTypeOptions,Zv as validateWorkspaceTransactionIdentity,IM as verifyAttestation,OR as verifyCliFlagInvocationParity,yR as verifyExplicitPositionalSlotCensus,mA as verifyHistoryChain,uA as verifyHistoryChainWithVersion,Bv as verifyHistoryEntries,rA as verifyHistoryRecordHash,nA as verifyHistoryRewriteEvidence,ER as verifyPmCliGrammar,CR as verifyPmCommandPositionalContracts,e1 as verifyPmFlagLexicon,wD as verifyPmRecoveryKindRuntimeCoverage,kb as verifyPmRecoveryProducerRuntimeCoverage,SD as verifyPmRecoveryReferences,RD as verifyPmRefusalClosureIdentityRatchet,vD as verifyPmRefusalClosureRatchet,ED as verifyPmRefusalReachability,ld as verifyToolOptionCliParity,PR as waiverNoticeFor,NA as withCliMutationInput,Ls as withExpectedItemRevisions,zs as withFlagAliasMetadata,VC as withHostEnvironmentBoundary,LA as withLiteralMutationInput,uN as withMcpCachePolicy,ji as withoutGenericRefusalExamples,xT as workflowApprovalFingerprint,NT as workflowPolicyApplies,kT as workflowPolicyFingerprint,Jl as workspaceGraphCache,rR as workspaceTransactionPlanDigest,Qc as wrapOwnershipConflict,tv as wrapThrownErrorForSentry,hi as writeAuthorEnvironment,De as writeFileAtomic,yC as writeMutationCheckpoint,QA as writeSettings,bv as writeSettingsSection,Hw as writeStderr,zw as writeStdout,zO as writeVectorizationStatusLedger,AA as writeWorkspaceJsonWithHistory,ep as writtenLinkedEntries};
35
35
  //# sourceMappingURL=sdk.js.map