@unbrained/pm-cli 2026.10.2 → 2026.10.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +15 -0
  3. package/dist/cli-bundle/bundle-manifest.json +99 -99
  4. package/dist/cli-bundle/chunks/{chunk-R4TUD355.js → chunk-3AF2R3Y6.js} +2 -2
  5. package/dist/cli-bundle/chunks/{chunk-TRYXVQ7W.js → chunk-44UGMMQ6.js} +2 -2
  6. package/dist/cli-bundle/chunks/{chunk-XOUBIF6Z.js → chunk-5XKF5SQV.js} +2 -2
  7. package/dist/cli-bundle/chunks/{chunk-WP6NRH72.js → chunk-6ST3SCQ6.js} +2 -2
  8. package/dist/cli-bundle/chunks/{chunk-CZLAWXDR.js → chunk-6Z4IV2MC.js} +2 -2
  9. package/dist/cli-bundle/chunks/{chunk-MTJMOI4I.js → chunk-FW5LJXQY.js} +31 -31
  10. package/dist/cli-bundle/chunks/{chunk-7FUEQOYG.js → chunk-H2DZW6I6.js} +2 -2
  11. package/dist/cli-bundle/chunks/{chunk-7NL3A2BY.js → chunk-H7CXQBGQ.js} +2 -2
  12. package/dist/cli-bundle/chunks/{chunk-ZI7F3FVE.js → chunk-KP7NBQK3.js} +2 -2
  13. package/dist/cli-bundle/chunks/{chunk-SV7CZEVV.js → chunk-MKXBCBAN.js} +2 -2
  14. package/dist/cli-bundle/chunks/{chunk-R7ULWMBG.js → chunk-QPKQKSQU.js} +7 -7
  15. package/dist/cli-bundle/chunks/{chunk-HY6M34B4.js → chunk-YCBGZF3T.js} +2 -2
  16. package/dist/cli-bundle/chunks/{chunk-Z2GYDSAO.js → chunk-YDWKGUQU.js} +2 -2
  17. package/dist/cli-bundle/chunks/{register-list-query-R4PHNB7W.js → register-list-query-DYCGUQEW.js} +2 -2
  18. package/dist/cli-bundle/chunks/{register-mutation-PDDAUDYV.js → register-mutation-5PT3NW3A.js} +2 -2
  19. package/dist/cli-bundle/chunks/{register-operations-A5HJT46K.js → register-operations-QDDQOAAV.js} +2 -2
  20. package/dist/cli-bundle/chunks/{register-setup-EZ2F25JI.js → register-setup-BBX67YMA.js} +2 -2
  21. package/dist/cli-bundle/focused-chunks/{chunk-BLCTBSGT.js → chunk-73DA7ISY.js} +26 -26
  22. package/dist/cli-bundle/focused-chunks/{chunk-GBD4EN6S.js → chunk-HIA2ZF64.js} +2 -2
  23. package/dist/cli-bundle/focused-chunks/{chunk-IR4UXLRP.js → chunk-WAJNX4RN.js} +2 -2
  24. package/dist/cli-bundle/main.js +2 -2
  25. package/dist/cli-bundle/sdk-core.js +31 -31
  26. package/dist/cli-bundle/sdk-governance.js +1 -1
  27. package/dist/cli-bundle/sdk-merge.js +20 -20
  28. package/dist/cli-bundle/sdk-query.js +1 -1
  29. package/dist/cli-bundle/sdk-runtime.js +1 -1
  30. package/dist/cli-bundle/sdk-testing.js +1 -1
  31. package/dist/cli-bundle/sdk.js +1 -1
  32. package/dist/core/shared/secret-rules.js +1 -1
  33. package/dist/sdk/linked-artifacts.d.ts +1 -1
  34. package/dist/sdk/linked-artifacts.js +1 -1
  35. package/dist/sdk/test/execution.js +2 -2
  36. package/dist/sdk/test/workspace-snapshot.d.ts +11 -0
  37. package/dist/sdk/test/workspace-snapshot.js +2 -0
  38. package/docs/DEVELOPMENT_DEPENDENCY_SECURITY.md +109 -0
  39. package/docs/TESTING.md +32 -5
  40. package/marketplace.json +2 -2
  41. package/package.json +5 -4
  42. package/packages/pm-beads/package.json +1 -1
  43. package/packages/pm-calendar/package.json +1 -1
  44. package/packages/pm-command-kit/package.json +1 -1
  45. package/packages/pm-digital-twin/package.json +1 -1
  46. package/packages/pm-governance-audit/package.json +1 -1
  47. package/packages/pm-guide-shell/package.json +1 -1
  48. package/packages/pm-kanban/package.json +1 -1
  49. package/packages/pm-lifecycle-hooks/package.json +1 -1
  50. package/packages/pm-linked-test-adapters/package.json +1 -1
  51. package/packages/pm-search-advanced/package.json +1 -1
  52. package/packages/pm-templates/package.json +1 -1
  53. package/packages/pm-todos/package.json +1 -1
  54. package/packages/pm-vcs/package.json +1 -1
  55. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  56. package/plugins/pm-claude/package.json +2 -2
  57. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  58. package/plugins/pm-codex/package.json +2 -2
  59. package/plugins/pm-codex/plugin.json +1 -1
@@ -1,2 +1,2 @@
1
- import{$ as m,A as Je,Aa as Mo,B as Ke,Ba as Ro,C as Qe,Ca as Ao,D as Ye,Da as Po,E as Ze,Ea as Bo,F as $e,Fa as Oo,G as eo,Ga as Uo,H as oo,Ha as Wo,I as to,Ia as jo,J as ro,Ja as Lo,K as no,Ka as No,L as fo,La as Vo,M as po,Ma as zo,N as ao,Na as Xo,O as mo,Oa as qo,P as so,Pa as Go,Q as io,Qa as Ho,R as xo,Ra as Jo,S as lo,Sa as Ko,T as uo,Ta as k,U as co,Ua as E,V as yo,Va as D,W as go,X as bo,Y as Co,Z as Io,_ as a,a as Be,aa as d,b as Oe,ba as s,c as Ue,ca as i,d as We,da as x,e as je,ea as l,f as Le,fa as u,g as Ne,ga as c,ha as y,ia as g,ja as b,ka as C,la as I,ma as w,na as T,o as Ve,oa as h,p as ze,pa as _,q as Xe,qa as wo,r as qe,ra as To,sa as ho,ta as _o,ua as ko,va as Eo,wa as Do,x as p,xa as vo,y as Ge,ya as Fo,z as He,za as So}from"./focused-chunks/chunk-GBD4EN6S.js";import{Q as te,Qa as Ce,Ra as Ie,Sa as we,Ta as Te,Ua as he,Va as _e,Wa as ke,da as n,db as Ee,eb as De,fb as ve,gb as Fe,hb as Se,ib as Me,jb as Re,kb as Ae,lb as Pe,tb as f}from"./focused-chunks/chunk-IR4UXLRP.js";import"./focused-chunks/chunk-ZIXFMIUL.js";import{a as J,b as K,c as Q,d as Y,e as Z,f as $}from"./focused-chunks/chunk-FKK2HI3S.js";import"./focused-chunks/chunk-XRSCIYHR.js";import{Ea as oe,Kb as se,Lb as ie,Mb as xe,Nb as le,Ob as ue,Pb as ce,Qb as ye,Rb as ge,Sb as be,aa as ee,nb as r,ob as re,pb as ne,qb as fe,rb as pe,tb as ae,ub as me,vb as de}from"./focused-chunks/chunk-YC32ZSLS.js";import"./focused-chunks/chunk-GMYUNHST.js";import"./focused-chunks/chunk-HFAW3FJQ.js";import{cd as v,dd as F,ed as S,ee as U,fd as M,fe as W,gd as R,ge as j,hd as A,he as L,id as P,ie as N,jd as B,je as V,kd as O,ke as z,le as X,me as q,ne as G,oe as H}from"./focused-chunks/chunk-WCY6HRZO.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="d45a8203-4501-5797-a6cc-a2e7844adec9")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="d007edcb-46f0-5546-b804-27d86afe23e7")}catch{}})();export{ie as ACTIONABILITY_ORDERING_KINDS,K as BRIEF_LIST_FIELDS,Ze as CONTEXT_EVALUATION_METRIC_NAMES,a as CONTEXT_OUTPUT_VALUES,ro as CONTEXT_PACKING_PROFILES,Je as CONTEXT_RELEVANCE_SERVICE,Ge as CONTEXT_RELEVANCE_SIGNAL_NAMES,po as CONTEXT_SIGNAL_SET_VERSION,fo as CONTEXT_SIGNAL_STORE_FORMAT_VERSION,ao as CONTEXT_SIGNAL_STORE_WARNING_DETAILS,U as CONTEXT_USAGE_LIMITS,xo as ContextSignalStore,W as ContextUsageValidationError,So as DEFAULT_CHILD_SAMPLE_LIMIT,J as DEFAULT_COMPACT_LIST_FIELDS,pe as DEFAULT_DERIVED_INDEX_MINIMUM_ITEMS,uo as DEFAULT_WORKSPACE_MEMORY_MINIMUM_ITEMS,k as EVAL_METRIC_NAMES,Z as GET_DEPTH_VALUES,io as JsonFileContextSignalStoreAdapter,Q as LIST_COMMAND_DEFAULT_PROJECTIONS,ve as LIST_SORT_FIELDS,Fe as LIST_SORT_ORDER_VALUES,Fo as MAX_CHILD_PROJECTION_ITEMS,wo as NEXT_OUTPUT_VALUES,Be as PM_COMPLETE_LIST_FINDING_CODES,Oe as PmCompleteListValidationError,O as QUERY_CURSOR_CONTRACT,Pe as _testOnly,vo as _testOnlyAggregateCommand,Ao as _testOnlyGetCommand,ho as _testOnlyNextCommand,Jo as _testOnlySearchCommand,ae as acquireItemMetadataDerivedIndexLock,f as analyzeDuplicateItems,h as applyContextTagProjection,Se as applyFilterValueEcho,Le as assertCompleteListResult,j as attachContextUsageServingReceipt,C as buildChildrenByParent,Vo as buildCompactSearchFilterSummary,Me as buildContentFilterEcho,so as buildContextSignalSnapshot,Re as buildGovernanceMissingFilterEcho,Mo as buildItemChildrenRollup,He as buildItemContextRelevanceCandidates,zo as buildVerboseSearchFilters,co as buildWorkspaceMemorySnapshot,je as certifyCompleteListResult,qo as classifyImplicitSemanticFallbackReason,xe as collectBlockedByIds,ue as collectBlockedByIdsFromCorpus,N as collectContextUsageDeliveredItemIds,ye as collectDependencyBlockedIds,Xo as collectErrorCauseCodes,u as collectSubtreeIds,c as compareCriticalItems,be as computeActionabilityReport,Ue as createCompleteListOptions,F as createQueryFingerprint,Lo as createSearchCursorFingerprint,A as decodeQueryCursor,M as decodeQueryCursorEnvelope,R as decodeQueryCursorState,Ke as defaultScoreContextCandidates,S as encodeQueryCursor,$e as evaluateContextRanking,D as evaluateMetricFloors,n as executeEmbeddingBatchesWithRetry,V as finalizeContextUsageDelivery,Ho as formatVectorIndexRecoveryWarnings,le as indexBlockedByIds,We as inspectCompleteListResult,$ as listGetProjectionFields,Y as listListProjectionFields,r as measureItemMetadataReadWork,w as mergeSortedWarnings,no as packContextCandidates,y as packRankedContextItems,B as paginateQueryRows,x as parseContextDepth,m as parseContextFocusFields,l as parseContextSections,mo as parseContextSignalSnapshot,E as parseEvalMetricFloors,Ce as parseIntegerLimit,te as parseLimit,Te as parseMultiValueFilter,Ie as parsePriority,ke as parsePriorityFilterSet,he as parseStringFilterSet,we as parseType,_e as parseTypeFilterSet,_o as partitionDecisionEntries,d as projectContextFocusRows,L as propagateContextUsageServingReceipt,re as queryItemMetadataIndex,ne as queryLinkedFileMetadataIndex,fe as querySimilarItemMetadataIndex,H as readContextUsageAffinity,ee as readHistoryEntries,me as readItemMetadataDerivedIndexState,lo as readWorkspaceContextSignals,yo as readWorkspaceMemory,X as recordContextUsageDelivery,z as recordContextUsageServing,q as recordContextUsageTouch,G as recordContextUsageTouches,de as refreshItemMetadataDerivedIndex,ze as renderCalendarMarkdown,Xe as renderCalendarToon,T as renderContextMarkdown,Eo as renderNextMarkdown,Ve as resolveCalendarOutputFormat,De as resolveContentFieldFilters,s as resolveContextOutputFormat,i as resolveContextTokenBudget,Oo as resolveEffectiveSearchMode,Wo as resolveHybridSemanticWeight,ce as resolveItemBlockers,se as resolveItemExecutionRole,Ee as resolveMissingMetadataFilters,To as resolveNextOutputFormat,P as resolveQueryCursorStart,Bo as resolveSearchMaxResults,No as resolveSearchPage,Uo as resolveSearchScoreThreshold,jo as resolveSearchTuning,Go as resolveVectorIndexRecovery,p as runActivity,Do as runAggregate,qe as runCalendar,_ as runContext,to as runContextEvaluationCorpus,eo as runContextEvaluationScenario,Ne as runDuplicates,Ro as runGet,Po as runHistory,Ae as runList,ko as runNext,Ko as runSearch,Qe as scoreContextCandidates,Ye as scoreContextCandidatesWithActiveExtensions,Co as searchWorkspaceMemory,Io as searchWorkspaceMemoryReadResult,ge as selectActionableEntries,v as selectCursorSemanticOptions,bo as selectWorkspaceMemory,go as selectWorkspaceMemoryRollups,oo as summarizeContextEvaluationReports,I as toContextFocusItem,g as toContextPackingSummary,b as toContextRankingSummary,oe as verifyHistoryChain};
1
+ import{$ as m,A as Je,Aa as Mo,B as Ke,Ba as Ro,C as Qe,Ca as Ao,D as Ye,Da as Po,E as Ze,Ea as Bo,F as $e,Fa as Oo,G as eo,Ga as Uo,H as oo,Ha as Wo,I as to,Ia as jo,J as ro,Ja as Lo,K as no,Ka as No,L as fo,La as Vo,M as po,Ma as zo,N as ao,Na as Xo,O as mo,Oa as qo,P as so,Pa as Go,Q as io,Qa as Ho,R as xo,Ra as Jo,S as lo,Sa as Ko,T as uo,Ta as k,U as co,Ua as E,V as yo,Va as D,W as go,X as bo,Y as Co,Z as Io,_ as a,a as Be,aa as d,b as Oe,ba as s,c as Ue,ca as i,d as We,da as x,e as je,ea as l,f as Le,fa as u,g as Ne,ga as c,ha as y,ia as g,ja as b,ka as C,la as I,ma as w,na as T,o as Ve,oa as h,p as ze,pa as _,q as Xe,qa as wo,r as qe,ra as To,sa as ho,ta as _o,ua as ko,va as Eo,wa as Do,x as p,xa as vo,y as Ge,ya as Fo,z as He,za as So}from"./focused-chunks/chunk-HIA2ZF64.js";import{Q as te,Qa as Ce,Ra as Ie,Sa as we,Ta as Te,Ua as he,Va as _e,Wa as ke,da as n,db as Ee,eb as De,fb as ve,gb as Fe,hb as Se,ib as Me,jb as Re,kb as Ae,lb as Pe,tb as f}from"./focused-chunks/chunk-WAJNX4RN.js";import"./focused-chunks/chunk-ZIXFMIUL.js";import{a as J,b as K,c as Q,d as Y,e as Z,f as $}from"./focused-chunks/chunk-FKK2HI3S.js";import"./focused-chunks/chunk-XRSCIYHR.js";import{Ea as oe,Kb as se,Lb as ie,Mb as xe,Nb as le,Ob as ue,Pb as ce,Qb as ye,Rb as ge,Sb as be,aa as ee,nb as r,ob as re,pb as ne,qb as fe,rb as pe,tb as ae,ub as me,vb as de}from"./focused-chunks/chunk-YC32ZSLS.js";import"./focused-chunks/chunk-GMYUNHST.js";import"./focused-chunks/chunk-HFAW3FJQ.js";import{cd as v,dd as F,ed as S,ee as U,fd as M,fe as W,gd as R,ge as j,hd as A,he as L,id as P,ie as N,jd as B,je as V,kd as O,ke as z,le as X,me as q,ne as G,oe as H}from"./focused-chunks/chunk-WCY6HRZO.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="d45a8203-4501-5797-a6cc-a2e7844adec9")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="d007edcb-46f0-5546-b804-27d86afe23e7")}catch{}})();export{ie as ACTIONABILITY_ORDERING_KINDS,K as BRIEF_LIST_FIELDS,Ze as CONTEXT_EVALUATION_METRIC_NAMES,a as CONTEXT_OUTPUT_VALUES,ro as CONTEXT_PACKING_PROFILES,Je as CONTEXT_RELEVANCE_SERVICE,Ge as CONTEXT_RELEVANCE_SIGNAL_NAMES,po as CONTEXT_SIGNAL_SET_VERSION,fo as CONTEXT_SIGNAL_STORE_FORMAT_VERSION,ao as CONTEXT_SIGNAL_STORE_WARNING_DETAILS,U as CONTEXT_USAGE_LIMITS,xo as ContextSignalStore,W as ContextUsageValidationError,So as DEFAULT_CHILD_SAMPLE_LIMIT,J as DEFAULT_COMPACT_LIST_FIELDS,pe as DEFAULT_DERIVED_INDEX_MINIMUM_ITEMS,uo as DEFAULT_WORKSPACE_MEMORY_MINIMUM_ITEMS,k as EVAL_METRIC_NAMES,Z as GET_DEPTH_VALUES,io as JsonFileContextSignalStoreAdapter,Q as LIST_COMMAND_DEFAULT_PROJECTIONS,ve as LIST_SORT_FIELDS,Fe as LIST_SORT_ORDER_VALUES,Fo as MAX_CHILD_PROJECTION_ITEMS,wo as NEXT_OUTPUT_VALUES,Be as PM_COMPLETE_LIST_FINDING_CODES,Oe as PmCompleteListValidationError,O as QUERY_CURSOR_CONTRACT,Pe as _testOnly,vo as _testOnlyAggregateCommand,Ao as _testOnlyGetCommand,ho as _testOnlyNextCommand,Jo as _testOnlySearchCommand,ae as acquireItemMetadataDerivedIndexLock,f as analyzeDuplicateItems,h as applyContextTagProjection,Se as applyFilterValueEcho,Le as assertCompleteListResult,j as attachContextUsageServingReceipt,C as buildChildrenByParent,Vo as buildCompactSearchFilterSummary,Me as buildContentFilterEcho,so as buildContextSignalSnapshot,Re as buildGovernanceMissingFilterEcho,Mo as buildItemChildrenRollup,He as buildItemContextRelevanceCandidates,zo as buildVerboseSearchFilters,co as buildWorkspaceMemorySnapshot,je as certifyCompleteListResult,qo as classifyImplicitSemanticFallbackReason,xe as collectBlockedByIds,ue as collectBlockedByIdsFromCorpus,N as collectContextUsageDeliveredItemIds,ye as collectDependencyBlockedIds,Xo as collectErrorCauseCodes,u as collectSubtreeIds,c as compareCriticalItems,be as computeActionabilityReport,Ue as createCompleteListOptions,F as createQueryFingerprint,Lo as createSearchCursorFingerprint,A as decodeQueryCursor,M as decodeQueryCursorEnvelope,R as decodeQueryCursorState,Ke as defaultScoreContextCandidates,S as encodeQueryCursor,$e as evaluateContextRanking,D as evaluateMetricFloors,n as executeEmbeddingBatchesWithRetry,V as finalizeContextUsageDelivery,Ho as formatVectorIndexRecoveryWarnings,le as indexBlockedByIds,We as inspectCompleteListResult,$ as listGetProjectionFields,Y as listListProjectionFields,r as measureItemMetadataReadWork,w as mergeSortedWarnings,no as packContextCandidates,y as packRankedContextItems,B as paginateQueryRows,x as parseContextDepth,m as parseContextFocusFields,l as parseContextSections,mo as parseContextSignalSnapshot,E as parseEvalMetricFloors,Ce as parseIntegerLimit,te as parseLimit,Te as parseMultiValueFilter,Ie as parsePriority,ke as parsePriorityFilterSet,he as parseStringFilterSet,we as parseType,_e as parseTypeFilterSet,_o as partitionDecisionEntries,d as projectContextFocusRows,L as propagateContextUsageServingReceipt,re as queryItemMetadataIndex,ne as queryLinkedFileMetadataIndex,fe as querySimilarItemMetadataIndex,H as readContextUsageAffinity,ee as readHistoryEntries,me as readItemMetadataDerivedIndexState,lo as readWorkspaceContextSignals,yo as readWorkspaceMemory,X as recordContextUsageDelivery,z as recordContextUsageServing,q as recordContextUsageTouch,G as recordContextUsageTouches,de as refreshItemMetadataDerivedIndex,ze as renderCalendarMarkdown,Xe as renderCalendarToon,T as renderContextMarkdown,Eo as renderNextMarkdown,Ve as resolveCalendarOutputFormat,De as resolveContentFieldFilters,s as resolveContextOutputFormat,i as resolveContextTokenBudget,Oo as resolveEffectiveSearchMode,Wo as resolveHybridSemanticWeight,ce as resolveItemBlockers,se as resolveItemExecutionRole,Ee as resolveMissingMetadataFilters,To as resolveNextOutputFormat,P as resolveQueryCursorStart,Bo as resolveSearchMaxResults,No as resolveSearchPage,Uo as resolveSearchScoreThreshold,jo as resolveSearchTuning,Go as resolveVectorIndexRecovery,p as runActivity,Do as runAggregate,qe as runCalendar,_ as runContext,to as runContextEvaluationCorpus,eo as runContextEvaluationScenario,Ne as runDuplicates,Ro as runGet,Po as runHistory,Ae as runList,ko as runNext,Ko as runSearch,Qe as scoreContextCandidates,Ye as scoreContextCandidatesWithActiveExtensions,Co as searchWorkspaceMemory,Io as searchWorkspaceMemoryReadResult,ge as selectActionableEntries,v as selectCursorSemanticOptions,bo as selectWorkspaceMemory,go as selectWorkspaceMemoryRollups,oo as summarizeContextEvaluationReports,I as toContextFocusItem,g as toContextPackingSummary,b as toContextRankingSummary,oe as verifyHistoryChain};
2
2
  //# sourceMappingURL=sdk-query.js.map
