@unbrained/pm-cli 2026.11.17 → 2026.11.18

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 (109) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/dist/cli-bundle/bundle-manifest.json +1 -1
  3. package/dist/cli-bundle/chunks/chunk-2VH6COJE.js +125 -0
  4. package/dist/cli-bundle/chunks/{chunk-2WHXFKMY.js → chunk-7ETRLLK3.js} +31 -31
  5. package/dist/cli-bundle/chunks/{chunk-FXSLODOK.js → chunk-7LCJA54R.js} +2 -2
  6. package/dist/cli-bundle/chunks/{chunk-DXSZL3T6.js → chunk-AGU7632B.js} +2 -2
  7. package/dist/cli-bundle/chunks/{chunk-X5TFNFTS.js → chunk-CGTVDSAR.js} +2 -2
  8. package/dist/cli-bundle/chunks/{chunk-ACLBUVQG.js → chunk-FJQCORYR.js} +2 -2
  9. package/dist/cli-bundle/chunks/{chunk-ABFHWRLE.js → chunk-JBPXNG6P.js} +2 -2
  10. package/dist/cli-bundle/chunks/{chunk-QZNL5XDT.js → chunk-L2ZLH3LZ.js} +2 -2
  11. package/dist/cli-bundle/chunks/{chunk-XPBADEUK.js → chunk-LGWP5D7V.js} +2 -2
  12. package/dist/cli-bundle/chunks/{chunk-KIQNEOKJ.js → chunk-MUGGRKK3.js} +2 -2
  13. package/dist/cli-bundle/chunks/{chunk-3IU2S5UQ.js → chunk-OD2I3SFQ.js} +2 -2
  14. package/dist/cli-bundle/chunks/{chunk-4FIN2XWC.js → chunk-QK7RAN7R.js} +2 -2
  15. package/dist/cli-bundle/chunks/{chunk-77MGDTK4.js → chunk-S3RMFLEG.js} +3 -3
  16. package/dist/cli-bundle/chunks/{chunk-QANUQMDL.js → chunk-SSZBVRIN.js} +2 -2
  17. package/dist/cli-bundle/chunks/{chunk-VLKCFZY6.js → chunk-T3E3WNHO.js} +2 -2
  18. package/dist/cli-bundle/chunks/{chunk-ADKDFCVT.js → chunk-TA5VN4ME.js} +2 -2
  19. package/dist/cli-bundle/chunks/{chunk-RXNBNF6O.js → chunk-TS2CZE3O.js} +2 -2
  20. package/dist/cli-bundle/chunks/{chunk-7K2RUKMK.js → chunk-VETSGCF4.js} +2 -2
  21. package/dist/cli-bundle/chunks/{chunk-36R3JTAD.js → chunk-WKHS4QC6.js} +2 -2
  22. package/dist/cli-bundle/chunks/{chunk-O4ZSIMNC.js → chunk-XDIJK6VW.js} +2 -2
  23. package/dist/cli-bundle/chunks/{chunk-XP35IEHT.js → chunk-YJI2Y5N6.js} +2 -2
  24. package/dist/cli-bundle/chunks/{item-revision-7RVMVXTE.js → item-revision-BV5BUBCR.js} +2 -2
  25. package/dist/cli-bundle/chunks/item-transaction-E2ST3A3X.js +2 -0
  26. package/dist/cli-bundle/chunks/{mutation-admission-3PKQOAYK.js → mutation-admission-5AWMXMCB.js} +2 -2
  27. package/dist/cli-bundle/chunks/{register-list-query-TPZLHFHQ.js → register-list-query-RJT7YBRF.js} +2 -2
  28. package/dist/cli-bundle/chunks/{register-mutation-JG5AEBRJ.js → register-mutation-6KTMJGYF.js} +2 -2
  29. package/dist/cli-bundle/chunks/{register-operations-3CNXP46P.js → register-operations-W24TA3HZ.js} +2 -2
  30. package/dist/cli-bundle/chunks/{register-setup-4N56VL2P.js → register-setup-QK67WUX6.js} +2 -2
  31. package/dist/cli-bundle/focused-chunks/{chunk-2MQNIDKG.js → chunk-3H3SVHAT.js} +2 -2
  32. package/dist/cli-bundle/focused-chunks/{chunk-GD2YWUAD.js → chunk-6OZ7BKWJ.js} +54 -54
  33. package/dist/cli-bundle/focused-chunks/{chunk-XJS4COL2.js → chunk-DWCFZVT2.js} +2 -2
  34. package/dist/cli-bundle/focused-chunks/{chunk-SESMRMEE.js → chunk-EO4XM3XJ.js} +2 -2
  35. package/dist/cli-bundle/focused-chunks/{chunk-BNLLST32.js → chunk-IGMFXB5W.js} +2 -2
  36. package/dist/cli-bundle/focused-chunks/{chunk-VBA4BIHN.js → chunk-LZR3JKYT.js} +2 -2
  37. package/dist/cli-bundle/focused-chunks/{chunk-6JQXDGHM.js → chunk-ONHUG7IL.js} +2 -2
  38. package/dist/cli-bundle/focused-chunks/{chunk-YWPLBFPC.js → chunk-PNCCTZKI.js} +3 -3
  39. package/dist/cli-bundle/focused-chunks/chunk-T3NMYMW4.js +27 -0
  40. package/dist/cli-bundle/focused-chunks/{item-revision-U7GDVAH7.js → item-revision-NS2V4WON.js} +2 -2
  41. package/dist/cli-bundle/focused-chunks/{item-transaction-7C4BH47O.js → item-transaction-NENC4HYI.js} +2 -2
  42. package/dist/cli-bundle/focused-chunks/{mutation-admission-SKXVITP5.js → mutation-admission-DZIBDJAE.js} +2 -2
  43. package/dist/cli-bundle/main.js +2 -2
  44. package/dist/cli-bundle/sdk-authoring.js +1 -1
  45. package/dist/cli-bundle/sdk-core.js +1 -1
  46. package/dist/cli-bundle/sdk-governance.js +1 -1
  47. package/dist/cli-bundle/sdk-merge.js +58 -58
  48. package/dist/cli-bundle/sdk-query.js +1 -1
  49. package/dist/cli-bundle/sdk-runtime.js +1 -1
  50. package/dist/cli-bundle/sdk-testing.js +1 -1
  51. package/dist/cli-bundle/sdk.js +1 -1
  52. package/dist/core/fs/file-glob.js +2 -0
  53. package/dist/core/shared/secret-rules.d.ts +83 -4
  54. package/dist/core/shared/secret-rules.js +5 -4
  55. package/dist/sdk/linked-artifacts.js +2 -2
  56. package/dist/sdk/mutation-guard.d.ts +25 -4
  57. package/dist/sdk/mutation-guard.js +1 -1
  58. package/dist/sdk/public-surface.json +1 -1
  59. package/docs/COMMANDS.md +33 -0
  60. package/docs/DEFECT_RECURRENCE.md +3 -2
  61. package/docs/MUTATION_INTEGRITY.md +187 -7
  62. package/marketplace.json +1 -1
  63. package/package.json +1 -3
  64. package/packages/pm-beads/package.json +1 -1
  65. package/packages/pm-calendar/package.json +1 -1
  66. package/packages/pm-command-kit/package.json +1 -1
  67. package/packages/pm-digital-twin/package.json +1 -1
  68. package/packages/pm-governance-audit/package.json +1 -1
  69. package/packages/pm-guide-shell/package.json +1 -1
  70. package/packages/pm-kanban/package.json +1 -1
  71. package/packages/pm-lifecycle-hooks/package.json +1 -1
  72. package/packages/pm-linked-test-adapters/package.json +1 -1
  73. package/packages/pm-search-advanced/package.json +1 -1
  74. package/packages/pm-templates/package.json +1 -1
  75. package/packages/pm-todos/package.json +1 -1
  76. package/packages/pm-vcs/package.json +1 -1
  77. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  78. package/plugins/pm-claude/package.json +1 -1
  79. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  80. package/plugins/pm-codex/package.json +1 -1
  81. package/plugins/pm-codex/plugin.json +1 -1
  82. package/runtime-dependencies.json +1 -1
  83. package/dist/cli-bundle/chunks/chunk-AM26RAG7.js +0 -124
  84. package/dist/cli-bundle/chunks/item-transaction-NVX6P3FK.js +0 -2
  85. package/dist/cli-bundle/focused-chunks/chunk-ZDY5L2C2.js +0 -26
  86. package/node_modules/fdir/LICENSE +0 -7
  87. package/node_modules/fdir/README.md +0 -91
  88. package/node_modules/fdir/dist/index.cjs +0 -588
  89. package/node_modules/fdir/dist/index.d.cts +0 -155
  90. package/node_modules/fdir/dist/index.d.mts +0 -155
  91. package/node_modules/fdir/dist/index.mjs +0 -570
  92. package/node_modules/fdir/package.json +0 -106
  93. package/node_modules/picomatch/LICENSE +0 -21
  94. package/node_modules/picomatch/README.md +0 -743
  95. package/node_modules/picomatch/index.js +0 -17
  96. package/node_modules/picomatch/lib/constants.js +0 -184
  97. package/node_modules/picomatch/lib/parse.js +0 -1425
  98. package/node_modules/picomatch/lib/picomatch.js +0 -361
  99. package/node_modules/picomatch/lib/scan.js +0 -403
  100. package/node_modules/picomatch/lib/utils.js +0 -72
  101. package/node_modules/picomatch/package.json +0 -83
  102. package/node_modules/picomatch/posix.js +0 -3
  103. package/node_modules/tinyglobby/LICENSE +0 -21
  104. package/node_modules/tinyglobby/README.md +0 -25
  105. package/node_modules/tinyglobby/dist/index.cjs +0 -335
  106. package/node_modules/tinyglobby/dist/index.d.cts +0 -148
  107. package/node_modules/tinyglobby/dist/index.d.mts +0 -148
  108. package/node_modules/tinyglobby/dist/index.mjs +0 -307
  109. package/node_modules/tinyglobby/package.json +0 -70
@@ -1,2 +1,2 @@
1
- import{$ as To,Aa as Mo,B as p,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 Qo,U as co,Ua as Yo,V as yo,Va as Zo,W as go,Wa as $o,X as bo,Xa as k,Y as Co,Ya as E,Z as Io,Za as D,_ as wo,a as Oe,aa as ho,b as Ue,ba as _o,c as We,ca as a,d as je,da as m,e as Le,ea as d,f as Ne,fa as s,g as Ve,ga as i,h as ze,ha as x,i as Xe,ia as l,ja as u,ka as c,la as y,ma as g,na as b,oa as C,pa as I,qa as w,r as qe,ra as T,s as Ge,sa as h,t as He,ta as _,u as Je,ua as ko,v as Ke,va as Eo,wa as Do,xa as vo,ya as Fo,za as So}from"./focused-chunks/chunk-6JQXDGHM.js";import{D as f,a as Ie,b as we,c as Te,d as he,e as _e,f as ke,g as Ee,p as De,q as ve,r as Fe,s as Se,t as Me,u as Re,v as Ae,w as Pe,x as Be}from"./focused-chunks/chunk-BNLLST32.js";import"./focused-chunks/chunk-OAIAZHRG.js";import{Ja as n,ua as re}from"./focused-chunks/chunk-ZDY5L2C2.js";import{b as v,c as F,d as S,e as M,g as R,h as A,j as P}from"./focused-chunks/chunk-ICEHI4SN.js";import"./focused-chunks/chunk-7Z2NYAK4.js";import{a as ie,b as xe,c as le,d as ue,e as ce,f as ye,g as ge,h as be,i as Ce}from"./focused-chunks/chunk-OPY43DNJ.js";import"./focused-chunks/chunk-GHQVM6K6.js";import{A as pe,B as ae,D as me,E as de,F as se,w as r,y as ne,z as fe}from"./focused-chunks/chunk-HO2YUD4P.js";import"./focused-chunks/chunk-MTBC32ZR.js";import"./focused-chunks/chunk-I5LGPUWH.js";import"./focused-chunks/chunk-C3O6JJPO.js";import{$g as z,Be as O,Vg as U,Wg as W,Xg as j,Yg as L,Zg as N,_g as V,ah as X,bh as q,ch as G,dh as H,eh as J,fh as K,gh as Q,hh as Y,ih as Z,jh as $,kh as ee,lh as oe,mh as te,pe as B}from"./focused-chunks/chunk-A2CLYPDA.js";import"./focused-chunks/chunk-IXYBN6D2.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]="e02d896b-ffa2-5bfa-83dc-d567e1ecd8be")}catch{}})();export{xe as ACTIONABILITY_ORDERING_KINDS,F as BRIEF_LIST_FIELDS,to as CONTEXT_EVALUATION_METRIC_NAMES,a as CONTEXT_OUTPUT_VALUES,ao as CONTEXT_PACKING_PROFILES,Ze as CONTEXT_RELEVANCE_SERVICE,Qe as CONTEXT_RELEVANCE_SIGNAL_NAMES,io as CONTEXT_SIGNAL_SET_VERSION,so as CONTEXT_SIGNAL_STORE_FORMAT_VERSION,xo as CONTEXT_SIGNAL_STORE_WARNING_DETAILS,G as CONTEXT_USAGE_LIMITS,yo as ContextSignalStore,H as ContextUsageValidationError,Po as DEFAULT_CHILD_SAMPLE_LIMIT,v as DEFAULT_COMPACT_LIST_FIELDS,ae as DEFAULT_DERIVED_INDEX_MINIMUM_ITEMS,bo as DEFAULT_WORKSPACE_MEMORY_MINIMUM_ITEMS,k as EVAL_METRIC_NAMES,A as GET_DEPTH_INPUT_VALUES,R as GET_DEPTH_VALUES,co as JsonFileContextSignalStoreAdapter,S as LIST_COMMAND_DEFAULT_PROJECTIONS,Fe as LIST_SORT_FIELDS,Se as LIST_SORT_ORDER_VALUES,Ao as MAX_CHILD_PROJECTION_ITEMS,ko as NEXT_OUTPUT_VALUES,qe as NEXT_RANKING_POLICIES,Oe as OutputEnvelopeFitError,We as PM_COMPLETE_LIST_FINDING_CODES,je as PmCompleteListValidationError,q as QUERY_CURSOR_CONTRACT,Be as _testOnly,Ro as _testOnlyAggregateCommand,Uo as _testOnlyGetCommand,Do as _testOnlyNextCommand,Zo as _testOnlySearchCommand,me as acquireItemMetadataDerivedIndexLock,f as analyzeDuplicateItems,h as applyContextTagProjection,Me as applyFilterValueEcho,ze as assertCompleteListResult,J as attachContextUsageServingReceipt,C as buildChildrenByParent,Go as buildCompactSearchFilterSummary,Re as buildContentFilterEcho,uo as buildContextSignalSnapshot,Ae as buildGovernanceMissingFilterEcho,Bo as buildItemChildrenRollup,Ye as buildItemContextRelevanceCandidates,Ho as buildVerboseSearchFilters,Co as buildWorkspaceMemorySnapshot,Ve as certifyCompleteListResult,Ko as classifyImplicitSemanticFallbackReason,le as collectBlockedByIds,ce as collectBlockedByIdsFromCorpus,Q as collectContextUsageDeliveredItemIds,ge as collectDependencyBlockedIds,Jo as collectErrorCauseCodes,u as collectSubtreeIds,c as compareCriticalItems,Ce as computeActionabilityReport,Le as createCompleteListOptions,W as createQueryFingerprint,Xo as createSearchCursorFingerprint,V as decodeQueryCursor,L as decodeQueryCursorEnvelope,N as decodeQueryCursorState,$e as defaultScoreContextCandidates,j as encodeQueryCursor,ro as evaluateContextRanking,D as evaluateMetricFloors,n as executeEmbeddingBatchesWithRetry,Y as finalizeContextUsageDelivery,Ue as fitOutputEnvelope,Yo as formatVectorIndexRecoveryWarnings,ue as indexBlockedByIds,Ne as inspectCompleteListResult,P as listGetProjectionFields,M as listListProjectionFields,r as measureItemMetadataReadWork,w as mergeSortedWarnings,mo as packContextCandidates,y as packRankedContextItems,X as paginateQueryRows,x as parseContextDepth,m as parseContextFocusFields,l as parseContextSections,lo as parseContextSignalSnapshot,E as parseEvalMetricFloors,Ie as parseIntegerLimit,re as parseLimit,he as parseMultiValueFilter,we as parsePriority,Ee as parsePriorityFilterSet,_e as parseStringFilterSet,Te as parseType,ke as parseTypeFilterSet,vo as partitionDecisionEntries,d as projectContextFocusRows,K as propagateContextUsageServingReceipt,ne as queryItemMetadataIndex,fe as queryLinkedFileMetadataIndex,pe as querySimilarItemMetadataIndex,te as readContextUsageAffinity,B as readHistoryEntries,de as readItemMetadataDerivedIndexState,go as readWorkspaceContextSignals,Io as readWorkspaceMemory,$ as recordContextUsageDelivery,Z as recordContextUsageServing,ee as recordContextUsageTouch,oe as recordContextUsageTouches,se as refreshItemMetadataDerivedIndex,He as renderCalendarMarkdown,Je as renderCalendarToon,T as renderContextMarkdown,So as renderNextMarkdown,Ge as resolveCalendarOutputFormat,ve as resolveContentFieldFilters,s as resolveContextOutputFormat,i as resolveContextTokenBudget,Lo as resolveEffectiveSearchMode,Vo as resolveHybridSemanticWeight,ye as resolveItemBlockers,ie as resolveItemExecutionRole,De as resolveMissingMetadataFilters,Eo as resolveNextOutputFormat,z as resolveQueryCursorStart,jo as resolveSearchMaxResults,qo as resolveSearchPage,No as resolveSearchScoreThreshold,zo as resolveSearchTuning,Qo as resolveVectorIndexRecovery,p as runActivity,Mo as runAggregate,Ke as runCalendar,_ as runContext,po as runContextEvaluationCorpus,no as runContextEvaluationScenario,Xe as runDuplicates,Oo as runGet,Wo as runHistory,Pe as runList,Fo as runNext,$o as runSearch,eo as scoreContextCandidates,oo as scoreContextCandidatesWithActiveExtensions,ho as searchWorkspaceMemory,_o as searchWorkspaceMemoryReadResult,be as selectActionableEntries,U as selectCursorSemanticOptions,To as selectWorkspaceMemory,wo as selectWorkspaceMemoryRollups,fo as summarizeContextEvaluationReports,I as toContextFocusItem,g as toContextPackingSummary,b as toContextRankingSummary,O as verifyHistoryChain};
1
+ import{$ as To,Aa as Mo,B as p,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 Qo,U as co,Ua as Yo,V as yo,Va as Zo,W as go,Wa as $o,X as bo,Xa as k,Y as Co,Ya as E,Z as Io,Za as D,_ as wo,a as Oe,aa as ho,b as Ue,ba as _o,c as We,ca as a,d as je,da as m,e as Le,ea as d,f as Ne,fa as s,g as Ve,ga as i,h as ze,ha as x,i as Xe,ia as l,ja as u,ka as c,la as y,ma as g,na as b,oa as C,pa as I,qa as w,r as qe,ra as T,s as Ge,sa as h,t as He,ta as _,u as Je,ua as ko,v as Ke,va as Eo,wa as Do,xa as vo,ya as Fo,za as So}from"./focused-chunks/chunk-ONHUG7IL.js";import{D as f,a as Ie,b as we,c as Te,d as he,e as _e,f as ke,g as Ee,p as De,q as ve,r as Fe,s as Se,t as Me,u as Re,v as Ae,w as Pe,x as Be}from"./focused-chunks/chunk-IGMFXB5W.js";import"./focused-chunks/chunk-OAIAZHRG.js";import{Ja as n,ua as re}from"./focused-chunks/chunk-T3NMYMW4.js";import{b as v,c as F,d as S,e as M,g as R,h as A,j as P}from"./focused-chunks/chunk-ICEHI4SN.js";import"./focused-chunks/chunk-7Z2NYAK4.js";import{a as ie,b as xe,c as le,d as ue,e as ce,f as ye,g as ge,h as be,i as Ce}from"./focused-chunks/chunk-OPY43DNJ.js";import"./focused-chunks/chunk-GHQVM6K6.js";import{A as pe,B as ae,D as me,E as de,F as se,w as r,y as ne,z as fe}from"./focused-chunks/chunk-HO2YUD4P.js";import"./focused-chunks/chunk-MTBC32ZR.js";import"./focused-chunks/chunk-I5LGPUWH.js";import"./focused-chunks/chunk-C3O6JJPO.js";import{$g as z,Be as O,Vg as U,Wg as W,Xg as j,Yg as L,Zg as N,_g as V,ah as X,bh as q,ch as G,dh as H,eh as J,fh as K,gh as Q,hh as Y,ih as Z,jh as $,kh as ee,lh as oe,mh as te,pe as B}from"./focused-chunks/chunk-A2CLYPDA.js";import"./focused-chunks/chunk-IXYBN6D2.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]="e02d896b-ffa2-5bfa-83dc-d567e1ecd8be")}catch{}})();export{xe as ACTIONABILITY_ORDERING_KINDS,F as BRIEF_LIST_FIELDS,to as CONTEXT_EVALUATION_METRIC_NAMES,a as CONTEXT_OUTPUT_VALUES,ao as CONTEXT_PACKING_PROFILES,Ze as CONTEXT_RELEVANCE_SERVICE,Qe as CONTEXT_RELEVANCE_SIGNAL_NAMES,io as CONTEXT_SIGNAL_SET_VERSION,so as CONTEXT_SIGNAL_STORE_FORMAT_VERSION,xo as CONTEXT_SIGNAL_STORE_WARNING_DETAILS,G as CONTEXT_USAGE_LIMITS,yo as ContextSignalStore,H as ContextUsageValidationError,Po as DEFAULT_CHILD_SAMPLE_LIMIT,v as DEFAULT_COMPACT_LIST_FIELDS,ae as DEFAULT_DERIVED_INDEX_MINIMUM_ITEMS,bo as DEFAULT_WORKSPACE_MEMORY_MINIMUM_ITEMS,k as EVAL_METRIC_NAMES,A as GET_DEPTH_INPUT_VALUES,R as GET_DEPTH_VALUES,co as JsonFileContextSignalStoreAdapter,S as LIST_COMMAND_DEFAULT_PROJECTIONS,Fe as LIST_SORT_FIELDS,Se as LIST_SORT_ORDER_VALUES,Ao as MAX_CHILD_PROJECTION_ITEMS,ko as NEXT_OUTPUT_VALUES,qe as NEXT_RANKING_POLICIES,Oe as OutputEnvelopeFitError,We as PM_COMPLETE_LIST_FINDING_CODES,je as PmCompleteListValidationError,q as QUERY_CURSOR_CONTRACT,Be as _testOnly,Ro as _testOnlyAggregateCommand,Uo as _testOnlyGetCommand,Do as _testOnlyNextCommand,Zo as _testOnlySearchCommand,me as acquireItemMetadataDerivedIndexLock,f as analyzeDuplicateItems,h as applyContextTagProjection,Me as applyFilterValueEcho,ze as assertCompleteListResult,J as attachContextUsageServingReceipt,C as buildChildrenByParent,Go as buildCompactSearchFilterSummary,Re as buildContentFilterEcho,uo as buildContextSignalSnapshot,Ae as buildGovernanceMissingFilterEcho,Bo as buildItemChildrenRollup,Ye as buildItemContextRelevanceCandidates,Ho as buildVerboseSearchFilters,Co as buildWorkspaceMemorySnapshot,Ve as certifyCompleteListResult,Ko as classifyImplicitSemanticFallbackReason,le as collectBlockedByIds,ce as collectBlockedByIdsFromCorpus,Q as collectContextUsageDeliveredItemIds,ge as collectDependencyBlockedIds,Jo as collectErrorCauseCodes,u as collectSubtreeIds,c as compareCriticalItems,Ce as computeActionabilityReport,Le as createCompleteListOptions,W as createQueryFingerprint,Xo as createSearchCursorFingerprint,V as decodeQueryCursor,L as decodeQueryCursorEnvelope,N as decodeQueryCursorState,$e as defaultScoreContextCandidates,j as encodeQueryCursor,ro as evaluateContextRanking,D as evaluateMetricFloors,n as executeEmbeddingBatchesWithRetry,Y as finalizeContextUsageDelivery,Ue as fitOutputEnvelope,Yo as formatVectorIndexRecoveryWarnings,ue as indexBlockedByIds,Ne as inspectCompleteListResult,P as listGetProjectionFields,M as listListProjectionFields,r as measureItemMetadataReadWork,w as mergeSortedWarnings,mo as packContextCandidates,y as packRankedContextItems,X as paginateQueryRows,x as parseContextDepth,m as parseContextFocusFields,l as parseContextSections,lo as parseContextSignalSnapshot,E as parseEvalMetricFloors,Ie as parseIntegerLimit,re as parseLimit,he as parseMultiValueFilter,we as parsePriority,Ee as parsePriorityFilterSet,_e as parseStringFilterSet,Te as parseType,ke as parseTypeFilterSet,vo as partitionDecisionEntries,d as projectContextFocusRows,K as propagateContextUsageServingReceipt,ne as queryItemMetadataIndex,fe as queryLinkedFileMetadataIndex,pe as querySimilarItemMetadataIndex,te as readContextUsageAffinity,B as readHistoryEntries,de as readItemMetadataDerivedIndexState,go as readWorkspaceContextSignals,Io as readWorkspaceMemory,$ as recordContextUsageDelivery,Z as recordContextUsageServing,ee as recordContextUsageTouch,oe as recordContextUsageTouches,se as refreshItemMetadataDerivedIndex,He as renderCalendarMarkdown,Je as renderCalendarToon,T as renderContextMarkdown,So as renderNextMarkdown,Ge as resolveCalendarOutputFormat,ve as resolveContentFieldFilters,s as resolveContextOutputFormat,i as resolveContextTokenBudget,Lo as resolveEffectiveSearchMode,Vo as resolveHybridSemanticWeight,ye as resolveItemBlockers,ie as resolveItemExecutionRole,De as resolveMissingMetadataFilters,Eo as resolveNextOutputFormat,z as resolveQueryCursorStart,jo as resolveSearchMaxResults,qo as resolveSearchPage,No as resolveSearchScoreThreshold,zo as resolveSearchTuning,Qo as resolveVectorIndexRecovery,p as runActivity,Mo as runAggregate,Ke as runCalendar,_ as runContext,po as runContextEvaluationCorpus,no as runContextEvaluationScenario,Xe as runDuplicates,Oo as runGet,Wo as runHistory,Pe as runList,Fo as runNext,$o as runSearch,eo as scoreContextCandidates,oo as scoreContextCandidatesWithActiveExtensions,ho as searchWorkspaceMemory,_o as searchWorkspaceMemoryReadResult,be as selectActionableEntries,U as selectCursorSemanticOptions,To as selectWorkspaceMemory,wo as selectWorkspaceMemoryRollups,fo as summarizeContextEvaluationReports,I as toContextFocusItem,g as toContextPackingSummary,b as toContextRankingSummary,O as verifyHistoryChain};
2
2
  //# sourceMappingURL=sdk-query.js.map
