@unbrained/pm-cli 2026.9.20 → 2026.9.21
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 +11 -0
- package/dist/cli-bundle/bundle-manifest.json +28 -28
- package/dist/cli-bundle/chunks/{chunk-33R5PEKI.js → chunk-4SI67A2F.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-TTFVQB4S.js → chunk-NHRB3L5T.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-2FEKKSLN.js → chunk-SDLBF4PY.js} +43 -43
- package/dist/cli-bundle/chunks/{register-mutation-EVRYSU72.js → register-mutation-DXES37MA.js} +2 -2
- package/dist/cli-bundle/main.js +2 -2
- package/dist/cli-bundle/sdk-core.js +21 -21
- 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/sdk/completion/bash.d.ts +1 -1
- package/dist/sdk/completion/bash.js +1 -1
- package/docs/README.md +1 -0
- package/docs/VALIDATION_PORTABILITY.md +82 -0
- package/marketplace.json +2 -2
- package/package.json +5 -5
- 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/extensions/guide-shell/runtime.ts +23 -17
- 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
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{$a as oc,$b as od,Aa as Kb,Ab as Pc,Ba as Lb,Bb as Qc,Ca as Mb,Cb as Rc,Da as Nb,Db as Sc,Ea as Ob,Eb as Tc,Fa as Pb,Fb as Uc,Ga as Qb,Gb as Vc,Ha as Rb,Hb as Wc,Ia as Sb,Ib as Xc,Ja as Tb,Jb as Yc,Ka as Ub,Kb as Zc,La as Vb,Lb as _c,Ma as Wb,Mb as $c,Na as Xb,Nb as ad,Oa as Yb,Ob as bd,Pa as Zb,Pb as cd,Qa as _b,Qb as dd,Ra as $b,Rb as ed,S as sb,Sa as ac,Sb as fd,T as tb,Ta as bc,Tb as gd,U as ub,Ua as cc,Ub as hd,V as vb,Va as dc,Vb as id,Wa as jc,Wb as jd,Xa as kc,Xb as kd,Ya as lc,Yb as ld,Za as mc,Zb as md,_a as nc,_b as nd,ab as pc,ac as pd,bb as qc,bc as qd,cb as rc,cc as rd,db as sc,dc as sd,eb as tc,ec as td,fb as uc,fc as ud,g as Y,gb as vc,gc as vd,h as Z,hb as wc,hc as wd,i as _,ib as xc,ic as xd,ja as Ab,jb as yc,jc as yd,ka as Bb,kb as zc,kc as zd,lb as Ac,lc as Ad,mb as Bc,mc as Bd,n as Ra,nb as Cc,nc as Cd,o as Sa,ob as Dc,oc as Dd,p as Ta,pb as Ec,pc as Ed,q as Ua,qb as Fc,qc as Fd,r as Va,rb as Gc,rc as Gd,sa as Cb,sb as Hc,sc as Hd,ta as Db,tb as Ic,tc as Id,ua as Eb,ub as Jc,uc as Jd,va as Fb,vb as Kc,vc as Kd,w as cb,wa as Gb,wb as Lc,wc as Ld,x as db,xa as Hb,xb as Mc,xc as Md,y as eb,ya as Ib,yb as Nc,yc as Nd,z as gb,za as Jb,zb as Oc,zc as Od}from"./chunks/chunk-
|
|
1
|
+
import{$a as oc,$b as od,Aa as Kb,Ab as Pc,Ba as Lb,Bb as Qc,Ca as Mb,Cb as Rc,Da as Nb,Db as Sc,Ea as Ob,Eb as Tc,Fa as Pb,Fb as Uc,Ga as Qb,Gb as Vc,Ha as Rb,Hb as Wc,Ia as Sb,Ib as Xc,Ja as Tb,Jb as Yc,Ka as Ub,Kb as Zc,La as Vb,Lb as _c,Ma as Wb,Mb as $c,Na as Xb,Nb as ad,Oa as Yb,Ob as bd,Pa as Zb,Pb as cd,Qa as _b,Qb as dd,Ra as $b,Rb as ed,S as sb,Sa as ac,Sb as fd,T as tb,Ta as bc,Tb as gd,U as ub,Ua as cc,Ub as hd,V as vb,Va as dc,Vb as id,Wa as jc,Wb as jd,Xa as kc,Xb as kd,Ya as lc,Yb as ld,Za as mc,Zb as md,_a as nc,_b as nd,ab as pc,ac as pd,bb as qc,bc as qd,cb as rc,cc as rd,db as sc,dc as sd,eb as tc,ec as td,fb as uc,fc as ud,g as Y,gb as vc,gc as vd,h as Z,hb as wc,hc as wd,i as _,ib as xc,ic as xd,ja as Ab,jb as yc,jc as yd,ka as Bb,kb as zc,kc as zd,lb as Ac,lc as Ad,mb as Bc,mc as Bd,n as Ra,nb as Cc,nc as Cd,o as Sa,ob as Dc,oc as Dd,p as Ta,pb as Ec,pc as Ed,q as Ua,qb as Fc,qc as Fd,r as Va,rb as Gc,rc as Gd,sa as Cb,sb as Hc,sc as Hd,ta as Db,tb as Ic,tc as Id,ua as Eb,ub as Jc,uc as Jd,va as Fb,vb as Kc,vc as Kd,w as cb,wa as Gb,wb as Lc,wc as Ld,x as db,xa as Hb,xb as Mc,xc as Md,y as eb,ya as Ib,yb as Nc,yc as Nd,z as gb,za as Jb,zb as Oc,zc as Od}from"./chunks/chunk-SDLBF4PY.js";import"./chunks/chunk-HAFSMFJK.js";import{L as yb,m as bb,n as wb,u as xb}from"./chunks/chunk-7YUYLYJQ.js";import{$c as qb,Fd as zb,Rd as ec,Sd as fc,Tc as fb,Td as gc,Ud as hc,Vd as ic,_c as pb,ad as rb,oc as Xa,pc as Ya,qc as Za,sb as Wa,sc as _a,tc as $a,uc as ab}from"./chunks/chunk-K7RWRJLT.js";import{M as Ma,N as Na,P as Oa,Q as Pa,R as Qa,i as Ia,j as Ja,l as Ka,m as La}from"./chunks/chunk-2QLXN6HZ.js";import{Dc as lb,Mb as hb,Nb as ib,Ob as jb,Pb as kb,Uc as mb,Vc as nb,Zc as ob,na as Ha}from"./chunks/chunk-GRHSNUQO.js";import{A as b,B as c,Bc as t,C as d,Fh as ra,Gh as sa,Hd as w,Id as x,Jd as y,Kc as u,Kd as z,Ld as A,Mc as v,Md as B,Mi as ya,Nd as C,Ni as za,Od as D,Pd as E,Pi as Aa,Qd as F,Qi as Ba,Rd as G,Sa as n,Ya as o,_a as p,_f as $,af as V,ag as aa,al as Da,bb as q,bf as W,bl as Ea,cb as r,cl as Fa,eb as s,el as Ga,fg as ba,gg as ca,gh as na,hf as X,hg as da,hh as oa,hj as Ca,ig as ea,ih as pa,jg as fa,jh as qa,kg as ga,ki as ta,la as e,lg as ha,me as H,na as f,ne as I,ng as ia,ni as ua,oa as g,oe as J,oi as va,pa as h,pe as K,pg as ja,pi as wa,qa as i,qe as L,qg as ka,re as M,se as N,sg as la,si as xa,te as O,tg as ma,ua as j,ue as P,ve as Q,wa as k,we as R,x as a,xa as l,xe as S,ya as m,ye as T,ze as U}from"./chunks/chunk-JBJUOOJI.js";export{ba as BASELINE_ITEM_FORMAT_VERSION,g as BUILTIN_ITEM_TYPE_VALUES,m as CONFIDENCE_TEXT_VALUES,lb as CONTEXT_OUTPUT_VALUES,ca as CURRENT_ITEM_FORMAT_VERSION,Xa as DEFAULT_TERMINAL_TRANSITION_POLICY,j as DEPENDENCY_KIND_VALUES,e as EXIT_CODE,na as HISTORY_EVENT_CLASSIFICATION_VERSION,l as ISSUE_SEVERITY_VALUES,h as ITEM_TYPE_VALUES,oa as MAINTENANCE_HISTORY_OPERATIONS,x as MAX_WORKFLOW_POLICIES,y as MAX_WORKFLOW_POLICY_TERMS,nb as NEXT_OUTPUT_VALUES,Y as PM_CLI_EXPECTED_ERROR_NAME,P as PM_COMMAND_OUTPUT_BUDGET_CONTRACTS,K as PM_DIAGNOSTIC_DEGRADATION_STEPS,L as PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS,J as PM_DIAGNOSTIC_OUTPUT_CLASSES,Ja as PM_GITIGNORE_END,Ia as PM_GITIGNORE_START,I as PM_OUTPUT_BUDGET_CLASSES,H as PM_OUTPUT_DEGRADATION_STEPS,f as PmCliError,jc as PmClient,Ra as PmCompleteListValidationError,k as RISK_VALUES,Cb as SEARCH_EXTENSION_FLAG_DEFINITIONS,i as STATUS_VALUES,pa as SUBSTANTIVE_HISTORY_OPERATIONS,w as WORKFLOW_POLICY_ACTIONS,Na as WORKFLOW_POLICY_DOCUMENT_SCHEMA,Ma as WORKFLOW_POLICY_SCHEMA,X as acquireLock,qc as aggregate,Od as analyzeSdkActionCoverage,Cc as append,sa as appendHistoryEntry,_a as applyTerminalOrderingPolicy,Va as assertCompleteListResult,Oa as buildWorkflowCompletenessCheck,ma as canonicalDocument,Ua as certifyCompleteListResult,ld as claim,md as claimNext,qa as classifyHistoryEvent,fa as classifyItemFormatVersion,Bb as clearWorkspaceContractsCache,kd as close,$a as closeItem,ud as closeTask,tc as comments,_b as commitImportedItem,Ec as config,kc as context,od as copy,hd as create,Sa as createCompleteListOptions,ra as createHistoryEntry,Pa as createLifecycleCompletenessPolicies,Z as createPmCliExpectedError,N as createPmCommandOutputBudget,G as createWorkflowPolicyEvaluator,O as definePmCommandOutputBudget,pd as deleteItem,Ac as deps,zc as docs,sc as duplicates,da as effectiveItemFormatVersion,Zb as emptyImportedDocument,La as ensurePmGitignore,Yb as ensureTrackerInitialized,R as estimatePmOutputTokens,F as evaluateWorkflowPolicies,vd as extension,xd as extensionActivate,yd as extensionDeactivate,wd as extensionList,wc as files,xc as filesDiscover,yc as filesLookup,rd as focus,bd as gc,wa as generateItemId,oc as get,t as getActiveExtensionRegistrations,Ld as getContracts,s as getHistoryPath,r as getItemPath,Ka as getPmGitignoreBlock,q as getSettingsPath,Db as getWorkspaceContracts,Bc as graph,ad as health,fd as historyCompact,gd as historyCompactBulk,cd as historyRedact,dd as historyRepair,ed as historyRepairAll,M as inferPmOutputBudgetClass,Dc as init,Ta as inspectCompleteListResult,_ as isPmCliExpectedError,ia as isTerminalStatus,W as isTimestampLiteral,Da as jaccardSimilarity,vc as learnings,lc as list,mc as listAllComplete,Aa as listAllItemMetadata,Ba as listAllItemMetadataLight,sb as loadCreateTemplateOptions,ya as locateItem,pc as next,ea as normalizeItemFormatVersion,va as normalizeItemId,ja as normalizeItemMetadata,ua as normalizeRawItemId,Ea as normalizeSimilarityText,ha as normalizeStatusInput,uc as notes,V as nowIso,Id as packageActivate,Hd as packageCatalog,Jd as packageDeactivate,Fd as packageDescribe,Dd as packageDoctor,Bd as packageInstall,zd as packageLifecycle,Ad as packageList,Ed as packageManage,Gd as packageReload,Cd as packageUninstall,Ca as parseTags,z as parseWorkflowPolicy,A as parseWorkflowPolicyDocument,a as pathExists,td as pauseTask,Wc as profile,Zc as profileApply,_c as profileLint,Xc as profileList,Yc as profileShow,T as projectPmDiagnosticOutput,U as projectPmDiagnosticText,Fb as readBooleanOption,Gb as readCsvListOption,b as readFileIfExists,za as readLocatedItem,Ab as readRequiredString,ta as readSettings,Eb as readStringOption,xa as readWorkflowPolicies,B as readWorkflowPolicyField,nd as release,d as removeFileIfExists,ib as renderCalendarMarkdown,jb as renderCalendarToon,bc as renderGuideMarkdown,jd as reopen,Za as requireTerminalReason,hb as resolveCalendarOutputFormat,$b as resolveGuideOutputFormat,o as resolveImplicitPmRoot,n as resolveItemTypeRegistry,Q as resolvePmCommandOutputBudget,S as resolvePmDiagnosticOutputBudget,p as resolvePmRoot,aa as resolveRuntimeFieldRegistry,$ as resolveRuntimeStatusRegistry,Ya as resolveTerminalReason,qd as restore,Nd as runAction,v as runActiveOnReadHooks,u as runActiveOnWriteHooks,wb as runAggregate,kb as runCalendar,ab as runClose,rb as runCloseTask,cc as runCompletion,mb as runContext,cb as runCopy,db as runDelete,Wa as runDuplicates,eb as runFocus,xb as runGet,ac as runGuide,Ha as runList,ob as runNext,qb as runPauseTask,dc as runReindex,gb as runReopen,bb as runRestore,yb as runSearch,pb as runStartTask,zb as runStats,ub as runTemplatesList,tb as runTemplatesSave,vb as runTemplatesShow,ec as runTestRunsList,gc as runTestRunsLogs,ic as runTestRunsResume,fc as runTestRunsStatus,hc as runTestRunsStop,fb as runUpdate,Md as runWithActiveExtensions,Qa as runWorkflowPolicyAction,ga 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,Ga as scoreItemSimilarity,nc as search,Xb as selectImportAuthor,la as serializeItemDocument,ka as splitFrontMatter,sd as startTask,rc 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,Fa as tokenizeSimilarityText,id as update,Kd as upgrade,$c as validate,D as workflowApprovalFingerprint,E as workflowPolicyApplies,C as workflowPolicyFingerprint,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-4SI67A2F.js";import"./chunks/chunk-SDLBF4PY.js";import"./chunks/chunk-HAFSMFJK.js";import"./chunks/chunk-7YUYLYJQ.js";import"./chunks/chunk-K7RWRJLT.js";import{Fa as b,n as a}from"./chunks/chunk-2QLXN6HZ.js";import"./chunks/chunk-GRHSNUQO.js";import"./chunks/chunk-JBJUOOJI.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 BM,B as qM,C as zM,D as VM,E as HM,a as ni,b as rw,c as ow,d as nw,e as iw,f as sw,g as ds,h as ls,i as us,j as ps,k as ms,l as jM,m as GM,n as Rh,o as Ph,p as Mh,r as kh,s as xh,t as Nh,u as Lh,v as Dh,w as $h,x as Fh,y as jh,z as UM}from"./chunks/chunk-2UNYUB4A.js";import{A as kk,B as xk,C as Nk,D as Lk,E as Dk,F as $k,G as Fk,H as jk,I as Gk,J as Uk,K as Bk,L as qk,M as zk,N as Vk,O as Hk,P as Kk,Q as Wk,R as Xk,S as Yk,T as Jk,U as Zk,V as Qk,W as e0,X as t0,Y as r0,a as sk,b as ak,c as ck,d as dk,e as lk,f as uk,g as pk,h as mk,i as fk,j as _k,k as hk,l as gk,m as yk,n as bk,o as Ck,p as Tk,q as Sk,r as wk,s as Ek,t as Ak,u as vk,v as Ok,w as Ik,x as Rk,y as Pk,z as Mk}from"./chunks/chunk-33R5PEKI.js";import{a as KM,b as WM,c as XM,d as YM}from"./chunks/chunk-QZTS23BV.js";import{a as JM,b as ZM,c as QM,d as ek,e as tk,f as rk,g as ok,h as nk,i as ik}from"./chunks/chunk-TTFVQB4S.js";import{$ as fm,$a as r_,$b as rh,A as Ze,Aa as Ef,Ab as R_,B as em,Ba as Af,Bb as P_,C as tm,Ca as vf,Cb as M_,D as rm,Da as Of,Db as k_,E as om,Ea as If,Eb as x_,F as nm,Fa as Rf,Fb as N_,G as Zt,Ga as Pf,Gb as L_,H as Qt,Ha as Mf,Hb as D_,I as er,Ia as kf,Ib as $_,J as tr,Ja as xf,Jb as F_,K as rr,Ka as Nf,Kb as j_,L as or,La as Lf,Lb as G_,M as nr,Ma as Df,Mb as U_,N as ir,Na as $f,Nb as B_,O as sr,Oa as Ff,Ob as q_,P as ar,Pa as jf,Pb as z_,Q as cr,Qa as Gf,Qb as V_,R as im,Ra as Uf,Rb as H_,S as sm,Sa as Bf,Sb as K_,T as am,Ta as qf,Tb as W_,U as cm,Ua as zf,Ub as X_,V as dm,Va as dr,Vb as Y_,W as Qe,Wa as he,Wb as J_,X as lm,Xa as Zf,Xb as Z_,Y as um,Ya as Qf,Yb as Q_,Z as pm,Za as e_,Zb as eh,_ as mm,_a as t_,_b as th,a as YS,aa as _m,ab as o_,ac as oh,b as JS,ba as hm,bb as n_,bc as nh,c as ZS,ca as gm,cb as i_,cc as ih,d as QS,da as CM,db as s_,dc as sh,e as ew,ea as TM,eb as a_,ec as ah,f as tw,fa as SM,fb as c_,fc as ch,g as ci,ga as Om,gb as d_,gc as dh,h as di,ha as Im,hb as l_,hc as lh,i as li,ia as Rm,ib as u_,ic as uh,j as BE,ja as _f,jb as p_,jc as ph,k as qE,ka as hf,kb as m_,kc as mh,l as os,la as MM,lb as f_,lc as fh,m as xI,ma as kM,mb as __,mc as _h,n as NI,na as xM,nb as h_,nc as hh,o as LI,oa as NM,ob as g_,oc as gh,p as DI,pa as LM,pb as y_,pc as yh,q as $I,qa as DM,qb as b_,qc as bh,r as FI,ra as $M,rb as C_,rc as Ch,s as ml,sa as FM,sb as T_,sc as Th,t as qu,ta as gf,tb as S_,tc as Sh,u as zu,ua as yf,ub as w_,uc as wh,v as Wu,va as bf,vb as E_,vc as Eh,w as Xu,wa as Cf,wb as A_,wc as Ah,x as mp,xa as Tf,xb as v_,xc as vh,y as Cp,ya as Sf,yb as O_,yc as Oh,z as cP,za as wf,zb as I_,zc as Ih}from"./chunks/chunk-2FEKKSLN.js";import{e as UI,f as BI,g as fl,h as _l,i as Xt}from"./chunks/chunk-HAFSMFJK.js";import{A as dM,B as lM,C as uM,D as pM,E as mM,F as fM,G as _M,H as hM,I as gM,J as yM,K as bM,L as Cm,M as Tm,N as Sm,O as wm,P as Em,Q as Am,R as vm,a as VR,b as HR,c as KR,d as WR,e as XR,f as Bu,g as YR,h as JR,i as ZR,j as QR,k as eP,m as Ku,n as ym,o as ZP,p as QP,q as eM,r as tM,s as rM,t as oM,u as bm,v as nM,w as iM,x as sM,y as aM,z as cM}from"./chunks/chunk-7YUYLYJQ.js";import{$ as pI,$a as Al,$b as Lu,$c as Zp,A as UO,Ab as WI,Ac as tp,Ad as Zm,B as BO,Bb as XI,Bc as rp,Bd as Qm,C as qO,Cb as YI,Cc as op,Cd as ef,D as zO,Db as JI,Dc as np,Dd as tf,E as VO,Ea as Jd,Eb as ZI,Ec as ip,Ed as rf,F as Je,Fa as Zd,Fb as yR,Fc as sp,Fd as of,G as HO,Ga as Qd,Gb as bR,Gc as ap,Gd as nf,H as qt,Ha as el,Hb as CR,Hc as cp,Hd as sf,I as KO,Ia as tl,Ib as TR,Ic as dp,Id as af,J as WO,Jb as SR,Jc as lp,Jd as cf,K as XO,Ka as rl,Kb as wR,Kc as up,Kd as df,L as YO,La as ol,Lb as ER,Ld as lf,M as JO,Ma as nl,Mb as PR,Mc as sP,Md as uf,N as ZO,Na as il,Nb as MR,Nc as aP,Nd as pf,O as QO,Oa as jI,Ob as Ou,Oc as pp,Od as mf,P as eI,Pa as GI,Pb as Iu,Pc as Tp,Pd as ff,Q as tI,Qa as sl,Qb as kR,Qd as Vf,R as rI,Ra as al,Rb as xR,Rd as Hf,S as oI,Sa as cl,Sb as NR,Sd as Kf,T as nI,Ta as dl,Tb as LR,Tc as Sp,Td as Wf,U as iI,Ua as ll,Ub as DR,Ud as Xf,V as sI,Va as ul,Vb as Ru,Vc as wp,Vd as Yf,W as aI,Wa as pl,Wb as Pu,Wc as Kp,Wd as Jf,X as cI,Xa as Tl,Xb as Mu,Xc as Wp,Y as dI,Ya as Sl,Yb as ku,Yc as Xp,Z as lI,Za as wl,Zb as xu,Zc as Yp,_ as uI,_a as El,_b as Nu,_c as Jp,a as kO,aa as mI,ab as vl,ac as Du,ad as Qp,b as Gt,ba as fI,bb as Ol,bc as $u,bd as Pm,c as xO,ca as _I,cb as Il,cc as Fu,cd as Mm,d as Xe,da as hI,db as Rl,dc as ju,dd as km,e as oe,ea as gI,eb as Pl,ec as Gu,ed as xm,f as md,fa as yI,fb as Ml,fc as $R,fd as Nm,gb as kl,gc as FR,gd as Lm,hb as xl,hc as jR,hd as Dm,i as Ye,ib as Nl,ic as GR,id as $m,j as fd,jb as Ll,jc as UR,jd as Fm,k as _d,kb as Dl,kc as BR,kd as IM,la as Yd,lb as $l,lc as qR,ld as RM,m as _e,mb as Fl,mc as zR,md as PM,n as hd,nb as zI,nc as Uu,nd as jm,o as gd,ob as jl,oc as tP,od as Gm,p as yd,pb as Gl,pc as rP,pd as Um,q as bd,qb as Ul,qc as oP,qd as Bm,r as NO,rb as Bl,rc as nP,rd as qm,s as LO,sb as VI,sc as iP,sd as zm,t as DO,tb as ql,tc as Vu,td as Vm,u as $O,ub as zl,uc as Hu,ud as Hm,v as FO,vb as Vl,vc as Yu,vd as Km,w as Ut,wb as Hl,wc as Ju,wd as Wm,x as jO,xb as Kl,xc as Zu,xd as Xm,y as GO,yb as HI,yc as Qu,yd as Ym,z as Bt,zb as KI,zc as ep,zd as Jm}from"./chunks/chunk-K7RWRJLT.js";import{A as OI,Aa as Ht,B as Rd,Ba as Kt,C as Pd,Ca as Wt,D as Md,Da as Dd,Fa as $d,Ga as Fd,Ha as jd,M as II,Ma as Gd,N as RI,Na as Ud,P as PI,Pa as Bd,Q as MI,Qa as qd,R as kI,Ra as zd,S as kd,Sa as Vd,T as xd,Ta as Hd,U as Nd,V as Ld,Va as Kd,W as zt,Wa as Wd,Xa as Xd,a as WE,b as XE,c as ns,d as is,e as ss,f as as,g as cs,i as Cd,j as Td,l as Sd,m as wd,n as bI,o as CI,p as TI,q as SI,r as wI,s as EI,t as AI,u as vI,v as Ed,w as Ad,x as vd,y as Od,z as Id,za as Vt}from"./chunks/chunk-2QLXN6HZ.js";import{$ as CO,$a as vu,$b as yP,$c as wM,Aa as Ql,Ac as VP,Ba as eu,Bb as AR,Bc as HP,Ca as tu,Cb as vR,Cc as KP,Da as ru,Db as OR,Dc as Yt,Ea as ou,Eb as IR,Ec as Rp,Fa as nu,Fb as RR,Fc as Pp,G as uO,Ga as iu,Gb as fp,Gc as Mp,H as pO,Ha as su,Hb as _p,Hc as kp,I as mO,Ia as au,Ib as hp,Ic as xp,J as fO,Ja as cu,Jb as gp,Jc as Np,K as _O,Ka as du,Kb as yp,Kc as Lp,L as hO,La as lu,Lb as bp,Lc as Dp,M as gO,Ma as uu,Mb as Ep,Mc as $p,N as yO,Na as pu,Nb as Ap,Nc as Fp,O as td,Oa as mu,Ob as vp,Oc as jp,P as rd,Pa as fu,Pb as Op,Pc as Gp,Q as od,Qa as _u,Qb as dP,Qc as Up,R as nd,Ra as hu,Rb as lP,Rc as Bp,S as id,Sa as gu,Sb as uP,Sc as qp,T as sd,Ta as yu,Tb as pP,Tc as zp,U as ad,Ua as bu,Ub as mP,Uc as Jt,V as cd,Va as Cu,Vb as fP,Vc as Vp,W as dd,Wa as Tu,Wb as _P,Wc as WP,X as ld,Xa as Su,Xc as XP,Y as ud,Ya as wu,Yb as Ip,Yc as YP,Z as We,Za as Eu,Zb as hP,Zc as Hp,_ as bO,_a as Au,_b as gP,_c as JP,aa as TO,ac as bP,ad as EM,b as jE,ba as SO,bc as CP,bd as AM,c as GE,ca as wO,cb as QI,cc as TP,cd as vM,d as UE,da as EO,db as eR,dc as SP,dd as OM,e as zE,eb as tR,ec as wP,f as VE,fb as rR,fc as EP,g as HE,ga as AO,gb as oR,gc as AP,h as KE,ha as vO,hb as nR,hc as vP,i as Xv,ia as OO,ib as iR,ic as OP,j as Yv,ja as IO,jb as sR,jc as IP,k as Jv,ka as RO,kb as aR,kc as RP,l as Zv,la as PO,lb as cR,lc as PP,m as Qv,ma as MO,mb as dR,mc as MP,n as eO,na as pd,nb as lR,nc as kP,o as tO,oa as hl,ob as uR,oc as xP,p as rO,pa as gl,pc as NP,q as oO,qa as yl,qc as LP,r as nO,ra as bl,rc as DP,s as iO,sa as qI,sb as pR,sc as $P,t as sO,tc as FP,u as aO,ua as Cl,ub as mR,uc as jP,v as cO,va as Wl,vb as fR,vc as GP,w as dO,wa as Xl,wc as UP,x as lO,xa as Yl,xb as _R,xc as BP,ya as Jl,yb as hR,yc as qP,za as Zl,zb as gR,zc as zP}from"./chunks/chunk-GRHSNUQO.js";import{$a as EC,$c as Cn,$d as Rn,$e as kt,$f as fw,$g as ji,$h as lE,$i as QE,$l as $v,$m as Ma,$n as Ic,A as Xo,Ac as XC,Ad as NT,Ae as JT,Af as BS,Ag as Ow,Ah as Hw,Ai as wE,Aj as bA,Ak as QA,Al as ks,Am as ia,An as nc,Ao as jt,B as Ge,Bc as hn,Bd as LT,Be as ZT,Bf as qS,Bg as Iw,Bh as Kw,Bi as EE,Bj as CA,Bk as ev,Bl as xs,Bm as sa,Bn as ic,C as Yo,Cc as YC,Cd as DT,Ce as QT,Cf as zS,Cg as Rw,Ch as Ww,Ci as AE,Cj as TA,Ck as tv,Cl as Ns,Cm as aa,Cn as sc,Dc as JC,Dd as $T,De as eS,Df as VS,Dg as Ei,Di as vE,Dj as SA,Dk as rv,Dl as Ls,Dm as ca,Dn as ac,E as Qb,Eb as vC,Ec as ZC,Ed as FT,Ee as tS,Ef as HS,Eg as Ai,Eh as Xw,Ei as OE,Ej as wA,Ek as ov,El as Ds,Em as da,En as cc,F as eC,Fc as QC,Fd as jT,Fe as rS,Ff as KS,Fg as $,Fh as Ki,Fi as IE,Fj as EA,Fk as nv,Fl as $s,Fn as dc,G as tC,Gb as OC,Gc as eT,Ge as oS,Gg as vi,Gh as Wi,Gi as RE,Gk as iv,Gl as Fs,Gm as la,Gn as lc,H as rC,Hb as IC,Hc as tT,Hd as GT,He as nS,Hf as WS,Hj as AA,Hk as sv,Hl as js,Hm as ua,Hn as uc,I as oC,Ib as RC,Ic as rT,Id as UT,Ie as iS,If as XS,Ii as PE,Ij as vA,Ik as av,Il as Gs,Im as pa,In as pc,J as nC,Jb as PC,Jc as oT,Jd as BT,Je as sS,Jf as ii,Ji as ME,Jj as OA,Jk as Dt,Jl as Us,Jm as ma,Jn as mc,Kb as MC,Kc as gn,Kd as qT,Ke as aS,Kf as si,Ki as kE,Kj as IA,Kk as cv,Kl as Bs,Km as fa,Kn as fc,L as iC,Lc as nT,Ld as zT,Le as cS,Lf as ai,Lh as Yw,Li as xE,Lj as RA,Ll as qs,Lm as _a,Ln as _c,M as sC,Mc as yn,Md as VT,Me as dS,Mf as aw,Mg as Pw,Mh as Jw,Mi as es,Ml as zs,Mm as ha,Mn as hc,Na as gC,Nb as kC,Nd as HT,Ne as lS,Nf as cw,Ng as Mw,Nh as Zw,Ni as ts,Nj as PA,Nk as dv,Nl as Vs,Nm as ga,Nn as gc,Oa as yC,Ob as xC,Oc as iT,Od as KT,Oe as uS,Of as dw,Og as kw,Oh as Qw,Ok as lv,Ol as Hs,Om as ya,On as yc,P as aC,Pa as bC,Pc as sT,Pd as WT,Pe as pS,Pf as lw,Pg as Oi,Ph as eE,Pi as rs,Pj as MA,Pk as uv,Pm as ba,Pn as bc,Qc as aT,Qd as XT,Qe as mS,Qf as uw,Qg as Ii,Qh as tE,Qi as NE,Qj as kA,Qk as pv,Ql as Iv,Qm as Ca,Qn as Cc,Rb as P,Rc as cT,Rd as YT,Re as fS,Rg as Ri,Rj as xA,Rk as mv,Rl as Rv,Rm as Ta,Rn as Tc,S as cC,Sa as nn,Sb as NC,Sc as dT,Sd as Sn,Se as _S,Sf as pw,Sg as Pi,Sh as rE,Si as LE,Sj as NA,Sk as fv,Sm as Sa,Sn as Sc,Ta as CC,Tb as It,Td as wn,Te as hS,Tg as Mi,Ti as DE,Tj as LA,Tk as _v,Tm as wa,Tn as wc,U as dC,Ua as TC,Ub as LC,Ud as En,Ue as gS,Ug as ki,Uh as oE,Ui as $E,Uk as hv,Ul as Pv,Um as Ea,Un as Ec,V as lC,Va as SC,Vd as An,Ve as yS,Vg as xi,Vh as nE,Vk as _s,Vl as Mv,Vm as Aa,Vn as Ac,W as uC,Wa as wC,Wb as DC,Wd as vn,We as bS,Wg as Ni,Wh as iE,Wi as FE,Wk as hs,Wl as kv,Wm as va,Wn as vc,Xd as On,Xe as CS,Xg as Li,Xh as sE,Xk as gs,Xl as xv,Xm as Oa,Xn as Oc,Ya as sn,Yc as Rt,Yd as In,Ye as TS,Yf as mw,Yg as Di,Yh as aE,Yi as YE,Yk as ys,Yl as Nv,Ym as Ia,Za as an,Zc as Pt,Zd as Be,Ze as Mt,Zg as $i,Zh as cE,Zi as JE,Zk as bs,Zl as Lv,Zm as Ra,Zn as Ke,_a as Ue,_c as bn,_d as qe,_f as ui,_g as Fi,_h as dE,_i as ZE,_k as Cs,_l as Dv,_m as Pa,_n as re,ad as Tn,ae as Pn,af as ri,ag as pi,ah as Gi,ai as uE,aj as eA,al as Ts,am as Fv,an as ka,ao as Rc,b as jo,ba as pC,bb as cn,be as Mn,bf as oi,bh as Ui,bi as pE,bj as tA,bl as Ss,bm as jv,bn as xa,bo as Pc,c as Go,cb as dn,cd as lT,ce as kn,cf as xt,cg as _w,ch as xw,ci as mE,ck as DA,cl as ws,cm as Ve,cn as Na,co as Mc,d as Uo,da as mC,dd as uT,de as xn,dg as hw,dh as Nw,di as fE,dj as rA,dk as $A,dl as Es,dm as Gv,dn as La,do as kc,e as Bo,eb as ln,ed as pT,ee as Nn,ef as SS,eg as gw,eh as Bi,ei as _E,ej as oA,ek as FA,el as As,em as Uv,en as Da,eo as xc,f as $e,fd as mT,fe as Ln,fg as mi,fh as Lw,fi as hE,fk as jA,fl as vs,fm as Bv,fn as $a,fo as Nc,g as qo,ga as fC,gc as $C,gd as fT,ge as Dn,gf as wS,gg as fi,gh as qi,gk as GA,gl as Os,gm as Ft,gn as Fa,go as Lc,h as L,hc as FC,hd as _T,he as $n,hf as ze,hg as _i,hh as zi,hj as fs,hk as UA,hl as Is,hm as He,hn as ja,ho as Dc,i as Fe,ic as jC,id as hT,ie as Fn,if as ES,ig as hi,ih as Vi,ii as gE,ij as nA,ik as BA,il as gv,im as qv,in as Ga,io as $c,j as zo,jd as gT,je as jn,jf as AS,jg as gi,jh as Hi,ji as yE,jj as iA,jk as qA,jl as yv,jm as zv,jn as Ua,jo as Fc,k as Vo,ka as _C,kc as GC,kd as yT,ke as Gn,kf as vS,kg as yi,ki as Xi,kj as sA,kk as zA,kl as bv,km as Vv,kn as Ba,ko as jc,l as Ho,la as D,lc as UC,ld as bT,le as Un,lf as OS,lg as bi,li as bE,lj as aA,lk as Lt,ll as Cv,lm as Hv,ln as qa,lo as Gc,m as Ko,ma as hC,md as CT,me as Bn,mf as IS,mg as yw,mj as cA,ml as Tv,mm as Kv,mn as za,mo as Uc,n as Kb,na as b,nc as BC,nd as TT,ne as qn,nf as RS,ng as bw,ni as Yi,nj as dA,nk as VA,nl as Sv,nm as Wv,nn as Va,no as Bc,o as je,oa as Jo,oc as mn,od as ST,oe as zn,of as PS,oi as Ji,ol as wv,om as Ks,on as Ha,oo as qc,p as vt,pa as Zo,pd as wT,pe as Vn,pf as MS,pg as Ci,pi as Zi,pj as lA,pk as HA,pl as Ev,pm as Ws,pn as Ka,po as zc,q as Wb,qa as Qo,qc as fn,qd as ET,qe as Hn,qf as kS,qg as Ti,qh as Dw,qj as uA,qm as Xs,qn as Wa,qo as Vc,r as Xb,rb as un,rc as _n,rd as AT,re as Kn,rf as xS,rg as Cw,rh as $w,rj as pA,rm as Ys,rn as Xa,ro as Hc,s as Yb,sb as pn,sd as vT,se as Wn,sf as NS,sg as Si,sh as Fw,si as CE,sj as mA,sm as Js,sn as Ya,so as Kc,t as Jb,tb as AC,td as OT,te as Xn,tf as LS,tg as wi,th as jw,tk as KA,tl as $t,tm as Zs,tn as Ja,to as Wc,u as H,ua as en,uc as qC,ud as IT,ue as Yn,uf as DS,ug as Tw,uh as Gw,uj as fA,uk as WA,ul as Av,um as Qs,un as Za,uo as Xc,v as Zb,vc as zC,vd as RT,ve as Jn,vf as $S,vg as Sw,vh as Uw,vj as _A,vk as XA,vl as vv,vm as ea,vn as Qa,vo as Yc,wa as tn,wc as VC,wd as PT,we as Zn,wf as FS,wg as ww,wh as Bw,wi as Qi,wk as YA,wl as Ov,wm as ta,wn as ec,wo as Jc,x as Wo,xa as rn,xc as HC,xd as MT,xe as Qn,xf as jS,xg as Ew,xh as qw,xi as Nt,xj as hA,xk as JA,xl as Rs,xm as ra,xn as tc,xo as Zc,y as Ot,ya as on,yc as KC,yd as kT,ye as ei,yf as GS,yg as Aw,yh as zw,yi as TE,yj as gA,yl as Ps,ym as oa,yn as rc,yo as Qc,z as fe,zc as WC,zd as xT,ze as ti,zf as US,zg as vw,zh as Vw,zi as SE,zj as yA,zk as ZA,zl as Ms,zm as na,zn as oc,zo as ed}from"./chunks/chunk-JBJUOOJI.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="08485124-a2f1-5bb5-9316-533a3f7888bc")}catch{}})();var K="2026-07-28",o0=["2025-11-25","2025-06-18"],et=[K],m={headerMismatch:-32020,missingRequiredClientCapability:-32021,unsupportedProtocolVersion:-32022,invalidParams:-32602},A={clientCapabilities:"io.modelcontextprotocol/clientCapabilities",clientInfo:"io.modelcontextprotocol/clientInfo",logLevel:"io.modelcontextprotocol/logLevel",protocolVersion:"io.modelcontextprotocol/protocolVersion",serverInfo:"io.modelcontextprotocol/serverInfo"},lr=["debug","info","notice","warning","error","critical","alert","emergency"],p=class extends Error{code;data;constructor(t,r,o={}){super(t),this.name="PmMcpProtocolError",this.code=r,this.data=o}};function _(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Gh(e){if(e===void 0)return;if(!_(e))throw new p("Invalid MCP clientInfo metadata",m.invalidParams,{field:A.clientInfo,expected:"object"});let t=typeof e.name=="string"?e.name.trim():"",r=typeof e.version=="string"?e.version.trim():"";if(t.length===0||r.length===0)throw new p("Invalid MCP clientInfo metadata",m.invalidParams,{field:A.clientInfo,required:["name","version"]});let o={name:t.slice(0,128),version:r.slice(0,128)};return typeof e.description=="string"&&e.description.trim()&&(o.description=e.description.trim().slice(0,1024)),typeof e.websiteUrl=="string"&&e.websiteUrl.trim()&&(o.websiteUrl=e.websiteUrl.trim().slice(0,2048)),o}function Uh(e){if(e!==void 0){if(typeof e!="string"||!lr.includes(e))throw new p("Invalid MCP logLevel metadata",m.invalidParams,{field:A.logLevel,allowed:[...lr]});return e}}function tt(e){let t=_(e)?e._meta:void 0;if(!_(t))throw new p("Missing required MCP request metadata",m.invalidParams,{required:[A.protocolVersion,A.clientCapabilities]});let r=t[A.protocolVersion];if(typeof r!="string"||!et.includes(r))throw new p("Unsupported protocol version",m.unsupportedProtocolVersion,{supported:[...et],requested:typeof r=="string"?r:null});let o=t[A.clientCapabilities];if(!_(o))throw new p("Invalid MCP client capabilities metadata",m.invalidParams,{field:A.clientCapabilities,expected:"object"});let n=Gh(t[A.clientInfo]),i=Uh(t[A.logLevel]);return{protocolVersion:K,clientCapabilities:o,...n?{clientInfo:n}:{},...i?{logLevel:i}:{}}}function n0(e,t){if(t!==e.protocolVersion)throw new p("MCP protocol header does not match request metadata",m.headerMismatch,{header:t??null,metadata:e.protocolVersion})}function i0(e,t){let r=t.filter(o=>!Object.prototype.hasOwnProperty.call(e.clientCapabilities,o));if(r.length>0)throw new p("Missing required client capability",m.missingRequiredClientCapability,{requiredCapabilities:Object.fromEntries(r.map(o=>[o,{}]))})}function s0(e,t){let r=e.clientCapabilities.extensions;return _(r)&&_(r[t])}function rt(e,t){let r=_(e._meta)?e._meta:{};return{...e,_meta:{...r,[A.serverInfo]:{...t}}}}function Bh(e,t){return rt({...e,resultType:"complete"},t)}function a0(e){let t=e.ttlMs??6e4;if(!Number.isFinite(t)||t<0)throw new p("Invalid MCP discovery cache TTL",m.invalidParams,{ttlMs:t});return Bh({supportedVersions:[...et],capabilities:structuredClone(e.capabilities),ttlMs:t,cacheScope:"public",...e.instructions?{instructions:e.instructions}:{}},e.serverInfo)}function c0(e,t){if(_(e)&&typeof e.resultType=="string")return e.resultType;if(t==="legacy")return"complete";throw new p("Modern MCP result is missing resultType",m.invalidParams,{required:"resultType"})}import{createHash as mr,createHmac as fr,timingSafeEqual as qh}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="6505e714-d1f3-5794-88c8-51c1644acec9")}catch{}})();var zh=["elicitation/create","roots/list","sampling/createMessage"],ur=class extends Error{inputRequests;requestState;constructor(t){super("MCP operation requires additional input"),this.name="PmMcpInputRequiredError",this.inputRequests=t.inputRequests,this.requestState=t.requestState}},_r=/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/u,ge=32,nt=64*1024,ye=16*1024,ot={maxBytes:256*1024,maxDepth:32,maxNodes:4096};function Vh(e){return e==="elicitation/create"?"elicitation":e==="sampling/createMessage"?"sampling":"roots"}function be(e,t,r){let o;try{o=JSON.stringify(e)}catch{throw new p(`Invalid ${r}: value is not JSON serializable`,m.invalidParams,{field:r})}if(Buffer.byteLength(o,"utf8")>t)throw new p(`Invalid ${r}: payload exceeds the protocol bound`,m.invalidParams,{field:r,maximumBytes:t})}function it(e,t){if(!_(e))throw new p("Invalid MCP inputRequests",m.invalidParams,{field:"inputRequests",expected:"object"});let r=Object.entries(e);if(r.length===0||r.length>ge)throw new p("Invalid MCP inputRequests count",m.invalidParams,{minimum:1,maximum:ge,observed:r.length});let o={};for(let[n,i]of r){if(!_r.test(n)||!_(i))throw new p("Invalid MCP input request entry",m.invalidParams,{field:`inputRequests.${n}`});let s=i.method;if(typeof s!="string"||!zh.includes(s))throw new p("Unsupported MCP input request method",m.invalidParams,{field:`inputRequests.${n}.method`,method:s??null});let a=Vh(s);if(!Object.prototype.hasOwnProperty.call(t.clientCapabilities,a))throw new p("Missing required client capability",m.missingRequiredClientCapability,{requiredCapabilities:{[a]:{}}});if(!_(i.params))throw new p("Invalid MCP input request parameters",m.invalidParams,{field:`inputRequests.${n}.params`,expected:"object"});o[n]={method:s,params:structuredClone(i.params)}}return be(o,nt,"inputRequests"),o}function hr(e){if(!_(e))throw new p("Invalid MCP inputResponses",m.invalidParams,{field:"inputResponses",expected:"object"});let t=Object.entries(e);if(t.length>ge)throw new p("Invalid MCP inputResponses count",m.invalidParams,{maximum:ge,observed:t.length});let r={};for(let[o,n]of t){if(!_r.test(o)||!_(n))throw new p("Invalid MCP input response entry",m.invalidParams,{field:`inputResponses.${o}`});r[o]=structuredClone(n)}return be(r,nt,"inputResponses"),r}function p0(e){let t=e.requestState?.trim();if(t&&Buffer.byteLength(t,"utf8")>ye)throw new p("Invalid MCP requestState: payload exceeds the protocol bound",m.invalidParams,{field:"requestState",maximumBytes:ye});let r=e.inputRequests===void 0?void 0:it(e.inputRequests,e.requestContext);if(r===void 0&&!t)throw new p("InputRequiredResult requires inputRequests or requestState",m.invalidParams,{requiredAnyOf:["inputRequests","requestState"]});return{resultType:"input_required",...r?{inputRequests:r}:{},...t?{requestState:t}:{},_meta:{[A.serverInfo]:{...e.serverInfo}}}}function gr(e){let t=Buffer.from(e);if(t.byteLength<32)throw new p("MCP requestState signing key must contain at least 32 bytes",m.invalidParams,{minimumBytes:32});return t}function m0(e,t){if(!Number.isSafeInteger(e.expiresAt)||e.expiresAt<=0||e.method.trim().length===0||e.parameterDigest.trim().length===0||e.principal.trim().length===0)throw new p("Invalid MCP requestState payload",m.invalidParams);let r=Buffer.from(JSON.stringify({version:1,...e}),"utf8");if(r.byteLength>ye/2)throw new p("MCP requestState payload exceeds the protocol bound",m.invalidParams,{maximumBytes:ye/2});let o=r.toString("base64url"),n=fr("sha256",gr(t)).update(o).digest("base64url");return`${o}.${n}`}function Hh(e){if(!_(e)||e.version!==1)throw new p("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});let{expiresAt:t,method:r,parameterDigest:o,principal:n,state:i}=e;if(typeof t!="number"||!Number.isSafeInteger(t))throw new p("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});if(typeof r!="string"||typeof o!="string"||typeof n!="string")throw new p("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});return{expiresAt:t,method:r,parameterDigest:o,principal:n,state:i}}function f0(e,t,r){let[o,n,i]=e.split(".");if(!o||!n||i!==void 0)throw new p("Invalid MCP requestState encoding",m.invalidParams,{field:"requestState"});let s=Buffer.from(n,"base64url"),a=fr("sha256",gr(t)).update(o).digest();if(s.byteLength!==a.byteLength||!qh(s,a))throw new p("Invalid MCP requestState signature",m.invalidParams,{field:"requestState"});let c;try{c=JSON.parse(Buffer.from(o,"base64url").toString("utf8"))}catch{c=null}let d=Hh(c),{expiresAt:l,method:u,parameterDigest:f,principal:g}=d;if(l<(r.nowMs??Date.now()))throw new p("Expired MCP requestState",m.invalidParams,{field:"requestState",expiredAt:l});if(u!==r.method||f!==r.parameterDigest||g!==r.principal)throw new p("MCP requestState binding mismatch",m.invalidParams,{field:"requestState"});return d}function _0(e){return be(e,nt,"request parameters"),mr("sha256").update(JSON.stringify(e)).digest("hex")}var pr=class{#e=new Set;#t;constructor(t=4096){if(!Number.isSafeInteger(t)||t<1)throw new p("Invalid MCP replay guard capacity",m.invalidParams,{maximumEntries:t});this.#t=t}consume(t){let r=mr("sha256").update(t).digest("hex");if(this.#e.has(r))throw new p("MCP requestState replay detected",m.invalidParams,{field:"requestState"});if(this.#e.size>=this.#t){let o=this.#e.values().next().value;this.#e.delete(o)}this.#e.add(r)}};function Kh(e){if(!Number.isSafeInteger(e.ttlMs)||e.ttlMs<0||e.cacheScope!=="public"&&e.cacheScope!=="private")throw new p("Invalid MCP cache policy",m.invalidParams,{ttlMs:e.ttlMs,cacheScope:e.cacheScope});return{ttlMs:e.ttlMs,cacheScope:e.cacheScope}}function h0(e,t){return{...e,...Kh(t)}}function Wh(e){return e.replaceAll("~1","/").replaceAll("~0","~")}function Xh(e,t){if(t==="#")return e;if(!t.startsWith("#/"))return;let r=e;for(let o of t.slice(2).split("/").map(Wh)){if(!_(r)&&!Array.isArray(r)||!Object.prototype.hasOwnProperty.call(r,o))return;r=r[o]}return r}function Yh(e){let t=e.maxBytes??ot.maxBytes,r=e.maxDepth??ot.maxDepth,o=e.maxNodes??ot.maxNodes;if(!Number.isSafeInteger(t)||t<2)throw new p("Invalid MCP JSON Schema work bounds",m.invalidParams);if(!Number.isSafeInteger(r)||r<1)throw new p("Invalid MCP JSON Schema work bounds",m.invalidParams);if(!Number.isSafeInteger(o)||o<1)throw new p("Invalid MCP JSON Schema work bounds",m.invalidParams);return{maximumBytes:t,maximumDepth:r,maximumNodes:o}}function Jh(e,t){let r=Array.isArray(e.value)?e.value:_(e.value)?Object.values(e.value):[];for(let o of r)t.push({value:o,depth:e.depth+1})}function Zh(e,t){if(!_(t)||typeof t.$ref!="string")return;let r=t.$ref;if(r.startsWith("#")&&Xh(e,r)===void 0)throw new p("MCP JSON Schema contains an unresolved local reference",m.invalidParams,{reference:r})}function g0(e,t={}){let{maximumBytes:r,maximumDepth:o,maximumNodes:n}=Yh(t);if(typeof e!="boolean"&&!_(e))throw new p("Invalid MCP JSON Schema root",m.invalidParams,{expected:"object or boolean"});be(e,r,"JSON Schema");let i=[{value:e,depth:0}],s=0;for(;i.length>0;){let a=i.pop();if(s+=1,s>n||a.depth>o)throw new p("MCP JSON Schema exceeds validation work bounds",m.invalidParams,{maximumDepth:o,maximumNodes:n});Zh(e,a.value),Jh(a,i)}return structuredClone(e)}import{randomUUID as Qh}from"node:crypto";import{readFile as eg}from"node:fs/promises";import yr from"node:path";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="7f5b3ba6-07cf-5317-8f62-63e84f561232")}catch{}})();var A0="io.modelcontextprotocol/tasks",tg=["working","input_required","completed","failed","cancelled"],rg=/^mcp-task-[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/iu,og=3600*1e3,ng=1e3,Te=1024,ig=30,sg=2e3;function st(e){return new p(e,m.invalidParams,{code:"mcp_task_not_found_or_not_authorized"})}function Ce(e){let t=e.trim();if(!rg.test(t))throw st("Unknown MCP task");return t}function br(e,t){if(typeof e!="string"||!Number.isFinite(Date.parse(e)))throw new p("Corrupt MCP task record",m.invalidParams,{field:t});return e}function Cr(e){if(!_(e)||typeof e.code!="number"||!Number.isFinite(e.code)||typeof e.message!="string")throw new p("Corrupt MCP task error",m.invalidParams);return{code:e.code,message:e.message.slice(0,Te),..._(e.data)?{data:structuredClone(e.data)}:{}}}function ag(e){if(!tg.includes(e))throw new p("Corrupt MCP task record",m.invalidParams);return e}function cg(e){if(typeof e!="string"||e.length===0)throw new p("Corrupt MCP task record",m.invalidParams);return e}function dg(e){if(typeof e!="number"||!Number.isSafeInteger(e)||e<1)throw new p("Corrupt MCP task record",m.invalidParams);return e}function lg(e){if(e!==null&&(typeof e!="number"||!Number.isSafeInteger(e)||e<0))throw new p("Corrupt MCP task record",m.invalidParams);return e}function ug(e){if(e!==void 0){if(typeof e!="number"||!Number.isSafeInteger(e)||e<0)throw new p("Corrupt MCP task record",m.invalidParams);return e}}function pg(e){if(!Array.isArray(e)||e.some(t=>typeof t!="string"))throw new p("Corrupt MCP task record",m.invalidParams);return[...e]}function mg(e){if(!_(e)||e.version!==1)throw new p("Corrupt MCP task record",m.invalidParams);let t=typeof e.taskId=="string"?Ce(e.taskId):"",r=ag(e.status),o=cg(e.principal),n=dg(e.workerPid),i=lg(e.ttlMs),s=ug(e.pollIntervalMs),a={version:1,taskId:t,status:r,principal:o,workerPid:n,createdAt:br(e.createdAt,"createdAt"),lastUpdatedAt:br(e.lastUpdatedAt,"lastUpdatedAt"),ttlMs:i,consumedInputKeys:pg(e.consumedInputKeys),...typeof e.statusMessage=="string"?{statusMessage:e.statusMessage.slice(0,Te)}:{},...typeof s=="number"?{pollIntervalMs:s}:{}};if(_(e.inputRequests)&&(a.inputRequests=structuredClone(e.inputRequests)),_(e.inputResponses)&&(a.inputResponses=structuredClone(e.inputResponses)),_(e.result)&&(a.result=structuredClone(e.result)),e.error!==void 0&&(a.error=Cr(e.error)),a.status==="input_required"&&!a.inputRequests||a.status==="completed"&&!a.result||a.status==="failed"&&!a.error)throw new p("Corrupt MCP task status payload",m.invalidParams,{status:a.status});return a}function W(e){let t={taskId:e.taskId,status:e.status,createdAt:e.createdAt,lastUpdatedAt:e.lastUpdatedAt,ttlMs:e.ttlMs,...e.statusMessage?{statusMessage:e.statusMessage}:{},...e.pollIntervalMs===void 0?{}:{pollIntervalMs:e.pollIntervalMs}};return e.status==="input_required"?{...t,status:"input_required",inputRequests:structuredClone(e.inputRequests)}:e.status==="completed"?{...t,status:"completed",result:structuredClone(e.result)}:e.status==="failed"?{...t,status:"failed",error:structuredClone(e.error)}:e.status==="cancelled"?{...t,status:"cancelled"}:{...t,status:"working"}}function ne(e){return e==="completed"||e==="failed"||e==="cancelled"}function fg(e){try{return process.kill(e,0),!0}catch(t){return!(typeof t=="object"&&t!==null&&"code"in t&&t.code==="ESRCH")}}var at=class{#e;#t;#r;#o;#i;constructor(t){this.#e=yr.resolve(t.pmRoot),this.#t=t.owner?.trim()||"pm-mcp",this.#r=t.now??(()=>new Date),this.#o=t.taskIdFactory??(()=>`mcp-task-${Qh()}`),this.#i=t.workerPid??process.pid}#s(t){return yr.join(this.#e,"runtime","mcp-tasks","records",`${Ce(t)}.json`)}async#c(t){try{return mg(JSON.parse(await eg(this.#s(t),"utf8")))}catch(r){throw fe(r)||r instanceof SyntaxError?st("Unknown MCP task"):r}}async#a(t){await Ge(this.#s(t.taskId),`${JSON.stringify(t,null,2)}
|
|
1
|
+
import{A as BM,B as qM,C as zM,D as VM,E as HM,a as ni,b as rw,c as ow,d as nw,e as iw,f as sw,g as ds,h as ls,i as us,j as ps,k as ms,l as jM,m as GM,n as Rh,o as Ph,p as Mh,r as kh,s as xh,t as Nh,u as Lh,v as Dh,w as $h,x as Fh,y as jh,z as UM}from"./chunks/chunk-2UNYUB4A.js";import{A as kk,B as xk,C as Nk,D as Lk,E as Dk,F as $k,G as Fk,H as jk,I as Gk,J as Uk,K as Bk,L as qk,M as zk,N as Vk,O as Hk,P as Kk,Q as Wk,R as Xk,S as Yk,T as Jk,U as Zk,V as Qk,W as e0,X as t0,Y as r0,a as sk,b as ak,c as ck,d as dk,e as lk,f as uk,g as pk,h as mk,i as fk,j as _k,k as hk,l as gk,m as yk,n as bk,o as Ck,p as Tk,q as Sk,r as wk,s as Ek,t as Ak,u as vk,v as Ok,w as Ik,x as Rk,y as Pk,z as Mk}from"./chunks/chunk-4SI67A2F.js";import{a as KM,b as WM,c as XM,d as YM}from"./chunks/chunk-QZTS23BV.js";import{a as JM,b as ZM,c as QM,d as ek,e as tk,f as rk,g as ok,h as nk,i as ik}from"./chunks/chunk-NHRB3L5T.js";import{$ as fm,$a as r_,$b as rh,A as Ze,Aa as Ef,Ab as R_,B as em,Ba as Af,Bb as P_,C as tm,Ca as vf,Cb as M_,D as rm,Da as Of,Db as k_,E as om,Ea as If,Eb as x_,F as nm,Fa as Rf,Fb as N_,G as Zt,Ga as Pf,Gb as L_,H as Qt,Ha as Mf,Hb as D_,I as er,Ia as kf,Ib as $_,J as tr,Ja as xf,Jb as F_,K as rr,Ka as Nf,Kb as j_,L as or,La as Lf,Lb as G_,M as nr,Ma as Df,Mb as U_,N as ir,Na as $f,Nb as B_,O as sr,Oa as Ff,Ob as q_,P as ar,Pa as jf,Pb as z_,Q as cr,Qa as Gf,Qb as V_,R as im,Ra as Uf,Rb as H_,S as sm,Sa as Bf,Sb as K_,T as am,Ta as qf,Tb as W_,U as cm,Ua as zf,Ub as X_,V as dm,Va as dr,Vb as Y_,W as Qe,Wa as he,Wb as J_,X as lm,Xa as Zf,Xb as Z_,Y as um,Ya as Qf,Yb as Q_,Z as pm,Za as e_,Zb as eh,_ as mm,_a as t_,_b as th,a as YS,aa as _m,ab as o_,ac as oh,b as JS,ba as hm,bb as n_,bc as nh,c as ZS,ca as gm,cb as i_,cc as ih,d as QS,da as CM,db as s_,dc as sh,e as ew,ea as TM,eb as a_,ec as ah,f as tw,fa as SM,fb as c_,fc as ch,g as ci,ga as Om,gb as d_,gc as dh,h as di,ha as Im,hb as l_,hc as lh,i as li,ia as Rm,ib as u_,ic as uh,j as BE,ja as _f,jb as p_,jc as ph,k as qE,ka as hf,kb as m_,kc as mh,l as os,la as MM,lb as f_,lc as fh,m as xI,ma as kM,mb as __,mc as _h,n as NI,na as xM,nb as h_,nc as hh,o as LI,oa as NM,ob as g_,oc as gh,p as DI,pa as LM,pb as y_,pc as yh,q as $I,qa as DM,qb as b_,qc as bh,r as FI,ra as $M,rb as C_,rc as Ch,s as ml,sa as FM,sb as T_,sc as Th,t as qu,ta as gf,tb as S_,tc as Sh,u as zu,ua as yf,ub as w_,uc as wh,v as Wu,va as bf,vb as E_,vc as Eh,w as Xu,wa as Cf,wb as A_,wc as Ah,x as mp,xa as Tf,xb as v_,xc as vh,y as Cp,ya as Sf,yb as O_,yc as Oh,z as cP,za as wf,zb as I_,zc as Ih}from"./chunks/chunk-SDLBF4PY.js";import{e as UI,f as BI,g as fl,h as _l,i as Xt}from"./chunks/chunk-HAFSMFJK.js";import{A as dM,B as lM,C as uM,D as pM,E as mM,F as fM,G as _M,H as hM,I as gM,J as yM,K as bM,L as Cm,M as Tm,N as Sm,O as wm,P as Em,Q as Am,R as vm,a as VR,b as HR,c as KR,d as WR,e as XR,f as Bu,g as YR,h as JR,i as ZR,j as QR,k as eP,m as Ku,n as ym,o as ZP,p as QP,q as eM,r as tM,s as rM,t as oM,u as bm,v as nM,w as iM,x as sM,y as aM,z as cM}from"./chunks/chunk-7YUYLYJQ.js";import{$ as pI,$a as Al,$b as Lu,$c as Zp,A as UO,Ab as WI,Ac as tp,Ad as Zm,B as BO,Bb as XI,Bc as rp,Bd as Qm,C as qO,Cb as YI,Cc as op,Cd as ef,D as zO,Db as JI,Dc as np,Dd as tf,E as VO,Ea as Jd,Eb as ZI,Ec as ip,Ed as rf,F as Je,Fa as Zd,Fb as yR,Fc as sp,Fd as of,G as HO,Ga as Qd,Gb as bR,Gc as ap,Gd as nf,H as qt,Ha as el,Hb as CR,Hc as cp,Hd as sf,I as KO,Ia as tl,Ib as TR,Ic as dp,Id as af,J as WO,Jb as SR,Jc as lp,Jd as cf,K as XO,Ka as rl,Kb as wR,Kc as up,Kd as df,L as YO,La as ol,Lb as ER,Ld as lf,M as JO,Ma as nl,Mb as PR,Mc as sP,Md as uf,N as ZO,Na as il,Nb as MR,Nc as aP,Nd as pf,O as QO,Oa as jI,Ob as Ou,Oc as pp,Od as mf,P as eI,Pa as GI,Pb as Iu,Pc as Tp,Pd as ff,Q as tI,Qa as sl,Qb as kR,Qd as Vf,R as rI,Ra as al,Rb as xR,Rd as Hf,S as oI,Sa as cl,Sb as NR,Sd as Kf,T as nI,Ta as dl,Tb as LR,Tc as Sp,Td as Wf,U as iI,Ua as ll,Ub as DR,Ud as Xf,V as sI,Va as ul,Vb as Ru,Vc as wp,Vd as Yf,W as aI,Wa as pl,Wb as Pu,Wc as Kp,Wd as Jf,X as cI,Xa as Tl,Xb as Mu,Xc as Wp,Y as dI,Ya as Sl,Yb as ku,Yc as Xp,Z as lI,Za as wl,Zb as xu,Zc as Yp,_ as uI,_a as El,_b as Nu,_c as Jp,a as kO,aa as mI,ab as vl,ac as Du,ad as Qp,b as Gt,ba as fI,bb as Ol,bc as $u,bd as Pm,c as xO,ca as _I,cb as Il,cc as Fu,cd as Mm,d as Xe,da as hI,db as Rl,dc as ju,dd as km,e as oe,ea as gI,eb as Pl,ec as Gu,ed as xm,f as md,fa as yI,fb as Ml,fc as $R,fd as Nm,gb as kl,gc as FR,gd as Lm,hb as xl,hc as jR,hd as Dm,i as Ye,ib as Nl,ic as GR,id as $m,j as fd,jb as Ll,jc as UR,jd as Fm,k as _d,kb as Dl,kc as BR,kd as IM,la as Yd,lb as $l,lc as qR,ld as RM,m as _e,mb as Fl,mc as zR,md as PM,n as hd,nb as zI,nc as Uu,nd as jm,o as gd,ob as jl,oc as tP,od as Gm,p as yd,pb as Gl,pc as rP,pd as Um,q as bd,qb as Ul,qc as oP,qd as Bm,r as NO,rb as Bl,rc as nP,rd as qm,s as LO,sb as VI,sc as iP,sd as zm,t as DO,tb as ql,tc as Vu,td as Vm,u as $O,ub as zl,uc as Hu,ud as Hm,v as FO,vb as Vl,vc as Yu,vd as Km,w as Ut,wb as Hl,wc as Ju,wd as Wm,x as jO,xb as Kl,xc as Zu,xd as Xm,y as GO,yb as HI,yc as Qu,yd as Ym,z as Bt,zb as KI,zc as ep,zd as Jm}from"./chunks/chunk-K7RWRJLT.js";import{A as OI,Aa as Ht,B as Rd,Ba as Kt,C as Pd,Ca as Wt,D as Md,Da as Dd,Fa as $d,Ga as Fd,Ha as jd,M as II,Ma as Gd,N as RI,Na as Ud,P as PI,Pa as Bd,Q as MI,Qa as qd,R as kI,Ra as zd,S as kd,Sa as Vd,T as xd,Ta as Hd,U as Nd,V as Ld,Va as Kd,W as zt,Wa as Wd,Xa as Xd,a as WE,b as XE,c as ns,d as is,e as ss,f as as,g as cs,i as Cd,j as Td,l as Sd,m as wd,n as bI,o as CI,p as TI,q as SI,r as wI,s as EI,t as AI,u as vI,v as Ed,w as Ad,x as vd,y as Od,z as Id,za as Vt}from"./chunks/chunk-2QLXN6HZ.js";import{$ as CO,$a as vu,$b as yP,$c as wM,Aa as Ql,Ac as VP,Ba as eu,Bb as AR,Bc as HP,Ca as tu,Cb as vR,Cc as KP,Da as ru,Db as OR,Dc as Yt,Ea as ou,Eb as IR,Ec as Rp,Fa as nu,Fb as RR,Fc as Pp,G as uO,Ga as iu,Gb as fp,Gc as Mp,H as pO,Ha as su,Hb as _p,Hc as kp,I as mO,Ia as au,Ib as hp,Ic as xp,J as fO,Ja as cu,Jb as gp,Jc as Np,K as _O,Ka as du,Kb as yp,Kc as Lp,L as hO,La as lu,Lb as bp,Lc as Dp,M as gO,Ma as uu,Mb as Ep,Mc as $p,N as yO,Na as pu,Nb as Ap,Nc as Fp,O as td,Oa as mu,Ob as vp,Oc as jp,P as rd,Pa as fu,Pb as Op,Pc as Gp,Q as od,Qa as _u,Qb as dP,Qc as Up,R as nd,Ra as hu,Rb as lP,Rc as Bp,S as id,Sa as gu,Sb as uP,Sc as qp,T as sd,Ta as yu,Tb as pP,Tc as zp,U as ad,Ua as bu,Ub as mP,Uc as Jt,V as cd,Va as Cu,Vb as fP,Vc as Vp,W as dd,Wa as Tu,Wb as _P,Wc as WP,X as ld,Xa as Su,Xc as XP,Y as ud,Ya as wu,Yb as Ip,Yc as YP,Z as We,Za as Eu,Zb as hP,Zc as Hp,_ as bO,_a as Au,_b as gP,_c as JP,aa as TO,ac as bP,ad as EM,b as jE,ba as SO,bc as CP,bd as AM,c as GE,ca as wO,cb as QI,cc as TP,cd as vM,d as UE,da as EO,db as eR,dc as SP,dd as OM,e as zE,eb as tR,ec as wP,f as VE,fb as rR,fc as EP,g as HE,ga as AO,gb as oR,gc as AP,h as KE,ha as vO,hb as nR,hc as vP,i as Xv,ia as OO,ib as iR,ic as OP,j as Yv,ja as IO,jb as sR,jc as IP,k as Jv,ka as RO,kb as aR,kc as RP,l as Zv,la as PO,lb as cR,lc as PP,m as Qv,ma as MO,mb as dR,mc as MP,n as eO,na as pd,nb as lR,nc as kP,o as tO,oa as hl,ob as uR,oc as xP,p as rO,pa as gl,pc as NP,q as oO,qa as yl,qc as LP,r as nO,ra as bl,rc as DP,s as iO,sa as qI,sb as pR,sc as $P,t as sO,tc as FP,u as aO,ua as Cl,ub as mR,uc as jP,v as cO,va as Wl,vb as fR,vc as GP,w as dO,wa as Xl,wc as UP,x as lO,xa as Yl,xb as _R,xc as BP,ya as Jl,yb as hR,yc as qP,za as Zl,zb as gR,zc as zP}from"./chunks/chunk-GRHSNUQO.js";import{$a as EC,$c as Cn,$d as Rn,$e as kt,$f as fw,$g as ji,$h as lE,$i as QE,$l as $v,$m as Ma,$n as Ic,A as Xo,Ac as XC,Ad as NT,Ae as JT,Af as BS,Ag as Ow,Ah as Hw,Ai as wE,Aj as bA,Ak as QA,Al as ks,Am as ia,An as nc,Ao as jt,B as Ge,Bc as hn,Bd as LT,Be as ZT,Bf as qS,Bg as Iw,Bh as Kw,Bi as EE,Bj as CA,Bk as ev,Bl as xs,Bm as sa,Bn as ic,C as Yo,Cc as YC,Cd as DT,Ce as QT,Cf as zS,Cg as Rw,Ch as Ww,Ci as AE,Cj as TA,Ck as tv,Cl as Ns,Cm as aa,Cn as sc,Dc as JC,Dd as $T,De as eS,Df as VS,Dg as Ei,Di as vE,Dj as SA,Dk as rv,Dl as Ls,Dm as ca,Dn as ac,E as Qb,Eb as vC,Ec as ZC,Ed as FT,Ee as tS,Ef as HS,Eg as Ai,Eh as Xw,Ei as OE,Ej as wA,Ek as ov,El as Ds,Em as da,En as cc,F as eC,Fc as QC,Fd as jT,Fe as rS,Ff as KS,Fg as $,Fh as Ki,Fi as IE,Fj as EA,Fk as nv,Fl as $s,Fn as dc,G as tC,Gb as OC,Gc as eT,Ge as oS,Gg as vi,Gh as Wi,Gi as RE,Gk as iv,Gl as Fs,Gm as la,Gn as lc,H as rC,Hb as IC,Hc as tT,Hd as GT,He as nS,Hf as WS,Hj as AA,Hk as sv,Hl as js,Hm as ua,Hn as uc,I as oC,Ib as RC,Ic as rT,Id as UT,Ie as iS,If as XS,Ii as PE,Ij as vA,Ik as av,Il as Gs,Im as pa,In as pc,J as nC,Jb as PC,Jc as oT,Jd as BT,Je as sS,Jf as ii,Ji as ME,Jj as OA,Jk as Dt,Jl as Us,Jm as ma,Jn as mc,Kb as MC,Kc as gn,Kd as qT,Ke as aS,Kf as si,Ki as kE,Kj as IA,Kk as cv,Kl as Bs,Km as fa,Kn as fc,L as iC,Lc as nT,Ld as zT,Le as cS,Lf as ai,Lh as Yw,Li as xE,Lj as RA,Ll as qs,Lm as _a,Ln as _c,M as sC,Mc as yn,Md as VT,Me as dS,Mf as aw,Mg as Pw,Mh as Jw,Mi as es,Ml as zs,Mm as ha,Mn as hc,Na as gC,Nb as kC,Nd as HT,Ne as lS,Nf as cw,Ng as Mw,Nh as Zw,Ni as ts,Nj as PA,Nk as dv,Nl as Vs,Nm as ga,Nn as gc,Oa as yC,Ob as xC,Oc as iT,Od as KT,Oe as uS,Of as dw,Og as kw,Oh as Qw,Ok as lv,Ol as Hs,Om as ya,On as yc,P as aC,Pa as bC,Pc as sT,Pd as WT,Pe as pS,Pf as lw,Pg as Oi,Ph as eE,Pi as rs,Pj as MA,Pk as uv,Pm as ba,Pn as bc,Qc as aT,Qd as XT,Qe as mS,Qf as uw,Qg as Ii,Qh as tE,Qi as NE,Qj as kA,Qk as pv,Ql as Iv,Qm as Ca,Qn as Cc,Rb as P,Rc as cT,Rd as YT,Re as fS,Rg as Ri,Rj as xA,Rk as mv,Rl as Rv,Rm as Ta,Rn as Tc,S as cC,Sa as nn,Sb as NC,Sc as dT,Sd as Sn,Se as _S,Sf as pw,Sg as Pi,Sh as rE,Si as LE,Sj as NA,Sk as fv,Sm as Sa,Sn as Sc,Ta as CC,Tb as It,Td as wn,Te as hS,Tg as Mi,Ti as DE,Tj as LA,Tk as _v,Tm as wa,Tn as wc,U as dC,Ua as TC,Ub as LC,Ud as En,Ue as gS,Ug as ki,Uh as oE,Ui as $E,Uk as hv,Ul as Pv,Um as Ea,Un as Ec,V as lC,Va as SC,Vd as An,Ve as yS,Vg as xi,Vh as nE,Vk as _s,Vl as Mv,Vm as Aa,Vn as Ac,W as uC,Wa as wC,Wb as DC,Wd as vn,We as bS,Wg as Ni,Wh as iE,Wi as FE,Wk as hs,Wl as kv,Wm as va,Wn as vc,Xd as On,Xe as CS,Xg as Li,Xh as sE,Xk as gs,Xl as xv,Xm as Oa,Xn as Oc,Ya as sn,Yc as Rt,Yd as In,Ye as TS,Yf as mw,Yg as Di,Yh as aE,Yi as YE,Yk as ys,Yl as Nv,Ym as Ia,Za as an,Zc as Pt,Zd as Be,Ze as Mt,Zg as $i,Zh as cE,Zi as JE,Zk as bs,Zl as Lv,Zm as Ra,Zn as Ke,_a as Ue,_c as bn,_d as qe,_f as ui,_g as Fi,_h as dE,_i as ZE,_k as Cs,_l as Dv,_m as Pa,_n as re,ad as Tn,ae as Pn,af as ri,ag as pi,ah as Gi,ai as uE,aj as eA,al as Ts,am as Fv,an as ka,ao as Rc,b as jo,ba as pC,bb as cn,be as Mn,bf as oi,bh as Ui,bi as pE,bj as tA,bl as Ss,bm as jv,bn as xa,bo as Pc,c as Go,cb as dn,cd as lT,ce as kn,cf as xt,cg as _w,ch as xw,ci as mE,ck as DA,cl as ws,cm as Ve,cn as Na,co as Mc,d as Uo,da as mC,dd as uT,de as xn,dg as hw,dh as Nw,di as fE,dj as rA,dk as $A,dl as Es,dm as Gv,dn as La,do as kc,e as Bo,eb as ln,ed as pT,ee as Nn,ef as SS,eg as gw,eh as Bi,ei as _E,ej as oA,ek as FA,el as As,em as Uv,en as Da,eo as xc,f as $e,fd as mT,fe as Ln,fg as mi,fh as Lw,fi as hE,fk as jA,fl as vs,fm as Bv,fn as $a,fo as Nc,g as qo,ga as fC,gc as $C,gd as fT,ge as Dn,gf as wS,gg as fi,gh as qi,gk as GA,gl as Os,gm as Ft,gn as Fa,go as Lc,h as L,hc as FC,hd as _T,he as $n,hf as ze,hg as _i,hh as zi,hj as fs,hk as UA,hl as Is,hm as He,hn as ja,ho as Dc,i as Fe,ic as jC,id as hT,ie as Fn,if as ES,ig as hi,ih as Vi,ii as gE,ij as nA,ik as BA,il as gv,im as qv,in as Ga,io as $c,j as zo,jd as gT,je as jn,jf as AS,jg as gi,jh as Hi,ji as yE,jj as iA,jk as qA,jl as yv,jm as zv,jn as Ua,jo as Fc,k as Vo,ka as _C,kc as GC,kd as yT,ke as Gn,kf as vS,kg as yi,ki as Xi,kj as sA,kk as zA,kl as bv,km as Vv,kn as Ba,ko as jc,l as Ho,la as D,lc as UC,ld as bT,le as Un,lf as OS,lg as bi,li as bE,lj as aA,lk as Lt,ll as Cv,lm as Hv,ln as qa,lo as Gc,m as Ko,ma as hC,md as CT,me as Bn,mf as IS,mg as yw,mj as cA,ml as Tv,mm as Kv,mn as za,mo as Uc,n as Kb,na as b,nc as BC,nd as TT,ne as qn,nf as RS,ng as bw,ni as Yi,nj as dA,nk as VA,nl as Sv,nm as Wv,nn as Va,no as Bc,o as je,oa as Jo,oc as mn,od as ST,oe as zn,of as PS,oi as Ji,ol as wv,om as Ks,on as Ha,oo as qc,p as vt,pa as Zo,pd as wT,pe as Vn,pf as MS,pg as Ci,pi as Zi,pj as lA,pk as HA,pl as Ev,pm as Ws,pn as Ka,po as zc,q as Wb,qa as Qo,qc as fn,qd as ET,qe as Hn,qf as kS,qg as Ti,qh as Dw,qj as uA,qm as Xs,qn as Wa,qo as Vc,r as Xb,rb as un,rc as _n,rd as AT,re as Kn,rf as xS,rg as Cw,rh as $w,rj as pA,rm as Ys,rn as Xa,ro as Hc,s as Yb,sb as pn,sd as vT,se as Wn,sf as NS,sg as Si,sh as Fw,si as CE,sj as mA,sm as Js,sn as Ya,so as Kc,t as Jb,tb as AC,td as OT,te as Xn,tf as LS,tg as wi,th as jw,tk as KA,tl as $t,tm as Zs,tn as Ja,to as Wc,u as H,ua as en,uc as qC,ud as IT,ue as Yn,uf as DS,ug as Tw,uh as Gw,uj as fA,uk as WA,ul as Av,um as Qs,un as Za,uo as Xc,v as Zb,vc as zC,vd as RT,ve as Jn,vf as $S,vg as Sw,vh as Uw,vj as _A,vk as XA,vl as vv,vm as ea,vn as Qa,vo as Yc,wa as tn,wc as VC,wd as PT,we as Zn,wf as FS,wg as ww,wh as Bw,wi as Qi,wk as YA,wl as Ov,wm as ta,wn as ec,wo as Jc,x as Wo,xa as rn,xc as HC,xd as MT,xe as Qn,xf as jS,xg as Ew,xh as qw,xi as Nt,xj as hA,xk as JA,xl as Rs,xm as ra,xn as tc,xo as Zc,y as Ot,ya as on,yc as KC,yd as kT,ye as ei,yf as GS,yg as Aw,yh as zw,yi as TE,yj as gA,yl as Ps,ym as oa,yn as rc,yo as Qc,z as fe,zc as WC,zd as xT,ze as ti,zf as US,zg as vw,zh as Vw,zi as SE,zj as yA,zk as ZA,zl as Ms,zm as na,zn as oc,zo as ed}from"./chunks/chunk-JBJUOOJI.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="08485124-a2f1-5bb5-9316-533a3f7888bc")}catch{}})();var K="2026-07-28",o0=["2025-11-25","2025-06-18"],et=[K],m={headerMismatch:-32020,missingRequiredClientCapability:-32021,unsupportedProtocolVersion:-32022,invalidParams:-32602},A={clientCapabilities:"io.modelcontextprotocol/clientCapabilities",clientInfo:"io.modelcontextprotocol/clientInfo",logLevel:"io.modelcontextprotocol/logLevel",protocolVersion:"io.modelcontextprotocol/protocolVersion",serverInfo:"io.modelcontextprotocol/serverInfo"},lr=["debug","info","notice","warning","error","critical","alert","emergency"],p=class extends Error{code;data;constructor(t,r,o={}){super(t),this.name="PmMcpProtocolError",this.code=r,this.data=o}};function _(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Gh(e){if(e===void 0)return;if(!_(e))throw new p("Invalid MCP clientInfo metadata",m.invalidParams,{field:A.clientInfo,expected:"object"});let t=typeof e.name=="string"?e.name.trim():"",r=typeof e.version=="string"?e.version.trim():"";if(t.length===0||r.length===0)throw new p("Invalid MCP clientInfo metadata",m.invalidParams,{field:A.clientInfo,required:["name","version"]});let o={name:t.slice(0,128),version:r.slice(0,128)};return typeof e.description=="string"&&e.description.trim()&&(o.description=e.description.trim().slice(0,1024)),typeof e.websiteUrl=="string"&&e.websiteUrl.trim()&&(o.websiteUrl=e.websiteUrl.trim().slice(0,2048)),o}function Uh(e){if(e!==void 0){if(typeof e!="string"||!lr.includes(e))throw new p("Invalid MCP logLevel metadata",m.invalidParams,{field:A.logLevel,allowed:[...lr]});return e}}function tt(e){let t=_(e)?e._meta:void 0;if(!_(t))throw new p("Missing required MCP request metadata",m.invalidParams,{required:[A.protocolVersion,A.clientCapabilities]});let r=t[A.protocolVersion];if(typeof r!="string"||!et.includes(r))throw new p("Unsupported protocol version",m.unsupportedProtocolVersion,{supported:[...et],requested:typeof r=="string"?r:null});let o=t[A.clientCapabilities];if(!_(o))throw new p("Invalid MCP client capabilities metadata",m.invalidParams,{field:A.clientCapabilities,expected:"object"});let n=Gh(t[A.clientInfo]),i=Uh(t[A.logLevel]);return{protocolVersion:K,clientCapabilities:o,...n?{clientInfo:n}:{},...i?{logLevel:i}:{}}}function n0(e,t){if(t!==e.protocolVersion)throw new p("MCP protocol header does not match request metadata",m.headerMismatch,{header:t??null,metadata:e.protocolVersion})}function i0(e,t){let r=t.filter(o=>!Object.prototype.hasOwnProperty.call(e.clientCapabilities,o));if(r.length>0)throw new p("Missing required client capability",m.missingRequiredClientCapability,{requiredCapabilities:Object.fromEntries(r.map(o=>[o,{}]))})}function s0(e,t){let r=e.clientCapabilities.extensions;return _(r)&&_(r[t])}function rt(e,t){let r=_(e._meta)?e._meta:{};return{...e,_meta:{...r,[A.serverInfo]:{...t}}}}function Bh(e,t){return rt({...e,resultType:"complete"},t)}function a0(e){let t=e.ttlMs??6e4;if(!Number.isFinite(t)||t<0)throw new p("Invalid MCP discovery cache TTL",m.invalidParams,{ttlMs:t});return Bh({supportedVersions:[...et],capabilities:structuredClone(e.capabilities),ttlMs:t,cacheScope:"public",...e.instructions?{instructions:e.instructions}:{}},e.serverInfo)}function c0(e,t){if(_(e)&&typeof e.resultType=="string")return e.resultType;if(t==="legacy")return"complete";throw new p("Modern MCP result is missing resultType",m.invalidParams,{required:"resultType"})}import{createHash as mr,createHmac as fr,timingSafeEqual as qh}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="6505e714-d1f3-5794-88c8-51c1644acec9")}catch{}})();var zh=["elicitation/create","roots/list","sampling/createMessage"],ur=class extends Error{inputRequests;requestState;constructor(t){super("MCP operation requires additional input"),this.name="PmMcpInputRequiredError",this.inputRequests=t.inputRequests,this.requestState=t.requestState}},_r=/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/u,ge=32,nt=64*1024,ye=16*1024,ot={maxBytes:256*1024,maxDepth:32,maxNodes:4096};function Vh(e){return e==="elicitation/create"?"elicitation":e==="sampling/createMessage"?"sampling":"roots"}function be(e,t,r){let o;try{o=JSON.stringify(e)}catch{throw new p(`Invalid ${r}: value is not JSON serializable`,m.invalidParams,{field:r})}if(Buffer.byteLength(o,"utf8")>t)throw new p(`Invalid ${r}: payload exceeds the protocol bound`,m.invalidParams,{field:r,maximumBytes:t})}function it(e,t){if(!_(e))throw new p("Invalid MCP inputRequests",m.invalidParams,{field:"inputRequests",expected:"object"});let r=Object.entries(e);if(r.length===0||r.length>ge)throw new p("Invalid MCP inputRequests count",m.invalidParams,{minimum:1,maximum:ge,observed:r.length});let o={};for(let[n,i]of r){if(!_r.test(n)||!_(i))throw new p("Invalid MCP input request entry",m.invalidParams,{field:`inputRequests.${n}`});let s=i.method;if(typeof s!="string"||!zh.includes(s))throw new p("Unsupported MCP input request method",m.invalidParams,{field:`inputRequests.${n}.method`,method:s??null});let a=Vh(s);if(!Object.prototype.hasOwnProperty.call(t.clientCapabilities,a))throw new p("Missing required client capability",m.missingRequiredClientCapability,{requiredCapabilities:{[a]:{}}});if(!_(i.params))throw new p("Invalid MCP input request parameters",m.invalidParams,{field:`inputRequests.${n}.params`,expected:"object"});o[n]={method:s,params:structuredClone(i.params)}}return be(o,nt,"inputRequests"),o}function hr(e){if(!_(e))throw new p("Invalid MCP inputResponses",m.invalidParams,{field:"inputResponses",expected:"object"});let t=Object.entries(e);if(t.length>ge)throw new p("Invalid MCP inputResponses count",m.invalidParams,{maximum:ge,observed:t.length});let r={};for(let[o,n]of t){if(!_r.test(o)||!_(n))throw new p("Invalid MCP input response entry",m.invalidParams,{field:`inputResponses.${o}`});r[o]=structuredClone(n)}return be(r,nt,"inputResponses"),r}function p0(e){let t=e.requestState?.trim();if(t&&Buffer.byteLength(t,"utf8")>ye)throw new p("Invalid MCP requestState: payload exceeds the protocol bound",m.invalidParams,{field:"requestState",maximumBytes:ye});let r=e.inputRequests===void 0?void 0:it(e.inputRequests,e.requestContext);if(r===void 0&&!t)throw new p("InputRequiredResult requires inputRequests or requestState",m.invalidParams,{requiredAnyOf:["inputRequests","requestState"]});return{resultType:"input_required",...r?{inputRequests:r}:{},...t?{requestState:t}:{},_meta:{[A.serverInfo]:{...e.serverInfo}}}}function gr(e){let t=Buffer.from(e);if(t.byteLength<32)throw new p("MCP requestState signing key must contain at least 32 bytes",m.invalidParams,{minimumBytes:32});return t}function m0(e,t){if(!Number.isSafeInteger(e.expiresAt)||e.expiresAt<=0||e.method.trim().length===0||e.parameterDigest.trim().length===0||e.principal.trim().length===0)throw new p("Invalid MCP requestState payload",m.invalidParams);let r=Buffer.from(JSON.stringify({version:1,...e}),"utf8");if(r.byteLength>ye/2)throw new p("MCP requestState payload exceeds the protocol bound",m.invalidParams,{maximumBytes:ye/2});let o=r.toString("base64url"),n=fr("sha256",gr(t)).update(o).digest("base64url");return`${o}.${n}`}function Hh(e){if(!_(e)||e.version!==1)throw new p("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});let{expiresAt:t,method:r,parameterDigest:o,principal:n,state:i}=e;if(typeof t!="number"||!Number.isSafeInteger(t))throw new p("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});if(typeof r!="string"||typeof o!="string"||typeof n!="string")throw new p("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});return{expiresAt:t,method:r,parameterDigest:o,principal:n,state:i}}function f0(e,t,r){let[o,n,i]=e.split(".");if(!o||!n||i!==void 0)throw new p("Invalid MCP requestState encoding",m.invalidParams,{field:"requestState"});let s=Buffer.from(n,"base64url"),a=fr("sha256",gr(t)).update(o).digest();if(s.byteLength!==a.byteLength||!qh(s,a))throw new p("Invalid MCP requestState signature",m.invalidParams,{field:"requestState"});let c;try{c=JSON.parse(Buffer.from(o,"base64url").toString("utf8"))}catch{c=null}let d=Hh(c),{expiresAt:l,method:u,parameterDigest:f,principal:g}=d;if(l<(r.nowMs??Date.now()))throw new p("Expired MCP requestState",m.invalidParams,{field:"requestState",expiredAt:l});if(u!==r.method||f!==r.parameterDigest||g!==r.principal)throw new p("MCP requestState binding mismatch",m.invalidParams,{field:"requestState"});return d}function _0(e){return be(e,nt,"request parameters"),mr("sha256").update(JSON.stringify(e)).digest("hex")}var pr=class{#e=new Set;#t;constructor(t=4096){if(!Number.isSafeInteger(t)||t<1)throw new p("Invalid MCP replay guard capacity",m.invalidParams,{maximumEntries:t});this.#t=t}consume(t){let r=mr("sha256").update(t).digest("hex");if(this.#e.has(r))throw new p("MCP requestState replay detected",m.invalidParams,{field:"requestState"});if(this.#e.size>=this.#t){let o=this.#e.values().next().value;this.#e.delete(o)}this.#e.add(r)}};function Kh(e){if(!Number.isSafeInteger(e.ttlMs)||e.ttlMs<0||e.cacheScope!=="public"&&e.cacheScope!=="private")throw new p("Invalid MCP cache policy",m.invalidParams,{ttlMs:e.ttlMs,cacheScope:e.cacheScope});return{ttlMs:e.ttlMs,cacheScope:e.cacheScope}}function h0(e,t){return{...e,...Kh(t)}}function Wh(e){return e.replaceAll("~1","/").replaceAll("~0","~")}function Xh(e,t){if(t==="#")return e;if(!t.startsWith("#/"))return;let r=e;for(let o of t.slice(2).split("/").map(Wh)){if(!_(r)&&!Array.isArray(r)||!Object.prototype.hasOwnProperty.call(r,o))return;r=r[o]}return r}function Yh(e){let t=e.maxBytes??ot.maxBytes,r=e.maxDepth??ot.maxDepth,o=e.maxNodes??ot.maxNodes;if(!Number.isSafeInteger(t)||t<2)throw new p("Invalid MCP JSON Schema work bounds",m.invalidParams);if(!Number.isSafeInteger(r)||r<1)throw new p("Invalid MCP JSON Schema work bounds",m.invalidParams);if(!Number.isSafeInteger(o)||o<1)throw new p("Invalid MCP JSON Schema work bounds",m.invalidParams);return{maximumBytes:t,maximumDepth:r,maximumNodes:o}}function Jh(e,t){let r=Array.isArray(e.value)?e.value:_(e.value)?Object.values(e.value):[];for(let o of r)t.push({value:o,depth:e.depth+1})}function Zh(e,t){if(!_(t)||typeof t.$ref!="string")return;let r=t.$ref;if(r.startsWith("#")&&Xh(e,r)===void 0)throw new p("MCP JSON Schema contains an unresolved local reference",m.invalidParams,{reference:r})}function g0(e,t={}){let{maximumBytes:r,maximumDepth:o,maximumNodes:n}=Yh(t);if(typeof e!="boolean"&&!_(e))throw new p("Invalid MCP JSON Schema root",m.invalidParams,{expected:"object or boolean"});be(e,r,"JSON Schema");let i=[{value:e,depth:0}],s=0;for(;i.length>0;){let a=i.pop();if(s+=1,s>n||a.depth>o)throw new p("MCP JSON Schema exceeds validation work bounds",m.invalidParams,{maximumDepth:o,maximumNodes:n});Zh(e,a.value),Jh(a,i)}return structuredClone(e)}import{randomUUID as Qh}from"node:crypto";import{readFile as eg}from"node:fs/promises";import yr from"node:path";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="7f5b3ba6-07cf-5317-8f62-63e84f561232")}catch{}})();var A0="io.modelcontextprotocol/tasks",tg=["working","input_required","completed","failed","cancelled"],rg=/^mcp-task-[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/iu,og=3600*1e3,ng=1e3,Te=1024,ig=30,sg=2e3;function st(e){return new p(e,m.invalidParams,{code:"mcp_task_not_found_or_not_authorized"})}function Ce(e){let t=e.trim();if(!rg.test(t))throw st("Unknown MCP task");return t}function br(e,t){if(typeof e!="string"||!Number.isFinite(Date.parse(e)))throw new p("Corrupt MCP task record",m.invalidParams,{field:t});return e}function Cr(e){if(!_(e)||typeof e.code!="number"||!Number.isFinite(e.code)||typeof e.message!="string")throw new p("Corrupt MCP task error",m.invalidParams);return{code:e.code,message:e.message.slice(0,Te),..._(e.data)?{data:structuredClone(e.data)}:{}}}function ag(e){if(!tg.includes(e))throw new p("Corrupt MCP task record",m.invalidParams);return e}function cg(e){if(typeof e!="string"||e.length===0)throw new p("Corrupt MCP task record",m.invalidParams);return e}function dg(e){if(typeof e!="number"||!Number.isSafeInteger(e)||e<1)throw new p("Corrupt MCP task record",m.invalidParams);return e}function lg(e){if(e!==null&&(typeof e!="number"||!Number.isSafeInteger(e)||e<0))throw new p("Corrupt MCP task record",m.invalidParams);return e}function ug(e){if(e!==void 0){if(typeof e!="number"||!Number.isSafeInteger(e)||e<0)throw new p("Corrupt MCP task record",m.invalidParams);return e}}function pg(e){if(!Array.isArray(e)||e.some(t=>typeof t!="string"))throw new p("Corrupt MCP task record",m.invalidParams);return[...e]}function mg(e){if(!_(e)||e.version!==1)throw new p("Corrupt MCP task record",m.invalidParams);let t=typeof e.taskId=="string"?Ce(e.taskId):"",r=ag(e.status),o=cg(e.principal),n=dg(e.workerPid),i=lg(e.ttlMs),s=ug(e.pollIntervalMs),a={version:1,taskId:t,status:r,principal:o,workerPid:n,createdAt:br(e.createdAt,"createdAt"),lastUpdatedAt:br(e.lastUpdatedAt,"lastUpdatedAt"),ttlMs:i,consumedInputKeys:pg(e.consumedInputKeys),...typeof e.statusMessage=="string"?{statusMessage:e.statusMessage.slice(0,Te)}:{},...typeof s=="number"?{pollIntervalMs:s}:{}};if(_(e.inputRequests)&&(a.inputRequests=structuredClone(e.inputRequests)),_(e.inputResponses)&&(a.inputResponses=structuredClone(e.inputResponses)),_(e.result)&&(a.result=structuredClone(e.result)),e.error!==void 0&&(a.error=Cr(e.error)),a.status==="input_required"&&!a.inputRequests||a.status==="completed"&&!a.result||a.status==="failed"&&!a.error)throw new p("Corrupt MCP task status payload",m.invalidParams,{status:a.status});return a}function W(e){let t={taskId:e.taskId,status:e.status,createdAt:e.createdAt,lastUpdatedAt:e.lastUpdatedAt,ttlMs:e.ttlMs,...e.statusMessage?{statusMessage:e.statusMessage}:{},...e.pollIntervalMs===void 0?{}:{pollIntervalMs:e.pollIntervalMs}};return e.status==="input_required"?{...t,status:"input_required",inputRequests:structuredClone(e.inputRequests)}:e.status==="completed"?{...t,status:"completed",result:structuredClone(e.result)}:e.status==="failed"?{...t,status:"failed",error:structuredClone(e.error)}:e.status==="cancelled"?{...t,status:"cancelled"}:{...t,status:"working"}}function ne(e){return e==="completed"||e==="failed"||e==="cancelled"}function fg(e){try{return process.kill(e,0),!0}catch(t){return!(typeof t=="object"&&t!==null&&"code"in t&&t.code==="ESRCH")}}var at=class{#e;#t;#r;#o;#i;constructor(t){this.#e=yr.resolve(t.pmRoot),this.#t=t.owner?.trim()||"pm-mcp",this.#r=t.now??(()=>new Date),this.#o=t.taskIdFactory??(()=>`mcp-task-${Qh()}`),this.#i=t.workerPid??process.pid}#s(t){return yr.join(this.#e,"runtime","mcp-tasks","records",`${Ce(t)}.json`)}async#c(t){try{return mg(JSON.parse(await eg(this.#s(t),"utf8")))}catch(r){throw fe(r)||r instanceof SyntaxError?st("Unknown MCP task"):r}}async#a(t){await Ge(this.#s(t.taskId),`${JSON.stringify(t,null,2)}
|
|
2
2
|
`)}async#n(t,r,o){let n=Ce(t),i=await ze(this.#e,n,ig,this.#t,!1,!1,sg);try{let s=await this.#c(n);if(s.principal!==r)throw st("Unknown MCP task");let a=o(s);return await this.#a(a),a}finally{await i()}}async create(t){let r=Ce(this.#o()),o=t.principal.trim(),n=t.ttlMs===void 0?og:t.ttlMs,i=t.pollIntervalMs??ng;if(o.length===0||n!==null&&(!Number.isSafeInteger(n)||n<0)||!Number.isSafeInteger(i)||i<0)throw new p("Invalid MCP task creation options",m.invalidParams);let s=this.#r().toISOString(),a={version:1,taskId:r,status:"working",createdAt:s,lastUpdatedAt:s,ttlMs:n,pollIntervalMs:i,principal:o,workerPid:this.#i,consumedInputKeys:[],...t.statusMessage?.trim()?{statusMessage:t.statusMessage.trim().slice(0,Te)}:{}};return await this.#a(a),{...W(a),resultType:"task"}}async get(t,r){return W(await this.#n(t,r,o=>{if(ne(o.status))return o;let n=this.#r().getTime(),i=o.ttlMs!==null&&Date.parse(o.createdAt)+o.ttlMs<=n,s=o.workerPid!==this.#i&&!fg(o.workerPid);return!i&&!s?o:{...o,status:"failed",statusMessage:i?"Task retention expired before completion.":"Task worker ended before recording a terminal result.",lastUpdatedAt:this.#r().toISOString(),error:{code:-32603,message:i?"MCP task expired":"MCP task worker unavailable after restart",data:{recoverable:!1,createNewTask:!0}},inputRequests:void 0}}))}async requireInput(t){let r=it(t.inputRequests,t.requestContext);return W(await this.#n(t.taskId,t.principal,o=>{if(ne(o.status))return o;let n=Object.keys(r).filter(i=>o.consumedInputKeys.includes(i));if(n.length>0)throw new p("MCP task input request keys must be unique for the task lifetime",m.invalidParams,{reused:n});return{...o,status:"input_required",statusMessage:t.statusMessage?.trim().slice(0,Te),lastUpdatedAt:this.#r().toISOString(),inputRequests:r}}))}async update(t,r,o){let n=hr(o),i=[],s=[];return await this.#n(t,r,a=>{if(a.status!=="input_required"||!a.inputRequests)return a;let c={...a.inputRequests},d=a.inputResponses?{...a.inputResponses}:{};for(let[l,u]of Object.entries(n))Object.prototype.hasOwnProperty.call(c,l)&&(d[l]=u,delete c[l],i.push(l));return s=Object.keys(c).sort(),i.length===0?a:{...a,status:s.length===0?"working":"input_required",lastUpdatedAt:this.#r().toISOString(),inputRequests:s.length===0?void 0:c,inputResponses:d,consumedInputKeys:[...new Set([...a.consumedInputKeys,...i])].sort()}}),{acceptedKeys:i.sort(),remainingKeys:s}}async takeInputResponses(t,r){let o={};return await this.#n(t,r,n=>(o=structuredClone(n.inputResponses??{}),Object.keys(o).length===0?n:{...n,inputResponses:void 0})),o}async complete(t,r,o){return W(await this.#n(t,r,n=>ne(n.status)?n:{...n,status:"completed",statusMessage:"Task completed.",lastUpdatedAt:this.#r().toISOString(),result:structuredClone(o),inputRequests:void 0,error:void 0}))}async fail(t,r,o){let n=Cr(o);return W(await this.#n(t,r,i=>ne(i.status)?i:{...i,status:"failed",statusMessage:n.message,lastUpdatedAt:this.#r().toISOString(),error:n,inputRequests:void 0,result:void 0}))}async cancel(t,r){return W(await this.#n(t,r,o=>ne(o.status)?o:{...o,status:"cancelled",statusMessage:"Task cancelled by the client.",lastUpdatedAt:this.#r().toISOString(),inputRequests:void 0,result:void 0,error:void 0}))}};function v0(e){return new at(e)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="f87864d3-e499-57f7-b1e3-4ea3f30b7725")}catch{}})();var Se="io.modelcontextprotocol/subscriptionId",Tr=256,Sr=2048,_g=5e3;function hg(e,t){return new Promise((r,o)=>{let n=setTimeout(()=>o(new Error("MCP subscription sink write timed out")),_g);n.unref(),Promise.resolve().then(()=>e(t)).then(()=>{clearTimeout(n),r()},i=>{clearTimeout(n),o(i instanceof Error?i:new Error(String(i)))})})}function ct(e,t){if(e!==void 0){if(typeof e!="boolean")throw new p("Invalid MCP subscription filter",m.invalidParams,{field:`notifications.${t}`,expected:"boolean"});return e||void 0}}function gg(e){if(!_(e))throw new p("Invalid MCP subscription filter",m.invalidParams,{field:"notifications",expected:"object"});let t=ct(e.toolsListChanged,"toolsListChanged"),r=ct(e.promptsListChanged,"promptsListChanged"),o=ct(e.resourcesListChanged,"resourcesListChanged"),n;if(e.resourceSubscriptions!==void 0){if(!Array.isArray(e.resourceSubscriptions)||e.resourceSubscriptions.length>Tr)throw new p("Invalid MCP resource subscriptions",m.invalidParams,{field:"notifications.resourceSubscriptions",maximum:Tr});let i=new Set;for(let s of e.resourceSubscriptions){if(typeof s!="string"||s.trim().length===0||Buffer.byteLength(s,"utf8")>Sr)throw new p("Invalid MCP resource subscription URI",m.invalidParams,{field:"notifications.resourceSubscriptions",maximumBytes:Sr});i.add(s)}i.size>0&&(n=[...i].sort())}return{...t?{toolsListChanged:t}:{},...r?{promptsListChanged:r}:{},...o?{resourcesListChanged:o}:{},...n?{resourceSubscriptions:n}:{}}}function yg(e,t){return{...e.toolsListChanged&&t.tools?.listChanged?{toolsListChanged:!0}:{},...e.promptsListChanged&&t.prompts?.listChanged?{promptsListChanged:!0}:{},...e.resourcesListChanged&&t.resources?.listChanged?{resourcesListChanged:!0}:{},...e.resourceSubscriptions&&t.resources?.subscribe?{resourceSubscriptions:[...e.resourceSubscriptions]}:{}}}var wr=class{#e;#t=new Map;#r;constructor(t){this.#e=structuredClone(t.capabilities),this.#r={...t.serverInfo}}get size(){return this.#t.size}async open(t){if(this.#t.has(t.id))throw new p("MCP subscription id is already active",m.invalidParams,{subscriptionId:t.id});let r=yg(gg(t.notifications),this.#e),o={filter:r,sink:t.sink,writeQueue:Promise.resolve()};this.#t.set(t.id,o);try{await this.#o(t.id,o,{jsonrpc:"2.0",method:"notifications/subscriptions/acknowledged",params:{_meta:{[Se]:t.id},notifications:structuredClone(r)}},!0)}catch(n){throw this.#t.delete(t.id),n}return structuredClone(r)}async emitListChanged(t){let r=`${t}ListChanged`,o=`notifications/${t}/list_changed`,n=[];for(let[i,s]of this.#t)s.filter[r]===!0&&n.push(this.#o(i,s,{jsonrpc:"2.0",method:o,params:{_meta:{[Se]:i}}}));return(await Promise.all(n)).filter(Boolean).length}async emitResourceUpdated(t){let r=[];for(let[o,n]of this.#t)n.filter.resourceSubscriptions?.includes(t)&&r.push(this.#o(o,n,{jsonrpc:"2.0",method:"notifications/resources/updated",params:{_meta:{[Se]:o},uri:t}}));return(await Promise.all(r)).filter(Boolean).length}async#o(t,r,o,n=!1){let i=r.writeQueue.then(async()=>{if(this.#t.get(t)!==r)return!1;try{return await hg(r.sink,o),!0}catch(s){if(this.#t.get(t)===r&&this.#t.delete(t),n)throw s;return!1}});return r.writeQueue=i.then(()=>{},()=>{}),i}close(t){if(this.#t.delete(t))return{...rt({resultType:"complete",_meta:{[Se]:t}},this.#r)}}closeAll(){let t=[];for(let r of this.#t.keys()){let o=this.close(r);t.push({id:r,result:o})}return t}};(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="7d591d0b-f009-519c-8024-c6fa18effb8e")}catch{}})();var Er=/^=\?base64\?([A-Za-z0-9+/]*={0,2})\?=$/u,bg=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/u,Ar=/^[\t\x20-\x7E]*$/u,vr=new Set(["prompts/get","resources/read","tools/call"]);function Cg(e){let t=new Map;for(let[r,o]of Object.entries(e)){if(o===void 0)continue;let n=typeof o=="string"?o:o.join(", ");t.set(r.toLowerCase(),n)}return t}function v(e,t){throw new p(e,m.headerMismatch,{header:t})}function Or(e){let t=typeof e=="boolean"?String(e).toLowerCase():String(e);return t.length>0&&t.trim()===t&&Ar.test(t)&&!Er.test(t)?t:`=?base64?${Buffer.from(t,"utf8").toString("base64")}?=`}function Ir(e,t){let r=Er.exec(e);if(r){let o=r[1],n=Buffer.from(o,"base64");return n.toString("base64")!==o||n.length===0?v("Malformed MCP Base64 header value",t):n.toString("utf8")}return e.length===0||e.trim()!==e||!Ar.test(e)?v("Malformed MCP header value",t):e}function we(e){return Array.isArray(e)?e.some(we):_(e)?Object.prototype.hasOwnProperty.call(e,"x-mcp-header")||Object.values(e).some(we):!1}function Tg(e,t,r){let o=e["x-mcp-header"];if(o===void 0)return;let n=e.type;if(typeof o!="string"||!bg.test(o)||!["boolean","integer","string"].includes(String(n))||r.has(o.toLowerCase()))throw new p("Invalid MCP x-mcp-header annotation",m.invalidParams,{field:t.join("."),annotation:o});return r.add(o.toLowerCase()),{name:o,path:t,type:n}}function Rr(e){if(!_(e))throw new p("Invalid MCP tool schema",m.invalidParams,{field:"inputSchema",expected:"object"});let t=[],r=new Set,o=(n,i)=>{let s=n.properties;if(s!==void 0){if(!_(s))throw new p("Invalid MCP tool schema properties",m.invalidParams,{field:"inputSchema.properties"});for(let[a,c]of Object.entries(s)){if(!_(c))continue;let d=[...i,a],l=Tg(c,d,r);l&&t.push(l);for(let[u,f]of Object.entries(c))if(u!=="properties"&&u!=="x-mcp-header"&&we(f))throw new p("MCP x-mcp-header is not statically reachable",m.invalidParams,{field:d.join("."),keyword:u});o(c,d)}}};for(let[n,i]of Object.entries(e))if(n!=="properties"&&we(i))throw new p("MCP x-mcp-header is not statically reachable",m.invalidParams,{field:"inputSchema",keyword:n});return o(e,[]),t}function Pr(e,t){let r=e;for(let o of t){if(!_(r))return;r=r[o]}return r}function Mr(e,t){let r=e==="resources/read"?t.uri:t.name;return typeof r=="string"?r:void 0}function Sg(e,t){let r=_(e.arguments)?e.arguments:{},o={};for(let n of Rr(t)){let i=Pr(r,n.path);if(i==null)continue;if(!(n.type==="integer"&&typeof i=="number"&&Number.isSafeInteger(i)||n.type==="boolean"&&typeof i=="boolean"||n.type==="string"&&typeof i=="string"))throw new p("Invalid MCP custom header argument",m.invalidParams,{field:n.path.join("."),expected:n.type});o[`Mcp-Param-${n.name}`]=Or(i)}return o}function M0(e){let t=_(e.request.params)?e.request.params:void 0,r=tt(t),o=e.request.method;if(typeof o!="string"||o.length===0)return v("Missing MCP request method","Mcp-Method");let n={Accept:"application/json, text/event-stream","Content-Type":"application/json","MCP-Protocol-Version":r.protocolVersion,"Mcp-Method":o},i=Mr(o,t);if(vr.has(o)){if(i===void 0)return v("Missing MCP request name","Mcp-Name");n["Mcp-Name"]=Or(i)}return o==="tools/call"&&e.toolSchema!==void 0&&Object.assign(n,Sg(t,e.toolSchema)),n}function wg(e,t){let r=t.method;(typeof r!="string"||r.length===0)&&v("Missing MCP request method","Mcp-Method");let o=_(t.params)?t.params:void 0,n=tt(o).protocolVersion;if(e.get("mcp-protocol-version")!==n&&v("MCP protocol header does not match request metadata","MCP-Protocol-Version"),e.get("mcp-method")!==r&&v("MCP method header does not match request body","Mcp-Method"),vr.has(r)){let i=e.get("mcp-name"),s=Mr(r,o);(i===void 0||s===void 0||Ir(i,"Mcp-Name")!==s)&&v("MCP name header does not match request body","Mcp-Name")}e.has("last-event-id")&&v("MCP SSE resumability is not supported","Last-Event-ID")}function Eg(e,t,r){return e.type==="integer"?typeof t=="number"&&Number.isSafeInteger(t)&&Number(r)===t:e.type==="boolean"?typeof t=="boolean"&&r===String(t):typeof t=="string"&&r===t}function Ag(e){let t=_(e.params.arguments)?e.params.arguments:{};for(let r of Rr(e.toolSchema)){let o=Pr(t,r.path),n=`Mcp-Param-${r.name}`,i=e.headers.get(n.toLowerCase());if(o==null){i!==void 0&&v("Unexpected MCP parameter header",n);continue}i===void 0&&v("Missing MCP parameter header",n),Eg(r,o,Ir(i,n))||v("MCP parameter header does not match request body",n)}}function k0(e){let t=Cg(e.headers),r=typeof e.request.method=="string"?e.request.method:"";wg(t,e.request),!(r!=="tools/call"||e.toolSchema===void 0)&&Ag({headers:t,params:e.request.params,toolSchema:e.toolSchema})}var x0=K;import{AsyncLocalStorage as vg}from"node:async_hooks";import{createHash as kr,timingSafeEqual as Og}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="6a5310f6-3add-5108-b39f-61607918dc9f")}catch{}})();var y=class extends Error{httpStatus;challenge;constructor(t,r,o){super(t),this.name="PmMcpAuthorizationError",this.httpStatus=r,this.challenge=o}},Ig=/^00-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})$/u,Rg=/^[a-z][a-z0-9_*/-]{0,255}$/u,Pg=/^(?:[a-z0-9][a-z0-9_*/-]{0,240})@[a-z][a-z0-9_*/-]{0,13}$/u,Mg=/^[\x20-\x2B\x2D-\x3C\x3E-\x7E]{0,255}[\x21-\x2B\x2D-\x3C\x3E-\x7E]$/u,Nr=/^[\x21\x23-\x5B\x5D-\x7E]+$/u,Lr=/^[A-Za-z0-9!#$%&'*+.^_`|~-]+$/u,kg=/^[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]*$/u,xg=/%(?![0-9A-Fa-f]{2})/u,Ng=512,Lg=32,Dg=180,$g=8192,Fg=8192,Dr=new vg;function E(e,t,r=!1){if(new RegExp("\\p{Cc}","u").test(e))throw new y(`Invalid ${t}`,401);let o;try{o=new URL(e)}catch{throw new y(`Invalid ${t}`,401)}let n=o.hostname==="127.0.0.1"||o.hostname==="localhost";if(o.hash.length>0||o.protocol!=="https:"&&!(r&&n&&o.protocol==="http:"))throw new y(`Invalid ${t}`,401);return o}function jg(e,t){let r=t.toLowerCase();for(let[o,n]of Object.entries(e))if(!(o.toLowerCase()!==r||n===void 0))return typeof n=="string"?n:n.join(", ")}function F0(e){let t=E(e.resource,"protected resource URI",!0).href.replace(/\/$/u,"");if(e.authorizationServers.length===0)throw new y("Protected resource metadata requires an authorization server",401);let r=e.authorizationServers.map(n=>E(n,"authorization server issuer").href.replace(/\/$/u,"")),o=[...new Set(e.scopes??[])];if(o.some(n=>!Nr.test(n)))throw new y("Invalid authorization scope",401);return{resource:t,authorization_servers:r,...o.length>0?{scopes_supported:o.sort()}:{}}}function j0(e){let t=E(e,"authorization server issuer"),r=t.pathname.replace(/^\/+|\/+$/gu,""),o=t.origin;return r?[`${o}/.well-known/oauth-authorization-server/${r}`,`${o}/.well-known/openid-configuration/${r}`,`${o}/${r}/.well-known/openid-configuration`]:[`${o}/.well-known/oauth-authorization-server`,`${o}/.well-known/openid-configuration`]}function G0(e,t){if(!_(e)||typeof e.issuer!="string")throw new y("Invalid authorization server metadata",401);let r=E(t,"expected issuer").href.replace(/\/$/u,"");if(E(e.issuer,"metadata issuer").href.replace(/\/$/u,"")!==r)throw new y("Authorization server issuer mismatch",401);if(!Array.isArray(e.code_challenge_methods_supported)||!e.code_challenge_methods_supported.includes("S256"))throw new y("Authorization server does not support required S256 PKCE",401);let n=d=>{let l=e[d];if(typeof l!="string")throw new y(`Authorization server metadata requires ${d}`,401);return E(l,d).href},i=d=>{let l=e[d];return typeof l=="string"?E(l,d).href:void 0},s=n("authorization_endpoint"),a=n("token_endpoint"),c=i("registration_endpoint");return{issuer:r,authorization_endpoint:s,token_endpoint:a,code_challenge_methods_supported:[...new Set(e.code_challenge_methods_supported.filter(d=>typeof d=="string"))],...e.client_id_metadata_document_supported===!0?{client_id_metadata_document_supported:!0}:{},...c?{registration_endpoint:c}:{}}}function U0(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 B0(e){if(e.responseIssuer===void 0){if(e.issuerParameterSupported)throw new y("Authorization response omitted the advertised issuer",401);return}if(e.responseIssuer!==e.expectedIssuer)throw new y("Authorization response issuer mismatch",401)}function q0(e,t){let r=E(t,"client metadata document URL");if(r.pathname==="/"||!_(e)||e.client_id!==r.href||typeof e.client_name!="string"||e.client_name.trim().length===0||!Array.isArray(e.redirect_uris)||e.redirect_uris.length===0)throw new y("Invalid Client ID Metadata Document",401);for(let o of e.redirect_uris){if(typeof o!="string")throw new y("Invalid client redirect URI",401);E(o,"client redirect URI",!0)}return structuredClone(e)}function z0(e){if(e.redirectUris.length===0||e.clientName.trim().length===0)throw new y("Invalid dynamic client registration metadata",401);let t=e.redirectUris.map(r=>E(r,"redirect URI",!0).href);return{application_type:e.applicationType,client_name:e.clientName.trim().slice(0,128),redirect_uris:t,grant_types:["authorization_code","refresh_token"],response_types:["code"],token_endpoint_auth_method:"none"}}var xr=class{#e=new Map;set(t,r){let o=E(t,"credential issuer").href;this.#e.set(o,structuredClone(r))}get(t){let r=E(t,"credential issuer").href,o=this.#e.get(r);return o?structuredClone(o):void 0}delete(t){let r=E(t,"credential issuer").href;return this.#e.delete(r)}};function Gg(e){let t=e.traceparent,r=e.tracestate;if(t!==void 0){let o=typeof t=="string"?Ig.exec(t):null;if(!o)throw new y("Invalid MCP traceparent",403);let n=o[1],i=o[2];if(/^0+$/u.test(n)||/^0+$/u.test(i))throw new y("Invalid MCP traceparent",403)}if(r!==void 0&&(typeof r!="string"||!Bg(r)))throw new y("Invalid MCP tracestate",403);return{...typeof t=="string"?{traceparent:t}:{},...typeof r=="string"?{tracestate:r}:{}}}function F(e){return e.replace(/^[ \t]*|[ \t]*$/gu,"")}function Ug(e){return Rg.test(e)||Pg.test(e)}function Bg(e){if(Buffer.byteLength(e,"utf8")>Ng)return!1;let t=e.split(",");if(t.length>Lg)return!1;let r=new Set;for(let o of t){let n=F(o);if(n.length===0)continue;let i=n.indexOf("="),s=i>0?n.slice(0,i):"",a=i>0?n.slice(i+1):"";if(!Ug(s)||!Mg.test(a)||r.has(s))return!1;r.add(s)}return!0}function $r(e){return kg.test(e)&&!xg.test(e)}function qg(e){let t=F(e),r=t.indexOf("="),o=F(r>=0?t.slice(0,r):t),n=r>=0?F(t.slice(r+1)):void 0;return Lr.test(o)&&(n===void 0||$r(n))}function zg(e){let t=F(e),r=t.split(";"),o=r[0],n=r.slice(1),i=o.indexOf("="),s=F(i>0?o.slice(0,i):""),a=i>0?F(o.slice(i+1)):"";if(!(!Lr.test(s)||!$r(a)||!n.every(qg)))return{key:s,serialized:t}}function Vg(e,t){if(e===void 0)return;if(typeof e!="string"||Buffer.byteLength(e,"utf8")>$g)throw new y("Invalid MCP baggage",403);let r=new Set(t),o=e.split(",");if(o.length>Dg)throw new y("Invalid MCP baggage",403);let n=[];for(let i of o){let s=zg(i);if(!s)throw new y("Invalid MCP baggage",403);r.has(s.key)&&n.push(s.serialized)}return n.length>0?n.join(","):void 0}function V0(e,t={}){let r=_(e)&&_(e._meta)?e._meta:{},o=Vg(r.baggage,t.baggageAllowlist??[]);return{...Gg(r),...o?{baggage:o}:{}}}function H0(e,t){return Dr.run(structuredClone(e),t)}function K0(){let e=Dr.getStore();return e?{...e}:void 0}async function W0(e){let t=E(e.policy.resourceMetadataUrl,"protected resource metadata URL",!0).href,r=[...new Set(e.policy.requiredScopes??[])];if(r.some(u=>!Nr.test(u)))throw new y("Invalid authorization scope",401);let o=`Bearer resource_metadata="${t}"`;if(new URL(e.requestUrl,e.policy.resource).searchParams.has("access_token"))throw new y("Access tokens must not appear in URI query parameters",401,o);let s=jg(e.headers,"authorization")?.match(/^Bearer ([^\s]+)$/iu);if(!s)throw new y("Missing or malformed bearer token",401,o);let a=s[1];if(Buffer.byteLength(a,"utf8")>Fg)throw new y("Missing or malformed bearer token",401,o);let c;try{c=await e.policy.verifyAccessToken(a)}catch{throw new y("Invalid bearer token",401,o)}let d=Array.isArray(c.audience)?c.audience:[c.audience];if(c.issuer!==e.policy.issuer||!d.includes(e.policy.resource))throw new y("Bearer token issuer or audience mismatch",401,o);let l=r.filter(u=>!c.scopes.includes(u));if(l.length>0)throw new y("Bearer token has insufficient scope",403,`${o}, scope="${l.join(" ")}"`);return{...c,audience:[...d],scopes:[...c.scopes]}}function X0(e){let t=kr("sha256").update(e.token).digest();return r=>{let o=kr("sha256").update(r).digest();if(!Og(t,o))throw new y("Invalid bearer token",401);return structuredClone(e.claims)}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="4f17095e-2dba-530c-935c-1803ed359510")}catch{}})();var dt="io.modelcontextprotocol/ui",Ee="2026-01-26",Gr="text/html;profile=mcp-app",Fr=Object.freeze({specVersion:Ee,mimeTypes:[Gr]});function Z0(e){let t=e.clientCapabilities.extensions;if(!_(t))return!1;let r=t[dt];if(r===void 0)return!1;if(!_(r))throw new p("Invalid MCP Apps client capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[dt]:Fr}}});let o=r.mimeTypes,n=r.specVersion;if(!Array.isArray(o)||!o.includes(Gr)||n!==void 0&&n!==Ee)throw new p("Unsupported MCP Apps client capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[dt]:Fr}}});return!0}var Hg={csp:{connectDomains:[],resourceDomains:[],frameDomains:[]},permissions:{},prefersBorder:!0},Ur=Object.freeze([{id:"context",name:"Context explorer",description:"Inspect bounded project context, provenance, omissions, and token accounting.",toolName:"pm_context",uri:"ui://pm/context.html"},{id:"graph",name:"Relationship graph",description:"Explore typed relationships, explaining paths, and graph-governance evidence.",toolName:"pm_graph",uri:"ui://pm/graph.html"},{id:"plan",name:"Plan and milestone view",description:"Review durable plan steps, dependencies, decisions, discoveries, and validation state.",toolName:"pm_plan",uri:"ui://pm/plan.html"},{id:"assurance",name:"Assurance dashboard",description:"Inspect validation verdicts, evidence, omissions, and actionable recovery paths.",toolName:"pm_validate",uri:"ui://pm/assurance.html"},{id:"operations",name:"Long-operation view",description:"Inspect durable test and operation results without creating a second task store.",toolName:"pm_test",uri:"ui://pm/operations.html"}].map(e=>({...e,toolMeta:{resourceUri:e.uri,visibility:["model","app"]},resourceMeta:Hg})));function Q0(e){return Ur.find(t=>t.uri===e)}function ex(e){let t=new Map(Ur.map(r=>[r.toolName,r]));return e.map(r=>{let o=t.get(r.name);return o?{...r,_meta:{...r._meta,ui:o.toolMeta}}:{...r}})}function jr(e){return e.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function tx(e){let t=jr(e.name),r=jr(e.description),o=JSON.stringify({name:`pm-${e.id}-view`,version:Ee}),n=JSON.stringify(Ee);return`<!doctype html>
|
|
3
3
|
<html lang="en">
|
|
4
4
|
<head>
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { CompletionRuntimeConfig } from "./shared.js";
|
|
2
|
-
/**
|
|
2
|
+
/** Render Bash 3.2-compatible completion with literal prefix matching of schema and command choices. */
|
|
3
3
|
export declare function generateBashScript(itemTypes?: string[], tags?: string[], eagerTagExpansion?: boolean, runtime?: CompletionRuntimeConfig): string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!(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]="945d479a-e5be-5e27-a309-0a841520db42")}catch(e2){}})();import{PM_NAMESPACED_COMMAND_ALIASES}from"../cli-contracts.js";import{AGGREGATE_FLAGS,ALL_COMMANDS,APPEND_FLAGS,CALENDAR_FLAGS,CLAIM_MUTATION_FLAGS,CLOSE_MANY_FLAGS,CLOSE_MUTATION_FLAGS,CLOSE_TASK_MUTATION_FLAGS,COMPLETION_SHELL_CHOICES,CONTEXT_FLAGS,CONTRACTS_FLAGS,COPY_FLAGS,CREATE_FLAGS,DELETE_MUTATION_FLAGS,DEPS_FLAGS,DUPLICATES_FLAGS,EVENTS_FLAGS,EXTENSION_LIFECYCLE_ACTIONS,EXTENSION_LIFECYCLE_FLAGS,FOCUS_FLAGS,GET_FLAGS,GLOBAL_COMPLETION_INLINE_PATTERNS,GLOBAL_COMPLETION_SWITCH_PATTERNS,GLOBAL_COMPLETION_VALUE_PATTERNS,GLOBAL_FLAGS,GRAPH_FLAGS,GUIDE_FLAGS,GUIDE_TOPIC_CHOICES,HEALTH_FLAGS,HISTORY_AUTHOR_ACKNOWLEDGE_FLAGS,HISTORY_FLAGS,HISTORY_LEAVES,HISTORY_OPERATION_FLAGS,INIT_FLAGS,LIST_FLAGS,MEET_FLAGS,MUTATION_FLAGS,NAMESPACE_NOUNS,NAMESPACE_PREFIXES,NEXT_FLAGS,PACKAGE_LIFECYCLE_ACTIONS,PACKAGE_LIFECYCLE_FLAGS,PLAN_FLAGS,PLAN_SUBCOMMANDS_LIST,RELEASE_MUTATION_FLAGS,REMIND_FLAGS,SCHEMA_SUBCOMMAND_CHOICES,SEARCH_FLAGS,STATS_FLAGS,UPDATE_FLAGS,UPDATE_MANY_FLAGS,UPGRADE_FLAGS,completionNamespaceLeaves,completionStatusValues,completionTypeValues,joinCompletionValues,mergeFlagStrings,shellDoubleQuote}from"./shared.js";function renderBashDynamicChoiceResolver(kind,command,fallback){const envKind=kind.toUpperCase();const cacheVar=`PM_COMPLETION_${envKind}_CACHE`;const cacheTsVar=`PM_COMPLETION_${envKind}_CACHE_TS`;const ttlVar=`PM_COMPLETION_${envKind}_TTL`;const escapedFallback=shellDoubleQuote(fallback);return[`_pm_completion_${kind}_choices() {`," local now ttl cache_ts resolved",' now="$(date +%s 2>/dev/null || echo 0)"',` ttl="\${${ttlVar}:-120}"`,` cache_ts="\${${cacheTsVar}:-0}"`,` if [[ -n "\${${cacheVar}:-}" && "$now" -ne 0 && $((now - cache_ts)) -lt "$ttl" ]]; then`,` printf '%s\\n' "$${cacheVar}"`," return 0"," fi",` resolved="$(pm ${command} 2>/dev/null)"`,' if [[ -z "$resolved" ]]; then',` resolved="${escapedFallback}"`," fi",` ${cacheVar}="$resolved"`,` ${cacheTsVar}="$now"`,` printf '%s\\n' "$${cacheVar}"`,"}"]}function generateBashScript(itemTypes=[],tags=[],eagerTagExpansion=false,runtime={}){const namespaceLeaves=completionNamespaceLeaves(runtime);const cmds=ALL_COMMANDS.join(" ");const useDynamicTypeExpansion=itemTypes.length===0;const typeValues=completionTypeValues(itemTypes,runtime);const statusValues=completionStatusValues(runtime);const tagValues=joinCompletionValues(tags);const listFlags=mergeFlagStrings(LIST_FLAGS,runtime.command_flags?.list);const createFlags=mergeFlagStrings(CREATE_FLAGS,runtime.command_flags?.create);const updateFlags=mergeFlagStrings(UPDATE_FLAGS,runtime.command_flags?.update);const updateManyFlags=mergeFlagStrings(UPDATE_MANY_FLAGS,runtime.command_flags?.["update-many"]);const searchFlags=mergeFlagStrings(SEARCH_FLAGS,runtime.command_flags?.search);const calendarFlags=mergeFlagStrings(CALENDAR_FLAGS,runtime.command_flags?.calendar);const contextFlags=mergeFlagStrings(CONTEXT_FLAGS,runtime.command_flags?.context);const useEagerTagExpansion=eagerTagExpansion||tags.length>0;const compgen=flags=>`$(compgen -W "${shellDoubleQuote(flags.replace(/([^a-zA-Z0-9_:./\s-])/gu,"\\$1"))}" -- "$cur")`;return["# bash completion for pm",`# Source this file or add 'eval "$(pm completion bash)"' to ~/.bashrc`,"",...useDynamicTypeExpansion?[...renderBashDynamicChoiceResolver("type","completion-types",typeValues),""]:[],...renderBashDynamicChoiceResolver("status","completion-statuses",statusValues),"","# Quote each word before compgen performs its own shell expansion.","_pm_completion_wordlist() {"," local line"," local -a values"," while IFS= read -r line; do",' read -r -a values <<< "$line"',` printf '%q ' "\${values[@]}"`,' done <<< "$1"',"}","","_pm_completion() {"," local cur prev words cword"," _init_completion 2>/dev/null || {",' cur="${COMP_WORDS[COMP_CWORD]}"',' prev="${COMP_WORDS[COMP_CWORD-1]}"'," cword=$COMP_CWORD"," }",""," if [[ $cword -eq 1 ]]; then",` COMPREPLY=(${compgen(cmds)})`," return 0"," fi","",' if [[ "$prev" == "--type" ]]; then',useDynamicTypeExpansion?' COMPREPLY=($(compgen -W "$(_pm_completion_wordlist "$(_pm_completion_type_choices)")" -- "$cur"))':` COMPREPLY=(${compgen(typeValues)})`," return 0"," fi","",' if [[ "$prev" == "--status" ]]; then',' COMPREPLY=($(compgen -W "$(_pm_completion_wordlist "$(_pm_completion_status_choices)")" -- "$cur"))'," return 0"," fi","",...useEagerTagExpansion?[' if [[ ( "$prev" == "--tag" || "$prev" == "--tags" ) && ! ( ( "${COMP_WORDS[1]}" == "package" || "${COMP_WORDS[1]}" == "packages" ) && "${COMP_WORDS[2]}" == "upgrade" ) ]]; then',` COMPREPLY=(${compgen(tagValues)})`," return 0"," fi"]:[' if [[ ( "$prev" == "--tag" || "$prev" == "--tags" ) && ! ( ( "${COMP_WORDS[1]}" == "package" || "${COMP_WORDS[1]}" == "packages" ) && "${COMP_WORDS[2]}" == "upgrade" ) ]]; then'," local now ttl cache_ts tag_values",' now="$(date +%s 2>/dev/null || echo 0)"',' ttl="${PM_COMPLETION_TAG_TTL:-120}"',' cache_ts="${PM_COMPLETION_TAG_CACHE_TS:-0}"',' tag_values="${PM_COMPLETION_TAG_CACHE:-}"',' if [[ -z "$tag_values" || "$now" -eq 0 || $((now - cache_ts)) -ge "$ttl" ]]; then',' tag_values="$(pm completion-tags 2>/dev/null)"',' PM_COMPLETION_TAG_CACHE="$tag_values"',' PM_COMPLETION_TAG_CACHE_TS="$now"'," fi",' COMPREPLY=($(compgen -W "$(_pm_completion_wordlist "$tag_values")" -- "$cur"))'," return 0"," fi"],"",' if [[ "$prev" == "--tag" && ( ( "${COMP_WORDS[1]}" == "package" || "${COMP_WORDS[1]}" == "packages" ) && "${COMP_WORDS[2]}" == "upgrade" ) ]]; then'," COMPREPLY=()"," return 0"," fi","",' local cmd="" command_path="" word_index=1 word'," while (( word_index < cword )); do",' word="${COMP_WORDS[word_index]}"',' case "${word//_/-}" in',` ${GLOBAL_COMPLETION_VALUE_PATTERNS}) (( word_index += 2 )); continue ;;`,` ${GLOBAL_COMPLETION_INLINE_PATTERNS}|${GLOBAL_COMPLETION_SWITCH_PATTERNS}) (( word_index++ )); continue ;;`," --) break ;;"," esac",' if [[ -z "$cmd" ]]; then',' cmd="$word"',' [[ "$cmd" == "ctx" ]] && cmd="context"',' command_path="$cmd"',` case "$cmd" in ${NAMESPACE_NOUNS.join("|")}) ;; *) break ;; esac`," else",' case "$command_path $word" in',...PM_NAMESPACED_COMMAND_ALIASES.map(entry=>` "${entry.canonical}") cmd="${entry.alias}"; command_path="${entry.canonical}" ;;`)," *) break ;;"," esac",` case "$command_path" in ${NAMESPACE_PREFIXES.map(prefix=>`"${prefix}"`).join("|")}) ;; *) (( word_index++ )); break ;; esac`," fi"," (( word_index++ ))"," done",' case "$cmd" in',...HISTORY_OPERATION_FLAGS.flatMap(entry=>[` ${entry.alias})`,` COMPREPLY=(${compgen(entry.flags)})`," return 0"," ;;"])," list)",` COMPREPLY=(${compgen(listFlags)})`," ;;"," aggregate)",` COMPREPLY=(${compgen(AGGREGATE_FLAGS)})`," ;;"," duplicates)",` COMPREPLY=(${compgen(DUPLICATES_FLAGS)})`," ;;"," create)",` COMPREPLY=(${compgen(createFlags)})`," ;;"," copy)",` COMPREPLY=(${compgen(COPY_FLAGS)})`," ;;"," focus)",` COMPREPLY=(${compgen(FOCUS_FLAGS)})`," ;;"," update)",` COMPREPLY=(${compgen(updateFlags)})`," if [[ $word_index -eq $cword ]]; then",` COMPREPLY+=(${compgen(namespaceLeaves.update)})`," fi"," ;;"," update-many)",` COMPREPLY=(${compgen(updateManyFlags)})`," ;;"," calendar|cal)",` COMPREPLY=(${compgen(calendarFlags)})`," ;;"," context|ctx)",` COMPREPLY=(${compgen(contextFlags)})`," if [[ $word_index -eq $cword ]]; then",` COMPREPLY+=(${compgen(namespaceLeaves.context)})`," fi"," ;;"," ops)",` COMPREPLY=(${compgen(`${GLOBAL_FLAGS} ${namespaceLeaves.ops}`)})`," ;;"," next)",` COMPREPLY=(${compgen(NEXT_FLAGS)})`," ;;"," guide)",` COMPREPLY=(${compgen(`${GUIDE_FLAGS} ${GUIDE_TOPIC_CHOICES}`)})`," ;;"," search)",` COMPREPLY=(${compgen(searchFlags)})`," ;;"," reindex)",` COMPREPLY=(${compgen("--mode --progress --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")})`," ;;"," init)",` COMPREPLY=(${compgen(`${INIT_FLAGS} --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help`)})`," ;;"," config)",` COMPREPLY=(${compgen("--criterion --clear-criteria --format --policy --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")})`," ;;"," extension)",` COMPREPLY=(${compgen(`${EXTENSION_LIFECYCLE_ACTIONS} ${EXTENSION_LIFECYCLE_FLAGS}`)})`," ;;"," package|packages)",` COMPREPLY=(${compgen(`${PACKAGE_LIFECYCLE_ACTIONS} ${PACKAGE_LIFECYCLE_FLAGS} ${UPGRADE_FLAGS}`)})`," ;;"," comments)",` COMPREPLY=(${compgen("--add --body --stdin --file --edit --delete --limit --full-history --if-absent --author --message --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")})`," ;;"," notes)",` COMPREPLY=(${compgen("--add --add-json --stdin --file --edit --delete --limit --since --event-type --include-meta --full-history --if-absent --author --message --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")})`," ;;"," learnings)",` COMPREPLY=(${compgen("--add --stdin --file --edit --delete --limit --full-history --if-absent --author --message --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")})`," ;;"," files)",` COMPREPLY=(${compgen("discover lookup --add --add-glob --remove --migrate --list --apply --note --append-stable --validate-paths --scope --limit --offset --no-truncate --strict-read --explain --lines --decision-depth --author --message --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")})`," ;;"," docs)",` COMPREPLY=(${compgen("--add --add-glob --remove --migrate --note --validate-paths --author --message --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")})`," ;;"," append)",` COMPREPLY=(${compgen(APPEND_FLAGS)})`," ;;"," deps)",` COMPREPLY=(${compgen(DEPS_FLAGS)})`," ;;"," graph)",` COMPREPLY=(${compgen(`ancestors descendants predecessors successors paths impact analyze audit communities redundancy dominators slack centrality articulation plan index ${GRAPH_FLAGS}`)})`," ;;"," test)",` COMPREPLY=(${compgen("--add --add-json --remove --remove-index --list --run --match --only-index --only-last --background --timeout --progress --env-set --env-clear --shared-host-safe --pm-context --override-linked-pm-context --fail-on-context-mismatch --fail-on-skipped --fail-on-empty-test-run --require-assertions-for-pm --check-context --auto-pm-context --author --message --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")})`," ;;"," test-all)",` COMPREPLY=(${compgen("--status --limit --offset --background --timeout --progress --env-set --env-clear --shared-host-safe --pm-context --override-linked-pm-context --fail-on-context-mismatch --fail-on-skipped --fail-on-empty-test-run --require-assertions-for-pm --check-context --auto-pm-context --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")})`," ;;"," test-runs)",` COMPREPLY=(${compgen("list status logs stop resume --status --limit --stream --tail --force --author --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")})`," ;;"," validate)",` COMPREPLY=(${compgen("--check-completeness --check-metadata --metadata-profile --check-resolution --check-lifecycle --check-stale-blockers --dependency-cycle-severity --parent-cycle-severity --check-files --scan-mode --include-pm-internals --verbose-file-lists --verbose-diagnostics --all-affected-ids --strict-exit --fail-on-warn --fix-hints --auto-fix --dry-run --fix-scope --prune-missing --check-history-drift --check-command-references --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")})`," ;;"," health)",` COMPREPLY=(${compgen(HEALTH_FLAGS)})`," ;;"," history)"," if [[ $word_index -eq $cword ]]; then",` COMPREPLY=(${compgen(`${HISTORY_FLAGS} ${HISTORY_LEAVES}`)})`," else",` COMPREPLY=(${compgen(HISTORY_FLAGS)})`," fi"," ;;"," events)",` COMPREPLY=(${compgen(EVENTS_FLAGS)})`," ;;"," history-author-acknowledge)",` COMPREPLY=(${compgen(`${HISTORY_AUTHOR_ACKNOWLEDGE_FLAGS} --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help`)})`," ;;"," get)",` COMPREPLY=(${compgen(GET_FLAGS)})`," ;;"," schema)",' if [[ "$prev" == "policy-mode" ]]; then',` COMPREPLY=(${compgen("advise refuse")})`," return"," fi",` COMPREPLY=(${compgen(`${SCHEMA_SUBCOMMAND_CHOICES} --definition --policy --message --description --default-status --folder --alias --role --order --type --commands --cli-flag --required --required-on-create --no-allow-unset --required-types --infer --min-count --apply --to --migration-id --dry-run --author --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help`)})`," ;;"," profile)",` COMPREPLY=(${compgen("list show apply lint agile ops research --dry-run --author --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")})`," ;;"," plan)",` COMPREPLY=(${compgen(`${PLAN_SUBCOMMANDS_LIST} ${PLAN_FLAGS}`)})`," ;;"," contracts)",` COMPREPLY=(${compgen(CONTRACTS_FLAGS)})`," ;;"," gc)",` COMPREPLY=(${compgen("--dry-run --scope --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")})`," ;;"," stats)",` COMPREPLY=(${compgen(STATS_FLAGS)})`," ;;"," close-task)",` COMPREPLY=(${compgen(CLOSE_TASK_MUTATION_FLAGS)})`," ;;"," close)",` COMPREPLY=(${compgen(CLOSE_MUTATION_FLAGS)})`,' if [[ "$cmd" == "close" && $word_index -eq $cword ]]; then',` COMPREPLY+=(${compgen(namespaceLeaves.close)})`," fi"," ;;"," close-many)",` COMPREPLY=(${compgen(CLOSE_MANY_FLAGS)})`," ;;"," release)",` COMPREPLY=(${compgen(RELEASE_MUTATION_FLAGS)})`," ;;"," delete)",` COMPREPLY=(${compgen(DELETE_MUTATION_FLAGS)})`," ;;"," claim)",` COMPREPLY=(${compgen(CLAIM_MUTATION_FLAGS)})`," ;;"," start-task|pause-task)",` COMPREPLY=(${compgen(MUTATION_FLAGS)})`," ;;"," meet|event)",` COMPREPLY=(${compgen(MEET_FLAGS)})`," ;;"," remind)",` COMPREPLY=(${compgen(REMIND_FLAGS)})`," ;;"," completion)",` COMPREPLY=(${compgen(COMPLETION_SHELL_CHOICES)})`," ;;"," templates)",` COMPREPLY=(${compgen("save list show")})`," ;;"," *)",` COMPREPLY=(${compgen(GLOBAL_FLAGS)})`," ;;"," esac"," if [[ $word_index -eq $cword ]]; then",' case "$command_path" in',...Object.entries(namespaceLeaves).filter(([prefix])=>["item","workspace","search"].includes(prefix.split(" ")[0])).map(([prefix,leaves])=>` "${prefix}") COMPREPLY+=(${compgen(leaves)}) ;;`)," esac"," fi",' if [[ "$cmd" == "comments" || "$cmd" == "notes" || "$cmd" == "learnings" ]]; then',` COMPREPLY+=(${compgen("--text")})`," fi"," return 0","}","","complete -F _pm_completion pm"].join("\n")}export{generateBashScript};
|
|
1
|
+
!(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]="2c4ca878-fa53-55b5-9cae-9fc6d7a3f0a7")}catch(e2){}})();import{PM_NAMESPACED_COMMAND_ALIASES}from"../cli-contracts.js";import{AGGREGATE_FLAGS,ALL_COMMANDS,APPEND_FLAGS,CALENDAR_FLAGS,CLAIM_MUTATION_FLAGS,CLOSE_MANY_FLAGS,CLOSE_MUTATION_FLAGS,CLOSE_TASK_MUTATION_FLAGS,COMPLETION_SHELL_CHOICES,CONTEXT_FLAGS,CONTRACTS_FLAGS,COPY_FLAGS,CREATE_FLAGS,DELETE_MUTATION_FLAGS,DEPS_FLAGS,DUPLICATES_FLAGS,EVENTS_FLAGS,EXTENSION_LIFECYCLE_ACTIONS,EXTENSION_LIFECYCLE_FLAGS,FOCUS_FLAGS,GET_FLAGS,GLOBAL_COMPLETION_INLINE_PATTERNS,GLOBAL_COMPLETION_SWITCH_PATTERNS,GLOBAL_COMPLETION_VALUE_PATTERNS,GLOBAL_FLAGS,GRAPH_FLAGS,GUIDE_FLAGS,GUIDE_TOPIC_CHOICES,HEALTH_FLAGS,HISTORY_AUTHOR_ACKNOWLEDGE_FLAGS,HISTORY_FLAGS,HISTORY_LEAVES,HISTORY_OPERATION_FLAGS,INIT_FLAGS,LIST_FLAGS,MEET_FLAGS,MUTATION_FLAGS,NAMESPACE_NOUNS,NAMESPACE_PREFIXES,NEXT_FLAGS,PACKAGE_LIFECYCLE_ACTIONS,PACKAGE_LIFECYCLE_FLAGS,PLAN_FLAGS,PLAN_SUBCOMMANDS_LIST,RELEASE_MUTATION_FLAGS,REMIND_FLAGS,SCHEMA_SUBCOMMAND_CHOICES,SEARCH_FLAGS,STATS_FLAGS,UPDATE_FLAGS,UPDATE_MANY_FLAGS,UPGRADE_FLAGS,completionNamespaceLeaves,completionStatusValues,completionTypeValues,joinCompletionValues,mergeFlagStrings,shellDoubleQuote}from"./shared.js";function renderBashDynamicChoiceResolver(kind,command,fallback){const envKind=kind.toUpperCase();const cacheVar=`PM_COMPLETION_${envKind}_CACHE`;const cacheTsVar=`PM_COMPLETION_${envKind}_CACHE_TS`;const ttlVar=`PM_COMPLETION_${envKind}_TTL`;const escapedFallback=shellDoubleQuote(fallback);return[`_pm_completion_${kind}_choices() {`," local now ttl cache_ts resolved",' now="$(date +%s 2>/dev/null || echo 0)"',` ttl="\${${ttlVar}:-120}"`,` cache_ts="\${${cacheTsVar}:-0}"`,` if [[ -n "\${${cacheVar}:-}" && "$now" -ne 0 && $((now - cache_ts)) -lt "$ttl" ]]; then`,` printf '%s\\n' "$${cacheVar}"`," return 0"," fi",` resolved="$(pm ${command} 2>/dev/null)"`,' if [[ -z "$resolved" ]]; then',` resolved="${escapedFallback}"`," fi",` ${cacheVar}="$resolved"`,` ${cacheTsVar}="$now"`,` printf '%s\\n' "$${cacheVar}"`,"}"]}function generateBashScript(itemTypes=[],tags=[],eagerTagExpansion=false,runtime={}){const namespaceLeaves=completionNamespaceLeaves(runtime);const cmds=ALL_COMMANDS.join(" ");const useDynamicTypeExpansion=itemTypes.length===0;const typeValues=completionTypeValues(itemTypes,runtime);const statusValues=completionStatusValues(runtime);const tagValues=joinCompletionValues(tags);const listFlags=mergeFlagStrings(LIST_FLAGS,runtime.command_flags?.list);const createFlags=mergeFlagStrings(CREATE_FLAGS,runtime.command_flags?.create);const updateFlags=mergeFlagStrings(UPDATE_FLAGS,runtime.command_flags?.update);const updateManyFlags=mergeFlagStrings(UPDATE_MANY_FLAGS,runtime.command_flags?.["update-many"]);const searchFlags=mergeFlagStrings(SEARCH_FLAGS,runtime.command_flags?.search);const calendarFlags=mergeFlagStrings(CALENDAR_FLAGS,runtime.command_flags?.calendar);const contextFlags=mergeFlagStrings(CONTEXT_FLAGS,runtime.command_flags?.context);const useEagerTagExpansion=eagerTagExpansion||tags.length>0;const matchWords=values=>`_pm_completion_add_matches "${shellDoubleQuote(values)}"`;return["# bash completion for pm",`# Source this file or add 'eval "$(pm completion bash)"' to ~/.bashrc`,"",...useDynamicTypeExpansion?[...renderBashDynamicChoiceResolver("type","completion-types",typeValues),""]:[],...renderBashDynamicChoiceResolver("status","completion-statuses",statusValues),"","# Treat choices as data: no eval, compgen expansion, or filename globbing.","_pm_completion_add_matches() {"," local line value quoted"," local -a values"," while IFS= read -r line; do",' read -r -a values <<< "$line"',' for value in "${values[@]}"; do',' [[ "$value" == "$cur"* ]] || continue',' case "$value" in'," *[!a-zA-Z0-9_.,:/@%+=-]*)"," quoted=${value//\\'/\\'\\\\\\'\\'}",` COMPREPLY+=("'$quoted'")`," ;;",' *) COMPREPLY+=("$value") ;;'," esac"," done",' done <<< "$1"',"}","","_pm_completion() {"," local cur prev words cword"," COMPREPLY=()"," # Refuse ambiguous shell quoting before _init_completion can dequote it.",' case "${COMP_WORDS[COMP_CWORD]}" in',` *"'"*|*'"'*|*'\`'*|*'\\'*) return 0 ;;`," esac"," _init_completion 2>/dev/null || {",' cur="${COMP_WORDS[COMP_CWORD]}"',' prev="${COMP_WORDS[COMP_CWORD-1]}"'," cword=$COMP_CWORD"," }",""," if [[ $cword -eq 1 ]]; then",` ${matchWords(cmds)}`," return 0"," fi","",' if [[ "$prev" == "--type" ]]; then',useDynamicTypeExpansion?' _pm_completion_add_matches "$(_pm_completion_type_choices)"':` ${matchWords(typeValues)}`," return 0"," fi","",' if [[ "$prev" == "--status" ]]; then',' _pm_completion_add_matches "$(_pm_completion_status_choices)"'," return 0"," fi","",...useEagerTagExpansion?[' if [[ ( "$prev" == "--tag" || "$prev" == "--tags" ) && ! ( ( "${COMP_WORDS[1]}" == "package" || "${COMP_WORDS[1]}" == "packages" ) && "${COMP_WORDS[2]}" == "upgrade" ) ]]; then',` ${matchWords(tagValues)}`," return 0"," fi"]:[' if [[ ( "$prev" == "--tag" || "$prev" == "--tags" ) && ! ( ( "${COMP_WORDS[1]}" == "package" || "${COMP_WORDS[1]}" == "packages" ) && "${COMP_WORDS[2]}" == "upgrade" ) ]]; then'," local now ttl cache_ts tag_values",' now="$(date +%s 2>/dev/null || echo 0)"',' ttl="${PM_COMPLETION_TAG_TTL:-120}"',' cache_ts="${PM_COMPLETION_TAG_CACHE_TS:-0}"',' tag_values="${PM_COMPLETION_TAG_CACHE:-}"',' if [[ -z "$tag_values" || "$now" -eq 0 || $((now - cache_ts)) -ge "$ttl" ]]; then',' tag_values="$(pm completion-tags 2>/dev/null)"',' PM_COMPLETION_TAG_CACHE="$tag_values"',' PM_COMPLETION_TAG_CACHE_TS="$now"'," fi",' _pm_completion_add_matches "$tag_values"'," return 0"," fi"],"",' if [[ "$prev" == "--tag" && ( ( "${COMP_WORDS[1]}" == "package" || "${COMP_WORDS[1]}" == "packages" ) && "${COMP_WORDS[2]}" == "upgrade" ) ]]; then'," COMPREPLY=()"," return 0"," fi","",' local cmd="" command_path="" word_index=1 word'," while (( word_index < cword )); do",' word="${COMP_WORDS[word_index]}"',' case "${word//_/-}" in',` ${GLOBAL_COMPLETION_VALUE_PATTERNS}) (( word_index += 2 )); continue ;;`,` ${GLOBAL_COMPLETION_INLINE_PATTERNS}|${GLOBAL_COMPLETION_SWITCH_PATTERNS}) (( word_index++ )); continue ;;`," --) break ;;"," esac",' if [[ -z "$cmd" ]]; then',' cmd="$word"',' [[ "$cmd" == "ctx" ]] && cmd="context"',' command_path="$cmd"',` case "$cmd" in ${NAMESPACE_NOUNS.join("|")}) ;; *) break ;; esac`," else",' case "$command_path $word" in',...PM_NAMESPACED_COMMAND_ALIASES.map(entry=>` "${entry.canonical}") cmd="${entry.alias}"; command_path="${entry.canonical}" ;;`)," *) break ;;"," esac",` case "$command_path" in ${NAMESPACE_PREFIXES.map(prefix=>`"${prefix}"`).join("|")}) ;; *) (( word_index++ )); break ;; esac`," fi"," (( word_index++ ))"," done",' case "$cmd" in',...HISTORY_OPERATION_FLAGS.flatMap(entry=>[` ${entry.alias})`,` ${matchWords(entry.flags)}`," return 0"," ;;"])," list)",` ${matchWords(listFlags)}`," ;;"," aggregate)",` ${matchWords(AGGREGATE_FLAGS)}`," ;;"," duplicates)",` ${matchWords(DUPLICATES_FLAGS)}`," ;;"," create)",` ${matchWords(createFlags)}`," ;;"," copy)",` ${matchWords(COPY_FLAGS)}`," ;;"," focus)",` ${matchWords(FOCUS_FLAGS)}`," ;;"," update)",` ${matchWords(updateFlags)}`," if [[ $word_index -eq $cword ]]; then",` ${matchWords(namespaceLeaves.update)}`," fi"," ;;"," update-many)",` ${matchWords(updateManyFlags)}`," ;;"," calendar|cal)",` ${matchWords(calendarFlags)}`," ;;"," context|ctx)",` ${matchWords(contextFlags)}`," if [[ $word_index -eq $cword ]]; then",` ${matchWords(namespaceLeaves.context)}`," fi"," ;;"," ops)",` ${matchWords(`${GLOBAL_FLAGS} ${namespaceLeaves.ops}`)}`," ;;"," next)",` ${matchWords(NEXT_FLAGS)}`," ;;"," guide)",` ${matchWords(`${GUIDE_FLAGS} ${GUIDE_TOPIC_CHOICES}`)}`," ;;"," search)",` ${matchWords(searchFlags)}`," ;;"," reindex)",` ${matchWords("--mode --progress --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")}`," ;;"," init)",` ${matchWords(`${INIT_FLAGS} --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help`)}`," ;;"," config)",` ${matchWords("--criterion --clear-criteria --format --policy --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")}`," ;;"," extension)",` ${matchWords(`${EXTENSION_LIFECYCLE_ACTIONS} ${EXTENSION_LIFECYCLE_FLAGS}`)}`," ;;"," package|packages)",` ${matchWords(`${PACKAGE_LIFECYCLE_ACTIONS} ${PACKAGE_LIFECYCLE_FLAGS} ${UPGRADE_FLAGS}`)}`," ;;"," comments)",` ${matchWords("--add --body --stdin --file --edit --delete --limit --full-history --if-absent --author --message --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")}`," ;;"," notes)",` ${matchWords("--add --add-json --stdin --file --edit --delete --limit --since --event-type --include-meta --full-history --if-absent --author --message --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")}`," ;;"," learnings)",` ${matchWords("--add --stdin --file --edit --delete --limit --full-history --if-absent --author --message --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")}`," ;;"," files)",` ${matchWords("discover lookup --add --add-glob --remove --migrate --list --apply --note --append-stable --validate-paths --scope --limit --offset --no-truncate --strict-read --explain --lines --decision-depth --author --message --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")}`," ;;"," docs)",` ${matchWords("--add --add-glob --remove --migrate --note --validate-paths --author --message --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")}`," ;;"," append)",` ${matchWords(APPEND_FLAGS)}`," ;;"," deps)",` ${matchWords(DEPS_FLAGS)}`," ;;"," graph)",` ${matchWords(`ancestors descendants predecessors successors paths impact analyze audit communities redundancy dominators slack centrality articulation plan index ${GRAPH_FLAGS}`)}`," ;;"," test)",` ${matchWords("--add --add-json --remove --remove-index --list --run --match --only-index --only-last --background --timeout --progress --env-set --env-clear --shared-host-safe --pm-context --override-linked-pm-context --fail-on-context-mismatch --fail-on-skipped --fail-on-empty-test-run --require-assertions-for-pm --check-context --auto-pm-context --author --message --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")}`," ;;"," test-all)",` ${matchWords("--status --limit --offset --background --timeout --progress --env-set --env-clear --shared-host-safe --pm-context --override-linked-pm-context --fail-on-context-mismatch --fail-on-skipped --fail-on-empty-test-run --require-assertions-for-pm --check-context --auto-pm-context --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")}`," ;;"," test-runs)",` ${matchWords("list status logs stop resume --status --limit --stream --tail --force --author --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")}`," ;;"," validate)",` ${matchWords("--check-completeness --check-metadata --metadata-profile --check-resolution --check-lifecycle --check-stale-blockers --dependency-cycle-severity --parent-cycle-severity --check-files --scan-mode --include-pm-internals --verbose-file-lists --verbose-diagnostics --all-affected-ids --strict-exit --fail-on-warn --fix-hints --auto-fix --dry-run --fix-scope --prune-missing --check-history-drift --check-command-references --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")}`," ;;"," health)",` ${matchWords(HEALTH_FLAGS)}`," ;;"," history)"," if [[ $word_index -eq $cword ]]; then",` ${matchWords(`${HISTORY_FLAGS} ${HISTORY_LEAVES}`)}`," else",` ${matchWords(HISTORY_FLAGS)}`," fi"," ;;"," events)",` ${matchWords(EVENTS_FLAGS)}`," ;;"," history-author-acknowledge)",` ${matchWords(`${HISTORY_AUTHOR_ACKNOWLEDGE_FLAGS} --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help`)}`," ;;"," get)",` ${matchWords(GET_FLAGS)}`," ;;"," schema)",' if [[ "$prev" == "policy-mode" ]]; then',` ${matchWords("advise refuse")}`," return"," fi",` ${matchWords(`${SCHEMA_SUBCOMMAND_CHOICES} --definition --policy --message --description --default-status --folder --alias --role --order --type --commands --cli-flag --required --required-on-create --no-allow-unset --required-types --infer --min-count --apply --to --migration-id --dry-run --author --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help`)}`," ;;"," profile)",` ${matchWords("list show apply lint agile ops research --dry-run --author --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")}`," ;;"," plan)",` ${matchWords(`${PLAN_SUBCOMMANDS_LIST} ${PLAN_FLAGS}`)}`," ;;"," contracts)",` ${matchWords(CONTRACTS_FLAGS)}`," ;;"," gc)",` ${matchWords("--dry-run --scope --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")}`," ;;"," stats)",` ${matchWords(STATS_FLAGS)}`," ;;"," close-task)",` ${matchWords(CLOSE_TASK_MUTATION_FLAGS)}`," ;;"," close)",` ${matchWords(CLOSE_MUTATION_FLAGS)}`,' if [[ "$cmd" == "close" && $word_index -eq $cword ]]; then',` ${matchWords(namespaceLeaves.close)}`," fi"," ;;"," close-many)",` ${matchWords(CLOSE_MANY_FLAGS)}`," ;;"," release)",` ${matchWords(RELEASE_MUTATION_FLAGS)}`," ;;"," delete)",` ${matchWords(DELETE_MUTATION_FLAGS)}`," ;;"," claim)",` ${matchWords(CLAIM_MUTATION_FLAGS)}`," ;;"," start-task|pause-task)",` ${matchWords(MUTATION_FLAGS)}`," ;;"," meet|event)",` ${matchWords(MEET_FLAGS)}`," ;;"," remind)",` ${matchWords(REMIND_FLAGS)}`," ;;"," completion)",` ${matchWords(COMPLETION_SHELL_CHOICES)}`," ;;"," templates)",` ${matchWords("save list show")}`," ;;"," *)",` ${matchWords(GLOBAL_FLAGS)}`," ;;"," esac"," if [[ $word_index -eq $cword ]]; then",' case "$command_path" in',...Object.entries(namespaceLeaves).filter(([prefix])=>["item","workspace","search"].includes(prefix.split(" ")[0])).map(([prefix,leaves])=>` "${prefix}") ${matchWords(leaves)} ;;`)," esac"," fi",' if [[ "$cmd" == "comments" || "$cmd" == "notes" || "$cmd" == "learnings" ]]; then',` ${matchWords("--text")}`," fi"," return 0","}","","complete -F _pm_completion pm"].join("\n")}export{generateBashScript};
|
|
2
2
|
//# sourceMappingURL=bash.js.map
|
package/docs/README.md
CHANGED
|
@@ -39,6 +39,7 @@ pm guide release --json
|
|
|
39
39
|
- [CLI Scripting Contract](SCRIPTING.md) - exit codes, flat mutation receipts versus read envelopes, stdout/stderr boundaries, stable JSON fields, uniform OR filters, and shell composition recipes.
|
|
40
40
|
- [Configuration](CONFIGURATION.md) - settings, storage formats, output, search, validation, and environment variables.
|
|
41
41
|
- [Testing](TESTING.md) - sandbox-safe local tests and linked-test orchestration.
|
|
42
|
+
- [Completion Portability and Bounded Replication Checks](VALIDATION_PORTABILITY.md) - literal Bash choices across versions and locales, and semantic Git diff collection.
|
|
42
43
|
- [Build and Release Acceptance](BUILD_AND_RELEASE_ACCEPTANCE.md) - complete-build leases and cross-platform registry installation controls.
|
|
43
44
|
- [Security Governance](SECURITY_GOVERNANCE.md) - vulnerability reporting, review discipline, property fuzzing, and OpenSSF limitations.
|
|
44
45
|
- [Architecture](ARCHITECTURE.md) - contributor internals: storage, mutation flow, search, extensions, and command contracts.
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Completion portability and bounded replication checks
|
|
2
|
+
|
|
3
|
+
Tracked by [pm-t6jl1f](../.agents/pm/issues/pm-t6jl1f.toon) and
|
|
4
|
+
[pm-26y269](../.agents/pm/tasks/pm-26y269.toon).
|
|
5
|
+
|
|
6
|
+
## Bash completion data boundary
|
|
7
|
+
|
|
8
|
+
The public SDK completion renderer supports Bash 3.2, including the system Bash
|
|
9
|
+
on macOS. Static command choices, runtime schema flags, types, statuses, and
|
|
10
|
+
tags use the same literal prefix matcher. Generated source quotes static input
|
|
11
|
+
once; completion execution reads choices as data and appends quoted array
|
|
12
|
+
elements to `COMPREPLY`. Candidates containing shell metacharacters or Unicode
|
|
13
|
+
use portable single-quote syntax, including embedded quote escaping, so accepting
|
|
14
|
+
a candidate and pressing Enter also preserves its literal argument value.
|
|
15
|
+
|
|
16
|
+
Already quoted or backslash-escaped prefixes return no suggestions before optional
|
|
17
|
+
completion initialization can remove their quoting. This conservative boundary
|
|
18
|
+
avoids inserting an unquoted-context escape inside a different shell quoting
|
|
19
|
+
context. Normal unquoted prefixes retain literal matching.
|
|
20
|
+
|
|
21
|
+
The matcher never evaluates choices as shell programs. Dollar signs, backticks,
|
|
22
|
+
quotes, backslashes, and wildcard characters remain literal. Unicode survives
|
|
23
|
+
both byte-oriented and UTF-8 locales. A wildcard in the typed prefix is also
|
|
24
|
+
literal, and an unmatched prefix returns no choices. Namespace and annotation
|
|
25
|
+
completion may append additional matches without discarding earlier matches.
|
|
26
|
+
|
|
27
|
+
The package output adapter recognizes both canonical `completion types`,
|
|
28
|
+
`completion statuses`, and `completion tags` paths and their compatibility
|
|
29
|
+
aliases. These helpers emit plain words by default; explicit `--json` retains
|
|
30
|
+
structured results. Installed-command acceptance verifies this wire boundary.
|
|
31
|
+
|
|
32
|
+
The existing helper protocol is whitespace-delimited: spaces, tabs, and newlines
|
|
33
|
+
separate candidate words. This change does not introduce a new representation
|
|
34
|
+
for candidate values containing whitespace. Helper lookup, fallback choices,
|
|
35
|
+
and cache policy retain their existing contracts.
|
|
36
|
+
|
|
37
|
+
`compgen -W` cannot safely serve as the data transport here: it performs another
|
|
38
|
+
expansion pass, and Bash 3.2 does not round-trip the ANSI-C quoting emitted by
|
|
39
|
+
`printf %q` for Unicode. Unquoted command-substitution arrays can additionally
|
|
40
|
+
expand literal wildcard candidates into filenames. The regression executes the
|
|
41
|
+
generated function and parses its accepted words with the real Bash parser,
|
|
42
|
+
rather than inferring safety from source substrings.
|
|
43
|
+
|
|
44
|
+
Run the focused native regression after building:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
node scripts/run-tests.mjs test -- tests/unit/sdk/security/completion-search-boundaries.spec.ts
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
To test another installed Bash version, set `PM_COMPLETION_TEST_BASH` to its
|
|
51
|
+
executable path. This is a test harness input, not a CLI configuration setting.
|
|
52
|
+
The existing macOS runtime-smoke job pins `/bin/bash` so PATH cannot silently
|
|
53
|
+
substitute a newer Homebrew Bash. It runs this regression before merge; Linux
|
|
54
|
+
coverage runs the same matrix. Native Fish and Zsh acceptance remains in the
|
|
55
|
+
required smoke gate.
|
|
56
|
+
|
|
57
|
+
## Replication diff collection
|
|
58
|
+
|
|
59
|
+
The replication gate retains a complete changed-path census across committed,
|
|
60
|
+
staged, unstaged, deleted, and untracked paths. Whole-file triggers and required
|
|
61
|
+
member checks consume that complete census.
|
|
62
|
+
|
|
63
|
+
Only structured triggers declaring `changed_lines_contain_any` need patch
|
|
64
|
+
content. The collector deduplicates their declared paths and reads patches only
|
|
65
|
+
for changed paths in that set. With a merge base, one such path requires three
|
|
66
|
+
patch subprocesses regardless of how many unrelated tracker documents changed.
|
|
67
|
+
No content triggers means no patch subprocesses.
|
|
68
|
+
|
|
69
|
+
Every applicable patch layer must be readable before its content can deactivate
|
|
70
|
+
a trigger. If one layer fails, evidence for that path is unknown even when
|
|
71
|
+
another layer contains readable but unrelated hunks. Unknown evidence activates
|
|
72
|
+
the trigger. Untracked files and empty patches retain that conservative policy;
|
|
73
|
+
deleted files remain visible through removed lines and the full path census.
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
node scripts/run-tests.mjs test -- tests/unit/scripts/release/surface-replication-cost.spec.ts tests/unit/scripts/release/surface-replication-gate.spec.ts
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
The cost regression uses an actual temporary Git repository with 1,000 unrelated
|
|
80
|
+
files. Git's trace records the real patch process count. A separate injected
|
|
81
|
+
staged-patch read failure proves the unknown-evidence boundary without replacing
|
|
82
|
+
the other Git operations or filesystem reads.
|
package/marketplace.json
CHANGED
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
},
|
|
7
7
|
"metadata": {
|
|
8
8
|
"description": "Official marketplace for pm CLI — native git-based project management for Claude Code and AI coding agents.",
|
|
9
|
-
"version": "2026.9.
|
|
9
|
+
"version": "2026.9.21"
|
|
10
10
|
},
|
|
11
11
|
"plugins": [
|
|
12
12
|
{
|
|
13
13
|
"name": "pm-claude",
|
|
14
14
|
"source": "./plugins/pm-claude",
|
|
15
15
|
"description": "Native pm CLI integration for Claude Code — 28 MCP tools, 5 workflow skills, 14 slash commands, 4 subagents, hybrid TUI task tracking, session context injection, and coordination subagents for git-based project management without leaving Claude Code.",
|
|
16
|
-
"version": "2026.9.
|
|
16
|
+
"version": "2026.9.21",
|
|
17
17
|
"author": {
|
|
18
18
|
"name": "unbrained",
|
|
19
19
|
"url": "https://github.com/unbraind/pm-cli"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unbrained/pm-cli",
|
|
3
|
-
"version": "2026.9.
|
|
3
|
+
"version": "2026.9.21",
|
|
4
4
|
"description": "Git-native project management CLI for humans and agents.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"packageManager": "pnpm@11.10.0",
|
|
@@ -222,16 +222,16 @@
|
|
|
222
222
|
"@eslint/js": "^10.0.1",
|
|
223
223
|
"@modelcontextprotocol/ext-apps": "2.0.0",
|
|
224
224
|
"@sentry/cli": "^3.8.0",
|
|
225
|
-
"@types/node": "^26.6.
|
|
225
|
+
"@types/node": "^26.6.2",
|
|
226
226
|
"@types/npm-package-arg": "^6.1.4",
|
|
227
227
|
"@vitest/coverage-v8": "^4.1.11",
|
|
228
228
|
"esbuild": "0.28.2",
|
|
229
|
-
"eslint": "^10.
|
|
229
|
+
"eslint": "^10.11.0",
|
|
230
230
|
"eslint-plugin-sonarjs": "^4.2.1",
|
|
231
|
-
"eslint-plugin-unicorn": "
|
|
231
|
+
"eslint-plugin-unicorn": "76.0.0",
|
|
232
232
|
"fast-check": "^4.10.1",
|
|
233
233
|
"github-slugger": "2.0.0",
|
|
234
|
-
"greptile": "^3.5.
|
|
234
|
+
"greptile": "^3.5.3",
|
|
235
235
|
"jscpd": "^5.3.0",
|
|
236
236
|
"marked": "18.0.13",
|
|
237
237
|
"parse5": "8.0.1",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unbrained/pm-digital-twin",
|
|
3
|
-
"version": "2026.9.
|
|
3
|
+
"version": "2026.9.21",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Beyond-PM exemplar: a temporal production-facility digital twin built entirely on public pm SDK and extension primitives.",
|