@unbrained/pm-cli 2026.9.9 → 2026.9.10
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.
- package/.claude-plugin/marketplace.json +2 -2
- package/CHANGELOG.md +17 -0
- package/dist/cli/command-namespaces.d.ts +9 -0
- package/dist/cli/command-namespaces.js +2 -0
- package/dist/cli/help-content.js +1 -1
- package/dist/cli/help-json-payload.d.ts +5 -1
- package/dist/cli/help-json-payload.js +2 -2
- package/dist/cli/main.d.ts +1 -0
- package/dist/cli/main.js +3 -3
- package/dist/cli/register-mutation.js +2 -2
- package/dist/cli/register-operations.d.ts +0 -5
- package/dist/cli/register-operations.js +1 -1
- package/dist/cli-bundle/bundle-manifest.json +154 -154
- package/dist/cli-bundle/chunks/chunk-4SFBH77G.js +2233 -0
- package/dist/cli-bundle/chunks/{chunk-4VL5P22L.js → chunk-74RGSPLL.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-WQKMSFBV.js → chunk-7WIHZI2M.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-L5RCDKQ2.js → chunk-EOCKPCEY.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-GLQMKUGP.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-OHNLSGGV.js → chunk-I6XT3DLQ.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-MACGGTLQ.js +29 -0
- package/dist/cli-bundle/chunks/{chunk-ECBLPN7B.js → chunk-NKOYVKFM.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-Z3XVXUVF.js → chunk-P6BEYAON.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-3IPRM75M.js → chunk-PYUITRSV.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-T3AMFUCN.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-D3YVILJJ.js → chunk-TSWEX72T.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-J6ERHBV2.js → chunk-YKQTETJI.js} +71 -71
- package/dist/cli-bundle/chunks/{register-list-query-UIHRCS6D.js → register-list-query-CUIW7SSE.js} +2 -2
- package/dist/cli-bundle/chunks/register-mutation-5F5CYUWZ.js +20 -0
- package/dist/cli-bundle/chunks/register-operations-XIZPLPQY.js +2 -0
- package/dist/cli-bundle/chunks/{register-setup-PERI45EM.js → register-setup-JVGPCAIL.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-OQUGRHKV.js → chunk-26O2WB73.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-5YU75QLV.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-QQQ4SAUO.js → chunk-7N5MRONP.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-B2CMFYRZ.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-PNKIANFZ.js → chunk-CRY5MHEI.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-YCDQ2N23.js → chunk-F6WKFXBT.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-BUCJUZVG.js → chunk-FHUARRMA.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-5FHTCOHS.js → chunk-M36SF4GE.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-TTYXF5YD.js → chunk-OROZM37I.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-XNR3DM6J.js → chunk-PNGYYQY7.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-ZTCE4UO6.js → chunk-SL5YVVPV.js} +3 -3
- package/dist/cli-bundle/focused-chunks/{chunk-XSS3APUF.js → chunk-TPOL4TWE.js} +5 -5
- package/dist/cli-bundle/focused-chunks/{chunk-7PC4R5QB.js → chunk-U5SHHU7E.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-2WSBXIGF.js → chunk-XSMA2W6Q.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-ZAWAL2CG.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-7N6DOREF.js → chunk-ZDNAWWQI.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-YJUXGS57.js → chunk-ZJHYQOTM.js} +2 -2
- package/dist/cli-bundle/main.js +26 -26
- package/dist/cli-bundle/sdk-authoring.js +1 -1
- package/dist/cli-bundle/sdk-contracts.js +2 -2
- package/dist/cli-bundle/sdk-core.js +37 -37
- package/dist/cli-bundle/sdk-governance.js +1 -1
- package/dist/cli-bundle/sdk-graph.js +1 -1
- package/dist/cli-bundle/sdk-merge.js +42 -42
- package/dist/cli-bundle/sdk-query.js +1 -1
- package/dist/cli-bundle/sdk-runtime.js +1 -1
- package/dist/cli-bundle/sdk-testing.js +1 -1
- package/dist/cli-bundle/sdk.js +10 -10
- package/dist/sdk/agent/item-addressing.js +1 -1
- package/dist/sdk/agent-capability-contracts.js +1 -1
- package/dist/sdk/cli-bootstrap.js +1 -1
- package/dist/sdk/cli-contracts/command-aliases.d.ts +11 -1
- package/dist/sdk/cli-contracts/command-aliases.js +1 -1
- package/dist/sdk/cli-contracts/flag-contracts.js +1 -1
- package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +1 -1
- package/dist/sdk/cli-contracts/grammar-contracts.js +1 -1
- package/dist/sdk/cli-contracts/runtime-contracts.d.ts +4 -1
- package/dist/sdk/cli-contracts/runtime-contracts.js +1 -1
- package/dist/sdk/cli-contracts/tool-schema.d.ts +3 -3
- package/dist/sdk/cli-contracts/tool-schema.js +1 -1
- package/dist/sdk/cli-contracts/typed-action-inputs.d.ts +2 -0
- package/dist/sdk/cli-contracts.d.ts +1 -1
- package/dist/sdk/cli-contracts.js +1 -1
- package/dist/sdk/completion.js +359 -346
- package/dist/sdk/index.d.ts +2 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/lifecycle/claim.js +1 -1
- package/dist/sdk/lifecycle/lifecycle-transitions.d.ts +1 -1
- package/dist/sdk/lifecycle/lifecycle-transitions.js +1 -1
- package/dist/sdk/lifecycle/mcp-actions.js +1 -1
- package/dist/sdk/lifecycle/task-composition.d.ts +17 -0
- package/dist/sdk/lifecycle/task-composition.js +2 -0
- package/dist/sdk/public-surface.json +1 -1
- package/dist/sdk/query/workspace-contracts.d.ts +3 -0
- package/dist/sdk/query/workspace-contracts.js +2 -0
- package/dist/sdk/runtime-input.js +1 -1
- package/dist/sdk/runtime.d.ts +69 -9
- package/dist/sdk/runtime.js +1 -1
- package/docs/COMMANDS.md +26 -24
- package/docs/COMMAND_NAMESPACES.md +65 -0
- package/docs/LIFECYCLE_COMMANDS.md +77 -0
- package/docs/README.md +2 -0
- package/docs/generated/AGENT_CAPABILITY_ROUTING.md +6 -6
- package/docs/generated/AGENT_COMMAND_SURFACE.md +19 -0
- package/docs/generated/FLAG_LEXICON_BUDGETS.md +21 -3
- package/docs/generated/REFUSAL_CLOSURE_CENSUS.md +2 -2
- package/marketplace.json +2 -2
- package/package.json +1 -1
- package/packages/pm-beads/package.json +1 -1
- package/packages/pm-calendar/package.json +1 -1
- package/packages/pm-command-kit/package.json +1 -1
- package/packages/pm-digital-twin/package.json +1 -1
- package/packages/pm-governance-audit/README.md +4 -2
- package/packages/pm-governance-audit/package.json +1 -1
- package/packages/pm-guide-shell/package.json +1 -1
- package/packages/pm-kanban/package.json +1 -1
- package/packages/pm-lifecycle-hooks/package.json +1 -1
- package/packages/pm-linked-test-adapters/package.json +1 -1
- package/packages/pm-search-advanced/README.md +6 -4
- package/packages/pm-search-advanced/package.json +1 -1
- package/packages/pm-templates/package.json +1 -1
- package/packages/pm-todos/package.json +1 -1
- package/packages/pm-vcs/package.json +1 -1
- package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
- package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
- package/dist/cli-bundle/chunks/chunk-AAFBV3U3.js +0 -29
- package/dist/cli-bundle/chunks/chunk-JUNJ5EKI.js +0 -2
- package/dist/cli-bundle/chunks/chunk-NSAPNEYH.js +0 -2
- package/dist/cli-bundle/chunks/chunk-XZ6T7YPP.js +0 -2217
- package/dist/cli-bundle/chunks/register-mutation-WHWMGRVX.js +0 -20
- package/dist/cli-bundle/chunks/register-operations-64YZYTC5.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-2W4XIYOB.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-FE3BABLJ.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-IWITF53W.js +0 -2
package/dist/cli-bundle/sdk.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{A as Rh,B as Ih,C as pk,D as mk,a as as,b as cs,c as ds,d as ls,e as rk,f as ok,g as gh,h as yh,i as bh,k as Ch,l as Th,m as wh,n as Sh,o as Eh,p as Ah,q as vh,r as Oh,s as nk,t as ik,u as sk,v as ak,w as ck,x as dk,y as lk,z as uk}from"./chunks/chunk-JUNJ5EKI.js";import{A as Qk,B as eM,C as tM,D as rM,E as oM,F as nM,G as iM,H as sM,I as aM,J as cM,K as dM,L as lM,M as uM,N as pM,O as mM,P as fM,Q as _M,R as hM,S as gM,T as yM,U as bM,V as CM,W as TM,X as wM,Y as SM,a as Ok,b as Rk,c as Ik,d as Pk,e as kk,f as Mk,g as xk,h as Nk,i as Lk,j as Dk,k as $k,l as Fk,m as jk,n as Gk,o as Uk,p as Bk,q as qk,r as zk,s as Vk,t as Hk,u as Kk,v as Wk,w as Xk,x as Yk,y as Jk,z as Zk}from"./chunks/chunk-Z3XVXUVF.js";import{a as fk,b as _k,c as hk,d as gk}from"./chunks/chunk-3IPRM75M.js";import{a as yk,b as bk,c as Ck,d as Tk,e as wk,f as Sk,g as Ek,h as Ak,i as vk}from"./chunks/chunk-L5RCDKQ2.js";import{$ as or,$a as Kf,$b as K_,A as xv,Aa as _f,Ab as C_,B as iu,Ba as hf,Bb as T_,C as Ju,Ca as gf,Cb as w_,D as Zu,Da as yf,Db as S_,E as Qu,Ea as bf,Eb as E_,F as ep,Fa as Cf,Fb as A_,G as Ep,Ga as Tf,Gb as v_,H as We,Ha as wf,Hb as O_,I as Ap,Ia as Sf,Ib as R_,J as vp,Ja as Ef,Jb as I_,K as Op,Ka as Af,Kb as P_,L as Rp,La as vf,Lb as k_,M as Ip,Ma as Of,Mb as M_,N as Pp,Na as Rf,Nb as x_,O as OP,Oa as If,Ob as N_,P as RP,Pa as Pf,Pb as L_,Q as IP,Qa as ar,Qb as D_,R as Kt,Ra as _e,Rb as $_,S as Wt,Sa as Ff,Sb as F_,T as Xt,Ta as jf,Tb as j_,U as Yt,Ua as Gf,Ub as G_,V as Jt,Va as Uf,Vb as U_,W as Zt,Wa as Bf,Wb as B_,X as Qt,Xa as qf,Xb as q_,Y as er,Ya as zf,Yb as z_,Z as tr,Za as Vf,Zb as V_,_ as rr,_a as Hf,_b as H_,a as $c,aa as sm,ab as Wf,ac as W_,b as Fc,ba as am,bb as Xf,bc as X_,c as jc,ca as cm,cb as Yf,cc as Y_,d as sv,da as dm,db as Jf,dc as J_,e as av,ea as lm,eb as Zf,ec as Z_,f as Gc,fa as Xe,fb as Qf,fc as Q_,g as fv,ga as um,gb as e_,gc as eh,h as _v,ha as pm,hb as t_,hc as th,i as hv,ia as mm,ib as r_,ic as rh,j as gv,ja as fm,jb as o_,jc as oh,k as yv,ka as _m,kb as n_,kc as nh,l as bv,la as hm,lb as i_,lc as ih,m as Cv,ma as gm,mb as s_,mc as sh,n as Tv,na as ym,nb as a_,nc as ah,o as wv,oa as qP,ob as c_,oc as ch,p as Sv,pa as of,pb as d_,pc as dh,q as Ev,qa as nf,qb as l_,qc as lh,r as Av,ra as sf,rb as u_,rc as uh,s as vv,sa as af,sb as p_,sc as ph,t as Ov,ta as cf,tb as m_,tc as mh,u as Vc,ua as df,ub as f_,uc as fh,v as Rv,va as lf,vb as __,vc as _h,w as Iv,wa as uf,wb as h_,wc as hh,x as Pv,xa as pf,xb as g_,y as kv,ya as mf,yb as y_,z as Mv,za as ff,zb as b_}from"./chunks/chunk-XZ6T7YPP.js";import{a as Ht,f as uP,g as pP,h as xp,i as Np}from"./chunks/chunk-ECBLPN7B.js";import{A as SP,B as EP,C as AP,D as vP,E as Vp,F as Hp,G as Kp,H as FP,I as bm,J as jP,K as GP,L as UP,M as BP,b as nu,c as sI,d as Yu,e as eP,f as nP,g as iP,h as sP,i as aP,j as cP,k as kp,l as dP,m as Up,n as Bp,o as qp,p as zp,q as mP,r as fP,s as _P,t as hP,u as gP,v as yP,w as bP,x as CP,y as TP,z as wP}from"./chunks/chunk-WQKMSFBV.js";import{$a as eu,$b as mp,$c as WP,A as hO,Aa as Ol,Ab as VI,Ac as rm,Ad as Vm,B as gO,Ba as Rl,Bb as HI,Bc as om,Bd as Hm,C as yO,Ca as Il,Cb as KI,Cc as nm,Cd as tk,D as bO,Da as Pl,Db as Wu,Dc as im,Dd as Km,E as IO,Ea as kl,Eb as Xu,Ec as LP,Ed as Wm,Fa as Ml,Fb as WI,Fc as DP,Fd as Xm,Ga as xl,Gb as XI,Gc as $P,Gd as Ym,Ha as Nl,Hb as YI,Hc as Cm,Hd as Jm,Ia as Ll,Ib as Ke,Ic as zP,Id as Zm,J as Bd,Ja as Dl,Jb as JI,Jc as nr,Jd as Qm,Ka as $l,Kb as Vt,Kc as VP,Kd as ef,La as Fl,Lb as ZI,Lc as Ye,Ld as tf,Ma as jl,Mb as QI,Mc as re,Md as rf,Na as Gl,Nc as Tm,Nd as kf,Oa as Ul,Ob as tp,Od as Mf,Pa as Bl,Pb as rp,Pd as xf,Qa as ql,Qb as tP,Qc as Je,Qd as Nf,Ra as zl,Rb as op,Rc as wm,Rd as Lf,Sa as Vl,Sb as np,Sc as Sm,Sd as Df,Ta as Hl,Tb as ip,Td as $f,Ua as Kl,Ub as sp,Uc as fe,Va as Wl,Vb as ap,Vc as Em,Wa as Xl,Wb as cp,Wc as Am,Xa as Yl,Xb as dp,Xc as vm,Ya as Jl,Yb as lp,Yc as Om,Za as Zl,Zb as up,Zc as HP,_a as Ql,_b as pp,_c as KP,a as zv,aa as PO,ab as tu,ac as fp,ad as XP,b as Vv,ba as kO,bb as ru,bc as _p,bd as YP,c as Hv,ca as qd,cb as QR,cc as hp,cd as ir,d as Kv,da as zd,db as eI,dc as gp,dd as JP,e as Wv,ea as Vd,eb as tI,ec as yp,ed as ZP,f as Xv,fa as Hd,fb as rI,fc as bp,fd as sr,g as Yv,ga as Kd,gb as oI,gc as Cp,gd as QP,h as Jv,ha as Wd,hb as nI,hc as Tp,hd as ek,i as Zv,ia as Xd,ib as iI,ic as rP,j as Qv,ja as uR,jb as su,jc as oP,jd as Rm,k as eO,ka as pR,kb as au,kc as wp,kd as Im,l as tO,la as mR,lb as cu,ld as Pm,m as rO,ma as fR,mb as du,md as km,n as oO,na as _R,nb as lu,nd as Mm,o as nO,oa as hR,oc as Sp,od as xm,p as iO,pa as gR,pb as uu,pd as Nm,q as sO,qa as SR,qb as pu,qc as lP,qd as Lm,r as aO,ra as ER,rb as mu,rc as Mp,rd as Dm,s as cO,sa as Tl,sb as fu,sc as Wp,sd as $m,t as dO,ta as wl,tb as _u,tc as Xp,td as Fm,u as lO,ua as AR,ub as zu,uc as Yp,ud as jm,v as uO,va as vR,vb as Vu,vc as Jp,vd as Gm,w as pO,wa as Sl,wb as Hu,wc as Zp,wd as Um,x as mO,xa as El,xb as Ku,xc as Qp,xd as Bm,y as fO,ya as Al,yb as qI,yc as em,yd as qm,z as _O,za as vl,zb as zI,zc as tm,zd as zm}from"./chunks/chunk-AAFBV3U3.js";import{Aa as dl,Ba as ll,Ca as ul,H as UO,Ha as pl,I as BO,Ia as ml,Ja as fl,K as qO,Ka as _l,L as zO,La as hl,M as VO,Ma as gl,N as nl,Na as yl,O as il,P as sl,Pa as bl,Q as al,Qa as Cl,R as Ft,Ra as Lp,Sa as Dp,Ta as $p,Va as Fp,Wa as jp,Xa as Gp,a as pv,b as mv,c as Uc,d as Bc,f as qc,g as zc,h as MO,i as xO,j as NO,k as LO,l as DO,m as $O,n as FO,o as jO,p as Yd,q as Jd,r as Zd,s as Qd,t as el,u as GO,ua as jt,v as tl,va as Gt,w as rl,wa as Ut,x as ol,xa as Bt,ya as cl}from"./chunks/chunk-OHNLSGGV.js";import{$ as dd,$a as aR,$b as dI,$c as Bu,A as CO,Aa as Dd,Ac as DI,B as TO,Ba as $d,Bc as $I,C as wO,Ca as Fd,Cc as FI,D as SO,Da as jd,Dc as Cu,E as EO,Ea as Gd,Ec as Tu,F as AO,Fa as Ud,Fb as GR,Fc as wu,G as vO,Gb as UR,Gc as Su,H as OO,Hb as BR,Hc as Eu,I as Kc,Ia as HO,Ib as qR,Ic as Au,J as Wc,Ja as KO,Jb as zR,Jc as qt,K as Xc,Ka as WO,Kb as VR,Kc as vu,L as Yc,La as XO,Lc as Ou,M as Jc,Ma as YO,Mc as Ru,N as Zc,Na as JO,Nb as HR,Nc as Iu,O as Qc,Oa as ZO,Ob as KR,Oc as Pu,P as ed,Pa as QO,Pb as WR,Pc as ku,Q as td,Qa as eR,Qb as XR,Qc as Mu,R as rd,Ra as tR,Rb as YR,Rc as xu,S as od,Sa as rR,Sb as JR,Sc as Nu,T as He,Ta as oR,Tb as ZR,Tc as Lu,U as nd,Ua as nR,Ub as ou,Uc as Du,V as id,Vb as hu,Vc as $u,W as sd,Wb as gu,Wc as Fu,X as ad,Xb as yu,Xc as ju,Y as RO,Ya as iR,Yb as bu,Yc as Gu,Zb as aI,Zc as Uu,_ as cd,_a as sR,_b as cI,_c as zt,aa as ld,ac as lI,ad as jI,b as ZA,ba as ud,bb as cR,bc as uI,bd as GI,c as QA,ca as pd,cb as dR,cc as pI,cd as UI,d as ev,da as md,db as lR,dc as mI,dd as qu,e as tv,ea as fd,ec as fI,ed as BI,f as rv,fa as _d,fb as yR,fc as _I,fd as PP,ga as hd,gb as bR,gc as hI,gd as kP,h as ov,ha as gd,hb as CR,hc as gI,hd as MP,i as nv,ia as yd,ib as TR,ic as yI,id as xP,j as iv,ja as bd,jb as wR,jc as bI,jd as NP,k as cv,ka as Cd,kb as OR,kc as CI,l as dv,la as Td,lb as RR,lc as TI,m as lv,ma as wd,mb as IR,mc as wI,n as uv,na as Sd,nb as PR,nc as SI,o as Nv,oa as Ed,ob as kR,oc as EI,p as Lv,pa as Ad,pb as MR,pc as AI,q as Dv,qa as vd,qb as xR,qc as vI,r as $v,ra as Od,rb as NR,rc as OI,s as Fv,sa as Rd,sb as LR,sc as RI,t as jv,ta as Id,tb as DR,tc as II,u as Gv,ua as Pd,ub as $R,uc as PI,v as Uv,va as kd,vb as FR,vc as kI,w as Bv,wa as Md,wb as jR,wc as MI,x as qv,xa as xd,xc as xI,ya as Nd,yc as NI,z as Hc,za as Ld,zc as LI}from"./chunks/chunk-D3YVILJJ.js";import{$ as Xb,$b as MC,$c as sT,$d as Sn,$f as si,$g as nS,$h as WS,$i as RE,$k as fs,$l as ea,$m as ec,A as Ub,Aa as Yo,Ac as dn,Ad as AT,Ae as Dn,Af as mw,Ag as ki,Ah as PS,Ai as mE,Aj as Ui,Al as Us,Am as Oa,An as te,Ba as Jo,Bc as ln,Bd as vT,Be as $n,Bf as fw,Bg as Mi,Bi as fE,Bj as Bi,Bk as Qi,Bl as Bs,Bm as Ra,Bn as Ac,Ca as Zo,Cb as SC,Cd as OT,Ce as Fn,Cf as _w,Cg as xi,Ci as _E,Cj as qi,Ck as es,Cl as qs,Cm as Ia,D as Bb,Db as je,Dd as RT,De as jn,Df as hw,Dg as Nw,Dh as kS,Di as hE,Dj as zi,Dk as ts,Dl as MA,Dm as Pa,Dn as qA,Eb as Rt,Ec as UC,Ed as IT,Ee as Gn,Ef as gw,Eg as Lw,Eh as MS,Ej as Vi,Ek as rs,El as xA,Em as ka,En as zA,Fb as EC,Fc as BC,Fd as PT,Fe as Un,Ff as yw,Fg as Dw,Fh as xS,Fi as gE,Fk as os,Fl as qe,Fm as Ma,Gb as AC,Gc as qC,Gd as kT,Ge as Bn,Gf as bw,Gg as $w,Gh as NS,Gj as Hi,Gk as ns,Gl as NA,Gm as xa,H as qb,Hb as vC,Hc as zC,He as qn,Hf as Cw,Hg as Fw,Hh as LS,Hi as yE,Hj as zE,Hk as is,Hl as LA,Hm as Na,Hn as VA,I as L,Ib as OC,Ic as VC,Ie as zn,If as Tw,Ig as jw,Ih as DS,Ii as bE,Ik as ss,Il as DA,Im as La,In as HA,J as zb,Jb as V,Jc as HC,Je as Vn,Jf as ww,Jg as Gw,Jh as $S,Ji as CE,Jj as VE,Jk as TA,Jl as Dt,Jm as Da,Jn as KA,K as b,Kb as RC,Kc as KC,Ke as zT,Kf as Sw,Kg as Uw,Kh as FS,Ki as TE,Kj as HE,Kk as wA,Kl as ze,Km as $a,Kn as WA,Lc as un,Le as VT,Lf as Ew,Lg as Bw,Lh as jS,Li as wE,Lj as KE,Lk as SA,Ll as $A,Lm as Fa,Ln as XA,M as Vb,Mc as WC,Md as MT,Me as Ge,Mf as Aw,Mg as qw,Mh as GS,Mk as EA,Ml as FA,Mm as ja,Mn as YA,N as Hb,Nc as XC,Ne as Hn,Nf as vw,Ng as zw,Nh as US,Nj as WE,Nk as AA,Nl as jA,Nm as Ga,Nn as JA,Oc as YC,Od as _n,Oe as HT,Of as Ow,Og as Vw,Oh as BS,Ok as vA,Ol as GA,Om as Ua,On as vc,Pc as JC,Pd as xT,Pe as Kn,Pf as Rw,Pg as Hw,Ph as qS,Pk as OA,Pl as UA,Pm as Ba,Pn as Oc,Q as Kb,Qc as ZC,Qd as hn,Qe as Wn,Qf as Iw,Qg as Kw,Qj as XE,Qk as RA,Ql as BA,Qm as qa,Qn as Rc,Ra as pC,Rc as QC,Re as Xn,Rf as Pw,Rg as Ww,Rh as zS,Rl as zs,Rm as za,Rn as Ic,Sa as mC,Sc as eT,Sd as NT,Se as Yn,Sf as kw,Sg as Xw,Sh as Ni,Sj as YE,Sl as Vs,Sm as Va,Sn as Pc,T as Wb,Ta as fC,Tc as tT,Td as LT,Tf as Mw,Tg as Yw,Th as Li,Tl as Hs,Tm as Ha,Tn as kc,U as At,Uc as pn,Ud as DT,Uf as xw,Ug as Jw,Uk as Lt,Ul as Ks,Um as Ka,Un as Mc,Vb as IC,Vc as rT,Vd as gn,Vf as ei,Vg as Zw,Vk as IA,Vl as Ws,Vm as Wa,Vn as xc,W as vt,Wa as Qo,Wb as sn,Wc as mn,Wd as yn,Wf as ti,Wg as Qw,Wi as SE,Wj as JE,Wk as PA,Wl as Xs,Wm as Xa,Wn as Nc,X as zo,Xa as _C,Xb as an,Xd as bn,Xf as ri,Xg as eS,Xi as EE,Xj as ZE,Xk as kA,Xl as Ys,Xm as Ya,Xn as Lc,Y as Vo,Ya as hC,Yb as PC,Yc as oT,Yd as Cn,Yf as oi,Yg as tS,Yh as VS,Yi as AE,Yj as QE,Yk as us,Yl as Js,Ym as Ja,Yn as Dc,Z as Ot,Za as gC,Zb as kC,Zc as nT,Zd as Tn,Zf as ni,Zg as rS,Zh as HS,Zi as vE,Zj as eA,Zk as ps,Zl as Zs,Zm as Za,Zn as $t,_a as yC,_b as P,_c as iT,_d as wn,_f as ii,_g as oS,_h as KS,_i as OE,_j as tA,_k as ms,_l as Qs,_m as Qa,ab as en,ac as It,ad as aT,ae as $T,af as kt,ag as Ue,ah as iS,ak as rA,al as _s,am as ta,an as tc,b as Do,ba as Yb,bb as tn,bc as xC,bd as Pt,be as FT,bf as Mt,bg as Be,bh as sS,bi as XS,bk as oA,bl as hs,bm as ra,bn as rc,c as De,ca as Jb,cb as Fe,cd as cT,cf as Jn,cg as ai,ch as aS,ci as YS,cj as IE,ck as nA,cl as gs,cm as oa,cn as oc,d as $o,da as Zb,db as bC,dc as NC,dd as dT,de as En,df as Zn,dg as ci,dh as cS,dj as PE,dk as iA,dl as ys,dm as na,dn as nc,e as Fo,ea as Qb,ed as lT,ee as An,ef as Qn,eg as di,eh as dS,ei as JS,ej as ji,ek as sA,el as bs,em as ia,en as ic,f as jo,fa as eC,fb as rn,fe as jT,fg as li,fh as lS,fj as kE,fk as aA,fl as Cs,fm as sa,fn as sc,g as Go,ga as tC,gb as on,gd as uT,ge as vn,gf as KT,gg as ui,gh as uS,gi as ZS,gj as ME,gk as cA,gl as Ts,gm as aa,gn as ac,ha as rC,hd as pT,he as On,hf as WT,hg as pi,hh as pS,hi as QS,hj as xE,hk as dA,hl as ws,hm as ca,hn as cc,i as Uo,ia as oC,ib as nn,ie as GT,if as XT,ig as mi,ih as mS,ii as eE,ij as NE,ik as lA,il as Ss,im as da,in as dc,j as Et,ja as nC,je as Rn,jf as YT,jg as fi,jh as fS,ji as tE,jj as xt,jk as uA,jl as Es,jm as la,jn as lc,k as me,ka as iC,kd as fn,ke as In,kf as JT,kg as _i,kh as _S,ki as rE,kk as Nt,kl as As,km as ua,kn as uc,l as Bo,ld as mT,le as D,lf as ZT,lg as hi,lh as hS,li as oE,lk as pA,ll as vs,lm as pa,ln as pc,m as $e,ma as sC,md as fT,me as Pn,mf as QT,mg as gi,mh as gS,mi as nE,mj as LE,mk as mA,ml as Os,mm as ma,mn as mc,n as qo,na as aC,nd as _T,nf as ew,ng as yi,nh as yS,ni as iE,nk as fA,nl as Rs,nm as fa,nn as fc,oa as cC,od as hT,of as tw,og as bi,oh as bS,oi as sE,ok as _A,ol as Is,om as _a,on as _c,p as $b,pa as dC,pd as gT,pf as rw,pg as Ci,ph as CS,pi as aE,pk as hA,pl as Ps,pm as ha,pn as hc,q as Fb,qa as lC,qc as LC,qd as yT,qf as ow,qg as Ti,qh as TS,qi as cE,qj as Gi,qk as gA,ql as ks,qm as ga,qn as gc,r as jb,ra as uC,rc as DC,rf as nw,rg as wi,rh as wS,ri as dE,rj as DE,rk as yA,rl as Ms,rm as ya,rn as yc,sa as Ho,sc as $C,sd as bT,se as UT,sf as iw,sg as Si,sh as SS,si as lE,sj as $E,sk as bA,sl as xs,sm as ba,sn as bc,ta as Ko,td as CT,te as BT,tf as sw,tg as Ei,th as ES,ti as uE,tj as FE,tk as CA,tl as Ns,tm as Ca,tn as Cc,ua as Wo,ub as CC,uc as FC,ud as TT,ue as qT,uf as aw,ug as Ai,uh as AS,uj as jE,uk as Ki,ul as Ls,um as Ta,un as Tc,vb as TC,vc as jC,vd as wT,ve as kn,vf as cw,vg as vi,vh as vS,vi as Di,vk as Wi,vl as Ds,vm as wa,vn as wc,wb as wC,we as Mn,wf as dw,wg as Oi,wh as OS,wi as $i,wj as GE,wk as Xi,wl as $s,wm as Sa,wn as Sc,xc as GC,xd as ST,xe as xn,xf as lw,xg as Ri,xh as RS,xi as Fi,xj as UE,xk as Yi,xl as Fs,xm as Ea,xn as Ec,y as Gb,ya as Xo,yc as cn,yd as ET,ye as Nn,yf as uw,yg as Ii,yj as BE,yk as Ji,yl as js,ym as Aa,ze as Ln,zf as pw,zg as Pi,zh as IS,zi as pE,zj as qE,zk as Zi,zl as Gs,zm as va,zn as Ve}from"./chunks/chunk-J6ERHBV2.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="08485124-a2f1-5bb5-9316-533a3f7888bc")}catch{}})();var H="2026-07-28",EM=["2025-11-25","2025-06-18"],Ze=[H],m={headerMismatch:-32020,missingRequiredClientCapability:-32021,unsupportedProtocolVersion:-32022,invalidParams:-32602},A={clientCapabilities:"io.modelcontextprotocol/clientCapabilities",clientInfo:"io.modelcontextprotocol/clientInfo",logLevel:"io.modelcontextprotocol/logLevel",protocolVersion:"io.modelcontextprotocol/protocolVersion",serverInfo:"io.modelcontextprotocol/serverInfo"},cr=["debug","info","notice","warning","error","critical","alert","emergency"],p=class extends Error{code;data;constructor(t,r,o={}){super(t),this.name="PmMcpProtocolError",this.code=r,this.data=o}};function _(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Ph(e){if(e===void 0)return;if(!_(e))throw new p("Invalid MCP clientInfo metadata",m.invalidParams,{field:A.clientInfo,expected:"object"});let t=typeof e.name=="string"?e.name.trim():"",r=typeof e.version=="string"?e.version.trim():"";if(t.length===0||r.length===0)throw new p("Invalid MCP clientInfo metadata",m.invalidParams,{field:A.clientInfo,required:["name","version"]});let o={name:t.slice(0,128),version:r.slice(0,128)};return typeof e.description=="string"&&e.description.trim()&&(o.description=e.description.trim().slice(0,1024)),typeof e.websiteUrl=="string"&&e.websiteUrl.trim()&&(o.websiteUrl=e.websiteUrl.trim().slice(0,2048)),o}function kh(e){if(e!==void 0){if(typeof e!="string"||!cr.includes(e))throw new p("Invalid MCP logLevel metadata",m.invalidParams,{field:A.logLevel,allowed:[...cr]});return e}}function Qe(e){let t=_(e)?e._meta:void 0;if(!_(t))throw new p("Missing required MCP request metadata",m.invalidParams,{required:[A.protocolVersion,A.clientCapabilities]});let r=t[A.protocolVersion];if(typeof r!="string"||!Ze.includes(r))throw new p("Unsupported protocol version",m.unsupportedProtocolVersion,{supported:[...Ze],requested:typeof r=="string"?r:null});let o=t[A.clientCapabilities];if(!_(o))throw new p("Invalid MCP client capabilities metadata",m.invalidParams,{field:A.clientCapabilities,expected:"object"});let n=Ph(t[A.clientInfo]),i=kh(t[A.logLevel]);return{protocolVersion:H,clientCapabilities:o,...n?{clientInfo:n}:{},...i?{logLevel:i}:{}}}function AM(e,t){if(t!==e.protocolVersion)throw new p("MCP protocol header does not match request metadata",m.headerMismatch,{header:t??null,metadata:e.protocolVersion})}function vM(e,t){let r=t.filter(o=>!Object.prototype.hasOwnProperty.call(e.clientCapabilities,o));if(r.length>0)throw new p("Missing required client capability",m.missingRequiredClientCapability,{requiredCapabilities:Object.fromEntries(r.map(o=>[o,{}]))})}function OM(e,t){let r=e.clientCapabilities.extensions;return _(r)&&_(r[t])}function et(e,t){let r=_(e._meta)?e._meta:{};return{...e,_meta:{...r,[A.serverInfo]:{...t}}}}function Mh(e,t){return et({...e,resultType:"complete"},t)}function RM(e){let t=e.ttlMs??6e4;if(!Number.isFinite(t)||t<0)throw new p("Invalid MCP discovery cache TTL",m.invalidParams,{ttlMs:t});return Mh({supportedVersions:[...Ze],capabilities:structuredClone(e.capabilities),ttlMs:t,cacheScope:"public",...e.instructions?{instructions:e.instructions}:{}},e.serverInfo)}function IM(e,t){if(_(e)&&typeof e.resultType=="string")return e.resultType;if(t==="legacy")return"complete";throw new p("Modern MCP result is missing resultType",m.invalidParams,{required:"resultType"})}import{createHash as ur,createHmac as pr,timingSafeEqual as xh}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="6505e714-d1f3-5794-88c8-51c1644acec9")}catch{}})();var Nh=["elicitation/create","roots/list","sampling/createMessage"],dr=class extends Error{inputRequests;requestState;constructor(t){super("MCP operation requires additional input"),this.name="PmMcpInputRequiredError",this.inputRequests=t.inputRequests,this.requestState=t.requestState}},mr=/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/u,he=32,rt=64*1024,ge=16*1024,tt={maxBytes:256*1024,maxDepth:32,maxNodes:4096};function Lh(e){return e==="elicitation/create"?"elicitation":e==="sampling/createMessage"?"sampling":"roots"}function ye(e,t,r){let o;try{o=JSON.stringify(e)}catch{throw new p(`Invalid ${r}: value is not JSON serializable`,m.invalidParams,{field:r})}if(Buffer.byteLength(o,"utf8")>t)throw new p(`Invalid ${r}: payload exceeds the protocol bound`,m.invalidParams,{field:r,maximumBytes:t})}function ot(e,t){if(!_(e))throw new p("Invalid MCP inputRequests",m.invalidParams,{field:"inputRequests",expected:"object"});let r=Object.entries(e);if(r.length===0||r.length>he)throw new p("Invalid MCP inputRequests count",m.invalidParams,{minimum:1,maximum:he,observed:r.length});let o={};for(let[n,i]of r){if(!mr.test(n)||!_(i))throw new p("Invalid MCP input request entry",m.invalidParams,{field:`inputRequests.${n}`});let s=i.method;if(typeof s!="string"||!Nh.includes(s))throw new p("Unsupported MCP input request method",m.invalidParams,{field:`inputRequests.${n}.method`,method:s??null});let a=Lh(s);if(!Object.prototype.hasOwnProperty.call(t.clientCapabilities,a))throw new p("Missing required client capability",m.missingRequiredClientCapability,{requiredCapabilities:{[a]:{}}});if(!_(i.params))throw new p("Invalid MCP input request parameters",m.invalidParams,{field:`inputRequests.${n}.params`,expected:"object"});o[n]={method:s,params:structuredClone(i.params)}}return ye(o,rt,"inputRequests"),o}function fr(e){if(!_(e))throw new p("Invalid MCP inputResponses",m.invalidParams,{field:"inputResponses",expected:"object"});let t=Object.entries(e);if(t.length>he)throw new p("Invalid MCP inputResponses count",m.invalidParams,{maximum:he,observed:t.length});let r={};for(let[o,n]of t){if(!mr.test(o)||!_(n))throw new p("Invalid MCP input response entry",m.invalidParams,{field:`inputResponses.${o}`});r[o]=structuredClone(n)}return ye(r,rt,"inputResponses"),r}function xM(e){let t=e.requestState?.trim();if(t&&Buffer.byteLength(t,"utf8")>ge)throw new p("Invalid MCP requestState: payload exceeds the protocol bound",m.invalidParams,{field:"requestState",maximumBytes:ge});let r=e.inputRequests===void 0?void 0:ot(e.inputRequests,e.requestContext);if(r===void 0&&!t)throw new p("InputRequiredResult requires inputRequests or requestState",m.invalidParams,{requiredAnyOf:["inputRequests","requestState"]});return{resultType:"input_required",...r?{inputRequests:r}:{},...t?{requestState:t}:{},_meta:{[A.serverInfo]:{...e.serverInfo}}}}function _r(e){let t=Buffer.from(e);if(t.byteLength<32)throw new p("MCP requestState signing key must contain at least 32 bytes",m.invalidParams,{minimumBytes:32});return t}function NM(e,t){if(!Number.isSafeInteger(e.expiresAt)||e.expiresAt<=0||e.method.trim().length===0||e.parameterDigest.trim().length===0||e.principal.trim().length===0)throw new p("Invalid MCP requestState payload",m.invalidParams);let r=Buffer.from(JSON.stringify({version:1,...e}),"utf8");if(r.byteLength>ge/2)throw new p("MCP requestState payload exceeds the protocol bound",m.invalidParams,{maximumBytes:ge/2});let o=r.toString("base64url"),n=pr("sha256",_r(t)).update(o).digest("base64url");return`${o}.${n}`}function Dh(e){if(!_(e)||e.version!==1)throw new p("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});let{expiresAt:t,method:r,parameterDigest:o,principal:n,state:i}=e;if(typeof t!="number"||!Number.isSafeInteger(t))throw new p("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});if(typeof r!="string"||typeof o!="string"||typeof n!="string")throw new p("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});return{expiresAt:t,method:r,parameterDigest:o,principal:n,state:i}}function LM(e,t,r){let[o,n,i]=e.split(".");if(!o||!n||i!==void 0)throw new p("Invalid MCP requestState encoding",m.invalidParams,{field:"requestState"});let s=Buffer.from(n,"base64url"),a=pr("sha256",_r(t)).update(o).digest();if(s.byteLength!==a.byteLength||!xh(s,a))throw new p("Invalid MCP requestState signature",m.invalidParams,{field:"requestState"});let c;try{c=JSON.parse(Buffer.from(o,"base64url").toString("utf8"))}catch{c=null}let d=Dh(c),{expiresAt:l,method:u,parameterDigest:f,principal:g}=d;if(l<(r.nowMs??Date.now()))throw new p("Expired MCP requestState",m.invalidParams,{field:"requestState",expiredAt:l});if(u!==r.method||f!==r.parameterDigest||g!==r.principal)throw new p("MCP requestState binding mismatch",m.invalidParams,{field:"requestState"});return d}function DM(e){return ye(e,rt,"request parameters"),ur("sha256").update(JSON.stringify(e)).digest("hex")}var lr=class{#e=new Set;#t;constructor(t=4096){if(!Number.isSafeInteger(t)||t<1)throw new p("Invalid MCP replay guard capacity",m.invalidParams,{maximumEntries:t});this.#t=t}consume(t){let r=ur("sha256").update(t).digest("hex");if(this.#e.has(r))throw new p("MCP requestState replay detected",m.invalidParams,{field:"requestState"});if(this.#e.size>=this.#t){let o=this.#e.values().next().value;this.#e.delete(o)}this.#e.add(r)}};function $h(e){if(!Number.isSafeInteger(e.ttlMs)||e.ttlMs<0||e.cacheScope!=="public"&&e.cacheScope!=="private")throw new p("Invalid MCP cache policy",m.invalidParams,{ttlMs:e.ttlMs,cacheScope:e.cacheScope});return{ttlMs:e.ttlMs,cacheScope:e.cacheScope}}function $M(e,t){return{...e,...$h(t)}}function Fh(e){return e.replaceAll("~1","/").replaceAll("~0","~")}function jh(e,t){if(t==="#")return e;if(!t.startsWith("#/"))return;let r=e;for(let o of t.slice(2).split("/").map(Fh)){if(!_(r)&&!Array.isArray(r)||!Object.prototype.hasOwnProperty.call(r,o))return;r=r[o]}return r}function Gh(e){let t=e.maxBytes??tt.maxBytes,r=e.maxDepth??tt.maxDepth,o=e.maxNodes??tt.maxNodes;if(!Number.isSafeInteger(t)||t<2)throw new p("Invalid MCP JSON Schema work bounds",m.invalidParams);if(!Number.isSafeInteger(r)||r<1)throw new p("Invalid MCP JSON Schema work bounds",m.invalidParams);if(!Number.isSafeInteger(o)||o<1)throw new p("Invalid MCP JSON Schema work bounds",m.invalidParams);return{maximumBytes:t,maximumDepth:r,maximumNodes:o}}function Uh(e,t){let r=Array.isArray(e.value)?e.value:_(e.value)?Object.values(e.value):[];for(let o of r)t.push({value:o,depth:e.depth+1})}function Bh(e,t){if(!_(t)||typeof t.$ref!="string")return;let r=t.$ref;if(r.startsWith("#")&&jh(e,r)===void 0)throw new p("MCP JSON Schema contains an unresolved local reference",m.invalidParams,{reference:r})}function FM(e,t={}){let{maximumBytes:r,maximumDepth:o,maximumNodes:n}=Gh(t);if(typeof e!="boolean"&&!_(e))throw new p("Invalid MCP JSON Schema root",m.invalidParams,{expected:"object or boolean"});ye(e,r,"JSON Schema");let i=[{value:e,depth:0}],s=0;for(;i.length>0;){let a=i.pop();if(s+=1,s>n||a.depth>o)throw new p("MCP JSON Schema exceeds validation work bounds",m.invalidParams,{maximumDepth:o,maximumNodes:n});Bh(e,a.value),Uh(a,i)}return structuredClone(e)}import{randomUUID as qh}from"node:crypto";import{readFile as zh}from"node:fs/promises";import hr from"node:path";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="7f5b3ba6-07cf-5317-8f62-63e84f561232")}catch{}})();var HM="io.modelcontextprotocol/tasks",Vh=["working","input_required","completed","failed","cancelled"],Hh=/^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,Kh=3600*1e3,Wh=1e3,Ce=1024,Xh=30,Yh=2e3;function nt(e){return new p(e,m.invalidParams,{code:"mcp_task_not_found_or_not_authorized"})}function be(e){let t=e.trim();if(!Hh.test(t))throw nt("Unknown MCP task");return t}function gr(e,t){if(typeof e!="string"||!Number.isFinite(Date.parse(e)))throw new p("Corrupt MCP task record",m.invalidParams,{field:t});return e}function yr(e){if(!_(e)||typeof e.code!="number"||!Number.isFinite(e.code)||typeof e.message!="string")throw new p("Corrupt MCP task error",m.invalidParams);return{code:e.code,message:e.message.slice(0,Ce),..._(e.data)?{data:structuredClone(e.data)}:{}}}function Jh(e){if(!Vh.includes(e))throw new p("Corrupt MCP task record",m.invalidParams);return e}function Zh(e){if(typeof e!="string"||e.length===0)throw new p("Corrupt MCP task record",m.invalidParams);return e}function Qh(e){if(typeof e!="number"||!Number.isSafeInteger(e)||e<1)throw new p("Corrupt MCP task record",m.invalidParams);return e}function eg(e){if(e!==null&&(typeof e!="number"||!Number.isSafeInteger(e)||e<0))throw new p("Corrupt MCP task record",m.invalidParams);return e}function tg(e){if(e!==void 0){if(typeof e!="number"||!Number.isSafeInteger(e)||e<0)throw new p("Corrupt MCP task record",m.invalidParams);return e}}function rg(e){if(!Array.isArray(e)||e.some(t=>typeof t!="string"))throw new p("Corrupt MCP task record",m.invalidParams);return[...e]}function og(e){if(!_(e)||e.version!==1)throw new p("Corrupt MCP task record",m.invalidParams);let t=typeof e.taskId=="string"?be(e.taskId):"",r=Jh(e.status),o=Zh(e.principal),n=Qh(e.workerPid),i=eg(e.ttlMs),s=tg(e.pollIntervalMs),a={version:1,taskId:t,status:r,principal:o,workerPid:n,createdAt:gr(e.createdAt,"createdAt"),lastUpdatedAt:gr(e.lastUpdatedAt,"lastUpdatedAt"),ttlMs:i,consumedInputKeys:rg(e.consumedInputKeys),...typeof e.statusMessage=="string"?{statusMessage:e.statusMessage.slice(0,Ce)}:{},...typeof s=="number"?{pollIntervalMs:s}:{}};if(_(e.inputRequests)&&(a.inputRequests=structuredClone(e.inputRequests)),_(e.inputResponses)&&(a.inputResponses=structuredClone(e.inputResponses)),_(e.result)&&(a.result=structuredClone(e.result)),e.error!==void 0&&(a.error=yr(e.error)),a.status==="input_required"&&!a.inputRequests||a.status==="completed"&&!a.result||a.status==="failed"&&!a.error)throw new p("Corrupt MCP task status payload",m.invalidParams,{status:a.status});return a}function K(e){let t={taskId:e.taskId,status:e.status,createdAt:e.createdAt,lastUpdatedAt:e.lastUpdatedAt,ttlMs:e.ttlMs,...e.statusMessage?{statusMessage:e.statusMessage}:{},...e.pollIntervalMs===void 0?{}:{pollIntervalMs:e.pollIntervalMs}};return e.status==="input_required"?{...t,status:"input_required",inputRequests:structuredClone(e.inputRequests)}:e.status==="completed"?{...t,status:"completed",result:structuredClone(e.result)}:e.status==="failed"?{...t,status:"failed",error:structuredClone(e.error)}:e.status==="cancelled"?{...t,status:"cancelled"}:{...t,status:"working"}}function oe(e){return e==="completed"||e==="failed"||e==="cancelled"}function ng(e){try{return process.kill(e,0),!0}catch(t){return!(typeof t=="object"&&t!==null&&"code"in t&&t.code==="ESRCH")}}var it=class{#e;#t;#r;#o;#i;constructor(t){this.#e=hr.resolve(t.pmRoot),this.#t=t.owner?.trim()||"pm-mcp",this.#r=t.now??(()=>new Date),this.#o=t.taskIdFactory??(()=>`mcp-task-${qh()}`),this.#i=t.workerPid??process.pid}#s(t){return hr.join(this.#e,"runtime","mcp-tasks","records",`${be(t)}.json`)}async#c(t){try{return og(JSON.parse(await zh(this.#s(t),"utf8")))}catch(r){throw me(r)||r instanceof SyntaxError?nt("Unknown MCP task"):r}}async#a(t){await $e(this.#s(t.taskId),`${JSON.stringify(t,null,2)}
|
|
2
|
-
`)}async#n(t,r,o){let n=be(t),i=await Ge(this.#e,n,Xh,this.#t,!1,!1,Yh);try{let s=await this.#c(n);if(s.principal!==r)throw nt("Unknown MCP task");let a=o(s);return await this.#a(a),a}finally{await i()}}async create(t){let r=be(this.#o()),o=t.principal.trim(),n=t.ttlMs===void 0?Kh:t.ttlMs,i=t.pollIntervalMs??Wh;if(o.length===0||n!==null&&(!Number.isSafeInteger(n)||n<0)||!Number.isSafeInteger(i)||i<0)throw new p("Invalid MCP task creation options",m.invalidParams);let s=this.#r().toISOString(),a={version:1,taskId:r,status:"working",createdAt:s,lastUpdatedAt:s,ttlMs:n,pollIntervalMs:i,principal:o,workerPid:this.#i,consumedInputKeys:[],...t.statusMessage?.trim()?{statusMessage:t.statusMessage.trim().slice(0,Ce)}:{}};return await this.#a(a),{...K(a),resultType:"task"}}async get(t,r){return K(await this.#n(t,r,o=>{if(oe(o.status))return o;let n=this.#r().getTime(),i=o.ttlMs!==null&&Date.parse(o.createdAt)+o.ttlMs<=n,s=o.workerPid!==this.#i&&!ng(o.workerPid);return!i&&!s?o:{...o,status:"failed",statusMessage:i?"Task retention expired before completion.":"Task worker ended before recording a terminal result.",lastUpdatedAt:this.#r().toISOString(),error:{code:-32603,message:i?"MCP task expired":"MCP task worker unavailable after restart",data:{recoverable:!1,createNewTask:!0}},inputRequests:void 0}}))}async requireInput(t){let r=ot(t.inputRequests,t.requestContext);return K(await this.#n(t.taskId,t.principal,o=>{if(oe(o.status))return o;let n=Object.keys(r).filter(i=>o.consumedInputKeys.includes(i));if(n.length>0)throw new p("MCP task input request keys must be unique for the task lifetime",m.invalidParams,{reused:n});return{...o,status:"input_required",statusMessage:t.statusMessage?.trim().slice(0,Ce),lastUpdatedAt:this.#r().toISOString(),inputRequests:r}}))}async update(t,r,o){let n=fr(o),i=[],s=[];return await this.#n(t,r,a=>{if(a.status!=="input_required"||!a.inputRequests)return a;let c={...a.inputRequests},d=a.inputResponses?{...a.inputResponses}:{};for(let[l,u]of Object.entries(n))Object.prototype.hasOwnProperty.call(c,l)&&(d[l]=u,delete c[l],i.push(l));return s=Object.keys(c).sort(),i.length===0?a:{...a,status:s.length===0?"working":"input_required",lastUpdatedAt:this.#r().toISOString(),inputRequests:s.length===0?void 0:c,inputResponses:d,consumedInputKeys:[...new Set([...a.consumedInputKeys,...i])].sort()}}),{acceptedKeys:i.sort(),remainingKeys:s}}async takeInputResponses(t,r){let o={};return await this.#n(t,r,n=>(o=structuredClone(n.inputResponses??{}),Object.keys(o).length===0?n:{...n,inputResponses:void 0})),o}async complete(t,r,o){return K(await this.#n(t,r,n=>oe(n.status)?n:{...n,status:"completed",statusMessage:"Task completed.",lastUpdatedAt:this.#r().toISOString(),result:structuredClone(o),inputRequests:void 0,error:void 0}))}async fail(t,r,o){let n=yr(o);return K(await this.#n(t,r,i=>oe(i.status)?i:{...i,status:"failed",statusMessage:n.message,lastUpdatedAt:this.#r().toISOString(),error:n,inputRequests:void 0,result:void 0}))}async cancel(t,r){return K(await this.#n(t,r,o=>oe(o.status)?o:{...o,status:"cancelled",statusMessage:"Task cancelled by the client.",lastUpdatedAt:this.#r().toISOString(),inputRequests:void 0,result:void 0,error:void 0}))}};function KM(e){return new it(e)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="f87864d3-e499-57f7-b1e3-4ea3f30b7725")}catch{}})();var Te="io.modelcontextprotocol/subscriptionId",br=256,Cr=2048,ig=5e3;function sg(e,t){return new Promise((r,o)=>{let n=setTimeout(()=>o(new Error("MCP subscription sink write timed out")),ig);n.unref(),Promise.resolve().then(()=>e(t)).then(()=>{clearTimeout(n),r()},i=>{clearTimeout(n),o(i instanceof Error?i:new Error(String(i)))})})}function st(e,t){if(e!==void 0){if(typeof e!="boolean")throw new p("Invalid MCP subscription filter",m.invalidParams,{field:`notifications.${t}`,expected:"boolean"});return e||void 0}}function ag(e){if(!_(e))throw new p("Invalid MCP subscription filter",m.invalidParams,{field:"notifications",expected:"object"});let t=st(e.toolsListChanged,"toolsListChanged"),r=st(e.promptsListChanged,"promptsListChanged"),o=st(e.resourcesListChanged,"resourcesListChanged"),n;if(e.resourceSubscriptions!==void 0){if(!Array.isArray(e.resourceSubscriptions)||e.resourceSubscriptions.length>br)throw new p("Invalid MCP resource subscriptions",m.invalidParams,{field:"notifications.resourceSubscriptions",maximum:br});let i=new Set;for(let s of e.resourceSubscriptions){if(typeof s!="string"||s.trim().length===0||Buffer.byteLength(s,"utf8")>Cr)throw new p("Invalid MCP resource subscription URI",m.invalidParams,{field:"notifications.resourceSubscriptions",maximumBytes:Cr});i.add(s)}i.size>0&&(n=[...i].sort())}return{...t?{toolsListChanged:t}:{},...r?{promptsListChanged:r}:{},...o?{resourcesListChanged:o}:{},...n?{resourceSubscriptions:n}:{}}}function cg(e,t){return{...e.toolsListChanged&&t.tools?.listChanged?{toolsListChanged:!0}:{},...e.promptsListChanged&&t.prompts?.listChanged?{promptsListChanged:!0}:{},...e.resourcesListChanged&&t.resources?.listChanged?{resourcesListChanged:!0}:{},...e.resourceSubscriptions&&t.resources?.subscribe?{resourceSubscriptions:[...e.resourceSubscriptions]}:{}}}var Tr=class{#e;#t=new Map;#r;constructor(t){this.#e=structuredClone(t.capabilities),this.#r={...t.serverInfo}}get size(){return this.#t.size}async open(t){if(this.#t.has(t.id))throw new p("MCP subscription id is already active",m.invalidParams,{subscriptionId:t.id});let r=cg(ag(t.notifications),this.#e),o={filter:r,sink:t.sink,writeQueue:Promise.resolve()};this.#t.set(t.id,o);try{await this.#o(t.id,o,{jsonrpc:"2.0",method:"notifications/subscriptions/acknowledged",params:{_meta:{[Te]:t.id},notifications:structuredClone(r)}},!0)}catch(n){throw this.#t.delete(t.id),n}return structuredClone(r)}async emitListChanged(t){let r=`${t}ListChanged`,o=`notifications/${t}/list_changed`,n=[];for(let[i,s]of this.#t)s.filter[r]===!0&&n.push(this.#o(i,s,{jsonrpc:"2.0",method:o,params:{_meta:{[Te]:i}}}));return(await Promise.all(n)).filter(Boolean).length}async emitResourceUpdated(t){let r=[];for(let[o,n]of this.#t)n.filter.resourceSubscriptions?.includes(t)&&r.push(this.#o(o,n,{jsonrpc:"2.0",method:"notifications/resources/updated",params:{_meta:{[Te]:o},uri:t}}));return(await Promise.all(r)).filter(Boolean).length}async#o(t,r,o,n=!1){let i=r.writeQueue.then(async()=>{if(this.#t.get(t)!==r)return!1;try{return await sg(r.sink,o),!0}catch(s){if(this.#t.get(t)===r&&this.#t.delete(t),n)throw s;return!1}});return r.writeQueue=i.then(()=>{},()=>{}),i}close(t){if(this.#t.delete(t))return{...et({resultType:"complete",_meta:{[Te]:t}},this.#r)}}closeAll(){let t=[];for(let r of this.#t.keys()){let o=this.close(r);t.push({id:r,result:o})}return t}};(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="7d591d0b-f009-519c-8024-c6fa18effb8e")}catch{}})();var wr=/^=\?base64\?([A-Za-z0-9+/]*={0,2})\?=$/u,dg=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/u,Sr=/^[\t\x20-\x7E]*$/u,Er=new Set(["prompts/get","resources/read","tools/call"]);function lg(e){let t=new Map;for(let[r,o]of Object.entries(e)){if(o===void 0)continue;let n=typeof o=="string"?o:o.join(", ");t.set(r.toLowerCase(),n)}return t}function v(e,t){throw new p(e,m.headerMismatch,{header:t})}function Ar(e){let t=typeof e=="boolean"?String(e).toLowerCase():String(e);return t.length>0&&t.trim()===t&&Sr.test(t)&&!wr.test(t)?t:`=?base64?${Buffer.from(t,"utf8").toString("base64")}?=`}function vr(e,t){let r=wr.exec(e);if(r){let o=r[1],n=Buffer.from(o,"base64");return n.toString("base64")!==o||n.length===0?v("Malformed MCP Base64 header value",t):n.toString("utf8")}return e.length===0||e.trim()!==e||!Sr.test(e)?v("Malformed MCP header value",t):e}function we(e){return Array.isArray(e)?e.some(we):_(e)?Object.prototype.hasOwnProperty.call(e,"x-mcp-header")||Object.values(e).some(we):!1}function ug(e,t,r){let o=e["x-mcp-header"];if(o===void 0)return;let n=e.type;if(typeof o!="string"||!dg.test(o)||!["boolean","integer","string"].includes(String(n))||r.has(o.toLowerCase()))throw new p("Invalid MCP x-mcp-header annotation",m.invalidParams,{field:t.join("."),annotation:o});return r.add(o.toLowerCase()),{name:o,path:t,type:n}}function Or(e){if(!_(e))throw new p("Invalid MCP tool schema",m.invalidParams,{field:"inputSchema",expected:"object"});let t=[],r=new Set,o=(n,i)=>{let s=n.properties;if(s!==void 0){if(!_(s))throw new p("Invalid MCP tool schema properties",m.invalidParams,{field:"inputSchema.properties"});for(let[a,c]of Object.entries(s)){if(!_(c))continue;let d=[...i,a],l=ug(c,d,r);l&&t.push(l);for(let[u,f]of Object.entries(c))if(u!=="properties"&&u!=="x-mcp-header"&&we(f))throw new p("MCP x-mcp-header is not statically reachable",m.invalidParams,{field:d.join("."),keyword:u});o(c,d)}}};for(let[n,i]of Object.entries(e))if(n!=="properties"&&we(i))throw new p("MCP x-mcp-header is not statically reachable",m.invalidParams,{field:"inputSchema",keyword:n});return o(e,[]),t}function Rr(e,t){let r=e;for(let o of t){if(!_(r))return;r=r[o]}return r}function Ir(e,t){let r=e==="resources/read"?t.uri:t.name;return typeof r=="string"?r:void 0}function pg(e,t){let r=_(e.arguments)?e.arguments:{},o={};for(let n of Or(t)){let i=Rr(r,n.path);if(i==null)continue;if(!(n.type==="integer"&&typeof i=="number"&&Number.isSafeInteger(i)||n.type==="boolean"&&typeof i=="boolean"||n.type==="string"&&typeof i=="string"))throw new p("Invalid MCP custom header argument",m.invalidParams,{field:n.path.join("."),expected:n.type});o[`Mcp-Param-${n.name}`]=Ar(i)}return o}function ZM(e){let t=_(e.request.params)?e.request.params:void 0,r=Qe(t),o=e.request.method;if(typeof o!="string"||o.length===0)return v("Missing MCP request method","Mcp-Method");let n={Accept:"application/json, text/event-stream","Content-Type":"application/json","MCP-Protocol-Version":r.protocolVersion,"Mcp-Method":o},i=Ir(o,t);if(Er.has(o)){if(i===void 0)return v("Missing MCP request name","Mcp-Name");n["Mcp-Name"]=Ar(i)}return o==="tools/call"&&e.toolSchema!==void 0&&Object.assign(n,pg(t,e.toolSchema)),n}function mg(e,t){let r=t.method;(typeof r!="string"||r.length===0)&&v("Missing MCP request method","Mcp-Method");let o=_(t.params)?t.params:void 0,n=Qe(o).protocolVersion;if(e.get("mcp-protocol-version")!==n&&v("MCP protocol header does not match request metadata","MCP-Protocol-Version"),e.get("mcp-method")!==r&&v("MCP method header does not match request body","Mcp-Method"),Er.has(r)){let i=e.get("mcp-name"),s=Ir(r,o);(i===void 0||s===void 0||vr(i,"Mcp-Name")!==s)&&v("MCP name header does not match request body","Mcp-Name")}e.has("last-event-id")&&v("MCP SSE resumability is not supported","Last-Event-ID")}function fg(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 _g(e){let t=_(e.params.arguments)?e.params.arguments:{};for(let r of Or(e.toolSchema)){let o=Rr(t,r.path),n=`Mcp-Param-${r.name}`,i=e.headers.get(n.toLowerCase());if(o==null){i!==void 0&&v("Unexpected MCP parameter header",n);continue}i===void 0&&v("Missing MCP parameter header",n),fg(r,o,vr(i,n))||v("MCP parameter header does not match request body",n)}}function QM(e){let t=lg(e.headers),r=typeof e.request.method=="string"?e.request.method:"";mg(t,e.request),!(r!=="tools/call"||e.toolSchema===void 0)&&_g({headers:t,params:e.request.params,toolSchema:e.toolSchema})}var e0=H;import{AsyncLocalStorage as hg}from"node:async_hooks";import{createHash as Pr,timingSafeEqual as gg}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="6a5310f6-3add-5108-b39f-61607918dc9f")}catch{}})();var y=class extends Error{httpStatus;challenge;constructor(t,r,o){super(t),this.name="PmMcpAuthorizationError",this.httpStatus=r,this.challenge=o}},yg=/^00-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})$/u,bg=/^[a-z][a-z0-9_*/-]{0,255}$/u,Cg=/^(?:[a-z0-9][a-z0-9_*/-]{0,240})@[a-z][a-z0-9_*/-]{0,13}$/u,Tg=/^[\x20-\x2B\x2D-\x3C\x3E-\x7E]{0,255}[\x21-\x2B\x2D-\x3C\x3E-\x7E]$/u,Mr=/^[\x21\x23-\x5B\x5D-\x7E]+$/u,xr=/^[A-Za-z0-9!#$%&'*+.^_`|~-]+$/u,wg=/^[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]*$/u,Sg=/%(?![0-9A-Fa-f]{2})/u,Eg=512,Ag=32,vg=180,Og=8192,Rg=8192,Nr=new hg;function E(e,t,r=!1){if(new RegExp("\\p{Cc}","u").test(e))throw new y(`Invalid ${t}`,401);let o;try{o=new URL(e)}catch{throw new y(`Invalid ${t}`,401)}let n=o.hostname==="127.0.0.1"||o.hostname==="localhost";if(o.hash.length>0||o.protocol!=="https:"&&!(r&&n&&o.protocol==="http:"))throw new y(`Invalid ${t}`,401);return o}function Ig(e,t){let r=t.toLowerCase();for(let[o,n]of Object.entries(e))if(!(o.toLowerCase()!==r||n===void 0))return typeof n=="string"?n:n.join(", ")}function i0(e){let t=E(e.resource,"protected resource URI",!0).href.replace(/\/$/u,"");if(e.authorizationServers.length===0)throw new y("Protected resource metadata requires an authorization server",401);let r=e.authorizationServers.map(n=>E(n,"authorization server issuer").href.replace(/\/$/u,"")),o=[...new Set(e.scopes??[])];if(o.some(n=>!Mr.test(n)))throw new y("Invalid authorization scope",401);return{resource:t,authorization_servers:r,...o.length>0?{scopes_supported:o.sort()}:{}}}function s0(e){let t=E(e,"authorization server issuer"),r=t.pathname.replace(/^\/+|\/+$/gu,""),o=t.origin;return r?[`${o}/.well-known/oauth-authorization-server/${r}`,`${o}/.well-known/openid-configuration/${r}`,`${o}/${r}/.well-known/openid-configuration`]:[`${o}/.well-known/oauth-authorization-server`,`${o}/.well-known/openid-configuration`]}function a0(e,t){if(!_(e)||typeof e.issuer!="string")throw new y("Invalid authorization server metadata",401);let r=E(t,"expected issuer").href.replace(/\/$/u,"");if(E(e.issuer,"metadata issuer").href.replace(/\/$/u,"")!==r)throw new y("Authorization server issuer mismatch",401);if(!Array.isArray(e.code_challenge_methods_supported)||!e.code_challenge_methods_supported.includes("S256"))throw new y("Authorization server does not support required S256 PKCE",401);let n=d=>{let l=e[d];if(typeof l!="string")throw new y(`Authorization server metadata requires ${d}`,401);return E(l,d).href},i=d=>{let l=e[d];return typeof l=="string"?E(l,d).href:void 0},s=n("authorization_endpoint"),a=n("token_endpoint"),c=i("registration_endpoint");return{issuer:r,authorization_endpoint:s,token_endpoint:a,code_challenge_methods_supported:[...new Set(e.code_challenge_methods_supported.filter(d=>typeof d=="string"))],...e.client_id_metadata_document_supported===!0?{client_id_metadata_document_supported:!0}:{},...c?{registration_endpoint:c}:{}}}function c0(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 d0(e){if(e.responseIssuer===void 0){if(e.issuerParameterSupported)throw new y("Authorization response omitted the advertised issuer",401);return}if(e.responseIssuer!==e.expectedIssuer)throw new y("Authorization response issuer mismatch",401)}function l0(e,t){let r=E(t,"client metadata document URL");if(r.pathname==="/"||!_(e)||e.client_id!==r.href||typeof e.client_name!="string"||e.client_name.trim().length===0||!Array.isArray(e.redirect_uris)||e.redirect_uris.length===0)throw new y("Invalid Client ID Metadata Document",401);for(let o of e.redirect_uris){if(typeof o!="string")throw new y("Invalid client redirect URI",401);E(o,"client redirect URI",!0)}return structuredClone(e)}function u0(e){if(e.redirectUris.length===0||e.clientName.trim().length===0)throw new y("Invalid dynamic client registration metadata",401);let t=e.redirectUris.map(r=>E(r,"redirect URI",!0).href);return{application_type:e.applicationType,client_name:e.clientName.trim().slice(0,128),redirect_uris:t,grant_types:["authorization_code","refresh_token"],response_types:["code"],token_endpoint_auth_method:"none"}}var kr=class{#e=new Map;set(t,r){let o=E(t,"credential issuer").href;this.#e.set(o,structuredClone(r))}get(t){let r=E(t,"credential issuer").href,o=this.#e.get(r);return o?structuredClone(o):void 0}delete(t){let r=E(t,"credential issuer").href;return this.#e.delete(r)}};function Pg(e){let t=e.traceparent,r=e.tracestate;if(t!==void 0){let o=typeof t=="string"?yg.exec(t):null;if(!o)throw new y("Invalid MCP traceparent",403);let n=o[1],i=o[2];if(/^0+$/u.test(n)||/^0+$/u.test(i))throw new y("Invalid MCP traceparent",403)}if(r!==void 0&&(typeof r!="string"||!Mg(r)))throw new y("Invalid MCP tracestate",403);return{...typeof t=="string"?{traceparent:t}:{},...typeof r=="string"?{tracestate:r}:{}}}function $(e){return e.replace(/^[ \t]*|[ \t]*$/gu,"")}function kg(e){return bg.test(e)||Cg.test(e)}function Mg(e){if(Buffer.byteLength(e,"utf8")>Eg)return!1;let t=e.split(",");if(t.length>Ag)return!1;let r=new Set;for(let o of t){let n=$(o);if(n.length===0)continue;let i=n.indexOf("="),s=i>0?n.slice(0,i):"",a=i>0?n.slice(i+1):"";if(!kg(s)||!Tg.test(a)||r.has(s))return!1;r.add(s)}return!0}function Lr(e){return wg.test(e)&&!Sg.test(e)}function xg(e){let t=$(e),r=t.indexOf("="),o=$(r>=0?t.slice(0,r):t),n=r>=0?$(t.slice(r+1)):void 0;return xr.test(o)&&(n===void 0||Lr(n))}function Ng(e){let t=$(e),r=t.split(";"),o=r[0],n=r.slice(1),i=o.indexOf("="),s=$(i>0?o.slice(0,i):""),a=i>0?$(o.slice(i+1)):"";if(!(!xr.test(s)||!Lr(a)||!n.every(xg)))return{key:s,serialized:t}}function Lg(e,t){if(e===void 0)return;if(typeof e!="string"||Buffer.byteLength(e,"utf8")>Og)throw new y("Invalid MCP baggage",403);let r=new Set(t),o=e.split(",");if(o.length>vg)throw new y("Invalid MCP baggage",403);let n=[];for(let i of o){let s=Ng(i);if(!s)throw new y("Invalid MCP baggage",403);r.has(s.key)&&n.push(s.serialized)}return n.length>0?n.join(","):void 0}function p0(e,t={}){let r=_(e)&&_(e._meta)?e._meta:{},o=Lg(r.baggage,t.baggageAllowlist??[]);return{...Pg(r),...o?{baggage:o}:{}}}function m0(e,t){return Nr.run(structuredClone(e),t)}function f0(){let e=Nr.getStore();return e?{...e}:void 0}async function _0(e){let t=E(e.policy.resourceMetadataUrl,"protected resource metadata URL",!0).href,r=[...new Set(e.policy.requiredScopes??[])];if(r.some(u=>!Mr.test(u)))throw new y("Invalid authorization scope",401);let o=`Bearer resource_metadata="${t}"`;if(new URL(e.requestUrl,e.policy.resource).searchParams.has("access_token"))throw new y("Access tokens must not appear in URI query parameters",401,o);let s=Ig(e.headers,"authorization")?.match(/^Bearer ([^\s]+)$/iu);if(!s)throw new y("Missing or malformed bearer token",401,o);let a=s[1];if(Buffer.byteLength(a,"utf8")>Rg)throw new y("Missing or malformed bearer token",401,o);let c;try{c=await e.policy.verifyAccessToken(a)}catch{throw new y("Invalid bearer token",401,o)}let d=Array.isArray(c.audience)?c.audience:[c.audience];if(c.issuer!==e.policy.issuer||!d.includes(e.policy.resource))throw new y("Bearer token issuer or audience mismatch",401,o);let l=r.filter(u=>!c.scopes.includes(u));if(l.length>0)throw new y("Bearer token has insufficient scope",403,`${o}, scope="${l.join(" ")}"`);return{...c,audience:[...d],scopes:[...c.scopes]}}function h0(e){let t=Pr("sha256").update(e.token).digest();return r=>{let o=Pr("sha256").update(r).digest();if(!gg(t,o))throw new y("Invalid bearer token",401);return structuredClone(e.claims)}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="4f17095e-2dba-530c-935c-1803ed359510")}catch{}})();var at="io.modelcontextprotocol/ui",Se="2026-01-26",Fr="text/html;profile=mcp-app",Dr=Object.freeze({specVersion:Se,mimeTypes:[Fr]});function b0(e){let t=e.clientCapabilities.extensions;if(!_(t))return!1;let r=t[at];if(r===void 0)return!1;if(!_(r))throw new p("Invalid MCP Apps client capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[at]:Dr}}});let o=r.mimeTypes,n=r.specVersion;if(!Array.isArray(o)||!o.includes(Fr)||n!==void 0&&n!==Se)throw new p("Unsupported MCP Apps client capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[at]:Dr}}});return!0}var Dg={csp:{connectDomains:[],resourceDomains:[],frameDomains:[]},permissions:{},prefersBorder:!0},jr=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:Dg})));function C0(e){return jr.find(t=>t.uri===e)}function T0(e){let t=new Map(jr.map(r=>[r.toolName,r]));return e.map(r=>{let o=t.get(r.name);return o?{...r,_meta:{...r._meta,ui:o.toolMeta}}:{...r}})}function $r(e){return e.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function w0(e){let t=$r(e.name),r=$r(e.description),o=JSON.stringify({name:`pm-${e.id}-view`,version:Se}),n=JSON.stringify(Se);return`<!doctype html>
|
|
1
|
+
import{A as $h,B as Fh,C as TM,D as SM,a as ms,b as fs,c as _s,d as hs,e as uM,f as pM,g as vh,h as Oh,i as Ih,k as Rh,l as Ph,m as Mh,n as kh,o as xh,p as Nh,q as Lh,r as Dh,s as mM,t as fM,u as _M,v as hM,w as gM,x as yM,y as bM,z as CM}from"./chunks/chunk-GLQMKUGP.js";import{A as ck,B as dk,C as lk,D as uk,E as pk,F as mk,G as fk,H as _k,I as hk,J as gk,K as yk,L as bk,M as Ck,N as Tk,O as Sk,P as wk,Q as Ek,R as Ak,S as vk,T as Ok,U as Ik,V as Rk,W as Pk,X as Mk,Y as kk,a as DM,b as $M,c as FM,d as jM,e as GM,f as UM,g as BM,h as qM,i as zM,j as VM,k as HM,l as KM,m as WM,n as XM,o as YM,p as JM,q as ZM,r as QM,s as ek,t as tk,u as rk,v as ok,w as nk,x as ik,y as sk,z as ak}from"./chunks/chunk-P6BEYAON.js";import{a as wM,b as EM,c as AM,d as vM}from"./chunks/chunk-PYUITRSV.js";import{a as OM,b as IM,c as RM,d as PM,e as MM,f as kM,g as xM,h as NM,i as LM}from"./chunks/chunk-EOCKPCEY.js";import{$ as nr,$a as r_,$b as rh,A as Uv,Aa as Ef,Ab as R_,B as Bv,Ba as Af,Bb as P_,C as pu,Ca as vf,Cb as M_,D as Mp,Da as Of,Db as k_,E as kp,Ea as If,Eb as x_,F as xp,Fa as Rf,Fb as N_,G as Np,Ga as Pf,Gb as L_,H as Lp,Ha as Mf,Hb as D_,I as Ye,Ia as kf,Ib as $_,J as Dp,Ja as xf,Jb as F_,K as $p,Ka as Nf,Kb as j_,L as Fp,La as Lf,Lb as G_,M as jp,Ma as Df,Mb as U_,N as Gp,Na as $f,Nb as B_,O as Up,Oa as Ff,Ob as q_,P as DP,Pa as jf,Pb as z_,Q as $P,Qa as Gf,Qb as V_,R as FP,Ra as dr,Rb as H_,S as Xt,Sa as he,Sb as K_,T as Yt,Ta as Wf,Tb as W_,U as Jt,Ua as Xf,Ub as X_,V as Zt,Va as Yf,Vb as Y_,W as Qt,Wa as Jf,Wb as J_,X as er,Xa as Zf,Xb as Z_,Y as tr,Ya as Qf,Yb as Q_,Z as rr,Za as e_,Zb as eh,_ as or,_a as t_,_b as th,a as qc,aa as ir,ab as o_,ac as oh,b as zc,ba as gm,bb as n_,bc as nh,c as Vc,ca as ym,cb as i_,cc as ih,d as _v,da as bm,db as s_,dc as sh,e as hv,ea as Cm,eb as a_,ec as ah,f as Hc,fa as Tm,fb as c_,fc as ch,g as wv,ga as Je,gb as d_,gc as dh,h as Ev,ha as Sm,hb as l_,hc as lh,i as Av,ia as wm,ib as u_,ic as uh,j as vv,ja as Em,jb as p_,jc as ph,k as Ov,ka as Am,kb as m_,kc as mh,l as Iv,la as vm,lb as f_,lc as fh,m as Rv,ma as Om,mb as __,mc as _h,n as Pv,na as Im,nb as h_,nc as hh,o as Mv,oa as Rm,ob as g_,oc as gh,p as kv,pa as ZP,pb as y_,pc as yh,q as xv,qa as ff,qb as b_,qc as bh,r as Nv,ra as _f,rb as C_,rc as Ch,s as Lv,sa as hf,sb as T_,sc as Th,t as Dv,ta as gf,tb as S_,tc as Sh,u as Jc,ua as yf,ub as w_,uc as wh,v as Zc,va as bf,vb as E_,vc as Eh,w as $v,wa as Cf,wb as A_,wc as Ah,x as Fv,xa as Tf,xb as v_,y as jv,ya as Sf,yb as O_,z as Gv,za as wf,zb as I_}from"./chunks/chunk-4SFBH77G.js";import{a as Wt,f as CP,g as TP,h as zp,i as Vp}from"./chunks/chunk-NKOYVKFM.js";import{A as kP,B as xP,C as NP,D as LP,E as rm,F as om,G as nm,H as KP,I as Pm,J as WP,K as XP,L as YP,M as JP,b as uu,c as _R,d as Pp,e as pP,f as mP,g as fP,h as _P,i as hP,j as gP,k as Bp,l as yP,m as Zp,n as Qp,o as em,p as tm,q as SP,r as wP,s as EP,t as AP,u as vP,v as OP,w as IP,x as RP,y as PP,z as MP}from"./chunks/chunk-7WIHZI2M.js";import{$a as au,$b as wp,$c as $m,A as AO,Aa as Nl,Ab as eP,Ac as dm,Ad as Zm,B as vO,Ba as Ll,Bb as tP,Bc as lm,Bd as Qm,C as OO,Ca as Dl,Cb as rP,Cc as um,Cd as ef,D as IO,Da as $l,Db as tp,Dc as pm,Dd as tf,E as FO,Ea as Fl,Eb as rp,Ec as mm,Ed as rf,Fa as jl,Fc as fm,Fd as lM,Ga as Gl,Gb as op,Gc as _m,Gd as of,Ha as Ul,Hb as np,Hc as hm,Hd as nf,Ia as Bl,Ib as oP,Ic as zP,Id as sf,J as Xd,Ja as ql,Jb as ip,Jc as VP,Jd as af,Ka as zl,Kb as sp,Kc as HP,Kd as cf,La as Vl,Lb as ap,Lc as QP,Ld as df,Ma as Hl,Mb as cp,Mc as sr,Md as lf,Na as Kl,Nb as dp,Nc as eM,Nd as uf,Oa as Wl,Ob as lp,Oc as Ze,Od as pf,Pa as Xl,Pb as up,Pc as re,Pd as mf,Qa as Yl,Qb as pp,Qc as Mm,Qd as Uf,Ra as Jl,Rb as mp,Rd as Bf,Sa as Zl,Sb as fp,Sd as qf,Ta as Ql,Tb as _p,Tc as Qe,Td as zf,Ua as eu,Ub as hp,Uc as km,Ud as Vf,Va as tu,Vb as gp,Vc as xm,Vd as Hf,Wa as ru,Wb as yp,Wd as Kf,Xa as ou,Xb as bp,Xc as _e,Ya as nu,Yb as Cp,Yc as Nm,Za as iu,Zb as Tp,Zc as Lm,_a as su,_b as Sp,_c as Dm,a as Qv,aa as jO,ab as cu,ac as nP,ad as tM,b as eO,ba as GO,bb as du,bc as iP,bd as rM,c as tO,ca as Yd,cb as cR,cc as Ep,cd as oM,d as rO,da as Jd,db as dR,dd as nM,e as oO,ea as Zd,eb as lR,ed as iM,f as nO,fa as Qd,fb as uR,fd as ar,g as iO,ga as el,gb as pR,gc as Ap,gd as sM,h as sO,ha as tl,hb as mR,hd as aM,i as aO,ia as rl,ib as fR,ic as vp,id as cr,j as cO,ja as CI,jb as mu,jc as Op,jd as cM,k as dO,ka as TI,kb as fu,kc as Ip,kd as dM,l as lO,la as SI,lb as _u,lc as Rp,m as uO,ma as wI,mb as hu,mc as sP,md as Fm,n as pO,na as EI,nb as gu,nc as aP,nd as jm,o as mO,oa as AI,oc as cP,od as Gm,p as fO,pa as vI,pb as yu,pc as Xe,pd as Um,q as _O,qa as kI,qb as bu,qc as dP,qd as Bm,r as hO,ra as xI,rb as Cu,rc as Kt,rd as qm,s as gO,sa as Il,sb as Tu,sc as lP,sd as zm,t as yO,ta as Rl,tb as Su,tc as uP,td as Vm,u as bO,ua as NI,ub as Ju,uc as bP,ud as Hm,v as CO,va as LI,vb as Zu,vc as qp,vd as Km,w as TO,wa as Pl,wb as Qu,wc as im,wd as Wm,x as SO,xa as Ml,xb as ep,xc as sm,xd as Xm,y as wO,ya as kl,yb as ZR,yc as am,yd as Ym,z as EO,za as xl,zb as QR,zc as cm,zd as Jm}from"./chunks/chunk-MACGGTLQ.js";import{Aa as hl,Ba as gl,Ca as yl,H as YO,Ha as bl,I as JO,Ia as Cl,Ja as Tl,K as ZO,Ka as Sl,L as QO,La as wl,M as eI,Ma as El,N as ul,Na as Al,O as pl,P as ml,Pa as vl,Q as fl,Qa as Ol,R as Gt,Ra as Hp,Sa as Kp,Ta as Wp,Va as Xp,Wa as Yp,Xa as Jp,a as Tv,b as Sv,c as Kc,d as Wc,f as Xc,g as Yc,h as UO,i as BO,j as qO,k as zO,l as VO,m as HO,n as KO,o as WO,p as ol,q as nl,r as il,s as sl,t as al,u as XO,ua as Ut,v as cl,va as Bt,w as dl,wa as qt,x as ll,xa as zt,ya as _l}from"./chunks/chunk-I6XT3DLQ.js";import{$ as hd,$a as hI,$b as yR,$c as Xu,A as RO,Aa as qd,Ac as VR,B as PO,Ba as zd,Bc as HR,C as MO,Ca as Vd,Cc as KR,D as kO,Da as Hd,Dc as Ou,E as xO,Ea as Kd,Ec as Iu,F as NO,Fa as Wd,Fb as XI,Fc as Ru,G as LO,Gb as YI,Gc as Pu,H as DO,Hb as JI,Hc as Mu,I as ed,Ia as tI,Ib as ZI,Ic as ku,J as td,Ja as rI,Jb as QI,Jc as Vt,K as rd,Ka as oI,Kb as eR,Kc as xu,L as od,La as nI,Lc as Nu,M as nd,Ma as iI,Mc as Lu,N as id,Na as sI,Nb as tR,Nc as Du,O as sd,Oa as aI,Ob as rR,Oc as $u,P as ad,Pa as cI,Pb as oR,Pc as Fu,Q as cd,Qa as dI,Qb as nR,Qc as ju,R as dd,Ra as lI,Rb as iR,Rc as Gu,S as ld,Sa as uI,Sb as sR,Sc as Uu,T as We,Ta as pI,Tb as aR,Tc as Bu,U as ud,Ua as mI,Ub as lu,Uc as qu,V as pd,Vb as wu,Vc as zu,W as md,Wb as Eu,Wc as Vu,X as fd,Xb as Au,Xc as Hu,Y as $O,Ya as fI,Yb as vu,Yc as Ku,Zb as hR,Zc as Wu,_ as _d,_a as _I,_b as gR,_c as Ht,aa as gd,ac as bR,ad as WR,b as av,ba as yd,bb as gI,bc as CR,bd as XR,c as cv,ca as bd,cb as yI,cc as TR,cd as YR,d as dv,da as Cd,db as bI,dc as SR,dd as Yu,e as lv,ea as Td,ec as wR,ed as JR,f as uv,fa as Sd,fb as OI,fc as ER,fd as jP,ga as wd,gb as II,gc as AR,gd as GP,h as pv,ha as Ed,hb as RI,hc as vR,hd as UP,i as mv,ia as Ad,ib as PI,ic as OR,id as BP,j as fv,ja as vd,jb as MI,jc as IR,jd as qP,k as gv,ka as Od,kb as DI,kc as RR,l as yv,la as Id,lb as $I,lc as PR,m as bv,ma as Rd,mb as FI,mc as MR,n as Cv,na as Pd,nb as jI,nc as kR,o as qv,oa as Md,ob as GI,oc as xR,p as zv,pa as kd,pb as UI,pc as NR,q as Vv,qa as xd,qb as BI,qc as LR,r as Hv,ra as Nd,rb as qI,rc as DR,s as Kv,sa as Ld,sb as zI,sc as $R,t as Wv,ta as Dd,tb as VI,tc as FR,u as Xv,ua as $d,ub as HI,uc as jR,v as Yv,va as Fd,vb as KI,vc as GR,w as Jv,wa as jd,wb as WI,wc as UR,x as Zv,xa as Gd,xc as BR,ya as Ud,yc as qR,z as Qc,za as Bd,zc as zR}from"./chunks/chunk-TSWEX72T.js";import{$ as It,$a as sn,$b as pn,$c as bn,$d as En,$f as ai,$g as cw,$i as kE,$j as sA,$k as jA,$l as ta,$m as tc,$n as Gc,Ab as PC,Ac as WC,Ad as MT,Ae as $n,Af as gS,Ag as ki,Ah as Lw,Ai as Bi,Ak as es,Al as Bs,Am as Ia,An as Ic,Bb as MC,Be as Fn,Bf as yS,Bg as xi,Bh as Dw,Bi as qi,Bj as XE,Bk as ts,Bl as qs,Bm as Ra,Bn as Rc,Cc as XC,Cd as kT,Ce as jn,Cf as bS,Cg as Ni,Ch as $w,Ci as zi,Cj as YE,Ck as rs,Cl as zs,Cm as Pa,Cn as Pc,D as Xb,Da as tn,Dc as fn,Dd as xT,De as Gn,Df as CS,Dg as Li,Dj as JE,Dk as os,Dl as Vs,Dm as Ma,Ee as Un,Ef as TS,Eg as Di,Eh as Fw,Ei as TE,Ej as ZE,Ek as ns,El as Hs,Em as ka,En as Ke,F as Yb,Fa as rn,Fc as _n,Fd as NT,Fe as Bn,Ff as SS,Fg as $i,Fh as jw,Fi as SE,Fj as Ki,Fl as Ks,Fm as xa,Fn as te,Ga as on,Gc as hn,Gd as LT,Ge as qn,Gf as wS,Gg as Fi,Gi as wE,Gj as Wi,Gk as is,Gl as Ws,Gm as Na,Gn as Mc,Ha as nn,Hb as kC,Hd as DT,He as zn,Hf as ES,Hg as ji,Hi as EE,Hj as Xi,Hk as ss,Hl as Xs,Hm as La,I as Jb,Ib as Ue,Id as $T,Ie as Vn,If as AS,Ig as qS,Ih as Gw,Ii as AE,Ij as Yi,Ik as as,Il as UA,Im as Da,In as ZA,Jb as Pt,Jc as YC,Jd as FT,Je as Hn,Jf as vS,Jg as zS,Jh as Uw,Jj as Ji,Jk as cs,Jl as BA,Jm as $a,Jn as QA,Kb as xC,Kc as JC,Kd as jT,Ke as Kn,Kf as OS,Kg as VS,Kh as Bw,Ki as vE,Kk as ds,Kl as Ve,Km as Fa,Lb as NC,Lc as ZC,Ld as GT,Le as Wn,Lf as IS,Lg as HS,Lh as qw,Lj as Zi,Lk as ls,Ll as qA,Lm as ja,M as Zb,Mb as LC,Mc as QC,Me as Xn,Mf as RS,Mg as KS,Mh as zw,Mi as OE,Mj as QE,Mk as us,Ml as zA,Mm as Ga,Mn as ev,N as L,Nb as DC,Nc as eT,Ne as Yn,Nf as PS,Ng as WS,Nh as Vw,Ni as IE,Nk as ps,Nl as VA,Nm as Ua,Nn as tv,O as Qb,Ob as V,Oc as tT,Oe as Jn,Of as MS,Og as XS,Oh as Hw,Oi as RE,Oj as eA,Ok as PA,Ol as Ft,Om as Ba,On as rv,P as b,Pb as $C,Pc as rT,Pe as QT,Pf as kS,Pg as YS,Ph as Kw,Pi as PE,Pj as tA,Pk as MA,Pl as He,Pm as qa,Pn as ov,Qc as gn,Qe as eS,Qf as xS,Qg as JS,Qh as Ww,Qi as ME,Qj as rA,Qk as kA,Ql as HA,Qm as za,Qn as nv,R as eC,Rc as oT,Rd as UT,Re as Be,Rf as NS,Rg as ZS,Rh as Xw,Rk as xA,Rl as KA,Rm as Va,Rn as iv,S as tC,Sc as nT,Se as Zn,Sf as LS,Sg as QS,Sh as Yw,Sj as oA,Sk as NA,Sl as WA,Sm as Ha,Sn as sv,Tc as iT,Td as Tn,Te as tS,Tf as DS,Tg as ew,Th as Jw,Tk as LA,Tl as XA,Tm as Ka,Tn as kc,Uc as sT,Ud as BT,Ue as Qn,Uf as $S,Ug as tw,Uh as Zw,Uk as DA,Ul as YA,Um as Wa,Un as xc,V as rC,Vc as aT,Vd as Sn,Ve as ei,Vf as FS,Vg as rw,Vj as nA,Vk as $A,Vl as JA,Vm as Xa,Vn as Nc,Wa as TC,Wc as cT,We as ti,Wf as jS,Wg as ow,Wh as Qw,Wl as Ys,Wm as Ya,Wn as Lc,Xa as SC,Xc as dT,Xd as qT,Xe as ri,Xf as GS,Xg as nw,Xh as Gi,Xj as iA,Xl as Js,Xm as Ja,Xn as Dc,Y as oC,Ya as wC,Yc as lT,Yd as zT,Yf as US,Yg as iw,Yh as Ui,Yl as Zs,Ym as Za,Yn as $c,Z as Ot,Zc as yn,Zd as VT,Zf as BS,Zg as sw,Zk as $t,Zl as Qs,Zm as Qa,Zn as Fc,_b as FC,_c as uT,_d as wn,_f as si,_g as aw,_k as FA,_l as ea,_m as ec,_n as jc,aa as Yo,ab as EC,ac as mn,ae as An,ag as ci,ah as dw,aj as xE,ak as aA,al as GA,am as ra,an as rc,ao as Uc,b as jo,ba as Jo,bb as AC,bc as jC,bd as pT,be as vn,bg as di,bh as lw,bi as eE,bj as NE,bk as cA,bl as gs,bm as oa,bn as oc,bo as Bc,c as Go,ca as Rt,cb as vC,cc as GC,cd as mT,ce as On,cg as li,ch as uw,ci as tE,cj as LE,ck as dA,cl as ys,cm as na,cn as nc,co as jt,d as Uo,db as OC,dc as P,dd as fT,de as In,dg as ui,dh as pw,di as rE,dj as DE,dk as lA,dl as bs,dm as ia,dn as ic,e as Bo,ea as nC,ec as UC,ed as _T,ee as Rn,eg as pi,eh as mw,ei as oE,ej as $E,el as Cs,em as sa,en as sc,f as $e,fb as an,fc as Mt,fd as hT,fe as HT,ff as xt,fg as qe,fh as fw,fk as uA,fl as Ts,fm as aa,fn as ac,g as me,ga as iC,gb as cn,gc as BC,gd as kt,ge as KT,gf as Nt,gg as ze,gh as _w,gi as nE,gk as pA,gl as Ss,gm as ca,gn as cc,h as Fe,ha as sC,hb as Ge,hd as gT,hf as oi,hg as mi,hh as hw,hi as iE,hj as FE,hk as mA,hl as ws,hm as da,hn as dc,i as qo,ia as aC,ib as IC,ic as qC,id as yT,ie as Pn,if as ni,ig as fi,ih as gw,ij as jE,ik as fA,il as Es,im as la,in as lc,j as zo,ja as cC,jd as bT,je as Mn,jf as ii,jg as _i,jh as yw,ji as sE,jj as Vi,jk as _A,jl as As,jm as ua,jn as uc,k as Vo,ka as dC,kb as dn,ke as WT,kg as hi,kh as bw,kj as GE,kk as hA,kl as vs,km as pa,kn as pc,l as Ho,la as lC,lb as ln,ld as CT,le as kn,lf as rS,lg as gi,lh as Cw,li as aE,lj as UE,lk as gA,ll as Os,lm as ma,ln as mc,ma as uC,md as TT,me as xn,mf as oS,mg as yi,mh as Tw,mi as cE,mj as BE,mk as yA,ml as Is,mm as fa,mn as fc,n as Ko,na as pC,nb as un,ne as XT,nf as nS,ng as bi,nh as Sw,ni as dE,nj as qE,nk as bA,nl as Rs,nm as _a,nn as _c,o as vt,oa as mC,oe as Nn,of as iS,og as Ci,oh as ww,oi as lE,oj as Lt,ok as CA,ol as Ps,om as ha,on as hc,p as fe,pa as fC,pd as Cn,pe as Ln,pf as sS,pg as Ti,ph as Ew,pi as uE,pk as Dt,pl as Ms,pm as ga,pn as gc,q as Wo,qd as ST,qe as D,qf as aS,qg as Si,qh as Aw,qi as pE,qk as TA,ql as ks,qm as ya,qn as yc,r as je,ra as _C,rd as wT,re as Dn,rf as cS,rg as wi,rh as vw,ri as mE,rj as zE,rk as SA,rl as xs,rm as ba,rn as bc,s as Xo,sa as hC,sd as ET,sf as dS,sg as Ei,sh as Ow,si as fE,sk as wA,sl as Ns,sm as Ca,sn as Cc,ta as gC,td as AT,tf as lS,tg as Ai,th as Iw,ti as _E,tk as EA,tl as Ls,tm as Ta,tn as Tc,u as Hb,ua as yC,ud as vT,uf as uS,ug as vi,uh as Rw,ui as hE,uk as AA,ul as Ds,um as Sa,un as Sc,v as Kb,va as bC,vc as zC,vd as OT,vf as pS,vg as Oi,vh as Pw,vi as gE,vj as Hi,vk as vA,vl as $s,vm as wa,vn as wc,w as Wb,wa as CC,wc as VC,wf as mS,wg as Ii,wh as Mw,wi as yE,wj as VE,wk as OA,wl as Fs,wm as Ea,wn as Ec,xa as Zo,xc as HC,xd as IT,xe as YT,xf as fS,xg as Ri,xh as kw,xi as bE,xj as HE,xk as IA,xl as js,xm as Aa,xn as Ac,ya as Qo,yd as RT,ye as JT,yf as _S,yg as Pi,yh as xw,yi as CE,yj as KE,yk as RA,yl as Gs,ym as va,yn as vc,za as en,zb as RC,zc as KC,zd as PT,ze as ZT,zf as hS,zg as Mi,zh as Nw,zj as WE,zk as Qi,zl as Us,zm as Oa,zn as Oc}from"./chunks/chunk-YKQTETJI.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="08485124-a2f1-5bb5-9316-533a3f7888bc")}catch{}})();var H="2026-07-28",xk=["2025-11-25","2025-06-18"],et=[H],m={headerMismatch:-32020,missingRequiredClientCapability:-32021,unsupportedProtocolVersion:-32022,invalidParams:-32602},A={clientCapabilities:"io.modelcontextprotocol/clientCapabilities",clientInfo:"io.modelcontextprotocol/clientInfo",logLevel:"io.modelcontextprotocol/logLevel",protocolVersion:"io.modelcontextprotocol/protocolVersion",serverInfo:"io.modelcontextprotocol/serverInfo"},lr=["debug","info","notice","warning","error","critical","alert","emergency"],p=class extends Error{code;data;constructor(t,r,o={}){super(t),this.name="PmMcpProtocolError",this.code=r,this.data=o}};function _(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function jh(e){if(e===void 0)return;if(!_(e))throw new p("Invalid MCP clientInfo metadata",m.invalidParams,{field:A.clientInfo,expected:"object"});let t=typeof e.name=="string"?e.name.trim():"",r=typeof e.version=="string"?e.version.trim():"";if(t.length===0||r.length===0)throw new p("Invalid MCP clientInfo metadata",m.invalidParams,{field:A.clientInfo,required:["name","version"]});let o={name:t.slice(0,128),version:r.slice(0,128)};return typeof e.description=="string"&&e.description.trim()&&(o.description=e.description.trim().slice(0,1024)),typeof e.websiteUrl=="string"&&e.websiteUrl.trim()&&(o.websiteUrl=e.websiteUrl.trim().slice(0,2048)),o}function Gh(e){if(e!==void 0){if(typeof e!="string"||!lr.includes(e))throw new p("Invalid MCP logLevel metadata",m.invalidParams,{field:A.logLevel,allowed:[...lr]});return e}}function tt(e){let t=_(e)?e._meta:void 0;if(!_(t))throw new p("Missing required MCP request metadata",m.invalidParams,{required:[A.protocolVersion,A.clientCapabilities]});let r=t[A.protocolVersion];if(typeof r!="string"||!et.includes(r))throw new p("Unsupported protocol version",m.unsupportedProtocolVersion,{supported:[...et],requested:typeof r=="string"?r:null});let o=t[A.clientCapabilities];if(!_(o))throw new p("Invalid MCP client capabilities metadata",m.invalidParams,{field:A.clientCapabilities,expected:"object"});let n=jh(t[A.clientInfo]),i=Gh(t[A.logLevel]);return{protocolVersion:H,clientCapabilities:o,...n?{clientInfo:n}:{},...i?{logLevel:i}:{}}}function Nk(e,t){if(t!==e.protocolVersion)throw new p("MCP protocol header does not match request metadata",m.headerMismatch,{header:t??null,metadata:e.protocolVersion})}function Lk(e,t){let r=t.filter(o=>!Object.prototype.hasOwnProperty.call(e.clientCapabilities,o));if(r.length>0)throw new p("Missing required client capability",m.missingRequiredClientCapability,{requiredCapabilities:Object.fromEntries(r.map(o=>[o,{}]))})}function Dk(e,t){let r=e.clientCapabilities.extensions;return _(r)&&_(r[t])}function rt(e,t){let r=_(e._meta)?e._meta:{};return{...e,_meta:{...r,[A.serverInfo]:{...t}}}}function Uh(e,t){return rt({...e,resultType:"complete"},t)}function $k(e){let t=e.ttlMs??6e4;if(!Number.isFinite(t)||t<0)throw new p("Invalid MCP discovery cache TTL",m.invalidParams,{ttlMs:t});return Uh({supportedVersions:[...et],capabilities:structuredClone(e.capabilities),ttlMs:t,cacheScope:"public",...e.instructions?{instructions:e.instructions}:{}},e.serverInfo)}function Fk(e,t){if(_(e)&&typeof e.resultType=="string")return e.resultType;if(t==="legacy")return"complete";throw new p("Modern MCP result is missing resultType",m.invalidParams,{required:"resultType"})}import{createHash as mr,createHmac as fr,timingSafeEqual as Bh}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="6505e714-d1f3-5794-88c8-51c1644acec9")}catch{}})();var qh=["elicitation/create","roots/list","sampling/createMessage"],ur=class extends Error{inputRequests;requestState;constructor(t){super("MCP operation requires additional input"),this.name="PmMcpInputRequiredError",this.inputRequests=t.inputRequests,this.requestState=t.requestState}},_r=/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/u,ge=32,nt=64*1024,ye=16*1024,ot={maxBytes:256*1024,maxDepth:32,maxNodes:4096};function zh(e){return e==="elicitation/create"?"elicitation":e==="sampling/createMessage"?"sampling":"roots"}function be(e,t,r){let o;try{o=JSON.stringify(e)}catch{throw new p(`Invalid ${r}: value is not JSON serializable`,m.invalidParams,{field:r})}if(Buffer.byteLength(o,"utf8")>t)throw new p(`Invalid ${r}: payload exceeds the protocol bound`,m.invalidParams,{field:r,maximumBytes:t})}function it(e,t){if(!_(e))throw new p("Invalid MCP inputRequests",m.invalidParams,{field:"inputRequests",expected:"object"});let r=Object.entries(e);if(r.length===0||r.length>ge)throw new p("Invalid MCP inputRequests count",m.invalidParams,{minimum:1,maximum:ge,observed:r.length});let o={};for(let[n,i]of r){if(!_r.test(n)||!_(i))throw new p("Invalid MCP input request entry",m.invalidParams,{field:`inputRequests.${n}`});let s=i.method;if(typeof s!="string"||!qh.includes(s))throw new p("Unsupported MCP input request method",m.invalidParams,{field:`inputRequests.${n}.method`,method:s??null});let a=zh(s);if(!Object.prototype.hasOwnProperty.call(t.clientCapabilities,a))throw new p("Missing required client capability",m.missingRequiredClientCapability,{requiredCapabilities:{[a]:{}}});if(!_(i.params))throw new p("Invalid MCP input request parameters",m.invalidParams,{field:`inputRequests.${n}.params`,expected:"object"});o[n]={method:s,params:structuredClone(i.params)}}return be(o,nt,"inputRequests"),o}function hr(e){if(!_(e))throw new p("Invalid MCP inputResponses",m.invalidParams,{field:"inputResponses",expected:"object"});let t=Object.entries(e);if(t.length>ge)throw new p("Invalid MCP inputResponses count",m.invalidParams,{maximum:ge,observed:t.length});let r={};for(let[o,n]of t){if(!_r.test(o)||!_(n))throw new p("Invalid MCP input response entry",m.invalidParams,{field:`inputResponses.${o}`});r[o]=structuredClone(n)}return be(r,nt,"inputResponses"),r}function Bk(e){let t=e.requestState?.trim();if(t&&Buffer.byteLength(t,"utf8")>ye)throw new p("Invalid MCP requestState: payload exceeds the protocol bound",m.invalidParams,{field:"requestState",maximumBytes:ye});let r=e.inputRequests===void 0?void 0:it(e.inputRequests,e.requestContext);if(r===void 0&&!t)throw new p("InputRequiredResult requires inputRequests or requestState",m.invalidParams,{requiredAnyOf:["inputRequests","requestState"]});return{resultType:"input_required",...r?{inputRequests:r}:{},...t?{requestState:t}:{},_meta:{[A.serverInfo]:{...e.serverInfo}}}}function gr(e){let t=Buffer.from(e);if(t.byteLength<32)throw new p("MCP requestState signing key must contain at least 32 bytes",m.invalidParams,{minimumBytes:32});return t}function qk(e,t){if(!Number.isSafeInteger(e.expiresAt)||e.expiresAt<=0||e.method.trim().length===0||e.parameterDigest.trim().length===0||e.principal.trim().length===0)throw new p("Invalid MCP requestState payload",m.invalidParams);let r=Buffer.from(JSON.stringify({version:1,...e}),"utf8");if(r.byteLength>ye/2)throw new p("MCP requestState payload exceeds the protocol bound",m.invalidParams,{maximumBytes:ye/2});let o=r.toString("base64url"),n=fr("sha256",gr(t)).update(o).digest("base64url");return`${o}.${n}`}function Vh(e){if(!_(e)||e.version!==1)throw new p("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});let{expiresAt:t,method:r,parameterDigest:o,principal:n,state:i}=e;if(typeof t!="number"||!Number.isSafeInteger(t))throw new p("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});if(typeof r!="string"||typeof o!="string"||typeof n!="string")throw new p("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});return{expiresAt:t,method:r,parameterDigest:o,principal:n,state:i}}function zk(e,t,r){let[o,n,i]=e.split(".");if(!o||!n||i!==void 0)throw new p("Invalid MCP requestState encoding",m.invalidParams,{field:"requestState"});let s=Buffer.from(n,"base64url"),a=fr("sha256",gr(t)).update(o).digest();if(s.byteLength!==a.byteLength||!Bh(s,a))throw new p("Invalid MCP requestState signature",m.invalidParams,{field:"requestState"});let c;try{c=JSON.parse(Buffer.from(o,"base64url").toString("utf8"))}catch{c=null}let d=Vh(c),{expiresAt:l,method:u,parameterDigest:f,principal:g}=d;if(l<(r.nowMs??Date.now()))throw new p("Expired MCP requestState",m.invalidParams,{field:"requestState",expiredAt:l});if(u!==r.method||f!==r.parameterDigest||g!==r.principal)throw new p("MCP requestState binding mismatch",m.invalidParams,{field:"requestState"});return d}function Vk(e){return be(e,nt,"request parameters"),mr("sha256").update(JSON.stringify(e)).digest("hex")}var pr=class{#e=new Set;#t;constructor(t=4096){if(!Number.isSafeInteger(t)||t<1)throw new p("Invalid MCP replay guard capacity",m.invalidParams,{maximumEntries:t});this.#t=t}consume(t){let r=mr("sha256").update(t).digest("hex");if(this.#e.has(r))throw new p("MCP requestState replay detected",m.invalidParams,{field:"requestState"});if(this.#e.size>=this.#t){let o=this.#e.values().next().value;this.#e.delete(o)}this.#e.add(r)}};function Hh(e){if(!Number.isSafeInteger(e.ttlMs)||e.ttlMs<0||e.cacheScope!=="public"&&e.cacheScope!=="private")throw new p("Invalid MCP cache policy",m.invalidParams,{ttlMs:e.ttlMs,cacheScope:e.cacheScope});return{ttlMs:e.ttlMs,cacheScope:e.cacheScope}}function Hk(e,t){return{...e,...Hh(t)}}function Kh(e){return e.replaceAll("~1","/").replaceAll("~0","~")}function Wh(e,t){if(t==="#")return e;if(!t.startsWith("#/"))return;let r=e;for(let o of t.slice(2).split("/").map(Kh)){if(!_(r)&&!Array.isArray(r)||!Object.prototype.hasOwnProperty.call(r,o))return;r=r[o]}return r}function Xh(e){let t=e.maxBytes??ot.maxBytes,r=e.maxDepth??ot.maxDepth,o=e.maxNodes??ot.maxNodes;if(!Number.isSafeInteger(t)||t<2)throw new p("Invalid MCP JSON Schema work bounds",m.invalidParams);if(!Number.isSafeInteger(r)||r<1)throw new p("Invalid MCP JSON Schema work bounds",m.invalidParams);if(!Number.isSafeInteger(o)||o<1)throw new p("Invalid MCP JSON Schema work bounds",m.invalidParams);return{maximumBytes:t,maximumDepth:r,maximumNodes:o}}function Yh(e,t){let r=Array.isArray(e.value)?e.value:_(e.value)?Object.values(e.value):[];for(let o of r)t.push({value:o,depth:e.depth+1})}function Jh(e,t){if(!_(t)||typeof t.$ref!="string")return;let r=t.$ref;if(r.startsWith("#")&&Wh(e,r)===void 0)throw new p("MCP JSON Schema contains an unresolved local reference",m.invalidParams,{reference:r})}function Kk(e,t={}){let{maximumBytes:r,maximumDepth:o,maximumNodes:n}=Xh(t);if(typeof e!="boolean"&&!_(e))throw new p("Invalid MCP JSON Schema root",m.invalidParams,{expected:"object or boolean"});be(e,r,"JSON Schema");let i=[{value:e,depth:0}],s=0;for(;i.length>0;){let a=i.pop();if(s+=1,s>n||a.depth>o)throw new p("MCP JSON Schema exceeds validation work bounds",m.invalidParams,{maximumDepth:o,maximumNodes:n});Jh(e,a.value),Yh(a,i)}return structuredClone(e)}import{randomUUID as Zh}from"node:crypto";import{readFile as Qh}from"node:fs/promises";import yr from"node:path";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="7f5b3ba6-07cf-5317-8f62-63e84f561232")}catch{}})();var t0="io.modelcontextprotocol/tasks",eg=["working","input_required","completed","failed","cancelled"],tg=/^mcp-task-[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/iu,rg=3600*1e3,og=1e3,Te=1024,ng=30,ig=2e3;function st(e){return new p(e,m.invalidParams,{code:"mcp_task_not_found_or_not_authorized"})}function Ce(e){let t=e.trim();if(!tg.test(t))throw st("Unknown MCP task");return t}function br(e,t){if(typeof e!="string"||!Number.isFinite(Date.parse(e)))throw new p("Corrupt MCP task record",m.invalidParams,{field:t});return e}function Cr(e){if(!_(e)||typeof e.code!="number"||!Number.isFinite(e.code)||typeof e.message!="string")throw new p("Corrupt MCP task error",m.invalidParams);return{code:e.code,message:e.message.slice(0,Te),..._(e.data)?{data:structuredClone(e.data)}:{}}}function sg(e){if(!eg.includes(e))throw new p("Corrupt MCP task record",m.invalidParams);return e}function ag(e){if(typeof e!="string"||e.length===0)throw new p("Corrupt MCP task record",m.invalidParams);return e}function cg(e){if(typeof e!="number"||!Number.isSafeInteger(e)||e<1)throw new p("Corrupt MCP task record",m.invalidParams);return e}function dg(e){if(e!==null&&(typeof e!="number"||!Number.isSafeInteger(e)||e<0))throw new p("Corrupt MCP task record",m.invalidParams);return e}function lg(e){if(e!==void 0){if(typeof e!="number"||!Number.isSafeInteger(e)||e<0)throw new p("Corrupt MCP task record",m.invalidParams);return e}}function ug(e){if(!Array.isArray(e)||e.some(t=>typeof t!="string"))throw new p("Corrupt MCP task record",m.invalidParams);return[...e]}function pg(e){if(!_(e)||e.version!==1)throw new p("Corrupt MCP task record",m.invalidParams);let t=typeof e.taskId=="string"?Ce(e.taskId):"",r=sg(e.status),o=ag(e.principal),n=cg(e.workerPid),i=dg(e.ttlMs),s=lg(e.pollIntervalMs),a={version:1,taskId:t,status:r,principal:o,workerPid:n,createdAt:br(e.createdAt,"createdAt"),lastUpdatedAt:br(e.lastUpdatedAt,"lastUpdatedAt"),ttlMs:i,consumedInputKeys:ug(e.consumedInputKeys),...typeof e.statusMessage=="string"?{statusMessage:e.statusMessage.slice(0,Te)}:{},...typeof s=="number"?{pollIntervalMs:s}:{}};if(_(e.inputRequests)&&(a.inputRequests=structuredClone(e.inputRequests)),_(e.inputResponses)&&(a.inputResponses=structuredClone(e.inputResponses)),_(e.result)&&(a.result=structuredClone(e.result)),e.error!==void 0&&(a.error=Cr(e.error)),a.status==="input_required"&&!a.inputRequests||a.status==="completed"&&!a.result||a.status==="failed"&&!a.error)throw new p("Corrupt MCP task status payload",m.invalidParams,{status:a.status});return a}function K(e){let t={taskId:e.taskId,status:e.status,createdAt:e.createdAt,lastUpdatedAt:e.lastUpdatedAt,ttlMs:e.ttlMs,...e.statusMessage?{statusMessage:e.statusMessage}:{},...e.pollIntervalMs===void 0?{}:{pollIntervalMs:e.pollIntervalMs}};return e.status==="input_required"?{...t,status:"input_required",inputRequests:structuredClone(e.inputRequests)}:e.status==="completed"?{...t,status:"completed",result:structuredClone(e.result)}:e.status==="failed"?{...t,status:"failed",error:structuredClone(e.error)}:e.status==="cancelled"?{...t,status:"cancelled"}:{...t,status:"working"}}function oe(e){return e==="completed"||e==="failed"||e==="cancelled"}function mg(e){try{return process.kill(e,0),!0}catch(t){return!(typeof t=="object"&&t!==null&&"code"in t&&t.code==="ESRCH")}}var at=class{#e;#t;#r;#o;#i;constructor(t){this.#e=yr.resolve(t.pmRoot),this.#t=t.owner?.trim()||"pm-mcp",this.#r=t.now??(()=>new Date),this.#o=t.taskIdFactory??(()=>`mcp-task-${Zh()}`),this.#i=t.workerPid??process.pid}#s(t){return yr.join(this.#e,"runtime","mcp-tasks","records",`${Ce(t)}.json`)}async#c(t){try{return pg(JSON.parse(await Qh(this.#s(t),"utf8")))}catch(r){throw fe(r)||r instanceof SyntaxError?st("Unknown MCP task"):r}}async#a(t){await je(this.#s(t.taskId),`${JSON.stringify(t,null,2)}
|
|
2
|
+
`)}async#n(t,r,o){let n=Ce(t),i=await Be(this.#e,n,ng,this.#t,!1,!1,ig);try{let s=await this.#c(n);if(s.principal!==r)throw st("Unknown MCP task");let a=o(s);return await this.#a(a),a}finally{await i()}}async create(t){let r=Ce(this.#o()),o=t.principal.trim(),n=t.ttlMs===void 0?rg:t.ttlMs,i=t.pollIntervalMs??og;if(o.length===0||n!==null&&(!Number.isSafeInteger(n)||n<0)||!Number.isSafeInteger(i)||i<0)throw new p("Invalid MCP task creation options",m.invalidParams);let s=this.#r().toISOString(),a={version:1,taskId:r,status:"working",createdAt:s,lastUpdatedAt:s,ttlMs:n,pollIntervalMs:i,principal:o,workerPid:this.#i,consumedInputKeys:[],...t.statusMessage?.trim()?{statusMessage:t.statusMessage.trim().slice(0,Te)}:{}};return await this.#a(a),{...K(a),resultType:"task"}}async get(t,r){return K(await this.#n(t,r,o=>{if(oe(o.status))return o;let n=this.#r().getTime(),i=o.ttlMs!==null&&Date.parse(o.createdAt)+o.ttlMs<=n,s=o.workerPid!==this.#i&&!mg(o.workerPid);return!i&&!s?o:{...o,status:"failed",statusMessage:i?"Task retention expired before completion.":"Task worker ended before recording a terminal result.",lastUpdatedAt:this.#r().toISOString(),error:{code:-32603,message:i?"MCP task expired":"MCP task worker unavailable after restart",data:{recoverable:!1,createNewTask:!0}},inputRequests:void 0}}))}async requireInput(t){let r=it(t.inputRequests,t.requestContext);return K(await this.#n(t.taskId,t.principal,o=>{if(oe(o.status))return o;let n=Object.keys(r).filter(i=>o.consumedInputKeys.includes(i));if(n.length>0)throw new p("MCP task input request keys must be unique for the task lifetime",m.invalidParams,{reused:n});return{...o,status:"input_required",statusMessage:t.statusMessage?.trim().slice(0,Te),lastUpdatedAt:this.#r().toISOString(),inputRequests:r}}))}async update(t,r,o){let n=hr(o),i=[],s=[];return await this.#n(t,r,a=>{if(a.status!=="input_required"||!a.inputRequests)return a;let c={...a.inputRequests},d=a.inputResponses?{...a.inputResponses}:{};for(let[l,u]of Object.entries(n))Object.prototype.hasOwnProperty.call(c,l)&&(d[l]=u,delete c[l],i.push(l));return s=Object.keys(c).sort(),i.length===0?a:{...a,status:s.length===0?"working":"input_required",lastUpdatedAt:this.#r().toISOString(),inputRequests:s.length===0?void 0:c,inputResponses:d,consumedInputKeys:[...new Set([...a.consumedInputKeys,...i])].sort()}}),{acceptedKeys:i.sort(),remainingKeys:s}}async takeInputResponses(t,r){let o={};return await this.#n(t,r,n=>(o=structuredClone(n.inputResponses??{}),Object.keys(o).length===0?n:{...n,inputResponses:void 0})),o}async complete(t,r,o){return K(await this.#n(t,r,n=>oe(n.status)?n:{...n,status:"completed",statusMessage:"Task completed.",lastUpdatedAt:this.#r().toISOString(),result:structuredClone(o),inputRequests:void 0,error:void 0}))}async fail(t,r,o){let n=Cr(o);return K(await this.#n(t,r,i=>oe(i.status)?i:{...i,status:"failed",statusMessage:n.message,lastUpdatedAt:this.#r().toISOString(),error:n,inputRequests:void 0,result:void 0}))}async cancel(t,r){return K(await this.#n(t,r,o=>oe(o.status)?o:{...o,status:"cancelled",statusMessage:"Task cancelled by the client.",lastUpdatedAt:this.#r().toISOString(),inputRequests:void 0,result:void 0,error:void 0}))}};function r0(e){return new at(e)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="f87864d3-e499-57f7-b1e3-4ea3f30b7725")}catch{}})();var Se="io.modelcontextprotocol/subscriptionId",Tr=256,Sr=2048,fg=5e3;function _g(e,t){return new Promise((r,o)=>{let n=setTimeout(()=>o(new Error("MCP subscription sink write timed out")),fg);n.unref(),Promise.resolve().then(()=>e(t)).then(()=>{clearTimeout(n),r()},i=>{clearTimeout(n),o(i instanceof Error?i:new Error(String(i)))})})}function ct(e,t){if(e!==void 0){if(typeof e!="boolean")throw new p("Invalid MCP subscription filter",m.invalidParams,{field:`notifications.${t}`,expected:"boolean"});return e||void 0}}function hg(e){if(!_(e))throw new p("Invalid MCP subscription filter",m.invalidParams,{field:"notifications",expected:"object"});let t=ct(e.toolsListChanged,"toolsListChanged"),r=ct(e.promptsListChanged,"promptsListChanged"),o=ct(e.resourcesListChanged,"resourcesListChanged"),n;if(e.resourceSubscriptions!==void 0){if(!Array.isArray(e.resourceSubscriptions)||e.resourceSubscriptions.length>Tr)throw new p("Invalid MCP resource subscriptions",m.invalidParams,{field:"notifications.resourceSubscriptions",maximum:Tr});let i=new Set;for(let s of e.resourceSubscriptions){if(typeof s!="string"||s.trim().length===0||Buffer.byteLength(s,"utf8")>Sr)throw new p("Invalid MCP resource subscription URI",m.invalidParams,{field:"notifications.resourceSubscriptions",maximumBytes:Sr});i.add(s)}i.size>0&&(n=[...i].sort())}return{...t?{toolsListChanged:t}:{},...r?{promptsListChanged:r}:{},...o?{resourcesListChanged:o}:{},...n?{resourceSubscriptions:n}:{}}}function gg(e,t){return{...e.toolsListChanged&&t.tools?.listChanged?{toolsListChanged:!0}:{},...e.promptsListChanged&&t.prompts?.listChanged?{promptsListChanged:!0}:{},...e.resourcesListChanged&&t.resources?.listChanged?{resourcesListChanged:!0}:{},...e.resourceSubscriptions&&t.resources?.subscribe?{resourceSubscriptions:[...e.resourceSubscriptions]}:{}}}var wr=class{#e;#t=new Map;#r;constructor(t){this.#e=structuredClone(t.capabilities),this.#r={...t.serverInfo}}get size(){return this.#t.size}async open(t){if(this.#t.has(t.id))throw new p("MCP subscription id is already active",m.invalidParams,{subscriptionId:t.id});let r=gg(hg(t.notifications),this.#e),o={filter:r,sink:t.sink,writeQueue:Promise.resolve()};this.#t.set(t.id,o);try{await this.#o(t.id,o,{jsonrpc:"2.0",method:"notifications/subscriptions/acknowledged",params:{_meta:{[Se]:t.id},notifications:structuredClone(r)}},!0)}catch(n){throw this.#t.delete(t.id),n}return structuredClone(r)}async emitListChanged(t){let r=`${t}ListChanged`,o=`notifications/${t}/list_changed`,n=[];for(let[i,s]of this.#t)s.filter[r]===!0&&n.push(this.#o(i,s,{jsonrpc:"2.0",method:o,params:{_meta:{[Se]:i}}}));return(await Promise.all(n)).filter(Boolean).length}async emitResourceUpdated(t){let r=[];for(let[o,n]of this.#t)n.filter.resourceSubscriptions?.includes(t)&&r.push(this.#o(o,n,{jsonrpc:"2.0",method:"notifications/resources/updated",params:{_meta:{[Se]:o},uri:t}}));return(await Promise.all(r)).filter(Boolean).length}async#o(t,r,o,n=!1){let i=r.writeQueue.then(async()=>{if(this.#t.get(t)!==r)return!1;try{return await _g(r.sink,o),!0}catch(s){if(this.#t.get(t)===r&&this.#t.delete(t),n)throw s;return!1}});return r.writeQueue=i.then(()=>{},()=>{}),i}close(t){if(this.#t.delete(t))return{...rt({resultType:"complete",_meta:{[Se]:t}},this.#r)}}closeAll(){let t=[];for(let r of this.#t.keys()){let o=this.close(r);t.push({id:r,result:o})}return t}};(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="7d591d0b-f009-519c-8024-c6fa18effb8e")}catch{}})();var Er=/^=\?base64\?([A-Za-z0-9+/]*={0,2})\?=$/u,yg=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/u,Ar=/^[\t\x20-\x7E]*$/u,vr=new Set(["prompts/get","resources/read","tools/call"]);function bg(e){let t=new Map;for(let[r,o]of Object.entries(e)){if(o===void 0)continue;let n=typeof o=="string"?o:o.join(", ");t.set(r.toLowerCase(),n)}return t}function v(e,t){throw new p(e,m.headerMismatch,{header:t})}function Or(e){let t=typeof e=="boolean"?String(e).toLowerCase():String(e);return t.length>0&&t.trim()===t&&Ar.test(t)&&!Er.test(t)?t:`=?base64?${Buffer.from(t,"utf8").toString("base64")}?=`}function Ir(e,t){let r=Er.exec(e);if(r){let o=r[1],n=Buffer.from(o,"base64");return n.toString("base64")!==o||n.length===0?v("Malformed MCP Base64 header value",t):n.toString("utf8")}return e.length===0||e.trim()!==e||!Ar.test(e)?v("Malformed MCP header value",t):e}function we(e){return Array.isArray(e)?e.some(we):_(e)?Object.prototype.hasOwnProperty.call(e,"x-mcp-header")||Object.values(e).some(we):!1}function Cg(e,t,r){let o=e["x-mcp-header"];if(o===void 0)return;let n=e.type;if(typeof o!="string"||!yg.test(o)||!["boolean","integer","string"].includes(String(n))||r.has(o.toLowerCase()))throw new p("Invalid MCP x-mcp-header annotation",m.invalidParams,{field:t.join("."),annotation:o});return r.add(o.toLowerCase()),{name:o,path:t,type:n}}function Rr(e){if(!_(e))throw new p("Invalid MCP tool schema",m.invalidParams,{field:"inputSchema",expected:"object"});let t=[],r=new Set,o=(n,i)=>{let s=n.properties;if(s!==void 0){if(!_(s))throw new p("Invalid MCP tool schema properties",m.invalidParams,{field:"inputSchema.properties"});for(let[a,c]of Object.entries(s)){if(!_(c))continue;let d=[...i,a],l=Cg(c,d,r);l&&t.push(l);for(let[u,f]of Object.entries(c))if(u!=="properties"&&u!=="x-mcp-header"&&we(f))throw new p("MCP x-mcp-header is not statically reachable",m.invalidParams,{field:d.join("."),keyword:u});o(c,d)}}};for(let[n,i]of Object.entries(e))if(n!=="properties"&&we(i))throw new p("MCP x-mcp-header is not statically reachable",m.invalidParams,{field:"inputSchema",keyword:n});return o(e,[]),t}function Pr(e,t){let r=e;for(let o of t){if(!_(r))return;r=r[o]}return r}function Mr(e,t){let r=e==="resources/read"?t.uri:t.name;return typeof r=="string"?r:void 0}function Tg(e,t){let r=_(e.arguments)?e.arguments:{},o={};for(let n of Rr(t)){let i=Pr(r,n.path);if(i==null)continue;if(!(n.type==="integer"&&typeof i=="number"&&Number.isSafeInteger(i)||n.type==="boolean"&&typeof i=="boolean"||n.type==="string"&&typeof i=="string"))throw new p("Invalid MCP custom header argument",m.invalidParams,{field:n.path.join("."),expected:n.type});o[`Mcp-Param-${n.name}`]=Or(i)}return o}function a0(e){let t=_(e.request.params)?e.request.params:void 0,r=tt(t),o=e.request.method;if(typeof o!="string"||o.length===0)return v("Missing MCP request method","Mcp-Method");let n={Accept:"application/json, text/event-stream","Content-Type":"application/json","MCP-Protocol-Version":r.protocolVersion,"Mcp-Method":o},i=Mr(o,t);if(vr.has(o)){if(i===void 0)return v("Missing MCP request name","Mcp-Name");n["Mcp-Name"]=Or(i)}return o==="tools/call"&&e.toolSchema!==void 0&&Object.assign(n,Tg(t,e.toolSchema)),n}function Sg(e,t){let r=t.method;(typeof r!="string"||r.length===0)&&v("Missing MCP request method","Mcp-Method");let o=_(t.params)?t.params:void 0,n=tt(o).protocolVersion;if(e.get("mcp-protocol-version")!==n&&v("MCP protocol header does not match request metadata","MCP-Protocol-Version"),e.get("mcp-method")!==r&&v("MCP method header does not match request body","Mcp-Method"),vr.has(r)){let i=e.get("mcp-name"),s=Mr(r,o);(i===void 0||s===void 0||Ir(i,"Mcp-Name")!==s)&&v("MCP name header does not match request body","Mcp-Name")}e.has("last-event-id")&&v("MCP SSE resumability is not supported","Last-Event-ID")}function wg(e,t,r){return e.type==="integer"?typeof t=="number"&&Number.isSafeInteger(t)&&Number(r)===t:e.type==="boolean"?typeof t=="boolean"&&r===String(t):typeof t=="string"&&r===t}function Eg(e){let t=_(e.params.arguments)?e.params.arguments:{};for(let r of Rr(e.toolSchema)){let o=Pr(t,r.path),n=`Mcp-Param-${r.name}`,i=e.headers.get(n.toLowerCase());if(o==null){i!==void 0&&v("Unexpected MCP parameter header",n);continue}i===void 0&&v("Missing MCP parameter header",n),wg(r,o,Ir(i,n))||v("MCP parameter header does not match request body",n)}}function c0(e){let t=bg(e.headers),r=typeof e.request.method=="string"?e.request.method:"";Sg(t,e.request),!(r!=="tools/call"||e.toolSchema===void 0)&&Eg({headers:t,params:e.request.params,toolSchema:e.toolSchema})}var d0=H;import{AsyncLocalStorage as Ag}from"node:async_hooks";import{createHash as kr,timingSafeEqual as vg}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="6a5310f6-3add-5108-b39f-61607918dc9f")}catch{}})();var y=class extends Error{httpStatus;challenge;constructor(t,r,o){super(t),this.name="PmMcpAuthorizationError",this.httpStatus=r,this.challenge=o}},Og=/^00-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})$/u,Ig=/^[a-z][a-z0-9_*/-]{0,255}$/u,Rg=/^(?:[a-z0-9][a-z0-9_*/-]{0,240})@[a-z][a-z0-9_*/-]{0,13}$/u,Pg=/^[\x20-\x2B\x2D-\x3C\x3E-\x7E]{0,255}[\x21-\x2B\x2D-\x3C\x3E-\x7E]$/u,Nr=/^[\x21\x23-\x5B\x5D-\x7E]+$/u,Lr=/^[A-Za-z0-9!#$%&'*+.^_`|~-]+$/u,Mg=/^[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]*$/u,kg=/%(?![0-9A-Fa-f]{2})/u,xg=512,Ng=32,Lg=180,Dg=8192,$g=8192,Dr=new Ag;function E(e,t,r=!1){if(new RegExp("\\p{Cc}","u").test(e))throw new y(`Invalid ${t}`,401);let o;try{o=new URL(e)}catch{throw new y(`Invalid ${t}`,401)}let n=o.hostname==="127.0.0.1"||o.hostname==="localhost";if(o.hash.length>0||o.protocol!=="https:"&&!(r&&n&&o.protocol==="http:"))throw new y(`Invalid ${t}`,401);return o}function Fg(e,t){let r=t.toLowerCase();for(let[o,n]of Object.entries(e))if(!(o.toLowerCase()!==r||n===void 0))return typeof n=="string"?n:n.join(", ")}function f0(e){let t=E(e.resource,"protected resource URI",!0).href.replace(/\/$/u,"");if(e.authorizationServers.length===0)throw new y("Protected resource metadata requires an authorization server",401);let r=e.authorizationServers.map(n=>E(n,"authorization server issuer").href.replace(/\/$/u,"")),o=[...new Set(e.scopes??[])];if(o.some(n=>!Nr.test(n)))throw new y("Invalid authorization scope",401);return{resource:t,authorization_servers:r,...o.length>0?{scopes_supported:o.sort()}:{}}}function _0(e){let t=E(e,"authorization server issuer"),r=t.pathname.replace(/^\/+|\/+$/gu,""),o=t.origin;return r?[`${o}/.well-known/oauth-authorization-server/${r}`,`${o}/.well-known/openid-configuration/${r}`,`${o}/${r}/.well-known/openid-configuration`]:[`${o}/.well-known/oauth-authorization-server`,`${o}/.well-known/openid-configuration`]}function h0(e,t){if(!_(e)||typeof e.issuer!="string")throw new y("Invalid authorization server metadata",401);let r=E(t,"expected issuer").href.replace(/\/$/u,"");if(E(e.issuer,"metadata issuer").href.replace(/\/$/u,"")!==r)throw new y("Authorization server issuer mismatch",401);if(!Array.isArray(e.code_challenge_methods_supported)||!e.code_challenge_methods_supported.includes("S256"))throw new y("Authorization server does not support required S256 PKCE",401);let n=d=>{let l=e[d];if(typeof l!="string")throw new y(`Authorization server metadata requires ${d}`,401);return E(l,d).href},i=d=>{let l=e[d];return typeof l=="string"?E(l,d).href:void 0},s=n("authorization_endpoint"),a=n("token_endpoint"),c=i("registration_endpoint");return{issuer:r,authorization_endpoint:s,token_endpoint:a,code_challenge_methods_supported:[...new Set(e.code_challenge_methods_supported.filter(d=>typeof d=="string"))],...e.client_id_metadata_document_supported===!0?{client_id_metadata_document_supported:!0}:{},...c?{registration_endpoint:c}:{}}}function g0(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 y0(e){if(e.responseIssuer===void 0){if(e.issuerParameterSupported)throw new y("Authorization response omitted the advertised issuer",401);return}if(e.responseIssuer!==e.expectedIssuer)throw new y("Authorization response issuer mismatch",401)}function b0(e,t){let r=E(t,"client metadata document URL");if(r.pathname==="/"||!_(e)||e.client_id!==r.href||typeof e.client_name!="string"||e.client_name.trim().length===0||!Array.isArray(e.redirect_uris)||e.redirect_uris.length===0)throw new y("Invalid Client ID Metadata Document",401);for(let o of e.redirect_uris){if(typeof o!="string")throw new y("Invalid client redirect URI",401);E(o,"client redirect URI",!0)}return structuredClone(e)}function C0(e){if(e.redirectUris.length===0||e.clientName.trim().length===0)throw new y("Invalid dynamic client registration metadata",401);let t=e.redirectUris.map(r=>E(r,"redirect URI",!0).href);return{application_type:e.applicationType,client_name:e.clientName.trim().slice(0,128),redirect_uris:t,grant_types:["authorization_code","refresh_token"],response_types:["code"],token_endpoint_auth_method:"none"}}var xr=class{#e=new Map;set(t,r){let o=E(t,"credential issuer").href;this.#e.set(o,structuredClone(r))}get(t){let r=E(t,"credential issuer").href,o=this.#e.get(r);return o?structuredClone(o):void 0}delete(t){let r=E(t,"credential issuer").href;return this.#e.delete(r)}};function jg(e){let t=e.traceparent,r=e.tracestate;if(t!==void 0){let o=typeof t=="string"?Og.exec(t):null;if(!o)throw new y("Invalid MCP traceparent",403);let n=o[1],i=o[2];if(/^0+$/u.test(n)||/^0+$/u.test(i))throw new y("Invalid MCP traceparent",403)}if(r!==void 0&&(typeof r!="string"||!Ug(r)))throw new y("Invalid MCP tracestate",403);return{...typeof t=="string"?{traceparent:t}:{},...typeof r=="string"?{tracestate:r}:{}}}function $(e){return e.replace(/^[ \t]*|[ \t]*$/gu,"")}function Gg(e){return Ig.test(e)||Rg.test(e)}function Ug(e){if(Buffer.byteLength(e,"utf8")>xg)return!1;let t=e.split(",");if(t.length>Ng)return!1;let r=new Set;for(let o of t){let n=$(o);if(n.length===0)continue;let i=n.indexOf("="),s=i>0?n.slice(0,i):"",a=i>0?n.slice(i+1):"";if(!Gg(s)||!Pg.test(a)||r.has(s))return!1;r.add(s)}return!0}function $r(e){return Mg.test(e)&&!kg.test(e)}function Bg(e){let t=$(e),r=t.indexOf("="),o=$(r>=0?t.slice(0,r):t),n=r>=0?$(t.slice(r+1)):void 0;return Lr.test(o)&&(n===void 0||$r(n))}function qg(e){let t=$(e),r=t.split(";"),o=r[0],n=r.slice(1),i=o.indexOf("="),s=$(i>0?o.slice(0,i):""),a=i>0?$(o.slice(i+1)):"";if(!(!Lr.test(s)||!$r(a)||!n.every(Bg)))return{key:s,serialized:t}}function zg(e,t){if(e===void 0)return;if(typeof e!="string"||Buffer.byteLength(e,"utf8")>Dg)throw new y("Invalid MCP baggage",403);let r=new Set(t),o=e.split(",");if(o.length>Lg)throw new y("Invalid MCP baggage",403);let n=[];for(let i of o){let s=qg(i);if(!s)throw new y("Invalid MCP baggage",403);r.has(s.key)&&n.push(s.serialized)}return n.length>0?n.join(","):void 0}function T0(e,t={}){let r=_(e)&&_(e._meta)?e._meta:{},o=zg(r.baggage,t.baggageAllowlist??[]);return{...jg(r),...o?{baggage:o}:{}}}function S0(e,t){return Dr.run(structuredClone(e),t)}function w0(){let e=Dr.getStore();return e?{...e}:void 0}async function E0(e){let t=E(e.policy.resourceMetadataUrl,"protected resource metadata URL",!0).href,r=[...new Set(e.policy.requiredScopes??[])];if(r.some(u=>!Nr.test(u)))throw new y("Invalid authorization scope",401);let o=`Bearer resource_metadata="${t}"`;if(new URL(e.requestUrl,e.policy.resource).searchParams.has("access_token"))throw new y("Access tokens must not appear in URI query parameters",401,o);let s=Fg(e.headers,"authorization")?.match(/^Bearer ([^\s]+)$/iu);if(!s)throw new y("Missing or malformed bearer token",401,o);let a=s[1];if(Buffer.byteLength(a,"utf8")>$g)throw new y("Missing or malformed bearer token",401,o);let c;try{c=await e.policy.verifyAccessToken(a)}catch{throw new y("Invalid bearer token",401,o)}let d=Array.isArray(c.audience)?c.audience:[c.audience];if(c.issuer!==e.policy.issuer||!d.includes(e.policy.resource))throw new y("Bearer token issuer or audience mismatch",401,o);let l=r.filter(u=>!c.scopes.includes(u));if(l.length>0)throw new y("Bearer token has insufficient scope",403,`${o}, scope="${l.join(" ")}"`);return{...c,audience:[...d],scopes:[...c.scopes]}}function A0(e){let t=kr("sha256").update(e.token).digest();return r=>{let o=kr("sha256").update(r).digest();if(!vg(t,o))throw new y("Invalid bearer token",401);return structuredClone(e.claims)}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="4f17095e-2dba-530c-935c-1803ed359510")}catch{}})();var dt="io.modelcontextprotocol/ui",Ee="2026-01-26",Gr="text/html;profile=mcp-app",Fr=Object.freeze({specVersion:Ee,mimeTypes:[Gr]});function I0(e){let t=e.clientCapabilities.extensions;if(!_(t))return!1;let r=t[dt];if(r===void 0)return!1;if(!_(r))throw new p("Invalid MCP Apps client capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[dt]:Fr}}});let o=r.mimeTypes,n=r.specVersion;if(!Array.isArray(o)||!o.includes(Gr)||n!==void 0&&n!==Ee)throw new p("Unsupported MCP Apps client capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[dt]:Fr}}});return!0}var Vg={csp:{connectDomains:[],resourceDomains:[],frameDomains:[]},permissions:{},prefersBorder:!0},Ur=Object.freeze([{id:"context",name:"Context explorer",description:"Inspect bounded project context, provenance, omissions, and token accounting.",toolName:"pm_context",uri:"ui://pm/context.html"},{id:"graph",name:"Relationship graph",description:"Explore typed relationships, explaining paths, and graph-governance evidence.",toolName:"pm_graph",uri:"ui://pm/graph.html"},{id:"plan",name:"Plan and milestone view",description:"Review durable plan steps, dependencies, decisions, discoveries, and validation state.",toolName:"pm_plan",uri:"ui://pm/plan.html"},{id:"assurance",name:"Assurance dashboard",description:"Inspect validation verdicts, evidence, omissions, and actionable recovery paths.",toolName:"pm_validate",uri:"ui://pm/assurance.html"},{id:"operations",name:"Long-operation view",description:"Inspect durable test and operation results without creating a second task store.",toolName:"pm_test",uri:"ui://pm/operations.html"}].map(e=>({...e,toolMeta:{resourceUri:e.uri,visibility:["model","app"]},resourceMeta:Vg})));function R0(e){return Ur.find(t=>t.uri===e)}function P0(e){let t=new Map(Ur.map(r=>[r.toolName,r]));return e.map(r=>{let o=t.get(r.name);return o?{...r,_meta:{...r._meta,ui:o.toolMeta}}:{...r}})}function jr(e){return e.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function M0(e){let t=jr(e.name),r=jr(e.description),o=JSON.stringify({name:`pm-${e.id}-view`,version:Ee}),n=JSON.stringify(Ee);return`<!doctype html>
|
|
3
3
|
<html lang="en">
|
|
4
4
|
<head>
|
|
5
5
|
<meta charset="utf-8">
|
|
@@ -22,12 +22,12 @@ import{A as Rh,B as Ih,C as pk,D as mk,a as as,b as cs,c as ds,d as ls,e as rk,f
|
|
|
22
22
|
(()=>{"use strict";const MAX=24000,status=document.querySelector("#status"),result=document.querySelector("#result"),input=document.querySelector("#input"),pending=new Map();let nextId=1;const render=(node,value)=>{let text;try{text=typeof value==="string"?value:JSON.stringify(value,null,2)}catch{text="Result could not be serialized."}if(text.length>MAX)text=text.slice(0,MAX)+"\\n\\n[View truncated at "+MAX+" characters; use the authoritative pm tool with a cursor or narrower projection.]";node.textContent=text};const send=(message)=>window.parent.postMessage(message,"*");window.addEventListener("message",event=>{if(event.source!==window.parent||!event.data||event.data.jsonrpc!=="2.0")return;const message=event.data;if(message.id!==undefined&&pending.has(message.id)){pending.get(message.id)(message);pending.delete(message.id);return}if(message.method==="ui/notifications/tool-input"||message.method==="ui/notifications/tool-input-partial"){render(input,message.params?.arguments??message.params);status.textContent="Input received"}else if(message.method==="ui/notifications/tool-result"){render(result,message.params);status.textContent="Current tool result"}else if(message.method==="ui/notifications/tool-cancelled"){status.textContent="Tool call cancelled";status.classList.add("notice")}else if(message.method==="ui/notifications/host-context-changed"&&message.params?.theme){document.documentElement.style.colorScheme=message.params.theme}});const request=(method,params)=>new Promise(resolve=>{const id=nextId++;pending.set(id,resolve);send({jsonrpc:"2.0",id,method,params})});document.querySelector("#copy").addEventListener("click",async()=>{const text=result.textContent+"\\n\\n"+input.textContent;try{await navigator.clipboard.writeText(text);status.textContent="Visible evidence copied"}catch{status.textContent="Clipboard permission unavailable";status.classList.add("notice")}});request("ui/initialize",{appInfo:${o},appCapabilities:{},protocolVersion:${n}}).then(message=>{if(message.error){status.textContent="Host rejected MCP App initialization";status.classList.add("notice");return}send({jsonrpc:"2.0",method:"ui/notifications/initialized"});status.textContent="Connected \u2014 awaiting authoritative result"})})();
|
|
23
23
|
</script>
|
|
24
24
|
</body>
|
|
25
|
-
</html>`}import{createHash as
|
|
26
|
-
`)).digest("hex");o.set(a.name,{uri:`skill://${a.name}/SKILL.md`,frontmatter:u,resources:f,_meta:{contractVersion:1,extensionRevision:
|
|
27
|
-
`)).digest("hex").slice(0,16)}#r(t,r){if(!t)return 0;try{let o=JSON.parse(Buffer.from(t,"base64url").toString("utf8"));return(typeof o!="object"||o===null||!("fingerprint"in o)||o.fingerprint!==this.#t||!("scope"in o)||o.scope!==r||!("offset"in o)||!Number.isInteger(o.offset)||Number(o.offset)<0)&&T("Skill cursor is invalid or stale."),Number(o.offset)}catch(o){if(o instanceof p)throw o;return T("Skill cursor is invalid or stale.")}}#o(t,r){return Buffer.from(JSON.stringify({fingerprint:this.#t,offset:t,scope:r})).toString("base64url")}static async load(t){let r=await zr(M.join(t.packageRoot,".agents","skills"),"package",t.packageVersion);if(t.workspaceRoot){let o=M.resolve(t.packageRoot,".agents","skills"),n=M.resolve(t.workspaceRoot,".agents","skills");if(n!==o){let i=await zr(n,"workspace",t.packageVersion);for(let[s,a]of i)r.set(s,a)}}return new e(r)}list(t={}){let r=t.limit??k.defaultPageSize;Br.has(r)||T(`Skill list limit must be an integer from 1 to ${k.maxPageSize}.`);let o=this.#r(t.cursor,"skills/list"),n=[...this.#e.values()].sort((c,d)=>c.uri.localeCompare(d.uri)),i=n.slice(o,o+r),s=o+i.length,a=s<n.length;return{skills:i.map(Vr),hasMore:a,...a?{nextCursor:this.#o(s,"skills/list")}:{}}}get(t){let r=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)\/SKILL\.md$/u.exec(t),o=r?this.#e.get(r[1]):void 0;return o||T(`Unknown pm MCP skill: ${t}.`,{field:"uri"}),Vr(o)}read(t){let r=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)\/(.+)$/u.exec(t),o=r?this.#e.get(r[1]):void 0,n=r?.[2]??"",i=o&&n?o.files.get(n):void 0,s=o?.resources.find(d=>d.uri===t);(!o||!i||!s)&&T(`Unknown pm MCP skill resource: ${t}.`,{field:"uri"});let a={digest:s.digest,origin:o._meta.origin,trust:"untrusted"},c=qr(n,i);return c!=="application/octet-stream"?{contents:[{uri:t,mimeType:c,text:i.toString("utf8"),_meta:a}]}:{contents:[{uri:t,mimeType:c,blob:i.toString("base64"),_meta:a}]}}readDirectory(t,r={}){let o=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)(?:\/(.+))?$/u.exec(t),n=o?this.#e.get(o[1]):void 0;n||T(`Unknown pm MCP skill directory: ${t}.`,{field:"uri"});let i=(o?.[2]??"").replace(/\/$/u,""),s=i.length>0?`${i}/`:"",a=`skill://${o[1]}`,c=new Map;for(let C of n.resources){let w=C.uri.slice(`${a}/`.length);if(!w.startsWith(s))continue;let z=w.slice(s.length),[I,...St]=z.split("/"),No=`${a}/${s}${I}`,Lo=n.files.get(`${s}${I}`);c.set(I,{uri:No,name:I,mimeType:St.length>0?"inode/directory":qr(I,Lo)})}i.length>0&&c.size===0&&T(`Unknown pm MCP skill directory: ${t}.`,{field:"uri"});let d=r.limit??k.maxPageSize;Br.has(d)||T(`Skill directory limit must be an integer from 1 to ${k.maxPageSize}.`);let l=this.#r(r.cursor,t),u=[...c.values()].sort((C,w)=>C.uri.localeCompare(w.uri)),f=u.slice(l,l+d),g=l+f.length,h=g<u.length;return{resources:f,hasMore:h,...h?{nextCursor:this.#o(g,t)}:{}}}};(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="38023567-8a5b-5e25-8d71-5112f74d1894")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="76fdc288-42b3-52b9-adc7-81e504f23ae3")}catch{}})();var Xr="https://schema.unbrained.dev/pm/workspace-recipe/v1";function lt(e,t){if(e===null||typeof e=="boolean"||typeof e=="string")return e;if(typeof e=="number"){if(!Number.isFinite(e))throw new Error(`Workspace recipe JSON number must be finite at ${t}`);return e}if(Array.isArray(e))return Object.freeze(e.map((r,o)=>lt(r,`${t}[${o}]`)));if(typeof e!="object"||Object.getPrototypeOf(e)!==Object.prototype&&Object.getPrototypeOf(e)!==null)throw new Error(`Workspace recipe input must contain JSON values at ${t}`);return Object.freeze(Object.fromEntries(Object.entries(e).map(([r,o])=>[r,lt(o,`${t}.${r}`)])))}function Ee(e){if(e.schema!==Xr)throw new Error(`Unsupported workspace recipe schema: ${e.schema}`);let t=At(e);if(e.operations.some(r=>r.action.trim().length===0||r.input===null||Array.isArray(r.input)))throw new Error("Workspace recipe operations require an action and object input");return Object.freeze({...t,operations:Object.freeze(e.operations.map((r,o)=>Object.freeze({action:r.action,input:lt(r.input,`operations[${o}].input`)})))})}async function Yr(e,t){let r=Ee(e);return vt(r,t)}async function Vg(e,t){return Yr(e,async()=>{let r=[];for(let[o,n]of e.operations.entries())r.push(await t(n,o));return r})}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="6e293af6-ee81-59b4-8d80-05e5c20bdcf1")}catch{}})();var Jr="pm.agent-observation/v1",Zr="pm.agent-verdict/v1",Qr="pm.agent-episode/v1";function R(e,t){if(!Number.isSafeInteger(e)||e<=0)throw new Error(`${t} must be a positive safe integer.`)}function x(e,t){if(e.trim().length===0)throw new Error(`${t} must not be empty.`)}function ne(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let t of Object.values(e))ne(t)}return e}function Hg(e){if(e.length===0)throw new Error("observation.reads must declare at least one bounded read.");let t=0;for(let r of e)if(x(r.command,"observation.reads.command"),R(r.budget_tokens,"observation.reads.budget_tokens"),t+=r.budget_tokens,!Number.isSafeInteger(t))throw new Error("observation read ceilings exceed safe integer range.")}function Kg(e){if(e.basis!=="emitted_bytes")throw new Error("observation calibration must use emitted_bytes.");for(let r of e.samples)if(!Number.isSafeInteger(r)||r<0)throw new Error("observation calibration samples must be non-negative safe integers.");if(e.samples.length===0)throw new Error("observation calibration must include at least one sample.");if(R(e.expected_emitted_bytes,"observation.calibration.expected_emitted_bytes"),!Number.isSafeInteger(e.tolerance_bytes)||e.tolerance_bytes<0)throw new Error("observation.calibration.tolerance_bytes must be a non-negative safe integer.");let t=e.samples.reduce((r,o)=>r+o,0)/e.samples.length;if(Math.abs(t-e.expected_emitted_bytes)>e.tolerance_bytes)throw new Error("observation expected_emitted_bytes is outside the calibrated sample tolerance.")}function Wg(e){if(e.length===0)throw new Error("observation.tiers must declare a degradation ladder.");let t=new Set,r=Number.POSITIVE_INFINITY;for(let o of e){if(x(o.id,"observation.tiers.id"),R(o.max_tokens,"observation.tiers.max_tokens"),t.has(o.id))throw new Error(`Duplicate observation tier: ${o.id}.`);if(t.add(o.id),o.max_tokens>r)throw new Error("observation tiers must be ordered from largest to smallest max_tokens.");r=o.max_tokens;let n=new Set;for(let i of o.fields){if(F(i,"observation.tiers.fields"),n.has(i))throw new Error(`Duplicate observation tier field: ${i}.`);n.add(i)}}}function Xg(e){if(e.schema!==Jr)throw new Error(`observation.schema must be ${Jr}.`);return x(e.id,"observation.id"),R(e.version,"observation.version"),Hg(e.reads),Kg(e.calibration),e.corpus_dependence.kind==="bounded"&&(x(e.corpus_dependence.dimension,"observation.corpus_dependence.dimension"),R(e.corpus_dependence.maximum,"observation.corpus_dependence.maximum")),Wg(e.tiers),ne(structuredClone(e))}function j0(e){return{contract_id:e.id,contract_version:e.version,guaranteed_ceiling_tokens:e.reads.reduce((t,r)=>t+r.budget_tokens,0),expected_emitted_bytes:e.calibration.expected_emitted_bytes,expected_tokens:Math.ceil(e.calibration.expected_emitted_bytes/4),tolerance_bytes:e.calibration.tolerance_bytes,calibration_basis:"emitted_bytes",corpus_dependence:e.corpus_dependence}}async function Yg(e,t,r){R(r.budget_tokens,"observation request budget_tokens");let o=[];for(let[n,i]of e.tiers.entries()){o.push(i.id);let s=await t(i),a=Buffer.byteLength(P(s),"utf8"),c=Math.ceil(a/4);if(c<=Math.min(r.budget_tokens,i.max_tokens))return{status:"served",payload:s,receipt:{contract_id:e.id,contract_version:e.version,served_tier:i.id,degraded:n>0,attempted_tiers:o,emitted_bytes:a,estimated_tokens:c,calibration_basis:"emitted_bytes"}}}return{status:"refused",reason:"no_declared_tier_fits_budget",receipt:{contract_id:e.id,contract_version:e.version,served_tier:null,degraded:e.tiers.length>1,attempted_tiers:o,emitted_bytes:null,estimated_tokens:null,calibration_basis:"emitted_bytes"}}}function F(e,t){let r=e.split(".");if(r.some(o=>o.length===0||o==="__proto__"||o==="prototype"||o==="constructor"))throw new Error(`${t} must be a safe, non-empty dot-separated path.`);return r}function eo(e,t){let r=e;for(let o of F(t,"recorded field path")){if(r===null||typeof r!="object"||!Object.hasOwn(r,o))return;r=r[o]}return r}function Jg(e){return`/${F(e,"verdict predicate path").map(t=>t.replaceAll("~","~0").replaceAll("/","~1")).join("/")}`}function Zg(e){if(e.kind!=="field_equals")return;let t;try{t=JSON.stringify(e.expected)}catch{throw new Error(`Expected value for verdict predicate ${e.id} must be JSON serializable.`)}if(t===void 0)throw new Error(`Expected value for verdict predicate ${e.id} must be JSON serializable.`)}function Qg(e){if(e.schema!==Zr)throw new Error(`verdict.schema must be ${Zr}.`);x(e.id,"verdict.id"),R(e.version,"verdict.version");let t=new Set;for(let o of e.predicates){x(o.id,"verdict.predicates.id"),F(o.path,"verdict.predicates.path");let n=o.kind;if(n!=="field_equals"&&n!=="field_present"&&n!=="field_absent")throw new Error(`Unsupported verdict predicate kind for ${o.id}.`);if(t.has(o.id))throw new Error(`Duplicate verdict predicate: ${o.id}.`);Zg(o),t.add(o.id)}if(e.composition.operator!=="all"&&e.composition.operator!=="any")throw new Error("verdict composition operator must be all or any.");if(e.composition.predicate_ids.length!==e.predicates.length)throw new Error("verdict composition must reference every predicate exactly once.");let r=new Set(e.composition.predicate_ids);if(r.size!==e.composition.predicate_ids.length||[...r].some(o=>!t.has(o)))throw new Error("verdict composition contains duplicate or unknown predicate ids.");return ne(structuredClone(e))}function ey(e,t){if(e.predicates.length===0)return{contract_id:e.id,contract_version:e.version,snapshot_id:t.snapshot_id,outcome:"not_applicable",score:null,policy:"verdict_only_no_reward",reason:"no_predicates_declared",predicates:[]};let r=new Map(e.predicates.map(s=>[s.id,s])),o=e.composition.predicate_ids.map(s=>{let a=r.get(s),c=eo(t.state,a.path),d=a.kind==="field_present"?c!==void 0:a.kind==="field_absent"?c===void 0:P(c)===P(a.expected);return{id:s,outcome:d?"satisfied":"violated",evidence_pointer:`${t.snapshot_id}#${Jg(a.path)}`,evidence_digest:It(P(c))}}),n=o.filter(s=>s.outcome==="satisfied").length,i=e.composition.operator==="all"?n===o.length:n>0;return{contract_id:e.id,contract_version:e.version,snapshot_id:t.snapshot_id,outcome:i?"satisfied":"violated",score:n/o.length,policy:"verdict_only_no_reward",predicates:o}}function G0(e){if(e.schema!==Qr)throw new Error(`episode.schema must be ${Qr}.`);if(x(e.id,"episode.id"),R(e.version,"episode.version"),!["benchmark","evaluation","training","scale_transfer"].includes(e.mode))throw new Error("episode.mode is not supported.");if(e.task_item_ids.length===0)throw new Error("episode.task_item_ids must declare at least one pm item.");for(let t of e.task_item_ids)x(t,"episode.task_item_ids");R(e.limits.max_actions,"episode.limits.max_actions"),R(e.limits.max_observations,"episode.limits.max_observations"),R(e.limits.max_tokens_per_observation,"episode.limits.max_tokens_per_observation");for(let t of e.observable_fields)F(t,"episode.observable_fields");for(let t of e.withheld_fields)F(t,"episode.withheld_fields");for(let t of e.observable_fields){let r=e.withheld_fields.find(o=>t===o||t.startsWith(`${o}.`)||o.startsWith(`${t}.`));if(r!==void 0)throw new Error(`Observable field ${t} overlaps withheld field ${r}.`)}for(let t of e.observation.tiers)for(let r of t.fields)if(!e.observable_fields.includes(r))throw new Error(`Observation tier field ${r} is not declared observable.`);return Xg(e.observation),Qg(e.verdict),Ee(e.recipe),ne(structuredClone(e))}function ty(e,t,r){let o=F(t,"observation projection field"),n=e;for(let[i,s]of o.entries()){if(i===o.length-1){r!==void 0&&(n[s]=structuredClone(r));return}let a=n[s];(a===null||typeof a!="object"||Array.isArray(a))&&(n[s]={}),n=n[s]}}function ry(e,t){let r={};for(let o of t)ty(r,o,eo(e,o));return r}async function U0(e,t){let r=[],o=0,n=0,i=!1,s,a={episode:{id:e.id,label:`pm agent environment v${e.version}`},provenance:{role:e.mode,topic:"agent-environment"}},c=await D(a,()=>t.reset(e.recipe));r.push({sequence:1,kind:"reset",state_id:c.state_id});let d=async()=>{if(i)throw new Error("episode is already closed.");if(n>=e.limits.max_observations)throw new Error("episode exceeded limits.max_observations.");n+=1;let u=await t.readRecordedState(),f=await Yg(e.observation,async g=>ry(u.state,g.fields),{budget_tokens:e.limits.max_tokens_per_observation});return r.push({sequence:r.length+1,kind:"observation",state_id:f.receipt.served_tier??u.snapshot_id}),f},l=async(u=!1)=>{if(i&&!u)throw new Error("episode is already closed.");if(n>=e.limits.max_observations)throw new Error("episode exceeded limits.max_observations.");n+=1;let f=await t.readRecordedState(),g=ey(e.verdict,f);return r.push({sequence:r.length+1,kind:"verdict",state_id:f.snapshot_id}),g};return{observe:()=>D(a,d),step:async u=>{if(i)throw new Error("episode is already closed.");if(o>=e.limits.max_actions)throw new Error("episode exceeded limits.max_actions.");o+=1;let f=await D(a,()=>t.execute(u));return r.push({sequence:r.length+1,kind:"action",state_id:f.state_id}),f},score:()=>D(a,l),close:()=>s!==void 0?s:i?Promise.reject(new Error("episode is already closed.")):(i=!0,s=D(a,()=>l(!0)).then(f=>(r.push({sequence:r.length+1,kind:"close",state_id:f.snapshot_id}),{verdict:f,trajectory:ne(structuredClone(r))})).catch(f=>{throw i=!1,f}).finally(()=>{s=void 0}),s)}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="9394fb87-fb36-5886-b262-ce2787326053")}catch{}})();var j="https://schema.unbrained.dev/pm/corpus-shape/v1";function W(e,t){if(!Number.isSafeInteger(e)||e<=0)throw new TypeError(`Corpus shape ${t} must be a positive safe integer`);return e}function ie(e,t){if(!Number.isSafeInteger(e)||e<0)throw new TypeError(`Corpus shape ${t} must be a non-negative safe integer`);return e}function ro(e){if(!(typeof e!="object"||e===null||Object.isFrozen(e))){for(let t of Object.values(e))ro(t);Object.freeze(e)}}function X(e){if(e.schema!==j)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(W(e.hierarchy_depth,"hierarchy_depth"),W(e.hierarchy_fanout,"hierarchy_fanout"),ie(e.age_span_days,"age_span_days"),W(e.history_entries_per_item,"history_entries_per_item"),ie(e.comments_per_100_items,"comments_per_100_items"),ie(e.notes_per_100_items,"notes_per_100_items"),ie(e.learnings_per_100_items,"learnings_per_100_items"),W(e.author_cardinality,"author_cardinality"),W(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 ro(t),t}var Ae=[{kind:"implements",weight:5},{kind:"blocked_by",weight:2},{kind:"discovered_from",weight:2},{kind:"verifies",weight:2},{kind:"supersedes",weight:1},{kind:"related",weight:4}],Y=Object.freeze({scratch:X({schema:j,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:X({schema:j,name:"representative",description:"Medium-lived project with rich evidence and typed lineage.",hierarchy_depth:5,hierarchy_fanout:8,age_span_days:730,history_entries_per_item:12,comments_per_100_items:30,notes_per_100_items:12,learnings_per_100_items:10,edge_kind_mix:Ae,author_cardinality:32,component_count:1,include_cycles:!1,custom_types:["Experiment"],custom_statuses:["review"],terminal_statuses:[],custom_fields:["domain"]}),"deep-graph":X({schema:j,name:"deep-graph",description:"Deep typed relationship graph with deterministic cycles.",hierarchy_depth:16,hierarchy_fanout:2,age_span_days:3650,history_entries_per_item:6,comments_per_100_items:15,notes_per_100_items:8,learnings_per_100_items:8,edge_kind_mix:Ae,author_cardinality:16,component_count:1,include_cycles:!0,custom_types:[],custom_statuses:[],terminal_statuses:[],custom_fields:[]}),"multi-decade":X({schema:j,name:"multi-decade",description:"Thirty-year event history with dense per-item evolution.",hierarchy_depth:6,hierarchy_fanout:6,age_span_days:10958,history_entries_per_item:24,comments_per_100_items:40,notes_per_100_items:20,learnings_per_100_items:16,edge_kind_mix:Ae,author_cardinality:64,component_count:1,include_cycles:!1,custom_types:["Program"],custom_statuses:["archived"],terminal_statuses:["archived"],custom_fields:["portfolio"]}),"disconnected-archive":X({schema:j,name:"disconnected-archive",description:"Multiple disconnected historical project components.",hierarchy_depth:4,hierarchy_fanout:10,age_span_days:7305,history_entries_per_item:8,comments_per_100_items:10,notes_per_100_items:5,learnings_per_100_items:6,edge_kind_mix:Ae,author_cardinality:24,component_count:5,include_cycles:!1,custom_types:["Archive"],custom_statuses:["archived"],terminal_statuses:["archived"],custom_fields:["archive_source"]})});function oy(){return Object.keys(Y).sort().map(e=>Y[e])}function ny(e){let t=e.trim().toLowerCase();if(!Object.hasOwn(Y,t))throw new TypeError(`Unknown corpus shape "${e}". Available: ${Object.keys(Y).join(", ")}`);return Y[t]}var to=new WeakMap;function oo(e,t){if(e===0)return[];let r=to.get(t);r===void 0&&(r=t.edge_kind_mix.flatMap(n=>Array.from({length:n.weight},()=>n.kind)),to.set(t,r));let o=[r[e%r.length]];return t.include_cycles&&e>2&&e%17===0&&o.push("related"),[...new Set(o)]}function iy(e,t,r,o=42){if(ie(t,"item index"),W(r,"item count"),t>=r)throw new RangeError(`Corpus item index ${t} exceeds ${r}`);let n=Math.min(e.component_count,r),i=t%n,s=Math.floor(t/n),a=0,c=1;for(let w=0;w<e.hierarchy_depth;w+=1)a=Math.min(Number.MAX_SAFE_INTEGER,a+c),c=Math.min(Number.MAX_SAFE_INTEGER,c*e.hierarchy_fanout);let d=s%a,l=s-d,u=d===0?void 0:i+(l+Math.floor((d-1)/e.hierarchy_fanout))*n,f=Date.UTC(2026,0,1),g=e.age_span_days*864e5,h=new Date(f+(r===1?0:Math.round(t/(r-1)*g))).toISOString(),C=(t*37+o)%100;return{index:t,id:`pm-s${t.toString(36).padStart(7,"0")}`,...u===void 0?{}:{parent:`pm-s${u.toString(36).padStart(7,"0")}`},component:i,timestamp:h,author:`pm-corpus-agent-${(t+o)%Math.min(e.author_cardinality,r)}`,history_entry_count:e.history_entries_per_item,dependency_kinds:oo(t,e),has_comment:C<e.comments_per_100_items,has_note:C<e.notes_per_100_items,has_learning:C<e.learnings_per_100_items,...e.custom_types.length>0&&t%11===0?{custom_type:e.custom_types[t%e.custom_types.length]}:{},...e.custom_statuses.length>0&&t%13===0?{custom_status:e.custom_statuses[t%e.custom_statuses.length]}:{}}}var ut=class{shape;authors=new Set;components=new Set;depths=new Map;childCounts=new Map;edgeKinds={};expectedEdgeKinds={};annotations={comments:0,notes:0,learnings:0};annotationFields;planMismatches=[];itemCount=0;observedDepth=0;observedFanout=0;historyEntryCount=0;firstTimestamp=null;lastTimestamp=null;constructor(t){this.shape=t,this.annotationFields=[["comments","has_comment",t.comments_per_100_items],["notes","has_note",t.notes_per_100_items],["learnings","has_learning",t.learnings_per_100_items]]}recordMismatch(t,r){t&&this.planMismatches.push(r)}recordEdgeKinds(t,r){for(let o of r)t[o]=(t[o]??0)+1}add(t){this.itemCount+=1,this.authors.add(t.author),this.components.add(t.component),this.recordMismatch(this.depths.has(t.id),`duplicate_id:${t.id}`);let r=1;if(t.parent!==void 0){let o=this.depths.get(t.parent);this.recordMismatch(o===void 0,`parent_missing:${t.parent}`),r=(o??0)+1;let n=(this.childCounts.get(t.parent)??0)+1;this.childCounts.set(t.parent,n),this.observedFanout=Math.max(this.observedFanout,n)}this.depths.set(t.id,r),this.observedDepth=Math.max(this.observedDepth,r),this.historyEntryCount+=t.history_entry_count,this.recordMismatch(t.history_entry_count!==this.shape.history_entries_per_item,"history_entries_per_item:drift"),this.firstTimestamp=this.firstTimestamp===null||t.timestamp<this.firstTimestamp?t.timestamp:this.firstTimestamp,this.lastTimestamp=this.lastTimestamp===null||t.timestamp>this.lastTimestamp?t.timestamp:this.lastTimestamp;for(let[o,n]of this.annotationFields)this.annotations[o]+=Number(t[n]);this.recordEdgeKinds(this.edgeKinds,t.dependency_kinds),this.recordEdgeKinds(this.expectedEdgeKinds,oo(t.index,this.shape))}finish(){let t=Math.min(this.shape.author_cardinality,this.itemCount),r=Math.min(this.shape.component_count,this.itemCount),o=[...this.planMismatches,...this.itemCount===0?["item_count:empty"]:[],...this.authors.size===t?[]:[`author_count:${this.authors.size}!=${t}`],...this.components.size===r?[]:[`component_count:${this.components.size}!=${r}`],...this.observedDepth<=this.shape.hierarchy_depth?[]:[`hierarchy_depth:${this.observedDepth}>${this.shape.hierarchy_depth}`],...this.observedFanout<=this.shape.hierarchy_fanout?[]:[`hierarchy_fanout:${this.observedFanout}>${this.shape.hierarchy_fanout}`]];for(let[s,,a]of this.annotationFields){let c=Math.floor(this.itemCount/100),d=this.itemCount%100,l=c*a+Math.max(0,a+d-100),u=c*a+Math.min(a,d),f=this.annotations[s];(f<l||f>u)&&o.push(`${s}:${f}!in[${l},${u}]`)}let n=new Set([...Object.keys(this.edgeKinds),...Object.keys(this.expectedEdgeKinds)]);for(let s of[...n].sort()){let a=this.edgeKinds[s]??0,c=this.expectedEdgeKinds[s]??0;a!==c&&o.push(`edge_kind:${s}:${a}!=${c}`)}let i=[...new Set(o)];return{shape:this.shape.name,item_count:this.itemCount,author_count:this.authors.size,component_count:this.components.size,hierarchy_depth:this.observedDepth,hierarchy_fanout:this.observedFanout,timestamp_range:{first:this.firstTimestamp,last:this.lastTimestamp},history_entry_count:this.historyEntryCount,annotations:{...this.annotations},edge_kinds:{...this.edgeKinds},matches_declaration:i.length===0,mismatches:i}}};function no(e){return new ut(e)}function sy(e,t){let r=no(e);for(let o of t)r.add(o);return r.finish()}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="48d03e9b-14a4-545c-8e5d-5f5f2092a113")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="dd1a948a-2fa2-5d2e-a41c-31f75297f17e")}catch{}})();async function ay(){let e=Fe(process.cwd(),process.env.PM_PATH);await xt(e,(t,r)=>Nt(t,r,{apply_runtime_defaults:!0}))}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="4534b1c9-de27-5745-88f2-641b00b94714")}catch{}})();async function cy(){await Lt()}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="b84b220f-cad0-5861-b3ed-07453179706e")}catch{}})();var io=["lines","branches","functions","statements"];function dy(e,t){if(typeof t!="object"||t===null||Array.isArray(t))throw new TypeError(`Coverage entry for ${e} must be an object.`)}function ly(e,t,r){if(typeof r!="object"||r===null||Array.isArray(r))throw new TypeError(`Coverage entry ${e} has invalid ${t} counts.`);let o=r;if(typeof o.covered!="number"||typeof o.total!="number"||!Number.isInteger(o.covered)||!Number.isInteger(o.total)||o.covered<0||o.total<o.covered)throw new TypeError(`Coverage entry ${e} has invalid ${t} counts.`);return{covered:o.covered,total:o.total}}function uy(e){if(typeof e!="object"||e===null||Array.isArray(e))throw new TypeError("Coverage summary must be a JSON object.");if(!("total"in e))throw new TypeError("Coverage summary is missing the total entry.");let t=[];for(let[r,o]of Object.entries(e)){dy(r,o);for(let n of io){let i=ly(r,n,o[n]),s=i.total-i.covered;s>0&&t.push({file:r,metric:n,uncovered:s,...i})}}return t}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="aa6b9997-a4c6-5bfb-8804-45b34afd9e01")}catch{}})();var py=["captured_redacted","captured_verbatim"],my=[{label:"home directory",pattern:/(?:\/home\/|\/Users\/)[^/\s"']+/u},{label:"GitHub token",pattern:/\b(?:gh[oprsu]_[A-Za-z0-9_]{20,})\b/u},{label:"npm token",pattern:/\bnpm_[A-Za-z0-9]{20,}\b/u},{label:"private key",pattern:/-----BEGIN (?:RSA |EC |OPENSSH )?PRIVATE KEY-----/u}];function O(e){return typeof e=="string"&&e.trim().length>0}function fy(e,t){if(typeof t!="object"||t===null||Array.isArray(t))return[{boundary_id:e.id,kind:"invalid_fixture",detail:`${e.fixture_path} must contain a JSON object.`}];let r=t,o=[];r.boundary_id!==e.id&&o.push({boundary_id:e.id,kind:"fixture_boundary_mismatch",detail:`${e.fixture_path} names ${String(r.boundary_id)} instead of ${e.id}.`}),(r.version!==1||!py.includes(r.capture_source)||!O(r.capture_provenance)||!Array.isArray(r.redactions)||!r.redactions.every(O)||!("input"in r)||!("observed"in r))&&o.push({boundary_id:e.id,kind:"invalid_fixture",detail:`${e.fixture_path} lacks captured provenance, redaction metadata, input, or observed output.`});let n=JSON.stringify(t);for(let i of my)i.pattern.test(n)&&o.push({boundary_id:e.id,kind:"unsafe_fixture",detail:`${e.fixture_path} contains a possible ${i.label}.`});return o}function _y(e,t){let r=Date.parse(e.waiver_expires_at),o=O(e.waiver_reason)&&O(e.waiver_owner)&&e.waiver_expires_at.endsWith("Z")&&Ot(e.waiver_expires_at)&&Number.isFinite(r);return{captured:0,waived:o&&r>=t?1:0,findings:o?r<t?[{boundary_id:e.id,kind:"expired_waiver",detail:`Boundary ${e.id} waiver expired at ${e.waiver_expires_at}.`}]:[]:[{boundary_id:e.id,kind:"invalid_waiver",detail:`Boundary ${e.id} waiver requires reason, owner, and an RFC 3339 UTC expiry.`}]}}function hy(e,t,r){if(!O(e.id)||!O(e.producer)||!O(e.consumer)||!O(e.format))return{captured:0,waived:0,findings:[{boundary_id:O(e.id)?e.id:"unknown",kind:"invalid_boundary",detail:"Each boundary requires non-empty id, producer, consumer, and format."}]};if("fixture_path"in e){let o=t[e.fixture_path],n=O(e.fixture_path)&&e.fixture_path in t?fy(e,o):[{boundary_id:e.id,kind:"missing_fixture",detail:`Boundary ${e.id} fixture ${String(e.fixture_path)} is missing.`}];return{captured:n.length===0?1:0,waived:0,findings:n}}return _y(e,r)}function nx(e,t,r=new Date){let o=[];if(e.version!==1||!O(e.inventory_scope)||!Array.isArray(e.boundaries))return{ok:!1,boundary_count:0,captured_count:0,waived_count:0,findings:[{boundary_id:"registry",kind:"invalid_registry",detail:"Boundary registry requires version 1, inventory_scope, and boundaries."}]};let n=new Set,i=0,s=0;for(let a of e.boundaries){if(typeof a!="object"||a===null||Array.isArray(a)){o.push({boundary_id:"unknown",kind:"invalid_boundary",detail:"Each boundary must be a JSON object."});continue}let c=a,d=O(c.id)?c.id:void 0;if(d!==void 0&&n.has(d)){o.push({boundary_id:d,kind:"duplicate_boundary",detail:`Boundary ${d} is inventoried more than once.`});continue}d!==void 0&&n.add(d);let l=hy(c,t,r.getTime());i+=l.captured,s+=l.waived,o.push(...l.findings)}return o.sort((a,c)=>a.boundary_id!==c.boundary_id?a.boundary_id.localeCompare(c.boundary_id):a.kind.localeCompare(c.kind)),{ok:o.length===0,boundary_count:e.boundaries.length,captured_count:i,waived_count:s,findings:o}}import J from"node:fs";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]="9c9e4ac4-51b2-5920-bb27-a4f239f6b429")}catch{}})();var so=300*1e3,gy=3;function dx(e){return(e?.trim()||"development").replace(/[^a-zA-Z0-9._-]/g,"_").replace(/^\./,"_")}function lx(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 o=pt.join(e,r);J.mkdirSync(o,{recursive:!0});let n=new Date;J.utimesSync(o,n,n);let i=J.readdirSync(e).filter(d=>d!==r).flatMap(d=>{try{return[{name:d,mtimeMs:J.statSync(pt.join(e,d)).mtimeMs}]}catch(l){if(l instanceof Error&&"code"in l&&me(l))return[];throw l}}).sort((d,l)=>l.mtimeMs-d.mtimeMs||d.name.localeCompare(l.name)),s=i.filter(d=>n.getTime()-d.mtimeMs<so),a=Math.max(0,gy-1-s.length),c=i.filter(d=>n.getTime()-d.mtimeMs>=so).slice(a).map(d=>d.name).sort((d,l)=>d.localeCompare(l));for(let d of c)J.rmSync(pt.join(e,d),{recursive:!0,force:!0,maxRetries:3,retryDelay:50});return{retained:r,removed:c}}import ao from"node:fs";import Oe from"node:path";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="7ab9180f-dfcb-579d-bc0c-dbba2e4ad77e")}catch{}})();var se="@unbrained/pm-cli",yy=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"]),co=new Set(["--author","--output-budget","--output-format","--output-include","--output-limit","--output-session","--path","--pm-path"]),_t=/\b(\d{4})\.(\d{1,2})\.(\d{1,2})(?:-(\d+))?\b/u,Ie="2026.8.31";function S(e,t){return e.some(r=>t.includes(r.split("=",1)[0]))}function mt(e,t){return["activate","adopt","adopt-all","deactivate","init","install","migrate","reload","uninstall"].includes(t[0]??"")||S(e,["--activate","--adopt","--adopt-all","--deactivate","--fix-managed-state","--init","--install","--output","--reload","--scaffold","--uninstall"])}var by={changelog:(e,t)=>{if(t[0]==="generate")return!S(e,["--check"]);let r=e.indexOf("export");return t[0]==="export"&&(S(e,["--output"])||r>=0&&e[r+1]!==void 0&&!e[r+1].startsWith("-"))},comments:e=>S(e,["--add","--delete","--edit","--file","--stdin"]),config:(e,t)=>(t[0]==="project"||t[0]==="global"?t[1]:t[0])==="set",deps:()=>!1,docs:e=>S(e,["--add","--add-glob","--migrate","--remove"]),duplicates:()=>!1,events:()=>!1,extension:mt,files:(e,t)=>S(e,["--add","--add-glob","--migrate","--remove"])||t[0]==="discover"&&S(e,["--apply"]),health:e=>!S(e,["--check-only","--no-refresh","--skip-vectors"]),learnings:e=>S(e,["--add","--delete","--edit","--file","--stdin"]),merge:(e,t)=>t[0]!=="report",notes:e=>S(e,["--add","--delete","--edit","--file","--stdin"]),package:mt,packages:mt,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]??"")&&!(S(e,["--infer"])&&!S(e,["--apply"])),telemetry:(e,t)=>t.slice(0,2).some(r=>["clear","flush"].includes(r)),templates:(e,t)=>t[0]==="save",test:e=>S(e,["--add","--add-json","--background","--measure","--remove","--resume","--run","--stop"]),validate:e=>S(e,["--auto-fix","--prune-missing"]),vcs:(e,t)=>["abandon","create","merge","propose","ref-create"].includes(t[0]??""),workspace:(e,t)=>t[0]==="snapshot"&&["create","delete","restore"].includes(t[1]??"")};function Re(e){let t=e.match(_t);return t?[Number(t[1]),Number(t[2]),Number(t[3]),Number(t[4]??0)]:null}function G(e,t){let r=Re(e),o=Re(t);if(!r||!o)return null;for(let n=0;n<r.length;n+=1){let i=r[n]-o[n];if(i!==0)return Math.sign(i)}return 0}function ve(e){return G(e,Ie)!==-1?3:2}function Cy(e,t){if(t===3)return e.filter(r=>r.history_epoch_compatible===!1).map(r=>({...r,declaration:r.declaration??r.version})).sort((r,o)=>G(r.version,o.version))[0]}function ft(e){try{let t=JSON.parse(ao.readFileSync(e,"utf8"));return typeof t=="object"&&t!==null&&!Array.isArray(t)?t:null}catch{return null}}function Ty(e){let t=[...e.matchAll(/(<=|<)\s*v?(\d{4}\.\d{1,2}\.\d{1,2}(?:-\d+)?)/gu)].map(o=>({inclusive:o[1]==="<=",version:o[2]})),r=e.match(/\b\d{4}\.\d{1,2}\.\d{1,2}(?:-\d+)?\s+-\s+v?(\d{4}\.\d{1,2}\.\d{1,2}(?:-\d+)?)/u);return r?[...t,{inclusive:!0,version:r[1]}]:t}function wy(e){let t=e.split("||").map(r=>Ty(r));return{bounded:t.some(r=>r.length>0),compatible:t.some(r=>r.every(o=>{let n=G(Ie,o.version);return n!==null&&(o.inclusive?n!==1:n===-1)}))}}function Sy(e){return["dependencies","devDependencies","optionalDependencies","peerDependencies"].flatMap(t=>{let r=e[t];if(typeof r!="object"||r===null)return[];let o=r[se],n=typeof o=="string"?o.trim():"",i=/^[<!]/u.test(n)?void 0:n.match(_t)?.[0];if(!i)return[];let s=/^(?:=|v)?\d{4}\.\d{1,2}\.\d{1,2}(?:-\d+)?$/u.test(n),a=wy(n);return[{version:i,constraint:s?"exact":a.bounded?"range":"minimum",...s?{}:{declaration:n},history_epoch_compatible:s?G(i,Ie)!==-1:a.compatible}]})}function Ey(e){let r=ft(Oe.join(e,"package-lock.json"))?.packages;if(typeof r!="object"||r===null)return;let o=r["node_modules/@unbrained/pm-cli"];if(typeof o!="object"||o===null)return;let n=o.version;return typeof n=="string"?n:void 0}function Ay(e,t){try{let r=ao.readFileSync(Oe.join(e,t),"utf8").split(/\r?\n/u),o=r.findIndex(c=>c.includes(se));if(o<0)return;let n=r[o].match(/^\s*/u)[0].length,i=[r[o]];for(let c=o+1;c<r.length;c+=1){let d=r[c],l=d.trim(),u=d.match(/^\s*/u)[0].length;if(l.length>0&&u<=n)break;i.push(d)}return i.join(`
|
|
28
|
-
`).match(/^\s*version(?::\s*|\s+)["']?(\d{4}\.\d{1,2}\.\d{1,2}(?:-\d+)?)/mu)?.[1]??i[0].match(_t)?.[0]}catch{return}}function vy(e){let t=[],r=ft(Oe.join(e,"package.json"));r&&t.push(...Sy(r).map(s=>({...s,source:"package.json"})));let n=ft(Oe.join(e,"node_modules","@unbrained","pm-cli","package.json"))?.version;typeof n=="string"&&Re(n)&&t.push({version:n,source:"installed-package",constraint:"exact",history_epoch_compatible:ve(n)===3});let i=Ey(e);i&&Re(i)&&t.push({version:i,source:"package-lock.json",constraint:"exact",history_epoch_compatible:ve(i)===3});for(let s of["pnpm-lock.yaml","yarn.lock"]){let a=Ay(e,s);a&&t.push({version:a,source:s,constraint:"exact",history_epoch_compatible:ve(a)===3})}return t}function lo(e){for(let t=0;t<e.length;t+=1){let r=e[t];if(co.has(r)){t+=1;continue}if(!r.startsWith("-"))return{command:r.toLowerCase(),index:t}}}function Oy(e){let t=lo(e);if(!t||S(e,["--help","-h","--dry-run"]))return!1;let{command:r,index:o}=t,n=[];for(let s=o+1;s<e.length;s+=1){let a=e[s];if(co.has(a)){s+=1;continue}a.startsWith("-")||n.push(a.toLowerCase())}let i=by[r];return i?i(e,n):yy.has(r)}function Ry(e){let t=lo(e.argv)?.command,r=Oy(e.argv),o=vy(e.projectRoot).filter(l=>G(l.version,e.executingVersion)!==null).sort((l,u)=>G(u.version,l.version)),n=o[0],i=n!==void 0&&G(e.executingVersion,n.version)===-1,s=ve(e.executingVersion),a=Cy(o,s),c=r&&a!==void 0,d=i&&!r?{code:"project_runtime_stale_read",executing_version:e.executingVersion,project_version:n.version,source:n.source,message:"This read is using an older pm runtime than the project requires.",next_steps:[`Run the command through the project's installed ${se} ${n.version}.`,"Install the project dependencies with its declared package manager if the local executable is missing."]}:void 0;return{compatible:!r||!i&&!c||e.allowStale===!0,executing_version:e.executingVersion,...n?{project_version:n.version,source:n.source}:{},...t?{command:t}:{},mutating:r,stale:i,history_epoch_incompatible:c,writer_item_hash_version:s,...a?{incompatible_project_version:a.declaration,incompatible_source:a.source}:{},...d?{warning:d}:{},override_applied:r&&(i||c)&&e.allowStale===!0}}function hx(e){let t=Ry(e);if(t.compatible)return t;throw t.history_epoch_incompatible?new b(`pm ${t.executing_version} cannot write item-hash epoch ${t.writer_item_hash_version} into a project pinned to pm ${t.incompatible_project_version}.`,L.CONFLICT,{code:"project_runtime_history_epoch_incompatible",reason:t.incompatible_source,why:`The pinned runtime cannot read item_hash_version ${t.writer_item_hash_version}; allowing the write would break its health and validation gates.`,nextSteps:[`Upgrade the project's ${se} pin to ${Ie} or newer before mutating tracker history.`,"For an intentional coordinated migration only, set PM_ALLOW_STALE_CLI=1 for this invocation and record why.","Read-only commands remain available without an override."]}):new b(`pm ${t.executing_version} cannot mutate a project pinned to newer pm ${t.project_version}.`,L.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 ${se} ${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 Iy}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="eb475dcd-d16c-51fb-b248-b14cf5ade4de")}catch{}})();var ht=1;function Z(e){e?.throwIfAborted()}function U(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship graph ${t} must be non-empty`);return e.trim()}function Q(e,t,r={}){let o=Date.parse(r.createdAt??new Date().toISOString());if(!Number.isFinite(o))throw new TypeError("Relationship graph createdAt must be a valid timestamp");let n=e.nodes(),i=e.edges(),s=t.list();return Object.freeze({version:ht,fingerprint:Iy("sha256").update(P({nodes:n,edges:i,kinds:s})).digest("hex"),created_at:new Date(o).toISOString(),nodes:n,edges:i,kinds:s})}function Py(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ce(e){if(!Py(e))throw new TypeError("Relationship graph snapshot must be an object");if(e.version!==ht)throw new TypeError(`Unsupported relationship graph snapshot version: ${String(e.version)}`);if(!Array.isArray(e.nodes)||e.nodes.some(n=>typeof n!="string"))throw new TypeError("Relationship graph snapshot nodes must be strings");if(!Array.isArray(e.edges)||!Array.isArray(e.kinds))throw new TypeError("Relationship graph snapshot edges and kinds must be arrays");if(typeof e.created_at!="string"||!Number.isFinite(Date.parse(e.created_at)))throw new TypeError("Relationship graph snapshot created_at must be valid");if(typeof e.fingerprint!="string")throw new TypeError("Relationship graph snapshot fingerprint must be a string");let t=new je([]);for(let n of e.kinds)t.register(n);let r=new V(e.nodes,e.edges,t),o=Q(r,t,{createdAt:e.created_at});if(o.fingerprint!==e.fingerprint)throw new TypeError("Relationship graph snapshot fingerprint mismatch");return{snapshot:o,registry:t,graph:r}}async function N(e,t){U(e.name,"adapter name");let r=U(t.workspace,"workspace");Z(t.signal);let o=await e.read({...t,workspace:r});return Z(t.signal),o===null?null:ce(o)}async function Pe(e,t){let r=U(t.workspace,"workspace"),o=ce(t.snapshot).snapshot,n=await N(e,{workspace:r,signal:t.signal});if(n?.snapshot.fingerprint===o.fingerprint)return{adapter:e.name,workspace:r,disposition:"current",fingerprint:o.fingerprint,previous_fingerprint:n.snapshot.fingerprint,node_count:o.nodes.length,edge_count:o.edges.length};if(Z(t.signal),await e.replace({workspace:r,signal:t.signal,snapshot:o,expected_fingerprint:n?.snapshot.fingerprint??null}),(await N(e,{workspace:r,signal:t.signal}))?.snapshot.fingerprint!==o.fingerprint)throw new Error(`Relationship graph adapter "${e.name}" did not expose the replaced snapshot`);return{adapter:e.name,workspace:r,disposition:"written",fingerprint:o.fingerprint,...n?{previous_fingerprint:n.snapshot.fingerprint}:{},node_count:o.nodes.length,edge_count:o.edges.length}}function ky(e,t={}){let r=e.map(ce),o=new Map;for(let s of r)for(let a of s.snapshot.kinds){let c=o.get(a.kind);if(c&&P(c)!==P(a))throw new TypeError(`Conflicting federated relationship kind: ${a.kind}`);o.set(a.kind,a)}let n=new je([...o.values()].sort((s,a)=>s.kind.localeCompare(a.kind))),i=new V(new Set(r.flatMap(s=>[...s.snapshot.nodes])),r.flatMap(s=>[...s.snapshot.edges]),n);return Q(i,n,t)}var ae=class{name;#e=new Map;constructor(t="memory"){this.name=U(t,"adapter name")}async read(t){Z(t.signal);let r=this.#e.get(U(t.workspace,"workspace"));return r?structuredClone(r):null}async replace(t){Z(t.signal);let r=U(t.workspace,"workspace"),o=this.#e.get(r);if(t.expected_fingerprint!==void 0&&(o?.fingerprint??null)!==t.expected_fingerprint)throw new Error(`Relationship graph adapter conflict for ${r}`);this.#e.set(r,structuredClone(ce(t.snapshot).snapshot))}async clear(t){Z(t.signal);let r=U(t.workspace,"workspace"),o=this.#e.get(r);if(t.expected_fingerprint!==void 0&&(o?.fingerprint??null)!==t.expected_fingerprint)throw new Error(`Relationship graph adapter conflict for ${r}`);this.#e.delete(r)}};(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="9a60b8c0-37d1-5c04-a079-e1351caf6e09")}catch{}})();function uo(e,t){if(!Number.isInteger(e)||e<1)throw new TypeError(`Relationship graph ${t} must be a positive integer`);return e}function My(e){let t=uo(e.nodeCount,"nodeCount"),r=uo(e.edgeStride??1,"edgeStride"),o=e.topology??"chain";if(!["chain","star","disconnected"].includes(o))throw new TypeError(`Unsupported relationship graph topology: ${o}`);let n=(e.kind??"related").trim(),i=(e.idPrefix??"node").trim();if(!n||!i)throw new TypeError("Relationship graph kind and idPrefix must be non-empty");let s=o==="disconnected"?0:Math.floor((t-1)/r);return{node_count:t,edge_count:s,edge_basis:"fixture_generated",nodes:{*[Symbol.iterator](){for(let a=0;a<t;a+=1)yield`${i}-${a}`}},edges:{*[Symbol.iterator](){if(o!=="disconnected")for(let a=r;a<t;a+=r)yield{source:`${i}-${o==="star"?0:a-r}`,target:`${i}-${a}`,kind:n}}}}}function B(e,t){if(!e)throw new Error(`Relationship graph adapter conformance: ${t}`)}async function po(e,t={}){let r=t.workspace?.trim()||"pm-graph-conformance",o=Rt(),n=Q(new V(["a","b"],[{source:"a",target:"b",kind:"related"}],o),o,{createdAt:"2026-01-01T00:00:00.000Z"}),i=Q(new V(["a","b","c"],[{source:"a",target:"b",kind:"related"},{source:"b",target:"c",kind:"blocked_by"}],o),o,{createdAt:"2026-01-02T00:00:00.000Z"}),s=[];B(await N(e,{workspace:r})===null,"workspace must start empty"),s.push({name:"empty-read",passed:!0});let a=await Pe(e,{workspace:r,snapshot:n});B(a.disposition==="written","first sync must write"),s.push({name:"atomic-replace",passed:!0}),(await e.read({workspace:r})).nodes.push("mutated-reader-copy"),B((await N(e,{workspace:r}))?.snapshot.nodes.length===2,"reads must not mutate stored state"),s.push({name:"read-isolation",passed:!0}),B((await Pe(e,{workspace:r,snapshot:n})).disposition==="current","identical sync must be idempotent"),s.push({name:"idempotent-sync",passed:!0}),await e.replace({workspace:r,snapshot:i,expected_fingerprint:n.fingerprint}),B((await N(e,{workspace:r}))?.snapshot.fingerprint===i.fingerprint,"replacement must become visible"),s.push({name:"replacement-visibility",passed:!0});let d=!1;try{await e.replace({workspace:r,snapshot:n,expected_fingerprint:n.fingerprint})}catch{d=!0}return B(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}),B(await N(e,{workspace:r})===null,"clear must remove the workspace"),s.push({name:"clear",passed:!0})),{adapter:e.name,workspace:r,cases:Object.freeze(s),clear_supported:e.clear!==void 0}}function xy(e){return po(new ae,e?{workspace:e}:{})}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="c59413c4-8955-5560-8bc6-f1dc9c8c5042")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="d45a8203-4501-5797-a6cc-a2e7844adec9")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="4d2bee02-8003-578c-9d25-32755534f8ff")}catch{}})();var gt=2,Ny=["self_reported","independent_transport"];function ke(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function de(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`${t} must be a non-empty string`);return e.trim()}function mo(e,t,r=!1){if(!Array.isArray(e)||e.length===0)throw new TypeError(`${t} must be a non-empty string array`);return e.map((o,n)=>{let i=de(o,`${t}[${String(n)}]`);return r?o:i})}function yt(e,t){return e===void 0?void 0:de(e,t)}function Ly(e,t){if(e===void 0)return;if(!ke(e)||Object.keys(e).length===0)throw new TypeError(`${t} must be a non-empty object`);let r=Object.entries(e).map(([o,n])=>{if(o.length===0||o.split(".").some(i=>i.length===0))throw new TypeError(`${t} must use dot-separated own-property paths`);if(n!==null&&typeof n!="string"&&typeof n!="boolean"&&(typeof n!="number"||!Number.isFinite(n)))throw new TypeError(`${t} values must be JSON primitives`);return[o,n]});return Object.fromEntries(r)}function Dy(e,t,r,o,n,i){if(o==="refusal"){if(Ke(r)||n===void 0||i===void 0)throw new TypeError(`${e} refusal steps require a non-success exit, error code, and refusal surface`);return}if(n!==void 0||i!==void 0)throw new TypeError(`${e} only refusal steps may declare expected_error_code or expected_refusal_surface`);let s=kt(t);if(s===void 0)throw new TypeError(`${e}.args must identify a command after global flags`);let a=t[s].trim().toLowerCase();if(a==="history"){let l=Mt(t.slice(s+1));l!==void 0&&(a=De(`history ${l}`))}let c=Vt(a);if(!Ke(r)||r!==0&&!c?.exit_codes.some(l=>l===r))throw new TypeError(`${e} successful output must use exit code 0 or a command-declared successful effect exit`);let d=sr(a).kind;if(o!==d)throw new TypeError(`${e} expected ${o}, but ${a} declares ${d}`)}function $y(e,t,r){if(!ke(e))throw new TypeError(`tasks.${t}.steps[${String(r)}] must be an object`);let o=`tasks.${t}.steps[${String(r)}]`,n=de(e.id,`${o}.id`),i=mo(e.args,`${o}.args`,!0),s=e.expected_exit_code;if(typeof s!="number"||!Number.isSafeInteger(s))throw new TypeError(`${o}.expected_exit_code must be a safe integer`);let a=e.expected_output_kind;if(a!=="refusal"&&!ir.includes(a))throw new TypeError(`${o}.expected_output_kind is unsupported`);let c=a,d=e.expected_accounting_mode;if(!Ny.includes(d))throw new TypeError(`${o}.expected_accounting_mode is unsupported`);let l=d;if(l==="independent_transport"&&c!=="refusal")throw new TypeError(`${o} independent_transport accounting is supported only for refusal steps`);let u=mo(e.required_fields,`${o}.required_fields`);if(u.some(w=>w.split(".").some(z=>z.length===0)))throw new TypeError(`${o}.required_fields must contain dot-separated own-property paths`);let f=Ly(e.expected_field_values,`${o}.expected_field_values`),g=yt(e.expected_error_code,`${o}.expected_error_code`),h=yt(e.expected_refusal_surface,`${o}.expected_refusal_surface`),C=yt(e.recovery_for,`${o}.recovery_for`);return Dy(o,i,s,c,g,h),{id:n,args:i,expected_exit_code:s,expected_output_kind:c,expected_accounting_mode:l,required_fields:u,...f?{expected_field_values:f}:{},...g?{expected_error_code:g}:{},...h?{expected_refusal_surface:h}:{},...C?{recovery_for:C}:{}}}function Fy(e,t){if(!ke(e))throw new TypeError(`tasks[${String(t)}] must be an object`);let r=de(e.id,`tasks[${String(t)}].id`),o=de(e.description,`tasks.${r}.description`);if(!Array.isArray(e.steps)||e.steps.length===0)throw new TypeError(`tasks.${r}.steps must be a non-empty array`);let n=e.steps.map((s,a)=>$y(s,r,a)),i=new Map;for(let s of n){if(i.has(s.id))throw new TypeError(`tasks.${r} contains duplicate step id ${s.id}`);if(s.recovery_for!==void 0&&(i.get(s.recovery_for)?.expected_output_kind!=="refusal"||s.expected_output_kind==="refusal"))throw new TypeError(`tasks.${r}.${s.id} recovery_for must reference an earlier refusal and declare successful output`);i.set(s.id,s)}if(n.at(-1)?.expected_output_kind==="refusal")throw new TypeError(`tasks.${r} completed task must terminate with successful output`);for(let s of n)if(s.expected_output_kind==="refusal"&&!n.some(a=>a.recovery_for===s.id))throw new TypeError(`tasks.${r}.${s.id} refusal must have a later successful recovery_for step`);return{id:r,description:o,steps:n}}function Vx(e){if(!ke(e))throw new TypeError("agent-task transcript corpus must be an object");if(e.version!==gt)throw new TypeError(`agent-task transcript corpus version must be ${String(gt)}`);if(!Array.isArray(e.tasks)||e.tasks.length===0)throw new TypeError("agent-task transcript corpus tasks must be non-empty");let t=e.tasks.map((o,n)=>Fy(o,n)),r=new Set;for(let o of t){if(r.has(o.id))throw new TypeError(`duplicate agent-task transcript id ${o.id}`);r.add(o.id)}return{version:gt,tasks:t}}import{createHash as fo}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="41ef1735-c534-5b84-8367-1278007cb7c6")}catch{}})();function _o(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship backfill ${t} must be non-empty`);return e.trim()}function Xx(e,t){let r=_o(t.migrationId,"migrationId"),o=_o(t.author,"author"),n=Date.parse(t.timestamp);if(!Number.isFinite(n))throw new TypeError("Relationship backfill timestamp must be valid");let i=new Date(n).toISOString(),s=He(e,void 0,t.registry),a=s.graph.nodes(),c=s.graph.edges().map(f=>{let g=fo("sha256").update(JSON.stringify([r,f.kind,f.source,f.target,f.createdAt??null,f.author??null,f.payload??null])).digest("hex").slice(0,24);return Object.freeze({eventId:`backfill:${r}:${g}`,relationshipId:`migration:${r}:${g}`,action:"add",edge:f,author:o,timestamp:i,reason:`Backfill ${r} from legacy item metadata`})}),d=fo("sha256").update(JSON.stringify({migrationId:r,nodes:a,events:c})).digest("hex"),l=new Set([...t.existingEventIds??[]].filter(f=>typeof f=="string").map(f=>f.trim()).filter(Boolean)),u=c.filter(f=>!l.has(f.eventId));return Object.freeze({migration_id:r,fingerprint:d,nodes:a,events:Object.freeze(u),edge_count:c.length,skipped_existing_count:c.length-u.length,duplicate_dependency_rows:s.duplicateRows.length,dangling_reference_count:s.dangling.active.length+s.dangling.legacy_terminal.length})}import*as ho from"node:module";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="81067f95-115f-5aee-b649-55d86c3915d4")}catch{}})();var le=["suggested_retry","candidate_command","example","next_step","migration_hint","restore_with"],bt={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"}},Jx=Object.freeze(Object.keys(bt));function go(e){if(Object.hasOwn(bt,e))return bt[e]}var jy=new Set([..."=([{,:;!?&|+-*%^~<>","=>"]);function ee(e,t){return e<t?-1:e>t?1:0}function Gy(e,t){let r=e[t],o=t+1,n="";for(;o<e.length&&e[o]!==r;)e[o]==="\\"?o+=2:(n+=e[o],o+=1);return e[o]===r&&(o+=1),{next:o,value:n}}function Uy(e){return e===void 0||e.kind==="punctuator"&&jy.has(e.value)||e.kind==="identifier"&&["return","case","throw","else","yield"].includes(e.value)}function By(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
|
|
30
|
-
`&&t.push(r+1);return t}function
|
|
31
|
-
`)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="6ecdd8cf-3153-5ed9-abd4-e8a73da6662a")}catch{}})();function ib(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 sb(e){return[e.exit_code!==L.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 ${L.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."},...ib(e)]}function uN(e){let t=[],r=new Set,o=0;e.length===0&&t.push({code:"empty_corpus",probe_id:"corpus",detail:"At least one real refusal observation is required."});for(let n of e){if(r.has(n.probe_id)){t.push({code:"duplicate_probe",probe_id:n.probe_id,detail:`${n.probe_id} was supplied more than once.`});continue}r.add(n.probe_id);let i=t.length;for(let s of sb(n))s!==void 0&&t.push(s);t.length===i&&(o+=1)}return t.sort((n,i)=>n.probe_id!==i.probe_id?n.probe_id.localeCompare(i.probe_id):n.code.localeCompare(i.code)),{ok:t.length===0,probe_count:r.size,closed_probe_count:o,closure_fraction:r.size===0?0:o/r.size,findings:t}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="e24f17e6-8b47-5dc0-b245-d6625b4fb60e")}catch{}})();var Co="not-a-declared-action";function ab(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 ue(e){return e.replaceAll(/[^a-z0-9]+/gu,"-").replaceAll(/^-|-$/gu,"")}function bN(e=ze.filter(t=>Dt.some(r=>r.command===t.command&&r.disposition!=="package_owned"))){let t=new Set(e.filter(({command:r})=>!r.includes(" ")).map(({command:r})=>ue(r)));return e.flatMap(r=>r.slots.flatMap((o,n)=>{if(!o.required)return[];let i=r.command.split(" "),s=ue(r.command),a=i.length>1&&t.has(s)?i.map(ue).join("--"):s,c=te(r.command).flatMap(l=>l.required?[l.flag,...l.value_name?["example"]:[]]:[]),d=qe.some(l=>l.command===r.command);return[{probe_id:`required-argument-${a}-${ue(o.name)}`,command:r.command,refusal_args:[...i,...r.slots.slice(0,n).map(l=>ab(r.command,l)),...c],recovery_args:[...i,"--help"],error_code:d&&!r.command.startsWith("assurance ")?"invalid_argument_value":/^extension (?:activate|adopt|deactivate|uninstall)$/u.test(r.command)?"missing_lifecycle_target":"missing_required_argument",missing_argument:o.name,missing_argument_index:n}]})).sort((r,o)=>r.probe_id.localeCompare(o.probe_id))}function cb(e){switch(e){case"assurance":case"workspace snapshot":return qe.filter(({parent:t})=>t===e).map(({action:t})=>t);case"graph":return Ue;case"merge":return Be;case"plan":return We;case"profile":return Xe;case"schema":return Ft;default:throw new Error(`Required positional action family ${e} has no authoritative value domain.`)}}function CN(e=ze){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-${ue(t)}`,command:t,refusal_args:[...r,Co],recovery_args:[...r,"--help"],error_code:"unknown_subcommand",rejected_value:Co,allowed_values:[...cb(t)].sort()}}).sort((t,r)=>t.probe_id.localeCompare(r.probe_id))}function db(e,t){let r=[...t].sort();return e.length===t.length&&[...e].sort().every((o,n)=>o===r[n])}function lb(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&&!db(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 TN(e,t){let r=new Map(e.map(s=>[s.probe_id,s])),o=new Map(t.map(s=>[s.probe_id,s])),n=[...e.flatMap(s=>lb(s,o.get(s.probe_id))),...t.filter(s=>!r.has(s.probe_id)).map(s=>({code:"unexpected_refusal_probe",probe_id:s.probe_id,detail:`${s.probe_id} has no declared grammar refusal contract.`}))];n.sort((s,a)=>s.probe_id.localeCompare(a.probe_id)||s.code.localeCompare(a.code));let i=new Set(n.map(({probe_id:s})=>s));return{ok:n.length===0,probe_count:e.length,closed_probe_count:e.filter(({probe_id:s})=>!i.has(s)).length,findings:n}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="5053cc84-63e5-50d3-9a4c-00c2a485ed69")}catch{}})();var Tt=[{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 SN(){return Tt.map(e=>({...e}))}function ub(e,t){let r=[];t.error_code!==e.expected_error_code&&r.push({code:"error_code_mismatch",probe_id:e.probe_id,detail:`Expected ${e.expected_error_code}, received ${t.error_code}.`}),t.exit_code!==e.expected_exit_code&&r.push({code:"exit_code_mismatch",probe_id:e.probe_id,detail:`Expected exit ${e.expected_exit_code}, received ${t.exit_code}.`}),t.recovery_kind!==e.recovery_kind&&r.push({code:"recovery_kind_mismatch",probe_id:e.probe_id,detail:`Expected ${e.recovery_kind}, received ${t.recovery_kind}.`});let o=t.suggested_retry_args.indexOf("init"),n=o===0||o===2&&t.suggested_retry_args[0]==="--pm-path"&&t.suggested_retry_args[1]?.length>0;return e.recovery_kind==="initialize"&&!n&&r.push({code:"missing_init_recovery",probe_id:e.probe_id,detail:"Missing and uninitialized roots must emit a tokenized init retry."}),(t.unsafe_init_recommended||e.recovery_kind!=="initialize"&&t.suggested_retry_args.includes("init"))&&r.push({code:"unsafe_init_recovery",probe_id:e.probe_id,detail:"A tracker root that cannot be initialized safely must not recommend initialization."}),t.retry_succeeded||r.push({code:"retry_failed",probe_id:e.probe_id,detail:"The emitted retry or safe alternate-root recovery did not execute successfully."}),r}function EN(e){let t=new Map(e.map(n=>[n.probe_id,n])),r=[],o=0;for(let n of Tt){let i=t.get(n.probe_id);if(i===void 0){r.push({code:"missing_probe",probe_id:n.probe_id,detail:"No runtime observation was supplied for this contract."});continue}let s=ub(n,i);r.push(...s),s.length===0&&(o+=1)}return r.sort((n,i)=>n.probe_id.localeCompare(i.probe_id)||n.code.localeCompare(i.code)),{ok:r.length===0,probe_count:Tt.length,closed_probe_count:o,findings:r}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="3764b417-dcf5-5bfd-9b32-503ca8364f8b")}catch{}})();var Me,pb=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 mb(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=pb[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 xe(){if(Me!==void 0)return Me;let t=re.filter(({command:i})=>Ve(i)).flatMap(({command:i,family:s})=>nr(i,te(i)).map(a=>({command:i,family:s,concept:mb(i,a.flag),flag:a.flag,aliases:Object.freeze([...a.aliases??[]]),value_kind:a.repeatable?"list":a.flag==="--limit"?"number":a.value_type}))),r=new Set(t.flatMap(i=>i.aliases.map(s=>`${i.command}:${s}`))),o=t.filter(i=>!r.has(`${i.command}:${i.flag}`)),n=new Map;for(let i of o){let s=n.get(i.concept)??new Set;s.add(i.value_kind),n.set(i.concept,s)}return Me=Object.freeze(o.map(i=>Object.freeze({...i,concept:n.get(i.concept)?.size===1?i.concept:`${i.concept}@${i.command}`}))),Me}function IN(){return Object.freeze(xe().map(e=>Object.freeze({command:e.command,canonical_flag:e.flag,accepted_spellings:Object.freeze([...new Set([e.flag,...e.aliases])].sort())})))}var To=Object.freeze({init:30,config:36,extension:54,package:55,packages:55,install:27,upgrade:29,create:100,copy:24,focus:22,list:86,"list-all":86,"list-draft":84,"list-open":84,"list-in-progress":84,"list-blocked":84,"list-closed":84,"list-canceled":84,aggregate:40,context:45,ctx:45,get:30,graph:34,search:78,duplicates:25,eval:25,next:38,history:35,events:33,"history-redact":27,"history-repair":27,"history-compact":30,"history-author-acknowledge":28,merge:27,schema:43,profile:22,activity:35,restore:23,update:105,"update-many":146,close:31,"close-many":72,delete:24,append:25,comments:31,notes:35,learnings:31,files:39,docs:30,deps:32,plan:109,test:53,"test-all":40,telemetry:21,stats:29,health:36,validate:46,assurance:30,gc:22,workspace:23,contracts:29,claim:38,release:23,"start-task":23,"pause-task":23,"close-task":24,meet:33,event:33,remind:29,"test-runs-worker":25});function wo(){let e=new Map(Object.keys(To).map(t=>[t,0]));for(let{command:t}of xe())e.set(t,Number(e.get(t))+1);return Object.freeze(Object.entries(To).map(([t,r])=>Object.freeze({command:t,current:Number(e.get(t)),maximum:r})))}function fb(e,t,r){for(let o of e)for(let n of o.aliases){let i=t.get(`${o.command}:${n}`);i===void 0||i.flag===o.flag||r.push({code:"alias_collision",command:o.command,detail:`${n} aliases ${o.flag} but is canonical for ${i.flag}.`})}}function _b(e,t,r){let o=new Set(t.map(({command:n})=>n));for(let n of e.keys())o.has(n)||r.push({code:"missing_budget",command:n,detail:`${n} has canonical flags but no persisted budget.`});for(let n of t){let i=e.get(n.command)??0;i===0&&r.push({code:"stale_budget",command:n.command,detail:`${n.command} has a persisted budget but no canonical flags.`}),!(i<=n.maximum)&&r.push({code:"budget_exceeded",command:n.command,detail:`${i} canonical flags exceed the ratcheted maximum ${n.maximum}.`})}}function hb(e,t,r){let o=new Map(e.map(n=>[`${n.command}:${n.flag}`,n]));for(let n of t){let i=`${n.command}:${n.canonical_flag}`,s=o.get(i);if(!s){r.push({code:"removed_canonical_spelling",command:n.command,detail:`${n.canonical_flag} disappeared from the executable spelling inventory.`});continue}let a=new Set([s.flag,...s.aliases]);for(let c of n.accepted_spellings)a.has(c)||r.push({code:"removed_compatibility_spelling",command:n.command,detail:`${c} no longer resolves to ${n.canonical_flag}.`})}}function PN(e=xe(),t=wo(),r=[]){let o=[],n=new Map,i=new Map,s=new Map,a=new Map;for(let c of e){let d=`${c.command}:${c.flag}`;n.has(d)?o.push({code:"duplicate_canonical_flag",command:c.command,detail:`${c.flag} has more than one canonical row.`}):n.set(d,c),a.set(c.command,(a.get(c.command)??0)+1);let l=i.get(c.concept);l!==void 0&&l!==c.value_kind?o.push({code:"inconsistent_concept_kind",command:c.command,detail:`${c.concept} uses both ${l} and ${c.value_kind}.`}):i.set(c.concept,c.value_kind);let u=s.get(c.concept);u!==void 0&&u!==c.flag?o.push({code:"semantic_spelling_collision",command:c.command,detail:`${c.concept} is canonicalized by both ${u} and ${c.flag}.`}):s.set(c.concept,c.flag)}return fb(e,n,o),_b(a,t,o),hb(e,r,o),o.sort((c,d)=>c.command.localeCompare(d.command)||c.code.localeCompare(d.code)||c.detail.localeCompare(d.detail)),{ok:o.length===0,entry_count:e.length,budget_count:t.length,concept_count:new Set(e.map(({concept:c})=>c)).size,baseline_entry_count:r.length,findings:o}}function kN(){let e=xe(),t=wo(),r=new Map(t.map(({command:n})=>[n,"unknown"]));for(let{command:n,family:i}of e)r.set(n,i);return["# Generated flag lexicon budgets","","This file is generated by `listPmFlagLexicon()`. Compatibility aliases do not consume canonical budget.","","| Command | Capability family | Canonical flags | Maximum |","| --- | --- | ---: | ---: |",...t.map(({command:n,current:i,maximum:s})=>{let a=r.get(n);return`| \`${n}\` | ${a} | ${i} | ${s} |`}),""].join(`
|
|
32
|
-
`)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="a169a68c-13d0-5a3a-b231-abdf1a34ef6a")}catch{}})();function xN(e){return e}function NN(e){return e}function LN(e){return e}function DN(e){return e}function $N(e){return e}function FN(e){return e}function jN(e){return e}function GN(e){return e}function UN(e){return e}function BN(e){return e}function qN(e){return e}function zN(e){return e}function VN(e){return e}function HN(e){return{handled:!0,result:e}}function KN(){return{handled:!1}}function WN(e){return e}function XN(e){return e}function YN(e){return e}function JN(e){return e}function ZN(e){return e}function QN(e){return e}function eL(e){return e}function tL(e){return e}function rL(e){return e}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="14bbf3be-03a5-5ff3-888f-6e8b9a68ac73")}catch{}})();function gb(e={},t={}){return new _e(t).extension(void 0,{...e,migrate:!0})}function yb(e={},t={}){return new _e(t).packageMigrate(e)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="af4da99c-f557-5bf7-a439-c14878e4970d")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="db5452b6-8d36-5425-a033-1d36757ce96e")}catch{}})();import{createHash as Eo,createHmac as bb,randomBytes as Cb,timingSafeEqual as Tb}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="31eda153-a06e-51ef-a62f-f6dce09064d3")}catch{}})();var WL="dev.unbrained.pm/progressive-tool-discovery",XL=Object.freeze({version:1,discoveryTool:"pm_discover",canonicalResult:"structuredContent.result",compatibilityText:"pointer"}),wb=Object.freeze(["pm_discover","pm_next","pm_context","pm_search","pm_get"]),q=Object.freeze({lexical:.4,semantic:.2,graph:.1,permission:.15,freshness:.05,usage:.1}),Sb=Object.freeze(["profile_changed","tool_contract_changed","workspace_extension_changed","authorization_changed","ranking_signal_changed","cursor_integrity_key_rotated"]),Ao={core:0,standard:1,full:2,internal:3},vo=Object.freeze(["core","standard","full"]),Eb=new Set(["core","standard","full","custom"]),Oo=new Set(re.map(({family:e})=>e)),Ab=Cb(32);function Le(e,t){if(typeof e!="string")throw new b(`pm tool discovery ${t} must be a string of at most 4096 Unicode characters.`,64);let r=e[Symbol.iterator](),o=0;for(let n=r.next();!n.done;n=r.next())if(o+=1,o>4096)throw new b(`pm tool discovery ${t} must be a string of at most 4096 Unicode characters.`,64);return e}function Ro(e){if(!Number.isInteger(e)||Number(e)<1||Number(e)>100)throw new b("pm tool discovery limit must be from 1 through 100.",64);return Number(e)}function Io(e){if(e!=="unbounded"&&(!Number.isInteger(e)||Number(e)<128))throw new b("pm tool discovery outputBudget must be unbounded or an integer of at least 128.",64);return e==="unbounded"?e:Number(e)}function Po(e){if(e!==void 0&&typeof e!="boolean")throw new b("pm tool discovery includeSchema must be a boolean.",64);return e===!0}function ko(e){if(e===null||typeof e!="object"||Array.isArray(e))throw new b("pm tool discovery options must be an object.",64)}function vb(e){if(!Array.isArray(e))throw new b("pm tool discovery candidates must be an array.",64);for(let[t,r]of e.entries()){if(r===null||typeof r!="object"||Array.isArray(r))throw new b(`pm tool discovery candidate ${t} must be an object.`,64);if(typeof r.name!="string"||r.name.trim().length===0)throw new b(`pm tool discovery candidate ${t} name must be a non-empty string.`,64);if(typeof r.description!="string"||r.description.trim().length===0)throw new b(`pm tool discovery candidate ${t} description must be a non-empty string.`,64);if(r.inputSchema===null||typeof r.inputSchema!="object"||Array.isArray(r.inputSchema))throw new b(`pm tool discovery candidate ${t} inputSchema must be an object.`,64);if(r.authorized!==void 0&&typeof r.authorized!="boolean")throw new b(`pm tool discovery candidate ${t} authorized must be a boolean.`,64)}}function YL(e){if(ko(e),e.family!==void 0&&(typeof e.family!="string"||!Oo.has(e.family)))throw new b("pm tool discovery family must be a declared capability family.",64);if(e.tier!==void 0&&(typeof e.tier!="string"||!vo.includes(e.tier)))throw new b("pm tool discovery tier must be core, standard, or full.",64);return{...e.query!==void 0?{query:Le(e.query,"query")}:{},...e.family!==void 0?{family:e.family}:{},...e.tier!==void 0?{tier:e.tier}:{},...e.limit!==void 0?{limit:Ro(e.limit)}:{},...e.cursor!==void 0?{cursor:Le(e.cursor,"cursor")}:{},...e.includeSchema!==void 0?{includeSchema:Po(e.includeSchema)}:{},...e.outputBudget!==void 0?{outputBudget:Io(e.outputBudget)}:{}}}function Ob(e){return e===void 0||!Number.isFinite(e)?0:Math.min(1,Math.max(0,e))}function pe(e){return[...new Set(e.toLowerCase().match(/[a-z0-9]+/gu)??[])].sort()}function Rb(e,t){let r=pe(e);if(r.length===0)return 0;let o=new Set(pe(t)),n=r.filter(s=>o.has(s)).length,i=t.toLowerCase().includes(e.toLowerCase())?.25:0;return Math.min(1,n/r.length+i)}function Ib(e,t){let r=pe(e);if(r.length===0)return 0;let o=t.toLowerCase(),n=pe(t),i=r.filter(a=>n.some(c=>c.startsWith(a)||a.startsWith(c))).length,s=o.includes(e.toLowerCase())?.2:0;return Math.min(1,i/r.length+s)}function So(e){return Eo("sha256").update(JSON.stringify(e)).digest("hex").slice(0,24)}function Mo(e,t,r){return bb("sha256",r).update(JSON.stringify({version:1,fingerprint:e,offset:t})).digest("base64url")}function Pb(e,t,r){let o={version:1,offset:t,signature:Mo(e,t,r)};return Buffer.from(JSON.stringify(o),"utf8").toString("base64url")}function kb(e,t,r,o){if(e===void 0)return 0;try{let n=JSON.parse(Buffer.from(e,"base64url").toString("utf8"));if(n.version!==1||!Number.isInteger(n.offset)||(n.offset??-1)<0||Number(n.offset)>r||typeof n.signature!="string")throw new Error("cursor fields do not match the request");let i=Buffer.from(Mo(t,n.offset,o),"base64url"),s=Buffer.from(n.signature,"base64url");if(s.length!==i.length||!Tb(s,i))throw new Error("cursor signature does not match the request");return n.offset}catch(n){throw new b("Invalid or stale pm tool discovery cursor; restart discovery without cursor.",64,{reason:String(n)})}}function wt(e,t,r){return{value:Ob(e),weight:t,available:r!=="unavailable",source:r}}function Ne(e,t,r){return wt(e??t,r,e===void 0?"computed":"host")}function Mb(e,t,r){let o=Object.hasOwn(fe,e.name)?fe[e.name]:"help",n=Ye(o),i=`${e.name} ${e.description} ${o} ${n}`,s=Rb(t,i),a=new Set(pe(t)),c={lexical:wt(s,q.lexical,"computed"),semantic:Ne(e.signals?.semantic,Ib(t,i),q.semantic),graph:Ne(e.signals?.graph,a.has(n)||a.has(o)?1:0,q.graph),permission:wt(1,q.permission,"authorization"),freshness:Ne(e.signals?.freshness,1,q.freshness),usage:Ne(e.signals?.usage,wb.includes(e.name)?1:0,q.usage)},d=Object.values(c).reduce((l,u)=>l+u.value*u.weight,0);return{name:e.name,description:e.description,command:o,tier:Je(o),family:n,score:Number(d.toFixed(6)),signals:c,...r?{input_schema:structuredClone(e.inputSchema)}:{}}}function xb(e){if(e.cursorIntegrityKey!==void 0&&(!(e.cursorIntegrityKey instanceof Uint8Array)||e.cursorIntegrityKey.byteLength<32))throw new b("pm tool discovery cursorIntegrityKey must contain at least 32 bytes.",64);if(e.tier!==void 0&&(typeof e.tier!="string"||!vo.includes(e.tier)))throw new b("pm tool discovery tier must be core, standard, or full.",64);if(e.family!==void 0&&(typeof e.family!="string"||!Oo.has(e.family)))throw new b("pm tool discovery family must be a declared capability family.",64);if(e.profile!==void 0&&(typeof e.profile!="string"||!Eb.has(e.profile)))throw new b("pm tool discovery profile must be core, standard, full, or custom.",64)}function Nb(e){let r=Le(e.query===void 0?"":e.query,"query").trim().replace(/\s+/gu," ");Le(e.cursor===void 0?"":e.cursor,"cursor");let o=Ro(e.limit===void 0?10:e.limit),n=Io(e.outputBudget===void 0?1200:e.outputBudget);return xb(e),{query:r,includeSchema:Po(e.includeSchema),limit:o,budget:n,maximumTier:Ao[e.tier??"full"],profile:e.profile===void 0?"core":e.profile}}function xo(e,t,r){let o=r??e.tools.reduce((s,a,c)=>s+(c===0?0:1)+Buffer.byteLength(JSON.stringify(a),"utf8"),0),n={...e,tools:[]},i=0;for(let s=0;s<4;s+=1){let a=Buffer.byteLength(JSON.stringify({...n,token_cost:{estimated_tokens:i,budget:t,within_budget:!0}}),"utf8"),c=Math.ceil((a+o)/4);if(c===i)break;i=c}return i}function Lb(e,t,r){return e.filter(o=>o.authorized!==!1).map(o=>Mb(o,r.query,r.includeSchema)).filter(o=>o.tier!=="internal"&&Ao[o.tier]<=r.maximumTier&&(t.family===void 0||o.family===t.family)).sort((o,n)=>n.score-o.score||(o.name<n.name?-1:o.name>n.name?1:0))}function Db(e,t,r){if(t==="unbounded")return[...e];let o=[],n=0;for(let[i,s]of e.entries()){let a=n+(i===0?0:1)+Buffer.byteLength(JSON.stringify(s),"utf8");if(xo(r(i+1),t,a)>t)break;o.push(s),n=a}return o}function JL(e,t={}){vb(e),ko(t);let r=Nb(t),o=t.cursorIntegrityKey??Ab,n=Lb(e,t,r),i=So({query:r.query,family:t.family??null,tier:t.tier??"full",includeSchema:r.includeSchema,profile:r.profile,ranked:n}),s=kb(t.cursor,i,n.length,o),a=n.slice(s,s+r.limit),c=[];r.includeSchema||c.push({name:"input_schema",reason:"compact_projection",restore_with:"Set includeSchema=true."}),s+r.limit<n.length&&c.push({name:"tools",reason:"limit",restore_with:"Continue with next_cursor or increase limit."});let d={result_type:"pm_tool_discovery",contract_version:1,query:r.query,profile:r.profile,total:n.length,ranking_policy:{version:1,formula:"weighted_sum_then_name",weights:q},cache:{key:So({fingerprint:i,cursorIntegrityKey:Eo("sha256").update(o).digest("hex"),limit:r.limit,offset:s,budget:r.budget}),ttl_ms:3e4,scope:"private",invalidates_on:Sb}},l=(h,C=h.length)=>{let w=s+C,z=w<n.length,I=[...c];return C<a.length&&I.push({name:"tools",reason:"token_budget",restore_with:"Continue with next_cursor or increase outputBudget."}),{...d,tools:[...h],returned:C,has_more:z,...z?{next_cursor:Pb(i,w,o)}:{},omission_receipt:{has_omissions:I.length>0,omitted:I}}},u=h=>{let C=l(h),w=xo(C,r.budget);return{...C,token_cost:{estimated_tokens:w,budget:r.budget,within_budget:r.budget==="unbounded"||w<=r.budget}}},f=Db(a,r.budget,h=>l([],h)),g=u(f);if(a.length>0&&f.length===0){let h=u([a[0]]).token_cost.estimated_tokens;throw new b(`pm tool discovery outputBudget is too small to return a tool; increase it to at least ${h}.`,64,{required:String(h)})}if(r.budget!=="unbounded"&&g.token_cost.estimated_tokens>r.budget)throw new b(`pm tool discovery outputBudget is too small; at least ${g.token_cost.estimated_tokens} estimated tokens are required for this page.`,64,{required:String(g.token_cost.estimated_tokens)});return g}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="87fb8085-4f16-58a9-9de7-c871fb90be5b")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="7130baa3-4e73-5123-be23-c7b4924fbf2a")}catch{}})();export{RR as ACTIONABILITY_ORDERING_KINDS,hs as ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS,uc as ACTIVITY_FLAG_CONTRACTS,kn as AGENT_PROVENANCE_DIMENSIONS,Xs as AGGREGATE_FLAG_CONTRACTS,La as APPEND_FLAG_CONTRACTS,rI as ASSURANCE_ACTIONS,oI as ASSURANCE_DECLARATION_KINDS,Xv as ASSURANCE_DOCUMENT_VERSION,tc as ASSURANCE_FLAG_CONTRACTS,Yv as ASSURANCE_GATE_TRIGGERS,Jv as ASSURANCE_MEASUREMENT_SOURCE_KINDS,fO as ASSURANCE_PRESET_IDS,Vv as AssuranceEvaluationRefusalError,zv as AssuranceMutationRefusalError,Hv as AssuranceSourceResolutionError,gn as BASELINE_ITEM_FORMAT_VERSION,py as BOUNDARY_FIXTURE_CAPTURE_SOURCES,UR as BRIEF_LIST_FIELDS,xn as BUILTIN_AGENT_PROVENANCE_ADAPTERS,Y as BUILTIN_CORPUS_SHAPES,Mn as BUILTIN_HARNESS_SIGNAL_DESCRIPTORS,Ho as BUILTIN_ITEM_TYPE_VALUES,Wt as BUILTIN_PROFILES,SC as BUILTIN_RELATIONSHIP_KINDS,ms as CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS,lc as CALENDAR_FLAG_CONTRACTS,Da as CLAIM_FLAG_CONTRACTS,Ic as CLOSE_ACTION_OPTION_KEYS,xa as CLOSE_FLAG_CONTRACTS,Na as CLOSE_MANY_FLAG_CONTRACTS,Ba as CLOSE_TASK_FLAG_CONTRACTS,Ys as COMMENTS_FLAG_CONTRACTS,pC as COMMON_MUTATION_COMMAND_OPTION_KEYS,Sc as COMPLETION_FLAG_CONTRACTS,Zo as CONFIDENCE_TEXT_VALUES,ua as CONFIG_FLAG_CONTRACTS,fs as CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS,_I as CONTEXT_EVALUATION_METRIC_NAMES,mc as CONTEXT_FLAG_CONTRACTS,qt as CONTEXT_OUTPUT_VALUES,CI as CONTEXT_PACKING_PROFILES,aI as CONTEXT_RECENCY_EPOCH,uI as CONTEXT_RELEVANCE_SERVICE,dI as CONTEXT_RELEVANCE_SIGNAL_NAMES,SI as CONTEXT_SIGNAL_SET_VERSION,wI as CONTEXT_SIGNAL_STORE_FORMAT_VERSION,EI as CONTEXT_SIGNAL_STORE_WARNING_DETAILS,iS as CONTEXT_USAGE_LIMITS,wc as CONTRACTS_FLAG_CONTRACTS,sc as COPY_FLAG_CONTRACTS,Cs as CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,ws as CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,Ts as CREATE_COMMANDER_STRING_OPTION_CONTRACTS,Ub as CREATE_DIRECT_CLOSE_REASON_DEFAULT,rc as CREATE_FLAG_CONTRACTS,kS as CURRENT_HISTORY_ITEM_HASH_VERSION,xS as CURRENT_HISTORY_RECORD_HASH_VERSION,yn as CURRENT_ITEM_FORMAT_VERSION,RI as ContextSignalStore,sS as ContextUsageValidationError,$v as DEFAULT_AUTHOR_IDENTITY_VOCABULARY,iP as DEFAULT_CHILD_SAMPLE_LIMIT,GR as DEFAULT_COMPACT_LIST_FIELDS,jE as DEFAULT_DERIVED_INDEX_MINIMUM_ITEMS,Hp as DEFAULT_EVAL_QUERIES_RELATIVE_PATH,qI as DEFAULT_TERMINAL_TRANSITION_POLICY,MI as DEFAULT_WORKSPACE_MEMORY_MINIMUM_ITEMS,VA as DEFECT_ESCAPE_CLASSES,HA as DEFECT_GATE_EVIDENCE_DISPOSITIONS,Fa as DELETE_FLAG_CONTRACTS,Xo as DEPENDENCY_KIND_VALUES,hc as DEPS_FLAG_CONTRACTS,ea as DOCS_FLAG_CONTRACTS,Za as DUPLICATES_FLAG_CONTRACTS,uR as DURABLE_MERGE_RECEIPT_INTRODUCED_AT,yc as EVAL_FLAG_CONTRACTS,Bp as EVAL_QUERY_SET_CONTRACT,qp as EVAL_QUERY_SET_EXAMPLE,Up as EVAL_QUERY_SET_SCHEMA_ID,pc as EVENTS_FLAG_CONTRACTS,za as EVENT_FLAG_CONTRACTS,Fo as EXECUTABLE_COMMAND_ALIASES,L as EXIT_CODE,wa as EXTENSION_ACTIVATE_FLAG_CONTRACTS,Ta as EXTENSION_ADOPT_ALL_FLAG_CONTRACTS,Ia as EXTENSION_ADOPT_FLAG_CONTRACTS,fv as EXTENSION_CAPABILITIES,jb as EXTENSION_CAPABILITY_CONTRACT,$b as EXTENSION_CAPABILITY_CONTRACT_VERSION,Fb as EXTENSION_CAPABILITY_LEGACY_ALIASES,cn as EXTENSION_CAPABILITY_REGISTRATION_SURFACES,Ra as EXTENSION_CATALOG_FLAG_CONTRACTS,Sa as EXTENSION_DEACTIVATE_FLAG_CONTRACTS,Ca as EXTENSION_DESCRIBE_FLAG_CONTRACTS,Oa as EXTENSION_DOCTOR_FLAG_CONTRACTS,ba as EXTENSION_EXPLORE_FLAG_CONTRACTS,pa as EXTENSION_FLAG_CONTRACTS,fa as EXTENSION_INIT_FLAG_CONTRACTS,ga as EXTENSION_INSTALL_FLAG_CONTRACTS,Aa as EXTENSION_MANAGE_FLAG_CONTRACTS,Ea as EXTENSION_MIGRATE_FLAG_CONTRACTS,_v as EXTENSION_POLICY_MODES,hv as EXTENSION_POLICY_SURFACES,va as EXTENSION_RELOAD_FLAG_CONTRACTS,yv as EXTENSION_SANDBOX_PROFILES,ma as EXTENSION_SCOPE_FLAG_CONTRACTS,gv as EXTENSION_TRUST_MODES,ya as EXTENSION_UNINSTALL_FLAG_CONTRACTS,wO as EXTERNAL_DEPENDENCY_RESOLUTION_STATUSES,CO as EXTERNAL_DEPENDENCY_SOURCE_KIND,TO as EXTERNAL_DEPENDENCY_SOURCE_KIND_ALIAS,Qs as FILES_FLAG_CONTRACTS,ac as FOCUS_FLAG_CONTRACTS,Ya as GC_FLAG_CONTRACTS,zR as GET_DEPTH_VALUES,fc as GET_FLAG_CONTRACTS,Ks as GLOBAL_FLAG_CONTRACTS,Id as GRAPH_DURABLE_CACHE_MIN_ITEMS,Rd as GRAPH_DURABLE_CACHE_VERSION,gc as GRAPH_FLAG_CONTRACTS,Ue as GRAPH_SUBCOMMAND_VALUES,_c as GUIDE_FLAG_CONTRACTS,Qa as HEALTH_FLAG_CONTRACTS,ia as HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS,PO as HISTORY_AUTHOR_ATTRIBUTION_BASELINE,GP as HISTORY_COMPACT_BULK_DEFAULT_MIN_ENTRIES,sa as HISTORY_COMPACT_FLAG_CONTRACTS,Kn as HISTORY_EVENT_CLASSIFICATION_VERSION,ta as HISTORY_FLAG_CONTRACTS,Ie as HISTORY_ITEM_HASH_VERSION_3_INTRODUCED_IN,oa as HISTORY_REDACT_FLAG_CONTRACTS,na as HISTORY_REPAIR_FLAG_CONTRACTS,Lp as INIT_AGENT_GUIDANCE_MODE_VALUES,la as INIT_FLAG_CONTRACTS,Pa as INSTALL_FLAG_CONTRACTS,Jo as ISSUE_SEVERITY_VALUES,nc as ITEM_COMPLETE_FLAG_CONTRACTS,rR as ITEM_LATEST_TIMESTAMP_FIELDS,Gb as ITEM_METADATA_KEY_ORDER,oc as ITEM_MUTATE_FLAG_CONTRACTS,ic as ITEM_REOPEN_FLAG_CONTRACTS,XO as ITEM_SCALAR_MISSING_VALUE,Ko as ITEM_TYPE_VALUES,tR as ITEM_UNION_COLLECTION_FIELDS,OI as JsonFileContextSignalStoreAdapter,Zs as LEARNINGS_FLAG_CONTRACTS,cp as LINKED_TEST_ENV_NAME_PATTERN,dp as LINKED_TEST_PM_CONTEXT_MODE_VALUES,ap as LINKED_TEST_PROTECTED_ENV_KEYS,lp as LINKED_TEST_WORKSPACE_CONTEXT_MODE_VALUES,us as LIST_COMMANDER_STRING_OPTION_CONTRACTS,BR as LIST_COMMAND_DEFAULT_PROJECTIONS,Cv as LIST_FILTER_EXTENSION_FLAG_DEFINITIONS,Ws as LIST_FILTER_FLAG_CONTRACTS,WR as LIST_SORT_FIELDS,XR as LIST_SORT_ORDER_VALUES,Wn as MAINTENANCE_HISTORY_OPERATIONS,nP as MAX_CHILD_PROJECTION_ITEMS,Ew as MAX_WORKFLOW_POLICIES,Aw as MAX_WORKFLOW_POLICY_TERMS,qa as MEET_FLAG_CONTRACTS,OP as MERGE_DRIVER_ARTIFACT_VALUES,ra as MERGE_FLAG_CONTRACTS,Be as MERGE_SUBCOMMAND_VALUES,PP as MUTATION_EVENT_WIRE_BUDGET,ae as MemoryRelationshipGraphAdapter,_s as NEXT_COMMANDER_STRING_OPTION_CONTRACTS,Cc as NEXT_FLAG_CONTRACTS,Bu as NEXT_OUTPUT_VALUES,Js as NOTES_FLAG_CONTRACTS,_a as PACKAGE_FLAG_CONTRACTS,ha as PACKAGE_INIT_FLAG_CONTRACTS,Ua as PAUSE_TASK_FLAG_CONTRACTS,Rc as PLAN_CREATE_METADATA_PARAMETER_KEYS,da as PLAN_FLAG_CONTRACTS,Ap as PLAN_SHOW_DEPTH_VALUES,We as PLAN_SUBCOMMANDS,vp as PLAN_TEMPLATE_NAMES,Ny as PM_AGENT_TASK_ACCOUNTING_MODES,gt as PM_AGENT_TASK_TRANSCRIPT_VERSION,$c as PM_CLI_EXPECTED_ERROR_NAME,$A as PM_CLI_GRAMMAR_CONTRACT,MA as PM_CLI_GRAMMAR_NOUNS,li as PM_CLI_ONLY_TOOL_ACTION_WAIVERS,xA as PM_CLI_SHARED_VERBS,$o as PM_COMMAND_ALIAS_CONTRACTS,re as PM_COMMAND_CAPABILITY_CONTRACTS,Dt as PM_COMMAND_DESTINATION_CONTRACTS,XI as PM_COMMAND_EXIT_CONTRACTS,WI as PM_COMMAND_EXIT_OUTCOME_CONTRACTS,Ri as PM_COMMAND_OUTPUT_BUDGET_CONTRACTS,ZP as PM_COMMAND_OUTPUT_ENVELOPE_CONTRACTS,ze as PM_COMMAND_POSITIONAL_CONTRACTS,Tm as PM_COMMAND_VISIBILITY_CONTRACTS,wv as PM_COMPLETE_LIST_FINDING_CODES,Rv as PM_CONTEXT_INTENTS_FILE,hS as PM_CONTEXT_INTENT_CONTRACTS,si as PM_CORE_COMMAND_NAMES,j as PM_CORPUS_SHAPE_SCHEMA,pi as PM_DEPRECATED_TOOL_ACTIONS,Si as PM_DIAGNOSTIC_DEGRADATION_STEPS,Ei as PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS,wi as PM_DIAGNOSTIC_OUTPUT_CLASSES,mi as PM_DISCOVERABLE_TOOL_ACTIONS,Qr as PM_EPISODE_SCHEMA,YP as PM_ERROR_CODE_CATALOG,HP as PM_ERROR_CODE_EXIT_CLASS_CONTRACTS,io as PM_EXACT_COVERAGE_METRICS,ei as PM_EXTENSION_CAPABILITY_CONTRACTS,ai as PM_EXTENSION_PACKAGE_ACTION_SUBCOMMANDS,ri as PM_EXTENSION_POLICY_MODE_CONTRACTS,ii as PM_EXTENSION_POLICY_SURFACE_CONTRACTS,ni as PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS,ti as PM_EXTENSION_SERVICE_NAME_CONTRACTS,oi as PM_EXTENSION_TRUST_MODE_CONTRACTS,$O as PM_GITATTRIBUTES_END,DO as PM_GITATTRIBUTES_START,jO as PM_GITATTRIBUTES_V2_END,FO as PM_GITATTRIBUTES_V2_START,Bc as PM_GITIGNORE_END,Uc as PM_GITIGNORE_START,Do as PM_HISTORY_COMMAND_ALIASES,di as PM_ITEM_ACTION_SUBCOMMANDS,at as PM_MCP_APPS_EXTENSION,Dr as PM_MCP_APPS_SERVER_CAPABILITY,Se as PM_MCP_APPS_SPEC_VERSION,jr as PM_MCP_APP_CONTRACTS,Fr as PM_MCP_APP_MIME_TYPE,wb as PM_MCP_ENTRY_TOOL_NAMES,m as PM_MCP_ERROR_CODES,e0 as PM_MCP_HTTP_PROTOCOL_VERSION,Nh as PM_MCP_INPUT_REQUEST_METHODS,EM as PM_MCP_LEGACY_PROTOCOL_VERSIONS,cr as PM_MCP_LOG_LEVELS,A as PM_MCP_META_KEYS,WL as PM_MCP_PROGRESSIVE_DISCOVERY_EXTENSION,XL as PM_MCP_PROGRESSIVE_DISCOVERY_SERVER_CAPABILITY,vm as PM_MCP_PROMPT_CONTRACTS,H as PM_MCP_PROTOCOL_VERSION,Am as PM_MCP_RESOURCE_CONTRACTS,dt as PM_MCP_SKILLS_DRAFT_REVISION,Gr as PM_MCP_SKILLS_EXTENSION,Gg as PM_MCP_SKILLS_SERVER_CAPABILITY,k as PM_MCP_SKILL_LIMITS,Te as PM_MCP_SUBSCRIPTION_ID_META_KEY,Ze as PM_MCP_SUPPORTED_PROTOCOL_VERSIONS,HM as PM_MCP_TASKS_EXTENSION,Vh as PM_MCP_TASK_STATUSES,fe as PM_MCP_TOOL_COMMAND_CONTRACTS,YT as PM_MODE_PAIRED_OUTPUT_PROJECTION_CONTRACTS,Ki as PM_MUTATION_ACTION_CONTRACTS,Jr as PM_OBSERVATION_SCHEMA,Ti as PM_OUTPUT_BUDGET_CLASSES,Ci as PM_OUTPUT_DEGRADATION_STEPS,ir as PM_OUTPUT_ENVELOPE_KINDS,Gt as PM_PACKAGE_CONVENTIONAL_RESOURCE_ROOTS,ci as PM_PACKAGE_ONLY_ACTION_SUBCOMMANDS,jt as PM_PACKAGE_RESOURCE_KINDS,qe as PM_POSITIONAL_ACTION_CONTRACTS,Dc as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA,Nc as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION,Kw as PM_READ_OUTPUT_COMPOSITION_OPTION_FLAGS,Nw as PM_READ_OUTPUT_CONTINUATION_FINGERPRINT_POLICIES,zw as PM_READ_OUTPUT_DIMENSIONS,Hw as PM_READ_OUTPUT_OPTION_FLAGS,jw as PM_READ_OUTPUT_SESSION_MAX_SEEN_ITEM_IDS,Fw as PM_READ_OUTPUT_SESSION_MIN_TOKENS,Vw as PM_READ_OUTPUT_SURFACES,Ww as PM_READ_OUTPUT_SURFACE_CONTRACTS,XT as PM_READ_ROW_CONTRACTS,WT as PM_READ_ROW_JQ_SELECTOR,Jx as PM_RECOVERY_REFERENCE_FIELDS,le as PM_RECOVERY_REFERENCE_KINDS,nb as PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE,bo as PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE_V2,nN as PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE,yo as PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE_V2,as as PM_REPRODUCIBLE_PROCESS_ENV,YI as PM_SUCCESS_EXIT_CODES,ui as PM_TOOL_ACTIONS,Pc as PM_TOOL_ACTION_PARAMETER_CONTRACTS,Lc as PM_TOOL_PARAMETERS_SCHEMA,xc as PM_TOOL_PARAMETERS_SCHEMA_MAJOR,Mc as PM_TOOL_PARAMETERS_SCHEMA_VERSION,vc as PM_TOOL_RESERVED_CUSTOM_FIELD_PROPERTIES,Zr as PM_VERDICT_SCHEMA,Xr as PM_WORKSPACE_RECIPE_SCHEMA,ca as PROFILE_FLAG_CONTRACTS,tr as PROFILE_LINT_CODES,er as PROFILE_LINT_DIMENSIONS,Kt as PROFILE_NAMES,Xe as PROFILE_SUBCOMMANDS,b as PmCliError,_e as PmClient,Sv as PmCompleteListValidationError,y as PmMcpAuthorizationError,dr as PmMcpInputRequiredError,kr as PmMcpIssuerCredentialStore,p as PmMcpProtocolError,lr as PmMcpRequestStateReplayGuard,Hr as PmMcpSkillRegistry,Tr as PmMcpSubscriptionRegistry,it as PmMcpTaskStore,pw as QUERY_CURSOR_CONTRACT,Ma as REINDEX_FLAG_CONTRACTS,xE as REINDEX_LOCK_ID,ht as RELATIONSHIP_GRAPH_SNAPSHOT_VERSION,ja as RELEASE_FLAG_CONTRACTS,Va as REMIND_FLAG_CONTRACTS,Pt as RESERVED_ITEM_FIELD_NAMES,$a as RESTORE_FLAG_CONTRACTS,Yo as RISK_VALUES,sv as RelationshipEventLog,av as RelationshipEventStore,V as RelationshipGraph,je as RelationshipKindRegistry,aa as SCHEMA_FLAG_CONTRACTS,ps as SEARCH_COMMANDER_STRING_OPTION_CONTRACTS,Tv as SEARCH_EXTENSION_FLAG_DEFINITIONS,Tc as SEARCH_FLAG_CONTRACTS,Eu as SEMANTIC_ATTRIBUTION_LIMITS,qb as SETTINGS_DEFAULTS,Jp as SNAPSHOT_SCHEMA,xO as SOURCE_CONTEXT_ACCESS_ENV,NO as SOURCE_CONTEXT_WRITE_OVERRIDE_ENV,Ga as START_TASK_FLAG_CONTRACTS,Ja as STATS_FLAG_CONTRACTS,Wo as STATUS_VALUES,Hs as SUBCOMMAND_GLOBAL_FLAG_CONTRACTS,Xn as SUBSTANTIVE_HISTORY_OPERATIONS,MS as SUPPORTED_HISTORY_ITEM_HASH_VERSIONS,NS as SUPPORTED_HISTORY_RECORD_HASH_VERSIONS,sC as SUPPRESS_HOST_OUTPUT_MARKER,Wa as TELEMETRY_FLAG_CONTRACTS,Km as TELEMETRY_SUBCOMMANDS,Ka as TEST_ALL_FLAG_CONTRACTS,Ha as TEST_FLAG_CONTRACTS,Xa as TEST_RUNS_FLAG_CONTRACTS,Bm as TEST_RUN_MEASUREMENT_LIMIT,Gs as TOOL_ACTIVITY_OPTION_CONTRACTS,Rs as TOOL_AGGREGATE_OPTION_CONTRACTS,Ds as TOOL_BULK_MUTATION_FILTER_OPTION_CONTRACT_SOURCE,js as TOOL_CALENDAR_OPTION_CONTRACTS,Fs as TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS,Us as TOOL_CONTEXT_OPTION_CONTRACTS,xs as TOOL_CREATE_OPTION_CONTRACTS,Ms as TOOL_CREATE_OPTION_CONTRACT_SOURCE,Bs as TOOL_DEPS_OPTION_CONTRACTS,qs as TOOL_GRAPH_OPTION_CONTRACTS,Os as TOOL_LIST_FILTER_OPTION_CONTRACTS,Is as TOOL_SEARCH_FILTER_OPTION_CONTRACTS,ks as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS,Ps as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACT_SOURCE,$s as TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS,Ls as TOOL_UPDATE_OPTION_CONTRACTS,Ns as TOOL_UPDATE_OPTION_CONTRACT_SOURCE,Bb as TYPE_TO_FOLDER,nC as UNKNOWN_SUBCOMMAND_COMPATIBILITY_CODES,Ss as UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,As as UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,Es as UPDATE_COMMANDER_STRING_OPTION_CONTRACTS,cc as UPDATE_FLAG_CONTRACTS,dc as UPDATE_MANY_FLAG_CONTRACTS,ka as UPGRADE_FLAG_CONTRACTS,ec as VALIDATE_FLAG_CONTRACTS,Sw as WORKFLOW_POLICY_ACTIONS,BO as WORKFLOW_POLICY_DOCUMENT_SCHEMA,UO as WORKFLOW_POLICY_SCHEMA,bc as WORKSPACE_FLAG_CONTRACTS,rE as WORKSPACE_HISTORY_ID,Zp as WORKSPACE_SNAPSHOT_ACTIONS,id as WorkspaceGraphCache,pv as WorkspaceTransactionInterruptedError,bm as _testOnly,sI as _testOnlyAggregateCommand,Np as _testOnlyConfigCommand,dP as _testOnlyGetCommand,wl as _testOnlyHealthCommand,jp as _testOnlyInit,Dp as _testOnlyInitAgentGuidance,vk as _testOnlyItemTransaction,NP as _testOnlyMutationEvents,GI as _testOnlyNextCommand,vP as _testOnlySearchCommand,tP as _testOnlySimilarity,sm as _testOnlyTemplates,tu as _testOnlyValidateCommand,$P as _testOnlyWorkspacePosition,yO as acceptAssuranceProposals,Ql as acknowledgeLinkedTests,Xd as acknowledgeUnknownAuthorHistoryEvents,Wd as acknowledgeUnknownAuthorHistoryEventsFromTransport,GE as acquireItemMetadataDerivedIndexLock,Ge as acquireLock,Fk as activateExtensionForTest,FC as activateExtensions,Pn as agentSessionEnvironment,zf as aggregate,km as analyzeAgentProvenanceDescriptorCoverage,WA as analyzeDefectChangeRisk,tI as analyzeDefectRecurrenceCoverage,np as analyzeDuplicateItems,dv as analyzeGraphImpact,Xc as analyzeHierarchyIntegrity,lv as analyzeKnowledgeGraph,ZI as analyzePmCommandExitConformance,fi as analyzePmToolActionParity,bR as analyzeReconciliationDiscard,cv as analyzeRelationshipExecution,Cd as analyzeRelationshipSchedule,hh as analyzeSdkActionCoverage,$t as analyzeSdkCliParameterCompleteness,r_ as append,Li as appendHistoryEntry,sE as appendWorkspaceAuditEvent,iE as appendWorkspaceHistoryChange,fT as applyAcceptanceCriteriaMutations,hO as applyAssurancePreset,Th as applyBootstrapPagerPolicy,TS as applyContextIntentProjection,Uu as applyContextTagProjection,YR as applyFilterValueEcho,ev as applyHistoryPatch,Rh as applyInvocationAuthorOverride,Rl as applyPathMigrations,rS as applyReadOutputDimensions,Zw as applyReadOutputIncludeModes,Uw as applyReadOutputSessionReferences,lT as applyRegisteredItemFieldDefaultsAndValidation,Ml as applyStandaloneNote,fl as applyStoredExtensionMigrationState,hT as applyTagRemovals,KI as applyTerminalOrderingPolicy,xl as artifactKey,Wb as asRecordClone,Kb as asRecordOrNull,He as assembleWorkspaceRelationshipGraph,Ov as assertCompleteListResult,yM as assertExtensionBlueprint,gM as assertExtensionCapabilityUsage,Qk as assertExtensionDeactivated,TM as assertExtensionManifestCompatible,CM as assertExtensionManifestMatchesBlueprint,wM as assertExtensionPreflight,Zc as assertHierarchyMutationAllowed,UP as assertHistoryCompactTarget,TR as assertHistoryRepairTarget,qi as assertInitializedTracker,Il as assertLinkedArtifactMutationIsUnambiguous,vM as assertMcpClientCapabilities,AM as assertMcpProtocolHeader,xy as assertMemoryRelationshipGraphAdapterConformance,bT as assertNoUnknownCsvKeys,eM as assertPackageManifest,_E as assertParentReferenceIsNotSelf,P0 as assertPmMcpSkillsCapability,bM as assertProjectProfile,hx as assertProjectRuntimeCompatibility,JT as assertProjectionModeChoice,Bi as assertReadableTrackerRoot,tM as assertRegisteredCommandContract,uM as assertRegisteredCommandOverride,aM as assertRegisteredExporter,rM as assertRegisteredFlags,oM as assertRegisteredHook,sM as assertRegisteredImporter,cM as assertRegisteredItemField,dM as assertRegisteredItemType,hM as assertRegisteredMigration,pM as assertRegisteredParserOverride,mM as assertRegisteredPreflightOverride,lM as assertRegisteredProfile,fM as assertRegisteredRendererOverride,nM as assertRegisteredSearchProvider,_M as assertRegisteredServiceOverride,iM as assertRegisteredVectorStoreAdapter,OC as assertRelationshipEdgeAllowed,po as assertRelationshipGraphAdapterConformance,Zv as assuranceAssertionUpdateIsLoosening,ES as attachContextIntentReceipt,aS as attachContextUsageServingReceipt,Xl as attachLinkedTestMutationProvenance,Wl as attachLinkedTestProvenance,et as attachMcpServerInfo,ow as attachOutputOmissionReceipt,vS as attachOutputTokenAccounting,AS as attachReadOutputContracts,Bw as attachReadOutputSessionReceipt,el as auditMergeAttributeFence,GO as auditMergeDriverConfiguration,vd as auditWorkspaceRelationshipGraph,_0 as authorizeMcpHttpRequest,Rn as boundAgentEpisodeIdentity,Tw as boundReadOutputRows,$u as buildChildrenByParent,mP as buildCompactSearchFilterSummary,JR as buildContentFilterEcho,vI as buildContextSignalSnapshot,iy as buildCorpusShapeItemPlan,KA as buildDefectRecurrenceIndex,ll as buildExtensionDescribeResult,gl as buildExtensionInstallPlan,ZR as buildGovernanceMissingFilterEcho,SE as buildInvalidTypeError,sP as buildItemChildrenRollup,Ek as buildItemCompletionMutations,lI as buildItemContextRelevanceCandidates,HE as buildItemNotFoundError,cP as buildItemSchedule,AR as buildLinkedFileRepairReport,s0 as buildMcpAuthorizationDiscoveryUrls,Mh as buildMcpCompleteResult,RM as buildMcpDiscoverResult,u0 as buildMcpDynamicRegistrationMetadata,ZM as buildMcpHttpRequestHeaders,xM as buildMcpInputRequiredResult,i0 as buildMcpProtectedResourceMetadata,Zd as buildMergeAttributePatterns,kc as buildPmActionToolInputSchema,aN as buildPmRefusalClosureCensus,RO as buildRelationshipContext,JE as buildSearchCorpus,QE as buildSemanticCorpusInput,ER as buildStatusRoleWarnings,Ui as buildTrackerInitializationRecovery,iA as buildVectorizationEmbeddingIdentity,sA as buildVectorizationEmbeddingMetadata,fP as buildVerboseSearchFilters,qO as buildWorkflowCompletenessCheck,xI as buildWorkspaceMemorySnapshot,On as canonicalDocument,mC as canonicalizeCommandOptionKey,cI as canonicalizeContextRecencyCoordinate,EC as canonicalizeRelationshipKind,Zx as censusPmRecoveryReferenceProducers,vv as certifyCompleteListResult,Dk as checkExtensionManifestCompatibility,j_ as claim,G_ as claimNext,kO as classifyHistoryAuthorEvent,Yn as classifyHistoryEvent,gR as classifyHistoryMergeReceiptReferences,CC as classifyHostEnvironmentFault,SP as classifyImplicitSemanticFallbackReason,Tn as classifyItemFormatVersion,Ym as classifyLinkedTestCommandSafety,Jm as classifyLinkedTestFailure,tT as clearActiveExtensionHooks,Nd as clearDurableGraphCache,qT as clearFocusedItem,Vc as clearWorkspaceContractsCache,F_ as close,Wu as closeItem,W_ as closeTask,Eh as coalesceRepeatedListFlags,IR as collectBlockedByIds,kR as collectBlockedByIdsFromCorpus,dS as collectContextUsageDeliveredItemIds,rd as collectDanglingDependencyReferences,xR as collectDependencyBlockedIds,ed as collectDuplicateDependencyRows,Ad as collectDuplicateRelationshipEdgeGroups,wP as collectErrorCauseCodes,Wc as collectHierarchyRelations,Or as collectMcpHeaderAnnotations,od as collectMissingDependencyTargetIds,tp as collectNewOrderingCycleWarnings,wd as collectOrderingCycles,td as collectOrderingStorageContradictions,kv as collectPackageContextIntentContracts,Bt as collectPackageExtensionDirectories,cT as collectRegisteredItemFieldNames,LT as collectRuntimeCreateFieldValues,EE as collectRuntimeFilterValues,DT as collectRuntimeUpdateFieldValues,Mu as collectSubtreeIds,dn as collectUsedExtensionCapabilities,fC as commandOptionFlagLabel,Kf as comments,vf as commitImportedItem,Ak as commitItemCompletion,Sk as commitItemMutations,mv as commitWorkspaceTransaction,Vs as compactFlagAliasContracts,xu as compareCriticalItems,G as comparePmDateVersions,uv as compareRelationshipSnapshots,Xb as compareTimestampStrings,Bv as compileHistoryProvenanceMatcher,bS as composeContextIntentContracts,Ik as composeExtension,Lk as composeExtensionPackage,LR as computeActionabilityReport,QS as computeHistoryDiff,yd as computeRelationshipCentrality,gd as computeRelationshipDominators,nd as computeWorkspaceGraphFingerprint,n_ as config,eT as consumeAfterCommandAffectedItems,Ff as context,SS as contextIntentRowId,B_ as copy,Zm as countFailureCategories,bw as countReadOutputRows,L_ as create,_O as createAssurancePreset,QR as createAssuranceWorkspaceContext,Jb as createCheckpointId,Ev as createCompleteListOptions,jC as createCoreCommandHookContext,no as createCorpusShapeMeasurement,oO as createEmptyAssuranceDocument,IC as createEmptyExtensionRegistrationRegistry,Gc as createExtensionCommandSdk,an as createExtensionContributionInventory,SM as createExtensionTestHarness,Ni as createHistoryEntry,wA as createLazyModule,zO as createLifecycleCompletenessPolicies,h0 as createMcpStaticBearerVerifier,KM as createMcpTaskStore,VE as createMutationGuardSdk,ZT as createOutputOmissionReceipt,Fc as createPmCliExpectedError,Ih as createPmCliProgram,vi as createPmCommandOutputBudget,iw as createQueryFingerprint,My as createRelationshipGraphScaleFixture,Q as createRelationshipGraphSnapshot,Rt as createRelationshipKindRegistry,ds as createReproducibleProcessRunner,_P as createSearchCursorFingerprint,GC as createSerialQueue,AT as createStdinTokenResolver,iC as createUnknownSubcommandError,xw as createWorkflowPolicyEvaluator,Qp as createWorkspaceSnapshot,jk as deactivateExtensionForTest,KN as declineServiceOverride,wS as decodeContextIntentCursor,TA as decodeHtmlEntitiesInOptions,vr as decodeMcpHttpHeaderValue,dw as decodeQueryCursor,aw as decodeQueryCursorEnvelope,cw as decodeQueryCursorState,$w as decodeReadOutputContinuationCursor,T0 as decoratePmMcpToolsWithApps,Ll as dedupeLinkedArtifacts,pI as defaultScoreContextCandidates,QN as defineAfterCommandHook,JN as defineBeforeCommandHook,ZN as defineBeforeMutationHook,LN as defineCommand,BN as defineCommandOverride,X as defineCorpusShape,G0 as defineEpisodeSpecification,YN as defineExporter,Ok as defineExtension,Rk as defineExtensionBlueprint,xN as defineExtensionManifest,DN as defineFlag,XN as defineImporter,FN as defineItemField,$N as defineItemType,jN as defineMigration,Xg as defineObservationContract,rL as defineOnIndexHook,tL as defineOnReadHook,eL as defineOnWriteHook,qN as defineParserOverride,Oi as definePmCommandOutputBudget,JP as definePmCommandOutputEnvelope,KP as definePmErrorCodeCatalog,zN as definePreflightOverride,NN as defineProjectProfile,WN as defineRendererOverride,GN as defineSearchProvider,VN as defineServiceOverride,UN as defineVectorStoreAdapter,Qg as defineVerdictContract,Ee as defineWorkspaceRecipe,q_ as deleteItem,im as deleteWorkspaceSnapshot,RC as dependencyToRelationship,e_ as deps,gO as deriveAssuranceProposals,kk as deriveExtensionCapabilities,QI as derivePmBulkMutationEffect,Qx as derivePmRecoveryReferenceObligations,Td as deriveRelationshipDeadlines,nl as deriveSchemaEvolutionMigrationId,fA as deriveTelemetryCommandResolution,RE as describeAllowedTransitions,MO as describeExtensionActivation,Mk as describeExtensionBlueprint,_u as describeItemOwnershipConflict,j0 as describeObservationCost,Zt as describeProfileComposition,Qt as describeProjectProfile,ak as describeUnknownError,Gn as detectAgentIdentity,zn as detectHarnessIdentity,_d as detectRelationshipCommunities,Un as diagnoseAgentIdentity,Od as diffRelationshipAuditSnapshots,Vm as diffTestRunMeasurements,DM as digestMcpRequestParameters,DC as discoverExtensions,tn as discoverNearbyPmRoot,JL as discoverPmTools,vy as discoverProjectRuntimeVersionPins,Qf as docs,Hf as duplicates,Pd as durableGraphCachePath,Ld as durableGraphCacheStatus,bn as effectiveItemFormatVersion,kA as emitTelemetryErrorEvent,Af as emptyImportedDocument,JO as encodeItemScalarDecisionValue,Ar as encodeMcpHttpHeaderValue,sw as encodeQueryCursor,Dw as encodeReadOutputContinuationCursor,eE as enforceHistoryStreamPolicyForItem,tE as enforceHistoryStreamPolicyForItems,zP as enrichCliFlagInvocationContract,nr as enrichCliFlagInvocationContracts,rv as ensureMaterializedHistoryTarget,zc as ensurePmGitignore,Sl as ensureScope,mA as ensureSentryInit,Ef as ensureTrackerInitialized,md as enumerateRelationshipPaths,Pi as estimatePmOutputTokens,iO as evaluateAssuranceAssertion,sO as evaluateAssuranceGate,nx as evaluateBoundaryFixtures,hI as evaluateContextRanking,XA as evaluateDefectGateEvidence,nO as evaluateMeasurement,Xi as evaluateMutationGuard,$m as evaluateProvenanceCoverage,Nm as evaluateSemanticAttributionCoverage,sp as evaluateSimilarityGovernance,OE as evaluateTransition,ey as evaluateVerdictContract,Mw as evaluateWorkflowPolicies,eA as executeEmbeddingBatchesWithRetry,oA as executeVectorDelete,nA as executeVectorReset,rA as executeVectorUpsert,Vg as executeWorkspaceRecipe,kl as expandAddGlobEntries,Ul as explainSourceTraceability,X_ as extension,J_ as extensionActivate,Z_ as extensionDeactivate,Y_ as extensionList,gb as extensionMigrate,hR as extractHistoryMergeReceiptDispositions,_R as extractHistoryMergeReceiptReferences,p0 as extractMcpTraceContext,ZA as extractPatchFailureContext,Vl as extractReferencedPmItemIdsFromCommand,ky as federateRelationshipGraphSnapshots,Yf as files,Jf as filesDiscover,Zf as filesLookup,lS as finalizeContextUsageDelivery,uy as findCoverageDeficits,ip as findDuplicateClusters,Jd as findGitWorkspaceRoot,kT as findHistoryIdentityDiscontinuities,cl as findInstalledNpmPackageCandidate,C0 as findPmMcpAppByUri,hd as findRedundantRelationshipEdges,bd as findRelationshipCutStructure,op as findSimilarItems,PA as finishTelemetryCommand,rC as flattenFlagListValue,cy as flushTelemetryQueue,V_ as focus,fd as forEachMatchedRelationshipEdge,Ed as formatDuplicateEdgeGroup,Yc as formatHierarchyRelation,Sd as formatOrderingStorageContradiction,DA as formatPmPositionalActionFlagTip,ym as formatProfileApplyHuman,gm as formatProfileLintHuman,_m as formatProfileListHuman,hm as formatProfileShowHuman,al as formatSchemaEvolutionMigrationHuman,AP as formatVectorIndexRecoveryWarnings,DP as formatWorkspacePositionHuman,I_ as gc,Fi as generateItemId,Bf as get,JC as getActiveCommandResult,gS as getActiveContextIntentContracts,un as getActiveExtensionRegistrations,f0 as getActiveMcpTraceContext,cO as getAssuranceDeclaration,ph as getContracts,UT as getFocusedItem,nn as getHistoryPath,iv as getItemAt,on as getItemPath,Zi as getMutationActionContract,qc as getPmGitignoreBlock,rn as getSettingsPath,uh as getWorkspaceContracts,oE as getWorkspaceHistoryPath,t_ as graph,kd as graphAuditBaselinePath,Lm as groupHistoryByEpisode,HN as handleServiceOverride,OM as hasMcpClientExtension,b0 as hasPmMcpAppsCapability,Ve as hasSubcommandFlagContractsForCommand,aA as hasVectorizationEmbeddingIdentityChanged,cA as hasVectorizationVectorDimensionChanged,BS as hashDocument,qS as hashDocumentForVersion,zS as hashEmptyDocument,DS as hashHistoryPatch,LS as hashHistoryRecord,$S as hashHistoryStream,ZO as hashItemScalarDecisionValue,R_ as health,dd as hierarchyAncestors,ld as hierarchyDescendants,x_ as historyCompact,N_ as historyCompactBulk,Uv as historyEntryMatchesProvenance,ve as historyItemHashVersionForRuntime,P_ as historyRedact,k_ as historyRepair,M_ as historyRepairAll,PR as indexBlockedByIds,Jc as indexHierarchyRelations,dA as inferConsistentVectorDimension,Ai as inferPmOutputBudgetClass,o_ as init,Av as inspectCompleteListResult,PC as inspectExtensionManifestSchema,qd as inspectHistoryAuthorStream,sR as inspectMergeReceiptEvidence,Ry as inspectProjectRuntimeCompatibility,is as inspectStaleInProgressItems,SR as inspectStatusRoleAssignments,nE as inspectWorkspaceHistoryState,em as inspectWorkspaceSnapshot,ol as installMergeFence,IM as interpretMcpResultType,zu as isAlreadyClaimedError,lk as isCommanderError,lu as isErrnoError,qA as isExternalDependencyReference,zA as isExternalDependencySourceKind,me as isFileMissingError,cC as isHostOutputSuppressed,YO as isItemScalarMissingValue,pR as isLegacyMergeReceiptSummary,_ as isMcpRecord,Yi as isMutationAction,vC as isOrderingRelationshipKind,mE as isPlaceholderReferenceToken,jc as isPmCliExpectedError,hi as isPmExtensionCapabilityContract,yi as isPmExtensionPolicyModeContract,bi as isPmExtensionPolicySurfaceContract,gi as isPmExtensionServiceNameContract,JI as isPmKnownExitCode,QP as isPmMutationReceipt,Ke as isPmSuccessfulExitCode,_i as isPmToolAction,mR as isPreDurableCloneLocalReceiptSummary,fR as isPreDurableDispositionEligibleReference,Oy as isProjectMutatingInvocation,SA as isPureSnakeCaseAlias,oS as isReadOutputBudgetExceeded,ew as isReadRowContract,Bd as isRuntimeRecord,vA as isTerminalPlanMode,FT as isTerminalStatus,Vo as isTimestampLiteral,Tk as itemDocumentToMutationOptions,aP as itemHasSchedule,Qi as jaccardSimilarity,Xf as learnings,oC as levenshteinDistanceWithinLimit,au as limitAnnotationEntries,Yl as linkedTestTrustFingerprint,xk as lintExtensionBlueprint,kC as lintExtensionManifestSchema,rr as lintProjectProfile,jf as list,Ln as listAgentProvenanceAdapters,Sh as listAliasPluralKeys,Gf as listAllComplete,qE as listAllDocumentCandidatesCached,Hi as listAllItemMetadata,zE as listAllItemMetadataLight,aO as listAssuranceDeclarations,mO as listAssuranceVerdicts,oy as listBuiltinCorpusShapes,fk as listCoreClosedDomainContracts,VR as listGetProjectionFields,KO as listInvalidProvenanceHistoryStreamIds,qR as listListProjectionFields,aR as listMergeReceipts,Ji as listMutationActions,kP as listMutationEvents,wo as listPmCommandFlagBudgets,Sm as listPmCommandsForFamily,wm as listPmCommandsForTier,xe as listPmFlagLexicon,IN as listPmFlagSpellingInventory,Em as listPmMcpToolsForProfile,bN as listPmRequiredArgumentRefusalContracts,CN as listPmSubcommandRefusalContracts,Jt as listProfiles,SN as listTrackerPreflightRecoveryContracts,tm as listWorkspaceSnapshots,Mv as loadContextIntentRuntimeLayers,am as loadCreateTemplateOptions,$C as loadExtensions,$d as loadGraphAuditBaseline,Qb as loadMutationCheckpoint,N as loadRelationshipGraphAdapter,zi as locateItem,yT as looksLikeGenericKeyValueEntry,Cw as mapReadOutputRows,cR as markMergeReceiptReconciled,AE as matchesRuntimeFilters,RA as maybeRunFirstUseTelemetryPrompt,sy as measureCorpusShapePlan,Gi as measureItemMetadataReadWork,_T as mergeAdditiveTags,Pk as mergeExtensionBlueprints,QO as mergeHistoryStreams,oR as mergeItemDocuments,nR as mergeJsonDocuments,Ah as mergeLinkedTestTwoTokenEntries,eR as mergeRelationshipEventStreams,ju as mergeSortedWarnings,AA as migrateItemFilesToFormat,WE as mutateItem,KE as mutateItemWithHistoryContext,aE as mutateWorkspaceJsonWithHistory,qf as next,$n as normalizeAgentProvenanceAdapterValue,su as normalizeAnnotationTransportOptions,Wv as normalizeAssuranceEvaluation,Kv as normalizeAssuranceMutation,vh as normalizeBootstrapInvocation,IT as normalizeBulkIdsValue,Qc as normalizeDependencyGraphTarget,vO as normalizeDependencySeedId,AO as normalizeDependencySourceKind,sn as normalizeExtensionContributionInventory,HO as normalizeInvalidHistoryProvenance,ok as normalizeItemAddressInvocation,Cn as normalizeItemFormatVersion,$i as normalizeItemId,En as normalizeItemMetadata,OO as normalizeItemReference,wh as normalizeLegacyExtensionActionSyntax,Pl as normalizeLinkedPath,pE as normalizeParentReferenceValue,Xt as normalizeProfileName,Di as normalizeRawItemId,Qw as normalizeReadOutputIncludeModeOptions,WS as normalizeReplayPatchOps,es as normalizeSimilarityText,$T as normalizeStatusForRegistry,Sn as normalizeStatusInput,xT as normalizeStatusInputWithRegistry,dk as normalizeThrownExitCode,Wf as notes,zo as nowIso,Md as openDurableGraphCache,LM as openMcpRequestState,U0 as openPmEpisode,ud as orderingPredecessors,pd as orderingSuccessors,TI as packContextCandidates,Nu as packRankedContextItems,ch as packageActivate,ah as packageCatalog,dh as packageDeactivate,ih as packageDescribe,oh as packageDoctor,th as packageInstall,Q_ as packageLifecycle,eh as packageList,nh as packageManage,yb as packageMigrate,sh as packageReload,rh as packageUninstall,uw as paginateQueryRows,El as parseAddEntries,Al as parseAddGlobEntries,du as parseAnnotationTextInput,yk as parseAtomicMutationControls,Ch as parseBootstrapCommandName,gh as parseBootstrapGlobalOptions,bh as parseBootstrapHelpRequest,Oh as parseBootstrapTypeValue,RT as parseBulkIdsText,Pu as parseContextDepth,vu as parseContextFocusFields,Iv as parseContextIntentDeclarations,ku as parseContextSections,AI as parseContextSignalSnapshot,gT as parseCsvKv,JA as parseDefectChangeRiskRequest,eI as parseDefectRecurrenceCoverageRequest,YA as parseDefectRecurrencePolicy,zp as parseEvalQuerySet,Gd as parseGraphSubcommand,jv as parseHistoryProvenanceFilters,Nv as parseIntegerLimit,jT as parseItemDocument,bk as parseItemMutationBatch,wE as parseLimit,bp as parseLinkedTestAssertionEqualsMap,Cp as parseLinkedTestAssertionGteMap,mp as parseLinkedTestBoolean,fp as parseLinkedTestContextMode,pp as parseLinkedTestEnvClear,up as parseLinkedTestEnvSet,Tp as parseLinkedTestJsonEntries,yp as parseLinkedTestMinLines,gp as parseLinkedTestRegexList,hp as parseLinkedTestStringList,_p as parseLinkedTestWorkspaceContextMode,$h as parseMcpCachePolicy,Ph as parseMcpImplementation,ot as parseMcpInputRequests,fr as parseMcpInputResponses,ag as parseMcpSubscriptionFilter,Ol as parseMigrateEntries,DR as parseMultiValueFilter,ek as parseMutationReceipt,OT as parseOptionalNonNegativeInteger,vT as parseOptionalNumber,Vx as parsePmAgentTaskTranscriptCorpus,YL as parsePmToolDiscoveryOptions,Lv as parsePriority,jR as parsePriorityFilterSet,Gw as parseReadOutputSession,dT as parseRegisteredItemFieldAssignments,ce as parseRelationshipGraphSnapshot,vl as parseRemoveEntries,Gl as parseSourceLineRange,yE as parseStatusFilterCsv,$R as parseStringFilterSet,fn as parseTags,qm as parseTestRunMeasurements,Dv as parseType,FR as parseTypeFilterSet,Kd as parseUnknownAuthorHistoryEventCoordinates,vw as parseWorkflowPolicy,Ow as parseWorkflowPolicyDocument,UI as partitionDecisionEntries,ZS as patchPathToChangedField,Uo as pathExists,K_ as pauseTask,xd as persistDurableGraphResult,IE as persistSelectedItemFormat,pP as planAgentIdentityVocabularyMutation,kI as planCompletedAtBackfill,yl as planExtensionDirectoryCopy,or as planProfileApplication,Xx as planRelationshipEventBackfill,jd as planRelationshipRemediation,il as planSchemaEvolutionMigration,Vd as planUnknownAuthorHistoryAcknowledgment,rm as planWorkspaceSnapshotRestore,jA as positionalShapeKey,GA as positionalSignatureKey,$k as preflightExtension,rs as prepareSimilarityText,TT as preserveMutationStdinTokenFields,CT as preserveMutationStdinTokenLiterals,PS as printError,IS as printResult,w_ as profile,A_ as profileApply,v_ as profileLint,S_ as profileList,E_ as profileShow,QC as projectAfterCommandItemSnapshot,Ou as projectContextFocusRows,Um as projectFleetAttributionAnalytics,Gv as projectHistoryProvenance,Mi as projectPmDiagnosticOutput,xi as projectPmDiagnosticText,jm as projectProvenanceCoverageAnalytics,eu as projectValidateCounts,bO as promoteAssuranceAssertion,cS as propagateContextUsageServingReceipt,lx as pruneCompileCacheGenerations,dO as putAssuranceDeclaration,lO as putAssuranceDeclarationBundle,DE as queryItemMetadataIndex,$E as queryLinkedFileMetadataIndex,FE as querySimilarItemMetadataIndex,zm as queryTestRunMeasurementsBelow,Zn as quoteCommandArg,Jn as quoteWindowsCommandArg,mk as rankCommandPaths,cu as readAnnotationEntries,Bn as readAuthorEnvironment,nf as readBooleanOption,_S as readContextUsageAffinity,sf as readCsvListOption,ml as readExtensionMigrationState,Bo as readFileIfExists,gs as readFirstStringFromCommanderOptions,ys as readFirstValueFromCommanderOptions,Dm as readHistoryAnalyticsWindow,HT as readHistoryEntries,Hn as readHistorySnapshot,Im as readImprovementLedger,UE as readItemMetadataDerivedIndexState,Vi as readLocatedItem,yw as readOutputBudgetCollections,Lw as readOutputCollectionFingerprint,gw as readOutputContinuationRowCollections,_w as readOutputContinuationRowPaths,Jw as readOutputIncludeModeOptions,hw as readOutputRowCollections,fw as readOutputRowPaths,qw as readOutputSessionRemainingTokens,Ut as readPmPackageManifest,mh as readRequiredString,ji as readSettings,PE as readSettingsWithMetadata,bs as readStringArrayFromCommanderOptions,of as readStringOption,ck as readThrownExitCode,lA as readVectorizationStatusLedger,LE as readWorkflowPolicies,Rw as readWorkflowPolicyField,Pv as readWorkspaceContextIntentContracts,II as readWorkspaceContextSignals,NI as readWorkspaceMemory,LP as readWorkspacePosition,JS as reanchorHistoryEntries,ln as reconcileExtensionCapabilityUsage,dE as reconcileWorkspaceJsonHistory,ZC as recordAfterCommandAffectedItem,pO as recordAssuranceVerdict,Tu as recordClaimSemanticAttribution,pS as recordContextUsageDelivery,uS as recordContextUsageServing,mS as recordContextUsageTouch,fS as recordContextUsageTouches,Su as recordFocusSemanticAttribution,Rm as recordImprovementObservation,wu as recordReleaseSemanticAttribution,BE as refreshItemMetadataDerivedIndex,tl as refreshMergeAttributeFenceIfInstalled,pA as refreshSearchArtifactsForMutation,Dn as registerAgentProvenanceAdapters,SO as registerExternalDependencyResolver,Nn as registerHarnessSignalDescriptors,KT as registerOutputMaterialFieldGroups,U_ as release,uO as removeAssuranceDeclaration,qo as removeFileIfExists,Fl as renameArtifactsResultKey,gu as renderCalendarMarkdown,yu as renderCalendarToon,Gu as renderContextMarkdown,ul as renderExtensionDescribeMarkdown,dl as renderExtensionSurfaceMarkdown,If as renderGuideMarkdown,sk as renderMissingOptionRetry,BI as renderNextMarkdown,_k as renderPmClosedDomainHelp,Qn as renderPmCommand,Go as renderPmCommandAliasMigrationHint,Om as renderPmCommandVisibilityMarkdown,kN as renderPmFlagLexiconMarkdown,w0 as renderPmMcpAppHtml,cN as renderPmRefusalClosureCensusMarkdown,CE as renderRowsAsCsv,TE as renderRowsAsTable,$_ as reopen,tv as replayHistoryToTarget,HS as replayToCanonicalItemDocument,VS as replayToItemDocument,VI as requireTerminalReason,HI as requireTerminalReasonWithRecovery,GS as resealHistoryRewrite,WC as resetActiveExtensionRuntimeState,ad as resetWorkspaceGraphCache,In as resolveAgentSessionContextFromSignals,fu as resolveAnnotationIndex,uu as resolveAnnotationInput,VT as resolveAuthor,Vn as resolveAuthorIdentity,uE as resolveBodyFileContent,ny as resolveBuiltinCorpusShape,hu as resolveCalendarOutputFormat,WP as resolveCanonicalPmErrorCodeContract,AC as resolveCanonicalRelationshipKind,zT as resolveClaimPrincipal,PT as resolveCliBulkIdsInput,gC as resolveCommandOptionPolicyState,dx as resolveCompileCacheGeneration,PI as resolveCompletionTimestamp,uC as resolveConfiguredPmPackageRoot,KR as resolveContentFieldFilters,CS as resolveContextIntentContract,Ru as resolveContextOutputFormat,Iu as resolveContextTokenBudget,rP as resolveCreateExplicitEmptyFlag,yP as resolveEffectiveSearchMode,XE as resolveEmbeddingProviders,bl as resolveExtensionInstallSourceIdentity,pl as resolveExtensionMigrationStatePath,LC as resolveExtensionRoots,EO as resolveExternalDependencyReference,tC as resolveFlagValueKind,Of as resolveGuideOutputFormat,Pm as resolveHistoryEpisodeGroupIdentity,Fv as resolveHistoryProvenanceDimensions,ov as resolveHistorySubject,QA as resolveHistoryTarget,CP as resolveHybridSemanticWeight,en as resolveImplicitPmRoot,Yb as resolveIsoOrRelative,MR as resolveItemBlockers,OR as resolveItemExecutionRole,Ck as resolveItemMutationDocument,Qo as resolveItemTypeRegistry,MT as resolveItemTypesFilePath,Qm as resolveLinkedTestFailureExitCode,Hl as resolveLinkedTestSourceRef,Kl as resolveLinkedTestSourceWorkspaceRoot,Jl as resolveLinkedTestTrust,Zl as resolveLinkedTestTrustBatch,cg as resolveMcpAcknowledgedSubscriptionFilter,Qe as resolveMcpRequestContext,Yd as resolveMergeInstallContext,HR as resolveMissingMetadataFilters,ik as resolveMissingOptionPlaceholder,QT as resolveModePairedOutputOmissionReceipt,jI as resolveNextOutputFormat,rw as resolveOutputOmissionReceipt,lC as resolvePmCliVersion,jo as resolvePmCommandAlias,Ye as resolvePmCommandCapabilityFamily,Vt as resolvePmCommandExitContract,Ii as resolvePmCommandOutputBudget,sr as resolvePmCommandOutputEnvelope,NA as resolvePmCommandPositionalContract,Je as resolvePmCommandVisibilityTier,ki as resolvePmDiagnosticOutputBudget,XP as resolvePmErrorCodeContract,mb as resolvePmFlagSemanticConcept,De as resolvePmHistoryOperation,dC as resolvePmPackageRootFromModule,LA as resolvePmPositionalActionContract,Ec as resolvePmPositionalActionFlagContracts,Fe as resolvePmRoot,Oc as resolvePmToolCustomFieldCollision,hE as resolvePriority,Yt as resolveProfile,Qd as resolveProjectMergeTypeFolders,lw as resolveQueryCursorStart,eS as resolveReadOutputDimensions,nS as resolveReadOutputEncoding,ww as resolveReadOutputRecoveryBudget,Xw as resolveReadOutputSurface,tw as resolveReadRowContract,nk as resolveRecoveryCommandName,uT as resolveRegisteredSearchProvider,pT as resolveRegisteredVectorStoreAdapter,cs as resolveReproducibleProcessEnvironment,hn as resolveRuntimeFieldRegistry,_n as resolveRuntimeStatusRegistry,YE as resolveSearchCorpusFields,gP as resolveSearchMaxResults,hP as resolveSearchPage,bP as resolveSearchScoreThreshold,TP as resolveSearchTuning,ZE as resolveSemanticCorpusCharacterLimit,Cu as resolveSemanticLineageIds,ME as resolveSettingsWithSemanticRuntimeDefaults,LO as resolveSourceContextWritePolicy,Cm as resolveStartTaskInProgressStatus,te as resolveSubcommandFlagContractsForCommand,zb as resolveTelemetryErrorCategory,zI as resolveTerminalReason,hC as resolveTypeDefinition,_C as resolveTypeName,bE as resolveTypeSynonym,vE as resolveTypeWorkflows,Hd as resolveUnknownAuthorAcknowledgmentSelector,EP as resolveVectorIndexRecovery,tA as resolveVectorStores,Kc as resolveWorkspaceRelationshipKindRegistry,bC as resolveWorkspaceRoot,z_ as restore,eC as restoreCheckpointItems,lE as restoreWorkspaceJsonFromHistory,nm as restoreWorkspaceSnapshot,om as restoreWorkspaceSnapshotWithRecovery,_h as runAction,rT as runActiveBeforeMutationHooks,nT as runActiveCommandHandler,oT as runActiveOnIndexHooks,mn as runActiveOnReadHooks,pn as runActiveOnWriteHooks,iT as runActiveParserOverride,sT as runActivePreflightOverride,aT as runActiveServiceOverride,Hc as runActivity,NC as runAfterCommandHooks,nu as runAggregate,mu as runAnnotationCommand,iu as runAppend,nI as runAssuranceAction,iI as runAssuranceDispatch,xC as runBeforeCommandHooks,bu as runCalendar,Vu as runClaim,Hu as runClaimNext,Xu as runClose,Ju as runCloseMany,Zu as runComments,Pf as runCompletion,xp as runConfig,zt as runContext,bI as runContextEvaluationCorpus,gI as runContextEvaluationScenario,Rp as runCopy,wp as runCreate,Ip as runDelete,cd as runDeps,jl as runDocs,tk as runDuplicates,Kp as runEval,Xp as runEvent,Cl as runExtension,hl as runExtensionMigrateAction,_l as runExtensionMigrations,Bl as runFiles,zl as runFilesDiscover,ql as runFilesLookup,Gm as runFleetAttributionAnalytics,Pp as runFocus,Mp as runGc,kp as runGet,Ud as runGraph,Rf as runGuide,Tl as runHealth,eP as runHistory,jP as runHistoryCompact,BP as runHistoryCompactBulk,yR as runHistoryMaintenance,FP as runHistoryRedact,CR as runHistoryRepair,wR as runHistoryRepairAll,Gp as runInit,$p as runInitAgentGuidance,Qu as runLearnings,$l as runLinkedArtifacts,ef as runLinkedTests,ou as runList,Wp as runMeet,RP as runMergeDriver,rl as runMergeInstall,lR as runMergeReceiptEvidenceReport,dR as runMergeReceiptReport,IP as runMergeReconcile,qu as runNext,ep as runNotes,Op as runPlan,fm as runProfileApply,mm as runProfileLint,um as runProfileList,pm as runProfileShow,Fm as runProvenanceCoverageAnalytics,Gk as runRegisteredCommandForTest,Vk as runRegisteredCommandOverrideForTest,Zk as runRegisteredExporterForTest,Bk as runRegisteredHookForTest,Jk as runRegisteredImporterForTest,Yk as runRegisteredMigrationForTest,Uk as runRegisteredMutationGuardForTest,qk as runRegisteredParserOverrideForTest,zk as runRegisteredPreflightOverrideForTest,Hk as runRegisteredRendererOverrideForTest,Wk as runRegisteredSearchProviderForTest,Kk as runRegisteredServiceOverrideForTest,Xk as runRegisteredVectorStoreAdapterForTest,ar as runReindex,Ku as runRelease,Yp as runRemind,qP as runReopen,Yu as runRestore,sl as runSchemaEvolutionMigration,Vp as runSearch,ay as runSearchRefreshWorkerEntrypoint,kf as runStartBackgroundRun,Hm as runStats,Wm as runTelemetry,dm as runTemplatesList,cm as runTemplatesSave,lm as runTemplatesShow,tf as runTest,rf as runTestAll,Mf as runTestRunsList,Nf as runTestRunsLogs,Df as runTestRunsResume,xf as runTestRunsStatus,Lf as runTestRunsStop,$f as runTestRunsWorker,Sp as runUpdate,Ep as runUpdateMany,Ht as runUpgrade,ru as runValidate,fh as runWithActiveExtensions,D as runWithAgentSessionContext,yS as runWithContextIntentContracts,xv as runWithDiscoveredContextIntentContracts,Fn as runWithHarnessDetectionSignals,m0 as runWithMcpTraceContext,ls as runWithReproducibleProcessEnvironment,jn as runWithWorkspaceHarnessSignalDescriptors,Yr as runWithWorkspaceRecipe,VO as runWorkflowPolicyAction,lP as runWorkspaceTransactionGc,Fd as saveGraphAuditBaseline,IO as scanExtensionHostVersions,zd as scanHistoryAuthorAttribution,wn as scanItemFormatVersions,Wi as scanMutationSecrets,WO as scanProvenanceResolverHealth,ss as scanStaleInProgressItems,vR as scanStorageIntegrity,i_ as schema,p_ as schemaAddField,l_ as schemaAddStatus,c_ as schemaAddType,h_ as schemaApplyPreset,g_ as schemaInferTypes,s_ as schemaList,f_ as schemaListFields,C_ as schemaRemapStatus,m_ as schemaRemoveField,u_ as schemaRemoveStatus,d_ as schemaRemoveType,b_ as schemaRenameField,y_ as schemaRenameType,a_ as schemaShow,__ as schemaShowField,T_ as schemaShowStatus,pk as scoreCommandPathMatch,mI as scoreContextCandidates,fI as scoreContextCandidatesWithActiveExtensions,os as scoreItemSimilarity,TN as scorePmGrammarRefusalClosure,uN as scorePmRefusalClosure,ns as scorePreparedItemSimilarity,EN as scoreTrackerPreflightRecoveryClosure,FS as sealHistoryRecord,NM as sealMcpRequestState,Uf as search,$I as searchWorkspaceMemory,FI as searchWorkspaceMemoryReadResult,NR as selectActionableEntries,nw as selectCursorSemanticOptions,Sf as selectImportAuthor,c0 as selectMcpClientRegistrationMode,DI as selectWorkspaceMemory,LI as selectWorkspaceMemoryRollups,Au as semanticAttributionAffinity,yA as sentryCaptureCliError,gA as sentryFinishCommandSpan,CA as sentryFlush,bA as sentryLogCliUsageError,_A as sentrySetCommandContext,hA as sentryStartCommandSpan,vn as serializeItemDocument,hk as serializeNdjsonRows,gk as serializeNdjsonStream,Yg as serveDeclaredObservation,XC as setActiveCommandContext,YC as setActiveCommandResult,BC as setActiveExtensionCommands,UC as setActiveExtensionHooks,qC as setActiveExtensionParsers,zC as setActiveExtensionPreflight,KC as setActiveExtensionRegistrations,HC as setActiveExtensionRenderers,VC as setActiveExtensionServices,BT as setFocusedItem,OA as shouldCompletePlanOnClose,Dd as shouldPersistDurableGraphCache,ET as shouldResolveMutationStdinTokenField,ST as shouldResolveMutationStdinTokens,NE as shouldRunSearchRefreshInForeground,rp as similarityAdvisoryWarnings,mw as sliceReadOutputRowCollection,Nl as sortLinkedArtifacts,mT as splitAcceptanceCriteria,EA as splitCommaList,An as splitFrontMatter,tS as stabilizeReadOutputReceiptEstimates,P as stableStringify,MC as stableValueEquals,H_ as startTask,IA as startTelemetryCommand,Vf as stats,NT as statusIsTerminal,yh as stripGlobalBootstrapTokens,MP as subscribeMutationEventBatches,xP as subscribeMutationEvents,uP as summarizeAgentIdentityVocabulary,Mm as summarizeAgentModelProvenance,xm as summarizeAgentProvenance,yI as summarizeContextEvaluationReports,Xm as summarizeContextPreflight,qv as summarizeHistoryProvenance,Fp as summarizeInitResult,iR as summarizeMergeReceipt,oP as supportsCreateExplicitEmpty,rk as supportsItemIdAlias,aC as suppressHostOutput,Pe as syncRelationshipGraphAdapter,Nk as synthesizeExtensionManifest,Ac as toCompletionFlagString,Fu as toContextFocusItem,Lu as toContextPackingSummary,Du as toContextRankingSummary,Hb as toErrorMessage,cf as toEstimatedMinutesValue,bv as toExtensionFlagDefinitions,mf as toImportBoolean,gf as toImportConfidence,pf as toImportInteger,Tf as toImportLinkedDocs,Cf as toImportLinkedFiles,wf as toImportLinkedTests,bf as toImportLogEntries,yf as toImportNormalizedEnum,hf as toImportNumberMap,df as toImportPriority,uf as toImportStatus,ff as toImportStringList,_f as toImportStringMap,lf as toImportTags,GT as toItemRecord,af as toNonEmptyImportString,Vb as toNonEmptyStringOrUndefined,KS as toReplayDocument,ts as tokenizeSimilarityText,wT as transferMutationStdinTokenPolicy,TC as translateHostEnvironmentFault,D_ as update,lh as upgrade,O_ as validate,eO as validateAssertionDefinition,rO as validateAssuranceDocument,tO as validateGateDefinition,wk as validateItemMutationRows,Dl as validateLinkedPaths,d0 as validateMcpAuthorizationResponseIssuer,a0 as validateMcpAuthorizationServerMetadata,l0 as validateMcpClientMetadataDocument,QM as validateMcpHttpRequestHeaders,FM as validateMcpJsonSchema,Qv as validateMeasurementDefinition,fE as validateMissingParentReference,Yw as validateReadOutputOptions,gE as validateSprintOrReleaseValue,yC as validateTypeOptions,VP as verifyCliFlagInvocationParity,FA as verifyExplicitPositionalSlotCensus,YS as verifyHistoryChain,XS as verifyHistoryChainWithVersion,nv as verifyHistoryEntries,jS as verifyHistoryRecordHash,US as verifyHistoryRewriteEvidence,BA as verifyPmCliGrammar,UA as verifyPmCommandPositionalContracts,PN as verifyPmFlagLexicon,rN as verifyPmRecoveryKindRuntimeCoverage,ob as verifyPmRecoveryProducerRuntimeCoverage,tN as verifyPmRecoveryReferences,sN as verifyPmRefusalClosureIdentityRatchet,iN as verifyPmRefusalClosureRatchet,eN as verifyPmRefusalReachability,vs as verifyToolOptionCliParity,zs as withFlagAliasMetadata,wC as withHostEnvironmentBoundary,$M as withMcpCachePolicy,Pw as workflowApprovalFingerprint,kw as workflowPolicyApplies,Iw as workflowPolicyFingerprint,sd as workspaceGraphCache,pu as wrapOwnershipConflict,uk as wrapThrownErrorForSentry,qn as writeAuthorEnvironment,$e as writeFileAtomic,Zb as writeMutationCheckpoint,kE as writeSettings,RS as writeStderr,OS as writeStdout,uA as writeVectorizationStatusLedger,cE as writeWorkspaceJsonWithHistory};
|
|
25
|
+
</html>`}import{createHash as lt}from"node:crypto";import{lstat as Hg,readdir as Xr,readFile as Kg}from"node:fs/promises";import k from"node:path";import{parseDocument as Wg}from"yaml";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="6bfbe073-3869-5451-9d65-499960a28af9")}catch{}})();var Br="io.modelcontextprotocol/skills",ut="SEP-2640@a3e147ca2710f68214247aecc729731ee1ae8d03",Xg=Object.freeze({revision:ut,status:"draft",directoryRead:!0});function j0(e,t=!1){let r=e.clientCapabilities.extensions,o=_(r)?r[Br]:void 0;if(!_(o)||o.revision!==ut||t&&o.directoryRead!==!0)throw new p("Missing or incompatible Skills over MCP draft capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[Br]:Xg}}})}var M=Object.freeze({maxFilesPerSkill:512,maxFileBytes:16*1024*1024,maxSkillBytes:16*1024*1024,defaultPageSize:20,maxPageSize:100}),qr=100,Yg=32*1024*1024,Jg=/^[a-z0-9]+(?:-[a-z0-9]+)*$/u,zr=new Set(Array.from({length:M.maxPageSize},(e,t)=>t+1));function T(e,t){throw new p(e,-32602,t)}function Vr(e,t){try{return new TextDecoder("utf-8",{fatal:!0}).decode(t),e.endsWith(".md")?"text/markdown":"text/plain"}catch{return"application/octet-stream"}}function Zg(e,t){let r=/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/u.exec(e);r||T(`Skill ${t} is missing YAML frontmatter.`);let o=Wg(r[1],{prettyErrors:!1,strict:!0,uniqueKeys:!0});o.errors.length>0&&T(`Skill ${t} has invalid YAML frontmatter.`,{errors:o.errors.map(i=>i.message)});let n;try{n=o.toJS({maxAliasCount:0})}catch(i){T(`Skill ${t} has unsupported YAML aliases.`,{error:String(i)})}return(typeof n!="object"||n===null||Array.isArray(n))&&T(`Skill ${t} frontmatter must be an object.`),n}async function Qg(e,t,r,o){return r>M.maxFileBytes&&T(`Skill resource exceeds the per-file limit: ${t}.`),o.files+=1,o.files>M.maxFilesPerSkill&&T(`Skill exceeds ${M.maxFilesPerSkill} files.`),o.skillBytes+=r,o.skillBytes>M.maxSkillBytes&&T(`Skill exceeds the aggregate byte limit: ${t}.`),o.originBytes.value+=r,o.originBytes.value>Yg&&T(`Skill origin exceeds the aggregate byte limit: ${t}.`),Kg(e)}async function Yr(e,t,r){let o=k.join(e,t),n=await Xr(o,{withFileTypes:!0}),i=[];for(let s of n.sort((a,c)=>a.name.localeCompare(c.name))){let a=k.posix.join(t.split(k.sep).join("/"),s.name),c=k.join(e,...a.split("/")),d=await Hg(c);d.isSymbolicLink()&&T(`Skill resource must not be a symbolic link: ${a}.`),d.isDirectory()?i.push(...await Yr(e,a,r)):d.isFile()?i.push({relative:a,bytes:await Qg(c,a,d.size,r)}):T(`Skill resource must be a regular file or directory: ${a}.`)}return i}async function Hr(e,t,r){let o=new Map,n;try{n=await Xr(e,{withFileTypes:!0})}catch(a){if(vt(a))return o;throw a}let i=n.filter(a=>a.isDirectory()&&Jg.test(a.name)).sort((a,c)=>a.name.localeCompare(c.name));i.length>qr&&T(`Skill origin exceeds ${qr} directories.`);let s={value:0};for(let a of i){let c=await Yr(k.join(e,a.name),"",{files:0,skillBytes:0,originBytes:s}),d=c.reduce((h,C)=>h+C.bytes.byteLength,0),l=c.find(h=>h.relative==="SKILL.md");if(!l)continue;let u=Zg(l.bytes.toString("utf8"),a.name);u.name!==a.name&&T(`Skill directory ${a.name} must match frontmatter name.`,{actual:u.name??null,expected:a.name}),(typeof u.description!="string"||u.description.trim().length===0)&&T(`Skill ${a.name} requires a non-empty frontmatter description.`,{required:["description"]});let f=c.map(h=>({uri:`skill://${a.name}/${h.relative}`,digest:`sha256:${lt("sha256").update(h.bytes).digest("hex")}`,size:h.bytes.byteLength})),g=lt("sha256").update(f.map(h=>`${h.uri}:${h.digest}`).join(`
|
|
26
|
+
`)).digest("hex");o.set(a.name,{uri:`skill://${a.name}/SKILL.md`,frontmatter:u,resources:f,_meta:{contractVersion:1,extensionRevision:ut,origin:t,packageVersion:r,protocolVersion:H,trust:"untrusted",estimatedTokens:Math.ceil(d/4)},files:new Map(c.map(h=>[h.relative,h.bytes])),fingerprint:g})}return o}function Kr(e){let{files:t,fingerprint:r,...o}=e;return o}var Wr=class e{#e;#t;constructor(t){this.#e=t,this.#t=lt("sha256").update([...t.entries()].sort(([r],[o])=>r.localeCompare(o)).map(([r,o])=>`${r}:${o.fingerprint}`).join(`
|
|
27
|
+
`)).digest("hex").slice(0,16)}#r(t,r){if(!t)return 0;try{let o=JSON.parse(Buffer.from(t,"base64url").toString("utf8"));return(typeof o!="object"||o===null||!("fingerprint"in o)||o.fingerprint!==this.#t||!("scope"in o)||o.scope!==r||!("offset"in o)||!Number.isInteger(o.offset)||Number(o.offset)<0)&&T("Skill cursor is invalid or stale."),Number(o.offset)}catch(o){if(o instanceof p)throw o;return T("Skill cursor is invalid or stale.")}}#o(t,r){return Buffer.from(JSON.stringify({fingerprint:this.#t,offset:t,scope:r})).toString("base64url")}static async load(t){let r=await Hr(k.join(t.packageRoot,".agents","skills"),"package",t.packageVersion);if(t.workspaceRoot){let o=k.resolve(t.packageRoot,".agents","skills"),n=k.resolve(t.workspaceRoot,".agents","skills");if(n!==o){let i=await Hr(n,"workspace",t.packageVersion);for(let[s,a]of i)r.set(s,a)}}return new e(r)}list(t={}){let r=t.limit??M.defaultPageSize;zr.has(r)||T(`Skill list limit must be an integer from 1 to ${M.maxPageSize}.`);let o=this.#r(t.cursor,"skills/list"),n=[...this.#e.values()].sort((c,d)=>c.uri.localeCompare(d.uri)),i=n.slice(o,o+r),s=o+i.length,a=s<n.length;return{skills:i.map(Kr),hasMore:a,...a?{nextCursor:this.#o(s,"skills/list")}:{}}}get(t){let r=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)\/SKILL\.md$/u.exec(t),o=r?this.#e.get(r[1]):void 0;return o||T(`Unknown pm MCP skill: ${t}.`,{field:"uri"}),Kr(o)}read(t){let r=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)\/(.+)$/u.exec(t),o=r?this.#e.get(r[1]):void 0,n=r?.[2]??"",i=o&&n?o.files.get(n):void 0,s=o?.resources.find(d=>d.uri===t);(!o||!i||!s)&&T(`Unknown pm MCP skill resource: ${t}.`,{field:"uri"});let a={digest:s.digest,origin:o._meta.origin,trust:"untrusted"},c=Vr(n,i);return c!=="application/octet-stream"?{contents:[{uri:t,mimeType:c,text:i.toString("utf8"),_meta:a}]}:{contents:[{uri:t,mimeType:c,blob:i.toString("base64"),_meta:a}]}}readDirectory(t,r={}){let o=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)(?:\/(.+))?$/u.exec(t),n=o?this.#e.get(o[1]):void 0;n||T(`Unknown pm MCP skill directory: ${t}.`,{field:"uri"});let i=(o?.[2]??"").replace(/\/$/u,""),s=i.length>0?`${i}/`:"",a=`skill://${o[1]}`,c=new Map;for(let C of n.resources){let S=C.uri.slice(`${a}/`.length);if(!S.startsWith(s))continue;let z=S.slice(s.length),[R,...At]=z.split("/"),$o=`${a}/${s}${R}`,Fo=n.files.get(`${s}${R}`);c.set(R,{uri:$o,name:R,mimeType:At.length>0?"inode/directory":Vr(R,Fo)})}i.length>0&&c.size===0&&T(`Unknown pm MCP skill directory: ${t}.`,{field:"uri"});let d=r.limit??M.maxPageSize;zr.has(d)||T(`Skill directory limit must be an integer from 1 to ${M.maxPageSize}.`);let l=this.#r(r.cursor,t),u=[...c.values()].sort((C,S)=>C.uri.localeCompare(S.uri)),f=u.slice(l,l+d),g=l+f.length,h=g<u.length;return{resources:f,hasMore:h,...h?{nextCursor:this.#o(g,t)}:{}}}};(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="38023567-8a5b-5e25-8d71-5112f74d1894")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="76fdc288-42b3-52b9-adc7-81e504f23ae3")}catch{}})();var Jr="https://schema.unbrained.dev/pm/workspace-recipe/v1";function pt(e,t){if(e===null||typeof e=="boolean"||typeof e=="string")return e;if(typeof e=="number"){if(!Number.isFinite(e))throw new Error(`Workspace recipe JSON number must be finite at ${t}`);return e}if(Array.isArray(e))return Object.freeze(e.map((r,o)=>pt(r,`${t}[${o}]`)));if(typeof e!="object"||Object.getPrototypeOf(e)!==Object.prototype&&Object.getPrototypeOf(e)!==null)throw new Error(`Workspace recipe input must contain JSON values at ${t}`);return Object.freeze(Object.fromEntries(Object.entries(e).map(([r,o])=>[r,pt(o,`${t}.${r}`)])))}function Ae(e){if(e.schema!==Jr)throw new Error(`Unsupported workspace recipe schema: ${e.schema}`);let t=Ot(e);if(e.operations.some(r=>r.action.trim().length===0||r.input===null||Array.isArray(r.input)))throw new Error("Workspace recipe operations require an action and object input");return Object.freeze({...t,operations:Object.freeze(e.operations.map((r,o)=>Object.freeze({action:r.action,input:pt(r.input,`operations[${o}].input`)})))})}async function Zr(e,t){let r=Ae(e);return It(r,t)}async function ey(e,t){return Zr(e,async()=>{let r=[];for(let[o,n]of e.operations.entries())r.push(await t(n,o));return r})}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="6e293af6-ee81-59b4-8d80-05e5c20bdcf1")}catch{}})();var Qr="pm.agent-observation/v1",eo="pm.agent-verdict/v1",to="pm.agent-episode/v1";function I(e,t){if(!Number.isSafeInteger(e)||e<=0)throw new Error(`${t} must be a positive safe integer.`)}function x(e,t){if(e.trim().length===0)throw new Error(`${t} must not be empty.`)}function ne(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let t of Object.values(e))ne(t)}return e}function ty(e){if(e.length===0)throw new Error("observation.reads must declare at least one bounded read.");let t=0;for(let r of e)if(x(r.command,"observation.reads.command"),I(r.budget_tokens,"observation.reads.budget_tokens"),t+=r.budget_tokens,!Number.isSafeInteger(t))throw new Error("observation read ceilings exceed safe integer range.")}function ry(e){if(e.basis!=="emitted_bytes")throw new Error("observation calibration must use emitted_bytes.");for(let r of e.samples)if(!Number.isSafeInteger(r)||r<0)throw new Error("observation calibration samples must be non-negative safe integers.");if(e.samples.length===0)throw new Error("observation calibration must include at least one sample.");if(I(e.expected_emitted_bytes,"observation.calibration.expected_emitted_bytes"),!Number.isSafeInteger(e.tolerance_bytes)||e.tolerance_bytes<0)throw new Error("observation.calibration.tolerance_bytes must be a non-negative safe integer.");let t=e.samples.reduce((r,o)=>r+o,0)/e.samples.length;if(Math.abs(t-e.expected_emitted_bytes)>e.tolerance_bytes)throw new Error("observation expected_emitted_bytes is outside the calibrated sample tolerance.")}function oy(e){if(e.length===0)throw new Error("observation.tiers must declare a degradation ladder.");let t=new Set,r=Number.POSITIVE_INFINITY;for(let o of e){if(x(o.id,"observation.tiers.id"),I(o.max_tokens,"observation.tiers.max_tokens"),t.has(o.id))throw new Error(`Duplicate observation tier: ${o.id}.`);if(t.add(o.id),o.max_tokens>r)throw new Error("observation tiers must be ordered from largest to smallest max_tokens.");r=o.max_tokens;let n=new Set;for(let i of o.fields){if(F(i,"observation.tiers.fields"),n.has(i))throw new Error(`Duplicate observation tier field: ${i}.`);n.add(i)}}}function ny(e){if(e.schema!==Qr)throw new Error(`observation.schema must be ${Qr}.`);return x(e.id,"observation.id"),I(e.version,"observation.version"),ty(e.reads),ry(e.calibration),e.corpus_dependence.kind==="bounded"&&(x(e.corpus_dependence.dimension,"observation.corpus_dependence.dimension"),I(e.corpus_dependence.maximum,"observation.corpus_dependence.maximum")),oy(e.tiers),ne(structuredClone(e))}function W0(e){return{contract_id:e.id,contract_version:e.version,guaranteed_ceiling_tokens:e.reads.reduce((t,r)=>t+r.budget_tokens,0),expected_emitted_bytes:e.calibration.expected_emitted_bytes,expected_tokens:Math.ceil(e.calibration.expected_emitted_bytes/4),tolerance_bytes:e.calibration.tolerance_bytes,calibration_basis:"emitted_bytes",corpus_dependence:e.corpus_dependence}}async function iy(e,t,r){I(r.budget_tokens,"observation request budget_tokens");let o=[];for(let[n,i]of e.tiers.entries()){o.push(i.id);let s=await t(i),a=Buffer.byteLength(P(s),"utf8"),c=Math.ceil(a/4);if(c<=Math.min(r.budget_tokens,i.max_tokens))return{status:"served",payload:s,receipt:{contract_id:e.id,contract_version:e.version,served_tier:i.id,degraded:n>0,attempted_tiers:o,emitted_bytes:a,estimated_tokens:c,calibration_basis:"emitted_bytes"}}}return{status:"refused",reason:"no_declared_tier_fits_budget",receipt:{contract_id:e.id,contract_version:e.version,served_tier:null,degraded:e.tiers.length>1,attempted_tiers:o,emitted_bytes:null,estimated_tokens:null,calibration_basis:"emitted_bytes"}}}function F(e,t){let r=e.split(".");if(r.some(o=>o.length===0||o==="__proto__"||o==="prototype"||o==="constructor"))throw new Error(`${t} must be a safe, non-empty dot-separated path.`);return r}function ro(e,t){let r=e;for(let o of F(t,"recorded field path")){if(r===null||typeof r!="object"||!Object.hasOwn(r,o))return;r=r[o]}return r}function sy(e){return`/${F(e,"verdict predicate path").map(t=>t.replaceAll("~","~0").replaceAll("/","~1")).join("/")}`}function ay(e){if(e.kind!=="field_equals")return;let t;try{t=JSON.stringify(e.expected)}catch{throw new Error(`Expected value for verdict predicate ${e.id} must be JSON serializable.`)}if(t===void 0)throw new Error(`Expected value for verdict predicate ${e.id} must be JSON serializable.`)}function cy(e){if(e.schema!==eo)throw new Error(`verdict.schema must be ${eo}.`);x(e.id,"verdict.id"),I(e.version,"verdict.version");let t=new Set;for(let o of e.predicates){x(o.id,"verdict.predicates.id"),F(o.path,"verdict.predicates.path");let n=o.kind;if(n!=="field_equals"&&n!=="field_present"&&n!=="field_absent")throw new Error(`Unsupported verdict predicate kind for ${o.id}.`);if(t.has(o.id))throw new Error(`Duplicate verdict predicate: ${o.id}.`);ay(o),t.add(o.id)}if(e.composition.operator!=="all"&&e.composition.operator!=="any")throw new Error("verdict composition operator must be all or any.");if(e.composition.predicate_ids.length!==e.predicates.length)throw new Error("verdict composition must reference every predicate exactly once.");let r=new Set(e.composition.predicate_ids);if(r.size!==e.composition.predicate_ids.length||[...r].some(o=>!t.has(o)))throw new Error("verdict composition contains duplicate or unknown predicate ids.");return ne(structuredClone(e))}function dy(e,t){if(e.predicates.length===0)return{contract_id:e.id,contract_version:e.version,snapshot_id:t.snapshot_id,outcome:"not_applicable",score:null,policy:"verdict_only_no_reward",reason:"no_predicates_declared",predicates:[]};let r=new Map(e.predicates.map(s=>[s.id,s])),o=e.composition.predicate_ids.map(s=>{let a=r.get(s),c=ro(t.state,a.path),d=a.kind==="field_present"?c!==void 0:a.kind==="field_absent"?c===void 0:P(c)===P(a.expected);return{id:s,outcome:d?"satisfied":"violated",evidence_pointer:`${t.snapshot_id}#${sy(a.path)}`,evidence_digest:Mt(P(c))}}),n=o.filter(s=>s.outcome==="satisfied").length,i=e.composition.operator==="all"?n===o.length:n>0;return{contract_id:e.id,contract_version:e.version,snapshot_id:t.snapshot_id,outcome:i?"satisfied":"violated",score:n/o.length,policy:"verdict_only_no_reward",predicates:o}}function X0(e){if(e.schema!==to)throw new Error(`episode.schema must be ${to}.`);if(x(e.id,"episode.id"),I(e.version,"episode.version"),!["benchmark","evaluation","training","scale_transfer"].includes(e.mode))throw new Error("episode.mode is not supported.");if(e.task_item_ids.length===0)throw new Error("episode.task_item_ids must declare at least one pm item.");for(let t of e.task_item_ids)x(t,"episode.task_item_ids");I(e.limits.max_actions,"episode.limits.max_actions"),I(e.limits.max_observations,"episode.limits.max_observations"),I(e.limits.max_tokens_per_observation,"episode.limits.max_tokens_per_observation");for(let t of e.observable_fields)F(t,"episode.observable_fields");for(let t of e.withheld_fields)F(t,"episode.withheld_fields");for(let t of e.observable_fields){let r=e.withheld_fields.find(o=>t===o||t.startsWith(`${o}.`)||o.startsWith(`${t}.`));if(r!==void 0)throw new Error(`Observable field ${t} overlaps withheld field ${r}.`)}for(let t of e.observation.tiers)for(let r of t.fields)if(!e.observable_fields.includes(r))throw new Error(`Observation tier field ${r} is not declared observable.`);return ny(e.observation),cy(e.verdict),Ae(e.recipe),ne(structuredClone(e))}function ly(e,t,r){let o=F(t,"observation projection field"),n=e;for(let[i,s]of o.entries()){if(i===o.length-1){r!==void 0&&(n[s]=structuredClone(r));return}let a=n[s];(a===null||typeof a!="object"||Array.isArray(a))&&(n[s]={}),n=n[s]}}function uy(e,t){let r={};for(let o of t)ly(r,o,ro(e,o));return r}async function Y0(e,t){let r=[],o=0,n=0,i=!1,s,a={episode:{id:e.id,label:`pm agent environment v${e.version}`},provenance:{role:e.mode,topic:"agent-environment"}},c=await D(a,()=>t.reset(e.recipe));r.push({sequence:1,kind:"reset",state_id:c.state_id});let d=async()=>{if(i)throw new Error("episode is already closed.");if(n>=e.limits.max_observations)throw new Error("episode exceeded limits.max_observations.");n+=1;let u=await t.readRecordedState(),f=await iy(e.observation,async g=>uy(u.state,g.fields),{budget_tokens:e.limits.max_tokens_per_observation});return r.push({sequence:r.length+1,kind:"observation",state_id:f.receipt.served_tier??u.snapshot_id}),f},l=async(u=!1)=>{if(i&&!u)throw new Error("episode is already closed.");if(n>=e.limits.max_observations)throw new Error("episode exceeded limits.max_observations.");n+=1;let f=await t.readRecordedState(),g=dy(e.verdict,f);return r.push({sequence:r.length+1,kind:"verdict",state_id:f.snapshot_id}),g};return{observe:()=>D(a,d),step:async u=>{if(i)throw new Error("episode is already closed.");if(o>=e.limits.max_actions)throw new Error("episode exceeded limits.max_actions.");o+=1;let f=await D(a,()=>t.execute(u));return r.push({sequence:r.length+1,kind:"action",state_id:f.state_id}),f},score:()=>D(a,l),close:()=>s!==void 0?s:i?Promise.reject(new Error("episode is already closed.")):(i=!0,s=D(a,()=>l(!0)).then(f=>(r.push({sequence:r.length+1,kind:"close",state_id:f.snapshot_id}),{verdict:f,trajectory:ne(structuredClone(r))})).catch(f=>{throw i=!1,f}).finally(()=>{s=void 0}),s)}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="9394fb87-fb36-5886-b262-ce2787326053")}catch{}})();var j="https://schema.unbrained.dev/pm/corpus-shape/v1";function W(e,t){if(!Number.isSafeInteger(e)||e<=0)throw new TypeError(`Corpus shape ${t} must be a positive safe integer`);return e}function ie(e,t){if(!Number.isSafeInteger(e)||e<0)throw new TypeError(`Corpus shape ${t} must be a non-negative safe integer`);return e}function no(e){if(!(typeof e!="object"||e===null||Object.isFrozen(e))){for(let t of Object.values(e))no(t);Object.freeze(e)}}function X(e){if(e.schema!==j)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(W(e.hierarchy_depth,"hierarchy_depth"),W(e.hierarchy_fanout,"hierarchy_fanout"),ie(e.age_span_days,"age_span_days"),W(e.history_entries_per_item,"history_entries_per_item"),ie(e.comments_per_100_items,"comments_per_100_items"),ie(e.notes_per_100_items,"notes_per_100_items"),ie(e.learnings_per_100_items,"learnings_per_100_items"),W(e.author_cardinality,"author_cardinality"),W(e.component_count,"component_count"),e.edge_kind_mix.length===0||e.edge_kind_mix.some(r=>r.kind.trim().length===0||r.weight<=0))throw new TypeError("Corpus shape edge_kind_mix requires non-empty kinds with positive weights");if(e.terminal_statuses.some(r=>!e.custom_statuses.includes(r)))throw new TypeError("Corpus shape terminal_statuses must be declared in custom_statuses");let t=structuredClone(e);return no(t),t}var ve=[{kind:"implements",weight:5},{kind:"blocked_by",weight:2},{kind:"discovered_from",weight:2},{kind:"verifies",weight:2},{kind:"supersedes",weight:1},{kind:"related",weight:4}],Y=Object.freeze({scratch:X({schema:j,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:X({schema:j,name:"representative",description:"Medium-lived project with rich evidence and typed lineage.",hierarchy_depth:5,hierarchy_fanout:8,age_span_days:730,history_entries_per_item:12,comments_per_100_items:30,notes_per_100_items:12,learnings_per_100_items:10,edge_kind_mix:ve,author_cardinality:32,component_count:1,include_cycles:!1,custom_types:["Experiment"],custom_statuses:["review"],terminal_statuses:[],custom_fields:["domain"]}),"deep-graph":X({schema:j,name:"deep-graph",description:"Deep typed relationship graph with deterministic cycles.",hierarchy_depth:16,hierarchy_fanout:2,age_span_days:3650,history_entries_per_item:6,comments_per_100_items:15,notes_per_100_items:8,learnings_per_100_items:8,edge_kind_mix:ve,author_cardinality:16,component_count:1,include_cycles:!0,custom_types:[],custom_statuses:[],terminal_statuses:[],custom_fields:[]}),"multi-decade":X({schema:j,name:"multi-decade",description:"Thirty-year event history with dense per-item evolution.",hierarchy_depth:6,hierarchy_fanout:6,age_span_days:10958,history_entries_per_item:24,comments_per_100_items:40,notes_per_100_items:20,learnings_per_100_items:16,edge_kind_mix:ve,author_cardinality:64,component_count:1,include_cycles:!1,custom_types:["Program"],custom_statuses:["archived"],terminal_statuses:["archived"],custom_fields:["portfolio"]}),"disconnected-archive":X({schema:j,name:"disconnected-archive",description:"Multiple disconnected historical project components.",hierarchy_depth:4,hierarchy_fanout:10,age_span_days:7305,history_entries_per_item:8,comments_per_100_items:10,notes_per_100_items:5,learnings_per_100_items:6,edge_kind_mix:ve,author_cardinality:24,component_count:5,include_cycles:!1,custom_types:["Archive"],custom_statuses:["archived"],terminal_statuses:["archived"],custom_fields:["archive_source"]})});function py(){return Object.keys(Y).sort().map(e=>Y[e])}function my(e){let t=e.trim().toLowerCase();if(!Object.hasOwn(Y,t))throw new TypeError(`Unknown corpus shape "${e}". Available: ${Object.keys(Y).join(", ")}`);return Y[t]}var oo=new WeakMap;function io(e,t){if(e===0)return[];let r=oo.get(t);r===void 0&&(r=t.edge_kind_mix.flatMap(n=>Array.from({length:n.weight},()=>n.kind)),oo.set(t,r));let o=[r[e%r.length]];return t.include_cycles&&e>2&&e%17===0&&o.push("related"),[...new Set(o)]}function fy(e,t,r,o=42){if(ie(t,"item index"),W(r,"item count"),t>=r)throw new RangeError(`Corpus item index ${t} exceeds ${r}`);let n=Math.min(e.component_count,r),i=t%n,s=Math.floor(t/n),a=0,c=1;for(let S=0;S<e.hierarchy_depth;S+=1)a=Math.min(Number.MAX_SAFE_INTEGER,a+c),c=Math.min(Number.MAX_SAFE_INTEGER,c*e.hierarchy_fanout);let d=s%a,l=s-d,u=d===0?void 0:i+(l+Math.floor((d-1)/e.hierarchy_fanout))*n,f=Date.UTC(2026,0,1),g=e.age_span_days*864e5,h=new Date(f+(r===1?0:Math.round(t/(r-1)*g))).toISOString(),C=(t*37+o)%100;return{index:t,id:`pm-s${t.toString(36).padStart(7,"0")}`,...u===void 0?{}:{parent:`pm-s${u.toString(36).padStart(7,"0")}`},component:i,timestamp:h,author:`pm-corpus-agent-${(t+o)%Math.min(e.author_cardinality,r)}`,history_entry_count:e.history_entries_per_item,dependency_kinds:io(t,e),has_comment:C<e.comments_per_100_items,has_note:C<e.notes_per_100_items,has_learning:C<e.learnings_per_100_items,...e.custom_types.length>0&&t%11===0?{custom_type:e.custom_types[t%e.custom_types.length]}:{},...e.custom_statuses.length>0&&t%13===0?{custom_status:e.custom_statuses[t%e.custom_statuses.length]}:{}}}var mt=class{shape;authors=new Set;components=new Set;depths=new Map;childCounts=new Map;edgeKinds={};expectedEdgeKinds={};annotations={comments:0,notes:0,learnings:0};annotationFields;planMismatches=[];itemCount=0;observedDepth=0;observedFanout=0;historyEntryCount=0;firstTimestamp=null;lastTimestamp=null;constructor(t){this.shape=t,this.annotationFields=[["comments","has_comment",t.comments_per_100_items],["notes","has_note",t.notes_per_100_items],["learnings","has_learning",t.learnings_per_100_items]]}recordMismatch(t,r){t&&this.planMismatches.push(r)}recordEdgeKinds(t,r){for(let o of r)t[o]=(t[o]??0)+1}add(t){this.itemCount+=1,this.authors.add(t.author),this.components.add(t.component),this.recordMismatch(this.depths.has(t.id),`duplicate_id:${t.id}`);let r=1;if(t.parent!==void 0){let o=this.depths.get(t.parent);this.recordMismatch(o===void 0,`parent_missing:${t.parent}`),r=(o??0)+1;let n=(this.childCounts.get(t.parent)??0)+1;this.childCounts.set(t.parent,n),this.observedFanout=Math.max(this.observedFanout,n)}this.depths.set(t.id,r),this.observedDepth=Math.max(this.observedDepth,r),this.historyEntryCount+=t.history_entry_count,this.recordMismatch(t.history_entry_count!==this.shape.history_entries_per_item,"history_entries_per_item:drift"),this.firstTimestamp=this.firstTimestamp===null||t.timestamp<this.firstTimestamp?t.timestamp:this.firstTimestamp,this.lastTimestamp=this.lastTimestamp===null||t.timestamp>this.lastTimestamp?t.timestamp:this.lastTimestamp;for(let[o,n]of this.annotationFields)this.annotations[o]+=Number(t[n]);this.recordEdgeKinds(this.edgeKinds,t.dependency_kinds),this.recordEdgeKinds(this.expectedEdgeKinds,io(t.index,this.shape))}finish(){let t=Math.min(this.shape.author_cardinality,this.itemCount),r=Math.min(this.shape.component_count,this.itemCount),o=[...this.planMismatches,...this.itemCount===0?["item_count:empty"]:[],...this.authors.size===t?[]:[`author_count:${this.authors.size}!=${t}`],...this.components.size===r?[]:[`component_count:${this.components.size}!=${r}`],...this.observedDepth<=this.shape.hierarchy_depth?[]:[`hierarchy_depth:${this.observedDepth}>${this.shape.hierarchy_depth}`],...this.observedFanout<=this.shape.hierarchy_fanout?[]:[`hierarchy_fanout:${this.observedFanout}>${this.shape.hierarchy_fanout}`]];for(let[s,,a]of this.annotationFields){let c=Math.floor(this.itemCount/100),d=this.itemCount%100,l=c*a+Math.max(0,a+d-100),u=c*a+Math.min(a,d),f=this.annotations[s];(f<l||f>u)&&o.push(`${s}:${f}!in[${l},${u}]`)}let n=new Set([...Object.keys(this.edgeKinds),...Object.keys(this.expectedEdgeKinds)]);for(let s of[...n].sort()){let a=this.edgeKinds[s]??0,c=this.expectedEdgeKinds[s]??0;a!==c&&o.push(`edge_kind:${s}:${a}!=${c}`)}let i=[...new Set(o)];return{shape:this.shape.name,item_count:this.itemCount,author_count:this.authors.size,component_count:this.components.size,hierarchy_depth:this.observedDepth,hierarchy_fanout:this.observedFanout,timestamp_range:{first:this.firstTimestamp,last:this.lastTimestamp},history_entry_count:this.historyEntryCount,annotations:{...this.annotations},edge_kinds:{...this.edgeKinds},matches_declaration:i.length===0,mismatches:i}}};function so(e){return new mt(e)}function _y(e,t){let r=so(e);for(let o of t)r.add(o);return r.finish()}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="48d03e9b-14a4-545c-8e5d-5f5f2092a113")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="dd1a948a-2fa2-5d2e-a41c-31f75297f17e")}catch{}})();async function hy(){let e=Ge(process.cwd(),process.env.PM_PATH);await Lt(e,(t,r)=>Dt(t,r,{apply_runtime_defaults:!0}))}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="4534b1c9-de27-5745-88f2-641b00b94714")}catch{}})();async function gy(){await $t()}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="b84b220f-cad0-5861-b3ed-07453179706e")}catch{}})();var ao=["lines","branches","functions","statements"];function yy(e,t){if(typeof t!="object"||t===null||Array.isArray(t))throw new TypeError(`Coverage entry for ${e} must be an object.`)}function by(e,t,r){if(typeof r!="object"||r===null||Array.isArray(r))throw new TypeError(`Coverage entry ${e} has invalid ${t} counts.`);let o=r;if(typeof o.covered!="number"||typeof o.total!="number"||!Number.isInteger(o.covered)||!Number.isInteger(o.total)||o.covered<0||o.total<o.covered)throw new TypeError(`Coverage entry ${e} has invalid ${t} counts.`);return{covered:o.covered,total:o.total}}function Cy(e){if(typeof e!="object"||e===null||Array.isArray(e))throw new TypeError("Coverage summary must be a JSON object.");if(!("total"in e))throw new TypeError("Coverage summary is missing the total entry.");let t=[];for(let[r,o]of Object.entries(e)){yy(r,o);for(let n of ao){let i=by(r,n,o[n]),s=i.total-i.covered;s>0&&t.push({file:r,metric:n,uncovered:s,...i})}}return t}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="aa6b9997-a4c6-5bfb-8804-45b34afd9e01")}catch{}})();var Ty=["captured_redacted","captured_verbatim"],Sy=[{label:"home directory",pattern:/(?:\/home\/|\/Users\/)[^/\s"']+/u},{label:"GitHub token",pattern:/\b(?:gh[oprsu]_[A-Za-z0-9_]{20,})\b/u},{label:"npm token",pattern:/\bnpm_[A-Za-z0-9]{20,}\b/u},{label:"private key",pattern:/-----BEGIN (?:RSA |EC |OPENSSH )?PRIVATE KEY-----/u}];function O(e){return typeof e=="string"&&e.trim().length>0}function wy(e,t){if(typeof t!="object"||t===null||Array.isArray(t))return[{boundary_id:e.id,kind:"invalid_fixture",detail:`${e.fixture_path} must contain a JSON object.`}];let r=t,o=[];r.boundary_id!==e.id&&o.push({boundary_id:e.id,kind:"fixture_boundary_mismatch",detail:`${e.fixture_path} names ${String(r.boundary_id)} instead of ${e.id}.`}),(r.version!==1||!Ty.includes(r.capture_source)||!O(r.capture_provenance)||!Array.isArray(r.redactions)||!r.redactions.every(O)||!("input"in r)||!("observed"in r))&&o.push({boundary_id:e.id,kind:"invalid_fixture",detail:`${e.fixture_path} lacks captured provenance, redaction metadata, input, or observed output.`});let n=JSON.stringify(t);for(let i of Sy)i.pattern.test(n)&&o.push({boundary_id:e.id,kind:"unsafe_fixture",detail:`${e.fixture_path} contains a possible ${i.label}.`});return o}function Ey(e,t){let r=Date.parse(e.waiver_expires_at),o=O(e.waiver_reason)&&O(e.waiver_owner)&&e.waiver_expires_at.endsWith("Z")&&Rt(e.waiver_expires_at)&&Number.isFinite(r);return{captured:0,waived:o&&r>=t?1:0,findings:o?r<t?[{boundary_id:e.id,kind:"expired_waiver",detail:`Boundary ${e.id} waiver expired at ${e.waiver_expires_at}.`}]:[]:[{boundary_id:e.id,kind:"invalid_waiver",detail:`Boundary ${e.id} waiver requires reason, owner, and an RFC 3339 UTC expiry.`}]}}function Ay(e,t,r){if(!O(e.id)||!O(e.producer)||!O(e.consumer)||!O(e.format))return{captured:0,waived:0,findings:[{boundary_id:O(e.id)?e.id:"unknown",kind:"invalid_boundary",detail:"Each boundary requires non-empty id, producer, consumer, and format."}]};if("fixture_path"in e){let o=t[e.fixture_path],n=O(e.fixture_path)&&e.fixture_path in t?wy(e,o):[{boundary_id:e.id,kind:"missing_fixture",detail:`Boundary ${e.id} fixture ${String(e.fixture_path)} is missing.`}];return{captured:n.length===0?1:0,waived:0,findings:n}}return Ey(e,r)}function mx(e,t,r=new Date){let o=[];if(e.version!==1||!O(e.inventory_scope)||!Array.isArray(e.boundaries))return{ok:!1,boundary_count:0,captured_count:0,waived_count:0,findings:[{boundary_id:"registry",kind:"invalid_registry",detail:"Boundary registry requires version 1, inventory_scope, and boundaries."}]};let n=new Set,i=0,s=0;for(let a of e.boundaries){if(typeof a!="object"||a===null||Array.isArray(a)){o.push({boundary_id:"unknown",kind:"invalid_boundary",detail:"Each boundary must be a JSON object."});continue}let c=a,d=O(c.id)?c.id:void 0;if(d!==void 0&&n.has(d)){o.push({boundary_id:d,kind:"duplicate_boundary",detail:`Boundary ${d} is inventoried more than once.`});continue}d!==void 0&&n.add(d);let l=Ay(c,t,r.getTime());i+=l.captured,s+=l.waived,o.push(...l.findings)}return o.sort((a,c)=>a.boundary_id!==c.boundary_id?a.boundary_id.localeCompare(c.boundary_id):a.kind.localeCompare(c.kind)),{ok:o.length===0,boundary_count:e.boundaries.length,captured_count:i,waived_count:s,findings:o}}import J from"node:fs";import ft from"node:path";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="9c9e4ac4-51b2-5920-bb27-a4f239f6b429")}catch{}})();var co=300*1e3,vy=3;function yx(e){return(e?.trim()||"development").replace(/[^a-zA-Z0-9._-]/g,"_").replace(/^\./,"_")}function bx(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 o=ft.join(e,r);J.mkdirSync(o,{recursive:!0});let n=new Date;J.utimesSync(o,n,n);let i=J.readdirSync(e).filter(d=>d!==r).flatMap(d=>{try{return[{name:d,mtimeMs:J.statSync(ft.join(e,d)).mtimeMs}]}catch(l){if(l instanceof Error&&"code"in l&&fe(l))return[];throw l}}).sort((d,l)=>l.mtimeMs-d.mtimeMs||d.name.localeCompare(l.name)),s=i.filter(d=>n.getTime()-d.mtimeMs<co),a=Math.max(0,vy-1-s.length),c=i.filter(d=>n.getTime()-d.mtimeMs>=co).slice(a).map(d=>d.name).sort((d,l)=>d.localeCompare(l));for(let d of c)J.rmSync(ft.join(e,d),{recursive:!0,force:!0,maxRetries:3,retryDelay:50});return{retained:r,removed:c}}import lo from"node:fs";import Ie from"node:path";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="7ab9180f-dfcb-579d-bc0c-dbba2e4ad77e")}catch{}})();var se="@unbrained/pm-cli",Oy=new Set(["append","claim","changelog","close","close-many","close-task","comments","config","copy","create","dedupe-merge","delete","deps","docs","extension","event","events","files","focus","gc","history-author-acknowledge","history-compact","history-redact","history-repair","init","install","item","learnings","meet","merge","normalize","notes","package","packages","pause-task","plan","profile","reindex","release","remind","restore","schema","start-task","test","test-all","test-runs","test-runs-worker","telemetry","templates","twin","update","update-many","upgrade","vcs","workspace"]),uo=new Set(["--author","--output-budget","--output-format","--output-include","--output-limit","--output-session","--path","--pm-path"]),gt=/\b(\d{4})\.(\d{1,2})\.(\d{1,2})(?:-(\d+))?\b/u,Pe="2026.8.31";function w(e,t){return e.some(r=>t.includes(r.split("=",1)[0]))}function _t(e,t){return["activate","adopt","adopt-all","deactivate","init","install","migrate","reload","uninstall"].includes(t[0]??"")||w(e,["--activate","--adopt","--adopt-all","--deactivate","--fix-managed-state","--init","--install","--output","--reload","--scaffold","--uninstall"])}var Iy={changelog:(e,t)=>{if(t[0]==="generate")return!w(e,["--check"]);let r=e.indexOf("export");return t[0]==="export"&&(w(e,["--output"])||r>=0&&e[r+1]!==void 0&&!e[r+1].startsWith("-"))},comments:e=>w(e,["--add","--delete","--edit","--file","--stdin"]),config:(e,t)=>(t[0]==="project"||t[0]==="global"?t[1]:t[0])==="set",deps:()=>!1,docs:e=>w(e,["--add","--add-glob","--migrate","--remove"]),duplicates:()=>!1,events:()=>!1,extension:_t,files:(e,t)=>w(e,["--add","--add-glob","--migrate","--remove"])||t[0]==="discover"&&w(e,["--apply"]),health:e=>!w(e,["--check-only","--no-refresh","--skip-vectors"]),learnings:e=>w(e,["--add","--delete","--edit","--file","--stdin"]),merge:(e,t)=>t[0]!=="report",notes:e=>w(e,["--add","--delete","--edit","--file","--stdin"]),package:_t,packages:_t,profile:(e,t)=>t[0]==="apply",schema:(e,t)=>["add-field","add-status","add-type","remove-field","remove-status","remove-type","remap-status","rename-field","rename-type"].includes(t[0]??"")&&!(w(e,["--infer"])&&!w(e,["--apply"])),telemetry:(e,t)=>t.slice(0,2).some(r=>["clear","flush"].includes(r)),templates:(e,t)=>t[0]==="save",test:e=>w(e,["--add","--add-json","--background","--measure","--remove","--resume","--run","--stop"]),validate:e=>w(e,["--auto-fix","--prune-missing"]),vcs:(e,t)=>["abandon","create","merge","propose","ref-create"].includes(t[0]??""),workspace:(e,t)=>t[0]==="snapshot"&&["create","delete","restore"].includes(t[1]??"")};function Re(e){let t=e.match(gt);return t?[Number(t[1]),Number(t[2]),Number(t[3]),Number(t[4]??0)]:null}function G(e,t){let r=Re(e),o=Re(t);if(!r||!o)return null;for(let n=0;n<r.length;n+=1){let i=r[n]-o[n];if(i!==0)return Math.sign(i)}return 0}function Oe(e){return G(e,Pe)!==-1?3:2}function Ry(e,t){if(t===3)return e.filter(r=>r.history_epoch_compatible===!1).map(r=>({...r,declaration:r.declaration??r.version})).sort((r,o)=>G(r.version,o.version))[0]}function ht(e){try{let t=JSON.parse(lo.readFileSync(e,"utf8"));return typeof t=="object"&&t!==null&&!Array.isArray(t)?t:null}catch{return null}}function Py(e){let t=[...e.matchAll(/(<=|<)\s*v?(\d{4}\.\d{1,2}\.\d{1,2}(?:-\d+)?)/gu)].map(o=>({inclusive:o[1]==="<=",version:o[2]})),r=e.match(/\b\d{4}\.\d{1,2}\.\d{1,2}(?:-\d+)?\s+-\s+v?(\d{4}\.\d{1,2}\.\d{1,2}(?:-\d+)?)/u);return r?[...t,{inclusive:!0,version:r[1]}]:t}function My(e){let t=e.split("||").map(r=>Py(r));return{bounded:t.some(r=>r.length>0),compatible:t.some(r=>r.every(o=>{let n=G(Pe,o.version);return n!==null&&(o.inclusive?n!==1:n===-1)}))}}function ky(e){return["dependencies","devDependencies","optionalDependencies","peerDependencies"].flatMap(t=>{let r=e[t];if(typeof r!="object"||r===null)return[];let o=r[se],n=typeof o=="string"?o.trim():"",i=/^[<!]/u.test(n)?void 0:n.match(gt)?.[0];if(!i)return[];let s=/^(?:=|v)?\d{4}\.\d{1,2}\.\d{1,2}(?:-\d+)?$/u.test(n),a=My(n);return[{version:i,constraint:s?"exact":a.bounded?"range":"minimum",...s?{}:{declaration:n},history_epoch_compatible:s?G(i,Pe)!==-1:a.compatible}]})}function xy(e){let r=ht(Ie.join(e,"package-lock.json"))?.packages;if(typeof r!="object"||r===null)return;let o=r["node_modules/@unbrained/pm-cli"];if(typeof o!="object"||o===null)return;let n=o.version;return typeof n=="string"?n:void 0}function Ny(e,t){try{let r=lo.readFileSync(Ie.join(e,t),"utf8").split(/\r?\n/u),o=r.findIndex(c=>c.includes(se));if(o<0)return;let n=r[o].match(/^\s*/u)[0].length,i=[r[o]];for(let c=o+1;c<r.length;c+=1){let d=r[c],l=d.trim(),u=d.match(/^\s*/u)[0].length;if(l.length>0&&u<=n)break;i.push(d)}return i.join(`
|
|
28
|
+
`).match(/^\s*version(?::\s*|\s+)["']?(\d{4}\.\d{1,2}\.\d{1,2}(?:-\d+)?)/mu)?.[1]??i[0].match(gt)?.[0]}catch{return}}function Ly(e){let t=[],r=ht(Ie.join(e,"package.json"));r&&t.push(...ky(r).map(s=>({...s,source:"package.json"})));let n=ht(Ie.join(e,"node_modules","@unbrained","pm-cli","package.json"))?.version;typeof n=="string"&&Re(n)&&t.push({version:n,source:"installed-package",constraint:"exact",history_epoch_compatible:Oe(n)===3});let i=xy(e);i&&Re(i)&&t.push({version:i,source:"package-lock.json",constraint:"exact",history_epoch_compatible:Oe(i)===3});for(let s of["pnpm-lock.yaml","yarn.lock"]){let a=Ny(e,s);a&&t.push({version:a,source:s,constraint:"exact",history_epoch_compatible:Oe(a)===3})}return t}function po(e){for(let t=0;t<e.length;t+=1){let r=e[t];if(uo.has(r)){t+=1;continue}if(!r.startsWith("-"))return{command:r.toLowerCase(),index:t}}}function Dy(e){let t=po(e);if(!t||w(e,["--help","-h","--dry-run"]))return!1;let{command:r,index:o}=t,n=[];for(let s=o+1;s<e.length;s+=1){let a=e[s];if(uo.has(a)){s+=1;continue}a.startsWith("-")||n.push(a.toLowerCase())}let i=Iy[r];return i?i(e,n):Oy.has(r)}function $y(e){let t=po(e.argv)?.command,r=Dy(e.argv),o=Ly(e.projectRoot).filter(l=>G(l.version,e.executingVersion)!==null).sort((l,u)=>G(u.version,l.version)),n=o[0],i=n!==void 0&&G(e.executingVersion,n.version)===-1,s=Oe(e.executingVersion),a=Ry(o,s),c=r&&a!==void 0,d=i&&!r?{code:"project_runtime_stale_read",executing_version:e.executingVersion,project_version:n.version,source:n.source,message:"This read is using an older pm runtime than the project requires.",next_steps:[`Run the command through the project's installed ${se} ${n.version}.`,"Install the project dependencies with its declared package manager if the local executable is missing."]}:void 0;return{compatible:!r||!i&&!c||e.allowStale===!0,executing_version:e.executingVersion,...n?{project_version:n.version,source:n.source}:{},...t?{command:t}:{},mutating:r,stale:i,history_epoch_incompatible:c,writer_item_hash_version:s,...a?{incompatible_project_version:a.declaration,incompatible_source:a.source}:{},...d?{warning:d}:{},override_applied:r&&(i||c)&&e.allowStale===!0}}function Ax(e){let t=$y(e);if(t.compatible)return t;throw t.history_epoch_incompatible?new b(`pm ${t.executing_version} cannot write item-hash epoch ${t.writer_item_hash_version} into a project pinned to pm ${t.incompatible_project_version}.`,L.CONFLICT,{code:"project_runtime_history_epoch_incompatible",reason:t.incompatible_source,why:`The pinned runtime cannot read item_hash_version ${t.writer_item_hash_version}; allowing the write would break its health and validation gates.`,nextSteps:[`Upgrade the project's ${se} pin to ${Pe} or newer before mutating tracker history.`,"For an intentional coordinated migration only, set PM_ALLOW_STALE_CLI=1 for this invocation and record why.","Read-only commands remain available without an override."]}):new b(`pm ${t.executing_version} cannot mutate a project pinned to newer pm ${t.project_version}.`,L.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 ${se} ${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 Fy}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="eb475dcd-d16c-51fb-b248-b14cf5ade4de")}catch{}})();var yt=1;function Z(e){e?.throwIfAborted()}function U(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship graph ${t} must be non-empty`);return e.trim()}function Q(e,t,r={}){let o=Date.parse(r.createdAt??new Date().toISOString());if(!Number.isFinite(o))throw new TypeError("Relationship graph createdAt must be a valid timestamp");let n=e.nodes(),i=e.edges(),s=t.list();return Object.freeze({version:yt,fingerprint:Fy("sha256").update(P({nodes:n,edges:i,kinds:s})).digest("hex"),created_at:new Date(o).toISOString(),nodes:n,edges:i,kinds:s})}function jy(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ce(e){if(!jy(e))throw new TypeError("Relationship graph snapshot must be an object");if(e.version!==yt)throw new TypeError(`Unsupported relationship graph snapshot version: ${String(e.version)}`);if(!Array.isArray(e.nodes)||e.nodes.some(n=>typeof n!="string"))throw new TypeError("Relationship graph snapshot nodes must be strings");if(!Array.isArray(e.edges)||!Array.isArray(e.kinds))throw new TypeError("Relationship graph snapshot edges and kinds must be arrays");if(typeof e.created_at!="string"||!Number.isFinite(Date.parse(e.created_at)))throw new TypeError("Relationship graph snapshot created_at must be valid");if(typeof e.fingerprint!="string")throw new TypeError("Relationship graph snapshot fingerprint must be a string");let t=new Ue([]);for(let n of e.kinds)t.register(n);let r=new V(e.nodes,e.edges,t),o=Q(r,t,{createdAt:e.created_at});if(o.fingerprint!==e.fingerprint)throw new TypeError("Relationship graph snapshot fingerprint mismatch");return{snapshot:o,registry:t,graph:r}}async function N(e,t){U(e.name,"adapter name");let r=U(t.workspace,"workspace");Z(t.signal);let o=await e.read({...t,workspace:r});return Z(t.signal),o===null?null:ce(o)}async function Me(e,t){let r=U(t.workspace,"workspace"),o=ce(t.snapshot).snapshot,n=await N(e,{workspace:r,signal:t.signal});if(n?.snapshot.fingerprint===o.fingerprint)return{adapter:e.name,workspace:r,disposition:"current",fingerprint:o.fingerprint,previous_fingerprint:n.snapshot.fingerprint,node_count:o.nodes.length,edge_count:o.edges.length};if(Z(t.signal),await e.replace({workspace:r,signal:t.signal,snapshot:o,expected_fingerprint:n?.snapshot.fingerprint??null}),(await N(e,{workspace:r,signal:t.signal}))?.snapshot.fingerprint!==o.fingerprint)throw new Error(`Relationship graph adapter "${e.name}" did not expose the replaced snapshot`);return{adapter:e.name,workspace:r,disposition:"written",fingerprint:o.fingerprint,...n?{previous_fingerprint:n.snapshot.fingerprint}:{},node_count:o.nodes.length,edge_count:o.edges.length}}function Gy(e,t={}){let r=e.map(ce),o=new Map;for(let s of r)for(let a of s.snapshot.kinds){let c=o.get(a.kind);if(c&&P(c)!==P(a))throw new TypeError(`Conflicting federated relationship kind: ${a.kind}`);o.set(a.kind,a)}let n=new Ue([...o.values()].sort((s,a)=>s.kind.localeCompare(a.kind))),i=new V(new Set(r.flatMap(s=>[...s.snapshot.nodes])),r.flatMap(s=>[...s.snapshot.edges]),n);return Q(i,n,t)}var ae=class{name;#e=new Map;constructor(t="memory"){this.name=U(t,"adapter name")}async read(t){Z(t.signal);let r=this.#e.get(U(t.workspace,"workspace"));return r?structuredClone(r):null}async replace(t){Z(t.signal);let r=U(t.workspace,"workspace"),o=this.#e.get(r);if(t.expected_fingerprint!==void 0&&(o?.fingerprint??null)!==t.expected_fingerprint)throw new Error(`Relationship graph adapter conflict for ${r}`);this.#e.set(r,structuredClone(ce(t.snapshot).snapshot))}async clear(t){Z(t.signal);let r=U(t.workspace,"workspace"),o=this.#e.get(r);if(t.expected_fingerprint!==void 0&&(o?.fingerprint??null)!==t.expected_fingerprint)throw new Error(`Relationship graph adapter conflict for ${r}`);this.#e.delete(r)}};(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="9a60b8c0-37d1-5c04-a079-e1351caf6e09")}catch{}})();function mo(e,t){if(!Number.isInteger(e)||e<1)throw new TypeError(`Relationship graph ${t} must be a positive integer`);return e}function Uy(e){let t=mo(e.nodeCount,"nodeCount"),r=mo(e.edgeStride??1,"edgeStride"),o=e.topology??"chain";if(!["chain","star","disconnected"].includes(o))throw new TypeError(`Unsupported relationship graph topology: ${o}`);let n=(e.kind??"related").trim(),i=(e.idPrefix??"node").trim();if(!n||!i)throw new TypeError("Relationship graph kind and idPrefix must be non-empty");let s=o==="disconnected"?0:Math.floor((t-1)/r);return{node_count:t,edge_count:s,edge_basis:"fixture_generated",nodes:{*[Symbol.iterator](){for(let a=0;a<t;a+=1)yield`${i}-${a}`}},edges:{*[Symbol.iterator](){if(o!=="disconnected")for(let a=r;a<t;a+=r)yield{source:`${i}-${o==="star"?0:a-r}`,target:`${i}-${a}`,kind:n}}}}}function B(e,t){if(!e)throw new Error(`Relationship graph adapter conformance: ${t}`)}async function fo(e,t={}){let r=t.workspace?.trim()||"pm-graph-conformance",o=Pt(),n=Q(new V(["a","b"],[{source:"a",target:"b",kind:"related"}],o),o,{createdAt:"2026-01-01T00:00:00.000Z"}),i=Q(new V(["a","b","c"],[{source:"a",target:"b",kind:"related"},{source:"b",target:"c",kind:"blocked_by"}],o),o,{createdAt:"2026-01-02T00:00:00.000Z"}),s=[];B(await N(e,{workspace:r})===null,"workspace must start empty"),s.push({name:"empty-read",passed:!0});let a=await Me(e,{workspace:r,snapshot:n});B(a.disposition==="written","first sync must write"),s.push({name:"atomic-replace",passed:!0}),(await e.read({workspace:r})).nodes.push("mutated-reader-copy"),B((await N(e,{workspace:r}))?.snapshot.nodes.length===2,"reads must not mutate stored state"),s.push({name:"read-isolation",passed:!0}),B((await Me(e,{workspace:r,snapshot:n})).disposition==="current","identical sync must be idempotent"),s.push({name:"idempotent-sync",passed:!0}),await e.replace({workspace:r,snapshot:i,expected_fingerprint:n.fingerprint}),B((await N(e,{workspace:r}))?.snapshot.fingerprint===i.fingerprint,"replacement must become visible"),s.push({name:"replacement-visibility",passed:!0});let d=!1;try{await e.replace({workspace:r,snapshot:n,expected_fingerprint:n.fingerprint})}catch{d=!0}return B(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}),B(await N(e,{workspace:r})===null,"clear must remove the workspace"),s.push({name:"clear",passed:!0})),{adapter:e.name,workspace:r,cases:Object.freeze(s),clear_supported:e.clear!==void 0}}function By(e){return fo(new ae,e?{workspace:e}:{})}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="c59413c4-8955-5560-8bc6-f1dc9c8c5042")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="d45a8203-4501-5797-a6cc-a2e7844adec9")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="4d2bee02-8003-578c-9d25-32755534f8ff")}catch{}})();var bt=2,qy=["self_reported","independent_transport"];function ke(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function de(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`${t} must be a non-empty string`);return e.trim()}function _o(e,t,r=!1){if(!Array.isArray(e)||e.length===0)throw new TypeError(`${t} must be a non-empty string array`);return e.map((o,n)=>{let i=de(o,`${t}[${String(n)}]`);return r?o:i})}function Ct(e,t){return e===void 0?void 0:de(e,t)}function zy(e,t){if(e===void 0)return;if(!ke(e)||Object.keys(e).length===0)throw new TypeError(`${t} must be a non-empty object`);let r=Object.entries(e).map(([o,n])=>{if(o.length===0||o.split(".").some(i=>i.length===0))throw new TypeError(`${t} must use dot-separated own-property paths`);if(n!==null&&typeof n!="string"&&typeof n!="boolean"&&(typeof n!="number"||!Number.isFinite(n)))throw new TypeError(`${t} values must be JSON primitives`);return[o,n]});return Object.fromEntries(r)}function Vy(e,t,r,o,n,i){if(o==="refusal"){if(Xe(r)||n===void 0||i===void 0)throw new TypeError(`${e} refusal steps require a non-success exit, error code, and refusal surface`);return}if(n!==void 0||i!==void 0)throw new TypeError(`${e} only refusal steps may declare expected_error_code or expected_refusal_surface`);let s=xt(t);if(s===void 0)throw new TypeError(`${e}.args must identify a command after global flags`);let a=t[s].trim().toLowerCase();if(a==="history"){let l=Nt(t.slice(s+1));l!==void 0&&(a=Fe(`history ${l}`))}let c=Kt(a);if(!Xe(r)||r!==0&&!c?.exit_codes.some(l=>l===r))throw new TypeError(`${e} successful output must use exit code 0 or a command-declared successful effect exit`);let d=cr(a).kind;if(o!==d)throw new TypeError(`${e} expected ${o}, but ${a} declares ${d}`)}function Hy(e,t,r){if(!ke(e))throw new TypeError(`tasks.${t}.steps[${String(r)}] must be an object`);let o=`tasks.${t}.steps[${String(r)}]`,n=de(e.id,`${o}.id`),i=_o(e.args,`${o}.args`,!0),s=e.expected_exit_code;if(typeof s!="number"||!Number.isSafeInteger(s))throw new TypeError(`${o}.expected_exit_code must be a safe integer`);let a=e.expected_output_kind;if(a!=="refusal"&&!ar.includes(a))throw new TypeError(`${o}.expected_output_kind is unsupported`);let c=a,d=e.expected_accounting_mode;if(!qy.includes(d))throw new TypeError(`${o}.expected_accounting_mode is unsupported`);let l=d;if(l==="independent_transport"&&c!=="refusal")throw new TypeError(`${o} independent_transport accounting is supported only for refusal steps`);let u=_o(e.required_fields,`${o}.required_fields`);if(u.some(S=>S.split(".").some(z=>z.length===0)))throw new TypeError(`${o}.required_fields must contain dot-separated own-property paths`);let f=zy(e.expected_field_values,`${o}.expected_field_values`),g=Ct(e.expected_error_code,`${o}.expected_error_code`),h=Ct(e.expected_refusal_surface,`${o}.expected_refusal_surface`),C=Ct(e.recovery_for,`${o}.recovery_for`);return Vy(o,i,s,c,g,h),{id:n,args:i,expected_exit_code:s,expected_output_kind:c,expected_accounting_mode:l,required_fields:u,...f?{expected_field_values:f}:{},...g?{expected_error_code:g}:{},...h?{expected_refusal_surface:h}:{},...C?{recovery_for:C}:{}}}function Ky(e,t){if(!ke(e))throw new TypeError(`tasks[${String(t)}] must be an object`);let r=de(e.id,`tasks[${String(t)}].id`),o=de(e.description,`tasks.${r}.description`);if(!Array.isArray(e.steps)||e.steps.length===0)throw new TypeError(`tasks.${r}.steps must be a non-empty array`);let n=e.steps.map((s,a)=>Hy(s,r,a)),i=new Map;for(let s of n){if(i.has(s.id))throw new TypeError(`tasks.${r} contains duplicate step id ${s.id}`);if(s.recovery_for!==void 0&&(i.get(s.recovery_for)?.expected_output_kind!=="refusal"||s.expected_output_kind==="refusal"))throw new TypeError(`tasks.${r}.${s.id} recovery_for must reference an earlier refusal and declare successful output`);i.set(s.id,s)}if(n.at(-1)?.expected_output_kind==="refusal")throw new TypeError(`tasks.${r} completed task must terminate with successful output`);for(let s of n)if(s.expected_output_kind==="refusal"&&!n.some(a=>a.recovery_for===s.id))throw new TypeError(`tasks.${r}.${s.id} refusal must have a later successful recovery_for step`);return{id:r,description:o,steps:n}}function eN(e){if(!ke(e))throw new TypeError("agent-task transcript corpus must be an object");if(e.version!==bt)throw new TypeError(`agent-task transcript corpus version must be ${String(bt)}`);if(!Array.isArray(e.tasks)||e.tasks.length===0)throw new TypeError("agent-task transcript corpus tasks must be non-empty");let t=e.tasks.map((o,n)=>Ky(o,n)),r=new Set;for(let o of t){if(r.has(o.id))throw new TypeError(`duplicate agent-task transcript id ${o.id}`);r.add(o.id)}return{version:bt,tasks:t}}import{createHash as ho}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="41ef1735-c534-5b84-8367-1278007cb7c6")}catch{}})();function go(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship backfill ${t} must be non-empty`);return e.trim()}function nN(e,t){let r=go(t.migrationId,"migrationId"),o=go(t.author,"author"),n=Date.parse(t.timestamp);if(!Number.isFinite(n))throw new TypeError("Relationship backfill timestamp must be valid");let i=new Date(n).toISOString(),s=We(e,void 0,t.registry),a=s.graph.nodes(),c=s.graph.edges().map(f=>{let g=ho("sha256").update(JSON.stringify([r,f.kind,f.source,f.target,f.createdAt??null,f.author??null,f.payload??null])).digest("hex").slice(0,24);return Object.freeze({eventId:`backfill:${r}:${g}`,relationshipId:`migration:${r}:${g}`,action:"add",edge:f,author:o,timestamp:i,reason:`Backfill ${r} from legacy item metadata`})}),d=ho("sha256").update(JSON.stringify({migrationId:r,nodes:a,events:c})).digest("hex"),l=new Set([...t.existingEventIds??[]].filter(f=>typeof f=="string").map(f=>f.trim()).filter(Boolean)),u=c.filter(f=>!l.has(f.eventId));return Object.freeze({migration_id:r,fingerprint:d,nodes:a,events:Object.freeze(u),edge_count:c.length,skipped_existing_count:c.length-u.length,duplicate_dependency_rows:s.duplicateRows.length,dangling_reference_count:s.dangling.active.length+s.dangling.legacy_terminal.length})}import*as yo from"node:module";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="81067f95-115f-5aee-b649-55d86c3915d4")}catch{}})();var le=["suggested_retry","candidate_command","example","next_step","migration_hint","restore_with"],Tt={suggested_retry:{kind:"suggested_retry",semantics:"recovery"},retry_command:{kind:"suggested_retry",semantics:"recovery"},candidate_command:{kind:"candidate_command",semantics:"recovery"},candidate_commands:{kind:"candidate_command",semantics:"recovery"},fallback_candidates:{kind:"candidate_command",semantics:"recovery",nested_value_field:"command"},next_best_command:{kind:"candidate_command",semantics:"recovery"},example:{kind:"example",semantics:"recovery"},examples:{kind:"example",semantics:"recovery"},next_step:{kind:"next_step",semantics:"recovery"},next_steps:{kind:"next_step",semantics:"recovery"},suggested_next_steps:{kind:"next_step",semantics:"recovery"},migration_hint:{kind:"migration_hint",semantics:"replacement"},migration_hints:{kind:"migration_hint",semantics:"replacement"},restore_with:{kind:"restore_with",semantics:"behavior_preserving"}},sN=Object.freeze(Object.keys(Tt));function bo(e){if(Object.hasOwn(Tt,e))return Tt[e]}var Wy=new Set([..."=([{,:;!?&|+-*%^~<>","=>"]);function ee(e,t){return e<t?-1:e>t?1:0}function Xy(e,t){let r=e[t],o=t+1,n="";for(;o<e.length&&e[o]!==r;)e[o]==="\\"?o+=2:(n+=e[o],o+=1);return e[o]===r&&(o+=1),{next:o,value:n}}function Yy(e){return e===void 0||e.kind==="punctuator"&&Wy.has(e.value)||e.kind==="identifier"&&["return","case","throw","else","yield"].includes(e.value)}function Jy(e,t){if(/\s/u.test(e[t]))return t+1;if(e.startsWith("//",t)){let r=e.indexOf(`
|
|
29
|
+
`,t+2);return r===-1?e.length:r+1}if(e.startsWith("/*",t))return e.indexOf("*/",t+2)+2}function Zy(e,t,r){if(e[t]!=="/"||!Yy(r))return;let o=t+1,n=!1;for(;o<e.length;)if(e[o]==="\\")o+=2;else if(e[o]==="[")n=!0,o+=1;else if(e[o]==="]")n=!1,o+=1;else if(e[o]==="/"&&!n){for(o+=1;/[A-Za-z]/u.test(e.charAt(o));)o+=1;return o}else o+=1;return o}function Qy(e,t){let r=e[t];if(r==="'"||r==='"'||r==="`"){let n=Xy(e,t);return r==="`"?{next:n.next}:{next:n.next,token:{kind:"string",value:n.value,offset:t+1}}}if(/[A-Za-z_$]/u.test(r)){let n=t+1;for(;/[A-Za-z0-9_$]/u.test(e[n]??"");)n+=1;return{next:n,token:{kind:"identifier",value:e.slice(t,n),offset:t}}}let o=e.startsWith("=>",t)?"=>":r;return{next:t+o.length,token:{kind:"punctuator",value:o,offset:t}}}function eb(e){let t=[],r=0;for(;r<e.length;){let o=Jy(e,r);if(o!==void 0){r=o;continue}let n=Zy(e,r,t.at(-1));if(n!==void 0){r=n;continue}let i=Qy(e,r);i.token&&t.push(i.token),r=i.next}return t}var tb=new Set(["object","block","pattern"]),rb=new Set(["const","let","var"]),ob=new Set(["}",")","]"]),nb=new Set(["=","(","[",",",":","?","return"]);function ib(e,t,r){if([...r].reverse().find(i=>tb.has(i.kind))?.kind==="pattern"||r.at(-1)?.kind==="paren"&&r.at(-1)?.parameter_list)return"pattern";let n=e[t-1];return n?.kind==="identifier"&&rb.has(n.value)?"pattern":n?.value==="=>"||n?.value===")"?"block":n&&nb.has(n.value)?"object":"block"}function sb(e,t,r){let o=e[t];if(o.value==="{"){let a=ib(e,t,r);return{kind:a,...a==="object"?{member_start:!0,candidates:[]}:{}}}if(o.value==="[")return{kind:"array"};if(o.value!=="(")return;let n=e[t-1],i=e[t-2];return{kind:"paren",...n?.value==="function"||i?.value==="function"?{parameter_list:!0}:{}}}function ab(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 cb(e,t){return e[t+1]?.value===")"&&e[t+2]?.value==="=>"||e[t+1]?.value==="="}function db(e){let t=eb(yo.stripTypeScriptTypes(e,{mode:"strip"})),r=[],o=[];for(let[n,i]of t.entries()){let s=o.at(-1),a=ab(s,i,t[n+1]);a&&s.candidates.push(a);let c=sb(t,n,o);if(c)o.push(c);else if(ob.has(i.value)){let d=o.pop();d?.kind==="object"&&!cb(t,n)&&r.push(...d.candidates)}else i.value===","&&s?.kind==="object"?s.member_start=!0:s?.kind==="object"&&i.value!==":"&&(s.member_start=!1)}return r}function lb(e){let t=[0];for(let r=0;r<e.length;r+=1)e[r]===`
|
|
30
|
+
`&&t.push(r+1);return t}function ub(e,t){let r=0,o=e.length;for(;r<o;){let n=Math.floor((r+o)/2);e[n]<=t?r=n+1:o=n}return r}function aN(e){let t=[],r=[];for(let n of[...e].sort((i,s)=>ee(i.path,s.path))){let i=lb(n.content),s;try{s=db(n.content)}catch(a){r.push({kind:"invalid_source",subject:n.path,detail:`${n.path} could not be parsed for recovery producers: ${String(a)}.`});continue}for(let a of s){let c=a.field,d=ub(i,a.offset),l=bo(c);l?t.push({path:n.path,line:d,field:c,kind:l.kind}):/(?:retry_command|candidate_command|fallback_candidate|next_best_command|example|next_step|migration_hint|restore_with)/u.test(c)&&!/(?:_total|_truncated)$/u.test(c)&&r.push({kind:"unknown_recovery_field",subject:`${n.path}:${d}:${c}`,detail:`${c} resembles a recovery reference but has no typed field contract.`})}}let o=Object.fromEntries(le.map(n=>[n,t.filter(i=>i.kind===n).length]));for(let n of le)o[n]===0&&r.push({kind:"missing_kind_producer",subject:n,detail:`No source producer emits the ${n} recovery-reference kind.`});return t.sort((n,i)=>n.path!==i.path?ee(n.path,i.path):n.line!==i.line?n.line-i.line:ee(n.field,i.field)),r.sort((n,i)=>n.subject!==i.subject?ee(n.subject,i.subject):ee(n.kind,i.kind)),{ok:r.length===0,scanned_file_count:e.length,producer_count:t.length,producer_count_by_kind:o,producers:t,findings:r}}function cN(e,t){let r=[],o=(n,i)=>{if(Array.isArray(n)){n.forEach((s,a)=>o(s,[...i,String(a)]));return}if(!(typeof n!="object"||n===null))for(let[s,a]of Object.entries(n).sort(([c],[d])=>ee(c,d))){let c=bo(s),d=c?.kind==="migration_hint"&&n.semantics==="behavior_preserving"?{...c,semantics:"behavior_preserving"}:c,l=[a].flat();d!==void 0&&l.forEach((u,f)=>{let g="nested_value_field"in d&&typeof d.nested_value_field=="string"?d.nested_value_field:void 0,h=g&&typeof u=="object"&&u!==null&&!Array.isArray(u)?u[g]:u;if(typeof h!="string"||h.trim().length===0)return;let C=[...i,s,String(f)].map(S=>encodeURIComponent(S)).join("/");r.push({id:`${e}:${d.kind}:${C}`,probe_id:e,kind:d.kind,semantics:d.semantics,value:h})}),o(a,[...i,s])}};return o(t,[]),r}function dN(e,t){let r=e.flatMap(s=>(s.owned_states??[]).map(a=>({contract:s,state:a}))),o=[],n=new Map;for(let s of t){if(n.has(s.probe_id)){o.push({kind:"duplicate_probe",probe_id:s.probe_id,detail:`Observation ${s.probe_id} was supplied more than once.`});continue}n.set(s.probe_id,s)}let i=new Set(r.map(({state:s})=>s.probe_id));for(let{contract:s,state:a}of r){let c=n.get(a.probe_id);if(!c){o.push({kind:"missing_probe",probe_id:a.probe_id,detail:`No entrypoint observation was recorded for ${s.code}.`});continue}c.code!==s.code&&o.push({kind:"wrong_error_code",probe_id:a.probe_id,detail:`Expected ${s.code}; observed ${c.code}.`}),c.exit_class!==a.expected_exit_class&&o.push({kind:"wrong_exit_class",probe_id:a.probe_id,detail:`Expected ${a.expected_exit_class}; observed ${c.exit_class}.`}),a.entrypoints.includes(c.entrypoint)||o.push({kind:"wrong_entrypoint",probe_id:a.probe_id,detail:`Expected one of ${a.entrypoints.join(", ")}; observed ${c.entrypoint}.`})}for(let s of t)i.has(s.probe_id)||o.push({kind:"undeclared_probe",probe_id:s.probe_id,detail:`Observation ${s.probe_id} has no catalog declaration.`});return o.sort((s,a)=>s.probe_id!==a.probe_id?s.probe_id.localeCompare(a.probe_id):s.kind.localeCompare(a.kind)),{ok:o.length===0,declared_probe_count:r.length,observed_probe_count:t.length,findings:o}}function lN(e,t){let r=[],o=new Set,n=new Set;for(let c of e){if(o.has(c.id)){n.add(c.id),r.push({kind:"duplicate_obligation",reference_id:c.id,detail:`Recovery obligation ${c.id} was declared more than once.`});continue}o.add(c.id)}let i=new Map;for(let c of t){if(i.has(c.id)){r.push({kind:"duplicate_observation",reference_id:c.id,detail:`Recovery reference ${c.id} was observed more than once.`});continue}i.set(c.id,c),o.has(c.id)||r.push({kind:"undeclared_observation",reference_id:c.id,detail:`Recovery observation ${c.id} has no emitted obligation.`})}for(let c of e){if(n.has(c.id))continue;let d=i.get(c.id);d?d.reachable?d.semantics!==c.semantics&&r.push({kind:"wrong_semantics",reference_id:c.id,detail:`Recovery reference ${c.value} promised ${c.semantics}; proof demonstrated ${d.semantics}.`}):r.push({kind:"unreachable_reference",reference_id:c.id,detail:`Recovery reference ${c.value} did not reach its promised target.`}):r.push({kind:"missing_observation",reference_id:c.id,detail:`No reachability proof was recorded for ${c.kind} ${c.value}.`})}let s=le.map(c=>{let d=e.filter(u=>u.kind===c),l=d.filter(u=>!n.has(u.id)).map(u=>i.get(u.id)).filter(u=>u!==void 0);return{kind:c,declared:d.length,observed:l.length,passed:d.filter(u=>{let f=i.get(u.id);return!n.has(u.id)&&f?.reachable===!0&&f.semantics===u.semantics}).length}});r.sort((c,d)=>c.reference_id!==d.reference_id?c.reference_id.localeCompare(d.reference_id):c.kind.localeCompare(d.kind));let a=s.reduce((c,d)=>c+d.passed,0);return{ok:r.length===0,declared_reference_count:e.length,observed_reference_count:t.length,pass_fraction:o.size===0?1:a/o.size,coverage_by_kind:s,findings:r}}function pb(e,t){let r=new Map(le.map(i=>[i,new Set]));for(let i of t)r.get(i.kind).add(i.value);let o=le.map(i=>({kind:i,source_producers:e.producer_count_by_kind[i],runtime_values:r.get(i).size})),n=o.filter(({source_producers:i,runtime_values:s})=>i>0&&s===0).map(({kind:i})=>i);return{ok:e.ok&&n.length===0,source_producer_count:e.producer_count,runtime_value_count:o.reduce((i,{runtime_values:s})=>i+s,0),coverage_by_kind:o,missing_runtime_kinds:n}}var uN=pb;(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="ae22de89-8bac-5728-a6e2-29b342383abe")}catch{}})();var mN=16,mb=Object.freeze(["bulk_ids_input_empty","bulk_ids_input_missing_path","bulk_ids_input_unreadable","invalid_argument_value","missing_lifecycle_target","missing_required_argument","projection_options_mutually_exclusive","tracker_not_initialized","tracker_root_missing","tracker_root_not_directory","tracker_root_unreadable","unknown_context_intent","unknown_field_projection","unknown_option","unknown_subcommand"]),Co=18,To=Object.freeze([...mb,"manifest_unknown_key","no_version_bounds_declared"].sort((e,t)=>e.localeCompare(t)));function fN(e,t=Co){return{ok:e.executable_error_code_count>=t,baseline:t,actual:e.executable_error_code_count}}function _N(e,t=To){let r=new Set(e.rows.filter(({disposition:n})=>n==="executable").map(({canonical_code:n})=>n)),o=t.filter(n=>!r.has(n));return{ok:o.length===0,required_canonical_codes:[...t],missing_required_canonical_codes:o}}function St(e,t){let r=e.get(t);if(r)return r;let o={kinds:new Set,probeIds:new Set};return e.set(t,o),o}function hN(e,t,r){let o=new Map(e.map(l=>[l.code,l.canonical_code??l.code])),n=new Map,i=0,s=0;for(let l of e){let u=St(n,l.canonical_code??l.code);for(let f of l.owned_states??[])u.kinds.add("owned_state"),u.probeIds.add(f.probe_id)}for(let l of t){let u=o.get(l.error_code);if(u===void 0)continue;i+=1;let f=St(n,u);f.kinds.add("closed_domain"),f.probeIds.add(l.probe_id)}for(let l of r){let u=o.get(l.error_code);if(u===void 0)continue;s+=1;let f=St(n,u);f.kinds.add("grammar"),f.probeIds.add(l.probe_id)}let a=e.map(l=>{let u=l.canonical_code??l.code,f=n.get(u),g=[...f.probeIds].sort();return{code:l.code,canonical_code:u,disposition:g.length>0?"executable":"uncovered",evidence_kinds:[...f.kinds].sort(),probe_ids:g}}).sort((l,u)=>l.code<u.code?-1:1),c=a.filter(({disposition:l})=>l==="uncovered").map(({code:l})=>l),d=a.length-c.length;return{ok:c.length===0,catalog_error_code_count:a.length,executable_error_code_count:d,uncovered_error_code_count:c.length,coverage_fraction:a.length===0?1:d/a.length,closed_domain_probe_count:i,grammar_probe_count:s,uncovered_error_codes:c,rows:a}}function gN(e){let t=e.rows.map(r=>`| \`${r.code}\` | \`${r.canonical_code}\` | ${r.disposition} | ${r.evidence_kinds.join(", ")||"none"} | ${r.probe_ids.length} |`);return["# Generated refusal closure census","","Tracker: `pm-f05lsg`.","","Every catalog code is listed. An `uncovered` row is an explicit closure obligation, never an omission or implied approval.","",`- Catalog error codes: ${e.catalog_error_code_count}`,`- Executable error codes: ${e.executable_error_code_count}`,`- Executable-code ratchet floor: ${Co}`,`- Required executable canonical codes: ${To.map(r=>`\`${r}\``).join(", ")}`,`- Uncovered error codes: ${e.uncovered_error_code_count}`,`- Coverage fraction: ${e.coverage_fraction.toFixed(6)}`,`- Closed-domain probes: ${e.closed_domain_probe_count}`,`- Grammar probes: ${e.grammar_probe_count}`,"","| Error code | Canonical code | Disposition | Evidence kinds | Probe count |","| --- | --- | --- | --- | --- |",...t,""].join(`
|
|
31
|
+
`)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="6ecdd8cf-3153-5ed9-abd4-e8a73da6662a")}catch{}})();function fb(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 _b(e){return[e.exit_code!==L.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 ${L.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."},...fb(e)]}function CN(e){let t=[],r=new Set,o=0;e.length===0&&t.push({code:"empty_corpus",probe_id:"corpus",detail:"At least one real refusal observation is required."});for(let n of e){if(r.has(n.probe_id)){t.push({code:"duplicate_probe",probe_id:n.probe_id,detail:`${n.probe_id} was supplied more than once.`});continue}r.add(n.probe_id);let i=t.length;for(let s of _b(n))s!==void 0&&t.push(s);t.length===i&&(o+=1)}return t.sort((n,i)=>n.probe_id!==i.probe_id?n.probe_id.localeCompare(i.probe_id):n.code.localeCompare(i.code)),{ok:t.length===0,probe_count:r.size,closed_probe_count:o,closure_fraction:r.size===0?0:o/r.size,findings:t}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="e24f17e6-8b47-5dc0-b245-d6625b4fb60e")}catch{}})();var So="not-a-declared-action";function hb(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 ue(e){return e.replaceAll(/[^a-z0-9]+/gu,"-").replaceAll(/^-|-$/gu,"")}function IN(e=He.filter(t=>Ft.some(r=>r.command===t.command&&r.disposition!=="package_owned"))){let t=new Set(e.filter(({command:r})=>!r.includes(" ")).map(({command:r})=>ue(r)));return e.flatMap(r=>r.slots.flatMap((o,n)=>{if(!o.required)return[];let i=r.command.split(" "),s=ue(r.command),a=i.length>1&&t.has(s)?i.map(ue).join("--"):s,c=te(r.command).flatMap(l=>l.required?[l.flag,...l.value_name?["example"]:[]]:[]),d=Ve.some(l=>l.command===r.command);return[{probe_id:`required-argument-${a}-${ue(o.name)}`,command:r.command,refusal_args:[...i,...r.slots.slice(0,n).map(l=>hb(r.command,l)),...c],recovery_args:[...i,"--help"],error_code:d&&!r.command.startsWith("assurance ")?"invalid_argument_value":/^extension (?:activate|adopt|deactivate|uninstall)$/u.test(r.command)?"missing_lifecycle_target":"missing_required_argument",missing_argument:o.name,missing_argument_index:n}]})).sort((r,o)=>r.probe_id.localeCompare(o.probe_id))}function gb(e){switch(e){case"assurance":case"workspace snapshot":return Ve.filter(({parent:t})=>t===e).map(({action:t})=>t);case"graph":return qe;case"merge":return ze;case"plan":return Ye;case"profile":return Je;case"schema":return Gt;default:throw new Error(`Required positional action family ${e} has no authoritative value domain.`)}}function RN(e=He){return e.filter(({slots:t})=>t[0]?.required===!0&&t[0].value_kind==="action").map(({command:t})=>{let r=t.split(" ");return{probe_id:`unknown-subcommand-${ue(t)}`,command:t,refusal_args:[...r,So],recovery_args:[...r,"--help"],error_code:"unknown_subcommand",rejected_value:So,allowed_values:[...gb(t)].sort()}}).sort((t,r)=>t.probe_id.localeCompare(r.probe_id))}function yb(e,t){let r=[...t].sort();return e.length===t.length&&[...e].sort().every((o,n)=>o===r[n])}function bb(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&&!yb(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 PN(e,t){let r=new Map(e.map(s=>[s.probe_id,s])),o=new Map(t.map(s=>[s.probe_id,s])),n=[...e.flatMap(s=>bb(s,o.get(s.probe_id))),...t.filter(s=>!r.has(s.probe_id)).map(s=>({code:"unexpected_refusal_probe",probe_id:s.probe_id,detail:`${s.probe_id} has no declared grammar refusal contract.`}))];n.sort((s,a)=>s.probe_id.localeCompare(a.probe_id)||s.code.localeCompare(a.code));let i=new Set(n.map(({probe_id:s})=>s));return{ok:n.length===0,probe_count:e.length,closed_probe_count:e.filter(({probe_id:s})=>!i.has(s)).length,findings:n}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="5053cc84-63e5-50d3-9a4c-00c2a485ed69")}catch{}})();var wt=[{probe_id:"tracker-root-missing",failure_kind:"missing_root",expected_error_code:"tracker_root_missing",expected_exit_code:3,recovery_kind:"initialize"},{probe_id:"tracker-root-settings-missing",failure_kind:"settings_missing",expected_error_code:"tracker_not_initialized",expected_exit_code:3,recovery_kind:"initialize"},{probe_id:"tracker-root-not-directory",failure_kind:"not_directory",expected_error_code:"tracker_root_not_directory",expected_exit_code:2,recovery_kind:"select_directory"},{probe_id:"tracker-root-unreadable",failure_kind:"unreadable_root",expected_error_code:"tracker_root_unreadable",expected_exit_code:1,recovery_kind:"repair_permissions"}];function kN(){return wt.map(e=>({...e}))}function Cb(e,t){let r=[];t.error_code!==e.expected_error_code&&r.push({code:"error_code_mismatch",probe_id:e.probe_id,detail:`Expected ${e.expected_error_code}, received ${t.error_code}.`}),t.exit_code!==e.expected_exit_code&&r.push({code:"exit_code_mismatch",probe_id:e.probe_id,detail:`Expected exit ${e.expected_exit_code}, received ${t.exit_code}.`}),t.recovery_kind!==e.recovery_kind&&r.push({code:"recovery_kind_mismatch",probe_id:e.probe_id,detail:`Expected ${e.recovery_kind}, received ${t.recovery_kind}.`});let o=t.suggested_retry_args.indexOf("init"),n=o===0||o===2&&t.suggested_retry_args[0]==="--pm-path"&&t.suggested_retry_args[1]?.length>0;return e.recovery_kind==="initialize"&&!n&&r.push({code:"missing_init_recovery",probe_id:e.probe_id,detail:"Missing and uninitialized roots must emit a tokenized init retry."}),(t.unsafe_init_recommended||e.recovery_kind!=="initialize"&&t.suggested_retry_args.includes("init"))&&r.push({code:"unsafe_init_recovery",probe_id:e.probe_id,detail:"A tracker root that cannot be initialized safely must not recommend initialization."}),t.retry_succeeded||r.push({code:"retry_failed",probe_id:e.probe_id,detail:"The emitted retry or safe alternate-root recovery did not execute successfully."}),r}function xN(e){let t=new Map(e.map(n=>[n.probe_id,n])),r=[],o=0;for(let n of wt){let i=t.get(n.probe_id);if(i===void 0){r.push({code:"missing_probe",probe_id:n.probe_id,detail:"No runtime observation was supplied for this contract."});continue}let s=Cb(n,i);r.push(...s),s.length===0&&(o+=1)}return r.sort((n,i)=>n.probe_id.localeCompare(i.probe_id)||n.code.localeCompare(i.code)),{ok:r.length===0,probe_count:wt.length,closed_probe_count:o,findings:r}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="ae33c5bd-ca3a-5ae5-a313-6a8daa71c52c")}catch{}})();var xe,Tb=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 Sb(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=Tb[me(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(me(e))?"linked-file-path":["comments","notes","learnings"].includes(e)?"entry-file-input":"plan-definition-file"}function Ne(){if(xe!==void 0)return xe;let t=re.filter(({command:i})=>Ke(i)).flatMap(({command:i,family:s})=>sr(i,te(i)).map(a=>({command:i,family:s,concept:Sb(i,a.flag),flag:a.flag,aliases:Object.freeze([...a.aliases??[]]),value_kind:a.repeatable?"list":a.flag==="--limit"?"number":a.value_type}))),r=new Set(t.flatMap(i=>i.aliases.map(s=>`${i.command}:${s}`))),o=t.filter(i=>!r.has(`${i.command}:${i.flag}`)),n=new Map;for(let i of o){let s=n.get(i.concept)??new Set;s.add(i.value_kind),n.set(i.concept,s)}return xe=Object.freeze(o.map(i=>Object.freeze({...i,concept:n.get(i.concept)?.size===1?i.concept:`${i.concept}@${i.command}`}))),xe}function jN(){return Object.freeze(Ne().map(e=>Object.freeze({command:e.command,canonical_flag:e.flag,accepted_spellings:Object.freeze([...new Set([e.flag,...e.aliases])].sort())})))}var wo=Object.freeze({init:30,config:36,extension:54,package:55,packages:55,install:27,upgrade:29,create:100,copy:24,focus:22,list:86,"list-all":86,"list-draft":84,"list-open":84,"list-in-progress":84,"list-blocked":84,"list-closed":84,"list-canceled":84,aggregate:40,context:45,ctx:45,get:30,graph:34,search:78,duplicates:25,eval:25,next:38,history:35,events:33,"history-redact":27,"history-repair":27,"history-compact":30,"history-author-acknowledge":28,merge:27,schema:43,profile:22,activity:35,restore:23,update:105,"update-many":146,close:32,"close-many":72,delete:24,append:25,comments:31,notes:35,learnings:31,files:39,docs:30,deps:32,plan:109,test:53,"test-all":40,telemetry:21,stats:29,health:36,validate:46,assurance:30,gc:22,workspace:23,contracts:29,claim:39,release:24,"start-task":23,"pause-task":23,"close-task":24,meet:33,event:33,remind:29,"test-runs-worker":25}),Eo=Object.freeze({...wo,...Object.fromEntries($e.flatMap(({alias:e,canonical:t})=>{let r=wo[e];return r===void 0?[]:[[t,r]]}))});function Ao(){let e=new Map(Object.keys(Eo).map(t=>[t,0]));for(let{command:t}of Ne())e.set(t,Number(e.get(t))+1);return Object.freeze(Object.entries(Eo).map(([t,r])=>Object.freeze({command:t,current:Number(e.get(t)),maximum:r})))}function wb(e,t,r){for(let o of e)for(let n of o.aliases){let i=t.get(`${o.command}:${n}`);i===void 0||i.flag===o.flag||r.push({code:"alias_collision",command:o.command,detail:`${n} aliases ${o.flag} but is canonical for ${i.flag}.`})}}function Eb(e,t,r){let o=new Set(t.map(({command:n})=>n));for(let n of e.keys())o.has(n)||r.push({code:"missing_budget",command:n,detail:`${n} has canonical flags but no persisted budget.`});for(let n of t){let i=e.get(n.command)??0;i===0&&r.push({code:"stale_budget",command:n.command,detail:`${n.command} has a persisted budget but no canonical flags.`}),!(i<=n.maximum)&&r.push({code:"budget_exceeded",command:n.command,detail:`${i} canonical flags exceed the ratcheted maximum ${n.maximum}.`})}}function Ab(e,t,r){let o=new Map(e.map(n=>[`${n.command}:${n.flag}`,n]));for(let n of t){let i=`${n.command}:${n.canonical_flag}`,s=o.get(i);if(!s){r.push({code:"removed_canonical_spelling",command:n.command,detail:`${n.canonical_flag} disappeared from the executable spelling inventory.`});continue}let a=new Set([s.flag,...s.aliases]);for(let c of n.accepted_spellings)a.has(c)||r.push({code:"removed_compatibility_spelling",command:n.command,detail:`${c} no longer resolves to ${n.canonical_flag}.`})}}function GN(e=Ne(),t=Ao(),r=[]){let o=[],n=new Map,i=new Map,s=new Map,a=new Map;for(let c of e){let d=`${c.command}:${c.flag}`;n.has(d)?o.push({code:"duplicate_canonical_flag",command:c.command,detail:`${c.flag} has more than one canonical row.`}):n.set(d,c),a.set(c.command,(a.get(c.command)??0)+1);let l=i.get(c.concept);l!==void 0&&l!==c.value_kind?o.push({code:"inconsistent_concept_kind",command:c.command,detail:`${c.concept} uses both ${l} and ${c.value_kind}.`}):i.set(c.concept,c.value_kind);let u=s.get(c.concept);u!==void 0&&u!==c.flag?o.push({code:"semantic_spelling_collision",command:c.command,detail:`${c.concept} is canonicalized by both ${u} and ${c.flag}.`}):s.set(c.concept,c.flag)}return wb(e,n,o),Eb(a,t,o),Ab(e,r,o),o.sort((c,d)=>c.command.localeCompare(d.command)||c.code.localeCompare(d.code)||c.detail.localeCompare(d.detail)),{ok:o.length===0,entry_count:e.length,budget_count:t.length,concept_count:new Set(e.map(({concept:c})=>c)).size,baseline_entry_count:r.length,findings:o}}function UN(){let e=Ne(),t=Ao(),r=new Map(t.map(({command:n})=>[n,"unknown"]));for(let{command:n,family:i}of e)r.set(n,i);return["# Generated flag lexicon budgets","","This file is generated by `listPmFlagLexicon()`. Compatibility aliases do not consume canonical budget.","","| Command | Capability family | Canonical flags | Maximum |","| --- | --- | ---: | ---: |",...t.map(({command:n,current:i,maximum:s})=>{let a=r.get(n);return`| \`${n}\` | ${a} | ${i} | ${s} |`}),""].join(`
|
|
32
|
+
`)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="a169a68c-13d0-5a3a-b231-abdf1a34ef6a")}catch{}})();function qN(e){return e}function zN(e){return e}function VN(e){return e}function HN(e){return e}function KN(e){return e}function WN(e){return e}function XN(e){return e}function YN(e){return e}function JN(e){return e}function ZN(e){return e}function QN(e){return e}function eL(e){return e}function tL(e){return e}function rL(e){return{handled:!0,result:e}}function oL(){return{handled:!1}}function nL(e){return e}function iL(e){return e}function sL(e){return e}function aL(e){return e}function cL(e){return e}function dL(e){return e}function lL(e){return e}function uL(e){return e}function pL(e){return e}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="14bbf3be-03a5-5ff3-888f-6e8b9a68ac73")}catch{}})();function vb(e={},t={}){return new he(t).extension(void 0,{...e,migrate:!0})}function Ob(e={},t={}){return new he(t).packageMigrate(e)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="af4da99c-f557-5bf7-a439-c14878e4970d")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="db5452b6-8d36-5425-a033-1d36757ce96e")}catch{}})();import{createHash as Oo,createHmac as Ib,randomBytes as Rb,timingSafeEqual as Pb}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="31eda153-a06e-51ef-a62f-f6dce09064d3")}catch{}})();var nD="dev.unbrained.pm/progressive-tool-discovery",iD=Object.freeze({version:1,discoveryTool:"pm_discover",canonicalResult:"structuredContent.result",compatibilityText:"pointer"}),Mb=Object.freeze(["pm_discover","pm_next","pm_context","pm_search","pm_get"]),q=Object.freeze({lexical:.4,semantic:.2,graph:.1,permission:.15,freshness:.05,usage:.1}),kb=Object.freeze(["profile_changed","tool_contract_changed","workspace_extension_changed","authorization_changed","ranking_signal_changed","cursor_integrity_key_rotated"]),Io={core:0,standard:1,full:2,internal:3},Ro=Object.freeze(["core","standard","full"]),xb=new Set(["core","standard","full","custom"]),Po=new Set(re.map(({family:e})=>e)),Nb=Rb(32);function De(e,t){if(typeof e!="string")throw new b(`pm tool discovery ${t} must be a string of at most 4096 Unicode characters.`,64);let r=e[Symbol.iterator](),o=0;for(let n=r.next();!n.done;n=r.next())if(o+=1,o>4096)throw new b(`pm tool discovery ${t} must be a string of at most 4096 Unicode characters.`,64);return e}function Mo(e){if(!Number.isInteger(e)||Number(e)<1||Number(e)>100)throw new b("pm tool discovery limit must be from 1 through 100.",64);return Number(e)}function ko(e){if(e!=="unbounded"&&(!Number.isInteger(e)||Number(e)<128))throw new b("pm tool discovery outputBudget must be unbounded or an integer of at least 128.",64);return e==="unbounded"?e:Number(e)}function xo(e){if(e!==void 0&&typeof e!="boolean")throw new b("pm tool discovery includeSchema must be a boolean.",64);return e===!0}function No(e){if(e===null||typeof e!="object"||Array.isArray(e))throw new b("pm tool discovery options must be an object.",64)}function Lb(e){if(!Array.isArray(e))throw new b("pm tool discovery candidates must be an array.",64);for(let[t,r]of e.entries()){if(r===null||typeof r!="object"||Array.isArray(r))throw new b(`pm tool discovery candidate ${t} must be an object.`,64);if(typeof r.name!="string"||r.name.trim().length===0)throw new b(`pm tool discovery candidate ${t} name must be a non-empty string.`,64);if(typeof r.description!="string"||r.description.trim().length===0)throw new b(`pm tool discovery candidate ${t} description must be a non-empty string.`,64);if(r.inputSchema===null||typeof r.inputSchema!="object"||Array.isArray(r.inputSchema))throw new b(`pm tool discovery candidate ${t} inputSchema must be an object.`,64);if(r.authorized!==void 0&&typeof r.authorized!="boolean")throw new b(`pm tool discovery candidate ${t} authorized must be a boolean.`,64)}}function sD(e){if(No(e),e.family!==void 0&&(typeof e.family!="string"||!Po.has(e.family)))throw new b("pm tool discovery family must be a declared capability family.",64);if(e.tier!==void 0&&(typeof e.tier!="string"||!Ro.includes(e.tier)))throw new b("pm tool discovery tier must be core, standard, or full.",64);return{...e.query!==void 0?{query:De(e.query,"query")}:{},...e.family!==void 0?{family:e.family}:{},...e.tier!==void 0?{tier:e.tier}:{},...e.limit!==void 0?{limit:Mo(e.limit)}:{},...e.cursor!==void 0?{cursor:De(e.cursor,"cursor")}:{},...e.includeSchema!==void 0?{includeSchema:xo(e.includeSchema)}:{},...e.outputBudget!==void 0?{outputBudget:ko(e.outputBudget)}:{}}}function Db(e){return e===void 0||!Number.isFinite(e)?0:Math.min(1,Math.max(0,e))}function pe(e){return[...new Set(e.toLowerCase().match(/[a-z0-9]+/gu)??[])].sort()}function $b(e,t){let r=pe(e);if(r.length===0)return 0;let o=new Set(pe(t)),n=r.filter(s=>o.has(s)).length,i=t.toLowerCase().includes(e.toLowerCase())?.25:0;return Math.min(1,n/r.length+i)}function Fb(e,t){let r=pe(e);if(r.length===0)return 0;let o=t.toLowerCase(),n=pe(t),i=r.filter(a=>n.some(c=>c.startsWith(a)||a.startsWith(c))).length,s=o.includes(e.toLowerCase())?.2:0;return Math.min(1,i/r.length+s)}function vo(e){return Oo("sha256").update(JSON.stringify(e)).digest("hex").slice(0,24)}function Lo(e,t,r){return Ib("sha256",r).update(JSON.stringify({version:1,fingerprint:e,offset:t})).digest("base64url")}function jb(e,t,r){let o={version:1,offset:t,signature:Lo(e,t,r)};return Buffer.from(JSON.stringify(o),"utf8").toString("base64url")}function Gb(e,t,r,o){if(e===void 0)return 0;try{let n=JSON.parse(Buffer.from(e,"base64url").toString("utf8"));if(n.version!==1||!Number.isInteger(n.offset)||(n.offset??-1)<0||Number(n.offset)>r||typeof n.signature!="string")throw new Error("cursor fields do not match the request");let i=Buffer.from(Lo(t,n.offset,o),"base64url"),s=Buffer.from(n.signature,"base64url");if(s.length!==i.length||!Pb(s,i))throw new Error("cursor signature does not match the request");return n.offset}catch(n){throw new b("Invalid or stale pm tool discovery cursor; restart discovery without cursor.",64,{reason:String(n)})}}function Et(e,t,r){return{value:Db(e),weight:t,available:r!=="unavailable",source:r}}function Le(e,t,r){return Et(e??t,r,e===void 0?"computed":"host")}function Ub(e,t,r){let o=Object.hasOwn(_e,e.name)?_e[e.name]:"help",n=Ze(o),i=`${e.name} ${e.description} ${o} ${n}`,s=$b(t,i),a=new Set(pe(t)),c={lexical:Et(s,q.lexical,"computed"),semantic:Le(e.signals?.semantic,Fb(t,i),q.semantic),graph:Le(e.signals?.graph,a.has(n)||a.has(o)?1:0,q.graph),permission:Et(1,q.permission,"authorization"),freshness:Le(e.signals?.freshness,1,q.freshness),usage:Le(e.signals?.usage,Mb.includes(e.name)?1:0,q.usage)},d=Object.values(c).reduce((l,u)=>l+u.value*u.weight,0);return{name:e.name,description:e.description,command:o,tier:Qe(o),family:n,score:Number(d.toFixed(6)),signals:c,...r?{input_schema:structuredClone(e.inputSchema)}:{}}}function Bb(e){if(e.cursorIntegrityKey!==void 0&&(!(e.cursorIntegrityKey instanceof Uint8Array)||e.cursorIntegrityKey.byteLength<32))throw new b("pm tool discovery cursorIntegrityKey must contain at least 32 bytes.",64);if(e.tier!==void 0&&(typeof e.tier!="string"||!Ro.includes(e.tier)))throw new b("pm tool discovery tier must be core, standard, or full.",64);if(e.family!==void 0&&(typeof e.family!="string"||!Po.has(e.family)))throw new b("pm tool discovery family must be a declared capability family.",64);if(e.profile!==void 0&&(typeof e.profile!="string"||!xb.has(e.profile)))throw new b("pm tool discovery profile must be core, standard, full, or custom.",64)}function qb(e){let r=De(e.query===void 0?"":e.query,"query").trim().replace(/\s+/gu," ");De(e.cursor===void 0?"":e.cursor,"cursor");let o=Mo(e.limit===void 0?10:e.limit),n=ko(e.outputBudget===void 0?1200:e.outputBudget);return Bb(e),{query:r,includeSchema:xo(e.includeSchema),limit:o,budget:n,maximumTier:Io[e.tier??"full"],profile:e.profile===void 0?"core":e.profile}}function Do(e,t,r){let o=r??e.tools.reduce((s,a,c)=>s+(c===0?0:1)+Buffer.byteLength(JSON.stringify(a),"utf8"),0),n={...e,tools:[]},i=0;for(let s=0;s<4;s+=1){let a=Buffer.byteLength(JSON.stringify({...n,token_cost:{estimated_tokens:i,budget:t,within_budget:!0}}),"utf8"),c=Math.ceil((a+o)/4);if(c===i)break;i=c}return i}function zb(e,t,r){return e.filter(o=>o.authorized!==!1).map(o=>Ub(o,r.query,r.includeSchema)).filter(o=>o.tier!=="internal"&&Io[o.tier]<=r.maximumTier&&(t.family===void 0||o.family===t.family)).sort((o,n)=>n.score-o.score||(o.name<n.name?-1:o.name>n.name?1:0))}function Vb(e,t,r){if(t==="unbounded")return[...e];let o=[],n=0;for(let[i,s]of e.entries()){let a=n+(i===0?0:1)+Buffer.byteLength(JSON.stringify(s),"utf8");if(Do(r(i+1),t,a)>t)break;o.push(s),n=a}return o}function aD(e,t={}){Lb(e),No(t);let r=qb(t),o=t.cursorIntegrityKey??Nb,n=zb(e,t,r),i=vo({query:r.query,family:t.family??null,tier:t.tier??"full",includeSchema:r.includeSchema,profile:r.profile,ranked:n}),s=Gb(t.cursor,i,n.length,o),a=n.slice(s,s+r.limit),c=[];r.includeSchema||c.push({name:"input_schema",reason:"compact_projection",restore_with:"Set includeSchema=true."}),s+r.limit<n.length&&c.push({name:"tools",reason:"limit",restore_with:"Continue with next_cursor or increase limit."});let d={result_type:"pm_tool_discovery",contract_version:1,query:r.query,profile:r.profile,total:n.length,ranking_policy:{version:1,formula:"weighted_sum_then_name",weights:q},cache:{key:vo({fingerprint:i,cursorIntegrityKey:Oo("sha256").update(o).digest("hex"),limit:r.limit,offset:s,budget:r.budget}),ttl_ms:3e4,scope:"private",invalidates_on:kb}},l=(h,C=h.length)=>{let S=s+C,z=S<n.length,R=[...c];return C<a.length&&R.push({name:"tools",reason:"token_budget",restore_with:"Continue with next_cursor or increase outputBudget."}),{...d,tools:[...h],returned:C,has_more:z,...z?{next_cursor:jb(i,S,o)}:{},omission_receipt:{has_omissions:R.length>0,omitted:R}}},u=h=>{let C=l(h),S=Do(C,r.budget);return{...C,token_cost:{estimated_tokens:S,budget:r.budget,within_budget:r.budget==="unbounded"||S<=r.budget}}},f=Vb(a,r.budget,h=>l([],h)),g=u(f);if(a.length>0&&f.length===0){let h=u([a[0]]).token_cost.estimated_tokens;throw new b(`pm tool discovery outputBudget is too small to return a tool; increase it to at least ${h}.`,64,{required:String(h)})}if(r.budget!=="unbounded"&&g.token_cost.estimated_tokens>r.budget)throw new b(`pm tool discovery outputBudget is too small; at least ${g.token_cost.estimated_tokens} estimated tokens are required for this page.`,64,{required:String(g.token_cost.estimated_tokens)});return g}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="87fb8085-4f16-58a9-9de7-c871fb90be5b")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="25763f4f-7689-5fb7-b083-30a7080adb22")}catch{}})();export{$I as ACTIONABILITY_ORDERING_KINDS,Ss as ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS,gc as ACTIVITY_FLAG_CONTRACTS,$n as AGENT_PROVENANCE_DIMENSIONS,ta as AGGREGATE_FLAG_CONTRACTS,Ua as APPEND_FLAG_CONTRACTS,uR as ASSURANCE_ACTIONS,pR as ASSURANCE_DECLARATION_KINDS,nO as ASSURANCE_DOCUMENT_VERSION,ac as ASSURANCE_FLAG_CONTRACTS,iO as ASSURANCE_GATE_TRIGGERS,sO as ASSURANCE_MEASUREMENT_SOURCE_KINDS,wO as ASSURANCE_PRESET_IDS,eO as AssuranceEvaluationRefusalError,Qv as AssuranceMutationRefusalError,tO as AssuranceSourceResolutionError,wn as BASELINE_ITEM_FORMAT_VERSION,Ty as BOUNDARY_FIXTURE_CAPTURE_SOURCES,YI as BRIEF_LIST_FIELDS,jn as BUILTIN_AGENT_PROVENANCE_ADAPTERS,Y as BUILTIN_CORPUS_SHAPES,Fn as BUILTIN_HARNESS_SIGNAL_DESCRIPTORS,Zo as BUILTIN_ITEM_TYPE_VALUES,Yt as BUILTIN_PROFILES,kC as BUILTIN_RELATIONSHIP_KINDS,bs as CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS,hc as CALENDAR_FLAG_CONTRACTS,Ba as CLAIM_FLAG_CONTRACTS,Lc as CLOSE_ACTION_OPTION_KEYS,ja as CLOSE_FLAG_CONTRACTS,Ga as CLOSE_MANY_FLAG_CONTRACTS,Wa as CLOSE_TASK_FLAG_CONTRACTS,ra as COMMENTS_FLAG_CONTRACTS,TC as COMMON_MUTATION_COMMAND_OPTION_KEYS,Rc as COMPLETION_FLAG_CONTRACTS,nn as CONFIDENCE_TEXT_VALUES,ga as CONFIG_FLAG_CONTRACTS,Cs as CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS,ER as CONTEXT_EVALUATION_METRIC_NAMES,bc as CONTEXT_FLAG_CONTRACTS,Vt as CONTEXT_OUTPUT_VALUES,RR as CONTEXT_PACKING_PROFILES,hR as CONTEXT_RECENCY_EPOCH,CR as CONTEXT_RELEVANCE_SERVICE,yR as CONTEXT_RELEVANCE_SIGNAL_NAMES,kR as CONTEXT_SIGNAL_SET_VERSION,MR as CONTEXT_SIGNAL_STORE_FORMAT_VERSION,xR as CONTEXT_SIGNAL_STORE_WARNING_DETAILS,fw as CONTEXT_USAGE_LIMITS,Ic as CONTRACTS_FLAG_CONTRACTS,pc as COPY_FLAG_CONTRACTS,vs as CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,Is as CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,Os as CREATE_COMMANDER_STRING_OPTION_CONTRACTS,Yb as CREATE_DIRECT_CLOSE_REASON_DEFAULT,cc as CREATE_FLAG_CONTRACTS,Gw as CURRENT_HISTORY_ITEM_HASH_VERSION,Bw as CURRENT_HISTORY_RECORD_HASH_VERSION,En as CURRENT_ITEM_FORMAT_VERSION,$R as ContextSignalStore,_w as ContextUsageValidationError,Hv as DEFAULT_AUTHOR_IDENTITY_VOCABULARY,fP as DEFAULT_CHILD_SAMPLE_LIMIT,XI as DEFAULT_COMPACT_LIST_FIELDS,WE as DEFAULT_DERIVED_INDEX_MINIMUM_ITEMS,om as DEFAULT_EVAL_QUERIES_RELATIVE_PATH,ZR as DEFAULT_TERMINAL_TRANSITION_POLICY,UR as DEFAULT_WORKSPACE_MEMORY_MINIMUM_ITEMS,ev as DEFECT_ESCAPE_CLASSES,tv as DEFECT_GATE_EVIDENCE_DISPOSITIONS,za as DELETE_FLAG_CONTRACTS,tn as DEPENDENCY_KIND_VALUES,Sc as DEPS_FLAG_CONTRACTS,sa as DOCS_FLAG_CONTRACTS,nc as DUPLICATES_FLAG_CONTRACTS,CI as DURABLE_MERGE_RECEIPT_INTRODUCED_AT,Ec as EVAL_FLAG_CONTRACTS,Qp as EVAL_QUERY_SET_CONTRACT,em as EVAL_QUERY_SET_EXAMPLE,Zp as EVAL_QUERY_SET_SCHEMA_ID,yc as EVENTS_FLAG_CONTRACTS,Ya as EVENT_FLAG_CONTRACTS,zo as EXECUTABLE_COMMAND_ALIASES,L as EXIT_CODE,Ia as EXTENSION_ACTIVATE_FLAG_CONTRACTS,Oa as EXTENSION_ADOPT_ALL_FLAG_CONTRACTS,La as EXTENSION_ADOPT_FLAG_CONTRACTS,wv as EXTENSION_CAPABILITIES,Wb as EXTENSION_CAPABILITY_CONTRACT,Hb as EXTENSION_CAPABILITY_CONTRACT_VERSION,Kb as EXTENSION_CAPABILITY_LEGACY_ALIASES,fn as EXTENSION_CAPABILITY_REGISTRATION_SURFACES,Na as EXTENSION_CATALOG_FLAG_CONTRACTS,Ra as EXTENSION_DEACTIVATE_FLAG_CONTRACTS,va as EXTENSION_DESCRIBE_FLAG_CONTRACTS,xa as EXTENSION_DOCTOR_FLAG_CONTRACTS,Aa as EXTENSION_EXPLORE_FLAG_CONTRACTS,ya as EXTENSION_FLAG_CONTRACTS,Ca as EXTENSION_INIT_FLAG_CONTRACTS,wa as EXTENSION_INSTALL_FLAG_CONTRACTS,Ma as EXTENSION_MANAGE_FLAG_CONTRACTS,Pa as EXTENSION_MIGRATE_FLAG_CONTRACTS,Ev as EXTENSION_POLICY_MODES,Av as EXTENSION_POLICY_SURFACES,ka as EXTENSION_RELOAD_FLAG_CONTRACTS,Ov as EXTENSION_SANDBOX_PROFILES,ba as EXTENSION_SCOPE_FLAG_CONTRACTS,vv as EXTENSION_TRUST_MODES,Ea as EXTENSION_UNINSTALL_FLAG_CONTRACTS,MO as EXTERNAL_DEPENDENCY_RESOLUTION_STATUSES,RO as EXTERNAL_DEPENDENCY_SOURCE_KIND,PO as EXTERNAL_DEPENDENCY_SOURCE_KIND_ALIAS,ia as FILES_FLAG_CONTRACTS,mc as FOCUS_FLAG_CONTRACTS,rc as GC_FLAG_CONTRACTS,QI as GET_DEPTH_VALUES,Cc as GET_FLAG_CONTRACTS,Qs as GLOBAL_FLAG_CONTRACTS,Dd as GRAPH_DURABLE_CACHE_MIN_ITEMS,Ld as GRAPH_DURABLE_CACHE_VERSION,wc as GRAPH_FLAG_CONTRACTS,qe as GRAPH_SUBCOMMAND_VALUES,Tc as GUIDE_FLAG_CONTRACTS,ic as HEALTH_FLAG_CONTRACTS,ua as HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS,jO as HISTORY_AUTHOR_ATTRIBUTION_BASELINE,XP as HISTORY_COMPACT_BULK_DEFAULT_MIN_ENTRIES,pa as HISTORY_COMPACT_FLAG_CONTRACTS,Qn as HISTORY_EVENT_CLASSIFICATION_VERSION,aa as HISTORY_FLAG_CONTRACTS,Pe as HISTORY_ITEM_HASH_VERSION_3_INTRODUCED_IN,da as HISTORY_REDACT_FLAG_CONTRACTS,la as HISTORY_REPAIR_FLAG_CONTRACTS,Hp as INIT_AGENT_GUIDANCE_MODE_VALUES,ha as INIT_FLAG_CONTRACTS,Da as INSTALL_FLAG_CONTRACTS,on as ISSUE_SEVERITY_VALUES,lc as ITEM_COMPLETE_FLAG_CONTRACTS,uI as ITEM_LATEST_TIMESTAMP_FIELDS,Xb as ITEM_METADATA_KEY_ORDER,dc as ITEM_MUTATE_FLAG_CONTRACTS,uc as ITEM_REOPEN_FLAG_CONTRACTS,nI as ITEM_SCALAR_MISSING_VALUE,Qo as ITEM_TYPE_VALUES,lI as ITEM_UNION_COLLECTION_FIELDS,DR as JsonFileContextSignalStoreAdapter,na as LEARNINGS_FLAG_CONTRACTS,lp as LINKED_TEST_ENV_NAME_PATTERN,up as LINKED_TEST_PM_CONTEXT_MODE_VALUES,dp as LINKED_TEST_PROTECTED_ENV_KEYS,pp as LINKED_TEST_WORKSPACE_CONTEXT_MODE_VALUES,gs as LIST_COMMANDER_STRING_OPTION_CONTRACTS,JI as LIST_COMMAND_DEFAULT_PROJECTIONS,Rv as LIST_FILTER_EXTENSION_FLAG_DEFINITIONS,ea as LIST_FILTER_FLAG_CONTRACTS,oR as LIST_SORT_FIELDS,nR as LIST_SORT_ORDER_VALUES,ei as MAINTENANCE_HISTORY_OPERATIONS,mP as MAX_CHILD_PROJECTION_ITEMS,xS as MAX_WORKFLOW_POLICIES,NS as MAX_WORKFLOW_POLICY_TERMS,Xa as MEET_FLAG_CONTRACTS,DP as MERGE_DRIVER_ARTIFACT_VALUES,ca as MERGE_FLAG_CONTRACTS,ze as MERGE_SUBCOMMAND_VALUES,jP as MUTATION_EVENT_WIRE_BUDGET,ae as MemoryRelationshipGraphAdapter,Ts as NEXT_COMMANDER_STRING_OPTION_CONTRACTS,vc as NEXT_FLAG_CONTRACTS,Xu as NEXT_OUTPUT_VALUES,oa as NOTES_FLAG_CONTRACTS,Ta as PACKAGE_FLAG_CONTRACTS,Sa as PACKAGE_INIT_FLAG_CONTRACTS,Ka as PAUSE_TASK_FLAG_CONTRACTS,Nc as PLAN_CREATE_METADATA_PARAMETER_KEYS,_a as PLAN_FLAG_CONTRACTS,Dp as PLAN_SHOW_DEPTH_VALUES,Ye as PLAN_SUBCOMMANDS,$p as PLAN_TEMPLATE_NAMES,qy as PM_AGENT_TASK_ACCOUNTING_MODES,bt as PM_AGENT_TASK_TRANSCRIPT_VERSION,Uo as PM_BULK_LIFECYCLE_COMMAND_ALIASES,qc as PM_CLI_EXPECTED_ERROR_NAME,HA as PM_CLI_GRAMMAR_CONTRACT,UA as PM_CLI_GRAMMAR_NOUNS,hi as PM_CLI_ONLY_TOOL_ACTION_WAIVERS,BA as PM_CLI_SHARED_VERBS,qo as PM_COMMAND_ALIAS_CONTRACTS,re as PM_COMMAND_CAPABILITY_CONTRACTS,Ft as PM_COMMAND_DESTINATION_CONTRACTS,aP as PM_COMMAND_EXIT_CONTRACTS,sP as PM_COMMAND_EXIT_OUTCOME_CONTRACTS,Ni as PM_COMMAND_OUTPUT_BUDGET_CONTRACTS,aM as PM_COMMAND_OUTPUT_ENVELOPE_CONTRACTS,He as PM_COMMAND_POSITIONAL_CONTRACTS,Mm as PM_COMMAND_VISIBILITY_CONTRACTS,Mv as PM_COMPLETE_LIST_FINDING_CODES,$v as PM_CONTEXT_INTENTS_FILE,Aw as PM_CONTEXT_INTENT_CONTRACTS,Go as PM_CONTEXT_OPS_COMMAND_ALIASES,pi as PM_CORE_COMMAND_NAMES,j as PM_CORPUS_SHAPE_SCHEMA,yi as PM_DEPRECATED_TOOL_ACTIONS,Ri as PM_DIAGNOSTIC_DEGRADATION_STEPS,Pi as PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS,Ii as PM_DIAGNOSTIC_OUTPUT_CLASSES,bi as PM_DISCOVERABLE_TOOL_ACTIONS,to as PM_EPISODE_SCHEMA,iM as PM_ERROR_CODE_CATALOG,tM as PM_ERROR_CODE_EXIT_CLASS_CONTRACTS,ao as PM_EXACT_COVERAGE_METRICS,si as PM_EXTENSION_CAPABILITY_CONTRACTS,mi as PM_EXTENSION_PACKAGE_ACTION_SUBCOMMANDS,ci as PM_EXTENSION_POLICY_MODE_CONTRACTS,ui as PM_EXTENSION_POLICY_SURFACE_CONTRACTS,li as PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS,ai as PM_EXTENSION_SERVICE_NAME_CONTRACTS,di as PM_EXTENSION_TRUST_MODE_CONTRACTS,HO as PM_GITATTRIBUTES_END,VO as PM_GITATTRIBUTES_START,WO as PM_GITATTRIBUTES_V2_END,KO as PM_GITATTRIBUTES_V2_START,Wc as PM_GITIGNORE_END,Kc as PM_GITIGNORE_START,jo as PM_HISTORY_COMMAND_ALIASES,_i as PM_ITEM_ACTION_SUBCOMMANDS,dt as PM_MCP_APPS_EXTENSION,Fr as PM_MCP_APPS_SERVER_CAPABILITY,Ee as PM_MCP_APPS_SPEC_VERSION,Ur as PM_MCP_APP_CONTRACTS,Gr as PM_MCP_APP_MIME_TYPE,Mb as PM_MCP_ENTRY_TOOL_NAMES,m as PM_MCP_ERROR_CODES,d0 as PM_MCP_HTTP_PROTOCOL_VERSION,qh as PM_MCP_INPUT_REQUEST_METHODS,xk as PM_MCP_LEGACY_PROTOCOL_VERSIONS,lr as PM_MCP_LOG_LEVELS,A as PM_MCP_META_KEYS,nD as PM_MCP_PROGRESSIVE_DISCOVERY_EXTENSION,iD as PM_MCP_PROGRESSIVE_DISCOVERY_SERVER_CAPABILITY,Dm as PM_MCP_PROMPT_CONTRACTS,H as PM_MCP_PROTOCOL_VERSION,Lm as PM_MCP_RESOURCE_CONTRACTS,ut as PM_MCP_SKILLS_DRAFT_REVISION,Br as PM_MCP_SKILLS_EXTENSION,Xg as PM_MCP_SKILLS_SERVER_CAPABILITY,M as PM_MCP_SKILL_LIMITS,Se as PM_MCP_SUBSCRIPTION_ID_META_KEY,et as PM_MCP_SUPPORTED_PROTOCOL_VERSIONS,t0 as PM_MCP_TASKS_EXTENSION,eg as PM_MCP_TASK_STATUSES,_e as PM_MCP_TOOL_COMMAND_CONTRACTS,iS as PM_MODE_PAIRED_OUTPUT_PROJECTION_CONTRACTS,Qi as PM_MUTATION_ACTION_CONTRACTS,$e as PM_NAMESPACED_COMMAND_ALIASES,Qr as PM_OBSERVATION_SCHEMA,Oi as PM_OUTPUT_BUDGET_CLASSES,vi as PM_OUTPUT_DEGRADATION_STEPS,ar as PM_OUTPUT_ENVELOPE_KINDS,Bt as PM_PACKAGE_CONVENTIONAL_RESOURCE_ROOTS,fi as PM_PACKAGE_ONLY_ACTION_SUBCOMMANDS,Ut as PM_PACKAGE_RESOURCE_KINDS,Ve as PM_POSITIONAL_ACTION_CONTRACTS,Bc as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA,Gc as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION,rw as PM_READ_OUTPUT_COMPOSITION_OPTION_FLAGS,qS as PM_READ_OUTPUT_CONTINUATION_FINGERPRINT_POLICIES,QS as PM_READ_OUTPUT_DIMENSIONS,tw as PM_READ_OUTPUT_OPTION_FLAGS,WS as PM_READ_OUTPUT_SESSION_MAX_SEEN_ITEM_IDS,KS as PM_READ_OUTPUT_SESSION_MIN_TOKENS,ew as PM_READ_OUTPUT_SURFACES,ow as PM_READ_OUTPUT_SURFACE_CONTRACTS,nS as PM_READ_ROW_CONTRACTS,oS as PM_READ_ROW_JQ_SELECTOR,sN as PM_RECOVERY_REFERENCE_FIELDS,le as PM_RECOVERY_REFERENCE_KINDS,mb as PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE,To as PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE_V2,mN as PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE,Co as PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE_V2,Bo as PM_RELOCATED_COMMAND_ALIASES,ms as PM_REPRODUCIBLE_PROCESS_ENV,cP as PM_SUCCESS_EXIT_CODES,gi as PM_TOOL_ACTIONS,Dc as PM_TOOL_ACTION_PARAMETER_CONTRACTS,Uc as PM_TOOL_PARAMETERS_SCHEMA,jc as PM_TOOL_PARAMETERS_SCHEMA_MAJOR,Fc as PM_TOOL_PARAMETERS_SCHEMA_VERSION,kc as PM_TOOL_RESERVED_CUSTOM_FIELD_PROPERTIES,eo as PM_VERDICT_SCHEMA,Jr as PM_WORKSPACE_RECIPE_SCHEMA,fa as PROFILE_FLAG_CONTRACTS,or as PROFILE_LINT_CODES,rr as PROFILE_LINT_DIMENSIONS,Xt as PROFILE_NAMES,Je as PROFILE_SUBCOMMANDS,b as PmCliError,he as PmClient,kv as PmCompleteListValidationError,y as PmMcpAuthorizationError,ur as PmMcpInputRequiredError,xr as PmMcpIssuerCredentialStore,p as PmMcpProtocolError,pr as PmMcpRequestStateReplayGuard,Wr as PmMcpSkillRegistry,wr as PmMcpSubscriptionRegistry,at as PmMcpTaskStore,TS as QUERY_CURSOR_CONTRACT,Fa as REINDEX_FLAG_CONTRACTS,BE as REINDEX_LOCK_ID,yt as RELATIONSHIP_GRAPH_SNAPSHOT_VERSION,Va as RELEASE_FLAG_CONTRACTS,Ja as REMIND_FLAG_CONTRACTS,kt as RESERVED_ITEM_FIELD_NAMES,qa as RESTORE_FLAG_CONTRACTS,rn as RISK_VALUES,_v as RelationshipEventLog,hv as RelationshipEventStore,V as RelationshipGraph,Ue as RelationshipKindRegistry,ma as SCHEMA_FLAG_CONTRACTS,ys as SEARCH_COMMANDER_STRING_OPTION_CONTRACTS,Pv as SEARCH_EXTENSION_FLAG_DEFINITIONS,Oc as SEARCH_FLAG_CONTRACTS,Mu as SEMANTIC_ATTRIBUTION_LIMITS,Zb as SETTINGS_DEFAULTS,cm as SNAPSHOT_SCHEMA,BO as SOURCE_CONTEXT_ACCESS_ENV,qO as SOURCE_CONTEXT_WRITE_OVERRIDE_ENV,Ha as START_TASK_FLAG_CONTRACTS,oc as STATS_FLAG_CONTRACTS,en as STATUS_VALUES,Zs as SUBCOMMAND_GLOBAL_FLAG_CONTRACTS,ti as SUBSTANTIVE_HISTORY_OPERATIONS,Uw as SUPPORTED_HISTORY_ITEM_HASH_VERSIONS,qw as SUPPORTED_HISTORY_RECORD_HASH_VERSIONS,_C as SUPPRESS_HOST_OUTPUT_MARKER,ec as TELEMETRY_FLAG_CONTRACTS,of as TELEMETRY_SUBCOMMANDS,Qa as TEST_ALL_FLAG_CONTRACTS,Za as TEST_FLAG_CONTRACTS,tc as TEST_RUNS_FLAG_CONTRACTS,Zm as TEST_RUN_MEASUREMENT_LIMIT,Hs as TOOL_ACTIVITY_OPTION_CONTRACTS,Ns as TOOL_AGGREGATE_OPTION_CONTRACTS,Bs as TOOL_BULK_MUTATION_FILTER_OPTION_CONTRACT_SOURCE,Vs as TOOL_CALENDAR_OPTION_CONTRACTS,zs as TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS,Ks as TOOL_CONTEXT_OPTION_CONTRACTS,js as TOOL_CREATE_OPTION_CONTRACTS,Fs as TOOL_CREATE_OPTION_CONTRACT_SOURCE,Ws as TOOL_DEPS_OPTION_CONTRACTS,Xs as TOOL_GRAPH_OPTION_CONTRACTS,xs as TOOL_LIST_FILTER_OPTION_CONTRACTS,Ls as TOOL_SEARCH_FILTER_OPTION_CONTRACTS,$s as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS,Ds as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACT_SOURCE,qs as TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS,Us as TOOL_UPDATE_OPTION_CONTRACTS,Gs as TOOL_UPDATE_OPTION_CONTRACT_SOURCE,Jb as TYPE_TO_FOLDER,mC as UNKNOWN_SUBCOMMAND_COMPATIBILITY_CODES,Rs as UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,Ms as UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,Ps as UPDATE_COMMANDER_STRING_OPTION_CONTRACTS,fc as UPDATE_FLAG_CONTRACTS,_c as UPDATE_MANY_FLAG_CONTRACTS,$a as UPGRADE_FLAG_CONTRACTS,sc as VALIDATE_FLAG_CONTRACTS,kS as WORKFLOW_POLICY_ACTIONS,JO as WORKFLOW_POLICY_DOCUMENT_SCHEMA,YO as WORKFLOW_POLICY_SCHEMA,Ac as WORKSPACE_FLAG_CONTRACTS,uE as WORKSPACE_HISTORY_ID,dm as WORKSPACE_SNAPSHOT_ACTIONS,pd as WorkspaceGraphCache,Tv as WorkspaceTransactionInterruptedError,Pm as _testOnly,_R as _testOnlyAggregateCommand,Vp as _testOnlyConfigCommand,yP as _testOnlyGetCommand,Rl as _testOnlyHealthCommand,Yp as _testOnlyInit,Kp as _testOnlyInitAgentGuidance,LM as _testOnlyItemTransaction,qP as _testOnlyMutationEvents,XR as _testOnlyNextCommand,LP as _testOnlySearchCommand,oP as _testOnlySimilarity,gm as _testOnlyTemplates,cu as _testOnlyValidateCommand,HP as _testOnlyWorkspacePosition,OO as acceptAssuranceProposals,su as acknowledgeLinkedTests,rl as acknowledgeUnknownAuthorHistoryEvents,tl as acknowledgeUnknownAuthorHistoryEventsFromTransport,XE as acquireItemMetadataDerivedIndexLock,Be as acquireLock,KM as activateExtensionForTest,KC as activateExtensions,Dn as agentSessionEnvironment,e_ as aggregate,Um as analyzeAgentProvenanceDescriptorCoverage,ov as analyzeDefectChangeRisk,lR as analyzeDefectRecurrenceCoverage,sp as analyzeDuplicateItems,yv as analyzeGraphImpact,rd as analyzeHierarchyIntegrity,bv as analyzeKnowledgeGraph,lP as analyzePmCommandExitConformance,Ci as analyzePmToolActionParity,II as analyzeReconciliationDiscard,gv as analyzeRelationshipExecution,Od as analyzeRelationshipSchedule,Ah as analyzeSdkActionCoverage,jt as analyzeSdkCliParameterCompleteness,p_ as append,Ui as appendHistoryEntry,_E as appendWorkspaceAuditEvent,fE as appendWorkspaceHistoryChange,wT as applyAcceptanceCriteriaMutations,AO as applyAssurancePreset,Ph as applyBootstrapPagerPolicy,Pw as applyContextIntentProjection,Wu as applyContextTagProjection,iR as applyFilterValueEcho,dv as applyHistoryPatch,$h as applyInvocationAuthorOverride,Ll as applyPathMigrations,uw as applyReadOutputDimensions,aw as applyReadOutputIncludeModes,YS as applyReadOutputSessionReferences,bT as applyRegisteredItemFieldDefaultsAndValidation,jl as applyStandaloneNote,Tl as applyStoredExtensionMigrationState,AT as applyTagRemovals,rP as applyTerminalOrderingPolicy,Gl as artifactKey,oC as asRecordClone,rC as asRecordOrNull,We as assembleWorkspaceRelationshipGraph,Dv as assertCompleteListResult,Ok as assertExtensionBlueprint,vk as assertExtensionCapabilityUsage,ck as assertExtensionDeactivated,Pk as assertExtensionManifestCompatible,Rk as assertExtensionManifestMatchesBlueprint,Mk as assertExtensionPreflight,id as assertHierarchyMutationAllowed,YP as assertHistoryCompactTarget,PI as assertHistoryRepairTarget,Xi as assertInitializedTracker,Dl as assertLinkedArtifactMutationIsUnambiguous,Lk as assertMcpClientCapabilities,Nk as assertMcpProtocolHeader,By as assertMemoryRelationshipGraphAdapterConformance,IT as assertNoUnknownCsvKeys,dk as assertPackageManifest,EE as assertParentReferenceIsNotSelf,j0 as assertPmMcpSkillsCapability,Ik as assertProjectProfile,Ax as assertProjectRuntimeCompatibility,sS as assertProjectionModeChoice,Wi as assertReadableTrackerRoot,lk as assertRegisteredCommandContract,Ck as assertRegisteredCommandOverride,hk as assertRegisteredExporter,uk as assertRegisteredFlags,pk as assertRegisteredHook,_k as assertRegisteredImporter,gk as assertRegisteredItemField,yk as assertRegisteredItemType,Ak as assertRegisteredMigration,Tk as assertRegisteredParserOverride,Sk as assertRegisteredPreflightOverride,bk as assertRegisteredProfile,wk as assertRegisteredRendererOverride,mk as assertRegisteredSearchProvider,Ek as assertRegisteredServiceOverride,fk as assertRegisteredVectorStoreAdapter,DC as assertRelationshipEdgeAllowed,fo as assertRelationshipGraphAdapterConformance,aO as assuranceAssertionUpdateIsLoosening,xw as attachContextIntentReceipt,hw as attachContextUsageServingReceipt,ru as attachLinkedTestMutationProvenance,tu as attachLinkedTestProvenance,rt as attachMcpServerInfo,pS as attachOutputOmissionReceipt,Lw as attachOutputTokenAccounting,Nw as attachReadOutputContracts,JS as attachReadOutputSessionReceipt,al as auditMergeAttributeFence,XO as auditMergeDriverConfiguration,xd as auditWorkspaceRelationshipGraph,E0 as authorizeMcpHttpRequest,Nn as boundAgentEpisodeIdentity,PS as boundReadOutputRows,zu as buildChildrenByParent,SP as buildCompactSearchFilterSummary,sR as buildContentFilterEcho,LR as buildContextSignalSnapshot,fy as buildCorpusShapeItemPlan,rv as buildDefectRecurrenceIndex,gl as buildExtensionDescribeResult,El as buildExtensionInstallPlan,aR as buildGovernanceMissingFilterEcho,kE as buildInvalidTypeError,_P as buildItemChildrenRollup,xM as buildItemCompletionMutations,bR as buildItemContextRelevanceCandidates,tA as buildItemNotFoundError,gP as buildItemSchedule,NI as buildLinkedFileRepairReport,_0 as buildMcpAuthorizationDiscoveryUrls,Uh as buildMcpCompleteResult,$k as buildMcpDiscoverResult,C0 as buildMcpDynamicRegistrationMetadata,a0 as buildMcpHttpRequestHeaders,Bk as buildMcpInputRequiredResult,f0 as buildMcpProtectedResourceMetadata,il as buildMergeAttributePatterns,$c as buildPmActionToolInputSchema,hN as buildPmRefusalClosureCensus,$O as buildRelationshipContext,sA as buildSearchCorpus,cA as buildSemanticCorpusInput,xI as buildStatusRoleWarnings,Ki as buildTrackerInitializationRecovery,fA as buildVectorizationEmbeddingIdentity,_A as buildVectorizationEmbeddingMetadata,wP as buildVerboseSearchFilters,ZO as buildWorkflowCompletenessCheck,BR as buildWorkspaceMemorySnapshot,xn as canonicalDocument,SC as canonicalizeCommandOptionKey,gR as canonicalizeContextRecencyCoordinate,xC as canonicalizeRelationshipKind,aN as censusPmRecoveryReferenceProducers,Lv as certifyCompleteListResult,VM as checkExtensionManifestCompatibility,X_ as claim,Y_ as claimNext,GO as classifyHistoryAuthorEvent,ri as classifyHistoryEvent,vI as classifyHistoryMergeReceiptReferences,RC as classifyHostEnvironmentFault,kP as classifyImplicitSemanticFallbackReason,On as classifyItemFormatVersion,af as classifyLinkedTestCommandSafety,cf as classifyLinkedTestFailure,lT as clearActiveExtensionHooks,Ud as clearDurableGraphCache,ZT as clearFocusedItem,Jc as clearWorkspaceContractsCache,W_ as close,tp as closeItem,nh as closeTask,xh as coalesceRepeatedListFlags,FI as collectBlockedByIds,GI as collectBlockedByIdsFromCorpus,yw as collectContextUsageDeliveredItemIds,dd as collectDanglingDependencyReferences,BI as collectDependencyBlockedIds,ad as collectDuplicateDependencyRows,kd as collectDuplicateRelationshipEdgeGroups,MP as collectErrorCauseCodes,td as collectHierarchyRelations,Rr as collectMcpHeaderAnnotations,ld as collectMissingDependencyTargetIds,op as collectNewOrderingCycleWarnings,Rd as collectOrderingCycles,cd as collectOrderingStorageContradictions,Gv as collectPackageContextIntentContracts,zt as collectPackageExtensionDirectories,gT as collectRegisteredItemFieldNames,zT as collectRuntimeCreateFieldValues,xE as collectRuntimeFilterValues,VT as collectRuntimeUpdateFieldValues,ju as collectSubtreeIds,_n as collectUsedExtensionCapabilities,wC as commandOptionFlagLabel,o_ as comments,Df as commitImportedItem,NM as commitItemCompletion,kM as commitItemMutations,Sv as commitWorkspaceTransaction,Js as compactFlagAliasContracts,Gu as compareCriticalItems,G as comparePmDateVersions,Cv as compareRelationshipSnapshots,nC as compareTimestampStrings,Jv as compileHistoryProvenanceMatcher,Iw as composeContextIntentContracts,FM as composeExtension,zM as composeExtensionPackage,zI as computeActionabilityReport,cE as computeHistoryDiff,Ad as computeRelationshipCentrality,Ed as computeRelationshipDominators,ud as computeWorkspaceGraphFingerprint,f_ as config,dT as consumeAfterCommandAffectedItems,Wf as context,kw as contextIntentRowId,Z_ as copy,df as countFailureCategories,IS as countReadOutputRows,V_ as create,EO as createAssurancePreset,cR as createAssuranceWorkspaceContext,sC as createCheckpointId,xv as createCompleteListOptions,WC as createCoreCommandHookContext,so as createCorpusShapeMeasurement,pO as createEmptyAssuranceDocument,FC as createEmptyExtensionRegistrationRegistry,Hc as createExtensionCommandSdk,mn as createExtensionContributionInventory,kk as createExtensionTestHarness,Gi as createHistoryEntry,MA as createLazyModule,QO as createLifecycleCompletenessPolicies,A0 as createMcpStaticBearerVerifier,r0 as createMcpTaskStore,eA as createMutationGuardSdk,aS as createOutputOmissionReceipt,zc as createPmCliExpectedError,Fh as createPmCliProgram,ki as createPmCommandOutputBudget,fS as createQueryFingerprint,Uy as createRelationshipGraphScaleFixture,Q as createRelationshipGraphSnapshot,Pt as createRelationshipKindRegistry,_s as createReproducibleProcessRunner,EP as createSearchCursorFingerprint,XC as createSerialQueue,NT as createStdinTokenResolver,fC as createUnknownSubcommandError,BS as createWorkflowPolicyEvaluator,lm as createWorkspaceSnapshot,WM as deactivateExtensionForTest,oL as declineServiceOverride,Mw as decodeContextIntentCursor,PA as decodeHtmlEntitiesInOptions,Ir as decodeMcpHttpHeaderValue,yS as decodeQueryCursor,hS as decodeQueryCursorEnvelope,gS as decodeQueryCursorState,HS as decodeReadOutputContinuationCursor,P0 as decoratePmMcpToolsWithApps,Bl as dedupeLinkedArtifacts,TR as defaultScoreContextCandidates,dL as defineAfterCommandHook,aL as defineBeforeCommandHook,cL as defineBeforeMutationHook,VN as defineCommand,ZN as defineCommandOverride,X as defineCorpusShape,X0 as defineEpisodeSpecification,sL as defineExporter,DM as defineExtension,$M as defineExtensionBlueprint,qN as defineExtensionManifest,HN as defineFlag,iL as defineImporter,WN as defineItemField,KN as defineItemType,XN as defineMigration,ny as defineObservationContract,pL as defineOnIndexHook,uL as defineOnReadHook,lL as defineOnWriteHook,QN as defineParserOverride,xi as definePmCommandOutputBudget,sM as definePmCommandOutputEnvelope,rM as definePmErrorCodeCatalog,eL as definePreflightOverride,zN as defineProjectProfile,nL as defineRendererOverride,YN as defineSearchProvider,tL as defineServiceOverride,JN as defineVectorStoreAdapter,cy as defineVerdictContract,Ae as defineWorkspaceRecipe,Q_ as deleteItem,hm as deleteWorkspaceSnapshot,$C as dependencyToRelationship,l_ as deps,vO as deriveAssuranceProposals,GM as deriveExtensionCapabilities,uP as derivePmBulkMutationEffect,cN as derivePmRecoveryReferenceObligations,Id as deriveRelationshipDeadlines,ul as deriveSchemaEvolutionMigrationId,wA as deriveTelemetryCommandResolution,$E as describeAllowedTransitions,UO as describeExtensionActivation,UM as describeExtensionBlueprint,Su as describeItemOwnershipConflict,W0 as describeObservationCost,er as describeProfileComposition,tr as describeProjectProfile,hM as describeUnknownError,Hn as detectAgentIdentity,Yn as detectHarnessIdentity,Sd as detectRelationshipCommunities,Kn as diagnoseAgentIdentity,Nd as diffRelationshipAuditSnapshots,tf as diffTestRunMeasurements,Vk as digestMcpRequestParameters,VC as discoverExtensions,cn as discoverNearbyPmRoot,aD as discoverPmTools,Ly as discoverProjectRuntimeVersionPins,d_ as docs,r_ as duplicates,$d as durableGraphCachePath,Bd as durableGraphCacheStatus,An as effectiveItemFormatVersion,GA as emitTelemetryErrorEvent,Lf as emptyImportedDocument,sI as encodeItemScalarDecisionValue,Or as encodeMcpHttpHeaderValue,_S as encodeQueryCursor,VS as encodeReadOutputContinuationCursor,dE as enforceHistoryStreamPolicyForItem,lE as enforceHistoryStreamPolicyForItems,QP as enrichCliFlagInvocationContract,sr as enrichCliFlagInvocationContracts,uv as ensureMaterializedHistoryTarget,Yc as ensurePmGitignore,Pl as ensureScope,SA as ensureSentryInit,Nf as ensureTrackerInitialized,Cd as enumerateRelationshipPaths,Di as estimatePmOutputTokens,fO as evaluateAssuranceAssertion,_O as evaluateAssuranceGate,mx as evaluateBoundaryFixtures,AR as evaluateContextRanking,nv as evaluateDefectGateEvidence,mO as evaluateMeasurement,ts as evaluateMutationGuard,Km as evaluateProvenanceCoverage,zm as evaluateSemanticAttributionCoverage,cp as evaluateSimilarityGovernance,DE as evaluateTransition,dy as evaluateVerdictContract,US as evaluateWorkflowPolicies,dA as executeEmbeddingBatchesWithRetry,pA as executeVectorDelete,mA as executeVectorReset,uA as executeVectorUpsert,ey as executeWorkspaceRecipe,Fl as expandAddGlobEntries,Wl as explainSourceTraceability,ih as extension,ah as extensionActivate,ch as extensionDeactivate,sh as extensionList,vb as extensionMigrate,AI as extractHistoryMergeReceiptDispositions,EI as extractHistoryMergeReceiptReferences,T0 as extractMcpTraceContext,av as extractPatchFailureContext,Zl as extractReferencedPmItemIdsFromCommand,Gy as federateRelationshipGraphSnapshots,s_ as files,a_ as filesDiscover,c_ as filesLookup,bw as finalizeContextUsageDelivery,Cy as findCoverageDeficits,ap as findDuplicateClusters,nl as findGitWorkspaceRoot,GT as findHistoryIdentityDiscontinuities,_l as findInstalledNpmPackageCandidate,R0 as findPmMcpAppByUri,wd as findRedundantRelationshipEdges,vd as findRelationshipCutStructure,ip as findSimilarItems,jA as finishTelemetryCommand,uC as flattenFlagListValue,gy as flushTelemetryQueue,th as focus,Td as forEachMatchedRelationshipEdge,Md as formatDuplicateEdgeGroup,od as formatHierarchyRelation,Pd as formatOrderingStorageContradiction,VA as formatPmPositionalActionFlagTip,Rm as formatProfileApplyHuman,Im as formatProfileLintHuman,vm as formatProfileListHuman,Om as formatProfileShowHuman,fl as formatSchemaEvolutionMigrationHuman,NP as formatVectorIndexRecoveryWarnings,VP as formatWorkspacePositionHuman,j_ as gc,zi as generateItemId,Zf as get,sT as getActiveCommandResult,vw as getActiveContextIntentContracts,gn as getActiveExtensionRegistrations,w0 as getActiveMcpTraceContext,gO as getAssuranceDeclaration,Th as getContracts,YT as getFocusedItem,un as getHistoryPath,fv as getItemAt,ln as getItemPath,ns as getMutationActionContract,Xc as getPmGitignoreBlock,dn as getSettingsPath,Zc as getWorkspaceContracts,pE as getWorkspaceHistoryPath,u_ as graph,Fd as graphAuditBaselinePath,Vm as groupHistoryByEpisode,rL as handleServiceOverride,Dk as hasMcpClientExtension,I0 as hasPmMcpAppsCapability,Ke as hasSubcommandFlagContractsForCommand,hA as hasVectorizationEmbeddingIdentityChanged,gA as hasVectorizationVectorDimensionChanged,Jw as hashDocument,Zw as hashDocumentForVersion,Qw as hashEmptyDocument,Vw as hashHistoryPatch,zw as hashHistoryRecord,Hw as hashHistoryStream,aI as hashItemScalarDecisionValue,F_ as health,hd as hierarchyAncestors,gd as hierarchyDescendants,q_ as historyCompact,z_ as historyCompactBulk,Yv as historyEntryMatchesProvenance,Oe as historyItemHashVersionForRuntime,G_ as historyRedact,U_ as historyRepair,B_ as historyRepairAll,jI as indexBlockedByIds,nd as indexHierarchyRelations,yA as inferConsistentVectorDimension,Mi as inferPmOutputBudgetClass,m_ as init,Nv as inspectCompleteListResult,jC as inspectExtensionManifestSchema,Yd as inspectHistoryAuthorStream,_I as inspectMergeReceiptEvidence,$y as inspectProjectRuntimeCompatibility,us as inspectStaleInProgressItems,kI as inspectStatusRoleAssignments,mE as inspectWorkspaceHistoryState,um as inspectWorkspaceSnapshot,ll as installMergeFence,Fk as interpretMcpResultType,Ju as isAlreadyClaimedError,bM as isCommanderError,gu as isErrnoError,ZA as isExternalDependencyReference,QA as isExternalDependencySourceKind,fe as isFileMissingError,gC as isHostOutputSuppressed,iI as isItemScalarMissingValue,TI as isLegacyMergeReceiptSummary,_ as isMcpRecord,rs as isMutationAction,LC as isOrderingRelationshipKind,SE as isPlaceholderReferenceToken,Vc as isPmCliExpectedError,Si as isPmExtensionCapabilityContract,Ei as isPmExtensionPolicyModeContract,Ai as isPmExtensionPolicySurfaceContract,wi as isPmExtensionServiceNameContract,dP as isPmKnownExitCode,cM as isPmMutationReceipt,Xe as isPmSuccessfulExitCode,Ti as isPmToolAction,SI as isPreDurableCloneLocalReceiptSummary,wI as isPreDurableDispositionEligibleReference,Dy as isProjectMutatingInvocation,kA as isPureSnakeCaseAlias,pw as isReadOutputBudgetExceeded,dS as isReadRowContract,Xd as isRuntimeRecord,LA as isTerminalPlanMode,KT as isTerminalStatus,Jo as isTimestampLiteral,PM as itemDocumentToMutationOptions,hP as itemHasSchedule,is as jaccardSimilarity,i_ as learnings,pC as levenshteinDistanceWithinLimit,fu as limitAnnotationEntries,ou as linkedTestTrustFingerprint,BM as lintExtensionBlueprint,GC as lintExtensionManifestSchema,nr as lintProjectProfile,Xf as list,Un as listAgentProvenanceAdapters,kh as listAliasPluralKeys,Yf as listAllComplete,ZE as listAllDocumentCandidatesCached,Zi as listAllItemMetadata,QE as listAllItemMetadataLight,hO as listAssuranceDeclarations,SO as listAssuranceVerdicts,py as listBuiltinCorpusShapes,wM as listCoreClosedDomainContracts,eR as listGetProjectionFields,rI as listInvalidProvenanceHistoryStreamIds,ZI as listListProjectionFields,hI as listMergeReceipts,os as listMutationActions,GP as listMutationEvents,Ao as listPmCommandFlagBudgets,xm as listPmCommandsForFamily,km as listPmCommandsForTier,Ne as listPmFlagLexicon,jN as listPmFlagSpellingInventory,Nm as listPmMcpToolsForProfile,IN as listPmRequiredArgumentRefusalContracts,RN as listPmSubcommandRefusalContracts,Qt as listProfiles,kN as listTrackerPreflightRecoveryContracts,pm as listWorkspaceSnapshots,Uv as loadContextIntentRuntimeLayers,ym as loadCreateTemplateOptions,HC as loadExtensions,zd as loadGraphAuditBaseline,cC as loadMutationCheckpoint,N as loadRelationshipGraphAdapter,Yi as locateItem,OT as looksLikeGenericKeyValueEntry,RS as mapReadOutputRows,gI as markMergeReceiptReconciled,NE as matchesRuntimeFilters,$A as maybeRunFirstUseTelemetryPrompt,_y as measureCorpusShapePlan,Hi as measureItemMetadataReadWork,ET as mergeAdditiveTags,jM as mergeExtensionBlueprints,cI as mergeHistoryStreams,pI as mergeItemDocuments,mI as mergeJsonDocuments,Nh as mergeLinkedTestTwoTokenEntries,dI as mergeRelationshipEventStreams,Hu as mergeSortedWarnings,NA as migrateItemFilesToFormat,oA as mutateItem,rA as mutateItemWithHistoryContext,hE as mutateWorkspaceJsonWithHistory,Qf as next,qn as normalizeAgentProvenanceAdapterValue,mu as normalizeAnnotationTransportOptions,oO as normalizeAssuranceEvaluation,rO as normalizeAssuranceMutation,Lh as normalizeBootstrapInvocation,FT as normalizeBulkIdsValue,sd as normalizeDependencyGraphTarget,LO as normalizeDependencySeedId,NO as normalizeDependencySourceKind,pn as normalizeExtensionContributionInventory,tI as normalizeInvalidHistoryProvenance,pM as normalizeItemAddressInvocation,vn as normalizeItemFormatVersion,qi as normalizeItemId,Pn as normalizeItemMetadata,DO as normalizeItemReference,Mh as normalizeLegacyExtensionActionSyntax,$l as normalizeLinkedPath,TE as normalizeParentReferenceValue,Jt as normalizeProfileName,Bi as normalizeRawItemId,cw as normalizeReadOutputIncludeModeOptions,oE as normalizeReplayPatchOps,ss as normalizeSimilarityText,HT as normalizeStatusForRegistry,Rn as normalizeStatusInput,BT as normalizeStatusInputWithRegistry,yM as normalizeThrownExitCode,n_ as notes,Yo as nowIso,jd as openDurableGraphCache,zk as openMcpRequestState,Y0 as openPmEpisode,yd as orderingPredecessors,bd as orderingSuccessors,PR as packContextCandidates,Uu as packRankedContextItems,yh as packageActivate,gh as packageCatalog,bh as packageDeactivate,_h as packageDescribe,mh as packageDoctor,uh as packageInstall,dh as packageLifecycle,lh as packageList,fh as packageManage,Ob as packageMigrate,hh as packageReload,ph as packageUninstall,CS as paginateQueryRows,Ml as parseAddEntries,kl as parseAddGlobEntries,hu as parseAnnotationTextInput,OM as parseAtomicMutationControls,Rh as parseBootstrapCommandName,vh as parseBootstrapGlobalOptions,Ih as parseBootstrapHelpRequest,Dh as parseBootstrapTypeValue,$T as parseBulkIdsText,$u as parseContextDepth,xu as parseContextFocusFields,Fv as parseContextIntentDeclarations,Fu as parseContextSections,NR as parseContextSignalSnapshot,vT as parseCsvKv,sv as parseDefectChangeRiskRequest,dR as parseDefectRecurrenceCoverageRequest,iv as parseDefectRecurrencePolicy,tm as parseEvalQuerySet,Kd as parseGraphSubcommand,Wv as parseHistoryProvenanceFilters,qv as parseIntegerLimit,WT as parseItemDocument,IM as parseItemMutationBatch,ME as parseLimit,Tp as parseLinkedTestAssertionEqualsMap,Sp as parseLinkedTestAssertionGteMap,_p as parseLinkedTestBoolean,hp as parseLinkedTestContextMode,fp as parseLinkedTestEnvClear,mp as parseLinkedTestEnvSet,wp as parseLinkedTestJsonEntries,Cp as parseLinkedTestMinLines,bp as parseLinkedTestRegexList,yp as parseLinkedTestStringList,gp as parseLinkedTestWorkspaceContextMode,Hh as parseMcpCachePolicy,jh as parseMcpImplementation,it as parseMcpInputRequests,hr as parseMcpInputResponses,hg as parseMcpSubscriptionFilter,Nl as parseMigrateEntries,VI as parseMultiValueFilter,dM as parseMutationReceipt,DT as parseOptionalNonNegativeInteger,LT as parseOptionalNumber,eN as parsePmAgentTaskTranscriptCorpus,sD as parsePmToolDiscoveryOptions,zv as parsePriority,WI as parsePriorityFilterSet,XS as parseReadOutputSession,yT as parseRegisteredItemFieldAssignments,ce as parseRelationshipGraphSnapshot,xl as parseRemoveEntries,Kl as parseSourceLineRange,OE as parseStatusFilterCsv,HI as parseStringFilterSet,Cn as parseTags,Qm as parseTestRunMeasurements,Vv as parseType,KI as parseTypeFilterSet,el as parseUnknownAuthorHistoryEventCoordinates,LS as parseWorkflowPolicy,DS as parseWorkflowPolicyDocument,YR as partitionDecisionEntries,aE as patchPathToChangedField,Ko as pathExists,oh as pauseTask,Gd as persistDurableGraphResult,FE as persistSelectedItemFormat,TP as planAgentIdentityVocabularyMutation,GR as planCompletedAtBackfill,Al as planExtensionDirectoryCopy,ir as planProfileApplication,nN as planRelationshipEventBackfill,Hd as planRelationshipRemediation,pl as planSchemaEvolutionMigration,Zd as planUnknownAuthorHistoryAcknowledgment,mm as planWorkspaceSnapshotRestore,WA as positionalShapeKey,XA as positionalSignatureKey,HM as preflightExtension,cs as prepareSimilarityText,PT as preserveMutationStdinTokenFields,RT as preserveMutationStdinTokenLiterals,jw as printError,Fw as printResult,k_ as profile,L_ as profileApply,D_ as profileLint,x_ as profileList,N_ as profileShow,cT as projectAfterCommandItemSnapshot,Nu as projectContextFocusRows,Jm as projectFleetAttributionAnalytics,Xv as projectHistoryProvenance,Fi as projectPmDiagnosticOutput,ji as projectPmDiagnosticText,Xm as projectProvenanceCoverageAnalytics,au as projectValidateCounts,IO as promoteAssuranceAssertion,gw as propagateContextUsageServingReceipt,bx as pruneCompileCacheGenerations,yO as putAssuranceDeclaration,bO as putAssuranceDeclarationBundle,VE as queryItemMetadataIndex,HE as queryLinkedFileMetadataIndex,KE as querySimilarItemMetadataIndex,ef as queryTestRunMeasurementsBelow,ni as quoteCommandArg,oi as quoteWindowsCommandArg,SM as rankCommandPaths,_u as readAnnotationEntries,Wn as readAuthorEnvironment,_f as readBooleanOption,Ew as readContextUsageAffinity,hf as readCsvListOption,Cl as readExtensionMigrationState,Wo as readFileIfExists,ws as readFirstStringFromCommanderOptions,Es as readFirstValueFromCommanderOptions,Hm as readHistoryAnalyticsWindow,tS as readHistoryEntries,Zn as readHistorySnapshot,jm as readImprovementLedger,YE as readItemMetadataDerivedIndexState,Ji as readLocatedItem,OS as readOutputBudgetCollections,zS as readOutputCollectionFingerprint,vS as readOutputContinuationRowCollections,ES as readOutputContinuationRowPaths,sw as readOutputIncludeModeOptions,AS as readOutputRowCollections,wS as readOutputRowPaths,ZS as readOutputSessionRemainingTokens,qt as readPmPackageManifest,Sh as readRequiredString,Vi as readSettings,jE as readSettingsWithMetadata,As as readStringArrayFromCommanderOptions,ff as readStringOption,gM as readThrownExitCode,bA as readVectorizationStatusLedger,zE as readWorkflowPolicies,$S as readWorkflowPolicyField,jv as readWorkspaceContextIntentContracts,FR as readWorkspaceContextSignals,qR as readWorkspaceMemory,zP as readWorkspacePosition,sE as reanchorHistoryEntries,hn as reconcileExtensionCapabilityUsage,yE as reconcileWorkspaceJsonHistory,aT as recordAfterCommandAffectedItem,TO as recordAssuranceVerdict,Iu as recordClaimSemanticAttribution,Tw as recordContextUsageDelivery,Cw as recordContextUsageServing,Sw as recordContextUsageTouch,ww as recordContextUsageTouches,Pu as recordFocusSemanticAttribution,Fm as recordImprovementObservation,Ru as recordReleaseSemanticAttribution,JE as refreshItemMetadataDerivedIndex,cl as refreshMergeAttributeFenceIfInstalled,TA as refreshSearchArtifactsForMutation,Bn as registerAgentProvenanceAdapters,kO as registerExternalDependencyResolver,Gn as registerHarnessSignalDescriptors,rS as registerOutputMaterialFieldGroups,J_ as release,CO as removeAssuranceDeclaration,Xo as removeFileIfExists,Vl as renameArtifactsResultKey,Eu as renderCalendarMarkdown,Au as renderCalendarToon,Ku as renderContextMarkdown,yl as renderExtensionDescribeMarkdown,hl as renderExtensionSurfaceMarkdown,jf as renderGuideMarkdown,_M as renderMissingOptionRetry,JR as renderNextMarkdown,EM as renderPmClosedDomainHelp,ii as renderPmCommand,Ho as renderPmCommandAliasMigrationHint,$m as renderPmCommandVisibilityMarkdown,UN as renderPmFlagLexiconMarkdown,M0 as renderPmMcpAppHtml,gN as renderPmRefusalClosureCensusMarkdown,RE as renderRowsAsCsv,PE as renderRowsAsTable,K_ as reopen,lv as replayHistoryToTarget,tE as replayToCanonicalItemDocument,eE as replayToItemDocument,eP as requireTerminalReason,tP as requireTerminalReasonWithRecovery,Xw as resealHistoryRewrite,oT as resetActiveExtensionRuntimeState,fd as resetWorkspaceGraphCache,Ln as resolveAgentSessionContextFromSignals,Tu as resolveAnnotationIndex,yu as resolveAnnotationInput,eS as resolveAuthor,Jn as resolveAuthorIdentity,CE as resolveBodyFileContent,my as resolveBuiltinCorpusShape,wu as resolveCalendarOutputFormat,oM as resolveCanonicalPmErrorCodeContract,NC as resolveCanonicalRelationshipKind,QT as resolveClaimPrincipal,jT as resolveCliBulkIdsInput,vC as resolveCommandOptionPolicyState,yx as resolveCompileCacheGeneration,jR as resolveCompletionTimestamp,CC as resolveConfiguredPmPackageRoot,rR as resolveContentFieldFilters,Rw as resolveContextIntentContract,Lu as resolveContextOutputFormat,Du as resolveContextTokenBudget,nP as resolveCreateExplicitEmptyFlag,OP as resolveEffectiveSearchMode,nA as resolveEmbeddingProviders,vl as resolveExtensionInstallSourceIdentity,bl as resolveExtensionMigrationStatePath,zC as resolveExtensionRoots,xO as resolveExternalDependencyReference,lC as resolveFlagValueKind,$f as resolveGuideOutputFormat,Gm as resolveHistoryEpisodeGroupIdentity,Kv as resolveHistoryProvenanceDimensions,pv as resolveHistorySubject,cv as resolveHistoryTarget,RP as resolveHybridSemanticWeight,an as resolveImplicitPmRoot,iC as resolveIsoOrRelative,UI as resolveItemBlockers,DI as resolveItemExecutionRole,RM as resolveItemMutationDocument,sn as resolveItemTypeRegistry,UT as resolveItemTypesFilePath,lf as resolveLinkedTestFailureExitCode,Ql as resolveLinkedTestSourceRef,eu as resolveLinkedTestSourceWorkspaceRoot,nu as resolveLinkedTestTrust,iu as resolveLinkedTestTrustBatch,gg as resolveMcpAcknowledgedSubscriptionFilter,tt as resolveMcpRequestContext,ol as resolveMergeInstallContext,tR as resolveMissingMetadataFilters,fM as resolveMissingOptionPlaceholder,cS as resolveModePairedOutputOmissionReceipt,WR as resolveNextOutputFormat,uS as resolveOutputOmissionReceipt,bC as resolvePmCliVersion,Vo as resolvePmCommandAlias,Ze as resolvePmCommandCapabilityFamily,Kt as resolvePmCommandExitContract,me as resolvePmCommandOperation,Li as resolvePmCommandOutputBudget,cr as resolvePmCommandOutputEnvelope,qA as resolvePmCommandPositionalContract,Qe as resolvePmCommandVisibilityTier,$i as resolvePmDiagnosticOutputBudget,nM as resolvePmErrorCodeContract,Sb as resolvePmFlagSemanticConcept,Fe as resolvePmHistoryOperation,yC as resolvePmPackageRootFromModule,zA as resolvePmPositionalActionContract,Pc as resolvePmPositionalActionFlagContracts,Ge as resolvePmRoot,xc as resolvePmToolCustomFieldCollision,AE as resolvePriority,Zt as resolveProfile,sl as resolveProjectMergeTypeFolders,bS as resolveQueryCursorStart,dw as resolveReadOutputDimensions,mw as resolveReadOutputEncoding,MS as resolveReadOutputRecoveryBudget,nw as resolveReadOutputSurface,lS as resolveReadRowContract,mM as resolveRecoveryCommandName,CT as resolveRegisteredSearchProvider,TT as resolveRegisteredVectorStoreAdapter,fs as resolveReproducibleProcessEnvironment,Sn as resolveRuntimeFieldRegistry,Tn as resolveRuntimeStatusRegistry,iA as resolveSearchCorpusFields,vP as resolveSearchMaxResults,AP as resolveSearchPage,IP as resolveSearchScoreThreshold,PP as resolveSearchTuning,aA as resolveSemanticCorpusCharacterLimit,Ou as resolveSemanticLineageIds,UE as resolveSettingsWithSemanticRuntimeDefaults,zO as resolveSourceContextWritePolicy,vp as resolveStartTaskInProgressStatus,te as resolveSubcommandFlagContractsForCommand,Qb as resolveTelemetryErrorCategory,QR as resolveTerminalReason,AC as resolveTypeDefinition,EC as resolveTypeName,IE as resolveTypeSynonym,LE as resolveTypeWorkflows,Qd as resolveUnknownAuthorAcknowledgmentSelector,xP as resolveVectorIndexRecovery,lA as resolveVectorStores,ed as resolveWorkspaceRelationshipKindRegistry,IC as resolveWorkspaceRoot,eh as restore,dC as restoreCheckpointItems,bE as restoreWorkspaceJsonFromHistory,_m as restoreWorkspaceSnapshot,fm as restoreWorkspaceSnapshotWithRecovery,Eh as runAction,uT as runActiveBeforeMutationHooks,mT as runActiveCommandHandler,pT as runActiveOnIndexHooks,bn as runActiveOnReadHooks,yn as runActiveOnWriteHooks,fT as runActiveParserOverride,_T as runActivePreflightOverride,hT as runActiveServiceOverride,Qc as runActivity,qC as runAfterCommandHooks,uu as runAggregate,Cu as runAnnotationCommand,pu as runAppend,mR as runAssuranceAction,fR as runAssuranceDispatch,BC as runBeforeCommandHooks,vu as runCalendar,Zu as runClaim,Qu as runClaimNext,rp as runClose,Mp as runCloseMany,Rp as runCloseTask,kp as runComments,Gf as runCompletion,zp as runConfig,Ht as runContext,IR as runContextEvaluationCorpus,vR as runContextEvaluationScenario,jp as runCopy,Ep as runCreate,Gp as runDelete,_d as runDeps,Hl as runDocs,lM as runDuplicates,nm as runEval,sm as runEvent,Ol as runExtension,wl as runExtensionMigrateAction,Sl as runExtensionMigrations,Xl as runFiles,Jl as runFilesDiscover,Yl as runFilesLookup,Ym as runFleetAttributionAnalytics,Up as runFocus,qp as runGc,Bp as runGet,Wd as runGraph,Ff as runGuide,Il as runHealth,pP as runHistory,WP as runHistoryCompact,JP as runHistoryCompactBulk,OI as runHistoryMaintenance,KP as runHistoryRedact,RI as runHistoryRepair,MI as runHistoryRepairAll,Jp as runInit,Wp as runInitAgentGuidance,xp as runLearnings,zl as runLinkedArtifacts,uf as runLinkedTests,lu as runList,im as runMeet,$P as runMergeDriver,dl as runMergeInstall,bI as runMergeReceiptEvidenceReport,yI as runMergeReceiptReport,FP as runMergeReconcile,Yu as runNext,Np as runNotes,Ip as runPauseTask,Fp as runPlan,Am as runProfileApply,Em as runProfileLint,Sm as runProfileList,wm as runProfileShow,Wm as runProvenanceCoverageAnalytics,XM as runRegisteredCommandForTest,ek as runRegisteredCommandOverrideForTest,ak as runRegisteredExporterForTest,JM as runRegisteredHookForTest,sk as runRegisteredImporterForTest,ik as runRegisteredMigrationForTest,YM as runRegisteredMutationGuardForTest,ZM as runRegisteredParserOverrideForTest,QM as runRegisteredPreflightOverrideForTest,tk as runRegisteredRendererOverrideForTest,ok as runRegisteredSearchProviderForTest,rk as runRegisteredServiceOverrideForTest,nk as runRegisteredVectorStoreAdapterForTest,dr as runReindex,ep as runRelease,am as runRemind,ZP as runReopen,Pp as runRestore,ml as runSchemaEvolutionMigration,rm as runSearch,hy as runSearchRefreshWorkerEntrypoint,Uf as runStartBackgroundRun,Op as runStartTask,rf as runStats,nf as runTelemetry,Cm as runTemplatesList,bm as runTemplatesSave,Tm as runTemplatesShow,pf as runTest,mf as runTestAll,Bf as runTestRunsList,zf as runTestRunsLogs,Hf as runTestRunsResume,qf as runTestRunsStatus,Vf as runTestRunsStop,Kf as runTestRunsWorker,Ap as runUpdate,Lp as runUpdateMany,Wt as runUpgrade,du as runValidate,wh as runWithActiveExtensions,D as runWithAgentSessionContext,Ow as runWithContextIntentContracts,Bv as runWithDiscoveredContextIntentContracts,zn as runWithHarnessDetectionSignals,S0 as runWithMcpTraceContext,hs as runWithReproducibleProcessEnvironment,Vn as runWithWorkspaceHarnessSignalDescriptors,Zr as runWithWorkspaceRecipe,eI as runWorkflowPolicyAction,bP as runWorkspaceTransactionGc,Vd as saveGraphAuditBaseline,FO as scanExtensionHostVersions,Jd as scanHistoryAuthorAttribution,In as scanItemFormatVersions,es as scanMutationSecrets,oI as scanProvenanceResolverHealth,ps as scanStaleInProgressItems,LI as scanStorageIntegrity,__ as schema,S_ as schemaAddField,C_ as schemaAddStatus,y_ as schemaAddType,v_ as schemaApplyPreset,O_ as schemaInferTypes,h_ as schemaList,E_ as schemaListFields,P_ as schemaRemapStatus,w_ as schemaRemoveField,T_ as schemaRemoveStatus,b_ as schemaRemoveType,R_ as schemaRenameField,I_ as schemaRenameType,g_ as schemaShow,A_ as schemaShowField,M_ as schemaShowStatus,TM as scoreCommandPathMatch,SR as scoreContextCandidates,wR as scoreContextCandidatesWithActiveExtensions,ds as scoreItemSimilarity,PN as scorePmGrammarRefusalClosure,CN as scorePmRefusalClosure,ls as scorePreparedItemSimilarity,xN as scoreTrackerPreflightRecoveryClosure,Kw as sealHistoryRecord,qk as sealMcpRequestState,Jf as search,HR as searchWorkspaceMemory,KR as searchWorkspaceMemoryReadResult,qI as selectActionableEntries,mS as selectCursorSemanticOptions,xf as selectImportAuthor,g0 as selectMcpClientRegistrationMode,VR as selectWorkspaceMemory,zR as selectWorkspaceMemoryRollups,ku as semanticAttributionAffinity,OA as sentryCaptureCliError,vA as sentryFinishCommandSpan,RA as sentryFlush,IA as sentryLogCliUsageError,EA as sentrySetCommandContext,AA as sentryStartCommandSpan,kn as serializeItemDocument,AM as serializeNdjsonRows,vM as serializeNdjsonStream,iy as serveDeclaredObservation,nT as setActiveCommandContext,iT as setActiveCommandResult,JC as setActiveExtensionCommands,YC as setActiveExtensionHooks,ZC as setActiveExtensionParsers,QC as setActiveExtensionPreflight,rT as setActiveExtensionRegistrations,tT as setActiveExtensionRenderers,eT as setActiveExtensionServices,JT as setFocusedItem,DA as shouldCompletePlanOnClose,qd as shouldPersistDurableGraphCache,xT as shouldResolveMutationStdinTokenField,kT as shouldResolveMutationStdinTokens,qE as shouldRunSearchRefreshInForeground,np as similarityAdvisoryWarnings,SS as sliceReadOutputRowCollection,Ul as sortLinkedArtifacts,ST as splitAcceptanceCriteria,xA as splitCommaList,Mn as splitFrontMatter,lw as stabilizeReadOutputReceiptEstimates,P as stableStringify,UC as stableValueEquals,rh as startTask,FA as startTelemetryCommand,t_ as stats,qT as statusIsTerminal,Oh as stripGlobalBootstrapTokens,UP as subscribeMutationEventBatches,BP as subscribeMutationEvents,CP as summarizeAgentIdentityVocabulary,Bm as summarizeAgentModelProvenance,qm as summarizeAgentProvenance,OR as summarizeContextEvaluationReports,sf as summarizeContextPreflight,Zv as summarizeHistoryProvenance,Xp as summarizeInitResult,fI as summarizeMergeReceipt,iP as supportsCreateExplicitEmpty,uM as supportsItemIdAlias,hC as suppressHostOutput,Me as syncRelationshipGraphAdapter,qM as synthesizeExtensionManifest,Mc as toCompletionFlagString,Vu as toContextFocusItem,Bu as toContextPackingSummary,qu as toContextRankingSummary,tC as toErrorMessage,yf as toEstimatedMinutesValue,Iv as toExtensionFlagDefinitions,wf as toImportBoolean,Of as toImportConfidence,Sf as toImportInteger,Mf as toImportLinkedDocs,Pf as toImportLinkedFiles,kf as toImportLinkedTests,Rf as toImportLogEntries,If as toImportNormalizedEnum,vf as toImportNumberMap,bf as toImportPriority,Tf as toImportStatus,Ef as toImportStringList,Af as toImportStringMap,Cf as toImportTags,XT as toItemRecord,gf as toNonEmptyImportString,eC as toNonEmptyStringOrUndefined,rE as toReplayDocument,as as tokenizeSimilarityText,MT as transferMutationStdinTokenPolicy,PC as translateHostEnvironmentFault,H_ as update,Ch as upgrade,$_ as validate,dO as validateAssertionDefinition,uO as validateAssuranceDocument,lO as validateGateDefinition,MM as validateItemMutationRows,ql as validateLinkedPaths,y0 as validateMcpAuthorizationResponseIssuer,h0 as validateMcpAuthorizationServerMetadata,b0 as validateMcpClientMetadataDocument,c0 as validateMcpHttpRequestHeaders,Kk as validateMcpJsonSchema,cO as validateMeasurementDefinition,wE as validateMissingParentReference,iw as validateReadOutputOptions,vE as validateSprintOrReleaseValue,OC as validateTypeOptions,eM as verifyCliFlagInvocationParity,KA as verifyExplicitPositionalSlotCensus,iE as verifyHistoryChain,nE as verifyHistoryChainWithVersion,mv as verifyHistoryEntries,Ww as verifyHistoryRecordHash,Yw as verifyHistoryRewriteEvidence,JA as verifyPmCliGrammar,YA as verifyPmCommandPositionalContracts,GN as verifyPmFlagLexicon,uN as verifyPmRecoveryKindRuntimeCoverage,pb as verifyPmRecoveryProducerRuntimeCoverage,lN as verifyPmRecoveryReferences,_N as verifyPmRefusalClosureIdentityRatchet,fN as verifyPmRefusalClosureRatchet,dN as verifyPmRefusalReachability,ks as verifyToolOptionCliParity,Ys as withFlagAliasMetadata,MC as withHostEnvironmentBoundary,Hk as withMcpCachePolicy,jS as workflowApprovalFingerprint,GS as workflowPolicyApplies,FS as workflowPolicyFingerprint,md as workspaceGraphCache,bu as wrapOwnershipConflict,CM as wrapThrownErrorForSentry,Xn as writeAuthorEnvironment,je as writeFileAtomic,aC as writeMutationCheckpoint,GE as writeSettings,$w as writeStderr,Dw as writeStdout,CA as writeVectorizationStatusLedger,gE as writeWorkspaceJsonWithHistory};
|
|
33
33
|
//# sourceMappingURL=sdk.js.map
|