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,472 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TOON Serializer for MCP Tools
|
|
3
|
+
*
|
|
4
|
+
* Converts MCP tool definitions to TOON (Token-Oriented Object Notation)
|
|
5
|
+
* format for ~40% token reduction when presenting tools to LLMs.
|
|
6
|
+
*
|
|
7
|
+
* TOON spec: https://toonformat.dev/
|
|
8
|
+
*/
|
|
9
|
+
import { countTokens } from "./token-counter.js";
|
|
10
|
+
/**
|
|
11
|
+
* Extract parameter info from JSON Schema
|
|
12
|
+
*/
|
|
13
|
+
function extractParams(schema) {
|
|
14
|
+
const params = [];
|
|
15
|
+
const properties = schema.properties;
|
|
16
|
+
const required = schema.required || [];
|
|
17
|
+
if (!properties)
|
|
18
|
+
return params;
|
|
19
|
+
for (const [name, prop] of Object.entries(properties)) {
|
|
20
|
+
const info = {
|
|
21
|
+
name,
|
|
22
|
+
type: inferType(prop),
|
|
23
|
+
required: required.includes(name),
|
|
24
|
+
};
|
|
25
|
+
if (prop.enum) {
|
|
26
|
+
info.enumValues = prop.enum;
|
|
27
|
+
}
|
|
28
|
+
params.push(info);
|
|
29
|
+
}
|
|
30
|
+
return params;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Infer a compact type string from JSON Schema property
|
|
34
|
+
*/
|
|
35
|
+
function inferType(prop) {
|
|
36
|
+
if (prop.enum) {
|
|
37
|
+
const values = prop.enum;
|
|
38
|
+
if (values.length <= 4) {
|
|
39
|
+
return values.join("|");
|
|
40
|
+
}
|
|
41
|
+
return `${values.slice(0, 3).join("|")}|...`;
|
|
42
|
+
}
|
|
43
|
+
if (prop.type === "string")
|
|
44
|
+
return "str";
|
|
45
|
+
if (prop.type === "boolean")
|
|
46
|
+
return "bool";
|
|
47
|
+
if (prop.type === "number" || prop.type === "integer")
|
|
48
|
+
return "num";
|
|
49
|
+
if (prop.type === "array")
|
|
50
|
+
return "arr";
|
|
51
|
+
if (prop.properties) {
|
|
52
|
+
// Nested object - extract key names
|
|
53
|
+
const keys = Object.keys(prop.properties);
|
|
54
|
+
if (keys.length <= 3) {
|
|
55
|
+
return `{${keys.join(",")}}`;
|
|
56
|
+
}
|
|
57
|
+
return `{${keys.slice(0, 2).join(",")},...}`;
|
|
58
|
+
}
|
|
59
|
+
if (prop.type === "object")
|
|
60
|
+
return "obj";
|
|
61
|
+
return "any";
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Format parameters in TOON style
|
|
65
|
+
*/
|
|
66
|
+
function formatParams(params) {
|
|
67
|
+
if (params.length === 0)
|
|
68
|
+
return "";
|
|
69
|
+
const parts = [];
|
|
70
|
+
for (const p of params) {
|
|
71
|
+
const optional = p.required ? "" : "?";
|
|
72
|
+
const type = p.type !== "str" ? `:${p.type}` : "";
|
|
73
|
+
parts.push(`${p.name}${optional}${type}`);
|
|
74
|
+
}
|
|
75
|
+
return parts.join(" ");
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Serialize a single tool to TOON format
|
|
79
|
+
*/
|
|
80
|
+
function serializeTool(tool, indent = " ") {
|
|
81
|
+
const params = extractParams(tool.inputSchema);
|
|
82
|
+
const paramStr = formatParams(params);
|
|
83
|
+
// Truncate description to save tokens
|
|
84
|
+
const desc = tool.description.length > 60
|
|
85
|
+
? tool.description.slice(0, 57) + "..."
|
|
86
|
+
: tool.description;
|
|
87
|
+
if (paramStr) {
|
|
88
|
+
return `${indent}${tool.name}(${paramStr}) → ${desc}`;
|
|
89
|
+
}
|
|
90
|
+
return `${indent}${tool.name}() → ${desc}`;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Serialize tools to TOON format
|
|
94
|
+
*
|
|
95
|
+
* Output format:
|
|
96
|
+
* ```
|
|
97
|
+
* tools[N]:
|
|
98
|
+
* tool_name(param1 param2?:type) → Description
|
|
99
|
+
* ...
|
|
100
|
+
* ```
|
|
101
|
+
*/
|
|
102
|
+
export function serializeToolsToToon(tools, options = {}) {
|
|
103
|
+
const { groupByCategory = false, categories } = options;
|
|
104
|
+
const lines = [];
|
|
105
|
+
if (groupByCategory && categories) {
|
|
106
|
+
// Group tools by category
|
|
107
|
+
const byCategory = new Map();
|
|
108
|
+
for (const tool of tools) {
|
|
109
|
+
const cat = categories.get(tool.name) || "other";
|
|
110
|
+
if (!byCategory.has(cat)) {
|
|
111
|
+
byCategory.set(cat, []);
|
|
112
|
+
}
|
|
113
|
+
byCategory.get(cat).push(tool);
|
|
114
|
+
}
|
|
115
|
+
for (const [cat, catTools] of byCategory) {
|
|
116
|
+
lines.push(`${cat}[${catTools.length}]:`);
|
|
117
|
+
for (const tool of catTools) {
|
|
118
|
+
lines.push(serializeTool(tool));
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
// Flat list
|
|
124
|
+
lines.push(`tools[${tools.length}]:`);
|
|
125
|
+
for (const tool of tools) {
|
|
126
|
+
lines.push(serializeTool(tool));
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
return lines.join("\n");
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Escape commas in TOON tabular values
|
|
133
|
+
*/
|
|
134
|
+
function escapeTabularValue(value) {
|
|
135
|
+
// If value contains comma, wrap in quotes (TOON spec)
|
|
136
|
+
if (value.includes(",")) {
|
|
137
|
+
return `"${value.replace(/"/g, '""')}"`;
|
|
138
|
+
}
|
|
139
|
+
return value;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Serialize tools to tabular TOON format (most compact)
|
|
143
|
+
*
|
|
144
|
+
* Output format:
|
|
145
|
+
* ```
|
|
146
|
+
* tools[N]{name,params,desc}:
|
|
147
|
+
* auto_optimize,content hint?:enum agg?:bool,Auto-compress 80-95%
|
|
148
|
+
* ...
|
|
149
|
+
* ```
|
|
150
|
+
*/
|
|
151
|
+
export function serializeToolsToToonTabular(tools) {
|
|
152
|
+
const lines = [];
|
|
153
|
+
lines.push(`tools[${tools.length}]{name,params,desc}:`);
|
|
154
|
+
for (const tool of tools) {
|
|
155
|
+
const params = extractParams(tool.inputSchema);
|
|
156
|
+
const paramStr = formatParams(params);
|
|
157
|
+
// Truncate and escape description for tabular format
|
|
158
|
+
let desc = tool.description.length > 50
|
|
159
|
+
? tool.description.slice(0, 47) + "..."
|
|
160
|
+
: tool.description;
|
|
161
|
+
desc = escapeTabularValue(desc);
|
|
162
|
+
lines.push(` ${tool.name},${paramStr || "-"},${desc}`);
|
|
163
|
+
}
|
|
164
|
+
return lines.join("\n");
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Compare token counts between JSON and TOON
|
|
168
|
+
*/
|
|
169
|
+
export function compareTokens(tools) {
|
|
170
|
+
const jsonStr = JSON.stringify(tools.map((t) => ({
|
|
171
|
+
name: t.name,
|
|
172
|
+
description: t.description,
|
|
173
|
+
inputSchema: t.inputSchema,
|
|
174
|
+
})));
|
|
175
|
+
const toonStr = serializeToolsToToon(tools);
|
|
176
|
+
const toonTabularStr = serializeToolsToToonTabular(tools);
|
|
177
|
+
const jsonTokens = countTokens(jsonStr);
|
|
178
|
+
const toonTokens = countTokens(toonStr);
|
|
179
|
+
const toonTabularTokens = countTokens(toonTabularStr);
|
|
180
|
+
const bestToon = Math.min(toonTokens, toonTabularTokens);
|
|
181
|
+
const savings = Math.round((1 - bestToon / jsonTokens) * 100);
|
|
182
|
+
return {
|
|
183
|
+
json: jsonTokens,
|
|
184
|
+
toon: toonTokens,
|
|
185
|
+
toonTabular: toonTabularTokens,
|
|
186
|
+
savings,
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Serialize tool metadata to lightweight TOON format (no schema loading)
|
|
191
|
+
*
|
|
192
|
+
* Used for lazy loading - shows available tools without loading full definitions.
|
|
193
|
+
* Output format:
|
|
194
|
+
* ```
|
|
195
|
+
* tools[N]:
|
|
196
|
+
* tool_name → Description [keywords]
|
|
197
|
+
* ...
|
|
198
|
+
* ```
|
|
199
|
+
*/
|
|
200
|
+
export function serializeMetadataToToon(metadata, options = {}) {
|
|
201
|
+
const { groupByCategory = true } = options;
|
|
202
|
+
const lines = [];
|
|
203
|
+
if (groupByCategory) {
|
|
204
|
+
const byCategory = new Map();
|
|
205
|
+
for (const tool of metadata) {
|
|
206
|
+
const cat = tool.category;
|
|
207
|
+
if (!byCategory.has(cat)) {
|
|
208
|
+
byCategory.set(cat, []);
|
|
209
|
+
}
|
|
210
|
+
byCategory.get(cat).push(tool);
|
|
211
|
+
}
|
|
212
|
+
for (const [cat, catTools] of byCategory) {
|
|
213
|
+
lines.push(`${cat}[${catTools.length}]:`);
|
|
214
|
+
for (const tool of catTools) {
|
|
215
|
+
const desc = tool.description.length > 50
|
|
216
|
+
? tool.description.slice(0, 47) + "..."
|
|
217
|
+
: tool.description;
|
|
218
|
+
lines.push(` ${tool.name} → ${desc}`);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
else {
|
|
223
|
+
lines.push(`tools[${metadata.length}]:`);
|
|
224
|
+
for (const tool of metadata) {
|
|
225
|
+
const desc = tool.description.length > 50
|
|
226
|
+
? tool.description.slice(0, 47) + "..."
|
|
227
|
+
: tool.description;
|
|
228
|
+
lines.push(` ${tool.name} → ${desc}`);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
return lines.join("\n");
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Serialize tool metadata to lightweight tabular TOON format
|
|
235
|
+
*/
|
|
236
|
+
export function serializeMetadataToToonTabular(metadata) {
|
|
237
|
+
const lines = [];
|
|
238
|
+
lines.push(`tools[${metadata.length}]{name,desc}:`);
|
|
239
|
+
for (const tool of metadata) {
|
|
240
|
+
let desc = tool.description.length > 50
|
|
241
|
+
? tool.description.slice(0, 47) + "..."
|
|
242
|
+
: tool.description;
|
|
243
|
+
// Escape commas
|
|
244
|
+
if (desc.includes(",")) {
|
|
245
|
+
desc = `"${desc.replace(/"/g, '""')}"`;
|
|
246
|
+
}
|
|
247
|
+
lines.push(` ${tool.name},${desc}`);
|
|
248
|
+
}
|
|
249
|
+
return lines.join("\n");
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Serialize any result to TOON format
|
|
253
|
+
*
|
|
254
|
+
* Converts objects, arrays, and primitives to compact TOON notation.
|
|
255
|
+
*
|
|
256
|
+
* Output formats:
|
|
257
|
+
* - Object: `name{field1,field2}: value1, value2`
|
|
258
|
+
* - Array: `items[N]: item1, item2, ...`
|
|
259
|
+
* - Stats: `stats: original→compressed (-X%)`
|
|
260
|
+
*/
|
|
261
|
+
export function serializeResultToToon(result, schema, options = {}) {
|
|
262
|
+
const { verbosity = "normal", includeStats = true, maxValueLength = verbosity === "minimal" ? 50 : verbosity === "normal" ? 100 : 200, } = options;
|
|
263
|
+
const lines = [];
|
|
264
|
+
if (result === null || result === undefined) {
|
|
265
|
+
return `${schema.name}: (empty)`;
|
|
266
|
+
}
|
|
267
|
+
if (Array.isArray(result)) {
|
|
268
|
+
return serializeArrayToToon(result, schema.name, maxValueLength, verbosity);
|
|
269
|
+
}
|
|
270
|
+
if (typeof result === "object") {
|
|
271
|
+
return serializeObjectToToon(result, schema, maxValueLength, verbosity, includeStats);
|
|
272
|
+
}
|
|
273
|
+
// Primitive value
|
|
274
|
+
return `${schema.name}: ${truncateValue(String(result), maxValueLength)}`;
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* Serialize array to TOON format
|
|
278
|
+
*/
|
|
279
|
+
function serializeArrayToToon(arr, name, maxValueLength, verbosity) {
|
|
280
|
+
const lines = [];
|
|
281
|
+
const maxItems = verbosity === "minimal" ? 5 : verbosity === "normal" ? 15 : 50;
|
|
282
|
+
lines.push(`${name}[${arr.length}]:`);
|
|
283
|
+
const items = arr.slice(0, maxItems);
|
|
284
|
+
for (const item of items) {
|
|
285
|
+
if (typeof item === "object" && item !== null) {
|
|
286
|
+
// Compact object representation
|
|
287
|
+
const obj = item;
|
|
288
|
+
const keys = Object.keys(obj).slice(0, 4);
|
|
289
|
+
const values = keys.map((k) => `${k}:${formatCompactValue(obj[k], maxValueLength)}`);
|
|
290
|
+
lines.push(` ${values.join(" ")}`);
|
|
291
|
+
}
|
|
292
|
+
else {
|
|
293
|
+
lines.push(` ${truncateValue(String(item), maxValueLength)}`);
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
if (arr.length > maxItems) {
|
|
297
|
+
lines.push(` ... +${arr.length - maxItems} more`);
|
|
298
|
+
}
|
|
299
|
+
return lines.join("\n");
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* Serialize object to TOON format
|
|
303
|
+
*/
|
|
304
|
+
function serializeObjectToToon(obj, schema, maxValueLength, verbosity, includeStats) {
|
|
305
|
+
const lines = [];
|
|
306
|
+
// Determine fields to include
|
|
307
|
+
const fields = schema.fields || Object.keys(obj);
|
|
308
|
+
// Check for stats object
|
|
309
|
+
const hasStats = includeStats && "stats" in obj && typeof obj.stats === "object";
|
|
310
|
+
// Format header with stats if present
|
|
311
|
+
if (hasStats) {
|
|
312
|
+
const stats = obj.stats;
|
|
313
|
+
const statsLine = formatStatsLine(stats);
|
|
314
|
+
if (statsLine) {
|
|
315
|
+
lines.push(`[${schema.name}] ${statsLine}`);
|
|
316
|
+
}
|
|
317
|
+
else {
|
|
318
|
+
lines.push(`[${schema.name}]`);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
else {
|
|
322
|
+
lines.push(`[${schema.name}]`);
|
|
323
|
+
}
|
|
324
|
+
// Serialize each field
|
|
325
|
+
for (const field of fields) {
|
|
326
|
+
if (field === "stats" && hasStats)
|
|
327
|
+
continue; // Already shown in header
|
|
328
|
+
if (!(field in obj))
|
|
329
|
+
continue;
|
|
330
|
+
const value = obj[field];
|
|
331
|
+
const formatted = formatFieldValue(field, value, maxValueLength, verbosity);
|
|
332
|
+
if (formatted) {
|
|
333
|
+
lines.push(formatted);
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
return lines.join("\n");
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* Format statistics line for header
|
|
340
|
+
*/
|
|
341
|
+
function formatStatsLine(stats) {
|
|
342
|
+
const parts = [];
|
|
343
|
+
// Token reduction stats
|
|
344
|
+
if ("original" in stats && "compressed" in stats) {
|
|
345
|
+
const original = stats.original;
|
|
346
|
+
const compressed = stats.compressed;
|
|
347
|
+
const percent = "reductionPercent" in stats
|
|
348
|
+
? stats.reductionPercent
|
|
349
|
+
: Math.round((1 - compressed / original) * 100);
|
|
350
|
+
parts.push(`${original}→${compressed} tokens (-${percent}%)`);
|
|
351
|
+
}
|
|
352
|
+
// Other common stats
|
|
353
|
+
if ("filesProcessed" in stats) {
|
|
354
|
+
parts.push(`${stats.filesProcessed} files`);
|
|
355
|
+
}
|
|
356
|
+
if ("executionTimeMs" in stats) {
|
|
357
|
+
parts.push(`${stats.executionTimeMs}ms`);
|
|
358
|
+
}
|
|
359
|
+
return parts.join(", ");
|
|
360
|
+
}
|
|
361
|
+
/**
|
|
362
|
+
* Format a single field value
|
|
363
|
+
*/
|
|
364
|
+
function formatFieldValue(field, value, maxValueLength, verbosity) {
|
|
365
|
+
if (value === null || value === undefined)
|
|
366
|
+
return null;
|
|
367
|
+
if (Array.isArray(value)) {
|
|
368
|
+
if (value.length === 0)
|
|
369
|
+
return null;
|
|
370
|
+
const maxItems = verbosity === "minimal" ? 3 : verbosity === "normal" ? 5 : 10;
|
|
371
|
+
const items = value.slice(0, maxItems).map((v) => formatCompactValue(v, maxValueLength / 2));
|
|
372
|
+
const suffix = value.length > maxItems ? ` +${value.length - maxItems}` : "";
|
|
373
|
+
return `${field}[${value.length}]: ${items.join(", ")}${suffix}`;
|
|
374
|
+
}
|
|
375
|
+
if (typeof value === "object") {
|
|
376
|
+
const obj = value;
|
|
377
|
+
const keys = Object.keys(obj).slice(0, 3);
|
|
378
|
+
const vals = keys.map((k) => `${k}:${formatCompactValue(obj[k], 30)}`);
|
|
379
|
+
return `${field}: {${vals.join(", ")}}`;
|
|
380
|
+
}
|
|
381
|
+
if (typeof value === "string" && value.length > maxValueLength) {
|
|
382
|
+
return `${field}: ${truncateValue(value, maxValueLength)}`;
|
|
383
|
+
}
|
|
384
|
+
return `${field}: ${value}`;
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* Format value compactly for inline display
|
|
388
|
+
*/
|
|
389
|
+
function formatCompactValue(value, maxLen) {
|
|
390
|
+
if (value === null || value === undefined)
|
|
391
|
+
return "-";
|
|
392
|
+
if (typeof value === "string")
|
|
393
|
+
return truncateValue(value, maxLen);
|
|
394
|
+
if (typeof value === "number")
|
|
395
|
+
return String(value);
|
|
396
|
+
if (typeof value === "boolean")
|
|
397
|
+
return value ? "T" : "F";
|
|
398
|
+
if (Array.isArray(value))
|
|
399
|
+
return `[${value.length}]`;
|
|
400
|
+
if (typeof value === "object")
|
|
401
|
+
return `{...}`;
|
|
402
|
+
return String(value);
|
|
403
|
+
}
|
|
404
|
+
/**
|
|
405
|
+
* Truncate string value
|
|
406
|
+
*/
|
|
407
|
+
function truncateValue(value, maxLen) {
|
|
408
|
+
if (value.length <= maxLen)
|
|
409
|
+
return value;
|
|
410
|
+
return value.slice(0, maxLen - 3) + "...";
|
|
411
|
+
}
|
|
412
|
+
/**
|
|
413
|
+
* Serialize result to tabular TOON format (most compact)
|
|
414
|
+
*/
|
|
415
|
+
export function serializeResultToToonTabular(result, schema) {
|
|
416
|
+
if (result === null || result === undefined) {
|
|
417
|
+
return `${schema.name}: -`;
|
|
418
|
+
}
|
|
419
|
+
if (Array.isArray(result)) {
|
|
420
|
+
const lines = [];
|
|
421
|
+
const fields = result.length > 0 && typeof result[0] === "object"
|
|
422
|
+
? Object.keys(result[0]).slice(0, 4)
|
|
423
|
+
: [];
|
|
424
|
+
if (fields.length > 0) {
|
|
425
|
+
lines.push(`${schema.name}[${result.length}]{${fields.join(",")}}:`);
|
|
426
|
+
for (const item of result.slice(0, 20)) {
|
|
427
|
+
const obj = item;
|
|
428
|
+
const values = fields.map((f) => escapeTabularValue(formatCompactValue(obj[f], 30)));
|
|
429
|
+
lines.push(` ${values.join(",")}`);
|
|
430
|
+
}
|
|
431
|
+
if (result.length > 20) {
|
|
432
|
+
lines.push(` ... +${result.length - 20} more`);
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
else {
|
|
436
|
+
lines.push(`${schema.name}[${result.length}]: ${result.slice(0, 10).join(", ")}`);
|
|
437
|
+
}
|
|
438
|
+
return lines.join("\n");
|
|
439
|
+
}
|
|
440
|
+
if (typeof result === "object") {
|
|
441
|
+
const obj = result;
|
|
442
|
+
const fields = schema.fields || Object.keys(obj).slice(0, 6);
|
|
443
|
+
const values = fields.map((f) => `${f}:${formatCompactValue(obj[f], 40)}`);
|
|
444
|
+
return `${schema.name}: ${values.join(", ")}`;
|
|
445
|
+
}
|
|
446
|
+
return `${schema.name}: ${result}`;
|
|
447
|
+
}
|
|
448
|
+
/**
|
|
449
|
+
* Format output based on global configuration
|
|
450
|
+
*
|
|
451
|
+
* Uses the output config singleton to determine format.
|
|
452
|
+
*/
|
|
453
|
+
export function formatOutputWithConfig(result, schema) {
|
|
454
|
+
// Import dynamically to avoid circular dependency
|
|
455
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
456
|
+
const { getOutputConfig, shouldUseToon } = require("../config/output-config.js");
|
|
457
|
+
const config = getOutputConfig();
|
|
458
|
+
if (shouldUseToon()) {
|
|
459
|
+
if (config.mode === "toon") {
|
|
460
|
+
return serializeResultToToonTabular(result, schema);
|
|
461
|
+
}
|
|
462
|
+
return serializeResultToToon(result, schema, {
|
|
463
|
+
verbosity: config.verbosity,
|
|
464
|
+
includeStats: config.includeStats,
|
|
465
|
+
});
|
|
466
|
+
}
|
|
467
|
+
// Default structured output
|
|
468
|
+
return serializeResultToToon(result, schema, {
|
|
469
|
+
verbosity: config.verbosity,
|
|
470
|
+
includeStats: config.includeStats,
|
|
471
|
+
});
|
|
472
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toon-serializer.test.d.ts","sourceRoot":"","sources":["../../src/utils/toon-serializer.test.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|