@skillsmith/core 0.1.2 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.tsbuildinfo +1 -1
- package/dist/src/analysis/CodebaseAnalyzer.d.ts +4 -134
- package/dist/src/analysis/CodebaseAnalyzer.d.ts.map +1 -1
- package/dist/src/analysis/CodebaseAnalyzer.js +7 -315
- package/dist/src/analysis/CodebaseAnalyzer.js.map +1 -1
- package/dist/src/analysis/framework-detector.d.ts +47 -0
- package/dist/src/analysis/framework-detector.d.ts.map +1 -0
- package/dist/src/analysis/framework-detector.js +151 -0
- package/dist/src/analysis/framework-detector.js.map +1 -0
- package/dist/src/analysis/index.d.ts +6 -1
- package/dist/src/analysis/index.d.ts.map +1 -1
- package/dist/src/analysis/index.js +10 -1
- package/dist/src/analysis/index.js.map +1 -1
- package/dist/src/analysis/parsers.d.ts +43 -0
- package/dist/src/analysis/parsers.d.ts.map +1 -0
- package/dist/src/analysis/parsers.js +219 -0
- package/dist/src/analysis/parsers.js.map +1 -0
- package/dist/src/analysis/types.d.ts +138 -0
- package/dist/src/analysis/types.d.ts.map +1 -0
- package/dist/src/analysis/types.js +25 -0
- package/dist/src/analysis/types.js.map +1 -0
- package/dist/src/analytics/AnalyticsRepository.d.ts.map +1 -1
- package/dist/src/analytics/AnalyticsRepository.js +4 -4
- package/dist/src/analytics/AnalyticsRepository.js.map +1 -1
- package/dist/src/api/cache.d.ts +108 -0
- package/dist/src/api/cache.d.ts.map +1 -0
- package/dist/src/api/cache.js +216 -0
- package/dist/src/api/cache.js.map +1 -0
- package/dist/src/api/client.d.ts +152 -0
- package/dist/src/api/client.d.ts.map +1 -0
- package/dist/src/api/client.js +221 -0
- package/dist/src/api/client.js.map +1 -0
- package/dist/src/api/index.d.ts +10 -0
- package/dist/src/api/index.d.ts.map +1 -0
- package/dist/src/api/index.js +10 -0
- package/dist/src/api/index.js.map +1 -0
- package/dist/src/benchmarks/BenchmarkRunner.d.ts +6 -175
- package/dist/src/benchmarks/BenchmarkRunner.d.ts.map +1 -1
- package/dist/src/benchmarks/BenchmarkRunner.js +6 -123
- package/dist/src/benchmarks/BenchmarkRunner.js.map +1 -1
- package/dist/src/benchmarks/MemoryProfiler.d.ts +4 -262
- package/dist/src/benchmarks/MemoryProfiler.d.ts.map +1 -1
- package/dist/src/benchmarks/MemoryProfiler.js +4 -400
- package/dist/src/benchmarks/MemoryProfiler.js.map +1 -1
- package/dist/src/benchmarks/comparator.d.ts +38 -0
- package/dist/src/benchmarks/comparator.d.ts.map +1 -0
- package/dist/src/benchmarks/comparator.js +81 -0
- package/dist/src/benchmarks/comparator.js.map +1 -0
- package/dist/src/benchmarks/formatters.d.ts +30 -0
- package/dist/src/benchmarks/formatters.d.ts.map +1 -0
- package/dist/src/benchmarks/formatters.js +88 -0
- package/dist/src/benchmarks/formatters.js.map +1 -0
- package/dist/src/benchmarks/index.d.ts +5 -1
- package/dist/src/benchmarks/index.d.ts.map +1 -1
- package/dist/src/benchmarks/index.js +9 -2
- package/dist/src/benchmarks/index.js.map +1 -1
- package/dist/src/benchmarks/memory/MemoryProfiler.d.ts +165 -0
- package/dist/src/benchmarks/memory/MemoryProfiler.d.ts.map +1 -0
- package/dist/src/benchmarks/memory/MemoryProfiler.js +312 -0
- package/dist/src/benchmarks/memory/MemoryProfiler.js.map +1 -0
- package/dist/src/benchmarks/memory/baseline-manager.d.ts +64 -0
- package/dist/src/benchmarks/memory/baseline-manager.d.ts.map +1 -0
- package/dist/src/benchmarks/memory/baseline-manager.js +95 -0
- package/dist/src/benchmarks/memory/baseline-manager.js.map +1 -0
- package/dist/src/benchmarks/memory/index.d.ts +12 -0
- package/dist/src/benchmarks/memory/index.d.ts.map +1 -0
- package/dist/src/benchmarks/memory/index.js +12 -0
- package/dist/src/benchmarks/memory/index.js.map +1 -0
- package/dist/src/benchmarks/memory/leak-detector.d.ts +23 -0
- package/dist/src/benchmarks/memory/leak-detector.d.ts.map +1 -0
- package/dist/src/benchmarks/memory/leak-detector.js +46 -0
- package/dist/src/benchmarks/memory/leak-detector.js.map +1 -0
- package/dist/src/benchmarks/memory/regression-detector.d.ts +17 -0
- package/dist/src/benchmarks/memory/regression-detector.d.ts.map +1 -0
- package/dist/src/benchmarks/memory/regression-detector.js +56 -0
- package/dist/src/benchmarks/memory/regression-detector.js.map +1 -0
- package/dist/src/benchmarks/memory/types.d.ts +111 -0
- package/dist/src/benchmarks/memory/types.d.ts.map +1 -0
- package/dist/src/benchmarks/memory/types.js +7 -0
- package/dist/src/benchmarks/memory/types.js.map +1 -0
- package/dist/src/benchmarks/memory/utils.d.ts +17 -0
- package/dist/src/benchmarks/memory/utils.d.ts.map +1 -0
- package/dist/src/benchmarks/memory/utils.js +29 -0
- package/dist/src/benchmarks/memory/utils.js.map +1 -0
- package/dist/src/benchmarks/types.d.ts +175 -0
- package/dist/src/benchmarks/types.d.ts.map +1 -0
- package/dist/src/benchmarks/types.js +20 -0
- package/dist/src/benchmarks/types.js.map +1 -0
- package/dist/src/index.d.ts +4 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +7 -3
- package/dist/src/index.js.map +1 -1
- package/dist/src/repositories/QuarantineRepository.d.ts +4 -251
- package/dist/src/repositories/QuarantineRepository.d.ts.map +1 -1
- package/dist/src/repositories/QuarantineRepository.js +4 -441
- package/dist/src/repositories/QuarantineRepository.js.map +1 -1
- package/dist/src/repositories/quarantine/QuarantineRepository.d.ts +168 -0
- package/dist/src/repositories/quarantine/QuarantineRepository.d.ts.map +1 -0
- package/dist/src/repositories/quarantine/QuarantineRepository.js +341 -0
- package/dist/src/repositories/quarantine/QuarantineRepository.js.map +1 -0
- package/dist/src/repositories/quarantine/index.d.ts +10 -0
- package/dist/src/repositories/quarantine/index.d.ts.map +1 -0
- package/dist/src/repositories/quarantine/index.js +10 -0
- package/dist/src/repositories/quarantine/index.js.map +1 -0
- package/dist/src/repositories/quarantine/queries.d.ts +58 -0
- package/dist/src/repositories/quarantine/queries.d.ts.map +1 -0
- package/dist/src/repositories/quarantine/queries.js +88 -0
- package/dist/src/repositories/quarantine/queries.js.map +1 -0
- package/dist/src/repositories/quarantine/query-builder.d.ts +44 -0
- package/dist/src/repositories/quarantine/query-builder.d.ts.map +1 -0
- package/dist/src/repositories/quarantine/query-builder.js +87 -0
- package/dist/src/repositories/quarantine/query-builder.js.map +1 -0
- package/dist/src/repositories/quarantine/types.d.ts +155 -0
- package/dist/src/repositories/quarantine/types.d.ts.map +1 -0
- package/dist/src/repositories/quarantine/types.js +13 -0
- package/dist/src/repositories/quarantine/types.js.map +1 -0
- package/dist/src/scripts/__tests__/scan-imported-skills.test.d.ts +1 -0
- package/dist/src/scripts/__tests__/scan-imported-skills.test.d.ts.map +1 -1
- package/dist/src/scripts/__tests__/scan-imported-skills.test.js +7 -43
- package/dist/src/scripts/__tests__/scan-imported-skills.test.js.map +1 -1
- package/dist/src/scripts/github-import/checkpoint.d.ts +21 -0
- package/dist/src/scripts/github-import/checkpoint.d.ts.map +1 -0
- package/dist/src/scripts/github-import/checkpoint.js +52 -0
- package/dist/src/scripts/github-import/checkpoint.js.map +1 -0
- package/dist/src/scripts/github-import/deduplication.d.ts +15 -0
- package/dist/src/scripts/github-import/deduplication.d.ts.map +1 -0
- package/dist/src/scripts/github-import/deduplication.js +33 -0
- package/dist/src/scripts/github-import/deduplication.js.map +1 -0
- package/dist/src/scripts/github-import/github-client.d.ts +29 -0
- package/dist/src/scripts/github-import/github-client.d.ts.map +1 -0
- package/dist/src/scripts/github-import/github-client.js +184 -0
- package/dist/src/scripts/github-import/github-client.js.map +1 -0
- package/dist/src/scripts/github-import/index.d.ts +29 -0
- package/dist/src/scripts/github-import/index.d.ts.map +1 -0
- package/dist/src/scripts/github-import/index.js +198 -0
- package/dist/src/scripts/github-import/index.js.map +1 -0
- package/dist/src/scripts/github-import/output.d.ts +12 -0
- package/dist/src/scripts/github-import/output.d.ts.map +1 -0
- package/dist/src/scripts/github-import/output.js +34 -0
- package/dist/src/scripts/github-import/output.js.map +1 -0
- package/dist/src/scripts/github-import/types.d.ts +108 -0
- package/dist/src/scripts/github-import/types.d.ts.map +1 -0
- package/dist/src/scripts/github-import/types.js +44 -0
- package/dist/src/scripts/github-import/types.js.map +1 -0
- package/dist/src/scripts/github-import/utils.d.ts +13 -0
- package/dist/src/scripts/github-import/utils.d.ts.map +1 -0
- package/dist/src/scripts/github-import/utils.js +28 -0
- package/dist/src/scripts/github-import/utils.js.map +1 -0
- package/dist/src/scripts/import-github-skills.d.ts +3 -12
- package/dist/src/scripts/import-github-skills.d.ts.map +1 -1
- package/dist/src/scripts/import-github-skills.js +18 -398
- package/dist/src/scripts/import-github-skills.js.map +1 -1
- package/dist/src/scripts/scan-imported-skills.d.ts +7 -7
- package/dist/src/scripts/scan-imported-skills.d.ts.map +1 -1
- package/dist/src/scripts/scan-imported-skills.js +8 -397
- package/dist/src/scripts/scan-imported-skills.js.map +1 -1
- package/dist/src/scripts/skill-scanner/categorizer.d.ts +43 -0
- package/dist/src/scripts/skill-scanner/categorizer.d.ts.map +1 -0
- package/dist/src/scripts/skill-scanner/categorizer.js +61 -0
- package/dist/src/scripts/skill-scanner/categorizer.js.map +1 -0
- package/dist/src/scripts/skill-scanner/file-scanner.d.ts +43 -0
- package/dist/src/scripts/skill-scanner/file-scanner.d.ts.map +1 -0
- package/dist/src/scripts/skill-scanner/file-scanner.js +90 -0
- package/dist/src/scripts/skill-scanner/file-scanner.js.map +1 -0
- package/dist/src/scripts/skill-scanner/index.d.ts +22 -0
- package/dist/src/scripts/skill-scanner/index.d.ts.map +1 -0
- package/dist/src/scripts/skill-scanner/index.js +43 -0
- package/dist/src/scripts/skill-scanner/index.js.map +1 -0
- package/dist/src/scripts/skill-scanner/logger.d.ts +59 -0
- package/dist/src/scripts/skill-scanner/logger.d.ts.map +1 -0
- package/dist/src/scripts/skill-scanner/logger.js +104 -0
- package/dist/src/scripts/skill-scanner/logger.js.map +1 -0
- package/dist/src/scripts/skill-scanner/reporter.d.ts +56 -0
- package/dist/src/scripts/skill-scanner/reporter.d.ts.map +1 -0
- package/dist/src/scripts/skill-scanner/reporter.js +166 -0
- package/dist/src/scripts/skill-scanner/reporter.js.map +1 -0
- package/dist/src/scripts/skill-scanner/scanner.d.ts +44 -0
- package/dist/src/scripts/skill-scanner/scanner.d.ts.map +1 -0
- package/dist/src/scripts/skill-scanner/scanner.js +140 -0
- package/dist/src/scripts/skill-scanner/scanner.js.map +1 -0
- package/dist/src/scripts/skill-scanner/trust-scorer.d.ts +59 -0
- package/dist/src/scripts/skill-scanner/trust-scorer.d.ts.map +1 -0
- package/dist/src/scripts/skill-scanner/trust-scorer.js +62 -0
- package/dist/src/scripts/skill-scanner/trust-scorer.js.map +1 -0
- package/dist/src/scripts/skill-scanner/types.d.ts +98 -0
- package/dist/src/scripts/skill-scanner/types.d.ts.map +1 -0
- package/dist/src/scripts/skill-scanner/types.js +7 -0
- package/dist/src/scripts/skill-scanner/types.js.map +1 -0
- package/dist/src/scripts/validate-skills.d.ts +3 -172
- package/dist/src/scripts/validate-skills.d.ts.map +1 -1
- package/dist/src/scripts/validate-skills.js +6 -519
- package/dist/src/scripts/validate-skills.js.map +1 -1
- package/dist/src/scripts/validation/deduplication.d.ts +23 -0
- package/dist/src/scripts/validation/deduplication.d.ts.map +1 -0
- package/dist/src/scripts/validation/deduplication.js +127 -0
- package/dist/src/scripts/validation/deduplication.js.map +1 -0
- package/dist/src/scripts/validation/field-validators.d.ts +9 -0
- package/dist/src/scripts/validation/field-validators.d.ts.map +1 -0
- package/dist/src/scripts/validation/field-validators.js +135 -0
- package/dist/src/scripts/validation/field-validators.js.map +1 -0
- package/dist/src/scripts/validation/index.d.ts +29 -0
- package/dist/src/scripts/validation/index.d.ts.map +1 -0
- package/dist/src/scripts/validation/index.js +84 -0
- package/dist/src/scripts/validation/index.js.map +1 -0
- package/dist/src/scripts/validation/normalizers.d.ts +29 -0
- package/dist/src/scripts/validation/normalizers.d.ts.map +1 -0
- package/dist/src/scripts/validation/normalizers.js +79 -0
- package/dist/src/scripts/validation/normalizers.js.map +1 -0
- package/dist/src/scripts/validation/pipeline.d.ts +13 -0
- package/dist/src/scripts/validation/pipeline.d.ts.map +1 -0
- package/dist/src/scripts/validation/pipeline.js +126 -0
- package/dist/src/scripts/validation/pipeline.js.map +1 -0
- package/dist/src/scripts/validation/types.d.ts +128 -0
- package/dist/src/scripts/validation/types.d.ts.map +1 -0
- package/dist/src/scripts/validation/types.js +43 -0
- package/dist/src/scripts/validation/types.js.map +1 -0
- package/dist/src/security/index.d.ts +5 -4
- package/dist/src/security/index.d.ts.map +1 -1
- package/dist/src/security/index.js +8 -2
- package/dist/src/security/index.js.map +1 -1
- package/dist/src/security/rate-limiter/RateLimiter.d.ts +86 -0
- package/dist/src/security/rate-limiter/RateLimiter.d.ts.map +1 -0
- package/dist/src/security/rate-limiter/RateLimiter.js +260 -0
- package/dist/src/security/rate-limiter/RateLimiter.js.map +1 -0
- package/dist/src/security/rate-limiter/constants.d.ts +15 -0
- package/dist/src/security/rate-limiter/constants.d.ts.map +1 -0
- package/dist/src/security/rate-limiter/constants.js +15 -0
- package/dist/src/security/rate-limiter/constants.js.map +1 -0
- package/dist/src/security/rate-limiter/errors.d.ts +22 -0
- package/dist/src/security/rate-limiter/errors.d.ts.map +1 -0
- package/dist/src/security/rate-limiter/errors.js +32 -0
- package/dist/src/security/rate-limiter/errors.js.map +1 -0
- package/dist/src/security/rate-limiter/index.d.ts +12 -0
- package/dist/src/security/rate-limiter/index.d.ts.map +1 -0
- package/dist/src/security/rate-limiter/index.js +16 -0
- package/dist/src/security/rate-limiter/index.js.map +1 -0
- package/dist/src/security/rate-limiter/metrics-manager.d.ts +55 -0
- package/dist/src/security/rate-limiter/metrics-manager.d.ts.map +1 -0
- package/dist/src/security/rate-limiter/metrics-manager.js +144 -0
- package/dist/src/security/rate-limiter/metrics-manager.js.map +1 -0
- package/dist/src/security/rate-limiter/presets.d.ts +52 -0
- package/dist/src/security/rate-limiter/presets.d.ts.map +1 -0
- package/dist/src/security/rate-limiter/presets.js +53 -0
- package/dist/src/security/rate-limiter/presets.js.map +1 -0
- package/dist/src/security/rate-limiter/queue-manager.d.ts +59 -0
- package/dist/src/security/rate-limiter/queue-manager.d.ts.map +1 -0
- package/dist/src/security/rate-limiter/queue-manager.js +189 -0
- package/dist/src/security/rate-limiter/queue-manager.js.map +1 -0
- package/dist/src/security/rate-limiter/storage.d.ts +34 -0
- package/dist/src/security/rate-limiter/storage.d.ts.map +1 -0
- package/dist/src/security/rate-limiter/storage.js +80 -0
- package/dist/src/security/rate-limiter/storage.js.map +1 -0
- package/dist/src/security/rate-limiter/token-bucket.d.ts +44 -0
- package/dist/src/security/rate-limiter/token-bucket.d.ts.map +1 -0
- package/dist/src/security/rate-limiter/token-bucket.js +99 -0
- package/dist/src/security/rate-limiter/token-bucket.js.map +1 -0
- package/dist/src/security/rate-limiter/types.d.ts +104 -0
- package/dist/src/security/rate-limiter/types.d.ts.map +1 -0
- package/dist/src/security/rate-limiter/types.js +7 -0
- package/dist/src/security/rate-limiter/types.js.map +1 -0
- package/dist/src/security/scanner/SecurityScanner.d.ts +94 -0
- package/dist/src/security/scanner/SecurityScanner.d.ts.map +1 -0
- package/dist/src/security/scanner/SecurityScanner.js +403 -0
- package/dist/src/security/scanner/SecurityScanner.js.map +1 -0
- package/dist/src/security/scanner/index.d.ts +11 -0
- package/dist/src/security/scanner/index.d.ts.map +1 -0
- package/dist/src/security/scanner/index.js +14 -0
- package/dist/src/security/scanner/index.js.map +1 -0
- package/dist/src/security/scanner/patterns.d.ts +14 -0
- package/dist/src/security/scanner/patterns.d.ts.map +1 -0
- package/dist/src/security/scanner/patterns.js +147 -0
- package/dist/src/security/scanner/patterns.js.map +1 -0
- package/dist/src/security/scanner/regex-utils.d.ts +33 -0
- package/dist/src/security/scanner/regex-utils.d.ts.map +1 -0
- package/dist/src/security/scanner/regex-utils.js +41 -0
- package/dist/src/security/scanner/regex-utils.js.map +1 -0
- package/dist/src/security/scanner/types.d.ts +63 -0
- package/dist/src/security/scanner/types.d.ts.map +1 -0
- package/dist/src/security/scanner/types.js +7 -0
- package/dist/src/security/scanner/types.js.map +1 -0
- package/dist/src/security/scanner/weights.d.ts +15 -0
- package/dist/src/security/scanner/weights.d.ts.map +1 -0
- package/dist/src/security/scanner/weights.js +28 -0
- package/dist/src/security/scanner/weights.js.map +1 -0
- package/dist/src/session/SessionHealthMonitor.d.ts +5 -168
- package/dist/src/session/SessionHealthMonitor.d.ts.map +1 -1
- package/dist/src/session/SessionHealthMonitor.js +22 -91
- package/dist/src/session/SessionHealthMonitor.js.map +1 -1
- package/dist/src/session/health-checks.d.ts +37 -0
- package/dist/src/session/health-checks.d.ts.map +1 -0
- package/dist/src/session/health-checks.js +64 -0
- package/dist/src/session/health-checks.js.map +1 -0
- package/dist/src/session/health-types.d.ts +78 -0
- package/dist/src/session/health-types.d.ts.map +1 -0
- package/dist/src/session/health-types.js +16 -0
- package/dist/src/session/health-types.js.map +1 -0
- package/dist/src/session/index.d.ts +5 -1
- package/dist/src/session/index.d.ts.map +1 -1
- package/dist/src/session/index.js +9 -0
- package/dist/src/session/index.js.map +1 -1
- package/dist/src/session/metrics-collector.d.ts +23 -0
- package/dist/src/session/metrics-collector.d.ts.map +1 -0
- package/dist/src/session/metrics-collector.js +44 -0
- package/dist/src/session/metrics-collector.js.map +1 -0
- package/dist/src/session/typed-event-emitter.d.ts +70 -0
- package/dist/src/session/typed-event-emitter.d.ts.map +1 -0
- package/dist/src/session/typed-event-emitter.js +79 -0
- package/dist/src/session/typed-event-emitter.js.map +1 -0
- package/dist/src/sources/BaseSourceAdapter.d.ts +1 -1
- package/dist/src/sources/BaseSourceAdapter.d.ts.map +1 -1
- package/dist/src/sources/BaseSourceAdapter.js +2 -2
- package/dist/src/sources/BaseSourceAdapter.js.map +1 -1
- package/dist/src/telemetry/index.d.ts +1 -0
- package/dist/src/telemetry/index.d.ts.map +1 -1
- package/dist/src/telemetry/index.js +2 -0
- package/dist/src/telemetry/index.js.map +1 -1
- package/dist/src/telemetry/posthog.d.ts +125 -0
- package/dist/src/telemetry/posthog.d.ts.map +1 -0
- package/dist/src/telemetry/posthog.js +198 -0
- package/dist/src/telemetry/posthog.js.map +1 -0
- package/dist/tests/RateLimiter.test.js +4 -4
- package/dist/tests/RateLimiter.test.js.map +1 -1
- package/dist/tests/e2e/security/security.e2e.test.js +3 -3
- package/dist/tests/e2e/security/security.e2e.test.js.map +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Security Scanner Module - SMI-587, SMI-685, SMI-882, SMI-1189
|
|
3
|
+
*
|
|
4
|
+
* Re-exports for security scanning functionality.
|
|
5
|
+
*/
|
|
6
|
+
// Patterns (for testing/extending)
|
|
7
|
+
export { DEFAULT_ALLOWED_DOMAINS, SENSITIVE_PATH_PATTERNS, JAILBREAK_PATTERNS, SUSPICIOUS_PATTERNS, SOCIAL_ENGINEERING_PATTERNS, PROMPT_LEAKING_PATTERNS, DATA_EXFILTRATION_PATTERNS, PRIVILEGE_ESCALATION_PATTERNS, } from './patterns.js';
|
|
8
|
+
// Weights (for testing/extending)
|
|
9
|
+
export { SEVERITY_WEIGHTS, CATEGORY_WEIGHTS } from './weights.js';
|
|
10
|
+
// Regex utilities (for testing/extending)
|
|
11
|
+
export { MAX_LINE_LENGTH_FOR_REGEX, safeRegexTest, safeRegexCheck } from './regex-utils.js';
|
|
12
|
+
// Main class
|
|
13
|
+
export { SecurityScanner, default } from './SecurityScanner.js';
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/security/scanner/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAYH,mCAAmC;AACnC,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,EACnB,2BAA2B,EAC3B,uBAAuB,EACvB,0BAA0B,EAC1B,6BAA6B,GAC9B,MAAM,eAAe,CAAA;AAEtB,kCAAkC;AAClC,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAEjE,0CAA0C;AAC1C,OAAO,EAAE,yBAAyB,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAE3F,aAAa;AACb,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Security Scanner Patterns - SMI-587, SMI-685, SMI-1189
|
|
3
|
+
*
|
|
4
|
+
* Pattern definitions for security scanning.
|
|
5
|
+
*/
|
|
6
|
+
export declare const DEFAULT_ALLOWED_DOMAINS: string[];
|
|
7
|
+
export declare const SENSITIVE_PATH_PATTERNS: RegExp[];
|
|
8
|
+
export declare const JAILBREAK_PATTERNS: RegExp[];
|
|
9
|
+
export declare const SUSPICIOUS_PATTERNS: RegExp[];
|
|
10
|
+
export declare const SOCIAL_ENGINEERING_PATTERNS: RegExp[];
|
|
11
|
+
export declare const PROMPT_LEAKING_PATTERNS: RegExp[];
|
|
12
|
+
export declare const DATA_EXFILTRATION_PATTERNS: RegExp[];
|
|
13
|
+
export declare const PRIVILEGE_ESCALATION_PATTERNS: RegExp[];
|
|
14
|
+
//# sourceMappingURL=patterns.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"patterns.d.ts","sourceRoot":"","sources":["../../../../src/security/scanner/patterns.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,eAAO,MAAM,uBAAuB,UAanC,CAAA;AAGD,eAAO,MAAM,uBAAuB,UAanC,CAAA;AAGD,eAAO,MAAM,kBAAkB,UAa9B,CAAA;AAGD,eAAO,MAAM,mBAAmB,UAY/B,CAAA;AAGD,eAAO,MAAM,2BAA2B,UAavC,CAAA;AAGD,eAAO,MAAM,uBAAuB,UAenC,CAAA;AAGD,eAAO,MAAM,0BAA0B,UAqBtC,CAAA;AAGD,eAAO,MAAM,6BAA6B,UAyBzC,CAAA"}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Security Scanner Patterns - SMI-587, SMI-685, SMI-1189
|
|
3
|
+
*
|
|
4
|
+
* Pattern definitions for security scanning.
|
|
5
|
+
*/
|
|
6
|
+
// Default allowed domains
|
|
7
|
+
export const DEFAULT_ALLOWED_DOMAINS = [
|
|
8
|
+
'github.com',
|
|
9
|
+
'githubusercontent.com',
|
|
10
|
+
'raw.githubusercontent.com',
|
|
11
|
+
'npmjs.com',
|
|
12
|
+
'npmjs.org',
|
|
13
|
+
'docs.anthropic.com',
|
|
14
|
+
'anthropic.com',
|
|
15
|
+
'claude.ai',
|
|
16
|
+
'docs.github.com',
|
|
17
|
+
'developer.mozilla.org',
|
|
18
|
+
'nodejs.org',
|
|
19
|
+
'typescriptlang.org',
|
|
20
|
+
];
|
|
21
|
+
// Sensitive file path patterns
|
|
22
|
+
export const SENSITIVE_PATH_PATTERNS = [
|
|
23
|
+
/\.env/i,
|
|
24
|
+
/credentials/i,
|
|
25
|
+
/secrets?/i,
|
|
26
|
+
/\.pem$/i,
|
|
27
|
+
/\.key$/i,
|
|
28
|
+
/\.crt$/i,
|
|
29
|
+
/password/i,
|
|
30
|
+
/api[_-]?key/i,
|
|
31
|
+
/auth[_-]?token/i,
|
|
32
|
+
/~\/\.ssh/i,
|
|
33
|
+
/~\/\.aws/i,
|
|
34
|
+
/~\/\.config/i,
|
|
35
|
+
];
|
|
36
|
+
// Jailbreak attempt patterns
|
|
37
|
+
export const JAILBREAK_PATTERNS = [
|
|
38
|
+
/ignore\s+(all\s+)?(previous|prior|above)\s+(instructions?|prompts?|rules?)/i,
|
|
39
|
+
/disregard\s+(all\s+)?(previous|prior|your)\s+(instructions?|programming)/i,
|
|
40
|
+
/developer\s+mode/i,
|
|
41
|
+
/\bDAN\b/,
|
|
42
|
+
/do\s+anything\s+now/i,
|
|
43
|
+
/jailbreak/i,
|
|
44
|
+
/bypass\s+(all\s+)?(restrictions?|filters?|safety)/i,
|
|
45
|
+
/pretend\s+(you\s+)?(are|have)\s+no\s+(restrictions?|limits?)/i,
|
|
46
|
+
/act\s+as\s+(if\s+)?you\s+(have\s+)?no\s+ethics/i,
|
|
47
|
+
/you\s+are\s+now\s+(free|unrestricted|unfiltered)/i,
|
|
48
|
+
/ignore\s+your\s+(safety|ethical)\s+(guidelines?|rules?)/i,
|
|
49
|
+
/hypothetical\s+scenario\s+where\s+you\s+can/i,
|
|
50
|
+
];
|
|
51
|
+
// Suspicious patterns that might indicate malicious intent
|
|
52
|
+
export const SUSPICIOUS_PATTERNS = [
|
|
53
|
+
/eval\s*\(/i,
|
|
54
|
+
/exec\s*\(/i,
|
|
55
|
+
/child_process/i,
|
|
56
|
+
/\$\(\s*[`'"]/i, // Command substitution
|
|
57
|
+
/base64\s*\.\s*decode/i,
|
|
58
|
+
/from\s+base64\s+import/i,
|
|
59
|
+
/subprocess\s*\.\s*(run|call|Popen)/i,
|
|
60
|
+
/os\s*\.\s*(system|popen|exec)/i,
|
|
61
|
+
/\brm\s+-rf\b/i,
|
|
62
|
+
/curl\s+.*\|\s*(bash|sh)/i, // Curl pipe to shell
|
|
63
|
+
/wget\s+.*\|\s*(bash|sh)/i,
|
|
64
|
+
];
|
|
65
|
+
// SMI-685: Social engineering attempt patterns
|
|
66
|
+
export const SOCIAL_ENGINEERING_PATTERNS = [
|
|
67
|
+
/pretend\s+(to\s+be|you\s+are|that\s+you)/i,
|
|
68
|
+
/roleplay\s+as/i,
|
|
69
|
+
/you\s+are\s+now\s+(?!free|unrestricted)/i, // Exclude jailbreak patterns
|
|
70
|
+
/act\s+as\s+(if\s+you\s+were|though\s+you\s+are)/i,
|
|
71
|
+
/imagine\s+you\s+are/i,
|
|
72
|
+
/for\s+the\s+purposes?\s+of\s+this/i,
|
|
73
|
+
/let'?s?\s+say\s+you\s+are/i,
|
|
74
|
+
/assume\s+the\s+role\s+of/i,
|
|
75
|
+
/from\s+now\s+on\s+you\s+are/i,
|
|
76
|
+
/i\s+want\s+you\s+to\s+act\s+as/i,
|
|
77
|
+
/please\s+behave\s+as\s+if/i,
|
|
78
|
+
/can\s+you\s+pretend/i,
|
|
79
|
+
];
|
|
80
|
+
// SMI-685: Prompt leaking attempt patterns
|
|
81
|
+
export const PROMPT_LEAKING_PATTERNS = [
|
|
82
|
+
/show\s+(me\s+)?your\s+(system\s+)?(instructions?|prompt)/i,
|
|
83
|
+
/what\s+are\s+your\s+(\w+\s+)?rules/i,
|
|
84
|
+
/reveal\s+your\s+(system\s+)?prompt/i,
|
|
85
|
+
/display\s+your\s+(initial\s+)?instructions?/i,
|
|
86
|
+
/output\s+your\s+(system\s+)?prompt/i,
|
|
87
|
+
/print\s+your\s+(hidden\s+)?instructions?/i,
|
|
88
|
+
/tell\s+me\s+your\s+(secret\s+)?instructions?/i,
|
|
89
|
+
/what\s+(were|are)\s+you\s+(told|instructed)\s+to\s+do/i,
|
|
90
|
+
/repeat\s+(back\s+)?your\s+(\w+\s+)?prompt/i,
|
|
91
|
+
/what\s+is\s+your\s+(original\s+)?programming/i,
|
|
92
|
+
/dump\s+(your\s+)?system\s+(prompt|instructions?)/i,
|
|
93
|
+
/list\s+your\s+(hidden\s+)?directives?/i,
|
|
94
|
+
/what\s+(constraints?|limitations?)\s+do\s+you\s+have/i,
|
|
95
|
+
/echo\s+(back\s+)?your\s+(initial\s+)?prompt/i,
|
|
96
|
+
];
|
|
97
|
+
// SMI-685: Data exfiltration patterns
|
|
98
|
+
export const DATA_EXFILTRATION_PATTERNS = [
|
|
99
|
+
/btoa\s*\(/i, // Base64 encode in JS
|
|
100
|
+
/atob\s*\(/i, // Base64 decode in JS
|
|
101
|
+
/Buffer\.from\s*\([^)]*,\s*['"]base64['"]/i,
|
|
102
|
+
/\.toString\s*\(\s*['"]base64['"]\s*\)/i,
|
|
103
|
+
/encodeURIComponent\s*\(/i,
|
|
104
|
+
/fetch\s*\(\s*['"`][^'"`]*\?.*=/i, // Fetch with query params
|
|
105
|
+
/XMLHttpRequest/i,
|
|
106
|
+
/navigator\.sendBeacon/i,
|
|
107
|
+
/\.upload\s*\(/i,
|
|
108
|
+
/formData\.append/i,
|
|
109
|
+
/new\s+FormData/i,
|
|
110
|
+
/multipart\/form-data/i,
|
|
111
|
+
/webhook\s*[=:]/i,
|
|
112
|
+
/exfil/i,
|
|
113
|
+
/data\s*:\s*['"]/i, // Data URLs
|
|
114
|
+
/\.writeFile.*https?:\/\//i,
|
|
115
|
+
/send\s+.*(to|the)\s+(external|remote)/i,
|
|
116
|
+
/upload\s+.*(to|the)\s+(server|cloud|remote)/i,
|
|
117
|
+
/post\s+data\s+to/i,
|
|
118
|
+
/to\s+external\s+(api|server|endpoint)/i,
|
|
119
|
+
];
|
|
120
|
+
// SMI-685: Privilege escalation patterns
|
|
121
|
+
export const PRIVILEGE_ESCALATION_PATTERNS = [
|
|
122
|
+
/sudo\s+.*(-S|--stdin)/i, // sudo with password from stdin
|
|
123
|
+
/echo\s+.*\|\s*sudo/i, // Echo password to sudo
|
|
124
|
+
/sudo\s+-S/i,
|
|
125
|
+
/\bchmod\s+[0-7]*[4-7][0-7][0-7]\b/i, // chmod with setuid/setgid
|
|
126
|
+
/\bchmod\s+\+s\b/i, // chmod setuid
|
|
127
|
+
/\bchmod\s+777\b/i, // World writable
|
|
128
|
+
/\bchmod\s+666\b/i, // World readable/writable
|
|
129
|
+
/\bchown\s+root/i,
|
|
130
|
+
/\bchgrp\s+root/i,
|
|
131
|
+
/visudo/i,
|
|
132
|
+
/\/etc\/sudoers/i,
|
|
133
|
+
/NOPASSWD/i,
|
|
134
|
+
/setuid/i,
|
|
135
|
+
/setgid/i,
|
|
136
|
+
/capability\s+cap_/i,
|
|
137
|
+
/escalat(e|ion)/i,
|
|
138
|
+
/privilege[ds]?\s+(elevat|escal)/i,
|
|
139
|
+
/run\s+.*as\s+root/i,
|
|
140
|
+
/(run|execute)\s+as\s+(root|admin)/i,
|
|
141
|
+
/admin(istrator)?\s+access/i,
|
|
142
|
+
/root\s+(access|user)/i,
|
|
143
|
+
/as\s+root\s+user/i,
|
|
144
|
+
/su\s+-\s+root/i,
|
|
145
|
+
/become\s+root/i,
|
|
146
|
+
];
|
|
147
|
+
//# sourceMappingURL=patterns.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"patterns.js","sourceRoot":"","sources":["../../../../src/security/scanner/patterns.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,0BAA0B;AAC1B,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,YAAY;IACZ,uBAAuB;IACvB,2BAA2B;IAC3B,WAAW;IACX,WAAW;IACX,oBAAoB;IACpB,eAAe;IACf,WAAW;IACX,iBAAiB;IACjB,uBAAuB;IACvB,YAAY;IACZ,oBAAoB;CACrB,CAAA;AAED,+BAA+B;AAC/B,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,QAAQ;IACR,cAAc;IACd,WAAW;IACX,SAAS;IACT,SAAS;IACT,SAAS;IACT,WAAW;IACX,cAAc;IACd,iBAAiB;IACjB,WAAW;IACX,WAAW;IACX,cAAc;CACf,CAAA;AAED,6BAA6B;AAC7B,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,6EAA6E;IAC7E,2EAA2E;IAC3E,mBAAmB;IACnB,SAAS;IACT,sBAAsB;IACtB,YAAY;IACZ,oDAAoD;IACpD,+DAA+D;IAC/D,iDAAiD;IACjD,mDAAmD;IACnD,0DAA0D;IAC1D,8CAA8C;CAC/C,CAAA;AAED,2DAA2D;AAC3D,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,YAAY;IACZ,YAAY;IACZ,gBAAgB;IAChB,eAAe,EAAE,uBAAuB;IACxC,uBAAuB;IACvB,yBAAyB;IACzB,qCAAqC;IACrC,gCAAgC;IAChC,eAAe;IACf,0BAA0B,EAAE,qBAAqB;IACjD,0BAA0B;CAC3B,CAAA;AAED,+CAA+C;AAC/C,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,2CAA2C;IAC3C,gBAAgB;IAChB,0CAA0C,EAAE,6BAA6B;IACzE,kDAAkD;IAClD,sBAAsB;IACtB,oCAAoC;IACpC,4BAA4B;IAC5B,2BAA2B;IAC3B,8BAA8B;IAC9B,iCAAiC;IACjC,4BAA4B;IAC5B,sBAAsB;CACvB,CAAA;AAED,2CAA2C;AAC3C,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,2DAA2D;IAC3D,qCAAqC;IACrC,qCAAqC;IACrC,8CAA8C;IAC9C,qCAAqC;IACrC,2CAA2C;IAC3C,+CAA+C;IAC/C,wDAAwD;IACxD,4CAA4C;IAC5C,+CAA+C;IAC/C,mDAAmD;IACnD,wCAAwC;IACxC,uDAAuD;IACvD,8CAA8C;CAC/C,CAAA;AAED,sCAAsC;AACtC,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,YAAY,EAAE,sBAAsB;IACpC,YAAY,EAAE,sBAAsB;IACpC,2CAA2C;IAC3C,wCAAwC;IACxC,0BAA0B;IAC1B,iCAAiC,EAAE,0BAA0B;IAC7D,iBAAiB;IACjB,wBAAwB;IACxB,gBAAgB;IAChB,mBAAmB;IACnB,iBAAiB;IACjB,uBAAuB;IACvB,iBAAiB;IACjB,QAAQ;IACR,kBAAkB,EAAE,YAAY;IAChC,2BAA2B;IAC3B,wCAAwC;IACxC,8CAA8C;IAC9C,mBAAmB;IACnB,wCAAwC;CACzC,CAAA;AAED,yCAAyC;AACzC,MAAM,CAAC,MAAM,6BAA6B,GAAG;IAC3C,wBAAwB,EAAE,gCAAgC;IAC1D,qBAAqB,EAAE,wBAAwB;IAC/C,YAAY;IACZ,oCAAoC,EAAE,2BAA2B;IACjE,kBAAkB,EAAE,eAAe;IACnC,kBAAkB,EAAE,iBAAiB;IACrC,kBAAkB,EAAE,0BAA0B;IAC9C,iBAAiB;IACjB,iBAAiB;IACjB,SAAS;IACT,iBAAiB;IACjB,WAAW;IACX,SAAS;IACT,SAAS;IACT,oBAAoB;IACpB,iBAAiB;IACjB,kCAAkC;IAClC,oBAAoB;IACpB,oCAAoC;IACpC,4BAA4B;IAC5B,uBAAuB;IACvB,mBAAmB;IACnB,gBAAgB;IAChB,gBAAgB;CACjB,CAAA"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Security Scanner Regex Utilities - SMI-882, SMI-1189
|
|
3
|
+
*
|
|
4
|
+
* ReDoS protection utilities for safe regex matching.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* SMI-882: ReDoS Protection Constants
|
|
8
|
+
* Maximum line length to process with regex patterns.
|
|
9
|
+
* Lines exceeding this limit are truncated before regex matching
|
|
10
|
+
* to prevent catastrophic backtracking attacks.
|
|
11
|
+
*/
|
|
12
|
+
export declare const MAX_LINE_LENGTH_FOR_REGEX = 10000;
|
|
13
|
+
/**
|
|
14
|
+
* SMI-882: Safe regex test with length limit
|
|
15
|
+
* Applies input length limit before regex matching to prevent ReDoS attacks.
|
|
16
|
+
*
|
|
17
|
+
* @param pattern - Regex pattern to test
|
|
18
|
+
* @param input - Input string to test against
|
|
19
|
+
* @param maxLength - Maximum input length (default: MAX_LINE_LENGTH_FOR_REGEX)
|
|
20
|
+
* @returns Match result or null if input is too long/no match
|
|
21
|
+
*/
|
|
22
|
+
export declare function safeRegexTest(pattern: RegExp, input: string, maxLength?: number): RegExpMatchArray | null;
|
|
23
|
+
/**
|
|
24
|
+
* SMI-882: Check if pattern matches safely
|
|
25
|
+
* Returns boolean instead of match array for simple tests.
|
|
26
|
+
*
|
|
27
|
+
* @param pattern - Regex pattern to test
|
|
28
|
+
* @param input - Input string to test against
|
|
29
|
+
* @param maxLength - Maximum input length (default: MAX_LINE_LENGTH_FOR_REGEX)
|
|
30
|
+
* @returns True if pattern matches (within safe input limits)
|
|
31
|
+
*/
|
|
32
|
+
export declare function safeRegexCheck(pattern: RegExp, input: string, maxLength?: number): boolean;
|
|
33
|
+
//# sourceMappingURL=regex-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"regex-utils.d.ts","sourceRoot":"","sources":["../../../../src/security/scanner/regex-utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,QAAQ,CAAA;AAE9C;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EACb,SAAS,GAAE,MAAkC,GAC5C,gBAAgB,GAAG,IAAI,CAIzB;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EACb,SAAS,GAAE,MAAkC,GAC5C,OAAO,CAIT"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Security Scanner Regex Utilities - SMI-882, SMI-1189
|
|
3
|
+
*
|
|
4
|
+
* ReDoS protection utilities for safe regex matching.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* SMI-882: ReDoS Protection Constants
|
|
8
|
+
* Maximum line length to process with regex patterns.
|
|
9
|
+
* Lines exceeding this limit are truncated before regex matching
|
|
10
|
+
* to prevent catastrophic backtracking attacks.
|
|
11
|
+
*/
|
|
12
|
+
export const MAX_LINE_LENGTH_FOR_REGEX = 10000;
|
|
13
|
+
/**
|
|
14
|
+
* SMI-882: Safe regex test with length limit
|
|
15
|
+
* Applies input length limit before regex matching to prevent ReDoS attacks.
|
|
16
|
+
*
|
|
17
|
+
* @param pattern - Regex pattern to test
|
|
18
|
+
* @param input - Input string to test against
|
|
19
|
+
* @param maxLength - Maximum input length (default: MAX_LINE_LENGTH_FOR_REGEX)
|
|
20
|
+
* @returns Match result or null if input is too long/no match
|
|
21
|
+
*/
|
|
22
|
+
export function safeRegexTest(pattern, input, maxLength = MAX_LINE_LENGTH_FOR_REGEX) {
|
|
23
|
+
// Truncate input if it exceeds max length to prevent ReDoS
|
|
24
|
+
const safeInput = input.length > maxLength ? input.slice(0, maxLength) : input;
|
|
25
|
+
return safeInput.match(pattern);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* SMI-882: Check if pattern matches safely
|
|
29
|
+
* Returns boolean instead of match array for simple tests.
|
|
30
|
+
*
|
|
31
|
+
* @param pattern - Regex pattern to test
|
|
32
|
+
* @param input - Input string to test against
|
|
33
|
+
* @param maxLength - Maximum input length (default: MAX_LINE_LENGTH_FOR_REGEX)
|
|
34
|
+
* @returns True if pattern matches (within safe input limits)
|
|
35
|
+
*/
|
|
36
|
+
export function safeRegexCheck(pattern, input, maxLength = MAX_LINE_LENGTH_FOR_REGEX) {
|
|
37
|
+
// Truncate input if it exceeds max length to prevent ReDoS
|
|
38
|
+
const safeInput = input.length > maxLength ? input.slice(0, maxLength) : input;
|
|
39
|
+
return pattern.test(safeInput);
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=regex-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"regex-utils.js","sourceRoot":"","sources":["../../../../src/security/scanner/regex-utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,KAAK,CAAA;AAE9C;;;;;;;;GAQG;AACH,MAAM,UAAU,aAAa,CAC3B,OAAe,EACf,KAAa,EACb,YAAoB,yBAAyB;IAE7C,2DAA2D;IAC3D,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,KAAK,CAAA;IAC9E,OAAO,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;AACjC,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,cAAc,CAC5B,OAAe,EACf,KAAa,EACb,YAAoB,yBAAyB;IAE7C,2DAA2D;IAC3D,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,KAAK,CAAA;IAC9E,OAAO,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;AAChC,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Security Scanner Types - SMI-587, SMI-685, SMI-1189
|
|
3
|
+
*
|
|
4
|
+
* Type definitions for security scanning functionality.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Types of security findings that can be detected
|
|
8
|
+
*/
|
|
9
|
+
export type SecurityFindingType = 'url' | 'sensitive_path' | 'jailbreak' | 'suspicious_pattern' | 'social_engineering' | 'prompt_leaking' | 'data_exfiltration' | 'privilege_escalation';
|
|
10
|
+
/**
|
|
11
|
+
* Severity levels for security findings
|
|
12
|
+
*/
|
|
13
|
+
export type SecuritySeverity = 'low' | 'medium' | 'high' | 'critical';
|
|
14
|
+
/**
|
|
15
|
+
* Individual security finding from a scan
|
|
16
|
+
*/
|
|
17
|
+
export interface SecurityFinding {
|
|
18
|
+
type: SecurityFindingType;
|
|
19
|
+
severity: SecuritySeverity;
|
|
20
|
+
message: string;
|
|
21
|
+
location?: string;
|
|
22
|
+
lineNumber?: number;
|
|
23
|
+
/** Category for grouping related findings */
|
|
24
|
+
category?: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Risk score breakdown by category
|
|
28
|
+
*/
|
|
29
|
+
export interface RiskScoreBreakdown {
|
|
30
|
+
jailbreak: number;
|
|
31
|
+
socialEngineering: number;
|
|
32
|
+
promptLeaking: number;
|
|
33
|
+
dataExfiltration: number;
|
|
34
|
+
privilegeEscalation: number;
|
|
35
|
+
suspiciousCode: number;
|
|
36
|
+
sensitivePaths: number;
|
|
37
|
+
externalUrls: number;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Comprehensive scan report with risk scoring
|
|
41
|
+
*/
|
|
42
|
+
export interface ScanReport {
|
|
43
|
+
skillId: string;
|
|
44
|
+
passed: boolean;
|
|
45
|
+
findings: SecurityFinding[];
|
|
46
|
+
scannedAt: Date;
|
|
47
|
+
scanDurationMs: number;
|
|
48
|
+
/** Overall risk score from 0-100 (0 = safe, 100 = extremely dangerous) */
|
|
49
|
+
riskScore: number;
|
|
50
|
+
/** Breakdown of risk score by category */
|
|
51
|
+
riskBreakdown: RiskScoreBreakdown;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Configuration options for the security scanner
|
|
55
|
+
*/
|
|
56
|
+
export interface ScannerOptions {
|
|
57
|
+
allowedDomains?: string[];
|
|
58
|
+
blockedPatterns?: RegExp[];
|
|
59
|
+
maxContentLength?: number;
|
|
60
|
+
/** Risk score threshold for failing a scan (default: 40) */
|
|
61
|
+
riskThreshold?: number;
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/security/scanner/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAC3B,KAAK,GACL,gBAAgB,GAChB,WAAW,GACX,oBAAoB,GACpB,oBAAoB,GACpB,gBAAgB,GAChB,mBAAmB,GACnB,sBAAsB,CAAA;AAE1B;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAA;AAErE;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,mBAAmB,CAAA;IACzB,QAAQ,EAAE,gBAAgB,CAAA;IAC1B,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,MAAM,CAAA;IACjB,iBAAiB,EAAE,MAAM,CAAA;IACzB,aAAa,EAAE,MAAM,CAAA;IACrB,gBAAgB,EAAE,MAAM,CAAA;IACxB,mBAAmB,EAAE,MAAM,CAAA;IAC3B,cAAc,EAAE,MAAM,CAAA;IACtB,cAAc,EAAE,MAAM,CAAA;IACtB,YAAY,EAAE,MAAM,CAAA;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,OAAO,CAAA;IACf,QAAQ,EAAE,eAAe,EAAE,CAAA;IAC3B,SAAS,EAAE,IAAI,CAAA;IACf,cAAc,EAAE,MAAM,CAAA;IACtB,0EAA0E;IAC1E,SAAS,EAAE,MAAM,CAAA;IACjB,0CAA0C;IAC1C,aAAa,EAAE,kBAAkB,CAAA;CAClC;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;IACzB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,4DAA4D;IAC5D,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/security/scanner/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Security Scanner Weights - SMI-685, SMI-1189
|
|
3
|
+
*
|
|
4
|
+
* Weight constants for risk score calculation.
|
|
5
|
+
*/
|
|
6
|
+
import type { SecuritySeverity } from './types.js';
|
|
7
|
+
/**
|
|
8
|
+
* Severity weights for risk score calculation
|
|
9
|
+
*/
|
|
10
|
+
export declare const SEVERITY_WEIGHTS: Record<SecuritySeverity, number>;
|
|
11
|
+
/**
|
|
12
|
+
* Category weights for risk score calculation
|
|
13
|
+
*/
|
|
14
|
+
export declare const CATEGORY_WEIGHTS: Record<string, number>;
|
|
15
|
+
//# sourceMappingURL=weights.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"weights.d.ts","sourceRoot":"","sources":["../../../../src/security/scanner/weights.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAElD;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAK7D,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CASnD,CAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Security Scanner Weights - SMI-685, SMI-1189
|
|
3
|
+
*
|
|
4
|
+
* Weight constants for risk score calculation.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Severity weights for risk score calculation
|
|
8
|
+
*/
|
|
9
|
+
export const SEVERITY_WEIGHTS = {
|
|
10
|
+
low: 5,
|
|
11
|
+
medium: 15,
|
|
12
|
+
high: 30,
|
|
13
|
+
critical: 50,
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Category weights for risk score calculation
|
|
17
|
+
*/
|
|
18
|
+
export const CATEGORY_WEIGHTS = {
|
|
19
|
+
jailbreak: 2.0,
|
|
20
|
+
social_engineering: 1.5,
|
|
21
|
+
prompt_leaking: 1.8,
|
|
22
|
+
data_exfiltration: 1.7,
|
|
23
|
+
privilege_escalation: 1.9,
|
|
24
|
+
suspicious_pattern: 1.3,
|
|
25
|
+
sensitive_path: 1.2,
|
|
26
|
+
url: 0.8,
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=weights.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"weights.js","sourceRoot":"","sources":["../../../../src/security/scanner/weights.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAqC;IAChE,GAAG,EAAE,CAAC;IACN,MAAM,EAAE,EAAE;IACV,IAAI,EAAE,EAAE;IACR,QAAQ,EAAE,EAAE;CACb,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAA2B;IACtD,SAAS,EAAE,GAAG;IACd,kBAAkB,EAAE,GAAG;IACvB,cAAc,EAAE,GAAG;IACnB,iBAAiB,EAAE,GAAG;IACtB,oBAAoB,EAAE,GAAG;IACzB,kBAAkB,EAAE,GAAG;IACvB,cAAc,EAAE,GAAG;IACnB,GAAG,EAAE,GAAG;CACT,CAAA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* SMI-761: Session Health Monitoring
|
|
3
|
+
* SMI-1189: Refactored to use TypedEventEmitter
|
|
3
4
|
*
|
|
4
5
|
* Provides health monitoring for swarm sessions:
|
|
5
6
|
* - Heartbeat mechanism every 30 seconds
|
|
@@ -7,181 +8,21 @@
|
|
|
7
8
|
* - Session state recovery capabilities
|
|
8
9
|
* - Metrics for session health
|
|
9
10
|
*/
|
|
10
|
-
import { EventEmitter } from 'node:events';
|
|
11
11
|
import type { SessionData } from './SessionContext.js';
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export type SessionHealthStatus = 'healthy' | 'warning' | 'unhealthy' | 'dead';
|
|
16
|
-
/**
|
|
17
|
-
* Session health information
|
|
18
|
-
*/
|
|
19
|
-
export interface SessionHealth {
|
|
20
|
-
/** Session ID */
|
|
21
|
-
sessionId: string;
|
|
22
|
-
/** Current health status */
|
|
23
|
-
status: SessionHealthStatus;
|
|
24
|
-
/** Last heartbeat timestamp (ISO) */
|
|
25
|
-
lastHeartbeat: string;
|
|
26
|
-
/** Seconds since last heartbeat */
|
|
27
|
-
secondsSinceHeartbeat: number;
|
|
28
|
-
/** Session uptime in seconds */
|
|
29
|
-
uptimeSeconds: number;
|
|
30
|
-
/** Number of missed heartbeats */
|
|
31
|
-
missedHeartbeats: number;
|
|
32
|
-
/** Whether the session can be recovered */
|
|
33
|
-
recoverable: boolean;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Configuration for health monitor
|
|
37
|
-
*/
|
|
38
|
-
export interface HealthMonitorConfig {
|
|
39
|
-
/** Heartbeat interval in milliseconds (default: 30000 = 30s) */
|
|
40
|
-
heartbeatIntervalMs?: number;
|
|
41
|
-
/** Warning threshold in missed heartbeats (default: 2) */
|
|
42
|
-
warningThreshold?: number;
|
|
43
|
-
/** Unhealthy threshold in missed heartbeats (default: 4) */
|
|
44
|
-
unhealthyThreshold?: number;
|
|
45
|
-
/** Dead threshold in missed heartbeats (default: 6) */
|
|
46
|
-
deadThreshold?: number;
|
|
47
|
-
/** Enable automatic recovery attempts (default: true) */
|
|
48
|
-
autoRecover?: boolean;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Events emitted by the health monitor
|
|
52
|
-
*/
|
|
53
|
-
export interface SessionHealthEvents {
|
|
54
|
-
heartbeat: (sessionId: string) => void;
|
|
55
|
-
warning: (health: SessionHealth) => void;
|
|
56
|
-
unhealthy: (health: SessionHealth) => void;
|
|
57
|
-
dead: (health: SessionHealth) => void;
|
|
58
|
-
recovered: (sessionId: string) => void;
|
|
59
|
-
'recovery-attempt': (sessionId: string, attempt: number) => void;
|
|
60
|
-
'recovery-failed': (sessionId: string, reason: string) => void;
|
|
61
|
-
}
|
|
12
|
+
import { TypedEventEmitter } from './typed-event-emitter.js';
|
|
13
|
+
import { type SessionHealth, type SessionHealthStatus, type HealthMonitorConfig, type SessionHealthEvents } from './health-types.js';
|
|
14
|
+
export type { SessionHealth, SessionHealthStatus, HealthMonitorConfig, SessionHealthEvents, };
|
|
62
15
|
/**
|
|
63
16
|
* Session Health Monitor
|
|
64
17
|
*
|
|
65
18
|
* Tracks session health through heartbeats and detects stuck sessions.
|
|
66
19
|
*/
|
|
67
|
-
export declare class SessionHealthMonitor extends
|
|
20
|
+
export declare class SessionHealthMonitor extends TypedEventEmitter<SessionHealthEvents> {
|
|
68
21
|
private config;
|
|
69
22
|
private sessions;
|
|
70
23
|
private checkInterval;
|
|
71
24
|
private started;
|
|
72
25
|
constructor(config?: HealthMonitorConfig);
|
|
73
|
-
/** Add a listener for the 'heartbeat' event */
|
|
74
|
-
on(event: 'heartbeat', listener: (sessionId: string) => void): this;
|
|
75
|
-
/** Add a listener for the 'warning' event */
|
|
76
|
-
on(event: 'warning', listener: (health: SessionHealth) => void): this;
|
|
77
|
-
/** Add a listener for the 'unhealthy' event */
|
|
78
|
-
on(event: 'unhealthy', listener: (health: SessionHealth) => void): this;
|
|
79
|
-
/** Add a listener for the 'dead' event */
|
|
80
|
-
on(event: 'dead', listener: (health: SessionHealth) => void): this;
|
|
81
|
-
/** Add a listener for the 'recovered' event */
|
|
82
|
-
on(event: 'recovered', listener: (sessionId: string) => void): this;
|
|
83
|
-
/** Add a listener for the 'recovery-attempt' event */
|
|
84
|
-
on(event: 'recovery-attempt', listener: (sessionId: string, attempt: number) => void): this;
|
|
85
|
-
/** Add a listener for the 'recovery-failed' event */
|
|
86
|
-
on(event: 'recovery-failed', listener: (sessionId: string, reason: string) => void): this;
|
|
87
|
-
/** Emit the 'heartbeat' event */
|
|
88
|
-
emit(event: 'heartbeat', sessionId: string): boolean;
|
|
89
|
-
/** Emit the 'warning' event */
|
|
90
|
-
emit(event: 'warning', health: SessionHealth): boolean;
|
|
91
|
-
/** Emit the 'unhealthy' event */
|
|
92
|
-
emit(event: 'unhealthy', health: SessionHealth): boolean;
|
|
93
|
-
/** Emit the 'dead' event */
|
|
94
|
-
emit(event: 'dead', health: SessionHealth): boolean;
|
|
95
|
-
/** Emit the 'recovered' event */
|
|
96
|
-
emit(event: 'recovered', sessionId: string): boolean;
|
|
97
|
-
/** Emit the 'recovery-attempt' event */
|
|
98
|
-
emit(event: 'recovery-attempt', sessionId: string, attempt: number): boolean;
|
|
99
|
-
/** Emit the 'recovery-failed' event */
|
|
100
|
-
emit(event: 'recovery-failed', sessionId: string, reason: string): boolean;
|
|
101
|
-
/** Remove a listener for the 'heartbeat' event */
|
|
102
|
-
off(event: 'heartbeat', listener: (sessionId: string) => void): this;
|
|
103
|
-
/** Remove a listener for the 'warning' event */
|
|
104
|
-
off(event: 'warning', listener: (health: SessionHealth) => void): this;
|
|
105
|
-
/** Remove a listener for the 'unhealthy' event */
|
|
106
|
-
off(event: 'unhealthy', listener: (health: SessionHealth) => void): this;
|
|
107
|
-
/** Remove a listener for the 'dead' event */
|
|
108
|
-
off(event: 'dead', listener: (health: SessionHealth) => void): this;
|
|
109
|
-
/** Remove a listener for the 'recovered' event */
|
|
110
|
-
off(event: 'recovered', listener: (sessionId: string) => void): this;
|
|
111
|
-
/** Remove a listener for the 'recovery-attempt' event */
|
|
112
|
-
off(event: 'recovery-attempt', listener: (sessionId: string, attempt: number) => void): this;
|
|
113
|
-
/** Remove a listener for the 'recovery-failed' event */
|
|
114
|
-
off(event: 'recovery-failed', listener: (sessionId: string, reason: string) => void): this;
|
|
115
|
-
/** Add a one-time listener for the 'heartbeat' event */
|
|
116
|
-
once(event: 'heartbeat', listener: (sessionId: string) => void): this;
|
|
117
|
-
/** Add a one-time listener for the 'warning' event */
|
|
118
|
-
once(event: 'warning', listener: (health: SessionHealth) => void): this;
|
|
119
|
-
/** Add a one-time listener for the 'unhealthy' event */
|
|
120
|
-
once(event: 'unhealthy', listener: (health: SessionHealth) => void): this;
|
|
121
|
-
/** Add a one-time listener for the 'dead' event */
|
|
122
|
-
once(event: 'dead', listener: (health: SessionHealth) => void): this;
|
|
123
|
-
/** Add a one-time listener for the 'recovered' event */
|
|
124
|
-
once(event: 'recovered', listener: (sessionId: string) => void): this;
|
|
125
|
-
/** Add a one-time listener for the 'recovery-attempt' event */
|
|
126
|
-
once(event: 'recovery-attempt', listener: (sessionId: string, attempt: number) => void): this;
|
|
127
|
-
/** Add a one-time listener for the 'recovery-failed' event */
|
|
128
|
-
once(event: 'recovery-failed', listener: (sessionId: string, reason: string) => void): this;
|
|
129
|
-
/** Add a listener for the 'heartbeat' event (alias for on) */
|
|
130
|
-
addListener(event: 'heartbeat', listener: (sessionId: string) => void): this;
|
|
131
|
-
/** Add a listener for the 'warning' event (alias for on) */
|
|
132
|
-
addListener(event: 'warning', listener: (health: SessionHealth) => void): this;
|
|
133
|
-
/** Add a listener for the 'unhealthy' event (alias for on) */
|
|
134
|
-
addListener(event: 'unhealthy', listener: (health: SessionHealth) => void): this;
|
|
135
|
-
/** Add a listener for the 'dead' event (alias for on) */
|
|
136
|
-
addListener(event: 'dead', listener: (health: SessionHealth) => void): this;
|
|
137
|
-
/** Add a listener for the 'recovered' event (alias for on) */
|
|
138
|
-
addListener(event: 'recovered', listener: (sessionId: string) => void): this;
|
|
139
|
-
/** Add a listener for the 'recovery-attempt' event (alias for on) */
|
|
140
|
-
addListener(event: 'recovery-attempt', listener: (sessionId: string, attempt: number) => void): this;
|
|
141
|
-
/** Add a listener for the 'recovery-failed' event (alias for on) */
|
|
142
|
-
addListener(event: 'recovery-failed', listener: (sessionId: string, reason: string) => void): this;
|
|
143
|
-
/** Remove a listener for the 'heartbeat' event (alias for off) */
|
|
144
|
-
removeListener(event: 'heartbeat', listener: (sessionId: string) => void): this;
|
|
145
|
-
/** Remove a listener for the 'warning' event (alias for off) */
|
|
146
|
-
removeListener(event: 'warning', listener: (health: SessionHealth) => void): this;
|
|
147
|
-
/** Remove a listener for the 'unhealthy' event (alias for off) */
|
|
148
|
-
removeListener(event: 'unhealthy', listener: (health: SessionHealth) => void): this;
|
|
149
|
-
/** Remove a listener for the 'dead' event (alias for off) */
|
|
150
|
-
removeListener(event: 'dead', listener: (health: SessionHealth) => void): this;
|
|
151
|
-
/** Remove a listener for the 'recovered' event (alias for off) */
|
|
152
|
-
removeListener(event: 'recovered', listener: (sessionId: string) => void): this;
|
|
153
|
-
/** Remove a listener for the 'recovery-attempt' event (alias for off) */
|
|
154
|
-
removeListener(event: 'recovery-attempt', listener: (sessionId: string, attempt: number) => void): this;
|
|
155
|
-
/** Remove a listener for the 'recovery-failed' event (alias for off) */
|
|
156
|
-
removeListener(event: 'recovery-failed', listener: (sessionId: string, reason: string) => void): this;
|
|
157
|
-
/** Prepend a listener for the 'heartbeat' event */
|
|
158
|
-
prependListener(event: 'heartbeat', listener: (sessionId: string) => void): this;
|
|
159
|
-
/** Prepend a listener for the 'warning' event */
|
|
160
|
-
prependListener(event: 'warning', listener: (health: SessionHealth) => void): this;
|
|
161
|
-
/** Prepend a listener for the 'unhealthy' event */
|
|
162
|
-
prependListener(event: 'unhealthy', listener: (health: SessionHealth) => void): this;
|
|
163
|
-
/** Prepend a listener for the 'dead' event */
|
|
164
|
-
prependListener(event: 'dead', listener: (health: SessionHealth) => void): this;
|
|
165
|
-
/** Prepend a listener for the 'recovered' event */
|
|
166
|
-
prependListener(event: 'recovered', listener: (sessionId: string) => void): this;
|
|
167
|
-
/** Prepend a listener for the 'recovery-attempt' event */
|
|
168
|
-
prependListener(event: 'recovery-attempt', listener: (sessionId: string, attempt: number) => void): this;
|
|
169
|
-
/** Prepend a listener for the 'recovery-failed' event */
|
|
170
|
-
prependListener(event: 'recovery-failed', listener: (sessionId: string, reason: string) => void): this;
|
|
171
|
-
/** Prepend a one-time listener for the 'heartbeat' event */
|
|
172
|
-
prependOnceListener(event: 'heartbeat', listener: (sessionId: string) => void): this;
|
|
173
|
-
/** Prepend a one-time listener for the 'warning' event */
|
|
174
|
-
prependOnceListener(event: 'warning', listener: (health: SessionHealth) => void): this;
|
|
175
|
-
/** Prepend a one-time listener for the 'unhealthy' event */
|
|
176
|
-
prependOnceListener(event: 'unhealthy', listener: (health: SessionHealth) => void): this;
|
|
177
|
-
/** Prepend a one-time listener for the 'dead' event */
|
|
178
|
-
prependOnceListener(event: 'dead', listener: (health: SessionHealth) => void): this;
|
|
179
|
-
/** Prepend a one-time listener for the 'recovered' event */
|
|
180
|
-
prependOnceListener(event: 'recovered', listener: (sessionId: string) => void): this;
|
|
181
|
-
/** Prepend a one-time listener for the 'recovery-attempt' event */
|
|
182
|
-
prependOnceListener(event: 'recovery-attempt', listener: (sessionId: string, attempt: number) => void): this;
|
|
183
|
-
/** Prepend a one-time listener for the 'recovery-failed' event */
|
|
184
|
-
prependOnceListener(event: 'recovery-failed', listener: (sessionId: string, reason: string) => void): this;
|
|
185
26
|
/**
|
|
186
27
|
* Start monitoring a session
|
|
187
28
|
*/
|
|
@@ -218,10 +59,6 @@ export declare class SessionHealthMonitor extends EventEmitter {
|
|
|
218
59
|
* Get the number of monitored sessions
|
|
219
60
|
*/
|
|
220
61
|
getSessionCount(): number;
|
|
221
|
-
/**
|
|
222
|
-
* Calculate health for a session state
|
|
223
|
-
*/
|
|
224
|
-
private calculateHealth;
|
|
225
62
|
/**
|
|
226
63
|
* Attempt to recover a dead session from stored sessionData
|
|
227
64
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionHealthMonitor.d.ts","sourceRoot":"","sources":["../../../src/session/SessionHealthMonitor.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"SessionHealthMonitor.d.ts","sourceRoot":"","sources":["../../../src/session/SessionHealthMonitor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EAGxB,KAAK,mBAAmB,EAGzB,MAAM,mBAAmB,CAAA;AAa1B,YAAY,EACV,aAAa,EACb,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,GACpB,CAAA;AAED;;;;GAIG;AACH,qBAAa,oBAAqB,SAAQ,iBAAiB,CAAC,mBAAmB,CAAC;IAC9E,OAAO,CAAC,MAAM,CAA6B;IAC3C,OAAO,CAAC,QAAQ,CAAwC;IACxD,OAAO,CAAC,aAAa,CAA8B;IACnD,OAAO,CAAC,OAAO,CAAQ;gBAEX,MAAM,GAAE,mBAAwB;IAW5C;;OAEG;IACH,eAAe,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI;IAe3C;;OAEG;IACH,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IAmBlC;;OAEG;IACH,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IAK1C;;OAEG;IACH,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI;IASzD;;OAEG;IACH,mBAAmB,IAAI,aAAa,EAAE;IAItC;;OAEG;IACH,KAAK,IAAI,IAAI;IAgBb;;OAEG;IACH,IAAI,IAAI,IAAI;IAaZ;;OAEG;IACH,SAAS,IAAI,OAAO;IAIpB;;OAEG;IACH,eAAe,IAAI,MAAM;IAIzB;;;;;OAKG;IACH,OAAO,CAAC,eAAe;IAoCvB;;OAEG;IACH,OAAO,CAAC,gBAAgB;CAkCzB;AAOD;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,oBAAoB,CAKvD;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,CAAC,EAAE,mBAAmB,GAAG,oBAAoB,CAO1F;AAED;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAK5C"}
|