distill-mcp 0.6.0-beta
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/bin/cli.js +133 -0
- package/dist/analytics/session-tracker.d.ts +74 -0
- package/dist/analytics/session-tracker.d.ts.map +1 -0
- package/dist/analytics/session-tracker.js +123 -0
- package/dist/ast/benchmark.test.d.ts +7 -0
- package/dist/ast/benchmark.test.d.ts.map +1 -0
- package/dist/ast/benchmark.test.js +175 -0
- package/dist/ast/go/index.d.ts +9 -0
- package/dist/ast/go/index.d.ts.map +1 -0
- package/dist/ast/go/index.js +8 -0
- package/dist/ast/go/parser.d.ts +31 -0
- package/dist/ast/go/parser.d.ts.map +1 -0
- package/dist/ast/go/parser.js +428 -0
- package/dist/ast/go/parser.test.d.ts +5 -0
- package/dist/ast/go/parser.test.d.ts.map +1 -0
- package/dist/ast/go/parser.test.js +241 -0
- package/dist/ast/go/queries.d.ts +51 -0
- package/dist/ast/go/queries.d.ts.map +1 -0
- package/dist/ast/go/queries.js +114 -0
- package/dist/ast/go/utils.d.ts +66 -0
- package/dist/ast/go/utils.d.ts.map +1 -0
- package/dist/ast/go/utils.js +140 -0
- package/dist/ast/index.d.ts +39 -0
- package/dist/ast/index.d.ts.map +1 -0
- package/dist/ast/index.js +245 -0
- package/dist/ast/php/index.d.ts +9 -0
- package/dist/ast/php/index.d.ts.map +1 -0
- package/dist/ast/php/index.js +8 -0
- package/dist/ast/php/parser.d.ts +31 -0
- package/dist/ast/php/parser.d.ts.map +1 -0
- package/dist/ast/php/parser.js +388 -0
- package/dist/ast/php/parser.test.d.ts +5 -0
- package/dist/ast/php/parser.test.d.ts.map +1 -0
- package/dist/ast/php/parser.test.js +328 -0
- package/dist/ast/php/queries.d.ts +61 -0
- package/dist/ast/php/queries.d.ts.map +1 -0
- package/dist/ast/php/queries.js +117 -0
- package/dist/ast/php/utils.d.ts +83 -0
- package/dist/ast/php/utils.d.ts.map +1 -0
- package/dist/ast/php/utils.js +246 -0
- package/dist/ast/python/index.d.ts +9 -0
- package/dist/ast/python/index.d.ts.map +1 -0
- package/dist/ast/python/index.js +8 -0
- package/dist/ast/python/parser.d.ts +32 -0
- package/dist/ast/python/parser.d.ts.map +1 -0
- package/dist/ast/python/parser.js +422 -0
- package/dist/ast/python/parser.test.d.ts +5 -0
- package/dist/ast/python/parser.test.d.ts.map +1 -0
- package/dist/ast/python/parser.test.js +186 -0
- package/dist/ast/python/queries.d.ts +73 -0
- package/dist/ast/python/queries.d.ts.map +1 -0
- package/dist/ast/python/queries.js +137 -0
- package/dist/ast/python/utils.d.ts +63 -0
- package/dist/ast/python/utils.d.ts.map +1 -0
- package/dist/ast/python/utils.js +159 -0
- package/dist/ast/quick-scan.d.ts +40 -0
- package/dist/ast/quick-scan.d.ts.map +1 -0
- package/dist/ast/quick-scan.js +287 -0
- package/dist/ast/rust/index.d.ts +9 -0
- package/dist/ast/rust/index.d.ts.map +1 -0
- package/dist/ast/rust/index.js +8 -0
- package/dist/ast/rust/parser.d.ts +31 -0
- package/dist/ast/rust/parser.d.ts.map +1 -0
- package/dist/ast/rust/parser.js +416 -0
- package/dist/ast/rust/parser.test.d.ts +5 -0
- package/dist/ast/rust/parser.test.d.ts.map +1 -0
- package/dist/ast/rust/parser.test.js +329 -0
- package/dist/ast/rust/queries.d.ts +66 -0
- package/dist/ast/rust/queries.d.ts.map +1 -0
- package/dist/ast/rust/queries.js +132 -0
- package/dist/ast/rust/utils.d.ts +91 -0
- package/dist/ast/rust/utils.d.ts.map +1 -0
- package/dist/ast/rust/utils.js +254 -0
- package/dist/ast/swift/index.d.ts +10 -0
- package/dist/ast/swift/index.d.ts.map +1 -0
- package/dist/ast/swift/index.js +8 -0
- package/dist/ast/swift/parser.d.ts +31 -0
- package/dist/ast/swift/parser.d.ts.map +1 -0
- package/dist/ast/swift/parser.js +554 -0
- package/dist/ast/swift/parser.test.d.ts +5 -0
- package/dist/ast/swift/parser.test.d.ts.map +1 -0
- package/dist/ast/swift/parser.test.js +398 -0
- package/dist/ast/swift/queries.d.ts +71 -0
- package/dist/ast/swift/queries.d.ts.map +1 -0
- package/dist/ast/swift/queries.js +137 -0
- package/dist/ast/swift/utils.d.ts +94 -0
- package/dist/ast/swift/utils.d.ts.map +1 -0
- package/dist/ast/swift/utils.js +411 -0
- package/dist/ast/types.d.ts +96 -0
- package/dist/ast/types.d.ts.map +1 -0
- package/dist/ast/types.js +21 -0
- package/dist/ast/typescript.d.ts +24 -0
- package/dist/ast/typescript.d.ts.map +1 -0
- package/dist/ast/typescript.js +357 -0
- package/dist/cache/file-hash.d.ts +33 -0
- package/dist/cache/file-hash.d.ts.map +1 -0
- package/dist/cache/file-hash.js +59 -0
- package/dist/cache/index.d.ts +9 -0
- package/dist/cache/index.d.ts.map +1 -0
- package/dist/cache/index.js +8 -0
- package/dist/cache/smart-cache.d.ts +68 -0
- package/dist/cache/smart-cache.d.ts.map +1 -0
- package/dist/cache/smart-cache.js +266 -0
- package/dist/cache/types.d.ts +102 -0
- package/dist/cache/types.d.ts.map +1 -0
- package/dist/cache/types.js +6 -0
- package/dist/cli/analyze.d.ts +43 -0
- package/dist/cli/analyze.d.ts.map +1 -0
- package/dist/cli/analyze.js +250 -0
- package/dist/cli/doctor.d.ts +2 -0
- package/dist/cli/doctor.d.ts.map +1 -0
- package/dist/cli/doctor.js +127 -0
- package/dist/cli/hooks.d.ts +14 -0
- package/dist/cli/hooks.d.ts.map +1 -0
- package/dist/cli/hooks.js +229 -0
- package/dist/cli/index.d.ts +5 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +4 -0
- package/dist/cli/setup.d.ts +10 -0
- package/dist/cli/setup.d.ts.map +1 -0
- package/dist/cli/setup.js +117 -0
- package/dist/cli/utils.d.ts +30 -0
- package/dist/cli/utils.d.ts.map +1 -0
- package/dist/cli/utils.js +116 -0
- package/dist/compressors/config.d.ts +9 -0
- package/dist/compressors/config.d.ts.map +1 -0
- package/dist/compressors/config.js +183 -0
- package/dist/compressors/conversation.d.ts +109 -0
- package/dist/compressors/conversation.d.ts.map +1 -0
- package/dist/compressors/conversation.js +404 -0
- package/dist/compressors/diff.d.ts +35 -0
- package/dist/compressors/diff.d.ts.map +1 -0
- package/dist/compressors/diff.js +389 -0
- package/dist/compressors/generic.d.ts +9 -0
- package/dist/compressors/generic.d.ts.map +1 -0
- package/dist/compressors/generic.js +188 -0
- package/dist/compressors/index.d.ts +31 -0
- package/dist/compressors/index.d.ts.map +1 -0
- package/dist/compressors/index.js +82 -0
- package/dist/compressors/logs.d.ts +9 -0
- package/dist/compressors/logs.d.ts.map +1 -0
- package/dist/compressors/logs.js +245 -0
- package/dist/compressors/multifile.d.ts +106 -0
- package/dist/compressors/multifile.d.ts.map +1 -0
- package/dist/compressors/multifile.js +498 -0
- package/dist/compressors/semantic.d.ts +33 -0
- package/dist/compressors/semantic.d.ts.map +1 -0
- package/dist/compressors/semantic.js +233 -0
- package/dist/compressors/stacktrace.d.ts +9 -0
- package/dist/compressors/stacktrace.d.ts.map +1 -0
- package/dist/compressors/stacktrace.js +259 -0
- package/dist/compressors/types.d.ts +146 -0
- package/dist/compressors/types.d.ts.map +1 -0
- package/dist/compressors/types.js +6 -0
- package/dist/config/output-config.d.ts +56 -0
- package/dist/config/output-config.d.ts.map +1 -0
- package/dist/config/output-config.js +78 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +27 -0
- package/dist/middleware/chain.d.ts +49 -0
- package/dist/middleware/chain.d.ts.map +1 -0
- package/dist/middleware/chain.js +126 -0
- package/dist/middleware/index.d.ts +4 -0
- package/dist/middleware/index.d.ts.map +1 -0
- package/dist/middleware/index.js +3 -0
- package/dist/middleware/logging.d.ts +8 -0
- package/dist/middleware/logging.d.ts.map +1 -0
- package/dist/middleware/logging.js +71 -0
- package/dist/middleware/types.d.ts +58 -0
- package/dist/middleware/types.d.ts.map +1 -0
- package/dist/middleware/types.js +7 -0
- package/dist/parsers/eslint.d.ts +8 -0
- package/dist/parsers/eslint.d.ts.map +1 -0
- package/dist/parsers/eslint.js +132 -0
- package/dist/parsers/generic.d.ts +8 -0
- package/dist/parsers/generic.d.ts.map +1 -0
- package/dist/parsers/generic.js +234 -0
- package/dist/parsers/index.d.ts +34 -0
- package/dist/parsers/index.d.ts.map +1 -0
- package/dist/parsers/index.js +216 -0
- package/dist/parsers/types.d.ts +84 -0
- package/dist/parsers/types.d.ts.map +1 -0
- package/dist/parsers/types.js +6 -0
- package/dist/parsers/typescript.d.ts +8 -0
- package/dist/parsers/typescript.d.ts.map +1 -0
- package/dist/parsers/typescript.js +107 -0
- package/dist/pipelines/definitions.d.ts +50 -0
- package/dist/pipelines/definitions.d.ts.map +1 -0
- package/dist/pipelines/definitions.js +206 -0
- package/dist/sandbox/executor.d.ts +12 -0
- package/dist/sandbox/executor.d.ts.map +1 -0
- package/dist/sandbox/executor.js +191 -0
- package/dist/sandbox/index.d.ts +11 -0
- package/dist/sandbox/index.d.ts.map +1 -0
- package/dist/sandbox/index.js +9 -0
- package/dist/sandbox/sandbox.test.d.ts +7 -0
- package/dist/sandbox/sandbox.test.d.ts.map +1 -0
- package/dist/sandbox/sandbox.test.js +202 -0
- package/dist/sandbox/sdk/analyze.d.ts +36 -0
- package/dist/sandbox/sdk/analyze.d.ts.map +1 -0
- package/dist/sandbox/sdk/analyze.js +413 -0
- package/dist/sandbox/sdk/analyze.test.d.ts +7 -0
- package/dist/sandbox/sdk/analyze.test.d.ts.map +1 -0
- package/dist/sandbox/sdk/analyze.test.js +191 -0
- package/dist/sandbox/sdk/code.d.ts +20 -0
- package/dist/sandbox/sdk/code.d.ts.map +1 -0
- package/dist/sandbox/sdk/code.js +104 -0
- package/dist/sandbox/sdk/compress.d.ts +23 -0
- package/dist/sandbox/sdk/compress.d.ts.map +1 -0
- package/dist/sandbox/sdk/compress.js +107 -0
- package/dist/sandbox/sdk/conversation.d.ts +148 -0
- package/dist/sandbox/sdk/conversation.d.ts.map +1 -0
- package/dist/sandbox/sdk/conversation.js +177 -0
- package/dist/sandbox/sdk/files.d.ts +29 -0
- package/dist/sandbox/sdk/files.d.ts.map +1 -0
- package/dist/sandbox/sdk/files.js +41 -0
- package/dist/sandbox/sdk/git.d.ts +37 -0
- package/dist/sandbox/sdk/git.d.ts.map +1 -0
- package/dist/sandbox/sdk/git.js +313 -0
- package/dist/sandbox/sdk/git.test.d.ts +8 -0
- package/dist/sandbox/sdk/git.test.d.ts.map +1 -0
- package/dist/sandbox/sdk/git.test.js +160 -0
- package/dist/sandbox/sdk/index.d.ts +16 -0
- package/dist/sandbox/sdk/index.d.ts.map +1 -0
- package/dist/sandbox/sdk/index.js +15 -0
- package/dist/sandbox/sdk/multifile.d.ts +63 -0
- package/dist/sandbox/sdk/multifile.d.ts.map +1 -0
- package/dist/sandbox/sdk/multifile.js +130 -0
- package/dist/sandbox/sdk/pipeline.d.ts +16 -0
- package/dist/sandbox/sdk/pipeline.d.ts.map +1 -0
- package/dist/sandbox/sdk/pipeline.js +454 -0
- package/dist/sandbox/sdk/pipeline.test.d.ts +7 -0
- package/dist/sandbox/sdk/pipeline.test.d.ts.map +1 -0
- package/dist/sandbox/sdk/pipeline.test.js +197 -0
- package/dist/sandbox/sdk/search.d.ts +36 -0
- package/dist/sandbox/sdk/search.d.ts.map +1 -0
- package/dist/sandbox/sdk/search.js +338 -0
- package/dist/sandbox/sdk/search.test.d.ts +7 -0
- package/dist/sandbox/sdk/search.test.d.ts.map +1 -0
- package/dist/sandbox/sdk/search.test.js +183 -0
- package/dist/sandbox/sdk/utils.d.ts +18 -0
- package/dist/sandbox/sdk/utils.d.ts.map +1 -0
- package/dist/sandbox/sdk/utils.js +24 -0
- package/dist/sandbox/security/code-analyzer.d.ts +15 -0
- package/dist/sandbox/security/code-analyzer.d.ts.map +1 -0
- package/dist/sandbox/security/code-analyzer.js +87 -0
- package/dist/sandbox/security/index.d.ts +6 -0
- package/dist/sandbox/security/index.d.ts.map +1 -0
- package/dist/sandbox/security/index.js +5 -0
- package/dist/sandbox/security/path-validator.d.ts +23 -0
- package/dist/sandbox/security/path-validator.d.ts.map +1 -0
- package/dist/sandbox/security/path-validator.js +113 -0
- package/dist/sandbox/types.d.ts +577 -0
- package/dist/sandbox/types.d.ts.map +1 -0
- package/dist/sandbox/types.js +14 -0
- package/dist/server.d.ts +36 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +133 -0
- package/dist/summarizers/build-logs.d.ts +11 -0
- package/dist/summarizers/build-logs.d.ts.map +1 -0
- package/dist/summarizers/build-logs.js +234 -0
- package/dist/summarizers/generic.d.ts +11 -0
- package/dist/summarizers/generic.d.ts.map +1 -0
- package/dist/summarizers/generic.js +93 -0
- package/dist/summarizers/index.d.ts +20 -0
- package/dist/summarizers/index.d.ts.map +1 -0
- package/dist/summarizers/index.js +43 -0
- package/dist/summarizers/server-logs.d.ts +11 -0
- package/dist/summarizers/server-logs.d.ts.map +1 -0
- package/dist/summarizers/server-logs.js +215 -0
- package/dist/summarizers/test-logs.d.ts +11 -0
- package/dist/summarizers/test-logs.d.ts.map +1 -0
- package/dist/summarizers/test-logs.js +258 -0
- package/dist/summarizers/types.d.ts +146 -0
- package/dist/summarizers/types.d.ts.map +1 -0
- package/dist/summarizers/types.js +21 -0
- package/dist/tools/analyze-build-output.d.ts +30 -0
- package/dist/tools/analyze-build-output.d.ts.map +1 -0
- package/dist/tools/analyze-build-output.js +45 -0
- package/dist/tools/analyze-context.d.ts +23 -0
- package/dist/tools/analyze-context.d.ts.map +1 -0
- package/dist/tools/analyze-context.js +78 -0
- package/dist/tools/auto-optimize.d.ts +9 -0
- package/dist/tools/auto-optimize.d.ts.map +1 -0
- package/dist/tools/auto-optimize.js +191 -0
- package/dist/tools/code-execute.d.ts +9 -0
- package/dist/tools/code-execute.d.ts.map +1 -0
- package/dist/tools/code-execute.js +84 -0
- package/dist/tools/code-skeleton.d.ts +33 -0
- package/dist/tools/code-skeleton.d.ts.map +1 -0
- package/dist/tools/code-skeleton.js +206 -0
- package/dist/tools/compress-context.d.ts +33 -0
- package/dist/tools/compress-context.d.ts.map +1 -0
- package/dist/tools/compress-context.js +64 -0
- package/dist/tools/context-budget.d.ts +43 -0
- package/dist/tools/context-budget.d.ts.map +1 -0
- package/dist/tools/context-budget.js +260 -0
- package/dist/tools/context-budget.test.d.ts +5 -0
- package/dist/tools/context-budget.test.d.ts.map +1 -0
- package/dist/tools/context-budget.test.js +219 -0
- package/dist/tools/conversation-compress.d.ts +46 -0
- package/dist/tools/conversation-compress.d.ts.map +1 -0
- package/dist/tools/conversation-compress.js +78 -0
- package/dist/tools/conversation-memory.d.ts +75 -0
- package/dist/tools/conversation-memory.d.ts.map +1 -0
- package/dist/tools/conversation-memory.js +289 -0
- package/dist/tools/deduplicate-errors.d.ts +30 -0
- package/dist/tools/deduplicate-errors.d.ts.map +1 -0
- package/dist/tools/deduplicate-errors.js +72 -0
- package/dist/tools/detect-retry-loop.d.ts +40 -0
- package/dist/tools/detect-retry-loop.d.ts.map +1 -0
- package/dist/tools/detect-retry-loop.js +212 -0
- package/dist/tools/diff-compress.d.ts +40 -0
- package/dist/tools/diff-compress.d.ts.map +1 -0
- package/dist/tools/diff-compress.js +94 -0
- package/dist/tools/discover-tools.d.ts +11 -0
- package/dist/tools/discover-tools.d.ts.map +1 -0
- package/dist/tools/discover-tools.js +163 -0
- package/dist/tools/dynamic-loader.d.ts +131 -0
- package/dist/tools/dynamic-loader.d.ts.map +1 -0
- package/dist/tools/dynamic-loader.js +378 -0
- package/dist/tools/dynamic-loader.test.d.ts +10 -0
- package/dist/tools/dynamic-loader.test.d.ts.map +1 -0
- package/dist/tools/dynamic-loader.test.js +164 -0
- package/dist/tools/lazy-mcp.d.ts +31 -0
- package/dist/tools/lazy-mcp.d.ts.map +1 -0
- package/dist/tools/lazy-mcp.js +151 -0
- package/dist/tools/lazy-mcp.test.d.ts +10 -0
- package/dist/tools/lazy-mcp.test.d.ts.map +1 -0
- package/dist/tools/lazy-mcp.test.js +172 -0
- package/dist/tools/multifile-compress.d.ts +36 -0
- package/dist/tools/multifile-compress.d.ts.map +1 -0
- package/dist/tools/multifile-compress.js +223 -0
- package/dist/tools/optimization-tips.d.ts +18 -0
- package/dist/tools/optimization-tips.d.ts.map +1 -0
- package/dist/tools/optimization-tips.js +133 -0
- package/dist/tools/registry.d.ts +70 -0
- package/dist/tools/registry.d.ts.map +1 -0
- package/dist/tools/registry.js +169 -0
- package/dist/tools/semantic-compress.d.ts +39 -0
- package/dist/tools/semantic-compress.d.ts.map +1 -0
- package/dist/tools/semantic-compress.js +113 -0
- package/dist/tools/semantic-compress.test.d.ts +5 -0
- package/dist/tools/semantic-compress.test.d.ts.map +1 -0
- package/dist/tools/semantic-compress.test.js +182 -0
- package/dist/tools/session-stats.d.ts +34 -0
- package/dist/tools/session-stats.d.ts.map +1 -0
- package/dist/tools/session-stats.js +194 -0
- package/dist/tools/set-output-config.d.ts +38 -0
- package/dist/tools/set-output-config.d.ts.map +1 -0
- package/dist/tools/set-output-config.js +122 -0
- package/dist/tools/smart-cache-tool.d.ts +38 -0
- package/dist/tools/smart-cache-tool.d.ts.map +1 -0
- package/dist/tools/smart-cache-tool.js +224 -0
- package/dist/tools/smart-file-read.d.ts +52 -0
- package/dist/tools/smart-file-read.d.ts.map +1 -0
- package/dist/tools/smart-file-read.js +481 -0
- package/dist/tools/smart-pipeline.d.ts +40 -0
- package/dist/tools/smart-pipeline.d.ts.map +1 -0
- package/dist/tools/smart-pipeline.js +295 -0
- package/dist/tools/summarize-logs.d.ts +36 -0
- package/dist/tools/summarize-logs.d.ts.map +1 -0
- package/dist/tools/summarize-logs.js +184 -0
- package/dist/tools/token-budget.test.d.ts +11 -0
- package/dist/tools/token-budget.test.d.ts.map +1 -0
- package/dist/tools/token-budget.test.js +275 -0
- package/dist/utils/bm25.d.ts +86 -0
- package/dist/utils/bm25.d.ts.map +1 -0
- package/dist/utils/bm25.js +153 -0
- package/dist/utils/bm25.test.d.ts +5 -0
- package/dist/utils/bm25.test.d.ts.map +1 -0
- package/dist/utils/bm25.test.js +156 -0
- package/dist/utils/command-normalizer.d.ts +39 -0
- package/dist/utils/command-normalizer.d.ts.map +1 -0
- package/dist/utils/command-normalizer.js +90 -0
- package/dist/utils/content-detector.d.ts +27 -0
- package/dist/utils/content-detector.d.ts.map +1 -0
- package/dist/utils/content-detector.js +127 -0
- package/dist/utils/embeddings.d.ts +54 -0
- package/dist/utils/embeddings.d.ts.map +1 -0
- package/dist/utils/embeddings.js +97 -0
- package/dist/utils/embeddings.test.d.ts +8 -0
- package/dist/utils/embeddings.test.d.ts.map +1 -0
- package/dist/utils/embeddings.test.js +96 -0
- package/dist/utils/error-normalizer.d.ts +39 -0
- package/dist/utils/error-normalizer.d.ts.map +1 -0
- package/dist/utils/error-normalizer.js +233 -0
- package/dist/utils/hybrid-search.d.ts +79 -0
- package/dist/utils/hybrid-search.d.ts.map +1 -0
- package/dist/utils/hybrid-search.js +146 -0
- package/dist/utils/hybrid-search.test.d.ts +5 -0
- package/dist/utils/hybrid-search.test.d.ts.map +1 -0
- package/dist/utils/hybrid-search.test.js +172 -0
- package/dist/utils/index.d.ts +13 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +12 -0
- package/dist/utils/language-detector.d.ts +27 -0
- package/dist/utils/language-detector.d.ts.map +1 -0
- package/dist/utils/language-detector.js +94 -0
- package/dist/utils/log-parser.d.ts +46 -0
- package/dist/utils/log-parser.d.ts.map +1 -0
- package/dist/utils/log-parser.js +287 -0
- package/dist/utils/output-estimator.d.ts +54 -0
- package/dist/utils/output-estimator.d.ts.map +1 -0
- package/dist/utils/output-estimator.js +119 -0
- package/dist/utils/output-estimator.test.d.ts +5 -0
- package/dist/utils/output-estimator.test.d.ts.map +1 -0
- package/dist/utils/output-estimator.test.js +115 -0
- package/dist/utils/output-similarity.d.ts +48 -0
- package/dist/utils/output-similarity.d.ts.map +1 -0
- package/dist/utils/output-similarity.js +140 -0
- package/dist/utils/project-detector.d.ts +16 -0
- package/dist/utils/project-detector.d.ts.map +1 -0
- package/dist/utils/project-detector.js +119 -0
- package/dist/utils/segment-scorer.d.ts +99 -0
- package/dist/utils/segment-scorer.d.ts.map +1 -0
- package/dist/utils/segment-scorer.js +148 -0
- package/dist/utils/signature-grouper.d.ts +58 -0
- package/dist/utils/signature-grouper.d.ts.map +1 -0
- package/dist/utils/signature-grouper.js +185 -0
- package/dist/utils/tfidf.d.ts +45 -0
- package/dist/utils/tfidf.d.ts.map +1 -0
- package/dist/utils/tfidf.js +204 -0
- package/dist/utils/tfidf.test.d.ts +5 -0
- package/dist/utils/tfidf.test.d.ts.map +1 -0
- package/dist/utils/tfidf.test.js +115 -0
- package/dist/utils/token-counter.d.ts +35 -0
- package/dist/utils/token-counter.d.ts.map +1 -0
- package/dist/utils/token-counter.js +83 -0
- package/dist/utils/toon-serializer.d.ts +120 -0
- package/dist/utils/toon-serializer.d.ts.map +1 -0
- package/dist/utils/toon-serializer.js +472 -0
- package/dist/utils/toon-serializer.test.d.ts +7 -0
- package/dist/utils/toon-serializer.test.d.ts.map +1 -0
- package/dist/utils/toon-serializer.test.js +290 -0
- package/package.json +63 -0
- package/scripts/install.ps1 +133 -0
- package/scripts/install.sh +183 -0
- package/scripts/pre-commit-hook.sh +86 -0
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Server Logs Summarizer
|
|
3
|
+
*
|
|
4
|
+
* Summarizes HTTP server logs with request statistics, response times, and error tracking.
|
|
5
|
+
*/
|
|
6
|
+
import { parseLogLine, parseTimestamp, calculateTimespan, deduplicateEntries, filterByTimeframe, isKeyEvent, } from "../utils/log-parser.js";
|
|
7
|
+
import { MAX_ENTRIES } from "./types.js";
|
|
8
|
+
/**
|
|
9
|
+
* HTTP request pattern: GET /api/users 200 45ms
|
|
10
|
+
*/
|
|
11
|
+
const HTTP_REQUEST_PATTERN = /\b(GET|POST|PUT|DELETE|PATCH|HEAD|OPTIONS)\s+(\/\S*)\s+(\d{3})(?:\s+(\d+(?:\.\d+)?)\s*m?s)?/i;
|
|
12
|
+
/**
|
|
13
|
+
* Alternative patterns for different log formats
|
|
14
|
+
*/
|
|
15
|
+
const ALT_PATTERNS = [
|
|
16
|
+
// nginx/apache: "GET /path HTTP/1.1" 200 1234
|
|
17
|
+
/"(GET|POST|PUT|DELETE|PATCH|HEAD|OPTIONS)\s+(\/\S*)\s+HTTP\/[\d.]+"\s+(\d{3})/i,
|
|
18
|
+
// status=200 path=/api/users method=GET
|
|
19
|
+
/method[=:]\s*(GET|POST|PUT|DELETE|PATCH|HEAD|OPTIONS).*path[=:]\s*(\/\S*).*status[=:]\s*(\d{3})/i,
|
|
20
|
+
];
|
|
21
|
+
/**
|
|
22
|
+
* Parse an HTTP request from a log line
|
|
23
|
+
*/
|
|
24
|
+
function parseHttpRequest(line) {
|
|
25
|
+
// Try main pattern
|
|
26
|
+
let match = line.match(HTTP_REQUEST_PATTERN);
|
|
27
|
+
if (match) {
|
|
28
|
+
return {
|
|
29
|
+
timestamp: parseTimestamp(line),
|
|
30
|
+
method: (match[1] ?? "GET").toUpperCase(),
|
|
31
|
+
path: match[2] ?? "/",
|
|
32
|
+
statusCode: parseInt(match[3] ?? "0", 10),
|
|
33
|
+
responseTime: match[4] ? parseFloat(match[4]) : undefined,
|
|
34
|
+
raw: line,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
// Try alternative patterns
|
|
38
|
+
for (const pattern of ALT_PATTERNS) {
|
|
39
|
+
match = line.match(pattern);
|
|
40
|
+
if (match) {
|
|
41
|
+
return {
|
|
42
|
+
timestamp: parseTimestamp(line),
|
|
43
|
+
method: (match[1] ?? "GET").toUpperCase(),
|
|
44
|
+
path: match[2] ?? "/",
|
|
45
|
+
statusCode: parseInt(match[3] ?? "0", 10),
|
|
46
|
+
raw: line,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Normalize path for grouping (remove IDs and query strings)
|
|
54
|
+
*/
|
|
55
|
+
function normalizePath(path) {
|
|
56
|
+
return path
|
|
57
|
+
.split("?")[0] // Remove query string
|
|
58
|
+
?.replace(/\/\d+/g, "/:id") // Replace numeric IDs
|
|
59
|
+
.replace(/\/[a-f0-9-]{36}/gi, "/:uuid") // Replace UUIDs
|
|
60
|
+
.replace(/\/[a-f0-9]{24}/gi, "/:id") ?? path; // Replace MongoDB ObjectIds
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Server logs summarizer
|
|
64
|
+
*/
|
|
65
|
+
export const serverLogsSummarizer = {
|
|
66
|
+
name: "server-logs",
|
|
67
|
+
logType: "server",
|
|
68
|
+
canSummarize(logs) {
|
|
69
|
+
const lines = logs.split("\n").slice(0, 100); // Sample first 100 lines
|
|
70
|
+
let matches = 0;
|
|
71
|
+
for (const line of lines) {
|
|
72
|
+
if (HTTP_REQUEST_PATTERN.test(line) || ALT_PATTERNS.some((p) => p.test(line))) {
|
|
73
|
+
matches++;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return matches / lines.length >= 0.1; // At least 10% HTTP requests
|
|
77
|
+
},
|
|
78
|
+
summarize(logs, options) {
|
|
79
|
+
const lines = logs.split("\n").filter((l) => l.trim());
|
|
80
|
+
const requests = [];
|
|
81
|
+
const errors = [];
|
|
82
|
+
const warnings = [];
|
|
83
|
+
const keyEvents = [];
|
|
84
|
+
const allEntries = [];
|
|
85
|
+
// Parse all lines
|
|
86
|
+
for (const line of lines) {
|
|
87
|
+
const trimmed = line.trim();
|
|
88
|
+
if (!trimmed)
|
|
89
|
+
continue;
|
|
90
|
+
// Try to parse as HTTP request
|
|
91
|
+
const request = parseHttpRequest(trimmed);
|
|
92
|
+
if (request) {
|
|
93
|
+
requests.push(request);
|
|
94
|
+
// Check for error status codes
|
|
95
|
+
if (request.statusCode >= 500) {
|
|
96
|
+
errors.push({
|
|
97
|
+
timestamp: request.timestamp,
|
|
98
|
+
level: "error",
|
|
99
|
+
message: `${request.method} ${request.path} → ${request.statusCode}`,
|
|
100
|
+
count: 1,
|
|
101
|
+
raw: trimmed,
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
else if (request.statusCode >= 400) {
|
|
105
|
+
warnings.push({
|
|
106
|
+
timestamp: request.timestamp,
|
|
107
|
+
level: "warning",
|
|
108
|
+
message: `${request.method} ${request.path} → ${request.statusCode}`,
|
|
109
|
+
count: 1,
|
|
110
|
+
raw: trimmed,
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
// Parse as regular log entry
|
|
115
|
+
const entry = parseLogLine(trimmed);
|
|
116
|
+
allEntries.push(entry);
|
|
117
|
+
// Collect errors and warnings from non-request lines
|
|
118
|
+
if (!request) {
|
|
119
|
+
if (entry.level === "error") {
|
|
120
|
+
errors.push(entry);
|
|
121
|
+
}
|
|
122
|
+
else if (entry.level === "warning") {
|
|
123
|
+
warnings.push(entry);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
// Detect key events
|
|
127
|
+
if (isKeyEvent(trimmed)) {
|
|
128
|
+
keyEvents.push(entry);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
// Filter by timeframe if specified
|
|
132
|
+
const filteredEntries = filterByTimeframe(allEntries, options.timeframe);
|
|
133
|
+
// Calculate endpoint statistics
|
|
134
|
+
const endpointStats = new Map();
|
|
135
|
+
const statusCodes = new Map();
|
|
136
|
+
for (const req of requests) {
|
|
137
|
+
const key = `${req.method} ${normalizePath(req.path)}`;
|
|
138
|
+
const stats = endpointStats.get(key) || { count: 0, totalTime: 0, errorCount: 0 };
|
|
139
|
+
stats.count++;
|
|
140
|
+
if (req.responseTime) {
|
|
141
|
+
stats.totalTime += req.responseTime;
|
|
142
|
+
}
|
|
143
|
+
if (req.statusCode >= 400) {
|
|
144
|
+
stats.errorCount++;
|
|
145
|
+
}
|
|
146
|
+
endpointStats.set(key, stats);
|
|
147
|
+
// Track status codes
|
|
148
|
+
statusCodes.set(req.statusCode, (statusCodes.get(req.statusCode) || 0) + 1);
|
|
149
|
+
}
|
|
150
|
+
// Calculate timespan
|
|
151
|
+
const timespan = calculateTimespan(filteredEntries);
|
|
152
|
+
// Build endpoint array
|
|
153
|
+
const endpoints = Array.from(endpointStats.entries())
|
|
154
|
+
.map(([key, stats]) => {
|
|
155
|
+
const [method, path] = key.split(" ");
|
|
156
|
+
return {
|
|
157
|
+
method: method ?? "GET",
|
|
158
|
+
path: path ?? "/",
|
|
159
|
+
count: stats.count,
|
|
160
|
+
avgTime: stats.count > 0 ? Math.round(stats.totalTime / stats.count) : 0,
|
|
161
|
+
errorCount: stats.errorCount,
|
|
162
|
+
};
|
|
163
|
+
})
|
|
164
|
+
.sort((a, b) => b.count - a.count);
|
|
165
|
+
// Calculate average response time
|
|
166
|
+
const totalTime = requests.reduce((sum, r) => sum + (r.responseTime || 0), 0);
|
|
167
|
+
const requestsWithTime = requests.filter((r) => r.responseTime !== undefined).length;
|
|
168
|
+
const avgResponseTime = requestsWithTime > 0 ? Math.round(totalTime / requestsWithTime) : 0;
|
|
169
|
+
// Deduplicate errors and warnings
|
|
170
|
+
const deduplicatedErrors = deduplicateEntries(errors);
|
|
171
|
+
const deduplicatedWarnings = deduplicateEntries(warnings);
|
|
172
|
+
// Build statistics
|
|
173
|
+
const statistics = {
|
|
174
|
+
timespan,
|
|
175
|
+
totalLines: lines.length,
|
|
176
|
+
errorCount: errors.length,
|
|
177
|
+
warningCount: warnings.length,
|
|
178
|
+
infoCount: allEntries.filter((e) => e.level === "info").length,
|
|
179
|
+
debugCount: allEntries.filter((e) => e.level === "debug").length,
|
|
180
|
+
requestCount: requests.length,
|
|
181
|
+
avgResponseTime,
|
|
182
|
+
endpoints: endpoints.slice(0, MAX_ENTRIES[options.detail].events),
|
|
183
|
+
statusCodes,
|
|
184
|
+
};
|
|
185
|
+
// Build overview
|
|
186
|
+
const overview = buildOverview(statistics, timespan);
|
|
187
|
+
return {
|
|
188
|
+
logType: "server",
|
|
189
|
+
overview,
|
|
190
|
+
errors: deduplicatedErrors.slice(0, MAX_ENTRIES[options.detail].errors),
|
|
191
|
+
warnings: deduplicatedWarnings.slice(0, MAX_ENTRIES[options.detail].warnings),
|
|
192
|
+
keyEvents: keyEvents.slice(0, MAX_ENTRIES[options.detail].events),
|
|
193
|
+
statistics,
|
|
194
|
+
};
|
|
195
|
+
},
|
|
196
|
+
};
|
|
197
|
+
/**
|
|
198
|
+
* Build overview text
|
|
199
|
+
*/
|
|
200
|
+
function buildOverview(stats, timespan) {
|
|
201
|
+
const parts = [];
|
|
202
|
+
if (timespan) {
|
|
203
|
+
parts.push(`Duration: ${timespan.durationFormatted}`);
|
|
204
|
+
}
|
|
205
|
+
if (stats.requestCount !== undefined) {
|
|
206
|
+
parts.push(`${stats.requestCount.toLocaleString()} requests processed`);
|
|
207
|
+
}
|
|
208
|
+
if (stats.avgResponseTime !== undefined && stats.avgResponseTime > 0) {
|
|
209
|
+
parts.push(`avg ${stats.avgResponseTime}ms response time`);
|
|
210
|
+
}
|
|
211
|
+
if (stats.errorCount > 0) {
|
|
212
|
+
parts.push(`${stats.errorCount} errors`);
|
|
213
|
+
}
|
|
214
|
+
return parts.join(", ") || "Server log summary";
|
|
215
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test Logs Summarizer
|
|
3
|
+
*
|
|
4
|
+
* Summarizes test runner output (Jest, Mocha, Vitest, pytest, etc.).
|
|
5
|
+
*/
|
|
6
|
+
import type { Summarizer } from "./types.js";
|
|
7
|
+
/**
|
|
8
|
+
* Test logs summarizer
|
|
9
|
+
*/
|
|
10
|
+
export declare const testLogsSummarizer: Summarizer;
|
|
11
|
+
//# sourceMappingURL=test-logs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-logs.d.ts","sourceRoot":"","sources":["../../src/summarizers/test-logs.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,UAAU,EAMX,MAAM,YAAY,CAAC;AAgJpB;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,UA8HhC,CAAC"}
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test Logs Summarizer
|
|
3
|
+
*
|
|
4
|
+
* Summarizes test runner output (Jest, Mocha, Vitest, pytest, etc.).
|
|
5
|
+
*/
|
|
6
|
+
import { parseLogLine, calculateTimespan, deduplicateEntries, filterByTimeframe, } from "../utils/log-parser.js";
|
|
7
|
+
import { MAX_ENTRIES } from "./types.js";
|
|
8
|
+
/**
|
|
9
|
+
* Test result patterns for different frameworks
|
|
10
|
+
*/
|
|
11
|
+
const TEST_PATTERNS = {
|
|
12
|
+
// Jest/Vitest: ✓ test name (5ms) or ✕ test name
|
|
13
|
+
jest: /^\s*(✓|✕|○)\s+(.+?)(?:\s+\((\d+)\s*m?s\))?$/,
|
|
14
|
+
// Jest: PASS/FAIL src/file.test.ts
|
|
15
|
+
jestFile: /^\s*(PASS|FAIL)\s+(.+\.(?:test|spec)\.[jt]sx?)$/,
|
|
16
|
+
// Mocha: ✓ test name: 5ms or 1) test name
|
|
17
|
+
mocha: /^\s*(?:(\d+)\)|(✓|✔))\s+(.+?)(?::\s*(\d+)ms)?$/,
|
|
18
|
+
// pytest: PASSED/FAILED test_file.py::test_name
|
|
19
|
+
pytest: /^\s*(PASSED|FAILED|SKIPPED|ERROR)\s+(.+?::.+?)(?:\s+\[(\d+)%\])?$/,
|
|
20
|
+
// Generic: [PASS] or [FAIL]
|
|
21
|
+
generic: /^\s*\[(PASS|FAIL|SKIP)\]\s+(.+)$/i,
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Summary line patterns
|
|
25
|
+
*/
|
|
26
|
+
const SUMMARY_PATTERNS = {
|
|
27
|
+
// Jest: Tests: 5 passed, 1 failed, 6 total
|
|
28
|
+
jest: /Tests?:\s*(\d+)\s*passed?,?\s*(\d+)\s*failed?,?\s*(?:(\d+)\s*skipped?,?\s*)?(\d+)\s*total/i,
|
|
29
|
+
// Jest: Test Suites: 2 passed, 1 failed, 3 total
|
|
30
|
+
jestSuites: /Test Suites?:\s*(\d+)\s*passed?,?\s*(\d+)\s*failed?,?\s*(\d+)\s*total/i,
|
|
31
|
+
// pytest: 5 passed, 1 failed in 2.5s
|
|
32
|
+
pytest: /(\d+)\s*passed?,?\s*(\d+)\s*failed?(?:,?\s*(\d+)\s*skipped?)?.*?in\s*([\d.]+)s/i,
|
|
33
|
+
// Time: 5.123s
|
|
34
|
+
time: /(?:Time|Duration|Ran).*?(\d+(?:\.\d+)?)\s*(?:s|ms|seconds?)/i,
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Parse a test result from a log line
|
|
38
|
+
*/
|
|
39
|
+
function parseTestResult(line) {
|
|
40
|
+
// Try Jest pattern
|
|
41
|
+
let match = line.match(TEST_PATTERNS.jest);
|
|
42
|
+
if (match) {
|
|
43
|
+
const symbol = match[1];
|
|
44
|
+
let status = "pass";
|
|
45
|
+
if (symbol === "✕")
|
|
46
|
+
status = "fail";
|
|
47
|
+
else if (symbol === "○")
|
|
48
|
+
status = "skip";
|
|
49
|
+
return {
|
|
50
|
+
name: (match[2] ?? "").trim(),
|
|
51
|
+
status,
|
|
52
|
+
duration: match[3] ? parseInt(match[3], 10) : undefined,
|
|
53
|
+
raw: line,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
// Try Jest file pattern
|
|
57
|
+
match = line.match(TEST_PATTERNS.jestFile);
|
|
58
|
+
if (match) {
|
|
59
|
+
return {
|
|
60
|
+
name: match[2] ?? "",
|
|
61
|
+
status: (match[1] ?? "").toLowerCase() === "pass" ? "pass" : "fail",
|
|
62
|
+
raw: line,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
// Try Mocha pattern
|
|
66
|
+
match = line.match(TEST_PATTERNS.mocha);
|
|
67
|
+
if (match) {
|
|
68
|
+
const isFailNumber = match[1] !== undefined;
|
|
69
|
+
return {
|
|
70
|
+
name: (match[3] ?? "").trim(),
|
|
71
|
+
status: isFailNumber ? "fail" : "pass",
|
|
72
|
+
duration: match[4] ? parseInt(match[4], 10) : undefined,
|
|
73
|
+
raw: line,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
// Try pytest pattern
|
|
77
|
+
match = line.match(TEST_PATTERNS.pytest);
|
|
78
|
+
if (match) {
|
|
79
|
+
const statusStr = (match[1] ?? "").toUpperCase();
|
|
80
|
+
let status = "pass";
|
|
81
|
+
if (statusStr === "FAILED" || statusStr === "ERROR")
|
|
82
|
+
status = "fail";
|
|
83
|
+
else if (statusStr === "SKIPPED")
|
|
84
|
+
status = "skip";
|
|
85
|
+
return {
|
|
86
|
+
name: match[2] ?? "",
|
|
87
|
+
status,
|
|
88
|
+
raw: line,
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
// Try generic pattern
|
|
92
|
+
match = line.match(TEST_PATTERNS.generic);
|
|
93
|
+
if (match) {
|
|
94
|
+
const statusStr = (match[1] ?? "").toUpperCase();
|
|
95
|
+
let status = "pass";
|
|
96
|
+
if (statusStr === "FAIL")
|
|
97
|
+
status = "fail";
|
|
98
|
+
else if (statusStr === "SKIP")
|
|
99
|
+
status = "skip";
|
|
100
|
+
return {
|
|
101
|
+
name: (match[2] ?? "").trim(),
|
|
102
|
+
status,
|
|
103
|
+
raw: line,
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
return null;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Extract summary statistics from summary lines
|
|
110
|
+
*/
|
|
111
|
+
function extractSummaryStats(logs) {
|
|
112
|
+
// Try Jest pattern
|
|
113
|
+
let match = logs.match(SUMMARY_PATTERNS.jest);
|
|
114
|
+
if (match) {
|
|
115
|
+
return {
|
|
116
|
+
passed: parseInt(match[1] ?? "0", 10),
|
|
117
|
+
failed: parseInt(match[2] ?? "0", 10),
|
|
118
|
+
skipped: match[3] ? parseInt(match[3], 10) : 0,
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
// Try pytest pattern
|
|
122
|
+
match = logs.match(SUMMARY_PATTERNS.pytest);
|
|
123
|
+
if (match) {
|
|
124
|
+
return {
|
|
125
|
+
passed: parseInt(match[1] ?? "0", 10),
|
|
126
|
+
failed: parseInt(match[2] ?? "0", 10),
|
|
127
|
+
skipped: match[3] ? parseInt(match[3], 10) : 0,
|
|
128
|
+
duration: parseFloat(match[4] ?? "0") * 1000, // Convert to ms
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
return null;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Test logs summarizer
|
|
135
|
+
*/
|
|
136
|
+
export const testLogsSummarizer = {
|
|
137
|
+
name: "test-logs",
|
|
138
|
+
logType: "test",
|
|
139
|
+
canSummarize(logs) {
|
|
140
|
+
const indicators = [
|
|
141
|
+
/\b(PASS|FAIL|SKIP)\b/,
|
|
142
|
+
/\b(describe|it|test)\s*\(/,
|
|
143
|
+
/✓|✕|○/,
|
|
144
|
+
/\bTest(?:s|Suites?):/,
|
|
145
|
+
/\bpytest\b/i,
|
|
146
|
+
/\b(jest|vitest|mocha)\b/i,
|
|
147
|
+
];
|
|
148
|
+
return indicators.some((p) => p.test(logs));
|
|
149
|
+
},
|
|
150
|
+
summarize(logs, options) {
|
|
151
|
+
const lines = logs.split("\n").filter((l) => l.trim());
|
|
152
|
+
const testResults = [];
|
|
153
|
+
const errors = [];
|
|
154
|
+
const warnings = [];
|
|
155
|
+
const keyEvents = [];
|
|
156
|
+
const allEntries = [];
|
|
157
|
+
// Try to extract summary stats from the logs
|
|
158
|
+
const summaryStats = extractSummaryStats(logs);
|
|
159
|
+
// Parse all lines
|
|
160
|
+
for (const line of lines) {
|
|
161
|
+
const trimmed = line.trim();
|
|
162
|
+
if (!trimmed)
|
|
163
|
+
continue;
|
|
164
|
+
// Try to parse as test result
|
|
165
|
+
const testResult = parseTestResult(trimmed);
|
|
166
|
+
if (testResult) {
|
|
167
|
+
testResults.push(testResult);
|
|
168
|
+
if (testResult.status === "fail") {
|
|
169
|
+
errors.push({
|
|
170
|
+
level: "error",
|
|
171
|
+
message: `FAIL: ${testResult.name}`,
|
|
172
|
+
count: 1,
|
|
173
|
+
raw: trimmed,
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
// Parse as regular log entry
|
|
178
|
+
const entry = parseLogLine(trimmed);
|
|
179
|
+
allEntries.push(entry);
|
|
180
|
+
// Collect errors from non-test lines
|
|
181
|
+
if (!testResult && entry.level === "error") {
|
|
182
|
+
errors.push(entry);
|
|
183
|
+
}
|
|
184
|
+
if (entry.level === "warning") {
|
|
185
|
+
warnings.push(entry);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
// Filter by timeframe if specified
|
|
189
|
+
const filteredEntries = filterByTimeframe(allEntries, options.timeframe);
|
|
190
|
+
// Calculate test statistics
|
|
191
|
+
const passCount = summaryStats?.passed ?? testResults.filter((t) => t.status === "pass").length;
|
|
192
|
+
const failCount = summaryStats?.failed ?? testResults.filter((t) => t.status === "fail").length;
|
|
193
|
+
const skipCount = summaryStats?.skipped ?? testResults.filter((t) => t.status === "skip").length;
|
|
194
|
+
const totalTests = passCount + failCount + skipCount;
|
|
195
|
+
// Calculate test duration
|
|
196
|
+
const testDuration = summaryStats?.duration ??
|
|
197
|
+
testResults.reduce((sum, t) => sum + (t.duration || 0), 0);
|
|
198
|
+
// Calculate timespan
|
|
199
|
+
const timespan = calculateTimespan(filteredEntries);
|
|
200
|
+
// Deduplicate errors
|
|
201
|
+
const deduplicatedErrors = deduplicateEntries(errors);
|
|
202
|
+
// Get failed test names
|
|
203
|
+
const failedTests = testResults
|
|
204
|
+
.filter((t) => t.status === "fail")
|
|
205
|
+
.map((t) => ({
|
|
206
|
+
level: "error",
|
|
207
|
+
message: t.name,
|
|
208
|
+
count: 1,
|
|
209
|
+
raw: t.raw,
|
|
210
|
+
context: t.error,
|
|
211
|
+
}));
|
|
212
|
+
// Build statistics
|
|
213
|
+
const statistics = {
|
|
214
|
+
timespan,
|
|
215
|
+
totalLines: lines.length,
|
|
216
|
+
errorCount: failCount,
|
|
217
|
+
warningCount: warnings.length,
|
|
218
|
+
infoCount: allEntries.filter((e) => e.level === "info").length,
|
|
219
|
+
debugCount: allEntries.filter((e) => e.level === "debug").length,
|
|
220
|
+
passCount,
|
|
221
|
+
failCount,
|
|
222
|
+
skipCount,
|
|
223
|
+
testDuration,
|
|
224
|
+
};
|
|
225
|
+
// Build overview
|
|
226
|
+
const overview = buildOverview(statistics, totalTests);
|
|
227
|
+
// Key events: test file results
|
|
228
|
+
const fileResults = lines
|
|
229
|
+
.filter((l) => TEST_PATTERNS.jestFile.test(l))
|
|
230
|
+
.map((l) => parseLogLine(l));
|
|
231
|
+
return {
|
|
232
|
+
logType: "test",
|
|
233
|
+
overview,
|
|
234
|
+
errors: failedTests.length > 0 ? failedTests : deduplicatedErrors.slice(0, MAX_ENTRIES[options.detail].errors),
|
|
235
|
+
warnings: deduplicateEntries(warnings).slice(0, MAX_ENTRIES[options.detail].warnings),
|
|
236
|
+
keyEvents: fileResults.slice(0, MAX_ENTRIES[options.detail].events),
|
|
237
|
+
statistics,
|
|
238
|
+
};
|
|
239
|
+
},
|
|
240
|
+
};
|
|
241
|
+
/**
|
|
242
|
+
* Build overview text
|
|
243
|
+
*/
|
|
244
|
+
function buildOverview(stats, totalTests) {
|
|
245
|
+
const parts = [];
|
|
246
|
+
if (totalTests > 0) {
|
|
247
|
+
const passRate = Math.round(((stats.passCount ?? 0) / totalTests) * 100);
|
|
248
|
+
parts.push(`${totalTests} tests: ${stats.passCount} passed, ${stats.failCount} failed`);
|
|
249
|
+
if (stats.skipCount && stats.skipCount > 0) {
|
|
250
|
+
parts.push(`${stats.skipCount} skipped`);
|
|
251
|
+
}
|
|
252
|
+
parts.push(`(${passRate}% pass rate)`);
|
|
253
|
+
}
|
|
254
|
+
if (stats.testDuration && stats.testDuration > 0) {
|
|
255
|
+
parts.push(`in ${(stats.testDuration / 1000).toFixed(2)}s`);
|
|
256
|
+
}
|
|
257
|
+
return parts.join(" ") || "Test log summary";
|
|
258
|
+
}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Log Summarizer Types
|
|
3
|
+
*
|
|
4
|
+
* Common types and interfaces for log summarization.
|
|
5
|
+
*/
|
|
6
|
+
export type LogType = "server" | "test" | "build" | "application" | "generic";
|
|
7
|
+
export type FocusArea = "errors" | "warnings" | "performance" | "timeline";
|
|
8
|
+
export type DetailLevel = "minimal" | "normal" | "detailed";
|
|
9
|
+
export type LogLevel = "error" | "warning" | "info" | "debug";
|
|
10
|
+
/**
|
|
11
|
+
* A single parsed log entry
|
|
12
|
+
*/
|
|
13
|
+
export interface LogEntry {
|
|
14
|
+
/** Timestamp if present */
|
|
15
|
+
timestamp?: string;
|
|
16
|
+
/** Log level */
|
|
17
|
+
level: LogLevel;
|
|
18
|
+
/** Main message content */
|
|
19
|
+
message: string;
|
|
20
|
+
/** Number of occurrences if deduplicated */
|
|
21
|
+
count: number;
|
|
22
|
+
/** Additional context (stack trace, etc.) */
|
|
23
|
+
context?: string;
|
|
24
|
+
/** Original raw line */
|
|
25
|
+
raw: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* HTTP request entry for server logs
|
|
29
|
+
*/
|
|
30
|
+
export interface HttpRequestEntry {
|
|
31
|
+
timestamp?: string;
|
|
32
|
+
method: string;
|
|
33
|
+
path: string;
|
|
34
|
+
statusCode: number;
|
|
35
|
+
responseTime?: number;
|
|
36
|
+
raw: string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Test result entry for test logs
|
|
40
|
+
*/
|
|
41
|
+
export interface TestResultEntry {
|
|
42
|
+
name: string;
|
|
43
|
+
status: "pass" | "fail" | "skip" | "pending";
|
|
44
|
+
duration?: number;
|
|
45
|
+
error?: string;
|
|
46
|
+
raw: string;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Timespan information
|
|
50
|
+
*/
|
|
51
|
+
export interface Timespan {
|
|
52
|
+
start: string;
|
|
53
|
+
end: string;
|
|
54
|
+
durationMs: number;
|
|
55
|
+
durationFormatted: string;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Statistics extracted from logs
|
|
59
|
+
*/
|
|
60
|
+
export interface LogStatistics {
|
|
61
|
+
/** Time range of logs */
|
|
62
|
+
timespan?: Timespan;
|
|
63
|
+
/** Total lines processed */
|
|
64
|
+
totalLines: number;
|
|
65
|
+
/** Count by log level */
|
|
66
|
+
errorCount: number;
|
|
67
|
+
warningCount: number;
|
|
68
|
+
infoCount: number;
|
|
69
|
+
debugCount: number;
|
|
70
|
+
requestCount?: number;
|
|
71
|
+
avgResponseTime?: number;
|
|
72
|
+
endpoints?: Array<{
|
|
73
|
+
method: string;
|
|
74
|
+
path: string;
|
|
75
|
+
count: number;
|
|
76
|
+
avgTime: number;
|
|
77
|
+
errorCount: number;
|
|
78
|
+
}>;
|
|
79
|
+
statusCodes?: Map<number, number>;
|
|
80
|
+
passCount?: number;
|
|
81
|
+
failCount?: number;
|
|
82
|
+
skipCount?: number;
|
|
83
|
+
testDuration?: number;
|
|
84
|
+
buildDuration?: number;
|
|
85
|
+
compiledFiles?: number;
|
|
86
|
+
bundleSize?: number;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Complete log summary result
|
|
90
|
+
*/
|
|
91
|
+
export interface LogSummary {
|
|
92
|
+
/** Type of log detected/specified */
|
|
93
|
+
logType: LogType;
|
|
94
|
+
/** Brief overview text */
|
|
95
|
+
overview: string;
|
|
96
|
+
/** Error entries (deduplicated) */
|
|
97
|
+
errors: LogEntry[];
|
|
98
|
+
/** Warning entries (deduplicated) */
|
|
99
|
+
warnings: LogEntry[];
|
|
100
|
+
/** Key events timeline */
|
|
101
|
+
keyEvents: LogEntry[];
|
|
102
|
+
/** Computed statistics */
|
|
103
|
+
statistics: LogStatistics;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Options for summarization
|
|
107
|
+
*/
|
|
108
|
+
export interface SummarizeOptions {
|
|
109
|
+
/** Type of log (auto-detected if not provided) */
|
|
110
|
+
logType?: LogType;
|
|
111
|
+
/** Areas to focus on */
|
|
112
|
+
focus?: FocusArea[];
|
|
113
|
+
/** Level of detail */
|
|
114
|
+
detail: DetailLevel;
|
|
115
|
+
/** Time range filter */
|
|
116
|
+
timeframe?: {
|
|
117
|
+
start?: string;
|
|
118
|
+
end?: string;
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Summarizer interface for different log types
|
|
123
|
+
*/
|
|
124
|
+
export interface Summarizer {
|
|
125
|
+
/** Summarizer name */
|
|
126
|
+
name: string;
|
|
127
|
+
/** Log type this summarizer handles */
|
|
128
|
+
logType: LogType;
|
|
129
|
+
/** Check if this summarizer can handle the given logs */
|
|
130
|
+
canSummarize(logs: string): boolean;
|
|
131
|
+
/** Generate summary from logs */
|
|
132
|
+
summarize(logs: string, options: SummarizeOptions): LogSummary;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Detail level thresholds
|
|
136
|
+
*/
|
|
137
|
+
export declare const DETAIL_THRESHOLDS: Record<DetailLevel, number>;
|
|
138
|
+
/**
|
|
139
|
+
* Maximum entries per section by detail level
|
|
140
|
+
*/
|
|
141
|
+
export declare const MAX_ENTRIES: Record<DetailLevel, {
|
|
142
|
+
errors: number;
|
|
143
|
+
warnings: number;
|
|
144
|
+
events: number;
|
|
145
|
+
}>;
|
|
146
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/summarizers/types.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Log Summarizer Types
|
|
3
|
+
*
|
|
4
|
+
* Common types and interfaces for log summarization.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Detail level thresholds
|
|
8
|
+
*/
|
|
9
|
+
export const DETAIL_THRESHOLDS = {
|
|
10
|
+
minimal: 3,
|
|
11
|
+
normal: 5,
|
|
12
|
+
detailed: 10,
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Maximum entries per section by detail level
|
|
16
|
+
*/
|
|
17
|
+
export const MAX_ENTRIES = {
|
|
18
|
+
minimal: { errors: 5, warnings: 3, events: 5 },
|
|
19
|
+
normal: { errors: 10, warnings: 5, events: 10 },
|
|
20
|
+
detailed: { errors: 20, warnings: 10, events: 20 },
|
|
21
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Analyze Build Output Tool
|
|
3
|
+
*
|
|
4
|
+
* Analyzes and compresses build tool outputs (tsc, webpack, eslint, etc.)
|
|
5
|
+
* to dramatically reduce tokens while preserving critical information.
|
|
6
|
+
*/
|
|
7
|
+
import type { ToolDefinition } from "./registry.js";
|
|
8
|
+
export declare const analyzeBuildOutputSchema: {
|
|
9
|
+
type: "object";
|
|
10
|
+
properties: {
|
|
11
|
+
output: {
|
|
12
|
+
type: string;
|
|
13
|
+
};
|
|
14
|
+
buildTool: {
|
|
15
|
+
enum: string[];
|
|
16
|
+
};
|
|
17
|
+
verbosity: {
|
|
18
|
+
enum: string[];
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
required: string[];
|
|
22
|
+
};
|
|
23
|
+
export declare function executeAnalyzeBuildOutput(args: unknown): Promise<{
|
|
24
|
+
content: Array<{
|
|
25
|
+
type: "text";
|
|
26
|
+
text: string;
|
|
27
|
+
}>;
|
|
28
|
+
}>;
|
|
29
|
+
export declare const analyzeBuildOutputTool: ToolDefinition;
|
|
30
|
+
//# sourceMappingURL=analyze-build-output.d.ts.map
|