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,295 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Smart Pipeline Tool
|
|
3
|
+
*
|
|
4
|
+
* Automatically chains compression tools based on detected content type.
|
|
5
|
+
* Executes multiple optimization steps sequentially with result passthrough.
|
|
6
|
+
*/
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
import { countTokens } from "../utils/token-counter.js";
|
|
9
|
+
import { detectContentType } from "../utils/content-detector.js";
|
|
10
|
+
// Import compression functions directly (not tools)
|
|
11
|
+
import { analyzeBuildOutput } from "../parsers/index.js";
|
|
12
|
+
import { groupBySignature, formatGroups } from "../utils/signature-grouper.js";
|
|
13
|
+
import { getSummarizer } from "../summarizers/index.js";
|
|
14
|
+
import { compressContent } from "../compressors/index.js";
|
|
15
|
+
import { compressDiff } from "../compressors/diff.js";
|
|
16
|
+
import { detectPipelineContentType, } from "../pipelines/definitions.js";
|
|
17
|
+
/**
|
|
18
|
+
* JSON Schema for MCP tool registration
|
|
19
|
+
*/
|
|
20
|
+
// Minimal schema - customPipeline/maxSteps rarely used
|
|
21
|
+
export const smartPipelineSchema = {
|
|
22
|
+
type: "object",
|
|
23
|
+
properties: {
|
|
24
|
+
content: { type: "string" },
|
|
25
|
+
mode: { enum: ["auto", "custom"] },
|
|
26
|
+
contentType: { enum: ["build", "logs", "stacktrace", "diff", "config", "code", "generic"] },
|
|
27
|
+
},
|
|
28
|
+
required: ["content"],
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Zod schema for runtime input validation
|
|
32
|
+
*/
|
|
33
|
+
const inputSchema = z.object({
|
|
34
|
+
content: z.string().min(1, "Content is required"),
|
|
35
|
+
mode: z.enum(["auto", "custom"]).optional().default("auto"),
|
|
36
|
+
contentType: z
|
|
37
|
+
.enum(["build", "logs", "stacktrace", "diff", "config", "code", "generic"])
|
|
38
|
+
.optional(),
|
|
39
|
+
customPipeline: z.array(z.string()).optional(),
|
|
40
|
+
maxSteps: z.number().int().positive().optional().default(5),
|
|
41
|
+
});
|
|
42
|
+
// =============================================================================
|
|
43
|
+
// Pipeline Step Functions
|
|
44
|
+
// =============================================================================
|
|
45
|
+
/**
|
|
46
|
+
* Format log summary to string
|
|
47
|
+
*/
|
|
48
|
+
function formatLogSummary(summary) {
|
|
49
|
+
const parts = [];
|
|
50
|
+
parts.push(`## ${summary.overview}`);
|
|
51
|
+
parts.push("");
|
|
52
|
+
if (summary.errors.length > 0) {
|
|
53
|
+
parts.push("### Errors");
|
|
54
|
+
for (const error of summary.errors.slice(0, 10)) {
|
|
55
|
+
const count = error.count > 1 ? ` (x${error.count})` : "";
|
|
56
|
+
parts.push(`- ${error.timestamp || ""} ${error.message}${count}`);
|
|
57
|
+
}
|
|
58
|
+
parts.push("");
|
|
59
|
+
}
|
|
60
|
+
if (summary.warnings.length > 0) {
|
|
61
|
+
parts.push("### Warnings");
|
|
62
|
+
for (const warning of summary.warnings.slice(0, 5)) {
|
|
63
|
+
const count = warning.count > 1 ? ` (x${warning.count})` : "";
|
|
64
|
+
parts.push(`- ${warning.timestamp || ""} ${warning.message}${count}`);
|
|
65
|
+
}
|
|
66
|
+
parts.push("");
|
|
67
|
+
}
|
|
68
|
+
if (summary.keyEvents.length > 0) {
|
|
69
|
+
parts.push("### Key Events");
|
|
70
|
+
for (const event of summary.keyEvents.slice(0, 5)) {
|
|
71
|
+
parts.push(`- ${event.timestamp || ""} ${event.message}`);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return parts.join("\n");
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Step: Analyze build output
|
|
78
|
+
*/
|
|
79
|
+
function stepAnalyzeBuild(content) {
|
|
80
|
+
const result = analyzeBuildOutput(content, { verbosity: "normal" });
|
|
81
|
+
return result.summary;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Step: Deduplicate errors
|
|
85
|
+
*/
|
|
86
|
+
function stepDeduplicate(content) {
|
|
87
|
+
const lines = content.split("\n");
|
|
88
|
+
const result = groupBySignature(lines);
|
|
89
|
+
return formatGroups(result);
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Step: Summarize logs
|
|
93
|
+
*/
|
|
94
|
+
function stepSummarizeLogs(content) {
|
|
95
|
+
const summarizer = getSummarizer(content);
|
|
96
|
+
if (!summarizer) {
|
|
97
|
+
// Fallback to generic compression
|
|
98
|
+
return stepSemanticCompress(content);
|
|
99
|
+
}
|
|
100
|
+
const summary = summarizer.summarize(content, { detail: "normal" });
|
|
101
|
+
return formatLogSummary(summary);
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Step: Compress diff
|
|
105
|
+
*/
|
|
106
|
+
function stepCompressDiff(content) {
|
|
107
|
+
const result = compressDiff(content, { strategy: "hunks-only" });
|
|
108
|
+
return result.compressed;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Step: Semantic compression
|
|
112
|
+
*/
|
|
113
|
+
function stepSemanticCompress(content) {
|
|
114
|
+
const result = compressContent(content, {
|
|
115
|
+
detail: "normal",
|
|
116
|
+
targetRatio: 0.5,
|
|
117
|
+
});
|
|
118
|
+
return result.compressed;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Step: Generic compression
|
|
122
|
+
*/
|
|
123
|
+
function stepGenericCompress(content) {
|
|
124
|
+
const result = compressContent(content, {
|
|
125
|
+
detail: "normal",
|
|
126
|
+
});
|
|
127
|
+
return result.compressed;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Map of step names to functions
|
|
131
|
+
*/
|
|
132
|
+
const STEP_FUNCTIONS = {
|
|
133
|
+
analyze_build_output: stepAnalyzeBuild,
|
|
134
|
+
analyze_build: stepAnalyzeBuild,
|
|
135
|
+
deduplicate_errors: stepDeduplicate,
|
|
136
|
+
deduplicate: stepDeduplicate,
|
|
137
|
+
summarize_logs: stepSummarizeLogs,
|
|
138
|
+
diff_compress: stepCompressDiff,
|
|
139
|
+
compress_diff: stepCompressDiff,
|
|
140
|
+
semantic_compress: stepSemanticCompress,
|
|
141
|
+
compress_context: stepGenericCompress,
|
|
142
|
+
generic: stepGenericCompress,
|
|
143
|
+
};
|
|
144
|
+
/**
|
|
145
|
+
* Map content types to step sequences
|
|
146
|
+
*/
|
|
147
|
+
const TYPE_TO_STEPS = {
|
|
148
|
+
build: ["analyze_build_output", "deduplicate_errors"],
|
|
149
|
+
logs: ["summarize_logs"],
|
|
150
|
+
stacktrace: ["deduplicate_errors", "semantic_compress"],
|
|
151
|
+
diff: ["diff_compress"],
|
|
152
|
+
config: ["compress_context"],
|
|
153
|
+
code: ["semantic_compress"],
|
|
154
|
+
generic: ["semantic_compress"],
|
|
155
|
+
};
|
|
156
|
+
// =============================================================================
|
|
157
|
+
// Pipeline Execution
|
|
158
|
+
// =============================================================================
|
|
159
|
+
/**
|
|
160
|
+
* Execute a pipeline on content
|
|
161
|
+
*/
|
|
162
|
+
function executePipeline(content, steps, maxSteps) {
|
|
163
|
+
let currentContent = content;
|
|
164
|
+
const stepResults = [];
|
|
165
|
+
const stepsToExecute = steps.slice(0, maxSteps);
|
|
166
|
+
for (const stepName of stepsToExecute) {
|
|
167
|
+
const stepFn = STEP_FUNCTIONS[stepName];
|
|
168
|
+
if (!stepFn) {
|
|
169
|
+
console.error(`[smart-pipeline] Unknown step: ${stepName}`);
|
|
170
|
+
continue;
|
|
171
|
+
}
|
|
172
|
+
const inputTokens = countTokens(currentContent);
|
|
173
|
+
try {
|
|
174
|
+
currentContent = stepFn(currentContent);
|
|
175
|
+
}
|
|
176
|
+
catch (error) {
|
|
177
|
+
console.error(`[smart-pipeline] Step ${stepName} failed:`, error);
|
|
178
|
+
// Continue with current content
|
|
179
|
+
continue;
|
|
180
|
+
}
|
|
181
|
+
const outputTokens = countTokens(currentContent);
|
|
182
|
+
const savingsPercent = inputTokens > 0 ? Math.round((1 - outputTokens / inputTokens) * 100) : 0;
|
|
183
|
+
stepResults.push({
|
|
184
|
+
step: stepName,
|
|
185
|
+
inputTokens,
|
|
186
|
+
outputTokens,
|
|
187
|
+
savingsPercent,
|
|
188
|
+
});
|
|
189
|
+
// Stop if no improvement
|
|
190
|
+
if (outputTokens >= inputTokens) {
|
|
191
|
+
break;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
return { finalContent: currentContent, stepResults };
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Format pipeline result - minimal header to save tokens
|
|
198
|
+
*/
|
|
199
|
+
function formatOutput(result) {
|
|
200
|
+
const header = `[pipeline:${result.detectedType}] ${result.totalOriginalTokens}→${result.totalCompressedTokens} tokens (-${result.totalSavingsPercent}%)`;
|
|
201
|
+
return `${header}\n${result.finalContent}`;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Execute the smart pipeline tool
|
|
205
|
+
*/
|
|
206
|
+
export async function executeSmartPipeline(args) {
|
|
207
|
+
// Validate input
|
|
208
|
+
const parseResult = inputSchema.safeParse(args);
|
|
209
|
+
if (!parseResult.success) {
|
|
210
|
+
return {
|
|
211
|
+
content: [
|
|
212
|
+
{
|
|
213
|
+
type: "text",
|
|
214
|
+
text: `Invalid input: ${parseResult.error.errors.map((e) => e.message).join(", ")}`,
|
|
215
|
+
},
|
|
216
|
+
],
|
|
217
|
+
isError: true,
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
const input = parseResult.data;
|
|
221
|
+
// Detect content type
|
|
222
|
+
let detectedType;
|
|
223
|
+
if (input.contentType) {
|
|
224
|
+
detectedType = input.contentType;
|
|
225
|
+
}
|
|
226
|
+
else {
|
|
227
|
+
detectedType = detectPipelineContentType(input.content);
|
|
228
|
+
// Fall back to standard detection if no specific type found
|
|
229
|
+
if (detectedType === "generic") {
|
|
230
|
+
const standardType = detectContentType(input.content);
|
|
231
|
+
if (standardType !== "generic") {
|
|
232
|
+
detectedType = standardType;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
// Determine pipeline steps
|
|
237
|
+
let steps;
|
|
238
|
+
if (input.mode === "custom" && input.customPipeline) {
|
|
239
|
+
steps = input.customPipeline;
|
|
240
|
+
}
|
|
241
|
+
else {
|
|
242
|
+
steps = TYPE_TO_STEPS[detectedType] ?? TYPE_TO_STEPS.generic;
|
|
243
|
+
}
|
|
244
|
+
// Validate custom pipeline steps
|
|
245
|
+
if (input.mode === "custom" && input.customPipeline) {
|
|
246
|
+
const invalidSteps = input.customPipeline.filter((s) => !STEP_FUNCTIONS[s]);
|
|
247
|
+
if (invalidSteps.length > 0) {
|
|
248
|
+
return {
|
|
249
|
+
content: [
|
|
250
|
+
{
|
|
251
|
+
type: "text",
|
|
252
|
+
text: `Invalid pipeline steps: ${invalidSteps.join(", ")}. Available: ${Object.keys(STEP_FUNCTIONS).join(", ")}`,
|
|
253
|
+
},
|
|
254
|
+
],
|
|
255
|
+
isError: true,
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
// Execute pipeline
|
|
260
|
+
const originalTokens = countTokens(input.content);
|
|
261
|
+
const { finalContent, stepResults } = executePipeline(input.content, steps, input.maxSteps);
|
|
262
|
+
const finalTokens = countTokens(finalContent);
|
|
263
|
+
// Build result
|
|
264
|
+
const result = {
|
|
265
|
+
finalContent,
|
|
266
|
+
detectedType,
|
|
267
|
+
steps: stepResults,
|
|
268
|
+
totalOriginalTokens: originalTokens,
|
|
269
|
+
totalCompressedTokens: finalTokens,
|
|
270
|
+
totalSavingsPercent: originalTokens > 0
|
|
271
|
+
? Math.round((1 - finalTokens / originalTokens) * 100)
|
|
272
|
+
: 0,
|
|
273
|
+
};
|
|
274
|
+
// Update session state
|
|
275
|
+
const tokensSaved = originalTokens - finalTokens;
|
|
276
|
+
if (tokensSaved > 0) {
|
|
277
|
+
}
|
|
278
|
+
return {
|
|
279
|
+
content: [
|
|
280
|
+
{
|
|
281
|
+
type: "text",
|
|
282
|
+
text: formatOutput(result),
|
|
283
|
+
},
|
|
284
|
+
],
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Tool definition for MCP registration
|
|
289
|
+
*/
|
|
290
|
+
export const smartPipelineTool = {
|
|
291
|
+
name: "smart_pipeline",
|
|
292
|
+
description: "Chain compression tools. Auto-detects content type.",
|
|
293
|
+
inputSchema: smartPipelineSchema,
|
|
294
|
+
execute: executeSmartPipeline,
|
|
295
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Summarize Logs Tool
|
|
3
|
+
*
|
|
4
|
+
* Intelligently summarizes verbose logs, extracting errors, warnings,
|
|
5
|
+
* key events, and statistics.
|
|
6
|
+
*/
|
|
7
|
+
import type { ToolDefinition } from "./registry.js";
|
|
8
|
+
export declare const summarizeLogsSchema: {
|
|
9
|
+
type: "object";
|
|
10
|
+
properties: {
|
|
11
|
+
logs: {
|
|
12
|
+
type: string;
|
|
13
|
+
};
|
|
14
|
+
logType: {
|
|
15
|
+
enum: string[];
|
|
16
|
+
};
|
|
17
|
+
focus: {
|
|
18
|
+
type: string;
|
|
19
|
+
items: {
|
|
20
|
+
enum: string[];
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
detail: {
|
|
24
|
+
enum: string[];
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
required: string[];
|
|
28
|
+
};
|
|
29
|
+
export declare function executeSummarizeLogs(args: unknown): Promise<{
|
|
30
|
+
content: Array<{
|
|
31
|
+
type: "text";
|
|
32
|
+
text: string;
|
|
33
|
+
}>;
|
|
34
|
+
}>;
|
|
35
|
+
export declare const summarizeLogsTool: ToolDefinition;
|
|
36
|
+
//# sourceMappingURL=summarize-logs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"summarize-logs.d.ts","sourceRoot":"","sources":["../../src/tools/summarize-logs.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAapD,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;CAS/B,CAAC;AAmBF,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,OAAO,GACZ,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CAkC7D;AAwID,eAAO,MAAM,iBAAiB,EAAE,cAM/B,CAAC"}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Summarize Logs Tool
|
|
3
|
+
*
|
|
4
|
+
* Intelligently summarizes verbose logs, extracting errors, warnings,
|
|
5
|
+
* key events, and statistics.
|
|
6
|
+
*/
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
import { getSummarizer, MAX_ENTRIES, } from "../summarizers/index.js";
|
|
9
|
+
import { detectLogType } from "../utils/log-parser.js";
|
|
10
|
+
// Minimal schema - timeframe rarely used
|
|
11
|
+
export const summarizeLogsSchema = {
|
|
12
|
+
type: "object",
|
|
13
|
+
properties: {
|
|
14
|
+
logs: { type: "string" },
|
|
15
|
+
logType: { enum: ["server", "test", "build", "application", "generic"] },
|
|
16
|
+
focus: { type: "array", items: { enum: ["errors", "warnings", "performance", "timeline"] } },
|
|
17
|
+
detail: { enum: ["minimal", "normal", "detailed"] },
|
|
18
|
+
},
|
|
19
|
+
required: ["logs"],
|
|
20
|
+
};
|
|
21
|
+
const inputSchema = z.object({
|
|
22
|
+
logs: z.string(),
|
|
23
|
+
logType: z
|
|
24
|
+
.enum(["server", "test", "build", "application", "generic"])
|
|
25
|
+
.optional(),
|
|
26
|
+
focus: z
|
|
27
|
+
.array(z.enum(["errors", "warnings", "performance", "timeline"]))
|
|
28
|
+
.optional(),
|
|
29
|
+
detail: z.enum(["minimal", "normal", "detailed"]).optional().default("normal"),
|
|
30
|
+
timeframe: z
|
|
31
|
+
.object({
|
|
32
|
+
start: z.string().optional(),
|
|
33
|
+
end: z.string().optional(),
|
|
34
|
+
})
|
|
35
|
+
.optional(),
|
|
36
|
+
});
|
|
37
|
+
export async function executeSummarizeLogs(args) {
|
|
38
|
+
const input = inputSchema.parse(args);
|
|
39
|
+
// Detect log type if not provided
|
|
40
|
+
const detectedType = input.logType || detectLogType(input.logs);
|
|
41
|
+
// Get appropriate summarizer
|
|
42
|
+
const summarizer = getSummarizer(input.logs, detectedType);
|
|
43
|
+
// Build options
|
|
44
|
+
const options = {
|
|
45
|
+
logType: detectedType,
|
|
46
|
+
focus: input.focus,
|
|
47
|
+
detail: input.detail,
|
|
48
|
+
timeframe: input.timeframe,
|
|
49
|
+
};
|
|
50
|
+
// Generate summary
|
|
51
|
+
const summary = summarizer.summarize(input.logs, options);
|
|
52
|
+
// Format output
|
|
53
|
+
const output = formatSummary(summary, options);
|
|
54
|
+
// Calculate token savings
|
|
55
|
+
const originalTokens = Math.ceil(input.logs.length / 4);
|
|
56
|
+
const outputTokens = Math.ceil(output.length / 4);
|
|
57
|
+
const reductionPercent = originalTokens > 0 ? Math.round((1 - outputTokens / originalTokens) * 100) : 0;
|
|
58
|
+
// Minimal header
|
|
59
|
+
const header = `[logs] ${originalTokens}→${outputTokens} tokens (-${reductionPercent}%)`;
|
|
60
|
+
return {
|
|
61
|
+
content: [{ type: "text", text: `${header}\n${output}` }],
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Format the summary as markdown
|
|
66
|
+
*/
|
|
67
|
+
function formatSummary(summary, options) {
|
|
68
|
+
const parts = [];
|
|
69
|
+
const focus = options.focus || ["errors", "warnings", "timeline"];
|
|
70
|
+
// Header
|
|
71
|
+
parts.push(`## Log Summary (${summary.logType})\n`);
|
|
72
|
+
parts.push(`**${summary.overview}**\n`);
|
|
73
|
+
// Errors section
|
|
74
|
+
if (focus.includes("errors") && summary.errors.length > 0) {
|
|
75
|
+
parts.push("---");
|
|
76
|
+
parts.push(`### Errors (${summary.statistics.errorCount})\n`);
|
|
77
|
+
if (summary.errors.length <= 5) {
|
|
78
|
+
for (const error of summary.errors) {
|
|
79
|
+
const prefix = error.timestamp ? `${error.timestamp} - ` : "";
|
|
80
|
+
const suffix = error.count > 1 ? ` (×${error.count})` : "";
|
|
81
|
+
parts.push(`- ${prefix}${error.message}${suffix}`);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
parts.push("| Time | Message | Count |");
|
|
86
|
+
parts.push("|------|---------|-------|");
|
|
87
|
+
for (const error of summary.errors.slice(0, MAX_ENTRIES[options.detail].errors)) {
|
|
88
|
+
const time = error.timestamp || "-";
|
|
89
|
+
const msg = truncate(error.message, 60);
|
|
90
|
+
parts.push(`| ${time} | ${msg} | ${error.count} |`);
|
|
91
|
+
}
|
|
92
|
+
if (summary.errors.length > MAX_ENTRIES[options.detail].errors) {
|
|
93
|
+
parts.push(`\n*...and ${summary.errors.length - MAX_ENTRIES[options.detail].errors} more errors*`);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
parts.push("");
|
|
97
|
+
}
|
|
98
|
+
// Warnings section
|
|
99
|
+
if (focus.includes("warnings") && summary.warnings.length > 0) {
|
|
100
|
+
parts.push("---");
|
|
101
|
+
parts.push(`### Warnings (${summary.statistics.warningCount})\n`);
|
|
102
|
+
for (const warning of summary.warnings.slice(0, MAX_ENTRIES[options.detail].warnings)) {
|
|
103
|
+
const prefix = warning.timestamp ? `${warning.timestamp} - ` : "";
|
|
104
|
+
const suffix = warning.count > 1 ? ` (×${warning.count})` : "";
|
|
105
|
+
parts.push(`- ${prefix}${warning.message}${suffix}`);
|
|
106
|
+
}
|
|
107
|
+
if (summary.warnings.length > MAX_ENTRIES[options.detail].warnings) {
|
|
108
|
+
parts.push(`\n*...and ${summary.warnings.length - MAX_ENTRIES[options.detail].warnings} more warnings*`);
|
|
109
|
+
}
|
|
110
|
+
parts.push("");
|
|
111
|
+
}
|
|
112
|
+
// Timeline / Key Events
|
|
113
|
+
if (focus.includes("timeline") && summary.keyEvents.length > 0) {
|
|
114
|
+
parts.push("---");
|
|
115
|
+
parts.push("### Key Events\n");
|
|
116
|
+
let eventNum = 1;
|
|
117
|
+
for (const event of summary.keyEvents.slice(0, MAX_ENTRIES[options.detail].events)) {
|
|
118
|
+
const time = event.timestamp || "";
|
|
119
|
+
parts.push(`${eventNum}. ${time ? `${time} - ` : ""}${event.message}`);
|
|
120
|
+
eventNum++;
|
|
121
|
+
}
|
|
122
|
+
parts.push("");
|
|
123
|
+
}
|
|
124
|
+
// Performance / Statistics
|
|
125
|
+
if (focus.includes("performance") || summary.logType === "server") {
|
|
126
|
+
parts.push("---");
|
|
127
|
+
parts.push("### Statistics\n");
|
|
128
|
+
const stats = summary.statistics;
|
|
129
|
+
if (stats.timespan) {
|
|
130
|
+
parts.push(`- **Duration:** ${stats.timespan.durationFormatted}`);
|
|
131
|
+
}
|
|
132
|
+
// Server-specific stats
|
|
133
|
+
if (stats.requestCount !== undefined) {
|
|
134
|
+
parts.push(`- **Total requests:** ${stats.requestCount.toLocaleString()}`);
|
|
135
|
+
}
|
|
136
|
+
if (stats.avgResponseTime !== undefined && stats.avgResponseTime > 0) {
|
|
137
|
+
parts.push(`- **Avg response time:** ${stats.avgResponseTime}ms`);
|
|
138
|
+
}
|
|
139
|
+
if (stats.endpoints && stats.endpoints.length > 0) {
|
|
140
|
+
parts.push("\n**Top Endpoints:**");
|
|
141
|
+
parts.push("| Endpoint | Requests | Avg Time |");
|
|
142
|
+
parts.push("|----------|----------|----------|");
|
|
143
|
+
for (const ep of stats.endpoints.slice(0, 5)) {
|
|
144
|
+
parts.push(`| ${ep.method} ${ep.path} | ${ep.count} | ${ep.avgTime}ms |`);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
// Test-specific stats
|
|
148
|
+
if (stats.passCount !== undefined) {
|
|
149
|
+
const total = (stats.passCount || 0) + (stats.failCount || 0) + (stats.skipCount || 0);
|
|
150
|
+
const passRate = total > 0 ? Math.round(((stats.passCount || 0) / total) * 100) : 0;
|
|
151
|
+
parts.push(`- **Tests:** ${stats.passCount} passed, ${stats.failCount} failed`);
|
|
152
|
+
if (stats.skipCount) {
|
|
153
|
+
parts.push(`- **Skipped:** ${stats.skipCount}`);
|
|
154
|
+
}
|
|
155
|
+
parts.push(`- **Pass rate:** ${passRate}%`);
|
|
156
|
+
}
|
|
157
|
+
if (stats.testDuration) {
|
|
158
|
+
parts.push(`- **Test duration:** ${(stats.testDuration / 1000).toFixed(2)}s`);
|
|
159
|
+
}
|
|
160
|
+
// Build-specific stats
|
|
161
|
+
if (stats.buildDuration) {
|
|
162
|
+
parts.push(`- **Build time:** ${(stats.buildDuration / 1000).toFixed(2)}s`);
|
|
163
|
+
}
|
|
164
|
+
if (stats.bundleSize) {
|
|
165
|
+
parts.push(`- **Bundle size:** ${(stats.bundleSize / 1024).toFixed(1)} KB`);
|
|
166
|
+
}
|
|
167
|
+
parts.push("");
|
|
168
|
+
}
|
|
169
|
+
return parts.join("\n");
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Truncate a string to a maximum length
|
|
173
|
+
*/
|
|
174
|
+
function truncate(str, maxLen) {
|
|
175
|
+
if (str.length <= maxLen)
|
|
176
|
+
return str;
|
|
177
|
+
return str.slice(0, maxLen - 3) + "...";
|
|
178
|
+
}
|
|
179
|
+
export const summarizeLogsTool = {
|
|
180
|
+
name: "summarize_logs",
|
|
181
|
+
description: "Summarize logs. Extracts errors, warnings, key events. Auto-detects log type.",
|
|
182
|
+
inputSchema: summarizeLogsSchema,
|
|
183
|
+
execute: executeSummarizeLogs,
|
|
184
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Token Budget Tests
|
|
3
|
+
*
|
|
4
|
+
* Ensures tool definitions stay within token budgets to prevent
|
|
5
|
+
* context window bloat from MCP tool descriptions.
|
|
6
|
+
*
|
|
7
|
+
* These tests guard against regression - any change that increases
|
|
8
|
+
* token consumption will fail the test.
|
|
9
|
+
*/
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=token-budget.test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"token-budget.test.d.ts","sourceRoot":"","sources":["../../src/tools/token-budget.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG"}
|