@unbrained/pm-cli 2026.8.26 → 2026.8.27

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 (161) hide show
  1. package/.agents/skills/HARNESS_COMPATIBILITY.md +32 -0
  2. package/.agents/skills/README.md +47 -0
  3. package/.agents/skills/pm-developer/SKILL.md +117 -0
  4. package/.agents/skills/pm-developer/references/COMMAND_PLAYBOOK.md +49 -0
  5. package/.agents/skills/pm-developer/references/GRAPH_AND_RELATIONSHIPS.md +91 -0
  6. package/.agents/skills/pm-developer/references/MULTI_AGENT_MERGE.md +72 -0
  7. package/.agents/skills/pm-developer/references/PROMPTS.md +17 -0
  8. package/.agents/skills/pm-developer/references/SCRIPTING_COMPOSITION.md +82 -0
  9. package/.agents/skills/pm-developer/references/TOKEN_BUDGETS.md +85 -0
  10. package/.agents/skills/pm-extensions/SKILL.md +106 -0
  11. package/.agents/skills/pm-extensions/references/AUTHORING.md +95 -0
  12. package/.agents/skills/pm-extensions/references/LIFECYCLE.md +40 -0
  13. package/.agents/skills/pm-extensions/references/TROUBLESHOOTING.md +25 -0
  14. package/.agents/skills/pm-sdk/SKILL.md +107 -0
  15. package/.agents/skills/pm-sdk/references/DOMAIN_MODELING.md +78 -0
  16. package/.agents/skills/pm-sdk/references/INTEGRATION_CHECKLIST.md +31 -0
  17. package/.agents/skills/pm-sdk/references/PROMPTS.md +13 -0
  18. package/.agents/skills/pm-sdk/references/SURFACE_MAP.md +82 -0
  19. package/.agents/skills/pm-user/SKILL.md +111 -0
  20. package/.agents/skills/pm-user/references/BACKLOG_SHAPING.md +105 -0
  21. package/.agents/skills/pm-user/references/PROMPTS.md +17 -0
  22. package/.agents/skills/pm-user/references/WORKFLOWS.md +35 -0
  23. package/.claude-plugin/marketplace.json +2 -2
  24. package/CHANGELOG.md +25 -3
  25. package/README.md +8 -5
  26. package/dist/cli/commander-usage.js +11 -7
  27. package/dist/cli/error-guidance.js +3 -3
  28. package/dist/cli/help-content.d.ts +2 -0
  29. package/dist/cli/help-content.js +53 -17
  30. package/dist/cli/help-json-payload.d.ts +8 -2
  31. package/dist/cli/help-json-payload.js +46 -12
  32. package/dist/cli/main.js +52 -74
  33. package/dist/cli/register-annotations.js +27 -21
  34. package/dist/cli/register-setup.js +98 -57
  35. package/dist/cli-bundle/bundle-manifest.json +152 -152
  36. package/dist/cli-bundle/chunks/chunk-3OO3W6FW.js +202 -0
  37. package/dist/cli-bundle/chunks/chunk-52EKTW6V.js +3 -0
  38. package/dist/cli-bundle/chunks/{chunk-KBFP3E4E.js → chunk-CVBBGWW5.js} +62 -44
  39. package/dist/cli-bundle/chunks/chunk-MFNTKMTI.js +13 -0
  40. package/dist/cli-bundle/chunks/{chunk-E2GCFJSU.js → chunk-OS27HHBN.js} +31 -31
  41. package/dist/cli-bundle/chunks/chunk-QTO7USTH.js +2 -0
  42. package/dist/cli-bundle/chunks/{chunk-S4U76VZF.js → chunk-R4ETAOJC.js} +2 -2
  43. package/dist/cli-bundle/chunks/{chunk-UKBCRPA2.js → chunk-SH6P7FXI.js} +2 -2
  44. package/dist/cli-bundle/chunks/{chunk-WRHJ3MB6.js → chunk-SHMDY36D.js} +2 -2
  45. package/dist/cli-bundle/chunks/{chunk-ZNRLJ54C.js → chunk-SKXLJIEK.js} +2 -2
  46. package/dist/cli-bundle/chunks/chunk-TNX6HC54.js +3 -0
  47. package/dist/cli-bundle/chunks/{register-list-query-EMCPMICY.js → register-list-query-EUWM6VII.js} +2 -2
  48. package/dist/cli-bundle/chunks/{register-mutation-OJ67ABCB.js → register-mutation-FD4HSAVU.js} +4 -4
  49. package/dist/cli-bundle/chunks/{register-operations-H2GLP7LT.js → register-operations-HRMNFEC3.js} +2 -2
  50. package/dist/cli-bundle/chunks/register-setup-33GNICLX.js +2 -0
  51. package/dist/cli-bundle/focused-chunks/{chunk-4XNH2HM7.js → chunk-2AGZ5BRT.js} +2 -2
  52. package/dist/cli-bundle/focused-chunks/{chunk-72T6JGAE.js → chunk-4BR5UU52.js} +45 -45
  53. package/dist/cli-bundle/focused-chunks/{chunk-OHIHZ7HS.js → chunk-6GCRSLPG.js} +2 -2
  54. package/dist/cli-bundle/focused-chunks/{chunk-UYBA57GY.js → chunk-AD6ULRAF.js} +2 -2
  55. package/dist/cli-bundle/focused-chunks/{chunk-7YCDTCBC.js → chunk-AQ5IYEZZ.js} +2 -2
  56. package/dist/cli-bundle/focused-chunks/{chunk-YO3ZF3FI.js → chunk-EKX37ZHA.js} +2 -2
  57. package/dist/cli-bundle/focused-chunks/{chunk-LV5N3LK5.js → chunk-FC2AXLB5.js} +2 -2
  58. package/dist/cli-bundle/focused-chunks/{chunk-IBHXMFE7.js → chunk-HC7ODMH3.js} +2 -2
  59. package/dist/cli-bundle/focused-chunks/{chunk-4K2II4TV.js → chunk-HVQ22RC4.js} +2 -2
  60. package/dist/cli-bundle/focused-chunks/{chunk-A644DUFQ.js → chunk-MEASX544.js} +2 -2
  61. package/dist/cli-bundle/focused-chunks/{chunk-FXDLT6FL.js → chunk-MXTYGECH.js} +2 -2
  62. package/dist/cli-bundle/focused-chunks/{chunk-MMXUPDDJ.js → chunk-SUBSWYW3.js} +2 -2
  63. package/dist/cli-bundle/focused-chunks/{chunk-57XY346D.js → chunk-XDPYBQCF.js} +9 -9
  64. package/dist/cli-bundle/focused-chunks/{chunk-TMJDFHVD.js → chunk-Y3JJXRVK.js} +2 -2
  65. package/dist/cli-bundle/focused-chunks/{chunk-66VGB23P.js → chunk-Y5A7SJJ7.js} +2 -2
  66. package/dist/cli-bundle/focused-chunks/chunk-YHWHX6YY.js +2 -0
  67. package/dist/cli-bundle/focused-chunks/{chunk-P2E6LDAE.js → chunk-YVVZ3LQ6.js} +3 -3
  68. package/dist/cli-bundle/focused-chunks/chunk-Z2USIBR2.js +5 -0
  69. package/dist/cli-bundle/main.js +15 -14
  70. package/dist/cli-bundle/sdk-authoring.js +1 -1
  71. package/dist/cli-bundle/sdk-contracts.js +2 -2
  72. package/dist/cli-bundle/sdk-core.js +31 -31
  73. package/dist/cli-bundle/sdk-governance.js +1 -1
  74. package/dist/cli-bundle/sdk-graph.js +1 -1
  75. package/dist/cli-bundle/sdk-merge.js +31 -31
  76. package/dist/cli-bundle/sdk-query.js +1 -1
  77. package/dist/cli-bundle/sdk-runtime.js +1 -1
  78. package/dist/cli-bundle/sdk-testing.js +1 -1
  79. package/dist/cli-bundle/sdk.js +32 -7
  80. package/dist/core/governance/issue-codes.d.ts +11 -2
  81. package/dist/core/governance/issue-codes.js +29 -10
  82. package/dist/core/item/item-format.js +3 -3
  83. package/dist/core/store/item-store.js +12 -5
  84. package/dist/mcp/server.js +123 -9
  85. package/dist/mcp/tool-definitions.d.ts +2 -0
  86. package/dist/mcp/tool-definitions.js +2 -2
  87. package/dist/sdk/agent/closed-domain-contracts.d.ts +1 -1
  88. package/dist/sdk/agent/closed-domain-contracts.js +24 -2
  89. package/dist/sdk/agent-capability-contracts.js +6 -2
  90. package/dist/sdk/cli-bootstrap.js +3 -2
  91. package/dist/sdk/cli-contracts/command-aliases.js +15 -2
  92. package/dist/sdk/cli-contracts/enum-contracts.d.ts +4 -1
  93. package/dist/sdk/cli-contracts/enum-contracts.js +7 -2
  94. package/dist/sdk/cli-contracts/flag-contracts.js +9 -5
  95. package/dist/sdk/cli-contracts/grammar-contracts.d.ts +3 -3
  96. package/dist/sdk/cli-contracts/grammar-contracts.js +24 -17
  97. package/dist/sdk/cli-contracts/runtime-contracts.js +13 -11
  98. package/dist/sdk/cli-contracts/tool-schema.js +18 -15
  99. package/dist/sdk/cli-contracts.d.ts +1 -1
  100. package/dist/sdk/cli-contracts.js +3 -3
  101. package/dist/sdk/cli-program.js +3 -2
  102. package/dist/sdk/completion.js +40 -13
  103. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +14 -2
  104. package/dist/sdk/governance/upgrade.d.ts +2 -0
  105. package/dist/sdk/governance/upgrade.js +30 -8
  106. package/dist/sdk/governance/validate.js +8 -6
  107. package/dist/sdk/guide-topics.js +6 -6
  108. package/dist/sdk/index.d.ts +4 -2
  109. package/dist/sdk/index.js +5 -3
  110. package/dist/sdk/mcp/apps.d.ts +70 -0
  111. package/dist/sdk/mcp/apps.js +154 -0
  112. package/dist/sdk/mcp/skills.d.ts +127 -0
  113. package/dist/sdk/mcp/skills.js +390 -0
  114. package/dist/sdk/read-output-contracts.js +16 -3
  115. package/dist/sdk/runtime-action-aliases.js +7 -3
  116. package/dist/sdk/runtime-input.js +12 -4
  117. package/dist/sdk/runtime-primitives.d.ts +1 -1
  118. package/dist/sdk/runtime-primitives.js +3 -3
  119. package/docs/CLI_GRAMMAR.md +7 -1
  120. package/docs/COMMANDS.md +2 -2
  121. package/docs/EXTENSIONS.md +33 -32
  122. package/docs/MCP_2026_07_28.md +24 -2
  123. package/docs/MCP_2026_07_28_CONFORMANCE.md +4 -4
  124. package/docs/MCP_SKILLS_AND_APPS.md +107 -0
  125. package/docs/QUICKSTART.md +15 -15
  126. package/docs/README.md +1 -0
  127. package/docs/RELEASING.md +11 -3
  128. package/docs/SDK_CONTEXT_INTEGRITY.md +6 -0
  129. package/docs/SDK_EVIDENCE_TRACEABILITY.md +9 -1
  130. package/docs/generated/AGENT_CAPABILITY_ROUTING.md +1 -1
  131. package/docs/generated/REFUSAL_CLOSURE_CENSUS.md +7 -6
  132. package/marketplace.json +2 -2
  133. package/package.json +9 -7
  134. package/packages/pm-beads/README.md +12 -6
  135. package/packages/pm-beads/docs/MIGRATION.md +53 -0
  136. package/packages/pm-beads/extensions/beads/index.ts +8 -0
  137. package/packages/pm-beads/extensions/beads/runtime.ts +671 -112
  138. package/packages/pm-beads/package.json +1 -1
  139. package/packages/pm-calendar/package.json +1 -1
  140. package/packages/pm-command-kit/package.json +1 -1
  141. package/packages/pm-digital-twin/package.json +1 -1
  142. package/packages/pm-governance-audit/package.json +1 -1
  143. package/packages/pm-guide-shell/package.json +1 -1
  144. package/packages/pm-kanban/package.json +1 -1
  145. package/packages/pm-lifecycle-hooks/package.json +1 -1
  146. package/packages/pm-linked-test-adapters/package.json +1 -1
  147. package/packages/pm-search-advanced/package.json +1 -1
  148. package/packages/pm-templates/package.json +1 -1
  149. package/packages/pm-todos/package.json +1 -1
  150. package/packages/pm-vcs/package.json +1 -1
  151. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  152. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  153. package/sdk/public-surface.json +235 -13
  154. package/dist/cli-bundle/chunks/chunk-ES25LX3D.js +0 -202
  155. package/dist/cli-bundle/chunks/chunk-FRDWWB6R.js +0 -3
  156. package/dist/cli-bundle/chunks/chunk-ICQ3RVIY.js +0 -2
  157. package/dist/cli-bundle/chunks/chunk-IV64RJVE.js +0 -13
  158. package/dist/cli-bundle/chunks/chunk-MVYLQ67M.js +0 -3
  159. package/dist/cli-bundle/chunks/register-setup-GLZAHLVI.js +0 -2
  160. package/dist/cli-bundle/focused-chunks/chunk-7I23XGWO.js +0 -2
  161. package/dist/cli-bundle/focused-chunks/chunk-LMKG3DFE.js +0 -5
@@ -1,8 +1,33 @@
1
- import{A as l_,B as f_,C as GR,D as $R,a as Ko,b as Wo,c as Xo,d as Yo,e as OR,f as IR,g as t_,h as r_,i as n_,k as o_,l as i_,m as s_,n as a_,o as c_,p as d_,q as p_,r as u_,s as PR,t as MR,u as kR,v as NR,w as vR,x as LR,y as DR,z as FR}from"./chunks/chunk-ICQ3RVIY.js";import{A as wO,B as xO,C as RO,D as OO,E as IO,F as PO,G as MO,H as kO,I as NO,J as vO,K as LO,L as DO,M as FO,N as GO,O as $O,P as UO,Q as jO,R as BO,S as qO,T as zO,U as HO,V as VO,W as KO,X as WO,Y as XO,a as QR,b as eO,c as tO,d as rO,e as nO,f as oO,g as iO,h as sO,i as aO,j as cO,k as dO,l as pO,m as uO,n as lO,o as fO,p as mO,q as _O,r as hO,s as gO,t as yO,u as TO,v as CO,w as bO,x as AO,y as EO,z as SO}from"./chunks/chunk-WRHJ3MB6.js";import{a as UR,b as jR,c as BR,d as qR}from"./chunks/chunk-FRDWWB6R.js";import{a as zR,b as HR,c as VR,d as KR,e as WR,f as XR,g as YR,h as JR,i as ZR}from"./chunks/chunk-UKBCRPA2.js";import{$ as ft,$a as At,$b as Cm,A as AE,Aa as jl,Ab as Kf,Ac as Km,B as qd,Ba as Bl,Bb as Wf,Bc as Wm,C as vp,Ca as ql,Cb as Xf,Cc as Xm,D as Lp,Da as zl,Db as Yf,Dc as Ym,E as Dp,Ea as Hl,Eb as Jf,Ec as Jm,F as Fp,Fa as Vl,Fb as Zf,Fc as Zm,G as Gp,Ga as Kl,Gb as Qf,Gc as Qm,H as au,Ha as Wl,Hb as em,Hc as e_,I as Ee,Ia as Xl,Ib as tm,J as cu,Ja as Yl,Jb as rm,K as du,Ka as Jl,Kb as nm,L as pu,La as Zl,Lb as om,M as uu,Ma as Ql,Mb as im,N as lu,Na as ef,Nb as sm,O as fu,Oa as tf,Ob as am,P as Vx,Pa as rf,Pb as cm,Q as Kx,Qa as nf,Qb as dm,R as Wx,Ra as of,Rb as pm,S as Xx,Sa as sf,Sb as um,T as Yx,Ta as af,Tb as lm,U as Jx,Ua as cf,Ub as fm,V as Zx,Va as df,Vb as mm,W as Qx,Wa as pf,Wb as _m,X as eR,Xa as uf,Xb as hm,Y as pt,Ya as lf,Yb as gm,Z as ut,Za as ff,Zb as ym,_ as lt,_a as mf,_b as Tm,a as Ea,aa as mt,ab as X,ac as bm,b as Sa,ba as _t,bb as Af,bc as Am,c as wa,ca as ht,cb as Ef,cc as Em,d as XA,da as gt,db as Sf,dc as Sm,e as YA,ea as yt,eb as wf,ec as wm,f as Ra,fa as Tt,fb as xf,fc as xm,g as nE,ga as Ct,gb as Rf,gc as Rm,h as oE,ha as qu,hb as Of,hc as Om,i as iE,ia as zu,ib as If,ic as Im,j as sE,ja as Hu,jb as Pf,jc as Pm,k as aE,ka as Vu,kb as Mf,kc as Mm,l as cE,la as Ku,lb as kf,lc as km,m as dE,ma as Se,mb as Nf,mc as Nm,n as pE,na as Wu,nb as vf,nc as vm,o as uE,oa as Xu,ob as Lf,oc as Lm,p as lE,pa as Yu,pb as Df,pc as Dm,q as fE,qa as Ju,qb as Ff,qc as Fm,r as mE,ra as Zu,rb as Gf,rc as Gm,s as _E,sa as Qu,sb as $f,sc as $m,t as hE,ta as el,tb as Uf,tc as Um,u as ka,ua as tl,ub as jf,uc as jm,v as gE,va as dR,vb as Bf,vc as Bm,w as yE,wa as pR,wb as qf,wc as qm,x as TE,xa as uR,xb as zf,xc as zm,y as CE,ya as lR,yb as Hf,yc as Hm,z as bE,za as fR,zb as Vf,zc as Vm}from"./chunks/chunk-KBFP3E4E.js";import{a as dt,f as Mx,g as kx,h as hu,i as gu}from"./chunks/chunk-MVYLQ67M.js";import{A as zx,B as Hx,C as Ou,D as Iu,E as Pu,b as Bd,c as bw,d as Cx,e as Sx,f as wx,g as xx,h as Rx,i as Ox,j as mu,k as Ix,l as Su,m as wu,n as xu,o as Ru,p as Nx,q as vx,r as Lx,s as Dx,t as Fx,u as Gx,v as $x,w as Ux,x as jx,y as Bx,z as qx}from"./chunks/chunk-S4U76VZF.js";import{$ as hS,$a as Ld,$b as qp,$c as cl,A as iS,Aa as cd,Ab as Zd,Ac as ku,Ad as El,B as sS,Ba as dd,Bb as Qd,Bc as Nu,Bd as Sl,C as aS,Ca as pd,Cb as Op,Cc as sR,Cd as wl,D as cS,Da as ud,Db as Ip,Dc as aR,Dd as xl,E as _S,Ea as ld,Eb as Pp,Ec as cR,Ed as Rl,Fa as fd,Fb as Mp,Fc as vu,Fd as Ol,Ga as md,Gb as ax,Gc as Lu,Gd as Il,Ha as _d,Hb as cx,Hc as Du,Hd as Pl,Ia as hd,Ib as dx,Ic as Fu,Id as Ml,J as Oc,Ja as gd,Jb as px,Jc as Gu,Jd as RR,Ka as yd,Kb as ux,Kc as $u,Kd as kl,La as Td,Lb as kp,Lc as Uu,Ld as Nl,Ma as Cd,Mb as Np,Mc as ju,Md as vl,Na as bd,Nb as lx,Nc as Bu,Nd as Ll,Oa as Ad,Ob as fx,Oc as rl,Od as Dl,Pa as Ed,Pb as mx,Pc as mR,Pd as Fl,Qa as Sd,Qb as _x,Qc as bt,Qd as Gl,Ra as wd,Rb as hx,Rc as _R,Rd as $l,Sa as xd,Sb as gx,Sc as nl,Sd as Ul,Ta as Rd,Tb as yx,Tc as we,Td as _f,Ua as Od,Ub as Tx,Uc as ol,Ud as hf,Va as Id,Vd as gf,Wa as Pd,Wb as $p,Wd as yf,Xa as Md,Xb as Up,Xc as il,Xd as Tf,Ya as kd,Yb as bx,Yc as sl,Yd as Cf,Za as Nd,Zb as jp,Zc as al,Zd as bf,_a as vd,_b as Bp,a as NE,aa as gS,ab as Dd,ac as zp,ad as dl,b as vE,ba as Ic,bb as Fd,bc as Hp,bd as pl,c as LE,ca as Pc,cb as Gd,cc as Vp,cd as ul,d as DE,da as Mc,db as $d,dc as Kp,dd as ll,e as FE,ea as kc,eb as Ud,ec as Wp,ed as hR,f as GE,fa as Nc,fb as $S,fc as Xp,fd as gR,g as $E,ga as vc,gb as US,gc as Yp,gd as yR,h as UE,ha as Lc,hb as jS,hc as Jp,hd as TR,i as jE,ia as RS,ib as BS,ic as Zp,id as CR,j as BE,ja as OS,jb as qS,jc as Qp,jd as bR,k as qE,ka as IS,kb as zS,kc as eu,kd as AR,l as zE,la as PS,lb as HS,lc as tu,ld as ER,m as HE,mb as VS,mc as ru,md as SR,n as VE,nb as KS,nc as nu,nd as wR,o as KE,oa as MS,ob as WS,oc as ou,od as xR,p as WE,pb as XS,pc as Ax,q as XE,qa as kS,qb as YS,qc as Ex,qd as fl,r as YE,ra as NS,rb as zd,rc as iu,rd as ml,s as JE,sa as vS,sb as Hd,sd as _l,t as ZE,ta as LS,tb as Vd,td as hl,u as QE,ua as DS,ub as Kd,ud as gl,v as eS,va as FS,vb as Wd,vc as su,vd as yl,w as tS,wa as id,wd as Tl,x as rS,xa as sd,xb as Xd,xc as Px,xd as Cl,y as nS,ya as GS,yb as Yd,yc as _u,yd as bl,z as oS,za as ad,zb as Jd,zc as Mu,zd as Al}from"./chunks/chunk-E2GCFJSU.js";import{Ba as Zc,Ca as Qc,Da as ed,Ea as td,Fa as rd,H as zc,Ha as nd,I as Hc,Ia as od,J as Vc,Ja as yu,K as Kc,Ka as Tu,L as rt,La as Cu,Ma as bu,Na as Au,Oa as Eu,a as tE,b as rE,c as Oa,d as Ia,f as Pa,g as Ma,h as yS,i as TS,j as CS,k as bS,l as AS,m as ES,n as SS,o as wS,oa as nt,p as Dc,pa as ot,q as Fc,qa as it,r as Gc,ra as st,s as $c,sa as Wc,t as Uc,u as xS,ua as Xc,v as jc,va as Yc,w as Bc,wa as Jc,x as qc}from"./chunks/chunk-ZNRLJ54C.js";import{$ as Za,$a as lw,$b as ap,Aa as wc,Ab as Nw,Ac as tR,B as Na,Ba as xc,Bb as vw,Bc as rR,C as dS,Ca as Rc,Cb as Lw,Cc as nR,D as pS,Db as Dw,Dc as oR,E as uS,Ea as JS,Eb as Fw,Ec as iR,F as lS,Fa as ZS,Fb as Gw,G as fS,Ga as QS,Gb as $w,H as va,Ha as ew,Hb as Uw,I as La,Ia as tw,Ib as jw,J as Da,Ja as rw,Jb as Bw,K as Fa,Ka as nw,Kb as qw,L as Ga,La as ow,Lb as zw,M as $a,Ma as iw,Mb as Hw,N as Ua,Na as sw,Nb as Vw,O as ja,Oa as aw,Ob as Kw,P as Ba,Pb as Ww,Q as qa,Qb as Xw,R as za,Rb as Yw,S as Ae,Sb as Jw,T as Ha,Tb as Zw,U as Va,Ub as Qw,V as Ka,Vb as ex,W as Wa,Wb as tx,X as mS,Xa as cw,Xb as rx,Y as Xa,Ya as dw,Yb as op,Z as Ya,Za as pw,Zb as ip,_ as Ja,_a as uw,_b as sp,a as UA,aa as Qa,ab as fw,ac as cp,b as jA,ba as ec,bc as dp,c as BA,ca as tc,cc as at,d as qA,da as rc,db as mw,dc as pp,e as zA,ea as nc,eb as _w,ec as up,fa as oc,fb as hw,fc as lp,ga as ic,gb as gw,gc as fp,h as HA,ha as sc,hb as yw,hc as mp,i as VA,ia as ac,ib as Tw,ic as _p,j as xa,ja as cc,jb as Cw,jc as hp,k as KA,ka as dc,kb as jd,kc as gp,l as WA,la as pc,lb as ep,lc as yp,m as JA,ma as uc,mb as tp,mc as Tp,n as ZA,na as lc,nb as rp,nc as Cp,o as QA,oa as fc,ob as np,oc as bp,p as eE,pa as mc,pb as Aw,pc as Ap,q as EE,qa as _c,qb as Ew,qc as Ep,r as SE,ra as hc,rb as Sw,rc as Sp,s as wE,sa as gc,sb as ww,sc as wp,t as xE,ta as yc,tb as xw,tc as ct,u as RE,ua as Tc,ub as Rw,uc as xp,v as OE,va as Cc,vb as Ow,vc as nx,w as IE,wa as bc,wb as Iw,wc as ox,x as PE,xa as Ac,xb as Pw,xc as ix,y as ME,ya as Ec,yb as Mw,yc as Rp,z as kE,za as Sc,zb as kw,zc as sx}from"./chunks/chunk-IV64RJVE.js";import{$ as Vg,$c as eT,$e as QT,$f as mC,$h as Rb,$i as Ze,$j as ui,$k as Ji,$l as Js,Ac as Br,Ad as Vr,Af as qn,Ag as jC,Ah as mb,Ai as zb,Aj as CA,Ak as vA,Al as Ss,Am as ba,B as vg,Bc as Ly,Bd as TT,Bf as zn,Bg as BC,Bj as bA,Bk as LA,Bl as ws,Bm as Aa,C as O,Cc as Dy,Cd as Kr,Cf as Hn,Cg as qC,Ch as _b,Ci as Hb,Cj as AA,Ck as DA,Cl as xs,Cm as tt,D as Lg,Dc as Fy,De as wn,Df as Vn,Dg as zC,Dj as EA,Dk as FA,Dl as Rs,E as fe,Ec as Gy,Ed as CT,Ee as xn,Ef as Kn,Eg as HC,Eh as hb,Ej as SA,Ek as GA,El as Os,Fc as $y,Fd as bT,Fe as Rn,Ff as Wn,Fh as gb,Fi as Vb,Fj as wA,Fk as $A,Fl as Is,G as Dg,Gc as Uy,Gd as AT,Gf as Xn,Gg as VC,Gh as yb,Gk as Pi,Gl as Ps,H as Fg,Hc as jy,Hd as Wr,He as NT,Hf as Yn,Hg as KC,Hh as Tb,Hi as Kb,Hk as Mi,Hl as Ms,Ic as By,Id as Xr,Ie as vT,If as Jn,Ih as Cb,Ik as ki,Il as ks,Ja as ny,Jc as qr,Jd as Yr,Je as LT,Jf as Zn,Jj as Qe,Jk as Ni,Jl as Ns,K as Gg,Ka as oy,Kb as hy,Kc as qy,Kd as Jr,Ke as DT,Kf as Qn,Kg as WC,Kj as xA,Kk as vi,Kl as vs,La as iy,Lb as Fr,Lc as zr,Ld as Zr,Le as FT,Lf as eo,Lg as XC,Li as Wb,Lj as RA,Lk as Li,Ll as Ls,Mb as Gr,Md as Qr,Me as GT,Mf as to,Mg as YC,Mi as Xb,Mj as OA,Mk as Di,Ml as Ds,N as $g,Nb as gy,Nc as zy,Nd as en,Ne as $T,Nf as ro,Ng as JC,Ni as Yb,Nj as Jo,Nk as Fi,Nl as Fs,O as Ve,Oa as Mr,Ob as yy,Oc as Hy,Od as ET,Oe as UT,Of as no,Og as ZC,Oi as Jb,Oj as Zo,Ok as Gi,Ol as Gs,Pa as sy,Pb as W,Pc as Vy,Pd as ST,Pe as jT,Pf as oo,Pg as lo,Pi as Zb,Pj as Qo,Pk as $i,Pl as $s,Q as Ke,Qa as ay,Qb as Ty,Qc as Ky,Qe as BT,Qf as io,Qg as fo,Qj as ei,Qk as Ui,Ql as Us,R as Ar,Ra as cy,Rc as Wy,Rd as tn,Re as qT,Rf as so,Ri as Qb,Rj as ti,Rk as ji,Rl as js,S as Er,Sa as dy,Sb as Cy,Sc as Ye,Sd as rn,Se as zT,Sf as ao,Si as eA,Sj as ri,Sk as Bi,Sl as Bs,T as We,Tc as Xy,Td as wT,Te as HT,Tf as co,Th as bb,Ti as tA,Tj as ni,Tk as qi,Tl as qs,U as Ug,Ua as kr,Ub as by,Uc as Yy,Ud as nn,Ue as VT,Uf as po,Ug as QC,Uh as Ab,Ui as rA,Uj as oi,Uk as zi,Ul as zs,Va as Nr,Vc as Jy,Vd as on,Ve as KT,Vf as uo,Vg as eb,Vh as Eb,Vi as nA,Vj as ii,Vk as Hi,Vl as Hs,W as jg,Wa as me,Wd as xT,We as WT,Wf as dC,Wg as tb,Wh as Sb,Wi as oA,Wj as si,Wk as Vi,Wl as Vs,X as Bg,Xc as Zy,Xd as sn,Xe as XT,Xf as pC,Xg as rb,Xh as wb,Xi as iA,Xj as ai,Xk as Ki,Xl as Ks,Y as qg,Yc as Qy,Yd as an,Ye as YT,Yf as uC,Yh as xb,Yi as sA,Yj as ci,Yk as Wi,Yl as Ws,Z as zg,Za as vr,Zd as cn,Ze as JT,Zf as lC,Zg as nb,Zi as aA,Zj as di,Zk as Xi,Zl as Xs,_ as Hg,_a as Lr,_c as Hr,_d as dn,_e as ZT,_f as fC,_g as ob,_i as cA,_j as pi,_k as Yi,_l as Ys,aa as Kg,ab as Dr,ad as tT,af as eC,ag as _C,ai as Ob,aj as dA,ak as li,al as Zi,am as Zs,ba as Wg,bd as rT,bf as tC,bg as hC,bi as xo,bj as pA,bk as fi,bl as Qi,bm as Qs,c as Tr,ca as Xg,cd as nT,cf as rC,cg as gC,ch as ib,ci as Ib,cj as uA,ck as mi,cl as es,cm as ea,da as Yg,dd as oT,df as nC,dg as yC,dh as sb,di as Pb,dj as lA,dk as _i,dl as ts,dm as ta,e as K,ed as iT,ee as RT,ef as oC,eg as TC,eh as ab,ei as Mb,ej as fA,ek as hi,el as rs,em as ra,f as Cr,fa as Jg,fc as Ay,fd as sT,fe as OT,ff as iC,fg as CC,fh as cb,fi as kb,fj as mA,fk as gi,fl as ns,fm as na,g as le,ga as Zg,gc as Ey,gd as aT,ge as IT,gf as sC,gg as bC,gh as ye,gi as Je,gj as _A,gk as yi,gl as os,gm as oa,h as br,ha as Qg,hc as Sy,hd as cT,he as pn,hf as aC,hg as AC,hh as mo,hi as Nb,hj as hA,hk as Ti,hl as is,hm as ia,ia as ey,id as dT,ie as un,if as cC,ig as EC,ih as _o,ii as vb,ij as gA,ik as Ci,il as ss,im as sa,j as Og,ja as ty,jc as wy,je as ln,jf as On,jg as SC,jh as ho,ji as Lb,jj as No,jk as bi,jl as as,jm as aa,k as Ig,ka as ry,kc as xy,kd as pT,ke as fn,kf as In,kg as wC,kh as go,ki as Db,kj as vo,kk as Ai,kl as cs,km as ca,l as Pg,la as Sr,ld as uT,le as mn,lf as Pn,lg as xC,lh as yo,lj as Lo,lk as Ei,ll as ds,lm as da,ma as wr,mc as Ry,me as _n,mf as Mn,mg as RC,mh as To,mi as Fb,mj as Do,mk as Si,ml as ps,mm as pa,na as xr,nc as $r,nd as lT,ne as hn,nf as kn,ng as OC,nh as Co,ni as Gb,nj as Fo,nk as wi,nl as us,od as fT,oe as gn,of as Nn,og as IC,oh as bo,oi as $b,oj as Go,ok as xi,ol as ls,om as be,pc as Ur,pd as mT,pe as yn,pf as vn,pg as PC,ph as Ao,pi as Ub,pk as Ri,pl as fs,pm as U,qc as jr,qd as _T,qe as Tn,qf as Ln,qg as MC,qh as db,qi as Ro,qj as $o,qk as Oi,ql as ms,qm as ua,ra as Rr,rb as py,rd as hT,re as Cn,rf as Dn,rg as kC,ri as Oo,rj as Uo,rk as Ii,rl as _s,rm as la,s as Mg,sb as _e,sd as gT,se as bn,sf as Fn,sg as NC,sh as Eo,si as Io,sj as jo,sk as IA,sl as hs,sm as fa,ta as Or,tb as Xe,tc as Oy,te as An,tf as Gn,tg as vC,th as So,ti as Po,tj as Bo,tk as PA,tl as gs,tm as ma,u as kg,ua as Ir,ub as uy,uc as Iy,ue as En,uf as he,ug as LC,uh as wo,ui as Mo,uj as qo,uk as Te,ul as ys,um as _a,va as Pr,vb as ly,vc as Py,ve as Sn,vf as ge,vg as DC,vi as ko,vj as zo,vk as MA,vl as Ts,vm as ha,wb as fy,wc as My,we as PT,wf as $n,wg as FC,wh as pb,wi as jb,wj as Ho,wk as kA,wl as Cs,wm as ga,x as Ng,xb as my,xc as ky,xe as MT,xf as Un,xg as GC,xh as ub,xj as Vo,xk as NA,xl as bs,xm as ya,yb as I,yc as Ny,yd as yT,ye as kT,yf as jn,yg as $C,yh as lb,yi as Bb,yj as yA,yk as et,yl as As,ym as Ta,zb as _y,zc as vy,zf as Bn,zg as UC,zh as fb,zi as qb,zj as TA,zk as Ce,zl as Es,zm as Ca}from"./chunks/chunk-ES25LX3D.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]="9cb05a78-f95d-5211-a35a-03756f66c812")}catch{}})();var Y="2026-07-28",YO=["2025-06-18"],xe=[Y],l={headerMismatch:-32020,missingRequiredClientCapability:-32021,unsupportedProtocolVersion:-32022,invalidParams:-32602},A={clientCapabilities:"io.modelcontextprotocol/clientCapabilities",clientInfo:"io.modelcontextprotocol/clientInfo",protocolVersion:"io.modelcontextprotocol/protocolVersion",serverInfo:"io.modelcontextprotocol/serverInfo"},u=class extends Error{code;data;constructor(t,r,n={}){super(t),this.name="PmMcpProtocolError",this.code=r,this.data=n}};function m(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function m_(e){if(e===void 0)return;if(!m(e))throw new u("Invalid MCP clientInfo metadata",l.invalidParams,{field:A.clientInfo,expected:"object"});let t=typeof e.name=="string"?e.name.trim():"",r=typeof e.version=="string"?e.version.trim():"";if(t.length===0||r.length===0)throw new u("Invalid MCP clientInfo metadata",l.invalidParams,{field:A.clientInfo,required:["name","version"]});let n={name:t.slice(0,128),version:r.slice(0,128)};return typeof e.description=="string"&&e.description.trim()&&(n.description=e.description.trim().slice(0,1024)),typeof e.websiteUrl=="string"&&e.websiteUrl.trim()&&(n.websiteUrl=e.websiteUrl.trim().slice(0,2048)),n}function Re(e){let t=m(e)?e._meta:void 0;if(!m(t))throw new u("Missing required MCP request metadata",l.invalidParams,{required:[A.protocolVersion,A.clientCapabilities]});let r=t[A.protocolVersion];if(typeof r!="string"||!xe.includes(r))throw new u("Unsupported protocol version",l.unsupportedProtocolVersion,{supported:[...xe],requested:typeof r=="string"?r:null});let n=t[A.clientCapabilities];if(!m(n))throw new u("Invalid MCP client capabilities metadata",l.invalidParams,{field:A.clientCapabilities,expected:"object"});let o=m_(t[A.clientInfo]);return{protocolVersion:Y,clientCapabilities:n,...o?{clientInfo:o}:{}}}function JO(e,t){if(t!==e.protocolVersion)throw new u("MCP protocol header does not match request metadata",l.headerMismatch,{header:t??null,metadata:e.protocolVersion})}function ZO(e,t){let r=t.filter(n=>!Object.prototype.hasOwnProperty.call(e.clientCapabilities,n));if(r.length>0)throw new u("Missing required client capability",l.missingRequiredClientCapability,{requiredCapabilities:Object.fromEntries(r.map(n=>[n,{}]))})}function QO(e,t){let r=e.clientCapabilities.extensions;return m(r)&&m(r[t])}function Oe(e,t){let r=m(e._meta)?e._meta:{};return{...e,_meta:{...r,[A.serverInfo]:{...t}}}}function __(e,t){return Oe({...e,resultType:"complete"},t)}function eI(e){let t=e.ttlMs??6e4;if(!Number.isFinite(t)||t<0)throw new u("Invalid MCP discovery cache TTL",l.invalidParams,{ttlMs:t});return __({supportedVersions:[...xe],capabilities:structuredClone(e.capabilities),ttlMs:t,cacheScope:"public",...e.instructions?{instructions:e.instructions}:{}},e.serverInfo)}function tI(e,t){if(m(e)&&typeof e.resultType=="string")return e.resultType;if(t==="legacy")return"complete";throw new u("Modern MCP result is missing resultType",l.invalidParams,{required:"resultType"})}import{createHash as wt,createHmac as xt,timingSafeEqual as h_}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]="469f704b-12eb-524d-bcc8-fb8f9f1775f2")}catch{}})();var g_=["elicitation/create","roots/list","sampling/createMessage"],Et=class extends Error{inputRequests;requestState;constructor(t){super("MCP operation requires additional input"),this.name="PmMcpInputRequiredError",this.inputRequests=t.inputRequests,this.requestState=t.requestState}},Rt=/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/u,J=32,Pe=64*1024,Z=16*1024,Ie={maxBytes:256*1024,maxDepth:32,maxNodes:4096};function y_(e){return e==="elicitation/create"?"elicitation":e==="sampling/createMessage"?"sampling":"roots"}function Q(e,t,r){let n;try{n=JSON.stringify(e)}catch{throw new u(`Invalid ${r}: value is not JSON serializable`,l.invalidParams,{field:r})}if(Buffer.byteLength(n,"utf8")>t)throw new u(`Invalid ${r}: payload exceeds the protocol bound`,l.invalidParams,{field:r,maximumBytes:t})}function Me(e,t){if(!m(e))throw new u("Invalid MCP inputRequests",l.invalidParams,{field:"inputRequests",expected:"object"});let r=Object.entries(e);if(r.length===0||r.length>J)throw new u("Invalid MCP inputRequests count",l.invalidParams,{minimum:1,maximum:J,observed:r.length});let n={};for(let[o,i]of r){if(!Rt.test(o)||!m(i))throw new u("Invalid MCP input request entry",l.invalidParams,{field:`inputRequests.${o}`});let s=i.method;if(typeof s!="string"||!g_.includes(s))throw new u("Unsupported MCP input request method",l.invalidParams,{field:`inputRequests.${o}.method`,method:s??null});let a=y_(s);if(!Object.prototype.hasOwnProperty.call(t.clientCapabilities,a))throw new u("Missing required client capability",l.missingRequiredClientCapability,{requiredCapabilities:{[a]:{}}});if(!m(i.params))throw new u("Invalid MCP input request parameters",l.invalidParams,{field:`inputRequests.${o}.params`,expected:"object"});n[o]={method:s,params:structuredClone(i.params)}}return Q(n,Pe,"inputRequests"),n}function Ot(e){if(!m(e))throw new u("Invalid MCP inputResponses",l.invalidParams,{field:"inputResponses",expected:"object"});let t=Object.entries(e);if(t.length>J)throw new u("Invalid MCP inputResponses count",l.invalidParams,{maximum:J,observed:t.length});let r={};for(let[n,o]of t){if(!Rt.test(n)||!m(o))throw new u("Invalid MCP input response entry",l.invalidParams,{field:`inputResponses.${n}`});r[n]=structuredClone(o)}return Q(r,Pe,"inputResponses"),r}function iI(e){let t=e.requestState?.trim();if(t&&Buffer.byteLength(t,"utf8")>Z)throw new u("Invalid MCP requestState: payload exceeds the protocol bound",l.invalidParams,{field:"requestState",maximumBytes:Z});let r=e.inputRequests===void 0?void 0:Me(e.inputRequests,e.requestContext);if(r===void 0&&!t)throw new u("InputRequiredResult requires inputRequests or requestState",l.invalidParams,{requiredAnyOf:["inputRequests","requestState"]});return{resultType:"input_required",...r?{inputRequests:r}:{},...t?{requestState:t}:{},_meta:{[A.serverInfo]:{...e.serverInfo}}}}function It(e){let t=Buffer.from(e);if(t.byteLength<32)throw new u("MCP requestState signing key must contain at least 32 bytes",l.invalidParams,{minimumBytes:32});return t}function sI(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",l.invalidParams);let r=Buffer.from(JSON.stringify({version:1,...e}),"utf8");if(r.byteLength>Z/2)throw new u("MCP requestState payload exceeds the protocol bound",l.invalidParams,{maximumBytes:Z/2});let n=r.toString("base64url"),o=xt("sha256",It(t)).update(n).digest("base64url");return`${n}.${o}`}function T_(e){if(!m(e)||e.version!==1)throw new u("Invalid MCP requestState payload",l.invalidParams,{field:"requestState"});let{expiresAt:t,method:r,parameterDigest:n,principal:o,state:i}=e;if(typeof t!="number"||!Number.isSafeInteger(t))throw new u("Invalid MCP requestState payload",l.invalidParams,{field:"requestState"});if(typeof r!="string"||typeof n!="string"||typeof o!="string")throw new u("Invalid MCP requestState payload",l.invalidParams,{field:"requestState"});return{expiresAt:t,method:r,parameterDigest:n,principal:o,state:i}}function aI(e,t,r){let[n,o,i]=e.split(".");if(!n||!o||i!==void 0)throw new u("Invalid MCP requestState encoding",l.invalidParams,{field:"requestState"});let s=Buffer.from(o,"base64url"),a=xt("sha256",It(t)).update(n).digest();if(s.byteLength!==a.byteLength||!h_(s,a))throw new u("Invalid MCP requestState signature",l.invalidParams,{field:"requestState"});let c;try{c=JSON.parse(Buffer.from(n,"base64url").toString("utf8"))}catch{c=null}let d=T_(c),{expiresAt:p,method:f,parameterDigest:_,principal:T}=d;if(p<(r.nowMs??Date.now()))throw new u("Expired MCP requestState",l.invalidParams,{field:"requestState",expiredAt:p});if(f!==r.method||_!==r.parameterDigest||T!==r.principal)throw new u("MCP requestState binding mismatch",l.invalidParams,{field:"requestState"});return d}function cI(e){return Q(e,Pe,"request parameters"),wt("sha256").update(JSON.stringify(e)).digest("hex")}var St=class{#e=new Set;#t;constructor(t=4096){if(!Number.isSafeInteger(t)||t<1)throw new u("Invalid MCP replay guard capacity",l.invalidParams,{maximumEntries:t});this.#t=t}consume(t){let r=wt("sha256").update(t).digest("hex");if(this.#e.has(r))throw new u("MCP requestState replay detected",l.invalidParams,{field:"requestState"});if(this.#e.size>=this.#t){let n=this.#e.values().next().value;this.#e.delete(n)}this.#e.add(r)}};function C_(e){if(!Number.isSafeInteger(e.ttlMs)||e.ttlMs<0||e.cacheScope!=="public"&&e.cacheScope!=="private")throw new u("Invalid MCP cache policy",l.invalidParams,{ttlMs:e.ttlMs,cacheScope:e.cacheScope});return{ttlMs:e.ttlMs,cacheScope:e.cacheScope}}function dI(e,t){return{...e,...C_(t)}}function b_(e){return e.replaceAll("~1","/").replaceAll("~0","~")}function A_(e,t){if(t==="#")return e;if(!t.startsWith("#/"))return;let r=e;for(let n of t.slice(2).split("/").map(b_)){if(!m(r)&&!Array.isArray(r)||!Object.prototype.hasOwnProperty.call(r,n))return;r=r[n]}return r}function E_(e){let t=e.maxBytes??Ie.maxBytes,r=e.maxDepth??Ie.maxDepth,n=e.maxNodes??Ie.maxNodes;if(!Number.isSafeInteger(t)||t<2)throw new u("Invalid MCP JSON Schema work bounds",l.invalidParams);if(!Number.isSafeInteger(r)||r<1)throw new u("Invalid MCP JSON Schema work bounds",l.invalidParams);if(!Number.isSafeInteger(n)||n<1)throw new u("Invalid MCP JSON Schema work bounds",l.invalidParams);return{maximumBytes:t,maximumDepth:r,maximumNodes:n}}function S_(e,t){let r=Array.isArray(e.value)?e.value:m(e.value)?Object.values(e.value):[];for(let n of r)t.push({value:n,depth:e.depth+1})}function w_(e,t){if(!m(t)||typeof t.$ref!="string")return;let r=t.$ref;if(r.startsWith("#")&&A_(e,r)===void 0)throw new u("MCP JSON Schema contains an unresolved local reference",l.invalidParams,{reference:r})}function pI(e,t={}){let{maximumBytes:r,maximumDepth:n,maximumNodes:o}=E_(t);if(typeof e!="boolean"&&!m(e))throw new u("Invalid MCP JSON Schema root",l.invalidParams,{expected:"object or boolean"});Q(e,r,"JSON Schema");let i=[{value:e,depth:0}],s=0;for(;i.length>0;){let a=i.pop();if(s+=1,s>o||a.depth>n)throw new u("MCP JSON Schema exceeds validation work bounds",l.invalidParams,{maximumDepth:n,maximumNodes:o});w_(e,a.value),S_(a,i)}return structuredClone(e)}import{randomUUID as x_}from"node:crypto";import{readFile as R_}from"node:fs/promises";import Pt 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]="1774674f-4d33-5a24-9d97-522c55b861c0")}catch{}})();var yI="io.modelcontextprotocol/tasks",O_=["working","input_required","completed","failed","cancelled"],I_=/^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,P_=3600*1e3,M_=1e3,te=1024,k_=30,N_=2e3;function ke(e){return new u(e,l.invalidParams,{code:"mcp_task_not_found_or_not_authorized"})}function ee(e){let t=e.trim();if(!I_.test(t))throw ke("Unknown MCP task");return t}function Mt(e,t){if(typeof e!="string"||!Number.isFinite(Date.parse(e)))throw new u("Corrupt MCP task record",l.invalidParams,{field:t});return e}function kt(e){if(!m(e)||typeof e.code!="number"||!Number.isFinite(e.code)||typeof e.message!="string")throw new u("Corrupt MCP task error",l.invalidParams);return{code:e.code,message:e.message.slice(0,te),...m(e.data)?{data:structuredClone(e.data)}:{}}}function v_(e){if(!O_.includes(e))throw new u("Corrupt MCP task record",l.invalidParams);return e}function L_(e){if(typeof e!="string"||e.length===0)throw new u("Corrupt MCP task record",l.invalidParams);return e}function D_(e){if(typeof e!="number"||!Number.isSafeInteger(e)||e<1)throw new u("Corrupt MCP task record",l.invalidParams);return e}function F_(e){if(e!==null&&(typeof e!="number"||!Number.isSafeInteger(e)||e<0))throw new u("Corrupt MCP task record",l.invalidParams);return e}function G_(e){if(e!==void 0){if(typeof e!="number"||!Number.isSafeInteger(e)||e<0)throw new u("Corrupt MCP task record",l.invalidParams);return e}}function $_(e){if(!Array.isArray(e)||e.some(t=>typeof t!="string"))throw new u("Corrupt MCP task record",l.invalidParams);return[...e]}function U_(e){if(!m(e)||e.version!==1)throw new u("Corrupt MCP task record",l.invalidParams);let t=typeof e.taskId=="string"?ee(e.taskId):"",r=v_(e.status),n=L_(e.principal),o=D_(e.workerPid),i=F_(e.ttlMs),s=G_(e.pollIntervalMs),a={version:1,taskId:t,status:r,principal:n,workerPid:o,createdAt:Mt(e.createdAt,"createdAt"),lastUpdatedAt:Mt(e.lastUpdatedAt,"lastUpdatedAt"),ttlMs:i,consumedInputKeys:$_(e.consumedInputKeys),...typeof e.statusMessage=="string"?{statusMessage:e.statusMessage.slice(0,te)}:{},...typeof s=="number"?{pollIntervalMs:s}:{}};if(m(e.inputRequests)&&(a.inputRequests=structuredClone(e.inputRequests)),m(e.inputResponses)&&(a.inputResponses=structuredClone(e.inputResponses)),m(e.result)&&(a.result=structuredClone(e.result)),e.error!==void 0&&(a.error=kt(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",l.invalidParams,{status:a.status});return a}function P(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 j(e){return e==="completed"||e==="failed"||e==="cancelled"}function j_(e){try{return process.kill(e,0),!0}catch(t){return!(typeof t=="object"&&t!==null&&"code"in t&&t.code==="ESRCH")}}var Ne=class{#e;#t;#r;#o;#i;constructor(t){this.#e=Pt.resolve(t.pmRoot),this.#t=t.owner?.trim()||"pm-mcp",this.#r=t.now??(()=>new Date),this.#o=t.taskIdFactory??(()=>`mcp-task-${x_()}`),this.#i=t.workerPid??process.pid}#s(t){return Pt.join(this.#e,"runtime","mcp-tasks","records",`${ee(t)}.json`)}async#c(t){try{return U_(JSON.parse(await R_(this.#s(t),"utf8")))}catch(r){throw K(r)||r instanceof SyntaxError?ke("Unknown MCP task"):r}}async#a(t){await le(this.#s(t.taskId),`${JSON.stringify(t,null,2)}
2
- `)}async#n(t,r,n){let o=ee(t),i=await ye(this.#e,o,k_,this.#t,!1,!1,N_);try{let s=await this.#c(o);if(s.principal!==r)throw ke("Unknown MCP task");let a=n(s);return await this.#a(a),a}finally{await i()}}async create(t){let r=ee(this.#o()),n=t.principal.trim(),o=t.ttlMs===void 0?P_:t.ttlMs,i=t.pollIntervalMs??M_;if(n.length===0||o!==null&&(!Number.isSafeInteger(o)||o<0)||!Number.isSafeInteger(i)||i<0)throw new u("Invalid MCP task creation options",l.invalidParams);let s=this.#r().toISOString(),a={version:1,taskId:r,status:"working",createdAt:s,lastUpdatedAt:s,ttlMs:o,pollIntervalMs:i,principal:n,workerPid:this.#i,consumedInputKeys:[],...t.statusMessage?.trim()?{statusMessage:t.statusMessage.trim().slice(0,te)}:{}};return await this.#a(a),{...P(a),resultType:"task"}}async get(t,r){return P(await this.#n(t,r,n=>{if(j(n.status))return n;let o=this.#r().getTime(),i=n.ttlMs!==null&&Date.parse(n.createdAt)+n.ttlMs<=o,s=n.workerPid!==this.#i&&!j_(n.workerPid);return!i&&!s?n:{...n,status:"failed",statusMessage:i?"Task retention expired before completion.":"Task worker ended before recording a terminal result.",lastUpdatedAt:this.#r().toISOString(),error:{code:-32603,message:i?"MCP task expired":"MCP task worker unavailable after restart",data:{recoverable:!1,createNewTask:!0}},inputRequests:void 0}}))}async requireInput(t){let r=Me(t.inputRequests,t.requestContext);return P(await this.#n(t.taskId,t.principal,n=>{if(j(n.status))return n;let o=Object.keys(r).filter(i=>n.consumedInputKeys.includes(i));if(o.length>0)throw new u("MCP task input request keys must be unique for the task lifetime",l.invalidParams,{reused:o});return{...n,status:"input_required",statusMessage:t.statusMessage?.trim().slice(0,te),lastUpdatedAt:this.#r().toISOString(),inputRequests:r}}))}async update(t,r,n){let o=Ot(n),i=[],s=[];return await this.#n(t,r,a=>{if(a.status!=="input_required"||!a.inputRequests)return a;let c={...a.inputRequests},d=a.inputResponses?{...a.inputResponses}:{};for(let[p,f]of Object.entries(o))Object.prototype.hasOwnProperty.call(c,p)&&(d[p]=f,delete c[p],i.push(p));return s=Object.keys(c).sort(),i.length===0?a:{...a,status:s.length===0?"working":"input_required",lastUpdatedAt:this.#r().toISOString(),inputRequests:s.length===0?void 0:c,inputResponses:d,consumedInputKeys:[...new Set([...a.consumedInputKeys,...i])].sort()}}),{acceptedKeys:i.sort(),remainingKeys:s}}async takeInputResponses(t,r){let n={};return await this.#n(t,r,o=>(n=structuredClone(o.inputResponses??{}),Object.keys(n).length===0?o:{...o,inputResponses:void 0})),n}async complete(t,r,n){return P(await this.#n(t,r,o=>j(o.status)?o:{...o,status:"completed",statusMessage:"Task completed.",lastUpdatedAt:this.#r().toISOString(),result:structuredClone(n),inputRequests:void 0,error:void 0}))}async fail(t,r,n){let o=kt(n);return P(await this.#n(t,r,i=>j(i.status)?i:{...i,status:"failed",statusMessage:o.message,lastUpdatedAt:this.#r().toISOString(),error:o,inputRequests:void 0,result:void 0}))}async cancel(t,r){return P(await this.#n(t,r,n=>j(n.status)?n:{...n,status:"cancelled",statusMessage:"Task cancelled by the client.",lastUpdatedAt:this.#r().toISOString(),inputRequests:void 0,result:void 0,error:void 0}))}};function TI(e){return new Ne(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]="cb791784-bde2-5b1d-b5df-038282816043")}catch{}})();var re="io.modelcontextprotocol/subscriptionId",Nt=256,vt=2048,B_=5e3;function q_(e,t){return new Promise((r,n)=>{let o=setTimeout(()=>n(new Error("MCP subscription sink write timed out")),B_);o.unref(),Promise.resolve().then(()=>e(t)).then(()=>{clearTimeout(o),r()},i=>{clearTimeout(o),n(i instanceof Error?i:new Error(String(i)))})})}function ve(e,t){if(e!==void 0){if(typeof e!="boolean")throw new u("Invalid MCP subscription filter",l.invalidParams,{field:`notifications.${t}`,expected:"boolean"});return e||void 0}}function z_(e){if(!m(e))throw new u("Invalid MCP subscription filter",l.invalidParams,{field:"notifications",expected:"object"});let t=ve(e.toolsListChanged,"toolsListChanged"),r=ve(e.promptsListChanged,"promptsListChanged"),n=ve(e.resourcesListChanged,"resourcesListChanged"),o;if(e.resourceSubscriptions!==void 0){if(!Array.isArray(e.resourceSubscriptions)||e.resourceSubscriptions.length>Nt)throw new u("Invalid MCP resource subscriptions",l.invalidParams,{field:"notifications.resourceSubscriptions",maximum:Nt});let i=new Set;for(let s of e.resourceSubscriptions){if(typeof s!="string"||s.trim().length===0||Buffer.byteLength(s,"utf8")>vt)throw new u("Invalid MCP resource subscription URI",l.invalidParams,{field:"notifications.resourceSubscriptions",maximumBytes:vt});i.add(s)}i.size>0&&(o=[...i].sort())}return{...t?{toolsListChanged:t}:{},...r?{promptsListChanged:r}:{},...n?{resourcesListChanged:n}:{},...o?{resourceSubscriptions:o}:{}}}function H_(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 Lt=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",l.invalidParams,{subscriptionId:t.id});let r=H_(z_(t.notifications),this.#e),n={filter:r,sink:t.sink,writeQueue:Promise.resolve()};this.#t.set(t.id,n);try{await this.#o(t.id,n,{jsonrpc:"2.0",method:"notifications/subscriptions/acknowledged",params:{_meta:{[re]:t.id},notifications:structuredClone(r)}},!0)}catch(o){throw this.#t.delete(t.id),o}return structuredClone(r)}async emitListChanged(t){let r=`${t}ListChanged`,n=`notifications/${t}/list_changed`,o=[];for(let[i,s]of this.#t)s.filter[r]===!0&&o.push(this.#o(i,s,{jsonrpc:"2.0",method:n,params:{_meta:{[re]:i}}}));return(await Promise.all(o)).filter(Boolean).length}async emitResourceUpdated(t){let r=[];for(let[n,o]of this.#t)o.filter.resourceSubscriptions?.includes(t)&&r.push(this.#o(n,o,{jsonrpc:"2.0",method:"notifications/resources/updated",params:{_meta:{[re]:n},uri:t}}));return(await Promise.all(r)).filter(Boolean).length}async#o(t,r,n,o=!1){let i=r.writeQueue.then(async()=>{if(this.#t.get(t)!==r)return!1;try{return await q_(r.sink,n),!0}catch(s){if(this.#t.get(t)===r&&this.#t.delete(t),o)throw s;return!1}});return r.writeQueue=i.then(()=>{},()=>{}),i}close(t){if(this.#t.delete(t))return{...Oe({resultType:"complete",_meta:{[re]:t}},this.#r)}}closeAll(){let t=[];for(let r of this.#t.keys()){let n=this.close(r);t.push({id:r,result:n})}return t}};(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="5ffe7128-0fbb-59af-89ef-74d5d799a00d")}catch{}})();var Dt=/^=\?base64\?([A-Za-z0-9+/]*={0,2})\?=$/u,V_=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/u,Ft=/^[\t\x20-\x7E]*$/u,Gt=new Set(["prompts/get","resources/read","tools/call"]);function K_(e){let t=new Map;for(let[r,n]of Object.entries(e)){if(n===void 0)continue;let o=typeof n=="string"?n:n.join(", ");t.set(r.toLowerCase(),o)}return t}function C(e,t){throw new u(e,l.headerMismatch,{header:t})}function $t(e){let t=typeof e=="boolean"?String(e).toLowerCase():String(e);return t.length>0&&t.trim()===t&&Ft.test(t)&&!Dt.test(t)?t:`=?base64?${Buffer.from(t,"utf8").toString("base64")}?=`}function Ut(e,t){let r=Dt.exec(e);if(r){let n=r[1],o=Buffer.from(n,"base64");return o.toString("base64")!==n||o.length===0?C("Malformed MCP Base64 header value",t):o.toString("utf8")}return e.length===0||e.trim()!==e||!Ft.test(e)?C("Malformed MCP header value",t):e}function ne(e){return Array.isArray(e)?e.some(ne):m(e)?Object.prototype.hasOwnProperty.call(e,"x-mcp-header")||Object.values(e).some(ne):!1}function W_(e,t,r){let n=e["x-mcp-header"];if(n===void 0)return;let o=e.type;if(typeof n!="string"||!V_.test(n)||!["boolean","integer","string"].includes(String(o))||r.has(n.toLowerCase()))throw new u("Invalid MCP x-mcp-header annotation",l.invalidParams,{field:t.join("."),annotation:n});return r.add(n.toLowerCase()),{name:n,path:t,type:o}}function jt(e){if(!m(e))throw new u("Invalid MCP tool schema",l.invalidParams,{field:"inputSchema",expected:"object"});let t=[],r=new Set,n=(o,i)=>{let s=o.properties;if(s!==void 0){if(!m(s))throw new u("Invalid MCP tool schema properties",l.invalidParams,{field:"inputSchema.properties"});for(let[a,c]of Object.entries(s)){if(!m(c))continue;let d=[...i,a],p=W_(c,d,r);p&&t.push(p);for(let[f,_]of Object.entries(c))if(f!=="properties"&&f!=="x-mcp-header"&&ne(_))throw new u("MCP x-mcp-header is not statically reachable",l.invalidParams,{field:d.join("."),keyword:f});n(c,d)}}};for(let[o,i]of Object.entries(e))if(o!=="properties"&&ne(i))throw new u("MCP x-mcp-header is not statically reachable",l.invalidParams,{field:"inputSchema",keyword:o});return n(e,[]),t}function Bt(e,t){let r=e;for(let n of t){if(!m(r))return;r=r[n]}return r}function qt(e,t){let r=e==="resources/read"?t.uri:t.name;return typeof r=="string"?r:void 0}function X_(e,t){let r=m(e.arguments)?e.arguments:{},n={};for(let o of jt(t)){let i=Bt(r,o.path);if(i==null)continue;if(!(o.type==="integer"&&typeof i=="number"&&Number.isSafeInteger(i)||o.type==="boolean"&&typeof i=="boolean"||o.type==="string"&&typeof i=="string"))throw new u("Invalid MCP custom header argument",l.invalidParams,{field:o.path.join("."),expected:o.type});n[`Mcp-Param-${o.name}`]=$t(i)}return n}function SI(e){let t=m(e.request.params)?e.request.params:void 0,r=Re(t),n=e.request.method;if(typeof n!="string"||n.length===0)return C("Missing MCP request method","Mcp-Method");let o={Accept:"application/json, text/event-stream","Content-Type":"application/json","MCP-Protocol-Version":r.protocolVersion,"Mcp-Method":n},i=qt(n,t);if(Gt.has(n)){if(i===void 0)return C("Missing MCP request name","Mcp-Name");o["Mcp-Name"]=$t(i)}return n==="tools/call"&&e.toolSchema!==void 0&&Object.assign(o,X_(t,e.toolSchema)),o}function Y_(e,t){let r=t.method;(typeof r!="string"||r.length===0)&&C("Missing MCP request method","Mcp-Method");let n=m(t.params)?t.params:void 0,o=Re(n).protocolVersion;if(e.get("mcp-protocol-version")!==o&&C("MCP protocol header does not match request metadata","MCP-Protocol-Version"),e.get("mcp-method")!==r&&C("MCP method header does not match request body","Mcp-Method"),Gt.has(r)){let i=e.get("mcp-name"),s=qt(r,n);(i===void 0||s===void 0||Ut(i,"Mcp-Name")!==s)&&C("MCP name header does not match request body","Mcp-Name")}e.has("last-event-id")&&C("MCP SSE resumability is not supported","Last-Event-ID")}function J_(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 Z_(e){let t=m(e.params.arguments)?e.params.arguments:{};for(let r of jt(e.toolSchema)){let n=Bt(t,r.path),o=`Mcp-Param-${r.name}`,i=e.headers.get(o.toLowerCase());if(n==null){i!==void 0&&C("Unexpected MCP parameter header",o);continue}i===void 0&&C("Missing MCP parameter header",o),J_(r,n,Ut(i,o))||C("MCP parameter header does not match request body",o)}}function wI(e){let t=K_(e.headers),r=typeof e.request.method=="string"?e.request.method:"";Y_(t,e.request),!(r!=="tools/call"||e.toolSchema===void 0)&&Z_({headers:t,params:e.request.params,toolSchema:e.toolSchema})}var xI=Y;import{AsyncLocalStorage as Q_}from"node:async_hooks";import{createHash as zt,timingSafeEqual as eh}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]="a9aefc86-a8ce-5ecf-bb54-e5fa3ea277c7")}catch{}})();var h=class extends Error{httpStatus;challenge;constructor(t,r,n){super(t),this.name="PmMcpAuthorizationError",this.httpStatus=r,this.challenge=n}},th=/^00-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})$/u,rh=/^[a-z][a-z0-9_*/-]{0,255}$/u,nh=/^(?:[a-z0-9][a-z0-9_*/-]{0,240})@[a-z][a-z0-9_*/-]{0,13}$/u,oh=/^[\x20-\x2B\x2D-\x3C\x3E-\x7E]{0,255}[\x21-\x2B\x2D-\x3C\x3E-\x7E]$/u,Vt=/^[\x21\x23-\x5B\x5D-\x7E]+$/u,Kt=/^[A-Za-z0-9!#$%&'*+.^_`|~-]+$/u,ih=/^[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]*$/u,sh=/%(?![0-9A-Fa-f]{2})/u,ah=512,ch=32,dh=180,ph=8192,uh=8192,Wt=new Q_;function y(e,t,r=!1){if(new RegExp("\\p{Cc}","u").test(e))throw new h(`Invalid ${t}`,401);let n;try{n=new URL(e)}catch{throw new h(`Invalid ${t}`,401)}let o=n.hostname==="127.0.0.1"||n.hostname==="localhost";if(n.hash.length>0||n.protocol!=="https:"&&!(r&&o&&n.protocol==="http:"))throw new h(`Invalid ${t}`,401);return n}function lh(e,t){let r=t.toLowerCase();for(let[n,o]of Object.entries(e))if(!(n.toLowerCase()!==r||o===void 0))return typeof o=="string"?o:o.join(", ")}function MI(e){let t=y(e.resource,"protected resource URI",!0).href.replace(/\/$/u,"");if(e.authorizationServers.length===0)throw new h("Protected resource metadata requires an authorization server",401);let r=e.authorizationServers.map(o=>y(o,"authorization server issuer").href.replace(/\/$/u,"")),n=[...new Set(e.scopes??[])];if(n.some(o=>!Vt.test(o)))throw new h("Invalid authorization scope",401);return{resource:t,authorization_servers:r,...n.length>0?{scopes_supported:n.sort()}:{}}}function kI(e){let t=y(e,"authorization server issuer"),r=t.pathname.replace(/^\/+|\/+$/gu,""),n=t.origin;return r?[`${n}/.well-known/oauth-authorization-server/${r}`,`${n}/.well-known/openid-configuration/${r}`,`${n}/${r}/.well-known/openid-configuration`]:[`${n}/.well-known/oauth-authorization-server`,`${n}/.well-known/openid-configuration`]}function NI(e,t){if(!m(e)||typeof e.issuer!="string")throw new h("Invalid authorization server metadata",401);let r=y(t,"expected issuer").href.replace(/\/$/u,"");if(y(e.issuer,"metadata issuer").href.replace(/\/$/u,"")!==r)throw new h("Authorization server issuer mismatch",401);if(!Array.isArray(e.code_challenge_methods_supported)||!e.code_challenge_methods_supported.includes("S256"))throw new h("Authorization server does not support required S256 PKCE",401);let o=d=>{let p=e[d];if(typeof p!="string")throw new h(`Authorization server metadata requires ${d}`,401);return y(p,d).href},i=d=>{let p=e[d];return typeof p=="string"?y(p,d).href:void 0},s=o("authorization_endpoint"),a=o("token_endpoint"),c=i("registration_endpoint");return{issuer:r,authorization_endpoint:s,token_endpoint:a,code_challenge_methods_supported:[...new Set(e.code_challenge_methods_supported.filter(d=>typeof d=="string"))],...e.client_id_metadata_document_supported===!0?{client_id_metadata_document_supported:!0}:{},...c?{registration_endpoint:c}:{}}}function vI(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 LI(e){if(e.responseIssuer===void 0){if(e.issuerParameterSupported)throw new h("Authorization response omitted the advertised issuer",401);return}if(e.responseIssuer!==e.expectedIssuer)throw new h("Authorization response issuer mismatch",401)}function DI(e,t){let r=y(t,"client metadata document URL");if(r.pathname==="/"||!m(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 h("Invalid Client ID Metadata Document",401);for(let n of e.redirect_uris){if(typeof n!="string")throw new h("Invalid client redirect URI",401);y(n,"client redirect URI",!0)}return structuredClone(e)}function FI(e){if(e.redirectUris.length===0||e.clientName.trim().length===0)throw new h("Invalid dynamic client registration metadata",401);let t=e.redirectUris.map(r=>y(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 Ht=class{#e=new Map;set(t,r){let n=y(t,"credential issuer").href;this.#e.set(n,structuredClone(r))}get(t){let r=y(t,"credential issuer").href,n=this.#e.get(r);return n?structuredClone(n):void 0}delete(t){let r=y(t,"credential issuer").href;return this.#e.delete(r)}};function fh(e){let t=e.traceparent,r=e.tracestate;if(t!==void 0){let n=typeof t=="string"?th.exec(t):null;if(!n)throw new h("Invalid MCP traceparent",403);let o=n[1],i=n[2];if(/^0+$/u.test(o)||/^0+$/u.test(i))throw new h("Invalid MCP traceparent",403)}if(r!==void 0&&(typeof r!="string"||!_h(r)))throw new h("Invalid MCP tracestate",403);return{...typeof t=="string"?{traceparent:t}:{},...typeof r=="string"?{tracestate:r}:{}}}function S(e){return e.replace(/^[ \t]*|[ \t]*$/gu,"")}function mh(e){return rh.test(e)||nh.test(e)}function _h(e){if(Buffer.byteLength(e,"utf8")>ah)return!1;let t=e.split(",");if(t.length>ch)return!1;let r=new Set;for(let n of t){let o=S(n);if(o.length===0)continue;let i=o.indexOf("="),s=i>0?o.slice(0,i):"",a=i>0?o.slice(i+1):"";if(!mh(s)||!oh.test(a)||r.has(s))return!1;r.add(s)}return!0}function Xt(e){return ih.test(e)&&!sh.test(e)}function hh(e){let t=S(e),r=t.indexOf("="),n=S(r>=0?t.slice(0,r):t),o=r>=0?S(t.slice(r+1)):void 0;return Kt.test(n)&&(o===void 0||Xt(o))}function gh(e){let t=S(e),r=t.split(";"),n=r[0],o=r.slice(1),i=n.indexOf("="),s=S(i>0?n.slice(0,i):""),a=i>0?S(n.slice(i+1)):"";if(!(!Kt.test(s)||!Xt(a)||!o.every(hh)))return{key:s,serialized:t}}function yh(e,t){if(e===void 0)return;if(typeof e!="string"||Buffer.byteLength(e,"utf8")>ph)throw new h("Invalid MCP baggage",403);let r=new Set(t),n=e.split(",");if(n.length>dh)throw new h("Invalid MCP baggage",403);let o=[];for(let i of n){let s=gh(i);if(!s)throw new h("Invalid MCP baggage",403);r.has(s.key)&&o.push(s.serialized)}return o.length>0?o.join(","):void 0}function GI(e,t={}){let r=m(e)&&m(e._meta)?e._meta:{},n=yh(r.baggage,t.baggageAllowlist??[]);return{...fh(r),...n?{baggage:n}:{}}}function $I(e,t){return Wt.run(structuredClone(e),t)}function UI(){let e=Wt.getStore();return e?{...e}:void 0}async function jI(e){let t=y(e.policy.resourceMetadataUrl,"protected resource metadata URL",!0).href,r=[...new Set(e.policy.requiredScopes??[])];if(r.some(f=>!Vt.test(f)))throw new h("Invalid authorization scope",401);let n=`Bearer resource_metadata="${t}"`;if(new URL(e.requestUrl,e.policy.resource).searchParams.has("access_token"))throw new h("Access tokens must not appear in URI query parameters",401,n);let s=lh(e.headers,"authorization")?.match(/^Bearer ([^\s]+)$/iu);if(!s)throw new h("Missing or malformed bearer token",401,n);let a=s[1];if(Buffer.byteLength(a,"utf8")>uh)throw new h("Missing or malformed bearer token",401,n);let c;try{c=await e.policy.verifyAccessToken(a)}catch{throw new h("Invalid bearer token",401,n)}let d=Array.isArray(c.audience)?c.audience:[c.audience];if(c.issuer!==e.policy.issuer||!d.includes(e.policy.resource))throw new h("Bearer token issuer or audience mismatch",401,n);let p=r.filter(f=>!c.scopes.includes(f));if(p.length>0)throw new h("Bearer token has insufficient scope",403,`${n}, scope="${p.join(" ")}"`);return{...c,audience:[...d],scopes:[...c.scopes]}}function BI(e){let t=zt("sha256").update(e.token).digest();return r=>{let n=zt("sha256").update(r).digest();if(!eh(t,n))throw new h("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]="cc0d4dd1-20e8-59d4-acb5-9f8ed639d35f")}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]="fa4eb88d-f50e-59fa-be7f-0cfb42931a73")}catch{}})();var w="https://schema.unbrained.dev/pm/corpus-shape/v1";function M(e,t){if(!Number.isSafeInteger(e)||e<=0)throw new TypeError(`Corpus shape ${t} must be a positive safe integer`);return e}function B(e,t){if(!Number.isSafeInteger(e)||e<0)throw new TypeError(`Corpus shape ${t} must be a non-negative safe integer`);return e}function Jt(e){if(!(typeof e!="object"||e===null||Object.isFrozen(e))){for(let t of Object.values(e))Jt(t);Object.freeze(e)}}function k(e){if(e.schema!==w)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(M(e.hierarchy_depth,"hierarchy_depth"),M(e.hierarchy_fanout,"hierarchy_fanout"),B(e.age_span_days,"age_span_days"),M(e.history_entries_per_item,"history_entries_per_item"),B(e.comments_per_100_items,"comments_per_100_items"),B(e.notes_per_100_items,"notes_per_100_items"),B(e.learnings_per_100_items,"learnings_per_100_items"),M(e.author_cardinality,"author_cardinality"),M(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 Jt(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}],N=Object.freeze({scratch:k({schema:w,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:w,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":k({schema:w,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":k({schema:w,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":k({schema:w,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 Th(){return Object.keys(N).sort().map(e=>N[e])}function Ch(e){let t=e.trim().toLowerCase();if(!Object.hasOwn(N,t))throw new TypeError(`Unknown corpus shape "${e}". Available: ${Object.keys(N).join(", ")}`);return N[t]}var Yt=new WeakMap;function Zt(e,t){if(e===0)return[];let r=Yt.get(t);r===void 0&&(r=t.edge_kind_mix.flatMap(o=>Array.from({length:o.weight},()=>o.kind)),Yt.set(t,r));let n=[r[e%r.length]];return t.include_cycles&&e>2&&e%17===0&&n.push("related"),[...new Set(n)]}function bh(e,t,r,n=42){if(B(t,"item index"),M(r,"item count"),t>=r)throw new RangeError(`Corpus item index ${t} exceeds ${r}`);let o=Math.min(e.component_count,r),i=t%o,s=Math.floor(t/o),a=0,c=1;for(let V=0;V<e.hierarchy_depth;V+=1)a=Math.min(Number.MAX_SAFE_INTEGER,a+c),c=Math.min(Number.MAX_SAFE_INTEGER,c*e.hierarchy_fanout);let d=s%a,p=s-d,f=d===0?void 0:i+(p+Math.floor((d-1)/e.hierarchy_fanout))*o,_=Date.UTC(2026,0,1),T=e.age_span_days*864e5,G=new Date(_+(r===1?0:Math.round(t/(r-1)*T))).toISOString(),$=(t*37+n)%100;return{index:t,id:`pm-s${t.toString(36).padStart(7,"0")}`,...f===void 0?{}:{parent:`pm-s${f.toString(36).padStart(7,"0")}`},component:i,timestamp:G,author:`pm-corpus-agent-${(t+n)%Math.min(e.author_cardinality,r)}`,history_entry_count:e.history_entries_per_item,dependency_kinds:Zt(t,e),has_comment:$<e.comments_per_100_items,has_note:$<e.notes_per_100_items,has_learning:$<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 Le=class{shape;authors=new Set;components=new Set;depths=new Map;childCounts=new Map;edgeKinds={};expectedEdgeKinds={};annotations={comments:0,notes:0,learnings:0};annotationFields;planMismatches=[];itemCount=0;observedDepth=0;observedFanout=0;historyEntryCount=0;firstTimestamp=null;lastTimestamp=null;constructor(t){this.shape=t,this.annotationFields=[["comments","has_comment",t.comments_per_100_items],["notes","has_note",t.notes_per_100_items],["learnings","has_learning",t.learnings_per_100_items]]}recordMismatch(t,r){t&&this.planMismatches.push(r)}recordEdgeKinds(t,r){for(let n of r)t[n]=(t[n]??0)+1}add(t){this.itemCount+=1,this.authors.add(t.author),this.components.add(t.component),this.recordMismatch(this.depths.has(t.id),`duplicate_id:${t.id}`);let r=1;if(t.parent!==void 0){let n=this.depths.get(t.parent);this.recordMismatch(n===void 0,`parent_missing:${t.parent}`),r=(n??0)+1;let o=(this.childCounts.get(t.parent)??0)+1;this.childCounts.set(t.parent,o),this.observedFanout=Math.max(this.observedFanout,o)}this.depths.set(t.id,r),this.observedDepth=Math.max(this.observedDepth,r),this.historyEntryCount+=t.history_entry_count,this.recordMismatch(t.history_entry_count!==this.shape.history_entries_per_item,"history_entries_per_item:drift"),this.firstTimestamp=this.firstTimestamp===null||t.timestamp<this.firstTimestamp?t.timestamp:this.firstTimestamp,this.lastTimestamp=this.lastTimestamp===null||t.timestamp>this.lastTimestamp?t.timestamp:this.lastTimestamp;for(let[n,o]of this.annotationFields)this.annotations[n]+=Number(t[o]);this.recordEdgeKinds(this.edgeKinds,t.dependency_kinds),this.recordEdgeKinds(this.expectedEdgeKinds,Zt(t.index,this.shape))}finish(){let t=Math.min(this.shape.author_cardinality,this.itemCount),r=Math.min(this.shape.component_count,this.itemCount),n=[...this.planMismatches,...this.itemCount===0?["item_count:empty"]:[],...this.authors.size===t?[]:[`author_count:${this.authors.size}!=${t}`],...this.components.size===r?[]:[`component_count:${this.components.size}!=${r}`],...this.observedDepth<=this.shape.hierarchy_depth?[]:[`hierarchy_depth:${this.observedDepth}>${this.shape.hierarchy_depth}`],...this.observedFanout<=this.shape.hierarchy_fanout?[]:[`hierarchy_fanout:${this.observedFanout}>${this.shape.hierarchy_fanout}`]];for(let[s,,a]of this.annotationFields){let c=Math.floor(this.itemCount/100),d=this.itemCount%100,p=c*a+Math.max(0,a+d-100),f=c*a+Math.min(a,d),_=this.annotations[s];(_<p||_>f)&&n.push(`${s}:${_}!in[${p},${f}]`)}let o=new Set([...Object.keys(this.edgeKinds),...Object.keys(this.expectedEdgeKinds)]);for(let s of[...o].sort()){let a=this.edgeKinds[s]??0,c=this.expectedEdgeKinds[s]??0;a!==c&&n.push(`edge_kind:${s}:${a}!=${c}`)}let i=[...new Set(n)];return{shape:this.shape.name,item_count:this.itemCount,author_count:this.authors.size,component_count:this.components.size,hierarchy_depth:this.observedDepth,hierarchy_fanout:this.observedFanout,timestamp_range:{first:this.firstTimestamp,last:this.lastTimestamp},history_entry_count:this.historyEntryCount,annotations:{...this.annotations},edge_kinds:{...this.edgeKinds},matches_declaration:i.length===0,mismatches:i}}};function Qt(e){return new Le(e)}function Ah(e,t){let r=Qt(e);for(let n of t)r.add(n);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]="cea03617-5e90-5683-a9d1-289087ed4646")}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]="8c9a34bd-b77a-55ab-a5d1-3594cecfeb3f")}catch{}})();async function Eh(){let e=me(process.cwd(),process.env.PM_PATH);await Je(e,(t,r)=>Ze(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]="f48b9002-59dc-54d3-95de-36bf0d11b39a")}catch{}})();var er="https://schema.unbrained.dev/pm/workspace-recipe/v1";function De(e,t){if(e===null||typeof e=="boolean"||typeof e=="string")return e;if(typeof e=="number"){if(!Number.isFinite(e))throw new Error(`Workspace recipe JSON number must be finite at ${t}`);return e}if(Array.isArray(e))return Object.freeze(e.map((r,n)=>De(r,`${t}[${n}]`)));if(typeof e!="object"||Object.getPrototypeOf(e)!==Object.prototype&&Object.getPrototypeOf(e)!==null)throw new Error(`Workspace recipe input must contain JSON values at ${t}`);return Object.freeze(Object.fromEntries(Object.entries(e).map(([r,n])=>[r,De(n,`${t}.${r}`)])))}function tr(e){if(e.schema!==er)throw new Error(`Unsupported workspace recipe schema: ${e.schema}`);let t=Ve(e);if(e.operations.some(r=>r.action.trim().length===0||r.input===null||Array.isArray(r.input)))throw new Error("Workspace recipe operations require an action and object input");return Object.freeze({...t,operations:Object.freeze(e.operations.map((r,n)=>Object.freeze({action:r.action,input:De(r.input,`operations[${n}].input`)})))})}async function rr(e,t){let r=tr(e);return Ke(r,t)}async function Sh(e,t){return rr(e,async()=>{let r=[];for(let[n,o]of e.operations.entries())r.push(await t(o,n));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]="a108f4d2-80c3-540e-821c-5acdf68eb7fa")}catch{}})();async function wh(){await Qe()}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="340305b6-e3c8-5daa-bfbe-4a9c62a6d039")}catch{}})();var nr=["lines","branches","functions","statements"];function xh(e,t){if(typeof t!="object"||t===null||Array.isArray(t))throw new TypeError(`Coverage entry for ${e} must be an object.`)}function Rh(e,t,r){if(typeof r!="object"||r===null||Array.isArray(r))throw new TypeError(`Coverage entry ${e} has invalid ${t} counts.`);let n=r;if(typeof n.covered!="number"||typeof n.total!="number"||!Number.isInteger(n.covered)||!Number.isInteger(n.total)||n.covered<0||n.total<n.covered)throw new TypeError(`Coverage entry ${e} has invalid ${t} counts.`);return{covered:n.covered,total:n.total}}function Oh(e){if(typeof e!="object"||e===null||Array.isArray(e))throw new TypeError("Coverage summary must be a JSON object.");if(!("total"in e))throw new TypeError("Coverage summary is missing the total entry.");let t=[];for(let[r,n]of Object.entries(e)){xh(r,n);for(let o of nr){let i=Rh(r,o,n[o]),s=i.total-i.covered;s>0&&t.push({file:r,metric:o,uncovered:s,...i})}}return t}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="3edb1f4f-d26e-51a8-b62a-caffdd3ac44b")}catch{}})();var Ih=["captured_redacted","captured_verbatim"],Ph=[{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 b(e){return typeof e=="string"&&e.trim().length>0}function Mh(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,n=[];r.boundary_id!==e.id&&n.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||!Ih.includes(r.capture_source)||!b(r.capture_provenance)||!Array.isArray(r.redactions)||!r.redactions.every(b)||!("input"in r)||!("observed"in r))&&n.push({boundary_id:e.id,kind:"invalid_fixture",detail:`${e.fixture_path} lacks captured provenance, redaction metadata, input, or observed output.`});let o=JSON.stringify(t);for(let i of Ph)i.pattern.test(o)&&n.push({boundary_id:e.id,kind:"unsafe_fixture",detail:`${e.fixture_path} contains a possible ${i.label}.`});return n}function kh(e,t){let r=Date.parse(e.waiver_expires_at),n=b(e.waiver_reason)&&b(e.waiver_owner)&&e.waiver_expires_at.endsWith("Z")&&We(e.waiver_expires_at)&&Number.isFinite(r);return{captured:0,waived:n&&r>=t?1:0,findings:n?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 Nh(e,t,r){if(!b(e.id)||!b(e.producer)||!b(e.consumer)||!b(e.format))return{captured:0,waived:0,findings:[{boundary_id:b(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 n=t[e.fixture_path],o=b(e.fixture_path)&&e.fixture_path in t?Mh(e,n):[{boundary_id:e.id,kind:"missing_fixture",detail:`Boundary ${e.id} fixture ${String(e.fixture_path)} is missing.`}];return{captured:o.length===0?1:0,waived:0,findings:o}}return kh(e,r)}function dP(e,t,r=new Date){let n=[];if(e.version!==1||!b(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 o=new Set,i=0,s=0;for(let a of e.boundaries){if(typeof a!="object"||a===null||Array.isArray(a)){n.push({boundary_id:"unknown",kind:"invalid_boundary",detail:"Each boundary must be a JSON object."});continue}let c=a,d=b(c.id)?c.id:void 0;if(d!==void 0&&o.has(d)){n.push({boundary_id:d,kind:"duplicate_boundary",detail:`Boundary ${d} is inventoried more than once.`});continue}d!==void 0&&o.add(d);let p=Nh(c,t,r.getTime());i+=p.captured,s+=p.waived,n.push(...p.findings)}return n.sort((a,c)=>a.boundary_id!==c.boundary_id?a.boundary_id.localeCompare(c.boundary_id):a.kind.localeCompare(c.kind)),{ok:n.length===0,boundary_count:e.boundaries.length,captured_count:i,waived_count:s,findings:n}}import v from"node:fs";import Fe 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]="611e9aba-d08e-5c1a-89c9-c7fda0cc9bc9")}catch{}})();var or=300*1e3,vh=3;function mP(e){return(e?.trim()||"development").replace(/[^a-zA-Z0-9._-]/g,"_").replace(/^\./,"_")}function _P(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.");v.mkdirSync(e,{recursive:!0});let n=Fe.join(e,r);v.mkdirSync(n,{recursive:!0});let o=new Date;v.utimesSync(n,o,o);let i=v.readdirSync(e).filter(d=>d!==r).flatMap(d=>{try{return[{name:d,mtimeMs:v.statSync(Fe.join(e,d)).mtimeMs}]}catch(p){if(p instanceof Error&&"code"in p&&K(p))return[];throw p}}).sort((d,p)=>p.mtimeMs-d.mtimeMs||d.name.localeCompare(p.name)),s=i.filter(d=>o.getTime()-d.mtimeMs<or),a=Math.max(0,vh-1-s.length),c=i.filter(d=>o.getTime()-d.mtimeMs>=or).slice(a).map(d=>d.name).sort((d,p)=>d.localeCompare(p));for(let d of c)v.rmSync(Fe.join(e,d),{recursive:!0,force:!0,maxRetries:3,retryDelay:50});return{retained:r,removed:c}}import ir from"node:fs";import se 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]="962636b0-ed3b-5ad0-ae0c-904435025986")}catch{}})();var ce="@unbrained/pm-cli",Lh=new Set(["append","claim","changelog","close","close-many","close-task","comments","config","copy","create","dedupe-merge","delete","deps","docs","extension","event","events","files","focus","gc","history-author-acknowledge","history-compact","history-redact","history-repair","init","install","item","learnings","meet","merge","normalize","notes","package","packages","pause-task","plan","profile","reindex","release","remind","restore","schema","start-task","test","test-all","test-runs","test-runs-worker","telemetry","templates","twin","update","update-many","upgrade","vcs","workspace"]),sr=new Set(["--author","--output-budget","--output-format","--output-include","--output-limit","--output-session","--path","--pm-path"]),Ue=/\b(\d{4})\.(\d{1,2})\.(\d{1,2})(?:-(\d+))?\b/u;function g(e,t){return e.some(r=>t.includes(r.split("=",1)[0]))}function Ge(e,t){return["activate","adopt","adopt-all","deactivate","init","install","migrate","reload","uninstall"].includes(t[0]??"")||g(e,["--activate","--adopt","--adopt-all","--deactivate","--fix-managed-state","--init","--install","--output","--reload","--scaffold","--uninstall"])}var Dh={changelog:(e,t)=>{if(t[0]==="generate")return!g(e,["--check"]);let r=e.indexOf("export");return t[0]==="export"&&(g(e,["--output"])||r>=0&&e[r+1]!==void 0&&!e[r+1].startsWith("-"))},comments:e=>g(e,["--add","--delete","--edit","--file","--stdin"]),config:(e,t)=>(t[0]==="project"||t[0]==="global"?t[1]:t[0])==="set",deps:()=>!1,docs:e=>g(e,["--add","--add-glob","--migrate","--remove"]),duplicates:()=>!1,events:()=>!1,extension:Ge,files:(e,t)=>g(e,["--add","--add-glob","--migrate","--remove"])||t[0]==="discover"&&g(e,["--apply"]),health:e=>!g(e,["--check-only","--no-refresh","--skip-vectors"]),learnings:e=>g(e,["--add","--delete","--edit","--file","--stdin"]),merge:(e,t)=>t[0]!=="report",notes:e=>g(e,["--add","--delete","--edit","--file","--stdin"]),package:Ge,packages:Ge,profile:(e,t)=>t[0]==="apply",schema:(e,t)=>["add-field","add-status","add-type","remove-field","remove-status","remove-type","remap-status","rename-field","rename-type"].includes(t[0]??"")&&!(g(e,["--infer"])&&!g(e,["--apply"])),telemetry:(e,t)=>t.slice(0,2).some(r=>["clear","flush"].includes(r)),templates:(e,t)=>t[0]==="save",test:e=>g(e,["--add","--add-json","--background","--measure","--remove","--resume","--run","--stop"]),validate:e=>g(e,["--auto-fix","--prune-missing"]),vcs:(e,t)=>["abandon","create","merge","propose","ref-create"].includes(t[0]??""),workspace:(e,t)=>t[0]==="snapshot"&&["create","delete","restore"].includes(t[1]??"")};function ae(e){let t=e.match(Ue);return t?[Number(t[1]),Number(t[2]),Number(t[3]),Number(t[4]??0)]:null}function ie(e,t){let r=ae(e),n=ae(t);if(!r||!n)return null;for(let o=0;o<r.length;o+=1){let i=r[o]-n[o];if(i!==0)return Math.sign(i)}return 0}function $e(e){try{let t=JSON.parse(ir.readFileSync(e,"utf8"));return typeof t=="object"&&t!==null&&!Array.isArray(t)?t:null}catch{return null}}function Fh(e){let t=[];for(let r of["dependencies","devDependencies","optionalDependencies","peerDependencies"]){let n=e[r];if(typeof n!="object"||n===null)continue;let o=n[ce],i=typeof o=="string"?o.trim():"",s=/^[<!]/u.test(i)?void 0:i.match(Ue)?.[0];s&&t.push(s)}return t.sort((r,n)=>ie(n,r))[0]}function Gh(e){let r=$e(se.join(e,"package-lock.json"))?.packages;if(typeof r!="object"||r===null)return;let n=r["node_modules/@unbrained/pm-cli"];if(typeof n!="object"||n===null)return;let o=n.version;return typeof o=="string"?o:void 0}function $h(e,t){try{let r=ir.readFileSync(se.join(e,t),"utf8").split(/\r?\n/u),n=r.findIndex(c=>c.includes(ce));if(n<0)return;let o=r[n].match(/^\s*/u)[0].length,i=[r[n]];for(let c=n+1;c<r.length;c+=1){let d=r[c],p=d.trim(),f=d.match(/^\s*/u)[0].length;if(p.length>0&&f<=o)break;i.push(d)}return i.join(`
3
- `).match(/^\s*version(?::\s*|\s+)["']?(\d{4}\.\d{1,2}\.\d{1,2}(?:-\d+)?)/mu)?.[1]??i[0].match(Ue)?.[0]}catch{return}}function Uh(e){let t=[],r=$e(se.join(e,"package.json")),n=r?Fh(r):void 0;n&&t.push({version:n,source:"package.json"});let i=$e(se.join(e,"node_modules","@unbrained","pm-cli","package.json"))?.version;typeof i=="string"&&ae(i)&&t.push({version:i,source:"installed-package"});let s=Gh(e);s&&ae(s)&&t.push({version:s,source:"package-lock.json"});for(let a of["pnpm-lock.yaml","yarn.lock"]){let c=$h(e,a);c&&t.push({version:c,source:a})}return t}function ar(e){for(let t=0;t<e.length;t+=1){let r=e[t];if(sr.has(r)){t+=1;continue}if(!r.startsWith("-"))return{command:r.toLowerCase(),index:t}}}function jh(e){let t=ar(e);if(!t||g(e,["--help","-h","--dry-run"]))return!1;let{command:r,index:n}=t,o=[];for(let s=n+1;s<e.length;s+=1){let a=e[s];if(sr.has(a)){s+=1;continue}a.startsWith("-")||o.push(a.toLowerCase())}let i=Dh[r];return i?i(e,o):Lh.has(r)}function Bh(e){let t=ar(e.argv)?.command,r=jh(e.argv),o=Uh(e.projectRoot).filter(a=>ie(a.version,e.executingVersion)!==null).sort((a,c)=>ie(c.version,a.version))[0],i=o!==void 0&&ie(e.executingVersion,o.version)===-1,s=i&&!r?{code:"project_runtime_stale_read",executing_version:e.executingVersion,project_version:o.version,source:o.source,message:"This read is using an older pm runtime than the project requires.",next_steps:[`Run the command through the project's installed ${ce} ${o.version}.`,"Install the project dependencies with its declared package manager if the local executable is missing."]}:void 0;return{compatible:!r||!i||e.allowStale===!0,executing_version:e.executingVersion,...o?{project_version:o.version,source:o.source}:{},...t?{command:t}:{},mutating:r,stale:i,...s?{warning:s}:{},override_applied:i&&r&&e.allowStale===!0}}function bP(e){let t=Bh(e);if(t.compatible)return t;throw new fe(`pm ${t.executing_version} cannot mutate a project pinned to newer pm ${t.project_version}.`,O.CONFLICT,{code:"project_runtime_stale_mutation",reason:t.source,why:"An older runtime can write storage, history, and merge contracts it does not understand.",nextSteps:[`Run this command through the project's installed ${ce} ${t.project_version}.`,"For an intentional recovery only, set PM_ALLOW_STALE_CLI=1 for this invocation and record why.","Read-only commands remain available without an override."]})}import{createHash as qh}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="4586a8b2-07c8-53d4-9c5d-ca557ee07977")}catch{}})();var je=1;function L(e){e?.throwIfAborted()}function x(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship graph ${t} must be non-empty`);return e.trim()}function D(e,t,r={}){let n=Date.parse(r.createdAt??new Date().toISOString());if(!Number.isFinite(n))throw new TypeError("Relationship graph createdAt must be a valid timestamp");let o=e.nodes(),i=e.edges(),s=t.list();return Object.freeze({version:je,fingerprint:qh("sha256").update(W({nodes:o,edges:i,kinds:s})).digest("hex"),created_at:new Date(n).toISOString(),nodes:o,edges:i,kinds:s})}function zh(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function z(e){if(!zh(e))throw new TypeError("Relationship graph snapshot must be an object");if(e.version!==je)throw new TypeError(`Unsupported relationship graph snapshot version: ${String(e.version)}`);if(!Array.isArray(e.nodes)||e.nodes.some(o=>typeof o!="string"))throw new TypeError("Relationship graph snapshot nodes must be strings");if(!Array.isArray(e.edges)||!Array.isArray(e.kinds))throw new TypeError("Relationship graph snapshot edges and kinds must be arrays");if(typeof e.created_at!="string"||!Number.isFinite(Date.parse(e.created_at)))throw new TypeError("Relationship graph snapshot created_at must be valid");if(typeof e.fingerprint!="string")throw new TypeError("Relationship graph snapshot fingerprint must be a string");let t=new _e([]);for(let o of e.kinds)t.register(o);let r=new I(e.nodes,e.edges,t),n=D(r,t,{createdAt:e.created_at});if(n.fingerprint!==e.fingerprint)throw new TypeError("Relationship graph snapshot fingerprint mismatch");return{snapshot:n,registry:t,graph:r}}async function E(e,t){x(e.name,"adapter name");let r=x(t.workspace,"workspace");L(t.signal);let n=await e.read({...t,workspace:r});return L(t.signal),n===null?null:z(n)}async function de(e,t){let r=x(t.workspace,"workspace"),n=z(t.snapshot).snapshot,o=await E(e,{workspace:r,signal:t.signal});if(o?.snapshot.fingerprint===n.fingerprint)return{adapter:e.name,workspace:r,disposition:"current",fingerprint:n.fingerprint,previous_fingerprint:o.snapshot.fingerprint,node_count:n.nodes.length,edge_count:n.edges.length};if(L(t.signal),await e.replace({workspace:r,signal:t.signal,snapshot:n,expected_fingerprint:o?.snapshot.fingerprint??null}),(await E(e,{workspace:r,signal:t.signal}))?.snapshot.fingerprint!==n.fingerprint)throw new Error(`Relationship graph adapter "${e.name}" did not expose the replaced snapshot`);return{adapter:e.name,workspace:r,disposition:"written",fingerprint:n.fingerprint,...o?{previous_fingerprint:o.snapshot.fingerprint}:{},node_count:n.nodes.length,edge_count:n.edges.length}}function Hh(e,t={}){let r=e.map(z),n=new Map;for(let s of r)for(let a of s.snapshot.kinds){let c=n.get(a.kind);if(c&&W(c)!==W(a))throw new TypeError(`Conflicting federated relationship kind: ${a.kind}`);n.set(a.kind,a)}let o=new _e([...n.values()].sort((s,a)=>s.kind.localeCompare(a.kind))),i=new I(new Set(r.flatMap(s=>[...s.snapshot.nodes])),r.flatMap(s=>[...s.snapshot.edges]),o);return D(i,o,t)}var q=class{name;#e=new Map;constructor(t="memory"){this.name=x(t,"adapter name")}async read(t){L(t.signal);let r=this.#e.get(x(t.workspace,"workspace"));return r?structuredClone(r):null}async replace(t){L(t.signal);let r=x(t.workspace,"workspace"),n=this.#e.get(r);if(t.expected_fingerprint!==void 0&&(n?.fingerprint??null)!==t.expected_fingerprint)throw new Error(`Relationship graph adapter conflict for ${r}`);this.#e.set(r,structuredClone(z(t.snapshot).snapshot))}async clear(t){L(t.signal);let r=x(t.workspace,"workspace"),n=this.#e.get(r);if(t.expected_fingerprint!==void 0&&(n?.fingerprint??null)!==t.expected_fingerprint)throw new Error(`Relationship graph adapter conflict for ${r}`);this.#e.delete(r)}};(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="423d6e5d-93e5-5f29-93e0-11ddca9c3156")}catch{}})();function cr(e,t){if(!Number.isInteger(e)||e<1)throw new TypeError(`Relationship graph ${t} must be a positive integer`);return e}function Vh(e){let t=cr(e.nodeCount,"nodeCount"),r=cr(e.edgeStride??1,"edgeStride"),n=e.topology??"chain";if(!["chain","star","disconnected"].includes(n))throw new TypeError(`Unsupported relationship graph topology: ${n}`);let o=(e.kind??"related").trim(),i=(e.idPrefix??"node").trim();if(!o||!i)throw new TypeError("Relationship graph kind and idPrefix must be non-empty");let s=n==="disconnected"?0:Math.floor((t-1)/r);return{node_count:t,edge_count:s,edge_basis:"fixture_generated",nodes:{*[Symbol.iterator](){for(let a=0;a<t;a+=1)yield`${i}-${a}`}},edges:{*[Symbol.iterator](){if(n!=="disconnected")for(let a=r;a<t;a+=r)yield{source:`${i}-${n==="star"?0:a-r}`,target:`${i}-${a}`,kind:o}}}}}function R(e,t){if(!e)throw new Error(`Relationship graph adapter conformance: ${t}`)}async function dr(e,t={}){let r=t.workspace?.trim()||"pm-graph-conformance",n=Xe(),o=D(new I(["a","b"],[{source:"a",target:"b",kind:"related"}],n),n,{createdAt:"2026-01-01T00:00:00.000Z"}),i=D(new I(["a","b","c"],[{source:"a",target:"b",kind:"related"},{source:"b",target:"c",kind:"blocked_by"}],n),n,{createdAt:"2026-01-02T00:00:00.000Z"}),s=[];R(await E(e,{workspace:r})===null,"workspace must start empty"),s.push({name:"empty-read",passed:!0});let a=await de(e,{workspace:r,snapshot:o});R(a.disposition==="written","first sync must write"),s.push({name:"atomic-replace",passed:!0}),(await e.read({workspace:r})).nodes.push("mutated-reader-copy"),R((await E(e,{workspace:r}))?.snapshot.nodes.length===2,"reads must not mutate stored state"),s.push({name:"read-isolation",passed:!0}),R((await de(e,{workspace:r,snapshot:o})).disposition==="current","identical sync must be idempotent"),s.push({name:"idempotent-sync",passed:!0}),await e.replace({workspace:r,snapshot:i,expected_fingerprint:o.fingerprint}),R((await E(e,{workspace:r}))?.snapshot.fingerprint===i.fingerprint,"replacement must become visible"),s.push({name:"replacement-visibility",passed:!0});let d=!1;try{await e.replace({workspace:r,snapshot:o,expected_fingerprint:o.fingerprint})}catch{d=!0}return R(d,"stale compare-and-swap must fail"),s.push({name:"stale-cas",passed:!0}),e.clear&&(await e.clear({workspace:r,expected_fingerprint:i.fingerprint}),R(await E(e,{workspace:r})===null,"clear must remove the workspace"),s.push({name:"clear",passed:!0})),{adapter:e.name,workspace:r,cases:Object.freeze(s),clear_supported:e.clear!==void 0}}function Kh(e){return dr(new q,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]="20842b89-cef6-542e-b069-76c22b340f1d")}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]="5133d678-01f4-5164-aea7-2cc5ed42dd58")}catch{}})();import{createHash as pr}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]="54a3448c-719c-5404-a9b9-c3072a2fdce2")}catch{}})();function ur(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship backfill ${t} must be non-empty`);return e.trim()}function KP(e,t){let r=ur(t.migrationId,"migrationId"),n=ur(t.author,"author"),o=Date.parse(t.timestamp);if(!Number.isFinite(o))throw new TypeError("Relationship backfill timestamp must be valid");let i=new Date(o).toISOString(),s=Ae(e,void 0,t.registry),a=s.graph.nodes(),c=s.graph.edges().map(_=>{let T=pr("sha256").update(JSON.stringify([r,_.kind,_.source,_.target,_.createdAt??null,_.author??null,_.payload??null])).digest("hex").slice(0,24);return Object.freeze({eventId:`backfill:${r}:${T}`,relationshipId:`migration:${r}:${T}`,action:"add",edge:_,author:n,timestamp:i,reason:`Backfill ${r} from legacy item metadata`})}),d=pr("sha256").update(JSON.stringify({migrationId:r,nodes:a,events:c})).digest("hex"),p=new Set([...t.existingEventIds??[]].filter(_=>typeof _=="string").map(_=>_.trim()).filter(Boolean)),f=c.filter(_=>!p.has(_.eventId));return Object.freeze({migration_id:r,fingerprint:d,nodes:a,events:Object.freeze(f),edge_count:c.length,skipped_existing_count:c.length-f.length,duplicate_dependency_rows:s.duplicateRows.length,dangling_reference_count:s.dangling.active.length+s.dangling.legacy_terminal.length})}import*as lr 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]="4f4e7daa-14aa-5dad-8a30-79a4d76159d4")}catch{}})();var H=["suggested_retry","candidate_command","example","next_step","migration_hint","restore_with"],Be={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"}},XP=Object.freeze(Object.keys(Be));function fr(e){if(Object.hasOwn(Be,e))return Be[e]}var Wh=new Set([..."=([{,:;!?&|+-*%^~<>","=>"]);function F(e,t){return e<t?-1:e>t?1:0}function Xh(e,t){let r=e[t],n=t+1,o="";for(;n<e.length&&e[n]!==r;)e[n]==="\\"?n+=2:(o+=e[n],n+=1);return e[n]===r&&(n+=1),{next:n,value:o}}function Yh(e){return e===void 0||e.kind==="punctuator"&&Wh.has(e.value)||e.kind==="identifier"&&["return","case","throw","else","yield"].includes(e.value)}function Jh(e,t){if(/\s/u.test(e[t]))return t+1;if(e.startsWith("//",t)){let r=e.indexOf(`
4
- `,t+2);return r===-1?e.length:r+1}if(e.startsWith("/*",t))return e.indexOf("*/",t+2)+2}function Zh(e,t,r){if(e[t]!=="/"||!Yh(r))return;let n=t+1,o=!1;for(;n<e.length;)if(e[n]==="\\")n+=2;else if(e[n]==="[")o=!0,n+=1;else if(e[n]==="]")o=!1,n+=1;else if(e[n]==="/"&&!o){for(n+=1;/[A-Za-z]/u.test(e.charAt(n));)n+=1;return n}else n+=1;return n}function Qh(e,t){let r=e[t];if(r==="'"||r==='"'||r==="`"){let o=Xh(e,t);return r==="`"?{next:o.next}:{next:o.next,token:{kind:"string",value:o.value,offset:t+1}}}if(/[A-Za-z_$]/u.test(r)){let o=t+1;for(;/[A-Za-z0-9_$]/u.test(e[o]??"");)o+=1;return{next:o,token:{kind:"identifier",value:e.slice(t,o),offset:t}}}let n=e.startsWith("=>",t)?"=>":r;return{next:t+n.length,token:{kind:"punctuator",value:n,offset:t}}}function eg(e){let t=[],r=0;for(;r<e.length;){let n=Jh(e,r);if(n!==void 0){r=n;continue}let o=Zh(e,r,t.at(-1));if(o!==void 0){r=o;continue}let i=Qh(e,r);i.token&&t.push(i.token),r=i.next}return t}var tg=new Set(["object","block","pattern"]),rg=new Set(["const","let","var"]),ng=new Set(["}",")","]"]),og=new Set(["=","(","[",",",":","?","return"]);function ig(e,t,r){if([...r].reverse().find(i=>tg.has(i.kind))?.kind==="pattern"||r.at(-1)?.kind==="paren"&&r.at(-1)?.parameter_list)return"pattern";let o=e[t-1];return o?.kind==="identifier"&&rg.has(o.value)?"pattern":o?.value==="=>"||o?.value===")"?"block":o&&og.has(o.value)?"object":"block"}function sg(e,t,r){let n=e[t];if(n.value==="{"){let a=ig(e,t,r);return{kind:a,...a==="object"?{member_start:!0,candidates:[]}:{}}}if(n.value==="[")return{kind:"array"};if(n.value!=="(")return;let o=e[t-1],i=e[t-2];return{kind:"paren",...o?.value==="function"||i?.value==="function"?{parameter_list:!0}:{}}}function ag(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 cg(e,t){return e[t+1]?.value===")"&&e[t+2]?.value==="=>"||e[t+1]?.value==="="}function dg(e){let t=eg(lr.stripTypeScriptTypes(e,{mode:"strip"})),r=[],n=[];for(let[o,i]of t.entries()){let s=n.at(-1),a=ag(s,i,t[o+1]);a&&s.candidates.push(a);let c=sg(t,o,n);if(c)n.push(c);else if(ng.has(i.value)){let d=n.pop();d?.kind==="object"&&!cg(t,o)&&r.push(...d.candidates)}else i.value===","&&s?.kind==="object"?s.member_start=!0:s?.kind==="object"&&i.value!==":"&&(s.member_start=!1)}return r}function pg(e){let t=[0];for(let r=0;r<e.length;r+=1)e[r]===`
5
- `&&t.push(r+1);return t}function ug(e,t){let r=0,n=e.length;for(;r<n;){let o=Math.floor((r+n)/2);e[o]<=t?r=o+1:n=o}return r}function YP(e){let t=[],r=[];for(let o of[...e].sort((i,s)=>F(i.path,s.path))){let i=pg(o.content),s;try{s=dg(o.content)}catch(a){r.push({kind:"invalid_source",subject:o.path,detail:`${o.path} could not be parsed for recovery producers: ${String(a)}.`});continue}for(let a of s){let c=a.field,d=ug(i,a.offset),p=fr(c);p?t.push({path:o.path,line:d,field:c,kind:p.kind}):/(?:retry_command|candidate_command|fallback_candidate|next_best_command|example|next_step|migration_hint|restore_with)/u.test(c)&&!/(?:_total|_truncated)$/u.test(c)&&r.push({kind:"unknown_recovery_field",subject:`${o.path}:${d}:${c}`,detail:`${c} resembles a recovery reference but has no typed field contract.`})}}let n=Object.fromEntries(H.map(o=>[o,t.filter(i=>i.kind===o).length]));for(let o of H)n[o]===0&&r.push({kind:"missing_kind_producer",subject:o,detail:`No source producer emits the ${o} recovery-reference kind.`});return t.sort((o,i)=>o.path!==i.path?F(o.path,i.path):o.line!==i.line?o.line-i.line:F(o.field,i.field)),r.sort((o,i)=>o.subject!==i.subject?F(o.subject,i.subject):F(o.kind,i.kind)),{ok:r.length===0,scanned_file_count:e.length,producer_count:t.length,producer_count_by_kind:n,producers:t,findings:r}}function JP(e,t){let r=[],n=(o,i)=>{if(Array.isArray(o)){o.forEach((s,a)=>n(s,[...i,String(a)]));return}if(!(typeof o!="object"||o===null))for(let[s,a]of Object.entries(o).sort(([c],[d])=>F(c,d))){let c=fr(s),d=c?.kind==="migration_hint"&&o.semantics==="behavior_preserving"?{...c,semantics:"behavior_preserving"}:c,p=[a].flat();d!==void 0&&p.forEach((f,_)=>{let T="nested_value_field"in d&&typeof d.nested_value_field=="string"?d.nested_value_field:void 0,G=T&&typeof f=="object"&&f!==null&&!Array.isArray(f)?f[T]:f;if(typeof G!="string"||G.trim().length===0)return;let $=[...i,s,String(_)].map(V=>encodeURIComponent(V)).join("/");r.push({id:`${e}:${d.kind}:${$}`,probe_id:e,kind:d.kind,semantics:d.semantics,value:G})}),n(a,[...i,s])}};return n(t,[]),r}function ZP(e,t){let r=e.flatMap(s=>(s.owned_states??[]).map(a=>({contract:s,state:a}))),n=[],o=new Map;for(let s of t){if(o.has(s.probe_id)){n.push({kind:"duplicate_probe",probe_id:s.probe_id,detail:`Observation ${s.probe_id} was supplied more than once.`});continue}o.set(s.probe_id,s)}let i=new Set(r.map(({state:s})=>s.probe_id));for(let{contract:s,state:a}of r){let c=o.get(a.probe_id);if(!c){n.push({kind:"missing_probe",probe_id:a.probe_id,detail:`No entrypoint observation was recorded for ${s.code}.`});continue}c.code!==s.code&&n.push({kind:"wrong_error_code",probe_id:a.probe_id,detail:`Expected ${s.code}; observed ${c.code}.`}),c.exit_class!==a.expected_exit_class&&n.push({kind:"wrong_exit_class",probe_id:a.probe_id,detail:`Expected ${a.expected_exit_class}; observed ${c.exit_class}.`}),a.entrypoints.includes(c.entrypoint)||n.push({kind:"wrong_entrypoint",probe_id:a.probe_id,detail:`Expected one of ${a.entrypoints.join(", ")}; observed ${c.entrypoint}.`})}for(let s of t)i.has(s.probe_id)||n.push({kind:"undeclared_probe",probe_id:s.probe_id,detail:`Observation ${s.probe_id} has no catalog declaration.`});return n.sort((s,a)=>s.probe_id!==a.probe_id?s.probe_id.localeCompare(a.probe_id):s.kind.localeCompare(a.kind)),{ok:n.length===0,declared_probe_count:r.length,observed_probe_count:t.length,findings:n}}function QP(e,t){let r=[],n=new Set,o=new Set;for(let c of e){if(n.has(c.id)){o.add(c.id),r.push({kind:"duplicate_obligation",reference_id:c.id,detail:`Recovery obligation ${c.id} was declared more than once.`});continue}n.add(c.id)}let i=new Map;for(let c of t){if(i.has(c.id)){r.push({kind:"duplicate_observation",reference_id:c.id,detail:`Recovery reference ${c.id} was observed more than once.`});continue}i.set(c.id,c),n.has(c.id)||r.push({kind:"undeclared_observation",reference_id:c.id,detail:`Recovery observation ${c.id} has no emitted obligation.`})}for(let c of e){if(o.has(c.id))continue;let d=i.get(c.id);d?d.reachable?d.semantics!==c.semantics&&r.push({kind:"wrong_semantics",reference_id:c.id,detail:`Recovery reference ${c.value} promised ${c.semantics}; proof demonstrated ${d.semantics}.`}):r.push({kind:"unreachable_reference",reference_id:c.id,detail:`Recovery reference ${c.value} did not reach its promised target.`}):r.push({kind:"missing_observation",reference_id:c.id,detail:`No reachability proof was recorded for ${c.kind} ${c.value}.`})}let s=H.map(c=>{let d=e.filter(f=>f.kind===c),p=d.filter(f=>!o.has(f.id)).map(f=>i.get(f.id)).filter(f=>f!==void 0);return{kind:c,declared:d.length,observed:p.length,passed:d.filter(f=>{let _=i.get(f.id);return!o.has(f.id)&&_?.reachable===!0&&_.semantics===f.semantics}).length}});r.sort((c,d)=>c.reference_id!==d.reference_id?c.reference_id.localeCompare(d.reference_id):c.kind.localeCompare(d.kind));let a=s.reduce((c,d)=>c+d.passed,0);return{ok:r.length===0,declared_reference_count:e.length,observed_reference_count:t.length,pass_fraction:n.size===0?1:a/n.size,coverage_by_kind:s,findings:r}}function lg(e,t){let r=new Map(H.map(i=>[i,new Set]));for(let i of t)r.get(i.kind).add(i.value);let n=H.map(i=>({kind:i,source_producers:e.producer_count_by_kind[i],runtime_values:r.get(i).size})),o=n.filter(({source_producers:i,runtime_values:s})=>i>0&&s===0).map(({kind:i})=>i);return{ok:e.ok&&o.length===0,source_producer_count:e.producer_count,runtime_value_count:n.reduce((i,{runtime_values:s})=>i+s,0),coverage_by_kind:n,missing_runtime_kinds:o}}var eM=lg;(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="a1efaf49-c6ca-53dd-8fad-eb2540c20cc8")}catch{}})();var rM=16,fg=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"]),mr=18,_r=Object.freeze([...fg,"manifest_unknown_key","no_version_bounds_declared"].sort((e,t)=>e.localeCompare(t)));function nM(e,t=mr){return{ok:e.executable_error_code_count>=t,baseline:t,actual:e.executable_error_code_count}}function oM(e,t=_r){let r=new Set(e.rows.filter(({disposition:o})=>o==="executable").map(({canonical_code:o})=>o)),n=t.filter(o=>!r.has(o));return{ok:n.length===0,required_canonical_codes:[...t],missing_required_canonical_codes:n}}function qe(e,t){let r=e.get(t);if(r)return r;let n={kinds:new Set,probeIds:new Set};return e.set(t,n),n}function iM(e,t,r){let n=new Map(e.map(p=>[p.code,p.canonical_code??p.code])),o=new Map,i=0,s=0;for(let p of e){let f=qe(o,p.canonical_code??p.code);for(let _ of p.owned_states??[])f.kinds.add("owned_state"),f.probeIds.add(_.probe_id)}for(let p of t){let f=n.get(p.error_code);if(f===void 0)continue;i+=1;let _=qe(o,f);_.kinds.add("closed_domain"),_.probeIds.add(p.probe_id)}for(let p of r){let f=n.get(p.error_code);if(f===void 0)continue;s+=1;let _=qe(o,f);_.kinds.add("grammar"),_.probeIds.add(p.probe_id)}let a=e.map(p=>{let f=p.canonical_code??p.code,_=o.get(f),T=[..._.probeIds].sort();return{code:p.code,canonical_code:f,disposition:T.length>0?"executable":"uncovered",evidence_kinds:[..._.kinds].sort(),probe_ids:T}}).sort((p,f)=>p.code<f.code?-1:1),c=a.filter(({disposition:p})=>p==="uncovered").map(({code:p})=>p),d=a.length-c.length;return{ok:c.length===0,catalog_error_code_count:a.length,executable_error_code_count:d,uncovered_error_code_count:c.length,coverage_fraction:a.length===0?1:d/a.length,closed_domain_probe_count:i,grammar_probe_count:s,uncovered_error_codes:c,rows:a}}function sM(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: ${mr}`,`- Required executable canonical codes: ${_r.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(`
6
- `)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="0ec8c375-e58e-5ce4-b0aa-8a8a4dfa0778")}catch{}})();function mg(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 _g(e){return[e.exit_code!==O.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 ${O.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."},...mg(e)]}function dM(e){let t=[],r=new Set,n=0;e.length===0&&t.push({code:"empty_corpus",probe_id:"corpus",detail:"At least one real refusal observation is required."});for(let o of e){if(r.has(o.probe_id)){t.push({code:"duplicate_probe",probe_id:o.probe_id,detail:`${o.probe_id} was supplied more than once.`});continue}r.add(o.probe_id);let i=t.length;for(let s of _g(o))s!==void 0&&t.push(s);t.length===i&&(n+=1)}return t.sort((o,i)=>o.probe_id!==i.probe_id?o.probe_id.localeCompare(i.probe_id):o.code.localeCompare(i.code)),{ok:t.length===0,probe_count:r.size,closed_probe_count:n,closure_fraction:r.size===0?0:n/r.size,findings:t}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="2e90ea29-2708-5af8-b390-599be97718e7")}catch{}})();var hr="not-a-declared-action";function hg(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 ze(e){return e.replaceAll(/[^a-z0-9]+/gu,"-").replaceAll(/^-|-$/gu,"")}function gM(e=Ce.filter(t=>et.some(r=>r.command===t.command&&r.disposition!=="package_owned"))){return e.flatMap(t=>t.slots.flatMap((r,n)=>{if(!r.required)return[];let o=t.command.split(" "),i=U(t.command).flatMap(a=>a.required?[a.flag,...a.value_name?["example"]:[]]:[]),s=Te.some(a=>a.command===t.command);return[{probe_id:`required-argument-${ze(t.command)}-${ze(r.name)}`,command:t.command,refusal_args:[...o,...t.slots.slice(0,n).map(a=>hg(t.command,a)),...i],recovery_args:[...o,"--help"],error_code:s&&!t.command.startsWith("assurance ")?"invalid_argument_value":/^extension (?:activate|adopt|deactivate|uninstall)$/u.test(t.command)?"missing_lifecycle_target":"missing_required_argument",missing_argument:r.name,missing_argument_index:n}]})).sort((t,r)=>t.probe_id.localeCompare(r.probe_id))}function gg(e){switch(e){case"assurance":case"workspace snapshot":return Te.filter(({parent:t})=>t===e).map(({action:t})=>t);case"graph":return he;case"merge":return ge;case"plan":return Ee;case"profile":return Se;case"schema":return rt;default:throw new Error(`Required positional action family ${e} has no authoritative value domain.`)}}function yM(e=Ce){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-${ze(t)}`,command:t,refusal_args:[...r,hr],recovery_args:[...r,"--help"],error_code:"unknown_subcommand",rejected_value:hr,allowed_values:[...gg(t)].sort()}}).sort((t,r)=>t.probe_id.localeCompare(r.probe_id))}function yg(e,t){let r=[...t].sort();return e.length===t.length&&[...e].sort().every((n,o)=>n===r[o])}function Tg(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&&!yg(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 TM(e,t){let r=new Map(e.map(s=>[s.probe_id,s])),n=new Map(t.map(s=>[s.probe_id,s])),o=[...e.flatMap(s=>Tg(s,n.get(s.probe_id))),...t.filter(s=>!r.has(s.probe_id)).map(s=>({code:"unexpected_refusal_probe",probe_id:s.probe_id,detail:`${s.probe_id} has no declared grammar refusal contract.`}))];o.sort((s,a)=>s.probe_id.localeCompare(a.probe_id)||s.code.localeCompare(a.code));let i=new Set(o.map(({probe_id:s})=>s));return{ok:o.length===0,probe_count:e.length,closed_probe_count:e.filter(({probe_id:s})=>!i.has(s)).length,findings:o}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="941a11a9-f756-56b3-9dc1-8afd78bc9328")}catch{}})();var He=[{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 bM(){return He.map(e=>({...e}))}function Cg(e,t){let r=[];t.error_code!==e.expected_error_code&&r.push({code:"error_code_mismatch",probe_id:e.probe_id,detail:`Expected ${e.expected_error_code}, received ${t.error_code}.`}),t.exit_code!==e.expected_exit_code&&r.push({code:"exit_code_mismatch",probe_id:e.probe_id,detail:`Expected exit ${e.expected_exit_code}, received ${t.exit_code}.`}),t.recovery_kind!==e.recovery_kind&&r.push({code:"recovery_kind_mismatch",probe_id:e.probe_id,detail:`Expected ${e.recovery_kind}, received ${t.recovery_kind}.`});let n=t.suggested_retry_args.indexOf("init"),o=n===0||n===2&&t.suggested_retry_args[0]==="--pm-path"&&t.suggested_retry_args[1]?.length>0;return e.recovery_kind==="initialize"&&!o&&r.push({code:"missing_init_recovery",probe_id:e.probe_id,detail:"Missing and uninitialized roots must emit a tokenized init retry."}),(t.unsafe_init_recommended||e.recovery_kind!=="initialize"&&t.suggested_retry_args.includes("init"))&&r.push({code:"unsafe_init_recovery",probe_id:e.probe_id,detail:"A tracker root that cannot be initialized safely must not recommend initialization."}),t.retry_succeeded||r.push({code:"retry_failed",probe_id:e.probe_id,detail:"The emitted retry or safe alternate-root recovery did not execute successfully."}),r}function AM(e){let t=new Map(e.map(o=>[o.probe_id,o])),r=[],n=0;for(let o of He){let i=t.get(o.probe_id);if(i===void 0){r.push({code:"missing_probe",probe_id:o.probe_id,detail:"No runtime observation was supplied for this contract."});continue}let s=Cg(o,i);r.push(...s),s.length===0&&(n+=1)}return r.sort((o,i)=>o.probe_id.localeCompare(i.probe_id)||o.code.localeCompare(i.code)),{ok:r.length===0,probe_count:He.length,closed_probe_count:n,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]="8320177c-e95d-5d14-a914-4ac37230c0b9")}catch{}})();var pe,bg=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 Ag(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=bg[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(e)?"linked-file-path":["comments","notes","learnings"].includes(e)?"entry-file-input":"plan-definition-file"}function ue(){if(pe!==void 0)return pe;let t=we.filter(({command:i})=>be(i)).flatMap(({command:i,family:s})=>bt(i,U(i)).map(a=>({command:i,family:s,concept:Ag(i,a.flag),flag:a.flag,aliases:Object.freeze([...a.aliases??[]]),value_kind:a.repeatable?"list":a.flag==="--limit"?"number":a.value_type}))),r=new Set(t.flatMap(i=>i.aliases.map(s=>`${i.command}:${s}`))),n=t.filter(i=>!r.has(`${i.command}:${i.flag}`)),o=new Map;for(let i of n){let s=o.get(i.concept)??new Set;s.add(i.value_kind),o.set(i.concept,s)}return pe=Object.freeze(n.map(i=>Object.freeze({...i,concept:o.get(i.concept)?.size===1?i.concept:`${i.concept}@${i.command}`}))),pe}function RM(){return Object.freeze(ue().map(e=>Object.freeze({command:e.command,canonical_flag:e.flag,accepted_spellings:Object.freeze([...new Set([e.flag,...e.aliases])].sort())})))}var gr=Object.freeze({init:30,config:35,extension:53,package:54,packages:54,install:26,upgrade:29,create:100,copy:24,focus:22,list:86,"list-all":85,"list-draft":84,"list-open":84,"list-in-progress":84,"list-blocked":84,"list-closed":84,"list-canceled":84,aggregate:37,context:45,ctx:45,get:30,graph:34,search:78,duplicates:24,eval:25,next:35,history:35,events:33,"history-redact":27,"history-repair":26,"history-compact":30,"history-author-acknowledge":28,merge:24,schema:40,profile:22,activity:35,restore:23,update:105,"update-many":140,close:31,"close-many":72,delete:24,append:24,comments:30,notes:34,learnings:26,files:39,docs:30,deps:32,plan:109,test:52,"test-all":40,telemetry:21,stats:29,health:36,validate:45,assurance:30,gc:22,workspace:23,contracts:29,claim:36,release:23,"start-task":23,"pause-task":23,"close-task":24,meet:33,event:33,remind:29,"test-runs-worker":25});function yr(){let e=new Map(Object.keys(gr).map(t=>[t,0]));for(let{command:t}of ue())e.set(t,Number(e.get(t))+1);return Object.freeze(Object.entries(gr).map(([t,r])=>Object.freeze({command:t,current:Number(e.get(t)),maximum:r})))}function Eg(e,t,r){for(let n of e)for(let o of n.aliases){let i=t.get(`${n.command}:${o}`);i===void 0||i.flag===n.flag||r.push({code:"alias_collision",command:n.command,detail:`${o} aliases ${n.flag} but is canonical for ${i.flag}.`})}}function Sg(e,t,r){let n=new Set(t.map(({command:o})=>o));for(let o of e.keys())n.has(o)||r.push({code:"missing_budget",command:o,detail:`${o} has canonical flags but no persisted budget.`});for(let o of t){let i=e.get(o.command)??0;i===0&&r.push({code:"stale_budget",command:o.command,detail:`${o.command} has a persisted budget but no canonical flags.`}),!(i<=o.maximum)&&r.push({code:"budget_exceeded",command:o.command,detail:`${i} canonical flags exceed the ratcheted maximum ${o.maximum}.`})}}function wg(e,t,r){let n=new Map(e.map(o=>[`${o.command}:${o.flag}`,o]));for(let o of t){let i=`${o.command}:${o.canonical_flag}`,s=n.get(i);if(!s){r.push({code:"removed_canonical_spelling",command:o.command,detail:`${o.canonical_flag} disappeared from the executable spelling inventory.`});continue}let a=new Set([s.flag,...s.aliases]);for(let c of o.accepted_spellings)a.has(c)||r.push({code:"removed_compatibility_spelling",command:o.command,detail:`${c} no longer resolves to ${o.canonical_flag}.`})}}function OM(e=ue(),t=yr(),r=[]){let n=[],o=new Map,i=new Map,s=new Map,a=new Map;for(let c of e){let d=`${c.command}:${c.flag}`;o.has(d)?n.push({code:"duplicate_canonical_flag",command:c.command,detail:`${c.flag} has more than one canonical row.`}):o.set(d,c),a.set(c.command,(a.get(c.command)??0)+1);let p=i.get(c.concept);p!==void 0&&p!==c.value_kind?n.push({code:"inconsistent_concept_kind",command:c.command,detail:`${c.concept} uses both ${p} and ${c.value_kind}.`}):i.set(c.concept,c.value_kind);let f=s.get(c.concept);f!==void 0&&f!==c.flag?n.push({code:"semantic_spelling_collision",command:c.command,detail:`${c.concept} is canonicalized by both ${f} and ${c.flag}.`}):s.set(c.concept,c.flag)}return Eg(e,o,n),Sg(a,t,n),wg(e,r,n),n.sort((c,d)=>c.command.localeCompare(d.command)||c.code.localeCompare(d.code)||c.detail.localeCompare(d.detail)),{ok:n.length===0,entry_count:e.length,budget_count:t.length,concept_count:new Set(e.map(({concept:c})=>c)).size,baseline_entry_count:r.length,findings:n}}function IM(){let e=ue(),t=yr(),r=new Map(t.map(({command:o})=>[o,"unknown"]));for(let{command:o,family:i}of e)r.set(o,i);return["# Generated flag lexicon budgets","","This file is generated by `listPmFlagLexicon()`. Compatibility aliases do not consume canonical budget.","","| Command | Capability family | Canonical flags | Maximum |","| --- | --- | ---: | ---: |",...t.map(({command:o,current:i,maximum:s})=>{let a=r.get(o);return`| \`${o}\` | ${a} | ${i} | ${s} |`}),""].join(`
7
- `)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="7fc669d4-1db2-5636-8304-2c111a684726")}catch{}})();function MM(e){return e}function kM(e){return e}function NM(e){return e}function vM(e){return e}function LM(e){return e}function DM(e){return e}function FM(e){return e}function GM(e){return e}function $M(e){return e}function UM(e){return e}function jM(e){return e}function BM(e){return e}function qM(e){return e}function zM(e){return{handled:!0,result:e}}function HM(){return{handled:!1}}function VM(e){return e}function KM(e){return e}function WM(e){return e}function XM(e){return e}function YM(e){return e}function JM(e){return e}function ZM(e){return e}function QM(e){return e}function ek(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]="5bbfab95-010d-5507-ab01-f8f43943d295")}catch{}})();function xg(e={},t={}){return new X(t).extension(void 0,{...e,migrate:!0})}function Rg(e={},t={}){return new X(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]="bca95ba2-258c-5be2-8428-dcb8dbc87ef0")}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]="c2063b82-58b6-54c9-baff-ca252cadf463")}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]="036baf5a-3ba9-55ea-a11b-d9e94a848b92")}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]="bfa96f97-ffdf-54f9-b632-006f5dfe2ee3")}catch{}})();export{JS as ACTIONABILITY_ORDERING_KINDS,ri as ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS,Js as ACTIVITY_FLAG_CONTRACTS,pn as AGENT_PROVENANCE_DIMENSIONS,Li as AGGREGATE_FLAG_CONTRACTS,bs as APPEND_FLAG_CONTRACTS,KS as ASSURANCE_ACTIONS,WS as ASSURANCE_DECLARATION_KINDS,GE as ASSURANCE_DOCUMENT_VERSION,js as ASSURANCE_FLAG_CONTRACTS,$E as ASSURANCE_GATE_TRIGGERS,UE as ASSURANCE_MEASUREMENT_SOURCE_KINDS,nS as ASSURANCE_PRESET_IDS,vE as AssuranceEvaluationRefusalError,NE as AssuranceMutationRefusalError,LE as AssuranceSourceResolutionError,Wr as BASELINE_ITEM_FORMAT_VERSION,Ih as BOUNDARY_FIXTURE_CAPTURE_SOURCES,dw as BRIEF_LIST_FIELDS,ln as BUILTIN_AGENT_PROVENANCE_ADAPTERS,N as BUILTIN_CORPUS_SHAPES,un as BUILTIN_HARNESS_SIGNAL_DESCRIPTORS,Sr as BUILTIN_ITEM_TYPE_VALUES,ut as BUILTIN_PROFILES,py as BUILTIN_RELATIONSHIP_KINDS,Qo as CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS,Ys as CALENDAR_FLAG_CONTRACTS,As as CLAIM_FLAG_CONTRACTS,_a as CLOSE_ACTION_OPTION_KEYS,Ts as CLOSE_FLAG_CONTRACTS,Cs as CLOSE_MANY_FLAG_CONTRACTS,Os as CLOSE_TASK_FLAG_CONTRACTS,Di as COMMENTS_FLAG_CONTRACTS,ny as COMMON_MUTATION_COMMAND_OPTION_KEYS,da as COMPLETION_FLAG_CONTRACTS,Pr as CONFIDENCE_TEXT_VALUES,Ji as CONFIG_FLAG_CONTRACTS,ei as CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS,Ow as CONTEXT_EVALUATION_METRIC_NAMES,Qs as CONTEXT_FLAG_CONTRACTS,at as CONTEXT_OUTPUT_VALUES,Nw as CONTEXT_PACKING_PROFILES,Sw as CONTEXT_RELEVANCE_SERVICE,Aw as CONTEXT_RELEVANCE_SIGNAL_NAMES,jw as CONTEXT_SIGNAL_SET_VERSION,Uw as CONTEXT_SIGNAL_STORE_FORMAT_VERSION,Bw as CONTEXT_SIGNAL_STORE_WARNING_DETAILS,ca as CONTRACTS_FLAG_CONTRACTS,Vs as COPY_FLAG_CONTRACTS,si as CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,ci as CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,ai as CREATE_COMMANDER_STRING_OPTION_CONTRACTS,kg as CREATE_DIRECT_CLOSE_REASON_DEFAULT,Bs as CREATE_FLAG_CONTRACTS,WC as CURRENT_HISTORY_ITEM_HASH_VERSION,Xr as CURRENT_ITEM_FORMAT_VERSION,Vw as ContextSignalStore,Lw as ContextUsageValidationError,xE as DEFAULT_AUTHOR_IDENTITY_VOCABULARY,wx as DEFAULT_CHILD_SAMPLE_LIMIT,cw as DEFAULT_COMPACT_LIST_FIELDS,Db as DEFAULT_DERIVED_INDEX_MINIMUM_ITEMS,Iu as DEFAULT_EVAL_QUERIES_RELATIVE_PATH,ax as DEFAULT_TERMINAL_TRANSITION_POLICY,Yw as DEFAULT_WORKSPACE_MEMORY_MINIMUM_ITEMS,US as DEFECT_ESCAPE_CLASSES,jS as DEFECT_GATE_EVIDENCE_DISPOSITIONS,Ss as DELETE_FLAG_CONTRACTS,Rr as DEPENDENCY_KIND_VALUES,ra as DEPS_FLAG_CONTRACTS,Ui as DOCS_FLAG_CONTRACTS,Gs as DUPLICATES_FLAG_CONTRACTS,oa as EVAL_FLAG_CONTRACTS,wu as EVAL_QUERY_SET_CONTRACT,xu as EVAL_QUERY_SET_EXAMPLE,Su as EVAL_QUERY_SET_SCHEMA_ID,Zs as EVENTS_FLAG_CONTRACTS,Ps as EVENT_FLAG_CONTRACTS,In as EXECUTABLE_COMMAND_ALIASES,O as EXIT_CODE,cs as EXTENSION_ACTIVATE_FLAG_CONTRACTS,as as EXTENSION_ADOPT_ALL_FLAG_CONTRACTS,_s as EXTENSION_ADOPT_FLAG_CONTRACTS,nE as EXTENSION_CAPABILITIES,Pg as EXTENSION_CAPABILITY_CONTRACT,Og as EXTENSION_CAPABILITY_CONTRACT_VERSION,Ig as EXTENSION_CAPABILITY_LEGACY_ALIASES,$r as EXTENSION_CAPABILITY_REGISTRATION_SURFACES,ms as EXTENSION_CATALOG_FLAG_CONTRACTS,ds as EXTENSION_DEACTIVATE_FLAG_CONTRACTS,ss as EXTENSION_DESCRIBE_FLAG_CONTRACTS,fs as EXTENSION_DOCTOR_FLAG_CONTRACTS,is as EXTENSION_EXPLORE_FLAG_CONTRACTS,Zi as EXTENSION_FLAG_CONTRACTS,es as EXTENSION_INIT_FLAG_CONTRACTS,ns as EXTENSION_INSTALL_FLAG_CONTRACTS,us as EXTENSION_MANAGE_FLAG_CONTRACTS,ps as EXTENSION_MIGRATE_FLAG_CONTRACTS,oE as EXTENSION_POLICY_MODES,iE as EXTENSION_POLICY_SURFACES,ls as EXTENSION_RELOAD_FLAG_CONTRACTS,aE as EXTENSION_SANDBOX_PROFILES,Qi as EXTENSION_SCOPE_FLAG_CONTRACTS,sE as EXTENSION_TRUST_MODES,os as EXTENSION_UNINSTALL_FLAG_CONTRACTS,dS as EXTERNAL_DEPENDENCY_SOURCE_KIND,pS as EXTERNAL_DEPENDENCY_SOURCE_KIND_ALIAS,$i as FILES_FLAG_CONTRACTS,Ks as FOCUS_FLAG_CONTRACTS,Ds as GC_FLAG_CONTRACTS,lw as GET_DEPTH_VALUES,ea as GET_FLAG_CONTRACTS,Ni as GLOBAL_FLAG_CONTRACTS,_c as GRAPH_DURABLE_CACHE_MIN_ITEMS,mc as GRAPH_DURABLE_CACHE_VERSION,na as GRAPH_FLAG_CONTRACTS,he as GRAPH_SUBCOMMAND_VALUES,ta as GUIDE_FLAG_CONTRACTS,$s as HEALTH_FLAG_CONTRACTS,Hi as HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS,hS as HISTORY_AUTHOR_ATTRIBUTION_BASELINE,pR as HISTORY_COMPACT_BULK_DEFAULT_MIN_ENTRIES,Vi as HISTORY_COMPACT_FLAG_CONTRACTS,ji as HISTORY_FLAG_CONTRACTS,qi as HISTORY_REDACT_FLAG_CONTRACTS,zi as HISTORY_REPAIR_FLAG_CONTRACTS,yu as INIT_AGENT_GUIDANCE_MODE_VALUES,Yi as INIT_FLAG_CONTRACTS,hs as INSTALL_FLAG_CONTRACTS,Ir as ISSUE_SEVERITY_VALUES,zs as ITEM_COMPLETE_FLAG_CONTRACTS,Xx as ITEM_LATEST_TIMESTAMP_FIELDS,Mg as ITEM_METADATA_KEY_ORDER,qs as ITEM_MUTATE_FLAG_CONTRACTS,Hs as ITEM_REOPEN_FLAG_CONTRACTS,wr as ITEM_TYPE_VALUES,Wx as ITEM_UNION_COLLECTION_FIELDS,Hw as JsonFileContextSignalStoreAdapter,Gi as LEARNINGS_FLAG_CONTRACTS,Hp as LINKED_TEST_ENV_NAME_PATTERN,Vp as LINKED_TEST_PM_CONTEXT_MODE_VALUES,zp as LINKED_TEST_PROTECTED_ENV_KEYS,Kp as LINKED_TEST_WORKSPACE_CONTEXT_MODE_VALUES,Jo as LIST_COMMANDER_STRING_OPTION_CONTRACTS,pw as LIST_COMMAND_DEFAULT_PROJECTIONS,dE as LIST_FILTER_EXTENSION_FLAG_DEFINITIONS,vi as LIST_FILTER_FLAG_CONTRACTS,hw as LIST_SORT_FIELDS,gw as LIST_SORT_ORDER_VALUES,Sx as MAX_CHILD_PROJECTION_ITEMS,Is as MEET_FLAG_CONTRACTS,Zx as MERGE_DRIVER_ARTIFACT_VALUES,Bi as MERGE_FLAG_CONTRACTS,ge as MERGE_SUBCOMMAND_VALUES,tR as MUTATION_EVENT_WIRE_BUDGET,q as MemoryRelationshipGraphAdapter,ti as NEXT_COMMANDER_STRING_OPTION_CONTRACTS,sa as NEXT_FLAG_CONTRACTS,xp as NEXT_OUTPUT_VALUES,Fi as NOTES_FLAG_CONTRACTS,ts as PACKAGE_FLAG_CONTRACTS,rs as PACKAGE_INIT_FLAG_CONTRACTS,Rs as PAUSE_TASK_FLAG_CONTRACTS,ma as PLAN_CREATE_METADATA_PARAMETER_KEYS,Xi as PLAN_FLAG_CONTRACTS,cu as PLAN_SHOW_DEPTH_VALUES,Ee as PLAN_SUBCOMMANDS,du as PLAN_TEMPLATE_NAMES,Ea as PM_CLI_EXPECTED_ERROR_NAME,vA as PM_CLI_GRAMMAR_CONTRACT,IA as PM_CLI_GRAMMAR_NOUNS,jn as PM_CLI_ONLY_TOOL_ACTION_WAIVERS,PA as PM_CLI_SHARED_VERBS,On as PM_COMMAND_ALIAS_CONTRACTS,we as PM_COMMAND_CAPABILITY_CONTRACTS,et as PM_COMMAND_DESTINATION_CONTRACTS,fx as PM_COMMAND_EXIT_CONTRACTS,lx as PM_COMMAND_EXIT_OUTCOME_CONTRACTS,io as PM_COMMAND_OUTPUT_BUDGET_CONTRACTS,ER as PM_COMMAND_OUTPUT_ENVELOPE_CONTRACTS,Ce as PM_COMMAND_POSITIONAL_CONTRACTS,ol as PM_COMMAND_VISIBILITY_CONTRACTS,uE as PM_COMPLETE_LIST_FINDING_CODES,gE as PM_CONTEXT_INTENTS_FILE,vC as PM_CONTEXT_INTENT_CONTRACTS,Gn as PM_CORE_COMMAND_NAMES,w as PM_CORPUS_SHAPE_SCHEMA,qn as PM_DEPRECATED_TOOL_ACTIONS,eo as PM_DIAGNOSTIC_DEGRADATION_STEPS,to as PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS,Qn as PM_DIAGNOSTIC_OUTPUT_CLASSES,zn as PM_DISCOVERABLE_TOOL_ACTIONS,CR as PM_ERROR_CODE_CATALOG,hR as PM_ERROR_CODE_EXIT_CLASS_CONTRACTS,nr as PM_EXACT_COVERAGE_METRICS,kn as PM_EXTENSION_CAPABILITY_CONTRACTS,$n as PM_EXTENSION_PACKAGE_ACTION_SUBCOMMANDS,vn as PM_EXTENSION_POLICY_MODE_CONTRACTS,Fn as PM_EXTENSION_POLICY_SURFACE_CONTRACTS,Dn as PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS,Nn as PM_EXTENSION_SERVICE_NAME_CONTRACTS,Ln as PM_EXTENSION_TRUST_MODE_CONTRACTS,ES as PM_GITATTRIBUTES_END,AS as PM_GITATTRIBUTES_START,wS as PM_GITATTRIBUTES_V2_END,SS as PM_GITATTRIBUTES_V2_START,Ia as PM_GITIGNORE_END,Oa as PM_GITIGNORE_START,Un as PM_ITEM_ACTION_SUBCOMMANDS,l as PM_MCP_ERROR_CODES,xI as PM_MCP_HTTP_PROTOCOL_VERSION,g_ as PM_MCP_INPUT_REQUEST_METHODS,YO as PM_MCP_LEGACY_PROTOCOL_VERSIONS,A as PM_MCP_META_KEYS,ul as PM_MCP_PROMPT_CONTRACTS,Y as PM_MCP_PROTOCOL_VERSION,pl as PM_MCP_RESOURCE_CONTRACTS,re as PM_MCP_SUBSCRIPTION_ID_META_KEY,xe as PM_MCP_SUPPORTED_PROTOCOL_VERSIONS,yI as PM_MCP_TASKS_EXTENSION,O_ as PM_MCP_TASK_STATUSES,cl as PM_MCP_TOOL_COMMAND_CONTRACTS,DT as PM_MODE_PAIRED_OUTPUT_PROJECTION_CONTRACTS,No as PM_MUTATION_ACTION_CONTRACTS,Zn as PM_OUTPUT_BUDGET_CLASSES,Jn as PM_OUTPUT_DEGRADATION_STEPS,bR as PM_OUTPUT_ENVELOPE_KINDS,ot as PM_PACKAGE_CONVENTIONAL_RESOURCE_ROOTS,nt as PM_PACKAGE_RESOURCE_KINDS,Te as PM_POSITIONAL_ACTION_CONTRACTS,Aa as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA,Ca as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION,AC as PM_READ_OUTPUT_COMPOSITION_OPTION_FLAGS,dC as PM_READ_OUTPUT_CONTINUATION_FINGERPRINT_POLICIES,TC as PM_READ_OUTPUT_DIMENSIONS,bC as PM_READ_OUTPUT_OPTION_FLAGS,mC as PM_READ_OUTPUT_SESSION_MAX_SEEN_ITEM_IDS,fC as PM_READ_OUTPUT_SESSION_MIN_TOKENS,CC as PM_READ_OUTPUT_SURFACES,EC as PM_READ_OUTPUT_SURFACE_CONTRACTS,LT as PM_READ_ROW_CONTRACTS,vT as PM_READ_ROW_JQ_SELECTOR,XP as PM_RECOVERY_REFERENCE_FIELDS,H as PM_RECOVERY_REFERENCE_KINDS,fg as PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE,_r as PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE_V2,rM as PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE,mr as PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE_V2,Ko as PM_REPRODUCIBLE_PROCESS_ENV,mx as PM_SUCCESS_EXIT_CODES,Bn as PM_TOOL_ACTIONS,ha as PM_TOOL_ACTION_PARAMETER_CONTRACTS,ba as PM_TOOL_PARAMETERS_SCHEMA,Ta as PM_TOOL_PARAMETERS_SCHEMA_MAJOR,ya as PM_TOOL_PARAMETERS_SCHEMA_VERSION,la as PM_TOOL_RESERVED_CUSTOM_FIELD_PROPERTIES,er as PM_WORKSPACE_RECIPE_SCHEMA,Wi as PROFILE_FLAG_CONTRACTS,yt as PROFILE_LINT_CODES,gt as PROFILE_LINT_DIMENSIONS,pt as PROFILE_NAMES,Se as PROFILE_SUBCOMMANDS,fe as PmCliError,X as PmClient,lE as PmCompleteListValidationError,h as PmMcpAuthorizationError,Et as PmMcpInputRequiredError,Ht as PmMcpIssuerCredentialStore,u as PmMcpProtocolError,St as PmMcpRequestStateReplayGuard,Lt as PmMcpSubscriptionRegistry,Ne as PmMcpTaskStore,ZT as QUERY_CURSOR_CONTRACT,ys as REINDEX_FLAG_CONTRACTS,Mb as REINDEX_LOCK_ID,je as RELATIONSHIP_GRAPH_SNAPSHOT_VERSION,ws as RELEASE_FLAG_CONTRACTS,Ms as REMIND_FLAG_CONTRACTS,Ye as RESERVED_ITEM_FIELD_NAMES,Es as RESTORE_FLAG_CONTRACTS,Or as RISK_VALUES,XA as RelationshipEventLog,YA as RelationshipEventStore,I as RelationshipGraph,_e as RelationshipKindRegistry,Ki as SCHEMA_FLAG_CONTRACTS,Zo as SEARCH_COMMANDER_STRING_OPTION_CONTRACTS,pE as SEARCH_EXTENSION_FLAG_DEFINITIONS,aa as SEARCH_FLAG_CONTRACTS,cp as SEMANTIC_ATTRIBUTION_LIMITS,vg as SETTINGS_DEFAULTS,vu as SNAPSHOT_SCHEMA,TS as SOURCE_CONTEXT_ACCESS_ENV,CS as SOURCE_CONTEXT_WRITE_OVERRIDE_ENV,xs as START_TASK_FLAG_CONTRACTS,Fs as STATS_FLAG_CONTRACTS,xr as STATUS_VALUES,ki as SUBCOMMAND_GLOBAL_FLAG_CONTRACTS,XC as SUPPORTED_HISTORY_ITEM_HASH_VERSIONS,Jg as SUPPRESS_HOST_OUTPUT_MARKER,vs as TELEMETRY_FLAG_CONTRACTS,kl as TELEMETRY_SUBCOMMANDS,Ns as TEST_ALL_FLAG_CONTRACTS,ks as TEST_FLAG_CONTRACTS,Ls as TEST_RUNS_FLAG_CONTRACTS,Rl as TEST_RUN_MEASUREMENT_LIMIT,xi as TOOL_ACTIVITY_OPTION_CONTRACTS,mi as TOOL_AGGREGATE_OPTION_CONTRACTS,Ai as TOOL_BULK_MUTATION_FILTER_OPTION_CONTRACT_SOURCE,wi as TOOL_CALENDAR_OPTION_CONTRACTS,Si as TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS,Ri as TOOL_CONTEXT_OPTION_CONTRACTS,Ti as TOOL_CREATE_OPTION_CONTRACTS,yi as TOOL_CREATE_OPTION_CONTRACT_SOURCE,Oi as TOOL_DEPS_OPTION_CONTRACTS,Ii as TOOL_GRAPH_OPTION_CONTRACTS,fi as TOOL_LIST_FILTER_OPTION_CONTRACTS,_i as TOOL_SEARCH_FILTER_OPTION_CONTRACTS,gi as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS,hi as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACT_SOURCE,Ei as TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS,bi as TOOL_UPDATE_OPTION_CONTRACTS,Ci as TOOL_UPDATE_OPTION_CONTRACT_SOURCE,Ng as TYPE_TO_FOLDER,Xg as UNKNOWN_SUBCOMMAND_COMPATIBILITY_CODES,di as UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,ui as UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,pi as UPDATE_COMMANDER_STRING_OPTION_CONTRACTS,Ws as UPDATE_FLAG_CONTRACTS,Xs as UPDATE_MANY_FLAG_CONTRACTS,gs as UPGRADE_FLAG_CONTRACTS,Us as VALIDATE_FLAG_CONTRACTS,ia as WORKSPACE_FLAG_CONTRACTS,mo as WORKSPACE_HISTORY_ID,Lu as WORKSPACE_SNAPSHOT_ACTIONS,Va as WorkspaceGraphCache,tE as WorkspaceTransactionInterruptedError,xa as _testOnly,bw as _testOnlyAggregateCommand,gu as _testOnlyConfigCommand,Ix as _testOnlyGetCommand,sd as _testOnlyHealthCommand,Au as _testOnlyInit,Tu as _testOnlyInitAgentGuidance,ZR as _testOnlyItemTransaction,iR as _testOnlyMutationEvents,ox as _testOnlyNextCommand,Hx as _testOnlySearchCommand,bx as _testOnlySimilarity,qu as _testOnlyTemplates,$d as _testOnlyValidateCommand,aS as acceptAssuranceProposals,Fd as acknowledgeLinkedTests,Lc as acknowledgeUnknownAuthorHistoryEvents,vc as acknowledgeUnknownAuthorHistoryEventsFromTransport,Fb as acquireItemMetadataDerivedIndexLock,ye as acquireLock,pO as activateExtensionForTest,wy as activateExtensions,dn as agentSessionEnvironment,Of as aggregate,hl as analyzeAgentProvenanceDescriptorCoverage,qS as analyzeDefectChangeRisk,ZA as analyzeGraphImpact,Da as analyzeHierarchyIntegrity,QA as analyzeKnowledgeGraph,yx as analyzePmCommandExitConformance,Hn as analyzePmToolActionParity,vS as analyzeReconciliationDiscard,JA as analyzeRelationshipExecution,ac as analyzeRelationshipSchedule,e_ as analyzeSdkActionCoverage,tt as analyzeSdkCliParameterCompleteness,Uf as append,fo as appendHistoryEntry,yo as appendWorkspaceAuditEvent,go as appendWorkspaceHistoryChange,tT as applyAcceptanceCriteriaMutations,iS as applyAssurancePreset,i_ as applyBootstrapPagerPolicy,$C as applyContextIntentProjection,wp as applyContextTagProjection,yw as applyFilterValueEcho,BA as applyHistoryPatch,l_ as applyInvocationAuthorOverride,ld as applyPathMigrations,MC as applyReadOutputDimensions,RC as applyReadOutputIncludeModes,hC as applyReadOutputSessionReferences,Jy as applyRegisteredItemFieldDefaultsAndValidation,hd as applyStandaloneNote,ed as applyStoredExtensionMigrationState,nT as applyTagRemovals,ux as applyTerminalOrderingPolicy,gd as artifactKey,$g as asRecordClone,Gg as asRecordOrNull,Ae as assembleWorkspaceRelationshipGraph,hE as assertCompleteListResult,zO as assertExtensionBlueprint,qO as assertExtensionCapabilityUsage,wO as assertExtensionDeactivated,KO as assertExtensionManifestCompatible,VO as assertExtensionManifestMatchesBlueprint,WO as assertExtensionPreflight,$a as assertHierarchyMutationAllowed,uR as assertHistoryCompactTarget,DS as assertHistoryRepairTarget,Io as assertInitializedTracker,fd as assertLinkedArtifactMutationIsUnambiguous,ZO as assertMcpClientCapabilities,JO as assertMcpProtocolHeader,Kh as assertMemoryRelationshipGraphAdapterConformance,sT as assertNoUnknownCsvKeys,xO as assertPackageManifest,fb as assertParentReferenceIsNotSelf,HO as assertProjectProfile,bP as assertProjectRuntimeCompatibility,FT as assertProjectionModeChoice,Oo as assertReadableTrackerRoot,RO as assertRegisteredCommandContract,FO as assertRegisteredCommandOverride,NO as assertRegisteredExporter,OO as assertRegisteredFlags,IO as assertRegisteredHook,kO as assertRegisteredImporter,vO as assertRegisteredItemField,LO as assertRegisteredItemType,BO as assertRegisteredMigration,GO as assertRegisteredParserOverride,$O as assertRegisteredPreflightOverride,DO as assertRegisteredProfile,UO as assertRegisteredRendererOverride,PO as assertRegisteredSearchProvider,jO as assertRegisteredServiceOverride,MO as assertRegisteredVectorStoreAdapter,my as assertRelationshipEdgeAllowed,dr as assertRelationshipGraphAdapterConformance,jE as assuranceAssertionUpdateIsLoosening,BC as attachContextIntentReceipt,Nd as attachLinkedTestMutationProvenance,kd as attachLinkedTestProvenance,Oe as attachMcpServerInfo,qT as attachOutputOmissionReceipt,zC as attachOutputTokenAccounting,qC as attachReadOutputContracts,gC as attachReadOutputSessionReceipt,Uc as auditMergeAttributeFence,xS as auditMergeDriverConfiguration,lc as auditWorkspaceRelationshipGraph,jI as authorizeMcpHttpRequest,sn as boundAgentEpisodeIdentity,aC as boundReadOutputRows,bp as buildChildrenByParent,Nx as buildCompactSearchFilterSummary,Tw as buildContentFilterEcho,zw as buildContextSignalSnapshot,bh as buildCorpusShapeItemPlan,BS as buildDefectRecurrenceIndex,Yc as buildExtensionDescribeResult,Cw as buildGovernanceMissingFilterEcho,bb as buildInvalidTypeError,xx as buildItemChildrenRollup,YR as buildItemCompletionMutations,Ew as buildItemContextRelevanceCandidates,qb as buildItemNotFoundError,Ox as buildItemSchedule,kI as buildMcpAuthorizationDiscoveryUrls,__ as buildMcpCompleteResult,eI as buildMcpDiscoverResult,FI as buildMcpDynamicRegistrationMetadata,SI as buildMcpHttpRequestHeaders,iI as buildMcpInputRequiredResult,MI as buildMcpProtectedResourceMetadata,Gc as buildMergeAttributePatterns,ga as buildPmActionToolInputSchema,iM as buildPmRefusalClosureCensus,mS as buildRelationshipContext,Wb as buildSearchCorpus,Yb as buildSemanticCorpusInput,Ro as buildTrackerInitializationRecovery,rA as buildVectorizationEmbeddingIdentity,nA as buildVectorizationEmbeddingMetadata,vx as buildVerboseSearchFilters,Jw as buildWorkspaceMemorySnapshot,on as canonicalDocument,oy as canonicalizeCommandOptionKey,uy as canonicalizeRelationshipKind,YP as censusPmRecoveryReferenceProducers,_E as certifyCompleteListResult,cO as checkExtensionManifestCompatibility,Em as claim,Sm as claimNext,gS as classifyHistoryAuthorEvent,sR as classifyHostEnvironmentFault,Bx as classifyImplicitSemanticFallbackReason,Zr as classifyItemFormatVersion,Ll as classifyLinkedTestFailure,By as clearActiveExtensionHooks,Cc as clearDurableGraphCache,IT as clearFocusedItem,ka as clearWorkspaceContractsCache,Am as close,kp as closeItem,km as closeTask,c_ as coalesceRepeatedListFlags,ZS as collectBlockedByIds,ew as collectBlockedByIdsFromCorpus,qa as collectDanglingDependencyReferences,rw as collectDependencyBlockedIds,ja as collectDuplicateDependencyRows,uc as collectDuplicateRelationshipEdgeGroups,jx as collectErrorCauseCodes,La as collectHierarchyRelations,jt as collectMcpHeaderAnnotations,za as collectMissingDependencyTargetIds,$p as collectNewOrderingCycleWarnings,cc as collectOrderingCycles,Ba as collectOrderingStorageContradictions,CE as collectPackageContextIntentContracts,st as collectPackageExtensionDirectories,Xy as collectRegisteredItemFieldNames,bT as collectRuntimeCreateFieldValues,Ab as collectRuntimeFilterValues,AT as collectRuntimeUpdateFieldValues,hp as collectSubtreeIds,Ur as collectUsedExtensionCapabilities,iy as commandOptionFlagLabel,Mf as comments,pf as commitImportedItem,JR as commitItemCompletion,XR as commitItemMutations,rE as commitWorkspaceTransaction,Mi as compactFlagAliasContracts,gp as compareCriticalItems,ie as comparePmDateVersions,eE as compareRelationshipSnapshots,Ug as compareTimestampStrings,ME as compileHistoryProvenanceMatcher,FC as composeContextIntentContracts,tO as composeExtension,aO as composeExtensionPackage,nw as computeActionabilityReport,sb as computeHistoryDiff,ic as computeRelationshipCentrality,oc as computeRelationshipDominators,Ha as computeWorkspaceGraphFingerprint,Bf as config,jy as consumeAfterCommandAffectedItems,Af as context,jC as contextIntentRowId,xm as copy,Dl as countFailureCategories,iC as countReadOutputRows,Tm as create,oS as createAssurancePreset,$S as createAssuranceWorkspaceContext,Bg as createCheckpointId,fE as createCompleteListOptions,xy as createCoreCommandHookContext,Qt as createCorpusShapeMeasurement,VE as createEmptyAssuranceDocument,hy as createEmptyExtensionRegistrationRegistry,Ra as createExtensionCommandSdk,Gr as createExtensionContributionInventory,XO as createExtensionTestHarness,lo as createHistoryEntry,TA as createLazyModule,BI as createMcpStaticBearerVerifier,TI as createMcpTaskStore,Bb as createMutationGuardSdk,GT as createOutputOmissionReceipt,Sa as createPmCliExpectedError,f_ as createPmCliProgram,no as createPmCommandOutputBudget,HT as createQueryFingerprint,Vh as createRelationshipGraphScaleFixture,D as createRelationshipGraphSnapshot,Xe as createRelationshipKindRegistry,Xo as createReproducibleProcessRunner,Lx as createSearchCursorFingerprint,Ry as createSerialQueue,lT as createStdinTokenResolver,Yg as createUnknownSubcommandError,Du as createWorkspaceSnapshot,uO as deactivateExtensionForTest,HM as declineServiceOverride,UC as decodeContextIntentCursor,yA as decodeHtmlEntitiesInOptions,Ut as decodeMcpHttpHeaderValue,XT as decodeQueryCursor,KT as decodeQueryCursorEnvelope,WT as decodeQueryCursorState,lC as decodeReadOutputContinuationCursor,Td as dedupeLinkedArtifacts,ww as defaultScoreContextCandidates,JM as defineAfterCommandHook,XM as defineBeforeCommandHook,YM as defineBeforeMutationHook,NM as defineCommand,UM as defineCommandOverride,k as defineCorpusShape,WM as defineExporter,QR as defineExtension,eO as defineExtensionBlueprint,MM as defineExtensionManifest,vM as defineFlag,KM as defineImporter,DM as defineItemField,LM as defineItemType,FM as defineMigration,ek as defineOnIndexHook,QM as defineOnReadHook,ZM as defineOnWriteHook,jM as defineParserOverride,oo as definePmCommandOutputBudget,AR as definePmCommandOutputEnvelope,gR as definePmErrorCodeCatalog,BM as definePreflightOverride,kM as defineProjectProfile,VM as defineRendererOverride,GM as defineSearchProvider,qM as defineServiceOverride,$M as defineVectorStoreAdapter,tr as defineWorkspaceRecipe,Rm as deleteItem,Bu as deleteWorkspaceSnapshot,_y as dependencyToRelationship,Gf as deps,sS as deriveAssuranceProposals,nO as deriveExtensionCapabilities,Tx as derivePmBulkMutationEffect,JP as derivePmRecoveryReferenceObligations,zc as deriveSchemaEvolutionMigrationId,uA as deriveTelemetryCommandResolution,xb as describeAllowedTransitions,yS as describeExtensionActivation,oO as describeExtensionBlueprint,Qd as describeItemOwnershipConflict,_t as describeProfileComposition,ht as describeProjectProfile,NR as describeUnknownError,Tn as detectAgentIdentity,En as detectHarnessIdentity,rc as detectRelationshipCommunities,Cn as diagnoseAgentIdentity,fc as diffRelationshipAuditSnapshots,Pl as diffTestRunMeasurements,cI as digestMcpRequestParameters,Ey as discoverExtensions,Nr as discoverNearbyPmRoot,Uh as discoverProjectRuntimeVersionPins,Ff as docs,Pf as duplicates,hc as durableGraphCachePath,bc as durableGraphCacheStatus,Yr as effectiveItemFormatVersion,OA as emitTelemetryErrorEvent,df as emptyImportedDocument,$t as encodeMcpHttpHeaderValue,VT as encodeQueryCursor,uC as encodeReadOutputContinuationCursor,ab as enforceHistoryStreamPolicyForItem,cb as enforceHistoryStreamPolicyForItems,mR as enrichCliFlagInvocationContract,bt as enrichCliFlagInvocationContracts,zA as ensureMaterializedHistoryTarget,Ma as ensurePmGitignore,ad as ensureScope,pA as ensureSentryInit,cf as ensureTrackerInitialized,ec as enumerateRelationshipPaths,ao as estimatePmOutputTokens,WE as evaluateAssuranceAssertion,XE as evaluateAssuranceGate,dP as evaluateBoundaryFixtures,Iw as evaluateContextRanking,zS as evaluateDefectGateEvidence,KE as evaluateMeasurement,Lo as evaluateMutationGuard,Al as evaluateProvenanceCoverage,Tl as evaluateSemanticAttributionCoverage,qp as evaluateSimilarityGovernance,wb as evaluateTransition,Jb as executeEmbeddingBatchesWithRetry,eA as executeVectorDelete,tA as executeVectorReset,Qb as executeVectorUpsert,Sh as executeWorkspaceRecipe,_d as expandAddGlobEntries,wd as explainSourceTraceability,Nm as extension,Lm as extensionActivate,Dm as extensionDeactivate,vm as extensionList,xg as extensionMigrate,GI as extractMcpTraceContext,UA as extractPatchFailureContext,Id as extractReferencedPmItemIdsFromCommand,Hh as federateRelationshipGraphSnapshots,vf as files,Lf as filesDiscover,Df as filesLookup,Oh as findCoverageDeficits,Bp as findDuplicateClusters,Fc as findGitWorkspaceRoot,Wc as findInstalledNpmPackageCandidate,nc as findRedundantRelationshipEdges,sc as findRelationshipCutStructure,jp as findSimilarItems,RA as finishTelemetryCommand,Kg as flattenFlagListValue,wh as flushTelemetryQueue,Im as focus,tc as forEachMatchedRelationshipEdge,pc as formatDuplicateEdgeGroup,Fa as formatHierarchyRelation,dc as formatOrderingStorageContradiction,NA as formatPmPositionalActionFlagTip,tl as formatProfileApplyHuman,el as formatProfileLintHuman,Zu as formatProfileListHuman,Qu as formatProfileShowHuman,Kc as formatSchemaEvolutionMigrationHuman,zx as formatVectorIndexRecoveryWarnings,fm as gc,wo as generateItemId,xf as get,Gy as getActiveCommandResult,LC as getActiveContextIntentContracts,Br as getActiveExtensionRegistrations,UI as getActiveMcpTraceContext,JE as getAssuranceDeclaration,Ym as getContracts,RT as getFocusedItem,Dr as getHistoryPath,WA as getItemAt,Lr as getItemPath,Go as getMutationActionContract,Pa as getPmGitignoreBlock,vr as getSettingsPath,Xm as getWorkspaceContracts,_o as getWorkspaceHistoryPath,$f as graph,gc as graphAuditBaselinePath,Cl as groupHistoryByEpisode,zM as handleServiceOverride,QO as hasMcpClientExtension,be as hasSubcommandFlagContractsForCommand,oA as hasVectorizationEmbeddingIdentityChanged,iA as hasVectorizationVectorDimensionChanged,YC as hashDocument,JC as hashDocumentForVersion,ZC as hashEmptyDocument,lm as health,Ya as hierarchyAncestors,Ja as hierarchyDescendants,gm as historyCompact,ym as historyCompactBulk,PE as historyEntryMatchesProvenance,mm as historyRedact,_m as historyRepair,hm as historyRepairAll,QS as indexBlockedByIds,Ga as indexHierarchyRelations,sA as inferConsistentVectorDimension,ro as inferPmOutputBudgetClass,jf as init,mE as inspectCompleteListResult,gy as inspectExtensionManifestSchema,Ic as inspectHistoryAuthorStream,Bh as inspectProjectRuntimeCompatibility,Ho as inspectStaleInProgressItems,ho as inspectWorkspaceHistoryState,Fu as inspectWorkspaceSnapshot,qc as installMergeFence,tI as interpretMcpResultType,Op as isAlreadyClaimedError,DR as isCommanderError,Wd as isErrnoError,uS as isExternalDependencySourceKind,K as isFileMissingError,Qg as isHostOutputSuppressed,m as isMcpRecord,Do as isMutationAction,fy as isOrderingRelationshipKind,ub as isPlaceholderReferenceToken,wa as isPmCliExpectedError,Kn as isPmExtensionCapabilityContract,Xn as isPmExtensionPolicyModeContract,Yn as isPmExtensionPolicySurfaceContract,Wn as isPmExtensionServiceNameContract,hx as isPmKnownExitCode,wR as isPmMutationReceipt,_x as isPmSuccessfulExitCode,Vn as isPmToolAction,jh as isProjectMutatingInvocation,CA as isPureSnakeCaseAlias,kC as isReadOutputBudgetExceeded,UT as isReadRowContract,Oc as isRuntimeRecord,EA as isTerminalPlanMode,ST as isTerminalStatus,Er as isTimestampLiteral,KR as itemDocumentToMutationOptions,Rx as itemHasSchedule,$o as jaccardSimilarity,Nf as learnings,Wg as levenshteinDistanceWithinLimit,Hd as limitAnnotationEntries,vd as linkedTestTrustFingerprint,iO as lintExtensionBlueprint,yy as lintExtensionManifestSchema,Tt as lintProjectProfile,Ef as list,mn as listAgentProvenanceAdapters,a_ as listAliasPluralKeys,Sf as listAllComplete,Ub as listAllDocumentCandidatesCached,ko as listAllItemMetadata,jb as listAllItemMetadataLight,YE as listAssuranceDeclarations,rS as listAssuranceVerdicts,Th as listBuiltinCorpusShapes,UR as listCoreClosedDomainContracts,fw as listGetProjectionFields,OS as listInvalidProvenanceHistoryStreamIds,uw as listListProjectionFields,MS as listMergeReceipts,Fo as listMutationActions,rR as listMutationEvents,yr as listPmCommandFlagBudgets,al as listPmCommandsForFamily,sl as listPmCommandsForTier,ue as listPmFlagLexicon,RM as listPmFlagSpellingInventory,dl as listPmMcpToolsForProfile,gM as listPmRequiredArgumentRefusalContracts,yM as listPmSubcommandRefusalContracts,mt as listProfiles,bM as listTrackerPreflightRecoveryContracts,Gu as listWorkspaceSnapshots,bE as loadContextIntentRuntimeLayers,zu as loadCreateTemplateOptions,Sy as loadExtensions,Ec as loadGraphAuditBaseline,zg as loadMutationCheckpoint,E as loadRelationshipGraphAdapter,Po as locateItem,iT as looksLikeGenericKeyValueEntry,sC as mapReadOutputRows,kS as markMergeReceiptReconciled,Eb as matchesRuntimeFilters,wA as maybeRunFirstUseTelemetryPrompt,Ah as measureCorpusShapePlan,rT as mergeAdditiveTags,rO as mergeExtensionBlueprints,Vx as mergeHistoryStreams,Yx as mergeItemDocuments,Jx as mergeJsonDocuments,d_ as mergeLinkedTestTwoTokenEntries,Kx as mergeRelationshipEventStreams,Ep as mergeSortedWarnings,AA as migrateItemFilesToFormat,Hb as mutateItem,zb as mutateItemWithHistoryContext,To as mutateWorkspaceJsonWithHistory,Rf as next,hn as normalizeAgentProvenanceAdapterValue,zd as normalizeAnnotationTransportOptions,FE as normalizeAssuranceEvaluation,DE as normalizeAssuranceMutation,p_ as normalizeBootstrapInvocation,hT as normalizeBulkIdsValue,Ua as normalizeDependencyGraphTarget,fS as normalizeDependencySeedId,lS as normalizeDependencySourceKind,Fr as normalizeExtensionContributionInventory,RS as normalizeInvalidHistoryProvenance,IR as normalizeItemAddressInvocation,Jr as normalizeItemFormatVersion,So as normalizeItemId,tn as normalizeItemMetadata,s_ as normalizeLegacyExtensionActionSyntax,md as normalizeLinkedPath,pb as normalizeParentReferenceValue,lt as normalizeProfileName,Eo as normalizeRawItemId,OC as normalizeReadOutputIncludeModeOptions,rb as normalizeReplayPatchOps,Uo as normalizeSimilarityText,ET as normalizeStatusForRegistry,en as normalizeStatusInput,TT as normalizeStatusInputWithRegistry,LR as normalizeThrownExitCode,kf as notes,Ar as nowIso,yc as openDurableGraphCache,aI as openMcpRequestState,Za as orderingPredecessors,Qa as orderingSuccessors,vw as packContextCandidates,yp as packRankedContextItems,Vm as packageActivate,Hm as packageCatalog,Km as packageDeactivate,qm as packageDescribe,jm as packageDoctor,$m as packageInstall,Fm as packageLifecycle,Gm as packageList,Bm as packageManage,Rg as packageMigrate,zm as packageReload,Um as packageUninstall,JT as paginateQueryRows,cd as parseAddEntries,dd as parseAddGlobEntries,Kd as parseAnnotationTextInput,zR as parseAtomicMutationControls,o_ as parseBootstrapCommandName,t_ as parseBootstrapGlobalOptions,n_ as parseBootstrapHelpRequest,u_ as parseBootstrapTypeValue,_T as parseBulkIdsText,mp as parseContextDepth,pp as parseContextFocusFields,yE as parseContextIntentDeclarations,_p as parseContextSections,qw as parseContextSignalSnapshot,oT as parseCsvKv,VS as parseDefectChangeRiskRequest,HS as parseDefectRecurrencePolicy,Ru as parseEvalQuerySet,xc as parseGraphSubcommand,OE as parseHistoryProvenanceFilters,EE as parseIntegerLimit,wT as parseItemDocument,HR as parseItemMutationBatch,Cb as parseLimit,ru as parseLinkedTestAssertionEqualsMap,nu as parseLinkedTestAssertionGteMap,Yp as parseLinkedTestBoolean,Jp as parseLinkedTestContextMode,Xp as parseLinkedTestEnvClear,Wp as parseLinkedTestEnvSet,ou as parseLinkedTestJsonEntries,tu as parseLinkedTestMinLines,eu as parseLinkedTestRegexList,Qp as parseLinkedTestStringList,Zp as parseLinkedTestWorkspaceContextMode,C_ as parseMcpCachePolicy,m_ as parseMcpImplementation,Me as parseMcpInputRequests,Ot as parseMcpInputResponses,z_ as parseMcpSubscriptionFilter,ud as parseMigrateEntries,ow as parseMultiValueFilter,xR as parseMutationReceipt,mT as parseOptionalNonNegativeInteger,fT as parseOptionalNumber,SE as parsePriority,aw as parsePriorityFilterSet,_C as parseReadOutputSession,Yy as parseRegisteredItemFieldAssignments,z as parseRelationshipGraphSnapshot,pd as parseRemoveEntries,Sd as parseSourceLineRange,hb as parseStatusFilterCsv,iw as parseStringFilterSet,Hr as parseTags,Ol as parseTestRunMeasurements,wE as parseType,sw as parseTypeFilterSet,Nc as parseUnknownAuthorHistoryEventCoordinates,ix as partitionDecisionEntries,ib as patchPathToChangedField,Tr as pathExists,Mm as pauseTask,Tc as persistDurableGraphResult,Rb as persistSelectedItemFormat,kx as planAgentIdentityVocabularyMutation,Xw as planCompletedAtBackfill,Ct as planProfileApplication,KP as planRelationshipEventBackfill,wc as planRelationshipRemediation,Hc as planSchemaEvolutionMigration,Mc as planUnknownAuthorHistoryAcknowledgment,$u as planWorkspaceSnapshotRestore,DA as positionalShapeKey,FA as positionalSignatureKey,dO as preflightExtension,Bo as prepareSimilarityText,cT as preserveMutationStdinTokenFields,aT as preserveMutationStdinTokenLiterals,KC as printError,VC as printResult,sm as profile,dm as profileApply,pm as profileLint,am as profileList,cm as profileShow,Uy as projectAfterCommandItemSnapshot,up as projectContextFocusRows,xl as projectFleetAttributionAnalytics,IE as projectHistoryProvenance,po as projectPmDiagnosticOutput,uo as projectPmDiagnosticText,Sl as projectProvenanceCoverageAnalytics,Gd as projectValidateCounts,cS as promoteAssuranceAssertion,_P as pruneCompileCacheGenerations,ZE as putAssuranceDeclaration,QE as putAssuranceDeclarationBundle,Nb as queryItemMetadataIndex,vb as queryLinkedFileMetadataIndex,Lb as querySimilarItemMetadataIndex,Il as queryTestRunMeasurementsBelow,xn as quoteCommandArg,wn as quoteWindowsCommandArg,$R as rankCommandPaths,Vd as readAnnotationEntries,bn as readAuthorEnvironment,Bl as readBooleanOption,$w as readContextUsageAffinity,ql as readCsvListOption,Qc as readExtensionMigrationState,Cr as readFileIfExists,ni as readFirstStringFromCommanderOptions,oi as readFirstValueFromCommanderOptions,bl as readHistoryAnalyticsWindow,kT as readHistoryEntries,ml as readImprovementLedger,Gb as readItemMetadataDerivedIndexState,Mo as readLocatedItem,oC as readOutputBudgetCollections,pC as readOutputCollectionFingerprint,nC as readOutputContinuationRowCollections,tC as readOutputContinuationRowPaths,xC as readOutputIncludeModeOptions,rC as readOutputRowCollections,eC as readOutputRowPaths,yC as readOutputSessionRemainingTokens,it as readPmPackageManifest,Jm as readRequiredString,xo as readSettings,Ob as readSettingsWithMetadata,ii as readStringArrayFromCommanderOptions,jl as readStringOption,vR as readThrownExitCode,aA as readVectorizationStatusLedger,TE as readWorkspaceContextIntentContracts,Kw as readWorkspaceContextSignals,Zw as readWorkspaceMemory,jr as reconcileExtensionCapabilityUsage,bo as reconcileWorkspaceJsonHistory,$y as recordAfterCommandAffectedItem,tS as recordAssuranceVerdict,ip as recordClaimSemanticAttribution,Dw as recordContextUsageServing,Fw as recordContextUsageTouch,Gw as recordContextUsageTouches,ap as recordFocusSemanticAttribution,fl as recordImprovementObservation,sp as recordReleaseSemanticAttribution,$b as refreshItemMetadataDerivedIndex,jc as refreshMergeAttributeFenceIfInstalled,dA as refreshSearchArtifactsForMutation,_n as registerAgentProvenanceAdapters,fn as registerHarnessSignalDescriptors,NT as registerOutputMaterialFieldGroups,wm as release,eS as removeAssuranceDeclaration,br as removeFileIfExists,Ad as renameArtifactsResultKey,tp as renderCalendarMarkdown,rp as renderCalendarToon,Sp as renderContextMarkdown,Jc as renderExtensionDescribeMarkdown,Xc as renderExtensionSurfaceMarkdown,ff as renderGuideMarkdown,kR as renderMissingOptionRetry,sx as renderNextMarkdown,jR as renderPmClosedDomainHelp,Rn as renderPmCommand,Mn as renderPmCommandAliasMigrationHint,ll as renderPmCommandVisibilityMarkdown,IM as renderPmFlagLexiconMarkdown,sM as renderPmRefusalClosureCensusMarkdown,yb as renderRowsAsCsv,Tb as renderRowsAsTable,bm as reopen,qA as replayHistoryToTarget,eb as replayToCanonicalItemDocument,QC as replayToItemDocument,dx as requireTerminalReason,px as requireTerminalReasonWithRecovery,Ly as resetActiveExtensionRuntimeState,Wa as resetWorkspaceGraphCache,an as resolveAgentSessionContextFromSignals,Zd as resolveAnnotationIndex,Xd as resolveAnnotationInput,MT as resolveAuthor,Sn as resolveAuthorIdentity,db as resolveBodyFileContent,Ch as resolveBuiltinCorpusShape,ep as resolveCalendarOutputFormat,yR as resolveCanonicalPmErrorCodeContract,ly as resolveCanonicalRelationshipKind,PT as resolveClaimPrincipal,gT as resolveCliBulkIdsInput,cy as resolveCommandOptionPolicyState,mP as resolveCompileCacheGeneration,Ww as resolveCompletionTimestamp,ry as resolveConfiguredPmPackageRoot,_w as resolveContentFieldFilters,GC as resolveContextIntentContract,lp as resolveContextOutputFormat,fp as resolveContextTokenBudget,Ax as resolveCreateExplicitEmptyFlag,Vb as resolveEmbeddingProviders,nd as resolveExtensionInstallSourceIdentity,Zc as resolveExtensionMigrationStatePath,Ay as resolveExtensionRoots,Vg as resolveFlagValueKind,uf as resolveGuideOutputFormat,_l as resolveHistoryEpisodeGroupIdentity,RE as resolveHistoryProvenanceDimensions,HA as resolveHistorySubject,jA as resolveHistoryTarget,$x as resolveHybridSemanticWeight,kr as resolveImplicitPmRoot,jg as resolveIsoOrRelative,tw as resolveItemBlockers,VR as resolveItemMutationDocument,Mr as resolveItemTypeRegistry,yT as resolveItemTypesFilePath,Fl as resolveLinkedTestFailureExitCode,Pd as resolveLinkedTestSourceRef,Md as resolveLinkedTestSourceWorkspaceRoot,Ld as resolveLinkedTestTrust,Dd as resolveLinkedTestTrustBatch,H_ as resolveMcpAcknowledgedSubscriptionFilter,Re as resolveMcpRequestContext,Dc as resolveMergeInstallContext,mw as resolveMissingMetadataFilters,MR as resolveMissingOptionPlaceholder,$T as resolveModePairedOutputOmissionReceipt,nx as resolveNextOutputFormat,BT as resolveOutputOmissionReceipt,ty as resolvePmCliVersion,Pn as resolvePmCommandAlias,nl as resolvePmCommandCapabilityFamily,gx as resolvePmCommandExitContract,so as resolvePmCommandOutputBudget,SR as resolvePmCommandOutputEnvelope,MA as resolvePmCommandPositionalContract,il as resolvePmCommandVisibilityTier,co as resolvePmDiagnosticOutputBudget,TR as resolvePmErrorCodeContract,Ag as resolvePmFlagSemanticConcept,ey as resolvePmPackageRootFromModule,kA as resolvePmPositionalActionContract,pa as resolvePmPositionalActionFlagContracts,me as resolvePmRoot,fa as resolvePmToolCustomFieldCollision,mb as resolvePriority,ft as resolveProfile,$c as resolveProjectMergeTypeFolders,YT as resolveQueryCursorStart,IC as resolveReadOutputDimensions,NC as resolveReadOutputEncoding,cC as resolveReadOutputRecoveryBudget,SC as resolveReadOutputSurface,jT as resolveReadRowContract,PR as resolveRecoveryCommandName,Zy as resolveRegisteredSearchProvider,Qy as resolveRegisteredVectorStoreAdapter,Wo as resolveReproducibleProcessEnvironment,Kr as resolveRuntimeFieldRegistry,Vr as resolveRuntimeStatusRegistry,Kb as resolveSearchCorpusFields,Fx as resolveSearchMaxResults,Dx as resolveSearchPage,Gx as resolveSearchScoreThreshold,Ux as resolveSearchTuning,Xb as resolveSemanticCorpusCharacterLimit,op as resolveSemanticLineageIds,Pb as resolveSettingsWithSemanticRuntimeDefaults,bS as resolveSourceContextWritePolicy,rl as resolveStartTaskInProgressStatus,U as resolveSubcommandFlagContractsForCommand,Lg as resolveTelemetryErrorCategory,cx as resolveTerminalReason,ay as resolveTypeDefinition,sy as resolveTypeName,gb as resolveTypeSynonym,Sb as resolveTypeWorkflows,kc as resolveUnknownAuthorAcknowledgmentSelector,qx as resolveVectorIndexRecovery,Zb as resolveVectorStores,va as resolveWorkspaceRelationshipKindRegistry,Om as restore,Hg as restoreCheckpointItems,Ao as restoreWorkspaceJsonFromHistory,ju as restoreWorkspaceSnapshot,Uu as restoreWorkspaceSnapshotWithRecovery,Qm as runAction,qy as runActiveBeforeMutationHooks,Hy as runActiveCommandHandler,zy as runActiveOnIndexHooks,zr as runActiveOnReadHooks,qr as runActiveOnWriteHooks,Vy as runActiveParserOverride,Ky as runActivePreflightOverride,Wy as runActiveServiceOverride,Na as runActivity,by as runAfterCommandHooks,Bd as runAggregate,Jd as runAnnotationCommand,qd as runAppend,XS as runAssuranceAction,YS as runAssuranceDispatch,Cy as runBeforeCommandHooks,np as runCalendar,Ip as runClaim,Pp as runClaimNext,Np as runClose,Lp as runCloseMany,Dp as runComments,mf as runCompletion,hu as runConfig,ct as runContext,kw as runContextEvaluationCorpus,Pw as runContextEvaluationScenario,uu as runCopy,iu as runCreate,lu as runDelete,Xa as runDeps,Ed as runDocs,RR as runDuplicates,Pu as runEval,ku as runEvent,od as runExtension,rd as runExtensionMigrateAction,td as runExtensionMigrations,xd as runFiles,Od as runFilesDiscover,Rd as runFilesLookup,wl as runFleetAttributionAnalytics,fu as runFocus,_u as runGc,mu as runGet,Rc as runGraph,lf as runGuide,id as runHealth,Cx as runHistory,dR as runHistoryCompact,lR as runHistoryCompactBulk,VA as runHistoryRedact,LS as runHistoryRepair,FS as runHistoryRepairAll,Eu as runInit,Cu as runInitAgentGuidance,Fp as runLearnings,bd as runLinkedArtifacts,Gl as runLinkedTests,jd as runList,Mu as runMeet,Qx as runMergeDriver,Bc as runMergeInstall,NS as runMergeReceiptReport,eR as runMergeReconcile,Rp as runNext,Gp as runNotes,pu as runPlan,Ju as runProfileApply,Yu as runProfileLint,Wu as runProfileList,Xu as runProfileShow,El as runProvenanceCoverageAnalytics,lO as runRegisteredCommandForTest,gO as runRegisteredCommandOverrideForTest,SO as runRegisteredExporterForTest,mO as runRegisteredHookForTest,EO as runRegisteredImporterForTest,AO as runRegisteredMigrationForTest,fO as runRegisteredMutationGuardForTest,_O as runRegisteredParserOverrideForTest,hO as runRegisteredPreflightOverrideForTest,yO as runRegisteredRendererOverrideForTest,CO as runRegisteredSearchProviderForTest,TO as runRegisteredServiceOverrideForTest,bO as runRegisteredVectorStoreAdapterForTest,At as runReindex,Mp as runRelease,Nu as runRemind,fR as runReopen,vp as runRestore,Vc as runSchemaEvolutionMigration,Ou as runSearch,Eh as runSearchRefreshWorkerEntrypoint,_f as runStartBackgroundRun,Ml as runStats,Nl as runTelemetry,Vu as runTemplatesList,Hu as runTemplatesSave,Ku as runTemplatesShow,$l as runTest,Ul as runTestAll,hf as runTestRunsList,yf as runTestRunsLogs,Cf as runTestRunsResume,gf as runTestRunsStatus,Tf as runTestRunsStop,bf as runTestRunsWorker,su as runUpdate,au as runUpdateMany,dt as runUpgrade,Ud as runValidate,Zm as runWithActiveExtensions,cn as runWithAgentSessionContext,DC as runWithContextIntentContracts,AE as runWithDiscoveredContextIntentContracts,gn as runWithHarnessDetectionSignals,$I as runWithMcpTraceContext,Yo as runWithReproducibleProcessEnvironment,yn as runWithWorkspaceHarnessSignalDescriptors,rr as runWithWorkspaceRecipe,Px as runWorkspaceTransactionGc,Sc as saveGraphAuditBaseline,_S as scanExtensionHostVersions,Pc as scanHistoryAuthorAttribution,Qr as scanItemFormatVersions,vo as scanMutationSecrets,IS as scanProvenanceResolverHealth,Vo as scanStaleInProgressItems,GS as scanStorageIntegrity,qf as schema,Yf as schemaAddField,Wf as schemaAddStatus,Vf as schemaAddType,em as schemaApplyPreset,tm as schemaInferTypes,zf as schemaList,Zf as schemaListFields,om as schemaRemapStatus,Jf as schemaRemoveField,Xf as schemaRemoveStatus,Kf as schemaRemoveType,nm as schemaRenameField,rm as schemaRenameType,Hf as schemaShow,Qf as schemaShowField,im as schemaShowStatus,GR as scoreCommandPathMatch,xw as scoreContextCandidates,Rw as scoreContextCandidatesWithActiveExtensions,qo as scoreItemSimilarity,TM as scorePmGrammarRefusalClosure,dM as scorePmRefusalClosure,zo as scorePreparedItemSimilarity,AM as scoreTrackerPreflightRecoveryClosure,sI as sealMcpRequestState,wf as search,tx as searchWorkspaceMemory,rx as searchWorkspaceMemoryReadResult,zT as selectCursorSemanticOptions,af as selectImportAuthor,vI as selectMcpClientRegistrationMode,ex as selectWorkspaceMemory,Qw as selectWorkspaceMemoryRollups,dp as semanticAttributionAffinity,_A as sentryCaptureCliError,mA as sentryFinishCommandSpan,gA as sentryFlush,hA as sentryLogCliUsageError,lA as sentrySetCommandContext,fA as sentryStartCommandSpan,nn as serializeItemDocument,BR as serializeNdjsonRows,qR as serializeNdjsonStream,Dy as setActiveCommandContext,Fy as setActiveCommandResult,Iy as setActiveExtensionCommands,Oy as setActiveExtensionHooks,Py as setActiveExtensionParsers,My as setActiveExtensionPreflight,vy as setActiveExtensionRegistrations,Ny as setActiveExtensionRenderers,ky as setActiveExtensionServices,OT as setFocusedItem,SA as shouldCompletePlanOnClose,Ac as shouldPersistDurableGraphCache,uT as shouldResolveMutationStdinTokenField,pT as shouldResolveMutationStdinTokens,kb as shouldRunSearchRefreshInForeground,Up as similarityAdvisoryWarnings,QT as sliceReadOutputRowCollection,yd as sortLinkedArtifacts,eT as splitAcceptanceCriteria,bA as splitCommaList,rn as splitFrontMatter,PC as stabilizeReadOutputReceiptEstimates,W as stableStringify,Ty as stableValueEquals,Pm as startTask,xA as startTelemetryCommand,If as stats,CT as statusIsTerminal,r_ as stripGlobalBootstrapTokens,nR as subscribeMutationEventBatches,oR as subscribeMutationEvents,Mx as summarizeAgentIdentityVocabulary,gl as summarizeAgentModelProvenance,yl as summarizeAgentProvenance,Mw as summarizeContextEvaluationReports,vl as summarizeContextPreflight,kE as summarizeHistoryProvenance,bu as summarizeInitResult,PS as summarizeMergeReceipt,Ex as supportsCreateExplicitEmpty,OR as supportsItemIdAlias,Zg as suppressHostOutput,de as syncRelationshipGraphAdapter,sO as synthesizeExtensionManifest,ua as toCompletionFlagString,Ap as toContextFocusItem,Tp as toContextPackingSummary,Cp as toContextRankingSummary,Fg as toErrorMessage,Hl as toEstimatedMinutesValue,cE as toExtensionFlagDefinitions,Yl as toImportBoolean,ef as toImportConfidence,Xl as toImportInteger,of as toImportLinkedDocs,nf as toImportLinkedFiles,sf as toImportLinkedTests,rf as toImportLogEntries,tf as toImportNormalizedEnum,Ql as toImportNumberMap,Vl as toImportPriority,Wl as toImportStatus,Jl as toImportStringList,Zl as toImportStringMap,Kl as toImportTags,xT as toItemRecord,zl as toNonEmptyImportString,Dg as toNonEmptyStringOrUndefined,tb as toReplayDocument,jo as tokenizeSimilarityText,dT as transferMutationStdinTokenPolicy,aR as translateHostEnvironmentFault,Cm as update,Wm as upgrade,um as validate,qE as validateAssertionDefinition,HE as validateAssuranceDocument,zE as validateGateDefinition,WR as validateItemMutationRows,Cd as validateLinkedPaths,LI as validateMcpAuthorizationResponseIssuer,NI as validateMcpAuthorizationServerMetadata,DI as validateMcpClientMetadataDocument,wI as validateMcpHttpRequestHeaders,pI as validateMcpJsonSchema,BE as validateMeasurementDefinition,lb as validateMissingParentReference,wC as validateReadOutputOptions,_b as validateSprintOrReleaseValue,dy as validateTypeOptions,_R as verifyCliFlagInvocationParity,LA as verifyExplicitPositionalSlotCensus,ob as verifyHistoryChain,nb as verifyHistoryChainWithVersion,KA as verifyHistoryEntries,$A as verifyPmCliGrammar,GA as verifyPmCommandPositionalContracts,OM as verifyPmFlagLexicon,eM as verifyPmRecoveryKindRuntimeCoverage,lg as verifyPmRecoveryProducerRuntimeCoverage,QP as verifyPmRecoveryReferences,oM as verifyPmRefusalClosureIdentityRatchet,nM as verifyPmRefusalClosureRatchet,ZP as verifyPmRefusalReachability,li as verifyToolOptionCliParity,Pi as withFlagAliasMetadata,cR as withHostEnvironmentBoundary,dI as withMcpCachePolicy,Ka as workspaceGraphCache,Yd as wrapOwnershipConflict,FR as wrapThrownErrorForSentry,An as writeAuthorEnvironment,le as writeFileAtomic,qg as writeMutationCheckpoint,Ib as writeSettings,HC as writeStdout,cA as writeVectorizationStatusLedger,Co as writeWorkspaceJsonWithHistory};
1
+ import{A as G_,B as U_,C as bO,D as SO,a as Ti,b as bi,c as Si,d as Ai,e as pO,f as uO,g as O_,h as P_,i as I_,k as M_,l as k_,m as v_,n as N_,o as L_,p as D_,q as $_,r as F_,s as fO,t as mO,u as _O,v as hO,w as gO,x as yO,y as CO,z as TO}from"./chunks/chunk-QTO7USTH.js";import{A as cP,B as dP,C as lP,D as pP,E as uP,F as fP,G as mP,H as _P,I as hP,J as gP,K as yP,L as CP,M as TP,N as bP,O as SP,P as AP,Q as EP,R as wP,S as xP,T as RP,U as OP,V as PP,W as IP,X as MP,Y as kP,a as DO,b as $O,c as FO,d as GO,e as UO,f as jO,g as BO,h as zO,i as qO,j as VO,k as HO,l as KO,m as WO,n as XO,o as YO,p as JO,q as ZO,r as QO,s as eP,t as tP,u as rP,v as nP,w as oP,x as iP,y as sP,z as aP}from"./chunks/chunk-SHMDY36D.js";import{a as AO,b as EO,c as wO,d as xO}from"./chunks/chunk-52EKTW6V.js";import{a as RO,b as OO,c as PO,d as IO,e as MO,f as kO,g as vO,h as NO,i as LO}from"./chunks/chunk-SH6P7FXI.js";import{$ as St,$a as Mt,$b as Km,A as iE,Aa as _f,Ab as Tm,Ac as T_,B as hl,Ba as hf,Bb as bm,Bc as b_,C as ap,Ca as gf,Cb as Sm,Cc as S_,D as cp,Da as yf,Db as Am,Dc as A_,E as dp,Ea as Cf,Eb as Em,Ec as E_,F as lp,Fa as Tf,Fb as wm,Fc as w_,G as pp,Ga as bf,Gb as xm,Gc as x_,H as Np,Ha as Sf,Hb as Rm,Hc as R_,I as Oe,Ia as Af,Ib as Om,J as Lp,Ja as Ef,Jb as Pm,K as Dp,Ka as wf,Kb as Im,L as $p,La as xf,Lb as Mm,M as Fp,Ma as Rf,Mb as km,N as Gp,Na as Of,Nb as vm,O as Up,Oa as Pf,Ob as Nm,P as PR,Pa as If,Pb as Lm,Q as IR,Qa as Mf,Qb as Dm,R as MR,Ra as kf,Rb as $m,S as kR,Sa as vf,Sb as Fm,T as vR,Ta as Nf,Tb as Gm,U as NR,Ua as Lf,Ub as Um,V as LR,Va as Df,Vb as jm,W as DR,Wa as $f,Wb as Bm,X as $R,Xa as Ff,Xb as zm,Y as Ct,Ya as Gf,Yb as qm,Z as Tt,Za as Uf,Zb as Vm,_ as bt,_a as jf,_b as Hm,a as Ya,aa as At,ab as ee,ac as Wm,b as Ja,ba as Et,bb as Xf,bc as Xm,c as Za,ca as wt,cb as Yf,cc as Ym,d as kA,da as xt,db as Jf,dc as Jm,e as vA,ea as Rt,eb as Zf,ec as Zm,f as ec,fa as Ot,fb as Qf,fc as Qm,g as UA,ga as Pt,gb as em,gc as e_,h as jA,ha as hu,hb as tm,hc as t_,i as BA,ia as gu,ib as rm,ic as r_,j as zA,ja as yu,jb as nm,jc as n_,k as qA,ka as Cu,kb as om,kc as o_,l as VA,la as Tu,lb as im,lc as i_,m as HA,ma as Pe,mb as sm,mc as s_,n as KA,na as bu,nb as am,nc as a_,o as WA,oa as Su,ob as cm,oc as c_,p as XA,pa as Au,pb as dm,pc as d_,q as YA,qa as Eu,qb as lm,qc as l_,r as JA,ra as wu,rb as pm,rc as p_,s as ZA,sa as xu,sb as um,sc as u_,t as QA,ta as Ru,tb as fm,tc as f_,u as ic,ua as Ou,ub as mm,uc as m_,v as eE,va as HR,vb as _m,vc as __,w as tE,wa as KR,wb as hm,wc as h_,x as rE,xa as WR,xb as gm,xc as g_,y as nE,ya as XR,yb as ym,yc as y_,z as oE,za as YR,zb as Cm,zc as C_}from"./chunks/chunk-CVBBGWW5.js";import{a as yt,f as mR,g as _R,h as zp,i as qp}from"./chunks/chunk-TNX6HC54.js";import{A as RR,B as OR,C as tu,D as ru,E as nu,b as _l,c as ox,d as nR,e as aR,f as cR,g as dR,h as lR,i as pR,j as jp,k as uR,l as Jp,m as Zp,n as Qp,o as eu,p as hR,q as gR,r as yR,s as CR,t as TR,u as bR,v as SR,w as AR,x as ER,y as wR,z as xR}from"./chunks/chunk-R4ETAOJC.js";import{$ as QE,$a as cl,$b as hp,$c as Lu,A as BE,Aa as Ld,Ab as wl,Ac as iu,Ad as Yu,B as zE,Ba as Dd,Bb as xl,Bc as su,Bd as Ju,C as qE,Ca as $d,Cb as tp,Cc as zR,Cd as Zu,D as VE,Da as Fd,Db as rp,Dc as qR,Dd as Qu,E as ZE,Ea as Gd,Eb as np,Ec as VR,Ed as ef,Fa as Ud,Fb as op,Fc as au,Fd as tf,Ga as jd,Gb as qx,Gc as cu,Gd as rf,Ha as Bd,Hb as Vx,Hc as du,Hd as nf,Ia as zd,Ib as Hx,Ic as lu,Id as of,J as td,Ja as qd,Jb as Kx,Jc as pu,Jd as lO,Ka as Vd,Kb as Wx,Kc as uu,Kd as sf,La as Hd,Lb as ip,Lc as fu,Ld as af,Ma as Kd,Mb as sp,Mc as mu,Md as cf,Na as Wd,Nb as Xx,Nc as _u,Nd as df,Oa as Xd,Ob as Yx,Oc as Pu,Od as lf,Pa as Yd,Pb as Jx,Pc as JR,Pd as pf,Qa as Jd,Qb as Zx,Qc as It,Qd as uf,Ra as Zd,Rb as Qx,Rc as ZR,Rd as ff,Sa as Qd,Sb as eR,Sc as Iu,Sd as mf,Ta as el,Tb as tR,Tc as Ie,Td as Bf,Ua as tl,Ub as rR,Uc as Mu,Ud as zf,Va as rl,Vd as qf,Wa as nl,Wb as up,Wd as Vf,Xa as ol,Xb as fp,Xc as ku,Xd as Hf,Ya as il,Yb as oR,Yc as vu,Yd as Kf,Za as sl,Zb as mp,Zc as Nu,Zd as Wf,_a as al,_b as _p,a as hE,aa as ew,ab as dl,ac as gp,ad as Du,b as gE,ba as rd,bb as ll,bc as yp,bd as $u,c as yE,ca as nd,cb as pl,cc as Cp,cd as Fu,d as CE,da as od,db as ul,dc as Tp,dd as Gu,e as TE,ea as id,eb as fl,ec as bp,ed as QR,f as bE,fa as sd,fb as Sw,fc as Sp,fd as eO,g as SE,ga as ad,gb as Aw,gc as Ap,gd as tO,h as AE,ha as cd,hb as Ew,hc as Ep,hd as rO,i as EE,ia as lw,ib as ww,ic as wp,id as nO,j as wE,ja as pw,jb as xw,jc as xp,jd as oO,k as xE,ka as uw,kb as Rw,kc as Rp,kd as iO,l as RE,la as fw,lb as Ow,lc as Op,ld as sO,m as OE,mb as Pw,mc as Pp,md as aO,n as PE,nb as Iw,nc as Ip,nd as cO,o as IE,oa as mw,ob as Mw,oc as Mp,od as dO,p as ME,pb as kw,pc as iR,q as kE,qa as _w,qb as vw,qc as sR,qd as Uu,r as vE,ra as hw,rb as gl,rc as kp,rd as ju,s as NE,sa as gw,sb as yl,sd as Bu,t as LE,ta as yw,tb as Cl,td as zu,u as DE,ua as Cw,ub as Tl,ud as qu,v as $E,va as Tw,vb as bl,vc as vp,vd as Vu,w as FE,wa as kd,wd as Hu,x as GE,xa as vd,xb as Sl,xc as fR,xd as Ku,y as UE,ya as bw,yb as Al,yc as Bp,yd as Wu,z as jE,za as Nd,zb as El,zc as ou,zd as Xu}from"./chunks/chunk-OS27HHBN.js";import{Ba as wd,Ca as xd,Da as Rd,Ea as Od,Fa as Pd,H as gd,Ha as Id,I as yd,Ia as Md,J as Cd,Ja as Vp,K as Td,Ka as Hp,L as pt,La as Kp,Ma as Wp,Na as Xp,Oa as Yp,a as FA,b as GA,c as tc,d as rc,f as nc,g as oc,h as tw,i as rw,j as nw,k as ow,l as iw,m as sw,n as aw,o as cw,oa as ut,p as dd,pa as ft,q as ld,qa as mt,r as pd,ra as _t,s as ud,sa as bd,t as fd,u as dw,ua as Sd,v as md,va as Ad,w as _d,wa as Ed,x as hd}from"./chunks/chunk-SKXLJIEK.js";import{$ as wc,$a as Xw,$b as Nl,Aa as Zc,Ab as hx,Ac as FR,B as sc,Ba as Qc,Bb as gx,Bc as GR,C as HE,Ca as ed,Cb as yx,Cc as UR,D as KE,Db as Cx,Dc as jR,E as WE,Ea as Nw,Eb as Tx,Ec as BR,F as XE,Fa as Lw,Fb as bx,G as YE,Ga as Dw,Gb as Sx,H as ac,Ha as $w,Hb as Ax,I as cc,Ia as Fw,Ib as Ex,J as dc,Ja as Gw,Jb as wx,K as lc,Ka as Uw,Kb as xx,L as pc,La as jw,Lb as Rx,M as uc,Ma as Bw,Mb as Ox,N as fc,Na as zw,Nb as Px,O as mc,Oa as qw,Ob as Ix,P as _c,Pb as Mx,Q as hc,Qb as kx,R as gc,Rb as vx,S as Re,Sb as Nx,T as yc,Tb as Lx,U as Cc,Ub as Dx,V as Tc,Vb as $x,W as bc,Wb as Fx,X as JE,Xa as Vw,Xb as Gx,Y as Sc,Ya as Hw,Yb as Ml,Z as Ac,Za as Kw,Zb as kl,_ as Ec,_a as Ww,_b as vl,a as AA,aa as xc,ab as Yw,ac as Ll,b as EA,ba as Rc,bc as Dl,c as wA,ca as Oc,cc as ht,d as xA,da as Pc,db as Jw,dc as $l,e as RA,ea as Ic,eb as Zw,ec as Fl,fa as Mc,fb as Qw,fc as Gl,ga as kc,gb as ex,gc as Ul,h as OA,ha as vc,hb as tx,hc as jl,i as PA,ia as Nc,ib as rx,ic as Bl,j as Qa,ja as Lc,jb as nx,jc as zl,k as IA,ka as Dc,kb as ml,kc as ql,l as MA,la as $c,lb as Rl,lc as Vl,m as NA,ma as Fc,mb as Ol,mc as Hl,n as LA,na as Gc,nb as Pl,nc as Kl,o as DA,oa as Uc,ob as Il,oc as Wl,p as $A,pa as jc,pb as ix,pc as Xl,q as sE,qa as Bc,qb as sx,qc as Yl,r as aE,ra as zc,rb as ax,rc as Jl,s as cE,sa as qc,sb as cx,sc as Zl,t as dE,ta as Vc,tb as dx,tc as gt,u as lE,ua as Hc,ub as lx,uc as Ql,v as pE,va as Kc,vb as px,vc as Ux,w as uE,wa as Wc,wb as ux,wc as jx,x as fE,xa as Xc,xb as fx,xc as Bx,y as mE,ya as Yc,yb as mx,yc as ep,z as _E,za as Jc,zb as _x,zc as zx}from"./chunks/chunk-MFNTKMTI.js";import{$ as Oy,$c as $C,$e as DT,$f as YT,$g as jb,$i as VS,$j as $i,$k as As,$l as Aa,Ac as _n,Ad as Cn,Af as ho,Ag as Ab,Ah as Yb,Ai as xS,Aj as rA,Ak as we,Al as Ys,Am as Ka,B as hy,Bc as yC,Bd as rT,Bf as go,Bg as Eb,Bh as Jb,Bi as RS,Bj as nA,Bk as gA,Bl as Js,Bm as Wa,C as N,Cc as CC,Cd as Tn,Cf as yo,Cg as wb,Cj as oA,Ck as yA,Cl as Zs,Cm as Xa,D as gy,Dc as TC,De as Jn,Df as Co,Dg as xb,Dh as Zb,Di as OS,Dj as iA,Dk as CA,Dl as Qs,Dm as lt,E as ye,Ec as bC,Ed as nT,Ee as Zn,Ef as To,Eg as Rb,Ej as sA,Ek as TA,El as ea,Fc as SC,Fd as oT,Fe as Qn,Ff as bo,Fg as Ob,Fh as Qb,Fj as aA,Fk as bA,Fl as ta,G as yy,Gc as AC,Gd as iT,Gf as So,Gh as eS,Gi as PS,Gj as cA,Gk as SA,Gl as ra,H as Cy,Hc as EC,Hd as bn,He as hT,Hf as Ao,Hg as Pb,Hh as tS,Hk as ns,Hl as na,Ic as wC,Id as Sn,Ie as gT,If as Eo,Ig as Ib,Ih as rS,Ii as IS,Ik as os,Il as oa,Ja as Gy,Jc as hn,Jd as An,Je as yT,Jf as wo,Jh as nS,Jk as is,Jl as ia,K as Ty,Ka as Uy,Kb as Qy,Kc as xC,Kd as En,Ke as CT,Kf as xo,Kj as ct,Kk as ss,Kl as sa,La as jy,Lb as ln,Lc as gn,Ld as wn,Le as TT,Lf as Ro,Lg as Mb,Lj as dA,Lk as as,Ll as aa,Mb as pn,Md as xn,Me as bT,Mf as Oo,Mg as kb,Mi as MS,Mj as lA,Mk as cs,Ml as ca,N as by,Nb as eC,Nc as RC,Nd as Rn,Ne as ST,Nf as Po,Ng as vb,Ni as kS,Nj as pA,Nk as ds,Nl as da,O as tt,Oa as nn,Ob as tC,Oc as OC,Od as sT,Oe as AT,Of as Io,Og as Nb,Oi as vS,Oj as Ei,Ok as ls,Ol as la,Pa as By,Pb as Q,Pc as PC,Pd as aT,Pe as ET,Pf as Mo,Pg as Lb,Pi as NS,Pj as wi,Pk as ps,Pl as pa,Q as rt,Qa as zy,Qb as rC,Qc as IC,Qe as wT,Qf as ko,Qg as Go,Qi as LS,Qj as xi,Qk as us,Ql as ua,R as Wr,Ra as qy,Rc as MC,Rd as On,Re as xT,Rf as vo,Rg as Uo,Rj as Ri,Rk as fs,Rl as fa,S as Xr,Sa as Vy,Sb as nC,Sc as it,Sd as Pn,Se as RT,Sf as No,Si as DS,Sj as Oi,Sk as ms,Sl as ma,T as nt,Tc as kC,Td as cT,Te as OT,Tf as Lo,Ti as $S,Tj as Pi,Tk as _s,Tl as _a,U as Sy,Ua as on,Ub as oC,Uc as vC,Ud as In,Ue as PT,Uf as Do,Uh as oS,Ui as FS,Uj as Ii,Uk as hs,Ul as ha,Va as sn,Vc as NC,Vd as Mn,Ve as IT,Vf as $o,Vg as Db,Vh as iS,Vi as GS,Vj as Mi,Vk as gs,Vl as ga,W as Ay,Wa as Ce,Wd as dT,We as MT,Wf as Fo,Wg as $b,Wh as sS,Wi as US,Wj as ki,Wk as ys,Wl as ya,X as Ey,Xa as Hy,Xc as LC,Xd as kn,Xe as kT,Xf as HT,Xg as Fb,Xh as aS,Xi as jS,Xj as vi,Xk as Cs,Xl as Ca,Y as wy,Yc as DC,Yd as vn,Ye as vT,Yf as KT,Yg as Gb,Yh as cS,Yi as BS,Yj as Ni,Yk as Ts,Yl as Ta,Z as xy,Za as an,Zd as Nn,Ze as NT,Zf as WT,Zh as dS,Zi as zS,Zj as Li,Zk as bs,Zl as ba,_ as Ry,_a as cn,_c as yn,_d as Ln,_e as LT,_f as XT,_g as Ub,_i as qS,_j as Di,_k as Ss,_l as Sa,aa as Py,ab as dn,ad as FC,af as $T,ag as JT,ai as lS,aj as at,ak as Fi,al as Es,am as Ea,ba as Iy,bd as GC,bf as FT,bg as ZT,bi as pS,bj as HS,bk as Gi,bl as ws,bm as wa,c as Vr,ca as My,cd as UC,cf as GT,cg as QT,ci as Qo,cj as KS,ck as Ui,cl as xs,cm as xa,d as et,da as ky,dd as jC,df as UT,dg as eb,dh as Bb,di as uS,dj as WS,dk as ji,dl as Rs,dm as Ra,e as Z,ed as BC,ee as lT,ef as jT,eg as tb,eh as zb,ei as fS,ej as XS,ek as Bi,el as Os,em as Oa,f as Hr,fa as vy,fc as iC,fd as zC,fe as pT,ff as BT,fg as rb,fh as qb,fi as mS,fj as YS,fk as zi,fl as Ps,fm as Pa,g as ge,ga as Ny,gc as sC,gd as qC,ge as uT,gf as zT,gg as nb,gh as Vb,gi as _S,gj as JS,gk as qi,gl as Is,gm as Ia,h as Kr,ha as Ly,hc as aC,hd as VC,he as Dn,hf as qT,hg as ob,hh as Ae,hi as st,hj as ZS,hk as Vi,hl as Ms,hm as Ma,ia as Dy,id as HC,ie as $n,if as VT,ig as ib,ih as jo,ii as hS,ij as QS,ik as Hi,il as ks,im as ka,j as ly,ja as $y,jc as cC,je as Fn,jf as eo,jg as sb,jh as Bo,ji as gS,jj as eA,jk as Ki,jl as vs,jm as va,k as py,ka as Fy,kc as dC,kd as KC,ke as Gn,kf as to,kg as ab,kh as zo,ki as yS,kj as si,kk as Wi,kl as Ns,km as Na,l as uy,la as Yr,ld as WC,le as Un,lf as ro,lg as cb,lh as qo,li as CS,lj as ai,lk as Xi,ll as Ls,lm as La,ma as Jr,mc as lC,me as jn,mf as no,mg as db,mh as Vo,mj as ci,mk as Yi,ml as Ds,mm as Da,na as Zr,nc as un,nd as XC,ne as Bn,nf as oo,ng as lb,nh as Ho,ni as TS,nj as di,nk as Ji,nl as $s,nm as $a,od as YC,oe as zn,of as io,og as pb,oh as Ko,oi as bS,oj as li,ok as Zi,ol as Fs,pc as fn,pd as JC,pe as qn,pf as so,pg as ub,ph as Wo,pi as SS,pj as pi,pk as Qi,pl as Gs,pm as xe,qc as mn,qd as ZC,qe as Vn,qf as ao,qg as fb,qh as Xo,qi as AS,qk as es,ql as Us,qm as H,ra as Qr,rb as Ky,rd as QC,re as Hn,rf as co,rg as mb,rh as Hb,ri as ei,rj as ui,rk as ts,rl as js,rm as Fa,s as fy,sb as Te,sd as eT,se as Kn,sf as lo,sg as _b,si as ti,sj as fi,sk as rs,sl as Bs,sm as Ga,ta as en,tb as ot,tc as pC,te as Wn,tf as po,tg as hb,th as Yo,ti as ri,tj as mi,tk as uA,tl as zs,tm as Ua,u as my,ua as tn,ub as Wy,uc as uC,ue as Xn,uf as be,ug as gb,uh as Jo,ui as ni,uj as _i,uk as fA,ul as qs,um as ja,va as rn,vb as Xy,vc as fC,ve as Yn,vf as Se,vg as yb,vh as Zo,vi as oi,vj as hi,vk as Ee,vl as Vs,vm as Ba,wb as Yy,wc as mC,we as fT,wf as uo,wg as Cb,wi as ii,wj as gi,wk as mA,wl as Hs,wm as za,x as _y,xb as Jy,xc as _C,xe as mT,xf as fo,xg as Tb,xh as Kb,xi as ES,xj as yi,xk as _A,xl as Ks,xm as qa,yb as L,yc as hC,yd as tT,ye as _T,yf as mo,yg as bb,yh as Wb,yj as Ci,yk as hA,yl as Ws,ym as Va,zb as Zy,zc as gC,zf as _o,zg as Sb,zh as Xb,zi as wS,zj as tA,zk as dt,zl as Xs,zm as Ha}from"./chunks/chunk-3OO3W6FW.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]="9cb05a78-f95d-5211-a35a-03756f66c812")}catch{}})();var D="2026-07-28",vP=["2025-06-18"],Me=[D],u={headerMismatch:-32020,missingRequiredClientCapability:-32021,unsupportedProtocolVersion:-32022,invalidParams:-32602},w={clientCapabilities:"io.modelcontextprotocol/clientCapabilities",clientInfo:"io.modelcontextprotocol/clientInfo",protocolVersion:"io.modelcontextprotocol/protocolVersion",serverInfo:"io.modelcontextprotocol/serverInfo"},p=class extends Error{code;data;constructor(t,r,n={}){super(t),this.name="PmMcpProtocolError",this.code=r,this.data=n}};function m(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function j_(e){if(e===void 0)return;if(!m(e))throw new p("Invalid MCP clientInfo metadata",u.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 p("Invalid MCP clientInfo metadata",u.invalidParams,{field:w.clientInfo,required:["name","version"]});let n={name:t.slice(0,128),version:r.slice(0,128)};return typeof e.description=="string"&&e.description.trim()&&(n.description=e.description.trim().slice(0,1024)),typeof e.websiteUrl=="string"&&e.websiteUrl.trim()&&(n.websiteUrl=e.websiteUrl.trim().slice(0,2048)),n}function ke(e){let t=m(e)?e._meta:void 0;if(!m(t))throw new p("Missing required MCP request metadata",u.invalidParams,{required:[w.protocolVersion,w.clientCapabilities]});let r=t[w.protocolVersion];if(typeof r!="string"||!Me.includes(r))throw new p("Unsupported protocol version",u.unsupportedProtocolVersion,{supported:[...Me],requested:typeof r=="string"?r:null});let n=t[w.clientCapabilities];if(!m(n))throw new p("Invalid MCP client capabilities metadata",u.invalidParams,{field:w.clientCapabilities,expected:"object"});let o=j_(t[w.clientInfo]);return{protocolVersion:D,clientCapabilities:n,...o?{clientInfo:o}:{}}}function NP(e,t){if(t!==e.protocolVersion)throw new p("MCP protocol header does not match request metadata",u.headerMismatch,{header:t??null,metadata:e.protocolVersion})}function LP(e,t){let r=t.filter(n=>!Object.prototype.hasOwnProperty.call(e.clientCapabilities,n));if(r.length>0)throw new p("Missing required client capability",u.missingRequiredClientCapability,{requiredCapabilities:Object.fromEntries(r.map(n=>[n,{}]))})}function DP(e,t){let r=e.clientCapabilities.extensions;return m(r)&&m(r[t])}function ve(e,t){let r=m(e._meta)?e._meta:{};return{...e,_meta:{...r,[w.serverInfo]:{...t}}}}function B_(e,t){return ve({...e,resultType:"complete"},t)}function $P(e){let t=e.ttlMs??6e4;if(!Number.isFinite(t)||t<0)throw new p("Invalid MCP discovery cache TTL",u.invalidParams,{ttlMs:t});return B_({supportedVersions:[...Me],capabilities:structuredClone(e.capabilities),ttlMs:t,cacheScope:"public",...e.instructions?{instructions:e.instructions}:{}},e.serverInfo)}function FP(e,t){if(m(e)&&typeof e.resultType=="string")return e.resultType;if(t==="legacy")return"complete";throw new p("Modern MCP result is missing resultType",u.invalidParams,{required:"resultType"})}import{createHash as Nt,createHmac as Lt,timingSafeEqual as z_}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]="469f704b-12eb-524d-bcc8-fb8f9f1775f2")}catch{}})();var q_=["elicitation/create","roots/list","sampling/createMessage"],kt=class extends Error{inputRequests;requestState;constructor(t){super("MCP operation requires additional input"),this.name="PmMcpInputRequiredError",this.inputRequests=t.inputRequests,this.requestState=t.requestState}},Dt=/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/u,te=32,Le=64*1024,re=16*1024,Ne={maxBytes:256*1024,maxDepth:32,maxNodes:4096};function V_(e){return e==="elicitation/create"?"elicitation":e==="sampling/createMessage"?"sampling":"roots"}function ne(e,t,r){let n;try{n=JSON.stringify(e)}catch{throw new p(`Invalid ${r}: value is not JSON serializable`,u.invalidParams,{field:r})}if(Buffer.byteLength(n,"utf8")>t)throw new p(`Invalid ${r}: payload exceeds the protocol bound`,u.invalidParams,{field:r,maximumBytes:t})}function De(e,t){if(!m(e))throw new p("Invalid MCP inputRequests",u.invalidParams,{field:"inputRequests",expected:"object"});let r=Object.entries(e);if(r.length===0||r.length>te)throw new p("Invalid MCP inputRequests count",u.invalidParams,{minimum:1,maximum:te,observed:r.length});let n={};for(let[o,i]of r){if(!Dt.test(o)||!m(i))throw new p("Invalid MCP input request entry",u.invalidParams,{field:`inputRequests.${o}`});let s=i.method;if(typeof s!="string"||!q_.includes(s))throw new p("Unsupported MCP input request method",u.invalidParams,{field:`inputRequests.${o}.method`,method:s??null});let a=V_(s);if(!Object.prototype.hasOwnProperty.call(t.clientCapabilities,a))throw new p("Missing required client capability",u.missingRequiredClientCapability,{requiredCapabilities:{[a]:{}}});if(!m(i.params))throw new p("Invalid MCP input request parameters",u.invalidParams,{field:`inputRequests.${o}.params`,expected:"object"});n[o]={method:s,params:structuredClone(i.params)}}return ne(n,Le,"inputRequests"),n}function $t(e){if(!m(e))throw new p("Invalid MCP inputResponses",u.invalidParams,{field:"inputResponses",expected:"object"});let t=Object.entries(e);if(t.length>te)throw new p("Invalid MCP inputResponses count",u.invalidParams,{maximum:te,observed:t.length});let r={};for(let[n,o]of t){if(!Dt.test(n)||!m(o))throw new p("Invalid MCP input response entry",u.invalidParams,{field:`inputResponses.${n}`});r[n]=structuredClone(o)}return ne(r,Le,"inputResponses"),r}function BP(e){let t=e.requestState?.trim();if(t&&Buffer.byteLength(t,"utf8")>re)throw new p("Invalid MCP requestState: payload exceeds the protocol bound",u.invalidParams,{field:"requestState",maximumBytes:re});let r=e.inputRequests===void 0?void 0:De(e.inputRequests,e.requestContext);if(r===void 0&&!t)throw new p("InputRequiredResult requires inputRequests or requestState",u.invalidParams,{requiredAnyOf:["inputRequests","requestState"]});return{resultType:"input_required",...r?{inputRequests:r}:{},...t?{requestState:t}:{},_meta:{[w.serverInfo]:{...e.serverInfo}}}}function Ft(e){let t=Buffer.from(e);if(t.byteLength<32)throw new p("MCP requestState signing key must contain at least 32 bytes",u.invalidParams,{minimumBytes:32});return t}function zP(e,t){if(!Number.isSafeInteger(e.expiresAt)||e.expiresAt<=0||e.method.trim().length===0||e.parameterDigest.trim().length===0||e.principal.trim().length===0)throw new p("Invalid MCP requestState payload",u.invalidParams);let r=Buffer.from(JSON.stringify({version:1,...e}),"utf8");if(r.byteLength>re/2)throw new p("MCP requestState payload exceeds the protocol bound",u.invalidParams,{maximumBytes:re/2});let n=r.toString("base64url"),o=Lt("sha256",Ft(t)).update(n).digest("base64url");return`${n}.${o}`}function H_(e){if(!m(e)||e.version!==1)throw new p("Invalid MCP requestState payload",u.invalidParams,{field:"requestState"});let{expiresAt:t,method:r,parameterDigest:n,principal:o,state:i}=e;if(typeof t!="number"||!Number.isSafeInteger(t))throw new p("Invalid MCP requestState payload",u.invalidParams,{field:"requestState"});if(typeof r!="string"||typeof n!="string"||typeof o!="string")throw new p("Invalid MCP requestState payload",u.invalidParams,{field:"requestState"});return{expiresAt:t,method:r,parameterDigest:n,principal:o,state:i}}function qP(e,t,r){let[n,o,i]=e.split(".");if(!n||!o||i!==void 0)throw new p("Invalid MCP requestState encoding",u.invalidParams,{field:"requestState"});let s=Buffer.from(o,"base64url"),a=Lt("sha256",Ft(t)).update(n).digest();if(s.byteLength!==a.byteLength||!z_(s,a))throw new p("Invalid MCP requestState signature",u.invalidParams,{field:"requestState"});let c;try{c=JSON.parse(Buffer.from(n,"base64url").toString("utf8"))}catch{c=null}let d=H_(c),{expiresAt:l,method:f,parameterDigest:_,principal:C}=d;if(l<(r.nowMs??Date.now()))throw new p("Expired MCP requestState",u.invalidParams,{field:"requestState",expiredAt:l});if(f!==r.method||_!==r.parameterDigest||C!==r.principal)throw new p("MCP requestState binding mismatch",u.invalidParams,{field:"requestState"});return d}function VP(e){return ne(e,Le,"request parameters"),Nt("sha256").update(JSON.stringify(e)).digest("hex")}var vt=class{#e=new Set;#t;constructor(t=4096){if(!Number.isSafeInteger(t)||t<1)throw new p("Invalid MCP replay guard capacity",u.invalidParams,{maximumEntries:t});this.#t=t}consume(t){let r=Nt("sha256").update(t).digest("hex");if(this.#e.has(r))throw new p("MCP requestState replay detected",u.invalidParams,{field:"requestState"});if(this.#e.size>=this.#t){let n=this.#e.values().next().value;this.#e.delete(n)}this.#e.add(r)}};function K_(e){if(!Number.isSafeInteger(e.ttlMs)||e.ttlMs<0||e.cacheScope!=="public"&&e.cacheScope!=="private")throw new p("Invalid MCP cache policy",u.invalidParams,{ttlMs:e.ttlMs,cacheScope:e.cacheScope});return{ttlMs:e.ttlMs,cacheScope:e.cacheScope}}function HP(e,t){return{...e,...K_(t)}}function W_(e){return e.replaceAll("~1","/").replaceAll("~0","~")}function X_(e,t){if(t==="#")return e;if(!t.startsWith("#/"))return;let r=e;for(let n of t.slice(2).split("/").map(W_)){if(!m(r)&&!Array.isArray(r)||!Object.prototype.hasOwnProperty.call(r,n))return;r=r[n]}return r}function Y_(e){let t=e.maxBytes??Ne.maxBytes,r=e.maxDepth??Ne.maxDepth,n=e.maxNodes??Ne.maxNodes;if(!Number.isSafeInteger(t)||t<2)throw new p("Invalid MCP JSON Schema work bounds",u.invalidParams);if(!Number.isSafeInteger(r)||r<1)throw new p("Invalid MCP JSON Schema work bounds",u.invalidParams);if(!Number.isSafeInteger(n)||n<1)throw new p("Invalid MCP JSON Schema work bounds",u.invalidParams);return{maximumBytes:t,maximumDepth:r,maximumNodes:n}}function J_(e,t){let r=Array.isArray(e.value)?e.value:m(e.value)?Object.values(e.value):[];for(let n of r)t.push({value:n,depth:e.depth+1})}function Z_(e,t){if(!m(t)||typeof t.$ref!="string")return;let r=t.$ref;if(r.startsWith("#")&&X_(e,r)===void 0)throw new p("MCP JSON Schema contains an unresolved local reference",u.invalidParams,{reference:r})}function KP(e,t={}){let{maximumBytes:r,maximumDepth:n,maximumNodes:o}=Y_(t);if(typeof e!="boolean"&&!m(e))throw new p("Invalid MCP JSON Schema root",u.invalidParams,{expected:"object or boolean"});ne(e,r,"JSON Schema");let i=[{value:e,depth:0}],s=0;for(;i.length>0;){let a=i.pop();if(s+=1,s>o||a.depth>n)throw new p("MCP JSON Schema exceeds validation work bounds",u.invalidParams,{maximumDepth:n,maximumNodes:o});Z_(e,a.value),J_(a,i)}return structuredClone(e)}import{randomUUID as Q_}from"node:crypto";import{readFile as eh}from"node:fs/promises";import Gt 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]="1774674f-4d33-5a24-9d97-522c55b861c0")}catch{}})();var tI="io.modelcontextprotocol/tasks",th=["working","input_required","completed","failed","cancelled"],rh=/^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,nh=3600*1e3,oh=1e3,ie=1024,ih=30,sh=2e3;function $e(e){return new p(e,u.invalidParams,{code:"mcp_task_not_found_or_not_authorized"})}function oe(e){let t=e.trim();if(!rh.test(t))throw $e("Unknown MCP task");return t}function Ut(e,t){if(typeof e!="string"||!Number.isFinite(Date.parse(e)))throw new p("Corrupt MCP task record",u.invalidParams,{field:t});return e}function jt(e){if(!m(e)||typeof e.code!="number"||!Number.isFinite(e.code)||typeof e.message!="string")throw new p("Corrupt MCP task error",u.invalidParams);return{code:e.code,message:e.message.slice(0,ie),...m(e.data)?{data:structuredClone(e.data)}:{}}}function ah(e){if(!th.includes(e))throw new p("Corrupt MCP task record",u.invalidParams);return e}function ch(e){if(typeof e!="string"||e.length===0)throw new p("Corrupt MCP task record",u.invalidParams);return e}function dh(e){if(typeof e!="number"||!Number.isSafeInteger(e)||e<1)throw new p("Corrupt MCP task record",u.invalidParams);return e}function lh(e){if(e!==null&&(typeof e!="number"||!Number.isSafeInteger(e)||e<0))throw new p("Corrupt MCP task record",u.invalidParams);return e}function ph(e){if(e!==void 0){if(typeof e!="number"||!Number.isSafeInteger(e)||e<0)throw new p("Corrupt MCP task record",u.invalidParams);return e}}function uh(e){if(!Array.isArray(e)||e.some(t=>typeof t!="string"))throw new p("Corrupt MCP task record",u.invalidParams);return[...e]}function fh(e){if(!m(e)||e.version!==1)throw new p("Corrupt MCP task record",u.invalidParams);let t=typeof e.taskId=="string"?oe(e.taskId):"",r=ah(e.status),n=ch(e.principal),o=dh(e.workerPid),i=lh(e.ttlMs),s=ph(e.pollIntervalMs),a={version:1,taskId:t,status:r,principal:n,workerPid:o,createdAt:Ut(e.createdAt,"createdAt"),lastUpdatedAt:Ut(e.lastUpdatedAt,"lastUpdatedAt"),ttlMs:i,consumedInputKeys:uh(e.consumedInputKeys),...typeof e.statusMessage=="string"?{statusMessage:e.statusMessage.slice(0,ie)}:{},...typeof s=="number"?{pollIntervalMs:s}:{}};if(m(e.inputRequests)&&(a.inputRequests=structuredClone(e.inputRequests)),m(e.inputResponses)&&(a.inputResponses=structuredClone(e.inputResponses)),m(e.result)&&(a.result=structuredClone(e.result)),e.error!==void 0&&(a.error=jt(e.error)),a.status==="input_required"&&!a.inputRequests||a.status==="completed"&&!a.result||a.status==="failed"&&!a.error)throw new p("Corrupt MCP task status payload",u.invalidParams,{status:a.status});return a}function $(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 K(e){return e==="completed"||e==="failed"||e==="cancelled"}function mh(e){try{return process.kill(e,0),!0}catch(t){return!(typeof t=="object"&&t!==null&&"code"in t&&t.code==="ESRCH")}}var Fe=class{#e;#t;#r;#n;#i;constructor(t){this.#e=Gt.resolve(t.pmRoot),this.#t=t.owner?.trim()||"pm-mcp",this.#r=t.now??(()=>new Date),this.#n=t.taskIdFactory??(()=>`mcp-task-${Q_()}`),this.#i=t.workerPid??process.pid}#s(t){return Gt.join(this.#e,"runtime","mcp-tasks","records",`${oe(t)}.json`)}async#c(t){try{return fh(JSON.parse(await eh(this.#s(t),"utf8")))}catch(r){throw Z(r)||r instanceof SyntaxError?$e("Unknown MCP task"):r}}async#a(t){await ge(this.#s(t.taskId),`${JSON.stringify(t,null,2)}
2
+ `)}async#o(t,r,n){let o=oe(t),i=await Ae(this.#e,o,ih,this.#t,!1,!1,sh);try{let s=await this.#c(o);if(s.principal!==r)throw $e("Unknown MCP task");let a=n(s);return await this.#a(a),a}finally{await i()}}async create(t){let r=oe(this.#n()),n=t.principal.trim(),o=t.ttlMs===void 0?nh:t.ttlMs,i=t.pollIntervalMs??oh;if(n.length===0||o!==null&&(!Number.isSafeInteger(o)||o<0)||!Number.isSafeInteger(i)||i<0)throw new p("Invalid MCP task creation options",u.invalidParams);let s=this.#r().toISOString(),a={version:1,taskId:r,status:"working",createdAt:s,lastUpdatedAt:s,ttlMs:o,pollIntervalMs:i,principal:n,workerPid:this.#i,consumedInputKeys:[],...t.statusMessage?.trim()?{statusMessage:t.statusMessage.trim().slice(0,ie)}:{}};return await this.#a(a),{...$(a),resultType:"task"}}async get(t,r){return $(await this.#o(t,r,n=>{if(K(n.status))return n;let o=this.#r().getTime(),i=n.ttlMs!==null&&Date.parse(n.createdAt)+n.ttlMs<=o,s=n.workerPid!==this.#i&&!mh(n.workerPid);return!i&&!s?n:{...n,status:"failed",statusMessage:i?"Task retention expired before completion.":"Task worker ended before recording a terminal result.",lastUpdatedAt:this.#r().toISOString(),error:{code:-32603,message:i?"MCP task expired":"MCP task worker unavailable after restart",data:{recoverable:!1,createNewTask:!0}},inputRequests:void 0}}))}async requireInput(t){let r=De(t.inputRequests,t.requestContext);return $(await this.#o(t.taskId,t.principal,n=>{if(K(n.status))return n;let o=Object.keys(r).filter(i=>n.consumedInputKeys.includes(i));if(o.length>0)throw new p("MCP task input request keys must be unique for the task lifetime",u.invalidParams,{reused:o});return{...n,status:"input_required",statusMessage:t.statusMessage?.trim().slice(0,ie),lastUpdatedAt:this.#r().toISOString(),inputRequests:r}}))}async update(t,r,n){let o=$t(n),i=[],s=[];return await this.#o(t,r,a=>{if(a.status!=="input_required"||!a.inputRequests)return a;let c={...a.inputRequests},d=a.inputResponses?{...a.inputResponses}:{};for(let[l,f]of Object.entries(o))Object.prototype.hasOwnProperty.call(c,l)&&(d[l]=f,delete c[l],i.push(l));return s=Object.keys(c).sort(),i.length===0?a:{...a,status:s.length===0?"working":"input_required",lastUpdatedAt:this.#r().toISOString(),inputRequests:s.length===0?void 0:c,inputResponses:d,consumedInputKeys:[...new Set([...a.consumedInputKeys,...i])].sort()}}),{acceptedKeys:i.sort(),remainingKeys:s}}async takeInputResponses(t,r){let n={};return await this.#o(t,r,o=>(n=structuredClone(o.inputResponses??{}),Object.keys(n).length===0?o:{...o,inputResponses:void 0})),n}async complete(t,r,n){return $(await this.#o(t,r,o=>K(o.status)?o:{...o,status:"completed",statusMessage:"Task completed.",lastUpdatedAt:this.#r().toISOString(),result:structuredClone(n),inputRequests:void 0,error:void 0}))}async fail(t,r,n){let o=jt(n);return $(await this.#o(t,r,i=>K(i.status)?i:{...i,status:"failed",statusMessage:o.message,lastUpdatedAt:this.#r().toISOString(),error:o,inputRequests:void 0,result:void 0}))}async cancel(t,r){return $(await this.#o(t,r,n=>K(n.status)?n:{...n,status:"cancelled",statusMessage:"Task cancelled by the client.",lastUpdatedAt:this.#r().toISOString(),inputRequests:void 0,result:void 0,error:void 0}))}};function rI(e){return new Fe(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]="cb791784-bde2-5b1d-b5df-038282816043")}catch{}})();var se="io.modelcontextprotocol/subscriptionId",Bt=256,zt=2048,_h=5e3;function hh(e,t){return new Promise((r,n)=>{let o=setTimeout(()=>n(new Error("MCP subscription sink write timed out")),_h);o.unref(),Promise.resolve().then(()=>e(t)).then(()=>{clearTimeout(o),r()},i=>{clearTimeout(o),n(i instanceof Error?i:new Error(String(i)))})})}function Ge(e,t){if(e!==void 0){if(typeof e!="boolean")throw new p("Invalid MCP subscription filter",u.invalidParams,{field:`notifications.${t}`,expected:"boolean"});return e||void 0}}function gh(e){if(!m(e))throw new p("Invalid MCP subscription filter",u.invalidParams,{field:"notifications",expected:"object"});let t=Ge(e.toolsListChanged,"toolsListChanged"),r=Ge(e.promptsListChanged,"promptsListChanged"),n=Ge(e.resourcesListChanged,"resourcesListChanged"),o;if(e.resourceSubscriptions!==void 0){if(!Array.isArray(e.resourceSubscriptions)||e.resourceSubscriptions.length>Bt)throw new p("Invalid MCP resource subscriptions",u.invalidParams,{field:"notifications.resourceSubscriptions",maximum:Bt});let i=new Set;for(let s of e.resourceSubscriptions){if(typeof s!="string"||s.trim().length===0||Buffer.byteLength(s,"utf8")>zt)throw new p("Invalid MCP resource subscription URI",u.invalidParams,{field:"notifications.resourceSubscriptions",maximumBytes:zt});i.add(s)}i.size>0&&(o=[...i].sort())}return{...t?{toolsListChanged:t}:{},...r?{promptsListChanged:r}:{},...n?{resourcesListChanged:n}:{},...o?{resourceSubscriptions:o}:{}}}function yh(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 qt=class{#e;#t=new Map;#r;constructor(t){this.#e=structuredClone(t.capabilities),this.#r={...t.serverInfo}}get size(){return this.#t.size}async open(t){if(this.#t.has(t.id))throw new p("MCP subscription id is already active",u.invalidParams,{subscriptionId:t.id});let r=yh(gh(t.notifications),this.#e),n={filter:r,sink:t.sink,writeQueue:Promise.resolve()};this.#t.set(t.id,n);try{await this.#n(t.id,n,{jsonrpc:"2.0",method:"notifications/subscriptions/acknowledged",params:{_meta:{[se]:t.id},notifications:structuredClone(r)}},!0)}catch(o){throw this.#t.delete(t.id),o}return structuredClone(r)}async emitListChanged(t){let r=`${t}ListChanged`,n=`notifications/${t}/list_changed`,o=[];for(let[i,s]of this.#t)s.filter[r]===!0&&o.push(this.#n(i,s,{jsonrpc:"2.0",method:n,params:{_meta:{[se]:i}}}));return(await Promise.all(o)).filter(Boolean).length}async emitResourceUpdated(t){let r=[];for(let[n,o]of this.#t)o.filter.resourceSubscriptions?.includes(t)&&r.push(this.#n(n,o,{jsonrpc:"2.0",method:"notifications/resources/updated",params:{_meta:{[se]:n},uri:t}}));return(await Promise.all(r)).filter(Boolean).length}async#n(t,r,n,o=!1){let i=r.writeQueue.then(async()=>{if(this.#t.get(t)!==r)return!1;try{return await hh(r.sink,n),!0}catch(s){if(this.#t.get(t)===r&&this.#t.delete(t),o)throw s;return!1}});return r.writeQueue=i.then(()=>{},()=>{}),i}close(t){if(this.#t.delete(t))return{...ve({resultType:"complete",_meta:{[se]:t}},this.#r)}}closeAll(){let t=[];for(let r of this.#t.keys()){let n=this.close(r);t.push({id:r,result:n})}return t}};(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="5ffe7128-0fbb-59af-89ef-74d5d799a00d")}catch{}})();var Vt=/^=\?base64\?([A-Za-z0-9+/]*={0,2})\?=$/u,Ch=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/u,Ht=/^[\t\x20-\x7E]*$/u,Kt=new Set(["prompts/get","resources/read","tools/call"]);function Th(e){let t=new Map;for(let[r,n]of Object.entries(e)){if(n===void 0)continue;let o=typeof n=="string"?n:n.join(", ");t.set(r.toLowerCase(),o)}return t}function S(e,t){throw new p(e,u.headerMismatch,{header:t})}function Wt(e){let t=typeof e=="boolean"?String(e).toLowerCase():String(e);return t.length>0&&t.trim()===t&&Ht.test(t)&&!Vt.test(t)?t:`=?base64?${Buffer.from(t,"utf8").toString("base64")}?=`}function Xt(e,t){let r=Vt.exec(e);if(r){let n=r[1],o=Buffer.from(n,"base64");return o.toString("base64")!==n||o.length===0?S("Malformed MCP Base64 header value",t):o.toString("utf8")}return e.length===0||e.trim()!==e||!Ht.test(e)?S("Malformed MCP header value",t):e}function ae(e){return Array.isArray(e)?e.some(ae):m(e)?Object.prototype.hasOwnProperty.call(e,"x-mcp-header")||Object.values(e).some(ae):!1}function bh(e,t,r){let n=e["x-mcp-header"];if(n===void 0)return;let o=e.type;if(typeof n!="string"||!Ch.test(n)||!["boolean","integer","string"].includes(String(o))||r.has(n.toLowerCase()))throw new p("Invalid MCP x-mcp-header annotation",u.invalidParams,{field:t.join("."),annotation:n});return r.add(n.toLowerCase()),{name:n,path:t,type:o}}function Yt(e){if(!m(e))throw new p("Invalid MCP tool schema",u.invalidParams,{field:"inputSchema",expected:"object"});let t=[],r=new Set,n=(o,i)=>{let s=o.properties;if(s!==void 0){if(!m(s))throw new p("Invalid MCP tool schema properties",u.invalidParams,{field:"inputSchema.properties"});for(let[a,c]of Object.entries(s)){if(!m(c))continue;let d=[...i,a],l=bh(c,d,r);l&&t.push(l);for(let[f,_]of Object.entries(c))if(f!=="properties"&&f!=="x-mcp-header"&&ae(_))throw new p("MCP x-mcp-header is not statically reachable",u.invalidParams,{field:d.join("."),keyword:f});n(c,d)}}};for(let[o,i]of Object.entries(e))if(o!=="properties"&&ae(i))throw new p("MCP x-mcp-header is not statically reachable",u.invalidParams,{field:"inputSchema",keyword:o});return n(e,[]),t}function Jt(e,t){let r=e;for(let n of t){if(!m(r))return;r=r[n]}return r}function Zt(e,t){let r=e==="resources/read"?t.uri:t.name;return typeof r=="string"?r:void 0}function Sh(e,t){let r=m(e.arguments)?e.arguments:{},n={};for(let o of Yt(t)){let i=Jt(r,o.path);if(i==null)continue;if(!(o.type==="integer"&&typeof i=="number"&&Number.isSafeInteger(i)||o.type==="boolean"&&typeof i=="boolean"||o.type==="string"&&typeof i=="string"))throw new p("Invalid MCP custom header argument",u.invalidParams,{field:o.path.join("."),expected:o.type});n[`Mcp-Param-${o.name}`]=Wt(i)}return n}function aI(e){let t=m(e.request.params)?e.request.params:void 0,r=ke(t),n=e.request.method;if(typeof n!="string"||n.length===0)return S("Missing MCP request method","Mcp-Method");let o={Accept:"application/json, text/event-stream","Content-Type":"application/json","MCP-Protocol-Version":r.protocolVersion,"Mcp-Method":n},i=Zt(n,t);if(Kt.has(n)){if(i===void 0)return S("Missing MCP request name","Mcp-Name");o["Mcp-Name"]=Wt(i)}return n==="tools/call"&&e.toolSchema!==void 0&&Object.assign(o,Sh(t,e.toolSchema)),o}function Ah(e,t){let r=t.method;(typeof r!="string"||r.length===0)&&S("Missing MCP request method","Mcp-Method");let n=m(t.params)?t.params:void 0,o=ke(n).protocolVersion;if(e.get("mcp-protocol-version")!==o&&S("MCP protocol header does not match request metadata","MCP-Protocol-Version"),e.get("mcp-method")!==r&&S("MCP method header does not match request body","Mcp-Method"),Kt.has(r)){let i=e.get("mcp-name"),s=Zt(r,n);(i===void 0||s===void 0||Xt(i,"Mcp-Name")!==s)&&S("MCP name header does not match request body","Mcp-Name")}e.has("last-event-id")&&S("MCP SSE resumability is not supported","Last-Event-ID")}function Eh(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 wh(e){let t=m(e.params.arguments)?e.params.arguments:{};for(let r of Yt(e.toolSchema)){let n=Jt(t,r.path),o=`Mcp-Param-${r.name}`,i=e.headers.get(o.toLowerCase());if(n==null){i!==void 0&&S("Unexpected MCP parameter header",o);continue}i===void 0&&S("Missing MCP parameter header",o),Eh(r,n,Xt(i,o))||S("MCP parameter header does not match request body",o)}}function cI(e){let t=Th(e.headers),r=typeof e.request.method=="string"?e.request.method:"";Ah(t,e.request),!(r!=="tools/call"||e.toolSchema===void 0)&&wh({headers:t,params:e.request.params,toolSchema:e.toolSchema})}var dI=D;import{AsyncLocalStorage as xh}from"node:async_hooks";import{createHash as Qt,timingSafeEqual as Rh}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]="a9aefc86-a8ce-5ecf-bb54-e5fa3ea277c7")}catch{}})();var h=class extends Error{httpStatus;challenge;constructor(t,r,n){super(t),this.name="PmMcpAuthorizationError",this.httpStatus=r,this.challenge=n}},Oh=/^00-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})$/u,Ph=/^[a-z][a-z0-9_*/-]{0,255}$/u,Ih=/^(?:[a-z0-9][a-z0-9_*/-]{0,240})@[a-z][a-z0-9_*/-]{0,13}$/u,Mh=/^[\x20-\x2B\x2D-\x3C\x3E-\x7E]{0,255}[\x21-\x2B\x2D-\x3C\x3E-\x7E]$/u,tr=/^[\x21\x23-\x5B\x5D-\x7E]+$/u,rr=/^[A-Za-z0-9!#$%&'*+.^_`|~-]+$/u,kh=/^[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]*$/u,vh=/%(?![0-9A-Fa-f]{2})/u,Nh=512,Lh=32,Dh=180,$h=8192,Fh=8192,nr=new xh;function b(e,t,r=!1){if(new RegExp("\\p{Cc}","u").test(e))throw new h(`Invalid ${t}`,401);let n;try{n=new URL(e)}catch{throw new h(`Invalid ${t}`,401)}let o=n.hostname==="127.0.0.1"||n.hostname==="localhost";if(n.hash.length>0||n.protocol!=="https:"&&!(r&&o&&n.protocol==="http:"))throw new h(`Invalid ${t}`,401);return n}function Gh(e,t){let r=t.toLowerCase();for(let[n,o]of Object.entries(e))if(!(n.toLowerCase()!==r||o===void 0))return typeof o=="string"?o:o.join(", ")}function mI(e){let t=b(e.resource,"protected resource URI",!0).href.replace(/\/$/u,"");if(e.authorizationServers.length===0)throw new h("Protected resource metadata requires an authorization server",401);let r=e.authorizationServers.map(o=>b(o,"authorization server issuer").href.replace(/\/$/u,"")),n=[...new Set(e.scopes??[])];if(n.some(o=>!tr.test(o)))throw new h("Invalid authorization scope",401);return{resource:t,authorization_servers:r,...n.length>0?{scopes_supported:n.sort()}:{}}}function _I(e){let t=b(e,"authorization server issuer"),r=t.pathname.replace(/^\/+|\/+$/gu,""),n=t.origin;return r?[`${n}/.well-known/oauth-authorization-server/${r}`,`${n}/.well-known/openid-configuration/${r}`,`${n}/${r}/.well-known/openid-configuration`]:[`${n}/.well-known/oauth-authorization-server`,`${n}/.well-known/openid-configuration`]}function hI(e,t){if(!m(e)||typeof e.issuer!="string")throw new h("Invalid authorization server metadata",401);let r=b(t,"expected issuer").href.replace(/\/$/u,"");if(b(e.issuer,"metadata issuer").href.replace(/\/$/u,"")!==r)throw new h("Authorization server issuer mismatch",401);if(!Array.isArray(e.code_challenge_methods_supported)||!e.code_challenge_methods_supported.includes("S256"))throw new h("Authorization server does not support required S256 PKCE",401);let o=d=>{let l=e[d];if(typeof l!="string")throw new h(`Authorization server metadata requires ${d}`,401);return b(l,d).href},i=d=>{let l=e[d];return typeof l=="string"?b(l,d).href:void 0},s=o("authorization_endpoint"),a=o("token_endpoint"),c=i("registration_endpoint");return{issuer:r,authorization_endpoint:s,token_endpoint:a,code_challenge_methods_supported:[...new Set(e.code_challenge_methods_supported.filter(d=>typeof d=="string"))],...e.client_id_metadata_document_supported===!0?{client_id_metadata_document_supported:!0}:{},...c?{registration_endpoint:c}:{}}}function gI(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 yI(e){if(e.responseIssuer===void 0){if(e.issuerParameterSupported)throw new h("Authorization response omitted the advertised issuer",401);return}if(e.responseIssuer!==e.expectedIssuer)throw new h("Authorization response issuer mismatch",401)}function CI(e,t){let r=b(t,"client metadata document URL");if(r.pathname==="/"||!m(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 h("Invalid Client ID Metadata Document",401);for(let n of e.redirect_uris){if(typeof n!="string")throw new h("Invalid client redirect URI",401);b(n,"client redirect URI",!0)}return structuredClone(e)}function TI(e){if(e.redirectUris.length===0||e.clientName.trim().length===0)throw new h("Invalid dynamic client registration metadata",401);let t=e.redirectUris.map(r=>b(r,"redirect URI",!0).href);return{application_type:e.applicationType,client_name:e.clientName.trim().slice(0,128),redirect_uris:t,grant_types:["authorization_code","refresh_token"],response_types:["code"],token_endpoint_auth_method:"none"}}var er=class{#e=new Map;set(t,r){let n=b(t,"credential issuer").href;this.#e.set(n,structuredClone(r))}get(t){let r=b(t,"credential issuer").href,n=this.#e.get(r);return n?structuredClone(n):void 0}delete(t){let r=b(t,"credential issuer").href;return this.#e.delete(r)}};function Uh(e){let t=e.traceparent,r=e.tracestate;if(t!==void 0){let n=typeof t=="string"?Oh.exec(t):null;if(!n)throw new h("Invalid MCP traceparent",403);let o=n[1],i=n[2];if(/^0+$/u.test(o)||/^0+$/u.test(i))throw new h("Invalid MCP traceparent",403)}if(r!==void 0&&(typeof r!="string"||!Bh(r)))throw new h("Invalid MCP tracestate",403);return{...typeof t=="string"?{traceparent:t}:{},...typeof r=="string"?{tracestate:r}:{}}}function I(e){return e.replace(/^[ \t]*|[ \t]*$/gu,"")}function jh(e){return Ph.test(e)||Ih.test(e)}function Bh(e){if(Buffer.byteLength(e,"utf8")>Nh)return!1;let t=e.split(",");if(t.length>Lh)return!1;let r=new Set;for(let n of t){let o=I(n);if(o.length===0)continue;let i=o.indexOf("="),s=i>0?o.slice(0,i):"",a=i>0?o.slice(i+1):"";if(!jh(s)||!Mh.test(a)||r.has(s))return!1;r.add(s)}return!0}function or(e){return kh.test(e)&&!vh.test(e)}function zh(e){let t=I(e),r=t.indexOf("="),n=I(r>=0?t.slice(0,r):t),o=r>=0?I(t.slice(r+1)):void 0;return rr.test(n)&&(o===void 0||or(o))}function qh(e){let t=I(e),r=t.split(";"),n=r[0],o=r.slice(1),i=n.indexOf("="),s=I(i>0?n.slice(0,i):""),a=i>0?I(n.slice(i+1)):"";if(!(!rr.test(s)||!or(a)||!o.every(zh)))return{key:s,serialized:t}}function Vh(e,t){if(e===void 0)return;if(typeof e!="string"||Buffer.byteLength(e,"utf8")>$h)throw new h("Invalid MCP baggage",403);let r=new Set(t),n=e.split(",");if(n.length>Dh)throw new h("Invalid MCP baggage",403);let o=[];for(let i of n){let s=qh(i);if(!s)throw new h("Invalid MCP baggage",403);r.has(s.key)&&o.push(s.serialized)}return o.length>0?o.join(","):void 0}function bI(e,t={}){let r=m(e)&&m(e._meta)?e._meta:{},n=Vh(r.baggage,t.baggageAllowlist??[]);return{...Uh(r),...n?{baggage:n}:{}}}function SI(e,t){return nr.run(structuredClone(e),t)}function AI(){let e=nr.getStore();return e?{...e}:void 0}async function EI(e){let t=b(e.policy.resourceMetadataUrl,"protected resource metadata URL",!0).href,r=[...new Set(e.policy.requiredScopes??[])];if(r.some(f=>!tr.test(f)))throw new h("Invalid authorization scope",401);let n=`Bearer resource_metadata="${t}"`;if(new URL(e.requestUrl,e.policy.resource).searchParams.has("access_token"))throw new h("Access tokens must not appear in URI query parameters",401,n);let s=Gh(e.headers,"authorization")?.match(/^Bearer ([^\s]+)$/iu);if(!s)throw new h("Missing or malformed bearer token",401,n);let a=s[1];if(Buffer.byteLength(a,"utf8")>Fh)throw new h("Missing or malformed bearer token",401,n);let c;try{c=await e.policy.verifyAccessToken(a)}catch{throw new h("Invalid bearer token",401,n)}let d=Array.isArray(c.audience)?c.audience:[c.audience];if(c.issuer!==e.policy.issuer||!d.includes(e.policy.resource))throw new h("Bearer token issuer or audience mismatch",401,n);let l=r.filter(f=>!c.scopes.includes(f));if(l.length>0)throw new h("Bearer token has insufficient scope",403,`${n}, scope="${l.join(" ")}"`);return{...c,audience:[...d],scopes:[...c.scopes]}}function wI(e){let t=Qt("sha256").update(e.token).digest();return r=>{let n=Qt("sha256").update(r).digest();if(!Rh(t,n))throw new h("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]="e6c49c89-781e-59a3-9c19-6a1c40424587")}catch{}})();var Ue="io.modelcontextprotocol/ui",ce="2026-01-26",ar="text/html;profile=mcp-app",ir=Object.freeze({specVersion:ce,mimeTypes:[ar]});function OI(e){let t=e.clientCapabilities.extensions;if(!m(t))return!1;let r=t[Ue];if(r===void 0)return!1;if(!m(r))throw new p("Invalid MCP Apps client capability",u.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[Ue]:ir}}});let n=r.mimeTypes,o=r.specVersion;if(!Array.isArray(n)||!n.includes(ar)||o!==void 0&&o!==ce)throw new p("Unsupported MCP Apps client capability",u.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[Ue]:ir}}});return!0}var Hh={csp:{connectDomains:[],resourceDomains:[],frameDomains:[]},permissions:{},prefersBorder:!0},cr=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:Hh})));function PI(e){return cr.find(t=>t.uri===e)}function II(e){let t=new Map(cr.map(r=>[r.toolName,r]));return e.map(r=>{let n=t.get(r.name);return n?{...r,_meta:{...r._meta,ui:n.toolMeta}}:{...r}})}function sr(e){return e.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;")}function MI(e){let t=sr(e.name),r=sr(e.description),n=JSON.stringify({name:`pm-${e.id}-view`,version:ce}),o=JSON.stringify(ce);return`<!doctype html>
3
+ <html lang="en">
4
+ <head>
5
+ <meta charset="utf-8">
6
+ <meta name="viewport" content="width=device-width,initial-scale=1">
7
+ <title>${t}</title>
8
+ <style>
9
+ :root{color-scheme:light dark;--ink:#172554;--muted:#526078;--panel:#f8fafc;--line:#cbd5e1;--signal:#0f766e;--accent:#4338ca;--danger:#b91c1c;font-family:Inter,ui-sans-serif,system-ui,sans-serif}
10
+ @media(prefers-color-scheme:dark){:root{--ink:#e0e7ff;--muted:#a8b3c7;--panel:#111827;--line:#334155;--signal:#5eead4;--accent:#a5b4fc;--danger:#fca5a5}}
11
+ *{box-sizing:border-box}body{margin:0;background:var(--panel);color:var(--ink)}main{display:grid;gap:1rem;padding:clamp(.9rem,3vw,1.5rem);max-width:76rem;margin:auto}header{display:grid;gap:.35rem;border-bottom:1px solid var(--line);padding-bottom:.8rem}h1{font-size:clamp(1.2rem,3vw,1.75rem);line-height:1.1;margin:0;letter-spacing:-.02em}p{margin:0;color:var(--muted);line-height:1.5}.status{display:flex;align-items:center;gap:.5rem;font:600 .75rem ui-monospace,monospace;text-transform:uppercase;letter-spacing:.06em}.status::before{content:"";width:.55rem;height:.55rem;border-radius:50%;background:var(--signal)}section{border:1px solid var(--line);border-radius:.8rem;padding:1rem;background:color-mix(in srgb,var(--panel) 92%,var(--accent) 8%)}h2{font-size:.75rem;text-transform:uppercase;letter-spacing:.08em;margin:0 0 .7rem;color:var(--accent)}pre{white-space:pre-wrap;overflow-wrap:anywhere;max-height:34rem;overflow:auto;margin:0;font:500 .78rem/1.55 ui-monospace,SFMono-Regular,monospace;tab-size:2}button{justify-self:start;border:1px solid var(--accent);border-radius:.45rem;background:transparent;color:var(--accent);padding:.55rem .75rem;font:600 .78rem inherit;cursor:pointer}button:focus-visible{outline:3px solid var(--signal);outline-offset:2px}.notice{color:var(--danger)}@media(max-width:40rem){main{padding:.75rem}section{padding:.8rem}pre{max-height:24rem}}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important}}
12
+ </style>
13
+ </head>
14
+ <body>
15
+ <main>
16
+ <header><div class="status" id="status" role="status" aria-live="polite">Connecting to host</div><h1>${t}</h1><p>${r}</p></header>
17
+ <section aria-labelledby="summary-title"><h2 id="summary-title">Authoritative result</h2><pre id="result" tabindex="0">Waiting for the host tool result\u2026</pre></section>
18
+ <section aria-labelledby="input-title"><h2 id="input-title">Invocation context</h2><pre id="input" tabindex="0">No tool input received.</pre></section>
19
+ <button type="button" id="copy">Copy visible evidence</button>
20
+ </main>
21
+ <script>
22
+ (()=>{"use strict";const MAX=24000,status=document.querySelector("#status"),result=document.querySelector("#result"),input=document.querySelector("#input"),pending=new Map();let nextId=1;const render=(node,value)=>{let text;try{text=typeof value==="string"?value:JSON.stringify(value,null,2)}catch{text="Result could not be serialized."}if(text.length>MAX)text=text.slice(0,MAX)+"\\n\\n[View truncated at "+MAX+" characters; use the authoritative pm tool with a cursor or narrower projection.]";node.textContent=text};const send=(message)=>window.parent.postMessage(message,"*");window.addEventListener("message",event=>{if(event.source!==window.parent||!event.data||event.data.jsonrpc!=="2.0")return;const message=event.data;if(message.id!==undefined&&pending.has(message.id)){pending.get(message.id)(message);pending.delete(message.id);return}if(message.method==="ui/notifications/tool-input"||message.method==="ui/notifications/tool-input-partial"){render(input,message.params?.arguments??message.params);status.textContent="Input received"}else if(message.method==="ui/notifications/tool-result"){render(result,message.params);status.textContent="Current tool result"}else if(message.method==="ui/notifications/tool-cancelled"){status.textContent="Tool call cancelled";status.classList.add("notice")}else if(message.method==="ui/notifications/host-context-changed"&&message.params?.theme){document.documentElement.style.colorScheme=message.params.theme}});const request=(method,params)=>new Promise(resolve=>{const id=nextId++;pending.set(id,resolve);send({jsonrpc:"2.0",id,method,params})});document.querySelector("#copy").addEventListener("click",async()=>{const text=result.textContent+"\\n\\n"+input.textContent;try{await navigator.clipboard.writeText(text);status.textContent="Visible evidence copied"}catch{status.textContent="Clipboard permission unavailable";status.classList.add("notice")}});request("ui/initialize",{appInfo:${n},appCapabilities:{},protocolVersion:${o}}).then(message=>{if(message.error){status.textContent="Host rejected MCP App initialization";status.classList.add("notice");return}send({jsonrpc:"2.0",method:"ui/notifications/initialized"});status.textContent="Connected \u2014 awaiting authoritative result"})})();
23
+ </script>
24
+ </body>
25
+ </html>`}import{createHash as je}from"node:crypto";import{lstat as Kh,readdir as hr,readFile as Wh}from"node:fs/promises";import O from"node:path";import{parseDocument as Xh}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]="5f60bc89-c81b-57ee-a8f2-0d0b18d0af1b")}catch{}})();var dr="io.modelcontextprotocol/skills",Be="SEP-2640@a3e147ca2710f68214247aecc729731ee1ae8d03",Yh=Object.freeze({revision:Be,status:"draft",directoryRead:!0});function GI(e,t=!1){let r=e.clientCapabilities.extensions,n=m(r)?r[dr]:void 0;if(!m(n)||n.revision!==Be||t&&n.directoryRead!==!0)throw new p("Missing or incompatible Skills over MCP draft capability",u.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[dr]:Yh}}})}var R=Object.freeze({maxFilesPerSkill:512,maxFileBytes:16*1024*1024,maxSkillBytes:16*1024*1024,defaultPageSize:20,maxPageSize:100}),lr=100,Jh=32*1024*1024,Zh=/^[a-z0-9]+(?:-[a-z0-9]+)*$/u,pr=new Set(Array.from({length:R.maxPageSize},(e,t)=>t+1));function y(e,t){throw new p(e,-32602,t)}function ur(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 Qh(e,t){let r=/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/u.exec(e);r||y(`Skill ${t} is missing YAML frontmatter.`);let n=Xh(r[1],{prettyErrors:!1,strict:!0,uniqueKeys:!0});n.errors.length>0&&y(`Skill ${t} has invalid YAML frontmatter.`,{errors:n.errors.map(i=>i.message)});let o;try{o=n.toJS({maxAliasCount:0})}catch(i){y(`Skill ${t} has unsupported YAML aliases.`,{error:String(i)})}return(typeof o!="object"||o===null||Array.isArray(o))&&y(`Skill ${t} frontmatter must be an object.`),o}async function eg(e,t,r,n){return r>R.maxFileBytes&&y(`Skill resource exceeds the per-file limit: ${t}.`),n.files+=1,n.files>R.maxFilesPerSkill&&y(`Skill exceeds ${R.maxFilesPerSkill} files.`),n.skillBytes+=r,n.skillBytes>R.maxSkillBytes&&y(`Skill exceeds the aggregate byte limit: ${t}.`),n.originBytes.value+=r,n.originBytes.value>Jh&&y(`Skill origin exceeds the aggregate byte limit: ${t}.`),Wh(e)}async function gr(e,t,r){let n=O.join(e,t),o=await hr(n,{withFileTypes:!0}),i=[];for(let s of o.sort((a,c)=>a.name.localeCompare(c.name))){let a=O.posix.join(t.split(O.sep).join("/"),s.name),c=O.join(e,...a.split("/")),d=await Kh(c);d.isSymbolicLink()&&y(`Skill resource must not be a symbolic link: ${a}.`),d.isDirectory()?i.push(...await gr(e,a,r)):d.isFile()?i.push({relative:a,bytes:await eg(c,a,d.size,r)}):y(`Skill resource must be a regular file or directory: ${a}.`)}return i}async function fr(e,t,r){let n=new Map,o;try{o=await hr(e,{withFileTypes:!0})}catch(a){if(et(a))return n;throw a}let i=o.filter(a=>a.isDirectory()&&Zh.test(a.name)).sort((a,c)=>a.name.localeCompare(c.name));i.length>lr&&y(`Skill origin exceeds ${lr} directories.`);let s={value:0};for(let a of i){let c=await gr(O.join(e,a.name),"",{files:0,skillBytes:0,originBytes:s}),d=c.reduce((g,E)=>g+E.bytes.byteLength,0),l=c.find(g=>g.relative==="SKILL.md");if(!l)continue;let f=Qh(l.bytes.toString("utf8"),a.name);f.name!==a.name&&y(`Skill directory ${a.name} must match frontmatter name.`,{actual:f.name??null,expected:a.name}),(typeof f.description!="string"||f.description.trim().length===0)&&y(`Skill ${a.name} requires a non-empty frontmatter description.`,{required:["description"]});let _=c.map(g=>({uri:`skill://${a.name}/${g.relative}`,digest:`sha256:${je("sha256").update(g.bytes).digest("hex")}`,size:g.bytes.byteLength})),C=je("sha256").update(_.map(g=>`${g.uri}:${g.digest}`).join(`
26
+ `)).digest("hex");n.set(a.name,{uri:`skill://${a.name}/SKILL.md`,frontmatter:f,resources:_,_meta:{contractVersion:1,extensionRevision:Be,origin:t,packageVersion:r,protocolVersion:D,trust:"untrusted",estimatedTokens:Math.ceil(d/4)},files:new Map(c.map(g=>[g.relative,g.bytes])),fingerprint:C})}return n}function mr(e){let{files:t,fingerprint:r,...n}=e;return n}var _r=class e{#e;#t;constructor(t){this.#e=t,this.#t=je("sha256").update([...t.entries()].sort(([r],[n])=>r.localeCompare(n)).map(([r,n])=>`${r}:${n.fingerprint}`).join(`
27
+ `)).digest("hex").slice(0,16)}#r(t,r){if(!t)return 0;try{let n=JSON.parse(Buffer.from(t,"base64url").toString("utf8"));return(typeof n!="object"||n===null||!("fingerprint"in n)||n.fingerprint!==this.#t||!("scope"in n)||n.scope!==r||!("offset"in n)||!Number.isInteger(n.offset)||Number(n.offset)<0)&&y("Skill cursor is invalid or stale."),Number(n.offset)}catch(n){if(n instanceof p)throw n;return y("Skill cursor is invalid or stale.")}}#n(t,r){return Buffer.from(JSON.stringify({fingerprint:this.#t,offset:t,scope:r})).toString("base64url")}static async load(t){let r=await fr(O.join(t.packageRoot,".agents","skills"),"package",t.packageVersion);if(t.workspaceRoot){let n=O.resolve(t.packageRoot,".agents","skills"),o=O.resolve(t.workspaceRoot,".agents","skills");if(o!==n){let i=await fr(o,"workspace",t.packageVersion);for(let[s,a]of i)r.set(s,a)}}return new e(r)}list(t={}){let r=t.limit??R.defaultPageSize;pr.has(r)||y(`Skill list limit must be an integer from 1 to ${R.maxPageSize}.`);let n=this.#r(t.cursor,"skills/list"),o=[...this.#e.values()].sort((c,d)=>c.uri.localeCompare(d.uri)),i=o.slice(n,n+r),s=n+i.length,a=s<o.length;return{skills:i.map(mr),hasMore:a,...a?{nextCursor:this.#n(s,"skills/list")}:{}}}get(t){let r=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)\/SKILL\.md$/u.exec(t),n=r?this.#e.get(r[1]):void 0;return n||y(`Unknown pm MCP skill: ${t}.`,{field:"uri"}),mr(n)}read(t){let r=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)\/(.+)$/u.exec(t),n=r?this.#e.get(r[1]):void 0,o=r?.[2]??"",i=n&&o?n.files.get(o):void 0,s=n?.resources.find(d=>d.uri===t);(!n||!i||!s)&&y(`Unknown pm MCP skill resource: ${t}.`,{field:"uri"});let a={digest:s.digest,origin:n._meta.origin,trust:"untrusted"},c=ur(o,i);return c!=="application/octet-stream"?{contents:[{uri:t,mimeType:c,text:i.toString("utf8"),_meta:a}]}:{contents:[{uri:t,mimeType:c,blob:i.toString("base64"),_meta:a}]}}readDirectory(t,r={}){let n=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)(?:\/(.+))?$/u.exec(t),o=n?this.#e.get(n[1]):void 0;o||y(`Unknown pm MCP skill directory: ${t}.`,{field:"uri"});let i=(n?.[2]??"").replace(/\/$/u,""),s=i.length>0?`${i}/`:"",a=`skill://${n[1]}`,c=new Map;for(let E of o.resources){let x=E.uri.slice(`${a}/`.length);if(!x.startsWith(s))continue;let jr=x.slice(s.length),[V,...Br]=jr.split("/"),zr=`${a}/${s}${V}`,qr=o.files.get(`${s}${V}`);c.set(V,{uri:zr,name:V,mimeType:Br.length>0?"inode/directory":ur(V,qr)})}i.length>0&&c.size===0&&y(`Unknown pm MCP skill directory: ${t}.`,{field:"uri"});let d=r.limit??R.maxPageSize;pr.has(d)||y(`Skill directory limit must be an integer from 1 to ${R.maxPageSize}.`);let l=this.#r(r.cursor,t),f=[...c.values()].sort((E,x)=>E.uri.localeCompare(x.uri)),_=f.slice(l,l+d),C=l+_.length,g=C<f.length;return{resources:_,hasMore:g,...g?{nextCursor:this.#n(C,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]="cc0d4dd1-20e8-59d4-acb5-9f8ed639d35f")}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]="fa4eb88d-f50e-59fa-be7f-0cfb42931a73")}catch{}})();var M="https://schema.unbrained.dev/pm/corpus-shape/v1";function F(e,t){if(!Number.isSafeInteger(e)||e<=0)throw new TypeError(`Corpus shape ${t} must be a positive safe integer`);return e}function W(e,t){if(!Number.isSafeInteger(e)||e<0)throw new TypeError(`Corpus shape ${t} must be a non-negative safe integer`);return e}function Cr(e){if(!(typeof e!="object"||e===null||Object.isFrozen(e))){for(let t of Object.values(e))Cr(t);Object.freeze(e)}}function G(e){if(e.schema!==M)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(F(e.hierarchy_depth,"hierarchy_depth"),F(e.hierarchy_fanout,"hierarchy_fanout"),W(e.age_span_days,"age_span_days"),F(e.history_entries_per_item,"history_entries_per_item"),W(e.comments_per_100_items,"comments_per_100_items"),W(e.notes_per_100_items,"notes_per_100_items"),W(e.learnings_per_100_items,"learnings_per_100_items"),F(e.author_cardinality,"author_cardinality"),F(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 Cr(t),t}var de=[{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}],U=Object.freeze({scratch:G({schema:M,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:G({schema:M,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:de,author_cardinality:32,component_count:1,include_cycles:!1,custom_types:["Experiment"],custom_statuses:["review"],terminal_statuses:[],custom_fields:["domain"]}),"deep-graph":G({schema:M,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:de,author_cardinality:16,component_count:1,include_cycles:!0,custom_types:[],custom_statuses:[],terminal_statuses:[],custom_fields:[]}),"multi-decade":G({schema:M,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:de,author_cardinality:64,component_count:1,include_cycles:!1,custom_types:["Program"],custom_statuses:["archived"],terminal_statuses:["archived"],custom_fields:["portfolio"]}),"disconnected-archive":G({schema:M,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:de,author_cardinality:24,component_count:5,include_cycles:!1,custom_types:["Archive"],custom_statuses:["archived"],terminal_statuses:["archived"],custom_fields:["archive_source"]})});function tg(){return Object.keys(U).sort().map(e=>U[e])}function rg(e){let t=e.trim().toLowerCase();if(!Object.hasOwn(U,t))throw new TypeError(`Unknown corpus shape "${e}". Available: ${Object.keys(U).join(", ")}`);return U[t]}var yr=new WeakMap;function Tr(e,t){if(e===0)return[];let r=yr.get(t);r===void 0&&(r=t.edge_kind_mix.flatMap(o=>Array.from({length:o.weight},()=>o.kind)),yr.set(t,r));let n=[r[e%r.length]];return t.include_cycles&&e>2&&e%17===0&&n.push("related"),[...new Set(n)]}function ng(e,t,r,n=42){if(W(t,"item index"),F(r,"item count"),t>=r)throw new RangeError(`Corpus item index ${t} exceeds ${r}`);let o=Math.min(e.component_count,r),i=t%o,s=Math.floor(t/o),a=0,c=1;for(let x=0;x<e.hierarchy_depth;x+=1)a=Math.min(Number.MAX_SAFE_INTEGER,a+c),c=Math.min(Number.MAX_SAFE_INTEGER,c*e.hierarchy_fanout);let d=s%a,l=s-d,f=d===0?void 0:i+(l+Math.floor((d-1)/e.hierarchy_fanout))*o,_=Date.UTC(2026,0,1),C=e.age_span_days*864e5,g=new Date(_+(r===1?0:Math.round(t/(r-1)*C))).toISOString(),E=(t*37+n)%100;return{index:t,id:`pm-s${t.toString(36).padStart(7,"0")}`,...f===void 0?{}:{parent:`pm-s${f.toString(36).padStart(7,"0")}`},component:i,timestamp:g,author:`pm-corpus-agent-${(t+n)%Math.min(e.author_cardinality,r)}`,history_entry_count:e.history_entries_per_item,dependency_kinds:Tr(t,e),has_comment:E<e.comments_per_100_items,has_note:E<e.notes_per_100_items,has_learning:E<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 ze=class{shape;authors=new Set;components=new Set;depths=new Map;childCounts=new Map;edgeKinds={};expectedEdgeKinds={};annotations={comments:0,notes:0,learnings:0};annotationFields;planMismatches=[];itemCount=0;observedDepth=0;observedFanout=0;historyEntryCount=0;firstTimestamp=null;lastTimestamp=null;constructor(t){this.shape=t,this.annotationFields=[["comments","has_comment",t.comments_per_100_items],["notes","has_note",t.notes_per_100_items],["learnings","has_learning",t.learnings_per_100_items]]}recordMismatch(t,r){t&&this.planMismatches.push(r)}recordEdgeKinds(t,r){for(let n of r)t[n]=(t[n]??0)+1}add(t){this.itemCount+=1,this.authors.add(t.author),this.components.add(t.component),this.recordMismatch(this.depths.has(t.id),`duplicate_id:${t.id}`);let r=1;if(t.parent!==void 0){let n=this.depths.get(t.parent);this.recordMismatch(n===void 0,`parent_missing:${t.parent}`),r=(n??0)+1;let o=(this.childCounts.get(t.parent)??0)+1;this.childCounts.set(t.parent,o),this.observedFanout=Math.max(this.observedFanout,o)}this.depths.set(t.id,r),this.observedDepth=Math.max(this.observedDepth,r),this.historyEntryCount+=t.history_entry_count,this.recordMismatch(t.history_entry_count!==this.shape.history_entries_per_item,"history_entries_per_item:drift"),this.firstTimestamp=this.firstTimestamp===null||t.timestamp<this.firstTimestamp?t.timestamp:this.firstTimestamp,this.lastTimestamp=this.lastTimestamp===null||t.timestamp>this.lastTimestamp?t.timestamp:this.lastTimestamp;for(let[n,o]of this.annotationFields)this.annotations[n]+=Number(t[o]);this.recordEdgeKinds(this.edgeKinds,t.dependency_kinds),this.recordEdgeKinds(this.expectedEdgeKinds,Tr(t.index,this.shape))}finish(){let t=Math.min(this.shape.author_cardinality,this.itemCount),r=Math.min(this.shape.component_count,this.itemCount),n=[...this.planMismatches,...this.itemCount===0?["item_count:empty"]:[],...this.authors.size===t?[]:[`author_count:${this.authors.size}!=${t}`],...this.components.size===r?[]:[`component_count:${this.components.size}!=${r}`],...this.observedDepth<=this.shape.hierarchy_depth?[]:[`hierarchy_depth:${this.observedDepth}>${this.shape.hierarchy_depth}`],...this.observedFanout<=this.shape.hierarchy_fanout?[]:[`hierarchy_fanout:${this.observedFanout}>${this.shape.hierarchy_fanout}`]];for(let[s,,a]of this.annotationFields){let c=Math.floor(this.itemCount/100),d=this.itemCount%100,l=c*a+Math.max(0,a+d-100),f=c*a+Math.min(a,d),_=this.annotations[s];(_<l||_>f)&&n.push(`${s}:${_}!in[${l},${f}]`)}let o=new Set([...Object.keys(this.edgeKinds),...Object.keys(this.expectedEdgeKinds)]);for(let s of[...o].sort()){let a=this.edgeKinds[s]??0,c=this.expectedEdgeKinds[s]??0;a!==c&&n.push(`edge_kind:${s}:${a}!=${c}`)}let i=[...new Set(n)];return{shape:this.shape.name,item_count:this.itemCount,author_count:this.authors.size,component_count:this.components.size,hierarchy_depth:this.observedDepth,hierarchy_fanout:this.observedFanout,timestamp_range:{first:this.firstTimestamp,last:this.lastTimestamp},history_entry_count:this.historyEntryCount,annotations:{...this.annotations},edge_kinds:{...this.edgeKinds},matches_declaration:i.length===0,mismatches:i}}};function br(e){return new ze(e)}function og(e,t){let r=br(e);for(let n of t)r.add(n);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]="cea03617-5e90-5683-a9d1-289087ed4646")}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]="8c9a34bd-b77a-55ab-a5d1-3594cecfeb3f")}catch{}})();async function ig(){let e=Ce(process.cwd(),process.env.PM_PATH);await st(e,(t,r)=>at(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]="f48b9002-59dc-54d3-95de-36bf0d11b39a")}catch{}})();var Sr="https://schema.unbrained.dev/pm/workspace-recipe/v1";function qe(e,t){if(e===null||typeof e=="boolean"||typeof e=="string")return e;if(typeof e=="number"){if(!Number.isFinite(e))throw new Error(`Workspace recipe JSON number must be finite at ${t}`);return e}if(Array.isArray(e))return Object.freeze(e.map((r,n)=>qe(r,`${t}[${n}]`)));if(typeof e!="object"||Object.getPrototypeOf(e)!==Object.prototype&&Object.getPrototypeOf(e)!==null)throw new Error(`Workspace recipe input must contain JSON values at ${t}`);return Object.freeze(Object.fromEntries(Object.entries(e).map(([r,n])=>[r,qe(n,`${t}.${r}`)])))}function Ar(e){if(e.schema!==Sr)throw new Error(`Unsupported workspace recipe schema: ${e.schema}`);let t=tt(e);if(e.operations.some(r=>r.action.trim().length===0||r.input===null||Array.isArray(r.input)))throw new Error("Workspace recipe operations require an action and object input");return Object.freeze({...t,operations:Object.freeze(e.operations.map((r,n)=>Object.freeze({action:r.action,input:qe(r.input,`operations[${n}].input`)})))})}async function Er(e,t){let r=Ar(e);return rt(r,t)}async function sg(e,t){return Er(e,async()=>{let r=[];for(let[n,o]of e.operations.entries())r.push(await t(o,n));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]="a108f4d2-80c3-540e-821c-5acdf68eb7fa")}catch{}})();async function ag(){await ct()}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="340305b6-e3c8-5daa-bfbe-4a9c62a6d039")}catch{}})();var wr=["lines","branches","functions","statements"];function cg(e,t){if(typeof t!="object"||t===null||Array.isArray(t))throw new TypeError(`Coverage entry for ${e} must be an object.`)}function dg(e,t,r){if(typeof r!="object"||r===null||Array.isArray(r))throw new TypeError(`Coverage entry ${e} has invalid ${t} counts.`);let n=r;if(typeof n.covered!="number"||typeof n.total!="number"||!Number.isInteger(n.covered)||!Number.isInteger(n.total)||n.covered<0||n.total<n.covered)throw new TypeError(`Coverage entry ${e} has invalid ${t} counts.`);return{covered:n.covered,total:n.total}}function lg(e){if(typeof e!="object"||e===null||Array.isArray(e))throw new TypeError("Coverage summary must be a JSON object.");if(!("total"in e))throw new TypeError("Coverage summary is missing the total entry.");let t=[];for(let[r,n]of Object.entries(e)){cg(r,n);for(let o of wr){let i=dg(r,o,n[o]),s=i.total-i.covered;s>0&&t.push({file:r,metric:o,uncovered:s,...i})}}return t}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="3edb1f4f-d26e-51a8-b62a-caffdd3ac44b")}catch{}})();var pg=["captured_redacted","captured_verbatim"],ug=[{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 A(e){return typeof e=="string"&&e.trim().length>0}function fg(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,n=[];r.boundary_id!==e.id&&n.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||!pg.includes(r.capture_source)||!A(r.capture_provenance)||!Array.isArray(r.redactions)||!r.redactions.every(A)||!("input"in r)||!("observed"in r))&&n.push({boundary_id:e.id,kind:"invalid_fixture",detail:`${e.fixture_path} lacks captured provenance, redaction metadata, input, or observed output.`});let o=JSON.stringify(t);for(let i of ug)i.pattern.test(o)&&n.push({boundary_id:e.id,kind:"unsafe_fixture",detail:`${e.fixture_path} contains a possible ${i.label}.`});return n}function mg(e,t){let r=Date.parse(e.waiver_expires_at),n=A(e.waiver_reason)&&A(e.waiver_owner)&&e.waiver_expires_at.endsWith("Z")&&nt(e.waiver_expires_at)&&Number.isFinite(r);return{captured:0,waived:n&&r>=t?1:0,findings:n?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 _g(e,t,r){if(!A(e.id)||!A(e.producer)||!A(e.consumer)||!A(e.format))return{captured:0,waived:0,findings:[{boundary_id:A(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 n=t[e.fixture_path],o=A(e.fixture_path)&&e.fixture_path in t?fg(e,n):[{boundary_id:e.id,kind:"missing_fixture",detail:`Boundary ${e.id} fixture ${String(e.fixture_path)} is missing.`}];return{captured:o.length===0?1:0,waived:0,findings:o}}return mg(e,r)}function sM(e,t,r=new Date){let n=[];if(e.version!==1||!A(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 o=new Set,i=0,s=0;for(let a of e.boundaries){if(typeof a!="object"||a===null||Array.isArray(a)){n.push({boundary_id:"unknown",kind:"invalid_boundary",detail:"Each boundary must be a JSON object."});continue}let c=a,d=A(c.id)?c.id:void 0;if(d!==void 0&&o.has(d)){n.push({boundary_id:d,kind:"duplicate_boundary",detail:`Boundary ${d} is inventoried more than once.`});continue}d!==void 0&&o.add(d);let l=_g(c,t,r.getTime());i+=l.captured,s+=l.waived,n.push(...l.findings)}return n.sort((a,c)=>a.boundary_id!==c.boundary_id?a.boundary_id.localeCompare(c.boundary_id):a.kind.localeCompare(c.kind)),{ok:n.length===0,boundary_count:e.boundaries.length,captured_count:i,waived_count:s,findings:n}}import j from"node:fs";import Ve 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]="611e9aba-d08e-5c1a-89c9-c7fda0cc9bc9")}catch{}})();var xr=300*1e3,hg=3;function pM(e){return(e?.trim()||"development").replace(/[^a-zA-Z0-9._-]/g,"_").replace(/^\./,"_")}function uM(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.");j.mkdirSync(e,{recursive:!0});let n=Ve.join(e,r);j.mkdirSync(n,{recursive:!0});let o=new Date;j.utimesSync(n,o,o);let i=j.readdirSync(e).filter(d=>d!==r).flatMap(d=>{try{return[{name:d,mtimeMs:j.statSync(Ve.join(e,d)).mtimeMs}]}catch(l){if(l instanceof Error&&"code"in l&&Z(l))return[];throw l}}).sort((d,l)=>l.mtimeMs-d.mtimeMs||d.name.localeCompare(l.name)),s=i.filter(d=>o.getTime()-d.mtimeMs<xr),a=Math.max(0,hg-1-s.length),c=i.filter(d=>o.getTime()-d.mtimeMs>=xr).slice(a).map(d=>d.name).sort((d,l)=>d.localeCompare(l));for(let d of c)j.rmSync(Ve.join(e,d),{recursive:!0,force:!0,maxRetries:3,retryDelay:50});return{retained:r,removed:c}}import Rr from"node:fs";import pe 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]="962636b0-ed3b-5ad0-ae0c-904435025986")}catch{}})();var fe="@unbrained/pm-cli",gg=new Set(["append","claim","changelog","close","close-many","close-task","comments","config","copy","create","dedupe-merge","delete","deps","docs","extension","event","events","files","focus","gc","history-author-acknowledge","history-compact","history-redact","history-repair","init","install","item","learnings","meet","merge","normalize","notes","package","packages","pause-task","plan","profile","reindex","release","remind","restore","schema","start-task","test","test-all","test-runs","test-runs-worker","telemetry","templates","twin","update","update-many","upgrade","vcs","workspace"]),Or=new Set(["--author","--output-budget","--output-format","--output-include","--output-limit","--output-session","--path","--pm-path"]),We=/\b(\d{4})\.(\d{1,2})\.(\d{1,2})(?:-(\d+))?\b/u;function T(e,t){return e.some(r=>t.includes(r.split("=",1)[0]))}function He(e,t){return["activate","adopt","adopt-all","deactivate","init","install","migrate","reload","uninstall"].includes(t[0]??"")||T(e,["--activate","--adopt","--adopt-all","--deactivate","--fix-managed-state","--init","--install","--output","--reload","--scaffold","--uninstall"])}var yg={changelog:(e,t)=>{if(t[0]==="generate")return!T(e,["--check"]);let r=e.indexOf("export");return t[0]==="export"&&(T(e,["--output"])||r>=0&&e[r+1]!==void 0&&!e[r+1].startsWith("-"))},comments:e=>T(e,["--add","--delete","--edit","--file","--stdin"]),config:(e,t)=>(t[0]==="project"||t[0]==="global"?t[1]:t[0])==="set",deps:()=>!1,docs:e=>T(e,["--add","--add-glob","--migrate","--remove"]),duplicates:()=>!1,events:()=>!1,extension:He,files:(e,t)=>T(e,["--add","--add-glob","--migrate","--remove"])||t[0]==="discover"&&T(e,["--apply"]),health:e=>!T(e,["--check-only","--no-refresh","--skip-vectors"]),learnings:e=>T(e,["--add","--delete","--edit","--file","--stdin"]),merge:(e,t)=>t[0]!=="report",notes:e=>T(e,["--add","--delete","--edit","--file","--stdin"]),package:He,packages:He,profile:(e,t)=>t[0]==="apply",schema:(e,t)=>["add-field","add-status","add-type","remove-field","remove-status","remove-type","remap-status","rename-field","rename-type"].includes(t[0]??"")&&!(T(e,["--infer"])&&!T(e,["--apply"])),telemetry:(e,t)=>t.slice(0,2).some(r=>["clear","flush"].includes(r)),templates:(e,t)=>t[0]==="save",test:e=>T(e,["--add","--add-json","--background","--measure","--remove","--resume","--run","--stop"]),validate:e=>T(e,["--auto-fix","--prune-missing"]),vcs:(e,t)=>["abandon","create","merge","propose","ref-create"].includes(t[0]??""),workspace:(e,t)=>t[0]==="snapshot"&&["create","delete","restore"].includes(t[1]??"")};function ue(e){let t=e.match(We);return t?[Number(t[1]),Number(t[2]),Number(t[3]),Number(t[4]??0)]:null}function le(e,t){let r=ue(e),n=ue(t);if(!r||!n)return null;for(let o=0;o<r.length;o+=1){let i=r[o]-n[o];if(i!==0)return Math.sign(i)}return 0}function Ke(e){try{let t=JSON.parse(Rr.readFileSync(e,"utf8"));return typeof t=="object"&&t!==null&&!Array.isArray(t)?t:null}catch{return null}}function Cg(e){let t=[];for(let r of["dependencies","devDependencies","optionalDependencies","peerDependencies"]){let n=e[r];if(typeof n!="object"||n===null)continue;let o=n[fe],i=typeof o=="string"?o.trim():"",s=/^[<!]/u.test(i)?void 0:i.match(We)?.[0];s&&t.push(s)}return t.sort((r,n)=>le(n,r))[0]}function Tg(e){let r=Ke(pe.join(e,"package-lock.json"))?.packages;if(typeof r!="object"||r===null)return;let n=r["node_modules/@unbrained/pm-cli"];if(typeof n!="object"||n===null)return;let o=n.version;return typeof o=="string"?o:void 0}function bg(e,t){try{let r=Rr.readFileSync(pe.join(e,t),"utf8").split(/\r?\n/u),n=r.findIndex(c=>c.includes(fe));if(n<0)return;let o=r[n].match(/^\s*/u)[0].length,i=[r[n]];for(let c=n+1;c<r.length;c+=1){let d=r[c],l=d.trim(),f=d.match(/^\s*/u)[0].length;if(l.length>0&&f<=o)break;i.push(d)}return i.join(`
28
+ `).match(/^\s*version(?::\s*|\s+)["']?(\d{4}\.\d{1,2}\.\d{1,2}(?:-\d+)?)/mu)?.[1]??i[0].match(We)?.[0]}catch{return}}function Sg(e){let t=[],r=Ke(pe.join(e,"package.json")),n=r?Cg(r):void 0;n&&t.push({version:n,source:"package.json"});let i=Ke(pe.join(e,"node_modules","@unbrained","pm-cli","package.json"))?.version;typeof i=="string"&&ue(i)&&t.push({version:i,source:"installed-package"});let s=Tg(e);s&&ue(s)&&t.push({version:s,source:"package-lock.json"});for(let a of["pnpm-lock.yaml","yarn.lock"]){let c=bg(e,a);c&&t.push({version:c,source:a})}return t}function Pr(e){for(let t=0;t<e.length;t+=1){let r=e[t];if(Or.has(r)){t+=1;continue}if(!r.startsWith("-"))return{command:r.toLowerCase(),index:t}}}function Ag(e){let t=Pr(e);if(!t||T(e,["--help","-h","--dry-run"]))return!1;let{command:r,index:n}=t,o=[];for(let s=n+1;s<e.length;s+=1){let a=e[s];if(Or.has(a)){s+=1;continue}a.startsWith("-")||o.push(a.toLowerCase())}let i=yg[r];return i?i(e,o):gg.has(r)}function Eg(e){let t=Pr(e.argv)?.command,r=Ag(e.argv),o=Sg(e.projectRoot).filter(a=>le(a.version,e.executingVersion)!==null).sort((a,c)=>le(c.version,a.version))[0],i=o!==void 0&&le(e.executingVersion,o.version)===-1,s=i&&!r?{code:"project_runtime_stale_read",executing_version:e.executingVersion,project_version:o.version,source:o.source,message:"This read is using an older pm runtime than the project requires.",next_steps:[`Run the command through the project's installed ${fe} ${o.version}.`,"Install the project dependencies with its declared package manager if the local executable is missing."]}:void 0;return{compatible:!r||!i||e.allowStale===!0,executing_version:e.executingVersion,...o?{project_version:o.version,source:o.source}:{},...t?{command:t}:{},mutating:r,stale:i,...s?{warning:s}:{},override_applied:i&&r&&e.allowStale===!0}}function yM(e){let t=Eg(e);if(t.compatible)return t;throw new ye(`pm ${t.executing_version} cannot mutate a project pinned to newer pm ${t.project_version}.`,N.CONFLICT,{code:"project_runtime_stale_mutation",reason:t.source,why:"An older runtime can write storage, history, and merge contracts it does not understand.",nextSteps:[`Run this command through the project's installed ${fe} ${t.project_version}.`,"For an intentional recovery only, set PM_ALLOW_STALE_CLI=1 for this invocation and record why.","Read-only commands remain available without an override."]})}import{createHash as 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]="4586a8b2-07c8-53d4-9c5d-ca557ee07977")}catch{}})();var Xe=1;function B(e){e?.throwIfAborted()}function k(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 n=Date.parse(r.createdAt??new Date().toISOString());if(!Number.isFinite(n))throw new TypeError("Relationship graph createdAt must be a valid timestamp");let o=e.nodes(),i=e.edges(),s=t.list();return Object.freeze({version:Xe,fingerprint:wg("sha256").update(Q({nodes:o,edges:i,kinds:s})).digest("hex"),created_at:new Date(n).toISOString(),nodes:o,edges:i,kinds:s})}function xg(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Y(e){if(!xg(e))throw new TypeError("Relationship graph snapshot must be an object");if(e.version!==Xe)throw new TypeError(`Unsupported relationship graph snapshot version: ${String(e.version)}`);if(!Array.isArray(e.nodes)||e.nodes.some(o=>typeof o!="string"))throw new TypeError("Relationship graph snapshot nodes must be strings");if(!Array.isArray(e.edges)||!Array.isArray(e.kinds))throw new TypeError("Relationship graph snapshot edges and kinds must be arrays");if(typeof e.created_at!="string"||!Number.isFinite(Date.parse(e.created_at)))throw new TypeError("Relationship graph snapshot created_at must be valid");if(typeof e.fingerprint!="string")throw new TypeError("Relationship graph snapshot fingerprint must be a string");let t=new Te([]);for(let o of e.kinds)t.register(o);let r=new L(e.nodes,e.edges,t),n=z(r,t,{createdAt:e.created_at});if(n.fingerprint!==e.fingerprint)throw new TypeError("Relationship graph snapshot fingerprint mismatch");return{snapshot:n,registry:t,graph:r}}async function P(e,t){k(e.name,"adapter name");let r=k(t.workspace,"workspace");B(t.signal);let n=await e.read({...t,workspace:r});return B(t.signal),n===null?null:Y(n)}async function me(e,t){let r=k(t.workspace,"workspace"),n=Y(t.snapshot).snapshot,o=await P(e,{workspace:r,signal:t.signal});if(o?.snapshot.fingerprint===n.fingerprint)return{adapter:e.name,workspace:r,disposition:"current",fingerprint:n.fingerprint,previous_fingerprint:o.snapshot.fingerprint,node_count:n.nodes.length,edge_count:n.edges.length};if(B(t.signal),await e.replace({workspace:r,signal:t.signal,snapshot:n,expected_fingerprint:o?.snapshot.fingerprint??null}),(await P(e,{workspace:r,signal:t.signal}))?.snapshot.fingerprint!==n.fingerprint)throw new Error(`Relationship graph adapter "${e.name}" did not expose the replaced snapshot`);return{adapter:e.name,workspace:r,disposition:"written",fingerprint:n.fingerprint,...o?{previous_fingerprint:o.snapshot.fingerprint}:{},node_count:n.nodes.length,edge_count:n.edges.length}}function Rg(e,t={}){let r=e.map(Y),n=new Map;for(let s of r)for(let a of s.snapshot.kinds){let c=n.get(a.kind);if(c&&Q(c)!==Q(a))throw new TypeError(`Conflicting federated relationship kind: ${a.kind}`);n.set(a.kind,a)}let o=new Te([...n.values()].sort((s,a)=>s.kind.localeCompare(a.kind))),i=new L(new Set(r.flatMap(s=>[...s.snapshot.nodes])),r.flatMap(s=>[...s.snapshot.edges]),o);return z(i,o,t)}var X=class{name;#e=new Map;constructor(t="memory"){this.name=k(t,"adapter name")}async read(t){B(t.signal);let r=this.#e.get(k(t.workspace,"workspace"));return r?structuredClone(r):null}async replace(t){B(t.signal);let r=k(t.workspace,"workspace"),n=this.#e.get(r);if(t.expected_fingerprint!==void 0&&(n?.fingerprint??null)!==t.expected_fingerprint)throw new Error(`Relationship graph adapter conflict for ${r}`);this.#e.set(r,structuredClone(Y(t.snapshot).snapshot))}async clear(t){B(t.signal);let r=k(t.workspace,"workspace"),n=this.#e.get(r);if(t.expected_fingerprint!==void 0&&(n?.fingerprint??null)!==t.expected_fingerprint)throw new Error(`Relationship graph adapter conflict for ${r}`);this.#e.delete(r)}};(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="423d6e5d-93e5-5f29-93e0-11ddca9c3156")}catch{}})();function Ir(e,t){if(!Number.isInteger(e)||e<1)throw new TypeError(`Relationship graph ${t} must be a positive integer`);return e}function Og(e){let t=Ir(e.nodeCount,"nodeCount"),r=Ir(e.edgeStride??1,"edgeStride"),n=e.topology??"chain";if(!["chain","star","disconnected"].includes(n))throw new TypeError(`Unsupported relationship graph topology: ${n}`);let o=(e.kind??"related").trim(),i=(e.idPrefix??"node").trim();if(!o||!i)throw new TypeError("Relationship graph kind and idPrefix must be non-empty");let s=n==="disconnected"?0:Math.floor((t-1)/r);return{node_count:t,edge_count:s,edge_basis:"fixture_generated",nodes:{*[Symbol.iterator](){for(let a=0;a<t;a+=1)yield`${i}-${a}`}},edges:{*[Symbol.iterator](){if(n!=="disconnected")for(let a=r;a<t;a+=r)yield{source:`${i}-${n==="star"?0:a-r}`,target:`${i}-${a}`,kind:o}}}}}function v(e,t){if(!e)throw new Error(`Relationship graph adapter conformance: ${t}`)}async function Mr(e,t={}){let r=t.workspace?.trim()||"pm-graph-conformance",n=ot(),o=z(new L(["a","b"],[{source:"a",target:"b",kind:"related"}],n),n,{createdAt:"2026-01-01T00:00:00.000Z"}),i=z(new L(["a","b","c"],[{source:"a",target:"b",kind:"related"},{source:"b",target:"c",kind:"blocked_by"}],n),n,{createdAt:"2026-01-02T00:00:00.000Z"}),s=[];v(await P(e,{workspace:r})===null,"workspace must start empty"),s.push({name:"empty-read",passed:!0});let a=await me(e,{workspace:r,snapshot:o});v(a.disposition==="written","first sync must write"),s.push({name:"atomic-replace",passed:!0}),(await e.read({workspace:r})).nodes.push("mutated-reader-copy"),v((await P(e,{workspace:r}))?.snapshot.nodes.length===2,"reads must not mutate stored state"),s.push({name:"read-isolation",passed:!0}),v((await me(e,{workspace:r,snapshot:o})).disposition==="current","identical sync must be idempotent"),s.push({name:"idempotent-sync",passed:!0}),await e.replace({workspace:r,snapshot:i,expected_fingerprint:o.fingerprint}),v((await P(e,{workspace:r}))?.snapshot.fingerprint===i.fingerprint,"replacement must become visible"),s.push({name:"replacement-visibility",passed:!0});let d=!1;try{await e.replace({workspace:r,snapshot:o,expected_fingerprint:o.fingerprint})}catch{d=!0}return v(d,"stale compare-and-swap must fail"),s.push({name:"stale-cas",passed:!0}),e.clear&&(await e.clear({workspace:r,expected_fingerprint:i.fingerprint}),v(await P(e,{workspace:r})===null,"clear must remove the workspace"),s.push({name:"clear",passed:!0})),{adapter:e.name,workspace:r,cases:Object.freeze(s),clear_supported:e.clear!==void 0}}function Pg(e){return Mr(new X,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]="20842b89-cef6-542e-b069-76c22b340f1d")}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]="5133d678-01f4-5164-aea7-2cc5ed42dd58")}catch{}})();import{createHash as kr}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]="54a3448c-719c-5404-a9b9-c3072a2fdce2")}catch{}})();function vr(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship backfill ${t} must be non-empty`);return e.trim()}function qM(e,t){let r=vr(t.migrationId,"migrationId"),n=vr(t.author,"author"),o=Date.parse(t.timestamp);if(!Number.isFinite(o))throw new TypeError("Relationship backfill timestamp must be valid");let i=new Date(o).toISOString(),s=Re(e,void 0,t.registry),a=s.graph.nodes(),c=s.graph.edges().map(_=>{let C=kr("sha256").update(JSON.stringify([r,_.kind,_.source,_.target,_.createdAt??null,_.author??null,_.payload??null])).digest("hex").slice(0,24);return Object.freeze({eventId:`backfill:${r}:${C}`,relationshipId:`migration:${r}:${C}`,action:"add",edge:_,author:n,timestamp:i,reason:`Backfill ${r} from legacy item metadata`})}),d=kr("sha256").update(JSON.stringify({migrationId:r,nodes:a,events:c})).digest("hex"),l=new Set([...t.existingEventIds??[]].filter(_=>typeof _=="string").map(_=>_.trim()).filter(Boolean)),f=c.filter(_=>!l.has(_.eventId));return Object.freeze({migration_id:r,fingerprint:d,nodes:a,events:Object.freeze(f),edge_count:c.length,skipped_existing_count:c.length-f.length,duplicate_dependency_rows:s.duplicateRows.length,dangling_reference_count:s.dangling.active.length+s.dangling.legacy_terminal.length})}import*as Nr 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]="4f4e7daa-14aa-5dad-8a30-79a4d76159d4")}catch{}})();var J=["suggested_retry","candidate_command","example","next_step","migration_hint","restore_with"],Ye={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"}},HM=Object.freeze(Object.keys(Ye));function Lr(e){if(Object.hasOwn(Ye,e))return Ye[e]}var Ig=new Set([..."=([{,:;!?&|+-*%^~<>","=>"]);function q(e,t){return e<t?-1:e>t?1:0}function Mg(e,t){let r=e[t],n=t+1,o="";for(;n<e.length&&e[n]!==r;)e[n]==="\\"?n+=2:(o+=e[n],n+=1);return e[n]===r&&(n+=1),{next:n,value:o}}function kg(e){return e===void 0||e.kind==="punctuator"&&Ig.has(e.value)||e.kind==="identifier"&&["return","case","throw","else","yield"].includes(e.value)}function vg(e,t){if(/\s/u.test(e[t]))return t+1;if(e.startsWith("//",t)){let r=e.indexOf(`
29
+ `,t+2);return r===-1?e.length:r+1}if(e.startsWith("/*",t))return e.indexOf("*/",t+2)+2}function Ng(e,t,r){if(e[t]!=="/"||!kg(r))return;let n=t+1,o=!1;for(;n<e.length;)if(e[n]==="\\")n+=2;else if(e[n]==="[")o=!0,n+=1;else if(e[n]==="]")o=!1,n+=1;else if(e[n]==="/"&&!o){for(n+=1;/[A-Za-z]/u.test(e.charAt(n));)n+=1;return n}else n+=1;return n}function Lg(e,t){let r=e[t];if(r==="'"||r==='"'||r==="`"){let o=Mg(e,t);return r==="`"?{next:o.next}:{next:o.next,token:{kind:"string",value:o.value,offset:t+1}}}if(/[A-Za-z_$]/u.test(r)){let o=t+1;for(;/[A-Za-z0-9_$]/u.test(e[o]??"");)o+=1;return{next:o,token:{kind:"identifier",value:e.slice(t,o),offset:t}}}let n=e.startsWith("=>",t)?"=>":r;return{next:t+n.length,token:{kind:"punctuator",value:n,offset:t}}}function Dg(e){let t=[],r=0;for(;r<e.length;){let n=vg(e,r);if(n!==void 0){r=n;continue}let o=Ng(e,r,t.at(-1));if(o!==void 0){r=o;continue}let i=Lg(e,r);i.token&&t.push(i.token),r=i.next}return t}var $g=new Set(["object","block","pattern"]),Fg=new Set(["const","let","var"]),Gg=new Set(["}",")","]"]),Ug=new Set(["=","(","[",",",":","?","return"]);function jg(e,t,r){if([...r].reverse().find(i=>$g.has(i.kind))?.kind==="pattern"||r.at(-1)?.kind==="paren"&&r.at(-1)?.parameter_list)return"pattern";let o=e[t-1];return o?.kind==="identifier"&&Fg.has(o.value)?"pattern":o?.value==="=>"||o?.value===")"?"block":o&&Ug.has(o.value)?"object":"block"}function Bg(e,t,r){let n=e[t];if(n.value==="{"){let a=jg(e,t,r);return{kind:a,...a==="object"?{member_start:!0,candidates:[]}:{}}}if(n.value==="[")return{kind:"array"};if(n.value!=="(")return;let o=e[t-1],i=e[t-2];return{kind:"paren",...o?.value==="function"||i?.value==="function"?{parameter_list:!0}:{}}}function zg(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 qg(e,t){return e[t+1]?.value===")"&&e[t+2]?.value==="=>"||e[t+1]?.value==="="}function Vg(e){let t=Dg(Nr.stripTypeScriptTypes(e,{mode:"strip"})),r=[],n=[];for(let[o,i]of t.entries()){let s=n.at(-1),a=zg(s,i,t[o+1]);a&&s.candidates.push(a);let c=Bg(t,o,n);if(c)n.push(c);else if(Gg.has(i.value)){let d=n.pop();d?.kind==="object"&&!qg(t,o)&&r.push(...d.candidates)}else i.value===","&&s?.kind==="object"?s.member_start=!0:s?.kind==="object"&&i.value!==":"&&(s.member_start=!1)}return r}function Hg(e){let t=[0];for(let r=0;r<e.length;r+=1)e[r]===`
30
+ `&&t.push(r+1);return t}function Kg(e,t){let r=0,n=e.length;for(;r<n;){let o=Math.floor((r+n)/2);e[o]<=t?r=o+1:n=o}return r}function KM(e){let t=[],r=[];for(let o of[...e].sort((i,s)=>q(i.path,s.path))){let i=Hg(o.content),s;try{s=Vg(o.content)}catch(a){r.push({kind:"invalid_source",subject:o.path,detail:`${o.path} could not be parsed for recovery producers: ${String(a)}.`});continue}for(let a of s){let c=a.field,d=Kg(i,a.offset),l=Lr(c);l?t.push({path:o.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:`${o.path}:${d}:${c}`,detail:`${c} resembles a recovery reference but has no typed field contract.`})}}let n=Object.fromEntries(J.map(o=>[o,t.filter(i=>i.kind===o).length]));for(let o of J)n[o]===0&&r.push({kind:"missing_kind_producer",subject:o,detail:`No source producer emits the ${o} recovery-reference kind.`});return t.sort((o,i)=>o.path!==i.path?q(o.path,i.path):o.line!==i.line?o.line-i.line:q(o.field,i.field)),r.sort((o,i)=>o.subject!==i.subject?q(o.subject,i.subject):q(o.kind,i.kind)),{ok:r.length===0,scanned_file_count:e.length,producer_count:t.length,producer_count_by_kind:n,producers:t,findings:r}}function WM(e,t){let r=[],n=(o,i)=>{if(Array.isArray(o)){o.forEach((s,a)=>n(s,[...i,String(a)]));return}if(!(typeof o!="object"||o===null))for(let[s,a]of Object.entries(o).sort(([c],[d])=>q(c,d))){let c=Lr(s),d=c?.kind==="migration_hint"&&o.semantics==="behavior_preserving"?{...c,semantics:"behavior_preserving"}:c,l=[a].flat();d!==void 0&&l.forEach((f,_)=>{let C="nested_value_field"in d&&typeof d.nested_value_field=="string"?d.nested_value_field:void 0,g=C&&typeof f=="object"&&f!==null&&!Array.isArray(f)?f[C]:f;if(typeof g!="string"||g.trim().length===0)return;let E=[...i,s,String(_)].map(x=>encodeURIComponent(x)).join("/");r.push({id:`${e}:${d.kind}:${E}`,probe_id:e,kind:d.kind,semantics:d.semantics,value:g})}),n(a,[...i,s])}};return n(t,[]),r}function XM(e,t){let r=e.flatMap(s=>(s.owned_states??[]).map(a=>({contract:s,state:a}))),n=[],o=new Map;for(let s of t){if(o.has(s.probe_id)){n.push({kind:"duplicate_probe",probe_id:s.probe_id,detail:`Observation ${s.probe_id} was supplied more than once.`});continue}o.set(s.probe_id,s)}let i=new Set(r.map(({state:s})=>s.probe_id));for(let{contract:s,state:a}of r){let c=o.get(a.probe_id);if(!c){n.push({kind:"missing_probe",probe_id:a.probe_id,detail:`No entrypoint observation was recorded for ${s.code}.`});continue}c.code!==s.code&&n.push({kind:"wrong_error_code",probe_id:a.probe_id,detail:`Expected ${s.code}; observed ${c.code}.`}),c.exit_class!==a.expected_exit_class&&n.push({kind:"wrong_exit_class",probe_id:a.probe_id,detail:`Expected ${a.expected_exit_class}; observed ${c.exit_class}.`}),a.entrypoints.includes(c.entrypoint)||n.push({kind:"wrong_entrypoint",probe_id:a.probe_id,detail:`Expected one of ${a.entrypoints.join(", ")}; observed ${c.entrypoint}.`})}for(let s of t)i.has(s.probe_id)||n.push({kind:"undeclared_probe",probe_id:s.probe_id,detail:`Observation ${s.probe_id} has no catalog declaration.`});return n.sort((s,a)=>s.probe_id!==a.probe_id?s.probe_id.localeCompare(a.probe_id):s.kind.localeCompare(a.kind)),{ok:n.length===0,declared_probe_count:r.length,observed_probe_count:t.length,findings:n}}function YM(e,t){let r=[],n=new Set,o=new Set;for(let c of e){if(n.has(c.id)){o.add(c.id),r.push({kind:"duplicate_obligation",reference_id:c.id,detail:`Recovery obligation ${c.id} was declared more than once.`});continue}n.add(c.id)}let i=new Map;for(let c of t){if(i.has(c.id)){r.push({kind:"duplicate_observation",reference_id:c.id,detail:`Recovery reference ${c.id} was observed more than once.`});continue}i.set(c.id,c),n.has(c.id)||r.push({kind:"undeclared_observation",reference_id:c.id,detail:`Recovery observation ${c.id} has no emitted obligation.`})}for(let c of e){if(o.has(c.id))continue;let d=i.get(c.id);d?d.reachable?d.semantics!==c.semantics&&r.push({kind:"wrong_semantics",reference_id:c.id,detail:`Recovery reference ${c.value} promised ${c.semantics}; proof demonstrated ${d.semantics}.`}):r.push({kind:"unreachable_reference",reference_id:c.id,detail:`Recovery reference ${c.value} did not reach its promised target.`}):r.push({kind:"missing_observation",reference_id:c.id,detail:`No reachability proof was recorded for ${c.kind} ${c.value}.`})}let s=J.map(c=>{let d=e.filter(f=>f.kind===c),l=d.filter(f=>!o.has(f.id)).map(f=>i.get(f.id)).filter(f=>f!==void 0);return{kind:c,declared:d.length,observed:l.length,passed:d.filter(f=>{let _=i.get(f.id);return!o.has(f.id)&&_?.reachable===!0&&_.semantics===f.semantics}).length}});r.sort((c,d)=>c.reference_id!==d.reference_id?c.reference_id.localeCompare(d.reference_id):c.kind.localeCompare(d.kind));let a=s.reduce((c,d)=>c+d.passed,0);return{ok:r.length===0,declared_reference_count:e.length,observed_reference_count:t.length,pass_fraction:n.size===0?1:a/n.size,coverage_by_kind:s,findings:r}}function Wg(e,t){let r=new Map(J.map(i=>[i,new Set]));for(let i of t)r.get(i.kind).add(i.value);let n=J.map(i=>({kind:i,source_producers:e.producer_count_by_kind[i],runtime_values:r.get(i).size})),o=n.filter(({source_producers:i,runtime_values:s})=>i>0&&s===0).map(({kind:i})=>i);return{ok:e.ok&&o.length===0,source_producer_count:e.producer_count,runtime_value_count:n.reduce((i,{runtime_values:s})=>i+s,0),coverage_by_kind:n,missing_runtime_kinds:o}}var JM=Wg;(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="a1efaf49-c6ca-53dd-8fad-eb2540c20cc8")}catch{}})();var QM=16,Xg=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"]),Dr=18,$r=Object.freeze([...Xg,"manifest_unknown_key","no_version_bounds_declared"].sort((e,t)=>e.localeCompare(t)));function ek(e,t=Dr){return{ok:e.executable_error_code_count>=t,baseline:t,actual:e.executable_error_code_count}}function tk(e,t=$r){let r=new Set(e.rows.filter(({disposition:o})=>o==="executable").map(({canonical_code:o})=>o)),n=t.filter(o=>!r.has(o));return{ok:n.length===0,required_canonical_codes:[...t],missing_required_canonical_codes:n}}function Je(e,t){let r=e.get(t);if(r)return r;let n={kinds:new Set,probeIds:new Set};return e.set(t,n),n}function rk(e,t,r){let n=new Map(e.map(l=>[l.code,l.canonical_code??l.code])),o=new Map,i=0,s=0;for(let l of e){let f=Je(o,l.canonical_code??l.code);for(let _ of l.owned_states??[])f.kinds.add("owned_state"),f.probeIds.add(_.probe_id)}for(let l of t){let f=n.get(l.error_code);if(f===void 0)continue;i+=1;let _=Je(o,f);_.kinds.add("closed_domain"),_.probeIds.add(l.probe_id)}for(let l of r){let f=n.get(l.error_code);if(f===void 0)continue;s+=1;let _=Je(o,f);_.kinds.add("grammar"),_.probeIds.add(l.probe_id)}let a=e.map(l=>{let f=l.canonical_code??l.code,_=o.get(f),C=[..._.probeIds].sort();return{code:l.code,canonical_code:f,disposition:C.length>0?"executable":"uncovered",evidence_kinds:[..._.kinds].sort(),probe_ids:C}}).sort((l,f)=>l.code<f.code?-1:1),c=a.filter(({disposition:l})=>l==="uncovered").map(({code:l})=>l),d=a.length-c.length;return{ok:c.length===0,catalog_error_code_count:a.length,executable_error_code_count:d,uncovered_error_code_count:c.length,coverage_fraction:a.length===0?1:d/a.length,closed_domain_probe_count:i,grammar_probe_count:s,uncovered_error_codes:c,rows:a}}function nk(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: ${Dr}`,`- Required executable canonical codes: ${$r.map(r=>`\`${r}\``).join(", ")}`,`- Uncovered error codes: ${e.uncovered_error_code_count}`,`- Coverage fraction: ${e.coverage_fraction.toFixed(6)}`,`- Closed-domain probes: ${e.closed_domain_probe_count}`,`- Grammar probes: ${e.grammar_probe_count}`,"","| Error code | Canonical code | Disposition | Evidence kinds | Probe count |","| --- | --- | --- | --- | --- |",...t,""].join(`
31
+ `)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="0ec8c375-e58e-5ce4-b0aa-8a8a4dfa0778")}catch{}})();function Yg(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 Jg(e){return[e.exit_code!==N.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 ${N.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."},...Yg(e)]}function sk(e){let t=[],r=new Set,n=0;e.length===0&&t.push({code:"empty_corpus",probe_id:"corpus",detail:"At least one real refusal observation is required."});for(let o of e){if(r.has(o.probe_id)){t.push({code:"duplicate_probe",probe_id:o.probe_id,detail:`${o.probe_id} was supplied more than once.`});continue}r.add(o.probe_id);let i=t.length;for(let s of Jg(o))s!==void 0&&t.push(s);t.length===i&&(n+=1)}return t.sort((o,i)=>o.probe_id!==i.probe_id?o.probe_id.localeCompare(i.probe_id):o.code.localeCompare(i.code)),{ok:t.length===0,probe_count:r.size,closed_probe_count:n,closure_fraction:r.size===0?0:n/r.size,findings:t}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="2e90ea29-2708-5af8-b390-599be97718e7")}catch{}})();var Fr="not-a-declared-action";function Zg(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 Ze(e){return e.replaceAll(/[^a-z0-9]+/gu,"-").replaceAll(/^-|-$/gu,"")}function mk(e=we.filter(t=>dt.some(r=>r.command===t.command&&r.disposition!=="package_owned"))){return e.flatMap(t=>t.slots.flatMap((r,n)=>{if(!r.required)return[];let o=t.command.split(" "),i=H(t.command).flatMap(a=>a.required?[a.flag,...a.value_name?["example"]:[]]:[]),s=Ee.some(a=>a.command===t.command);return[{probe_id:`required-argument-${Ze(t.command)}-${Ze(r.name)}`,command:t.command,refusal_args:[...o,...t.slots.slice(0,n).map(a=>Zg(t.command,a)),...i],recovery_args:[...o,"--help"],error_code:s&&!t.command.startsWith("assurance ")?"invalid_argument_value":/^extension (?:activate|adopt|deactivate|uninstall)$/u.test(t.command)?"missing_lifecycle_target":"missing_required_argument",missing_argument:r.name,missing_argument_index:n}]})).sort((t,r)=>t.probe_id.localeCompare(r.probe_id))}function Qg(e){switch(e){case"assurance":case"workspace snapshot":return Ee.filter(({parent:t})=>t===e).map(({action:t})=>t);case"graph":return be;case"merge":return Se;case"plan":return Oe;case"profile":return Pe;case"schema":return pt;default:throw new Error(`Required positional action family ${e} has no authoritative value domain.`)}}function _k(e=we){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-${Ze(t)}`,command:t,refusal_args:[...r,Fr],recovery_args:[...r,"--help"],error_code:"unknown_subcommand",rejected_value:Fr,allowed_values:[...Qg(t)].sort()}}).sort((t,r)=>t.probe_id.localeCompare(r.probe_id))}function ey(e,t){let r=[...t].sort();return e.length===t.length&&[...e].sort().every((n,o)=>n===r[o])}function ty(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&&!ey(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 hk(e,t){let r=new Map(e.map(s=>[s.probe_id,s])),n=new Map(t.map(s=>[s.probe_id,s])),o=[...e.flatMap(s=>ty(s,n.get(s.probe_id))),...t.filter(s=>!r.has(s.probe_id)).map(s=>({code:"unexpected_refusal_probe",probe_id:s.probe_id,detail:`${s.probe_id} has no declared grammar refusal contract.`}))];o.sort((s,a)=>s.probe_id.localeCompare(a.probe_id)||s.code.localeCompare(a.code));let i=new Set(o.map(({probe_id:s})=>s));return{ok:o.length===0,probe_count:e.length,closed_probe_count:e.filter(({probe_id:s})=>!i.has(s)).length,findings:o}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="941a11a9-f756-56b3-9dc1-8afd78bc9328")}catch{}})();var Qe=[{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 yk(){return Qe.map(e=>({...e}))}function ry(e,t){let r=[];t.error_code!==e.expected_error_code&&r.push({code:"error_code_mismatch",probe_id:e.probe_id,detail:`Expected ${e.expected_error_code}, received ${t.error_code}.`}),t.exit_code!==e.expected_exit_code&&r.push({code:"exit_code_mismatch",probe_id:e.probe_id,detail:`Expected exit ${e.expected_exit_code}, received ${t.exit_code}.`}),t.recovery_kind!==e.recovery_kind&&r.push({code:"recovery_kind_mismatch",probe_id:e.probe_id,detail:`Expected ${e.recovery_kind}, received ${t.recovery_kind}.`});let n=t.suggested_retry_args.indexOf("init"),o=n===0||n===2&&t.suggested_retry_args[0]==="--pm-path"&&t.suggested_retry_args[1]?.length>0;return e.recovery_kind==="initialize"&&!o&&r.push({code:"missing_init_recovery",probe_id:e.probe_id,detail:"Missing and uninitialized roots must emit a tokenized init retry."}),(t.unsafe_init_recommended||e.recovery_kind!=="initialize"&&t.suggested_retry_args.includes("init"))&&r.push({code:"unsafe_init_recovery",probe_id:e.probe_id,detail:"A tracker root that cannot be initialized safely must not recommend initialization."}),t.retry_succeeded||r.push({code:"retry_failed",probe_id:e.probe_id,detail:"The emitted retry or safe alternate-root recovery did not execute successfully."}),r}function Ck(e){let t=new Map(e.map(o=>[o.probe_id,o])),r=[],n=0;for(let o of Qe){let i=t.get(o.probe_id);if(i===void 0){r.push({code:"missing_probe",probe_id:o.probe_id,detail:"No runtime observation was supplied for this contract."});continue}let s=ry(o,i);r.push(...s),s.length===0&&(n+=1)}return r.sort((o,i)=>o.probe_id.localeCompare(i.probe_id)||o.code.localeCompare(i.code)),{ok:r.length===0,probe_count:Qe.length,closed_probe_count:n,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]="8320177c-e95d-5d14-a914-4ac37230c0b9")}catch{}})();var _e,ny=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 oy(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=ny[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(e)?"linked-file-path":["comments","notes","learnings"].includes(e)?"entry-file-input":"plan-definition-file"}function he(){if(_e!==void 0)return _e;let t=Ie.filter(({command:i})=>xe(i)).flatMap(({command:i,family:s})=>It(i,H(i)).map(a=>({command:i,family:s,concept:oy(i,a.flag),flag:a.flag,aliases:Object.freeze([...a.aliases??[]]),value_kind:a.repeatable?"list":a.flag==="--limit"?"number":a.value_type}))),r=new Set(t.flatMap(i=>i.aliases.map(s=>`${i.command}:${s}`))),n=t.filter(i=>!r.has(`${i.command}:${i.flag}`)),o=new Map;for(let i of n){let s=o.get(i.concept)??new Set;s.add(i.value_kind),o.set(i.concept,s)}return _e=Object.freeze(n.map(i=>Object.freeze({...i,concept:o.get(i.concept)?.size===1?i.concept:`${i.concept}@${i.command}`}))),_e}function Ek(){return Object.freeze(he().map(e=>Object.freeze({command:e.command,canonical_flag:e.flag,accepted_spellings:Object.freeze([...new Set([e.flag,...e.aliases])].sort())})))}var Gr=Object.freeze({init:30,config:35,extension:53,package:54,packages:54,install:26,upgrade:29,create:100,copy:24,focus:22,list:86,"list-all":85,"list-draft":84,"list-open":84,"list-in-progress":84,"list-blocked":84,"list-closed":84,"list-canceled":84,aggregate:37,context:45,ctx:45,get:30,graph:34,search:78,duplicates:24,eval:25,next:35,history:35,events:33,"history-redact":27,"history-repair":26,"history-compact":30,"history-author-acknowledge":28,merge:24,schema:40,profile:22,activity:35,restore:23,update:105,"update-many":140,close:31,"close-many":72,delete:24,append:24,comments:30,notes:34,learnings:26,files:39,docs:30,deps:32,plan:109,test:52,"test-all":40,telemetry:21,stats:29,health:36,validate:45,assurance:30,gc:22,workspace:23,contracts:29,claim:36,release:23,"start-task":23,"pause-task":23,"close-task":24,meet:33,event:33,remind:29,"test-runs-worker":25});function Ur(){let e=new Map(Object.keys(Gr).map(t=>[t,0]));for(let{command:t}of he())e.set(t,Number(e.get(t))+1);return Object.freeze(Object.entries(Gr).map(([t,r])=>Object.freeze({command:t,current:Number(e.get(t)),maximum:r})))}function iy(e,t,r){for(let n of e)for(let o of n.aliases){let i=t.get(`${n.command}:${o}`);i===void 0||i.flag===n.flag||r.push({code:"alias_collision",command:n.command,detail:`${o} aliases ${n.flag} but is canonical for ${i.flag}.`})}}function sy(e,t,r){let n=new Set(t.map(({command:o})=>o));for(let o of e.keys())n.has(o)||r.push({code:"missing_budget",command:o,detail:`${o} has canonical flags but no persisted budget.`});for(let o of t){let i=e.get(o.command)??0;i===0&&r.push({code:"stale_budget",command:o.command,detail:`${o.command} has a persisted budget but no canonical flags.`}),!(i<=o.maximum)&&r.push({code:"budget_exceeded",command:o.command,detail:`${i} canonical flags exceed the ratcheted maximum ${o.maximum}.`})}}function ay(e,t,r){let n=new Map(e.map(o=>[`${o.command}:${o.flag}`,o]));for(let o of t){let i=`${o.command}:${o.canonical_flag}`,s=n.get(i);if(!s){r.push({code:"removed_canonical_spelling",command:o.command,detail:`${o.canonical_flag} disappeared from the executable spelling inventory.`});continue}let a=new Set([s.flag,...s.aliases]);for(let c of o.accepted_spellings)a.has(c)||r.push({code:"removed_compatibility_spelling",command:o.command,detail:`${c} no longer resolves to ${o.canonical_flag}.`})}}function wk(e=he(),t=Ur(),r=[]){let n=[],o=new Map,i=new Map,s=new Map,a=new Map;for(let c of e){let d=`${c.command}:${c.flag}`;o.has(d)?n.push({code:"duplicate_canonical_flag",command:c.command,detail:`${c.flag} has more than one canonical row.`}):o.set(d,c),a.set(c.command,(a.get(c.command)??0)+1);let l=i.get(c.concept);l!==void 0&&l!==c.value_kind?n.push({code:"inconsistent_concept_kind",command:c.command,detail:`${c.concept} uses both ${l} and ${c.value_kind}.`}):i.set(c.concept,c.value_kind);let f=s.get(c.concept);f!==void 0&&f!==c.flag?n.push({code:"semantic_spelling_collision",command:c.command,detail:`${c.concept} is canonicalized by both ${f} and ${c.flag}.`}):s.set(c.concept,c.flag)}return iy(e,o,n),sy(a,t,n),ay(e,r,n),n.sort((c,d)=>c.command.localeCompare(d.command)||c.code.localeCompare(d.code)||c.detail.localeCompare(d.detail)),{ok:n.length===0,entry_count:e.length,budget_count:t.length,concept_count:new Set(e.map(({concept:c})=>c)).size,baseline_entry_count:r.length,findings:n}}function xk(){let e=he(),t=Ur(),r=new Map(t.map(({command:o})=>[o,"unknown"]));for(let{command:o,family:i}of e)r.set(o,i);return["# Generated flag lexicon budgets","","This file is generated by `listPmFlagLexicon()`. Compatibility aliases do not consume canonical budget.","","| Command | Capability family | Canonical flags | Maximum |","| --- | --- | ---: | ---: |",...t.map(({command:o,current:i,maximum:s})=>{let a=r.get(o);return`| \`${o}\` | ${a} | ${i} | ${s} |`}),""].join(`
32
+ `)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="7fc669d4-1db2-5636-8304-2c111a684726")}catch{}})();function Ok(e){return e}function Pk(e){return e}function Ik(e){return e}function Mk(e){return e}function kk(e){return e}function vk(e){return e}function Nk(e){return e}function Lk(e){return e}function Dk(e){return e}function $k(e){return e}function Fk(e){return e}function Gk(e){return e}function Uk(e){return e}function jk(e){return{handled:!0,result:e}}function Bk(){return{handled:!1}}function zk(e){return e}function qk(e){return e}function Vk(e){return e}function Hk(e){return e}function Kk(e){return e}function Wk(e){return e}function Xk(e){return e}function Yk(e){return e}function Jk(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]="5bbfab95-010d-5507-ab01-f8f43943d295")}catch{}})();function cy(e={},t={}){return new ee(t).extension(void 0,{...e,migrate:!0})}function dy(e={},t={}){return new ee(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]="bca95ba2-258c-5be2-8428-dcb8dbc87ef0")}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]="c2063b82-58b6-54c9-baff-ca252cadf463")}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]="036baf5a-3ba9-55ea-a11b-d9e94a848b92")}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]="ae931d1f-b7c6-5f15-aa9a-cda07f375b74")}catch{}})();export{Nw as ACTIONABILITY_ORDERING_KINDS,Pi as ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS,Ea as ACTIVITY_FLAG_CONTRACTS,Dn as AGENT_PROVENANCE_DIMENSIONS,cs as AGGREGATE_FLAG_CONTRACTS,Ws as APPEND_FLAG_CONTRACTS,Iw as ASSURANCE_ACTIONS,Mw as ASSURANCE_DECLARATION_KINDS,bE as ASSURANCE_DOCUMENT_VERSION,ma as ASSURANCE_FLAG_CONTRACTS,SE as ASSURANCE_GATE_TRIGGERS,AE as ASSURANCE_MEASUREMENT_SOURCE_KINDS,UE as ASSURANCE_PRESET_IDS,gE as AssuranceEvaluationRefusalError,hE as AssuranceMutationRefusalError,yE as AssuranceSourceResolutionError,bn as BASELINE_ITEM_FORMAT_VERSION,pg as BOUNDARY_FIXTURE_CAPTURE_SOURCES,Hw as BRIEF_LIST_FIELDS,Fn as BUILTIN_AGENT_PROVENANCE_ADAPTERS,U as BUILTIN_CORPUS_SHAPES,$n as BUILTIN_HARNESS_SIGNAL_DESCRIPTORS,Yr as BUILTIN_ITEM_TYPE_VALUES,Tt as BUILTIN_PROFILES,Ky as BUILTIN_RELATIONSHIP_KINDS,xi as CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS,Aa as CALENDAR_FLAG_CONTRACTS,Xs as CLAIM_FLAG_CONTRACTS,Ba as CLOSE_ACTION_OPTION_KEYS,Hs as CLOSE_FLAG_CONTRACTS,Ks as CLOSE_MANY_FLAG_CONTRACTS,ta as CLOSE_TASK_FLAG_CONTRACTS,ds as COMMENTS_FLAG_CONTRACTS,Gy as COMMON_MUTATION_COMMAND_OPTION_KEYS,Da as COMPLETION_FLAG_CONTRACTS,rn as CONFIDENCE_TEXT_VALUES,Es as CONFIG_FLAG_CONTRACTS,Ri as CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS,px as CONTEXT_EVALUATION_METRIC_NAMES,xa as CONTEXT_FLAG_CONTRACTS,ht as CONTEXT_OUTPUT_VALUES,hx as CONTEXT_PACKING_PROFILES,ax as CONTEXT_RELEVANCE_SERVICE,ix as CONTEXT_RELEVANCE_SIGNAL_NAMES,Ex as CONTEXT_SIGNAL_SET_VERSION,Ax as CONTEXT_SIGNAL_STORE_FORMAT_VERSION,wx as CONTEXT_SIGNAL_STORE_WARNING_DETAILS,La as CONTRACTS_FLAG_CONTRACTS,Ca as COPY_FLAG_CONTRACTS,vi as CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,Li as CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,Ni as CREATE_COMMANDER_STRING_OPTION_CONTRACTS,my as CREATE_DIRECT_CLOSE_REASON_DEFAULT,_a as CREATE_FLAG_CONTRACTS,Mb as CURRENT_HISTORY_ITEM_HASH_VERSION,Sn as CURRENT_ITEM_FORMAT_VERSION,Px as ContextSignalStore,yx as ContextUsageValidationError,dE as DEFAULT_AUTHOR_IDENTITY_VOCABULARY,cR as DEFAULT_CHILD_SAMPLE_LIMIT,Vw as DEFAULT_COMPACT_LIST_FIELDS,CS as DEFAULT_DERIVED_INDEX_MINIMUM_ITEMS,ru as DEFAULT_EVAL_QUERIES_RELATIVE_PATH,qx as DEFAULT_TERMINAL_TRANSITION_POLICY,vx as DEFAULT_WORKSPACE_MEMORY_MINIMUM_ITEMS,Aw as DEFECT_ESCAPE_CLASSES,Ew as DEFECT_GATE_EVIDENCE_DISPOSITIONS,Js as DELETE_FLAG_CONTRACTS,Qr as DEPENDENCY_KIND_VALUES,Pa as DEPS_FLAG_CONTRACTS,fs as DOCS_FLAG_CONTRACTS,pa as DUPLICATES_FLAG_CONTRACTS,Ma as EVAL_FLAG_CONTRACTS,Zp as EVAL_QUERY_SET_CONTRACT,Qp as EVAL_QUERY_SET_EXAMPLE,Jp as EVAL_QUERY_SET_SCHEMA_ID,wa as EVENTS_FLAG_CONTRACTS,na as EVENT_FLAG_CONTRACTS,to as EXECUTABLE_COMMAND_ALIASES,N as EXIT_CODE,Ls as EXTENSION_ACTIVATE_FLAG_CONTRACTS,Ns as EXTENSION_ADOPT_ALL_FLAG_CONTRACTS,Bs as EXTENSION_ADOPT_FLAG_CONTRACTS,UA as EXTENSION_CAPABILITIES,uy as EXTENSION_CAPABILITY_CONTRACT,ly as EXTENSION_CAPABILITY_CONTRACT_VERSION,py as EXTENSION_CAPABILITY_LEGACY_ALIASES,un as EXTENSION_CAPABILITY_REGISTRATION_SURFACES,js as EXTENSION_CATALOG_FLAG_CONTRACTS,Ds as EXTENSION_DEACTIVATE_FLAG_CONTRACTS,vs as EXTENSION_DESCRIBE_FLAG_CONTRACTS,Us as EXTENSION_DOCTOR_FLAG_CONTRACTS,ks as EXTENSION_EXPLORE_FLAG_CONTRACTS,ws as EXTENSION_FLAG_CONTRACTS,Rs as EXTENSION_INIT_FLAG_CONTRACTS,Is as EXTENSION_INSTALL_FLAG_CONTRACTS,Fs as EXTENSION_MANAGE_FLAG_CONTRACTS,$s as EXTENSION_MIGRATE_FLAG_CONTRACTS,jA as EXTENSION_POLICY_MODES,BA as EXTENSION_POLICY_SURFACES,Gs as EXTENSION_RELOAD_FLAG_CONTRACTS,qA as EXTENSION_SANDBOX_PROFILES,xs as EXTENSION_SCOPE_FLAG_CONTRACTS,zA as EXTENSION_TRUST_MODES,Ms as EXTENSION_UNINSTALL_FLAG_CONTRACTS,HE as EXTERNAL_DEPENDENCY_SOURCE_KIND,KE as EXTERNAL_DEPENDENCY_SOURCE_KIND_ALIAS,us as FILES_FLAG_CONTRACTS,Ta as FOCUS_FLAG_CONTRACTS,da as GC_FLAG_CONTRACTS,Xw as GET_DEPTH_VALUES,Ra as GET_FLAG_CONTRACTS,ss as GLOBAL_FLAG_CONTRACTS,Bc as GRAPH_DURABLE_CACHE_MIN_ITEMS,jc as GRAPH_DURABLE_CACHE_VERSION,Ia as GRAPH_FLAG_CONTRACTS,be as GRAPH_SUBCOMMAND_VALUES,Oa as GUIDE_FLAG_CONTRACTS,ua as HEALTH_FLAG_CONTRACTS,ys as HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS,QE as HISTORY_AUTHOR_ATTRIBUTION_BASELINE,KR as HISTORY_COMPACT_BULK_DEFAULT_MIN_ENTRIES,Cs as HISTORY_COMPACT_FLAG_CONTRACTS,ms as HISTORY_FLAG_CONTRACTS,hs as HISTORY_REDACT_FLAG_CONTRACTS,gs as HISTORY_REPAIR_FLAG_CONTRACTS,Vp as INIT_AGENT_GUIDANCE_MODE_VALUES,As as INIT_FLAG_CONTRACTS,zs as INSTALL_FLAG_CONTRACTS,tn as ISSUE_SEVERITY_VALUES,ga as ITEM_COMPLETE_FLAG_CONTRACTS,kR as ITEM_LATEST_TIMESTAMP_FIELDS,fy as ITEM_METADATA_KEY_ORDER,ha as ITEM_MUTATE_FLAG_CONTRACTS,ya as ITEM_REOPEN_FLAG_CONTRACTS,Jr as ITEM_TYPE_VALUES,MR as ITEM_UNION_COLLECTION_FIELDS,Ox as JsonFileContextSignalStoreAdapter,ps as LEARNINGS_FLAG_CONTRACTS,yp as LINKED_TEST_ENV_NAME_PATTERN,Cp as LINKED_TEST_PM_CONTEXT_MODE_VALUES,gp as LINKED_TEST_PROTECTED_ENV_KEYS,Tp as LINKED_TEST_WORKSPACE_CONTEXT_MODE_VALUES,Ei as LIST_COMMANDER_STRING_OPTION_CONTRACTS,Kw as LIST_COMMAND_DEFAULT_PROJECTIONS,HA as LIST_FILTER_EXTENSION_FLAG_DEFINITIONS,as as LIST_FILTER_FLAG_CONTRACTS,Qw as LIST_SORT_FIELDS,ex as LIST_SORT_ORDER_VALUES,aR as MAX_CHILD_PROJECTION_ITEMS,ra as MEET_FLAG_CONTRACTS,LR as MERGE_DRIVER_ARTIFACT_VALUES,_s as MERGE_FLAG_CONTRACTS,Se as MERGE_SUBCOMMAND_VALUES,FR as MUTATION_EVENT_WIRE_BUDGET,X as MemoryRelationshipGraphAdapter,Oi as NEXT_COMMANDER_STRING_OPTION_CONTRACTS,va as NEXT_FLAG_CONTRACTS,Ql as NEXT_OUTPUT_VALUES,ls as NOTES_FLAG_CONTRACTS,Os as PACKAGE_FLAG_CONTRACTS,Ps as PACKAGE_INIT_FLAG_CONTRACTS,ea as PAUSE_TASK_FLAG_CONTRACTS,ja as PLAN_CREATE_METADATA_PARAMETER_KEYS,Ss as PLAN_FLAG_CONTRACTS,Lp as PLAN_SHOW_DEPTH_VALUES,Oe as PLAN_SUBCOMMANDS,Dp as PLAN_TEMPLATE_NAMES,Ya as PM_CLI_EXPECTED_ERROR_NAME,gA as PM_CLI_GRAMMAR_CONTRACT,uA as PM_CLI_GRAMMAR_NOUNS,_o as PM_CLI_ONLY_TOOL_ACTION_WAIVERS,fA as PM_CLI_SHARED_VERBS,eo as PM_COMMAND_ALIAS_CONTRACTS,Ie as PM_COMMAND_CAPABILITY_CONTRACTS,dt as PM_COMMAND_DESTINATION_CONTRACTS,Yx as PM_COMMAND_EXIT_CONTRACTS,Xx as PM_COMMAND_EXIT_OUTCOME_CONTRACTS,vo as PM_COMMAND_OUTPUT_BUDGET_CONTRACTS,sO as PM_COMMAND_OUTPUT_ENVELOPE_CONTRACTS,we as PM_COMMAND_POSITIONAL_CONTRACTS,Mu as PM_COMMAND_VISIBILITY_CONTRACTS,WA as PM_COMPLETE_LIST_FINDING_CODES,eE as PM_CONTEXT_INTENTS_FILE,gb as PM_CONTEXT_INTENT_CONTRACTS,po as PM_CORE_COMMAND_NAMES,M as PM_CORPUS_SHAPE_SCHEMA,go as PM_DEPRECATED_TOOL_ACTIONS,Oo as PM_DIAGNOSTIC_DEGRADATION_STEPS,Po as PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS,Ro as PM_DIAGNOSTIC_OUTPUT_CLASSES,yo as PM_DISCOVERABLE_TOOL_ACTIONS,nO as PM_ERROR_CODE_CATALOG,QR as PM_ERROR_CODE_EXIT_CLASS_CONTRACTS,wr as PM_EXACT_COVERAGE_METRICS,oo as PM_EXTENSION_CAPABILITY_CONTRACTS,uo as PM_EXTENSION_PACKAGE_ACTION_SUBCOMMANDS,so as PM_EXTENSION_POLICY_MODE_CONTRACTS,lo as PM_EXTENSION_POLICY_SURFACE_CONTRACTS,co as PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS,io as PM_EXTENSION_SERVICE_NAME_CONTRACTS,ao as PM_EXTENSION_TRUST_MODE_CONTRACTS,sw as PM_GITATTRIBUTES_END,iw as PM_GITATTRIBUTES_START,cw as PM_GITATTRIBUTES_V2_END,aw as PM_GITATTRIBUTES_V2_START,rc as PM_GITIGNORE_END,tc as PM_GITIGNORE_START,mo as PM_ITEM_ACTION_SUBCOMMANDS,Ue as PM_MCP_APPS_EXTENSION,ir as PM_MCP_APPS_SERVER_CAPABILITY,ce as PM_MCP_APPS_SPEC_VERSION,cr as PM_MCP_APP_CONTRACTS,ar as PM_MCP_APP_MIME_TYPE,u as PM_MCP_ERROR_CODES,dI as PM_MCP_HTTP_PROTOCOL_VERSION,q_ as PM_MCP_INPUT_REQUEST_METHODS,vP as PM_MCP_LEGACY_PROTOCOL_VERSIONS,w as PM_MCP_META_KEYS,Fu as PM_MCP_PROMPT_CONTRACTS,D as PM_MCP_PROTOCOL_VERSION,$u as PM_MCP_RESOURCE_CONTRACTS,Be as PM_MCP_SKILLS_DRAFT_REVISION,dr as PM_MCP_SKILLS_EXTENSION,Yh as PM_MCP_SKILLS_SERVER_CAPABILITY,R as PM_MCP_SKILL_LIMITS,se as PM_MCP_SUBSCRIPTION_ID_META_KEY,Me as PM_MCP_SUPPORTED_PROTOCOL_VERSIONS,tI as PM_MCP_TASKS_EXTENSION,th as PM_MCP_TASK_STATUSES,Lu as PM_MCP_TOOL_COMMAND_CONTRACTS,CT as PM_MODE_PAIRED_OUTPUT_PROJECTION_CONTRACTS,si as PM_MUTATION_ACTION_CONTRACTS,xo as PM_OUTPUT_BUDGET_CLASSES,wo as PM_OUTPUT_DEGRADATION_STEPS,oO as PM_OUTPUT_ENVELOPE_KINDS,ft as PM_PACKAGE_CONVENTIONAL_RESOURCE_ROOTS,fo as PM_PACKAGE_ONLY_ACTION_SUBCOMMANDS,ut as PM_PACKAGE_RESOURCE_KINDS,Ee as PM_POSITIONAL_ACTION_CONTRACTS,Xa as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA,Ka as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION,ib as PM_READ_OUTPUT_COMPOSITION_OPTION_FLAGS,HT as PM_READ_OUTPUT_CONTINUATION_FINGERPRINT_POLICIES,rb as PM_READ_OUTPUT_DIMENSIONS,ob as PM_READ_OUTPUT_OPTION_FLAGS,JT as PM_READ_OUTPUT_SESSION_MAX_SEEN_ITEM_IDS,YT as PM_READ_OUTPUT_SESSION_MIN_TOKENS,nb as PM_READ_OUTPUT_SURFACES,sb as PM_READ_OUTPUT_SURFACE_CONTRACTS,yT as PM_READ_ROW_CONTRACTS,gT as PM_READ_ROW_JQ_SELECTOR,HM as PM_RECOVERY_REFERENCE_FIELDS,J as PM_RECOVERY_REFERENCE_KINDS,Xg as PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE,$r as PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE_V2,QM as PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE,Dr as PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE_V2,Ti as PM_REPRODUCIBLE_PROCESS_ENV,Jx as PM_SUCCESS_EXIT_CODES,ho as PM_TOOL_ACTIONS,za as PM_TOOL_ACTION_PARAMETER_CONTRACTS,Wa as PM_TOOL_PARAMETERS_SCHEMA,Ha as PM_TOOL_PARAMETERS_SCHEMA_MAJOR,Va as PM_TOOL_PARAMETERS_SCHEMA_VERSION,Ga as PM_TOOL_RESERVED_CUSTOM_FIELD_PROPERTIES,Sr as PM_WORKSPACE_RECIPE_SCHEMA,bs as PROFILE_FLAG_CONTRACTS,Rt as PROFILE_LINT_CODES,xt as PROFILE_LINT_DIMENSIONS,Ct as PROFILE_NAMES,Pe as PROFILE_SUBCOMMANDS,ye as PmCliError,ee as PmClient,XA as PmCompleteListValidationError,h as PmMcpAuthorizationError,kt as PmMcpInputRequiredError,er as PmMcpIssuerCredentialStore,p as PmMcpProtocolError,vt as PmMcpRequestStateReplayGuard,_r as PmMcpSkillRegistry,qt as PmMcpSubscriptionRegistry,Fe as PmMcpTaskStore,LT as QUERY_CURSOR_CONTRACT,Vs as REINDEX_FLAG_CONTRACTS,mS as REINDEX_LOCK_ID,Xe as RELATIONSHIP_GRAPH_SNAPSHOT_VERSION,Zs as RELEASE_FLAG_CONTRACTS,oa as REMIND_FLAG_CONTRACTS,it as RESERVED_ITEM_FIELD_NAMES,Ys as RESTORE_FLAG_CONTRACTS,en as RISK_VALUES,kA as RelationshipEventLog,vA as RelationshipEventStore,L as RelationshipGraph,Te as RelationshipKindRegistry,Ts as SCHEMA_FLAG_CONTRACTS,wi as SEARCH_COMMANDER_STRING_OPTION_CONTRACTS,KA as SEARCH_EXTENSION_FLAG_DEFINITIONS,Na as SEARCH_FLAG_CONTRACTS,Ll as SEMANTIC_ATTRIBUTION_LIMITS,hy as SETTINGS_DEFAULTS,au as SNAPSHOT_SCHEMA,rw as SOURCE_CONTEXT_ACCESS_ENV,nw as SOURCE_CONTEXT_WRITE_OVERRIDE_ENV,Qs as START_TASK_FLAG_CONTRACTS,la as STATS_FLAG_CONTRACTS,Zr as STATUS_VALUES,is as SUBCOMMAND_GLOBAL_FLAG_CONTRACTS,kb as SUPPORTED_HISTORY_ITEM_HASH_VERSIONS,vy as SUPPRESS_HOST_OUTPUT_MARKER,aa as TELEMETRY_FLAG_CONTRACTS,sf as TELEMETRY_SUBCOMMANDS,sa as TEST_ALL_FLAG_CONTRACTS,ia as TEST_FLAG_CONTRACTS,ca as TEST_RUNS_FLAG_CONTRACTS,ef as TEST_RUN_MEASUREMENT_LIMIT,Qi as TOOL_ACTIVITY_OPTION_CONTRACTS,ji as TOOL_AGGREGATE_OPTION_CONTRACTS,Xi as TOOL_BULK_MUTATION_FILTER_OPTION_CONTRACT_SOURCE,Zi as TOOL_CALENDAR_OPTION_CONTRACTS,Ji as TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS,es as TOOL_CONTEXT_OPTION_CONTRACTS,Hi as TOOL_CREATE_OPTION_CONTRACTS,Vi as TOOL_CREATE_OPTION_CONTRACT_SOURCE,ts as TOOL_DEPS_OPTION_CONTRACTS,rs as TOOL_GRAPH_OPTION_CONTRACTS,Ui as TOOL_LIST_FILTER_OPTION_CONTRACTS,Bi as TOOL_SEARCH_FILTER_OPTION_CONTRACTS,qi as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS,zi as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACT_SOURCE,Yi as TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS,Wi as TOOL_UPDATE_OPTION_CONTRACTS,Ki as TOOL_UPDATE_OPTION_CONTRACT_SOURCE,_y as TYPE_TO_FOLDER,My as UNKNOWN_SUBCOMMAND_COMPATIBILITY_CODES,Di as UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,Fi as UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,$i as UPDATE_COMMANDER_STRING_OPTION_CONTRACTS,ba as UPDATE_FLAG_CONTRACTS,Sa as UPDATE_MANY_FLAG_CONTRACTS,qs as UPGRADE_FLAG_CONTRACTS,fa as VALIDATE_FLAG_CONTRACTS,ka as WORKSPACE_FLAG_CONTRACTS,jo as WORKSPACE_HISTORY_ID,cu as WORKSPACE_SNAPSHOT_ACTIONS,Cc as WorkspaceGraphCache,FA as WorkspaceTransactionInterruptedError,Qa as _testOnly,ox as _testOnlyAggregateCommand,qp as _testOnlyConfigCommand,uR as _testOnlyGetCommand,vd as _testOnlyHealthCommand,Xp as _testOnlyInit,Hp as _testOnlyInitAgentGuidance,LO as _testOnlyItemTransaction,BR as _testOnlyMutationEvents,jx as _testOnlyNextCommand,OR as _testOnlySearchCommand,oR as _testOnlySimilarity,hu as _testOnlyTemplates,ul as _testOnlyValidateCommand,qE as acceptAssuranceProposals,ll as acknowledgeLinkedTests,cd as acknowledgeUnknownAuthorHistoryEvents,ad as acknowledgeUnknownAuthorHistoryEventsFromTransport,TS as acquireItemMetadataDerivedIndexLock,Ae as acquireLock,KO as activateExtensionForTest,cC as activateExtensions,Ln as agentSessionEnvironment,tm as aggregate,zu as analyzeAgentProvenanceDescriptorCoverage,xw as analyzeDefectChangeRisk,LA as analyzeGraphImpact,dc as analyzeHierarchyIntegrity,DA as analyzeKnowledgeGraph,tR as analyzePmCommandExitConformance,Co as analyzePmToolActionParity,gw as analyzeReconciliationDiscard,NA as analyzeRelationshipExecution,Nc as analyzeRelationshipSchedule,R_ as analyzeSdkActionCoverage,lt as analyzeSdkCliParameterCompleteness,fm as append,Uo as appendHistoryEntry,Vo as appendWorkspaceAuditEvent,qo as appendWorkspaceHistoryChange,FC as applyAcceptanceCriteriaMutations,BE as applyAssurancePreset,k_ as applyBootstrapPagerPolicy,Sb as applyContextIntentProjection,Zl as applyContextTagProjection,tx as applyFilterValueEcho,wA as applyHistoryPatch,G_ as applyInvocationAuthorOverride,Gd as applyPathMigrations,mb as applyReadOutputDimensions,lb as applyReadOutputIncludeModes,QT as applyReadOutputSessionReferences,NC as applyRegisteredItemFieldDefaultsAndValidation,zd as applyStandaloneNote,Rd as applyStoredExtensionMigrationState,UC as applyTagRemovals,Wx as applyTerminalOrderingPolicy,qd as artifactKey,by as asRecordClone,Ty as asRecordOrNull,Re as assembleWorkspaceRelationshipGraph,QA as assertCompleteListResult,RP as assertExtensionBlueprint,xP as assertExtensionCapabilityUsage,cP as assertExtensionDeactivated,IP as assertExtensionManifestCompatible,PP as assertExtensionManifestMatchesBlueprint,MP as assertExtensionPreflight,uc as assertHierarchyMutationAllowed,WR as assertHistoryCompactTarget,Cw as assertHistoryRepairTarget,ri as assertInitializedTracker,Ud as assertLinkedArtifactMutationIsUnambiguous,LP as assertMcpClientCapabilities,NP as assertMcpProtocolHeader,Pg as assertMemoryRelationshipGraphAdapterConformance,zC as assertNoUnknownCsvKeys,dP as assertPackageManifest,Yb as assertParentReferenceIsNotSelf,GI as assertPmMcpSkillsCapability,OP as assertProjectProfile,yM as assertProjectRuntimeCompatibility,TT as assertProjectionModeChoice,ti as assertReadableTrackerRoot,lP as assertRegisteredCommandContract,TP as assertRegisteredCommandOverride,hP as assertRegisteredExporter,pP as assertRegisteredFlags,uP as assertRegisteredHook,_P as assertRegisteredImporter,gP as assertRegisteredItemField,yP as assertRegisteredItemType,wP as assertRegisteredMigration,bP as assertRegisteredParserOverride,SP as assertRegisteredPreflightOverride,CP as assertRegisteredProfile,AP as assertRegisteredRendererOverride,fP as assertRegisteredSearchProvider,EP as assertRegisteredServiceOverride,mP as assertRegisteredVectorStoreAdapter,Jy as assertRelationshipEdgeAllowed,Mr as assertRelationshipGraphAdapterConformance,EE as assuranceAssertionUpdateIsLoosening,wb as attachContextIntentReceipt,sl as attachLinkedTestMutationProvenance,il as attachLinkedTestProvenance,ve as attachMcpServerInfo,xT as attachOutputOmissionReceipt,Rb as attachOutputTokenAccounting,xb as attachReadOutputContracts,eb as attachReadOutputSessionReceipt,fd as auditMergeAttributeFence,dw as auditMergeDriverConfiguration,Gc as auditWorkspaceRelationshipGraph,EI as authorizeMcpHttpRequest,kn as boundAgentEpisodeIdentity,qT as boundReadOutputRows,Wl as buildChildrenByParent,hR as buildCompactSearchFilterSummary,rx as buildContentFilterEcho,Rx as buildContextSignalSnapshot,ng as buildCorpusShapeItemPlan,ww as buildDefectRecurrenceIndex,Ad as buildExtensionDescribeResult,nx as buildGovernanceMissingFilterEcho,oS as buildInvalidTypeError,dR as buildItemChildrenRollup,vO as buildItemCompletionMutations,sx as buildItemContextRelevanceCandidates,xS as buildItemNotFoundError,pR as buildItemSchedule,_I as buildMcpAuthorizationDiscoveryUrls,B_ as buildMcpCompleteResult,$P as buildMcpDiscoverResult,TI as buildMcpDynamicRegistrationMetadata,aI as buildMcpHttpRequestHeaders,BP as buildMcpInputRequiredResult,mI as buildMcpProtectedResourceMetadata,pd as buildMergeAttributePatterns,qa as buildPmActionToolInputSchema,rk as buildPmRefusalClosureCensus,JE as buildRelationshipContext,MS as buildSearchCorpus,vS as buildSemanticCorpusInput,ei as buildTrackerInitializationRecovery,GS as buildVectorizationEmbeddingIdentity,US as buildVectorizationEmbeddingMetadata,gR as buildVerboseSearchFilters,Nx as buildWorkspaceMemorySnapshot,Mn as canonicalDocument,Uy as canonicalizeCommandOptionKey,Wy as canonicalizeRelationshipKind,KM as censusPmRecoveryReferenceProducers,ZA as certifyCompleteListResult,VO as checkExtensionManifestCompatibility,Ym as claim,Jm as claimNext,ew as classifyHistoryAuthorEvent,zR as classifyHostEnvironmentFault,wR as classifyImplicitSemanticFallbackReason,wn as classifyItemFormatVersion,df as classifyLinkedTestFailure,wC as clearActiveExtensionHooks,Kc as clearDurableGraphCache,uT as clearFocusedItem,ic as clearWorkspaceContractsCache,Xm as close,ip as closeItem,i_ as closeTask,L_ as coalesceRepeatedListFlags,Lw as collectBlockedByIds,$w as collectBlockedByIdsFromCorpus,hc as collectDanglingDependencyReferences,Gw as collectDependencyBlockedIds,mc as collectDuplicateDependencyRows,Fc as collectDuplicateRelationshipEdgeGroups,ER as collectErrorCauseCodes,cc as collectHierarchyRelations,Yt as collectMcpHeaderAnnotations,gc as collectMissingDependencyTargetIds,up as collectNewOrderingCycleWarnings,Lc as collectOrderingCycles,_c as collectOrderingStorageContradictions,nE as collectPackageContextIntentContracts,_t as collectPackageExtensionDirectories,kC as collectRegisteredItemFieldNames,oT as collectRuntimeCreateFieldValues,iS as collectRuntimeFilterValues,iT as collectRuntimeUpdateFieldValues,zl as collectSubtreeIds,fn as collectUsedExtensionCapabilities,jy as commandOptionFlagLabel,om as comments,$f as commitImportedItem,NO as commitItemCompletion,kO as commitItemMutations,GA as commitWorkspaceTransaction,os as compactFlagAliasContracts,ql as compareCriticalItems,le as comparePmDateVersions,$A as compareRelationshipSnapshots,Sy as compareTimestampStrings,mE as compileHistoryProvenanceMatcher,Tb as composeContextIntentContracts,FO as composeExtension,qO as composeExtensionPackage,Uw as computeActionabilityReport,zb as computeHistoryDiff,kc as computeRelationshipCentrality,Mc as computeRelationshipDominators,yc as computeWorkspaceGraphFingerprint,_m as config,EC as consumeAfterCommandAffectedItems,Xf as context,Eb as contextIntentRowId,Qm as copy,lf as countFailureCategories,BT as countReadOutputRows,Hm as create,jE as createAssurancePreset,Sw as createAssuranceWorkspaceContext,Ey as createCheckpointId,YA as createCompleteListOptions,dC as createCoreCommandHookContext,br as createCorpusShapeMeasurement,PE as createEmptyAssuranceDocument,Qy as createEmptyExtensionRegistrationRegistry,ec as createExtensionCommandSdk,pn as createExtensionContributionInventory,kP as createExtensionTestHarness,Go as createHistoryEntry,rA as createLazyModule,wI as createMcpStaticBearerVerifier,rI as createMcpTaskStore,wS as createMutationGuardSdk,bT as createOutputOmissionReceipt,Ja as createPmCliExpectedError,U_ as createPmCliProgram,Mo as createPmCommandOutputBudget,OT as createQueryFingerprint,Og as createRelationshipGraphScaleFixture,z as createRelationshipGraphSnapshot,ot as createRelationshipKindRegistry,Si as createReproducibleProcessRunner,yR as createSearchCursorFingerprint,lC as createSerialQueue,XC as createStdinTokenResolver,ky as createUnknownSubcommandError,du as createWorkspaceSnapshot,WO as deactivateExtensionForTest,Bk as declineServiceOverride,Ab as decodeContextIntentCursor,tA as decodeHtmlEntitiesInOptions,Xt as decodeMcpHttpHeaderValue,kT as decodeQueryCursor,IT as decodeQueryCursorEnvelope,MT as decodeQueryCursorState,XT as decodeReadOutputContinuationCursor,II as decoratePmMcpToolsWithApps,Hd as dedupeLinkedArtifacts,cx as defaultScoreContextCandidates,Wk as defineAfterCommandHook,Hk as defineBeforeCommandHook,Kk as defineBeforeMutationHook,Ik as defineCommand,$k as defineCommandOverride,G as defineCorpusShape,Vk as defineExporter,DO as defineExtension,$O as defineExtensionBlueprint,Ok as defineExtensionManifest,Mk as defineFlag,qk as defineImporter,vk as defineItemField,kk as defineItemType,Nk as defineMigration,Jk as defineOnIndexHook,Yk as defineOnReadHook,Xk as defineOnWriteHook,Fk as defineParserOverride,ko as definePmCommandOutputBudget,iO as definePmCommandOutputEnvelope,eO as definePmErrorCodeCatalog,Gk as definePreflightOverride,Pk as defineProjectProfile,zk as defineRendererOverride,Lk as defineSearchProvider,Uk as defineServiceOverride,Dk as defineVectorStoreAdapter,Ar as defineWorkspaceRecipe,e_ as deleteItem,_u as deleteWorkspaceSnapshot,Zy as dependencyToRelationship,pm as deps,zE as deriveAssuranceProposals,UO as deriveExtensionCapabilities,rR as derivePmBulkMutationEffect,WM as derivePmRecoveryReferenceObligations,gd as deriveSchemaEvolutionMigrationId,WS as deriveTelemetryCommandResolution,dS as describeAllowedTransitions,tw as describeExtensionActivation,jO as describeExtensionBlueprint,xl as describeItemOwnershipConflict,Et as describeProfileComposition,wt as describeProjectProfile,hO as describeUnknownError,Vn as detectAgentIdentity,Xn as detectHarnessIdentity,Pc as detectRelationshipCommunities,Hn as diagnoseAgentIdentity,Uc as diffRelationshipAuditSnapshots,nf as diffTestRunMeasurements,VP as digestMcpRequestParameters,sC as discoverExtensions,sn as discoverNearbyPmRoot,Sg as discoverProjectRuntimeVersionPins,lm as docs,nm as duplicates,zc as durableGraphCachePath,Wc as durableGraphCacheStatus,An as effectiveItemFormatVersion,pA as emitTelemetryErrorEvent,Df as emptyImportedDocument,Wt as encodeMcpHttpHeaderValue,PT as encodeQueryCursor,WT as encodeReadOutputContinuationCursor,qb as enforceHistoryStreamPolicyForItem,Vb as enforceHistoryStreamPolicyForItems,JR as enrichCliFlagInvocationContract,It as enrichCliFlagInvocationContracts,RA as ensureMaterializedHistoryTarget,oc as ensurePmGitignore,Nd as ensureScope,KS as ensureSentryInit,Lf as ensureTrackerInitialized,Rc as enumerateRelationshipPaths,Lo as estimatePmOutputTokens,ME as evaluateAssuranceAssertion,kE as evaluateAssuranceGate,sM as evaluateBoundaryFixtures,ux as evaluateContextRanking,Rw as evaluateDefectGateEvidence,IE as evaluateMeasurement,ci as evaluateMutationGuard,Xu as evaluateProvenanceCoverage,Hu as evaluateSemanticAttributionCoverage,hp as evaluateSimilarityGovernance,cS as evaluateTransition,NS as executeEmbeddingBatchesWithRetry,$S as executeVectorDelete,FS as executeVectorReset,DS as executeVectorUpsert,sg as executeWorkspaceRecipe,Bd as expandAddGlobEntries,Zd as explainSourceTraceability,s_ as extension,c_ as extensionActivate,d_ as extensionDeactivate,a_ as extensionList,cy as extensionMigrate,bI as extractMcpTraceContext,AA as extractPatchFailureContext,rl as extractReferencedPmItemIdsFromCommand,Rg as federateRelationshipGraphSnapshots,am as files,cm as filesDiscover,dm as filesLookup,lg as findCoverageDeficits,_p as findDuplicateClusters,ld as findGitWorkspaceRoot,bd as findInstalledNpmPackageCandidate,PI as findPmMcpAppByUri,Ic as findRedundantRelationshipEdges,vc as findRelationshipCutStructure,mp as findSimilarItems,lA as finishTelemetryCommand,Py as flattenFlagListValue,ag as flushTelemetryQueue,r_ as focus,Oc as forEachMatchedRelationshipEdge,$c as formatDuplicateEdgeGroup,lc as formatHierarchyRelation,Dc as formatOrderingStorageContradiction,hA as formatPmPositionalActionFlagTip,Ou as formatProfileApplyHuman,Ru as formatProfileLintHuman,wu as formatProfileListHuman,xu as formatProfileShowHuman,Td as formatSchemaEvolutionMigrationHuman,RR as formatVectorIndexRecoveryWarnings,Um as gc,Zo as generateItemId,Qf as get,bC as getActiveCommandResult,yb as getActiveContextIntentContracts,_n as getActiveExtensionRegistrations,AI as getActiveMcpTraceContext,NE as getAssuranceDeclaration,A_ as getContracts,lT as getFocusedItem,dn as getHistoryPath,MA as getItemAt,cn as getItemPath,pi as getMutationActionContract,nc as getPmGitignoreBlock,an as getSettingsPath,S_ as getWorkspaceContracts,Bo as getWorkspaceHistoryPath,um as graph,qc as graphAuditBaselinePath,Ku as groupHistoryByEpisode,jk as handleServiceOverride,DP as hasMcpClientExtension,OI as hasPmMcpAppsCapability,xe as hasSubcommandFlagContractsForCommand,jS as hasVectorizationEmbeddingIdentityChanged,BS as hasVectorizationVectorDimensionChanged,vb as hashDocument,Nb as hashDocumentForVersion,Lb as hashEmptyDocument,Gm as health,Ac as hierarchyAncestors,Ec as hierarchyDescendants,qm as historyCompact,Vm as historyCompactBulk,fE as historyEntryMatchesProvenance,jm as historyRedact,Bm as historyRepair,zm as historyRepairAll,Dw as indexBlockedByIds,pc as indexHierarchyRelations,zS as inferConsistentVectorDimension,Io as inferPmOutputBudgetClass,mm as init,JA as inspectCompleteListResult,eC as inspectExtensionManifestSchema,rd as inspectHistoryAuthorStream,Eg as inspectProjectRuntimeCompatibility,yi as inspectStaleInProgressItems,zo as inspectWorkspaceHistoryState,lu as inspectWorkspaceSnapshot,hd as installMergeFence,FP as interpretMcpResultType,tp as isAlreadyClaimedError,CO as isCommanderError,bl as isErrnoError,WE as isExternalDependencySourceKind,Z as isFileMissingError,Ly as isHostOutputSuppressed,m as isMcpRecord,di as isMutationAction,Yy as isOrderingRelationshipKind,Wb as isPlaceholderReferenceToken,Za as isPmCliExpectedError,bo as isPmExtensionCapabilityContract,Ao as isPmExtensionPolicyModeContract,Eo as isPmExtensionPolicySurfaceContract,So as isPmExtensionServiceNameContract,Qx as isPmKnownExitCode,cO as isPmMutationReceipt,Zx as isPmSuccessfulExitCode,To as isPmToolAction,Ag as isProjectMutatingInvocation,nA as isPureSnakeCaseAlias,_b as isReadOutputBudgetExceeded,AT as isReadRowContract,td as isRuntimeRecord,sA as isTerminalPlanMode,aT as isTerminalStatus,Xr as isTimestampLiteral,IO as itemDocumentToMutationOptions,lR as itemHasSchedule,ui as jaccardSimilarity,sm as learnings,Iy as levenshteinDistanceWithinLimit,yl as limitAnnotationEntries,al as linkedTestTrustFingerprint,BO as lintExtensionBlueprint,tC as lintExtensionManifestSchema,Ot as lintProjectProfile,Yf as list,Un as listAgentProvenanceAdapters,N_ as listAliasPluralKeys,Jf as listAllComplete,AS as listAllDocumentCandidatesCached,ii as listAllItemMetadata,ES as listAllItemMetadataLight,vE as listAssuranceDeclarations,GE as listAssuranceVerdicts,tg as listBuiltinCorpusShapes,AO as listCoreClosedDomainContracts,Yw as listGetProjectionFields,pw as listInvalidProvenanceHistoryStreamIds,Ww as listListProjectionFields,mw as listMergeReceipts,li as listMutationActions,GR as listMutationEvents,Ur as listPmCommandFlagBudgets,Nu as listPmCommandsForFamily,vu as listPmCommandsForTier,he as listPmFlagLexicon,Ek as listPmFlagSpellingInventory,Du as listPmMcpToolsForProfile,mk as listPmRequiredArgumentRefusalContracts,_k as listPmSubcommandRefusalContracts,At as listProfiles,yk as listTrackerPreflightRecoveryContracts,pu as listWorkspaceSnapshots,oE as loadContextIntentRuntimeLayers,gu as loadCreateTemplateOptions,aC as loadExtensions,Yc as loadGraphAuditBaseline,xy as loadMutationCheckpoint,P as loadRelationshipGraphAdapter,ni as locateItem,BC as looksLikeGenericKeyValueEntry,zT as mapReadOutputRows,_w as markMergeReceiptReconciled,sS as matchesRuntimeFilters,cA as maybeRunFirstUseTelemetryPrompt,og as measureCorpusShapePlan,GC as mergeAdditiveTags,GO as mergeExtensionBlueprints,PR as mergeHistoryStreams,vR as mergeItemDocuments,NR as mergeJsonDocuments,D_ as mergeLinkedTestTwoTokenEntries,IR as mergeRelationshipEventStreams,Yl as mergeSortedWarnings,iA as migrateItemFilesToFormat,OS as mutateItem,RS as mutateItemWithHistoryContext,Ho as mutateWorkspaceJsonWithHistory,em as next,Bn as normalizeAgentProvenanceAdapterValue,gl as normalizeAnnotationTransportOptions,TE as normalizeAssuranceEvaluation,CE as normalizeAssuranceMutation,$_ as normalizeBootstrapInvocation,QC as normalizeBulkIdsValue,fc as normalizeDependencyGraphTarget,YE as normalizeDependencySeedId,XE as normalizeDependencySourceKind,ln as normalizeExtensionContributionInventory,lw as normalizeInvalidHistoryProvenance,uO as normalizeItemAddressInvocation,En as normalizeItemFormatVersion,Jo as normalizeItemId,On as normalizeItemMetadata,v_ as normalizeLegacyExtensionActionSyntax,jd as normalizeLinkedPath,Kb as normalizeParentReferenceValue,bt as normalizeProfileName,Yo as normalizeRawItemId,pb as normalizeReadOutputIncludeModeOptions,Gb as normalizeReplayPatchOps,fi as normalizeSimilarityText,sT as normalizeStatusForRegistry,Rn as normalizeStatusInput,rT as normalizeStatusInputWithRegistry,yO as normalizeThrownExitCode,im as notes,Wr as nowIso,Vc as openDurableGraphCache,qP as openMcpRequestState,wc as orderingPredecessors,xc as orderingSuccessors,gx as packContextCandidates,Vl as packRankedContextItems,C_ as packageActivate,y_ as packageCatalog,T_ as packageDeactivate,h_ as packageDescribe,m_ as packageDoctor,u_ as packageInstall,l_ as packageLifecycle,p_ as packageList,__ as packageManage,dy as packageMigrate,g_ as packageReload,f_ as packageUninstall,NT as paginateQueryRows,Ld as parseAddEntries,Dd as parseAddGlobEntries,Tl as parseAnnotationTextInput,RO as parseAtomicMutationControls,M_ as parseBootstrapCommandName,O_ as parseBootstrapGlobalOptions,I_ as parseBootstrapHelpRequest,F_ as parseBootstrapTypeValue,ZC as parseBulkIdsText,jl as parseContextDepth,$l as parseContextFocusFields,tE as parseContextIntentDeclarations,Bl as parseContextSections,xx as parseContextSignalSnapshot,jC as parseCsvKv,Pw as parseDefectChangeRiskRequest,Ow as parseDefectRecurrencePolicy,eu as parseEvalQuerySet,Qc as parseGraphSubcommand,pE as parseHistoryProvenanceFilters,sE as parseIntegerLimit,cT as parseItemDocument,OO as parseItemMutationBatch,nS as parseLimit,Pp as parseLinkedTestAssertionEqualsMap,Ip as parseLinkedTestAssertionGteMap,Ap as parseLinkedTestBoolean,Ep as parseLinkedTestContextMode,Sp as parseLinkedTestEnvClear,bp as parseLinkedTestEnvSet,Mp as parseLinkedTestJsonEntries,Op as parseLinkedTestMinLines,Rp as parseLinkedTestRegexList,xp as parseLinkedTestStringList,wp as parseLinkedTestWorkspaceContextMode,K_ as parseMcpCachePolicy,j_ as parseMcpImplementation,De as parseMcpInputRequests,$t as parseMcpInputResponses,gh as parseMcpSubscriptionFilter,Fd as parseMigrateEntries,jw as parseMultiValueFilter,dO as parseMutationReceipt,JC as parseOptionalNonNegativeInteger,YC as parseOptionalNumber,aE as parsePriority,qw as parsePriorityFilterSet,ZT as parseReadOutputSession,vC as parseRegisteredItemFieldAssignments,Y as parseRelationshipGraphSnapshot,$d as parseRemoveEntries,Jd as parseSourceLineRange,Qb as parseStatusFilterCsv,Bw as parseStringFilterSet,yn as parseTags,tf as parseTestRunMeasurements,cE as parseType,zw as parseTypeFilterSet,sd as parseUnknownAuthorHistoryEventCoordinates,Bx as partitionDecisionEntries,Bb as patchPathToChangedField,Vr as pathExists,o_ as pauseTask,Hc as persistDurableGraphResult,lS as persistSelectedItemFormat,_R as planAgentIdentityVocabularyMutation,kx as planCompletedAtBackfill,Pt as planProfileApplication,qM as planRelationshipEventBackfill,Zc as planRelationshipRemediation,yd as planSchemaEvolutionMigration,od as planUnknownAuthorHistoryAcknowledgment,uu as planWorkspaceSnapshotRestore,CA as positionalShapeKey,TA as positionalSignatureKey,HO as preflightExtension,_i as prepareSimilarityText,VC as preserveMutationStdinTokenFields,qC as preserveMutationStdinTokenLiterals,Ib as printError,Pb as printResult,vm as profile,Dm as profileApply,$m as profileLint,Nm as profileList,Lm as profileShow,AC as projectAfterCommandItemSnapshot,Fl as projectContextFocusRows,Qu as projectFleetAttributionAnalytics,uE as projectHistoryProvenance,$o as projectPmDiagnosticOutput,Fo as projectPmDiagnosticText,Ju as projectProvenanceCoverageAnalytics,pl as projectValidateCounts,VE as promoteAssuranceAssertion,uM as pruneCompileCacheGenerations,LE as putAssuranceDeclaration,DE as putAssuranceDeclarationBundle,hS as queryItemMetadataIndex,gS as queryLinkedFileMetadataIndex,yS as querySimilarItemMetadataIndex,rf as queryTestRunMeasurementsBelow,Zn as quoteCommandArg,Jn as quoteWindowsCommandArg,SO as rankCommandPaths,Cl as readAnnotationEntries,Kn as readAuthorEnvironment,hf as readBooleanOption,Sx as readContextUsageAffinity,gf as readCsvListOption,xd as readExtensionMigrationState,Hr as readFileIfExists,Ii as readFirstStringFromCommanderOptions,Mi as readFirstValueFromCommanderOptions,Wu as readHistoryAnalyticsWindow,_T as readHistoryEntries,ju as readImprovementLedger,bS as readItemMetadataDerivedIndexState,oi as readLocatedItem,jT as readOutputBudgetCollections,KT as readOutputCollectionFingerprint,UT as readOutputContinuationRowCollections,FT as readOutputContinuationRowPaths,db as readOutputIncludeModeOptions,GT as readOutputRowCollections,$T as readOutputRowPaths,tb as readOutputSessionRemainingTokens,mt as readPmPackageManifest,E_ as readRequiredString,Qo as readSettings,pS as readSettingsWithMetadata,ki as readStringArrayFromCommanderOptions,_f as readStringOption,gO as readThrownExitCode,qS as readVectorizationStatusLedger,rE as readWorkspaceContextIntentContracts,Ix as readWorkspaceContextSignals,Lx as readWorkspaceMemory,mn as reconcileExtensionCapabilityUsage,Wo as reconcileWorkspaceJsonHistory,SC as recordAfterCommandAffectedItem,FE as recordAssuranceVerdict,kl as recordClaimSemanticAttribution,Cx as recordContextUsageServing,Tx as recordContextUsageTouch,bx as recordContextUsageTouches,Nl as recordFocusSemanticAttribution,Uu as recordImprovementObservation,vl as recordReleaseSemanticAttribution,SS as refreshItemMetadataDerivedIndex,md as refreshMergeAttributeFenceIfInstalled,HS as refreshSearchArtifactsForMutation,jn as registerAgentProvenanceAdapters,Gn as registerHarnessSignalDescriptors,hT as registerOutputMaterialFieldGroups,Zm as release,$E as removeAssuranceDeclaration,Kr as removeFileIfExists,Xd as renameArtifactsResultKey,Ol as renderCalendarMarkdown,Pl as renderCalendarToon,Jl as renderContextMarkdown,Ed as renderExtensionDescribeMarkdown,Sd as renderExtensionSurfaceMarkdown,Uf as renderGuideMarkdown,_O as renderMissingOptionRetry,zx as renderNextMarkdown,EO as renderPmClosedDomainHelp,Qn as renderPmCommand,no as renderPmCommandAliasMigrationHint,Gu as renderPmCommandVisibilityMarkdown,xk as renderPmFlagLexiconMarkdown,MI as renderPmMcpAppHtml,nk as renderPmRefusalClosureCensusMarkdown,tS as renderRowsAsCsv,rS as renderRowsAsTable,Wm as reopen,xA as replayHistoryToTarget,$b as replayToCanonicalItemDocument,Db as replayToItemDocument,Hx as requireTerminalReason,Kx as requireTerminalReasonWithRecovery,yC as resetActiveExtensionRuntimeState,bc as resetWorkspaceGraphCache,vn as resolveAgentSessionContextFromSignals,wl as resolveAnnotationIndex,Sl as resolveAnnotationInput,mT as resolveAuthor,Yn as resolveAuthorIdentity,Hb as resolveBodyFileContent,rg as resolveBuiltinCorpusShape,Rl as resolveCalendarOutputFormat,tO as resolveCanonicalPmErrorCodeContract,Xy as resolveCanonicalRelationshipKind,fT as resolveClaimPrincipal,eT as resolveCliBulkIdsInput,qy as resolveCommandOptionPolicyState,pM as resolveCompileCacheGeneration,Mx as resolveCompletionTimestamp,Fy as resolveConfiguredPmPackageRoot,Zw as resolveContentFieldFilters,bb as resolveContextIntentContract,Gl as resolveContextOutputFormat,Ul as resolveContextTokenBudget,iR as resolveCreateExplicitEmptyFlag,PS as resolveEmbeddingProviders,Id as resolveExtensionInstallSourceIdentity,wd as resolveExtensionMigrationStatePath,iC as resolveExtensionRoots,Oy as resolveFlagValueKind,Ff as resolveGuideOutputFormat,Bu as resolveHistoryEpisodeGroupIdentity,lE as resolveHistoryProvenanceDimensions,OA as resolveHistorySubject,EA as resolveHistoryTarget,SR as resolveHybridSemanticWeight,on as resolveImplicitPmRoot,Ay as resolveIsoOrRelative,Fw as resolveItemBlockers,PO as resolveItemMutationDocument,nn as resolveItemTypeRegistry,tT as resolveItemTypesFilePath,pf as resolveLinkedTestFailureExitCode,nl as resolveLinkedTestSourceRef,ol as resolveLinkedTestSourceWorkspaceRoot,cl as resolveLinkedTestTrust,dl as resolveLinkedTestTrustBatch,yh as resolveMcpAcknowledgedSubscriptionFilter,ke as resolveMcpRequestContext,dd as resolveMergeInstallContext,Jw as resolveMissingMetadataFilters,mO as resolveMissingOptionPlaceholder,ST as resolveModePairedOutputOmissionReceipt,Ux as resolveNextOutputFormat,wT as resolveOutputOmissionReceipt,$y as resolvePmCliVersion,ro as resolvePmCommandAlias,Iu as resolvePmCommandCapabilityFamily,eR as resolvePmCommandExitContract,No as resolvePmCommandOutputBudget,aO as resolvePmCommandOutputEnvelope,mA as resolvePmCommandPositionalContract,ku as resolvePmCommandVisibilityTier,Do as resolvePmDiagnosticOutputBudget,rO as resolvePmErrorCodeContract,oy as resolvePmFlagSemanticConcept,Dy as resolvePmPackageRootFromModule,_A as resolvePmPositionalActionContract,$a as resolvePmPositionalActionFlagContracts,Ce as resolvePmRoot,Ua as resolvePmToolCustomFieldCollision,Jb as resolvePriority,St as resolveProfile,ud as resolveProjectMergeTypeFolders,vT as resolveQueryCursorStart,ub as resolveReadOutputDimensions,hb as resolveReadOutputEncoding,VT as resolveReadOutputRecoveryBudget,ab as resolveReadOutputSurface,ET as resolveReadRowContract,fO as resolveRecoveryCommandName,LC as resolveRegisteredSearchProvider,DC as resolveRegisteredVectorStoreAdapter,bi as resolveReproducibleProcessEnvironment,Tn as resolveRuntimeFieldRegistry,Cn as resolveRuntimeStatusRegistry,IS as resolveSearchCorpusFields,TR as resolveSearchMaxResults,CR as resolveSearchPage,bR as resolveSearchScoreThreshold,AR as resolveSearchTuning,kS as resolveSemanticCorpusCharacterLimit,Ml as resolveSemanticLineageIds,fS as resolveSettingsWithSemanticRuntimeDefaults,ow as resolveSourceContextWritePolicy,Pu as resolveStartTaskInProgressStatus,H as resolveSubcommandFlagContractsForCommand,gy as resolveTelemetryErrorCategory,Vx as resolveTerminalReason,zy as resolveTypeDefinition,By as resolveTypeName,eS as resolveTypeSynonym,aS as resolveTypeWorkflows,id as resolveUnknownAuthorAcknowledgmentSelector,xR as resolveVectorIndexRecovery,LS as resolveVectorStores,ac as resolveWorkspaceRelationshipKindRegistry,Hy as resolveWorkspaceRoot,t_ as restore,Ry as restoreCheckpointItems,Xo as restoreWorkspaceJsonFromHistory,mu as restoreWorkspaceSnapshot,fu as restoreWorkspaceSnapshotWithRecovery,x_ as runAction,xC as runActiveBeforeMutationHooks,OC as runActiveCommandHandler,RC as runActiveOnIndexHooks,gn as runActiveOnReadHooks,hn as runActiveOnWriteHooks,PC as runActiveParserOverride,IC as runActivePreflightOverride,MC as runActiveServiceOverride,sc as runActivity,oC as runAfterCommandHooks,_l as runAggregate,El as runAnnotationCommand,hl as runAppend,kw as runAssuranceAction,vw as runAssuranceDispatch,nC as runBeforeCommandHooks,Il as runCalendar,rp as runClaim,np as runClaimNext,sp as runClose,cp as runCloseMany,dp as runComments,jf as runCompletion,zp as runConfig,gt as runContext,_x as runContextEvaluationCorpus,fx as runContextEvaluationScenario,Fp as runCopy,kp as runCreate,Gp as runDelete,Sc as runDeps,Yd as runDocs,lO as runDuplicates,nu as runEval,iu as runEvent,Md as runExtension,Pd as runExtensionMigrateAction,Od as runExtensionMigrations,Qd as runFiles,tl as runFilesDiscover,el as runFilesLookup,Zu as runFleetAttributionAnalytics,Up as runFocus,Bp as runGc,jp as runGet,ed as runGraph,Gf as runGuide,kd as runHealth,nR as runHistory,HR as runHistoryCompact,XR as runHistoryCompactBulk,PA as runHistoryRedact,yw as runHistoryRepair,Tw as runHistoryRepairAll,Yp as runInit,Kp as runInitAgentGuidance,lp as runLearnings,Wd as runLinkedArtifacts,uf as runLinkedTests,ml as runList,ou as runMeet,DR as runMergeDriver,_d as runMergeInstall,hw as runMergeReceiptReport,$R as runMergeReconcile,ep as runNext,pp as runNotes,$p as runPlan,Eu as runProfileApply,Au as runProfileLint,bu as runProfileList,Su as runProfileShow,Yu as runProvenanceCoverageAnalytics,XO as runRegisteredCommandForTest,eP as runRegisteredCommandOverrideForTest,aP as runRegisteredExporterForTest,JO as runRegisteredHookForTest,sP as runRegisteredImporterForTest,iP as runRegisteredMigrationForTest,YO as runRegisteredMutationGuardForTest,ZO as runRegisteredParserOverrideForTest,QO as runRegisteredPreflightOverrideForTest,tP as runRegisteredRendererOverrideForTest,nP as runRegisteredSearchProviderForTest,rP as runRegisteredServiceOverrideForTest,oP as runRegisteredVectorStoreAdapterForTest,Mt as runReindex,op as runRelease,su as runRemind,YR as runReopen,ap as runRestore,Cd as runSchemaEvolutionMigration,tu as runSearch,ig as runSearchRefreshWorkerEntrypoint,Bf as runStartBackgroundRun,of as runStats,af as runTelemetry,Cu as runTemplatesList,yu as runTemplatesSave,Tu as runTemplatesShow,ff as runTest,mf as runTestAll,zf as runTestRunsList,Vf as runTestRunsLogs,Kf as runTestRunsResume,qf as runTestRunsStatus,Hf as runTestRunsStop,Wf as runTestRunsWorker,vp as runUpdate,Np as runUpdateMany,yt as runUpgrade,fl as runValidate,w_ as runWithActiveExtensions,Nn as runWithAgentSessionContext,Cb as runWithContextIntentContracts,iE as runWithDiscoveredContextIntentContracts,zn as runWithHarnessDetectionSignals,SI as runWithMcpTraceContext,Ai as runWithReproducibleProcessEnvironment,qn as runWithWorkspaceHarnessSignalDescriptors,Er as runWithWorkspaceRecipe,fR as runWorkspaceTransactionGc,Jc as saveGraphAuditBaseline,ZE as scanExtensionHostVersions,nd as scanHistoryAuthorAttribution,xn as scanItemFormatVersions,ai as scanMutationSecrets,uw as scanProvenanceResolverHealth,Ci as scanStaleInProgressItems,bw as scanStorageIntegrity,hm as schema,Am as schemaAddField,bm as schemaAddStatus,Cm as schemaAddType,Rm as schemaApplyPreset,Om as schemaInferTypes,gm as schemaList,wm as schemaListFields,Mm as schemaRemapStatus,Em as schemaRemoveField,Sm as schemaRemoveStatus,Tm as schemaRemoveType,Im as schemaRenameField,Pm as schemaRenameType,ym as schemaShow,xm as schemaShowField,km as schemaShowStatus,bO as scoreCommandPathMatch,dx as scoreContextCandidates,lx as scoreContextCandidatesWithActiveExtensions,hi as scoreItemSimilarity,hk as scorePmGrammarRefusalClosure,sk as scorePmRefusalClosure,gi as scorePreparedItemSimilarity,Ck as scoreTrackerPreflightRecoveryClosure,zP as sealMcpRequestState,Zf as search,Fx as searchWorkspaceMemory,Gx as searchWorkspaceMemoryReadResult,RT as selectCursorSemanticOptions,Nf as selectImportAuthor,gI as selectMcpClientRegistrationMode,$x as selectWorkspaceMemory,Dx as selectWorkspaceMemoryRollups,Dl as semanticAttributionAffinity,ZS as sentryCaptureCliError,JS as sentryFinishCommandSpan,eA as sentryFlush,QS as sentryLogCliUsageError,XS as sentrySetCommandContext,YS as sentryStartCommandSpan,In as serializeItemDocument,wO as serializeNdjsonRows,xO as serializeNdjsonStream,CC as setActiveCommandContext,TC as setActiveCommandResult,uC as setActiveExtensionCommands,pC as setActiveExtensionHooks,fC as setActiveExtensionParsers,mC as setActiveExtensionPreflight,gC as setActiveExtensionRegistrations,hC as setActiveExtensionRenderers,_C as setActiveExtensionServices,pT as setFocusedItem,aA as shouldCompletePlanOnClose,Xc as shouldPersistDurableGraphCache,WC as shouldResolveMutationStdinTokenField,KC as shouldResolveMutationStdinTokens,_S as shouldRunSearchRefreshInForeground,fp as similarityAdvisoryWarnings,DT as sliceReadOutputRowCollection,Vd as sortLinkedArtifacts,$C as splitAcceptanceCriteria,oA as splitCommaList,Pn as splitFrontMatter,fb as stabilizeReadOutputReceiptEstimates,Q as stableStringify,rC as stableValueEquals,n_ as startTask,dA as startTelemetryCommand,rm as stats,nT as statusIsTerminal,P_ as stripGlobalBootstrapTokens,UR as subscribeMutationEventBatches,jR as subscribeMutationEvents,mR as summarizeAgentIdentityVocabulary,qu as summarizeAgentModelProvenance,Vu as summarizeAgentProvenance,mx as summarizeContextEvaluationReports,cf as summarizeContextPreflight,_E as summarizeHistoryProvenance,Wp as summarizeInitResult,fw as summarizeMergeReceipt,sR as supportsCreateExplicitEmpty,pO as supportsItemIdAlias,Ny as suppressHostOutput,me as syncRelationshipGraphAdapter,zO as synthesizeExtensionManifest,Fa as toCompletionFlagString,Xl as toContextFocusItem,Hl as toContextPackingSummary,Kl as toContextRankingSummary,Cy as toErrorMessage,Cf as toEstimatedMinutesValue,VA as toExtensionFlagDefinitions,Ef as toImportBoolean,Of as toImportConfidence,Af as toImportInteger,kf as toImportLinkedDocs,Mf as toImportLinkedFiles,vf as toImportLinkedTests,If as toImportLogEntries,Pf as toImportNormalizedEnum,Rf as toImportNumberMap,Tf as toImportPriority,Sf as toImportStatus,wf as toImportStringList,xf as toImportStringMap,bf as toImportTags,dT as toItemRecord,yf as toNonEmptyImportString,yy as toNonEmptyStringOrUndefined,Fb as toReplayDocument,mi as tokenizeSimilarityText,HC as transferMutationStdinTokenPolicy,qR as translateHostEnvironmentFault,Km as update,b_ as upgrade,Fm as validate,xE as validateAssertionDefinition,OE as validateAssuranceDocument,RE as validateGateDefinition,MO as validateItemMutationRows,Kd as validateLinkedPaths,yI as validateMcpAuthorizationResponseIssuer,hI as validateMcpAuthorizationServerMetadata,CI as validateMcpClientMetadataDocument,cI as validateMcpHttpRequestHeaders,KP as validateMcpJsonSchema,wE as validateMeasurementDefinition,Xb as validateMissingParentReference,cb as validateReadOutputOptions,Zb as validateSprintOrReleaseValue,Vy as validateTypeOptions,ZR as verifyCliFlagInvocationParity,yA as verifyExplicitPositionalSlotCensus,jb as verifyHistoryChain,Ub as verifyHistoryChainWithVersion,IA as verifyHistoryEntries,SA as verifyPmCliGrammar,bA as verifyPmCommandPositionalContracts,wk as verifyPmFlagLexicon,JM as verifyPmRecoveryKindRuntimeCoverage,Wg as verifyPmRecoveryProducerRuntimeCoverage,YM as verifyPmRecoveryReferences,tk as verifyPmRefusalClosureIdentityRatchet,ek as verifyPmRefusalClosureRatchet,XM as verifyPmRefusalReachability,Gi as verifyToolOptionCliParity,ns as withFlagAliasMetadata,VR as withHostEnvironmentBoundary,HP as withMcpCachePolicy,Tc as workspaceGraphCache,Al as wrapOwnershipConflict,TO as wrapThrownErrorForSentry,Wn as writeAuthorEnvironment,ge as writeFileAtomic,wy as writeMutationCheckpoint,uS as writeSettings,Ob as writeStdout,VS as writeVectorizationStatusLedger,Ko as writeWorkspaceJsonWithHistory};
8
33
  //# sourceMappingURL=sdk.js.map