@@ -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 ra,gb as vc,gc as vd,h as sa,hb as wc,hc as wd,i as ta,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-XOUBIF6Z.js";import"./chunks/chunk-Z2GYDSAO.js";import{L as yb,m as bb,n as wb,u as xb}from"./chunks/chunk-R4TUD355.js";import{$c as pb,Gd as zb,Td as ec,Uc as fb,Ud as fc,Vd as gc,Wd as hc,Xd as ic,ad as qb,bd as rb,pc as Xa,qc as Ya,rc as Za,tb as Wa,tc as _a,uc as $a,vc as ab}from"./chunks/chunk-MTJMOI4I.js";import{U as Ma,V as Na,X as Oa,Y as Pa,Z as Qa,j as Ia,k as Ja,m as Ka,n as La}from"./chunks/chunk-ZI7F3FVE.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-SV7CZEVV.js";import{$i as Ba,A as b,Aa as m,Ae as R,Ai as wa,Be as S,Bg as ga,C as c,Ce as T,Cg as ha,D as d,Dc as t,De as U,Di as xa,Dl as Ca,Eg as ia,Fg as ja,Kh as oa,Ld as w,Lh as pa,Mc as u,Md as x,Nd as y,Oc as v,Od as z,Pd as A,Qd as B,Rd as C,Sd as D,Td as E,Ua as n,Ud as F,Vd as G,Xi as ya,Yi as za,_a as o,_i as Aa,ab as p,db as q,eb as r,ff as V,gb as s,gf as W,kg as Y,lh as ka,mf as X,mg as Z,mh as la,na as e,nh as ma,oh as na,pa as f,pi as qa,qa as g,qe as H,ra as h,re as I,rg as _,sa as i,se as J,sg as $,te as K,tg as aa,ue as L,ug as ba,ve as M,vg as ca,vn as Da,wa as j,we as N,wg as da,wn as Ea,x as a,xe as O,xg as ea,xn as Fa,ya as k,ye as P,yi as ua,za as l,ze as Q,zg as fa,zi as va,zn as Ga}from"./chunks/chunk-R7ULWMBG.js";export{_ as BASELINE_ITEM_FORMAT_VERSION,g as BUILTIN_ITEM_TYPE_VALUES,m as CONFIDENCE_TEXT_VALUES,lb as CONTEXT_OUTPUT_VALUES,$ as CURRENT_ITEM_FORMAT_VERSION,Xa as DEFAULT_TERMINAL_TRANSITION_POLICY,j as DEPENDENCY_KIND_VALUES,e as EXIT_CODE,ka as HISTORY_EVENT_CLASSIFICATION_VERSION,l as ISSUE_SEVERITY_VALUES,h as ITEM_TYPE_VALUES,la as MAINTENANCE_HISTORY_OPERATIONS,x as MAX_WORKFLOW_POLICIES,y as MAX_WORKFLOW_POLICY_TERMS,nb as NEXT_OUTPUT_VALUES,ra 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,ma 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,pa as appendHistoryEntry,_a as applyTerminalOrderingPolicy,Va as assertCompleteListResult,Oa as buildWorkflowCompletenessCheck,ja as canonicalDocument,Ua as certifyCompleteListResult,ld as claim,md as claimNext,na as classifyHistoryEvent,ca 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,oa as createHistoryEntry,Pa as createLifecycleCompletenessPolicies,sa as createPmCliExpectedError,N as createPmCommandOutputBudget,G as createWorkflowPolicyEvaluator,O as definePmCommandOutputBudget,pd as deleteItem,Ac as deps,zc as docs,sc as duplicates,aa 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,ta as isPmCliExpectedError,fa 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,ba as normalizeItemFormatVersion,va as normalizeItemId,ga as normalizeItemMetadata,ua as normalizeRawItemId,Ea as normalizeSimilarityText,ea 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,qa 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,Z as resolveRuntimeFieldRegistry,Y 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,da 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,ia as serializeItemDocument,ha 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};
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 ra,gb as vc,gc as vd,h as sa,hb as wc,hc as wd,i as ta,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-5XKF5SQV.js";import"./chunks/chunk-YDWKGUQU.js";import{L as yb,m as bb,n as wb,u as xb}from"./chunks/chunk-3AF2R3Y6.js";import{$c as pb,Gd as zb,Td as ec,Uc as fb,Ud as fc,Vd as gc,Wd as hc,Xd as ic,ad as qb,bd as rb,pc as Xa,qc as Ya,rc as Za,tb as Wa,tc as _a,uc as $a,vc as ab}from"./chunks/chunk-FW5LJXQY.js";import{U as Ma,V as Na,X as Oa,Y as Pa,Z as Qa,j as Ia,k as Ja,m as Ka,n as La}from"./chunks/chunk-KP7NBQK3.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-MKXBCBAN.js";import{$i as Ba,A as b,Aa as m,Ae as R,Ai as wa,Be as S,Bg as ga,C as c,Ce as T,Cg as ha,D as d,Dc as t,De as U,Di as xa,Dl as Ca,Eg as ia,Fg as ja,Kh as oa,Ld as w,Lh as pa,Mc as u,Md as x,Nd as y,Oc as v,Od as z,Pd as A,Qd as B,Rd as C,Sd as D,Td as E,Ua as n,Ud as F,Vd as G,Xi as ya,Yi as za,_a as o,_i as Aa,ab as p,db as q,eb as r,ff as V,gb as s,gf as W,kg as Y,lh as ka,mf as X,mg as Z,mh as la,na as e,nh as ma,oh as na,pa as f,pi as qa,qa as g,qe as H,ra as h,re as I,rg as _,sa as i,se as J,sg as $,te as K,tg as aa,ue as L,ug as ba,ve as M,vg as ca,vn as Da,wa as j,we as N,wg as da,wn as Ea,x as a,xe as O,xg as ea,xn as Fa,ya as k,ye as P,yi as ua,za as l,ze as Q,zg as fa,zi as va,zn as Ga}from"./chunks/chunk-QPKQKSQU.js";export{_ as BASELINE_ITEM_FORMAT_VERSION,g as BUILTIN_ITEM_TYPE_VALUES,m as CONFIDENCE_TEXT_VALUES,lb as CONTEXT_OUTPUT_VALUES,$ as CURRENT_ITEM_FORMAT_VERSION,Xa as DEFAULT_TERMINAL_TRANSITION_POLICY,j as DEPENDENCY_KIND_VALUES,e as EXIT_CODE,ka as HISTORY_EVENT_CLASSIFICATION_VERSION,l as ISSUE_SEVERITY_VALUES,h as ITEM_TYPE_VALUES,la as MAINTENANCE_HISTORY_OPERATIONS,x as MAX_WORKFLOW_POLICIES,y as MAX_WORKFLOW_POLICY_TERMS,nb as NEXT_OUTPUT_VALUES,ra 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,ma 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,pa as appendHistoryEntry,_a as applyTerminalOrderingPolicy,Va as assertCompleteListResult,Oa as buildWorkflowCompletenessCheck,ja as canonicalDocument,Ua as certifyCompleteListResult,ld as claim,md as claimNext,na as classifyHistoryEvent,ca 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,oa as createHistoryEntry,Pa as createLifecycleCompletenessPolicies,sa as createPmCliExpectedError,N as createPmCommandOutputBudget,G as createWorkflowPolicyEvaluator,O as definePmCommandOutputBudget,pd as deleteItem,Ac as deps,zc as docs,sc as duplicates,aa 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,ta as isPmCliExpectedError,fa 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,ba as normalizeItemFormatVersion,va as normalizeItemId,ga as normalizeItemMetadata,ua as normalizeRawItemId,Ea as normalizeSimilarityText,ea 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,qa 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,Z as resolveRuntimeFieldRegistry,Y 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,da 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,ia as serializeItemDocument,ha 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-CZLAWXDR.js";import"./chunks/chunk-XOUBIF6Z.js";import"./chunks/chunk-Z2GYDSAO.js";import"./chunks/chunk-R4TUD355.js";import"./chunks/chunk-MTJMOI4I.js";import{Qa as b,o as a}from"./chunks/chunk-ZI7F3FVE.js";import"./chunks/chunk-SV7CZEVV.js";import"./chunks/chunk-R7ULWMBG.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};
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-6Z4IV2MC.js";import"./chunks/chunk-5XKF5SQV.js";import"./chunks/chunk-YDWKGUQU.js";import"./chunks/chunk-3AF2R3Y6.js";import"./chunks/chunk-FW5LJXQY.js";import{Qa as b,o as a}from"./chunks/chunk-KP7NBQK3.js";import"./chunks/chunk-MKXBCBAN.js";import"./chunks/chunk-QPKQKSQU.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
@@ -1,4 +1,4 @@
1
- import{A as LM,B as DM,C as $M,D as FM,E as GM,a as Vn,b as US,c as jS,d as BS,e as qS,f as zS,g as Ww,h as Xw,i as ka,j as xa,k as Na,m as La,n as Da,o as $a,p as Fa,q as Ga,r as Ua,s as ja,t as Ba,u as Za,v as Qa,w as ec,x as tc,y as rc,z as NM}from"./chunks/chunk-7NL3A2BY.js";import{A as vk,B as Ok,C as Rk,D as Ik,E as Pk,F as Mk,G as kk,H as xk,I as Nk,J as Lk,K as Dk,L as $k,M as Fk,N as Gk,O as Uk,P as jk,Q as Bk,R as qk,S as zk,T as Vk,U as Hk,V as Kk,W as Wk,X as Xk,Y as Yk,a as ek,b as tk,c as rk,d as ok,e as nk,f as ik,g as sk,h as ak,i as ck,j as dk,k as lk,l as uk,m as pk,n as mk,o as fk,p as _k,q as hk,r as gk,s as yk,t as bk,u as Ck,v as Tk,w as Sk,x as Ek,y as wk,z as Ak}from"./chunks/chunk-CZLAWXDR.js";import{a as Mh}from"./chunks/chunk-WP6NRH72.js";import{a as UM,b as jM,c as BM,d as qM}from"./chunks/chunk-TRYXVQ7W.js";import{a as zM,b as VM,c as HM,d as KM,e as WM,f as XM,g as YM,h as JM,i as ZM,j as QM}from"./chunks/chunk-HY6M34B4.js";import{$ as mm,$a as n_,$b as nh,A as Ve,Aa as vf,Ab as M_,B as Qp,Ba as Of,Bb as k_,C as em,Ca as Rf,Cb as x_,D as tm,Da as If,Db as N_,E as rm,Ea as Pf,Eb as L_,F as om,Fa as Mf,Fb as D_,G as Bt,Ga as kf,Gb as $_,H as qt,Ha as xf,Hb as F_,I as zt,Ia as Nf,Ib as G_,J as Vt,Ja as Lf,Jb as U_,K as Ht,Ka as Df,Kb as j_,L as Kt,La as $f,Lb as B_,M as Wt,Ma as Ff,Mb as q_,N as Xt,Na as Gf,Nb as z_,O as Yt,Oa as Uf,Ob as V_,P as Jt,Pa as jf,Pb as H_,Q as Zt,Qa as Bf,Qb as K_,R as nm,Ra as qf,Rb as W_,S as im,Sa as zf,Sb as X_,T as sm,Ta as Vf,Tb as Y_,U as am,Ua as Hf,Ub as J_,V as cm,Va as Qt,Vb as Z_,W as He,Wa as me,Wb as Q_,X as dm,Xa as e_,Xb as eh,Y as lm,Ya as t_,Yb as th,Z as um,Za as r_,Zb as rh,_ as pm,_a as o_,_b as oh,a as NS,aa as fm,ab as i_,ac as ih,b as LS,ba as _m,bb as s_,bc as sh,c as DS,ca as hm,cb as a_,cc as ah,d as $S,da as _M,db as c_,dc as ch,e as FS,ea as hM,eb as d_,ec as dh,f as GS,fa as gM,fb as l_,fc as lh,g as Ni,ga as Im,gb as u_,gc as uh,h as Li,ha as Pm,hb as p_,hc as ph,i as Di,ia as Mm,ib as m_,ic as mh,j as Ow,ja as gf,jb as f_,jc as fh,k as Rw,ka as yf,kb as __,kc as _h,l as zi,la as vM,lb as h_,lc as hh,m as RR,ma as OM,mb as g_,mc as gh,n as IR,na as RM,nb as y_,nc as yh,o as PR,oa as IM,ob as b_,oc as bh,p as MR,pa as PM,pb as C_,pc as Ch,q as kR,qa as MM,qb as T_,qc as Th,r as xR,ra as kM,rb as S_,rc as Sh,s as pl,sa as xM,sb as E_,sc as Eh,t as Bu,ta as bf,tb as w_,tc as wh,u as qu,ua as Cf,ub as A_,uc as Ah,v as Ku,va as Tf,vb as v_,vc as vh,w as Wu,wa as Sf,wb as O_,wc as Oh,x as pp,xa as Ef,xb as R_,xc as Rh,y as bp,ya as wf,yb as I_,yc as Ih,z as oP,za as Af,zb as P_,zc as Ph}from"./chunks/chunk-XOUBIF6Z.js";import{e as DR,f as $R,g as ml,h as fl,i as Gt}from"./chunks/chunk-Z2GYDSAO.js";import{A as nM,B as iM,C as sM,D as aM,E as cM,F as dM,G as lM,H as uM,I as pM,J as mM,K as fM,L as bm,M as Cm,N as Tm,O as Sm,P as Em,Q as wm,R as Am,S as vm,T as Om,U as Rm,a as UI,b as jI,c as BI,d as qI,e as zI,f as ju,g as VI,h as HI,i as KI,j as WI,k as XI,m as Hu,n as gm,o as KP,p as WP,q as XP,r as YP,s as JP,t as ZP,u as ym,v as QP,w as eM,x as tM,y as rM,z as oM}from"./chunks/chunk-R4TUD355.js";import{$ as eR,$a as El,$b as xu,$c as Yp,A as IO,Ab as BR,Ac as Qu,Ad as Qm,B as PO,Bb as qR,Bc as ep,Bd as ef,C as MO,Cb as zR,Cc as tp,Cd as tf,D as kO,Db as VR,Dc as rp,Dd as rf,E as xO,Eb as HR,Ec as op,Ed as of,F as ze,Fa as Yd,Fb as KR,Fc as np,Fd as nf,G as NO,Ga as Jd,Gb as mI,Gc as ip,Gd as sf,H as xt,Ha as Zd,Hb as fI,Hc as sp,Hd as af,I as LO,Ia as Qd,Ib as _I,Ic as ap,J as DO,Ja as el,Jb as hI,Jc as cp,Jd as cf,K as $O,Kb as gI,Kc as dp,Kd as df,L as FO,La as tl,Lb as yI,Lc as lp,Ld as lf,M as GO,Ma as rl,Mb as bI,Md as uf,N as UO,Na as ol,Nb as AI,Nc as tP,Nd as pf,O as jO,Oa as nl,Ob as vI,Oc as rP,Od as mf,P as BO,Pa as NR,Pb as vu,Pc as up,Pd as ff,Q as qO,Qa as LR,Qb as Ou,Qc as Cp,Qd as _f,R as zO,Ra as il,Rb as OI,Rd as hf,S as VO,Sa as sl,Sb as RI,Sd as Kf,T as HO,Ta as al,Tb as II,Td as Wf,U as KO,Ua as cl,Ub as PI,Uc as Tp,Ud as Xf,V as WO,Va as dl,Vb as MI,Vd as Yf,W as XO,Wa as ll,Wb as Ru,Wc as Sp,Wd as Jf,X as YO,Xa as ul,Xb as Iu,Xc as Hp,Xd as Zf,Y as JO,Ya as Cl,Yb as Pu,Yc as Kp,Yd as Qf,Z as ZO,Za as Tl,Zb as Mu,Zc as Wp,_ as QO,_a as Sl,_b as ku,_c as Xp,a as CO,aa as tR,ab as wl,ac as Nu,ad as Jp,b as Pt,ba as rR,bb as Al,bc as Lu,bd as Zp,c as TO,ca as oR,cb as vl,cc as Du,cd as km,d as Be,da as nR,db as Ol,dc as $u,dd as xm,e as ee,ea as iR,eb as Rl,ec as Fu,ed as Nm,f as pd,fa as sR,fb as Il,fc as Gu,fd as Lm,gb as Pl,gc as kI,gd as Dm,hb as Ml,hc as xI,hd as $m,i as qe,ib as kl,ic as NI,id as Fm,j as md,jb as xl,jc as LI,jd as Gm,k as fd,kb as Nl,kc as DI,kd as Um,lb as Ll,lc as $I,ld as EM,m as pe,ma as Xd,mb as Dl,mc as FI,md as wM,n as _d,nb as $l,nc as GI,nd as AM,o as hd,ob as GR,oc as Uu,od as jm,p as gd,pb as Fl,pc as YI,pd as Bm,q as yd,qb as Gl,qc as JI,qd as qm,r as SO,rb as Ul,rc as ZI,rd as zm,s as EO,sb as jl,sc as QI,sd as Vm,t as wO,tb as UR,tc as eP,td as Hm,u as AO,ub as Bl,uc as zu,ud as Km,v as vO,vb as ql,vc as Vu,vd as Wm,w as Mt,wb as zl,wc as Xu,wd as Xm,x as OO,xb as Vl,xc as Yu,xd as Ym,y as RO,yb as Hl,yc as Ju,yd as Jm,z as kt,zb as jR,zc as Zu,zd as Zm}from"./chunks/chunk-MTJMOI4I.js";import{$ as kd,$a as Bd,A as bR,B as CR,C as TR,D as Ed,E as wd,F as Ad,G as vd,H as Od,I as SR,J as Rd,K as Id,Ka as Lt,L as Pd,La as Dt,Ma as $t,Na as Ft,Oa as Ld,Qa as Dd,Ra as $d,Sa as Fd,U as ER,V as wR,X as AR,Xa as Gd,Y as vR,Ya as Ud,Z as OR,_ as Md,_a as jd,a as xw,aa as xd,ab as qd,b as Nw,ba as Nd,bb as zd,c as Lw,ca as Nt,cb as Vd,d as Vi,e as Hi,eb as Hd,f as Ki,fb as Kd,g as Wi,gb as Wd,h as Xi,j as bd,k as Cd,m as Td,n as Sd,o as aR,p as cR,q as dR,r as lR,s as uR,t as pR,u as mR,v as fR,w as _R,x as hR,y as gR,z as yR}from"./chunks/chunk-ZI7F3FVE.js";import{$ as cO,$a as Au,$b as mP,$c as yM,Aa as Zl,Ac as UP,Ba as Ql,Bb as CI,Bc as jP,Ca as eu,Cb as TI,Cc as BP,Da as tu,Db as SI,Dc as Ut,Ea as ru,Eb as EI,Ec as Rp,Fa as ou,Fb as wI,Fc as Ip,G as Qv,Ga as nu,Gb as mp,Gc as Pp,H as eO,Ha as iu,Hb as fp,Hc as Mp,I as tO,Ia as su,Ib as _p,Ic as kp,J as rO,Ja as au,Jb as hp,Jc as xp,K as oO,Ka as cu,Kb as gp,Kc as Np,L as nO,La as du,Lb as yp,Lc as Lp,M as iO,Ma as lu,Mb as Ep,Mc as Dp,N as sO,Na as uu,Nb as wp,Nc as $p,O as ed,Oa as pu,Ob as Ap,Oc as Fp,P as td,Pa as mu,Pb as vp,Pc as Gp,Q as rd,Qa as fu,Qb as nP,Qc as Up,R as od,Ra as _u,Rb as iP,Rc as jp,S as nd,Sa as hu,Sb as sP,Sc as Bp,T as id,Ta as gu,Tb as aP,Tc as qp,U as sd,Ua as yu,Ub as cP,Uc as jt,V as ad,Va as bu,Vb as dP,Vc as zp,W as cd,Wa as Cu,Wb as lP,Wc as qP,X as dd,Xa as Tu,Xc as zP,Y as ld,Ya as Su,Yb as Op,Yc as VP,Z as je,Za as Eu,Zb as uP,Zc as Vp,_ as aO,_a as wu,_b as pP,_c as HP,aa as dO,ac as fP,ad as bM,b as ww,ba as lO,bc as _P,bd as CM,c as Aw,ca as uO,cb as WR,cc as hP,cd as TM,d as vw,da as pO,db as XR,dc as gP,dd as SM,e as Iw,eb as YR,ec as yP,f as Pw,fb as JR,fc as bP,g as Mw,ga as mO,gb as ZR,gc as CP,h as kw,ha as fO,hb as QR,hc as TP,i as $v,ia as _O,ib as eI,ic as SP,j as Fv,ja as hO,jb as tI,jc as EP,k as Gv,ka as gO,kb as rI,kc as wP,l as Uv,la as yO,lb as oI,lc as AP,m as jv,ma as bO,mb as nI,mc as vP,n as Bv,na as ud,nb as iI,nc as OP,o as qv,oa as _l,ob as sI,oc as RP,p as zv,pa as hl,pc as IP,q as Vv,qa as gl,qc as PP,r as Hv,ra as yl,rc as MP,s as Kv,sa as FR,sb as aI,sc as kP,t as Wv,tc as xP,u as Xv,ua as bl,ub as cI,uc as NP,v as Yv,va as Kl,vb as dI,vc as LP,w as Jv,wa as Wl,wc as DP,x as Zv,xa as Xl,xb as lI,xc as $P,ya as Yl,yb as uI,yc as FP,za as Jl,zb as pI,zc as GP}from"./chunks/chunk-SV7CZEVV.js";import{$a as Ko,$c as Ct,$d as fn,$e as oS,$f as tE,$g as yi,$h as BE,$i as bw,$j as vs,$k as va,$l as AA,$m as iv,$n as Rc,A as Do,Aa as zo,Ac as IC,Ad as fT,Ae as Gn,Af as TS,Ah as wE,Ai as Gi,Aj as es,Ak as Qs,Al as nA,Am as UA,An as hc,Ao as qc,Bc as PC,Bd as _T,Be as Un,Bf as SS,Bg as ni,Bh as AE,Bj as ts,Bk as ea,Bm as jA,Bn as gc,Bo as zc,C as xe,Cc as MC,Cd as hT,Ce as jn,Cf as ES,Cg as ii,Ch as vE,Cj as rs,Ck as ta,Cm as BA,Cn as yc,Co as Vc,D as $o,Dc as rn,Dd as gT,De as Bn,Df as wS,Dg as uE,Dh as OE,Di as iw,Dj as os,Dk as ra,Dl as oc,Dm as qA,Dn as gv,Do as Hc,Ec as kC,Ed as yT,Ee as LT,Ef as AS,Eg as si,Eh as RE,Ej as ns,Ek as oa,El as iA,Em as zA,En as yv,Eo as Kc,F as Nb,Fc as xC,Fd as bT,Fe as DT,Ff as vS,Fg as ai,Fh as IE,Fj as is,Fk as na,Fl as sA,Fm as VA,Fn as bv,Fo as Wc,G as Lb,Gb as cC,Gc as NC,Gd as CT,Ge as $T,Gf as OS,Gg as pE,Gh as PE,Gj as ss,Gk as ia,Gl as aA,Gm as vt,Gn as Cv,Go as Xc,H as Db,Hc as LC,Hd as TT,He as FT,Hf as RS,Hg as ci,Hh as ME,Hi as Ui,Hj as as,Hk as sa,Hl as cA,Hn as Tv,Ho as Yc,I as $b,Ib as dC,Ic as DC,Id as ST,Ie as GT,If as IS,Ig as di,Ii as wt,Ij as cs,Ik as aa,Il as dA,Im as HA,In as Sv,Io as Jc,J as Fb,Jb as lC,Jc as $C,Jd as ET,Je as UT,Jf as PS,Jg as L,Jh as kE,Ji as sw,Jj as ds,Jk as ca,Jl as lA,Jn as Ev,Jo as Zc,K as Gb,Kb as uC,Kc as FC,Ke as jT,Kf as MS,Kg as li,Kh as Mi,Ki as aw,Kj as ls,Kk as da,Km as KA,Kn as wv,Ko as Qc,Lb as pC,Lc as GC,Ld as wT,Le as BT,Lh as ki,Li as cw,Lj as us,Lk as la,Ll as uA,Lo as It,M as Ub,Mb as mC,Mc as on,Md as AT,Me as qT,Mf as kS,Mh as xE,Mi as dw,Mj as ps,Mk as ua,Ml as pA,N as jb,Nc as UC,Nd as vT,Ne as zT,Nf as xS,Ni as lw,Nk as pa,Nl as mA,Oc as nn,Od as OT,Of as Hn,Oi as uw,Oj as ms,Ok as ma,Ol as fA,Om as WA,On as Rt,Pa as Zb,Pb as fC,Pd as RT,Pe as VT,Pf as Kn,Pi as pw,Pj as fs,Pk as fa,Pm as XA,Pn as Av,Q as Bb,Qa as Qb,Qb as _C,Qc as jC,Qd as IT,Qe as HT,Qf as Wn,Qi as mw,Qj as _s,Qk as _a,Ql as _A,Qm as YA,Qn as vv,Ra as eC,Rc as BC,Rd as PT,Re as KT,Rf as VS,Rg as mE,Rh as NE,Ri as fw,Rj as hs,Rk as ha,Rl as hA,Rm as nc,Rn as Ov,Sc as qC,Sd as MT,Se as WT,Sf as HS,Sg as fE,Sh as LE,Sj as gs,Sk as ga,Sm as JA,Sn as bc,T as qb,Tb as I,Tc as zC,Td as kT,Te as XT,Tf as KS,Tg as _E,Th as DE,Ti as _w,Tj as ys,Tk as ya,Tl as gA,Tn as Cc,Ua as Vo,Ub as hC,Uc as VC,Ud as xT,Ue as YT,Uf as WS,Ug as ui,Uh as $E,Ui as hw,Uj as bs,Uk as ba,Ul as yA,Um as ZA,Un as Tc,V as zb,Va as tC,Vb as yt,Vd as NT,Ve as JT,Vf as XS,Vg as pi,Vh as FE,Vi as gw,Vj as Cs,Vk as Ca,Vl as bA,Vm as QA,Vn as Sc,W as Vb,Wa as rC,Wb as gC,Wd as dn,We as ZT,Wf as YS,Wg as mi,Wh as GE,Wi as yw,Wj as Ts,Wk as Ta,Wl as CA,Wm as ev,Wn as Ec,X as Hb,Xa as oC,Xd as ln,Xe as QT,Xf as JS,Xg as fi,Xi as ji,Xj as Ss,Xk as Sa,Xl as TA,Xm as tv,Xn as wc,Ya as nC,Yb as yC,Yd as un,Ye as eS,Yf as ZS,Yg as _i,Yh as UE,Yi as Bi,Yj as Es,Yk as Ea,Yl as SA,Ym as rv,Yn as Ac,Zd as pn,Ze as tS,Zf as QS,Zg as hi,Zj as ws,Zk as wa,Zl as EA,Zm as ov,Zn as vc,_a as Ho,_c as bt,_d as mn,_e as rS,_f as eE,_g as gi,_h as jE,_i as qi,_j as As,_k as Aa,_l as wA,_m as nv,_n as Oc,ab as Ne,ad as sn,ae as _n,af as nS,ag as rE,ah as bi,ai as qE,ak as Os,al as Oa,an as sv,ao as Ic,b as vo,bb as iC,bd as an,be as Le,bf as iS,bg as oE,bh as Ci,bi as zE,bj as Cw,bk as Rs,bl as Ra,bm as vA,bn as av,bo as Pc,c as Oo,ca as Kb,cb as sC,cd as cn,ce as De,cf as Tt,ch as Ti,ci as VE,cj as Tw,ck as Is,cl as Ia,cm as OA,cn as Ot,co as Mc,d as Ro,db as Wo,de as hn,dh as Si,di as HE,dj as Sw,dk as Ps,dl as Pa,dm as RA,dn as cv,do as kc,e as Io,eb as Xo,ed as HC,ee as gn,ef as St,eh as Ei,ei as KE,ek as Ms,em as IA,eo as xc,f as Pe,fa as Wb,fd as KC,fe as yn,ff as qn,fh as wi,fi as WE,fj as Ew,fk as ks,fl as Ue,fm as PA,fo as Nc,g as Po,gb as Yo,gd as WC,ge as bn,gf as zn,gh as Ai,gi as XE,gk as xs,gl as Q,gn as dv,go as Lc,h as N,hd as XC,he as Cn,hf as Et,hg as nE,hh as hE,hj as Dw,hk as Ns,hl as Ma,hm as MA,hn as lv,ho as Dc,i as Me,ia as Xb,ic as bC,id as YC,ie as Tn,ih as gE,ij as $w,ik as Ls,il as qa,in as uv,j as Mo,jc as CC,jd as JC,je as Sn,jf as sS,jh as vi,jj as Fw,jk as Ds,jl as za,jm as kA,jn as pv,jo as Rv,k as ko,kc as TC,kd as ZC,ke as En,kg as Xn,kh as yE,ki as YE,kj as Fe,kk as $s,kl as Va,km as xA,kn as mv,ko as Iv,l as xo,ld as QC,le as wn,lf as aS,lg as iE,lh as Oi,lj as Gw,lk as Fs,ll as Ha,lm as NA,ln as fv,m as No,ma as Yb,mc as SC,md as eT,me as An,mf as $e,mg as Yn,mh as Ri,mi as JE,mj as Uw,mk as Gs,ml as Ka,mm as LA,mn as _v,n as Rb,na as ue,nc as EC,nd as tT,ne as vn,nf as cS,nh as Ii,nj as jw,nk as Us,nl as Wa,nm as DA,nn as hv,no as Pv,o as ke,oa as Jb,od as rT,oe as On,of as dS,og as sE,oh as Pi,oi as ZE,oj as At,ok as js,ol as Xa,on as ic,oo as Mv,p as ht,pa as b,pc as wC,pd as oT,pe as Rn,pf as lS,pg as aE,pi as xi,pj as Ge,pk as Bs,pl as Ya,pn as sc,po as kv,q as Ib,qa as Fo,qc as Qo,qd as nT,qe as In,qf as uS,qg as cE,qi as QE,qj as Bw,qk as qs,ql as Ja,qn as ac,qo as xv,r as Pb,ra as Go,rd as iT,re as Pn,rf as pS,rg as Jn,rj as qw,rk as zs,rl as Yw,rn as cc,ro as Nv,s as Mb,sa as Uo,sc as en,sd as sT,se as Mn,sf as mS,sg as Zn,si as ew,sj as zw,sk as Vs,sl as Jw,sn as dc,so as Lv,t as kb,tb as Jo,tc as tn,td as aT,te as kn,tf as fS,tg as Qn,ti as tw,tj as Vw,tk as Hs,tl as Zw,tn as lc,to as Dv,u as q,ub as Zo,ud as cT,ue as xn,uf as _S,ug as ei,ui as rw,uj as Hw,uk as Ks,ul as Qw,uo as $c,v as xb,vb as aC,vd as dT,ve as Nn,vf as hS,vg as ti,vh as bE,vi as ow,vj as Kw,vk as Ws,vl as eA,vn as uc,vo as Fc,wa as jo,wc as AC,wd as lT,we as Ln,wf as gS,wg as ri,wh as CE,wi as nw,wj as Yi,wk as Xs,wl as tA,wn as pc,wo as Gc,x as Lo,xc as vC,xd as uT,xe as Dn,xf as yS,xg as oi,xh as TE,xj as Ji,xk as Ys,xl as rA,xm as $A,xn as mc,xo as Uc,y as gt,ya as Bo,yc as OC,yd as pT,ye as $n,yf as bS,yg as dE,yh as SE,yi as $i,yj as Zi,yk as Js,ym as FA,yn as fc,yo as jc,z as le,za as qo,zc as RC,zd as mT,ze as Fn,zf as CS,zg as lE,zh as EE,zi as Fi,zj as Qi,zk as Zs,zl as oA,zm as GA,zn as _c,zo as Bc}from"./chunks/chunk-R7ULWMBG.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 z="2026-07-28",Jk=["2025-11-25","2025-06-18"],Ke=[z],m={headerMismatch:-32020,missingRequiredClientCapability:-32021,unsupportedProtocolVersion:-32022,invalidParams:-32602},w={clientCapabilities:"io.modelcontextprotocol/clientCapabilities",clientInfo:"io.modelcontextprotocol/clientInfo",logLevel:"io.modelcontextprotocol/logLevel",protocolVersion:"io.modelcontextprotocol/protocolVersion",serverInfo:"io.modelcontextprotocol/serverInfo"},er=["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 kh(e){if(e===void 0)return;if(!_(e))throw new p("Invalid MCP clientInfo metadata",m.invalidParams,{field:w.clientInfo,expected:"object"});let t=typeof e.name=="string"?e.name.trim():"",r=typeof e.version=="string"?e.version.trim():"";if(t.length===0||r.length===0)throw new p("Invalid MCP clientInfo metadata",m.invalidParams,{field:w.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 xh(e){if(e!==void 0){if(typeof e!="string"||!er.includes(e))throw new p("Invalid MCP logLevel metadata",m.invalidParams,{field:w.logLevel,allowed:[...er]});return e}}function We(e){let t=_(e)?e._meta:void 0;if(!_(t))throw new p("Missing required MCP request metadata",m.invalidParams,{required:[w.protocolVersion,w.clientCapabilities]});let r=t[w.protocolVersion];if(typeof r!="string"||!Ke.includes(r))throw new p("Unsupported protocol version",m.unsupportedProtocolVersion,{supported:[...Ke],requested:typeof r=="string"?r:null});let o=t[w.clientCapabilities];if(!_(o))throw new p("Invalid MCP client capabilities metadata",m.invalidParams,{field:w.clientCapabilities,expected:"object"});let n=kh(t[w.clientInfo]),i=xh(t[w.logLevel]);return{protocolVersion:z,clientCapabilities:o,...n?{clientInfo:n}:{},...i?{logLevel:i}:{}}}function Zk(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 Qk(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 ex(e,t){let r=e.clientCapabilities.extensions;return _(r)&&_(r[t])}function Xe(e,t){let r=_(e._meta)?e._meta:{};return{...e,_meta:{...r,[w.serverInfo]:{...t}}}}function Nh(e,t){return Xe({...e,resultType:"complete"},t)}function tx(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 Nh({supportedVersions:[...Ke],capabilities:structuredClone(e.capabilities),ttlMs:t,cacheScope:"public",...e.instructions?{instructions:e.instructions}:{}},e.serverInfo)}function rx(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 or,createHmac as nr,timingSafeEqual as Lh}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 Dh=["elicitation/create","roots/list","sampling/createMessage"],tr=class extends Error{inputRequests;requestState;constructor(t){super("MCP operation requires additional input"),this.name="PmMcpInputRequiredError",this.inputRequests=t.inputRequests,this.requestState=t.requestState}},ir=/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/u,fe=32,Je=64*1024,_e=16*1024,Ye={maxBytes:256*1024,maxDepth:32,maxNodes:4096};function $h(e){return e==="elicitation/create"?"elicitation":e==="sampling/createMessage"?"sampling":"roots"}function he(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 Ze(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>fe)throw new p("Invalid MCP inputRequests count",m.invalidParams,{minimum:1,maximum:fe,observed:r.length});let o={};for(let[n,i]of r){if(!ir.test(n)||!_(i))throw new p("Invalid MCP input request entry",m.invalidParams,{field:`inputRequests.${n}`});let s=i.method;if(typeof s!="string"||!Dh.includes(s))throw new p("Unsupported MCP input request method",m.invalidParams,{field:`inputRequests.${n}.method`,method:s??null});let a=$h(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 he(o,Je,"inputRequests"),o}function sr(e){if(!_(e))throw new p("Invalid MCP inputResponses",m.invalidParams,{field:"inputResponses",expected:"object"});let t=Object.entries(e);if(t.length>fe)throw new p("Invalid MCP inputResponses count",m.invalidParams,{maximum:fe,observed:t.length});let r={};for(let[o,n]of t){if(!ir.test(o)||!_(n))throw new p("Invalid MCP input response entry",m.invalidParams,{field:`inputResponses.${o}`});r[o]=structuredClone(n)}return he(r,Je,"inputResponses"),r}function sx(e){let t=e.requestState?.trim();if(t&&Buffer.byteLength(t,"utf8")>_e)throw new p("Invalid MCP requestState: payload exceeds the protocol bound",m.invalidParams,{field:"requestState",maximumBytes:_e});let r=e.inputRequests===void 0?void 0:Ze(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:{[w.serverInfo]:{...e.serverInfo}}}}function ar(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 ax(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>_e/2)throw new p("MCP requestState payload exceeds the protocol bound",m.invalidParams,{maximumBytes:_e/2});let o=r.toString("base64url"),n=nr("sha256",ar(t)).update(o).digest("base64url");return`${o}.${n}`}function Fh(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 cx(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=nr("sha256",ar(t)).update(o).digest();if(s.byteLength!==a.byteLength||!Lh(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=Fh(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 dx(e){return he(e,Je,"request parameters"),or("sha256").update(JSON.stringify(e)).digest("hex")}var rr=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=or("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 Gh(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 lx(e,t){return{...e,...Gh(t)}}function Uh(e){return e.replaceAll("~1","/").replaceAll("~0","~")}function jh(e,t){if(t==="#")return e;if(!t.startsWith("#/"))return;let r=e;for(let o of t.slice(2).split("/").map(Uh)){if(!_(r)&&!Array.isArray(r)||!Object.prototype.hasOwnProperty.call(r,o))return;r=r[o]}return r}function Bh(e){let t=e.maxBytes??Ye.maxBytes,r=e.maxDepth??Ye.maxDepth,o=e.maxNodes??Ye.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 qh(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("#")&&jh(e,r)===void 0)throw new p("MCP JSON Schema contains an unresolved local reference",m.invalidParams,{reference:r})}function ux(e,t={}){let{maximumBytes:r,maximumDepth:o,maximumNodes:n}=Bh(t);if(typeof e!="boolean"&&!_(e))throw new p("Invalid MCP JSON Schema root",m.invalidParams,{expected:"object or boolean"});he(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),qh(a,i)}return structuredClone(e)}import{randomUUID as Vh}from"node:crypto";import{readFile as Hh}from"node:fs/promises";import cr 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 bx="io.modelcontextprotocol/tasks",Kh=["working","input_required","completed","failed","cancelled"],Wh=/^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,Xh=3600*1e3,Yh=1e3,ye=1024,Jh=30,Zh=2e3;function Qe(e){return new p(e,m.invalidParams,{code:"mcp_task_not_found_or_not_authorized"})}function ge(e){let t=e.trim();if(!Wh.test(t))throw Qe("Unknown MCP task");return t}function dr(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 lr(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,ye),..._(e.data)?{data:structuredClone(e.data)}:{}}}function Qh(e){if(!Kh.includes(e))throw new p("Corrupt MCP task record",m.invalidParams);return e}function eg(e){if(typeof e!="string"||e.length===0)throw new p("Corrupt MCP task record",m.invalidParams);return e}function tg(e){if(typeof e!="number"||!Number.isSafeInteger(e)||e<1)throw new p("Corrupt MCP task record",m.invalidParams);return e}function rg(e){if(e!==null&&(typeof e!="number"||!Number.isSafeInteger(e)||e<0))throw new p("Corrupt MCP task record",m.invalidParams);return e}function og(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 ng(e){if(!Array.isArray(e)||e.some(t=>typeof t!="string"))throw new p("Corrupt MCP task record",m.invalidParams);return[...e]}function ig(e){if(!_(e)||e.version!==1)throw new p("Corrupt MCP task record",m.invalidParams);let t=typeof e.taskId=="string"?ge(e.taskId):"",r=Qh(e.status),o=eg(e.principal),n=tg(e.workerPid),i=rg(e.ttlMs),s=og(e.pollIntervalMs),a={version:1,taskId:t,status:r,principal:o,workerPid:n,createdAt:dr(e.createdAt,"createdAt"),lastUpdatedAt:dr(e.lastUpdatedAt,"lastUpdatedAt"),ttlMs:i,consumedInputKeys:ng(e.consumedInputKeys),...typeof e.statusMessage=="string"?{statusMessage:e.statusMessage.slice(0,ye)}:{},...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=lr(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 V(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 te(e){return e==="completed"||e==="failed"||e==="cancelled"}function sg(e){try{return process.kill(e,0),!0}catch(t){return!(typeof t=="object"&&t!==null&&"code"in t&&t.code==="ESRCH")}}var et=class{#e;#t;#r;#o;#i;constructor(t){this.#e=cr.resolve(t.pmRoot),this.#t=t.owner?.trim()||"pm-mcp",this.#r=t.now??(()=>new Date),this.#o=t.taskIdFactory??(()=>`mcp-task-${Vh()}`),this.#i=t.workerPid??process.pid}#s(t){return cr.join(this.#e,"runtime","mcp-tasks","records",`${ge(t)}.json`)}async#c(t){try{return ig(JSON.parse(await Hh(this.#s(t),"utf8")))}catch(r){throw le(r)||r instanceof SyntaxError?Qe("Unknown MCP task"):r}}async#a(t){await xe(this.#s(t.taskId),`${JSON.stringify(t,null,2)}
1
+ import{A as LM,B as DM,C as $M,D as FM,E as GM,a as Vn,b as US,c as jS,d as BS,e as qS,f as zS,g as Ww,h as Xw,i as ka,j as xa,k as Na,m as La,n as Da,o as $a,p as Fa,q as Ga,r as Ua,s as ja,t as Ba,u as Za,v as Qa,w as ec,x as tc,y as rc,z as NM}from"./chunks/chunk-H7CXQBGQ.js";import{A as vk,B as Ok,C as Rk,D as Ik,E as Pk,F as Mk,G as kk,H as xk,I as Nk,J as Lk,K as Dk,L as $k,M as Fk,N as Gk,O as Uk,P as jk,Q as Bk,R as qk,S as zk,T as Vk,U as Hk,V as Kk,W as Wk,X as Xk,Y as Yk,a as ek,b as tk,c as rk,d as ok,e as nk,f as ik,g as sk,h as ak,i as ck,j as dk,k as lk,l as uk,m as pk,n as mk,o as fk,p as _k,q as hk,r as gk,s as yk,t as bk,u as Ck,v as Tk,w as Sk,x as Ek,y as wk,z as Ak}from"./chunks/chunk-6Z4IV2MC.js";import{a as Mh}from"./chunks/chunk-6ST3SCQ6.js";import{a as UM,b as jM,c as BM,d as qM}from"./chunks/chunk-44UGMMQ6.js";import{a as zM,b as VM,c as HM,d as KM,e as WM,f as XM,g as YM,h as JM,i as ZM,j as QM}from"./chunks/chunk-YCBGZF3T.js";import{$ as mm,$a as n_,$b as nh,A as Ve,Aa as vf,Ab as M_,B as Qp,Ba as Of,Bb as k_,C as em,Ca as Rf,Cb as x_,D as tm,Da as If,Db as N_,E as rm,Ea as Pf,Eb as L_,F as om,Fa as Mf,Fb as D_,G as Bt,Ga as kf,Gb as $_,H as qt,Ha as xf,Hb as F_,I as zt,Ia as Nf,Ib as G_,J as Vt,Ja as Lf,Jb as U_,K as Ht,Ka as Df,Kb as j_,L as Kt,La as $f,Lb as B_,M as Wt,Ma as Ff,Mb as q_,N as Xt,Na as Gf,Nb as z_,O as Yt,Oa as Uf,Ob as V_,P as Jt,Pa as jf,Pb as H_,Q as Zt,Qa as Bf,Qb as K_,R as nm,Ra as qf,Rb as W_,S as im,Sa as zf,Sb as X_,T as sm,Ta as Vf,Tb as Y_,U as am,Ua as Hf,Ub as J_,V as cm,Va as Qt,Vb as Z_,W as He,Wa as me,Wb as Q_,X as dm,Xa as e_,Xb as eh,Y as lm,Ya as t_,Yb as th,Z as um,Za as r_,Zb as rh,_ as pm,_a as o_,_b as oh,a as NS,aa as fm,ab as i_,ac as ih,b as LS,ba as _m,bb as s_,bc as sh,c as DS,ca as hm,cb as a_,cc as ah,d as $S,da as _M,db as c_,dc as ch,e as FS,ea as hM,eb as d_,ec as dh,f as GS,fa as gM,fb as l_,fc as lh,g as Ni,ga as Im,gb as u_,gc as uh,h as Li,ha as Pm,hb as p_,hc as ph,i as Di,ia as Mm,ib as m_,ic as mh,j as Ow,ja as gf,jb as f_,jc as fh,k as Rw,ka as yf,kb as __,kc as _h,l as zi,la as vM,lb as h_,lc as hh,m as RR,ma as OM,mb as g_,mc as gh,n as IR,na as RM,nb as y_,nc as yh,o as PR,oa as IM,ob as b_,oc as bh,p as MR,pa as PM,pb as C_,pc as Ch,q as kR,qa as MM,qb as T_,qc as Th,r as xR,ra as kM,rb as S_,rc as Sh,s as pl,sa as xM,sb as E_,sc as Eh,t as Bu,ta as bf,tb as w_,tc as wh,u as qu,ua as Cf,ub as A_,uc as Ah,v as Ku,va as Tf,vb as v_,vc as vh,w as Wu,wa as Sf,wb as O_,wc as Oh,x as pp,xa as Ef,xb as R_,xc as Rh,y as bp,ya as wf,yb as I_,yc as Ih,z as oP,za as Af,zb as P_,zc as Ph}from"./chunks/chunk-5XKF5SQV.js";import{e as DR,f as $R,g as ml,h as fl,i as Gt}from"./chunks/chunk-YDWKGUQU.js";import{A as nM,B as iM,C as sM,D as aM,E as cM,F as dM,G as lM,H as uM,I as pM,J as mM,K as fM,L as bm,M as Cm,N as Tm,O as Sm,P as Em,Q as wm,R as Am,S as vm,T as Om,U as Rm,a as UI,b as jI,c as BI,d as qI,e as zI,f as ju,g as VI,h as HI,i as KI,j as WI,k as XI,m as Hu,n as gm,o as KP,p as WP,q as XP,r as YP,s as JP,t as ZP,u as ym,v as QP,w as eM,x as tM,y as rM,z as oM}from"./chunks/chunk-3AF2R3Y6.js";import{$ as eR,$a as El,$b as xu,$c as Yp,A as IO,Ab as BR,Ac as Qu,Ad as Qm,B as PO,Bb as qR,Bc as ep,Bd as ef,C as MO,Cb as zR,Cc as tp,Cd as tf,D as kO,Db as VR,Dc as rp,Dd as rf,E as xO,Eb as HR,Ec as op,Ed as of,F as ze,Fa as Yd,Fb as KR,Fc as np,Fd as nf,G as NO,Ga as Jd,Gb as mI,Gc as ip,Gd as sf,H as xt,Ha as Zd,Hb as fI,Hc as sp,Hd as af,I as LO,Ia as Qd,Ib as _I,Ic as ap,J as DO,Ja as el,Jb as hI,Jc as cp,Jd as cf,K as $O,Kb as gI,Kc as dp,Kd as df,L as FO,La as tl,Lb as yI,Lc as lp,Ld as lf,M as GO,Ma as rl,Mb as bI,Md as uf,N as UO,Na as ol,Nb as AI,Nc as tP,Nd as pf,O as jO,Oa as nl,Ob as vI,Oc as rP,Od as mf,P as BO,Pa as NR,Pb as vu,Pc as up,Pd as ff,Q as qO,Qa as LR,Qb as Ou,Qc as Cp,Qd as _f,R as zO,Ra as il,Rb as OI,Rd as hf,S as VO,Sa as sl,Sb as RI,Sd as Kf,T as HO,Ta as al,Tb as II,Td as Wf,U as KO,Ua as cl,Ub as PI,Uc as Tp,Ud as Xf,V as WO,Va as dl,Vb as MI,Vd as Yf,W as XO,Wa as ll,Wb as Ru,Wc as Sp,Wd as Jf,X as YO,Xa as ul,Xb as Iu,Xc as Hp,Xd as Zf,Y as JO,Ya as Cl,Yb as Pu,Yc as Kp,Yd as Qf,Z as ZO,Za as Tl,Zb as Mu,Zc as Wp,_ as QO,_a as Sl,_b as ku,_c as Xp,a as CO,aa as tR,ab as wl,ac as Nu,ad as Jp,b as Pt,ba as rR,bb as Al,bc as Lu,bd as Zp,c as TO,ca as oR,cb as vl,cc as Du,cd as km,d as Be,da as nR,db as Ol,dc as $u,dd as xm,e as ee,ea as iR,eb as Rl,ec as Fu,ed as Nm,f as pd,fa as sR,fb as Il,fc as Gu,fd as Lm,gb as Pl,gc as kI,gd as Dm,hb as Ml,hc as xI,hd as $m,i as qe,ib as kl,ic as NI,id as Fm,j as md,jb as xl,jc as LI,jd as Gm,k as fd,kb as Nl,kc as DI,kd as Um,lb as Ll,lc as $I,ld as EM,m as pe,ma as Xd,mb as Dl,mc as FI,md as wM,n as _d,nb as $l,nc as GI,nd as AM,o as hd,ob as GR,oc as Uu,od as jm,p as gd,pb as Fl,pc as YI,pd as Bm,q as yd,qb as Gl,qc as JI,qd as qm,r as SO,rb as Ul,rc as ZI,rd as zm,s as EO,sb as jl,sc as QI,sd as Vm,t as wO,tb as UR,tc as eP,td as Hm,u as AO,ub as Bl,uc as zu,ud as Km,v as vO,vb as ql,vc as Vu,vd as Wm,w as Mt,wb as zl,wc as Xu,wd as Xm,x as OO,xb as Vl,xc as Yu,xd as Ym,y as RO,yb as Hl,yc as Ju,yd as Jm,z as kt,zb as jR,zc as Zu,zd as Zm}from"./chunks/chunk-FW5LJXQY.js";import{$ as kd,$a as Bd,A as bR,B as CR,C as TR,D as Ed,E as wd,F as Ad,G as vd,H as Od,I as SR,J as Rd,K as Id,Ka as Lt,L as Pd,La as Dt,Ma as $t,Na as Ft,Oa as Ld,Qa as Dd,Ra as $d,Sa as Fd,U as ER,V as wR,X as AR,Xa as Gd,Y as vR,Ya as Ud,Z as OR,_ as Md,_a as jd,a as xw,aa as xd,ab as qd,b as Nw,ba as Nd,bb as zd,c as Lw,ca as Nt,cb as Vd,d as Vi,e as Hi,eb as Hd,f as Ki,fb as Kd,g as Wi,gb as Wd,h as Xi,j as bd,k as Cd,m as Td,n as Sd,o as aR,p as cR,q as dR,r as lR,s as uR,t as pR,u as mR,v as fR,w as _R,x as hR,y as gR,z as yR}from"./chunks/chunk-KP7NBQK3.js";import{$ as cO,$a as Au,$b as mP,$c as yM,Aa as Zl,Ac as UP,Ba as Ql,Bb as CI,Bc as jP,Ca as eu,Cb as TI,Cc as BP,Da as tu,Db as SI,Dc as Ut,Ea as ru,Eb as EI,Ec as Rp,Fa as ou,Fb as wI,Fc as Ip,G as Qv,Ga as nu,Gb as mp,Gc as Pp,H as eO,Ha as iu,Hb as fp,Hc as Mp,I as tO,Ia as su,Ib as _p,Ic as kp,J as rO,Ja as au,Jb as hp,Jc as xp,K as oO,Ka as cu,Kb as gp,Kc as Np,L as nO,La as du,Lb as yp,Lc as Lp,M as iO,Ma as lu,Mb as Ep,Mc as Dp,N as sO,Na as uu,Nb as wp,Nc as $p,O as ed,Oa as pu,Ob as Ap,Oc as Fp,P as td,Pa as mu,Pb as vp,Pc as Gp,Q as rd,Qa as fu,Qb as nP,Qc as Up,R as od,Ra as _u,Rb as iP,Rc as jp,S as nd,Sa as hu,Sb as sP,Sc as Bp,T as id,Ta as gu,Tb as aP,Tc as qp,U as sd,Ua as yu,Ub as cP,Uc as jt,V as ad,Va as bu,Vb as dP,Vc as zp,W as cd,Wa as Cu,Wb as lP,Wc as qP,X as dd,Xa as Tu,Xc as zP,Y as ld,Ya as Su,Yb as Op,Yc as VP,Z as je,Za as Eu,Zb as uP,Zc as Vp,_ as aO,_a as wu,_b as pP,_c as HP,aa as dO,ac as fP,ad as bM,b as ww,ba as lO,bc as _P,bd as CM,c as Aw,ca as uO,cb as WR,cc as hP,cd as TM,d as vw,da as pO,db as XR,dc as gP,dd as SM,e as Iw,eb as YR,ec as yP,f as Pw,fb as JR,fc as bP,g as Mw,ga as mO,gb as ZR,gc as CP,h as kw,ha as fO,hb as QR,hc as TP,i as $v,ia as _O,ib as eI,ic as SP,j as Fv,ja as hO,jb as tI,jc as EP,k as Gv,ka as gO,kb as rI,kc as wP,l as Uv,la as yO,lb as oI,lc as AP,m as jv,ma as bO,mb as nI,mc as vP,n as Bv,na as ud,nb as iI,nc as OP,o as qv,oa as _l,ob as sI,oc as RP,p as zv,pa as hl,pc as IP,q as Vv,qa as gl,qc as PP,r as Hv,ra as yl,rc as MP,s as Kv,sa as FR,sb as aI,sc as kP,t as Wv,tc as xP,u as Xv,ua as bl,ub as cI,uc as NP,v as Yv,va as Kl,vb as dI,vc as LP,w as Jv,wa as Wl,wc as DP,x as Zv,xa as Xl,xb as lI,xc as $P,ya as Yl,yb as uI,yc as FP,za as Jl,zb as pI,zc as GP}from"./chunks/chunk-MKXBCBAN.js";import{$a as Ko,$c as Ct,$d as fn,$e as oS,$f as tE,$g as yi,$h as BE,$i as bw,$j as vs,$k as va,$l as AA,$m as iv,$n as Rc,A as Do,Aa as zo,Ac as IC,Ad as fT,Ae as Gn,Af as TS,Ah as wE,Ai as Gi,Aj as es,Ak as Qs,Al as nA,Am as UA,An as hc,Ao as qc,Bc as PC,Bd as _T,Be as Un,Bf as SS,Bg as ni,Bh as AE,Bj as ts,Bk as ea,Bm as jA,Bn as gc,Bo as zc,C as xe,Cc as MC,Cd as hT,Ce as jn,Cf as ES,Cg as ii,Ch as vE,Cj as rs,Ck as ta,Cm as BA,Cn as yc,Co as Vc,D as $o,Dc as rn,Dd as gT,De as Bn,Df as wS,Dg as uE,Dh as OE,Di as iw,Dj as os,Dk as ra,Dl as oc,Dm as qA,Dn as gv,Do as Hc,Ec as kC,Ed as yT,Ee as LT,Ef as AS,Eg as si,Eh as RE,Ej as ns,Ek as oa,El as iA,Em as zA,En as yv,Eo as Kc,F as Nb,Fc as xC,Fd as bT,Fe as DT,Ff as vS,Fg as ai,Fh as IE,Fj as is,Fk as na,Fl as sA,Fm as VA,Fn as bv,Fo as Wc,G as Lb,Gb as cC,Gc as NC,Gd as CT,Ge as $T,Gf as OS,Gg as pE,Gh as PE,Gj as ss,Gk as ia,Gl as aA,Gm as vt,Gn as Cv,Go as Xc,H as Db,Hc as LC,Hd as TT,He as FT,Hf as RS,Hg as ci,Hh as ME,Hi as Ui,Hj as as,Hk as sa,Hl as cA,Hn as Tv,Ho as Yc,I as $b,Ib as dC,Ic as DC,Id as ST,Ie as GT,If as IS,Ig as di,Ii as wt,Ij as cs,Ik as aa,Il as dA,Im as HA,In as Sv,Io as Jc,J as Fb,Jb as lC,Jc as $C,Jd as ET,Je as UT,Jf as PS,Jg as L,Jh as kE,Ji as sw,Jj as ds,Jk as ca,Jl as lA,Jn as Ev,Jo as Zc,K as Gb,Kb as uC,Kc as FC,Ke as jT,Kf as MS,Kg as li,Kh as Mi,Ki as aw,Kj as ls,Kk as da,Km as KA,Kn as wv,Ko as Qc,Lb as pC,Lc as GC,Ld as wT,Le as BT,Lh as ki,Li as cw,Lj as us,Lk as la,Ll as uA,Lo as It,M as Ub,Mb as mC,Mc as on,Md as AT,Me as qT,Mf as kS,Mh as xE,Mi as dw,Mj as ps,Mk as ua,Ml as pA,N as jb,Nc as UC,Nd as vT,Ne as zT,Nf as xS,Ni as lw,Nk as pa,Nl as mA,Oc as nn,Od as OT,Of as Hn,Oi as uw,Oj as ms,Ok as ma,Ol as fA,Om as WA,On as Rt,Pa as Zb,Pb as fC,Pd as RT,Pe as VT,Pf as Kn,Pi as pw,Pj as fs,Pk as fa,Pm as XA,Pn as Av,Q as Bb,Qa as Qb,Qb as _C,Qc as jC,Qd as IT,Qe as HT,Qf as Wn,Qi as mw,Qj as _s,Qk as _a,Ql as _A,Qm as YA,Qn as vv,Ra as eC,Rc as BC,Rd as PT,Re as KT,Rf as VS,Rg as mE,Rh as NE,Ri as fw,Rj as hs,Rk as ha,Rl as hA,Rm as nc,Rn as Ov,Sc as qC,Sd as MT,Se as WT,Sf as HS,Sg as fE,Sh as LE,Sj as gs,Sk as ga,Sm as JA,Sn as bc,T as qb,Tb as I,Tc as zC,Td as kT,Te as XT,Tf as KS,Tg as _E,Th as DE,Ti as _w,Tj as ys,Tk as ya,Tl as gA,Tn as Cc,Ua as Vo,Ub as hC,Uc as VC,Ud as xT,Ue as YT,Uf as WS,Ug as ui,Uh as $E,Ui as hw,Uj as bs,Uk as ba,Ul as yA,Um as ZA,Un as Tc,V as zb,Va as tC,Vb as yt,Vd as NT,Ve as JT,Vf as XS,Vg as pi,Vh as FE,Vi as gw,Vj as Cs,Vk as Ca,Vl as bA,Vm as QA,Vn as Sc,W as Vb,Wa as rC,Wb as gC,Wd as dn,We as ZT,Wf as YS,Wg as mi,Wh as GE,Wi as yw,Wj as Ts,Wk as Ta,Wl as CA,Wm as ev,Wn as Ec,X as Hb,Xa as oC,Xd as ln,Xe as QT,Xf as JS,Xg as fi,Xi as ji,Xj as Ss,Xk as Sa,Xl as TA,Xm as tv,Xn as wc,Ya as nC,Yb as yC,Yd as un,Ye as eS,Yf as ZS,Yg as _i,Yh as UE,Yi as Bi,Yj as Es,Yk as Ea,Yl as SA,Ym as rv,Yn as Ac,Zd as pn,Ze as tS,Zf as QS,Zg as hi,Zj as ws,Zk as wa,Zl as EA,Zm as ov,Zn as vc,_a as Ho,_c as bt,_d as mn,_e as rS,_f as eE,_g as gi,_h as jE,_i as qi,_j as As,_k as Aa,_l as wA,_m as nv,_n as Oc,ab as Ne,ad as sn,ae as _n,af as nS,ag as rE,ah as bi,ai as qE,ak as Os,al as Oa,an as sv,ao as Ic,b as vo,bb as iC,bd as an,be as Le,bf as iS,bg as oE,bh as Ci,bi as zE,bj as Cw,bk as Rs,bl as Ra,bm as vA,bn as av,bo as Pc,c as Oo,ca as Kb,cb as sC,cd as cn,ce as De,cf as Tt,ch as Ti,ci as VE,cj as Tw,ck as Is,cl as Ia,cm as OA,cn as Ot,co as Mc,d as Ro,db as Wo,de as hn,dh as Si,di as HE,dj as Sw,dk as Ps,dl as Pa,dm as RA,dn as cv,do as kc,e as Io,eb as Xo,ed as HC,ee as gn,ef as St,eh as Ei,ei as KE,ek as Ms,em as IA,eo as xc,f as Pe,fa as Wb,fd as KC,fe as yn,ff as qn,fh as wi,fi as WE,fj as Ew,fk as ks,fl as Ue,fm as PA,fo as Nc,g as Po,gb as Yo,gd as WC,ge as bn,gf as zn,gh as Ai,gi as XE,gk as xs,gl as Q,gn as dv,go as Lc,h as N,hd as XC,he as Cn,hf as Et,hg as nE,hh as hE,hj as Dw,hk as Ns,hl as Ma,hm as MA,hn as lv,ho as Dc,i as Me,ia as Xb,ic as bC,id as YC,ie as Tn,ih as gE,ij as $w,ik as Ls,il as qa,in as uv,j as Mo,jc as CC,jd as JC,je as Sn,jf as sS,jh as vi,jj as Fw,jk as Ds,jl as za,jm as kA,jn as pv,jo as Rv,k as ko,kc as TC,kd as ZC,ke as En,kg as Xn,kh as yE,ki as YE,kj as Fe,kk as $s,kl as Va,km as xA,kn as mv,ko as Iv,l as xo,ld as QC,le as wn,lf as aS,lg as iE,lh as Oi,lj as Gw,lk as Fs,ll as Ha,lm as NA,ln as fv,m as No,ma as Yb,mc as SC,md as eT,me as An,mf as $e,mg as Yn,mh as Ri,mi as JE,mj as Uw,mk as Gs,ml as Ka,mm as LA,mn as _v,n as Rb,na as ue,nc as EC,nd as tT,ne as vn,nf as cS,nh as Ii,nj as jw,nk as Us,nl as Wa,nm as DA,nn as hv,no as Pv,o as ke,oa as Jb,od as rT,oe as On,of as dS,og as sE,oh as Pi,oi as ZE,oj as At,ok as js,ol as Xa,on as ic,oo as Mv,p as ht,pa as b,pc as wC,pd as oT,pe as Rn,pf as lS,pg as aE,pi as xi,pj as Ge,pk as Bs,pl as Ya,pn as sc,po as kv,q as Ib,qa as Fo,qc as Qo,qd as nT,qe as In,qf as uS,qg as cE,qi as QE,qj as Bw,qk as qs,ql as Ja,qn as ac,qo as xv,r as Pb,ra as Go,rd as iT,re as Pn,rf as pS,rg as Jn,rj as qw,rk as zs,rl as Yw,rn as cc,ro as Nv,s as Mb,sa as Uo,sc as en,sd as sT,se as Mn,sf as mS,sg as Zn,si as ew,sj as zw,sk as Vs,sl as Jw,sn as dc,so as Lv,t as kb,tb as Jo,tc as tn,td as aT,te as kn,tf as fS,tg as Qn,ti as tw,tj as Vw,tk as Hs,tl as Zw,tn as lc,to as Dv,u as q,ub as Zo,ud as cT,ue as xn,uf as _S,ug as ei,ui as rw,uj as Hw,uk as Ks,ul as Qw,uo as $c,v as xb,vb as aC,vd as dT,ve as Nn,vf as hS,vg as ti,vh as bE,vi as ow,vj as Kw,vk as Ws,vl as eA,vn as uc,vo as Fc,wa as jo,wc as AC,wd as lT,we as Ln,wf as gS,wg as ri,wh as CE,wi as nw,wj as Yi,wk as Xs,wl as tA,wn as pc,wo as Gc,x as Lo,xc as vC,xd as uT,xe as Dn,xf as yS,xg as oi,xh as TE,xj as Ji,xk as Ys,xl as rA,xm as $A,xn as mc,xo as Uc,y as gt,ya as Bo,yc as OC,yd as pT,ye as $n,yf as bS,yg as dE,yh as SE,yi as $i,yj as Zi,yk as Js,ym as FA,yn as fc,yo as jc,z as le,za as qo,zc as RC,zd as mT,ze as Fn,zf as CS,zg as lE,zh as EE,zi as Fi,zj as Qi,zk as Zs,zl as oA,zm as GA,zn as _c,zo as Bc}from"./chunks/chunk-QPKQKSQU.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 z="2026-07-28",Jk=["2025-11-25","2025-06-18"],Ke=[z],m={headerMismatch:-32020,missingRequiredClientCapability:-32021,unsupportedProtocolVersion:-32022,invalidParams:-32602},w={clientCapabilities:"io.modelcontextprotocol/clientCapabilities",clientInfo:"io.modelcontextprotocol/clientInfo",logLevel:"io.modelcontextprotocol/logLevel",protocolVersion:"io.modelcontextprotocol/protocolVersion",serverInfo:"io.modelcontextprotocol/serverInfo"},er=["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 kh(e){if(e===void 0)return;if(!_(e))throw new p("Invalid MCP clientInfo metadata",m.invalidParams,{field:w.clientInfo,expected:"object"});let t=typeof e.name=="string"?e.name.trim():"",r=typeof e.version=="string"?e.version.trim():"";if(t.length===0||r.length===0)throw new p("Invalid MCP clientInfo metadata",m.invalidParams,{field:w.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 xh(e){if(e!==void 0){if(typeof e!="string"||!er.includes(e))throw new p("Invalid MCP logLevel metadata",m.invalidParams,{field:w.logLevel,allowed:[...er]});return e}}function We(e){let t=_(e)?e._meta:void 0;if(!_(t))throw new p("Missing required MCP request metadata",m.invalidParams,{required:[w.protocolVersion,w.clientCapabilities]});let r=t[w.protocolVersion];if(typeof r!="string"||!Ke.includes(r))throw new p("Unsupported protocol version",m.unsupportedProtocolVersion,{supported:[...Ke],requested:typeof r=="string"?r:null});let o=t[w.clientCapabilities];if(!_(o))throw new p("Invalid MCP client capabilities metadata",m.invalidParams,{field:w.clientCapabilities,expected:"object"});let n=kh(t[w.clientInfo]),i=xh(t[w.logLevel]);return{protocolVersion:z,clientCapabilities:o,...n?{clientInfo:n}:{},...i?{logLevel:i}:{}}}function Zk(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 Qk(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 ex(e,t){let r=e.clientCapabilities.extensions;return _(r)&&_(r[t])}function Xe(e,t){let r=_(e._meta)?e._meta:{};return{...e,_meta:{...r,[w.serverInfo]:{...t}}}}function Nh(e,t){return Xe({...e,resultType:"complete"},t)}function tx(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 Nh({supportedVersions:[...Ke],capabilities:structuredClone(e.capabilities),ttlMs:t,cacheScope:"public",...e.instructions?{instructions:e.instructions}:{}},e.serverInfo)}function rx(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 or,createHmac as nr,timingSafeEqual as Lh}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 Dh=["elicitation/create","roots/list","sampling/createMessage"],tr=class extends Error{inputRequests;requestState;constructor(t){super("MCP operation requires additional input"),this.name="PmMcpInputRequiredError",this.inputRequests=t.inputRequests,this.requestState=t.requestState}},ir=/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/u,fe=32,Je=64*1024,_e=16*1024,Ye={maxBytes:256*1024,maxDepth:32,maxNodes:4096};function $h(e){return e==="elicitation/create"?"elicitation":e==="sampling/createMessage"?"sampling":"roots"}function he(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 Ze(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>fe)throw new p("Invalid MCP inputRequests count",m.invalidParams,{minimum:1,maximum:fe,observed:r.length});let o={};for(let[n,i]of r){if(!ir.test(n)||!_(i))throw new p("Invalid MCP input request entry",m.invalidParams,{field:`inputRequests.${n}`});let s=i.method;if(typeof s!="string"||!Dh.includes(s))throw new p("Unsupported MCP input request method",m.invalidParams,{field:`inputRequests.${n}.method`,method:s??null});let a=$h(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 he(o,Je,"inputRequests"),o}function sr(e){if(!_(e))throw new p("Invalid MCP inputResponses",m.invalidParams,{field:"inputResponses",expected:"object"});let t=Object.entries(e);if(t.length>fe)throw new p("Invalid MCP inputResponses count",m.invalidParams,{maximum:fe,observed:t.length});let r={};for(let[o,n]of t){if(!ir.test(o)||!_(n))throw new p("Invalid MCP input response entry",m.invalidParams,{field:`inputResponses.${o}`});r[o]=structuredClone(n)}return he(r,Je,"inputResponses"),r}function sx(e){let t=e.requestState?.trim();if(t&&Buffer.byteLength(t,"utf8")>_e)throw new p("Invalid MCP requestState: payload exceeds the protocol bound",m.invalidParams,{field:"requestState",maximumBytes:_e});let r=e.inputRequests===void 0?void 0:Ze(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:{[w.serverInfo]:{...e.serverInfo}}}}function ar(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 ax(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>_e/2)throw new p("MCP requestState payload exceeds the protocol bound",m.invalidParams,{maximumBytes:_e/2});let o=r.toString("base64url"),n=nr("sha256",ar(t)).update(o).digest("base64url");return`${o}.${n}`}function Fh(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 cx(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=nr("sha256",ar(t)).update(o).digest();if(s.byteLength!==a.byteLength||!Lh(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=Fh(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 dx(e){return he(e,Je,"request parameters"),or("sha256").update(JSON.stringify(e)).digest("hex")}var rr=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=or("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 Gh(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 lx(e,t){return{...e,...Gh(t)}}function Uh(e){return e.replaceAll("~1","/").replaceAll("~0","~")}function jh(e,t){if(t==="#")return e;if(!t.startsWith("#/"))return;let r=e;for(let o of t.slice(2).split("/").map(Uh)){if(!_(r)&&!Array.isArray(r)||!Object.prototype.hasOwnProperty.call(r,o))return;r=r[o]}return r}function Bh(e){let t=e.maxBytes??Ye.maxBytes,r=e.maxDepth??Ye.maxDepth,o=e.maxNodes??Ye.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 qh(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("#")&&jh(e,r)===void 0)throw new p("MCP JSON Schema contains an unresolved local reference",m.invalidParams,{reference:r})}function ux(e,t={}){let{maximumBytes:r,maximumDepth:o,maximumNodes:n}=Bh(t);if(typeof e!="boolean"&&!_(e))throw new p("Invalid MCP JSON Schema root",m.invalidParams,{expected:"object or boolean"});he(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),qh(a,i)}return structuredClone(e)}import{randomUUID as Vh}from"node:crypto";import{readFile as Hh}from"node:fs/promises";import cr 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 bx="io.modelcontextprotocol/tasks",Kh=["working","input_required","completed","failed","cancelled"],Wh=/^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,Xh=3600*1e3,Yh=1e3,ye=1024,Jh=30,Zh=2e3;function Qe(e){return new p(e,m.invalidParams,{code:"mcp_task_not_found_or_not_authorized"})}function ge(e){let t=e.trim();if(!Wh.test(t))throw Qe("Unknown MCP task");return t}function dr(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 lr(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,ye),..._(e.data)?{data:structuredClone(e.data)}:{}}}function Qh(e){if(!Kh.includes(e))throw new p("Corrupt MCP task record",m.invalidParams);return e}function eg(e){if(typeof e!="string"||e.length===0)throw new p("Corrupt MCP task record",m.invalidParams);return e}function tg(e){if(typeof e!="number"||!Number.isSafeInteger(e)||e<1)throw new p("Corrupt MCP task record",m.invalidParams);return e}function rg(e){if(e!==null&&(typeof e!="number"||!Number.isSafeInteger(e)||e<0))throw new p("Corrupt MCP task record",m.invalidParams);return e}function og(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 ng(e){if(!Array.isArray(e)||e.some(t=>typeof t!="string"))throw new p("Corrupt MCP task record",m.invalidParams);return[...e]}function ig(e){if(!_(e)||e.version!==1)throw new p("Corrupt MCP task record",m.invalidParams);let t=typeof e.taskId=="string"?ge(e.taskId):"",r=Qh(e.status),o=eg(e.principal),n=tg(e.workerPid),i=rg(e.ttlMs),s=og(e.pollIntervalMs),a={version:1,taskId:t,status:r,principal:o,workerPid:n,createdAt:dr(e.createdAt,"createdAt"),lastUpdatedAt:dr(e.lastUpdatedAt,"lastUpdatedAt"),ttlMs:i,consumedInputKeys:ng(e.consumedInputKeys),...typeof e.statusMessage=="string"?{statusMessage:e.statusMessage.slice(0,ye)}:{},...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=lr(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 V(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 te(e){return e==="completed"||e==="failed"||e==="cancelled"}function sg(e){try{return process.kill(e,0),!0}catch(t){return!(typeof t=="object"&&t!==null&&"code"in t&&t.code==="ESRCH")}}var et=class{#e;#t;#r;#o;#i;constructor(t){this.#e=cr.resolve(t.pmRoot),this.#t=t.owner?.trim()||"pm-mcp",this.#r=t.now??(()=>new Date),this.#o=t.taskIdFactory??(()=>`mcp-task-${Vh()}`),this.#i=t.workerPid??process.pid}#s(t){return cr.join(this.#e,"runtime","mcp-tasks","records",`${ge(t)}.json`)}async#c(t){try{return ig(JSON.parse(await Hh(this.#s(t),"utf8")))}catch(r){throw le(r)||r instanceof SyntaxError?Qe("Unknown MCP task"):r}}async#a(t){await xe(this.#s(t.taskId),`${JSON.stringify(t,null,2)}
2
2
  `)}async#n(t,r,o){let n=ge(t),i=await $e(this.#e,n,Jh,this.#t,!1,!1,Zh);try{let s=await this.#c(n);if(s.principal!==r)throw Qe("Unknown MCP task");let a=o(s);return await this.#a(a),a}finally{await i()}}async create(t){let r=ge(this.#o()),o=t.principal.trim(),n=t.ttlMs===void 0?Xh:t.ttlMs,i=t.pollIntervalMs??Yh;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,ye)}:{}};return await this.#a(a),{...V(a),resultType:"task"}}async get(t,r){return V(await this.#n(t,r,o=>{if(te(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&&!sg(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=Ze(t.inputRequests,t.requestContext);return V(await this.#n(t.taskId,t.principal,o=>{if(te(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,ye),lastUpdatedAt:this.#r().toISOString(),inputRequests:r}}))}async update(t,r,o){let n=sr(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 V(await this.#n(t,r,n=>te(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=lr(o);return V(await this.#n(t,r,i=>te(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 V(await this.#n(t,r,o=>te(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 Cx(e){return new et(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 be="io.modelcontextprotocol/subscriptionId",ur=256,pr=2048,ag=5e3;function cg(e,t){return new Promise((r,o)=>{let n=setTimeout(()=>o(new Error("MCP subscription sink write timed out")),ag);n.unref(),Promise.resolve().then(()=>e(t)).then(()=>{clearTimeout(n),r()},i=>{clearTimeout(n),o(i instanceof Error?i:new Error(String(i)))})})}function tt(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 dg(e){if(!_(e))throw new p("Invalid MCP subscription filter",m.invalidParams,{field:"notifications",expected:"object"});let t=tt(e.toolsListChanged,"toolsListChanged"),r=tt(e.promptsListChanged,"promptsListChanged"),o=tt(e.resourcesListChanged,"resourcesListChanged"),n;if(e.resourceSubscriptions!==void 0){if(!Array.isArray(e.resourceSubscriptions)||e.resourceSubscriptions.length>ur)throw new p("Invalid MCP resource subscriptions",m.invalidParams,{field:"notifications.resourceSubscriptions",maximum:ur});let i=new Set;for(let s of e.resourceSubscriptions){if(typeof s!="string"||s.trim().length===0||Buffer.byteLength(s,"utf8")>pr)throw new p("Invalid MCP resource subscription URI",m.invalidParams,{field:"notifications.resourceSubscriptions",maximumBytes:pr});i.add(s)}i.size>0&&(n=[...i].sort())}return{...t?{toolsListChanged:t}:{},...r?{promptsListChanged:r}:{},...o?{resourcesListChanged:o}:{},...n?{resourceSubscriptions:n}:{}}}function lg(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 mr=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=lg(dg(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:{[be]: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:{[be]: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:{[be]: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 cg(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{...Xe({resultType:"complete",_meta:{[be]: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 fr=/^=\?base64\?([A-Za-z0-9+/]*={0,2})\?=$/u,ug=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/u,_r=/^[\t\x20-\x7E]*$/u,hr=new Set(["prompts/get","resources/read","tools/call"]);function pg(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 A(e,t){throw new p(e,m.headerMismatch,{header:t})}function gr(e){let t=typeof e=="boolean"?String(e).toLowerCase():String(e);return t.length>0&&t.trim()===t&&_r.test(t)&&!fr.test(t)?t:`=?base64?${Buffer.from(t,"utf8").toString("base64")}?=`}function yr(e,t){let r=fr.exec(e);if(r){let o=r[1],n=Buffer.from(o,"base64");return n.toString("base64")!==o||n.length===0?A("Malformed MCP Base64 header value",t):n.toString("utf8")}return e.length===0||e.trim()!==e||!_r.test(e)?A("Malformed MCP header value",t):e}function Ce(e){return Array.isArray(e)?e.some(Ce):_(e)?Object.prototype.hasOwnProperty.call(e,"x-mcp-header")||Object.values(e).some(Ce):!1}function mg(e,t,r){let o=e["x-mcp-header"];if(o===void 0)return;let n=e.type;if(typeof o!="string"||!ug.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 br(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=mg(c,d,r);l&&t.push(l);for(let[u,f]of Object.entries(c))if(u!=="properties"&&u!=="x-mcp-header"&&Ce(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"&&Ce(i))throw new p("MCP x-mcp-header is not statically reachable",m.invalidParams,{field:"inputSchema",keyword:n});return o(e,[]),t}function Cr(e,t){let r=e;for(let o of t){if(!_(r))return;r=r[o]}return r}function Tr(e,t){let r=e==="resources/read"?t.uri:t.name;return typeof r=="string"?r:void 0}function fg(e,t){let r=_(e.arguments)?e.arguments:{},o={};for(let n of br(t)){let i=Cr(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}`]=gr(i)}return o}function Ax(e){let t=_(e.request.params)?e.request.params:void 0,r=We(t),o=e.request.method;if(typeof o!="string"||o.length===0)return A("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=Tr(o,t);if(hr.has(o)){if(i===void 0)return A("Missing MCP request name","Mcp-Name");n["Mcp-Name"]=gr(i)}return o==="tools/call"&&e.toolSchema!==void 0&&Object.assign(n,fg(t,e.toolSchema)),n}function _g(e,t){let r=t.method;(typeof r!="string"||r.length===0)&&A("Missing MCP request method","Mcp-Method");let o=_(t.params)?t.params:void 0,n=We(o).protocolVersion;if(e.get("mcp-protocol-version")!==n&&A("MCP protocol header does not match request metadata","MCP-Protocol-Version"),e.get("mcp-method")!==r&&A("MCP method header does not match request body","Mcp-Method"),hr.has(r)){let i=e.get("mcp-name"),s=Tr(r,o);(i===void 0||s===void 0||yr(i,"Mcp-Name")!==s)&&A("MCP name header does not match request body","Mcp-Name")}e.has("last-event-id")&&A("MCP SSE resumability is not supported","Last-Event-ID")}function hg(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 gg(e){let t=_(e.params.arguments)?e.params.arguments:{};for(let r of br(e.toolSchema)){let o=Cr(t,r.path),n=`Mcp-Param-${r.name}`,i=e.headers.get(n.toLowerCase());if(o==null){i!==void 0&&A("Unexpected MCP parameter header",n);continue}i===void 0&&A("Missing MCP parameter header",n),hg(r,o,yr(i,n))||A("MCP parameter header does not match request body",n)}}function vx(e){let t=pg(e.headers),r=typeof e.request.method=="string"?e.request.method:"";_g(t,e.request),!(r!=="tools/call"||e.toolSchema===void 0)&&gg({headers:t,params:e.request.params,toolSchema:e.toolSchema})}var Ox=z;import{AsyncLocalStorage as yg}from"node:async_hooks";import{createHash as Sr,timingSafeEqual as bg}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}},Cg=/^00-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})$/u,Tg=/^[a-z][a-z0-9_*/-]{0,255}$/u,Sg=/^(?:[a-z0-9][a-z0-9_*/-]{0,240})@[a-z][a-z0-9_*/-]{0,13}$/u,Eg=/^[\x20-\x2B\x2D-\x3C\x3E-\x7E]{0,255}[\x21-\x2B\x2D-\x3C\x3E-\x7E]$/u,wr=/^[\x21\x23-\x5B\x5D-\x7E]+$/u,Ar=/^[A-Za-z0-9!#$%&'*+.^_`|~-]+$/u,wg=/^[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]*$/u,Ag=/%(?![0-9A-Fa-f]{2})/u,vg=512,Og=32,Rg=180,Ig=8192,Pg=8192,vr=new yg;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 Mg(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 kx(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=>!wr.test(n)))throw new y("Invalid authorization scope",401);return{resource:t,authorization_servers:r,...o.length>0?{scopes_supported:o.sort()}:{}}}function xx(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 Nx(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 Lx(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 Dx(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 $x(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 Fx(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 Er=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 kg(e){let t=e.traceparent,r=e.tracestate;if(t!==void 0){let o=typeof t=="string"?Cg.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"||!Ng(r)))throw new y("Invalid MCP tracestate",403);return{...typeof t=="string"?{traceparent:t}:{},...typeof r=="string"?{tracestate:r}:{}}}function D(e){return e.replace(/^[ \t]*|[ \t]*$/gu,"")}function xg(e){return Tg.test(e)||Sg.test(e)}function Ng(e){if(Buffer.byteLength(e,"utf8")>vg)return!1;let t=e.split(",");if(t.length>Og)return!1;let r=new Set;for(let o of t){let n=D(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(!xg(s)||!Eg.test(a)||r.has(s))return!1;r.add(s)}return!0}function Or(e){return wg.test(e)&&!Ag.test(e)}function Lg(e){let t=D(e),r=t.indexOf("="),o=D(r>=0?t.slice(0,r):t),n=r>=0?D(t.slice(r+1)):void 0;return Ar.test(o)&&(n===void 0||Or(n))}function Dg(e){let t=D(e),r=t.split(";"),o=r[0],n=r.slice(1),i=o.indexOf("="),s=D(i>0?o.slice(0,i):""),a=i>0?D(o.slice(i+1)):"";if(!(!Ar.test(s)||!Or(a)||!n.every(Lg)))return{key:s,serialized:t}}function $g(e,t){if(e===void 0)return;if(typeof e!="string"||Buffer.byteLength(e,"utf8")>Ig)throw new y("Invalid MCP baggage",403);let r=new Set(t),o=e.split(",");if(o.length>Rg)throw new y("Invalid MCP baggage",403);let n=[];for(let i of o){let s=Dg(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 Gx(e,t={}){let r=_(e)&&_(e._meta)?e._meta:{},o=$g(r.baggage,t.baggageAllowlist??[]);return{...kg(r),...o?{baggage:o}:{}}}function Ux(e,t){return vr.run(structuredClone(e),t)}function jx(){let e=vr.getStore();return e?{...e}:void 0}async function Bx(e){let t=E(e.policy.resourceMetadataUrl,"protected resource metadata URL",!0).href,r=[...new Set(e.policy.requiredScopes??[])];if(r.some(u=>!wr.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=Mg(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")>Pg)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 qx(e){let t=Sr("sha256").update(e.token).digest();return r=>{let o=Sr("sha256").update(r).digest();if(!bg(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 rt="io.modelcontextprotocol/ui",Te="2026-01-26",Pr="text/html;profile=mcp-app",Rr=Object.freeze({specVersion:Te,mimeTypes:[Pr]});function Hx(e){let t=e.clientCapabilities.extensions;if(!_(t))return!1;let r=t[rt];if(r===void 0)return!1;if(!_(r))throw new p("Invalid MCP Apps client capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[rt]:Rr}}});let o=r.mimeTypes,n=r.specVersion;if(!Array.isArray(o)||!o.includes(Pr)||n!==void 0&&n!==Te)throw new p("Unsupported MCP Apps client capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[rt]:Rr}}});return!0}var Fg={csp:{connectDomains:[],resourceDomains:[],frameDomains:[]},permissions:{},prefersBorder:!0},Mr=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:Fg})));function Kx(e){return Mr.find(t=>t.uri===e)}function Wx(e){let t=new Map(Mr.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 Ir(e){return e.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;")}function Xx(e){let t=Ir(e.name),r=Ir(e.description),o=JSON.stringify({name:`pm-${e.id}-view`,version:Te}),n=JSON.stringify(Te);return`<!doctype html>
3
3
  <html lang="en">
4
4
  <head>
@@ -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]="d7a68072-168d-509a-95ec-145635d71d46")}catch(e2){}})();const SECRET_RULES=[{name:"private-key",mutationRule:"private_key",regex:/-----BEGIN [A-Z0-9 ]*PRIVATE KEY-----/g},{name:"github-token",mutationRule:"github_token",regex:/\b(?:gh[opsru]_[A-Za-z0-9]{20,}|github_pat_[A-Za-z0-9_]{20,})\b/g},{name:"npm-token",mutationRule:"npm_token",regex:/\bnpm_[A-Za-z0-9]{20,}\b/g},{name:"aws-access-key",mutationRule:"aws_access_key",regex:/\b(?:AKIA|ASIA)[0-9A-Z]{16}\b/g},{name:"google-api-key",mutationRule:"google_api_key",regex:/\bAIza[0-9A-Za-z_-]{35}\b/g},{name:"slack-token",mutationRule:"slack_token",regex:/\bxox[baprs]-[A-Za-z0-9-]{10,}\b/g},{name:"anthropic-api-key",mutationRule:"anthropic_api_key",regex:/\bsk-ant-[A-Za-z0-9_-]{20,}\b/g},{name:"openai-api-key",mutationRule:"openai_api_key",regex:/\bsk-(?!ant-)[A-Za-z0-9_-]{20,}\b/g},{name:"gitlab-token",mutationRule:"gitlab_token",regex:/\bglpat-[A-Za-z0-9_.-]{20,}\b/g},{name:"jwt-like-token",mutationRule:"jwt_like_token",regex:/\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\b/g},{name:"npm-auth-token-assignment",mutationRule:"npm_auth_token_assignment",regex:/_authToken\s*=\s*\S+/g},{name:"sentry-user-token",mutationRule:"sentry_user_token",regex:/\bsntryu_[A-Za-z0-9]{20,}\b/g},{name:"sentry-org-token",mutationRule:"sentry_org_token",regex:/\bsntrys_[A-Za-z0-9_-]{20,}\b/g},{name:"private-ip",mutationRule:"private_ip",regex:/\b(?:10\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)|172\.(?:1[6-9]|2\d|3[01])\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)|192\.168\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d))\b/g},{name:"private-ssh-target",mutationRule:"private_ssh_target",regex:/\b(?:ssh|scp|rsync)\s+[A-Za-z0-9._-]+@(?:10\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)|172\.(?:1[6-9]|2\d|3[01])\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)|192\.168\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d))\b/g},{name:"sshpass-inline-password",mutationRule:"sshpass_inline_password",regex:/\bsshpass\s+-p\s+["'][^"']{6,}["']/g},{name:"password-assignment",mutationRule:"password_assignment",regex:/\b(?:password|passphrase)\s*[:=]\s*(?:(?!<|\$\{|\$\()[A-Za-z0-9!@#$%^&*._+\-=]{8,}|"(?!<|\$\{|\$\()[^"]{8,}"|'(?!<|\$\{|\$\()[^']{8,}')/gi},{name:"absolute-home-path",mutationRule:"absolute_home_path",regex:/(?:^|[\s"'`(=])\/home\/[A-Za-z0-9._-]+\/[^\s"'`),;]+/g,excludeFiles:/^(?:tests\/|examples\/)/},{name:"user-at-private-host",mutationRule:"user_at_private_host",regex:/\b[A-Za-z0-9._-]+@(?:10\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)|172\.(?:1[6-9]|2\d|3[01])\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)|192\.168\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d))\b/g,excludeFiles:/^(?:tests\/|examples\/)/},{name:"high-entropy-assignment",mutationRule:"high_entropy_assignment",regex:/\b(?:token|secret|password|passwd|api[_-]?key)\s*[:=]\s*["']?([A-Za-z0-9+/=_-]{24,})/gi,mutationOnlyReason:"Generic assignments in source code are not credentials; preserve the existing mutation heuristic without treating source identifiers as secrets.",minimumEntropy:3.5}];function acceptsSecretMatch(rule,match){if(rule.minimumEntropy===void 0)return true;const value=match[1];const counts=new Map;for(const character of value){counts.set(character,(counts.get(character)??0)+1)}let entropy=0;for(const count of counts.values()){const probability=count/value.length;entropy-=probability*Math.log2(probability)}return entropy>=rule.minimumEntropy}export{SECRET_RULES,acceptsSecretMatch};
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]="e5e43a96-6711-5777-8d65-06ae99eb008f")}catch(e2){}})();const SECRET_RULES=[{name:"private-key",mutationRule:"private_key",regex:/-----BEGIN [A-Z0-9 ]*PRIVATE KEY-----/g},{name:"github-token",mutationRule:"github_token",regex:/\b(?:gh[opsru]_[A-Za-z0-9]{20,}|github_pat_[A-Za-z0-9_]{20,})\b/g},{name:"npm-token",mutationRule:"npm_token",regex:/\bnpm_[A-Za-z0-9]{20,}\b/g},{name:"aws-access-key",mutationRule:"aws_access_key",regex:/\b(?:AKIA|ASIA)[0-9A-Z]{16}\b/g},{name:"google-api-key",mutationRule:"google_api_key",regex:/\bAIza[0-9A-Za-z_-]{35}\b/g},{name:"slack-token",mutationRule:"slack_token",regex:/\bxox[baprs]-[A-Za-z0-9-]{10,}\b/g},{name:"anthropic-api-key",mutationRule:"anthropic_api_key",regex:/\bsk-ant-[A-Za-z0-9_-]{20,}\b/g},{name:"openai-api-key",mutationRule:"openai_api_key",regex:/\bsk-(?!ant-)[A-Za-z0-9_-]{20,}\b/g},{name:"gitlab-token",mutationRule:"gitlab_token",regex:/\bglpat-[A-Za-z0-9_.-]{20,}\b/g},{name:"jwt-like-token",mutationRule:"jwt_like_token",regex:/\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\b/g},{name:"npm-auth-token-assignment",mutationRule:"npm_auth_token_assignment",regex:/_authToken\s*=\s*\S+/g},{name:"sentry-user-token",mutationRule:"sentry_user_token",regex:/\bsntryu_[A-Za-z0-9]{20,}\b/g},{name:"sentry-org-token",mutationRule:"sentry_org_token",regex:/\bsntrys_[A-Za-z0-9_-]{20,}\b/g},{name:"private-ip",mutationRule:"private_ip",regex:/\b(?:10\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)|172\.(?:1[6-9]|2\d|3[01])\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)|192\.168\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d))\b/g},{name:"private-ssh-target",mutationRule:"private_ssh_target",regex:/\b(?:ssh|scp|rsync)\s+[A-Za-z0-9._-]+@(?:10\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)|172\.(?:1[6-9]|2\d|3[01])\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)|192\.168\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d))\b/g},{name:"sshpass-inline-password",mutationRule:"sshpass_inline_password",regex:/\bsshpass\s+-p\s+["'][^"']{6,}["']/g},{name:"password-assignment",mutationRule:"password_assignment",regex:/\b(?:password|passphrase)\s*[:=]\s*(?:(?!<|\$\{|\$\(|config\.auth\.password\s*(?:\|\|\s*(?:''|"")|\?\s*unescape\(encodeURIComponent\(config\.auth\.password\)\)\s*:\s*(?:''|""))(?=[ \t]*(?:\/\*(?:[^*]|\*(?!\/))*\*\/[ \t]*)*(?:;|$|\/\/[^\r\n\u2028\u2029]*(?:\r\n)?$)))[A-Za-z0-9!@#$%^&*._+\-=]{8,}|"(?!<|\$\{|\$\()[^"]{8,}"|'(?!<|\$\{|\$\()[^']{8,}')/gi},{name:"absolute-home-path",mutationRule:"absolute_home_path",regex:/(?:^|[\s"'`(=])\/home\/[A-Za-z0-9._-]+\/[^\s"'`),;]+/g,excludeFiles:/^(?:tests\/|examples\/)/},{name:"user-at-private-host",mutationRule:"user_at_private_host",regex:/\b[A-Za-z0-9._-]+@(?:10\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)|172\.(?:1[6-9]|2\d|3[01])\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)|192\.168\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d))\b/g,excludeFiles:/^(?:tests\/|examples\/)/},{name:"high-entropy-assignment",mutationRule:"high_entropy_assignment",regex:/\b(?:token|secret|password|passwd|api[_-]?key)\s*[:=]\s*["']?([A-Za-z0-9+/=_-]{24,})/gi,mutationOnlyReason:"Generic assignments in source code are not credentials; preserve the existing mutation heuristic without treating source identifiers as secrets.",minimumEntropy:3.5}];function acceptsSecretMatch(rule,match){if(rule.minimumEntropy===void 0)return true;const value=match[1];const counts=new Map;for(const character of value){counts.set(character,(counts.get(character)??0)+1)}let entropy=0;for(const count of counts.values()){const probability=count/value.length;entropy-=probability*Math.log2(probability)}return entropy>=rule.minimumEntropy}export{SECRET_RULES,acceptsSecretMatch};
2
2
  //# sourceMappingURL=secret-rules.js.map
@@ -121,7 +121,7 @@ export declare function assertLinkedArtifactMutationIsUnambiguous(adds: LinkedAr
121
121
  export declare function normalizeLinkedPath(value: string): string;
122
122
  /** Anchor a local linked path to the project workspace while preserving remote references and absolute paths. */
123
123
  export declare function anchorLinkedPath(value: string, workspaceRoot: string, invocationRoot?: string): string;
124
- /** Implements expand add glob entries for the public runtime surface of this module. */
124
+ /** Match files from the invocation directory, then anchor and sort each entry while retaining its scope and note. Literal directories never expand recursively. */
125
125
  export declare function expandAddGlobEntries(entries: AddGlobEntry[], workspaceRoot?: string, invocationRoot?: string): Promise<LinkedArtifact[]>;
126
126
  /** GH-170 (pm-pfnx): apply a standalone --note to the links added in this invocation. Semantics (documented on pm-pfnx): the note is attached to EVERY entry added via --add/--add-glob so a single flag annotates the whole batch predictably; a per-entry embedded `note=` wins over the standalone flag; and --note without any --add/--add-glob flag is a usage error because there is nothing to annotate (it never retro-edits existing links). `hasAddFlags` reflects flag presence, not match count, so a glob that legitimately matches zero files is not an error. */
127
127
  export declare function applyStandaloneNote(adds: LinkedArtifact[], note: string | undefined, hasAddFlags: boolean): LinkedArtifact[];
@@ -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]="bb855f72-341c-5dc3-ade5-dd3102275cd8")}catch(e2){}})();import{assertInitializedTracker}from"./environment/tracker-preflight.js";import fs from"node:fs/promises";import path from"node:path";import fg from"fast-glob";import{isFileAbsentError}from"../core/fs/fs-utils.js";import{getActiveExtensionRegistrations}from"../core/extensions/index.js";import{assertNoAmbiguousBareCommaEntry,assertNoUnknownCsvKeys,createStdinTokenResolver,looksLikeGenericKeyValueEntry,parseCsvKv}from"../core/item/parse.js";import{resolveItemTypeRegistry}from"../core/item/type-registry.js";import{isRemoteLinkedArtifactReference}from"../core/validate/linked-artifact-reference.js";import{EXIT_CODE}from"../core/shared/constants.js";import{PmCliError}from"../core/shared/errors.js";import{stableValueEquals}from"../core/shared/serialization.js";import{locateItem,mutateItem,readLocatedItem}from"../core/store/item-store.js";import{resolvePmRoot,resolveWorkspaceRoot}from"../core/store/paths.js";import{readSettings}from"../core/store/settings.js";import{SCOPE_VALUES}from"../types/index.js";import{resolveAuthor}from"../core/shared/author.js";const LINKED_ARTIFACT_ADD_KEYS=["path","scope","note"];const LINKED_ARTIFACT_ADD_GLOB_KEYS=["pattern","glob","path","scope","note"];const LINKED_ARTIFACT_REMOVE_KEYS=["path"];const LINKED_ARTIFACT_MIGRATE_KEYS=["from","to"];const LINKED_ARTIFACT_REMOVE_UNSUPPORTED_KEYS=new Set(["note","scope"]);function ensureScope(raw){const value=raw??"project";if(!SCOPE_VALUES.includes(value)){throw new PmCliError(`Invalid scope "${raw}". Valid scopes: ${SCOPE_VALUES.join(", ")} (default: project).`,EXIT_CODE.USAGE)}return value}function looksLikeStructuredPathEntry(raw){if(raw.startsWith("```")||raw.includes("\n")){return true}if(/^(?:[-*+]\s+)?(?:path|scope|note)\s*[:=]/i.test(raw)){return true}const firstCommaIndex=raw.indexOf(",");const leadingSegment=raw.slice(0,firstCommaIndex>=0?firstCommaIndex:raw.length);const equalsIndex=leadingSegment.indexOf("=");if(equalsIndex>=0&&!/\s/u.test(raw)&&(/^[A-Za-z][A-Za-z0-9+.-]*:\/\//u.test(raw)||/^(?:[A-Za-z]:[\\/]|[\\/]{1,2}|\.\.?(?:[\\/]))/u.test(raw)||[raw.indexOf("/"),raw.indexOf("\\")].some(separatorIndex=>separatorIndex>=0&&separatorIndex<equalsIndex))){return false}return leadingSegment.includes("=")||looksLikeGenericKeyValueEntry(raw)}function hasBalancedParentheses(value){let depth=0;for(const character of value){if(character==="(")depth+=1;if(character===")")depth-=1;if(depth<0)return false}return depth===0}function parseDocumentationReference(trimmed){if(/^[A-Za-z][A-Za-z0-9+.-]*:\/\//u.test(trimmed)&&!looksLikeStructuredPathEntry(trimmed)){return{path:trimmed,scope:"project",note:void 0}}const labelEnd=trimmed.indexOf("](");if(trimmed.startsWith("[")&&labelEnd>0&&trimmed.endsWith(")")){const destination2=trimmed.slice(labelEnd+2,-1).trim();if(destination2.length>0&&hasBalancedParentheses(destination2)){return{path:destination2,scope:"project",note:trimmed.slice(1,labelEnd).trim()||void 0}}}const delimiterIndex=trimmed.indexOf(",");if(delimiterIndex<0)return void 0;const label=trimmed.slice(0,delimiterIndex).trim();const destination=trimmed.slice(delimiterIndex+1).trim();if(label.length===0||!/^[A-Za-z][A-Za-z0-9+.-]*:\/\//u.test(destination)){return void 0}return{path:destination,scope:"project",note:label}}function parseAddEntries(raw,bareNoun){if(!raw)return[];return raw.flatMap(entry=>{const trimmed=entry.trim();if(bareNoun==="doc"){const reference=parseDocumentationReference(trimmed);if(reference!==void 0)return[reference]}assertNoAmbiguousBareCommaEntry(trimmed,"--add",`${bareNoun} path`,looksLikeStructuredPathEntry(trimmed));const kv=looksLikeStructuredPathEntry(trimmed)?parseCsvKv(entry,"--add"):{path:trimmed};assertNoUnknownCsvKeys(kv,"--add",LINKED_ARTIFACT_ADD_KEYS);if(!kv.path){throw new PmCliError(`--add requires path=<value> or a bare ${bareNoun} path`,EXIT_CODE.USAGE)}return[{path:kv.path,scope:ensureScope(kv.scope),note:kv.note?.trim()||void 0}]})}function parseAddGlobEntries(raw){if(!raw)return[];return raw.map(entry=>{const trimmed=entry.trim();if(!trimmed){throw new PmCliError("--add-glob requires a glob pattern value",EXIT_CODE.USAGE)}if(trimmed.includes("=")||/^(?:[-*+]\s+)?(?:pattern|glob|path)\s*[:=]/i.test(trimmed)||trimmed.startsWith("```")){const kv=parseCsvKv(trimmed,"--add-glob");assertNoUnknownCsvKeys(kv,"--add-glob",LINKED_ARTIFACT_ADD_GLOB_KEYS);const pattern=kv.pattern?.trim()||kv.glob?.trim()||kv.path?.trim();if(!pattern){throw new PmCliError("--add-glob key/value form requires pattern=<glob>",EXIT_CODE.USAGE)}return{pattern,scope:ensureScope(kv.scope),note:kv.note?.trim()||void 0}}return{pattern:trimmed,scope:"project"}})}function parseRemoveEntries(raw){if(!raw)return[];return raw.map(entry=>{const trimmed=entry.trim();if(!trimmed){throw new PmCliError("--remove requires a path value",EXIT_CODE.USAGE)}if(trimmed.includes("=")||/^(?:[-*+]\s+)?path\s*[:=]/i.test(trimmed)||trimmed.startsWith("```")){const kv=parseCsvKv(trimmed,"--remove");const unsupportedRemoveKeys=Object.keys(kv).filter(key=>LINKED_ARTIFACT_REMOVE_UNSUPPORTED_KEYS.has(key.toLowerCase()));if(unsupportedRemoveKeys.length>0){throw new PmCliError(`--remove identifies a linked artifact by path only and does not accept ${unsupportedRemoveKeys.map(key=>`"${key}"`).join(", ")}. Pass just the path (path=<value>, path:<value>, or a bare path); record removal context with --message "<why removed>".`,EXIT_CODE.USAGE)}assertNoUnknownCsvKeys(kv,"--remove",LINKED_ARTIFACT_REMOVE_KEYS);if(!kv.path){throw new PmCliError("--remove key/value form requires path=<value>",EXIT_CODE.USAGE)}return kv.path}return trimmed})}function parseMigrateEntries(raw){if(!raw)return[];return raw.map(entry=>{const kv=parseCsvKv(entry,"--migrate");assertNoUnknownCsvKeys(kv,"--migrate",LINKED_ARTIFACT_MIGRATE_KEYS);const from=kv.from?.trim();const to=kv.to?.trim();if(!from||!to){throw new PmCliError("--migrate requires from=<value> and to=<value>",EXIT_CODE.USAGE)}return{from,to}})}function applyPathMigrations(artifactPath,migrations){let next=artifactPath;for(const migration of migrations){if(next.startsWith(migration.from)){next=`${migration.to}${next.slice(migration.from.length)}`}}return next}function assertLinkedArtifactMutationIsUnambiguous(adds,removes,migrations=[]){if(adds.length===0||removes.length===0){return}const addedPaths=new Set(adds.map(entry=>applyPathMigrations(entry.path,migrations)));const conflicts=[...new Set(removes.map(entry=>applyPathMigrations(entry,migrations)).filter(entry=>addedPaths.has(entry)))].sort((left,right)=>left.localeCompare(right));if(conflicts.length===0){return}throw new PmCliError(`Linked artifact mutation cannot add and remove the same normalized path in one transaction: ${conflicts.join(", ")}. Split the replacement into separate commands so each history event has one unambiguous intent.`,EXIT_CODE.USAGE,{code:"linked_artifact_mutation_conflict",reason:"same_path_added_and_removed",required:"Use distinct normalized paths for --add and --remove in one invocation.",why:"Conflicting batch intent cannot be applied deterministically without silently discarding metadata or a removal.",nextSteps:["Run the removal and addition as separate commands with a --message describing each intent."]})}function normalizeLinkedPath(value){return value.split(path.sep).join("/")}function anchorLinkedPath(value,workspaceRoot,invocationRoot=process.cwd()){const trimmed=value.trim();if(isRemoteLinkedArtifactReference(trimmed)){return trimmed}if(path.isAbsolute(trimmed)||/^[A-Za-z]:[\\/]/.test(trimmed)){return normalizeLinkedPath(trimmed.replaceAll("\\",path.sep))}const invocationRelativeToWorkspace=path.relative(workspaceRoot,invocationRoot);if(invocationRelativeToWorkspace.startsWith(`..${path.sep}`)||invocationRelativeToWorkspace===".."||path.isAbsolute(invocationRelativeToWorkspace)){return normalizeLinkedPath(path.normalize(trimmed))}return normalizeLinkedPath(path.relative(workspaceRoot,path.resolve(invocationRoot,trimmed)))}async function expandAddGlobEntries(entries,workspaceRoot=process.cwd(),invocationRoot=process.cwd()){const expanded=[];for(const entry of entries){const absolutePattern=path.isAbsolute(entry.pattern);const matches=await fg(entry.pattern,{cwd:invocationRoot,absolute:absolutePattern,onlyFiles:true,dot:true,unique:true,followSymbolicLinks:true});const sortedMatches=[...new Set(matches.map(match=>anchorLinkedPath(match,workspaceRoot,invocationRoot)))].sort((left,right)=>left.localeCompare(right));for(const matchedPath of sortedMatches){expanded.push({path:matchedPath,scope:entry.scope,note:entry.note})}}return expanded}function applyStandaloneNote(adds,note,hasAddFlags){if(note===void 0){return adds}if(!hasAddFlags){throw new PmCliError("--note requires --add or --add-glob in the same invocation (the note annotates the links being added)",EXIT_CODE.USAGE)}const trimmed=note.trim();if(trimmed.length===0){return adds}return adds.map(entry=>entry.note===void 0?{...entry,note:trimmed}:entry)}function artifactKey(value){return`${value.path}::${value.scope}`}function sortLinkedArtifacts(artifacts){return[...artifacts].sort((left,right)=>{const byPath=left.path.localeCompare(right.path);if(byPath!==0)return byPath;return left.scope.localeCompare(right.scope)})}function dedupeLinkedArtifacts(artifacts){return[...new Map(artifacts.map(entry=>[artifactKey(entry),entry])).values()].map(entry=>({...entry,note:entry.note?.trim()||void 0}))}async function validateLinkedPaths(paths,workspaceRoot=process.cwd()){const uniquePaths=[...new Set(paths)].sort((left,right)=>left.localeCompare(right));const existingFiles=[];const missingPaths=[];const nonFilePaths=[];const remoteReferences=[];for(const relativePath of uniquePaths){if(isRemoteLinkedArtifactReference(relativePath)){remoteReferences.push(relativePath.trim());continue}const resolvedPath=path.isAbsolute(relativePath)?relativePath:path.resolve(workspaceRoot,relativePath);try{const stats=await fs.stat(resolvedPath);if(stats.isFile()){existingFiles.push(relativePath)}else{nonFilePaths.push(relativePath)}}catch(error){if(typeof error==="object"&&error!==null&&"code"in error&&isFileAbsentError(error)){missingPaths.push(relativePath);continue}nonFilePaths.push(relativePath)}}return{checked:uniquePaths.length,existing_files:existingFiles,missing_paths:missingPaths,non_file_paths:nonFilePaths,remote_references:remoteReferences}}function applyLinkedArtifactMigrations(current,adds,removes,migrations){let count=0;for(let index=0;index<current.length;index+=1){const migratedPath=applyPathMigrations(current[index].path,migrations);if(migratedPath!==current[index].path){current[index]={...current[index],path:migratedPath};count+=1}}const migratedAdds=adds.map(entry=>{const migratedPath=applyPathMigrations(entry.path,migrations);if(migratedPath!==entry.path)count+=1;return{...entry,path:migratedPath}});return{adds:migratedAdds,removes:removes.map(entry=>applyPathMigrations(entry,migrations)),count}}function mergeLinkedArtifactChanges(current,adds,removes,appendStable){const merged=dedupeLinkedArtifacts(current);for(const add of adds){const index=merged.findIndex(entry=>entry.path===add.path&&entry.scope===add.scope);if(index<0){merged.push(add)}else if(add.note!==void 0){merged[index]={...merged[index],note:add.note}}}if(removes.length>0){for(let index=merged.length-1;index>=0;index-=1){if(removes.includes(merged[index].path))merged.splice(index,1)}}return appendStable?merged:sortLinkedArtifacts(merged)}async function buildLinkedArtifactResult(params){const paths=params.artifacts.map(entry=>entry.path);return{id:params.id,artifacts:params.artifacts,changed:params.changed,count:params.artifacts.length,migrations_applied:params.migrationsApplied&&params.migrationsApplied>0?params.migrationsApplied:void 0,validation:params.options.validatePaths||params.changed?await validateLinkedPaths(paths,params.workspaceRoot):void 0}}async function runLinkedArtifacts(id,options,global2,config){const{metadataKey}=config;const stdinResolver=createStdinTokenResolver();const pmRoot=resolvePmRoot(process.cwd(),global2.path);const workspaceRoot=resolveWorkspaceRoot(pmRoot);const invocationRoot=process.cwd();await assertInitializedTracker(pmRoot);const settings=await readSettings(pmRoot);const typeRegistry=resolveItemTypeRegistry(settings,getActiveExtensionRegistrations());const resolvedAdds=await stdinResolver.resolveList(options.add,"--add");const resolvedAddGlobs=await stdinResolver.resolveList(options.addGlob,"--add-glob");const resolvedRemoves=await stdinResolver.resolveList(options.remove,"--remove");const resolvedMigrations=await stdinResolver.resolveList(options.migrate,"--migrate");const parsedAdds=parseAddEntries(resolvedAdds,config.bareNoun).map(entry=>({...entry,path:anchorLinkedPath(entry.path,workspaceRoot,invocationRoot)}));const addGlobs=parseAddGlobEntries(resolvedAddGlobs);const expandedGlobAdds=await expandAddGlobEntries(addGlobs,workspaceRoot,invocationRoot);const adds=applyStandaloneNote([...parsedAdds,...expandedGlobAdds],options.note,parsedAdds.length>0||addGlobs.length>0);const removes=parseRemoveEntries(resolvedRemoves).map(entry=>anchorLinkedPath(entry,workspaceRoot,invocationRoot));const migrations=parseMigrateEntries(resolvedMigrations);assertLinkedArtifactMutationIsUnambiguous(adds,removes,migrations);const shouldMutate=adds.length>0||removes.length>0||migrations.length>0;if(!shouldMutate){const located=await locateItem(pmRoot,id,settings.id_prefix,settings.item_format,typeRegistry.type_to_folder);if(!located){throw new PmCliError(`Item ${id} not found`,EXIT_CODE.NOT_FOUND)}const loaded=await readLocatedItem(located,{schema:settings.schema});const artifacts2=loaded.document.metadata[metadataKey]??[];return buildLinkedArtifactResult({id:located.id,artifacts:artifacts2,changed:false,options,workspaceRoot})}const author=resolveAuthor(options.author,settings.author_default);const result=await mutateItem({pmRoot,settings,id,op:config.op,author,message:options.message,force:options.force,skipNoop:true,mutate(document){const metadata=document.metadata;const current=metadata[metadataKey]??[];const next=[...current];const migrated=applyLinkedArtifactMigrations(next,adds,removes,migrations);const normalized=mergeLinkedArtifactChanges(next,migrated.adds,migrated.removes,config.supportsAppendStable&&options.appendStable===true);if(normalized.length>0){metadata[metadataKey]=normalized}else{delete metadata[metadataKey]}const changed=!stableValueEquals(current,normalized);return{changedFields:changed?[metadataKey]:[],warnings:changed&&migrated.count>0?[`path_migrations_applied:${migrated.count}`]:[]}}});const artifacts=result.item[metadataKey]??[];const migrationWarning=result.warnings.find(warning=>warning.startsWith("path_migrations_applied:"));const migrationCount=migrationWarning?Number(migrationWarning.slice("path_migrations_applied:".length)):0;return buildLinkedArtifactResult({id:result.item.id,artifacts,changed:result.changedFields.includes(metadataKey),migrationsApplied:migrationCount,options,workspaceRoot})}function renameArtifactsResultKey(result,key){const out={};for(const[field,value]of Object.entries(result)){out[field==="artifacts"?key:field]=value}return out}export{LINKED_ARTIFACT_ADD_GLOB_KEYS,LINKED_ARTIFACT_ADD_KEYS,LINKED_ARTIFACT_MIGRATE_KEYS,LINKED_ARTIFACT_REMOVE_KEYS,anchorLinkedPath,applyPathMigrations,applyStandaloneNote,artifactKey,assertLinkedArtifactMutationIsUnambiguous,dedupeLinkedArtifacts,ensureScope,expandAddGlobEntries,looksLikeStructuredPathEntry,normalizeLinkedPath,parseAddEntries,parseAddGlobEntries,parseMigrateEntries,parseRemoveEntries,renameArtifactsResultKey,runLinkedArtifacts,sortLinkedArtifacts,validateLinkedPaths};
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]="4adcee44-f1a4-5ac8-b9a9-5981a3197bce")}catch(e2){}})();import{assertInitializedTracker}from"./environment/tracker-preflight.js";import fs from"node:fs/promises";import path from"node:path";import{glob}from"tinyglobby";import{isFileAbsentError}from"../core/fs/fs-utils.js";import{getActiveExtensionRegistrations}from"../core/extensions/index.js";import{assertNoAmbiguousBareCommaEntry,assertNoUnknownCsvKeys,createStdinTokenResolver,looksLikeGenericKeyValueEntry,parseCsvKv}from"../core/item/parse.js";import{resolveItemTypeRegistry}from"../core/item/type-registry.js";import{isRemoteLinkedArtifactReference}from"../core/validate/linked-artifact-reference.js";import{EXIT_CODE}from"../core/shared/constants.js";import{PmCliError}from"../core/shared/errors.js";import{stableValueEquals}from"../core/shared/serialization.js";import{locateItem,mutateItem,readLocatedItem}from"../core/store/item-store.js";import{resolvePmRoot,resolveWorkspaceRoot}from"../core/store/paths.js";import{readSettings}from"../core/store/settings.js";import{SCOPE_VALUES}from"../types/index.js";import{resolveAuthor}from"../core/shared/author.js";const LINKED_ARTIFACT_ADD_KEYS=["path","scope","note"];const LINKED_ARTIFACT_ADD_GLOB_KEYS=["pattern","glob","path","scope","note"];const LINKED_ARTIFACT_REMOVE_KEYS=["path"];const LINKED_ARTIFACT_MIGRATE_KEYS=["from","to"];const LINKED_ARTIFACT_REMOVE_UNSUPPORTED_KEYS=new Set(["note","scope"]);function ensureScope(raw){const value=raw??"project";if(!SCOPE_VALUES.includes(value)){throw new PmCliError(`Invalid scope "${raw}". Valid scopes: ${SCOPE_VALUES.join(", ")} (default: project).`,EXIT_CODE.USAGE)}return value}function looksLikeStructuredPathEntry(raw){if(raw.startsWith("```")||raw.includes("\n")){return true}if(/^(?:[-*+]\s+)?(?:path|scope|note)\s*[:=]/i.test(raw)){return true}const firstCommaIndex=raw.indexOf(",");const leadingSegment=raw.slice(0,firstCommaIndex>=0?firstCommaIndex:raw.length);const equalsIndex=leadingSegment.indexOf("=");if(equalsIndex>=0&&!/\s/u.test(raw)&&(/^[A-Za-z][A-Za-z0-9+.-]*:\/\//u.test(raw)||/^(?:[A-Za-z]:[\\/]|[\\/]{1,2}|\.\.?(?:[\\/]))/u.test(raw)||[raw.indexOf("/"),raw.indexOf("\\")].some(separatorIndex=>separatorIndex>=0&&separatorIndex<equalsIndex))){return false}return leadingSegment.includes("=")||looksLikeGenericKeyValueEntry(raw)}function hasBalancedParentheses(value){let depth=0;for(const character of value){if(character==="(")depth+=1;if(character===")")depth-=1;if(depth<0)return false}return depth===0}function parseDocumentationReference(trimmed){if(/^[A-Za-z][A-Za-z0-9+.-]*:\/\//u.test(trimmed)&&!looksLikeStructuredPathEntry(trimmed)){return{path:trimmed,scope:"project",note:void 0}}const labelEnd=trimmed.indexOf("](");if(trimmed.startsWith("[")&&labelEnd>0&&trimmed.endsWith(")")){const destination2=trimmed.slice(labelEnd+2,-1).trim();if(destination2.length>0&&hasBalancedParentheses(destination2)){return{path:destination2,scope:"project",note:trimmed.slice(1,labelEnd).trim()||void 0}}}const delimiterIndex=trimmed.indexOf(",");if(delimiterIndex<0)return void 0;const label=trimmed.slice(0,delimiterIndex).trim();const destination=trimmed.slice(delimiterIndex+1).trim();if(label.length===0||!/^[A-Za-z][A-Za-z0-9+.-]*:\/\//u.test(destination)){return void 0}return{path:destination,scope:"project",note:label}}function parseAddEntries(raw,bareNoun){if(!raw)return[];return raw.flatMap(entry=>{const trimmed=entry.trim();if(bareNoun==="doc"){const reference=parseDocumentationReference(trimmed);if(reference!==void 0)return[reference]}assertNoAmbiguousBareCommaEntry(trimmed,"--add",`${bareNoun} path`,looksLikeStructuredPathEntry(trimmed));const kv=looksLikeStructuredPathEntry(trimmed)?parseCsvKv(entry,"--add"):{path:trimmed};assertNoUnknownCsvKeys(kv,"--add",LINKED_ARTIFACT_ADD_KEYS);if(!kv.path){throw new PmCliError(`--add requires path=<value> or a bare ${bareNoun} path`,EXIT_CODE.USAGE)}return[{path:kv.path,scope:ensureScope(kv.scope),note:kv.note?.trim()||void 0}]})}function parseAddGlobEntries(raw){if(!raw)return[];return raw.map(entry=>{const trimmed=entry.trim();if(!trimmed){throw new PmCliError("--add-glob requires a glob pattern value",EXIT_CODE.USAGE)}if(trimmed.includes("=")||/^(?:[-*+]\s+)?(?:pattern|glob|path)\s*[:=]/i.test(trimmed)||trimmed.startsWith("```")){const kv=parseCsvKv(trimmed,"--add-glob");assertNoUnknownCsvKeys(kv,"--add-glob",LINKED_ARTIFACT_ADD_GLOB_KEYS);const pattern=kv.pattern?.trim()||kv.glob?.trim()||kv.path?.trim();if(!pattern){throw new PmCliError("--add-glob key/value form requires pattern=<glob>",EXIT_CODE.USAGE)}return{pattern,scope:ensureScope(kv.scope),note:kv.note?.trim()||void 0}}return{pattern:trimmed,scope:"project"}})}function parseRemoveEntries(raw){if(!raw)return[];return raw.map(entry=>{const trimmed=entry.trim();if(!trimmed){throw new PmCliError("--remove requires a path value",EXIT_CODE.USAGE)}if(trimmed.includes("=")||/^(?:[-*+]\s+)?path\s*[:=]/i.test(trimmed)||trimmed.startsWith("```")){const kv=parseCsvKv(trimmed,"--remove");const unsupportedRemoveKeys=Object.keys(kv).filter(key=>LINKED_ARTIFACT_REMOVE_UNSUPPORTED_KEYS.has(key.toLowerCase()));if(unsupportedRemoveKeys.length>0){throw new PmCliError(`--remove identifies a linked artifact by path only and does not accept ${unsupportedRemoveKeys.map(key=>`"${key}"`).join(", ")}. Pass just the path (path=<value>, path:<value>, or a bare path); record removal context with --message "<why removed>".`,EXIT_CODE.USAGE)}assertNoUnknownCsvKeys(kv,"--remove",LINKED_ARTIFACT_REMOVE_KEYS);if(!kv.path){throw new PmCliError("--remove key/value form requires path=<value>",EXIT_CODE.USAGE)}return kv.path}return trimmed})}function parseMigrateEntries(raw){if(!raw)return[];return raw.map(entry=>{const kv=parseCsvKv(entry,"--migrate");assertNoUnknownCsvKeys(kv,"--migrate",LINKED_ARTIFACT_MIGRATE_KEYS);const from=kv.from?.trim();const to=kv.to?.trim();if(!from||!to){throw new PmCliError("--migrate requires from=<value> and to=<value>",EXIT_CODE.USAGE)}return{from,to}})}function applyPathMigrations(artifactPath,migrations){let next=artifactPath;for(const migration of migrations){if(next.startsWith(migration.from)){next=`${migration.to}${next.slice(migration.from.length)}`}}return next}function assertLinkedArtifactMutationIsUnambiguous(adds,removes,migrations=[]){if(adds.length===0||removes.length===0){return}const addedPaths=new Set(adds.map(entry=>applyPathMigrations(entry.path,migrations)));const conflicts=[...new Set(removes.map(entry=>applyPathMigrations(entry,migrations)).filter(entry=>addedPaths.has(entry)))].sort((left,right)=>left.localeCompare(right));if(conflicts.length===0){return}throw new PmCliError(`Linked artifact mutation cannot add and remove the same normalized path in one transaction: ${conflicts.join(", ")}. Split the replacement into separate commands so each history event has one unambiguous intent.`,EXIT_CODE.USAGE,{code:"linked_artifact_mutation_conflict",reason:"same_path_added_and_removed",required:"Use distinct normalized paths for --add and --remove in one invocation.",why:"Conflicting batch intent cannot be applied deterministically without silently discarding metadata or a removal.",nextSteps:["Run the removal and addition as separate commands with a --message describing each intent."]})}function normalizeLinkedPath(value){return value.split(path.sep).join("/")}function anchorLinkedPath(value,workspaceRoot,invocationRoot=process.cwd()){const trimmed=value.trim();if(isRemoteLinkedArtifactReference(trimmed)){return trimmed}if(path.isAbsolute(trimmed)||/^[A-Za-z]:[\\/]/.test(trimmed)){return normalizeLinkedPath(trimmed.replaceAll("\\",path.sep))}const invocationRelativeToWorkspace=path.relative(workspaceRoot,invocationRoot);if(invocationRelativeToWorkspace.startsWith(`..${path.sep}`)||invocationRelativeToWorkspace===".."||path.isAbsolute(invocationRelativeToWorkspace)){return normalizeLinkedPath(path.normalize(trimmed))}return normalizeLinkedPath(path.relative(workspaceRoot,path.resolve(invocationRoot,trimmed)))}async function expandAddGlobEntries(entries,workspaceRoot=process.cwd(),invocationRoot=process.cwd()){const expanded=[];for(const entry of entries){if(path.resolve(invocationRoot,entry.pattern)===path.resolve(invocationRoot))continue;const absolutePattern=path.isAbsolute(entry.pattern);const matches=await glob(entry.pattern,{cwd:invocationRoot,absolute:absolutePattern,onlyFiles:true,dot:true,expandDirectories:false,followSymbolicLinks:true});const sortedMatches=[...new Set(matches.map(match=>anchorLinkedPath(match,workspaceRoot,invocationRoot)))].sort((left,right)=>left.localeCompare(right));for(const matchedPath of sortedMatches){expanded.push({path:matchedPath,scope:entry.scope,note:entry.note})}}return expanded}function applyStandaloneNote(adds,note,hasAddFlags){if(note===void 0){return adds}if(!hasAddFlags){throw new PmCliError("--note requires --add or --add-glob in the same invocation (the note annotates the links being added)",EXIT_CODE.USAGE)}const trimmed=note.trim();if(trimmed.length===0){return adds}return adds.map(entry=>entry.note===void 0?{...entry,note:trimmed}:entry)}function artifactKey(value){return`${value.path}::${value.scope}`}function sortLinkedArtifacts(artifacts){return[...artifacts].sort((left,right)=>{const byPath=left.path.localeCompare(right.path);if(byPath!==0)return byPath;return left.scope.localeCompare(right.scope)})}function dedupeLinkedArtifacts(artifacts){return[...new Map(artifacts.map(entry=>[artifactKey(entry),entry])).values()].map(entry=>({...entry,note:entry.note?.trim()||void 0}))}async function validateLinkedPaths(paths,workspaceRoot=process.cwd()){const uniquePaths=[...new Set(paths)].sort((left,right)=>left.localeCompare(right));const existingFiles=[];const missingPaths=[];const nonFilePaths=[];const remoteReferences=[];for(const relativePath of uniquePaths){if(isRemoteLinkedArtifactReference(relativePath)){remoteReferences.push(relativePath.trim());continue}const resolvedPath=path.isAbsolute(relativePath)?relativePath:path.resolve(workspaceRoot,relativePath);try{const stats=await fs.stat(resolvedPath);if(stats.isFile()){existingFiles.push(relativePath)}else{nonFilePaths.push(relativePath)}}catch(error){if(typeof error==="object"&&error!==null&&"code"in error&&isFileAbsentError(error)){missingPaths.push(relativePath);continue}nonFilePaths.push(relativePath)}}return{checked:uniquePaths.length,existing_files:existingFiles,missing_paths:missingPaths,non_file_paths:nonFilePaths,remote_references:remoteReferences}}function applyLinkedArtifactMigrations(current,adds,removes,migrations){let count=0;for(let index=0;index<current.length;index+=1){const migratedPath=applyPathMigrations(current[index].path,migrations);if(migratedPath!==current[index].path){current[index]={...current[index],path:migratedPath};count+=1}}const migratedAdds=adds.map(entry=>{const migratedPath=applyPathMigrations(entry.path,migrations);if(migratedPath!==entry.path)count+=1;return{...entry,path:migratedPath}});return{adds:migratedAdds,removes:removes.map(entry=>applyPathMigrations(entry,migrations)),count}}function mergeLinkedArtifactChanges(current,adds,removes,appendStable){const merged=dedupeLinkedArtifacts(current);for(const add of adds){const index=merged.findIndex(entry=>entry.path===add.path&&entry.scope===add.scope);if(index<0){merged.push(add)}else if(add.note!==void 0){merged[index]={...merged[index],note:add.note}}}if(removes.length>0){for(let index=merged.length-1;index>=0;index-=1){if(removes.includes(merged[index].path))merged.splice(index,1)}}return appendStable?merged:sortLinkedArtifacts(merged)}async function buildLinkedArtifactResult(params){const paths=params.artifacts.map(entry=>entry.path);return{id:params.id,artifacts:params.artifacts,changed:params.changed,count:params.artifacts.length,migrations_applied:params.migrationsApplied&&params.migrationsApplied>0?params.migrationsApplied:void 0,validation:params.options.validatePaths||params.changed?await validateLinkedPaths(paths,params.workspaceRoot):void 0}}async function runLinkedArtifacts(id,options,global2,config){const{metadataKey}=config;const stdinResolver=createStdinTokenResolver();const pmRoot=resolvePmRoot(process.cwd(),global2.path);const workspaceRoot=resolveWorkspaceRoot(pmRoot);const invocationRoot=process.cwd();await assertInitializedTracker(pmRoot);const settings=await readSettings(pmRoot);const typeRegistry=resolveItemTypeRegistry(settings,getActiveExtensionRegistrations());const resolvedAdds=await stdinResolver.resolveList(options.add,"--add");const resolvedAddGlobs=await stdinResolver.resolveList(options.addGlob,"--add-glob");const resolvedRemoves=await stdinResolver.resolveList(options.remove,"--remove");const resolvedMigrations=await stdinResolver.resolveList(options.migrate,"--migrate");const parsedAdds=parseAddEntries(resolvedAdds,config.bareNoun).map(entry=>({...entry,path:anchorLinkedPath(entry.path,workspaceRoot,invocationRoot)}));const addGlobs=parseAddGlobEntries(resolvedAddGlobs);const expandedGlobAdds=await expandAddGlobEntries(addGlobs,workspaceRoot,invocationRoot);const adds=applyStandaloneNote([...parsedAdds,...expandedGlobAdds],options.note,parsedAdds.length>0||addGlobs.length>0);const removes=parseRemoveEntries(resolvedRemoves).map(entry=>anchorLinkedPath(entry,workspaceRoot,invocationRoot));const migrations=parseMigrateEntries(resolvedMigrations);assertLinkedArtifactMutationIsUnambiguous(adds,removes,migrations);const shouldMutate=adds.length>0||removes.length>0||migrations.length>0;if(!shouldMutate){const located=await locateItem(pmRoot,id,settings.id_prefix,settings.item_format,typeRegistry.type_to_folder);if(!located){throw new PmCliError(`Item ${id} not found`,EXIT_CODE.NOT_FOUND)}const loaded=await readLocatedItem(located,{schema:settings.schema});const artifacts2=loaded.document.metadata[metadataKey]??[];return buildLinkedArtifactResult({id:located.id,artifacts:artifacts2,changed:false,options,workspaceRoot})}const author=resolveAuthor(options.author,settings.author_default);const result=await mutateItem({pmRoot,settings,id,op:config.op,author,message:options.message,force:options.force,skipNoop:true,mutate(document){const metadata=document.metadata;const current=metadata[metadataKey]??[];const next=[...current];const migrated=applyLinkedArtifactMigrations(next,adds,removes,migrations);const normalized=mergeLinkedArtifactChanges(next,migrated.adds,migrated.removes,config.supportsAppendStable&&options.appendStable===true);if(normalized.length>0){metadata[metadataKey]=normalized}else{delete metadata[metadataKey]}const changed=!stableValueEquals(current,normalized);return{changedFields:changed?[metadataKey]:[],warnings:changed&&migrated.count>0?[`path_migrations_applied:${migrated.count}`]:[]}}});const artifacts=result.item[metadataKey]??[];const migrationWarning=result.warnings.find(warning=>warning.startsWith("path_migrations_applied:"));const migrationCount=migrationWarning?Number(migrationWarning.slice("path_migrations_applied:".length)):0;return buildLinkedArtifactResult({id:result.item.id,artifacts,changed:result.changedFields.includes(metadataKey),migrationsApplied:migrationCount,options,workspaceRoot})}function renameArtifactsResultKey(result,key){const out={};for(const[field,value]of Object.entries(result)){out[field==="artifacts"?key:field]=value}return out}export{LINKED_ARTIFACT_ADD_GLOB_KEYS,LINKED_ARTIFACT_ADD_KEYS,LINKED_ARTIFACT_MIGRATE_KEYS,LINKED_ARTIFACT_REMOVE_KEYS,anchorLinkedPath,applyPathMigrations,applyStandaloneNote,artifactKey,assertLinkedArtifactMutationIsUnambiguous,dedupeLinkedArtifacts,ensureScope,expandAddGlobEntries,looksLikeStructuredPathEntry,normalizeLinkedPath,parseAddEntries,parseAddGlobEntries,parseMigrateEntries,parseRemoveEntries,renameArtifactsResultKey,runLinkedArtifacts,sortLinkedArtifacts,validateLinkedPaths};
2
2
  //# sourceMappingURL=linked-artifacts.js.map