@@ -1,2 +1,2 @@
1
- import{$a as Dc,$b as Dd,A as tb,Aa as Zb,Ab as cd,Ba as _b,Bb as dd,Ca as $b,Cb as ed,Da as ac,Db as fd,Ea as bc,Eb as gd,Fa as cc,Fb as hd,Ga as dc,Gb as id,Ha as ec,Hb as jd,Ia as fc,Ib as kd,Ja as gc,Jb as ld,Ka as hc,Kb as md,La as ic,Lb as nd,Ma as jc,Mb as od,Na as kc,Nb as pd,Oa as lc,Ob as qd,Pa as mc,Pb as rd,Qa as nc,Qb as sd,R as Gb,Ra as oc,Rb as td,S as Hb,Sa as pc,Sb as ud,T as Ib,Ta as qc,Tb as vd,U as Jb,Ua as rc,Ub as wd,Va as sc,Vb as xd,Wa as yc,Wb as yd,Xa as zc,Xb as zd,Ya as Ac,Yb as Ad,Za as Bc,Zb as Bd,_a as Cc,_b as Cd,ab as Ec,ac as Ed,bb as Fc,bc as Fd,cb as Gc,cc as Gd,db as Hc,dc as Hd,eb as Ic,ec as Id,fb as Jc,fc as Jd,gb as Kc,gc as Kd,hb as Lc,hc as Ld,ia as Ob,ib as Mc,ic as Md,ja as Pb,jb as Nc,jc as Nd,kb as Oc,kc as Od,lb as Pc,lc as Pd,mb as Qc,mc as Qd,nb as Rc,nc as Rd,ob as Sc,oc as Sd,pb as Tc,pc as Td,q as db,qb as Uc,qc as Ud,r as eb,ra as Qb,rb as Vc,rc as Vd,s as fb,sa as Rb,sb as Wc,sc as Wd,t as gb,ta as Sb,tb as Xc,tc as Xd,u as hb,ua as Tb,ub as Yc,uc as Yd,va as Ub,vb as Zc,vc as Zd,wa as Vb,wb as _c,wc as _d,x as pb,xa as Wb,xb as $c,xc as $d,y as qb,ya as Xb,yb as ad,yc as ae,z as rb,za as Yb,zb as bd,zc as be}from"./chunks/chunk-77MGDTK4.js";import"./chunks/chunk-DXSZL3T6.js";import{L as Mb,m as Fb,n as Kb,u as Lb}from"./chunks/chunk-QANUQMDL.js";import{$d as tc,Nd as Nb,_c as sb,ae as uc,be as vc,ce as wc,de as xc,gd as Cb,hd as Db,id as Eb,mc as jb,nb as ib,nc as kb,oc as lb,qc as mb,sc as nb,tc as ob}from"./chunks/chunk-2WHXFKMY.js";import"./chunks/chunk-HQYIKAC6.js";import"./chunks/chunk-36R3JTAD.js";import{A as bb,B as cb,w as _a,x as $a,z as ab}from"./chunks/chunk-3IU2S5UQ.js";import"./chunks/chunk-H64BNM4A.js";import{a as Wa,b as Xa,e as Ya,f as Za}from"./chunks/chunk-Y4LXVPA5.js";import{Ab as vb,Bb as wb,Cb as xb,Hc as zb,Ic as Ab,Mc as Bb,U as Va,qc as yb,zb as ub}from"./chunks/chunk-X5TFNFTS.js";import"./chunks/chunk-RXNBNF6O.js";import"./chunks/chunk-7K2RUKMK.js";import"./chunks/chunk-VLKCFZY6.js";import"./chunks/chunk-4FIN2XWC.js";import"./chunks/chunk-IB7UB5TE.js";import{Nc as Sa,Oc as Ta,Qc as Ua,bb as Fa,fc as Ka,gc as La,hc as Ma,i as n,ic as Na,ja as za,ka as Aa,kc as Oa,la as Ba,mc as Pa,oc as Qa,pc as Ra,qb as Ga,rb as Ha,sa as Ca,ta as Da,tb as Ia,ub as Ja}from"./chunks/chunk-AM26RAG7.js";import{v as Ea}from"./chunks/chunk-CR5GC3VO.js";import{Ad as W,Af as qa,Bf as ra,Cc as H,Cf as sa,Df as ta,Ec as I,He as $,Ka as z,Qa as A,Rc as J,Sa as B,Sc as K,Uc as L,Va as C,Vc as M,Wa as D,Wc as N,Xb as F,Xc as O,Ya as E,Yb as G,Yc as P,_c as Q,ca as s,cj as wa,da as t,e as c,ea as u,f as d,g as e,h as f,i as g,j as h,ja as v,k as i,kd as R,kf as aa,l as j,la as w,ld as S,lf as ba,m as k,ma as x,mf as ca,n as l,na as y,nd as T,nf as da,nj as xa,o as m,od as U,of as ea,pf as fa,qf as ga,rf as ha,rj as ya,se as X,sf as ia,sh as ua,te as Y,tf as ja,th as va,ue as Z,uf as ka,ve as _,vf as la,wf as ma,xf as na,yf as oa,zd as V,zf as pa}from"./chunks/chunk-7UUPLMCU.js";import"./chunks/chunk-VS565KBX.js";import"./chunks/chunk-SPPHDVZE.js";import{A as a,C as b,E as o,H as p,K as q,M as r}from"./chunks/chunk-5OFMWP3Q.js";import"./chunks/chunk-XAWE4EAK.js";export{J as BASELINE_ITEM_FORMAT_VERSION,s as BUILTIN_ITEM_TYPE_VALUES,y as CONFIDENCE_TEXT_VALUES,yb as CONTEXT_OUTPUT_VALUES,K as CURRENT_ITEM_FORMAT_VERSION,jb as DEFAULT_TERMINAL_TRANSITION_POLICY,v as DEPENDENCY_KIND_VALUES,a as EXIT_CODE,X as HISTORY_EVENT_CLASSIFICATION_VERSION,x as ISSUE_SEVERITY_VALUES,t as ITEM_TYPE_VALUES,Y as MAINTENANCE_HISTORY_OPERATIONS,d as MAX_WORKFLOW_POLICIES,e as MAX_WORKFLOW_POLICY_TERMS,Ab as NEXT_OUTPUT_VALUES,Ka as PM_CLI_ERROR_DETAILS_LIMITS,Pa as PM_CLI_EXPECTED_ERROR_NAME,ia as PM_COMMAND_OUTPUT_BUDGET_CONTRACTS,da as PM_DIAGNOSTIC_DEGRADATION_STEPS,ea as PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS,ca as PM_DIAGNOSTIC_OUTPUT_CLASSES,oa as PM_GENERIC_REFUSAL_GUIDANCE,Xa as PM_GITIGNORE_END,Wa as PM_GITIGNORE_START,ba as PM_OUTPUT_BUDGET_CLASSES,aa as PM_OUTPUT_DEGRADATION_STEPS,sa as PM_RECOVERY_ECHO_FIELDS,b as PmCliError,yc as PmClient,db as PmCompleteListValidationError,w as RISK_VALUES,Qb as SEARCH_EXTENSION_FLAG_DEFINITIONS,u as STATUS_VALUES,Z as SUBSTANTIVE_HISTORY_OPERATIONS,c as WORKFLOW_POLICY_ACTIONS,$a as WORKFLOW_POLICY_DOCUMENT_SCHEMA,_a as WORKFLOW_POLICY_SCHEMA,V as acquireLock,W as acquireLockLease,Fc as aggregate,be as analyzeSdkActionCoverage,Rc as append,va as appendHistoryEntry,mb as applyTerminalOrderingPolicy,hb as assertCompleteListResult,ab as buildWorkflowCompletenessCheck,U as canonicalDocument,gb as certifyCompleteListResult,Ad as claim,Bd as claimNext,_ as classifyHistoryEvent,N as classifyItemFormatVersion,Pb as clearWorkspaceContractsCache,zd as close,nb as closeItem,Jd as closeTask,Ic as comments,nc as commitImportedItem,Tc as config,zc as context,Dd as copy,wd as create,eb as createCompleteListOptions,ua as createHistoryEntry,bb as createLifecycleCompletenessPolicies,Qa as createPmCliExpectedError,ga as createPmCommandOutputBudget,m as createWorkflowPolicyEvaluator,ha as definePmCommandOutputBudget,Ed as deleteItem,Pc as deps,Oc as docs,Hc as duplicates,L as effectiveItemFormatVersion,mc as emptyImportedDocument,Za as ensurePmGitignore,lc as ensureTrackerInitialized,ka as estimatePmOutputTokens,l as evaluateWorkflowPolicies,Kd as extension,Md as extensionActivate,Nd as extensionDeactivate,Ld as extensionList,Lc as files,Mc as filesDiscover,Nc as filesLookup,Gd as focus,qd as gc,Ba as generateItemId,Dc as get,wa as getActiveExtensionRegistrations,_d as getContracts,E as getHistoryPath,D as getItemPath,Ya as getPmGitignoreBlock,C as getSettingsPath,Rb as getWorkspaceContracts,Qc as graph,pd as health,ud as historyCompact,vd as historyCompactBulk,rd as historyRedact,sd as historyRepair,td as historyRepairAll,fa as inferPmOutputBudgetClass,Sc as init,fb as inspectCompleteListResult,pa as isGenericRefusalRequired,qa as isGenericRefusalWhy,La as isPmCliErrorDetails,Ra as isPmCliExpectedError,Q as isTerminalStatus,G as isTimestampLiteral,$ as jaccardSimilarity,Kc as learnings,Ac as list,Bc as listAllComplete,Ia as listAllItemMetadata,Ja as listAllItemMetadataLight,Gb as loadCreateTemplateOptions,Ga as locateItem,Ec as next,M as normalizeItemFormatVersion,Aa as normalizeItemId,R as normalizeItemMetadata,za as normalizeRawItemId,Sa as normalizeSimilarityText,P as normalizeStatusInput,Jc as notes,F as nowIso,Xd as packageActivate,Wd as packageCatalog,Yd as packageDeactivate,Ud as packageDescribe,Sd as packageDoctor,Qd as packageInstall,Od as packageLifecycle,Pd as packageList,Td as packageManage,Vd as packageReload,Rd as packageUninstall,n as parseTags,f as parseWorkflowPolicy,g as parseWorkflowPolicyDocument,o as pathExists,Id as pauseTask,jd as profile,md as profileApply,nd as profileLint,kd as profileList,ld as profileShow,ta as projectLeanRecoveryPayload,Oa as projectPmCliErrorContextDetails,Ma as projectPmCliErrorDetails,ma as projectPmDiagnosticOutput,na as projectPmDiagnosticText,Tb as readBooleanOption,Ub as readCsvListOption,p as readFileIfExists,Ha as readLocatedItem,Ob as readRequiredString,Ea as readSettings,Sb as readStringOption,Fa as readWorkflowPolicies,h as readWorkflowPolicyField,Cd as release,r as removeFileIfExists,vb as renderCalendarMarkdown,wb as renderCalendarToon,qc as renderGuideMarkdown,yd as reopen,lb as requireTerminalReason,ub as resolveCalendarOutputFormat,oc as resolveGuideOutputFormat,A as resolveImplicitPmRoot,z as resolveItemTypeRegistry,ja as resolvePmCommandOutputBudget,la as resolvePmDiagnosticOutputBudget,B as resolvePmRoot,I as resolveRuntimeFieldRegistry,H as resolveRuntimeStatusRegistry,kb as resolveTerminalReason,Fd as restore,ae as runAction,ya as runActiveOnReadHooks,xa as runActiveOnWriteHooks,Kb as runAggregate,xb as runCalendar,ob as runClose,Eb as runCloseTask,rc as runCompletion,zb as runContext,pb as runCopy,qb as runDelete,ib as runDuplicates,rb as runFocus,Lb as runGet,pc as runGuide,Va as runList,Bb as runNext,Db as runPauseTask,sc as runReindex,tb as runReopen,Fb as runRestore,Mb as runSearch,Cb as runStartTask,Nb as runStats,Ib as runTemplatesList,Hb as runTemplatesSave,Jb as runTemplatesShow,tc as runTestRunsList,vc as runTestRunsLogs,xc as runTestRunsResume,uc as runTestRunsStatus,wc as runTestRunsStop,sb as runUpdate,$d as runWithActiveExtensions,cb as runWorkflowPolicyAction,O as scanItemFormatVersions,Uc as schema,$c as schemaAddField,Zc as schemaAddStatus,Xc as schemaAddType,dd as schemaApplyPreset,ed as schemaInferTypes,Vc as schemaList,bd as schemaListFields,hd as schemaRemapStatus,ad as schemaRemoveField,_c as schemaRemoveStatus,Yc as schemaRemoveType,gd as schemaRenameField,fd as schemaRenameType,Wc as schemaShow,cd as schemaShowField,id as schemaShowStatus,Ua as scoreItemSimilarity,Cc as search,kc as selectImportAuthor,T as serializeItemDocument,Na as snapshotPmCliErrorContext,S as splitFrontMatter,Hd as startTask,Gc as stats,Wb as toEstimatedMinutesValue,$b as toImportBoolean,dc as toImportConfidence,ic as toImportDeferredFields,_b as toImportInteger,hc as toImportLinkedDocs,gc as toImportLinkedFiles,jc as toImportLinkedTests,fc as toImportLogEntries,ec as toImportNormalizedEnum,cc as toImportNumberMap,Xb as toImportPriority,Zb as toImportStatus,ac as toImportStringList,bc as toImportStringMap,Yb as toImportTags,Vb as toNonEmptyImportString,Ta as tokenizeSimilarityText,xd as update,Zd as upgrade,od as validate,Ca as withCliMutationInput,Da as withLiteralMutationInput,ra as withoutGenericRefusalExamples,j as workflowApprovalFingerprint,k as workflowPolicyApplies,i as workflowPolicyFingerprint,q as writeFileAtomic};
1
+ import{$a as Dc,$b as Dd,A as tb,Aa as Zb,Ab as cd,Ba as _b,Bb as dd,Ca as $b,Cb as ed,Da as ac,Db as fd,Ea as bc,Eb as gd,Fa as cc,Fb as hd,Ga as dc,Gb as id,Ha as ec,Hb as jd,Ia as fc,Ib as kd,Ja as gc,Jb as ld,Ka as hc,Kb as md,La as ic,Lb as nd,Ma as jc,Mb as od,Na as kc,Nb as pd,Oa as lc,Ob as qd,Pa as mc,Pb as rd,Qa as nc,Qb as sd,R as Gb,Ra as oc,Rb as td,S as Hb,Sa as pc,Sb as ud,T as Ib,Ta as qc,Tb as vd,U as Jb,Ua as rc,Ub as wd,Va as sc,Vb as xd,Wa as yc,Wb as yd,Xa as zc,Xb as zd,Ya as Ac,Yb as Ad,Za as Bc,Zb as Bd,_a as Cc,_b as Cd,ab as Ec,ac as Ed,bb as Fc,bc as Fd,cb as Gc,cc as Gd,db as Hc,dc as Hd,eb as Ic,ec as Id,fb as Jc,fc as Jd,gb as Kc,gc as Kd,hb as Lc,hc as Ld,ia as Ob,ib as Mc,ic as Md,ja as Pb,jb as Nc,jc as Nd,kb as Oc,kc as Od,lb as Pc,lc as Pd,mb as Qc,mc as Qd,nb as Rc,nc as Rd,ob as Sc,oc as Sd,pb as Tc,pc as Td,q as db,qb as Uc,qc as Ud,r as eb,ra as Qb,rb as Vc,rc as Vd,s as fb,sa as Rb,sb as Wc,sc as Wd,t as gb,ta as Sb,tb as Xc,tc as Xd,u as hb,ua as Tb,ub as Yc,uc as Yd,va as Ub,vb as Zc,vc as Zd,wa as Vb,wb as _c,wc as _d,x as pb,xa as Wb,xb as $c,xc as $d,y as qb,ya as Xb,yb as ad,yc as ae,z as rb,za as Yb,zb as bd,zc as be}from"./chunks/chunk-S3RMFLEG.js";import"./chunks/chunk-AGU7632B.js";import{L as Mb,m as Fb,n as Kb,u as Lb}from"./chunks/chunk-SSZBVRIN.js";import{$d as tc,Nd as Nb,_c as sb,ae as uc,be as vc,ce as wc,de as xc,gd as Cb,hd as Db,id as Eb,mc as jb,nb as ib,nc as kb,oc as lb,qc as mb,sc as nb,tc as ob}from"./chunks/chunk-7ETRLLK3.js";import"./chunks/chunk-HQYIKAC6.js";import"./chunks/chunk-WKHS4QC6.js";import{A as bb,B as cb,w as _a,x as $a,z as ab}from"./chunks/chunk-OD2I3SFQ.js";import"./chunks/chunk-H64BNM4A.js";import{a as Wa,b as Xa,e as Ya,f as Za}from"./chunks/chunk-Y4LXVPA5.js";import{Ab as vb,Bb as wb,Cb as xb,Hc as zb,Ic as Ab,Mc as Bb,U as Va,qc as yb,zb as ub}from"./chunks/chunk-CGTVDSAR.js";import"./chunks/chunk-TS2CZE3O.js";import"./chunks/chunk-VETSGCF4.js";import"./chunks/chunk-T3E3WNHO.js";import"./chunks/chunk-QK7RAN7R.js";import"./chunks/chunk-IB7UB5TE.js";import{Nc as Sa,Oc as Ta,Qc as Ua,bb as Fa,fc as Ka,gc as La,hc as Ma,i as n,ic as Na,ja as za,ka as Aa,kc as Oa,la as Ba,mc as Pa,oc as Qa,pc as Ra,qb as Ga,rb as Ha,sa as Ca,ta as Da,tb as Ia,ub as Ja}from"./chunks/chunk-2VH6COJE.js";import{v as Ea}from"./chunks/chunk-CR5GC3VO.js";import{Ad as W,Af as qa,Bf as ra,Cc as H,Cf as sa,Df as ta,Ec as I,He as $,Ka as z,Qa as A,Rc as J,Sa as B,Sc as K,Uc as L,Va as C,Vc as M,Wa as D,Wc as N,Xb as F,Xc as O,Ya as E,Yb as G,Yc as P,_c as Q,ca as s,cj as wa,da as t,e as c,ea as u,f as d,g as e,h as f,i as g,j as h,ja as v,k as i,kd as R,kf as aa,l as j,la as w,ld as S,lf as ba,m as k,ma as x,mf as ca,n as l,na as y,nd as T,nf as da,nj as xa,o as m,od as U,of as ea,pf as fa,qf as ga,rf as ha,rj as ya,se as X,sf as ia,sh as ua,te as Y,tf as ja,th as va,ue as Z,uf as ka,ve as _,vf as la,wf as ma,xf as na,yf as oa,zd as V,zf as pa}from"./chunks/chunk-7UUPLMCU.js";import"./chunks/chunk-VS565KBX.js";import"./chunks/chunk-SPPHDVZE.js";import{A as a,C as b,E as o,H as p,K as q,M as r}from"./chunks/chunk-5OFMWP3Q.js";import"./chunks/chunk-XAWE4EAK.js";export{J as BASELINE_ITEM_FORMAT_VERSION,s as BUILTIN_ITEM_TYPE_VALUES,y as CONFIDENCE_TEXT_VALUES,yb as CONTEXT_OUTPUT_VALUES,K as CURRENT_ITEM_FORMAT_VERSION,jb as DEFAULT_TERMINAL_TRANSITION_POLICY,v as DEPENDENCY_KIND_VALUES,a as EXIT_CODE,X as HISTORY_EVENT_CLASSIFICATION_VERSION,x as ISSUE_SEVERITY_VALUES,t as ITEM_TYPE_VALUES,Y as MAINTENANCE_HISTORY_OPERATIONS,d as MAX_WORKFLOW_POLICIES,e as MAX_WORKFLOW_POLICY_TERMS,Ab as NEXT_OUTPUT_VALUES,Ka as PM_CLI_ERROR_DETAILS_LIMITS,Pa as PM_CLI_EXPECTED_ERROR_NAME,ia as PM_COMMAND_OUTPUT_BUDGET_CONTRACTS,da as PM_DIAGNOSTIC_DEGRADATION_STEPS,ea as PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS,ca as PM_DIAGNOSTIC_OUTPUT_CLASSES,oa as PM_GENERIC_REFUSAL_GUIDANCE,Xa as PM_GITIGNORE_END,Wa as PM_GITIGNORE_START,ba as PM_OUTPUT_BUDGET_CLASSES,aa as PM_OUTPUT_DEGRADATION_STEPS,sa as PM_RECOVERY_ECHO_FIELDS,b as PmCliError,yc as PmClient,db as PmCompleteListValidationError,w as RISK_VALUES,Qb as SEARCH_EXTENSION_FLAG_DEFINITIONS,u as STATUS_VALUES,Z as SUBSTANTIVE_HISTORY_OPERATIONS,c as WORKFLOW_POLICY_ACTIONS,$a as WORKFLOW_POLICY_DOCUMENT_SCHEMA,_a as WORKFLOW_POLICY_SCHEMA,V as acquireLock,W as acquireLockLease,Fc as aggregate,be as analyzeSdkActionCoverage,Rc as append,va as appendHistoryEntry,mb as applyTerminalOrderingPolicy,hb as assertCompleteListResult,ab as buildWorkflowCompletenessCheck,U as canonicalDocument,gb as certifyCompleteListResult,Ad as claim,Bd as claimNext,_ as classifyHistoryEvent,N as classifyItemFormatVersion,Pb as clearWorkspaceContractsCache,zd as close,nb as closeItem,Jd as closeTask,Ic as comments,nc as commitImportedItem,Tc as config,zc as context,Dd as copy,wd as create,eb as createCompleteListOptions,ua as createHistoryEntry,bb as createLifecycleCompletenessPolicies,Qa as createPmCliExpectedError,ga as createPmCommandOutputBudget,m as createWorkflowPolicyEvaluator,ha as definePmCommandOutputBudget,Ed as deleteItem,Pc as deps,Oc as docs,Hc as duplicates,L as effectiveItemFormatVersion,mc as emptyImportedDocument,Za as ensurePmGitignore,lc as ensureTrackerInitialized,ka as estimatePmOutputTokens,l as evaluateWorkflowPolicies,Kd as extension,Md as extensionActivate,Nd as extensionDeactivate,Ld as extensionList,Lc as files,Mc as filesDiscover,Nc as filesLookup,Gd as focus,qd as gc,Ba as generateItemId,Dc as get,wa as getActiveExtensionRegistrations,_d as getContracts,E as getHistoryPath,D as getItemPath,Ya as getPmGitignoreBlock,C as getSettingsPath,Rb as getWorkspaceContracts,Qc as graph,pd as health,ud as historyCompact,vd as historyCompactBulk,rd as historyRedact,sd as historyRepair,td as historyRepairAll,fa as inferPmOutputBudgetClass,Sc as init,fb as inspectCompleteListResult,pa as isGenericRefusalRequired,qa as isGenericRefusalWhy,La as isPmCliErrorDetails,Ra as isPmCliExpectedError,Q as isTerminalStatus,G as isTimestampLiteral,$ as jaccardSimilarity,Kc as learnings,Ac as list,Bc as listAllComplete,Ia as listAllItemMetadata,Ja as listAllItemMetadataLight,Gb as loadCreateTemplateOptions,Ga as locateItem,Ec as next,M as normalizeItemFormatVersion,Aa as normalizeItemId,R as normalizeItemMetadata,za as normalizeRawItemId,Sa as normalizeSimilarityText,P as normalizeStatusInput,Jc as notes,F as nowIso,Xd as packageActivate,Wd as packageCatalog,Yd as packageDeactivate,Ud as packageDescribe,Sd as packageDoctor,Qd as packageInstall,Od as packageLifecycle,Pd as packageList,Td as packageManage,Vd as packageReload,Rd as packageUninstall,n as parseTags,f as parseWorkflowPolicy,g as parseWorkflowPolicyDocument,o as pathExists,Id as pauseTask,jd as profile,md as profileApply,nd as profileLint,kd as profileList,ld as profileShow,ta as projectLeanRecoveryPayload,Oa as projectPmCliErrorContextDetails,Ma as projectPmCliErrorDetails,ma as projectPmDiagnosticOutput,na as projectPmDiagnosticText,Tb as readBooleanOption,Ub as readCsvListOption,p as readFileIfExists,Ha as readLocatedItem,Ob as readRequiredString,Ea as readSettings,Sb as readStringOption,Fa as readWorkflowPolicies,h as readWorkflowPolicyField,Cd as release,r as removeFileIfExists,vb as renderCalendarMarkdown,wb as renderCalendarToon,qc as renderGuideMarkdown,yd as reopen,lb as requireTerminalReason,ub as resolveCalendarOutputFormat,oc as resolveGuideOutputFormat,A as resolveImplicitPmRoot,z as resolveItemTypeRegistry,ja as resolvePmCommandOutputBudget,la as resolvePmDiagnosticOutputBudget,B as resolvePmRoot,I as resolveRuntimeFieldRegistry,H as resolveRuntimeStatusRegistry,kb as resolveTerminalReason,Fd as restore,ae as runAction,ya as runActiveOnReadHooks,xa as runActiveOnWriteHooks,Kb as runAggregate,xb as runCalendar,ob as runClose,Eb as runCloseTask,rc as runCompletion,zb as runContext,pb as runCopy,qb as runDelete,ib as runDuplicates,rb as runFocus,Lb as runGet,pc as runGuide,Va as runList,Bb as runNext,Db as runPauseTask,sc as runReindex,tb as runReopen,Fb as runRestore,Mb as runSearch,Cb as runStartTask,Nb as runStats,Ib as runTemplatesList,Hb as runTemplatesSave,Jb as runTemplatesShow,tc as runTestRunsList,vc as runTestRunsLogs,xc as runTestRunsResume,uc as runTestRunsStatus,wc as runTestRunsStop,sb as runUpdate,$d as runWithActiveExtensions,cb as runWorkflowPolicyAction,O as scanItemFormatVersions,Uc as schema,$c as schemaAddField,Zc as schemaAddStatus,Xc as schemaAddType,dd as schemaApplyPreset,ed as schemaInferTypes,Vc as schemaList,bd as schemaListFields,hd as schemaRemapStatus,ad as schemaRemoveField,_c as schemaRemoveStatus,Yc as schemaRemoveType,gd as schemaRenameField,fd as schemaRenameType,Wc as schemaShow,cd as schemaShowField,id as schemaShowStatus,Ua as scoreItemSimilarity,Cc as search,kc as selectImportAuthor,T as serializeItemDocument,Na as snapshotPmCliErrorContext,S as splitFrontMatter,Hd as startTask,Gc as stats,Wb as toEstimatedMinutesValue,$b as toImportBoolean,dc as toImportConfidence,ic as toImportDeferredFields,_b as toImportInteger,hc as toImportLinkedDocs,gc as toImportLinkedFiles,jc as toImportLinkedTests,fc as toImportLogEntries,ec as toImportNormalizedEnum,cc as toImportNumberMap,Xb as toImportPriority,Zb as toImportStatus,ac as toImportStringList,bc as toImportStringMap,Yb as toImportTags,Vb as toNonEmptyImportString,Ta as tokenizeSimilarityText,xd as update,Zd as upgrade,od as validate,Ca as withCliMutationInput,Da as withLiteralMutationInput,ra as withoutGenericRefusalExamples,j as workflowApprovalFingerprint,k as workflowPolicyApplies,i as workflowPolicyFingerprint,q 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,Z as S,_ as T,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-O4ZSIMNC.js";import"./chunks/chunk-77MGDTK4.js";import"./chunks/chunk-DXSZL3T6.js";import"./chunks/chunk-QANUQMDL.js";import"./chunks/chunk-2WHXFKMY.js";import"./chunks/chunk-HQYIKAC6.js";import"./chunks/chunk-36R3JTAD.js";import{n as a,sa as b}from"./chunks/chunk-3IU2S5UQ.js";import"./chunks/chunk-H64BNM4A.js";import"./chunks/chunk-Y4LXVPA5.js";import"./chunks/chunk-X5TFNFTS.js";import"./chunks/chunk-RXNBNF6O.js";import"./chunks/chunk-7K2RUKMK.js";import"./chunks/chunk-VLKCFZY6.js";import"./chunks/chunk-4FIN2XWC.js";import"./chunks/chunk-IB7UB5TE.js";import"./chunks/chunk-AM26RAG7.js";import"./chunks/chunk-CR5GC3VO.js";import"./chunks/chunk-7UUPLMCU.js";import"./chunks/chunk-VS565KBX.js";import"./chunks/chunk-SPPHDVZE.js";import"./chunks/chunk-5OFMWP3Q.js";import"./chunks/chunk-XAWE4EAK.js";export{g as activateExtensionForTest,O as assertExtensionBlueprint,N as assertExtensionCapabilityUsage,v as assertExtensionDeactivated,R as assertExtensionManifestCompatible,Q as assertExtensionManifestMatchesBlueprint,S as assertExtensionPreflight,w as assertPackageManifest,P as assertProjectProfile,x as assertRegisteredCommandContract,H as assertRegisteredCommandOverride,D as assertRegisteredExporter,y as assertRegisteredFlags,z as assertRegisteredHook,C as assertRegisteredImporter,E as assertRegisteredItemField,F as assertRegisteredItemType,M as assertRegisteredMigration,I as assertRegisteredParserOverride,J as assertRegisteredPreflightOverride,G as assertRegisteredProfile,K as assertRegisteredRendererOverride,A as assertRegisteredSearchProvider,L as assertRegisteredServiceOverride,B as assertRegisteredVectorStoreAdapter,T as createExtensionTestHarness,h as deactivateExtensionForTest,e as decodeToon,a as describeExtensionActivation,c as describeExtensionBlueprint,f as encodeToon,d as lintExtensionBlueprint,b as renderExtensionSurfaceMarkdown,i as runRegisteredCommandForTest,n as runRegisteredCommandOverrideForTest,u as runRegisteredExporterForTest,k as runRegisteredHookForTest,t as runRegisteredImporterForTest,s as runRegisteredMigrationForTest,j as runRegisteredMutationGuardForTest,l as runRegisteredParserOverrideForTest,m as runRegisteredPreflightOverrideForTest,o as runRegisteredRendererOverrideForTest,q as runRegisteredSearchProviderForTest,p as runRegisteredServiceOverrideForTest,r 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,Z as S,_ as T,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-XDIJK6VW.js";import"./chunks/chunk-S3RMFLEG.js";import"./chunks/chunk-AGU7632B.js";import"./chunks/chunk-SSZBVRIN.js";import"./chunks/chunk-7ETRLLK3.js";import"./chunks/chunk-HQYIKAC6.js";import"./chunks/chunk-WKHS4QC6.js";import{n as a,sa as b}from"./chunks/chunk-OD2I3SFQ.js";import"./chunks/chunk-H64BNM4A.js";import"./chunks/chunk-Y4LXVPA5.js";import"./chunks/chunk-CGTVDSAR.js";import"./chunks/chunk-TS2CZE3O.js";import"./chunks/chunk-VETSGCF4.js";import"./chunks/chunk-T3E3WNHO.js";import"./chunks/chunk-QK7RAN7R.js";import"./chunks/chunk-IB7UB5TE.js";import"./chunks/chunk-2VH6COJE.js";import"./chunks/chunk-CR5GC3VO.js";import"./chunks/chunk-7UUPLMCU.js";import"./chunks/chunk-VS565KBX.js";import"./chunks/chunk-SPPHDVZE.js";import"./chunks/chunk-5OFMWP3Q.js";import"./chunks/chunk-XAWE4EAK.js";export{g as activateExtensionForTest,O as assertExtensionBlueprint,N as assertExtensionCapabilityUsage,v as assertExtensionDeactivated,R as assertExtensionManifestCompatible,Q as assertExtensionManifestMatchesBlueprint,S as assertExtensionPreflight,w as assertPackageManifest,P as assertProjectProfile,x as assertRegisteredCommandContract,H as assertRegisteredCommandOverride,D as assertRegisteredExporter,y as assertRegisteredFlags,z as assertRegisteredHook,C as assertRegisteredImporter,E as assertRegisteredItemField,F as assertRegisteredItemType,M as assertRegisteredMigration,I as assertRegisteredParserOverride,J as assertRegisteredPreflightOverride,G as assertRegisteredProfile,K as assertRegisteredRendererOverride,A as assertRegisteredSearchProvider,L as assertRegisteredServiceOverride,B as assertRegisteredVectorStoreAdapter,T as createExtensionTestHarness,h as deactivateExtensionForTest,e as decodeToon,a as describeExtensionActivation,c as describeExtensionBlueprint,f as encodeToon,d as lintExtensionBlueprint,b as renderExtensionSurfaceMarkdown,i as runRegisteredCommandForTest,n as runRegisteredCommandOverrideForTest,u as runRegisteredExporterForTest,k as runRegisteredHookForTest,t as runRegisteredImporterForTest,s as runRegisteredMigrationForTest,j as runRegisteredMutationGuardForTest,l as runRegisteredParserOverrideForTest,m as runRegisteredPreflightOverrideForTest,o as runRegisteredRendererOverrideForTest,q as runRegisteredSearchProviderForTest,p as runRegisteredServiceOverrideForTest,r as runRegisteredVectorStoreAdapterForTest};
2
2
  //# sourceMappingURL=sdk-testing.js.map
@@ -1,4 +1,4 @@
1
- import{a as Rg}from"./chunks/chunk-KIQNEOKJ.js";import{a as gx,b as yx,c as bx,d as Tx}from"./chunks/chunk-QZNL5XDT.js";import{a as Cx,b as Ex}from"./chunks/chunk-ABFHWRLE.js";import{b as jk,c as Bk,d as qk,e as zk,f as Hk,g as Vk,h as Kk,i as Wk,j as Yk,k as Xk,l as Jk,m as Qk,n as Zk,o as ex,p as tx,q as rx,r as ox}from"./chunks/chunk-XPBADEUK.js";import{A as lx,B as px,C as ux,D as mx,E as fx,F as _x,G as hx,a as Us,b as VI,c as KI,d as Pc,e as Mc,f as kc,h as xc,i as Nc,j as Lc,k as Dc,l as $c,m as Fc,n as Gc,o as Uc,p as qd,q as zd,r as Hd,s as Vd,t as Kd,u as nx,v as ix,w as sx,x as ax,y as cx,z as dx}from"./chunks/chunk-FXSLODOK.js";import{A as Yx,B as Xx,C as Jx,D as Qx,E as Zx,F as eN,G as tN,H as rN,I as oN,J as nN,K as iN,L as sN,M as aN,N as cN,O as dN,P as lN,Q as pN,R as uN,S as mN,T as fN,U as _N,V as hN,W as gN,X as yN,Y as bN,Z as TN,_ as CN,a as Sx,b as wx,c as Ax,d as Ox,e as vx,f as Ix,g as Rx,h as Px,i as Mx,j as kx,k as xx,l as Nx,m as Lx,n as Dx,o as $x,p as Fx,q as Gx,r as Ux,s as jx,t as Bx,u as qx,v as zx,w as Hx,x as Vx,y as Kx,z as Wx}from"./chunks/chunk-O4ZSIMNC.js";import{$ as pf,$a as rh,$b as rg,A as d0,Aa as w_,Ab as Rh,B as Ke,Ba as A_,Bb as Ph,C as Xm,Ca as O_,Cb as Mh,D as Jm,Da as v_,Db as kh,E as Zm,Ea as I_,Eb as xh,F as zt,Fa as R_,Fb as Nh,G as Ht,Ga as P_,Gb as Lh,H as Vt,Ha as M_,Hb as Dh,I as Kt,Ia as k_,Ib as $h,J as Wt,Ja as x_,Jb as Fh,K as Yt,Ka as N_,Kb as Gh,L as Xt,La as L_,Lb as Uh,M as Jt,Ma as D_,Mb as jh,N as Qt,Na as $_,Nb as Bh,O as Zt,Oa as F_,Ob as qh,P as er,Pa as G_,Pb as zh,Q as ef,Qa as U_,Qb as Hh,R as tf,Ra as j_,Rb as Vh,S as rf,Sa as B_,Sb as Kh,T as of,Ta as q_,Tb as Wh,U as nf,Ua as z_,Ub as Yh,V as We,Va as tr,Vb as Xh,W as sf,Wa as _e,Wb as Jh,X as af,Xa as Q_,Xb as Qh,Y as cf,Ya as Z_,Yb as Zh,Z as df,Za as eh,Zb as eg,_ as lf,_a as th,_b as tg,a as iI,aa as uf,ab as oh,ac as og,b as sI,ba as mf,bb as nh,bc as ng,c as aI,ca as Ek,cb as ih,cc as ig,d as cI,da as Sk,db as sh,dc as sg,e as dI,ea as wk,eb as ah,ec as ag,f as lI,fa as Of,fb as ch,fc as cg,g as mI,ga as vf,gb as dh,gc as dg,h as fI,ha as If,hb as lh,hc as lg,i as _I,ia as f_,ib as ph,ic as pg,j as hI,ja as __,jb as uh,jc as ug,k as js,ka as xk,kb as mh,kc as mg,l as id,la as Nk,lb as fh,lc as fg,m as sd,ma as Lk,mb as _h,mc as _g,n as ad,na as Dk,nb as hh,nc as hg,oa as $k,ob as gh,oc as gg,p as MP,pa as Fk,pb as yh,pc as yg,q as kP,qa as Gk,qb as bh,qc as bg,r as xP,ra as Uk,rb as Th,rc as Tg,s as NP,sa as h_,sb as Ch,sc as Cg,t as LP,ta as g_,tb as Eh,tc as Eg,u as DP,ua as y_,ub as Sh,uc as Sg,v as Mu,va as b_,vb as wh,vc as wg,w as Nu,wa as T_,wb as Ah,wc as Ag,x as Lu,xa as C_,xb as Oh,xc as Og,y as tm,ya as E_,yb as vh,yc as vg,z as cm,za as S_,zb as Ih,zc as Ig}from"./chunks/chunk-77MGDTK4.js";import{e as GP,f as UP,g as Jl,h as Ql,i as jt}from"./chunks/chunk-DXSZL3T6.js";import{A as pk,B as uk,C as mk,D as fk,E as _k,F as hk,G as gk,H as yk,I as bk,J as Tk,K as Ck,L as hf,M as gf,N as yf,O as bf,P as Tf,Q as Cf,R as Ef,S as Sf,T as wf,U as Af,a as VM,b as KM,c as WM,d as YM,e as XM,f as Pu,g as JM,h as QM,i as ZM,j as e0,k as t0,m as Qm,n as ff,o as ek,p as tk,q as rk,r as ok,s as nk,t as ik,u as _f,v as sk,w as ak,x as ck,y as dk,z as lk}from"./chunks/chunk-QANUQMDL.js";import{$ as qR,$a as gp,$b as Au,$d as V_,A as ze,Aa as fP,Ab as tM,Ac as ju,Ad as qf,B as ee,Ba as _P,Bb as fu,Bc as Bu,Bd as zf,C as al,Ca as hP,Cb as rM,Cc as qu,Cd as Hf,Db as bM,Dc as zu,Dd as Vf,Eb as TM,Ec as Hu,Ed as Kf,F as He,Fa as $P,Fb as CM,Fc as Vu,Fd as Wf,G as cl,Ga as FP,Gb as EM,Gc as Ku,Gd as Yf,H as dl,Ha as zl,Hb as SM,Hc as Wu,Hd as Xf,Ia as Hl,Ib as wM,Ic as Yu,Id as Jf,J as fe,Ja as Vl,Jb as AM,Jc as Xu,Jd as Qf,K as ll,Ka as Kl,Kb as MM,Kc as Ju,Kd as Zf,L as pl,La as Wl,Lb as kM,Lc as Qu,Ld as e_,M as ul,Ma as Yl,Mb as _u,Mc as Zu,Md as t_,N as ml,Na as Xl,Nb as hu,Nd as r_,O as kR,Oa as np,Ob as xM,Oc as a0,Od as o_,P as xR,Pa as ip,Pb as NM,Pc as c0,Q as NR,Qa as sp,Qb as LM,Qc as em,Qd as n_,R as LR,Ra as ap,Rb as DM,Rc as dm,Rd as i_,S as DR,Sa as cp,Sb as $M,Sc as lm,Sd as s_,T as xt,Ta as dp,Tb as gu,Tc as pm,Td as a_,U as $R,Ua as lp,Ub as yu,Uc as um,Ud as c_,V as FR,Va as pp,Vb as bu,Vc as mm,Vd as d_,W as Nt,Wa as up,Wb as Tu,Wd as l_,X as GR,Xa as mp,Xb as Cu,Xd as p_,Y as UR,Ya as fp,Yb as Eu,Yd as u_,Z as jR,Za as _p,Zb as Su,Zd as m_,_ as BR,_a as hp,_b as wu,_c as fm,_d as H_,a as WI,aa as Ve,ab as yp,ac as Ou,ad as Bm,ae as K_,b as Rt,ba as zR,bb as bp,bc as vu,bd as qm,be as W_,c as YI,ca as Lt,cb as Tp,cc as Iu,cd as zm,ce as Y_,d as Xc,da as HR,db as Cp,dc as FM,de as X_,e as Jc,ea as VR,eb as Ep,ec as GM,ed as Hm,ee as J_,f as Qc,fa as KR,fb as Sp,fc as UM,fd as Vm,g as Zc,ga as WR,gb as wp,gc as jM,gd as Km,h as ed,ha as YR,hb as Ap,hc as BM,hd as Wm,ia as XR,ib as qP,ic as qM,id as Ym,j as td,ja as JR,jb as Op,jc as zM,jd as Rf,k as rd,ka as QR,kb as vp,kc as HM,kd as Pf,la as ZR,lb as Ip,lc as Ru,ld as Mf,ma as eP,mb as Rp,mc as r0,md as kf,na as tP,nb as zP,nc as o0,nd as xf,o as od,oa as rP,ob as Pp,oc as n0,od as Nf,p as nd,pa as oP,pb as Mp,pc as i0,pd as Lf,qa as nP,qb as kp,qc as s0,qd as Df,ra as iP,rb as xp,rd as $f,sa as sP,sb as Np,sc as ku,sd as Pk,ta as aP,tb as HP,tc as xu,td as Mk,ua as cP,ub as VP,uc as Du,ud as kk,va as dP,vb as KP,vc as $u,vd as Ff,w as Mt,wa as lP,wb as WP,wd as Gf,xa as pP,xb as YP,xc as Fu,xd as Uf,y as kt,ya as uP,yb as XP,yc as Gu,yd as jf,za as mP,zb as JP,zc as Uu,zd as Bf}from"./chunks/chunk-2WHXFKMY.js";import"./chunks/chunk-HQYIKAC6.js";import{x as Wd}from"./chunks/chunk-36R3JTAD.js";import{A as RP,Aa as Ll,B as PP,C as Ol,Ca as Dl,D as vl,Da as $l,E as Il,Ea as Fl,F as Rl,Fa as Gl,G as Dt,Ga as Ul,Ia as jl,Ja as Bl,Ka as ql,b as CI,c as EI,d as SI,e as wI,f as AI,g as OI,h as Bs,i as qs,j as zs,k as Hs,l as Vs,ma as $t,n as gP,na as Ft,oa as Gt,pa as Ut,qa as Pl,sa as Ml,ta as kl,ua as xl,w as OP,x as vP,z as IP,za as Nl}from"./chunks/chunk-3IU2S5UQ.js";import{a as yP,b as bP,c as TP,d as CP,e as EP,f as SP,g as wP,h as yl,i as bl,j as Tl,k as Cl,l as El,m as AP,n as Sl,o as wl,p as Al}from"./chunks/chunk-H64BNM4A.js";import{a as fl,b as _l,e as hl,f as gl}from"./chunks/chunk-Y4LXVPA5.js";import{$a as mM,$b as x0,A as wR,Aa as su,Ab as Tm,Ac as xm,B as Yd,Ba as au,Bb as Cm,Bc as Nm,C as Xd,Ca as cu,Cb as Em,Cc as Lm,D as Jd,Da as du,Db as p0,Dc as Dm,E as Qd,Ea as lu,Eb as u0,Ec as $m,F as Zd,Fa as pu,Fb as m0,Fc as Fm,G as el,Ga as uu,Gb as f0,Gc as Gm,H as tl,Ha as mu,Hb as _0,Hc as qt,I as rl,Ib as h0,Ic as Um,J as ol,Jb as g0,Jc as X0,K as nl,Kc as J0,L as il,La as QP,Lb as Sm,Lc as Q0,M as qe,Ma as ZP,Mb as y0,Mc as jm,N as AR,Na as eM,Nb as b0,Nc as Z0,O as OR,Oa as oM,Ob as T0,Oc as Ak,P as vR,Pa as nM,Pb as C0,Pc as Ok,Q as IR,Qa as iM,Qb as E0,Qc as vk,R as RR,Ra as sM,Rb as S0,Rc as Ik,S as PR,Sa as aM,Sb as w0,Sc as Rk,T as MR,Ta as cM,Tb as A0,U as sl,Ua as dM,Ub as O0,V as Zl,Va as lM,Vb as v0,W as ep,Wa as pM,Wb as I0,X as tp,Xa as uM,Xb as R0,Y as rp,Yb as P0,Z as jP,Zb as M0,_ as BP,_b as k0,a as gI,aa as op,ac as N0,b as yI,ba as Lp,bb as fM,bc as L0,c as bI,ca as Dp,cb as _M,cc as D0,d as TI,da as $p,dc as $0,e as lR,ea as Fp,ec as F0,f as pR,fa as Gp,fb as hM,fc as G0,g as uR,ga as Up,gb as gM,gc as U0,h as mR,ha as jp,hb as yM,hc as j0,i as fR,ia as Bp,ic as B0,j as _R,ja as qp,jb as OM,jc as q0,k as hR,ka as zp,kb as vM,kc as z0,la as Hp,lb as IM,lc as H0,ma as Vp,mb as RM,mc as V0,na as Kp,nb as PM,nc as K0,oa as Wp,ob as rm,oc as W0,pa as Yp,pb as om,pc as Y0,qa as Xp,qb as nm,qc as Bt,ra as Jp,rb as im,rc as wm,sa as Qp,sb as sm,sc as Am,t as gR,ta as Zp,tb as am,tc as Om,u as yR,ua as eu,ub as _m,uc as vm,v as bR,va as tu,vb as hm,vc as Im,w as TR,wa as ru,wb as gm,wc as Rm,x as CR,xa as ou,xb as ym,xc as Pm,y as ER,ya as nu,yb as l0,yc as Mm,z as SR,za as iu,zb as bm,zc as km}from"./chunks/chunk-X5TFNFTS.js";import{a as pI,b as uI}from"./chunks/chunk-RXNBNF6O.js";import{$ as ba,$a as bc,A as Ws,Aa as Va,Ab as ud,B as Ys,Ba as Ka,Bb as md,C as Xs,Ca as Wa,Cb as fd,Da as Ya,Db as _d,E as Js,Ea as Xa,Eb as hd,F as Qs,Fa as Ja,Fb as gd,G as Zs,Ga as Qa,Gb as yd,H as ea,Ha as Za,Hb as bd,I as ta,Ia as ec,Ib as Td,J as ra,Ja as tc,Jb as Cd,K as oa,Ka as rc,Kb as Ed,L as na,La as oc,Lb as Sd,M as ia,Ma as nc,Mb as wd,N as sa,Na as ic,Nb as Ad,O as aa,Oa as sc,Ob as Od,P as ca,Pa as ac,Pb as vd,Q as da,Qa as cc,Qb as Id,R as la,Ra as dc,Rb as Rd,Sa as lc,Sb as Pd,T as pa,Ta as pc,Tb as Md,U as ua,Ua as uc,Ub as XI,V as ma,Va as mc,Vb as JI,W as fa,Wa as fc,Wb as QI,X as _a,Xa as _c,Xb as ZI,Y as ha,Ya as hc,Yb as eR,Z as ga,Za as gc,Zb as tR,_ as ya,_a as yc,a as vI,aa as Ta,ab as Tc,b as II,ba as Ca,bb as Cc,bc as rR,c as RI,ca as Ea,cb as Ec,cc as oR,d as PI,da as Sa,db as Sc,dc as nR,e as MI,ea as wa,eb as wc,ec as iR,fa as Aa,fb as Ac,fc as sR,g as kI,ga as Oa,gb as Oc,gc as aR,h as xI,ha as va,hb as vc,hc as cR,i as Ks,ia as Ia,ib as Ic,ic as dR,j as NI,ja as Ra,ka as Pa,kb as Be,kc as kd,la as Ma,lb as Z,lc as xd,m as LI,ma as ka,mb as Rc,mc as Nd,n as DI,na as xa,nb as jc,nc as Ld,o as Ue,oa as Na,ob as Bc,oc as Dd,p as $I,pa as La,pb as qc,pc as $d,q as FI,qa as Da,qb as zc,qc as Fd,r as GI,ra as $a,rb as Hc,rc as Gd,s as It,sa as Fa,sb as Vc,sc as Ud,t as je,ta as Ga,tb as Kc,tc as jd,u as UI,ua as Ua,ub as Wc,uc as Bd,v as jI,va as ja,vb as Yc,vc as Pt,w as BI,wa as Ba,wb as cd,x as qI,xa as qa,xb as dd,y as zI,ya as za,yb as ld,z as HI,za as Ha,zb as pd}from"./chunks/chunk-7K2RUKMK.js";import{a as Xv,b as Jv,c as Qv,d as Zv,e as eI,f as tI,g as rI,h as oI,i as nI,j as Ms,k as ks,l as xs,m as Ns,n as Ls,o as Ds,q as $s,s as Fs,y as Gs}from"./chunks/chunk-VLKCFZY6.js";import{b as Kv}from"./chunks/chunk-4FIN2XWC.js";import"./chunks/chunk-IB7UB5TE.js";import{$b as nv,$c as Ov,A as aC,Aa as JA,Ab as UO,Ac as _v,Ad as Wv,B as cC,Ba as QA,Bc as hv,Bd as Yv,C as dC,Cc as gv,Db as jO,Dc as yv,Ec as bv,Fb as BO,Fc as Tv,Gc as Cv,Hc as fs,Ic as _s,Jb as qO,Jc as hs,K as bC,Kb as zO,Kc as gs,La as ZA,Lb as HO,Lc as ys,M as IC,Ma as eO,Mb as os,Mc as bs,N as RC,Na as tO,Nb as VO,Nc as Ts,O as PC,Oa as rO,Oc as Cs,P as MC,Pa as oO,Pb as KO,Pc as Es,Q as $C,Qa as nO,Qb as WO,Qc as Ss,R as FC,Ra as lO,Rb as YO,Rc as ws,S as wt,Sa as pO,Sb as XO,T as gA,Ta as uO,Tb as JO,Tc as As,U as yA,Ua as At,Ub as QO,Uc as Ev,V as bA,Vb as ZO,Vc as Sv,Wa as mO,Wb as ev,Wc as Os,X as TA,Xa as fO,Xb as tv,Xc as wv,Ya as _O,Yb as rv,Yc as Av,Z as CA,Za as hO,Zb as Ot,Zc as vs,_ as EA,_a as gO,_b as ov,_c as Is,a as WT,aa as SA,ad as vv,ba as wA,bb as yO,bd as Iv,ca as AA,cd as Rv,da as OA,dd as Pv,ea as vA,ed as Mv,fa as IA,fb as Xi,fc as ns,fd as kv,ga as RA,gc as is,gd as Rs,ha as GA,hb as IO,hc as ss,hd as Ps,i as sn,ib as RO,ic as as,id as xv,j as YT,ja as Vi,jb as PO,jd as Nv,k as XT,ka as Ki,kb as MO,kc as cs,kd as Lv,l as JT,la as Wi,lc as ds,ld as Dv,m as QT,mb as kO,mc as ls,md as $v,na as UA,nb as xO,nc as ps,nd as Fv,o as ZT,oa as jA,ob as NO,oc as us,od as Gv,p as eC,pa as BA,pb as LO,pc as ms,pd as Uv,qa as qA,qb as es,qc as iv,qd as jv,r as tC,ra as zA,rb as ts,rc as sv,rd as Bv,sa as HA,sc as av,sd as qv,t as rC,ta as VA,tb as rs,tc as cv,u as oC,ub as DO,uc as dv,v as nC,va as KA,vc as lv,wb as $O,wc as pv,wd as vt,x as iC,xa as WA,xb as FO,xc as uv,xd as zv,y as sC,ya as YA,yb as GO,yc as mv,yd as Hv,za as XA,zc as fv,zd as Vv}from"./chunks/chunk-AM26RAG7.js";import{A as EO,B as SO,C as wO,D as AO,E as OO,F as vO,G as Ji,H as Qi,I as Zi,a as PA,b as MA,c as kA,d as xA,e as NA,f as LA,g as DA,h as $A,i as FA,n as iO,q as sO,r as aO,u as cO,v as Yi,w as dO,x as bO,y as TO,z as CO}from"./chunks/chunk-CR5GC3VO.js";import{$b as OC,$d as pE,$e as GE,$f as hS,$g as pw,$h as Fi,$i as eA,A as Fo,Ad as Wn,Af as ki,Ag as qS,B as Go,Be as EE,Bf as xi,Bg as zS,C as Uo,Cb as TC,Cc as kn,Ce as SE,Cf as Ni,Cg as HS,D as jo,Db as CC,Dc as ZC,De as wE,Df as Li,Dg as VS,E as Bo,Ec as xn,Ef as YE,Eg as KS,F as qo,Fa as lC,Ff as XE,Fg as WS,G as zo,Ga as pC,Gc as eE,Gf as JE,Gg as YS,H as Ho,Ha as uC,Hd as cE,He as _i,Hf as QE,Hg as XS,I as Ne,Ib as EC,Id as dE,If as ZE,Ig as JS,J as Le,Jd as lE,Jf as eS,Jg as QS,Ji as zw,K as Vo,Ka as gn,Kd as Yn,Kf as tS,Kg as ZS,Ki as Hw,L as Ko,La as mC,Lb as SC,Ld as Xn,Le as AE,Lf as rS,Lg as ew,Li as Vw,M as Wo,Ma as fC,Mc as tE,Md as Jn,Me as OE,Mf as oS,Mg as tw,N as Yo,Na as _C,Nd as Qn,Ne as vE,Ng as rw,Ni as Kw,O as Xo,Oa as hC,Ob as wC,Od as Zn,Oe as IE,Oh as vw,Oi as Ww,P as Jo,Pc as rE,Pd as ei,Pe as RE,Pf as nS,Ph as Ge,Q as Qo,Qa as yn,Qc as oE,Qd as ti,Qe as PE,Qf as iS,Qg as ow,Qh as St,Qi as Yw,R as Zo,Ra as bn,Rb as AC,Rc as Nn,Rd as ri,Re as ME,Rf as sS,Rg as nw,Rh as Iw,Ri as Ui,S as en,Sa as $e,Sc as Ln,Sd as oi,Se as kE,Sf as aS,Sg as iw,Sh as Rw,T as tn,Ta as gC,Tb as Tt,Td as ni,Te as xE,Tf as cS,Tg as sw,Th as Pw,Ti as ji,U as rn,Ua as yC,Uc as Dn,Ud as ii,Ue as NE,Uf as dS,Ug as aw,Uh as Mw,Ui as Bi,V as on,Va as Tn,Vb as Ct,Vc as $n,Vd as si,Ve as LE,Vf as lS,Vg as cw,Vh as q,W as nn,Wa as Cn,Wc as Fn,Wd as ai,We as DE,Wf as pS,Wg as dw,Wh as kw,Xb as Pn,Xc as Gn,Xd as ci,Xf as uS,Xg as lw,Xh as xw,Xi as Xw,Ya as En,Yb as Mn,Yc as Un,Yd as di,Yf as mS,Yh as Nw,Yi as Jw,Zb as Et,Zc as nE,Ze as $E,Zf as fS,Zh as Lw,Zi as Qw,_c as iE,_e as FE,_f as _S,_i as Zw,a as I,aa as gt,ae as uE,af as UE,ag as gS,ah as uw,ai as Gi,aj as tA,b as DT,ba as yt,bc as vC,be as li,bf as jE,bg as yS,bj as rA,c as ht,ca as ln,cc as kC,ce as mE,cf as BE,cg as bS,cj as qi,da as pn,dc as xC,de as fE,df as qE,dg as TS,dh as mw,dj as oA,e as $T,ea as un,ec as NC,ef as zE,eg as CS,eh as fw,ej as nA,f as FT,fc as LC,ff as HE,fg as ES,fh as _w,g as GT,gc as DC,gf as VE,gg as SS,gh as hw,h as UT,hc as GC,hf as KE,hg as wS,hh as gw,hj as iA,i as jT,ic as UC,ie as _E,if as WE,ig as AS,ih as yw,ij as sA,j as BT,ja as mn,jb as Sn,jc as jC,je as hE,jg as OS,jh as bw,jj as aA,k as qT,kb as wn,kc as BC,kd as jn,ke as gE,kf as hi,kg as vS,kh as Tw,kj as cA,l as zT,la as fn,lb as An,lc as qC,ld as Bn,le as yE,lf as gi,lg as IS,lh as Cw,li as Dw,lj as dA,m as HT,ma as _n,mb as On,mc as zC,md as sE,mf as yi,mg as RS,mh as Ew,mj as lA,n as VT,na as hn,nb as vn,nc as HC,nd as qn,ne as bE,nf as bi,ng as PS,nh as Sw,ni as $w,nj as zi,o as KT,oc as VC,od as zn,oe as TE,of as Ti,og as MS,oh as ww,oi as Fw,p as Po,pc as KC,pd as aE,pf as Ci,pg as kS,ph as Aw,pi as Gw,q as Mo,qc as WC,qd as Hn,qe as CE,qf as Ei,qg as xS,qi as Uw,qj as pA,r as ko,rc as YC,rd as Vn,rf as Si,rg as NS,rh as Ow,ri as jw,rj as Hi,s as xo,sc as XC,sd as L,se as pi,sf as wi,sg as LS,sh as Di,t as ke,tc as JC,td as Kn,te as ui,tf as Ai,tg as DS,th as $i,tj as uA,u as No,ue as mi,uf as Oi,ug as $S,uj as mA,v as N,ve as fi,vf as vi,vg as FS,vi as Bw,vj as fA,w as xe,wb as In,wf as Ii,wg as GS,wj as _A,x as Lo,xf as Ri,xg as US,xi as qw,xj as hA,y as Do,yb as Rn,yf as Pi,yg as jS,z as $o,zc as QC,zd as Fe,zf as Mi,zg as BS}from"./chunks/chunk-7UUPLMCU.js";import"./chunks/chunk-VS565KBX.js";import"./chunks/chunk-SPPHDVZE.js";import{A as ue,B as LT,C as b,E as an,F as bt,G as me,H as cn,K as De,M as dn,b as IT,c as RT,d as PT,m as MT,r as kT,u as xT,y as NT}from"./chunks/chunk-5OFMWP3Q.js";import"./chunks/chunk-XAWE4EAK.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]="8f11e0bf-4115-55a8-bd39-c360f43cdc09")}catch{}})();var z="2026-07-28",or=["2025-11-25","2025-06-18"],te=[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"},rr=["debug","info","notice","warning","error","critical","alert","emergency"],u=class extends Error{code;data;constructor(t,r,o={}){super(t),this.name="PmMcpProtocolError",this.code=r,this.data=o}};function h(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Pg(e){if(e===void 0)return;if(!h(e))throw new u("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 u("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 Mg(e){if(e!==void 0){if(typeof e!="string"||!rr.includes(e))throw new u("Invalid MCP logLevel metadata",m.invalidParams,{field:w.logLevel,allowed:[...rr]});return e}}function Ye(e){let t=h(e)?e._meta:void 0;if(!h(t))throw new u("Missing required MCP request metadata",m.invalidParams,{required:[w.protocolVersion,w.clientCapabilities]});let r=t[w.protocolVersion];if(typeof r!="string"||!te.includes(r))throw new u("Unsupported protocol version",m.unsupportedProtocolVersion,{supported:[...te],requested:typeof r=="string"?r:null});let o=t[w.clientCapabilities];if(!h(o))throw new u("Invalid MCP client capabilities metadata",m.invalidParams,{field:w.clientCapabilities,expected:"object"});let n=Pg(t[w.clientInfo]),s=Mg(t[w.logLevel]);return{protocolVersion:z,clientCapabilities:o,...n?{clientInfo:n}:{},...s?{logLevel:s}:{}}}function EN(e,t){if(t!==e.protocolVersion)throw new u("MCP protocol header does not match request metadata",m.headerMismatch,{header:t??null,metadata:e.protocolVersion})}function SN(e,t){let r=t.filter(o=>!Object.prototype.hasOwnProperty.call(e.clientCapabilities,o));if(r.length>0)throw new u("Missing required client capability",m.missingRequiredClientCapability,{requiredCapabilities:Object.fromEntries(r.map(o=>[o,{}]))})}function wN(e,t){let r=e.clientCapabilities.extensions;return h(r)&&h(r[t])}function Xe(e,t){let r=h(e._meta)?e._meta:{};return{...e,_meta:{...r,[w.serverInfo]:{...t}}}}function kg(e,t){return Xe({...e,resultType:"complete"},t)}function AN(e){let t=e.ttlMs??6e4;if(!Number.isFinite(t)||t<0)throw new u("Invalid MCP discovery cache TTL",m.invalidParams,{ttlMs:t});return kg({supportedVersions:[...te],capabilities:structuredClone(e.capabilities),ttlMs:t,cacheScope:"public",...e.instructions?{instructions:e.instructions}:{}},e.serverInfo)}function ON(e,t){if(h(e)&&typeof e.resultType=="string")return e.resultType;if(t==="legacy")return"complete";throw new u("Modern MCP result is missing resultType",m.invalidParams,{required:"resultType"})}(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]="d4a56906-c542-567e-9265-15184a5c330b")}catch{}})();var xg=new Set(["--help","-h","--version","-V"]);function Ng(e,t){let r=[`Usage: ${e==="stdio"?"pm-mcp":"pm-mcp-http"} [--help | --version]`,"",e==="stdio"?"JSON-RPC over stdin/stdout. With no arguments, starts the stdio server.":"Streamable HTTP POST /mcp. With no arguments, starts the HTTP server.","","Options:"," -h, --help Print help and exit before transport startup."," -V, --version Print the package version and exit.","","Environment:"," PM_PATH Tracker root (otherwise discovered from cwd)."," PM_GLOBAL_PATH Global settings root."," PM_MCP_PROFILE core (default), standard, full, or custom."," PM_MCP_TOOLS Comma-separated tool allowlist for custom profile."," PM_MCP_DISCOVERY_CURSOR_KEY Shared discovery cursor secret, at least 32 UTF-8 bytes."," PM_MCP_BAGGAGE_ALLOWLIST Comma-separated permitted trace baggage keys."];return e==="http"&&r.push(" PM_MCP_HTTP_HOST Bind host (default 127.0.0.1)."," PM_MCP_HTTP_PORT Bind port, 0..65535 (default 3000)."," PM_MCP_HTTP_ALLOWED_ORIGINS Comma-separated exact browser origins (default none)."," PM_MCP_HTTP_BEARER_TOKEN Deployment token for the bundled verifier."," PM_MCP_HTTP_AUTH_ISSUER Exact HTTPS authorization-server issuer."," PM_MCP_HTTP_RESOURCE Canonical resource/audience URI."," PM_MCP_HTTP_SCOPES Space-separated scopes (default pm:read pm:write).","","Non-loopback HTTP requires bearer token, issuer, and resource together."),r.push("",`MCP protocol: ${te.join(", ")}.`,e==="stdio"?`Legacy initialize compatibility: ${or.join(", ")}.`:"HTTP requires modern per-request metadata; legacy initialize is stdio-only.","",e==="stdio"?"Client configuration:":"Example loopback server:",e==="stdio"?JSON.stringify({mcpServers:{pm:{command:"npx",args:["--yes","--package",`@unbrained/pm-cli@${t}`,"pm-mcp"]}}}):`PM_MCP_HTTP_PORT=3000 npx --yes --package @unbrained/pm-cli@${t} pm-mcp-http`,...e==="http"?["HTTP client configuration:",JSON.stringify({mcpServers:{pm:{url:"http://127.0.0.1:3000/mcp"}}})]:[],"","Configuration: https://github.com/unbraind/pm-cli/blob/main/docs/MCP_REMOTE_TRANSPORT_SECURITY.md",""),r.join(`
1
+ import{a as Rg}from"./chunks/chunk-MUGGRKK3.js";import{a as gx,b as yx,c as bx,d as Tx}from"./chunks/chunk-L2ZLH3LZ.js";import{a as Cx,b as Ex}from"./chunks/chunk-JBPXNG6P.js";import{b as jk,c as Bk,d as qk,e as zk,f as Hk,g as Vk,h as Kk,i as Wk,j as Yk,k as Xk,l as Jk,m as Qk,n as Zk,o as ex,p as tx,q as rx,r as ox}from"./chunks/chunk-LGWP5D7V.js";import{A as lx,B as px,C as ux,D as mx,E as fx,F as _x,G as hx,a as Us,b as VI,c as KI,d as Pc,e as Mc,f as kc,h as xc,i as Nc,j as Lc,k as Dc,l as $c,m as Fc,n as Gc,o as Uc,p as qd,q as zd,r as Hd,s as Vd,t as Kd,u as nx,v as ix,w as sx,x as ax,y as cx,z as dx}from"./chunks/chunk-7LCJA54R.js";import{A as Yx,B as Xx,C as Jx,D as Qx,E as Zx,F as eN,G as tN,H as rN,I as oN,J as nN,K as iN,L as sN,M as aN,N as cN,O as dN,P as lN,Q as pN,R as uN,S as mN,T as fN,U as _N,V as hN,W as gN,X as yN,Y as bN,Z as TN,_ as CN,a as Sx,b as wx,c as Ax,d as Ox,e as vx,f as Ix,g as Rx,h as Px,i as Mx,j as kx,k as xx,l as Nx,m as Lx,n as Dx,o as $x,p as Fx,q as Gx,r as Ux,s as jx,t as Bx,u as qx,v as zx,w as Hx,x as Vx,y as Kx,z as Wx}from"./chunks/chunk-XDIJK6VW.js";import{$ as pf,$a as rh,$b as rg,A as d0,Aa as w_,Ab as Rh,B as Ke,Ba as A_,Bb as Ph,C as Xm,Ca as O_,Cb as Mh,D as Jm,Da as v_,Db as kh,E as Zm,Ea as I_,Eb as xh,F as zt,Fa as R_,Fb as Nh,G as Ht,Ga as P_,Gb as Lh,H as Vt,Ha as M_,Hb as Dh,I as Kt,Ia as k_,Ib as $h,J as Wt,Ja as x_,Jb as Fh,K as Yt,Ka as N_,Kb as Gh,L as Xt,La as L_,Lb as Uh,M as Jt,Ma as D_,Mb as jh,N as Qt,Na as $_,Nb as Bh,O as Zt,Oa as F_,Ob as qh,P as er,Pa as G_,Pb as zh,Q as ef,Qa as U_,Qb as Hh,R as tf,Ra as j_,Rb as Vh,S as rf,Sa as B_,Sb as Kh,T as of,Ta as q_,Tb as Wh,U as nf,Ua as z_,Ub as Yh,V as We,Va as tr,Vb as Xh,W as sf,Wa as _e,Wb as Jh,X as af,Xa as Q_,Xb as Qh,Y as cf,Ya as Z_,Yb as Zh,Z as df,Za as eh,Zb as eg,_ as lf,_a as th,_b as tg,a as iI,aa as uf,ab as oh,ac as og,b as sI,ba as mf,bb as nh,bc as ng,c as aI,ca as Ek,cb as ih,cc as ig,d as cI,da as Sk,db as sh,dc as sg,e as dI,ea as wk,eb as ah,ec as ag,f as lI,fa as Of,fb as ch,fc as cg,g as mI,ga as vf,gb as dh,gc as dg,h as fI,ha as If,hb as lh,hc as lg,i as _I,ia as f_,ib as ph,ic as pg,j as hI,ja as __,jb as uh,jc as ug,k as js,ka as xk,kb as mh,kc as mg,l as id,la as Nk,lb as fh,lc as fg,m as sd,ma as Lk,mb as _h,mc as _g,n as ad,na as Dk,nb as hh,nc as hg,oa as $k,ob as gh,oc as gg,p as MP,pa as Fk,pb as yh,pc as yg,q as kP,qa as Gk,qb as bh,qc as bg,r as xP,ra as Uk,rb as Th,rc as Tg,s as NP,sa as h_,sb as Ch,sc as Cg,t as LP,ta as g_,tb as Eh,tc as Eg,u as DP,ua as y_,ub as Sh,uc as Sg,v as Mu,va as b_,vb as wh,vc as wg,w as Nu,wa as T_,wb as Ah,wc as Ag,x as Lu,xa as C_,xb as Oh,xc as Og,y as tm,ya as E_,yb as vh,yc as vg,z as cm,za as S_,zb as Ih,zc as Ig}from"./chunks/chunk-S3RMFLEG.js";import{e as GP,f as UP,g as Jl,h as Ql,i as jt}from"./chunks/chunk-AGU7632B.js";import{A as pk,B as uk,C as mk,D as fk,E as _k,F as hk,G as gk,H as yk,I as bk,J as Tk,K as Ck,L as hf,M as gf,N as yf,O as bf,P as Tf,Q as Cf,R as Ef,S as Sf,T as wf,U as Af,a as VM,b as KM,c as WM,d as YM,e as XM,f as Pu,g as JM,h as QM,i as ZM,j as e0,k as t0,m as Qm,n as ff,o as ek,p as tk,q as rk,r as ok,s as nk,t as ik,u as _f,v as sk,w as ak,x as ck,y as dk,z as lk}from"./chunks/chunk-SSZBVRIN.js";import{$ as qR,$a as gp,$b as Au,$d as V_,A as ze,Aa as fP,Ab as tM,Ac as ju,Ad as qf,B as ee,Ba as _P,Bb as fu,Bc as Bu,Bd as zf,C as al,Ca as hP,Cb as rM,Cc as qu,Cd as Hf,Db as bM,Dc as zu,Dd as Vf,Eb as TM,Ec as Hu,Ed as Kf,F as He,Fa as $P,Fb as CM,Fc as Vu,Fd as Wf,G as cl,Ga as FP,Gb as EM,Gc as Ku,Gd as Yf,H as dl,Ha as zl,Hb as SM,Hc as Wu,Hd as Xf,Ia as Hl,Ib as wM,Ic as Yu,Id as Jf,J as fe,Ja as Vl,Jb as AM,Jc as Xu,Jd as Qf,K as ll,Ka as Kl,Kb as MM,Kc as Ju,Kd as Zf,L as pl,La as Wl,Lb as kM,Lc as Qu,Ld as e_,M as ul,Ma as Yl,Mb as _u,Mc as Zu,Md as t_,N as ml,Na as Xl,Nb as hu,Nd as r_,O as kR,Oa as np,Ob as xM,Oc as a0,Od as o_,P as xR,Pa as ip,Pb as NM,Pc as c0,Q as NR,Qa as sp,Qb as LM,Qc as em,Qd as n_,R as LR,Ra as ap,Rb as DM,Rc as dm,Rd as i_,S as DR,Sa as cp,Sb as $M,Sc as lm,Sd as s_,T as xt,Ta as dp,Tb as gu,Tc as pm,Td as a_,U as $R,Ua as lp,Ub as yu,Uc as um,Ud as c_,V as FR,Va as pp,Vb as bu,Vc as mm,Vd as d_,W as Nt,Wa as up,Wb as Tu,Wd as l_,X as GR,Xa as mp,Xb as Cu,Xd as p_,Y as UR,Ya as fp,Yb as Eu,Yd as u_,Z as jR,Za as _p,Zb as Su,Zd as m_,_ as BR,_a as hp,_b as wu,_c as fm,_d as H_,a as WI,aa as Ve,ab as yp,ac as Ou,ad as Bm,ae as K_,b as Rt,ba as zR,bb as bp,bc as vu,bd as qm,be as W_,c as YI,ca as Lt,cb as Tp,cc as Iu,cd as zm,ce as Y_,d as Xc,da as HR,db as Cp,dc as FM,de as X_,e as Jc,ea as VR,eb as Ep,ec as GM,ed as Hm,ee as J_,f as Qc,fa as KR,fb as Sp,fc as UM,fd as Vm,g as Zc,ga as WR,gb as wp,gc as jM,gd as Km,h as ed,ha as YR,hb as Ap,hc as BM,hd as Wm,ia as XR,ib as qP,ic as qM,id as Ym,j as td,ja as JR,jb as Op,jc as zM,jd as Rf,k as rd,ka as QR,kb as vp,kc as HM,kd as Pf,la as ZR,lb as Ip,lc as Ru,ld as Mf,ma as eP,mb as Rp,mc as r0,md as kf,na as tP,nb as zP,nc as o0,nd as xf,o as od,oa as rP,ob as Pp,oc as n0,od as Nf,p as nd,pa as oP,pb as Mp,pc as i0,pd as Lf,qa as nP,qb as kp,qc as s0,qd as Df,ra as iP,rb as xp,rd as $f,sa as sP,sb as Np,sc as ku,sd as Pk,ta as aP,tb as HP,tc as xu,td as Mk,ua as cP,ub as VP,uc as Du,ud as kk,va as dP,vb as KP,vc as $u,vd as Ff,w as Mt,wa as lP,wb as WP,wd as Gf,xa as pP,xb as YP,xc as Fu,xd as Uf,y as kt,ya as uP,yb as XP,yc as Gu,yd as jf,za as mP,zb as JP,zc as Uu,zd as Bf}from"./chunks/chunk-7ETRLLK3.js";import"./chunks/chunk-HQYIKAC6.js";import{x as Wd}from"./chunks/chunk-WKHS4QC6.js";import{A as RP,Aa as Ll,B as PP,C as Ol,Ca as Dl,D as vl,Da as $l,E as Il,Ea as Fl,F as Rl,Fa as Gl,G as Dt,Ga as Ul,Ia as jl,Ja as Bl,Ka as ql,b as CI,c as EI,d as SI,e as wI,f as AI,g as OI,h as Bs,i as qs,j as zs,k as Hs,l as Vs,ma as $t,n as gP,na as Ft,oa as Gt,pa as Ut,qa as Pl,sa as Ml,ta as kl,ua as xl,w as OP,x as vP,z as IP,za as Nl}from"./chunks/chunk-OD2I3SFQ.js";import{a as yP,b as bP,c as TP,d as CP,e as EP,f as SP,g as wP,h as yl,i as bl,j as Tl,k as Cl,l as El,m as AP,n as Sl,o as wl,p as Al}from"./chunks/chunk-H64BNM4A.js";import{a as fl,b as _l,e as hl,f as gl}from"./chunks/chunk-Y4LXVPA5.js";import{$a as mM,$b as x0,A as wR,Aa as su,Ab as Tm,Ac as xm,B as Yd,Ba as au,Bb as Cm,Bc as Nm,C as Xd,Ca as cu,Cb as Em,Cc as Lm,D as Jd,Da as du,Db as p0,Dc as Dm,E as Qd,Ea as lu,Eb as u0,Ec as $m,F as Zd,Fa as pu,Fb as m0,Fc as Fm,G as el,Ga as uu,Gb as f0,Gc as Gm,H as tl,Ha as mu,Hb as _0,Hc as qt,I as rl,Ib as h0,Ic as Um,J as ol,Jb as g0,Jc as X0,K as nl,Kc as J0,L as il,La as QP,Lb as Sm,Lc as Q0,M as qe,Ma as ZP,Mb as y0,Mc as jm,N as AR,Na as eM,Nb as b0,Nc as Z0,O as OR,Oa as oM,Ob as T0,Oc as Ak,P as vR,Pa as nM,Pb as C0,Pc as Ok,Q as IR,Qa as iM,Qb as E0,Qc as vk,R as RR,Ra as sM,Rb as S0,Rc as Ik,S as PR,Sa as aM,Sb as w0,Sc as Rk,T as MR,Ta as cM,Tb as A0,U as sl,Ua as dM,Ub as O0,V as Zl,Va as lM,Vb as v0,W as ep,Wa as pM,Wb as I0,X as tp,Xa as uM,Xb as R0,Y as rp,Yb as P0,Z as jP,Zb as M0,_ as BP,_b as k0,a as gI,aa as op,ac as N0,b as yI,ba as Lp,bb as fM,bc as L0,c as bI,ca as Dp,cb as _M,cc as D0,d as TI,da as $p,dc as $0,e as lR,ea as Fp,ec as F0,f as pR,fa as Gp,fb as hM,fc as G0,g as uR,ga as Up,gb as gM,gc as U0,h as mR,ha as jp,hb as yM,hc as j0,i as fR,ia as Bp,ic as B0,j as _R,ja as qp,jb as OM,jc as q0,k as hR,ka as zp,kb as vM,kc as z0,la as Hp,lb as IM,lc as H0,ma as Vp,mb as RM,mc as V0,na as Kp,nb as PM,nc as K0,oa as Wp,ob as rm,oc as W0,pa as Yp,pb as om,pc as Y0,qa as Xp,qb as nm,qc as Bt,ra as Jp,rb as im,rc as wm,sa as Qp,sb as sm,sc as Am,t as gR,ta as Zp,tb as am,tc as Om,u as yR,ua as eu,ub as _m,uc as vm,v as bR,va as tu,vb as hm,vc as Im,w as TR,wa as ru,wb as gm,wc as Rm,x as CR,xa as ou,xb as ym,xc as Pm,y as ER,ya as nu,yb as l0,yc as Mm,z as SR,za as iu,zb as bm,zc as km}from"./chunks/chunk-CGTVDSAR.js";import{a as pI,b as uI}from"./chunks/chunk-TS2CZE3O.js";import{$ as ba,$a as bc,A as Ws,Aa as Va,Ab as ud,B as Ys,Ba as Ka,Bb as md,C as Xs,Ca as Wa,Cb as fd,Da as Ya,Db as _d,E as Js,Ea as Xa,Eb as hd,F as Qs,Fa as Ja,Fb as gd,G as Zs,Ga as Qa,Gb as yd,H as ea,Ha as Za,Hb as bd,I as ta,Ia as ec,Ib as Td,J as ra,Ja as tc,Jb as Cd,K as oa,Ka as rc,Kb as Ed,L as na,La as oc,Lb as Sd,M as ia,Ma as nc,Mb as wd,N as sa,Na as ic,Nb as Ad,O as aa,Oa as sc,Ob as Od,P as ca,Pa as ac,Pb as vd,Q as da,Qa as cc,Qb as Id,R as la,Ra as dc,Rb as Rd,Sa as lc,Sb as Pd,T as pa,Ta as pc,Tb as Md,U as ua,Ua as uc,Ub as XI,V as ma,Va as mc,Vb as JI,W as fa,Wa as fc,Wb as QI,X as _a,Xa as _c,Xb as ZI,Y as ha,Ya as hc,Yb as eR,Z as ga,Za as gc,Zb as tR,_ as ya,_a as yc,a as vI,aa as Ta,ab as Tc,b as II,ba as Ca,bb as Cc,bc as rR,c as RI,ca as Ea,cb as Ec,cc as oR,d as PI,da as Sa,db as Sc,dc as nR,e as MI,ea as wa,eb as wc,ec as iR,fa as Aa,fb as Ac,fc as sR,g as kI,ga as Oa,gb as Oc,gc as aR,h as xI,ha as va,hb as vc,hc as cR,i as Ks,ia as Ia,ib as Ic,ic as dR,j as NI,ja as Ra,ka as Pa,kb as Be,kc as kd,la as Ma,lb as Z,lc as xd,m as LI,ma as ka,mb as Rc,mc as Nd,n as DI,na as xa,nb as jc,nc as Ld,o as Ue,oa as Na,ob as Bc,oc as Dd,p as $I,pa as La,pb as qc,pc as $d,q as FI,qa as Da,qb as zc,qc as Fd,r as GI,ra as $a,rb as Hc,rc as Gd,s as It,sa as Fa,sb as Vc,sc as Ud,t as je,ta as Ga,tb as Kc,tc as jd,u as UI,ua as Ua,ub as Wc,uc as Bd,v as jI,va as ja,vb as Yc,vc as Pt,w as BI,wa as Ba,wb as cd,x as qI,xa as qa,xb as dd,y as zI,ya as za,yb as ld,z as HI,za as Ha,zb as pd}from"./chunks/chunk-VETSGCF4.js";import{a as Xv,b as Jv,c as Qv,d as Zv,e as eI,f as tI,g as rI,h as oI,i as nI,j as Ms,k as ks,l as xs,m as Ns,n as Ls,o as Ds,q as $s,s as Fs,y as Gs}from"./chunks/chunk-T3E3WNHO.js";import{b as Kv}from"./chunks/chunk-QK7RAN7R.js";import"./chunks/chunk-IB7UB5TE.js";import{$b as nv,$c as Ov,A as aC,Aa as JA,Ab as UO,Ac as _v,Ad as Wv,B as cC,Ba as QA,Bc as hv,Bd as Yv,C as dC,Cc as gv,Db as jO,Dc as yv,Ec as bv,Fb as BO,Fc as Tv,Gc as Cv,Hc as fs,Ic as _s,Jb as qO,Jc as hs,K as bC,Kb as zO,Kc as gs,La as ZA,Lb as HO,Lc as ys,M as IC,Ma as eO,Mb as os,Mc as bs,N as RC,Na as tO,Nb as VO,Nc as Ts,O as PC,Oa as rO,Oc as Cs,P as MC,Pa as oO,Pb as KO,Pc as Es,Q as $C,Qa as nO,Qb as WO,Qc as Ss,R as FC,Ra as lO,Rb as YO,Rc as ws,S as wt,Sa as pO,Sb as XO,T as gA,Ta as uO,Tb as JO,Tc as As,U as yA,Ua as At,Ub as QO,Uc as Ev,V as bA,Vb as ZO,Vc as Sv,Wa as mO,Wb as ev,Wc as Os,X as TA,Xa as fO,Xb as tv,Xc as wv,Ya as _O,Yb as rv,Yc as Av,Z as CA,Za as hO,Zb as Ot,Zc as vs,_ as EA,_a as gO,_b as ov,_c as Is,a as WT,aa as SA,ad as vv,ba as wA,bb as yO,bd as Iv,ca as AA,cd as Rv,da as OA,dd as Pv,ea as vA,ed as Mv,fa as IA,fb as Xi,fc as ns,fd as kv,ga as RA,gc as is,gd as Rs,ha as GA,hb as IO,hc as ss,hd as Ps,i as sn,ib as RO,ic as as,id as xv,j as YT,ja as Vi,jb as PO,jd as Nv,k as XT,ka as Ki,kb as MO,kc as cs,kd as Lv,l as JT,la as Wi,lc as ds,ld as Dv,m as QT,mb as kO,mc as ls,md as $v,na as UA,nb as xO,nc as ps,nd as Fv,o as ZT,oa as jA,ob as NO,oc as us,od as Gv,p as eC,pa as BA,pb as LO,pc as ms,pd as Uv,qa as qA,qb as es,qc as iv,qd as jv,r as tC,ra as zA,rb as ts,rc as sv,rd as Bv,sa as HA,sc as av,sd as qv,t as rC,ta as VA,tb as rs,tc as cv,u as oC,ub as DO,uc as dv,v as nC,va as KA,vc as lv,wb as $O,wc as pv,wd as vt,x as iC,xa as WA,xb as FO,xc as uv,xd as zv,y as sC,ya as YA,yb as GO,yc as mv,yd as Hv,za as XA,zc as fv,zd as Vv}from"./chunks/chunk-2VH6COJE.js";import{A as EO,B as SO,C as wO,D as AO,E as OO,F as vO,G as Ji,H as Qi,I as Zi,a as PA,b as MA,c as kA,d as xA,e as NA,f as LA,g as DA,h as $A,i as FA,n as iO,q as sO,r as aO,u as cO,v as Yi,w as dO,x as bO,y as TO,z as CO}from"./chunks/chunk-CR5GC3VO.js";import{$b as OC,$d as pE,$e as GE,$f as hS,$g as pw,$h as Fi,$i as eA,A as Fo,Ad as Wn,Af as ki,Ag as qS,B as Go,Be as EE,Bf as xi,Bg as zS,C as Uo,Cb as TC,Cc as kn,Ce as SE,Cf as Ni,Cg as HS,D as jo,Db as CC,Dc as ZC,De as wE,Df as Li,Dg as VS,E as Bo,Ec as xn,Ef as YE,Eg as KS,F as qo,Fa as lC,Ff as XE,Fg as WS,G as zo,Ga as pC,Gc as eE,Gf as JE,Gg as YS,H as Ho,Ha as uC,Hd as cE,He as _i,Hf as QE,Hg as XS,I as Ne,Ib as EC,Id as dE,If as ZE,Ig as JS,J as Le,Jd as lE,Jf as eS,Jg as QS,Ji as zw,K as Vo,Ka as gn,Kd as Yn,Kf as tS,Kg as ZS,Ki as Hw,L as Ko,La as mC,Lb as SC,Ld as Xn,Le as AE,Lf as rS,Lg as ew,Li as Vw,M as Wo,Ma as fC,Mc as tE,Md as Jn,Me as OE,Mf as oS,Mg as tw,N as Yo,Na as _C,Nd as Qn,Ne as vE,Ng as rw,Ni as Kw,O as Xo,Oa as hC,Ob as wC,Od as Zn,Oe as IE,Oh as vw,Oi as Ww,P as Jo,Pc as rE,Pd as ei,Pe as RE,Pf as nS,Ph as Ge,Q as Qo,Qa as yn,Qc as oE,Qd as ti,Qe as PE,Qf as iS,Qg as ow,Qh as St,Qi as Yw,R as Zo,Ra as bn,Rb as AC,Rc as Nn,Rd as ri,Re as ME,Rf as sS,Rg as nw,Rh as Iw,Ri as Ui,S as en,Sa as $e,Sc as Ln,Sd as oi,Se as kE,Sf as aS,Sg as iw,Sh as Rw,T as tn,Ta as gC,Tb as Tt,Td as ni,Te as xE,Tf as cS,Tg as sw,Th as Pw,Ti as ji,U as rn,Ua as yC,Uc as Dn,Ud as ii,Ue as NE,Uf as dS,Ug as aw,Uh as Mw,Ui as Bi,V as on,Va as Tn,Vb as Ct,Vc as $n,Vd as si,Ve as LE,Vf as lS,Vg as cw,Vh as q,W as nn,Wa as Cn,Wc as Fn,Wd as ai,We as DE,Wf as pS,Wg as dw,Wh as kw,Xb as Pn,Xc as Gn,Xd as ci,Xf as uS,Xg as lw,Xh as xw,Xi as Xw,Ya as En,Yb as Mn,Yc as Un,Yd as di,Yf as mS,Yh as Nw,Yi as Jw,Zb as Et,Zc as nE,Ze as $E,Zf as fS,Zh as Lw,Zi as Qw,_c as iE,_e as FE,_f as _S,_i as Zw,a as I,aa as gt,ae as uE,af as UE,ag as gS,ah as uw,ai as Gi,aj as tA,b as DT,ba as yt,bc as vC,be as li,bf as jE,bg as yS,bj as rA,c as ht,ca as ln,cc as kC,ce as mE,cf as BE,cg as bS,cj as qi,da as pn,dc as xC,de as fE,df as qE,dg as TS,dh as mw,dj as oA,e as $T,ea as un,ec as NC,ef as zE,eg as CS,eh as fw,ej as nA,f as FT,fc as LC,ff as HE,fg as ES,fh as _w,g as GT,gc as DC,gf as VE,gg as SS,gh as hw,h as UT,hc as GC,hf as KE,hg as wS,hh as gw,hj as iA,i as jT,ic as UC,ie as _E,if as WE,ig as AS,ih as yw,ij as sA,j as BT,ja as mn,jb as Sn,jc as jC,je as hE,jg as OS,jh as bw,jj as aA,k as qT,kb as wn,kc as BC,kd as jn,ke as gE,kf as hi,kg as vS,kh as Tw,kj as cA,l as zT,la as fn,lb as An,lc as qC,ld as Bn,le as yE,lf as gi,lg as IS,lh as Cw,li as Dw,lj as dA,m as HT,ma as _n,mb as On,mc as zC,md as sE,mf as yi,mg as RS,mh as Ew,mj as lA,n as VT,na as hn,nb as vn,nc as HC,nd as qn,ne as bE,nf as bi,ng as PS,nh as Sw,ni as $w,nj as zi,o as KT,oc as VC,od as zn,oe as TE,of as Ti,og as MS,oh as ww,oi as Fw,p as Po,pc as KC,pd as aE,pf as Ci,pg as kS,ph as Aw,pi as Gw,q as Mo,qc as WC,qd as Hn,qe as CE,qf as Ei,qg as xS,qi as Uw,qj as pA,r as ko,rc as YC,rd as Vn,rf as Si,rg as NS,rh as Ow,ri as jw,rj as Hi,s as xo,sc as XC,sd as L,se as pi,sf as wi,sg as LS,sh as Di,t as ke,tc as JC,td as Kn,te as ui,tf as Ai,tg as DS,th as $i,tj as uA,u as No,ue as mi,uf as Oi,ug as $S,uj as mA,v as N,ve as fi,vf as vi,vg as FS,vi as Bw,vj as fA,w as xe,wb as In,wf as Ii,wg as GS,wj as _A,x as Lo,xf as Ri,xg as US,xi as qw,xj as hA,y as Do,yb as Rn,yf as Pi,yg as jS,z as $o,zc as QC,zd as Fe,zf as Mi,zg as BS}from"./chunks/chunk-7UUPLMCU.js";import"./chunks/chunk-VS565KBX.js";import"./chunks/chunk-SPPHDVZE.js";import{A as ue,B as LT,C as b,E as an,F as bt,G as me,H as cn,K as De,M as dn,b as IT,c as RT,d as PT,m as MT,r as kT,u as xT,y as NT}from"./chunks/chunk-5OFMWP3Q.js";import"./chunks/chunk-XAWE4EAK.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]="8f11e0bf-4115-55a8-bd39-c360f43cdc09")}catch{}})();var z="2026-07-28",or=["2025-11-25","2025-06-18"],te=[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"},rr=["debug","info","notice","warning","error","critical","alert","emergency"],u=class extends Error{code;data;constructor(t,r,o={}){super(t),this.name="PmMcpProtocolError",this.code=r,this.data=o}};function h(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Pg(e){if(e===void 0)return;if(!h(e))throw new u("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 u("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 Mg(e){if(e!==void 0){if(typeof e!="string"||!rr.includes(e))throw new u("Invalid MCP logLevel metadata",m.invalidParams,{field:w.logLevel,allowed:[...rr]});return e}}function Ye(e){let t=h(e)?e._meta:void 0;if(!h(t))throw new u("Missing required MCP request metadata",m.invalidParams,{required:[w.protocolVersion,w.clientCapabilities]});let r=t[w.protocolVersion];if(typeof r!="string"||!te.includes(r))throw new u("Unsupported protocol version",m.unsupportedProtocolVersion,{supported:[...te],requested:typeof r=="string"?r:null});let o=t[w.clientCapabilities];if(!h(o))throw new u("Invalid MCP client capabilities metadata",m.invalidParams,{field:w.clientCapabilities,expected:"object"});let n=Pg(t[w.clientInfo]),s=Mg(t[w.logLevel]);return{protocolVersion:z,clientCapabilities:o,...n?{clientInfo:n}:{},...s?{logLevel:s}:{}}}function EN(e,t){if(t!==e.protocolVersion)throw new u("MCP protocol header does not match request metadata",m.headerMismatch,{header:t??null,metadata:e.protocolVersion})}function SN(e,t){let r=t.filter(o=>!Object.prototype.hasOwnProperty.call(e.clientCapabilities,o));if(r.length>0)throw new u("Missing required client capability",m.missingRequiredClientCapability,{requiredCapabilities:Object.fromEntries(r.map(o=>[o,{}]))})}function wN(e,t){let r=e.clientCapabilities.extensions;return h(r)&&h(r[t])}function Xe(e,t){let r=h(e._meta)?e._meta:{};return{...e,_meta:{...r,[w.serverInfo]:{...t}}}}function kg(e,t){return Xe({...e,resultType:"complete"},t)}function AN(e){let t=e.ttlMs??6e4;if(!Number.isFinite(t)||t<0)throw new u("Invalid MCP discovery cache TTL",m.invalidParams,{ttlMs:t});return kg({supportedVersions:[...te],capabilities:structuredClone(e.capabilities),ttlMs:t,cacheScope:"public",...e.instructions?{instructions:e.instructions}:{}},e.serverInfo)}function ON(e,t){if(h(e)&&typeof e.resultType=="string")return e.resultType;if(t==="legacy")return"complete";throw new u("Modern MCP result is missing resultType",m.invalidParams,{required:"resultType"})}(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]="d4a56906-c542-567e-9265-15184a5c330b")}catch{}})();var xg=new Set(["--help","-h","--version","-V"]);function Ng(e,t){let r=[`Usage: ${e==="stdio"?"pm-mcp":"pm-mcp-http"} [--help | --version]`,"",e==="stdio"?"JSON-RPC over stdin/stdout. With no arguments, starts the stdio server.":"Streamable HTTP POST /mcp. With no arguments, starts the HTTP server.","","Options:"," -h, --help Print help and exit before transport startup."," -V, --version Print the package version and exit.","","Environment:"," PM_PATH Tracker root (otherwise discovered from cwd)."," PM_GLOBAL_PATH Global settings root."," PM_MCP_PROFILE core (default), standard, full, or custom."," PM_MCP_TOOLS Comma-separated tool allowlist for custom profile."," PM_MCP_DISCOVERY_CURSOR_KEY Shared discovery cursor secret, at least 32 UTF-8 bytes."," PM_MCP_BAGGAGE_ALLOWLIST Comma-separated permitted trace baggage keys."];return e==="http"&&r.push(" PM_MCP_HTTP_HOST Bind host (default 127.0.0.1)."," PM_MCP_HTTP_PORT Bind port, 0..65535 (default 3000)."," PM_MCP_HTTP_ALLOWED_ORIGINS Comma-separated exact browser origins (default none)."," PM_MCP_HTTP_BEARER_TOKEN Deployment token for the bundled verifier."," PM_MCP_HTTP_AUTH_ISSUER Exact HTTPS authorization-server issuer."," PM_MCP_HTTP_RESOURCE Canonical resource/audience URI."," PM_MCP_HTTP_SCOPES Space-separated scopes (default pm:read pm:write).","","Non-loopback HTTP requires bearer token, issuer, and resource together."),r.push("",`MCP protocol: ${te.join(", ")}.`,e==="stdio"?`Legacy initialize compatibility: ${or.join(", ")}.`:"HTTP requires modern per-request metadata; legacy initialize is stdio-only.","",e==="stdio"?"Client configuration:":"Example loopback server:",e==="stdio"?JSON.stringify({mcpServers:{pm:{command:"npx",args:["--yes","--package",`@unbrained/pm-cli@${t}`,"pm-mcp"]}}}):`PM_MCP_HTTP_PORT=3000 npx --yes --package @unbrained/pm-cli@${t} pm-mcp-http`,...e==="http"?["HTTP client configuration:",JSON.stringify({mcpServers:{pm:{url:"http://127.0.0.1:3000/mcp"}}})]:[],"","Configuration: https://github.com/unbraind/pm-cli/blob/main/docs/MCP_REMOTE_TRANSPORT_SECURITY.md",""),r.join(`
2
2
  `)}function RN(e,t,r){if(e.length===0)return{kind:"serve"};let o=e.find(n=>!xg.has(n));if(o!==void 0){let n=t==="stdio"?"pm-mcp":"pm-mcp-http";return{kind:"exit",exitCode:64,stdout:"",stderr:`Unsupported argument ${JSON.stringify(o)}. Run ${n} --help.
3
3
  `}}return{kind:"exit",exitCode:0,stdout:e.includes("--help")||e.includes("-h")?Ng(t,r):`${r}
4
4
  `,stderr:""}}import{createHash as sr,createHmac as ar,timingSafeEqual as Lg}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]="15b81dd0-ef1a-58be-b6ee-5975b6778993")}catch{}})();var Dg=["elicitation/create","roots/list","sampling/createMessage"],nr=class extends Error{inputRequests;requestState;constructor(t){super("MCP operation requires additional input"),this.name="PmMcpInputRequiredError",this.inputRequests=t.inputRequests,this.requestState=t.requestState}},cr=/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/u,he=32,Qe=64*1024,ge=16*1024,Je={maxBytes:256*1024,maxDepth:32,maxNodes:4096};function $g(e){return e==="elicitation/create"?"elicitation":e==="sampling/createMessage"?"sampling":"roots"}function ye(e,t,r){let o;try{o=JSON.stringify(e)}catch{throw new u(`Invalid ${r}: value is not JSON serializable`,m.invalidParams,{field:r})}if(Buffer.byteLength(o,"utf8")>t)throw new u(`Invalid ${r}: payload exceeds the protocol bound`,m.invalidParams,{field:r,maximumBytes:t})}function Ze(e,t){if(!h(e))throw new u("Invalid MCP inputRequests",m.invalidParams,{field:"inputRequests",expected:"object"});let r=Object.entries(e);if(r.length===0||r.length>he)throw new u("Invalid MCP inputRequests count",m.invalidParams,{minimum:1,maximum:he,observed:r.length});let o={};for(let[n,s]of r){if(!cr.test(n)||!h(s))throw new u("Invalid MCP input request entry",m.invalidParams,{field:`inputRequests.${n}`});let i=s.method;if(typeof i!="string"||!Dg.includes(i))throw new u("Unsupported MCP input request method",m.invalidParams,{field:`inputRequests.${n}.method`,method:i??null});let a=$g(i);if(!Object.prototype.hasOwnProperty.call(t.clientCapabilities,a))throw new u("Missing required client capability",m.missingRequiredClientCapability,{requiredCapabilities:{[a]:{}}});if(!h(s.params))throw new u("Invalid MCP input request parameters",m.invalidParams,{field:`inputRequests.${n}.params`,expected:"object"});o[n]={method:i,params:structuredClone(s.params)}}return ye(o,Qe,"inputRequests"),o}function dr(e){if(!h(e))throw new u("Invalid MCP inputResponses",m.invalidParams,{field:"inputResponses",expected:"object"});let t=Object.entries(e);if(t.length>he)throw new u("Invalid MCP inputResponses count",m.invalidParams,{maximum:he,observed:t.length});let r={};for(let[o,n]of t){if(!cr.test(o)||!h(n))throw new u("Invalid MCP input response entry",m.invalidParams,{field:`inputResponses.${o}`});r[o]=structuredClone(n)}return ye(r,Qe,"inputResponses"),r}function xN(e){let t=e.requestState?.trim();if(t&&Buffer.byteLength(t,"utf8")>ge)throw new u("Invalid MCP requestState: payload exceeds the protocol bound",m.invalidParams,{field:"requestState",maximumBytes:ge});let r=e.inputRequests===void 0?void 0:Ze(e.inputRequests,e.requestContext);if(r===void 0&&!t)throw new u("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 lr(e){let t=Buffer.from(e);if(t.byteLength<32)throw new u("MCP requestState signing key must contain at least 32 bytes",m.invalidParams,{minimumBytes:32});return t}function NN(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 u("Invalid MCP requestState payload",m.invalidParams);let r=Buffer.from(JSON.stringify({version:1,...e}),"utf8");if(r.byteLength>ge/2)throw new u("MCP requestState payload exceeds the protocol bound",m.invalidParams,{maximumBytes:ge/2});let o=r.toString("base64url"),n=ar("sha256",lr(t)).update(o).digest("base64url");return`${o}.${n}`}function Fg(e){if(!h(e)||e.version!==1)throw new u("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});let{expiresAt:t,method:r,parameterDigest:o,principal:n,state:s}=e;if(typeof t!="number"||!Number.isSafeInteger(t))throw new u("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});if(typeof r!="string"||typeof o!="string"||typeof n!="string")throw new u("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});return{expiresAt:t,method:r,parameterDigest:o,principal:n,state:s}}function LN(e,t,r){let[o,n,s]=e.split(".");if(!o||!n||s!==void 0)throw new u("Invalid MCP requestState encoding",m.invalidParams,{field:"requestState"});let i=Buffer.from(n,"base64url"),a=ar("sha256",lr(t)).update(o).digest();if(i.byteLength!==a.byteLength||!Lg(i,a))throw new u("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=Fg(c),{expiresAt:l,method:p,parameterDigest:f,principal:_}=d;if(l<(r.nowMs??Date.now()))throw new u("Expired MCP requestState",m.invalidParams,{field:"requestState",expiredAt:l});if(p!==r.method||f!==r.parameterDigest||_!==r.principal)throw new u("MCP requestState binding mismatch",m.invalidParams,{field:"requestState"});return d}function DN(e){return ye(e,Qe,"request parameters"),sr("sha256").update(JSON.stringify(e)).digest("hex")}var ir=class{#e=new Set;#t;constructor(t=4096){if(!Number.isSafeInteger(t)||t<1)throw new u("Invalid MCP replay guard capacity",m.invalidParams,{maximumEntries:t});this.#t=t}consume(t){let r=sr("sha256").update(t).digest("hex");if(this.#e.has(r))throw new u("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 Gg(e){if(!Number.isSafeInteger(e.ttlMs)||e.ttlMs<0||e.cacheScope!=="public"&&e.cacheScope!=="private")throw new u("Invalid MCP cache policy",m.invalidParams,{ttlMs:e.ttlMs,cacheScope:e.cacheScope});return{ttlMs:e.ttlMs,cacheScope:e.cacheScope}}function $N(e,t){return{...e,...Gg(t)}}function Ug(e){return e.replaceAll("~1","/").replaceAll("~0","~")}function jg(e,t){if(t==="#")return e;if(!t.startsWith("#/"))return;let r=e;for(let o of t.slice(2).split("/").map(Ug)){if(!h(r)&&!Array.isArray(r)||!Object.prototype.hasOwnProperty.call(r,o))return;r=r[o]}return r}function Bg(e){let t=e.maxBytes??Je.maxBytes,r=e.maxDepth??Je.maxDepth,o=e.maxNodes??Je.maxNodes;if(!Number.isSafeInteger(t)||t<2)throw new u("Invalid MCP JSON Schema work bounds",m.invalidParams);if(!Number.isSafeInteger(r)||r<1)throw new u("Invalid MCP JSON Schema work bounds",m.invalidParams);if(!Number.isSafeInteger(o)||o<1)throw new u("Invalid MCP JSON Schema work bounds",m.invalidParams);return{maximumBytes:t,maximumDepth:r,maximumNodes:o}}function qg(e,t){let r=Array.isArray(e.value)?e.value:h(e.value)?Object.values(e.value):[];for(let o of r)t.push({value:o,depth:e.depth+1})}function zg(e,t){if(!h(t)||typeof t.$ref!="string")return;let r=t.$ref;if(r.startsWith("#")&&jg(e,r)===void 0)throw new u("MCP JSON Schema contains an unresolved local reference",m.invalidParams,{reference:r})}function FN(e,t={}){let{maximumBytes:r,maximumDepth:o,maximumNodes:n}=Bg(t);if(typeof e!="boolean"&&!h(e))throw new u("Invalid MCP JSON Schema root",m.invalidParams,{expected:"object or boolean"});ye(e,r,"JSON Schema");let s=[{value:e,depth:0}],i=0;for(;s.length>0;){let a=s.pop();if(i+=1,i>n||a.depth>o)throw new u("MCP JSON Schema exceeds validation work bounds",m.invalidParams,{maximumDepth:o,maximumNodes:n});zg(e,a.value),qg(a,s)}return structuredClone(e)}import{randomUUID as Hg}from"node:crypto";import{readFile as Vg}from"node:fs/promises";import pr 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]="f3e94896-b2a0-561c-902b-71c28ddde2a1")}catch{}})();var VN="io.modelcontextprotocol/tasks",Kg=["working","input_required","completed","failed","cancelled"],Wg=/^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,Yg=3600*1e3,Xg=1e3,Te=1024,Jg=30,Qg=2e3;function et(e){return new u(e,m.invalidParams,{code:"mcp_task_not_found_or_not_authorized"})}function be(e){let t=e.trim();if(!Wg.test(t))throw et("Unknown MCP task");return t}function ur(e,t){if(typeof e!="string"||!Number.isFinite(Date.parse(e)))throw new u("Corrupt MCP task record",m.invalidParams,{field:t});return e}function mr(e){if(!h(e)||typeof e.code!="number"||!Number.isFinite(e.code)||typeof e.message!="string")throw new u("Corrupt MCP task error",m.invalidParams);return{code:e.code,message:e.message.slice(0,Te),...h(e.data)?{data:structuredClone(e.data)}:{}}}function Zg(e){if(!Kg.includes(e))throw new u("Corrupt MCP task record",m.invalidParams);return e}function ey(e){if(typeof e!="string"||e.length===0)throw new u("Corrupt MCP task record",m.invalidParams);return e}function ty(e){if(typeof e!="number"||!Number.isSafeInteger(e)||e<1)throw new u("Corrupt MCP task record",m.invalidParams);return e}function ry(e){if(e!==null&&(typeof e!="number"||!Number.isSafeInteger(e)||e<0))throw new u("Corrupt MCP task record",m.invalidParams);return e}function oy(e){if(e!==void 0){if(typeof e!="number"||!Number.isSafeInteger(e)||e<0)throw new u("Corrupt MCP task record",m.invalidParams);return e}}function ny(e){if(!Array.isArray(e)||e.some(t=>typeof t!="string"))throw new u("Corrupt MCP task record",m.invalidParams);return[...e]}function iy(e){if(!h(e)||e.version!==1)throw new u("Corrupt MCP task record",m.invalidParams);let t=typeof e.taskId=="string"?be(e.taskId):"",r=Zg(e.status),o=ey(e.principal),n=ty(e.workerPid),s=ry(e.ttlMs),i=oy(e.pollIntervalMs),a={version:1,taskId:t,status:r,principal:o,workerPid:n,createdAt:ur(e.createdAt,"createdAt"),lastUpdatedAt:ur(e.lastUpdatedAt,"lastUpdatedAt"),ttlMs:s,consumedInputKeys:ny(e.consumedInputKeys),...typeof e.statusMessage=="string"?{statusMessage:e.statusMessage.slice(0,Te)}:{},...typeof i=="number"?{pollIntervalMs:i}:{}};if(h(e.inputRequests)&&(a.inputRequests=structuredClone(e.inputRequests)),h(e.inputResponses)&&(a.inputResponses=structuredClone(e.inputResponses)),h(e.result)&&(a.result=structuredClone(e.result)),e.error!==void 0&&(a.error=mr(e.error)),a.status==="input_required"&&!a.inputRequests||a.status==="completed"&&!a.result||a.status==="failed"&&!a.error)throw new u("Corrupt MCP task status payload",m.invalidParams,{status:a.status});return a}function H(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 re(e){return e==="completed"||e==="failed"||e==="cancelled"}function sy(e){try{return process.kill(e,0),!0}catch(t){return!(typeof t=="object"&&t!==null&&"code"in t&&t.code==="ESRCH")}}var tt=class{#e;#t;#r;#o;#i;constructor(t){this.#e=pr.resolve(t.pmRoot),this.#t=t.owner?.trim()||"pm-mcp",this.#r=t.now??(()=>new Date),this.#o=t.taskIdFactory??(()=>`mcp-task-${Hg()}`),this.#i=t.workerPid??process.pid}#s(t){return pr.join(this.#e,"runtime","mcp-tasks","records",`${be(t)}.json`)}async#c(t){try{return iy(JSON.parse(await Vg(this.#s(t),"utf8")))}catch(r){throw me(r)||r instanceof SyntaxError?et("Unknown MCP task"):r}}async#a(t){await De(this.#s(t.taskId),`${JSON.stringify(t,null,2)}
@@ -0,0 +1,2 @@
1
+ (function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="fa27dff5-0270-505f-bd5f-bc1eb0fe5ad8")}catch{}})();import{readdir,realpath,stat}from"node:fs/promises";import path from"node:path";import{EXIT_CODE}from"../shared/constants.js";import{PmCliError}from"../shared/errors.js";const MAX_PATTERN_LENGTH=4096,MAX_NESTING=32,MAX_RANGE_SIZE=1e3,MAX_STATES=5e4,DFA_LIMITS={nodes:1e4,edges:4e4,stateIds:2e6},SLASH=47;class GlobTooComplex extends Error{}const POSIX_CLASSES=new Map(Object.entries({alnum:[[48,57],[65,90],[97,122]],alpha:[[65,90],[97,122]],ascii:[[0,127]],blank:[[9,9],[32,32]],cntrl:[[0,31],[127,127]],digit:[[48,57]],graph:[[33,126]],lower:[[97,122]],print:[[32,126]],punct:[[33,47],[58,64],[91,96],[123,126]],space:[[9,13],[32,32]],upper:[[65,90]],word:[[48,57],[65,90],[95,95],[97,122]],xdigit:[[48,57],[65,70],[97,102]]}));function negationRefusal(){return new PmCliError("--add-glob does not support negated patterns (a leading ! or !(...)); list the files or patterns to link instead",EXIT_CODE.USAGE)}function bracketEnd(chars,start){let index=start+1;for((chars[index]==="!"||chars[index]==="^")&&(index+=1),chars[index]==="]"&&(index+=1);index<chars.length;){const char=chars[index];if(char==="\\")index+=2;else if(char==="["&&chars[index+1]===":"){const close=chars.indexOf(":",index+2);close===-1||chars[close+1]!=="]"?index+=1:index=close+2}else{if(char==="]")return index+1;index+=1}}return-1}function openerAt(chars,index,open){const char=chars[index];if(char==="{")return{index,kind:"{"};if(char!=="(")return;const operator=chars[index-1];return operator!==void 0&&"@?*+!".includes(operator)&&!isEscaped(chars,index-1)?{index:index-1,kind:"("}:open.some(opener=>opener.kind==="(")?{index,kind:"plain"}:void 0}function closeAt(chars,index,open,closers,groups){const char=chars[index],top=open.at(-1);if(char===")"&&top?.kind==="plain"){open.pop(),groups.set(top.index,index);return}const kind=char==="}"?"{":char===")"?"(":void 0;if(!(kind===void 0||top?.kind!==kind)&&(open.pop(),closers.set(top.index,index),chars[top.index]==="!"))throw negationRefusal()}function pairConstructs(chars){const closers=new Map,brackets=new Map,groups=new Map,open=[];let index=0;for(;index<chars.length;){if(chars[index]==="\\"){index+=2;continue}const end=chars[index]==="["?bracketEnd(chars,index):-1;if(end!==-1){brackets.set(index,end),index=end;continue}const opener=openerAt(chars,index,open);if(opener!==void 0?open.push(opener):closeAt(chars,index,open,closers,groups),open.length>MAX_NESTING)throw new GlobTooComplex;index+=1}return{closers,brackets,groups}}function isEscaped(chars,index){let count=0;for(let cursor=index-1;cursor>=0&&chars[cursor]==="\\";cursor-=1)count+=1;return count%2===1}function literalNodes(text){return Array.from(text,char=>({kind:"char",value:char.codePointAt(0)}))}function braceRange(content){const numeric=/^(-?(?:0|[1-9]\d{0,8}))\.\.(-?(?:0|[1-9]\d{0,8}))$/u.exec(content),alphabetic=/^([A-Za-z])\.\.([A-Za-z])$/u.exec(content);if(numeric===null&&alphabetic===null)return;const[from,to]=numeric!==null?[Number(numeric[1]),Number(numeric[2])]:[alphabetic[1].codePointAt(0),alphabetic[2].codePointAt(0)];if(Math.abs(to-from)+1>MAX_RANGE_SIZE)throw new GlobTooComplex;const step=from<=to?1:-1,values=[];for(let value=from;value!==to+step;value+=step)values.push(numeric!==null?String(value):String.fromCodePoint(value));return values}function posixClassAt(chars,index){if(chars[index]!=="["||chars[index+1]!==":")return;const colon=chars.indexOf(":",index+2);if(!(colon===-1||chars[colon+1]!=="]"))return{ranges:POSIX_CLASSES.get(chars.slice(index+2,colon).join(""))??[],next:colon+2}}function memberAt(chars,index,close){const escaped=chars[index]==="\\"&&index+1<close;return{codePoint:chars[escaped?index+1:index].codePointAt(0),next:index+(escaped?2:1)}}function bracketLiteral(chars,start,end){const literal=[];for(let cursor=start;cursor<end;cursor+=1)chars[cursor]==="\\"&&cursor+1<end&&(cursor+=1),literal.push(chars[cursor].codePointAt(0));return literal}function parseClass(chars,start,end){let index=start+1;const negated=chars[index]==="!"||chars[index]==="^";negated&&(index+=1);const ranges=[],close=end-1;for(;index<close;){const posix=posixClassAt(chars,index);if(posix!==void 0){ranges.push(...posix.ranges),index=posix.next;continue}const low=memberAt(chars,index,close);if(index=low.next,chars[index]!=="-"||index+1>=close){ranges.push([low.codePoint,low.codePoint]);continue}const high=memberAt(chars,index+1,close);index=high.next,low.codePoint<=high.codePoint&&ranges.push([low.codePoint,high.codePoint])}return{kind:"class",negated,ranges,literal:bracketLiteral(chars,start,end)}}class Parser{chars;closers;brackets;groups;constructor(chars,pairs){this.chars=chars,this.closers=pairs.closers,this.brackets=pairs.brackets,this.groups=pairs.groups}alternatives(start,end,separator){const options=[];let cursor=start;for(;;){const{nodes,stop}=this.sequence(cursor,end,separator);if(options.push(nodes),stop>=end)return options;cursor=stop+1}}sequence(start,end,separator){const nodes=[];let index=start;for(;index<end;){if(this.chars[index]===separator)return{nodes,stop:index};const token=this.token(index,end);nodes.push(...token.nodes),index=token.next}return{nodes,stop:end}}token(index,end){const char=this.chars[index];if(char==="\\")return{nodes:literalNodes(index+1<end?this.chars[index+1]:"\\"),next:index+2};const closer=this.closers.get(index);if(closer!==void 0)return{nodes:char==="{"?this.brace(index,closer):this.extglob(char,index,closer),next:closer+1};const group=this.groups.get(index);if(group!==void 0)return{nodes:[...literalNodes("("),...this.sequence(index+1,group,void 0).nodes,...literalNodes(")")],next:group+1};const bracket=this.brackets.get(index);return bracket!==void 0?{nodes:[parseClass(this.chars,index,bracket)],next:bracket}:char==="*"?this.stars(index,end):{nodes:char==="?"?[{kind:"any"}]:literalNodes(char),next:index+1}}extglob(operator,index,closer){const options=this.alternatives(index+2,closer,"|");return[operator==="@"?{kind:"alt",options}:{kind:"repeat",optional:operator!=="+",many:operator!=="?",options}]}brace(index,closer){const options=this.alternatives(index+1,closer,",");if(options.length>1)return[{kind:"alt",options}];const range=braceRange(this.chars.slice(index+1,closer).join(""));return range!==void 0?[{kind:"alt",options:range.map(literalNodes)}]:[...literalNodes("{"),...options[0],...literalNodes("}")]}stars(index,end){let run=1;for(;this.chars[index+run]==="*"&&index+run<end&&!this.closers.has(index+run);)run+=1;if(run!==2)return{nodes:[{kind:"star"}],next:index+run};const slash=index+run<end&&this.chars[index+run]==="/";return{nodes:[{kind:"globstar",slash}],next:index+run+(slash?1:0)}}}const END_KINDS=["segment","inside"],ANY={kind:"any"};function entriesOf(ends){return END_KINDS.flatMap(kind=>ends[kind]===void 0?[]:[ends[kind]])}class Nfa{states=[];add(){if(this.states.length>=MAX_STATES)throw new GlobTooComplex;return this.states.push({epsilon:[],syntactic:[],edges:[]}),this.states.length-1}epsilon(from,to,syntactic=!0){this.states[from].epsilon.push(to),syntactic&&this.states[from].syntactic.push(to)}consume(from,test,kind){const to=this.add();for(const entry of entriesOf(from))this.states[entry].edges.push({test,to});return{[kind]:to}}join(parts){const joined={};for(const kind of END_KINDS){const states=parts.flatMap(part=>part[kind]===void 0?[]:[part[kind]]);if(states.length===1&&(joined[kind]=states[0]),states.length>1){const merged=this.add();for(const state of states)this.epsilon(state,merged);joined[kind]=merged}}return joined}feed(ends,loop){for(const kind of END_KINDS)ends[kind]!==void 0&&this.epsilon(ends[kind],loop[kind])}build(nodes,from){let current=from;for(const node of nodes)current=this.node(node,current);return current}alternation(options,from){return this.join(options.map(option=>this.build(option,from)))}star(from){const loop=this.add();for(const entry of entriesOf(from))this.epsilon(entry,loop,!1);return this.states[loop].edges.push({test:ANY,to:loop}),{inside:loop}}segments(from){const between=this.add();this.epsilon(from,between,!1);const inside=this.add();return this.states[between].edges.push({test:ANY,to:inside}),this.states[inside].edges.push({test:ANY,to:inside},{test:{kind:"char",value:SLASH},to:between}),between}globstar(from,slash){if(slash){const parts=[];return from.segment!==void 0&&parts.push({segment:this.segments(from.segment)}),from.inside!==void 0&&parts.push(this.consume(this.star({inside:from.inside}),{kind:"char",value:SLASH},"segment")),this.join(parts)}const star=this.star(from);return from.segment!==void 0&&this.globstars.push({continuation:star.inside,entry:from.segment}),star}globstars=[];syntacticClosure(seed){const seen=new Set(seed),stack=[...seed];for(;stack.length>0;)for(const next of this.states[stack.pop()].syntactic)seen.has(next)||(seen.add(next),stack.push(next));return seen}resolveGlobstars(accept){for(const{continuation,entry}of this.globstars){const reachable=this.syntacticClosure([continuation]);if(reachable.has(accept)){const rest=this.add();this.epsilon(entry,rest,!1),this.states[rest].edges.push({test:{kind:"all"},to:rest}),this.epsilon(rest,accept,!1)}const targets=new Set;for(const state of reachable)for(const{test,to}of this.states[state].edges)accepts(test,SLASH)&&targets.add(to);if(targets.size===0)continue;const segments=this.segments(entry);for(const target of targets)this.epsilon(segments,target,!1)}}repeat(node,from){if(!node.many)return this.join([from,this.alternation(node.options,from)]);const loop={segment:this.add(),inside:this.add()};return this.feed(node.optional?from:this.alternation(node.options,from),loop),this.feed(this.alternation(node.options,loop),loop),loop}node(node,from){switch(node.kind){case"char":return this.consume(from,{kind:"char",value:node.value},node.value===SLASH?"segment":"inside");case"any":return this.consume(from,ANY,"inside");case"star":return this.star(from);case"globstar":return this.globstar(from,node.slash);case"class":return this.join([this.consume(from,{kind:"class",negated:node.negated,ranges:node.ranges},"inside"),this.build(node.literal.map(value=>({kind:"char",value})),from)]);case"alt":return this.alternation(node.options,from);case"repeat":return this.repeat(node,from)}}}function accepts(test,codePoint){switch(test.kind){case"char":return test.value===codePoint;case"any":return codePoint!==SLASH;case"all":return!0;case"class":return codePoint!==SLASH&&test.ranges.some(([low,high])=>codePoint>=low&&codePoint<=high)!==test.negated}}class PathMatcher{generation=0;nextId=0;nodes=new Map;edges=new Map;stateIds=0;nfa;acceptState;limits;start;constructor(nfa,startState,acceptState,limits){this.nfa=nfa,this.acceptState=acceptState,this.limits=limits,this.start=this.node(this.closure([startState]))}retained(){return{nodes:this.nodes.size,edges:this.edges.size,stateIds:this.stateIds}}reset(){this.generation+=1,this.nodes=new Map,this.edges=new Map,this.stateIds=0}closure(seed){const seen=new Set(seed),stack=[...seed];for(;stack.length>0;)for(const next of this.nfa.states[stack.pop()].epsilon)seen.has(next)||(seen.add(next),stack.push(next));return[...seen].sort((left,right)=>left-right)}node(states){const key=states.join(","),cached=this.nodes.get(key);if(cached!==void 0)return cached;(this.nodes.size>=this.limits.nodes||this.stateIds+states.length>this.limits.stateIds)&&this.reset();const created={id:this.nextId,generation:this.generation,states,accepting:states.includes(this.acceptState)};return this.nextId+=1,this.nodes.set(key,created),this.stateIds+=states.length,created}step(from,codePoint){const key=`${from.id}:${codePoint}`,known=from.generation===this.generation?this.edges.get(key):void 0;if(known!==void 0)return known;const reached=[];for(const state of from.states)for(const{test,to}of this.nfa.states[state].edges)accepts(test,codePoint)&&reached.push(to);const next=this.node(this.closure(reached));return this.edges.size>=this.limits.edges&&this.reset(),from.generation===this.generation&&this.edges.set(key,next),next}advance(from,text){let node=from;for(const char of text){if(node.states.length===0)return node;node=this.step(node,char.codePointAt(0))}return node}}function compile(text,limits=DFA_LIMITS){const chars=Array.from(text),nodes=new Parser(chars,pairConstructs(chars)).sequence(0,chars.length,void 0).nodes,nfa=new Nfa,start=nfa.add(),accept=nfa.add();for(const end of entriesOf(nfa.build(nodes,{segment:start})))nfa.epsilon(end,accept);return nfa.resolveGlobstars(accept),new PathMatcher(nfa,start,accept,limits)}function isStaticSegment(segment){return!/[*?[\]{}()!@+\\]/u.test(segment)}function kindOf(entry){return entry.isFile()?"file":entry.isDirectory()?"directory":"other"}async function resolveEntry(directory,real,entry){if(!entry.isSymbolicLink())return{kind:kindOf(entry),real:path.join(real,entry.name)};try{const target=await realpath(path.join(directory,entry.name));return{kind:kindOf(await stat(target)),real:target}}catch{return}}async function walk(matcher,directory,real,prefix,node,ancestors,out){let entries;try{entries=await readdir(directory,{withFileTypes:!0})}catch{return}for(const entry of entries){const afterName=matcher.advance(node,entry.name);if(afterName.states.length===0)continue;const resolved=await resolveEntry(directory,real,entry);if(resolved===void 0)continue;const relative=path.posix.join(prefix,entry.name);if(resolved.kind==="file"&&afterName.accepting&&out.push(relative),resolved.kind!=="directory")continue;const afterSlash=matcher.step(afterName,SLASH);afterSlash.states.length===0||ancestors.has(resolved.real)||(ancestors.add(resolved.real),await walk(matcher,path.join(directory,entry.name),resolved.real,relative,afterSlash,ancestors,out),ancestors.delete(resolved.real))}}function normalizePattern(pattern){const normalized=path.posix.normalize(pattern);return/^\/\/[^/]/u.test(pattern)?`/${normalized}`:normalized}function trimTrailingSeparators(pattern){let text=pattern;for(;text.length>1&&text.endsWith("/")&&!isEscaped(text,text.length-1);)text=text.slice(0,-1);return text}async function listed(directory,name){return(await readdir(directory).catch(()=>[])).includes(name)}async function exactCase(cwd,segments){let directory=cwd,index=0;for(;segments[index]==="..";)directory=path.dirname(directory),index+=1;for(;index<segments.length;index+=1){if(!await listed(directory,segments[index]))return!1;directory=path.join(directory,segments[index])}return!0}async function literalMatch(text,cwd){const target=path.resolve(cwd,text),found=await stat(target).catch(()=>{});if(found===void 0||!found.isFile())return[];const absolute=path.isAbsolute(text);return(absolute?await listed(path.dirname(target),path.basename(target)):await exactCase(cwd,text.split("/")))?[absolute?target.replaceAll("\\","/"):path.posix.normalize(text)]:[]}function splitStatic(text,cwd){const segments=text.split("/");let count=0;for(;count<segments.length&&isStaticSegment(segments[count]);)count+=1;if(count===segments.length)return;const prefix=count===0?"":`${segments.slice(0,count).join("/")}/`,root=path.resolve(cwd,prefix),rest=segments.slice(count).join("/");if(path.isAbsolute(text))return{root,base:root.replaceAll("\\","/"),rest,prefix:[]};const relative=path.posix.normalize(prefix===""?".":prefix).replace(/\/$/u,"");return{root,base:relative==="."?"":relative,rest,prefix:segments.slice(0,count)}}function compileWithinBounds(text){try{return compile(text)}catch(error){if(error instanceof GlobTooComplex)return;throw error}}async function expandFileGlob(pattern,cwd){if(pattern.startsWith("!"))throw negationRefusal();if(Array.from(pattern).length>MAX_PATTERN_LENGTH)return[];const text=trimTrailingSeparators(normalizePattern(pattern)),parts=splitStatic(text,cwd);if(parts===void 0)return literalMatch(text,cwd);const matcher=compileWithinBounds(parts.rest);if(matcher===void 0||!await exactCase(cwd,parts.prefix))return[];const real=await realpath(parts.root).catch(()=>{});if(real===void 0)return[];const out=[];return await walk(matcher,parts.root,real,"",matcher.start,new Set([real]),out),out.map(relative=>joinOutput(parts.base,relative))}function joinOutput(base,relative){return base.startsWith("//")?`/${path.posix.join(base.slice(1),relative)}`:path.posix.join(base,relative)}const _testOnly={compile,joinOutput,normalizePattern};export{_testOnly,expandFileGlob};
2
+ //# sourceMappingURL=file-glob.js.map
@@ -54,10 +54,89 @@ rejectValue?:RegExp;
54
54
  /** Case-sensitive shape of an unquoted captured value that is a reference when a `;` ends its statement. */
