@unbrained/pm-cli 2026.9.10 → 2026.9.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +2 -2
- package/CHANGELOG.md +53 -11
- package/dist/cli/command-namespaces.d.ts +2 -2
- package/dist/cli/command-namespaces.js +1 -1
- package/dist/cli/error-guidance.d.ts +10 -0
- package/dist/cli/error-guidance.js +1 -1
- package/dist/cli/extension-command-help.js +3 -3
- package/dist/cli/main.d.ts +4 -0
- package/dist/cli/main.js +2 -2
- package/dist/cli/option-values.d.ts +3 -0
- package/dist/cli/option-values.js +2 -0
- package/dist/cli/register-history-maintenance.js +2 -1
- package/dist/cli/register-list-query.js +2 -2
- package/dist/cli/register-mutation.d.ts +5 -0
- package/dist/cli/register-mutation.js +2 -16
- package/dist/cli/schema/registration.d.ts +4 -0
- package/dist/cli/schema/registration.js +16 -0
- package/dist/cli-bundle/bundle-manifest.json +156 -156
- package/dist/cli-bundle/chunks/{chunk-NKOYVKFM.js → chunk-2JAY4LFI.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-I6XT3DLQ.js → chunk-3ZJDGTYC.js} +53 -53
- package/dist/cli-bundle/chunks/chunk-67H4PKQ5.js +3 -0
- package/dist/cli-bundle/chunks/{chunk-EOCKPCEY.js → chunk-7H33WPDF.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-7KF6HCRC.js +20 -0
- package/dist/cli-bundle/chunks/chunk-DEGRLB6Y.js +235 -0
- package/dist/cli-bundle/chunks/chunk-GKY655T7.js +6 -0
- package/dist/cli-bundle/chunks/chunk-I6VQUHK6.js +8 -0
- package/dist/cli-bundle/chunks/chunk-PTX2JRFR.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-PYUITRSV.js → chunk-TAGDYARO.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-X6POOZKD.js +29 -0
- package/dist/cli-bundle/chunks/{chunk-4SFBH77G.js → chunk-YU75JRTW.js} +156 -142
- package/dist/cli-bundle/chunks/{register-list-query-CUIW7SSE.js → register-list-query-KEZPDR6X.js} +6 -6
- package/dist/cli-bundle/chunks/register-mutation-HEXA3ZDM.js +20 -0
- package/dist/cli-bundle/chunks/{register-operations-XIZPLPQY.js → register-operations-TEZT65JF.js} +2 -2
- package/dist/cli-bundle/chunks/{register-setup-JVGPCAIL.js → register-setup-IIL74WUG.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-ZAWAL2CG.js → chunk-2BQ4JSJQ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-5CRND7UA.js +12 -0
- package/dist/cli-bundle/focused-chunks/chunk-5PSYV3AT.js +164 -0
- package/dist/cli-bundle/focused-chunks/{chunk-SL5YVVPV.js → chunk-7EKXAUKF.js} +53 -52
- package/dist/cli-bundle/focused-chunks/chunk-BIOWOU6S.js +30 -0
- package/dist/cli-bundle/focused-chunks/chunk-EIXGDI77.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-GAKFECOQ.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-HFAW3FJQ.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-U5SHHU7E.js → chunk-IURELABV.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-KK7KSXUP.js +8 -0
- package/dist/cli-bundle/focused-chunks/{chunk-ZDNAWWQI.js → chunk-LWJBBM6X.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-MFVABYEU.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-7N5MRONP.js → chunk-PERRTPIY.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-FHUARRMA.js → chunk-SDQOOL34.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-M36SF4GE.js → chunk-TTRB47KM.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-VWMP6W7Y.js +20 -0
- package/dist/cli-bundle/focused-chunks/chunk-YNBACVQ2.js +2 -0
- package/dist/cli-bundle/main.js +21 -21
- 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 +29 -29
- 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/core/history/digest.d.ts +12 -0
- package/dist/core/history/digest.js +2 -0
- package/dist/core/history/drift-scan.js +1 -1
- package/dist/core/history/history.d.ts +5 -3
- package/dist/core/history/history.js +2 -2
- package/dist/core/history/operation-contract.d.ts +30 -0
- package/dist/core/history/operation-contract.js +2 -0
- package/dist/core/history/replay.d.ts +3 -2
- package/dist/core/history/replay.js +1 -1
- package/dist/core/history/tombstone.d.ts +3 -0
- package/dist/core/history/tombstone.js +2 -0
- package/dist/core/item/id.d.ts +8 -7
- package/dist/core/item/id.js +1 -1
- package/dist/core/output/mutation-projection.d.ts +1 -0
- package/dist/core/output/mutation-projection.js +1 -1
- package/dist/core/shared/command-line.d.ts +10 -0
- package/dist/core/shared/command-line.js +2 -0
- package/dist/core/shared/errors.d.ts +13 -0
- package/dist/core/shared/errors.js +1 -1
- package/dist/core/store/item-store.d.ts +5 -1
- package/dist/core/store/item-store.js +1 -1
- package/dist/core/telemetry/runtime.d.ts +1 -0
- package/dist/core/telemetry/runtime.js +2 -2
- package/dist/sdk/agent/command-recovery.js +1 -1
- package/dist/sdk/agent/item-addressing.js +1 -1
- package/dist/sdk/agent/refusal-corpus-contracts.js +1 -1
- package/dist/sdk/agent-capability-contracts.js +1 -1
- package/dist/sdk/cli-bootstrap.d.ts +2 -1
- package/dist/sdk/cli-bootstrap.js +1 -1
- package/dist/sdk/cli-contracts/command-aliases.d.ts +2 -0
- package/dist/sdk/cli-contracts/command-aliases.js +1 -1
- package/dist/sdk/cli-contracts/enum-contracts.d.ts +1 -1
- package/dist/sdk/cli-contracts/enum-contracts.js +1 -1
- package/dist/sdk/cli-contracts/flag-contracts.d.ts +2 -0
- 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 +3 -0
- package/dist/sdk/cli-contracts/runtime-contracts.js +1 -1
- package/dist/sdk/cli-contracts/tool-schema.d.ts +2 -2
- package/dist/sdk/cli-contracts/tool-schema.js +1 -1
- package/dist/sdk/cli-contracts.d.ts +1 -1
- package/dist/sdk/cli-contracts.js +1 -1
- package/dist/sdk/command-line.d.ts +1 -6
- package/dist/sdk/command-line.js +1 -1
- package/dist/sdk/comments.js +1 -1
- package/dist/sdk/completion.d.ts +2 -0
- package/dist/sdk/completion.js +26 -14
- package/dist/sdk/contracts.d.ts +2 -0
- package/dist/sdk/contracts.js +1 -1
- package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1 -1
- package/dist/sdk/generated/generated-error-code-catalog-part-2.js +1 -1
- package/dist/sdk/governance/storage-integrity.js +1 -1
- package/dist/sdk/governance/workflow-completeness.js +1 -1
- package/dist/sdk/governance/workflow-policy.js +2 -2
- package/dist/sdk/governance.d.ts +3 -0
- package/dist/sdk/governance.js +1 -1
- package/dist/sdk/history/attestation-command.d.ts +22 -0
- package/dist/sdk/history/attestation-command.js +3 -0
- package/dist/sdk/history/attestation-contract.d.ts +103 -0
- package/dist/sdk/history/attestation-contract.js +2 -0
- package/dist/sdk/history/attestation-scan.d.ts +16 -0
- package/dist/sdk/history/attestation-scan.js +2 -0
- package/dist/sdk/history/attestation.d.ts +8 -0
- package/dist/sdk/history/attestation.js +2 -0
- package/dist/sdk/history/salvage.js +1 -1
- package/dist/sdk/history-compact.js +1 -1
- package/dist/sdk/history-read.js +1 -1
- package/dist/sdk/history-redact.js +1 -1
- package/dist/sdk/history-repair.js +1 -1
- package/dist/sdk/index.d.ts +3 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/learnings.js +1 -1
- package/dist/sdk/lifecycle/claim.d.ts +2 -0
- package/dist/sdk/lifecycle/claim.js +1 -1
- package/dist/sdk/lifecycle/mcp-actions.d.ts +4 -0
- package/dist/sdk/lifecycle/mcp-actions.js +1 -1
- package/dist/sdk/lifecycle/task-composition.d.ts +2 -0
- package/dist/sdk/lifecycle/task-composition.js +1 -1
- package/dist/sdk/merge/reconcile.js +1 -1
- package/dist/sdk/merge/three-way.js +2 -2
- package/dist/sdk/notes.js +1 -1
- package/dist/sdk/public-surface.json +1 -1
- package/dist/sdk/query/projection-contracts.d.ts +1 -1
- package/dist/sdk/query/projection-contracts.js +1 -1
- package/dist/sdk/read-output-budget.d.ts +4 -10
- package/dist/sdk/read-output-budget.js +1 -1
- package/dist/sdk/read-output-contracts.d.ts +1 -1
- package/dist/sdk/read-output-contracts.js +1 -1
- package/dist/sdk/read-output-session.d.ts +1 -1
- package/dist/sdk/read-output-session.js +1 -1
- package/dist/sdk/runtime-input.js +1 -1
- package/dist/sdk/runtime.d.ts +3 -0
- package/dist/sdk/runtime.js +1 -1
- package/dist/types.d.ts +5 -1
- package/dist/types.js +1 -1
- package/docs/AGENT_UX_CONTRACTS.md +8 -0
- package/docs/ARCHITECTURE.md +7 -0
- package/docs/CLI_GRAMMAR.md +23 -0
- package/docs/HISTORY_ATTESTATION.md +164 -0
- package/docs/HISTORY_OPERATIONS.md +46 -0
- package/docs/HISTORY_RECOVERY.md +27 -2
- package/docs/LIFECYCLE_COMMANDS.md +19 -2
- package/docs/MERGE_SAFETY.md +64 -3
- package/docs/README.md +1 -0
- package/docs/READ_OUTPUT_CONTRACTS.md +13 -0
- package/docs/WORKFLOW_POLICIES.md +47 -3
- package/docs/generated/AGENT_CAPABILITY_ROUTING.md +4 -4
- package/docs/generated/AGENT_COMMAND_SURFACE.md +5 -0
- package/docs/generated/FLAG_LEXICON_BUDGETS.md +5 -0
- package/docs/generated/REFUSAL_CLOSURE_CENSUS.md +10 -7
- package/marketplace.json +2 -2
- package/package.json +4 -4
- 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 +31 -7
- package/packages/pm-governance-audit/extensions/governance-audit/index.ts +6 -3
- package/packages/pm-governance-audit/package.json +1 -1
- package/packages/pm-guide-shell/extensions/guide-shell/runtime.ts +7 -19
- 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 +9 -5
- package/packages/pm-search-advanced/extensions/search-advanced/index.ts +3 -2
- 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-74RGSPLL.js +0 -2
- package/dist/cli-bundle/chunks/chunk-7WIHZI2M.js +0 -5
- package/dist/cli-bundle/chunks/chunk-GLQMKUGP.js +0 -2
- package/dist/cli-bundle/chunks/chunk-MACGGTLQ.js +0 -29
- package/dist/cli-bundle/chunks/chunk-P6BEYAON.js +0 -8
- package/dist/cli-bundle/chunks/chunk-TSWEX72T.js +0 -20
- package/dist/cli-bundle/chunks/chunk-YKQTETJI.js +0 -235
- package/dist/cli-bundle/chunks/register-mutation-5F5CYUWZ.js +0 -20
- package/dist/cli-bundle/focused-chunks/chunk-26O2WB73.js +0 -10
- package/dist/cli-bundle/focused-chunks/chunk-5YU75QLV.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-B2CMFYRZ.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-CRY5MHEI.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-F6WKFXBT.js +0 -8
- package/dist/cli-bundle/focused-chunks/chunk-OROZM37I.js +0 -177
- package/dist/cli-bundle/focused-chunks/chunk-PNGYYQY7.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-TPOL4TWE.js +0 -9
- package/dist/cli-bundle/focused-chunks/chunk-XSMA2W6Q.js +0 -12
- package/dist/cli-bundle/focused-chunks/chunk-ZJHYQOTM.js +0 -20
package/dist/cli-bundle/sdk.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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>
|
|
1
|
+
import{A as Fh,B as jh,C as GM,D as UM,a as fs,b as _s,c as hs,d as gs,e as PM,f as MM,g as Oh,h as Ih,i as Rh,k as Ph,l as Mh,m as kh,n as xh,o as Nh,p as Lh,q as Dh,r as $h,s as kM,t as xM,u as NM,v as LM,w as DM,x as $M,y as FM,z as jM}from"./chunks/chunk-PTX2JRFR.js";import{A as Ok,B as Ik,C as Rk,D as Pk,E as Mk,F as kk,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,a as tk,b as rk,c as ok,d as nk,e as ik,f as sk,g as ak,h as ck,i as dk,j as lk,k as uk,l as pk,m as mk,n as fk,o as _k,p as hk,q as gk,r as yk,s as bk,t as Ck,u as Tk,v as Sk,w as wk,x as Ek,y as Ak,z as vk}from"./chunks/chunk-I6VQUHK6.js";import{a as BM,b as qM,c as zM,d as VM}from"./chunks/chunk-TAGDYARO.js";import{a as HM,b as KM,c as WM,d as XM,e as YM,f as JM,g as ZM,h as QM,i as ek}from"./chunks/chunk-7H33WPDF.js";import{$ as nr,$a as o_,$b as oh,A as tO,Aa as Af,Ab as P_,B as rO,Ba as vf,Bb as M_,C as mu,Ca as Of,Cb as k_,D as kp,Da as If,Db as x_,E as xp,Ea as Rf,Eb as N_,F as Np,Fa as Pf,Fb as L_,G as Lp,Ga as Mf,Gb as D_,H as Dp,Ha as kf,Hb as $_,I as Ye,Ia as xf,Ib as F_,J as $p,Ja as Nf,Jb as j_,K as Fp,Ka as Lf,Kb as G_,L as jp,La as Df,Lb as U_,M as Gp,Ma as $f,Mb as B_,N as Up,Na as Ff,Nb as q_,O as Bp,Oa as jf,Ob as z_,P as tM,Pa as Gf,Pb as V_,Q as rM,Qa as Uf,Qb as H_,R as oM,Ra as dr,Rb as K_,S as Xt,Sa as he,Sb as W_,T as Yt,Ta as Xf,Tb as X_,U as Jt,Ua as Yf,Ub as Y_,V as Zt,Va as Jf,Vb as J_,W as Qt,Wa as Zf,Wb as Z_,X as er,Xa as Qf,Xb as Q_,Y as tr,Ya as e_,Yb as eh,Z as rr,Za as t_,Zb as th,_ as or,_a as r_,_b as rh,a as zc,aa as ir,ab as n_,ac as nh,b as Vc,ba as ym,bb as i_,bc as ih,c as Hc,ca as bm,cb as s_,cc as sh,d as Rv,da as Cm,db as a_,dc as ah,e as Pv,ea as Tm,eb as c_,ec as ch,f as Kc,fa as Sm,fb as d_,fc as dh,g as $v,ga as Je,gb as l_,gc as lh,h as Fv,ha as wm,hb as u_,hc as uh,i as jv,ia as Em,ib as p_,ic as ph,j as Gv,ja as Am,jb as m_,jc as mh,k as Uv,ka as vm,kb as f_,kc as fh,l as Bv,la as Om,lb as __,lc as _h,m as qv,ma as Im,mb as h_,mc as hh,n as zv,na as Rm,nb as g_,nc as gh,o as Vv,oa as Pm,ob as y_,oc as yh,p as Hv,pa as gM,pb as b_,pc as bh,q as Kv,qa as _f,qb as C_,qc as Ch,r as Wv,ra as hf,rb as T_,rc as Th,s as Xv,sa as gf,sb as S_,sc as Sh,t as Yv,ta as yf,tb as w_,tc as wh,u as Zc,ua as bf,ub as E_,uc as Eh,v as Qc,va as Cf,vb as A_,vc as Ah,w as Jv,wa as Tf,wb as v_,wc as vh,x as Zv,xa as Sf,xb as O_,y as Qv,ya as wf,yb as I_,z as eO,za as Ef,zb as R_}from"./chunks/chunk-YU75JRTW.js";import{a as Wt,f as jP,g as GP,h as Vp,i as Hp}from"./chunks/chunk-2JAY4LFI.js";import{A as HP,B as KP,C as WP,D as XP,E as YP,F as JP,G as ZP,H as QP,I as eM,J as om,K as nm,L as im,M as pM,N as Mm,O as mM,P as fM,Q as _M,R as hM,b as pu,c as RR,d as Mp,e as vP,f as OP,g as IP,h as RP,i as PP,j as MP,k as kP,l as xP,m as NP,n as LP,o as DP,p as qp,q as $P,r as Qp,s as em,t as tm,u as rm,v as UP,w as BP,x as qP,y as zP,z as VP}from"./chunks/chunk-GKY655T7.js";import{$a as cu,$b as Ep,$c as Fm,A as jO,Aa as Ll,Ab as fP,Ac as lm,Ad as Qm,B as GO,Ba as Dl,Bb as _P,Bc as um,Bd as ef,C as UO,Ca as $l,Cb as hP,Cc as pm,Cd as tf,D as BO,Da as Fl,Db as rp,Dc as mm,Dd as rf,E as ZO,Ea as jl,Eb as op,Ec as fm,Ed as of,Fa as Gl,Fc as _m,Fd as RM,Ga as Ul,Gb as np,Gc as hm,Gd as nf,Ha as Bl,Hb as ip,Hc as gm,Hd as sf,Ia as ql,Ib as gP,Ic as dM,Id as af,J as Yd,Ja as zl,Jb as sp,Jc as lM,Jd as cf,Ka as Vl,Kb as ap,Kc as uM,Kd as df,La as Hl,Lb as cp,Lc as yM,Ld as lf,Ma as Kl,Mb as dp,Mc as sr,Md as uf,Na as Wl,Nb as lp,Nc as bM,Nd as pf,Oa as Xl,Ob as up,Oc as Ze,Od as mf,Pa as Yl,Pb as pp,Pc as oe,Pd as ff,Qa as Jl,Qb as mp,Qc as km,Qd as Bf,Ra as Zl,Rb as fp,Rd as qf,Sa as Ql,Sb as _p,Sd as zf,Ta as eu,Tb as hp,Tc as Qe,Td as Vf,Ua as tu,Ub as gp,Uc as xm,Ud as Hf,Va as ru,Vb as yp,Vc as Nm,Vd as Kf,Wa as ou,Wb as bp,Wd as Wf,Xa as nu,Xb as Cp,Xc as _e,Ya as iu,Yb as Tp,Yc as Lm,Za as su,Zb as Sp,Zc as Dm,_a as au,_b as wp,_c as $m,a as mO,aa as QO,ab as du,ac as yP,ad as CM,b as fO,ba as eI,bb as lu,bc as bP,bd as TM,c as _O,ca as Jd,cb as SR,cc as Ap,cd as SM,d as hO,da as Zd,db as wR,dd as wM,e as gO,ea as Qd,eb as ER,ed as EM,f as yO,fa as el,fb as AR,fd as ar,g as bO,ga as tl,gb as vR,gc as vp,gd as AM,h as CO,ha as rl,hb as OR,hd as vM,i as TO,ia as ol,ib as IR,ic as Op,id as cr,j as SO,ja as NI,jb as fu,jc as Ip,jd as OM,k as wO,ka as LI,kb as _u,kc as Rp,kd as IM,l as EO,la as DI,lb as hu,lc as Pp,m as AO,ma as $I,mb as gu,mc as CP,md as jm,n as vO,na as FI,nb as yu,nc as TP,nd as Gm,o as OO,oa as jI,oc as SP,od as Um,p as IO,pa as GI,pb as bu,pc as Xe,pd as Bm,q as RO,qa as HI,qb as Cu,qc as wP,qd as qm,r as PO,ra as KI,rb as Tu,rc as Kt,rd as zm,s as MO,sa as Rl,sb as Su,sc as EP,sd as Vm,t as kO,ta as Pl,tb as wu,tc as AP,td as Hm,u as xO,ua as WI,ub as Zu,uc as FP,ud as Km,v as NO,va as XI,vb as Qu,vc as zp,vd as Wm,w as LO,wa as Ml,wb as ep,wc as sm,wd as Xm,x as DO,xa as kl,xb as tp,xc as am,xd as Ym,y as $O,ya as xl,yb as pP,yc as cm,yd as Jm,z as FO,za as Nl,zb as mP,zc as dm,zd as Zm}from"./chunks/chunk-X6POOZKD.js";import{Aa as gl,Ba as yl,Ca as bl,H as lI,Ha as Cl,I as uI,Ia as Tl,Ja as Sl,K as pI,Ka as wl,L as mI,La as El,M as fI,Ma as Al,N as pl,Na as vl,O as ml,P as fl,Pa as Ol,Q as _l,Qa as Il,R as Gt,Ra as Kp,Sa as Wp,Ta as Xp,Va as Yp,Wa as Jp,Xa as Zp,a as Lv,b as Dv,c as Wc,d as Xc,f as Yc,g as Jc,h as tI,i as rI,j as oI,k as nI,l as iI,m as sI,n as aI,o as cI,p as nl,q as il,r as sl,s as al,t as cl,u as dI,ua as Ut,v as dl,va as Bt,w as ll,wa as qt,x as ul,xa as zt,ya as hl}from"./chunks/chunk-3ZJDGTYC.js";import{$ as wd,$a as UI,$b as FR,$c as nM,A as XO,Ab as lR,Ac as Mu,B as YO,Bb as uR,Bc as ku,C as td,Ca as _I,Cb as pR,Cc as xu,D as rd,Da as hI,Db as mR,Dc as Vt,E as od,Ea as gI,Eb as fR,Ec as Nu,F as nd,Fa as yI,Fc as Lu,G as id,Ga as bI,Gc as Du,H as sd,Ha as CI,Hb as _R,Hc as $u,I as ad,Ia as TI,Ib as hR,Ic as Fu,J as cd,Ja as SI,Jb as gR,Jc as ju,K as dd,Ka as wI,Kb as yR,Kc as Gu,L as ld,La as EI,Lb as bR,Lc as Uu,M as ud,Ma as AI,Mb as CR,Mc as Bu,N as We,Na as vI,Nb as TR,Nc as qu,O as pd,Oa as OI,Ob as uu,Oc as zu,P as md,Pb as Eu,Pc as Vu,Q as fd,Qb as Au,Qc as Hu,R as _d,Rb as vu,Rc as Ku,S as JO,Sa as II,Sb as Ou,Sc as Wu,Tb as PR,Tc as Xu,U as hd,Ua as RI,Ub as MR,Uc as Ht,V as gd,Va as PI,Vb as kR,Vc as Yu,W as yd,Wb as xR,Wc as cP,X as bd,Xa as MI,Xb as NR,Xc as dP,Y as Cd,Ya as kI,Yb as LR,Yc as lP,Z as Td,Za as xI,Zb as DR,Zc as Ju,_ as Sd,_b as $R,_c as uP,aa as Ed,ab as BI,ac as jR,ad as iM,b as vv,ba as Ad,bb as qI,bc as GR,bd as sM,c as Ov,ca as vd,cb as zI,cc as UR,cd as aM,d as Iv,da as Od,db as VI,dc as BR,dd as cM,e as Mv,ea as Id,eb as YI,ec as qR,f as kv,fa as Rd,fb as JI,fc as zR,g as xv,ga as Pd,gb as ZI,gc as VR,h as Nv,ha as Md,hb as QI,hc as HR,i as oO,ia as kd,ib as eR,ic as KR,j as nO,ja as xd,jb as tR,jc as WR,k as iO,ka as Nd,kb as rR,kc as XR,l as sO,la as Ld,lb as oR,lc as YR,m as aO,ma as Dd,mb as nR,mc as JR,n as cO,na as $d,nb as iR,nc as ZR,o as dO,oa as Fd,ob as sR,oc as QR,p as lO,pa as jd,pb as aR,pc as eP,q as uO,qa as Gd,qb as cR,qc as tP,r as pO,ra as Ud,rc as rP,sa as Bd,sc as oP,t as ed,ta as qd,tc as nP,u as qO,ua as zd,uc as iP,v as zO,va as Vd,vc as sP,w as VO,wa as Hd,wc as aP,x as HO,xa as Kd,xc as Iu,y as KO,ya as Wd,yc as Ru,z as WO,za as Xd,zb as dR,zc as Pu}from"./chunks/chunk-7KF6HCRC.js";import{$b as jC,$c as pT,$d as wn,$e as Jn,$f as zS,$g as cw,$h as iE,$i as qE,$j as Ji,$k as cs,$l as sv,$m as Da,Aa as tn,Ab as PC,Ac as WC,Ad as MT,Ae as cS,Af as gS,Ag as bi,Ah as Lw,Ai as wE,Aj as oA,Ak as kA,Al as Es,Am as la,An as dc,Bb as MC,Bc as XC,Bd as kT,Be as dS,Bf as yS,Bg as Ci,Bh as Dw,Bi as EE,Bj as Lt,Bk as xA,Bl as As,Bm as ua,Bn as lc,Cb as kC,Ce as Ln,Cf as bS,Cg as Ti,Ch as $w,Ci as AE,Ck as NA,Cl as vs,Cm as pa,Cn as uc,Dc as YC,Dd as xT,De as Dn,Df as CS,Dg as Si,Dh as Fw,Di as vE,Dj as nA,Dk as LA,Dl as Os,Dm as ma,Dn as pc,E as Yb,Ea as rn,Ec as _n,Ed as NT,Ee as D,Ef as TS,Eg as wi,Eh as jw,Ei as OE,Ej as iA,Ek as DA,El as Is,En as mc,Fe as $n,Ff as SS,Fg as Ei,Fh as Gw,Fi as IE,Fj as sA,Fk as $A,Fl as Rs,Fm as fa,Fn as fc,G as Jb,Ga as on,Gc as hn,Gd as LT,Gf as wS,Gg as Ai,Gh as Uw,Gi as RE,Gj as aA,Gk as FA,Gl as Ps,Gm as _a,Gn as _c,Ha as nn,Hc as gn,Hd as DT,Hf as ES,Hg as vi,Hh as Bw,Hi as PE,Hj as cA,Hk as jA,Hl as Ms,Hm as ha,Hn as hc,Ia as sn,Ib as xC,Id as $T,If as AS,Ig as Oi,Ih as qw,Ii as ME,Ik as Dt,Il as ks,Im as ga,In as gc,J as Zb,Jb as Ue,Jd as FT,Jf as vS,Jg as Ii,Jh as zw,Ji as kE,Jk as GA,Jl as xs,Jm as ya,Jn as yc,Kb as Pt,Kc as JC,Kd as jT,Kf as OS,Kg as Ri,Kh as Vw,Ki as xE,Kj as dA,Kk as UA,Kl as Ns,Km as ba,Kn as bc,Lb as NC,Lc as ZC,Ld as GT,Le as lS,Lf as IS,Lg as Pi,Lh as Hw,Li as NE,Lk as BA,Ll as Ls,Lm as Ca,Ln as Cc,Mb as LC,Mc as QC,Md as UT,Me as uS,Mf as RS,Mg as Mi,Mh as Kw,Mk as qA,Ml as Ds,Mm as Ta,Mn as Tc,N as Qb,Nb as DC,Nc as eT,Nd as BT,Ne as pS,Nf as PS,Ng as ki,Nh as Ww,Ni as qi,Nk as zA,Nl as $s,Nm as Sa,Nn as Sc,O as L,Ob as $C,Oc as tT,Od as qT,Oe as Fn,Of as MS,Og as xi,Oh as Xw,Oi as zi,Oj as Ki,Ok as VA,Ol as Fs,Om as wa,On as wc,P as eC,Pb as H,Pc as rT,Pd as zT,Pe as jn,Pf as kS,Pg as Ni,Ph as Yw,Pi as Vi,Pj as lA,Pk as HA,Pl as js,Pm as Ea,Pn as Ec,Q as b,Qb as FC,Qc as oT,Qd as VT,Qe as Gn,Qf as xS,Qg as Li,Qh as Jw,Qj as uA,Qk as KA,Ql as Gs,Qm as Aa,Qn as Ac,Rc as yn,Rd as HT,Re as Un,Rf as NS,Rg as Di,Ri as LE,Rj as pA,Rk as WA,Rl as Us,Rm as va,Rn as vc,S as tC,Sc as nT,Se as Bn,Sf as LS,Sg as $i,Sh as Zw,Si as DE,Sj as mA,Sk as es,Sl as Bs,Sm as Oa,Sn as Oc,T as rC,Tc as iT,Te as qn,Tf as DS,Tg as Fi,Th as Qw,Ti as $E,Tk as ts,Tl as qs,Tm as Ia,Tn as Ic,Uc as sT,Ue as zn,Uf as $S,Ug as ji,Ui as FE,Uj as fA,Uk as rs,Ul as zs,Um as Ra,Un as Rc,Vc as aT,Ve as Vn,Vf as FS,Vg as Gi,Vi as jE,Vj as _A,Vk as os,Vl as Vs,Vm as Pa,Vn as Pc,W as oC,Wc as cT,We as Hn,Wf as jS,Wg as ow,Wh as eE,Wj as hA,Wk as ns,Wl as Hs,Wm as Ma,Wn as Mc,Xa as SC,Xc as dT,Xd as KT,Xe as Kn,Xf as GS,Xg as nw,Xh as tE,Xi as GE,Xj as gA,Xk as is,Xl as Ks,Xm as ka,Ya as wC,Yc as lT,Ye as Wn,Yf as US,Yg as iw,Yh as rE,Yj as Wi,Yl as Ws,Ym as xa,Yn as Ke,Z as nC,Za as EC,Zc as uT,Zd as Sn,Ze as Xn,Zf as BS,Zg as sw,Zh as oE,Zi as UE,Zj as Xi,Zk as ss,Zl as Xs,Zm as Na,Zn as re,_ as Ot,_c as bn,_d as WT,_e as Yn,_f as qS,_g as aw,_h as nE,_i as BE,_j as Yi,_k as as,_l as Ys,_m as La,_n as kc,aa as It,ab as an,ac as mn,ad as Cn,af as Zn,ag as VS,ah as dw,ai as sE,aj as zE,ak as Zi,al as ds,am as av,an as $a,ao as gv,b as jo,ba as Jo,bb as AC,bc as fn,be as XT,bf as mS,bg as HS,bh as lw,bi as aE,bj as VE,bl as ls,bm as Ve,bn as Fa,bo as yv,c as Go,ca as Zo,cb as vC,cc as GC,cd as mT,ce as YT,cf as fS,cg as KS,ch as uw,ci as cE,ck as Qi,cl as us,cm as cv,cn as ja,d as Uo,da as Rt,db as OC,dc as UC,dd as fT,de as JT,df as Be,dg as WS,dh as pw,di as dE,dk as yA,dl as ps,dm as dv,dn as Ga,e as Bo,eb as IC,ec as P,ed as _T,ee as En,ef as Qn,eg as XS,eh as mw,ei as lE,el as ms,em as lv,en as Ua,eo as bv,f as $e,fa as iC,fc as BC,fd as hT,fe as An,ff as _S,fg as YS,fh as fw,fi as uE,fk as bA,fl as XA,fm as Ft,fn as Ba,fo as Cv,g as qo,gb as cn,gc as Mt,gd as gT,ge as vn,gf as ei,gg as JS,gh as _w,gi as pE,gk as CA,gl as YA,gm as He,gn as qa,go as Tv,h as V,ha as sC,hb as dn,hc as qC,hd as kt,he as On,hf as ti,hg as ZS,hh as hw,hk as TA,hl as JA,hm as uv,hn as za,ho as Sv,i as Fe,ia as aC,ib as Ge,id as yT,ie as In,if as ri,ig as QS,ih as gw,ii as mE,il as ZA,im as pv,in as Va,io as wv,j as zo,ja as cC,jb as RC,jc as zC,jd as bT,je as Rn,jf as oi,jg as ew,jh as yw,ji as Ui,jk as SA,jl as QA,jm as mv,jn as Ha,jo as Ev,k as Vo,ka as dC,kd as CT,ke as Pn,kg as tw,kh as bw,ki as Bi,kl as ev,km as fv,kn as Ka,ko as Av,l as Ho,la as lC,lb as ln,le as ZT,lg as rw,lh as Cw,ll as tv,lm as _v,ln as Wa,lo as xc,m as Ko,ma as uC,mb as un,md as TT,me as QT,mg as ai,mh as Tw,mj as HE,mk as wA,ml as rv,mm as hv,mn as Xa,mo as Nc,na as pC,nd as ST,ng as ci,nh as Sw,nj as KE,nm as Js,nn as Ya,no as Lc,o as Wo,oa as mC,ob as pn,oe as Mn,og as di,oh as ww,oj as WE,ok as EA,om as Zs,on as Ja,oo as Dc,p as vt,pa as fC,pe as kn,pg as li,ph as Ew,pi as fE,pj as XE,pm as Qs,pn as Za,po as $c,q as fe,qa as _C,qd as Tn,qe as eS,qg as ui,qh as Aw,qi as _E,qj as YE,ql as $t,qm as ea,qn as Qa,qo as Fc,r as Xo,rd as wT,re as xn,rg as pi,rh as vw,ri as hE,rj as JE,rl as ov,rm as ta,rn as ec,ro as jc,s as je,sa as hC,sd as ET,se as Nn,sg as mi,sh as Ow,si as gE,sk as AA,sl as nv,sm as ra,sn as tc,so as Gc,t as Yo,ta as gC,td as AT,te as tS,tf as xt,tg as qe,th as Iw,ti as yE,tk as vA,tl as iv,tm as oa,tn as rc,to as Uc,ua as yC,ud as vT,ue as rS,uf as Nt,ug as ze,uh as Rw,ui as bE,uj as ZE,uk as OA,ul as ys,um as na,un as oc,uo as Bc,v as Kb,va as bC,vd as OT,ve as oS,vf as ni,vg as fi,vh as Pw,vj as QE,vk as IA,vl as bs,vm as ia,vn as nc,vo as qc,w as Wb,wa as CC,wc as VC,wd as IT,we as nS,wf as ii,wg as _i,wh as Mw,wi as CE,wj as Hi,wk as RA,wl as Cs,wm as sa,wn as ic,wo as jt,x as Xb,xa as TC,xc as HC,xe as iS,xf as si,xg as hi,xh as kw,xj as eA,xl as Ts,xm as aa,xn as sc,ya as Qo,yc as KC,yd as RT,ye as sS,yg as gi,yh as xw,yi as TE,yj as tA,yk as PA,yl as Ss,ym as ca,yn as ac,za as en,zd as PT,ze as aS,zf as hS,zg as yi,zh as Nw,zi as SE,zj as rA,zk as MA,zl as ws,zm as da,zn as cc}from"./chunks/chunk-DEGRLB6Y.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 K="2026-07-28",Zk=["2025-11-25","2025-06-18"],et=[K],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 Gh(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 Uh(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=Gh(t[A.clientInfo]),i=Uh(t[A.logLevel]);return{protocolVersion:K,clientCapabilities:o,...n?{clientInfo:n}:{},...i?{logLevel:i}:{}}}function Qk(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 e0(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 t0(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 Bh(e,t){return rt({...e,resultType:"complete"},t)}function r0(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 Bh({supportedVersions:[...et],capabilities:structuredClone(e.capabilities),ttlMs:t,cacheScope:"public",...e.instructions?{instructions:e.instructions}:{}},e.serverInfo)}function o0(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 qh}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="6505e714-d1f3-5794-88c8-51c1644acec9")}catch{}})();var zh=["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 Vh(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"||!zh.includes(s))throw new p("Unsupported MCP input request method",m.invalidParams,{field:`inputRequests.${n}.method`,method:s??null});let a=Vh(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 a0(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 c0(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 Hh(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 d0(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||!qh(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=Hh(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 l0(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 Kh(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 u0(e,t){return{...e,...Kh(t)}}function Wh(e){return e.replaceAll("~1","/").replaceAll("~0","~")}function Xh(e,t){if(t==="#")return e;if(!t.startsWith("#/"))return;let r=e;for(let o of t.slice(2).split("/").map(Wh)){if(!_(r)&&!Array.isArray(r)||!Object.prototype.hasOwnProperty.call(r,o))return;r=r[o]}return r}function Yh(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 Jh(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 Zh(e,t){if(!_(t)||typeof t.$ref!="string")return;let r=t.$ref;if(r.startsWith("#")&&Xh(e,r)===void 0)throw new p("MCP JSON Schema contains an unresolved local reference",m.invalidParams,{reference:r})}function p0(e,t={}){let{maximumBytes:r,maximumDepth:o,maximumNodes:n}=Yh(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});Zh(e,a.value),Jh(a,i)}return structuredClone(e)}import{randomUUID as Qh}from"node:crypto";import{readFile as eg}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 C0="io.modelcontextprotocol/tasks",tg=["working","input_required","completed","failed","cancelled"],rg=/^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,og=3600*1e3,ng=1e3,Te=1024,ig=30,sg=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(!rg.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 ag(e){if(!tg.includes(e))throw new p("Corrupt MCP task record",m.invalidParams);return e}function cg(e){if(typeof e!="string"||e.length===0)throw new p("Corrupt MCP task record",m.invalidParams);return e}function dg(e){if(typeof e!="number"||!Number.isSafeInteger(e)||e<1)throw new p("Corrupt MCP task record",m.invalidParams);return e}function lg(e){if(e!==null&&(typeof e!="number"||!Number.isSafeInteger(e)||e<0))throw new p("Corrupt MCP task record",m.invalidParams);return e}function ug(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 pg(e){if(!Array.isArray(e)||e.some(t=>typeof t!="string"))throw new p("Corrupt MCP task record",m.invalidParams);return[...e]}function mg(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=ag(e.status),o=cg(e.principal),n=dg(e.workerPid),i=lg(e.ttlMs),s=ug(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:pg(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 W(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 ne(e){return e==="completed"||e==="failed"||e==="cancelled"}function fg(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-${Qh()}`),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 mg(JSON.parse(await eg(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,ig,this.#t,!1,!1,sg);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?og:t.ttlMs,i=t.pollIntervalMs??ng;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),{...W(a),resultType:"task"}}async get(t,r){return W(await this.#n(t,r,o=>{if(ne(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&&!fg(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 W(await this.#n(t.taskId,t.principal,o=>{if(ne(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 W(await this.#n(t,r,n=>ne(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 W(await this.#n(t,r,i=>ne(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 W(await this.#n(t,r,o=>ne(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 T0(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,_g=5e3;function hg(e,t){return new Promise((r,o)=>{let n=setTimeout(()=>o(new Error("MCP subscription sink write timed out")),_g);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 gg(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 yg(e,t){return{...e.toolsListChanged&&t.tools?.listChanged?{toolsListChanged:!0}:{},...e.promptsListChanged&&t.prompts?.listChanged?{promptsListChanged:!0}:{},...e.resourcesListChanged&&t.resources?.listChanged?{resourcesListChanged:!0}:{},...e.resourceSubscriptions&&t.resources?.subscribe?{resourceSubscriptions:[...e.resourceSubscriptions]}:{}}}var 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=yg(gg(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 hg(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,bg=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/u,Ar=/^[\t\x20-\x7E]*$/u,vr=new Set(["prompts/get","resources/read","tools/call"]);function Cg(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 Tg(e,t,r){let o=e["x-mcp-header"];if(o===void 0)return;let n=e.type;if(typeof o!="string"||!bg.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=Tg(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 Sg(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 v0(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,Sg(t,e.toolSchema)),n}function wg(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 Eg(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 Ag(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),Eg(r,o,Ir(i,n))||v("MCP parameter header does not match request body",n)}}function O0(e){let t=Cg(e.headers),r=typeof e.request.method=="string"?e.request.method:"";wg(t,e.request),!(r!=="tools/call"||e.toolSchema===void 0)&&Ag({headers:t,params:e.request.params,toolSchema:e.toolSchema})}var I0=K;import{AsyncLocalStorage as vg}from"node:async_hooks";import{createHash as kr,timingSafeEqual as Og}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}},Ig=/^00-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})$/u,Rg=/^[a-z][a-z0-9_*/-]{0,255}$/u,Pg=/^(?:[a-z0-9][a-z0-9_*/-]{0,240})@[a-z][a-z0-9_*/-]{0,13}$/u,Mg=/^[\x20-\x2B\x2D-\x3C\x3E-\x7E]{0,255}[\x21-\x2B\x2D-\x3C\x3E-\x7E]$/u,Nr=/^[\x21\x23-\x5B\x5D-\x7E]+$/u,Lr=/^[A-Za-z0-9!#$%&'*+.^_`|~-]+$/u,kg=/^[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]*$/u,xg=/%(?![0-9A-Fa-f]{2})/u,Ng=512,Lg=32,Dg=180,$g=8192,Fg=8192,Dr=new vg;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 jg(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 x0(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 N0(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 L0(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 D0(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 $0(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 F0(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 j0(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 Gg(e){let t=e.traceparent,r=e.tracestate;if(t!==void 0){let o=typeof t=="string"?Ig.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"||!Bg(r)))throw new y("Invalid MCP tracestate",403);return{...typeof t=="string"?{traceparent:t}:{},...typeof r=="string"?{tracestate:r}:{}}}function $(e){return e.replace(/^[ \t]*|[ \t]*$/gu,"")}function Ug(e){return Rg.test(e)||Pg.test(e)}function Bg(e){if(Buffer.byteLength(e,"utf8")>Ng)return!1;let t=e.split(",");if(t.length>Lg)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(!Ug(s)||!Mg.test(a)||r.has(s))return!1;r.add(s)}return!0}function $r(e){return kg.test(e)&&!xg.test(e)}function qg(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 zg(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(qg)))return{key:s,serialized:t}}function Vg(e,t){if(e===void 0)return;if(typeof e!="string"||Buffer.byteLength(e,"utf8")>$g)throw new y("Invalid MCP baggage",403);let r=new Set(t),o=e.split(",");if(o.length>Dg)throw new y("Invalid MCP baggage",403);let n=[];for(let i of o){let s=zg(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 G0(e,t={}){let r=_(e)&&_(e._meta)?e._meta:{},o=Vg(r.baggage,t.baggageAllowlist??[]);return{...Gg(r),...o?{baggage:o}:{}}}function U0(e,t){return Dr.run(structuredClone(e),t)}function B0(){let e=Dr.getStore();return e?{...e}:void 0}async function q0(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=jg(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")>Fg)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 z0(e){let t=kr("sha256").update(e.token).digest();return r=>{let o=kr("sha256").update(r).digest();if(!Og(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 K0(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 Hg={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:Hg})));function W0(e){return Ur.find(t=>t.uri===e)}function X0(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 Y0(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 $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
|
|
|
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 lt}from"node:crypto";import{lstat as
|
|
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:
|
|
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
|
|
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 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};
|
|
25
|
+
</html>`}import{createHash as lt}from"node:crypto";import{lstat as Kg,readdir as Xr,readFile as Wg}from"node:fs/promises";import k from"node:path";import{parseDocument as Xg}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",Yg=Object.freeze({revision:ut,status:"draft",directoryRead:!0});function nx(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]:Yg}}})}var M=Object.freeze({maxFilesPerSkill:512,maxFileBytes:16*1024*1024,maxSkillBytes:16*1024*1024,defaultPageSize:20,maxPageSize:100}),qr=100,Jg=32*1024*1024,Zg=/^[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 Qg(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=Xg(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 ey(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>Jg&&T(`Skill origin exceeds the aggregate byte limit: ${t}.`),Wg(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 Kg(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 ey(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()&&Zg.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=Qg(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:K,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 ty(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 ie(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let t of Object.values(e))ie(t)}return e}function ry(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 oy(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 ny(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 iy(e){if(e.schema!==Qr)throw new Error(`observation.schema must be ${Qr}.`);return x(e.id,"observation.id"),I(e.version,"observation.version"),ry(e.reads),oy(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")),ny(e.tiers),ie(structuredClone(e))}function mx(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 sy(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 ay(e){return`/${F(e,"verdict predicate path").map(t=>t.replaceAll("~","~0").replaceAll("/","~1")).join("/")}`}function cy(e){if(e.kind!=="field_equals")return;let t;try{t=JSON.stringify(e.expected)}catch{throw new Error(`Expected value for verdict predicate ${e.id} must be JSON serializable.`)}if(t===void 0)throw new Error(`Expected value for verdict predicate ${e.id} must be JSON serializable.`)}function dy(e){if(e.schema!==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}.`);cy(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 ie(structuredClone(e))}function ly(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}#${ay(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 fx(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 iy(e.observation),dy(e.verdict),Ae(e.recipe),ie(structuredClone(e))}function uy(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 py(e,t){let r={};for(let o of t)uy(r,o,ro(e,o));return r}async function _x(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 sy(e.observation,async g=>py(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=ly(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:ie(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 X(e,t){if(!Number.isSafeInteger(e)||e<=0)throw new TypeError(`Corpus shape ${t} must be a positive safe integer`);return e}function se(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 Y(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(X(e.hierarchy_depth,"hierarchy_depth"),X(e.hierarchy_fanout,"hierarchy_fanout"),se(e.age_span_days,"age_span_days"),X(e.history_entries_per_item,"history_entries_per_item"),se(e.comments_per_100_items,"comments_per_100_items"),se(e.notes_per_100_items,"notes_per_100_items"),se(e.learnings_per_100_items,"learnings_per_100_items"),X(e.author_cardinality,"author_cardinality"),X(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}],J=Object.freeze({scratch:Y({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:Y({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":Y({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":Y({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":Y({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 my(){return Object.keys(J).sort().map(e=>J[e])}function fy(e){let t=e.trim().toLowerCase();if(!Object.hasOwn(J,t))throw new TypeError(`Unknown corpus shape "${e}". Available: ${Object.keys(J).join(", ")}`);return J[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 _y(e,t,r,o=42){if(se(t,"item index"),X(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 hy(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 gy(){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 yy(){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 by(e,t){if(typeof t!="object"||t===null||Array.isArray(t))throw new TypeError(`Coverage entry for ${e} must be an object.`)}function Cy(e,t,r){if(typeof r!="object"||r===null||Array.isArray(r))throw new TypeError(`Coverage entry ${e} has invalid ${t} counts.`);let o=r;if(typeof o.covered!="number"||typeof o.total!="number"||!Number.isInteger(o.covered)||!Number.isInteger(o.total)||o.covered<0||o.total<o.covered)throw new TypeError(`Coverage entry ${e} has invalid ${t} counts.`);return{covered:o.covered,total:o.total}}function Ty(e){if(typeof e!="object"||e===null||Array.isArray(e))throw new TypeError("Coverage summary must be a JSON object.");if(!("total"in e))throw new TypeError("Coverage summary is missing the total entry.");let t=[];for(let[r,o]of Object.entries(e)){by(r,o);for(let n of ao){let i=Cy(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 Sy=["captured_redacted","captured_verbatim"],wy=[{label:"home directory",pattern:/(?:\/home\/|\/Users\/)[^/\s"']+/u},{label:"GitHub token",pattern:/\b(?:gh[oprsu]_[A-Za-z0-9_]{20,})\b/u},{label:"npm token",pattern:/\bnpm_[A-Za-z0-9]{20,}\b/u},{label:"private key",pattern:/-----BEGIN (?:RSA |EC |OPENSSH )?PRIVATE KEY-----/u}];function O(e){return typeof e=="string"&&e.trim().length>0}function Ey(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||!Sy.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 wy)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 Ay(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 vy(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?Ey(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 Ay(e,r)}function kx(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=vy(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 Z 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,Oy=3;function $x(e){return(e?.trim()||"development").replace(/[^a-zA-Z0-9._-]/g,"_").replace(/^\./,"_")}function Fx(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.");Z.mkdirSync(e,{recursive:!0});let o=ft.join(e,r);Z.mkdirSync(o,{recursive:!0});let n=new Date;Z.utimesSync(o,n,n);let i=Z.readdirSync(e).filter(d=>d!==r).flatMap(d=>{try{return[{name:d,mtimeMs:Z.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,Oy-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)Z.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 ae="@unbrained/pm-cli",Iy=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 Ry={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 Py(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 My(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 ky(e){let t=e.split("||").map(r=>My(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 xy(e){return["dependencies","devDependencies","optionalDependencies","peerDependencies"].flatMap(t=>{let r=e[t];if(typeof r!="object"||r===null)return[];let o=r[ae],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=ky(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 Ny(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 Ly(e,t){try{let r=lo.readFileSync(Ie.join(e,t),"utf8").split(/\r?\n/u),o=r.findIndex(c=>c.includes(ae));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 Dy(e){let t=[],r=ht(Ie.join(e,"package.json"));r&&t.push(...xy(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=Ny(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=Ly(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 $y(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=Ry[r];return i?i(e,n):Iy.has(r)}function Fy(e){let t=po(e.argv)?.command,r=$y(e.argv),o=Dy(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=Py(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 ${ae} ${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 zx(e){let t=Fy(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 ${ae} 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 ${ae} ${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 jy}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 Q(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 ee(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:jy("sha256").update(P({nodes:n,edges:i,kinds:s})).digest("hex"),created_at:new Date(o).toISOString(),nodes:n,edges:i,kinds:s})}function Gy(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function de(e){if(!Gy(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 H(e.nodes,e.edges,t),o=ee(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");Q(t.signal);let o=await e.read({...t,workspace:r});return Q(t.signal),o===null?null:de(o)}async function Me(e,t){let r=U(t.workspace,"workspace"),o=de(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(Q(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 Uy(e,t={}){let r=e.map(de),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 H(new Set(r.flatMap(s=>[...s.snapshot.nodes])),r.flatMap(s=>[...s.snapshot.edges]),n);return ee(i,n,t)}var ce=class{name;#e=new Map;constructor(t="memory"){this.name=U(t,"adapter name")}async read(t){Q(t.signal);let r=this.#e.get(U(t.workspace,"workspace"));return r?structuredClone(r):null}async replace(t){Q(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(de(t.snapshot).snapshot))}async clear(t){Q(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 By(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=ee(new H(["a","b"],[{source:"a",target:"b",kind:"related"}],o),o,{createdAt:"2026-01-01T00:00:00.000Z"}),i=ee(new H(["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 qy(e){return fo(new ce,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,zy=["self_reported","independent_transport"];function ke(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function le(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=le(o,`${t}[${String(n)}]`);return r?o:i})}function Ct(e,t){return e===void 0?void 0:le(e,t)}function Vy(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 Hy(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 Ky(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=le(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(!zy.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=Vy(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 Hy(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 Wy(e,t){if(!ke(e))throw new TypeError(`tasks[${String(t)}] must be an object`);let r=le(e.id,`tasks[${String(t)}].id`),o=le(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)=>Ky(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 bN(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)=>Wy(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 wN(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 ue=["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"}},AN=Object.freeze(Object.keys(Tt));function bo(e){if(Object.hasOwn(Tt,e))return Tt[e]}var Xy=new Set([..."=([{,:;!?&|+-*%^~<>","=>"]);function te(e,t){return e<t?-1:e>t?1:0}function Yy(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 Jy(e){return e===void 0||e.kind==="punctuator"&&Xy.has(e.value)||e.kind==="identifier"&&["return","case","throw","else","yield"].includes(e.value)}function Zy(e,t){if(/\s/u.test(e[t]))return t+1;if(e.startsWith("//",t)){let r=e.indexOf(`
|
|
29
|
+
`,t+2);return r===-1?e.length:r+1}if(e.startsWith("/*",t))return e.indexOf("*/",t+2)+2}function Qy(e,t,r){if(e[t]!=="/"||!Jy(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 eb(e,t){let r=e[t];if(r==="'"||r==='"'||r==="`"){let n=Yy(e,t);return r==="`"?{next:n.next}:{next:n.next,token:{kind:"string",value:n.value,offset:t+1}}}if(/[A-Za-z_$]/u.test(r)){let n=t+1;for(;/[A-Za-z0-9_$]/u.test(e[n]??"");)n+=1;return{next:n,token:{kind:"identifier",value:e.slice(t,n),offset:t}}}let o=e.startsWith("=>",t)?"=>":r;return{next:t+o.length,token:{kind:"punctuator",value:o,offset:t}}}function tb(e){let t=[],r=0;for(;r<e.length;){let o=Zy(e,r);if(o!==void 0){r=o;continue}let n=Qy(e,r,t.at(-1));if(n!==void 0){r=n;continue}let i=eb(e,r);i.token&&t.push(i.token),r=i.next}return t}var rb=new Set(["object","block","pattern"]),ob=new Set(["const","let","var"]),nb=new Set(["}",")","]"]),ib=new Set(["=","(","[",",",":","?","return"]);function sb(e,t,r){if([...r].reverse().find(i=>rb.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"&&ob.has(n.value)?"pattern":n?.value==="=>"||n?.value===")"?"block":n&&ib.has(n.value)?"object":"block"}function ab(e,t,r){let o=e[t];if(o.value==="{"){let a=sb(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 cb(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 db(e,t){return e[t+1]?.value===")"&&e[t+2]?.value==="=>"||e[t+1]?.value==="="}function lb(e){let t=tb(yo.stripTypeScriptTypes(e,{mode:"strip"})),r=[],o=[];for(let[n,i]of t.entries()){let s=o.at(-1),a=cb(s,i,t[n+1]);a&&s.candidates.push(a);let c=ab(t,n,o);if(c)o.push(c);else if(nb.has(i.value)){let d=o.pop();d?.kind==="object"&&!db(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 ub(e){let t=[0];for(let r=0;r<e.length;r+=1)e[r]===`
|
|
30
|
+
`&&t.push(r+1);return t}function pb(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 vN(e){let t=[],r=[];for(let n of[...e].sort((i,s)=>te(i.path,s.path))){let i=ub(n.content),s;try{s=lb(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=pb(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(ue.map(n=>[n,t.filter(i=>i.kind===n).length]));for(let n of ue)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?te(n.path,i.path):n.line!==i.line?n.line-i.line:te(n.field,i.field)),r.sort((n,i)=>n.subject!==i.subject?te(n.subject,i.subject):te(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 ON(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])=>te(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 IN(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 RN(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=ue.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 mb(e,t){let r=new Map(ue.map(i=>[i,new Set]));for(let i of t)r.get(i.kind).add(i.value);let o=ue.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 PN=mb;(function(){try{var e=typeof window<"u"?window:typeof 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 kN=16,fb=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([...fb,"manifest_unknown_key","no_version_bounds_declared"].sort((e,t)=>e.localeCompare(t)));function xN(e,t=Co){return{ok:e.executable_error_code_count>=t,baseline:t,actual:e.executable_error_code_count}}function NN(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 LN(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 DN(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 _b(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 hb(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."},..._b(e)]}function jN(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 hb(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]="41d33f0e-f925-54da-a75d-52a73dd76f38")}catch{}})();var So="not-a-declared-action";function gb(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 pe(e){return e.replaceAll(/[^a-z0-9]+/gu,"-").replaceAll(/^-|-$/gu,"")}function WN(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})=>pe(r)));return e.flatMap(r=>r.slots.flatMap((o,n)=>{if(!o.required)return[];let i=r.command.split(" "),s=pe(r.command),a=i.length>1&&t.has(s)?i.map(pe).join("--"):s,c=re(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}-${pe(o.name)}`,command:r.command,refusal_args:[...i,...r.slots.slice(0,n).map(l=>gb(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 yb(e){switch(V(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 XN(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-${pe(t)}`,command:t,refusal_args:[...r,So],recovery_args:[...r,"--help"],error_code:"unknown_subcommand",rejected_value:So,allowed_values:[...yb(t)].sort()}}).sort((t,r)=>t.probe_id.localeCompare(r.probe_id))}function bb(e,t){let r=[...t].sort();return e.length===t.length&&[...e].sort().every((o,n)=>o===r[n])}function Cb(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&&!bb(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 YN(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=>Cb(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 ZN(){return wt.map(e=>({...e}))}function Tb(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 QN(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=Tb(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]="f732fc03-3a3f-59b0-8cf8-0f247ab34417")}catch{}})();var xe,Sb=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 wb(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=Sb[V(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(V(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=oe.filter(({command:i})=>Ke(i)).flatMap(({command:i,family:s})=>sr(i,re(i)).map(a=>({command:i,family:s,concept:wb(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 iL(){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-attest":23,"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 Eb(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 Ab(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 vb(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 sL(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 Eb(e,n,o),Ab(a,t,o),vb(e,r,o),o.sort((c,d)=>c.command.localeCompare(d.command)||c.code.localeCompare(d.code)||c.detail.localeCompare(d.detail)),{ok:o.length===0,entry_count:e.length,budget_count:t.length,concept_count:new Set(e.map(({concept:c})=>c)).size,baseline_entry_count:r.length,findings:o}}function aL(){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 dL(e){return e}function lL(e){return e}function uL(e){return e}function pL(e){return e}function mL(e){return e}function fL(e){return e}function _L(e){return e}function hL(e){return e}function gL(e){return e}function yL(e){return e}function bL(e){return e}function CL(e){return e}function TL(e){return e}function SL(e){return{handled:!0,result:e}}function wL(){return{handled:!1}}function EL(e){return e}function AL(e){return e}function vL(e){return e}function OL(e){return e}function IL(e){return e}function RL(e){return e}function PL(e){return e}function ML(e){return e}function kL(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 Ob(e={},t={}){return new he(t).extension(void 0,{...e,migrate:!0})}function Ib(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]="ae8f06a0-a2e6-5f91-99f7-e822270b491d")}catch{}})();import{createHash as Oo,createHmac as Rb,randomBytes as Pb,timingSafeEqual as Mb}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 OD="dev.unbrained.pm/progressive-tool-discovery",ID=Object.freeze({version:1,discoveryTool:"pm_discover",canonicalResult:"structuredContent.result",compatibilityText:"pointer"}),kb=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}),xb=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"]),Nb=new Set(["core","standard","full","custom"]),Po=new Set(oe.map(({family:e})=>e)),Lb=Pb(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 Db(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 RD(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 $b(e){return e===void 0||!Number.isFinite(e)?0:Math.min(1,Math.max(0,e))}function me(e){return[...new Set(e.toLowerCase().match(/[a-z0-9]+/gu)??[])].sort()}function Fb(e,t){let r=me(e);if(r.length===0)return 0;let o=new Set(me(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 jb(e,t){let r=me(e);if(r.length===0)return 0;let o=t.toLowerCase(),n=me(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 Rb("sha256",r).update(JSON.stringify({version:1,fingerprint:e,offset:t})).digest("base64url")}function Gb(e,t,r){let o={version:1,offset:t,signature:Lo(e,t,r)};return Buffer.from(JSON.stringify(o),"utf8").toString("base64url")}function Ub(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||!Mb(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:$b(e),weight:t,available:r!=="unavailable",source:r}}function Le(e,t,r){return Et(e??t,r,e===void 0?"computed":"host")}function Bb(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=Fb(t,i),a=new Set(me(t)),c={lexical:Et(s,q.lexical,"computed"),semantic:Le(e.signals?.semantic,jb(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,kb.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 qb(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"||!Nb.has(e.profile)))throw new b("pm tool discovery profile must be core, standard, full, or custom.",64)}function zb(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 qb(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 Vb(e,t,r){return e.filter(o=>o.authorized!==!1).map(o=>Bb(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 Hb(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 PD(e,t={}){Db(e),No(t);let r=zb(t),o=t.cursorIntegrityKey??Lb,n=Vb(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=Ub(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:xb}},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:Gb(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=Hb(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]="f5d5516b-01ec-51b3-a7a0-e611b4622581")}catch{}})();export{JI as ACTIONABILITY_ORDERING_KINDS,ws as ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS,yc as ACTIVITY_FLAG_CONTRACTS,Fn as AGENT_PROVENANCE_DIMENSIONS,ra as AGGREGATE_FLAG_CONTRACTS,Ba as APPEND_FLAG_CONTRACTS,AR as ASSURANCE_ACTIONS,vR as ASSURANCE_DECLARATION_KINDS,yO as ASSURANCE_DOCUMENT_VERSION,cc as ASSURANCE_FLAG_CONTRACTS,bO as ASSURANCE_GATE_TRIGGERS,CO as ASSURANCE_MEASUREMENT_SOURCE_KINDS,$O as ASSURANCE_PRESET_IDS,fO as AssuranceEvaluationRefusalError,mO as AssuranceMutationRefusalError,_O as AssuranceSourceResolutionError,En as BASELINE_ITEM_FORMAT_VERSION,Sy as BOUNDARY_FIXTURE_CAPTURE_SOURCES,lR as BRIEF_LIST_FIELDS,Gn as BUILTIN_AGENT_PROVENANCE_ADAPTERS,J as BUILTIN_CORPUS_SHAPES,jn as BUILTIN_HARNESS_SIGNAL_DESCRIPTORS,Qo as BUILTIN_ITEM_TYPE_VALUES,Yt as BUILTIN_PROFILES,xC as BUILTIN_RELATIONSHIP_KINDS,Cs as CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS,gc as CALENDAR_FLAG_CONTRACTS,qa as CLAIM_FLAG_CONTRACTS,Dc as CLOSE_ACTION_OPTION_KEYS,Ga as CLOSE_FLAG_CONTRACTS,Ua as CLOSE_MANY_FLAG_CONTRACTS,Xa as CLOSE_TASK_FLAG_CONTRACTS,oa as COMMENTS_FLAG_CONTRACTS,SC as COMMON_MUTATION_COMMAND_OPTION_KEYS,Pc as COMPLETION_FLAG_CONTRACTS,sn as CONFIDENCE_TEXT_VALUES,ya as CONFIG_FLAG_CONTRACTS,Ts as CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS,FR as CONTEXT_EVALUATION_METRIC_NAMES,Cc as CONTEXT_FLAG_CONTRACTS,Vt as CONTEXT_OUTPUT_VALUES,qR as CONTEXT_PACKING_PROFILES,PR as CONTEXT_RECENCY_EPOCH,NR as CONTEXT_RELEVANCE_SERVICE,kR as CONTEXT_RELEVANCE_SIGNAL_NAMES,HR as CONTEXT_SIGNAL_SET_VERSION,VR as CONTEXT_SIGNAL_STORE_FORMAT_VERSION,KR as CONTEXT_SIGNAL_STORE_WARNING_DETAILS,Iw as CONTEXT_USAGE_LIMITS,Rc as CONTRACTS_FLAG_CONTRACTS,mc as COPY_FLAG_CONTRACTS,Os as CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,Rs as CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,Is as CREATE_COMMANDER_STRING_OPTION_CONTRACTS,Jb as CREATE_DIRECT_CLOSE_REASON_DEFAULT,dc as CREATE_FLAG_CONTRACTS,qT as CURRENT_HISTORY_HASH_ALGORITHM,eE as CURRENT_HISTORY_ITEM_HASH_VERSION,rE as CURRENT_HISTORY_RECORD_HASH_VERSION,An as CURRENT_ITEM_FORMAT_VERSION,JR as ContextSignalStore,Rw as ContextUsageValidationError,sO as DEFAULT_AUTHOR_IDENTITY_VOCABULARY,xP as DEFAULT_CHILD_SAMPLE_LIMIT,dR as DEFAULT_COMPACT_LIST_FIELDS,mA as DEFAULT_DERIVED_INDEX_MINIMUM_ITEMS,nm as DEFAULT_EVAL_QUERIES_RELATIVE_PATH,pP as DEFAULT_TERMINAL_TRANSITION_POLICY,tP as DEFAULT_WORKSPACE_MEMORY_MINIMUM_ITEMS,bv as DEFECT_ESCAPE_CLASSES,Cv as DEFECT_GATE_EVIDENCE_DISPOSITIONS,Va as DELETE_FLAG_CONTRACTS,rn as DEPENDENCY_KIND_VALUES,wc as DEPS_FLAG_CONTRACTS,aa as DOCS_FLAG_CONTRACTS,ic as DUPLICATES_FLAG_CONTRACTS,NI as DURABLE_MERGE_RECEIPT_INTRODUCED_AT,Ac as EVAL_FLAG_CONTRACTS,em as EVAL_QUERY_SET_CONTRACT,tm as EVAL_QUERY_SET_EXAMPLE,Qp as EVAL_QUERY_SET_SCHEMA_ID,bc as EVENTS_FLAG_CONTRACTS,Ja as EVENT_FLAG_CONTRACTS,Vo as EXECUTABLE_COMMAND_ALIASES,L as EXIT_CODE,Ra as EXTENSION_ACTIVATE_FLAG_CONTRACTS,Ia as EXTENSION_ADOPT_ALL_FLAG_CONTRACTS,Da as EXTENSION_ADOPT_FLAG_CONTRACTS,$v as EXTENSION_CAPABILITIES,Xb as EXTENSION_CAPABILITY_CONTRACT,Kb as EXTENSION_CAPABILITY_CONTRACT_VERSION,Wb as EXTENSION_CAPABILITY_LEGACY_ALIASES,_n as EXTENSION_CAPABILITY_REGISTRATION_SURFACES,La as EXTENSION_CATALOG_FLAG_CONTRACTS,Pa as EXTENSION_DEACTIVATE_FLAG_CONTRACTS,Oa as EXTENSION_DESCRIBE_FLAG_CONTRACTS,Na as EXTENSION_DOCTOR_FLAG_CONTRACTS,va as EXTENSION_EXPLORE_FLAG_CONTRACTS,ba as EXTENSION_FLAG_CONTRACTS,Ta as EXTENSION_INIT_FLAG_CONTRACTS,Ea as EXTENSION_INSTALL_FLAG_CONTRACTS,ka as EXTENSION_MANAGE_FLAG_CONTRACTS,Ma as EXTENSION_MIGRATE_FLAG_CONTRACTS,Fv as EXTENSION_POLICY_MODES,jv as EXTENSION_POLICY_SURFACES,xa as EXTENSION_RELOAD_FLAG_CONTRACTS,Uv as EXTENSION_SANDBOX_PROFILES,Ca as EXTENSION_SCOPE_FLAG_CONTRACTS,Gv as EXTENSION_TRUST_MODES,Aa as EXTENSION_UNINSTALL_FLAG_CONTRACTS,VO as EXTERNAL_DEPENDENCY_RESOLUTION_STATUSES,qO as EXTERNAL_DEPENDENCY_SOURCE_KIND,zO as EXTERNAL_DEPENDENCY_SOURCE_KIND_ALIAS,sa as FILES_FLAG_CONTRACTS,fc as FOCUS_FLAG_CONTRACTS,oc as GC_FLAG_CONTRACTS,mR as GET_DEPTH_VALUES,Tc as GET_FLAG_CONTRACTS,ea as GLOBAL_FLAG_CONTRACTS,$d as GRAPH_DURABLE_CACHE_MIN_ITEMS,Dd as GRAPH_DURABLE_CACHE_VERSION,Ec as GRAPH_FLAG_CONTRACTS,qe as GRAPH_SUBCOMMAND_VALUES,Sc as GUIDE_FLAG_CONTRACTS,sc as HEALTH_FLAG_CONTRACTS,pa as HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS,QO as HISTORY_AUTHOR_ATTRIBUTION_BASELINE,fM as HISTORY_COMPACT_BULK_DEFAULT_MIN_ENTRIES,ma as HISTORY_COMPACT_FLAG_CONTRACTS,ei as HISTORY_EVENT_CLASSIFICATION_VERSION,ca as HISTORY_FLAG_CONTRACTS,UT as HISTORY_HASH_ALGORITHMS,Pe as HISTORY_ITEM_HASH_VERSION_3_INTRODUCED_IN,la as HISTORY_REDACT_FLAG_CONTRACTS,ua as HISTORY_REPAIR_FLAG_CONTRACTS,Kp as INIT_AGENT_GUIDANCE_MODE_VALUES,ga as INIT_FLAG_CONTRACTS,$a as INSTALL_FLAG_CONTRACTS,nn as ISSUE_SEVERITY_VALUES,uc as ITEM_COMPLETE_FLAG_CONTRACTS,AI as ITEM_LATEST_TIMESTAMP_FIELDS,Yb as ITEM_METADATA_KEY_ORDER,lc as ITEM_MUTATE_FLAG_CONTRACTS,pc as ITEM_REOPEN_FLAG_CONTRACTS,yI as ITEM_SCALAR_MISSING_VALUE,en as ITEM_TYPE_VALUES,EI as ITEM_UNION_COLLECTION_FIELDS,YR as JsonFileContextSignalStoreAdapter,ia as LEARNINGS_FLAG_CONTRACTS,BT as LEGACY_HISTORY_HASH_ALGORITHM,up as LINKED_TEST_ENV_NAME_PATTERN,pp as LINKED_TEST_PM_CONTEXT_MODE_VALUES,lp as LINKED_TEST_PROTECTED_ENV_KEYS,mp as LINKED_TEST_WORKSPACE_CONTEXT_MODE_VALUES,ys as LIST_COMMANDER_STRING_OPTION_CONTRACTS,uR as LIST_COMMAND_DEFAULT_PROJECTIONS,qv as LIST_FILTER_EXTENSION_FLAG_DEFINITIONS,ta as LIST_FILTER_FLAG_CONTRACTS,gR as LIST_SORT_FIELDS,yR as LIST_SORT_ORDER_VALUES,ti as MAINTENANCE_HISTORY_OPERATIONS,kP as MAX_CHILD_PROJECTION_ITEMS,KS as MAX_WORKFLOW_POLICIES,WS as MAX_WORKFLOW_POLICY_TERMS,Ya as MEET_FLAG_CONTRACTS,tM as MERGE_DRIVER_ARTIFACT_VALUES,da as MERGE_FLAG_CONTRACTS,ze as MERGE_SUBCOMMAND_VALUES,nM as MUTATION_EVENT_WIRE_BUDGET,ce as MemoryRelationshipGraphAdapter,Ss as NEXT_COMMANDER_STRING_OPTION_CONTRACTS,Oc as NEXT_FLAG_CONTRACTS,Yu as NEXT_OUTPUT_VALUES,na as NOTES_FLAG_CONTRACTS,Sa as PACKAGE_FLAG_CONTRACTS,wa as PACKAGE_INIT_FLAG_CONTRACTS,Wa as PAUSE_TASK_FLAG_CONTRACTS,Lc as PLAN_CREATE_METADATA_PARAMETER_KEYS,ha as PLAN_FLAG_CONTRACTS,$p as PLAN_SHOW_DEPTH_VALUES,Ye as PLAN_SUBCOMMANDS,Fp as PLAN_TEMPLATE_NAMES,zy as PM_AGENT_TASK_ACCOUNTING_MODES,bt as PM_AGENT_TASK_TRANSCRIPT_VERSION,Uo as PM_BULK_LIFECYCLE_COMMAND_ALIASES,zc as PM_CLI_EXPECTED_ERROR_NAME,uv as PM_CLI_GRAMMAR_CONTRACT,sv as PM_CLI_GRAMMAR_NOUNS,gi as PM_CLI_ONLY_TOOL_ACTION_WAIVERS,av as PM_CLI_SHARED_VERBS,zo as PM_COMMAND_ALIAS_CONTRACTS,oe as PM_COMMAND_CAPABILITY_CONTRACTS,Ft as PM_COMMAND_DESTINATION_CONTRACTS,TP as PM_COMMAND_EXIT_CONTRACTS,CP as PM_COMMAND_EXIT_OUTCOME_CONTRACTS,Li as PM_COMMAND_OUTPUT_BUDGET_CONTRACTS,vM as PM_COMMAND_OUTPUT_ENVELOPE_CONTRACTS,He as PM_COMMAND_POSITIONAL_CONTRACTS,km as PM_COMMAND_VISIBILITY_CONTRACTS,Vv as PM_COMPLETE_LIST_FINDING_CODES,Jv as PM_CONTEXT_INTENTS_FILE,jw as PM_CONTEXT_INTENT_CONTRACTS,Go as PM_CONTEXT_OPS_COMMAND_ALIASES,mi as PM_CORE_COMMAND_NAMES,j as PM_CORPUS_SHAPE_SCHEMA,bi as PM_DEPRECATED_TOOL_ACTIONS,Pi as PM_DIAGNOSTIC_DEGRADATION_STEPS,Mi as PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS,Ri as PM_DIAGNOSTIC_OUTPUT_CLASSES,Ci as PM_DISCOVERABLE_TOOL_ACTIONS,to as PM_EPISODE_SCHEMA,EM as PM_ERROR_CODE_CATALOG,CM as PM_ERROR_CODE_EXIT_CLASS_CONTRACTS,ao as PM_EXACT_COVERAGE_METRICS,ai as PM_EXTENSION_CAPABILITY_CONTRACTS,fi as PM_EXTENSION_PACKAGE_ACTION_SUBCOMMANDS,di as PM_EXTENSION_POLICY_MODE_CONTRACTS,pi as PM_EXTENSION_POLICY_SURFACE_CONTRACTS,ui as PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS,ci as PM_EXTENSION_SERVICE_NAME_CONTRACTS,li as PM_EXTENSION_TRUST_MODE_CONTRACTS,sI as PM_GITATTRIBUTES_END,iI as PM_GITATTRIBUTES_START,cI as PM_GITATTRIBUTES_V2_END,aI as PM_GITATTRIBUTES_V2_START,Xc as PM_GITIGNORE_END,Wc as PM_GITIGNORE_START,OP as PM_HISTORY_ATTESTATION_CONTRACT,jo as PM_HISTORY_COMMAND_ALIASES,nS as PM_HISTORY_OPERATION_ALIASES,sS as PM_HISTORY_OPERATION_CONTRACT,iS as PM_HISTORY_OPERATION_PATTERNS,hi as PM_ITEM_ACTION_SUBCOMMANDS,rS as PM_ITEM_HISTORY_OPERATIONS,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,kb as PM_MCP_ENTRY_TOOL_NAMES,m as PM_MCP_ERROR_CODES,I0 as PM_MCP_HTTP_PROTOCOL_VERSION,zh as PM_MCP_INPUT_REQUEST_METHODS,Zk as PM_MCP_LEGACY_PROTOCOL_VERSIONS,lr as PM_MCP_LOG_LEVELS,A as PM_MCP_META_KEYS,OD as PM_MCP_PROGRESSIVE_DISCOVERY_EXTENSION,ID as PM_MCP_PROGRESSIVE_DISCOVERY_SERVER_CAPABILITY,$m as PM_MCP_PROMPT_CONTRACTS,K as PM_MCP_PROTOCOL_VERSION,Dm as PM_MCP_RESOURCE_CONTRACTS,ut as PM_MCP_SKILLS_DRAFT_REVISION,Br as PM_MCP_SKILLS_EXTENSION,Yg 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,C0 as PM_MCP_TASKS_EXTENSION,tg as PM_MCP_TASK_STATUSES,_e as PM_MCP_TOOL_COMMAND_CONTRACTS,bS as PM_MODE_PAIRED_OUTPUT_PROJECTION_CONTRACTS,es as PM_MUTATION_ACTION_CONTRACTS,$e as PM_NAMESPACED_COMMAND_ALIASES,Qr as PM_OBSERVATION_SCHEMA,Ii as PM_OUTPUT_BUDGET_CLASSES,Oi as PM_OUTPUT_DEGRADATION_STEPS,ar as PM_OUTPUT_ENVELOPE_KINDS,Bt as PM_PACKAGE_CONVENTIONAL_RESOURCE_ROOTS,_i as PM_PACKAGE_ONLY_ACTION_SUBCOMMANDS,Ut as PM_PACKAGE_RESOURCE_KINDS,Ve as PM_POSITIONAL_ACTION_CONTRACTS,qc as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA,Uc as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION,hw as PM_READ_OUTPUT_COMPOSITION_OPTION_FLAGS,ow as PM_READ_OUTPUT_CONTINUATION_FINGERPRINT_POLICIES,mw as PM_READ_OUTPUT_DIMENSIONS,_w as PM_READ_OUTPUT_OPTION_FLAGS,cw as PM_READ_OUTPUT_SESSION_MAX_SEEN_ITEM_IDS,aw as PM_READ_OUTPUT_SESSION_MIN_TOKENS,fw as PM_READ_OUTPUT_SURFACES,gw as PM_READ_OUTPUT_SURFACE_CONTRACTS,yS as PM_READ_ROW_CONTRACTS,gS as PM_READ_ROW_JQ_SELECTOR,AN as PM_RECOVERY_REFERENCE_FIELDS,ue as PM_RECOVERY_REFERENCE_KINDS,fb as PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE,To as PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE_V2,kN as PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE,Co as PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE_V2,Bo as PM_RELOCATED_COMMAND_ALIASES,fs as PM_REPRODUCIBLE_PROCESS_ENV,SP as PM_SUCCESS_EXIT_CODES,yi as PM_TOOL_ACTIONS,$c as PM_TOOL_ACTION_PARAMETER_CONTRACTS,Bc as PM_TOOL_PARAMETERS_SCHEMA,Gc as PM_TOOL_PARAMETERS_SCHEMA_MAJOR,jc as PM_TOOL_PARAMETERS_SCHEMA_VERSION,xc as PM_TOOL_RESERVED_CUSTOM_FIELD_PROPERTIES,eo as PM_VERDICT_SCHEMA,oS as PM_WORKSPACE_HISTORY_OPERATIONS,Jr as PM_WORKSPACE_RECIPE_SCHEMA,_a 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,Hv 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,LS as QUERY_CURSOR_CONTRACT,ja as REINDEX_FLAG_CONTRACTS,rA as REINDEX_LOCK_ID,yt as RELATIONSHIP_GRAPH_SNAPSHOT_VERSION,Ha as RELEASE_FLAG_CONTRACTS,Za as REMIND_FLAG_CONTRACTS,kt as RESERVED_ITEM_FIELD_NAMES,za as RESTORE_FLAG_CONTRACTS,on as RISK_VALUES,Rv as RelationshipEventLog,Pv as RelationshipEventStore,H as RelationshipGraph,Ue as RelationshipKindRegistry,fa as SCHEMA_FLAG_CONTRACTS,bs as SEARCH_COMMANDER_STRING_OPTION_CONTRACTS,zv as SEARCH_EXTENSION_FLAG_DEFINITIONS,Ic as SEARCH_FLAG_CONTRACTS,ku as SEMANTIC_ATTRIBUTION_LIMITS,Qb as SETTINGS_DEFAULTS,dm as SNAPSHOT_SCHEMA,rI as SOURCE_CONTEXT_ACCESS_ENV,oI as SOURCE_CONTEXT_WRITE_OVERRIDE_ENV,Ka as START_TASK_FLAG_CONTRACTS,nc as STATS_FLAG_CONTRACTS,tn as STATUS_VALUES,Qs as SUBCOMMAND_GLOBAL_FLAG_CONTRACTS,ri as SUBSTANTIVE_HISTORY_OPERATIONS,tE as SUPPORTED_HISTORY_ITEM_HASH_VERSIONS,oE as SUPPORTED_HISTORY_RECORD_HASH_VERSIONS,hC as SUPPRESS_HOST_OUTPUT_MARKER,tc as TELEMETRY_FLAG_CONTRACTS,nf as TELEMETRY_SUBCOMMANDS,ec as TEST_ALL_FLAG_CONTRACTS,Qa as TEST_FLAG_CONTRACTS,rc as TEST_RUNS_FLAG_CONTRACTS,Qm as TEST_RUN_MEASUREMENT_LIMIT,Ks as TOOL_ACTIVITY_OPTION_CONTRACTS,Ls as TOOL_AGGREGATE_OPTION_CONTRACTS,qs as TOOL_BULK_MUTATION_FILTER_OPTION_CONTRACT_SOURCE,Hs as TOOL_CALENDAR_OPTION_CONTRACTS,Vs as TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS,Ws as TOOL_CONTEXT_OPTION_CONTRACTS,Gs as TOOL_CREATE_OPTION_CONTRACTS,js as TOOL_CREATE_OPTION_CONTRACT_SOURCE,Xs as TOOL_DEPS_OPTION_CONTRACTS,Ys as TOOL_GRAPH_OPTION_CONTRACTS,Ns as TOOL_LIST_FILTER_OPTION_CONTRACTS,Ds as TOOL_SEARCH_FILTER_OPTION_CONTRACTS,Fs as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS,$s as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACT_SOURCE,zs as TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS,Bs as TOOL_UPDATE_OPTION_CONTRACTS,Us as TOOL_UPDATE_OPTION_CONTRACT_SOURCE,Zb as TYPE_TO_FOLDER,fC as UNKNOWN_SUBCOMMAND_COMPATIBILITY_CODES,Ps as UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,ks as UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,Ms as UPDATE_COMMANDER_STRING_OPTION_CONTRACTS,_c as UPDATE_FLAG_CONTRACTS,hc as UPDATE_MANY_FLAG_CONTRACTS,Fa as UPGRADE_FLAG_CONTRACTS,ac as VALIDATE_FLAG_CONTRACTS,HS as WORKFLOW_POLICY_ACTIONS,uI as WORKFLOW_POLICY_DOCUMENT_SCHEMA,lI as WORKFLOW_POLICY_SCHEMA,vc as WORKSPACE_FLAG_CONTRACTS,AE as WORKSPACE_HISTORY_ID,lm as WORKSPACE_SNAPSHOT_ACTIONS,md as WorkspaceGraphCache,Lv as WorkspaceTransactionInterruptedError,Mm as _testOnly,RR as _testOnlyAggregateCommand,Hp as _testOnlyConfigCommand,$P as _testOnlyGetCommand,Pl as _testOnlyHealthCommand,Jp as _testOnlyInit,Wp as _testOnlyInitAgentGuidance,ek as _testOnlyItemTransaction,cM as _testOnlyMutationEvents,dP as _testOnlyNextCommand,eM as _testOnlySearchCommand,gP as _testOnlySimilarity,ym as _testOnlyTemplates,du as _testOnlyValidateCommand,uM as _testOnlyWorkspacePosition,UO as acceptAssuranceProposals,au as acknowledgeLinkedTests,ol as acknowledgeUnknownAuthorHistoryEvents,rl as acknowledgeUnknownAuthorHistoryEventsFromTransport,fA as acquireItemMetadataDerivedIndexLock,Be as acquireLock,pk as activateExtensionForTest,WC as activateExtensions,$n as agentSessionEnvironment,t_ as aggregate,Bm as analyzeAgentProvenanceDescriptorCoverage,Sv as analyzeDefectChangeRisk,ER as analyzeDefectRecurrenceCoverage,ap as analyzeDuplicateItems,kv as analyzeGraphImpact,od as analyzeHierarchyIntegrity,xv as analyzeKnowledgeGraph,EP as analyzePmCommandExitConformance,Ti as analyzePmToolActionParity,BI as analyzeReconciliationDiscard,Mv as analyzeRelationshipExecution,Id as analyzeRelationshipSchedule,vh as analyzeSdkActionCoverage,jt as analyzeSdkCliParameterCompleteness,m_ as append,Bi as appendHistoryEntry,RE as appendWorkspaceAuditEvent,IE as appendWorkspaceHistoryChange,ET as applyAcceptanceCriteriaMutations,jO as applyAssurancePreset,Mh as applyBootstrapPagerPolicy,zw as applyContextIntentProjection,Xu as applyContextTagProjection,bR as applyFilterValueEcho,sA as applyHistoryPatch,Fh as applyInvocationAuthorOverride,Dl as applyPathMigrations,Aw as applyReadOutputDimensions,Tw as applyReadOutputIncludeModes,lw as applyReadOutputSessionReferences,CT as applyRegisteredItemFieldDefaultsAndValidation,Gl as applyStandaloneNote,Sl as applyStoredExtensionMigrationState,vT as applyTagRemovals,hP as applyTerminalOrderingPolicy,Ul as artifactKey,nC as asRecordClone,oC as asRecordOrNull,We as assembleWorkspaceRelationshipGraph,Yv as assertCompleteListResult,Hk as assertExtensionBlueprint,Vk as assertExtensionCapabilityUsage,Ok as assertExtensionDeactivated,Xk as assertExtensionManifestCompatible,Wk as assertExtensionManifestMatchesBlueprint,Yk as assertExtensionPreflight,sd as assertHierarchyMutationAllowed,_M as assertHistoryCompactTarget,zI as assertHistoryRepairTarget,Yi as assertInitializedTracker,$l as assertLinkedArtifactMutationIsUnambiguous,e0 as assertMcpClientCapabilities,Qk as assertMcpProtocolHeader,qy as assertMemoryRelationshipGraphAdapterConformance,RT as assertNoUnknownCsvKeys,Ik as assertPackageManifest,FE as assertParentReferenceIsNotSelf,nx as assertPmMcpSkillsCapability,Kk as assertProjectProfile,zx as assertProjectRuntimeCompatibility,CS as assertProjectionModeChoice,Xi as assertReadableTrackerRoot,Rk as assertRegisteredCommandContract,jk as assertRegisteredCommandOverride,Lk as assertRegisteredExporter,Pk as assertRegisteredFlags,Mk as assertRegisteredHook,Nk as assertRegisteredImporter,Dk as assertRegisteredItemField,$k as assertRegisteredItemType,zk as assertRegisteredMigration,Gk as assertRegisteredParserOverride,Uk as assertRegisteredPreflightOverride,Fk as assertRegisteredProfile,Bk as assertRegisteredRendererOverride,kk as assertRegisteredSearchProvider,qk as assertRegisteredServiceOverride,xk as assertRegisteredVectorStoreAdapter,$C as assertRelationshipEdgeAllowed,fo as assertRelationshipGraphAdapterConformance,TO as assuranceAssertionUpdateIsLoosening,Kw as attachContextIntentReceipt,Pw as attachContextUsageServingReceipt,ou as attachLinkedTestMutationProvenance,ru as attachLinkedTestProvenance,rt as attachMcpServerInfo,vS as attachOutputOmissionReceipt,Xw as attachOutputTokenAccounting,Ww as attachReadOutputContracts,uw as attachReadOutputSessionReceipt,cl as auditMergeAttributeFence,dI as auditMergeDriverConfiguration,Nd as auditWorkspaceRelationshipGraph,q0 as authorizeMcpHttpRequest,Ln as boundAgentEpisodeIdentity,zS as boundReadOutputRows,Vu as buildChildrenByParent,UP as buildCompactSearchFilterSummary,CR as buildContentFilterEcho,XR as buildContextSignalSnapshot,_y as buildCorpusShapeItemPlan,Tv as buildDefectRecurrenceIndex,yl as buildExtensionDescribeResult,Al as buildExtensionInstallPlan,TR as buildGovernanceMissingFilterEcho,HE as buildInvalidTypeError,NP as buildItemChildrenRollup,ZM as buildItemCompletionMutations,xR as buildItemContextRelevanceCandidates,CA as buildItemNotFoundError,DP as buildItemSchedule,WI as buildLinkedFileRepairReport,N0 as buildMcpAuthorizationDiscoveryUrls,Bh as buildMcpCompleteResult,r0 as buildMcpDiscoverResult,j0 as buildMcpDynamicRegistrationMetadata,v0 as buildMcpHttpRequestHeaders,a0 as buildMcpInputRequiredResult,x0 as buildMcpProtectedResourceMetadata,sl as buildMergeAttributePatterns,Fc as buildPmActionToolInputSchema,LN as buildPmRefusalClosureCensus,JO as buildRelationshipContext,AA as buildSearchCorpus,OA as buildSemanticCorpusInput,KI as buildStatusRoleWarnings,Wi as buildTrackerInitializationRecovery,xA as buildVectorizationEmbeddingIdentity,NA as buildVectorizationEmbeddingMetadata,BP as buildVerboseSearchFilters,pI as buildWorkflowCompletenessCheck,rP as buildWorkspaceMemorySnapshot,Nn as canonicalDocument,wC as canonicalizeCommandOptionKey,MR as canonicalizeContextRecencyCoordinate,NC as canonicalizeRelationshipKind,vN as censusPmRecoveryReferenceProducers,Xv as certifyCompleteListResult,lk as checkExtensionManifestCompatibility,Y_ as claim,J_ as claimNext,eI as classifyHistoryAuthorEvent,oi as classifyHistoryEvent,GI as classifyHistoryMergeReceiptReferences,PC as classifyHostEnvironmentFault,JP as classifyImplicitSemanticFallbackReason,In as classifyItemFormatVersion,cf as classifyLinkedTestCommandSafety,df as classifyLinkedTestFailure,uT as clearActiveExtensionHooks,Bd as clearDurableGraphCache,pS as clearFocusedItem,Zc as clearWorkspaceContractsCache,X_ as close,rp as closeItem,ih as closeTask,Nh as coalesceRepeatedListFlags,ZI as collectBlockedByIds,eR as collectBlockedByIdsFromCorpus,kw as collectContextUsageDeliveredItemIds,ld as collectDanglingDependencyReferences,rR as collectDependencyBlockedIds,cd as collectDuplicateDependencyRows,xd as collectDuplicateRelationshipEdgeGroups,YP as collectErrorCauseCodes,rd as collectHierarchyRelations,Rr as collectMcpHeaderAnnotations,ud as collectMissingDependencyTargetIds,np as collectNewOrderingCycleWarnings,Pd as collectOrderingCycles,dd as collectOrderingStorageContradictions,eO as collectPackageContextIntentContracts,zt as collectPackageExtensionDirectories,yT as collectRegisteredItemFieldNames,YT as collectRuntimeCreateFieldValues,KE as collectRuntimeFilterValues,JT as collectRuntimeUpdateFieldValues,Gu as collectSubtreeIds,hn as collectUsedExtensionCapabilities,EC as commandOptionFlagLabel,n_ as comments,$f as commitImportedItem,QM as commitItemCompletion,JM as commitItemMutations,Dv as commitWorkspaceTransaction,Zs as compactFlagAliasContracts,Uu as compareCriticalItems,G as comparePmDateVersions,Nv as compareRelationshipSnapshots,iC as compareTimestampStrings,uO as compileHistoryProvenanceMatcher,Bw as composeContextIntentContracts,ok as composeExtension,dk as composeExtensionPackage,nR as computeActionabilityReport,SE as computeHistoryDiff,vd as computeRelationshipCentrality,Ad as computeRelationshipDominators,pd as computeWorkspaceGraphFingerprint,__ as config,lT as consumeAfterCommandAffectedItems,Xf as context,Hw as contextIntentRowId,Q_ as copy,lf as countFailureCategories,BS as countReadOutputRows,H_ as create,FO as createAssurancePreset,SR as createAssuranceWorkspaceContext,aC as createCheckpointId,Kv as createCompleteListOptions,XC as createCoreCommandHookContext,so as createCorpusShapeMeasurement,vO as createEmptyAssuranceDocument,jC as createEmptyExtensionRegistrationRegistry,Kc as createExtensionCommandSdk,fn as createExtensionContributionInventory,Jk as createExtensionTestHarness,Ui as createHistoryEntry,YA as createLazyModule,mI as createLifecycleCompletenessPolicies,z0 as createMcpStaticBearerVerifier,T0 as createMcpTaskStore,bA as createMutationGuardSdk,TS as createOutputOmissionReceipt,Vc as createPmCliExpectedError,jh as createPmCliProgram,xi as createPmCommandOutputBudget,IS as createQueryFingerprint,By as createRelationshipGraphScaleFixture,ee as createRelationshipGraphSnapshot,Pt as createRelationshipKindRegistry,hs as createReproducibleProcessRunner,qP as createSearchCursorFingerprint,YC as createSerialQueue,LT as createStdinTokenResolver,_C as createUnknownSubcommandError,rw as createWorkflowPolicyEvaluator,um as createWorkspaceSnapshot,mk as deactivateExtensionForTest,wL as declineServiceOverride,Vw as decodeContextIntentCursor,XA as decodeHtmlEntitiesInOptions,Ir as decodeMcpHttpHeaderValue,kS as decodeQueryCursor,PS as decodeQueryCursorEnvelope,MS as decodeQueryCursorState,sw as decodeReadOutputContinuationCursor,X0 as decoratePmMcpToolsWithApps,ql as dedupeLinkedArtifacts,LR as defaultScoreContextCandidates,RL as defineAfterCommandHook,OL as defineBeforeCommandHook,IL as defineBeforeMutationHook,uL as defineCommand,yL as defineCommandOverride,Y as defineCorpusShape,fx as defineEpisodeSpecification,vL as defineExporter,tk as defineExtension,rk as defineExtensionBlueprint,dL as defineExtensionManifest,pL as defineFlag,AL as defineImporter,fL as defineItemField,mL as defineItemType,_L as defineMigration,iy as defineObservationContract,kL as defineOnIndexHook,ML as defineOnReadHook,PL as defineOnWriteHook,bL as defineParserOverride,Ni as definePmCommandOutputBudget,AM as definePmCommandOutputEnvelope,TM as definePmErrorCodeCatalog,CL as definePreflightOverride,lL as defineProjectProfile,EL as defineRendererOverride,hL as defineSearchProvider,TL as defineServiceOverride,gL as defineVectorStoreAdapter,dy as defineVerdictContract,Ae as defineWorkspaceRecipe,eh as deleteItem,gm as deleteWorkspaceSnapshot,FC as dependencyToRelationship,u_ as deps,GO as deriveAssuranceProposals,ik as deriveExtensionCapabilities,AP as derivePmBulkMutationEffect,ON as derivePmRecoveryReferenceObligations,Rd as deriveRelationshipDeadlines,pl as deriveSchemaEvolutionMigrationId,BA as deriveTelemetryCommandResolution,JE as describeAllowedTransitions,tI as describeExtensionActivation,sk as describeExtensionBlueprint,wu as describeItemOwnershipConflict,mx as describeObservationCost,er as describeProfileComposition,tr as describeProjectProfile,LM as describeUnknownError,Kn as detectAgentIdentity,Jn as detectHarnessIdentity,wd as detectRelationshipCommunities,Wn as diagnoseAgentIdentity,Ld as diffRelationshipAuditSnapshots,rf as diffTestRunMeasurements,l0 as digestMcpRequestParameters,HC as discoverExtensions,dn as discoverNearbyPmRoot,PD as discoverPmTools,Dy as discoverProjectRuntimeVersionPins,l_ as docs,o_ as duplicates,Fd as durableGraphCachePath,qd as durableGraphCacheStatus,vn as effectiveItemFormatVersion,iv as emitTelemetryErrorEvent,Df as emptyImportedDocument,CI as encodeItemScalarDecisionValue,Or as encodeMcpHttpHeaderValue,RS as encodeQueryCursor,iw as encodeReadOutputContinuationCursor,wE as enforceHistoryStreamPolicyForItem,EE as enforceHistoryStreamPolicyForItems,yM as enrichCliFlagInvocationContract,sr as enrichCliFlagInvocationContracts,cA as ensureMaterializedHistoryTarget,Jc as ensurePmGitignore,Ml as ensureScope,UA as ensureSentryInit,Lf as ensureTrackerInitialized,Td as enumerateRelationshipPaths,$i as estimatePmOutputTokens,IO as evaluateAssuranceAssertion,RO as evaluateAssuranceGate,kx as evaluateBoundaryFixtures,jR as evaluateContextRanking,wv as evaluateDefectGateEvidence,OO as evaluateMeasurement,rs as evaluateMutationGuard,Wm as evaluateProvenanceCoverage,Vm as evaluateSemanticAttributionCoverage,dp as evaluateSimilarityGovernance,YE as evaluateTransition,ly as evaluateVerdictContract,tw as evaluateWorkflowPolicies,IA as executeEmbeddingBatchesWithRetry,MA as executeVectorDelete,kA as executeVectorReset,PA as executeVectorUpsert,ty as executeWorkspaceRecipe,jl as expandAddGlobEntries,Xl as explainSourceTraceability,RP as exportAttestation,sh as extension,ch as extensionActivate,dh as extensionDeactivate,ah as extensionList,Ob as extensionMigrate,jI as extractHistoryMergeReceiptDispositions,FI as extractHistoryMergeReceiptReferences,G0 as extractMcpTraceContext,nA as extractPatchFailureContext,Ql as extractReferencedPmItemIdsFromCommand,Uy as federateRelationshipGraphSnapshots,a_ as files,c_ as filesDiscover,d_ as filesLookup,xw as finalizeContextUsageDelivery,Ty as findCoverageDeficits,cp as findDuplicateClusters,il as findGitWorkspaceRoot,HT as findHistoryIdentityDiscontinuities,hl as findInstalledNpmPackageCandidate,W0 as findPmMcpAppByUri,qo as findPmNamespacedCommand,Ed as findRedundantRelationshipEdges,Od as findRelationshipCutStructure,sp as findSimilarItems,nv as finishTelemetryCommand,pC as flattenFlagListValue,yy as flushTelemetryQueue,rh as focus,Sd as forEachMatchedRelationshipEdge,kd as formatDuplicateEdgeGroup,nd as formatHierarchyRelation,Md as formatOrderingStorageContradiction,lv as formatPmPositionalActionFlagTip,Pm as formatProfileApplyHuman,Rm as formatProfileLintHuman,Om as formatProfileListHuman,Im as formatProfileShowHuman,_l as formatSchemaEvolutionMigrationHuman,QP as formatVectorIndexRecoveryWarnings,lM as formatWorkspacePositionHuman,G_ as gc,Vi as generateItemId,Qf as get,aT as getActiveCommandResult,Gw as getActiveContextIntentContracts,yn as getActiveExtensionRegistrations,B0 as getActiveMcpTraceContext,MO as getAssuranceDeclaration,Sh as getContracts,lS as getFocusedItem,pn as getHistoryPath,Iv as getItemAt,un as getItemPath,is as getMutationActionContract,Yc as getPmGitignoreBlock,ln as getSettingsPath,Qc as getWorkspaceContracts,vE as getWorkspaceHistoryPath,p_ as graph,jd as graphAuditBaselinePath,Hm as groupHistoryByEpisode,SL as handleServiceOverride,t0 as hasMcpClientExtension,K0 as hasPmMcpAppsCapability,Ke as hasSubcommandFlagContractsForCommand,LA as hasVectorizationEmbeddingIdentityChanged,DA as hasVectorizationVectorDimensionChanged,uE as hashDocument,pE as hashDocumentForVersion,mE as hashEmptyDocument,iE as hashHistoryPatch,nE as hashHistoryRecord,sE as hashHistoryStream,TI as hashItemScalarDecisionValue,j_ as health,gd as hierarchyAncestors,yd as hierarchyDescendants,z_ as historyCompact,V_ as historyCompactBulk,VT as historyDigest,lO as historyEntryMatchesProvenance,Oe as historyItemHashVersionForRuntime,U_ as historyRedact,B_ as historyRepair,q_ as historyRepairAll,QI as indexBlockedByIds,id as indexHierarchyRelations,$A as inferConsistentVectorDimension,ki as inferPmOutputBudgetClass,f_ as init,Wv as inspectCompleteListResult,GC as inspectExtensionManifestSchema,Jd as inspectHistoryAuthorStream,RI as inspectMergeReceiptEvidence,Fy as inspectProjectRuntimeCompatibility,ps as inspectStaleInProgressItems,HI as inspectStatusRoleAssignments,OE as inspectWorkspaceHistoryState,pm as inspectWorkspaceSnapshot,ul as installMergeFence,o0 as interpretMcpResultType,Zu as isAlreadyClaimedError,FM as isCommanderError,yu as isErrnoError,gv as isExternalDependencyReference,yv as isExternalDependencySourceKind,fe as isFileMissingError,yC as isHostOutputSuppressed,bI as isItemScalarMissingValue,LI as isLegacyMergeReceiptSummary,_ as isMcpRecord,os as isMutationAction,DC as isOrderingRelationshipKind,DE as isPlaceholderReferenceToken,Hc as isPmCliExpectedError,wi as isPmExtensionCapabilityContract,Ai as isPmExtensionPolicyModeContract,vi as isPmExtensionPolicySurfaceContract,Ei as isPmExtensionServiceNameContract,wP as isPmKnownExitCode,OM as isPmMutationReceipt,Xe as isPmSuccessfulExitCode,Si as isPmToolAction,DI as isPreDurableCloneLocalReceiptSummary,$I as isPreDurableDispositionEligibleReference,$y as isProjectMutatingInvocation,JA as isPureSnakeCaseAlias,vw as isReadOutputBudgetExceeded,wS as isReadRowContract,Yd as isRuntimeRecord,ev as isTerminalPlanMode,QT as isTerminalStatus,Zo as isTimestampLiteral,XM as itemDocumentToMutationOptions,LP as itemHasSchedule,ss as jaccardSimilarity,s_ as learnings,mC as levenshteinDistanceWithinLimit,_u as limitAnnotationEntries,nu as linkedTestTrustFingerprint,ak as lintExtensionBlueprint,UC as lintExtensionManifestSchema,nr as lintProjectProfile,Yf as list,Bn as listAgentProvenanceAdapters,xh as listAliasPluralKeys,Jf as listAllComplete,gA as listAllDocumentCandidatesCached,Qi as listAllItemMetadata,yA as listAllItemMetadataLight,PO as listAssuranceDeclarations,DO as listAssuranceVerdicts,my as listBuiltinCorpusShapes,BM as listCoreClosedDomainContracts,fR as listGetProjectionFields,hI as listInvalidProvenanceHistoryStreamIds,pR as listListProjectionFields,PI as listMergeReceipts,ns as listMutationActions,iM as listMutationEvents,Ao as listPmCommandFlagBudgets,Nm as listPmCommandsForFamily,xm as listPmCommandsForTier,Ne as listPmFlagLexicon,iL as listPmFlagSpellingInventory,Lm as listPmMcpToolsForProfile,WN as listPmRequiredArgumentRefusalContracts,XN as listPmSubcommandRefusalContracts,Qt as listProfiles,ZN as listTrackerPreflightRecoveryContracts,mm as listWorkspaceSnapshots,tO as loadContextIntentRuntimeLayers,bm as loadCreateTemplateOptions,KC as loadExtensions,Vd as loadGraphAuditBaseline,dC as loadMutationCheckpoint,N as loadRelationshipGraphAdapter,Ji as locateItem,IT as looksLikeGenericKeyValueEntry,qS as mapReadOutputRows,MI as markMergeReceiptReconciled,WE as matchesRuntimeFilters,rv as maybeRunFirstUseTelemetryPrompt,hy as measureCorpusShapePlan,Ki as measureItemMetadataReadWork,AT as mergeAdditiveTags,nk as mergeExtensionBlueprints,SI as mergeHistoryStreams,vI as mergeItemDocuments,OI as mergeJsonDocuments,Lh as mergeLinkedTestTwoTokenEntries,wI as mergeRelationshipEventStreams,Ku as mergeSortedWarnings,QA as migrateItemFilesToFormat,SA as mutateItem,TA as mutateItemWithHistoryContext,PE as mutateWorkspaceJsonWithHistory,e_ as next,zn as normalizeAgentProvenanceAdapterValue,fu as normalizeAnnotationTransportOptions,gO as normalizeAssuranceEvaluation,hO as normalizeAssuranceMutation,Dh as normalizeBootstrapInvocation,jT as normalizeBulkIdsValue,ad as normalizeDependencyGraphTarget,XO as normalizeDependencySeedId,WO as normalizeDependencySourceKind,mn as normalizeExtensionContributionInventory,dS as normalizeHistoryOperationForWrite,_I as normalizeInvalidHistoryProvenance,MM as normalizeItemAddressInvocation,On as normalizeItemFormatVersion,zi as normalizeItemId,Mn as normalizeItemMetadata,YO as normalizeItemReference,kh as normalizeLegacyExtensionActionSyntax,Fl as normalizeLinkedPath,LE as normalizeParentReferenceValue,Jt as normalizeProfileName,qi as normalizeRawItemId,Sw as normalizeReadOutputIncludeModeOptions,gE as normalizeReplayPatchOps,as as normalizeSimilarityText,ZT as normalizeStatusForRegistry,Pn as normalizeStatusInput,WT as normalizeStatusInputWithRegistry,$M as normalizeThrownExitCode,i_ as notes,Jo as nowIso,Gd as openDurableGraphCache,d0 as openMcpRequestState,_x as openPmEpisode,bd as orderingPredecessors,Cd as orderingSuccessors,zR as packContextCandidates,Bu as packRankedContextItems,bh as packageActivate,yh as packageCatalog,Ch as packageDeactivate,hh as packageDescribe,fh as packageDoctor,ph as packageInstall,lh as packageLifecycle,uh as packageList,_h as packageManage,Ib as packageMigrate,gh as packageReload,mh as packageUninstall,NS as paginateQueryRows,kl as parseAddEntries,xl as parseAddGlobEntries,gu as parseAnnotationTextInput,HM as parseAtomicMutationControls,Ph as parseBootstrapCommandName,Oh as parseBootstrapGlobalOptions,Rh as parseBootstrapHelpRequest,$h as parseBootstrapTypeValue,FT as parseBulkIdsText,Fu as parseContextDepth,Nu as parseContextFocusFields,Zv as parseContextIntentDeclarations,ju as parseContextSections,WR as parseContextSignalSnapshot,OT as parseCsvKv,Av as parseDefectChangeRiskRequest,wR as parseDefectRecurrenceCoverageRequest,Ev as parseDefectRecurrencePolicy,rm as parseEvalQuerySet,Wd as parseGraphSubcommand,IP as parseHistoryAttestation,cO as parseHistoryProvenanceFilters,oO as parseIntegerLimit,eS as parseItemDocument,KM as parseItemMutationBatch,VE as parseLimit,Sp as parseLinkedTestAssertionEqualsMap,wp as parseLinkedTestAssertionGteMap,hp as parseLinkedTestBoolean,gp as parseLinkedTestContextMode,_p as parseLinkedTestEnvClear,fp as parseLinkedTestEnvSet,Ep as parseLinkedTestJsonEntries,Tp as parseLinkedTestMinLines,Cp as parseLinkedTestRegexList,bp as parseLinkedTestStringList,yp as parseLinkedTestWorkspaceContextMode,Kh as parseMcpCachePolicy,Gh as parseMcpImplementation,it as parseMcpInputRequests,hr as parseMcpInputResponses,gg as parseMcpSubscriptionFilter,Ll as parseMigrateEntries,iR as parseMultiValueFilter,IM as parseMutationReceipt,$T as parseOptionalNonNegativeInteger,DT as parseOptionalNumber,bN as parsePmAgentTaskTranscriptCorpus,RD as parsePmToolDiscoveryOptions,nO as parsePriority,cR as parsePriorityFilterSet,dw as parseReadOutputSession,bT as parseRegisteredItemFieldAssignments,de as parseRelationshipGraphSnapshot,Nl as parseRemoveEntries,Wl as parseSourceLineRange,UE as parseStatusFilterCsv,sR as parseStringFilterSet,Tn as parseTags,ef as parseTestRunMeasurements,iO as parseType,aR as parseTypeFilterSet,tl as parseUnknownAuthorHistoryEventCoordinates,XS as parseWorkflowPolicy,YS as parseWorkflowPolicyDocument,lP as partitionDecisionEntries,TE as patchPathToChangedField,Wo as pathExists,nh as pauseTask,Ud as persistDurableGraphResult,ZE as persistSelectedItemFormat,GP as planAgentIdentityVocabularyMutation,eP as planCompletedAtBackfill,vl as planExtensionDirectoryCopy,ir as planProfileApplication,wN as planRelationshipEventBackfill,Kd as planRelationshipRemediation,ml as planSchemaEvolutionMigration,Qd as planUnknownAuthorHistoryAcknowledgment,fm as planWorkspaceSnapshotRestore,mv as positionalShapeKey,fv as positionalSignatureKey,uk as preflightExtension,ds as prepareSimilarityText,MT as preserveMutationStdinTokenFields,PT as preserveMutationStdinTokenLiterals,Qw as printError,Zw as printResult,x_ as profile,D_ as profileApply,$_ as profileLint,N_ as profileList,L_ as profileShow,dT as projectAfterCommandItemSnapshot,Lu as projectContextFocusRows,Zm as projectFleetAttributionAnalytics,dO as projectHistoryProvenance,ji as projectPmDiagnosticOutput,Gi as projectPmDiagnosticText,Ym as projectProvenanceCoverageAnalytics,cu as projectValidateCounts,BO as promoteAssuranceAssertion,Mw as propagateContextUsageServingReceipt,Fx as pruneCompileCacheGenerations,kO as putAssuranceDeclaration,xO as putAssuranceDeclarationBundle,lA as queryItemMetadataIndex,uA as queryLinkedFileMetadataIndex,pA as querySimilarItemMetadataIndex,tf as queryTestRunMeasurementsBelow,ii as quoteCommandArg,ni as quoteWindowsCommandArg,UM as rankCommandPaths,hu as readAnnotationEntries,Xn as readAuthorEnvironment,hf as readBooleanOption,Fw as readContextUsageAffinity,gf as readCsvListOption,Tl as readExtensionMigrationState,Xo as readFileIfExists,Es as readFirstStringFromCommanderOptions,As as readFirstValueFromCommanderOptions,Km as readHistoryAnalyticsWindow,_S as readHistoryEntries,Qn as readHistorySnapshot,Gm as readImprovementLedger,_A as readItemMetadataDerivedIndexState,Zi as readLocatedItem,US as readOutputBudgetCollections,nw as readOutputCollectionFingerprint,GS as readOutputContinuationRowCollections,FS as readOutputContinuationRowPaths,Cw as readOutputIncludeModeOptions,jS as readOutputRowCollections,$S as readOutputRowPaths,pw as readOutputSessionRemainingTokens,qt as readPmPackageManifest,wh as readRequiredString,Hi as readSettings,QE as readSettingsWithMetadata,vs as readStringArrayFromCommanderOptions,_f as readStringOption,DM as readThrownExitCode,FA as readVectorizationStatusLedger,dA as readWorkflowPolicies,JS as readWorkflowPolicyField,Qv as readWorkspaceContextIntentContracts,ZR as readWorkspaceContextSignals,oP as readWorkspaceMemory,dM as readWorkspacePosition,CE as reanchorHistoryEntries,gn as reconcileExtensionCapabilityUsage,kE as reconcileWorkspaceJsonHistory,cT as recordAfterCommandAffectedItem,LO as recordAssuranceVerdict,Ru as recordClaimSemanticAttribution,Lw as recordContextUsageDelivery,Nw as recordContextUsageServing,Dw as recordContextUsageTouch,$w as recordContextUsageTouches,Mu as recordFocusSemanticAttribution,jm as recordImprovementObservation,Pu as recordReleaseSemanticAttribution,hA as refreshItemMetadataDerivedIndex,dl as refreshMergeAttributeFenceIfInstalled,GA as refreshSearchArtifactsForMutation,qn as registerAgentProvenanceAdapters,HO as registerExternalDependencyResolver,Un as registerHarnessSignalDescriptors,hS as registerOutputMaterialFieldGroups,Z_ as release,NO as removeAssuranceDeclaration,Yo as removeFileIfExists,Hl as renameArtifactsResultKey,Au as renderCalendarMarkdown,vu as renderCalendarToon,Wu as renderContextMarkdown,bl as renderExtensionDescribeMarkdown,gl as renderExtensionSurfaceMarkdown,Gf as renderGuideMarkdown,NM as renderMissingOptionRetry,uP as renderNextMarkdown,qM as renderPmClosedDomainHelp,si as renderPmCommand,Ko as renderPmCommandAliasMigrationHint,Fm as renderPmCommandVisibilityMarkdown,aL as renderPmFlagLexiconMarkdown,Y0 as renderPmMcpAppHtml,DN as renderPmRefusalClosureCensusMarkdown,qE as renderRowsAsCsv,zE as renderRowsAsTable,W_ as reopen,aA as replayHistoryToTarget,_E as replayToCanonicalItemDocument,fE as replayToItemDocument,cS as requireHistoryOperation,fP as requireTerminalReason,_P as requireTerminalReasonWithRecovery,dE as resealHistoryRewrite,nT as resetActiveExtensionRuntimeState,_d as resetWorkspaceGraphCache,Dn as resolveAgentSessionContextFromSignals,Su as resolveAnnotationIndex,bu as resolveAnnotationInput,fS as resolveAuthor,Zn as resolveAuthorIdentity,NE as resolveBodyFileContent,fy as resolveBuiltinCorpusShape,Eu as resolveCalendarOutputFormat,SM as resolveCanonicalPmErrorCodeContract,LC as resolveCanonicalRelationshipKind,mS as resolveClaimPrincipal,GT as resolveCliBulkIdsInput,OC as resolveCommandOptionPolicyState,$x as resolveCompileCacheGeneration,QR as resolveCompletionTimestamp,TC as resolveConfiguredPmPackageRoot,hR as resolveContentFieldFilters,qw as resolveContextIntentContract,Du as resolveContextOutputFormat,$u as resolveContextTokenBudget,yP as resolveCreateExplicitEmptyFlag,HP as resolveEffectiveSearchMode,wA as resolveEmbeddingProviders,Ol as resolveExtensionInstallSourceIdentity,Cl as resolveExtensionMigrationStatePath,VC as resolveExtensionRoots,KO as resolveExternalDependencyReference,uC as resolveFlagValueKind,Ff as resolveGuideOutputFormat,Um as resolveHistoryEpisodeGroupIdentity,zT as resolveHistoryHashAlgorithm,aS as resolveHistoryOperation,aO as resolveHistoryProvenanceDimensions,vv as resolveHistorySubject,iA as resolveHistoryTarget,WP as resolveHybridSemanticWeight,cn as resolveImplicitPmRoot,sC as resolveIsoOrRelative,tR as resolveItemBlockers,YI as resolveItemExecutionRole,WM as resolveItemMutationDocument,an as resolveItemTypeRegistry,KT as resolveItemTypesFilePath,uf as resolveLinkedTestFailureExitCode,eu as resolveLinkedTestSourceRef,tu as resolveLinkedTestSourceWorkspaceRoot,iu as resolveLinkedTestTrust,su as resolveLinkedTestTrustBatch,yg as resolveMcpAcknowledgedSubscriptionFilter,tt as resolveMcpRequestContext,nl as resolveMergeInstallContext,_R as resolveMissingMetadataFilters,xM as resolveMissingOptionPlaceholder,SS as resolveModePairedOutputOmissionReceipt,cP as resolveNextOutputFormat,AS as resolveOutputOmissionReceipt,CC as resolvePmCliVersion,Ho as resolvePmCommandAlias,Ze as resolvePmCommandCapabilityFamily,Kt as resolvePmCommandExitContract,V as resolvePmCommandOperation,Di as resolvePmCommandOutputBudget,cr as resolvePmCommandOutputEnvelope,cv as resolvePmCommandPositionalContract,Qe as resolvePmCommandVisibilityTier,Fi as resolvePmDiagnosticOutputBudget,wM as resolvePmErrorCodeContract,wb as resolvePmFlagSemanticConcept,Fe as resolvePmHistoryOperation,bC as resolvePmPackageRootFromModule,dv as resolvePmPositionalActionContract,Mc as resolvePmPositionalActionFlagContracts,Ge as resolvePmRoot,Nc as resolvePmToolCustomFieldCollision,jE as resolvePriority,Zt as resolveProfile,al as resolveProjectMergeTypeFolders,xS as resolveQueryCursorStart,ww as resolveReadOutputDimensions,Ow as resolveReadOutputEncoding,VS as resolveReadOutputRecoveryBudget,yw as resolveReadOutputSurface,ES as resolveReadRowContract,kM as resolveRecoveryCommandName,TT as resolveRegisteredSearchProvider,ST as resolveRegisteredVectorStoreAdapter,_s as resolveReproducibleProcessEnvironment,wn as resolveRuntimeFieldRegistry,Sn as resolveRuntimeStatusRegistry,EA as resolveSearchCorpusFields,VP as resolveSearchMaxResults,zP as resolveSearchPage,KP as resolveSearchScoreThreshold,XP as resolveSearchTuning,vA as resolveSemanticCorpusCharacterLimit,Iu as resolveSemanticLineageIds,tA as resolveSettingsWithSemanticRuntimeDefaults,nI as resolveSourceContextWritePolicy,Op as resolveStartTaskInProgressStatus,re as resolveSubcommandFlagContractsForCommand,eC as resolveTelemetryErrorCategory,mP as resolveTerminalReason,vC as resolveTypeDefinition,AC as resolveTypeName,BE as resolveTypeSynonym,XE as resolveTypeWorkflows,el as resolveUnknownAuthorAcknowledgmentSelector,ZP as resolveVectorIndexRecovery,RA as resolveVectorStores,td as resolveWorkspaceRelationshipKindRegistry,RC as resolveWorkspaceRoot,th as restore,lC as restoreCheckpointItems,xE as restoreWorkspaceJsonFromHistory,hm as restoreWorkspaceSnapshot,_m as restoreWorkspaceSnapshotWithRecovery,Ah as runAction,pT as runActiveBeforeMutationHooks,fT as runActiveCommandHandler,mT as runActiveOnIndexHooks,Cn as runActiveOnReadHooks,bn as runActiveOnWriteHooks,_T as runActiveParserOverride,hT as runActivePreflightOverride,gT as runActiveServiceOverride,ed as runActivity,zC as runAfterCommandHooks,pu as runAggregate,Tu as runAnnotationCommand,mu as runAppend,OR as runAssuranceAction,IR as runAssuranceDispatch,qC as runBeforeCommandHooks,Ou as runCalendar,Qu as runClaim,ep as runClaimNext,op as runClose,kp as runCloseMany,Pp as runCloseTask,xp as runComments,Uf as runCompletion,Vp as runConfig,Ht as runContext,BR as runContextEvaluationCorpus,GR as runContextEvaluationScenario,Gp as runCopy,Ap as runCreate,Up as runDelete,hd as runDeps,Kl as runDocs,RM as runDuplicates,im as runEval,am as runEvent,Il as runExtension,El as runExtensionMigrateAction,wl as runExtensionMigrations,Yl as runFiles,Zl as runFilesDiscover,Jl as runFilesLookup,Jm as runFleetAttributionAnalytics,Bp as runFocus,zp as runGc,qp as runGet,Xd as runGraph,jf as runGuide,Rl as runHealth,vP as runHistory,MP as runHistoryAttest,mM as runHistoryCompact,hM as runHistoryCompactBulk,UI as runHistoryMaintenance,pM as runHistoryRedact,qI as runHistoryRepair,VI as runHistoryRepairAll,Zp as runInit,Xp as runInitAgentGuidance,Np as runLearnings,Vl as runLinkedArtifacts,pf as runLinkedTests,uu as runList,sm as runMeet,rM as runMergeDriver,ll as runMergeInstall,xI as runMergeReceiptEvidenceReport,kI as runMergeReceiptReport,oM as runMergeReconcile,Ju as runNext,Lp as runNotes,Rp as runPauseTask,jp as runPlan,vm as runProfileApply,Am as runProfileLint,wm as runProfileList,Em as runProfileShow,Xm as runProvenanceCoverageAnalytics,fk as runRegisteredCommandForTest,bk as runRegisteredCommandOverrideForTest,vk as runRegisteredExporterForTest,hk as runRegisteredHookForTest,Ak as runRegisteredImporterForTest,Ek as runRegisteredMigrationForTest,_k as runRegisteredMutationGuardForTest,gk as runRegisteredParserOverrideForTest,yk as runRegisteredPreflightOverrideForTest,Ck as runRegisteredRendererOverrideForTest,Sk as runRegisteredSearchProviderForTest,Tk as runRegisteredServiceOverrideForTest,wk as runRegisteredVectorStoreAdapterForTest,dr as runReindex,tp as runRelease,cm as runRemind,gM as runReopen,Mp as runRestore,fl as runSchemaEvolutionMigration,om as runSearch,gy as runSearchRefreshWorkerEntrypoint,Bf as runStartBackgroundRun,Ip as runStartTask,of as runStats,sf as runTelemetry,Tm as runTemplatesList,Cm as runTemplatesSave,Sm as runTemplatesShow,mf as runTest,ff as runTestAll,qf as runTestRunsList,Vf as runTestRunsLogs,Kf as runTestRunsResume,zf as runTestRunsStatus,Hf as runTestRunsStop,Wf as runTestRunsWorker,vp as runUpdate,Dp as runUpdateMany,Wt as runUpgrade,lu as runValidate,Eh as runWithActiveExtensions,D as runWithAgentSessionContext,Uw as runWithContextIntentContracts,rO as runWithDiscoveredContextIntentContracts,Vn as runWithHarnessDetectionSignals,U0 as runWithMcpTraceContext,gs as runWithReproducibleProcessEnvironment,Hn as runWithWorkspaceHarnessSignalDescriptors,Zr as runWithWorkspaceRecipe,fI as runWorkflowPolicyAction,FP as runWorkspaceTransactionGc,Hd as saveGraphAuditBaseline,ZO as scanExtensionHostVersions,Zd as scanHistoryAuthorAttribution,Rn as scanItemFormatVersions,ts as scanMutationSecrets,gI as scanProvenanceResolverHealth,ms as scanStaleInProgressItems,XI as scanStorageIntegrity,h_ as schema,w_ as schemaAddField,T_ as schemaAddStatus,b_ as schemaAddType,O_ as schemaApplyPreset,I_ as schemaInferTypes,g_ as schemaList,A_ as schemaListFields,M_ as schemaRemapStatus,E_ as schemaRemoveField,S_ as schemaRemoveStatus,C_ as schemaRemoveType,P_ as schemaRenameField,R_ as schemaRenameType,y_ as schemaShow,v_ as schemaShowField,k_ as schemaShowStatus,GM as scoreCommandPathMatch,DR as scoreContextCandidates,$R as scoreContextCandidatesWithActiveExtensions,ls as scoreItemSimilarity,YN as scorePmGrammarRefusalClosure,jN as scorePmRefusalClosure,us as scorePreparedItemSimilarity,QN as scoreTrackerPreflightRecoveryClosure,aE as sealHistoryRecord,c0 as sealMcpRequestState,Zf as search,sP as searchWorkspaceMemory,aP as searchWorkspaceMemoryReadResult,oR as selectActionableEntries,OS as selectCursorSemanticOptions,Nf as selectImportAuthor,D0 as selectMcpClientRegistrationMode,iP as selectWorkspaceMemory,nP as selectWorkspaceMemoryRollups,xu as semanticAttributionAffinity,HA as sentryCaptureCliError,VA as sentryFinishCommandSpan,WA as sentryFlush,KA as sentryLogCliUsageError,qA as sentrySetCommandContext,zA as sentryStartCommandSpan,xn as serializeItemDocument,zM as serializeNdjsonRows,VM as serializeNdjsonStream,sy as serveDeclaredObservation,iT as setActiveCommandContext,sT as setActiveCommandResult,ZC as setActiveExtensionCommands,JC as setActiveExtensionHooks,QC as setActiveExtensionParsers,eT as setActiveExtensionPreflight,oT as setActiveExtensionRegistrations,rT as setActiveExtensionRenderers,tT as setActiveExtensionServices,uS as setFocusedItem,tv as shouldCompletePlanOnClose,zd as shouldPersistDurableGraphCache,NT as shouldResolveMutationStdinTokenField,xT as shouldResolveMutationStdinTokens,oA as shouldRunSearchRefreshInForeground,ip as similarityAdvisoryWarnings,DS as sliceReadOutputRowCollection,Bl as sortLinkedArtifacts,wT as splitAcceptanceCriteria,ZA as splitCommaList,kn as splitFrontMatter,Ew as stabilizeReadOutputReceiptEstimates,P as stableStringify,BC as stableValueEquals,oh as startTask,ov as startTelemetryCommand,r_ as stats,XT as statusIsTerminal,Ih as stripGlobalBootstrapTokens,sM as subscribeMutationEventBatches,aM as subscribeMutationEvents,jP as summarizeAgentIdentityVocabulary,qm as summarizeAgentModelProvenance,zm as summarizeAgentProvenance,UR as summarizeContextEvaluationReports,af as summarizeContextPreflight,pO as summarizeHistoryProvenance,Yp as summarizeInitResult,II as summarizeMergeReceipt,bP as supportsCreateExplicitEmpty,PM as supportsItemIdAlias,gC as suppressHostOutput,Me as syncRelationshipGraphAdapter,ck as synthesizeExtensionManifest,kc as toCompletionFlagString,Hu as toContextFocusItem,qu as toContextPackingSummary,zu as toContextRankingSummary,rC as toErrorMessage,bf as toEstimatedMinutesValue,Bv as toExtensionFlagDefinitions,Ef as toImportBoolean,If as toImportConfidence,wf as toImportInteger,kf as toImportLinkedDocs,Mf as toImportLinkedFiles,xf as toImportLinkedTests,Pf as toImportLogEntries,Rf as toImportNormalizedEnum,Of as toImportNumberMap,Cf as toImportPriority,Sf as toImportStatus,Af as toImportStringList,vf as toImportStringMap,Tf as toImportTags,tS as toItemRecord,yf as toNonEmptyImportString,tC as toNonEmptyStringOrUndefined,hE as toReplayDocument,cs as tokenizeSimilarityText,kT as transferMutationStdinTokenPolicy,MC as translateHostEnvironmentFault,K_ as update,Th as upgrade,F_ as validate,wO as validateAssertionDefinition,AO as validateAssuranceDocument,EO as validateGateDefinition,YM as validateItemMutationRows,zl as validateLinkedPaths,$0 as validateMcpAuthorizationResponseIssuer,L0 as validateMcpAuthorizationServerMetadata,F0 as validateMcpClientMetadataDocument,O0 as validateMcpHttpRequestHeaders,p0 as validateMcpJsonSchema,SO as validateMeasurementDefinition,$E as validateMissingParentReference,bw as validateReadOutputOptions,GE as validateSprintOrReleaseValue,IC as validateTypeOptions,PP as verifyAttestation,bM as verifyCliFlagInvocationParity,pv as verifyExplicitPositionalSlotCensus,bE as verifyHistoryChain,yE as verifyHistoryChainWithVersion,Ov as verifyHistoryEntries,cE as verifyHistoryRecordHash,lE as verifyHistoryRewriteEvidence,hv as verifyPmCliGrammar,_v as verifyPmCommandPositionalContracts,sL as verifyPmFlagLexicon,PN as verifyPmRecoveryKindRuntimeCoverage,mb as verifyPmRecoveryProducerRuntimeCoverage,RN as verifyPmRecoveryReferences,NN as verifyPmRefusalClosureIdentityRatchet,xN as verifyPmRefusalClosureRatchet,IN as verifyPmRefusalReachability,xs as verifyToolOptionCliParity,Js as withFlagAliasMetadata,kC as withHostEnvironmentBoundary,u0 as withMcpCachePolicy,QS as workflowApprovalFingerprint,ew as workflowPolicyApplies,ZS as workflowPolicyFingerprint,fd as workspaceGraphCache,Cu as wrapOwnershipConflict,jM as wrapThrownErrorForSentry,Yn as writeAuthorEnvironment,je as writeFileAtomic,cC as writeMutationCheckpoint,eA as writeSettings,Jw as writeStderr,Yw as writeStdout,jA as writeVectorizationStatusLedger,ME as writeWorkspaceJsonWithHistory};
|
|
33
33
|
//# sourceMappingURL=sdk.js.map
|