@unbrained/pm-cli 2026.9.1 → 2026.9.2
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 +10 -0
- package/dist/cli-bundle/bundle-manifest.json +59 -59
- package/dist/cli-bundle/chunks/{chunk-2MC2LCXZ.js → chunk-FZ4Z2J4F.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-6XIIGE7U.js → chunk-T6H5BZCP.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-U45JXJCC.js → chunk-UDW64J2W.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-ZLJIFSOE.js +35 -0
- package/dist/cli-bundle/chunks/{register-mutation-2MVLRS3J.js → register-mutation-WFQ7MJTX.js} +2 -2
- package/dist/cli-bundle/chunks/{register-operations-WCIDXBU3.js → register-operations-JVTI7JPP.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-FWPLDEXF.js → chunk-242AXYB2.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-Y6JJIX6I.js → chunk-O67VDLOT.js} +48 -48
- package/dist/cli-bundle/main.js +2 -2
- package/dist/cli-bundle/sdk-contracts.js +1 -1
- package/dist/cli-bundle/sdk-core.js +1 -1
- package/dist/cli-bundle/sdk-governance.js +1 -1
- package/dist/cli-bundle/sdk-merge.js +32 -32
- package/dist/cli-bundle/sdk-runtime.js +1 -1
- package/dist/cli-bundle/sdk-testing.js +1 -1
- package/dist/cli-bundle/sdk.js +1 -1
- package/dist/core/diagnostics/remediation.js +9 -4
- package/dist/sdk/generated/generated-error-code-catalog-part-1.js +14 -2
- package/dist/sdk/governance/health.js +77 -11
- package/dist/sdk/governance/validate.js +4 -2
- package/dist/sdk/merge/index.d.ts +1 -1
- package/dist/sdk/merge/index.js +2 -2
- package/dist/sdk/merge/receipts.d.ts +24 -0
- package/dist/sdk/merge/receipts.js +122 -30
- package/docs/CONTEXT_RECOVERY_PRIMITIVES.md +11 -2
- package/docs/MERGE_SAFETY.md +16 -2
- package/docs/generated/REFUSAL_CLOSURE_CENSUS.md +4 -3
- package/marketplace.json +2 -2
- package/package.json +1 -1
- package/packages/pm-beads/package.json +1 -1
- package/packages/pm-calendar/package.json +1 -1
- package/packages/pm-command-kit/package.json +1 -1
- package/packages/pm-digital-twin/package.json +1 -1
- package/packages/pm-governance-audit/package.json +1 -1
- package/packages/pm-guide-shell/package.json +1 -1
- package/packages/pm-kanban/package.json +1 -1
- package/packages/pm-lifecycle-hooks/package.json +1 -1
- package/packages/pm-linked-test-adapters/package.json +1 -1
- package/packages/pm-search-advanced/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/sdk/public-surface.json +29 -6
- package/dist/cli-bundle/chunks/chunk-ALKKAUFN.js +0 -35
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{$a as Fb,$b as Kc,Aa as eb,Ab as jc,Ac as jd,Ba as fb,Bb as kc,Bc as kd,C as Sa,Ca as gb,Cb as lc,Cc as ld,Da as hb,Db as mc,Dc as md,Ea as ib,Eb as nc,Ec as nd,Fa as jb,Fb as oc,Fc as od,Ga as kb,Gb as pc,Gc as pd,Ha as lb,Hb as qc,Hc as qd,Ia as mb,Ib as rc,Ja as nb,Jb as sc,Ka as ob,Kb as tc,La as pb,Lb as uc,M as Ua,Ma as qb,Mb as vc,N as Va,Na as rb,Nb as wc,O as Wa,Oa as sb,Ob as xc,Pa as tb,Pb as yc,Qa as ub,Qb as zc,Ra as vb,Rb as Ac,Sa as wb,Sb as Bc,Ta as xb,Tb as Cc,Ua as yb,Ub as Dc,Va as zb,Vb as Ec,Wa as Ab,Wb as Fc,Xa as Bb,Xb as Gc,Ya as Cb,Yb as Hc,Za as Db,Zb as Ic,_a as Eb,_b as Jc,a as oa,ab as Lb,ac as Lc,b as pa,bb as Mb,bc as Mc,c as qa,cb as Nb,cc as Nc,db as Ob,dc as Oc,eb as Pb,ec as Pc,fb as Qb,fc as Qc,gb as Rb,gc as Rc,hb as Sb,hc as Sc,ia as Za,ib as Tb,ic as Tc,ja as _a,jb as Ub,jc as Uc,ka as $a,kb as Vb,kc as Vc,la as ab,lb as Wb,lc as Wc,mb as Xb,mc as Xc,n as va,nb as Yb,nc as Yc,ob as Zb,oc as Zc,p as wa,pb as _b,pc as _c,q as xa,qb as $b,qc as $c,r as ya,rb as ac,rc as ad,s as za,sb as bc,sc as bd,t as Aa,tb as cc,tc as cd,u as Ba,ub as dc,uc as dd,vb as ec,vc as ed,wb as fc,wc as fd,xb as gc,xc as gd,yb as hc,yc as hd,za as bb,zb as ic,zc as id}from"./chunks/chunk-
|
|
1
|
+
import{$a as Fb,$b as Kc,Aa as eb,Ab as jc,Ac as jd,Ba as fb,Bb as kc,Bc as kd,C as Sa,Ca as gb,Cb as lc,Cc as ld,Da as hb,Db as mc,Dc as md,Ea as ib,Eb as nc,Ec as nd,Fa as jb,Fb as oc,Fc as od,Ga as kb,Gb as pc,Gc as pd,Ha as lb,Hb as qc,Hc as qd,Ia as mb,Ib as rc,Ja as nb,Jb as sc,Ka as ob,Kb as tc,La as pb,Lb as uc,M as Ua,Ma as qb,Mb as vc,N as Va,Na as rb,Nb as wc,O as Wa,Oa as sb,Ob as xc,Pa as tb,Pb as yc,Qa as ub,Qb as zc,Ra as vb,Rb as Ac,Sa as wb,Sb as Bc,Ta as xb,Tb as Cc,Ua as yb,Ub as Dc,Va as zb,Vb as Ec,Wa as Ab,Wb as Fc,Xa as Bb,Xb as Gc,Ya as Cb,Yb as Hc,Za as Db,Zb as Ic,_a as Eb,_b as Jc,a as oa,ab as Lb,ac as Lc,b as pa,bb as Mb,bc as Mc,c as qa,cb as Nb,cc as Nc,db as Ob,dc as Oc,eb as Pb,ec as Pc,fb as Qb,fc as Qc,gb as Rb,gc as Rc,hb as Sb,hc as Sc,ia as Za,ib as Tb,ic as Tc,ja as _a,jb as Ub,jc as Uc,ka as $a,kb as Vb,kc as Vc,la as ab,lb as Wb,lc as Wc,mb as Xb,mc as Xc,n as va,nb as Yb,nc as Yc,ob as Zb,oc as Zc,p as wa,pb as _b,pc as _c,q as xa,qb as $b,qc as $c,r as ya,rb as ac,rc as ad,s as za,sb as bc,sc as bd,t as Aa,tb as cc,tc as cd,u as Ba,ub as dc,uc as dd,vb as ec,vc as ed,wb as fc,wc as fd,xb as gc,xc as gd,yb as hc,yc as hd,za as bb,zb as ic,zc as id}from"./chunks/chunk-FZ4Z2J4F.js";import"./chunks/chunk-Y7VOMSZT.js";import{C as Ya,b as Da,j as Xa}from"./chunks/chunk-X4RCGLTX.js";import{$d as Hb,Ib as Ma,Jb as Na,Kb as Oa,Mb as Pa,Nb as Qa,Nd as cb,Ob as Ra,Od as db,_d as Gb,ae as Ib,be as Jb,ce as Kb,xc as Ta}from"./chunks/chunk-ZLJIFSOE.js";import{c as ra,d as sa,f as ta,g as ua}from"./chunks/chunk-TAG4VC22.js";import{Cc as La,gc as Ia,ob as Ca,pb as Ea,qb as Fa,rb as Ga,sb as Ha,xc as Ja,yc as Ka}from"./chunks/chunk-GOACULJW.js";import{$c as y,Ac as v,Ai as ia,Bi as ja,C as e,Cd as z,E as f,Ed as A,Jc as w,Jd as B,Kd as C,Lc as x,Ld as D,Lf as N,Md as E,Mf as O,Nd as F,Nf as P,Oa as p,Od as G,Of as Q,Pd as H,Pf as R,Qf as S,R as g,Rd as I,Rf as T,S as h,Sf as U,Td as J,Tf as V,Tg as $,Ua as q,Ud as K,Uf as W,Ug as aa,Vf as X,Wa as r,Wd as L,Wf as Y,Xd as M,Xf as Z,Yf as _,Za as s,_a as t,ab as u,c as a,f as b,g as c,gi as fa,h as d,la as i,lh as ba,ma as j,na as k,ra as l,ta as m,ua as n,va as o,vj as ka,wj as la,xh as ca,xj as ma,yh as da,yi as ga,zh as ea,zi as ha,zj as na}from"./chunks/chunk-NOPL37X4.js";export{B as BASELINE_ITEM_FORMAT_VERSION,i as BUILTIN_ITEM_TYPE_VALUES,o as CONFIDENCE_TEXT_VALUES,Ia as CONTEXT_OUTPUT_VALUES,C as CURRENT_ITEM_FORMAT_VERSION,Ma as DEFAULT_TERMINAL_TRANSITION_POLICY,l as DEPENDENCY_KIND_VALUES,e as EXIT_CODE,n as ISSUE_SEVERITY_VALUES,j as ITEM_TYPE_VALUES,Ka as NEXT_OUTPUT_VALUES,oa as PM_CLI_EXPECTED_ERROR_NAME,V as PM_COMMAND_OUTPUT_BUDGET_CONTRACTS,Q as PM_DIAGNOSTIC_DEGRADATION_STEPS,R as PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS,P as PM_DIAGNOSTIC_OUTPUT_CLASSES,sa as PM_GITIGNORE_END,ra as PM_GITIGNORE_START,O as PM_OUTPUT_BUDGET_CLASSES,N as PM_OUTPUT_DEGRADATION_STEPS,f as PmCliError,Lb as PmClient,wa as PmCompleteListValidationError,m as RISK_VALUES,va as SEARCH_EXTENSION_FLAG_DEFINITIONS,k as STATUS_VALUES,ba as acquireLock,Sb as aggregate,qd as analyzeSdkActionCoverage,cc as append,aa as appendHistoryEntry,Pa as applyTerminalOrderingPolicy,Aa as assertCompleteListResult,M as canonicalDocument,za as certifyCompleteListResult,Nc as claim,Oc as claimNext,F as classifyItemFormatVersion,Ba as clearWorkspaceContractsCache,Mc as close,Qa as closeItem,Wc as closeTask,Vb as comments,Ab as commitImportedItem,ec as config,Mb as context,Qc as copy,Jc as create,xa as createCompleteListOptions,$ as createHistoryEntry,pa as createPmCliExpectedError,T as createPmCommandOutputBudget,U as definePmCommandOutputBudget,Rc as deleteItem,ac as deps,$b as docs,Ub as duplicates,D as effectiveItemFormatVersion,zb as emptyImportedDocument,ua as ensurePmGitignore,yb as ensureTrackerInitialized,X as estimatePmOutputTokens,Xc as extension,Zc as extensionActivate,_c as extensionDeactivate,Yc as extensionList,Yb as files,Zb as filesDiscover,_b as filesLookup,Tc as focus,Dc as gc,ea as generateItemId,Qb as get,v as getActiveExtensionRegistrations,md as getContracts,u as getHistoryPath,t as getItemPath,ta as getPmGitignoreBlock,s as getSettingsPath,ld as getWorkspaceContracts,bc as graph,Cc as health,Hc as historyCompact,Ic as historyCompactBulk,Ec as historyRedact,Fc as historyRepair,Gc as historyRepairAll,S as inferPmOutputBudgetClass,dc as init,ya as inspectCompleteListResult,qa as isPmCliExpectedError,I as isTerminalStatus,h as isTimestampLiteral,ka as jaccardSimilarity,Xb as learnings,Nb as list,Ob as listAllComplete,ia as listAllItemMetadata,ja as listAllItemMetadataLight,Za as loadCreateTemplateOptions,ga as locateItem,Rb as next,E as normalizeItemFormatVersion,da as normalizeItemId,J as normalizeItemMetadata,ca as normalizeRawItemId,la as normalizeSimilarityText,H as normalizeStatusInput,Wb as notes,g as nowIso,id as packageActivate,hd as packageCatalog,jd as packageDeactivate,fd as packageDescribe,dd as packageDoctor,bd as packageInstall,$c as packageLifecycle,ad as packageList,ed as packageManage,gd as packageReload,cd as packageUninstall,y as parseTags,a as pathExists,Vc as pauseTask,wc as profile,zc as profileApply,Ac as profileLint,xc as profileList,yc as profileShow,Z as projectPmDiagnosticOutput,_ as projectPmDiagnosticText,fb as readBooleanOption,gb as readCsvListOption,b as readFileIfExists,ha as readLocatedItem,nd as readRequiredString,fa as readSettings,eb as readStringOption,Pc as release,d as removeFileIfExists,Fa as renderCalendarMarkdown,Ga as renderCalendarToon,Db as renderGuideMarkdown,Lc as reopen,Oa as requireTerminalReason,Ea as resolveCalendarOutputFormat,Bb as resolveGuideOutputFormat,q as resolveImplicitPmRoot,p as resolveItemTypeRegistry,W as resolvePmCommandOutputBudget,Y as resolvePmDiagnosticOutputBudget,r as resolvePmRoot,A as resolveRuntimeFieldRegistry,z as resolveRuntimeStatusRegistry,Na as resolveTerminalReason,Sc as restore,pd as runAction,x as runActiveOnReadHooks,w as runActiveOnWriteHooks,Da as runAggregate,Ha as runCalendar,Ra as runClose,Eb as runCompletion,Ja as runContext,Ua as runCopy,Va as runDelete,db as runDuplicates,Wa as runFocus,Xa as runGet,Cb as runGuide,Ca as runList,La as runNext,Fb as runReindex,bb as runReopen,Sa as runRestore,Ya as runSearch,cb as runStats,$a as runTemplatesList,_a as runTemplatesSave,ab as runTemplatesShow,Gb as runTestRunsList,Ib as runTestRunsLogs,Kb as runTestRunsResume,Hb as runTestRunsStatus,Jb as runTestRunsStop,Ta as runUpdate,od as runWithActiveExtensions,G as scanItemFormatVersions,fc as schema,mc as schemaAddField,kc as schemaAddStatus,ic as schemaAddType,qc as schemaApplyPreset,rc as schemaInferTypes,gc as schemaList,oc as schemaListFields,uc as schemaRemapStatus,nc as schemaRemoveField,lc as schemaRemoveStatus,jc as schemaRemoveType,tc as schemaRenameField,sc as schemaRenameType,hc as schemaShow,pc as schemaShowField,vc as schemaShowStatus,na as scoreItemSimilarity,Pb as search,xb as selectImportAuthor,L as serializeItemDocument,K as splitFrontMatter,Uc as startTask,Tb as stats,ib as toEstimatedMinutesValue,nb as toImportBoolean,rb as toImportConfidence,mb as toImportInteger,vb as toImportLinkedDocs,ub as toImportLinkedFiles,wb as toImportLinkedTests,tb as toImportLogEntries,sb as toImportNormalizedEnum,qb as toImportNumberMap,jb as toImportPriority,lb as toImportStatus,ob as toImportStringList,pb as toImportStringMap,kb as toImportTags,hb as toNonEmptyImportString,ma as tokenizeSimilarityText,Kc as update,kd as upgrade,Bc as validate,c as writeFileAtomic};
|
|
2
2
|
//# sourceMappingURL=sdk-runtime.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{A as t,B as u,C as v,D as w,E as x,F as y,G as z,H as A,I as B,J as C,K as D,L as E,M as F,N as G,O as H,P as I,Q as J,R as K,S as L,T as M,U as N,V as O,W as P,X as Q,Y as R,f as c,g as d,l as e,m as f,n as g,o as h,p as i,q as j,r as k,s as l,t as m,u as n,v as o,w as p,x as q,y as r,z as s}from"./chunks/chunk-
|
|
1
|
+
import{A as t,B as u,C as v,D as w,E as x,F as y,G as z,H as A,I as B,J as C,K as D,L as E,M as F,N as G,O as H,P as I,Q as J,R as K,S as L,T as M,U as N,V as O,W as P,X as Q,Y as R,f as c,g as d,l as e,m as f,n as g,o as h,p as i,q as j,r as k,s as l,t as m,u as n,v as o,w as p,x as q,y as r,z as s}from"./chunks/chunk-UDW64J2W.js";import"./chunks/chunk-FZ4Z2J4F.js";import"./chunks/chunk-Y7VOMSZT.js";import"./chunks/chunk-X4RCGLTX.js";import"./chunks/chunk-ZLJIFSOE.js";import{h as a,ua as b}from"./chunks/chunk-TAG4VC22.js";import"./chunks/chunk-GOACULJW.js";import"./chunks/chunk-NOPL37X4.js";export{e as activateExtensionForTest,M as assertExtensionBlueprint,L as assertExtensionCapabilityUsage,t as assertExtensionDeactivated,P as assertExtensionManifestCompatible,O as assertExtensionManifestMatchesBlueprint,Q as assertExtensionPreflight,u as assertPackageManifest,N as assertProjectProfile,v as assertRegisteredCommandContract,F as assertRegisteredCommandOverride,B as assertRegisteredExporter,w as assertRegisteredFlags,x as assertRegisteredHook,A as assertRegisteredImporter,C as assertRegisteredItemField,D as assertRegisteredItemType,K as assertRegisteredMigration,G as assertRegisteredParserOverride,H as assertRegisteredPreflightOverride,E as assertRegisteredProfile,I as assertRegisteredRendererOverride,y as assertRegisteredSearchProvider,J as assertRegisteredServiceOverride,z as assertRegisteredVectorStoreAdapter,R as createExtensionTestHarness,f as deactivateExtensionForTest,a as describeExtensionActivation,c as describeExtensionBlueprint,d as lintExtensionBlueprint,b as renderExtensionSurfaceMarkdown,g as runRegisteredCommandForTest,l as runRegisteredCommandOverrideForTest,s as runRegisteredExporterForTest,i as runRegisteredHookForTest,r as runRegisteredImporterForTest,q as runRegisteredMigrationForTest,h as runRegisteredMutationGuardForTest,j as runRegisteredParserOverrideForTest,k as runRegisteredPreflightOverrideForTest,m as runRegisteredRendererOverrideForTest,o as runRegisteredSearchProviderForTest,n as runRegisteredServiceOverrideForTest,p as runRegisteredVectorStoreAdapterForTest};
|
|
2
2
|
//# sourceMappingURL=sdk-testing.js.map
|
package/dist/cli-bundle/sdk.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{A as wI,B as ph,C as fh,D as EI,E as AI,a as Xi,b as Yi,c as Ji,d as Zi,e as mI,f as _I,g as Yt,h as th,i as rh,j as nh,l as oh,m as ih,n as sh,o as ah,p as ch,q as dh,r as uh,s as lh,t as hI,u as gI,v as yI,w as bI,x as CI,y as TI,z as SI}from"./chunks/chunk-DTGWEL23.js";import{A as lP,B as pP,C as fP,D as mP,E as _P,F as hP,G as gP,H as yP,I as bP,J as CP,K as TP,L as SP,M as wP,N as EP,O as AP,P as xP,Q as RP,R as OP,S as IP,T as PP,U as MP,V as kP,W as vP,X as NP,Y as LP,a as GI,b as UI,c as jI,d as BI,e as qI,f as zI,g as VI,h as HI,i as KI,j as WI,k as XI,l as YI,m as JI,n as ZI,o as QI,p as eP,q as tP,r as rP,s as nP,t as oP,u as iP,v as sP,w as aP,x as cP,y as dP,z as uP}from"./chunks/chunk-U45JXJCC.js";import{a as xI,b as RI,c as OI,d as II}from"./chunks/chunk-3WICXLVT.js";import{a as PI,b as MI,c as kI,d as vI,e as NI,f as LI,g as DI,h as $I,i as FI}from"./chunks/chunk-6XIIGE7U.js";import{$ as Ft,$a as Xt,$b as C_,A as tA,Aa as Bf,Ab as Km,Ac as K_,B as Vu,Ba as qf,Bb as Wm,Bc as W_,C as Dl,Ca as zf,Cb as Xm,Cc as X_,D as $l,Da as Vf,Db as Ym,Dc as Y_,E as Fl,Ea as Hf,Eb as Jm,Ec as J_,F as Gl,Fa as Kf,Fb as Zm,Fc as Z_,G as Ul,Ga as Wf,Gb as Qm,Gc as Q_,H as dp,Ha as Xf,Hb as e_,Hc as eh,I as Fe,Ia as Yf,Ib as t_,J as up,Ja as Jf,Jb as r_,K as lp,Ka as Zf,Kb as n_,L as pp,La as Qf,Lb as o_,M as fp,Ma as em,Mb as i_,N as mp,Na as tm,Nb as s_,O as _p,Oa as rm,Ob as a_,P as MO,Pa as nm,Pb as c_,Q as kO,Qa as om,Qb as d_,R as vO,Ra as im,Rb as u_,S as NO,Sa as sm,Sb as l_,T as LO,Ta as am,Tb as p_,U as DO,Ua as cm,Ub as f_,V as $O,Va as dm,Vb as m_,W as FO,Wa as um,Wb as __,X as GO,Xa as lm,Xb as h_,Y as Lt,Ya as pm,Yb as g_,Z as Dt,Za as fm,Zb as y_,_ as $t,_a as mm,_b as b_,a as Ac,aa as Gt,ab as ae,ac as T_,b as xc,ba as Ut,bb as Sm,bc as S_,c as Rc,ca as jt,cb as wm,cc as w_,d as OE,da as Bt,db as Em,dc as E_,e as IE,ea as qt,eb as Am,ec as A_,f as Ic,fa as zt,fb as xm,fc as x_,g as DE,ga as Vt,gb as Rm,gc as R_,h as $E,ha as Vp,hb as Om,hc as O_,i as FE,ia as Hp,ib as Im,ic as I_,j as GE,ja as Kp,jb as Pm,jc as P_,k as UE,ka as Wp,kb as Mm,kc as M_,l as jE,la as Xp,lb as km,lc as k_,m as BE,ma as Ge,mb as vm,mc as v_,n as qE,na as Yp,nb as Nm,nc as N_,o as zE,oa as Jp,ob as Lm,oc as L_,p as VE,pa as Zp,pb as Dm,pc as D_,q as HE,qa as Qp,qb as $m,qc as $_,r as KE,ra as ef,rb as Fm,rc as F_,s as WE,sa as tf,sb as Gm,sc as G_,t as XE,ta as rf,tb as Um,tc as U_,u as Nc,ua as nf,ub as jm,uc as j_,v as YE,va as JO,vb as Bm,vc as B_,w as JE,wa as ZO,wb as qm,wc as q_,x as ZE,xa as QO,xb as zm,xc as z_,y as QE,ya as eI,yb as Vm,yc as V_,z as eA,za as tI,zb as Hm,zc as H_}from"./chunks/chunk-2MC2LCXZ.js";import{a as Nt,f as hO,g as gO,h as yp,i as bp}from"./chunks/chunk-Y7VOMSZT.js";import{A as IO,B as PO,C as Pp,D as Mp,E as kp,b as zu,c as cR,d as iO,e as dO,f as uO,g as lO,h as pO,i as fO,j as hp,k as mO,l as xp,m as Rp,n as Op,o as Ip,p as yO,q as bO,r as CO,s as TO,t as SO,u as wO,v as EO,w as AO,x as xO,y as RO,z as OO}from"./chunks/chunk-X4RCGLTX.js";import{$ as QA,$a as Lu,$b as ql,$d as gm,A as FA,Aa as Ax,Ab as Zu,Ac as gp,Ad as yf,B as GA,Ba as du,Bb as Qu,Bc as vp,Bd as bf,C as UA,Ca as uu,Cb as el,Cc as Np,Cd as Cf,D as jA,Da as lu,Db as tl,Dc as Lp,Dd as Tf,E as ZA,Ea as pu,Eb as Pl,Ec as VO,Ed as Sf,Fa as fu,Fb as Ml,Fc as HO,Fd as wf,Ga as mu,Gb as kl,Gc as KO,Gd as Ef,Ha as _u,Hb as vl,Hc as Dp,Hd as Af,Ia as hu,Ib as WR,Ic as $p,Id as xf,J as Pd,Ja as gu,Jb as XR,Jc as Fp,Jd as Rf,Ka as yu,Kb as YR,Kc as Gp,Kd as Of,La as bu,Lb as JR,Lc as Up,Ld as If,Ma as Cu,Mb as ZR,Mc as jp,Md as Pf,Na as Tu,Nb as Nl,Nc as Bp,Nd as Mf,Oa as Su,Ob as Ll,Oc as qp,Od as fI,Pa as wu,Pb as QR,Pc as zp,Pd as kf,Qa as Eu,Qb as eO,Qc as WO,Qd as vf,Ra as Au,Rb as tO,Rc as XO,Rd as Nf,Sa as xu,Sb as $e,Sc as YO,Sd as Lf,Ta as Ru,Tb as rO,Tc as of,Td as Df,Ua as Ou,Ub as vt,Uc as rI,Ud as $f,Va as Iu,Vb as nO,Vc as Ht,Vd as Ff,Wa as Pu,Wb as oO,Wc as nI,Wd as Gf,Xa as Mu,Xc as Ue,Xd as Uf,Ya as ku,Yb as jl,Yc as Y,Yd as jf,Za as vu,Zb as Bl,Zc as sf,Zd as _m,_a as Nu,_b as sO,_d as hm,a as pA,aa as ex,ab as Du,ac as zl,ad as je,ae as ym,b as fA,ba as Md,bb as $u,bc as Vl,bd as af,be as bm,c as mA,ca as kd,cb as Fu,cc as Hl,cd as cf,ce as Cm,d as _A,da as vd,db as Gu,dc as Kl,de as Tm,e as hA,ea as Nd,eb as Uu,ec as Wl,ed as se,f as gA,fa as Ld,fb as ju,fc as Xl,fd as df,g as yA,ga as Dd,gb as Bu,gc as Yl,gd as uf,h as bA,ha as $d,hb as xx,hc as Jl,hd as lf,i as CA,ia as ux,ib as Rx,ic as Zl,id as pf,j as TA,ja as lx,jb as Ox,jc as Ql,jd as oI,k as SA,ka as px,kb as Ix,kc as ep,kd as iI,l as wA,la as fx,lb as Px,lc as tp,ld as sI,m as EA,mb as Mx,mc as rp,md as aI,n as AA,na as mx,nb as kx,nc as np,nd as cI,o as xA,oa as _x,ob as vx,oc as op,od as Kt,p as RA,pa as hx,pb as Nx,pc as ip,pd as dI,q as OA,qa as gx,qb as Lx,qc as sp,qd as uI,r as IA,ra as yx,rb as Dx,rc as aO,rd as Wt,s as PA,sa as bx,sb as $x,sc as cO,sd as lI,t as MA,ta as Cx,tb as Hu,tc as ap,td as pI,u as kA,ua as Tx,ub as Ku,v as vA,va as Sx,vb as Wu,vd as ff,w as NA,wa as wx,wb as Xu,wd as mf,x as LA,xa as Ex,xb as Yu,xc as cp,xd as _f,y as DA,ya as au,yd as hf,z as $A,za as cu,zb as Ju,zc as _O,zd as gf}from"./chunks/chunk-ALKKAUFN.js";import{Ba as eu,Ca as tu,Da as ru,Ea as nu,Fa as ou,H as Hd,Ha as iu,I as Kd,Ia as su,J as Wd,Ja as Cp,K as Xd,Ka as Tp,L as xt,La as Sp,Ma as wp,Na as Ep,Oa as Ap,a as NE,b as LE,c as Pc,d as Mc,f as kc,g as vc,h as tx,i as rx,j as nx,k as ox,l as ix,m as sx,n as ax,o as cx,oa as Rt,p as Fd,pa as Ot,q as Gd,qa as It,r as Ud,ra as Pt,s as jd,sa as Yd,t as Bd,u as dx,ua as Jd,v as qd,va as Zd,w as zd,wa as Qd,x as Vd}from"./chunks/chunk-TAG4VC22.js";import{$ as JA,$a as Xx,$b as qR,Aa as wd,Ab as hR,Ac as VR,B as Lc,Ba as Ed,Bb as gR,Bc as HR,C as BA,Ca as Ad,Cb as yR,Cc as Il,D as qA,Da as xd,Db as bR,Dc as KR,E as zA,Ea as Rd,Eb as CR,Ec as UO,F as VA,Fa as Od,Fb as TR,Fc as jO,G as HA,Ga as Id,Gb as SR,Gc as BO,H as KA,Hb as wR,Hc as qO,I as WA,Ia as Fx,Ib as ER,Ic as zO,J as XA,Ja as Gx,Jb as AR,K as YA,Ka as Ux,Kb as xR,L as Dc,La as jx,Lb as RR,M as $c,Ma as Bx,Mb as OR,N as Fc,Na as qx,Nb as IR,O as Gc,Oa as zx,Ob as PR,P as Uc,Pa as Vx,Pb as MR,Q as jc,Qa as Hx,Qb as kR,R as Bc,Ra as Kx,Rb as vR,S as qc,Sa as Wx,Sb as NR,T as zc,Tb as LR,U as Vc,Ub as DR,V as Hc,Vb as $R,W as De,Wb as FR,X as Kc,Xb as GR,Y as Wc,Yb as UR,Z as Xc,Zb as jR,_ as Yc,_b as BR,a as bE,aa as Jc,ab as Yx,ac as sl,b as CE,ba as Zc,bb as Jx,bc as al,c as TE,ca as Qc,cb as Zx,cc as cl,d as SE,da as ed,db as Qx,dc as dl,e as wE,ea as td,eb as eR,ec as ul,fa as rd,fc as ll,ga as nd,gc as Mt,h as EE,ha as od,hb as tR,hc as pl,i as AE,ia as id,ib as rR,ic as fl,j as Oc,ja as sd,jb as nR,jc as ml,k as xE,ka as ad,kb as oR,kc as _l,l as RE,la as cd,lb as iR,lc as hl,m as PE,ma as dd,mb as sR,mc as gl,n as ME,na as ud,nb as aR,nc as yl,o as kE,oa as ld,ob as qu,oc as bl,p as vE,pa as pd,pb as rl,pc as Cl,q as rA,qa as fd,qb as nl,qc as Tl,r as nA,ra as md,rb as ol,rc as Sl,s as oA,sa as _d,sb as il,sc as wl,t as iA,ta as hd,tb as dR,tc as El,u as sA,ua as gd,ub as uR,uc as Al,v as aA,va as yd,vb as lR,vc as xl,w as cA,wa as bd,wb as pR,wc as Rl,x as dA,xa as Cd,xb as fR,xc as kt,y as uA,ya as Td,yb as mR,yc as Ol,z as lA,za as Sd,zb as _R,zc as zR}from"./chunks/chunk-GOACULJW.js";import{$ as Eb,$c as Kn,$d as uo,$e as PT,$f as zT,$g as NS,$h as nw,$i as $w,$j as cs,$k as Ws,$l as Wa,Ac as zn,Ad as JC,Ae as lT,Af as qo,Ag as gS,Ai as Ni,Aj as Hi,Ak as uE,Al as Ta,Am as yc,B as pb,Bc as mC,Bf as zo,Bg as yS,Bh as qS,Bi as Cw,Bj as Ki,Bk as lE,Bl as Sa,Bm as bc,C as F,Cc as _C,Cd as Wn,Cf as Vo,Cg as bS,Ch as zS,Cj as Wi,Ck as pE,Cl as wa,Cm as Cc,D as fb,Dc as hC,Dd as ZC,Df as Ho,Dg as CS,Dh as VS,Di as Tw,Dj as Jw,Dk as Et,Dl as Ea,Dm as Tc,E as b,Ec as gC,Ed as Xn,Ef as Ko,Eg as TS,Eh as HS,Ei as Sw,Ej as Zw,Ek as Ne,El as Aa,Em as Sc,Fc as yC,Fe as Ro,Ff as Wo,Fg as SS,Fh as KS,Fi as ww,Fj as Qw,Fk as fE,Fl as xa,Fm as wc,G as mb,Gc as bC,Gd as QC,Ge as Oo,Gf as Xo,Gg as wS,Gj as eE,Gk as mE,Gl as Ra,Gm as Ec,H as _b,Hc as CC,Hd as eT,He as Io,Hf as Yo,Hg as ES,Hh as WS,Hi as Ew,Hj as tE,Hk as _E,Hl as Oa,Hm as At,Ic as TC,Id as tT,If as Jo,Ij as rE,Ik as hE,Il as Ia,Ja as Lb,Jc as Vn,Jd as Yn,Je as pT,Jf as Zo,Jg as AS,Jh as XS,Jj as nE,Jk as gE,Jl as Pa,K as hb,Ka as Db,Kb as Xb,Kc as SC,Kd as Jn,Ke as fT,Kf as Qo,Kg as xS,Kh as YS,Ki as Aw,Kj as oE,Kk as yE,Kl as Ma,La as $b,Lb as Gn,Lc as Hn,Ld as Zn,Le as mT,Lf as ei,Lh as JS,Lk as ks,Ll as ka,Mb as Un,Md as Qn,Me as _T,Mf as ti,Mh as ZS,Mi as xw,Mk as vs,Ml as va,N as gb,Nb as Yb,Nc as wC,Nd as eo,Ne as hT,Nf as ri,Ng as RS,Nh as QS,Nk as Ns,Nl as Na,O as ht,Oa as vn,Ob as Jb,Oc as EC,Od as to,Oe as gT,Of as ni,Og as OS,Oj as wt,Ok as Ls,Ol as La,Pa as Fb,Pb as ie,Pc as AC,Pd as ro,Pe as yT,Pf as oi,Pg as IS,Pj as iE,Pk as Ds,Pl as Da,Q as gt,Qa as Gb,Qb as Zb,Qc as xC,Qd as rT,Qe as bT,Qf as ii,Qg as PS,Qi as Rw,Qj as sE,Qk as $s,Ql as $a,R as En,Ra as Ub,Rc as RC,Rd as nT,Re as CT,Rf as si,Ri as Ow,Rj as aE,Rk as Fs,Rl as Fa,S as An,Sa as jb,Sb as Qb,Sc as Ct,Se as TT,Sf as ai,Sg as MS,Si as Iw,Sj as Qi,Sk as Gs,Sl as Ga,T as yt,Tc as OC,Td as no,Te as ST,Tf as ci,Tg as mi,Ti as Pw,Tj as es,Tk as Us,Tl as Ua,U as yb,Ua as Nn,Ub as eC,Uc as IC,Ud as oo,Ue as wT,Uf as di,Ug as _i,Ui as Mw,Uj as ts,Uk as js,Ul as ja,Va as Ln,Vc as PC,Vd as oT,Ve as ET,Vf as ui,Vj as rs,Vk as Bs,Vl as Ba,W as bb,Wa as Oe,Wd as io,We as AT,Wf as li,Wi as kw,Wj as ns,Wk as qs,Wl as qa,X as Cb,Xa as Bb,Xc as MC,Xd as so,Xe as xT,Xf as pi,Xi as vw,Xj as os,Xk as zs,Xl as za,Y as Tb,Yc as kC,Yd as iT,Ye as RT,Yf as fi,Yh as ew,Yi as Nw,Yj as is,Yk as Vs,Yl as Va,Z as Sb,Za as Dn,Zd as ao,Ze as OT,Zf as BT,Zg as kS,Zh as tw,Zi as Lw,Zj as ss,Zk as Hs,Zl as Ha,_ as wb,_a as $n,_d as co,_e as IT,_f as qT,_g as vS,_h as rw,_i as Dw,_j as as,_k as Ks,_l as Ka,aa as Ab,ab as Fn,ad as vC,ae as lo,af as MT,ag as VT,ah as LS,ai as ow,aj as Fw,ak as ds,al as Xs,am as Xa,ba as xb,bd as NC,bf as kT,bg as HT,bi as iw,bj as Gw,bk as us,bl as Ys,bm as Ya,c as Tn,ca as Rb,cd as LC,cf as vT,cg as KT,ch as DS,cj as Uw,ck as ls,cl as Js,cm as Ja,d as _t,da as Ob,dd as DC,df as NT,dg as WT,dh as $S,dj as jw,dk as ps,dl as Zs,dm as Za,e as oe,ed as $C,ef as LT,eg as XT,ei as sw,ej as St,ek as fs,el as Qs,em as Qa,f as Sn,fa as Ib,fc as tC,fd as FC,ff as DT,fg as YT,fi as aw,fj as Bw,fk as ms,fl as ea,fm as ec,g as Re,ga as Pb,gc as rC,ge as sT,gf as $T,gg as JT,gi as Oi,gj as qw,gk as _s,gl as ta,gm as tc,h as wn,ha as Mb,hc as nC,hd as GC,he as aT,hf as FT,hg as ZT,hh as FS,hi as cw,hj as zw,hk as hs,hl as ra,hm as rc,ia as kb,id as UC,ie as cT,if as GT,ig as QT,ih as GS,ii as dw,ij as Vw,ik as gs,il as na,im as nc,j as sb,ja as vb,jc as oC,jd as jC,je as po,jf as UT,jg as eS,jh as US,ji as uw,jj as Hw,jk as ys,jl as oa,jm as oc,k as ab,ka as Nb,kc as iC,kd as BC,ke as fo,kf as jT,kg as tS,kh as jS,ki as lw,kj as Kw,kk as bs,kl as ia,km as ic,l as cb,la as xn,le as mo,lf as Po,lg as rS,lh as ke,li as Tt,lj as Ww,lk as Cs,ll as sa,lm as sc,ma as Rn,mc as sC,md as qC,me as _o,mf as Mo,mg as nS,mh as hi,mi as pw,mj as Xw,mk as Ts,ml as aa,mm as ac,na as On,nc as jn,nd as zC,ne as ho,nf as ko,ng as oS,nh as gi,ni as fw,nj as Yw,nk as Ss,nl as ca,nm as cc,oe as go,of as vo,og as iS,oh as yi,oi as mw,oj as Li,ok as ws,ol as da,om as dc,pc as Bn,pd as VC,pe as yo,pf as No,pg as sS,ph as bi,pi as _w,pj as Di,pk as Es,pl as ua,pm as uc,qc as qn,qd as HC,qe as bo,qf as Lo,qg as aS,qh as Ci,qj as $i,qk as As,ql as la,qm as lc,ra as In,rb as qb,rd as KC,re as Co,rf as Do,rg as cS,rh as Ti,ri as hw,rj as Fi,rk as xs,rl as pa,rm as pc,s as db,sb as Ie,sd as WC,se as To,sf as $o,sg as dS,sh as Si,si as gw,sj as Gi,sk as Rs,sl as fa,ta as Pn,tb as bt,tc as aC,td as XC,te as So,tf as Fo,tg as uS,th as wi,ti as yw,tj as Ui,tk as Os,tl as ma,tm as Le,u as ub,ua as Mn,ub as zb,uc as cC,ud as YC,ue as wo,uf as Go,ug as lS,uh as Ei,ui as bw,uk as Is,ul as _a,um as X,va as kn,vb as Vb,vc as dC,ve as Eo,vf as Uo,vg as pS,vh as BS,vi as Ii,vj as ji,vk as Ps,vl as ha,vm as fc,wb as Hb,wc as uC,we as Ao,wf as Pe,wg as fS,wi as Pi,wj as Bi,wk as Ms,wl as ga,wm as mc,x as lb,xb as Kb,xc as lC,xe as xo,xf as Me,xg as mS,xh as Ai,xi as Mi,xj as qi,xk as cE,xl as ya,xm as _c,yb as G,yc as pC,ye as dT,yf as jo,yg as _S,yh as xi,yi as ki,yj as zi,yk as dE,yl as ba,ym as hc,zb as Wb,zc as fC,ze as uT,zf as Bo,zg as hS,zh as Ri,zi as vi,zj as Vi,zk as ve,zl as Ca,zm as gc}from"./chunks/chunk-NOPL37X4.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]="0ec82581-c626-544c-9deb-ec5e810fd7e9")}catch{}})();var U="2026-07-28",DP=["2025-11-25","2025-06-18"],Be=[U],f={headerMismatch:-32020,missingRequiredClientCapability:-32021,unsupportedProtocolVersion:-32022,invalidParams:-32602},R={clientCapabilities:"io.modelcontextprotocol/clientCapabilities",clientInfo:"io.modelcontextprotocol/clientInfo",protocolVersion:"io.modelcontextprotocol/protocolVersion",serverInfo:"io.modelcontextprotocol/serverInfo"},l=class extends Error{code;data;constructor(t,r,n={}){super(t),this.name="PmMcpProtocolError",this.code=r,this.data=n}};function _(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function mh(e){if(e===void 0)return;if(!_(e))throw new l("Invalid MCP clientInfo metadata",f.invalidParams,{field:R.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 l("Invalid MCP clientInfo metadata",f.invalidParams,{field:R.clientInfo,required:["name","version"]});let n={name:t.slice(0,128),version:r.slice(0,128)};return typeof e.description=="string"&&e.description.trim()&&(n.description=e.description.trim().slice(0,1024)),typeof e.websiteUrl=="string"&&e.websiteUrl.trim()&&(n.websiteUrl=e.websiteUrl.trim().slice(0,2048)),n}function qe(e){let t=_(e)?e._meta:void 0;if(!_(t))throw new l("Missing required MCP request metadata",f.invalidParams,{required:[R.protocolVersion,R.clientCapabilities]});let r=t[R.protocolVersion];if(typeof r!="string"||!Be.includes(r))throw new l("Unsupported protocol version",f.unsupportedProtocolVersion,{supported:[...Be],requested:typeof r=="string"?r:null});let n=t[R.clientCapabilities];if(!_(n))throw new l("Invalid MCP client capabilities metadata",f.invalidParams,{field:R.clientCapabilities,expected:"object"});let o=mh(t[R.clientInfo]);return{protocolVersion:U,clientCapabilities:n,...o?{clientInfo:o}:{}}}function $P(e,t){if(t!==e.protocolVersion)throw new l("MCP protocol header does not match request metadata",f.headerMismatch,{header:t??null,metadata:e.protocolVersion})}function FP(e,t){let r=t.filter(n=>!Object.prototype.hasOwnProperty.call(e.clientCapabilities,n));if(r.length>0)throw new l("Missing required client capability",f.missingRequiredClientCapability,{requiredCapabilities:Object.fromEntries(r.map(n=>[n,{}]))})}function GP(e,t){let r=e.clientCapabilities.extensions;return _(r)&&_(r[t])}function ze(e,t){let r=_(e._meta)?e._meta:{};return{...e,_meta:{...r,[R.serverInfo]:{...t}}}}function _h(e,t){return ze({...e,resultType:"complete"},t)}function UP(e){let t=e.ttlMs??6e4;if(!Number.isFinite(t)||t<0)throw new l("Invalid MCP discovery cache TTL",f.invalidParams,{ttlMs:t});return _h({supportedVersions:[...Be],capabilities:structuredClone(e.capabilities),ttlMs:t,cacheScope:"public",...e.instructions?{instructions:e.instructions}:{}},e.serverInfo)}function jP(e,t){if(_(e)&&typeof e.resultType=="string")return e.resultType;if(t==="legacy")return"complete";throw new l("Modern MCP result is missing resultType",f.invalidParams,{required:"resultType"})}import{createHash as Qt,createHmac as er,timingSafeEqual as hh}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="469f704b-12eb-524d-bcc8-fb8f9f1775f2")}catch{}})();var gh=["elicitation/create","roots/list","sampling/createMessage"],Jt=class extends Error{inputRequests;requestState;constructor(t){super("MCP operation requires additional input"),this.name="PmMcpInputRequiredError",this.inputRequests=t.inputRequests,this.requestState=t.requestState}},tr=/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/u,ce=32,He=64*1024,de=16*1024,Ve={maxBytes:256*1024,maxDepth:32,maxNodes:4096};function yh(e){return e==="elicitation/create"?"elicitation":e==="sampling/createMessage"?"sampling":"roots"}function ue(e,t,r){let n;try{n=JSON.stringify(e)}catch{throw new l(`Invalid ${r}: value is not JSON serializable`,f.invalidParams,{field:r})}if(Buffer.byteLength(n,"utf8")>t)throw new l(`Invalid ${r}: payload exceeds the protocol bound`,f.invalidParams,{field:r,maximumBytes:t})}function Ke(e,t){if(!_(e))throw new l("Invalid MCP inputRequests",f.invalidParams,{field:"inputRequests",expected:"object"});let r=Object.entries(e);if(r.length===0||r.length>ce)throw new l("Invalid MCP inputRequests count",f.invalidParams,{minimum:1,maximum:ce,observed:r.length});let n={};for(let[o,i]of r){if(!tr.test(o)||!_(i))throw new l("Invalid MCP input request entry",f.invalidParams,{field:`inputRequests.${o}`});let s=i.method;if(typeof s!="string"||!gh.includes(s))throw new l("Unsupported MCP input request method",f.invalidParams,{field:`inputRequests.${o}.method`,method:s??null});let a=yh(s);if(!Object.prototype.hasOwnProperty.call(t.clientCapabilities,a))throw new l("Missing required client capability",f.missingRequiredClientCapability,{requiredCapabilities:{[a]:{}}});if(!_(i.params))throw new l("Invalid MCP input request parameters",f.invalidParams,{field:`inputRequests.${o}.params`,expected:"object"});n[o]={method:s,params:structuredClone(i.params)}}return ue(n,He,"inputRequests"),n}function rr(e){if(!_(e))throw new l("Invalid MCP inputResponses",f.invalidParams,{field:"inputResponses",expected:"object"});let t=Object.entries(e);if(t.length>ce)throw new l("Invalid MCP inputResponses count",f.invalidParams,{maximum:ce,observed:t.length});let r={};for(let[n,o]of t){if(!tr.test(n)||!_(o))throw new l("Invalid MCP input response entry",f.invalidParams,{field:`inputResponses.${n}`});r[n]=structuredClone(o)}return ue(r,He,"inputResponses"),r}function VP(e){let t=e.requestState?.trim();if(t&&Buffer.byteLength(t,"utf8")>de)throw new l("Invalid MCP requestState: payload exceeds the protocol bound",f.invalidParams,{field:"requestState",maximumBytes:de});let r=e.inputRequests===void 0?void 0:Ke(e.inputRequests,e.requestContext);if(r===void 0&&!t)throw new l("InputRequiredResult requires inputRequests or requestState",f.invalidParams,{requiredAnyOf:["inputRequests","requestState"]});return{resultType:"input_required",...r?{inputRequests:r}:{},...t?{requestState:t}:{},_meta:{[R.serverInfo]:{...e.serverInfo}}}}function nr(e){let t=Buffer.from(e);if(t.byteLength<32)throw new l("MCP requestState signing key must contain at least 32 bytes",f.invalidParams,{minimumBytes:32});return t}function HP(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 l("Invalid MCP requestState payload",f.invalidParams);let r=Buffer.from(JSON.stringify({version:1,...e}),"utf8");if(r.byteLength>de/2)throw new l("MCP requestState payload exceeds the protocol bound",f.invalidParams,{maximumBytes:de/2});let n=r.toString("base64url"),o=er("sha256",nr(t)).update(n).digest("base64url");return`${n}.${o}`}function bh(e){if(!_(e)||e.version!==1)throw new l("Invalid MCP requestState payload",f.invalidParams,{field:"requestState"});let{expiresAt:t,method:r,parameterDigest:n,principal:o,state:i}=e;if(typeof t!="number"||!Number.isSafeInteger(t))throw new l("Invalid MCP requestState payload",f.invalidParams,{field:"requestState"});if(typeof r!="string"||typeof n!="string"||typeof o!="string")throw new l("Invalid MCP requestState payload",f.invalidParams,{field:"requestState"});return{expiresAt:t,method:r,parameterDigest:n,principal:o,state:i}}function KP(e,t,r){let[n,o,i]=e.split(".");if(!n||!o||i!==void 0)throw new l("Invalid MCP requestState encoding",f.invalidParams,{field:"requestState"});let s=Buffer.from(o,"base64url"),a=er("sha256",nr(t)).update(n).digest();if(s.byteLength!==a.byteLength||!hh(s,a))throw new l("Invalid MCP requestState signature",f.invalidParams,{field:"requestState"});let c;try{c=JSON.parse(Buffer.from(n,"base64url").toString("utf8"))}catch{c=null}let d=bh(c),{expiresAt:u,method:p,parameterDigest:m,principal:y}=d;if(u<(r.nowMs??Date.now()))throw new l("Expired MCP requestState",f.invalidParams,{field:"requestState",expiredAt:u});if(p!==r.method||m!==r.parameterDigest||y!==r.principal)throw new l("MCP requestState binding mismatch",f.invalidParams,{field:"requestState"});return d}function WP(e){return ue(e,He,"request parameters"),Qt("sha256").update(JSON.stringify(e)).digest("hex")}var Zt=class{#e=new Set;#t;constructor(t=4096){if(!Number.isSafeInteger(t)||t<1)throw new l("Invalid MCP replay guard capacity",f.invalidParams,{maximumEntries:t});this.#t=t}consume(t){let r=Qt("sha256").update(t).digest("hex");if(this.#e.has(r))throw new l("MCP requestState replay detected",f.invalidParams,{field:"requestState"});if(this.#e.size>=this.#t){let n=this.#e.values().next().value;this.#e.delete(n)}this.#e.add(r)}};function Ch(e){if(!Number.isSafeInteger(e.ttlMs)||e.ttlMs<0||e.cacheScope!=="public"&&e.cacheScope!=="private")throw new l("Invalid MCP cache policy",f.invalidParams,{ttlMs:e.ttlMs,cacheScope:e.cacheScope});return{ttlMs:e.ttlMs,cacheScope:e.cacheScope}}function XP(e,t){return{...e,...Ch(t)}}function Th(e){return e.replaceAll("~1","/").replaceAll("~0","~")}function Sh(e,t){if(t==="#")return e;if(!t.startsWith("#/"))return;let r=e;for(let n of t.slice(2).split("/").map(Th)){if(!_(r)&&!Array.isArray(r)||!Object.prototype.hasOwnProperty.call(r,n))return;r=r[n]}return r}function wh(e){let t=e.maxBytes??Ve.maxBytes,r=e.maxDepth??Ve.maxDepth,n=e.maxNodes??Ve.maxNodes;if(!Number.isSafeInteger(t)||t<2)throw new l("Invalid MCP JSON Schema work bounds",f.invalidParams);if(!Number.isSafeInteger(r)||r<1)throw new l("Invalid MCP JSON Schema work bounds",f.invalidParams);if(!Number.isSafeInteger(n)||n<1)throw new l("Invalid MCP JSON Schema work bounds",f.invalidParams);return{maximumBytes:t,maximumDepth:r,maximumNodes:n}}function Eh(e,t){let r=Array.isArray(e.value)?e.value:_(e.value)?Object.values(e.value):[];for(let n of r)t.push({value:n,depth:e.depth+1})}function Ah(e,t){if(!_(t)||typeof t.$ref!="string")return;let r=t.$ref;if(r.startsWith("#")&&Sh(e,r)===void 0)throw new l("MCP JSON Schema contains an unresolved local reference",f.invalidParams,{reference:r})}function YP(e,t={}){let{maximumBytes:r,maximumDepth:n,maximumNodes:o}=wh(t);if(typeof e!="boolean"&&!_(e))throw new l("Invalid MCP JSON Schema root",f.invalidParams,{expected:"object or boolean"});ue(e,r,"JSON Schema");let i=[{value:e,depth:0}],s=0;for(;i.length>0;){let a=i.pop();if(s+=1,s>o||a.depth>n)throw new l("MCP JSON Schema exceeds validation work bounds",f.invalidParams,{maximumDepth:n,maximumNodes:o});Ah(e,a.value),Eh(a,i)}return structuredClone(e)}import{randomUUID as xh}from"node:crypto";import{readFile as Rh}from"node:fs/promises";import or from"node:path";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="1774674f-4d33-5a24-9d97-522c55b861c0")}catch{}})();var oM="io.modelcontextprotocol/tasks",Oh=["working","input_required","completed","failed","cancelled"],Ih=/^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,Ph=3600*1e3,Mh=1e3,pe=1024,kh=30,vh=2e3;function We(e){return new l(e,f.invalidParams,{code:"mcp_task_not_found_or_not_authorized"})}function le(e){let t=e.trim();if(!Ih.test(t))throw We("Unknown MCP task");return t}function ir(e,t){if(typeof e!="string"||!Number.isFinite(Date.parse(e)))throw new l("Corrupt MCP task record",f.invalidParams,{field:t});return e}function sr(e){if(!_(e)||typeof e.code!="number"||!Number.isFinite(e.code)||typeof e.message!="string")throw new l("Corrupt MCP task error",f.invalidParams);return{code:e.code,message:e.message.slice(0,pe),..._(e.data)?{data:structuredClone(e.data)}:{}}}function Nh(e){if(!Oh.includes(e))throw new l("Corrupt MCP task record",f.invalidParams);return e}function Lh(e){if(typeof e!="string"||e.length===0)throw new l("Corrupt MCP task record",f.invalidParams);return e}function Dh(e){if(typeof e!="number"||!Number.isSafeInteger(e)||e<1)throw new l("Corrupt MCP task record",f.invalidParams);return e}function $h(e){if(e!==null&&(typeof e!="number"||!Number.isSafeInteger(e)||e<0))throw new l("Corrupt MCP task record",f.invalidParams);return e}function Fh(e){if(e!==void 0){if(typeof e!="number"||!Number.isSafeInteger(e)||e<0)throw new l("Corrupt MCP task record",f.invalidParams);return e}}function Gh(e){if(!Array.isArray(e)||e.some(t=>typeof t!="string"))throw new l("Corrupt MCP task record",f.invalidParams);return[...e]}function Uh(e){if(!_(e)||e.version!==1)throw new l("Corrupt MCP task record",f.invalidParams);let t=typeof e.taskId=="string"?le(e.taskId):"",r=Nh(e.status),n=Lh(e.principal),o=Dh(e.workerPid),i=$h(e.ttlMs),s=Fh(e.pollIntervalMs),a={version:1,taskId:t,status:r,principal:n,workerPid:o,createdAt:ir(e.createdAt,"createdAt"),lastUpdatedAt:ir(e.lastUpdatedAt,"lastUpdatedAt"),ttlMs:i,consumedInputKeys:Gh(e.consumedInputKeys),...typeof e.statusMessage=="string"?{statusMessage:e.statusMessage.slice(0,pe)}:{},...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=sr(e.error)),a.status==="input_required"&&!a.inputRequests||a.status==="completed"&&!a.result||a.status==="failed"&&!a.error)throw new l("Corrupt MCP task status payload",f.invalidParams,{status:a.status});return a}function j(e){let t={taskId:e.taskId,status:e.status,createdAt:e.createdAt,lastUpdatedAt:e.lastUpdatedAt,ttlMs:e.ttlMs,...e.statusMessage?{statusMessage:e.statusMessage}:{},...e.pollIntervalMs===void 0?{}:{pollIntervalMs:e.pollIntervalMs}};return e.status==="input_required"?{...t,status:"input_required",inputRequests:structuredClone(e.inputRequests)}:e.status==="completed"?{...t,status:"completed",result:structuredClone(e.result)}:e.status==="failed"?{...t,status:"failed",error:structuredClone(e.error)}:e.status==="cancelled"?{...t,status:"cancelled"}:{...t,status:"working"}}function J(e){return e==="completed"||e==="failed"||e==="cancelled"}function jh(e){try{return process.kill(e,0),!0}catch(t){return!(typeof t=="object"&&t!==null&&"code"in t&&t.code==="ESRCH")}}var Xe=class{#e;#t;#r;#n;#i;constructor(t){this.#e=or.resolve(t.pmRoot),this.#t=t.owner?.trim()||"pm-mcp",this.#r=t.now??(()=>new Date),this.#n=t.taskIdFactory??(()=>`mcp-task-${xh()}`),this.#i=t.workerPid??process.pid}#s(t){return or.join(this.#e,"runtime","mcp-tasks","records",`${le(t)}.json`)}async#c(t){try{return Uh(JSON.parse(await Rh(this.#s(t),"utf8")))}catch(r){throw oe(r)||r instanceof SyntaxError?We("Unknown MCP task"):r}}async#a(t){await Re(this.#s(t.taskId),`${JSON.stringify(t,null,2)}
|
|
1
|
+
import{A as wI,B as ph,C as fh,D as EI,E as AI,a as Xi,b as Yi,c as Ji,d as Zi,e as mI,f as _I,g as Yt,h as th,i as rh,j as nh,l as oh,m as ih,n as sh,o as ah,p as ch,q as dh,r as uh,s as lh,t as hI,u as gI,v as yI,w as bI,x as CI,y as TI,z as SI}from"./chunks/chunk-DTGWEL23.js";import{A as lP,B as pP,C as fP,D as mP,E as _P,F as hP,G as gP,H as yP,I as bP,J as CP,K as TP,L as SP,M as wP,N as EP,O as AP,P as xP,Q as RP,R as OP,S as IP,T as PP,U as MP,V as kP,W as vP,X as NP,Y as LP,a as GI,b as UI,c as jI,d as BI,e as qI,f as zI,g as VI,h as HI,i as KI,j as WI,k as XI,l as YI,m as JI,n as ZI,o as QI,p as eP,q as tP,r as rP,s as nP,t as oP,u as iP,v as sP,w as aP,x as cP,y as dP,z as uP}from"./chunks/chunk-UDW64J2W.js";import{a as xI,b as RI,c as OI,d as II}from"./chunks/chunk-3WICXLVT.js";import{a as PI,b as MI,c as kI,d as vI,e as NI,f as LI,g as DI,h as $I,i as FI}from"./chunks/chunk-T6H5BZCP.js";import{$ as Ft,$a as Xt,$b as C_,A as tA,Aa as Bf,Ab as Km,Ac as K_,B as Vu,Ba as qf,Bb as Wm,Bc as W_,C as Dl,Ca as zf,Cb as Xm,Cc as X_,D as $l,Da as Vf,Db as Ym,Dc as Y_,E as Fl,Ea as Hf,Eb as Jm,Ec as J_,F as Gl,Fa as Kf,Fb as Zm,Fc as Z_,G as Ul,Ga as Wf,Gb as Qm,Gc as Q_,H as dp,Ha as Xf,Hb as e_,Hc as eh,I as Fe,Ia as Yf,Ib as t_,J as up,Ja as Jf,Jb as r_,K as lp,Ka as Zf,Kb as n_,L as pp,La as Qf,Lb as o_,M as fp,Ma as em,Mb as i_,N as mp,Na as tm,Nb as s_,O as _p,Oa as rm,Ob as a_,P as MO,Pa as nm,Pb as c_,Q as kO,Qa as om,Qb as d_,R as vO,Ra as im,Rb as u_,S as NO,Sa as sm,Sb as l_,T as LO,Ta as am,Tb as p_,U as DO,Ua as cm,Ub as f_,V as $O,Va as dm,Vb as m_,W as FO,Wa as um,Wb as __,X as GO,Xa as lm,Xb as h_,Y as Lt,Ya as pm,Yb as g_,Z as Dt,Za as fm,Zb as y_,_ as $t,_a as mm,_b as b_,a as Ac,aa as Gt,ab as ae,ac as T_,b as xc,ba as Ut,bb as Sm,bc as S_,c as Rc,ca as jt,cb as wm,cc as w_,d as OE,da as Bt,db as Em,dc as E_,e as IE,ea as qt,eb as Am,ec as A_,f as Ic,fa as zt,fb as xm,fc as x_,g as DE,ga as Vt,gb as Rm,gc as R_,h as $E,ha as Vp,hb as Om,hc as O_,i as FE,ia as Hp,ib as Im,ic as I_,j as GE,ja as Kp,jb as Pm,jc as P_,k as UE,ka as Wp,kb as Mm,kc as M_,l as jE,la as Xp,lb as km,lc as k_,m as BE,ma as Ge,mb as vm,mc as v_,n as qE,na as Yp,nb as Nm,nc as N_,o as zE,oa as Jp,ob as Lm,oc as L_,p as VE,pa as Zp,pb as Dm,pc as D_,q as HE,qa as Qp,qb as $m,qc as $_,r as KE,ra as ef,rb as Fm,rc as F_,s as WE,sa as tf,sb as Gm,sc as G_,t as XE,ta as rf,tb as Um,tc as U_,u as Nc,ua as nf,ub as jm,uc as j_,v as YE,va as JO,vb as Bm,vc as B_,w as JE,wa as ZO,wb as qm,wc as q_,x as ZE,xa as QO,xb as zm,xc as z_,y as QE,ya as eI,yb as Vm,yc as V_,z as eA,za as tI,zb as Hm,zc as H_}from"./chunks/chunk-FZ4Z2J4F.js";import{a as Nt,f as hO,g as gO,h as yp,i as bp}from"./chunks/chunk-Y7VOMSZT.js";import{A as IO,B as PO,C as Pp,D as Mp,E as kp,b as zu,c as cR,d as iO,e as dO,f as uO,g as lO,h as pO,i as fO,j as hp,k as mO,l as xp,m as Rp,n as Op,o as Ip,p as yO,q as bO,r as CO,s as TO,t as SO,u as wO,v as EO,w as AO,x as xO,y as RO,z as OO}from"./chunks/chunk-X4RCGLTX.js";import{$ as QA,$a as Lu,$b as ql,$d as gm,A as FA,Aa as Ax,Ab as Zu,Ac as gp,Ad as yf,B as GA,Ba as du,Bb as Qu,Bc as vp,Bd as bf,C as UA,Ca as uu,Cb as el,Cc as Np,Cd as Cf,D as jA,Da as lu,Db as tl,Dc as Lp,Dd as Tf,E as ZA,Ea as pu,Eb as Pl,Ec as VO,Ed as Sf,Fa as fu,Fb as Ml,Fc as HO,Fd as wf,Ga as mu,Gb as kl,Gc as KO,Gd as Ef,Ha as _u,Hb as vl,Hc as Dp,Hd as Af,Ia as hu,Ib as WR,Ic as $p,Id as xf,J as Pd,Ja as gu,Jb as XR,Jc as Fp,Jd as Rf,Ka as yu,Kb as YR,Kc as Gp,Kd as Of,La as bu,Lb as JR,Lc as Up,Ld as If,Ma as Cu,Mb as ZR,Mc as jp,Md as Pf,Na as Tu,Nb as Nl,Nc as Bp,Nd as Mf,Oa as Su,Ob as Ll,Oc as qp,Od as fI,Pa as wu,Pb as QR,Pc as zp,Pd as kf,Qa as Eu,Qb as eO,Qc as WO,Qd as vf,Ra as Au,Rb as tO,Rc as XO,Rd as Nf,Sa as xu,Sb as $e,Sc as YO,Sd as Lf,Ta as Ru,Tb as rO,Tc as of,Td as Df,Ua as Ou,Ub as vt,Uc as rI,Ud as $f,Va as Iu,Vb as nO,Vc as Ht,Vd as Ff,Wa as Pu,Wb as oO,Wc as nI,Wd as Gf,Xa as Mu,Xc as Ue,Xd as Uf,Ya as ku,Yb as jl,Yc as Y,Yd as jf,Za as vu,Zb as Bl,Zc as sf,Zd as _m,_a as Nu,_b as sO,_d as hm,a as pA,aa as ex,ab as Du,ac as zl,ad as je,ae as ym,b as fA,ba as Md,bb as $u,bc as Vl,bd as af,be as bm,c as mA,ca as kd,cb as Fu,cc as Hl,cd as cf,ce as Cm,d as _A,da as vd,db as Gu,dc as Kl,de as Tm,e as hA,ea as Nd,eb as Uu,ec as Wl,ed as se,f as gA,fa as Ld,fb as ju,fc as Xl,fd as df,g as yA,ga as Dd,gb as Bu,gc as Yl,gd as uf,h as bA,ha as $d,hb as xx,hc as Jl,hd as lf,i as CA,ia as ux,ib as Rx,ic as Zl,id as pf,j as TA,ja as lx,jb as Ox,jc as Ql,jd as oI,k as SA,ka as px,kb as Ix,kc as ep,kd as iI,l as wA,la as fx,lb as Px,lc as tp,ld as sI,m as EA,mb as Mx,mc as rp,md as aI,n as AA,na as mx,nb as kx,nc as np,nd as cI,o as xA,oa as _x,ob as vx,oc as op,od as Kt,p as RA,pa as hx,pb as Nx,pc as ip,pd as dI,q as OA,qa as gx,qb as Lx,qc as sp,qd as uI,r as IA,ra as yx,rb as Dx,rc as aO,rd as Wt,s as PA,sa as bx,sb as $x,sc as cO,sd as lI,t as MA,ta as Cx,tb as Hu,tc as ap,td as pI,u as kA,ua as Tx,ub as Ku,v as vA,va as Sx,vb as Wu,vd as ff,w as NA,wa as wx,wb as Xu,wd as mf,x as LA,xa as Ex,xb as Yu,xc as cp,xd as _f,y as DA,ya as au,yd as hf,z as $A,za as cu,zb as Ju,zc as _O,zd as gf}from"./chunks/chunk-ZLJIFSOE.js";import{Ba as eu,Ca as tu,Da as ru,Ea as nu,Fa as ou,H as Hd,Ha as iu,I as Kd,Ia as su,J as Wd,Ja as Cp,K as Xd,Ka as Tp,L as xt,La as Sp,Ma as wp,Na as Ep,Oa as Ap,a as NE,b as LE,c as Pc,d as Mc,f as kc,g as vc,h as tx,i as rx,j as nx,k as ox,l as ix,m as sx,n as ax,o as cx,oa as Rt,p as Fd,pa as Ot,q as Gd,qa as It,r as Ud,ra as Pt,s as jd,sa as Yd,t as Bd,u as dx,ua as Jd,v as qd,va as Zd,w as zd,wa as Qd,x as Vd}from"./chunks/chunk-TAG4VC22.js";import{$ as JA,$a as Xx,$b as qR,Aa as wd,Ab as hR,Ac as VR,B as Lc,Ba as Ed,Bb as gR,Bc as HR,C as BA,Ca as Ad,Cb as yR,Cc as Il,D as qA,Da as xd,Db as bR,Dc as KR,E as zA,Ea as Rd,Eb as CR,Ec as UO,F as VA,Fa as Od,Fb as TR,Fc as jO,G as HA,Ga as Id,Gb as SR,Gc as BO,H as KA,Hb as wR,Hc as qO,I as WA,Ia as Fx,Ib as ER,Ic as zO,J as XA,Ja as Gx,Jb as AR,K as YA,Ka as Ux,Kb as xR,L as Dc,La as jx,Lb as RR,M as $c,Ma as Bx,Mb as OR,N as Fc,Na as qx,Nb as IR,O as Gc,Oa as zx,Ob as PR,P as Uc,Pa as Vx,Pb as MR,Q as jc,Qa as Hx,Qb as kR,R as Bc,Ra as Kx,Rb as vR,S as qc,Sa as Wx,Sb as NR,T as zc,Tb as LR,U as Vc,Ub as DR,V as Hc,Vb as $R,W as De,Wb as FR,X as Kc,Xb as GR,Y as Wc,Yb as UR,Z as Xc,Zb as jR,_ as Yc,_b as BR,a as bE,aa as Jc,ab as Yx,ac as sl,b as CE,ba as Zc,bb as Jx,bc as al,c as TE,ca as Qc,cb as Zx,cc as cl,d as SE,da as ed,db as Qx,dc as dl,e as wE,ea as td,eb as eR,ec as ul,fa as rd,fc as ll,ga as nd,gc as Mt,h as EE,ha as od,hb as tR,hc as pl,i as AE,ia as id,ib as rR,ic as fl,j as Oc,ja as sd,jb as nR,jc as ml,k as xE,ka as ad,kb as oR,kc as _l,l as RE,la as cd,lb as iR,lc as hl,m as PE,ma as dd,mb as sR,mc as gl,n as ME,na as ud,nb as aR,nc as yl,o as kE,oa as ld,ob as qu,oc as bl,p as vE,pa as pd,pb as rl,pc as Cl,q as rA,qa as fd,qb as nl,qc as Tl,r as nA,ra as md,rb as ol,rc as Sl,s as oA,sa as _d,sb as il,sc as wl,t as iA,ta as hd,tb as dR,tc as El,u as sA,ua as gd,ub as uR,uc as Al,v as aA,va as yd,vb as lR,vc as xl,w as cA,wa as bd,wb as pR,wc as Rl,x as dA,xa as Cd,xb as fR,xc as kt,y as uA,ya as Td,yb as mR,yc as Ol,z as lA,za as Sd,zb as _R,zc as zR}from"./chunks/chunk-GOACULJW.js";import{$ as Eb,$c as Kn,$d as uo,$e as PT,$f as zT,$g as NS,$h as nw,$i as $w,$j as cs,$k as Ws,$l as Wa,Ac as zn,Ad as JC,Ae as lT,Af as qo,Ag as gS,Ai as Ni,Aj as Hi,Ak as uE,Al as Ta,Am as yc,B as pb,Bc as mC,Bf as zo,Bg as yS,Bh as qS,Bi as Cw,Bj as Ki,Bk as lE,Bl as Sa,Bm as bc,C as F,Cc as _C,Cd as Wn,Cf as Vo,Cg as bS,Ch as zS,Cj as Wi,Ck as pE,Cl as wa,Cm as Cc,D as fb,Dc as hC,Dd as ZC,Df as Ho,Dg as CS,Dh as VS,Di as Tw,Dj as Jw,Dk as Et,Dl as Ea,Dm as Tc,E as b,Ec as gC,Ed as Xn,Ef as Ko,Eg as TS,Eh as HS,Ei as Sw,Ej as Zw,Ek as Ne,El as Aa,Em as Sc,Fc as yC,Fe as Ro,Ff as Wo,Fg as SS,Fh as KS,Fi as ww,Fj as Qw,Fk as fE,Fl as xa,Fm as wc,G as mb,Gc as bC,Gd as QC,Ge as Oo,Gf as Xo,Gg as wS,Gj as eE,Gk as mE,Gl as Ra,Gm as Ec,H as _b,Hc as CC,Hd as eT,He as Io,Hf as Yo,Hg as ES,Hh as WS,Hi as Ew,Hj as tE,Hk as _E,Hl as Oa,Hm as At,Ic as TC,Id as tT,If as Jo,Ij as rE,Ik as hE,Il as Ia,Ja as Lb,Jc as Vn,Jd as Yn,Je as pT,Jf as Zo,Jg as AS,Jh as XS,Jj as nE,Jk as gE,Jl as Pa,K as hb,Ka as Db,Kb as Xb,Kc as SC,Kd as Jn,Ke as fT,Kf as Qo,Kg as xS,Kh as YS,Ki as Aw,Kj as oE,Kk as yE,Kl as Ma,La as $b,Lb as Gn,Lc as Hn,Ld as Zn,Le as mT,Lf as ei,Lh as JS,Lk as ks,Ll as ka,Mb as Un,Md as Qn,Me as _T,Mf as ti,Mh as ZS,Mi as xw,Mk as vs,Ml as va,N as gb,Nb as Yb,Nc as wC,Nd as eo,Ne as hT,Nf as ri,Ng as RS,Nh as QS,Nk as Ns,Nl as Na,O as ht,Oa as vn,Ob as Jb,Oc as EC,Od as to,Oe as gT,Of as ni,Og as OS,Oj as wt,Ok as Ls,Ol as La,Pa as Fb,Pb as ie,Pc as AC,Pd as ro,Pe as yT,Pf as oi,Pg as IS,Pj as iE,Pk as Ds,Pl as Da,Q as gt,Qa as Gb,Qb as Zb,Qc as xC,Qd as rT,Qe as bT,Qf as ii,Qg as PS,Qi as Rw,Qj as sE,Qk as $s,Ql as $a,R as En,Ra as Ub,Rc as RC,Rd as nT,Re as CT,Rf as si,Ri as Ow,Rj as aE,Rk as Fs,Rl as Fa,S as An,Sa as jb,Sb as Qb,Sc as Ct,Se as TT,Sf as ai,Sg as MS,Si as Iw,Sj as Qi,Sk as Gs,Sl as Ga,T as yt,Tc as OC,Td as no,Te as ST,Tf as ci,Tg as mi,Ti as Pw,Tj as es,Tk as Us,Tl as Ua,U as yb,Ua as Nn,Ub as eC,Uc as IC,Ud as oo,Ue as wT,Uf as di,Ug as _i,Ui as Mw,Uj as ts,Uk as js,Ul as ja,Va as Ln,Vc as PC,Vd as oT,Ve as ET,Vf as ui,Vj as rs,Vk as Bs,Vl as Ba,W as bb,Wa as Oe,Wd as io,We as AT,Wf as li,Wi as kw,Wj as ns,Wk as qs,Wl as qa,X as Cb,Xa as Bb,Xc as MC,Xd as so,Xe as xT,Xf as pi,Xi as vw,Xj as os,Xk as zs,Xl as za,Y as Tb,Yc as kC,Yd as iT,Ye as RT,Yf as fi,Yh as ew,Yi as Nw,Yj as is,Yk as Vs,Yl as Va,Z as Sb,Za as Dn,Zd as ao,Ze as OT,Zf as BT,Zg as kS,Zh as tw,Zi as Lw,Zj as ss,Zk as Hs,Zl as Ha,_ as wb,_a as $n,_d as co,_e as IT,_f as qT,_g as vS,_h as rw,_i as Dw,_j as as,_k as Ks,_l as Ka,aa as Ab,ab as Fn,ad as vC,ae as lo,af as MT,ag as VT,ah as LS,ai as ow,aj as Fw,ak as ds,al as Xs,am as Xa,ba as xb,bd as NC,bf as kT,bg as HT,bi as iw,bj as Gw,bk as us,bl as Ys,bm as Ya,c as Tn,ca as Rb,cd as LC,cf as vT,cg as KT,ch as DS,cj as Uw,ck as ls,cl as Js,cm as Ja,d as _t,da as Ob,dd as DC,df as NT,dg as WT,dh as $S,dj as jw,dk as ps,dl as Zs,dm as Za,e as oe,ed as $C,ef as LT,eg as XT,ei as sw,ej as St,ek as fs,el as Qs,em as Qa,f as Sn,fa as Ib,fc as tC,fd as FC,ff as DT,fg as YT,fi as aw,fj as Bw,fk as ms,fl as ea,fm as ec,g as Re,ga as Pb,gc as rC,ge as sT,gf as $T,gg as JT,gi as Oi,gj as qw,gk as _s,gl as ta,gm as tc,h as wn,ha as Mb,hc as nC,hd as GC,he as aT,hf as FT,hg as ZT,hh as FS,hi as cw,hj as zw,hk as hs,hl as ra,hm as rc,ia as kb,id as UC,ie as cT,if as GT,ig as QT,ih as GS,ii as dw,ij as Vw,ik as gs,il as na,im as nc,j as sb,ja as vb,jc as oC,jd as jC,je as po,jf as UT,jg as eS,jh as US,ji as uw,jj as Hw,jk as ys,jl as oa,jm as oc,k as ab,ka as Nb,kc as iC,kd as BC,ke as fo,kf as jT,kg as tS,kh as jS,ki as lw,kj as Kw,kk as bs,kl as ia,km as ic,l as cb,la as xn,le as mo,lf as Po,lg as rS,lh as ke,li as Tt,lj as Ww,lk as Cs,ll as sa,lm as sc,ma as Rn,mc as sC,md as qC,me as _o,mf as Mo,mg as nS,mh as hi,mi as pw,mj as Xw,mk as Ts,ml as aa,mm as ac,na as On,nc as jn,nd as zC,ne as ho,nf as ko,ng as oS,nh as gi,ni as fw,nj as Yw,nk as Ss,nl as ca,nm as cc,oe as go,of as vo,og as iS,oh as yi,oi as mw,oj as Li,ok as ws,ol as da,om as dc,pc as Bn,pd as VC,pe as yo,pf as No,pg as sS,ph as bi,pi as _w,pj as Di,pk as Es,pl as ua,pm as uc,qc as qn,qd as HC,qe as bo,qf as Lo,qg as aS,qh as Ci,qj as $i,qk as As,ql as la,qm as lc,ra as In,rb as qb,rd as KC,re as Co,rf as Do,rg as cS,rh as Ti,ri as hw,rj as Fi,rk as xs,rl as pa,rm as pc,s as db,sb as Ie,sd as WC,se as To,sf as $o,sg as dS,sh as Si,si as gw,sj as Gi,sk as Rs,sl as fa,ta as Pn,tb as bt,tc as aC,td as XC,te as So,tf as Fo,tg as uS,th as wi,ti as yw,tj as Ui,tk as Os,tl as ma,tm as Le,u as ub,ua as Mn,ub as zb,uc as cC,ud as YC,ue as wo,uf as Go,ug as lS,uh as Ei,ui as bw,uk as Is,ul as _a,um as X,va as kn,vb as Vb,vc as dC,ve as Eo,vf as Uo,vg as pS,vh as BS,vi as Ii,vj as ji,vk as Ps,vl as ha,vm as fc,wb as Hb,wc as uC,we as Ao,wf as Pe,wg as fS,wi as Pi,wj as Bi,wk as Ms,wl as ga,wm as mc,x as lb,xb as Kb,xc as lC,xe as xo,xf as Me,xg as mS,xh as Ai,xi as Mi,xj as qi,xk as cE,xl as ya,xm as _c,yb as G,yc as pC,ye as dT,yf as jo,yg as _S,yh as xi,yi as ki,yj as zi,yk as dE,yl as ba,ym as hc,zb as Wb,zc as fC,ze as uT,zf as Bo,zg as hS,zh as Ri,zi as vi,zj as Vi,zk as ve,zl as Ca,zm as gc}from"./chunks/chunk-NOPL37X4.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]="0ec82581-c626-544c-9deb-ec5e810fd7e9")}catch{}})();var U="2026-07-28",DP=["2025-11-25","2025-06-18"],Be=[U],f={headerMismatch:-32020,missingRequiredClientCapability:-32021,unsupportedProtocolVersion:-32022,invalidParams:-32602},R={clientCapabilities:"io.modelcontextprotocol/clientCapabilities",clientInfo:"io.modelcontextprotocol/clientInfo",protocolVersion:"io.modelcontextprotocol/protocolVersion",serverInfo:"io.modelcontextprotocol/serverInfo"},l=class extends Error{code;data;constructor(t,r,n={}){super(t),this.name="PmMcpProtocolError",this.code=r,this.data=n}};function _(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function mh(e){if(e===void 0)return;if(!_(e))throw new l("Invalid MCP clientInfo metadata",f.invalidParams,{field:R.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 l("Invalid MCP clientInfo metadata",f.invalidParams,{field:R.clientInfo,required:["name","version"]});let n={name:t.slice(0,128),version:r.slice(0,128)};return typeof e.description=="string"&&e.description.trim()&&(n.description=e.description.trim().slice(0,1024)),typeof e.websiteUrl=="string"&&e.websiteUrl.trim()&&(n.websiteUrl=e.websiteUrl.trim().slice(0,2048)),n}function qe(e){let t=_(e)?e._meta:void 0;if(!_(t))throw new l("Missing required MCP request metadata",f.invalidParams,{required:[R.protocolVersion,R.clientCapabilities]});let r=t[R.protocolVersion];if(typeof r!="string"||!Be.includes(r))throw new l("Unsupported protocol version",f.unsupportedProtocolVersion,{supported:[...Be],requested:typeof r=="string"?r:null});let n=t[R.clientCapabilities];if(!_(n))throw new l("Invalid MCP client capabilities metadata",f.invalidParams,{field:R.clientCapabilities,expected:"object"});let o=mh(t[R.clientInfo]);return{protocolVersion:U,clientCapabilities:n,...o?{clientInfo:o}:{}}}function $P(e,t){if(t!==e.protocolVersion)throw new l("MCP protocol header does not match request metadata",f.headerMismatch,{header:t??null,metadata:e.protocolVersion})}function FP(e,t){let r=t.filter(n=>!Object.prototype.hasOwnProperty.call(e.clientCapabilities,n));if(r.length>0)throw new l("Missing required client capability",f.missingRequiredClientCapability,{requiredCapabilities:Object.fromEntries(r.map(n=>[n,{}]))})}function GP(e,t){let r=e.clientCapabilities.extensions;return _(r)&&_(r[t])}function ze(e,t){let r=_(e._meta)?e._meta:{};return{...e,_meta:{...r,[R.serverInfo]:{...t}}}}function _h(e,t){return ze({...e,resultType:"complete"},t)}function UP(e){let t=e.ttlMs??6e4;if(!Number.isFinite(t)||t<0)throw new l("Invalid MCP discovery cache TTL",f.invalidParams,{ttlMs:t});return _h({supportedVersions:[...Be],capabilities:structuredClone(e.capabilities),ttlMs:t,cacheScope:"public",...e.instructions?{instructions:e.instructions}:{}},e.serverInfo)}function jP(e,t){if(_(e)&&typeof e.resultType=="string")return e.resultType;if(t==="legacy")return"complete";throw new l("Modern MCP result is missing resultType",f.invalidParams,{required:"resultType"})}import{createHash as Qt,createHmac as er,timingSafeEqual as hh}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="469f704b-12eb-524d-bcc8-fb8f9f1775f2")}catch{}})();var gh=["elicitation/create","roots/list","sampling/createMessage"],Jt=class extends Error{inputRequests;requestState;constructor(t){super("MCP operation requires additional input"),this.name="PmMcpInputRequiredError",this.inputRequests=t.inputRequests,this.requestState=t.requestState}},tr=/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/u,ce=32,He=64*1024,de=16*1024,Ve={maxBytes:256*1024,maxDepth:32,maxNodes:4096};function yh(e){return e==="elicitation/create"?"elicitation":e==="sampling/createMessage"?"sampling":"roots"}function ue(e,t,r){let n;try{n=JSON.stringify(e)}catch{throw new l(`Invalid ${r}: value is not JSON serializable`,f.invalidParams,{field:r})}if(Buffer.byteLength(n,"utf8")>t)throw new l(`Invalid ${r}: payload exceeds the protocol bound`,f.invalidParams,{field:r,maximumBytes:t})}function Ke(e,t){if(!_(e))throw new l("Invalid MCP inputRequests",f.invalidParams,{field:"inputRequests",expected:"object"});let r=Object.entries(e);if(r.length===0||r.length>ce)throw new l("Invalid MCP inputRequests count",f.invalidParams,{minimum:1,maximum:ce,observed:r.length});let n={};for(let[o,i]of r){if(!tr.test(o)||!_(i))throw new l("Invalid MCP input request entry",f.invalidParams,{field:`inputRequests.${o}`});let s=i.method;if(typeof s!="string"||!gh.includes(s))throw new l("Unsupported MCP input request method",f.invalidParams,{field:`inputRequests.${o}.method`,method:s??null});let a=yh(s);if(!Object.prototype.hasOwnProperty.call(t.clientCapabilities,a))throw new l("Missing required client capability",f.missingRequiredClientCapability,{requiredCapabilities:{[a]:{}}});if(!_(i.params))throw new l("Invalid MCP input request parameters",f.invalidParams,{field:`inputRequests.${o}.params`,expected:"object"});n[o]={method:s,params:structuredClone(i.params)}}return ue(n,He,"inputRequests"),n}function rr(e){if(!_(e))throw new l("Invalid MCP inputResponses",f.invalidParams,{field:"inputResponses",expected:"object"});let t=Object.entries(e);if(t.length>ce)throw new l("Invalid MCP inputResponses count",f.invalidParams,{maximum:ce,observed:t.length});let r={};for(let[n,o]of t){if(!tr.test(n)||!_(o))throw new l("Invalid MCP input response entry",f.invalidParams,{field:`inputResponses.${n}`});r[n]=structuredClone(o)}return ue(r,He,"inputResponses"),r}function VP(e){let t=e.requestState?.trim();if(t&&Buffer.byteLength(t,"utf8")>de)throw new l("Invalid MCP requestState: payload exceeds the protocol bound",f.invalidParams,{field:"requestState",maximumBytes:de});let r=e.inputRequests===void 0?void 0:Ke(e.inputRequests,e.requestContext);if(r===void 0&&!t)throw new l("InputRequiredResult requires inputRequests or requestState",f.invalidParams,{requiredAnyOf:["inputRequests","requestState"]});return{resultType:"input_required",...r?{inputRequests:r}:{},...t?{requestState:t}:{},_meta:{[R.serverInfo]:{...e.serverInfo}}}}function nr(e){let t=Buffer.from(e);if(t.byteLength<32)throw new l("MCP requestState signing key must contain at least 32 bytes",f.invalidParams,{minimumBytes:32});return t}function HP(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 l("Invalid MCP requestState payload",f.invalidParams);let r=Buffer.from(JSON.stringify({version:1,...e}),"utf8");if(r.byteLength>de/2)throw new l("MCP requestState payload exceeds the protocol bound",f.invalidParams,{maximumBytes:de/2});let n=r.toString("base64url"),o=er("sha256",nr(t)).update(n).digest("base64url");return`${n}.${o}`}function bh(e){if(!_(e)||e.version!==1)throw new l("Invalid MCP requestState payload",f.invalidParams,{field:"requestState"});let{expiresAt:t,method:r,parameterDigest:n,principal:o,state:i}=e;if(typeof t!="number"||!Number.isSafeInteger(t))throw new l("Invalid MCP requestState payload",f.invalidParams,{field:"requestState"});if(typeof r!="string"||typeof n!="string"||typeof o!="string")throw new l("Invalid MCP requestState payload",f.invalidParams,{field:"requestState"});return{expiresAt:t,method:r,parameterDigest:n,principal:o,state:i}}function KP(e,t,r){let[n,o,i]=e.split(".");if(!n||!o||i!==void 0)throw new l("Invalid MCP requestState encoding",f.invalidParams,{field:"requestState"});let s=Buffer.from(o,"base64url"),a=er("sha256",nr(t)).update(n).digest();if(s.byteLength!==a.byteLength||!hh(s,a))throw new l("Invalid MCP requestState signature",f.invalidParams,{field:"requestState"});let c;try{c=JSON.parse(Buffer.from(n,"base64url").toString("utf8"))}catch{c=null}let d=bh(c),{expiresAt:u,method:p,parameterDigest:m,principal:y}=d;if(u<(r.nowMs??Date.now()))throw new l("Expired MCP requestState",f.invalidParams,{field:"requestState",expiredAt:u});if(p!==r.method||m!==r.parameterDigest||y!==r.principal)throw new l("MCP requestState binding mismatch",f.invalidParams,{field:"requestState"});return d}function WP(e){return ue(e,He,"request parameters"),Qt("sha256").update(JSON.stringify(e)).digest("hex")}var Zt=class{#e=new Set;#t;constructor(t=4096){if(!Number.isSafeInteger(t)||t<1)throw new l("Invalid MCP replay guard capacity",f.invalidParams,{maximumEntries:t});this.#t=t}consume(t){let r=Qt("sha256").update(t).digest("hex");if(this.#e.has(r))throw new l("MCP requestState replay detected",f.invalidParams,{field:"requestState"});if(this.#e.size>=this.#t){let n=this.#e.values().next().value;this.#e.delete(n)}this.#e.add(r)}};function Ch(e){if(!Number.isSafeInteger(e.ttlMs)||e.ttlMs<0||e.cacheScope!=="public"&&e.cacheScope!=="private")throw new l("Invalid MCP cache policy",f.invalidParams,{ttlMs:e.ttlMs,cacheScope:e.cacheScope});return{ttlMs:e.ttlMs,cacheScope:e.cacheScope}}function XP(e,t){return{...e,...Ch(t)}}function Th(e){return e.replaceAll("~1","/").replaceAll("~0","~")}function Sh(e,t){if(t==="#")return e;if(!t.startsWith("#/"))return;let r=e;for(let n of t.slice(2).split("/").map(Th)){if(!_(r)&&!Array.isArray(r)||!Object.prototype.hasOwnProperty.call(r,n))return;r=r[n]}return r}function wh(e){let t=e.maxBytes??Ve.maxBytes,r=e.maxDepth??Ve.maxDepth,n=e.maxNodes??Ve.maxNodes;if(!Number.isSafeInteger(t)||t<2)throw new l("Invalid MCP JSON Schema work bounds",f.invalidParams);if(!Number.isSafeInteger(r)||r<1)throw new l("Invalid MCP JSON Schema work bounds",f.invalidParams);if(!Number.isSafeInteger(n)||n<1)throw new l("Invalid MCP JSON Schema work bounds",f.invalidParams);return{maximumBytes:t,maximumDepth:r,maximumNodes:n}}function Eh(e,t){let r=Array.isArray(e.value)?e.value:_(e.value)?Object.values(e.value):[];for(let n of r)t.push({value:n,depth:e.depth+1})}function Ah(e,t){if(!_(t)||typeof t.$ref!="string")return;let r=t.$ref;if(r.startsWith("#")&&Sh(e,r)===void 0)throw new l("MCP JSON Schema contains an unresolved local reference",f.invalidParams,{reference:r})}function YP(e,t={}){let{maximumBytes:r,maximumDepth:n,maximumNodes:o}=wh(t);if(typeof e!="boolean"&&!_(e))throw new l("Invalid MCP JSON Schema root",f.invalidParams,{expected:"object or boolean"});ue(e,r,"JSON Schema");let i=[{value:e,depth:0}],s=0;for(;i.length>0;){let a=i.pop();if(s+=1,s>o||a.depth>n)throw new l("MCP JSON Schema exceeds validation work bounds",f.invalidParams,{maximumDepth:n,maximumNodes:o});Ah(e,a.value),Eh(a,i)}return structuredClone(e)}import{randomUUID as xh}from"node:crypto";import{readFile as Rh}from"node:fs/promises";import or from"node:path";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="1774674f-4d33-5a24-9d97-522c55b861c0")}catch{}})();var oM="io.modelcontextprotocol/tasks",Oh=["working","input_required","completed","failed","cancelled"],Ih=/^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,Ph=3600*1e3,Mh=1e3,pe=1024,kh=30,vh=2e3;function We(e){return new l(e,f.invalidParams,{code:"mcp_task_not_found_or_not_authorized"})}function le(e){let t=e.trim();if(!Ih.test(t))throw We("Unknown MCP task");return t}function ir(e,t){if(typeof e!="string"||!Number.isFinite(Date.parse(e)))throw new l("Corrupt MCP task record",f.invalidParams,{field:t});return e}function sr(e){if(!_(e)||typeof e.code!="number"||!Number.isFinite(e.code)||typeof e.message!="string")throw new l("Corrupt MCP task error",f.invalidParams);return{code:e.code,message:e.message.slice(0,pe),..._(e.data)?{data:structuredClone(e.data)}:{}}}function Nh(e){if(!Oh.includes(e))throw new l("Corrupt MCP task record",f.invalidParams);return e}function Lh(e){if(typeof e!="string"||e.length===0)throw new l("Corrupt MCP task record",f.invalidParams);return e}function Dh(e){if(typeof e!="number"||!Number.isSafeInteger(e)||e<1)throw new l("Corrupt MCP task record",f.invalidParams);return e}function $h(e){if(e!==null&&(typeof e!="number"||!Number.isSafeInteger(e)||e<0))throw new l("Corrupt MCP task record",f.invalidParams);return e}function Fh(e){if(e!==void 0){if(typeof e!="number"||!Number.isSafeInteger(e)||e<0)throw new l("Corrupt MCP task record",f.invalidParams);return e}}function Gh(e){if(!Array.isArray(e)||e.some(t=>typeof t!="string"))throw new l("Corrupt MCP task record",f.invalidParams);return[...e]}function Uh(e){if(!_(e)||e.version!==1)throw new l("Corrupt MCP task record",f.invalidParams);let t=typeof e.taskId=="string"?le(e.taskId):"",r=Nh(e.status),n=Lh(e.principal),o=Dh(e.workerPid),i=$h(e.ttlMs),s=Fh(e.pollIntervalMs),a={version:1,taskId:t,status:r,principal:n,workerPid:o,createdAt:ir(e.createdAt,"createdAt"),lastUpdatedAt:ir(e.lastUpdatedAt,"lastUpdatedAt"),ttlMs:i,consumedInputKeys:Gh(e.consumedInputKeys),...typeof e.statusMessage=="string"?{statusMessage:e.statusMessage.slice(0,pe)}:{},...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=sr(e.error)),a.status==="input_required"&&!a.inputRequests||a.status==="completed"&&!a.result||a.status==="failed"&&!a.error)throw new l("Corrupt MCP task status payload",f.invalidParams,{status:a.status});return a}function j(e){let t={taskId:e.taskId,status:e.status,createdAt:e.createdAt,lastUpdatedAt:e.lastUpdatedAt,ttlMs:e.ttlMs,...e.statusMessage?{statusMessage:e.statusMessage}:{},...e.pollIntervalMs===void 0?{}:{pollIntervalMs:e.pollIntervalMs}};return e.status==="input_required"?{...t,status:"input_required",inputRequests:structuredClone(e.inputRequests)}:e.status==="completed"?{...t,status:"completed",result:structuredClone(e.result)}:e.status==="failed"?{...t,status:"failed",error:structuredClone(e.error)}:e.status==="cancelled"?{...t,status:"cancelled"}:{...t,status:"working"}}function J(e){return e==="completed"||e==="failed"||e==="cancelled"}function jh(e){try{return process.kill(e,0),!0}catch(t){return!(typeof t=="object"&&t!==null&&"code"in t&&t.code==="ESRCH")}}var Xe=class{#e;#t;#r;#n;#i;constructor(t){this.#e=or.resolve(t.pmRoot),this.#t=t.owner?.trim()||"pm-mcp",this.#r=t.now??(()=>new Date),this.#n=t.taskIdFactory??(()=>`mcp-task-${xh()}`),this.#i=t.workerPid??process.pid}#s(t){return or.join(this.#e,"runtime","mcp-tasks","records",`${le(t)}.json`)}async#c(t){try{return Uh(JSON.parse(await Rh(this.#s(t),"utf8")))}catch(r){throw oe(r)||r instanceof SyntaxError?We("Unknown MCP task"):r}}async#a(t){await Re(this.#s(t.taskId),`${JSON.stringify(t,null,2)}
|
|
2
2
|
`)}async#o(t,r,n){let o=le(t),i=await ke(this.#e,o,kh,this.#t,!1,!1,vh);try{let s=await this.#c(o);if(s.principal!==r)throw We("Unknown MCP task");let a=n(s);return await this.#a(a),a}finally{await i()}}async create(t){let r=le(this.#n()),n=t.principal.trim(),o=t.ttlMs===void 0?Ph:t.ttlMs,i=t.pollIntervalMs??Mh;if(n.length===0||o!==null&&(!Number.isSafeInteger(o)||o<0)||!Number.isSafeInteger(i)||i<0)throw new l("Invalid MCP task creation options",f.invalidParams);let s=this.#r().toISOString(),a={version:1,taskId:r,status:"working",createdAt:s,lastUpdatedAt:s,ttlMs:o,pollIntervalMs:i,principal:n,workerPid:this.#i,consumedInputKeys:[],...t.statusMessage?.trim()?{statusMessage:t.statusMessage.trim().slice(0,pe)}:{}};return await this.#a(a),{...j(a),resultType:"task"}}async get(t,r){return j(await this.#o(t,r,n=>{if(J(n.status))return n;let o=this.#r().getTime(),i=n.ttlMs!==null&&Date.parse(n.createdAt)+n.ttlMs<=o,s=n.workerPid!==this.#i&&!jh(n.workerPid);return!i&&!s?n:{...n,status:"failed",statusMessage:i?"Task retention expired before completion.":"Task worker ended before recording a terminal result.",lastUpdatedAt:this.#r().toISOString(),error:{code:-32603,message:i?"MCP task expired":"MCP task worker unavailable after restart",data:{recoverable:!1,createNewTask:!0}},inputRequests:void 0}}))}async requireInput(t){let r=Ke(t.inputRequests,t.requestContext);return j(await this.#o(t.taskId,t.principal,n=>{if(J(n.status))return n;let o=Object.keys(r).filter(i=>n.consumedInputKeys.includes(i));if(o.length>0)throw new l("MCP task input request keys must be unique for the task lifetime",f.invalidParams,{reused:o});return{...n,status:"input_required",statusMessage:t.statusMessage?.trim().slice(0,pe),lastUpdatedAt:this.#r().toISOString(),inputRequests:r}}))}async update(t,r,n){let o=rr(n),i=[],s=[];return await this.#o(t,r,a=>{if(a.status!=="input_required"||!a.inputRequests)return a;let c={...a.inputRequests},d=a.inputResponses?{...a.inputResponses}:{};for(let[u,p]of Object.entries(o))Object.prototype.hasOwnProperty.call(c,u)&&(d[u]=p,delete c[u],i.push(u));return s=Object.keys(c).sort(),i.length===0?a:{...a,status:s.length===0?"working":"input_required",lastUpdatedAt:this.#r().toISOString(),inputRequests:s.length===0?void 0:c,inputResponses:d,consumedInputKeys:[...new Set([...a.consumedInputKeys,...i])].sort()}}),{acceptedKeys:i.sort(),remainingKeys:s}}async takeInputResponses(t,r){let n={};return await this.#o(t,r,o=>(n=structuredClone(o.inputResponses??{}),Object.keys(n).length===0?o:{...o,inputResponses:void 0})),n}async complete(t,r,n){return j(await this.#o(t,r,o=>J(o.status)?o:{...o,status:"completed",statusMessage:"Task completed.",lastUpdatedAt:this.#r().toISOString(),result:structuredClone(n),inputRequests:void 0,error:void 0}))}async fail(t,r,n){let o=sr(n);return j(await this.#o(t,r,i=>J(i.status)?i:{...i,status:"failed",statusMessage:o.message,lastUpdatedAt:this.#r().toISOString(),error:o,inputRequests:void 0,result:void 0}))}async cancel(t,r){return j(await this.#o(t,r,n=>J(n.status)?n:{...n,status:"cancelled",statusMessage:"Task cancelled by the client.",lastUpdatedAt:this.#r().toISOString(),inputRequests:void 0,result:void 0,error:void 0}))}};function iM(e){return new Xe(e)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="cb791784-bde2-5b1d-b5df-038282816043")}catch{}})();var fe="io.modelcontextprotocol/subscriptionId",ar=256,cr=2048,Bh=5e3;function qh(e,t){return new Promise((r,n)=>{let o=setTimeout(()=>n(new Error("MCP subscription sink write timed out")),Bh);o.unref(),Promise.resolve().then(()=>e(t)).then(()=>{clearTimeout(o),r()},i=>{clearTimeout(o),n(i instanceof Error?i:new Error(String(i)))})})}function Ye(e,t){if(e!==void 0){if(typeof e!="boolean")throw new l("Invalid MCP subscription filter",f.invalidParams,{field:`notifications.${t}`,expected:"boolean"});return e||void 0}}function zh(e){if(!_(e))throw new l("Invalid MCP subscription filter",f.invalidParams,{field:"notifications",expected:"object"});let t=Ye(e.toolsListChanged,"toolsListChanged"),r=Ye(e.promptsListChanged,"promptsListChanged"),n=Ye(e.resourcesListChanged,"resourcesListChanged"),o;if(e.resourceSubscriptions!==void 0){if(!Array.isArray(e.resourceSubscriptions)||e.resourceSubscriptions.length>ar)throw new l("Invalid MCP resource subscriptions",f.invalidParams,{field:"notifications.resourceSubscriptions",maximum:ar});let i=new Set;for(let s of e.resourceSubscriptions){if(typeof s!="string"||s.trim().length===0||Buffer.byteLength(s,"utf8")>cr)throw new l("Invalid MCP resource subscription URI",f.invalidParams,{field:"notifications.resourceSubscriptions",maximumBytes:cr});i.add(s)}i.size>0&&(o=[...i].sort())}return{...t?{toolsListChanged:t}:{},...r?{promptsListChanged:r}:{},...n?{resourcesListChanged:n}:{},...o?{resourceSubscriptions:o}:{}}}function Vh(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 dr=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 l("MCP subscription id is already active",f.invalidParams,{subscriptionId:t.id});let r=Vh(zh(t.notifications),this.#e),n={filter:r,sink:t.sink,writeQueue:Promise.resolve()};this.#t.set(t.id,n);try{await this.#n(t.id,n,{jsonrpc:"2.0",method:"notifications/subscriptions/acknowledged",params:{_meta:{[fe]:t.id},notifications:structuredClone(r)}},!0)}catch(o){throw this.#t.delete(t.id),o}return structuredClone(r)}async emitListChanged(t){let r=`${t}ListChanged`,n=`notifications/${t}/list_changed`,o=[];for(let[i,s]of this.#t)s.filter[r]===!0&&o.push(this.#n(i,s,{jsonrpc:"2.0",method:n,params:{_meta:{[fe]:i}}}));return(await Promise.all(o)).filter(Boolean).length}async emitResourceUpdated(t){let r=[];for(let[n,o]of this.#t)o.filter.resourceSubscriptions?.includes(t)&&r.push(this.#n(n,o,{jsonrpc:"2.0",method:"notifications/resources/updated",params:{_meta:{[fe]:n},uri:t}}));return(await Promise.all(r)).filter(Boolean).length}async#n(t,r,n,o=!1){let i=r.writeQueue.then(async()=>{if(this.#t.get(t)!==r)return!1;try{return await qh(r.sink,n),!0}catch(s){if(this.#t.get(t)===r&&this.#t.delete(t),o)throw s;return!1}});return r.writeQueue=i.then(()=>{},()=>{}),i}close(t){if(this.#t.delete(t))return{...ze({resultType:"complete",_meta:{[fe]:t}},this.#r)}}closeAll(){let t=[];for(let r of this.#t.keys()){let n=this.close(r);t.push({id:r,result:n})}return t}};(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="5ffe7128-0fbb-59af-89ef-74d5d799a00d")}catch{}})();var ur=/^=\?base64\?([A-Za-z0-9+/]*={0,2})\?=$/u,Hh=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/u,lr=/^[\t\x20-\x7E]*$/u,pr=new Set(["prompts/get","resources/read","tools/call"]);function Kh(e){let t=new Map;for(let[r,n]of Object.entries(e)){if(n===void 0)continue;let o=typeof n=="string"?n:n.join(", ");t.set(r.toLowerCase(),o)}return t}function A(e,t){throw new l(e,f.headerMismatch,{header:t})}function fr(e){let t=typeof e=="boolean"?String(e).toLowerCase():String(e);return t.length>0&&t.trim()===t&&lr.test(t)&&!ur.test(t)?t:`=?base64?${Buffer.from(t,"utf8").toString("base64")}?=`}function mr(e,t){let r=ur.exec(e);if(r){let n=r[1],o=Buffer.from(n,"base64");return o.toString("base64")!==n||o.length===0?A("Malformed MCP Base64 header value",t):o.toString("utf8")}return e.length===0||e.trim()!==e||!lr.test(e)?A("Malformed MCP header value",t):e}function me(e){return Array.isArray(e)?e.some(me):_(e)?Object.prototype.hasOwnProperty.call(e,"x-mcp-header")||Object.values(e).some(me):!1}function Wh(e,t,r){let n=e["x-mcp-header"];if(n===void 0)return;let o=e.type;if(typeof n!="string"||!Hh.test(n)||!["boolean","integer","string"].includes(String(o))||r.has(n.toLowerCase()))throw new l("Invalid MCP x-mcp-header annotation",f.invalidParams,{field:t.join("."),annotation:n});return r.add(n.toLowerCase()),{name:n,path:t,type:o}}function _r(e){if(!_(e))throw new l("Invalid MCP tool schema",f.invalidParams,{field:"inputSchema",expected:"object"});let t=[],r=new Set,n=(o,i)=>{let s=o.properties;if(s!==void 0){if(!_(s))throw new l("Invalid MCP tool schema properties",f.invalidParams,{field:"inputSchema.properties"});for(let[a,c]of Object.entries(s)){if(!_(c))continue;let d=[...i,a],u=Wh(c,d,r);u&&t.push(u);for(let[p,m]of Object.entries(c))if(p!=="properties"&&p!=="x-mcp-header"&&me(m))throw new l("MCP x-mcp-header is not statically reachable",f.invalidParams,{field:d.join("."),keyword:p});n(c,d)}}};for(let[o,i]of Object.entries(e))if(o!=="properties"&&me(i))throw new l("MCP x-mcp-header is not statically reachable",f.invalidParams,{field:"inputSchema",keyword:o});return n(e,[]),t}function hr(e,t){let r=e;for(let n of t){if(!_(r))return;r=r[n]}return r}function gr(e,t){let r=e==="resources/read"?t.uri:t.name;return typeof r=="string"?r:void 0}function Xh(e,t){let r=_(e.arguments)?e.arguments:{},n={};for(let o of _r(t)){let i=hr(r,o.path);if(i==null)continue;if(!(o.type==="integer"&&typeof i=="number"&&Number.isSafeInteger(i)||o.type==="boolean"&&typeof i=="boolean"||o.type==="string"&&typeof i=="string"))throw new l("Invalid MCP custom header argument",f.invalidParams,{field:o.path.join("."),expected:o.type});n[`Mcp-Param-${o.name}`]=fr(i)}return n}function uM(e){let t=_(e.request.params)?e.request.params:void 0,r=qe(t),n=e.request.method;if(typeof n!="string"||n.length===0)return A("Missing MCP request method","Mcp-Method");let o={Accept:"application/json, text/event-stream","Content-Type":"application/json","MCP-Protocol-Version":r.protocolVersion,"Mcp-Method":n},i=gr(n,t);if(pr.has(n)){if(i===void 0)return A("Missing MCP request name","Mcp-Name");o["Mcp-Name"]=fr(i)}return n==="tools/call"&&e.toolSchema!==void 0&&Object.assign(o,Xh(t,e.toolSchema)),o}function Yh(e,t){let r=t.method;(typeof r!="string"||r.length===0)&&A("Missing MCP request method","Mcp-Method");let n=_(t.params)?t.params:void 0,o=qe(n).protocolVersion;if(e.get("mcp-protocol-version")!==o&&A("MCP protocol header does not match request metadata","MCP-Protocol-Version"),e.get("mcp-method")!==r&&A("MCP method header does not match request body","Mcp-Method"),pr.has(r)){let i=e.get("mcp-name"),s=gr(r,n);(i===void 0||s===void 0||mr(i,"Mcp-Name")!==s)&&A("MCP name header does not match request body","Mcp-Name")}e.has("last-event-id")&&A("MCP SSE resumability is not supported","Last-Event-ID")}function Jh(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 Zh(e){let t=_(e.params.arguments)?e.params.arguments:{};for(let r of _r(e.toolSchema)){let n=hr(t,r.path),o=`Mcp-Param-${r.name}`,i=e.headers.get(o.toLowerCase());if(n==null){i!==void 0&&A("Unexpected MCP parameter header",o);continue}i===void 0&&A("Missing MCP parameter header",o),Jh(r,n,mr(i,o))||A("MCP parameter header does not match request body",o)}}function lM(e){let t=Kh(e.headers),r=typeof e.request.method=="string"?e.request.method:"";Yh(t,e.request),!(r!=="tools/call"||e.toolSchema===void 0)&&Zh({headers:t,params:e.request.params,toolSchema:e.toolSchema})}var pM=U;import{AsyncLocalStorage as Qh}from"node:async_hooks";import{createHash as yr,timingSafeEqual as eg}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="a9aefc86-a8ce-5ecf-bb54-e5fa3ea277c7")}catch{}})();var g=class extends Error{httpStatus;challenge;constructor(t,r,n){super(t),this.name="PmMcpAuthorizationError",this.httpStatus=r,this.challenge=n}},tg=/^00-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})$/u,rg=/^[a-z][a-z0-9_*/-]{0,255}$/u,ng=/^(?:[a-z0-9][a-z0-9_*/-]{0,240})@[a-z][a-z0-9_*/-]{0,13}$/u,og=/^[\x20-\x2B\x2D-\x3C\x3E-\x7E]{0,255}[\x21-\x2B\x2D-\x3C\x3E-\x7E]$/u,Cr=/^[\x21\x23-\x5B\x5D-\x7E]+$/u,Tr=/^[A-Za-z0-9!#$%&'*+.^_`|~-]+$/u,ig=/^[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]*$/u,sg=/%(?![0-9A-Fa-f]{2})/u,ag=512,cg=32,dg=180,ug=8192,lg=8192,Sr=new Qh;function E(e,t,r=!1){if(new RegExp("\\p{Cc}","u").test(e))throw new g(`Invalid ${t}`,401);let n;try{n=new URL(e)}catch{throw new g(`Invalid ${t}`,401)}let o=n.hostname==="127.0.0.1"||n.hostname==="localhost";if(n.hash.length>0||n.protocol!=="https:"&&!(r&&o&&n.protocol==="http:"))throw new g(`Invalid ${t}`,401);return n}function pg(e,t){let r=t.toLowerCase();for(let[n,o]of Object.entries(e))if(!(n.toLowerCase()!==r||o===void 0))return typeof o=="string"?o:o.join(", ")}function gM(e){let t=E(e.resource,"protected resource URI",!0).href.replace(/\/$/u,"");if(e.authorizationServers.length===0)throw new g("Protected resource metadata requires an authorization server",401);let r=e.authorizationServers.map(o=>E(o,"authorization server issuer").href.replace(/\/$/u,"")),n=[...new Set(e.scopes??[])];if(n.some(o=>!Cr.test(o)))throw new g("Invalid authorization scope",401);return{resource:t,authorization_servers:r,...n.length>0?{scopes_supported:n.sort()}:{}}}function yM(e){let t=E(e,"authorization server issuer"),r=t.pathname.replace(/^\/+|\/+$/gu,""),n=t.origin;return r?[`${n}/.well-known/oauth-authorization-server/${r}`,`${n}/.well-known/openid-configuration/${r}`,`${n}/${r}/.well-known/openid-configuration`]:[`${n}/.well-known/oauth-authorization-server`,`${n}/.well-known/openid-configuration`]}function bM(e,t){if(!_(e)||typeof e.issuer!="string")throw new g("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 g("Authorization server issuer mismatch",401);if(!Array.isArray(e.code_challenge_methods_supported)||!e.code_challenge_methods_supported.includes("S256"))throw new g("Authorization server does not support required S256 PKCE",401);let o=d=>{let u=e[d];if(typeof u!="string")throw new g(`Authorization server metadata requires ${d}`,401);return E(u,d).href},i=d=>{let u=e[d];return typeof u=="string"?E(u,d).href:void 0},s=o("authorization_endpoint"),a=o("token_endpoint"),c=i("registration_endpoint");return{issuer:r,authorization_endpoint:s,token_endpoint:a,code_challenge_methods_supported:[...new Set(e.code_challenge_methods_supported.filter(d=>typeof d=="string"))],...e.client_id_metadata_document_supported===!0?{client_id_metadata_document_supported:!0}:{},...c?{registration_endpoint:c}:{}}}function CM(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 TM(e){if(e.responseIssuer===void 0){if(e.issuerParameterSupported)throw new g("Authorization response omitted the advertised issuer",401);return}if(e.responseIssuer!==e.expectedIssuer)throw new g("Authorization response issuer mismatch",401)}function SM(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 g("Invalid Client ID Metadata Document",401);for(let n of e.redirect_uris){if(typeof n!="string")throw new g("Invalid client redirect URI",401);E(n,"client redirect URI",!0)}return structuredClone(e)}function wM(e){if(e.redirectUris.length===0||e.clientName.trim().length===0)throw new g("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 br=class{#e=new Map;set(t,r){let n=E(t,"credential issuer").href;this.#e.set(n,structuredClone(r))}get(t){let r=E(t,"credential issuer").href,n=this.#e.get(r);return n?structuredClone(n):void 0}delete(t){let r=E(t,"credential issuer").href;return this.#e.delete(r)}};function fg(e){let t=e.traceparent,r=e.tracestate;if(t!==void 0){let n=typeof t=="string"?tg.exec(t):null;if(!n)throw new g("Invalid MCP traceparent",403);let o=n[1],i=n[2];if(/^0+$/u.test(o)||/^0+$/u.test(i))throw new g("Invalid MCP traceparent",403)}if(r!==void 0&&(typeof r!="string"||!_g(r)))throw new g("Invalid MCP tracestate",403);return{...typeof t=="string"?{traceparent:t}:{},...typeof r=="string"?{tracestate:r}:{}}}function k(e){return e.replace(/^[ \t]*|[ \t]*$/gu,"")}function mg(e){return rg.test(e)||ng.test(e)}function _g(e){if(Buffer.byteLength(e,"utf8")>ag)return!1;let t=e.split(",");if(t.length>cg)return!1;let r=new Set;for(let n of t){let o=k(n);if(o.length===0)continue;let i=o.indexOf("="),s=i>0?o.slice(0,i):"",a=i>0?o.slice(i+1):"";if(!mg(s)||!og.test(a)||r.has(s))return!1;r.add(s)}return!0}function wr(e){return ig.test(e)&&!sg.test(e)}function hg(e){let t=k(e),r=t.indexOf("="),n=k(r>=0?t.slice(0,r):t),o=r>=0?k(t.slice(r+1)):void 0;return Tr.test(n)&&(o===void 0||wr(o))}function gg(e){let t=k(e),r=t.split(";"),n=r[0],o=r.slice(1),i=n.indexOf("="),s=k(i>0?n.slice(0,i):""),a=i>0?k(n.slice(i+1)):"";if(!(!Tr.test(s)||!wr(a)||!o.every(hg)))return{key:s,serialized:t}}function yg(e,t){if(e===void 0)return;if(typeof e!="string"||Buffer.byteLength(e,"utf8")>ug)throw new g("Invalid MCP baggage",403);let r=new Set(t),n=e.split(",");if(n.length>dg)throw new g("Invalid MCP baggage",403);let o=[];for(let i of n){let s=gg(i);if(!s)throw new g("Invalid MCP baggage",403);r.has(s.key)&&o.push(s.serialized)}return o.length>0?o.join(","):void 0}function EM(e,t={}){let r=_(e)&&_(e._meta)?e._meta:{},n=yg(r.baggage,t.baggageAllowlist??[]);return{...fg(r),...n?{baggage:n}:{}}}function AM(e,t){return Sr.run(structuredClone(e),t)}function xM(){let e=Sr.getStore();return e?{...e}:void 0}async function RM(e){let t=E(e.policy.resourceMetadataUrl,"protected resource metadata URL",!0).href,r=[...new Set(e.policy.requiredScopes??[])];if(r.some(p=>!Cr.test(p)))throw new g("Invalid authorization scope",401);let n=`Bearer resource_metadata="${t}"`;if(new URL(e.requestUrl,e.policy.resource).searchParams.has("access_token"))throw new g("Access tokens must not appear in URI query parameters",401,n);let s=pg(e.headers,"authorization")?.match(/^Bearer ([^\s]+)$/iu);if(!s)throw new g("Missing or malformed bearer token",401,n);let a=s[1];if(Buffer.byteLength(a,"utf8")>lg)throw new g("Missing or malformed bearer token",401,n);let c;try{c=await e.policy.verifyAccessToken(a)}catch{throw new g("Invalid bearer token",401,n)}let d=Array.isArray(c.audience)?c.audience:[c.audience];if(c.issuer!==e.policy.issuer||!d.includes(e.policy.resource))throw new g("Bearer token issuer or audience mismatch",401,n);let u=r.filter(p=>!c.scopes.includes(p));if(u.length>0)throw new g("Bearer token has insufficient scope",403,`${n}, scope="${u.join(" ")}"`);return{...c,audience:[...d],scopes:[...c.scopes]}}function OM(e){let t=yr("sha256").update(e.token).digest();return r=>{let n=yr("sha256").update(r).digest();if(!eg(t,n))throw new g("Invalid bearer token",401);return structuredClone(e.claims)}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="e6c49c89-781e-59a3-9c19-6a1c40424587")}catch{}})();var Je="io.modelcontextprotocol/ui",_e="2026-01-26",xr="text/html;profile=mcp-app",Er=Object.freeze({specVersion:_e,mimeTypes:[xr]});function MM(e){let t=e.clientCapabilities.extensions;if(!_(t))return!1;let r=t[Je];if(r===void 0)return!1;if(!_(r))throw new l("Invalid MCP Apps client capability",f.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[Je]:Er}}});let n=r.mimeTypes,o=r.specVersion;if(!Array.isArray(n)||!n.includes(xr)||o!==void 0&&o!==_e)throw new l("Unsupported MCP Apps client capability",f.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[Je]:Er}}});return!0}var bg={csp:{connectDomains:[],resourceDomains:[],frameDomains:[]},permissions:{},prefersBorder:!0},Rr=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:bg})));function kM(e){return Rr.find(t=>t.uri===e)}function vM(e){let t=new Map(Rr.map(r=>[r.toolName,r]));return e.map(r=>{let n=t.get(r.name);return n?{...r,_meta:{...r._meta,ui:n.toolMeta}}:{...r}})}function Ar(e){return e.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function NM(e){let t=Ar(e.name),r=Ar(e.description),n=JSON.stringify({name:`pm-${e.id}-view`,version:_e}),o=JSON.stringify(_e);return`<!doctype html>
|
|
3
3
|
<html lang="en">
|
|
4
4
|
<head>
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
*/
|
|
20
20
|
/** Registry of every non-extension `pm health` / `pm validate` warning code and its remediation. Extension findings keep their richer, contextual `details.triage.remediation` produced by the extension health triage and are intentionally excluded here (see pm-0hnu: "all non-extension checks"). */
|
|
21
21
|
|
|
22
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
22
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="24a69725-363a-59e1-96c6-1e1ca079a311")}catch(e){}}();
|
|
23
23
|
export const REMEDIATION_REGISTRY = Object.freeze([
|
|
24
24
|
// --- pm health: directories ---
|
|
25
25
|
{
|
|
@@ -200,8 +200,13 @@ export const REMEDIATION_REGISTRY = Object.freeze([
|
|
|
200
200
|
},
|
|
201
201
|
{
|
|
202
202
|
code: "merge_receipt_evidence_invalid",
|
|
203
|
-
command: "pm
|
|
204
|
-
summary: "One or more receipt
|
|
203
|
+
command: "pm merge report --include-reconciled --json",
|
|
204
|
+
summary: "One or more receipt candidates failed bounded-file, schema, identity, or copy-consistency validation; inspect the report's privacy-safe source, receipt id, and reason before repairing only the named evidence.",
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
code: "merge_receipt_history_reference_missing",
|
|
208
|
+
command: "pm health --check-only --full --json",
|
|
209
|
+
summary: "One or more append-only history coordinates reference receipt evidence that is no longer present; inspect the bounded item, line, and privacy-safe receipt locator, then recover the named evidence from an authoritative clone or backup without rewriting history.",
|
|
205
210
|
},
|
|
206
211
|
{
|
|
207
212
|
code: "validate_merge_decisions_unreviewed",
|
|
@@ -499,4 +504,4 @@ export function buildRemediationCommands(warnings) {
|
|
|
499
504
|
return Object.values(buildRemediationMap(warnings));
|
|
500
505
|
}
|
|
501
506
|
//# sourceMappingURL=remediation.js.map
|
|
502
|
-
//# debugId=
|
|
507
|
+
//# debugId=24a69725-363a-59e1-96c6-1e1ca079a311
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** Generated partition 1 of the exhaustive error-code catalog. */
|
|
2
2
|
|
|
3
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
3
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="4734edf6-c174-50d0-b4e9-1003bc8a20bf")}catch(e){}}();
|
|
4
4
|
export const PM_ERROR_CODE_CATALOG_PART_1 = [
|
|
5
5
|
{
|
|
6
6
|
code: "acceptance_criteria_mutation_conflict",
|
|
@@ -2076,6 +2076,18 @@ export const PM_ERROR_CODE_CATALOG_PART_1 = [
|
|
|
2076
2076
|
canonical_code: "merge_receipt_evidence_invalid",
|
|
2077
2077
|
aliases: [],
|
|
2078
2078
|
},
|
|
2079
|
+
{
|
|
2080
|
+
code: "merge_receipt_history_reference_missing",
|
|
2081
|
+
meaning: "Merge receipt history reference missing condition.",
|
|
2082
|
+
stability: "provisional",
|
|
2083
|
+
exit_code: 1,
|
|
2084
|
+
class: "generic_failure",
|
|
2085
|
+
recovery: "Inspect the structured error guidance and retry the suggested command.",
|
|
2086
|
+
sources: ["core/diagnostics/remediation.ts"],
|
|
2087
|
+
emitting_commands: ["*"],
|
|
2088
|
+
canonical_code: "merge_receipt_history_reference_missing",
|
|
2089
|
+
aliases: [],
|
|
2090
|
+
},
|
|
2079
2091
|
{
|
|
2080
2092
|
code: "merge_receipts_pending",
|
|
2081
2093
|
meaning: "Merge receipts pending condition.",
|
|
@@ -2150,4 +2162,4 @@ export const PM_ERROR_CODE_CATALOG_PART_1 = [
|
|
|
2150
2162
|
},
|
|
2151
2163
|
];
|
|
2152
2164
|
//# sourceMappingURL=generated-error-code-catalog-part-1.js.map
|
|
2153
|
-
//# debugId=
|
|
2165
|
+
//# debugId=4734edf6-c174-50d0-b4e9-1003bc8a20bf
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Implements the pm health command surface and its agent-facing runtime behavior.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
7
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="f27cb24d-f2c8-5034-b655-84c577de7a16")}catch(e){}}();
|
|
8
8
|
import fs from "node:fs/promises";
|
|
9
9
|
import path from "node:path";
|
|
10
10
|
import { assertInitializedTracker } from "../environment/tracker-preflight.js";
|
|
@@ -28,6 +28,7 @@ import { EXIT_CODE, PM_CORE_REQUIRED_SUBDIRS, TYPE_TO_FOLDER, } from "../../core
|
|
|
28
28
|
import { findFirstMergeConflictMarker } from "../../core/shared/conflict-markers.js";
|
|
29
29
|
import { PmCliError } from "../../core/shared/errors.js";
|
|
30
30
|
import { toNonEmptyStringOrUndefined } from "../../core/shared/primitives.js";
|
|
31
|
+
import { sha256Hex } from "../../core/shared/serialization.js";
|
|
31
32
|
import { nowIso } from "../../core/shared/time.js";
|
|
32
33
|
import { parseItemDocument } from "../../core/item/item-format.js";
|
|
33
34
|
import { effectiveItemFormatVersion, scanItemFormatVersions, } from "../../core/item/item-format-version.js";
|
|
@@ -46,7 +47,7 @@ import { buildCapabilityContractMetadata, buildRegistrationCollisionRemediation,
|
|
|
46
47
|
import { scanStaleInProgressItems, } from "./stale-work.js";
|
|
47
48
|
import { scanTrackedRuntimeCache } from "./tracked-runtime-cache.js";
|
|
48
49
|
import { auditMergeDriverConfiguration, findGitWorkspaceRoot, } from "../merge/install.js";
|
|
49
|
-
import { inspectMergeReceiptEvidence, partitionMergeReceipts, } from "../merge/receipts.js";
|
|
50
|
+
import { inspectMergeReceiptEvidence, isSafeReceiptId, partitionMergeReceipts, } from "../merge/receipts.js";
|
|
50
51
|
import { runHistoryRepair } from "../history-repair.js";
|
|
51
52
|
import { resolveWorkspaceRelationshipKindRegistry } from "../graph/assembly.js";
|
|
52
53
|
import { analyzeHierarchyIntegrity, } from "../graph/hierarchy-integrity.js";
|
|
@@ -278,11 +279,41 @@ async function scanItemIntegrity(pmRoot, typeToFolder, schema) {
|
|
|
278
279
|
}
|
|
279
280
|
return { paths, unreadable, conflictMarkers, parseFailures, formatVersions };
|
|
280
281
|
}
|
|
282
|
+
function mergeReceiptIdsFromHistoryEntry(value) {
|
|
283
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
284
|
+
return [];
|
|
285
|
+
}
|
|
286
|
+
const context = value.context;
|
|
287
|
+
if (typeof context !== "object" ||
|
|
288
|
+
context === null ||
|
|
289
|
+
Array.isArray(context)) {
|
|
290
|
+
return [];
|
|
291
|
+
}
|
|
292
|
+
const merge = context.merge;
|
|
293
|
+
if (typeof merge !== "object" || merge === null || Array.isArray(merge)) {
|
|
294
|
+
return [];
|
|
295
|
+
}
|
|
296
|
+
const receipts = merge.receipts;
|
|
297
|
+
if (!Array.isArray(receipts))
|
|
298
|
+
return [];
|
|
299
|
+
return receipts.flatMap((receipt) => {
|
|
300
|
+
if (typeof receipt !== "object" ||
|
|
301
|
+
receipt === null ||
|
|
302
|
+
Array.isArray(receipt)) {
|
|
303
|
+
return [];
|
|
304
|
+
}
|
|
305
|
+
const receiptId = receipt.receipt_id;
|
|
306
|
+
return typeof receiptId === "string" && receiptId.length > 0
|
|
307
|
+
? [receiptId]
|
|
308
|
+
: [];
|
|
309
|
+
});
|
|
310
|
+
}
|
|
281
311
|
async function scanHistoryIntegrity(pmRoot) {
|
|
282
312
|
const historyDir = path.join(pmRoot, "history");
|
|
283
313
|
const unreadable = [];
|
|
284
314
|
const conflictMarkers = [];
|
|
285
315
|
const invalidJson = [];
|
|
316
|
+
const mergeReceiptReferences = [];
|
|
286
317
|
let files = [];
|
|
287
318
|
try {
|
|
288
319
|
files = (await fs.readdir(historyDir))
|
|
@@ -314,14 +345,25 @@ async function scanHistoryIntegrity(pmRoot) {
|
|
|
314
345
|
if (!line.trim())
|
|
315
346
|
return;
|
|
316
347
|
try {
|
|
317
|
-
JSON.parse(line);
|
|
348
|
+
const parsed = JSON.parse(line);
|
|
349
|
+
mergeReceiptReferences.push(...mergeReceiptIdsFromHistoryEntry(parsed).map((receiptId) => ({
|
|
350
|
+
itemId,
|
|
351
|
+
line: index + 1,
|
|
352
|
+
receiptId,
|
|
353
|
+
})));
|
|
318
354
|
}
|
|
319
355
|
catch {
|
|
320
356
|
invalidJson.push({ id: itemId, line: index + 1 });
|
|
321
357
|
}
|
|
322
358
|
});
|
|
323
359
|
}
|
|
324
|
-
return {
|
|
360
|
+
return {
|
|
361
|
+
files,
|
|
362
|
+
unreadable,
|
|
363
|
+
conflictMarkers,
|
|
364
|
+
invalidJson,
|
|
365
|
+
mergeReceiptReferences,
|
|
366
|
+
};
|
|
325
367
|
}
|
|
326
368
|
function buildHierarchyIntegrityWarnings(analysis) {
|
|
327
369
|
return [
|
|
@@ -336,10 +378,15 @@ function buildHierarchyIntegrityWarnings(analysis) {
|
|
|
336
378
|
: `integrity_hierarchy_divergence:${finding.child_id}`),
|
|
337
379
|
];
|
|
338
380
|
}
|
|
339
|
-
function buildMergeReceiptEvidenceWarnings(
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
381
|
+
function buildMergeReceiptEvidenceWarnings(params) {
|
|
382
|
+
const warnings = [];
|
|
383
|
+
if (params.invalidEvidenceCount > 0) {
|
|
384
|
+
warnings.push(`merge_receipt_evidence_invalid:${params.invalidEvidenceCount}`);
|
|
385
|
+
}
|
|
386
|
+
if (params.missingHistoryReferenceCount > 0) {
|
|
387
|
+
warnings.push(`merge_receipt_history_reference_missing:${params.missingHistoryReferenceCount}`);
|
|
388
|
+
}
|
|
389
|
+
return warnings;
|
|
343
390
|
}
|
|
344
391
|
async function buildIntegrityCheck(pmRoot, typeToFolder, schema, requireMergeDrivers, items) {
|
|
345
392
|
const itemScan = await scanItemIntegrity(pmRoot, typeToFolder, schema);
|
|
@@ -353,10 +400,21 @@ async function buildIntegrityCheck(pmRoot, typeToFolder, schema, requireMergeDri
|
|
|
353
400
|
? null
|
|
354
401
|
: await auditMergeDriverConfiguration(gitWorkspaceRoot);
|
|
355
402
|
const mergeReceiptEvidence = await inspectMergeReceiptEvidence(gitWorkspaceRoot ?? pmRoot, {
|
|
403
|
+
includeReconciled: true,
|
|
356
404
|
includeLossless: true,
|
|
357
405
|
pmRoot,
|
|
358
406
|
});
|
|
359
|
-
const
|
|
407
|
+
const availableMergeReceiptIds = new Set(mergeReceiptEvidence.receipts.map((receipt) => receipt.id));
|
|
408
|
+
const missingMergeReceiptReferences = historyScan.mergeReceiptReferences
|
|
409
|
+
.filter((reference) => !availableMergeReceiptIds.has(reference.receiptId))
|
|
410
|
+
.map((reference) => ({
|
|
411
|
+
item_id: reference.itemId,
|
|
412
|
+
history_line: reference.line,
|
|
413
|
+
...(isSafeReceiptId(reference.receiptId)
|
|
414
|
+
? { receipt_id: reference.receiptId }
|
|
415
|
+
: { receipt_reference_hash: sha256Hex(reference.receiptId) }),
|
|
416
|
+
}));
|
|
417
|
+
const pendingMergeReceipts = mergeReceiptEvidence.receipts.filter((receipt) => receipt.state === "pending");
|
|
360
418
|
const { pendingDecisions: pendingMergeDecisions, lossless: losslessMergeReceipts, } = partitionMergeReceipts(pendingMergeReceipts);
|
|
361
419
|
const mergeDriverInstallationMissing = mergeDriverAudit?.status === "missing" &&
|
|
362
420
|
mergeDriverAudit.missing_keys.length === 5 &&
|
|
@@ -389,7 +447,10 @@ async function buildIntegrityCheck(pmRoot, typeToFolder, schema, requireMergeDri
|
|
|
389
447
|
...(losslessMergeReceipts.length > 0
|
|
390
448
|
? [`merge_receipts_pending:${losslessMergeReceipts.length}`]
|
|
391
449
|
: []),
|
|
392
|
-
...buildMergeReceiptEvidenceWarnings(
|
|
450
|
+
...buildMergeReceiptEvidenceWarnings({
|
|
451
|
+
invalidEvidenceCount: mergeReceiptEvidence.invalid_evidence_count,
|
|
452
|
+
missingHistoryReferenceCount: missingMergeReceiptReferences.length,
|
|
453
|
+
}),
|
|
393
454
|
];
|
|
394
455
|
const normalizedWarnings = [...new Set(warnings)].sort((left, right) => left.localeCompare(right));
|
|
395
456
|
const actionableWarnings = normalizedWarnings.filter((warning) => !warning.startsWith("integrity_legacy_hierarchy_"));
|
|
@@ -421,6 +482,7 @@ async function buildIntegrityCheck(pmRoot, typeToFolder, schema, requireMergeDri
|
|
|
421
482
|
pending_merge_decisions: pendingMergeDecisions.length,
|
|
422
483
|
lossless_merge_receipts: losslessMergeReceipts.length,
|
|
423
484
|
invalid_merge_receipt_evidence: mergeReceiptEvidence.invalid_evidence_count,
|
|
485
|
+
missing_merge_receipt_history_references: missingMergeReceiptReferences.length,
|
|
424
486
|
},
|
|
425
487
|
item_unreadable: itemScan.unreadable,
|
|
426
488
|
item_conflict_markers: itemScan.conflictMarkers,
|
|
@@ -452,6 +514,10 @@ async function buildIntegrityCheck(pmRoot, typeToFolder, schema, requireMergeDri
|
|
|
452
514
|
lossless_merge_receipt_items: [
|
|
453
515
|
...new Set(losslessMergeReceipts.map((receipt) => receipt.item_id)),
|
|
454
516
|
].sort((left, right) => left.localeCompare(right)),
|
|
517
|
+
invalid_merge_receipt_evidence_details: mergeReceiptEvidence.invalid_evidence,
|
|
518
|
+
invalid_merge_receipt_evidence_details_truncated: mergeReceiptEvidence.invalid_evidence_truncated,
|
|
519
|
+
missing_merge_receipt_history_reference_details: missingMergeReceiptReferences.slice(0, HEALTH_WARNING_LIMIT),
|
|
520
|
+
missing_merge_receipt_history_reference_details_truncated: missingMergeReceiptReferences.length > HEALTH_WARNING_LIMIT,
|
|
455
521
|
},
|
|
456
522
|
},
|
|
457
523
|
warnings: normalizedWarnings,
|
|
@@ -2309,4 +2375,4 @@ export const _testOnlyHealthCommand = {
|
|
|
2309
2375
|
warningCode,
|
|
2310
2376
|
};
|
|
2311
2377
|
//# sourceMappingURL=health.js.map
|
|
2312
|
-
//# debugId=
|
|
2378
|
+
//# debugId=f27cb24d-f2c8-5034-b655-84c577de7a16
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Implements the pm validate command surface and its agent-facing runtime behavior.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
7
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="0d466293-869d-54bb-b07d-facb3be51e8c")}catch(e){}}();
|
|
8
8
|
import { assertInitializedTracker } from "../environment/tracker-preflight.js";
|
|
9
9
|
import fs from "node:fs/promises";
|
|
10
10
|
import { realpathSync } from "node:fs";
|
|
@@ -2053,6 +2053,8 @@ async function buildStorageIntegrityCheck(pmRoot, items, typeToFolder, settings)
|
|
|
2053
2053
|
].sort((left, right) => left.localeCompare(right)),
|
|
2054
2054
|
lossless_merge_receipt_count: losslessMergeReceipts.length,
|
|
2055
2055
|
invalid_merge_receipt_evidence_count: mergeReceiptEvidence.invalid_evidence_count,
|
|
2056
|
+
invalid_merge_receipt_evidence_details: mergeReceiptEvidence.invalid_evidence,
|
|
2057
|
+
invalid_merge_receipt_evidence_details_truncated: mergeReceiptEvidence.invalid_evidence_truncated,
|
|
2056
2058
|
lossless_merge_receipt_items: [
|
|
2057
2059
|
...new Set(losslessMergeReceipts.map((receipt) => receipt.item_id)),
|
|
2058
2060
|
].sort((left, right) => left.localeCompare(right)),
|
|
@@ -2273,4 +2275,4 @@ export async function runValidate(options, global, services = {}) {
|
|
|
2273
2275
|
}
|
|
2274
2276
|
/* c8 ignore stop */
|
|
2275
2277
|
//# sourceMappingURL=validate.js.map
|
|
2276
|
-
//# debugId=
|
|
2278
|
+
//# debugId=0d466293-869d-54bb-b07d-facb3be51e8c
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* this module so packages and hosts can reuse the same merge behavior.
|
|
8
8
|
*/
|
|
9
9
|
export { ITEM_LATEST_TIMESTAMP_FIELDS, ITEM_UNION_COLLECTION_FIELDS, mergeHistoryStreams, mergeItemDocuments, mergeJsonDocuments, mergeRelationshipEventStreams, type HistoryMergeResult, type HistoryMergeStrategy, type ItemDocumentMergeResult, type JsonDocumentMergeResult, type ItemMergeConflictDecision, type MergePreferredSide, type RelationshipStreamMergeResult, } from "./three-way.js";
|
|
10
|
-
export { inspectMergeReceiptEvidence, listMergeReceipts, markMergeReceiptReconciled, runMergeReceiptEvidenceReport, runMergeReceiptReport, summarizeMergeReceipt, type MergeDecisionReceipt, type MergeDecisionReceiptSummary, type MergeReceiptEvidenceReport, type MergeReceiptEvidenceScan, type MergeReceiptReport, } from "./receipts.js";
|
|
10
|
+
export { inspectMergeReceiptEvidence, listMergeReceipts, markMergeReceiptReconciled, runMergeReceiptEvidenceReport, runMergeReceiptReport, summarizeMergeReceipt, type MergeDecisionReceipt, type MergeDecisionReceiptSummary, type MergeReceiptEvidenceReport, type MergeReceiptEvidenceScan, type MergeReceiptInvalidEvidence, type MergeReceiptReport, } from "./receipts.js";
|
|
11
11
|
export { MERGE_DRIVER_ARTIFACT_VALUES, runMergeDriver, type MergeDriverArtifact, type MergeDriverOptions, type MergeDriverResult, } from "./driver.js";
|
|
12
12
|
export { auditMergeAttributeFence, auditMergeDriverConfiguration, buildMergeAttributePatterns, findGitWorkspaceRoot, PM_GITATTRIBUTES_END, PM_GITATTRIBUTES_START, PM_GITATTRIBUTES_V2_END, PM_GITATTRIBUTES_V2_START, refreshMergeAttributeFenceIfInstalled, resolveMergeInstallContext, runMergeInstall, type MergeFenceAuditResult, type MergeDriverConfigurationAuditResult, type MergeFenceRefreshOutcome, type MergeInstallOptions, type MergeInstallContextResolution, type MergeInstallResult, } from "./install.js";
|
|
13
13
|
export { runMergeReconcile, type MergeReconcileOptions, type MergeReconcileResult, } from "./reconcile.js";
|
package/dist/sdk/merge/index.js
CHANGED
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
* this module so packages and hosts can reuse the same merge behavior.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
10
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="0a17e896-d54a-5796-8be3-535179c4d6e0")}catch(e){}}();
|
|
11
11
|
export { ITEM_LATEST_TIMESTAMP_FIELDS, ITEM_UNION_COLLECTION_FIELDS, mergeHistoryStreams, mergeItemDocuments, mergeJsonDocuments, mergeRelationshipEventStreams, } from "./three-way.js";
|
|
12
12
|
export { inspectMergeReceiptEvidence, listMergeReceipts, markMergeReceiptReconciled, runMergeReceiptEvidenceReport, runMergeReceiptReport, summarizeMergeReceipt, } from "./receipts.js";
|
|
13
13
|
export { MERGE_DRIVER_ARTIFACT_VALUES, runMergeDriver, } from "./driver.js";
|
|
14
14
|
export { auditMergeAttributeFence, auditMergeDriverConfiguration, buildMergeAttributePatterns, findGitWorkspaceRoot, PM_GITATTRIBUTES_END, PM_GITATTRIBUTES_START, PM_GITATTRIBUTES_V2_END, PM_GITATTRIBUTES_V2_START, refreshMergeAttributeFenceIfInstalled, resolveMergeInstallContext, runMergeInstall, } from "./install.js";
|
|
15
15
|
export { runMergeReconcile, } from "./reconcile.js";
|
|
16
16
|
//# sourceMappingURL=index.js.map
|
|
17
|
-
//# debugId=
|
|
17
|
+
//# debugId=0a17e896-d54a-5796-8be3-535179c4d6e0
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import type { Stats } from "node:fs";
|
|
1
2
|
import type { ItemMergeConflictDecision, MergePreferredSide } from "./three-way.js";
|
|
3
|
+
/** Return whether a receipt id is safe to expose in cleartext diagnostics. */
|
|
4
|
+
export declare function isSafeReceiptId(value: string): boolean;
|
|
2
5
|
/** One clone-local merge receipt with recoverable branch values. */
|
|
3
6
|
export interface MergeDecisionReceipt {
|
|
4
7
|
/** Receipt schema version. */
|
|
@@ -80,6 +83,10 @@ export interface MergeReceiptEvidenceReport {
|
|
|
80
83
|
count: number;
|
|
81
84
|
/** Number of candidates rejected by bounded-file, schema, identity, or copy-consistency validation. */
|
|
82
85
|
invalid_evidence_count: number;
|
|
86
|
+
/** Bounded privacy-safe identities and reason codes for rejected evidence. */
|
|
87
|
+
invalid_evidence: MergeReceiptInvalidEvidence[];
|
|
88
|
+
/** Whether additional rejected evidence was omitted from the bounded detail list. */
|
|
89
|
+
invalid_evidence_truncated: boolean;
|
|
83
90
|
/** Whether the clone-local Git receipt directory was resolved successfully; always emitted by current implementations and optional for structural compatibility. */
|
|
84
91
|
clone_local_evidence_resolved?: boolean;
|
|
85
92
|
/** Receipts including recoverable values from the local clone only. */
|
|
@@ -93,9 +100,24 @@ export interface MergeReceiptEvidenceScan {
|
|
|
93
100
|
receipts: MergeDecisionReceipt[];
|
|
94
101
|
/** Number of JSON receipt candidates that could not be validated safely. */
|
|
95
102
|
invalid_evidence_count: number;
|
|
103
|
+
/** Bounded privacy-safe identities and reason codes for rejected evidence. */
|
|
104
|
+
invalid_evidence: MergeReceiptInvalidEvidence[];
|
|
105
|
+
/** Whether additional rejected evidence was omitted from the bounded detail list. */
|
|
106
|
+
invalid_evidence_truncated: boolean;
|
|
96
107
|
/** Whether the clone-local Git receipt directory was resolved successfully; always emitted by current implementations and optional for structural compatibility. */
|
|
97
108
|
clone_local_evidence_resolved?: boolean;
|
|
98
109
|
}
|
|
110
|
+
/** Stable privacy-safe classification for one rejected receipt candidate or source. */
|
|
111
|
+
export interface MergeReceiptInvalidEvidence {
|
|
112
|
+
/** Evidence store that produced the rejected candidate. */
|
|
113
|
+
evidence_source: "clone_local" | "durable" | "clone_local_and_durable";
|
|
114
|
+
/** Stable failure class suitable for remediation routing and graph analytics. */
|
|
115
|
+
reason: "directory_unreadable" | "candidate_not_bounded_regular_file" | "candidate_unreadable" | "candidate_invalid_json" | "schema_or_identity_invalid" | "copy_provenance_mismatch";
|
|
116
|
+
/** Receipt identity when the bounded filename itself is a valid receipt id. */
|
|
117
|
+
receipt_id?: string;
|
|
118
|
+
/** SHA-256 locator for an unsafe or malformed candidate filename. */
|
|
119
|
+
candidate_name_hash?: string;
|
|
120
|
+
}
|
|
99
121
|
declare function prepareReceiptSettlement(params: {
|
|
100
122
|
receiptPath: string;
|
|
101
123
|
receiptId: string;
|
|
@@ -120,6 +142,7 @@ export declare function writeMergeReceipt(params: {
|
|
|
120
142
|
mergedFieldHashes?: Record<string, string>;
|
|
121
143
|
decisions: ItemMergeConflictDecision[];
|
|
122
144
|
}): Promise<MergeDecisionReceipt | null>;
|
|
145
|
+
declare function receiptDirectoryFailureMeansAbsent(directory: string, error: unknown, inspectAncestor?: (ancestor: string) => Promise<Pick<Stats, "isDirectory">>): Promise<boolean>;
|
|
123
146
|
/** Inspect valid receipts and count invalid evidence without returning untrusted file contents. */
|
|
124
147
|
export declare function inspectMergeReceiptEvidence(cwd: string, options?: {
|
|
125
148
|
/** Include receipts whose reconciliation state is already settled. */
|
|
@@ -163,5 +186,6 @@ export declare function runMergeReceiptEvidenceReport(options: {
|
|
|
163
186
|
/** Test-only seams for deterministic receipt-boundary fault coverage. */
|
|
164
187
|
export declare const _testOnlyMergeReceipts: {
|
|
165
188
|
prepareReceiptSettlement: typeof prepareReceiptSettlement;
|
|
189
|
+
receiptDirectoryFailureMeansAbsent: typeof receiptDirectoryFailureMeansAbsent;
|
|
166
190
|
};
|
|
167
191
|
export {};
|