55
55
  rejectStatementReference?:RegExp;
56
56
  /** Quoted-key, nested-container and element spellings judged by the same value grammar. */
57
- structured?:SecretStructuredSpelling;}
57
+ structured?:SecretStructuredSpelling;
58
+ /**
59
+ * Minimum length of the literal left in the captured value once every
60
+ * run-time reference expands to nothing (see {@link literalAfterReferences}).
61
+ * A reference is a placeholder only when it is the whole value. The literal,
62
+ * not the captured text, is then judged by the entropy and value predicates.
63
+ */
64
+ minimumLiteralLength?:number;
65
+ /**
66
+ * Sticky grammar that the literal a captured value spells must match whole,
67
+ * read as one double-quoted literal, when the captured text holds a
68
+ * reference opener or a quote (see {@link acceptsSecretMatch}). It lets a
69
+ * referenced value be judged by the same grammar as a reference-free one.
70
+ */
71
+ literalValue?:RegExp;
72
+ /**
73
+ * A narrower reading scanned as well: its own flat pattern and structured
74
+ * value grammar, with the same keys, judged on the captured text by the
75
+ * rule's value and entropy predicates but without the literal minimum or
76
+ * literal grammar, as the narrower rule always judged it. A value is a
77
+ * finding when either reading reports it, so widening `regex` and
78
+ * `structured.value` never drops a finding the narrower rule made, and
79
+ * every key the narrower scan visits is still visited (pm-hw00c2).
80
+ */
81
+ baseline?:SecretRuleReading;}
82
+ /** A flat pattern and the structured value grammar that go with it. */
83
+ export interface SecretRuleReading{
84
+ /** Global flat pattern, as {@link SecretRule.regex}. */
85
+ regex:RegExp;
86
+ /** Structured value grammar (regular-expression source), as {@link SecretStructuredSpelling.value}. */
87
+ value:string;}
58
88
  /** Canonical patterns; repository exemptions never exempt mutation payloads. */
59
- export declare const SECRET_RULES:readonly[{readonly name:"private-key";readonly mutationRule:"private_key";readonly regex:RegExp;},{readonly name:"github-token";readonly mutationRule:"github_token";readonly regex:RegExp;},{readonly name:"npm-token";readonly mutationRule:"npm_token";readonly regex:RegExp;},{readonly name:"aws-access-key";readonly mutationRule:"aws_access_key";readonly regex:RegExp;},{readonly name:"google-api-key";readonly mutationRule:"google_api_key";readonly regex:RegExp;},{readonly name:"slack-token";readonly mutationRule:"slack_token";readonly regex:RegExp;},{readonly name:"anthropic-api-key";readonly mutationRule:"anthropic_api_key";readonly regex:RegExp;},{readonly name:"openai-api-key";readonly mutationRule:"openai_api_key";readonly regex:RegExp;},{readonly name:"gitlab-token";readonly mutationRule:"gitlab_token";readonly regex:RegExp;},{readonly name:"jwt-like-token";readonly mutationRule:"jwt_like_token";readonly regex:RegExp;},{readonly name:"npm-auth-token-assignment";readonly mutationRule:"npm_auth_token_assignment";readonly regex:RegExp;},{readonly name:"sentry-user-token";readonly mutationRule:"sentry_user_token";readonly regex:RegExp;},{readonly name:"sentry-org-token";readonly mutationRule:"sentry_org_token";readonly regex:RegExp;},{readonly name:"private-ip";readonly mutationRule:"private_ip";readonly regex:RegExp;},{readonly name:"private-ssh-target";readonly mutationRule:"private_ssh_target";readonly regex:RegExp;},{readonly name:"sshpass-inline-password";readonly mutationRule:"sshpass_inline_password";readonly regex:RegExp;},{readonly name:"password-assignment";readonly mutationRule:"password_assignment";readonly regex:RegExp;readonly structured:{readonly keys:"password|passphrase";readonly value:string;readonly element:true;};},{readonly name:"absolute-home-path";readonly mutationRule:"absolute_home_path";readonly regex:RegExp;readonly excludeFiles:RegExp;},{readonly name:"user-at-private-host";readonly mutationRule:"user_at_private_host";readonly regex:RegExp;readonly excludeFiles:RegExp;},{readonly name:"high-entropy-assignment";readonly mutationRule:"high_entropy_assignment";readonly regex:RegExp;readonly structured:{readonly keys:"token|secret|password|passwd|api[_-]?key";readonly value:string;};readonly mutationOnlyReason:"Generic assignments in source code are not credentials; preserve the existing mutation heuristic without treating source identifiers as secrets.";readonly minimumEntropy:3.5;},{readonly name:"credential-key-assignment";readonly mutationRule:"credential_key_assignment";readonly regex:RegExp;readonly structured:{readonly keys:"(?<![a-z0-9_]|[a-z0-9_]-)(?:(?:[a-z0-9]+_)+(?:password|passphrase)|(?:[a-z0-9]+[_-])*(?:secret|token|(?:api|secret|private|access)[_-]?key|client[_-]?secret|passwd|pwd))";readonly value:string;readonly element:true;readonly elementValue:true;};readonly mutationOnlyReason:"Key-named assignments in source code and test fixtures are identifiers and synthetic data; repository scans keep the token-format rules, which recognize real credentials there.";readonly minimumEntropy:3;readonly rejectValue:RegExp;readonly rejectStatementReference:RegExp;}];
89
+ export declare const SECRET_RULES:readonly[{readonly name:"private-key";readonly mutationRule:"private_key";readonly regex:RegExp;},{readonly name:"github-token";readonly mutationRule:"github_token";readonly regex:RegExp;},{readonly name:"npm-token";readonly mutationRule:"npm_token";readonly regex:RegExp;},{readonly name:"aws-access-key";readonly mutationRule:"aws_access_key";readonly regex:RegExp;},{readonly name:"google-api-key";readonly mutationRule:"google_api_key";readonly regex:RegExp;},{readonly name:"slack-token";readonly mutationRule:"slack_token";readonly regex:RegExp;},{readonly name:"anthropic-api-key";readonly mutationRule:"anthropic_api_key";readonly regex:RegExp;},{readonly name:"openai-api-key";readonly mutationRule:"openai_api_key";readonly regex:RegExp;},{readonly name:"gitlab-token";readonly mutationRule:"gitlab_token";readonly regex:RegExp;},{readonly name:"jwt-like-token";readonly mutationRule:"jwt_like_token";readonly regex:RegExp;},{readonly name:"npm-auth-token-assignment";readonly mutationRule:"npm_auth_token_assignment";readonly regex:RegExp;},{readonly name:"sentry-user-token";readonly mutationRule:"sentry_user_token";readonly regex:RegExp;},{readonly name:"sentry-org-token";readonly mutationRule:"sentry_org_token";readonly regex:RegExp;},{readonly name:"private-ip";readonly mutationRule:"private_ip";readonly regex:RegExp;},{readonly name:"private-ssh-target";readonly mutationRule:"private_ssh_target";readonly regex:RegExp;},{readonly name:"sshpass-inline-password";readonly mutationRule:"sshpass_inline_password";readonly regex:RegExp;},{readonly name:"password-assignment";readonly mutationRule:"password_assignment";readonly regex:RegExp;readonly structured:{readonly keys:"password|passphrase";readonly value:string;readonly element:true;};readonly minimumLiteralLength:8;},{readonly name:"absolute-home-path";readonly mutationRule:"absolute_home_path";readonly regex:RegExp;readonly excludeFiles:RegExp;},{readonly name:"user-at-private-host";readonly mutationRule:"user_at_private_host";readonly regex:RegExp;readonly excludeFiles:RegExp;},{readonly name:"high-entropy-assignment";readonly mutationRule:"high_entropy_assignment";readonly regex:RegExp;readonly structured:{readonly keys:"token|secret|password|passwd|api[_-]?key";readonly value:string;};readonly mutationOnlyReason:"Generic assignments in source code are not credentials; preserve the existing mutation heuristic without treating source identifiers as secrets.";readonly minimumEntropy:3.5;},{readonly name:"credential-key-assignment";readonly mutationRule:"credential_key_assignment";readonly regex:RegExp;readonly structured:{readonly keys:"(?<![a-z0-9_]|[a-z0-9_]-)(?:(?:[a-z0-9]+_)+(?:password|passphrase)|(?:[a-z0-9]+[_-])*(?:secret|token|(?:api|secret|private|access)[_-]?key|client[_-]?secret|passwd|pwd))";readonly value:string;readonly element:true;readonly elementValue:true;};readonly mutationOnlyReason:"Key-named assignments in source code and test fixtures are identifiers and synthetic data; repository scans keep the token-format rules, which recognize real credentials there.";readonly minimumEntropy:3;readonly minimumLiteralLength:8;readonly literalValue:RegExp;readonly baseline:{readonly regex:RegExp;readonly value:string;};readonly rejectValue:RegExp;readonly rejectStatementReference:RegExp;}];
60
90
  /** Share matching and normalization, returning locations rather than matched values. */
61
91
  export declare function findSecretRuleMatches(rule:SecretRule,content:string):Generator<SecretRuleMatch>;
62
- /** Accept a pattern match, applying the declared entropy predicate when present. */
63
- export declare function acceptsSecretMatch(rule:SecretRule,match:RegExpMatchArray):boolean;
92
+ /**
93
+ * Where the references that lead a value end (`$($(cmd))`, `${A:-${B}}`,
94
+ * `$NAME`, `<x>`). An iterative scan, so no reference length can exhaust the
95
+ * regex backtrack stack and make the guard fail open; each character is read
96
+ * once.
97
+ */
98
+ declare function leadingReferencesEnd(text:string):number;
99
+ /**
100
+ * How a structured key spelling `"<name>":` reads for a key-named rule:
101
+ * `exact` when the key word is the whole name, `prefixed` when other key text
102
+ * precedes it, and undefined when the name does not end with one of the rule's
103
+ * keys. The same key pattern and shape check judge quoted keys in text, so a
104
+ * payload property and its JSON spelling read alike.
105
+ */
106
+ export declare function structuredKeyShape(rule:SecretRule,name:string):"exact"|"prefixed"|undefined;
107
+ /**
108
+ * Judge one string as a quoted structured value of a key-named rule, exactly
109
+ * as the structured pass judges a quoted value in text: `compact` for a
110
+ * prefixed key's value or an object member's value, lenient for an exact key's
111
+ * value or an array element.
112
+ */
113
+ export declare function acceptsStructuredValue(rule:SecretRule,value:string,compact:boolean):boolean;
114
+ /**
115
+ * Expand run-time references in data, such as a decoded literal or an element
116
+ * body, whose own quote characters are literal: `${NAME}`, `${NAME:?message}`,
117
+ * `$(command)`, a leading CONSTANT_CASE `$NAME` and `<placeholder>` contribute
118
+ * nothing (a value that is only one `$name` of any case spells nothing), and the default word of
119
+ * `${NAME:-word}` contributes its own expansion with the shell's quote removal
120
+ * (`${PW:-"x"}` contributes `x`; `${PW:-${FALLBACK}}` contributes nothing). A
121
+ * reference that never closes, and a `<` without a `>` before the next `<`,
122
+ * stay literal text. With `variables` false, `$NAME` text is always literal.
123
+ */
124
+ export declare function expandRuntimeReferences(text:string,variables?:boolean):string;
125
+ /**
126
+ * The literal a captured text value spells: references expand as in
127
+ * {@link expandRuntimeReferences}, and the quote characters that delimit each
128
+ * top-level quoted piece are removed, as a shell or configuration reader
129
+ * removes them; a quote of the other kind inside a piece is part of the
130
+ * literal. Both happen in the same pass, so a reference may hold quotes
131
+ * (`${PW:-""}`) and a default word's data quotes stay data.
132
+ */
133
+ export declare function literalAfterReferences(value:string,variables?:boolean):string;
134
+ /**
135
+ * Accept a pattern match, applying the declared literal-length, literal
136
+ * grammar, value and entropy predicates when present. A rule with a literal
137
+ * minimum judges the literal its value spells once references expand, so a
138
+ * reference never hides the literal around it and never counts as one.
139
+ */
140
+ export declare function acceptsSecretMatch(rule:SecretRule,match:RegExpMatchArray):boolean;
141
+ /** Internal scanners exposed for unit tests only; not part of any public surface. */
142
+ export declare const _testOnly:{leadingReferencesEnd:typeof leadingReferencesEnd;};export{};
@@ -1,5 +1,6 @@
1
- (function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="14a5d95f-9996-5e0a-a029-b53f3a2385e6")}catch{}})();const COMPONENT=`[^\\s/\\\\<>"'\\x60()\\[\\]{},;?=:#*]+`,SEPARATOR="[/\\\\]+",ACCOUNT="[\\p{L}\\p{N}._@-]+",ACCOUNT_PATH=ACCOUNT+"(?:"+SEPARATOR+COMPONENT+")*",ROOT_HOME="(?:(?:home|users)"+SEPARATOR+ACCOUNT_PATH+"|root"+SEPARATOR+ACCOUNT_PATH+")",UNIX_HOME="[/\\\\]"+ROOT_HOME,MULTI_ROOT_HOME="[/\\\\]{2,}"+ROOT_HOME,WINDOWS_HOME="/?[a-z]:"+SEPARATOR+"users"+SEPARATOR+ACCOUNT_PATH,SHARE_COMPONENT=COMPONENT+"(?: +"+COMPONENT+")*",SHARED_PROFILE="(?:"+SHARE_COMPONENT+SEPARATOR+")?users"+SEPARATOR+ACCOUNT_PATH,UNC_HOME="[/\\\\]{2,}"+COMPONENT+SEPARATOR+SHARED_PROFILE,DEVICE_VOLUME="(?:[a-z]:|volume\\{[a-f0-9-]+\\}|"+COMPONENT+")",DEVICE_HOME="[/\\\\]{2}[?.]"+SEPARATOR+"(?:unc"+SEPARATOR+COMPONENT+SEPARATOR+SHARED_PROFILE+"|"+DEVICE_VOLUME+SEPARATOR+"users"+SEPARATOR+ACCOUNT_PATH+")",FILE_HOME="file:(?:"+DEVICE_HOME+"|(?:[/\\\\](?![/\\\\])|[/\\\\]{3,}|[/\\\\]{2}localhost"+SEPARATOR+")(?:"+ROOT_HOME+"|[a-z]:"+SEPARATOR+"users"+SEPARATOR+ACCOUNT_PATH+")|[/\\\\]{2}(?:[a-z]:"+SEPARATOR+"users"+SEPARATOR+ACCOUNT_PATH+"|"+COMPONENT+SEPARATOR+"(?:"+ROOT_HOME+"|"+SHARED_PROFILE+")))",PRIVATE_HOME_PATH_PATTERN=new RegExp("(?:^|[^\\p{L}\\p{N}_./\\\\~])(?:"+UNIX_HOME+"|"+WINDOWS_HOME+"|"+FILE_HOME+")|(?:^|[^\\p{L}\\p{N}_:./\\\\~])(?:"+MULTI_ROOT_HOME+"|"+UNC_HOME+"|"+DEVICE_HOME+")","giu"),MAX_NORMALIZATION_PASSES=4,REMAINING_ENCODING=/%[a-f0-9]{2}|\\(?:u[a-f0-9]{4}|x[a-f0-9]{2}|\/)/iu,utf8=new TextDecoder("utf-8");function percentView(value){return value.replace(/(?:%[a-f0-9]{2})+/giu,run=>utf8.decode(Uint8Array.from(run.matchAll(/%([a-f0-9]{2})/giu),match=>Number.parseInt(match[1],16)))).replace(/%(?![a-f0-9]{2})[a-z0-9]{0,2}/giu,"\uFFFD")}function escapedView(value){return value.replace(/\\+(?:u([a-f0-9]{4})|x([a-f0-9]{2})|(\/))?/giu,(match,unicode,byte,slash)=>{const code=unicode??byte;return code===void 0?slash??match:String.fromCharCode(Number.parseInt(code,16))})}function unicodeView(value){return value.normalize("NFKC").replace(/[\p{Bidi_Control}\u200b-\u200f\u2060-\u206f\ufeff]/gu,"").replace(/[\u2215\u2044]/gu,"/").replace(/[\u043e\u041e]/gu,"o").replace(/[\u0455\u0405]/gu,"s")}function nextNormalizedView(view,steps){for(const[kind,transform]of[["percent_decode",percentView],["json_unescape",escapedView],["unicode_fold",unicodeView]]){const transformed=transform(view);transformed!==view&&!steps.includes(kind)&&steps.push(kind),view=transformed}return view}function*normalizedHomePathMatches(line,regex,detected){let view=line;const steps=[];for(let pass=0;pass<MAX_NORMALIZATION_PASSES;pass+=1){const previous=view;if(view=nextNormalizedView(view,steps),!detected){regex.lastIndex=0;for(const _match of view.matchAll(regex))detected=!0,yield{index:0,normalizations:[...steps]}}if(view===previous)break;pass===MAX_NORMALIZATION_PASSES-1&&REMAINING_ENCODING.test(view)&&(yield{index:0,normalizations:[...steps],normalization_incomplete:!0})}}function*findPrivateHomePathMatches(content,regex){let offset=0;for(const line of content.split(`
2
- `)){regex.lastIndex=0;let rawFound=!1;for(const match of line.matchAll(regex))rawFound=!0,yield{index:offset+match.index};for(const match of normalizedHomePathMatches(line,regex,rawFound))yield{...match,index:offset};offset+=line.length+1}}const PASSWORD_KEYS="password|passphrase",PASSWORD_VALUE=/(?:(?!<|\$\{|\$\(|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,}')/,HIGH_ENTROPY_KEYS="token|secret|password|passwd|api[_-]?key",CREDENTIAL_KEYS="(?<![a-z0-9_]|[a-z0-9_]-)(?:(?:[a-z0-9]+_)+(?:password|passphrase)|(?:[a-z0-9]+[_-])*(?:secret|token|(?:api|secret|private|access)[_-]?key|client[_-]?secret|passwd|pwd))",CREDENTIAL_VALUE=/(?:"(?=[^"\s]{8,}")|'(?=[^'\s]{8,}')|(?!["']))((?![<[$/]|~\/|\.\.?\/|[A-Za-z][\w+.-]*:\/\/|%[A-Za-z_]\w*%|[A-Za-z]:[\\/]|(?<=")(?:(?:[A-Za-z_]\w*\.)+[A-Za-z_]\w*|[A-Za-z]+(?:-[A-Za-z]+)*|(?:[\w.-]+\/)+[\w.-]+\.[A-Za-z][A-Za-z0-9]{0,4})"|(?<=')(?:(?:[A-Za-z_]\w*\.)+[A-Za-z_]\w*|[A-Za-z]+(?:-[A-Za-z]+)*|(?:[\w.-]+\/)+[\w.-]+\.[A-Za-z][A-Za-z0-9]{0,4})'|(?<!["'])[A-Za-z]+(?:-[A-Za-z]+)*(?![\w!@#$%^&*.+\-=/~])|(?<!["'])(?:[A-Za-z_]\w*\.)+[A-Za-z_]\w*(?![\w!@#$%^&*.+\-=/~])|(?<!["'])(?:[\w.-]+\/)+[\w.-]+\.[A-Za-z][A-Za-z0-9]{0,4}(?=[\s,;)}\]]|$)|(?<!["'])[\w$.]+\()(?:(?<=")[^\s"]{8,}|(?<=')[^\s']{8,}|(?<==)[A-Za-z0-9!@#$%^&*._+\-=/~?:|]{8,}|(?<!["'=])[A-Za-z0-9!@#$%^&*._+\-=/~]{8,}))/,HIGH_ENTROPY_VALUE=/["']?([A-Za-z0-9+/=_-]{24,})/,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:new RegExp(String.raw`\b(?:${PASSWORD_KEYS})\s*[:=]\s*`+PASSWORD_VALUE.source,"gi"),structured:{keys:PASSWORD_KEYS,value:PASSWORD_VALUE.source,element:!0}},{name:"absolute-home-path",mutationRule:"absolute_home_path",regex:PRIVATE_HOME_PATH_PATTERN,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:new RegExp(String.raw`\b(?:${HIGH_ENTROPY_KEYS})\s*[:=]\s*`+HIGH_ENTROPY_VALUE.source,"gi"),structured:{keys:HIGH_ENTROPY_KEYS,value:HIGH_ENTROPY_VALUE.source},mutationOnlyReason:"Generic assignments in source code are not credentials; preserve the existing mutation heuristic without treating source identifiers as secrets.",minimumEntropy:3.5},{name:"credential-key-assignment",mutationRule:"credential_key_assignment",regex:new RegExp(String.raw`\b(?:${CREDENTIAL_KEYS})\s*[:=]\s*`+CREDENTIAL_VALUE.source,"gi"),structured:{keys:CREDENTIAL_KEYS,value:CREDENTIAL_VALUE.source,element:!0,elementValue:!0},mutationOnlyReason:"Key-named assignments in source code and test fixtures are identifiers and synthetic data; repository scans keep the token-format rules, which recognize real credentials there.",minimumEntropy:3,rejectValue:/^(?:[\w.-]+\/)*id_(?:rsa|dsa|ecdsa|ed25519)(?:_sk)?(?:\.pub)?$/u,rejectStatementReference:/^[A-Z]+(?:_[A-Z]+)+$/u}];function*findSecretRuleMatches(rule,content){if(rule.mutationRule==="absolute_home_path"){yield*findPrivateHomePathMatches(content,rule.regex);return}rule.regex.lastIndex=0;for(const match of content.matchAll(rule.regex))acceptsSecretMatch(rule,match)&&(yield{index:match.index});rule.structured&&(yield*findStructuredSpellingMatches(rule,rule.structured,content))}const compiledSpellings=new Map,LINE_BREAK=/[\r\n\u2028\u2029]/u;function compileSpelling(spelling){const cacheKey=`${spelling.keys}\0${spelling.value}\0${spelling.element===!0}`;let compiled=compiledSpellings.get(cacheKey);return compiled||(compiled={key:new RegExp(String.raw`\b(?:${spelling.keys})(["']?)\s*[:=]\s*`,"gi"),value:new RegExp(spelling.value,"iy"),...spelling.element?{element:new RegExp(String.raw`<(?:${spelling.keys})(?:\s[^<>]*)?>([^<]*)<\/(?:${spelling.keys})\s*>`,"gi")}:{}},compiledSpellings.set(cacheKey,compiled)),compiled}function scanQuoted(content,start){const quote=content[start];for(let index=start+1;index<content.length;index+=1){const character=content[index];if(character==="\\")index+=1;else if(character===quote)return{end:index+1,terminated:!0}}return{end:content.length,terminated:!1}}function endOfQuoted(content,start){return scanQuoted(content,start).end}function judgeFor(closers,accepts,acceptsMember){return closers.at(-1)==="}"?acceptsMember:accepts}function walkContainer(content,start,accepts,acceptsMember=accepts){const closers=[];let expectKey=!1;for(let index=start;index<content.length;index+=1){const character=content[index];switch(character){case"[":case"{":closers.push(character==="["?"]":"}"),expectKey=character==="{";break;case"]":case"}":if(closers.pop()!==character||closers.length===0)return{found:!1,end:index+1};expectKey=!1;break;case",":expectKey=closers.at(-1)==="}";break;case":":expectKey=!1;break;case'"':case"'":if(!expectKey&&judgeFor(closers,accepts,acceptsMember)(index))return{found:!0,end:index};index=endOfQuoted(content,index)-1;break;default:break}}return{found:!1,end:content.length}}const ESCAPE_SEQUENCE=/\\(?:U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{2}|[0-7]{1,3}|[\s\S])/gu,SIMPLE_ESCAPES={n:`
3
- `,r:"\r",t:" ",b:"\b",f:"\f",v:"\v"};function decodeQuotedLiteral(literal,terminated){const quote=literal[0],neutral=literal.slice(1,terminated?-1:void 0).replaceAll(ESCAPE_SEQUENCE,sequence=>{const kind=sequence[1];if((kind==="u"||kind==="x")&&sequence.length>2)return String.fromCharCode(Number.parseInt(sequence.slice(2),16));if(/^[0-7]$/u.test(kind))return String.fromCharCode(Number.parseInt(sequence.slice(1),8));if(kind==="U"&&sequence.length===10){const codePoint=Number.parseInt(sequence.slice(2),16);return codePoint<=1114111?String.fromCodePoint(codePoint):"\uFFFD"}return SIMPLE_ESCAPES[kind]??kind}).replaceAll(quote,quote==='"'?"'":'"').replaceAll(/[\r\n\u2028\u2029]/gu," ");return`${quote}${neutral}${terminated?quote:""}`}const MAX_KEY_PREFIX=64;function keyShape(content,index,quote){const previous=content[index-1];if(!quote)return previous!==void 0&&/[\p{L}\p{N}_.-]/u.test(previous)?"prefixed":"exact";if(previous===quote)return"exact";const floor=Math.max(0,index-MAX_KEY_PREFIX);for(let cursor=index-1;cursor>=floor;cursor-=1){const character=content[cursor];if(character===quote)return"prefixed";if(character===`
4
- `||character==="\r"||character==='"'||character==="'")return"malformed"}return"malformed"}function createValueJudge(rule,value,content){const valueMatch=(text,at)=>{value.lastIndex=at;const match=value.exec(text);return match!==null&&!LINE_BREAK.test(match[0])&&acceptsSecretMatch(rule,match)?match:null},escapedMatches=at=>{if(content[at]!=='"'&&content[at]!=="'")return;const{end,terminated}=scanQuoted(content,at),literal=content.slice(at,end);return literal.includes("\\")?LINE_BREAK.test(literal)?[]:(content[at]==="'"?[decodeQuotedLiteral(literal,terminated),literal]:[decodeQuotedLiteral(literal,terminated)]).map(reading=>valueMatch(reading,0)).filter(match=>match!==null):void 0},valuesAt=at=>{const escaped=escapedMatches(at);if(escaped!==void 0)return escaped;const match=valueMatch(content,at);return match===null?[]:[match]};return{direct:at=>valueMatch(content,at)!==null,escaped:at=>(escapedMatches(at)?.length??0)>0,accepts:compact=>at=>valuesAt(at).some(match=>!(compact&&/\s/u.test(match[0])))}}function*elementMatches(element,content,judge){element.lastIndex=0;for(const match of content.matchAll(element)){const value=match[1].trim();(judge?judge(value):value.length>=8&&!value.startsWith("${")&&!value.startsWith("$("))&&(yield{index:match.index})}}function alreadyWalked(walkedEnd,valueStart,compact){return valueStart<walkedEnd.exact||compact&&valueStart<walkedEnd.compact}function scalarFinds(judge,accepts,quote,valueStart){return(quote||judge.escaped(valueStart)&&!judge.direct(valueStart))&&accepts(valueStart)}function*findStructuredSpellingMatches(rule,spelling,content){const compiled=compileSpelling(spelling),judge=createValueJudge(rule,compiled.value,content),key=new RegExp(compiled.key),walkedEnd={exact:0,compact:0};for(let match=key.exec(content);match;match=key.exec(content)){const quote=match[1],shape=keyShape(content,match.index,quote);if(shape==="malformed")continue;const compact=shape==="prefixed",accepts=judge.accepts(compact),valueStart=match.index+match[0].length,opener=content[valueStart];if(opener==="["||opener==="{"){if(alreadyWalked(walkedEnd,valueStart,compact))continue;const walked=walkContainer(content,valueStart,accepts,judge.accepts(!0));walkedEnd[compact?"compact":"exact"]=walked.end,walked.found&&(yield{index:match.index})}else scalarFinds(judge,accepts,quote,valueStart)&&(yield{index:match.index})}compiled.element&&(yield*elementMatches(compiled.element,content,elementValueJudge(rule,spelling,compiled)))}function elementValueJudge(rule,spelling,compiled){if(spelling.elementValue)return value=>{const neutral=value.replaceAll('"',"'");compiled.value.lastIndex=0;const match=compiled.value.exec(`"${neutral}"`);return match===null||match[1]!==neutral?!1:(match[1]=value,acceptsSecretMatch(rule,match))}}function isStatementReference(shape,match){const end=match.index+match[0].length,opener=match.input[end-match[1].length-1];return/^[ \t]*;/u.test(match.input.slice(end,end+64))&&opener!=='"'&&opener!=="'"&&shape.test(match[1])}function acceptsSecretMatch(rule,match){if(rule.rejectValue?.test(match[1])===!0||rule.rejectStatementReference&&isStatementReference(rule.rejectStatementReference,match))return!1;if(rule.minimumEntropy===void 0)return!0;const characters=[...match[1]],counts=new Map;for(const character of characters)counts.set(character,(counts.get(character)??0)+1);let entropy=0;for(const count of counts.values()){const probability=count/characters.length;entropy-=probability*Math.log2(probability)}return entropy>=rule.minimumEntropy}export{PRIVATE_HOME_PATH_PATTERN,SECRET_RULES,acceptsSecretMatch,findPrivateHomePathMatches,findSecretRuleMatches};
1
+ (function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="b93aa43d-6c3e-5a34-9139-88000581c39f")}catch{}})();const COMPONENT=`[^\\s/\\\\<>"'\\x60()\\[\\]{},;?=:#*]+`,SEPARATOR="[/\\\\]+",ACCOUNT="[\\p{L}\\p{N}._@-]+",ACCOUNT_PATH=ACCOUNT+"(?:"+SEPARATOR+COMPONENT+")*",ROOT_HOME="(?:(?:home|users)"+SEPARATOR+ACCOUNT_PATH+"|root"+SEPARATOR+ACCOUNT_PATH+")",UNIX_HOME="[/\\\\]"+ROOT_HOME,MULTI_ROOT_HOME="[/\\\\]{2,}"+ROOT_HOME,WINDOWS_HOME="/?[a-z]:"+SEPARATOR+"users"+SEPARATOR+ACCOUNT_PATH,SHARE_COMPONENT=COMPONENT+"(?: +"+COMPONENT+")*",SHARED_PROFILE="(?:"+SHARE_COMPONENT+SEPARATOR+")?users"+SEPARATOR+ACCOUNT_PATH,UNC_HOME="[/\\\\]{2,}"+COMPONENT+SEPARATOR+SHARED_PROFILE,DEVICE_VOLUME="(?:[a-z]:|volume\\{[a-f0-9-]+\\}|"+COMPONENT+")",DEVICE_HOME="[/\\\\]{2}[?.]"+SEPARATOR+"(?:unc"+SEPARATOR+COMPONENT+SEPARATOR+SHARED_PROFILE+"|"+DEVICE_VOLUME+SEPARATOR+"users"+SEPARATOR+ACCOUNT_PATH+")",FILE_HOME="file:(?:"+DEVICE_HOME+"|(?:[/\\\\](?![/\\\\])|[/\\\\]{3,}|[/\\\\]{2}localhost"+SEPARATOR+")(?:"+ROOT_HOME+"|[a-z]:"+SEPARATOR+"users"+SEPARATOR+ACCOUNT_PATH+")|[/\\\\]{2}(?:[a-z]:"+SEPARATOR+"users"+SEPARATOR+ACCOUNT_PATH+"|"+COMPONENT+SEPARATOR+"(?:"+ROOT_HOME+"|"+SHARED_PROFILE+")))",PRIVATE_HOME_PATH_PATTERN=new RegExp("(?:^|[^\\p{L}\\p{N}_./\\\\~])(?:"+UNIX_HOME+"|"+WINDOWS_HOME+"|"+FILE_HOME+")|(?:^|[^\\p{L}\\p{N}_:./\\\\~])(?:"+MULTI_ROOT_HOME+"|"+UNC_HOME+"|"+DEVICE_HOME+")","giu"),MAX_NORMALIZATION_PASSES=4,REMAINING_ENCODING=/%[a-f0-9]{2}|\\(?:u[a-f0-9]{4}|x[a-f0-9]{2}|\/)/iu,utf8=new TextDecoder("utf-8");function percentView(value){return value.replace(/(?:%[a-f0-9]{2})+/giu,run=>utf8.decode(Uint8Array.from(run.matchAll(/%([a-f0-9]{2})/giu),match=>Number.parseInt(match[1],16)))).replace(/%(?![a-f0-9]{2})[a-z0-9]{0,2}/giu,"\uFFFD")}function escapedView(value){return value.replace(/\\+(?:u([a-f0-9]{4})|x([a-f0-9]{2})|(\/))?/giu,(match,unicode,byte,slash)=>{const code=unicode??byte;return code===void 0?slash??match:String.fromCharCode(Number.parseInt(code,16))})}function unicodeView(value){return value.normalize("NFKC").replace(/[\p{Bidi_Control}\u200b-\u200f\u2060-\u206f\ufeff]/gu,"").replace(/[\u2215\u2044]/gu,"/").replace(/[\u043e\u041e]/gu,"o").replace(/[\u0455\u0405]/gu,"s")}function nextNormalizedView(view,steps){for(const[kind,transform]of[["percent_decode",percentView],["json_unescape",escapedView],["unicode_fold",unicodeView]]){const transformed=transform(view);transformed!==view&&!steps.includes(kind)&&steps.push(kind),view=transformed}return view}function*normalizedHomePathMatches(line,regex,detected){let view=line;const steps=[];for(let pass=0;pass<MAX_NORMALIZATION_PASSES;pass+=1){const previous=view;if(view=nextNormalizedView(view,steps),!detected){regex.lastIndex=0;for(const _match of view.matchAll(regex))detected=!0,yield{index:0,normalizations:[...steps]}}if(view===previous)break;pass===MAX_NORMALIZATION_PASSES-1&&REMAINING_ENCODING.test(view)&&(yield{index:0,normalizations:[...steps],normalization_incomplete:!0})}}function*findPrivateHomePathMatches(content,regex){let offset=0;for(const line of content.split(`
2
+ `)){regex.lastIndex=0;let rawFound=!1;for(const match of line.matchAll(regex))rawFound=!0,yield{index:offset+match.index};for(const match of normalizedHomePathMatches(line,regex,rawFound))yield{...match,index:offset};offset+=line.length+1}}const PASSWORD_KEYS="password|passphrase",PASSWORD_QUOTED_PIECES=4,PASSWORD_REPEAT_BOUND=4096,maximalRun=characterClass=>`${characterClass}+(?!${characterClass})`,PASSWORD_QUOTED_SPAN=String.raw`'[^'\r\n]*'|"[^"\\\r\n]*(?:\\.[^"\\\r\n]*){0,${PASSWORD_REPEAT_BOUND}}"`,PASSWORD_REFERENCE=String.raw`\$\{(?:${maximalRun(String.raw`[^{}$'"\\\r\n]`)}|\\[^\r\n]|${PASSWORD_QUOTED_SPAN}|\$(?!\{)|\$\{[^{}\r\n]*\}){0,${PASSWORD_REPEAT_BOUND}}\}`+String.raw`|\$\((?:${maximalRun(String.raw`[^()$'"\\\r\n]`)}|\\[^\r\n]|${PASSWORD_QUOTED_SPAN}|\$(?!\()|\$\([^()\r\n]*\)){0,${PASSWORD_REPEAT_BOUND}}\)`,PASSWORD_PIECE=String.raw`${PASSWORD_REFERENCE}|<[^<>\r\n]*>|${maximalRun(String.raw`[A-Za-z0-9!@#%^&*._+\-=]`)}|\$(?![{(])`,PASSWORD_QUOTED=String.raw`"[^"]*"|'[^']*'`,PASSWORD_QUOTED_PIECE=String.raw`(?:"[^"\s]*"|'[^'\s]*')(?:${PASSWORD_PIECE}){0,${PASSWORD_REPEAT_BOUND}}`,PASSWORD_VALUE=new RegExp(String.raw`(?!config\.auth\.password\s*(?:\|\|\s*(?:''|"")|\?\s*unescape\(encodeURIComponent\(config\.auth\.password\)\)\s*:\s*(?:''|""))(?=[ \t]*(?:\/\*(?:[^*]|\*(?!\/))*\*\/[ \t]*)*(?:;|$|\/\/[^\r\n\u2028\u2029]*(?:\r\n)?$)))`+`((?:${PASSWORD_PIECE}){1,${PASSWORD_REPEAT_BOUND}}(?:${PASSWORD_QUOTED_PIECE}){0,${PASSWORD_QUOTED_PIECES}}|(?:${PASSWORD_QUOTED_PIECE}){1,${PASSWORD_QUOTED_PIECES}}|${PASSWORD_QUOTED})`),PASSWORD_MINIMUM_LITERAL_LENGTH=8,HIGH_ENTROPY_KEYS="token|secret|password|passwd|api[_-]?key",CREDENTIAL_KEYS="(?<![a-z0-9_]|[a-z0-9_]-)(?:(?:[a-z0-9]+_)+(?:password|passphrase)|(?:[a-z0-9]+[_-])*(?:secret|token|(?:api|secret|private|access)[_-]?key|client[_-]?secret|passwd|pwd))",EXCLUSION_REPEAT_BOUND=4096,CREDENTIAL_OPEN=String.raw`"(?=[^"\s]{8}[^"\s]*")|'(?=[^'\s]{8}[^'\s]*')|(?!["'])`,CREDENTIAL_PLAIN=String.raw`(?![<[$/]|~\/|\.\.?\/|[A-Za-z][\w+.-]*:\/\/|%[A-Za-z_]\w*%|[A-Za-z]:[\\/]|(?<=")(?:(?:[A-Za-z_]\w*\.){1,${EXCLUSION_REPEAT_BOUND}}[A-Za-z_]\w*|[A-Za-z]+(?:-[A-Za-z]+){0,${EXCLUSION_REPEAT_BOUND}}|(?:[\w.-]+\/){1,${EXCLUSION_REPEAT_BOUND}}[\w.-]+\.[A-Za-z][A-Za-z0-9]{0,4})"|(?<=')(?:(?:[A-Za-z_]\w*\.){1,${EXCLUSION_REPEAT_BOUND}}[A-Za-z_]\w*|[A-Za-z]+(?:-[A-Za-z]+){0,${EXCLUSION_REPEAT_BOUND}}|(?:[\w.-]+\/){1,${EXCLUSION_REPEAT_BOUND}}[\w.-]+\.[A-Za-z][A-Za-z0-9]{0,4})'|(?<!["'])[A-Za-z]+(?:-[A-Za-z]+){0,${EXCLUSION_REPEAT_BOUND}}(?![\w!@#$%^&*.+\-=/~])|(?<!["'])(?:[A-Za-z_]\w*\.){1,${EXCLUSION_REPEAT_BOUND}}[A-Za-z_]\w*(?![\w!@#$%^&*.+\-=/~])|(?<!["'])(?:[\w.-]+\/){1,${EXCLUSION_REPEAT_BOUND}}[\w.-]+\.[A-Za-z][A-Za-z0-9]{0,4}(?=[\s,;)}\]]|$)|(?<!["'])[\w$.]+\()(?:(?<=")[^\s"]{8}[^\s"]*|(?<=')[^\s']{8}[^\s']*|(?<==)[A-Za-z0-9!@#$%^&*._+\-=/~?:|]{8,}|(?<!["'=])[A-Za-z0-9!@#$%^&*._+\-=/~]{8,})`,CREDENTIAL_LITERAL_VALUE=new RegExp(`(?:${CREDENTIAL_OPEN})(${CREDENTIAL_PLAIN})`,"iy"),CREDENTIAL_MINIMUM_LITERAL_LENGTH=8,CREDENTIAL_RUN=String.raw`[A-Za-z0-9!@#%^*._+\-=/~]`,CREDENTIAL_AMPERSAND=String.raw`&(?!&)`,CREDENTIAL_LEADING_LITERAL=64,CREDENTIAL_REFERENCE_SPAN=String.raw`'[^'\s]*'|"[^"\\\s]*(?:\\\S[^"\\\s]*){0,${PASSWORD_REPEAT_BOUND}}"`,CREDENTIAL_REFERENCE=String.raw`\$\{(?:${maximalRun(String.raw`[^{}$'"\\\s]`)}|\\\S|${CREDENTIAL_REFERENCE_SPAN}|\$(?!\{)|\$\{[^{}\s]*\}){0,${PASSWORD_REPEAT_BOUND}}\}`+String.raw`|\$\((?:${maximalRun(String.raw`[^()$'"\\\s]`)}|\\\S|${CREDENTIAL_REFERENCE_SPAN}|\$(?!\()|\$\([^()\s]*\)){0,${PASSWORD_REPEAT_BOUND}}\)`+String.raw`|<[^<>\s]*>|\$[A-Za-z_]\w*(?!\w)`,credentialPiece=run=>String.raw`${CREDENTIAL_REFERENCE}|${maximalRun(run)}|${CREDENTIAL_AMPERSAND}|\$(?![{(A-Za-z_])`,credentialQuotedPiece=run=>String.raw`(?:"[^"\s]*"|'[^'\s]*')(?:${credentialPiece(run)}){0,${PASSWORD_REPEAT_BOUND}}`,credentialReferenced=run=>String.raw`(?:(?:${run}|${CREDENTIAL_AMPERSAND}){1,${CREDENTIAL_LEADING_LITERAL}}(?=[$<]))?(?:${CREDENTIAL_REFERENCE})`+String.raw`(?:${credentialPiece(run)}){0,${PASSWORD_REPEAT_BOUND}}(?:${credentialQuotedPiece(run)}){0,${PASSWORD_QUOTED_PIECES}}`,credentialConcatenated=run=>String.raw`(?:${credentialQuotedPiece(run)}){1,${PASSWORD_QUOTED_PIECES}}`,credentialUnquoted=build=>String.raw`(?<!["'])(?:${build(CREDENTIAL_RUN)})`,CREDENTIAL_CONCATENATION_CONTINUES=String.raw`(?:[\w@#~]|!(?![.+\-*/%=^!(]))`,CREDENTIAL_CONCATENATION_OPEN=String.raw`(?=(?:"[^"\s]*"|'[^'\s]*')[$<"']`+String.raw`|"(?=[^"\s]*[$<])[^"\s]*"${CREDENTIAL_CONCATENATION_CONTINUES}|'(?=[^'\s]*[$<])[^'\s]*'${CREDENTIAL_CONCATENATION_CONTINUES})`,CREDENTIAL_QUOTED_REFERENCED=String.raw`(?<=")(?=[^"\s]*[$<])[^"\s]+|(?<=')(?=[^'\s]*[$<])[^'\s]+`,CREDENTIAL_VALUE=new RegExp(`(?:${CREDENTIAL_CONCATENATION_OPEN}|${CREDENTIAL_OPEN})((?=["'])(?:${credentialUnquoted(credentialConcatenated)})|${CREDENTIAL_QUOTED_REFERENCED}|${credentialUnquoted(credentialReferenced)}|${CREDENTIAL_PLAIN})`),HIGH_ENTROPY_VALUE=/["']?([A-Za-z0-9+/=_-]{24,})/,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:new RegExp(String.raw`\b(?:${PASSWORD_KEYS})\s*[:=]\s*`+PASSWORD_VALUE.source,"gi"),structured:{keys:PASSWORD_KEYS,value:PASSWORD_VALUE.source,element:!0},minimumLiteralLength:PASSWORD_MINIMUM_LITERAL_LENGTH},{name:"absolute-home-path",mutationRule:"absolute_home_path",regex:PRIVATE_HOME_PATH_PATTERN,excludeFiles:/^(?:tests\/|examples\/)/},{name:"user-at-private-host",mutationRule:"user_at_private_host",regex:/(?<![A-Za-z0-9._-])[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:new RegExp(String.raw`\b(?:${HIGH_ENTROPY_KEYS})\s*[:=]\s*`+HIGH_ENTROPY_VALUE.source,"gi"),structured:{keys:HIGH_ENTROPY_KEYS,value:HIGH_ENTROPY_VALUE.source},mutationOnlyReason:"Generic assignments in source code are not credentials; preserve the existing mutation heuristic without treating source identifiers as secrets.",minimumEntropy:3.5},{name:"credential-key-assignment",mutationRule:"credential_key_assignment",regex:new RegExp(String.raw`\b(?:${CREDENTIAL_KEYS})\s*[:=]\s*`+CREDENTIAL_VALUE.source,"gi"),structured:{keys:CREDENTIAL_KEYS,value:CREDENTIAL_VALUE.source,element:!0,elementValue:!0},mutationOnlyReason:"Key-named assignments in source code and test fixtures are identifiers and synthetic data; repository scans keep the token-format rules, which recognize real credentials there.",minimumEntropy:3,minimumLiteralLength:CREDENTIAL_MINIMUM_LITERAL_LENGTH,literalValue:CREDENTIAL_LITERAL_VALUE,baseline:{regex:new RegExp(String.raw`\b(?:${CREDENTIAL_KEYS})\s*[:=]\s*`+CREDENTIAL_LITERAL_VALUE.source,"gi"),value:CREDENTIAL_LITERAL_VALUE.source},rejectValue:/^(?:[\w.-]+\/)*id_(?:rsa|dsa|ecdsa|ed25519)(?:_sk)?(?:\.pub)?$/u,rejectStatementReference:/^[A-Z]+(?:_[A-Z]+)+$/u}];function*findSecretRuleMatches(rule,content){if(rule.mutationRule==="absolute_home_path"){yield*findPrivateHomePathMatches(content,rule.regex);return}for(const reading of ruleReadings(rule))yield*flatMatches(reading,content),reading.structured&&(yield*findStructuredSpellingMatches(reading,reading.structured,content))}const baselineRules=new WeakMap;function ruleReadings(rule){const baseline=rule.baseline;if(baseline===void 0)return[rule];let judged=baselineRules.get(rule);return judged===void 0&&(judged={...rule,regex:baseline.regex,minimumLiteralLength:void 0,literalValue:void 0,baseline:void 0},rule.structured&&(judged.structured={...rule.structured,value:baseline.value}),baselineRules.set(rule,judged)),[rule,judged]}function isParameterName(content,index){const name=content[index-1]==="#"||content[index-1]==="!"?index-1:index;return content[name-1]==="{"&&content[name-2]==="$"}const INNER_SHELL_MATCHES=new WeakSet,INNER_CLOSE_AT=new WeakMap,CUT_REFERENCE_BOUND=4096;function referenceSpans(content,offset,text){const spans=[],open=[],end=offset+text.length;return walkReferences(content,offset,end,open,spans),walkReferences(content,end,Math.min(content.length,end+CUT_REFERENCE_BOUND),open),spans}function walkReferences(content,start,end,open,spans){for(let index=start;index<end&&(spans!==void 0||open.length>0);index+=1){const frame=open.at(-1);if(content[index]==="$"&&(content[index+1]==="{"||content[index+1]==="(")&&frame?.quoted!=="'"){const span={open:index,close:end,command:content[index+1]==="(",quoted:[]};spans?.push(span),open.push({span,closer:content[index+1]==="{"?"}":")"}),index+=1}else frame!==void 0&&(index=referenceStep(content,index,open))}}function referenceStep(text,index,open){const frame=open.at(-1),character=text[index];return character==="\\"&&frame.quoted!=="'"?index+1:(frame.quoted!==void 0?character===frame.quoted&&(frame.span.quoted.push([frame.quoteStart,index]),frame.quoted=void 0):character==="'"||character==='"'?(frame.quoted=character,frame.quoteStart=index):character===frame.closer&&(open.pop().span.close=index),index)}function enclosingCloser(spans){const active=[];let next=0;return position=>{for(;next<spans.length&&spans[next].open<position;next+=1){for(;active.length>0&&active.at(-1).close<spans[next].open;)active.pop();active.push(spans[next])}for(;active.length>0&&active.at(-1).close<position;)active.pop();return active.at(-1)}}function insideQuotedRange(span,position){let low=0,high=span.quoted.length-1;for(;low<=high;){const middle=low+high>>1,[start,end]=span.quoted[middle];if(position<start)high=middle-1;else if(position>end)low=middle+1;else return!0}return!1}const VALUE_REFERENCE=/\$[({A-Za-z_]|</u;function*flatMatches(rule,content){const regex=rule.regex;regex.lastIndex=0;const rescan=rescanDepth(rule);let inner;for(const match of content.matchAll(regex))acceptsSecretMatch(rule,match)?yield{index:match.index}:rescan!==void 0&&VALUE_REFERENCE.test(match[1])&&(inner??=new RegExp(regex),yield*keysInsideRejectedValue(rule,inner,content,match,rescan==="deep"))}function rescanDepth(rule){return rule.minimumLiteralLength===void 0?void 0:rule.minimumEntropy===void 0&&rule.literalValue===void 0&&rule.rejectValue===void 0?"deep":"shallow"}function*keysInsideRejectedValue(rule,inner,content,match,deep){const end=match.index+match[0].length;inner.lastIndex=end-match[1].length;let closerAt;for(let found=inner.exec(content);found!==null&&found.index<end;found=inner.exec(content)){if(isParameterName(content,found.index)){inner.lastIndex=found.index+1;continue}closerAt??=enclosingCloser(referenceSpans(content,end-match[1].length,match[1]));const span=closerAt(found.index);span!==void 0&&(INNER_CLOSE_AT.set(found,span.close),span.command&&!insideQuotedRange(span,found.index)&&INNER_SHELL_MATCHES.add(found)),acceptsSecretMatch(rule,found)?yield{index:found.index}:deep&&VALUE_REFERENCE.test(found[1])&&(inner.lastIndex=found.index+found[0].length-found[1].length)}}const compiledSpellings=new Map,LINE_BREAK=/[\r\n\u2028\u2029]/u;function compileSpelling(spelling){const cacheKey=`${spelling.keys}\0${spelling.value}\0${spelling.element===!0}`;let compiled=compiledSpellings.get(cacheKey);return compiled||(compiled={key:new RegExp(String.raw`\b(?:${spelling.keys})(["']?)\s*[:=]\s*`,"gi"),value:new RegExp(spelling.value,"iyd"),...spelling.element?{element:{open:new RegExp(String.raw`<(?:${spelling.keys})(?:\s[^<>]*)?>`,"gi"),close:new RegExp(String.raw`<\/(?:${spelling.keys})\s*>`,"iy"),span:new RegExp(String.raw`<(?!\/?(?:${spelling.keys})\b)[^<>]*>`,"iy")}}:{}},compiledSpellings.set(cacheKey,compiled)),compiled}function scanQuoted(content,start){const quote=content[start];for(let index=start+1;index<content.length;index+=1){const character=content[index];if(character==="\\")index+=1;else if(character===quote)return{end:index+1,terminated:!0}}return{end:content.length,terminated:!1}}function endOfQuoted(content,start){return scanQuoted(content,start).end}function judgeFor(closers,accepts,acceptsMember){return closers.at(-1)==="}"?acceptsMember:accepts}function walkContainer(content,start,accepts,acceptsMember=accepts){const closers=[];let expectKey=!1;for(let index=start;index<content.length;index+=1){const character=content[index];switch(character){case"[":case"{":closers.push(character==="["?"]":"}"),expectKey=character==="{";break;case"]":case"}":if(closers.pop()!==character||closers.length===0)return{found:!1,end:index+1};expectKey=!1;break;case",":expectKey=closers.at(-1)==="}";break;case":":expectKey=!1;break;case'"':case"'":if(!expectKey&&judgeFor(closers,accepts,acceptsMember)(index))return{found:!0,end:index};index=endOfQuoted(content,index)-1;break;default:break}}return{found:!1,end:content.length}}const ESCAPE_SEQUENCE=/\\(?:U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{2}|[0-7]{1,3}|[\s\S])/gu,SIMPLE_ESCAPES={n:`
3
+ `,r:"\r",t:" ",b:"\b",f:"\f",v:"\v"};function decodeQuotedLiteral(literal,terminated){const quote=literal[0],body=literal.slice(1,terminated?-1:void 0).replaceAll(ESCAPE_SEQUENCE,sequence=>{const kind=sequence[1];if((kind==="u"||kind==="x")&&sequence.length>2)return String.fromCharCode(Number.parseInt(sequence.slice(2),16));if(/^[0-7]$/u.test(kind))return String.fromCharCode(Number.parseInt(sequence.slice(1),8));if(kind==="U"&&sequence.length===10){const codePoint=Number.parseInt(sequence.slice(2),16);return codePoint<=1114111?String.fromCodePoint(codePoint):"\uFFFD"}return SIMPLE_ESCAPES[kind]??kind}),neutral=body.replaceAll(quote,quote==='"'?"'":'"').replaceAll(/[\r\n\u2028\u2029]/gu," "),close=terminated?quote:"";return{reading:`${quote}${neutral}${close}`,...literalBody(`${quote}${body}${close}`,terminated)}}function literalBody(original,terminated){return{original,bodyStart:1,bodyEnd:original.length-(terminated?1:0)}}const MAX_KEY_PREFIX=64;function keyShape(content,index,quote){const previous=content[index-1];if(!quote)return previous!==void 0&&/[\p{L}\p{N}_.-]/u.test(previous)?"prefixed":"exact";if(previous===quote)return"exact";const floor=Math.max(0,index-MAX_KEY_PREFIX);for(let cursor=index-1;cursor>=floor;cursor-=1){const character=content[cursor];if(character===quote)return"prefixed";if(character===`
4
+ `||character==="\r"||character==='"'||character==="'")return"malformed"}return"malformed"}function createValueJudge(rule,value,content,alwaysDecode=!1){const valueMatch=(text,at,decoded)=>{value.lastIndex=at;const match=value.exec(text);if(match===null||LINE_BREAK.test(match[0]))return null;const span=match.indices?.[1];return decoded!==void 0&&span!==void 0&&(match[1]=decoded.original.slice(Math.max(span[0],decoded.bodyStart),Math.min(span[1],decoded.bodyEnd)),DECODED_DATA_MATCHES.add(match)),acceptsSecretMatch(rule,match)?match:null},escapedMatches=at=>{if(content[at]!=='"'&&content[at]!=="'")return;const{end,terminated}=scanQuoted(content,at),literal=content.slice(at,end);if(!alwaysDecode&&!literal.includes("\\"))return;if(LINE_BREAK.test(literal))return[];const decoded=decodeQuotedLiteral(literal,terminated);return(content[at]==="'"?[decoded,{reading:literal,...literalBody(literal,terminated)}]:[decoded]).map(reading=>valueMatch(reading.reading,0,reading)).filter(match=>match!==null)},valuesAt=at=>{const escaped=escapedMatches(at);if(escaped!==void 0)return escaped;const match=valueMatch(content,at);return match===null?[]:[match]};return{direct:at=>valueMatch(content,at)!==null,escaped:at=>(escapedMatches(at)?.length??0)>0,accepts:compact=>at=>valuesAt(at).some(match=>!(compact&&/\s/u.test(compactReading(rule,match))))}}function compactReading(rule,match){return rule.minimumLiteralLength===void 0?match[0]:judgedLiteral(match)}const DECODED_DATA_MATCHES=new WeakSet;function judgedLiteral(match){const word=INNER_SHELL_MATCHES.has(match)&&!isQuote(captureOpener(match))?shellWordPrefix(match[1]):void 0,text=word??match[1],variables=word!==void 0||wordComplete(match);return DECODED_DATA_MATCHES.has(match)||isQuote(captureOpener(match))?expandRuntimeReferences(text,variables):literalAfterReferences(text,variables)}function shellWordPrefix(text){for(let index=0;index<text.length;index+=1){const character=text[index];if(character==="'"||character==='"')index=quotedSpanEnd(text,index);else if(character==="$"&&(text[index+1]==="{"||text[index+1]==="("))index=Math.max(index,referenceEnd(text,index)-1);else if(/[|&;<>]/u.test(character))return text.slice(0,index)}}const STRUCTURE_RUN=/^[;,)}\]]{0,64}/u;function wordComplete(match){const input=match.input,end=match.index+match[0].length,closed=isQuote(captureOpener(match))&&isQuote(input[end])?end+1:isQuote(match[0].at(-1))?end:-1,start=closed===-1?end:closed,structure=STRUCTURE_RUN.exec(input.slice(start,start+WORD_END_BOUND))[0].length,after=start+structure;if(after===input.length||/\s/u.test(input[after])||INNER_CLOSE_AT.get(match)===start||INNER_SHELL_MATCHES.has(match)&&/[|&;<>]/u.test(input[start]))return!0;if(closed===-1||structure===0)return!1;const context=structuredContext(match,closed===end+1),next=input.slice(after,after+40),closedContainer=/[}\]]/u.test(input.slice(start,after));return context!==void 0&&(NEXT_MEMBER.test(next)||(context==="element"||closedContainer)&&BARE_SCALAR_MEMBER.test(next))}function structuredContext(match,openerOutsideCapture){const input=match.input,valueStart=match.index+match[0].length-match[1].length-(openerOutsideCapture?1:0),before=input.slice(Math.max(0,valueStart-STRUCTURED_LOOK_BACK),valueStart);return ARRAY_ELEMENT_BEFORE.test(before)?"element":QUOTED_KEY_BEFORE.test(before)?"key":void 0}const STRUCTURED_LOOK_BACK=512,QUOTED_KEY_BEFORE=/[{,]\s*(["'])[^"'\r\n]{1,256}\1\s*[:=]\s*$/u,ARRAY_ELEMENT_BEFORE=/[[,]\s*$/u,NEXT_MEMBER=/^(?:["'`]|[{[](?:[\s"'`{[\]}]|$|(?:-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?|true|false|null)[\s,\]}]))/u,BARE_SCALAR_MEMBER=/^(?:-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?|true|false|null)[\s,\]}]/u,WORD_END_BOUND=64,CALL_AFTER=/^\s{0,16}\(/u,ASSIGNED_BEFORE=/(?<![=!<>])=[ \t]{0,16}$/u;function captureOpener(match){return match.input[match.index+match[0].length-match[1].length-1]}function isQuote(character){return character==='"'||character==="'"}const SPELLING_SENSITIVE=/[$<"']/u;function isCodeAfterReference(match){if(DECODED_DATA_MATCHES.has(match)||isQuote(captureOpener(match))||!/^[$<]/u.test(match[1]))return!1;const end=match.index+match[0].length,valueStart=end-match[1].length,after=match.input.slice(end,end+18);if(match[1][0]==="<"&&(isTypeAssertion(match[1])||ASSIGNED_BEFORE.test(match.input.slice(Math.max(0,valueStart-18),valueStart))||EXPRESSION_AFTER.test(after)))return!0;const lead=leadingReferencesEnd(match[1]),operator=match[1][lead]==="!"?match[1][lead+1]:match[1][lead];return CODE_OPERATOR.test(operator??"")||CALL_AFTER.test(after)}function leadingReferencesEnd(text){let index=0;for(let next=referenceEnd(text,index);next!==-1;next=referenceEnd(text,index))index=next;return index}function referenceEnd(text,start){const opener=text[start];if(opener==="<")return angleSpanEnd(text,start);if(opener!=="$")return-1;const bracket=text[start+1];if(bracket==="{"||bracket==="(")return bracketedEnd(text,start+1,bracket);VARIABLE_REFERENCE.lastIndex=start;const variable=VARIABLE_REFERENCE.exec(text)?.[0];return variable===void 0?-1:start+variable.length}function angleSpanEnd(text,start){const close=text.indexOf(">",start+1),reopen=text.indexOf("<",start+1);return close!==-1&&(reopen===-1||close<reopen)?close+1:-1}function bracketedEnd(text,start,bracket){const closer=bracket==="{"?"}":")";let depth=0;for(let index=start;index<text.length;index+=1){const character=text[index];if(character==="\\")index+=1;else if(character==="'"||character==='"')index=quotedSpanEnd(text,index);else if(character===bracket)depth+=1;else if(character===closer&&--depth===0)return index+1}return-1}function quotedSpanEnd(text,start){const quote=text[start];for(let index=start+1;index<text.length;index+=1){if(text[index]===quote)return index;quote==='"'&&text[index]==="\\"&&(index+=1)}return text.length}const TYPE_TEXT=/^[\w$.[\]|&,{}:;?]+$/u,LITERAL_TYPE=/^(?:"[^"]*"|'[^']*'|-?\d+(?:\.\d+)?)(?:\|(?:"[^"]*"|'[^']*'|-?\d+(?:\.\d+)?|[A-Za-z_$][\w$.]*))*$/u,PRIMITIVE_TYPE=/\b(?:string|number|boolean|bigint|symbol|any|unknown|object|never|void|undefined|null)\b/u;function isTypeAssertion(value){const type=value.slice(1,value.indexOf(">"));return LITERAL_TYPE.test(type)?!0:TYPE_TEXT.test(type)?PRIMITIVE_TYPE.test(type)||/[.|&[{]/u.test(type)||/^[A-Z][\w$]*$/u.test(type)&&(type.length===1||/[a-z]/u.test(type)):!1}const CODE_OPERATOR=/[.+\-*/%=^&]/u,EXPRESSION_AFTER=/^\s{0,16}(?:\?\.|\?\?|\|\||&&|[([])/u;function literalMatches(grammar,literal,code){if(code)return!1;const body=literal.replaceAll('"',"'");return grammar.lastIndex=0,grammar.exec(`"${body}"`)?.[1]===body}function structuredKeyShape(rule,name){if(!rule.structured)return;const content=`${JSON.stringify(name)}:`,key=compileSpelling(rule.structured).key;key.lastIndex=0;for(let match=key.exec(content);match;match=key.exec(content)){if(match.index+match[0].length!==content.length)continue;const shape=keyShape(content,match.index,match[1]);if(shape!=="malformed")return shape}}function acceptsStructuredValue(rule,value,compact){if(!rule.structured)return!1;const content=JSON.stringify(value).replaceAll("\u2028","\\u2028").replaceAll("\u2029","\\u2029");return ruleReadings(rule).some(reading=>createValueJudge(reading,compileSpelling(reading.structured).value,content,!0).accepts(compact)(0))}function*elementMatches(element,content,judge){const open=new RegExp(element.open);for(let match=open.exec(content);match;match=open.exec(content)){const bodyStart=match.index+match[0].length,body=elementBodyEnd(element,content,bodyStart);if(body===void 0){open.lastIndex=match.index+1;continue}judge(content.slice(bodyStart,body.start).trim())&&(yield{index:match.index}),open.lastIndex=body.end}}function elementBodyEnd(element,content,start){for(let index=content.indexOf("<",start);index!==-1;){element.close.lastIndex=index;const close=element.close.exec(content);if(close!==null)return{start:index,end:index+close[0].length};element.span.lastIndex=index;const span=element.span.exec(content);if(span===null)return;index=content.indexOf("<",index+span[0].length)}}function alreadyWalked(walkedEnd,valueStart,compact){return valueStart<walkedEnd.exact||compact&&valueStart<walkedEnd.compact}function scalarFinds(judge,accepts,quote,valueStart){return(quote||judge.escaped(valueStart)&&!judge.direct(valueStart))&&accepts(valueStart)}function*findStructuredSpellingMatches(rule,spelling,content){const compiled=compileSpelling(spelling),judge=createValueJudge(rule,compiled.value,content),key=new RegExp(compiled.key),walkedEnd={exact:0,compact:0};for(let match=key.exec(content);match;match=key.exec(content)){const quote=match[1],shape=keyShape(content,match.index,quote);if(shape==="malformed")continue;const compact=shape==="prefixed",accepts=judge.accepts(compact),valueStart=match.index+match[0].length,opener=content[valueStart];if(opener==="["||opener==="{"){if(alreadyWalked(walkedEnd,valueStart,compact))continue;const walked=walkContainer(content,valueStart,accepts,judge.accepts(!0));walkedEnd[compact?"compact":"exact"]=walked.end,walked.found&&(yield{index:match.index})}else scalarFinds(judge,accepts,quote,valueStart)&&(yield{index:match.index})}compiled.element&&(yield*elementMatches(compiled.element,content,elementValueJudge(rule,spelling,compiled)))}const DEFAULT_ELEMENT_LITERAL_LENGTH=8;function elementValueJudge(rule,spelling,compiled){if(!spelling.elementValue){const minimum=rule.minimumLiteralLength??DEFAULT_ELEMENT_LITERAL_LENGTH;return value=>expandRuntimeReferences(value).length>=minimum}return value=>{const neutral=value.replaceAll('"',"'");compiled.value.lastIndex=0;const match=compiled.value.exec(`"${neutral}"`);return match===null||match[1]!==neutral?!1:(match[1]=value,acceptsSecretMatch(rule,match))}}function isStatementReference(shape,match,value){const end=match.index+match[0].length;return/^[ \t]*;/u.test(match.input.slice(end,end+64))&&!isQuote(captureOpener(match))&&shape.test(value)}function indexOfAngleClose(text,start){for(let index=start+1;index<text.length;index+=1){if(text[index]===">")return index;if(text[index]==="<")return-1}return-1}function appendText(frame,text){frame.raw+=text,frame.literal+=text}function openReference(text,index,frames){const next=text[index+1];if(text[index]!=="$"||next!=="{"&&next!=="(")return-1;const prefix=next==="{"?text.slice(index+2,index+2+defaultedPrefixLength(text,index+2)):"",root=frames[0],opensPiece=frames.length===1&&root.quote!==void 0&&root.literal.length===root.pieceStart;return frames.push({close:next==="{"?"}":")",keep:prefix!=="",raw:`$${next}${prefix}`,literal:"",opensPiece}),index+2+prefix.length}const NAME_START=/[A-Za-z_]/u,NAME_PART=/\w/u,REFERENCE_AFTER_DOLLAR=/[{(A-Za-z_]/u,VARIABLE_REFERENCE=/\$[A-Za-z_]\w*/y,CONSTANT_NAME=/^_*[A-Z][A-Z0-9_]*$/u,BARE_VARIABLE=/^\$[A-Za-z_]\w*$/u,QUOTED_BARE_VARIABLE=/^(["'])\$[A-Za-z_]\w*\1$/u;function variableStep(text,index,frame){VARIABLE_REFERENCE.lastIndex=index;const variable=VARIABLE_REFERENCE.exec(text)?.[0];return variable===void 0?-1:(frame.literal===""&&CONSTANT_NAME.test(variable.slice(1))?frame.raw+=variable:appendText(frame,variable),index+variable.length)}function defaultedPrefixLength(text,start){if(!NAME_START.test(text[start]??""))return 0;let index=start+1;for(;index<text.length&&NAME_PART.test(text[index]);)index+=1;text[index]===":"&&(index+=1);const operator=text[index];return operator==="-"||operator==="="||operator==="+"?index+1-start:0}function closeReference(frames,character){const frame=frames.pop(),parent=frames.at(-1);parent.raw+=`${frame.raw}${character}`,frame.keep&&(parent.literal+=frame.literal)}const PLAIN_RUN=/[^$<"'\\})]+/y,DOUBLE_QUOTE_ESCAPABLE='$`"\\\n';function escapedContribution(next,quote){return next===`
5
+ `?"":quote==='"'&&!DOUBLE_QUOTE_ESCAPABLE.includes(next)?`\\${next}`:next}function quotedStep(text,index,frame){const character=text[index],quote=frame.quote;if(quote==='"'&&character==="$"&&REFERENCE_AFTER_DOLLAR.test(text[index+1]??""))return-1;let length=1,contributed=character;if(character==="\\"&&quote!=="'"&&index+1<text.length)length=2,contributed=escapedContribution(text[index+1],quote);else if(quote===void 0){if(character!=='"'&&character!=="'")return-1;frame.quote=character,contributed=""}else character===quote&&(frame.quote=void 0,contributed="");return frame.raw+=text.slice(index,index+length),frame.keep&&(frame.literal+=contributed),index+length}function expandStep(text,index,frames,rootQuotesAreSyntax,variables){const innermost=frames.at(-1);PLAIN_RUN.lastIndex=index;const run=PLAIN_RUN.exec(text)?.[0];if(run!==void 0)return appendText(innermost,run),index+run.length;if(frames.length>1){const quoted=quotedStep(text,index,innermost);if(quoted!==-1)return quoted}else if(rootQuotesAreSyntax&&rootQuoteStep(text[index],innermost))return index+1;const opened=openReference(text,index,frames);if(opened!==-1)return opened;const top=frames.at(-1),character=text[index],variable=variables&&character==="$"?variableStep(text,index,top):-1;if(variable!==-1)return variable;if(frames.length>1&&character===top.close)return closeReference(frames,character),index+1;const angleClose=character==="<"?indexOfAngleClose(text,index):-1;return angleClose!==-1?(top.raw+=text.slice(index,angleClose+1),angleClose+1):(appendText(top,character),index+1)}function rootQuoteStep(character,root){return character!=='"'&&character!=="'"?!1:root.quote===void 0?(root.quote=character,root.pieceStart=root.literal.length,!0):character!==root.quote?!1:(root.quote=void 0,!0)}function expandWords(text,rootQuotesAreSyntax,variables){if(variables&&(BARE_VARIABLE.test(text)||rootQuotesAreSyntax&&QUOTED_BARE_VARIABLE.test(text)))return"";const root={close:"}",keep:!0,raw:"",literal:""},frames=[root];for(let index=0;index<text.length;)index=expandStep(text,index,frames,rootQuotesAreSyntax,variables);for(let depth=frames.length-1;depth>0;depth-=1){const frame=frames[depth],parent=frames[depth-1];parent.raw+=frame.raw,rootQuotesAreSyntax&&depth===1&&frame.opensPiece===!0||(parent.literal+=frame.raw)}return root.literal}function expandRuntimeReferences(text,variables=!0){return expandWords(text,!1,variables)}function literalAfterReferences(value,variables=!0){return expandWords(value,!0,variables)}function acceptsSecretMatch(rule,match){const value=rule.minimumLiteralLength===void 0?match[1]:judgedLiteral(match);if(rule.minimumLiteralLength!==void 0&&value.length<rule.minimumLiteralLength||rule.literalValue&&SPELLING_SENSITIVE.test(match[1])&&!literalMatches(rule.literalValue,value,isCodeAfterReference(match))||rule.rejectValue?.test(value)===!0||rule.rejectStatementReference&&isStatementReference(rule.rejectStatementReference,match,value))return!1;if(rule.minimumEntropy===void 0)return!0;const characters=[...value],counts=new Map;for(const character of characters)counts.set(character,(counts.get(character)??0)+1);let entropy=0;for(const count of counts.values()){const probability=count/characters.length;entropy-=probability*Math.log2(probability)}return entropy>=rule.minimumEntropy}const _testOnly={leadingReferencesEnd};export{PRIVATE_HOME_PATH_PATTERN,SECRET_RULES,_testOnly,acceptsSecretMatch,acceptsStructuredValue,expandRuntimeReferences,findPrivateHomePathMatches,findSecretRuleMatches,literalAfterReferences,structuredKeyShape};
5
6
  //# sourceMappingURL=secret-rules.js.map