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,577 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sandbox Types
|
|
3
|
+
*
|
|
4
|
+
* Type definitions for the code execution SDK.
|
|
5
|
+
*/
|
|
6
|
+
import type { SupportedLanguage, ElementType } from "../ast/types.js";
|
|
7
|
+
import type { ContentType } from "../compressors/types.js";
|
|
8
|
+
/**
|
|
9
|
+
* Execution context passed to sandbox
|
|
10
|
+
*/
|
|
11
|
+
export interface ExecutionContext {
|
|
12
|
+
workingDir: string;
|
|
13
|
+
timeout: number;
|
|
14
|
+
memoryLimit: number;
|
|
15
|
+
maxOutputTokens: number;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Default execution limits
|
|
19
|
+
*/
|
|
20
|
+
export declare const DEFAULT_LIMITS: {
|
|
21
|
+
readonly timeout: 5000;
|
|
22
|
+
readonly maxTimeout: 30000;
|
|
23
|
+
readonly memoryLimit: 128;
|
|
24
|
+
readonly maxOutputTokens: 4000;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Compression result from SDK
|
|
28
|
+
*/
|
|
29
|
+
export interface CompressResult {
|
|
30
|
+
compressed: string;
|
|
31
|
+
stats: {
|
|
32
|
+
original: number;
|
|
33
|
+
compressed: number;
|
|
34
|
+
reductionPercent: number;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Log summary result
|
|
39
|
+
*/
|
|
40
|
+
export interface LogSummary {
|
|
41
|
+
summary: string;
|
|
42
|
+
stats: {
|
|
43
|
+
totalLines: number;
|
|
44
|
+
errorCount: number;
|
|
45
|
+
warningCount: number;
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Code element from AST parsing
|
|
50
|
+
*/
|
|
51
|
+
export interface CodeElement {
|
|
52
|
+
type: ElementType;
|
|
53
|
+
name: string;
|
|
54
|
+
startLine: number;
|
|
55
|
+
endLine?: number;
|
|
56
|
+
signature?: string;
|
|
57
|
+
documentation?: string;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* File structure from parsing
|
|
61
|
+
*/
|
|
62
|
+
export interface FileStructure {
|
|
63
|
+
language: SupportedLanguage;
|
|
64
|
+
functions: CodeElement[];
|
|
65
|
+
classes: CodeElement[];
|
|
66
|
+
interfaces: CodeElement[];
|
|
67
|
+
types: CodeElement[];
|
|
68
|
+
variables: CodeElement[];
|
|
69
|
+
imports: CodeElement[];
|
|
70
|
+
exports: CodeElement[];
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Extraction target for code elements
|
|
74
|
+
*/
|
|
75
|
+
export interface ExtractionTarget {
|
|
76
|
+
type: ElementType;
|
|
77
|
+
name: string;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* SDK functions available in sandbox
|
|
81
|
+
*/
|
|
82
|
+
export interface CtxOptSDK {
|
|
83
|
+
compress: {
|
|
84
|
+
auto: (content: string, hint?: string) => CompressResult;
|
|
85
|
+
logs: (logs: string) => LogSummary;
|
|
86
|
+
diff: (diff: string) => CompressResult;
|
|
87
|
+
semantic: (content: string, ratio?: number) => CompressResult;
|
|
88
|
+
};
|
|
89
|
+
code: {
|
|
90
|
+
parse: (content: string, language: SupportedLanguage) => FileStructure;
|
|
91
|
+
extract: (content: string, language: SupportedLanguage, target: ExtractionTarget) => string | null;
|
|
92
|
+
skeleton: (content: string, language: SupportedLanguage) => string;
|
|
93
|
+
};
|
|
94
|
+
files: {
|
|
95
|
+
read: (path: string) => string;
|
|
96
|
+
exists: (path: string) => boolean;
|
|
97
|
+
glob: (pattern: string) => string[];
|
|
98
|
+
};
|
|
99
|
+
utils: {
|
|
100
|
+
countTokens: (text: string) => number;
|
|
101
|
+
detectType: (content: string) => ContentType;
|
|
102
|
+
detectLanguage: (filePath: string) => SupportedLanguage;
|
|
103
|
+
};
|
|
104
|
+
git: {
|
|
105
|
+
diff: (ref?: string) => GitDiff;
|
|
106
|
+
log: (limit?: number) => GitCommit[];
|
|
107
|
+
blame: (file: string, line?: number) => GitBlame;
|
|
108
|
+
status: () => GitStatus;
|
|
109
|
+
branch: () => GitBranch;
|
|
110
|
+
};
|
|
111
|
+
search: {
|
|
112
|
+
grep: (pattern: string, glob?: string) => GrepResult;
|
|
113
|
+
symbols: (query: string, glob?: string) => SymbolResult;
|
|
114
|
+
files: (pattern: string) => FileResult;
|
|
115
|
+
references: (symbol: string, glob?: string) => ReferenceMatch[];
|
|
116
|
+
};
|
|
117
|
+
analyze: {
|
|
118
|
+
dependencies: (file: string) => DependencyResult;
|
|
119
|
+
callGraph: (functionName: string, file: string, depth?: number) => CallGraphResult;
|
|
120
|
+
exports: (file: string) => ExportInfo[];
|
|
121
|
+
structure: (dir?: string, depth?: number) => StructureEntry;
|
|
122
|
+
};
|
|
123
|
+
pipeline: {
|
|
124
|
+
(steps: PipelineStep[]): PipelineResult;
|
|
125
|
+
codebaseOverview: (dir?: string) => CodebaseOverview;
|
|
126
|
+
findUsages: (symbol: string, glob?: string) => SymbolUsage;
|
|
127
|
+
analyzeDeps: (file: string, depth?: number) => DependencyAnalysis;
|
|
128
|
+
};
|
|
129
|
+
multifile: {
|
|
130
|
+
compress: (patterns: string[], options?: MultiFileCompressOptions) => MultiFileCompressResult;
|
|
131
|
+
extractShared: (patterns: string[]) => SharedElements;
|
|
132
|
+
chunk: (patterns: string[], maxTokensPerChunk: number) => ChunkInfo[];
|
|
133
|
+
skeletons: (patterns: string[], depth?: number) => string;
|
|
134
|
+
readAll: (patterns: string[]) => string;
|
|
135
|
+
};
|
|
136
|
+
conversation: {
|
|
137
|
+
compress: (messages: ConversationMessage[], options?: ConversationCompressOptions) => ConversationCompressResult;
|
|
138
|
+
createMemory: (messages: ConversationMessage[], options?: ConversationCompressOptions) => ConversationMemoryResult;
|
|
139
|
+
extractDecisions: (messages: ConversationMessage[]) => Decision[];
|
|
140
|
+
extractCodeRefs: (messages: ConversationMessage[]) => CodeReference[];
|
|
141
|
+
restore: (options?: MemoryRestoreOptions) => string;
|
|
142
|
+
getMemory: () => ConversationMemory | null;
|
|
143
|
+
setMemory: (memory: ConversationMemory) => void;
|
|
144
|
+
clearMemory: () => void;
|
|
145
|
+
hasMemory: () => boolean;
|
|
146
|
+
getSummary: () => ConversationMemorySummary | null;
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Execution result from sandbox
|
|
151
|
+
*/
|
|
152
|
+
export interface ExecutionResult {
|
|
153
|
+
success: boolean;
|
|
154
|
+
output: unknown;
|
|
155
|
+
error?: string;
|
|
156
|
+
stats: {
|
|
157
|
+
executionTimeMs: number;
|
|
158
|
+
tokensUsed: number;
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Code analysis result for security
|
|
163
|
+
*/
|
|
164
|
+
export interface CodeAnalysis {
|
|
165
|
+
safe: boolean;
|
|
166
|
+
warnings: string[];
|
|
167
|
+
blockedPatterns: string[];
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Host callbacks for sandbox file operations
|
|
171
|
+
*/
|
|
172
|
+
export interface HostCallbacks {
|
|
173
|
+
readFile: (path: string) => string;
|
|
174
|
+
fileExists: (path: string) => boolean;
|
|
175
|
+
glob: (pattern: string) => string[];
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Git diff result
|
|
179
|
+
*/
|
|
180
|
+
export interface GitDiff {
|
|
181
|
+
raw: string;
|
|
182
|
+
files: GitFileChange[];
|
|
183
|
+
stats: {
|
|
184
|
+
additions: number;
|
|
185
|
+
deletions: number;
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Individual file change in a diff
|
|
190
|
+
*/
|
|
191
|
+
export interface GitFileChange {
|
|
192
|
+
file: string;
|
|
193
|
+
status: "added" | "modified" | "deleted" | "renamed";
|
|
194
|
+
additions: number;
|
|
195
|
+
deletions: number;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Git commit information
|
|
199
|
+
*/
|
|
200
|
+
export interface GitCommit {
|
|
201
|
+
hash: string;
|
|
202
|
+
shortHash: string;
|
|
203
|
+
author: string;
|
|
204
|
+
date: string;
|
|
205
|
+
message: string;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Git blame result
|
|
209
|
+
*/
|
|
210
|
+
export interface GitBlame {
|
|
211
|
+
lines: GitBlameLine[];
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Individual blame line
|
|
215
|
+
*/
|
|
216
|
+
export interface GitBlameLine {
|
|
217
|
+
hash: string;
|
|
218
|
+
author: string;
|
|
219
|
+
date: string;
|
|
220
|
+
line: number;
|
|
221
|
+
content: string;
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Git repository status
|
|
225
|
+
*/
|
|
226
|
+
export interface GitStatus {
|
|
227
|
+
branch: string;
|
|
228
|
+
ahead: number;
|
|
229
|
+
behind: number;
|
|
230
|
+
staged: string[];
|
|
231
|
+
modified: string[];
|
|
232
|
+
untracked: string[];
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Git branch information
|
|
236
|
+
*/
|
|
237
|
+
export interface GitBranch {
|
|
238
|
+
current: string;
|
|
239
|
+
branches: string[];
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Grep match result
|
|
243
|
+
*/
|
|
244
|
+
export interface GrepMatch {
|
|
245
|
+
file: string;
|
|
246
|
+
line: number;
|
|
247
|
+
column: number;
|
|
248
|
+
content: string;
|
|
249
|
+
match: string;
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Grep search result
|
|
253
|
+
*/
|
|
254
|
+
export interface GrepResult {
|
|
255
|
+
matches: GrepMatch[];
|
|
256
|
+
totalMatches: number;
|
|
257
|
+
filesSearched: number;
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Symbol search result
|
|
261
|
+
*/
|
|
262
|
+
export interface SymbolMatch {
|
|
263
|
+
name: string;
|
|
264
|
+
type: ElementType;
|
|
265
|
+
file: string;
|
|
266
|
+
line: number;
|
|
267
|
+
signature?: string;
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Symbol search result container
|
|
271
|
+
*/
|
|
272
|
+
export interface SymbolResult {
|
|
273
|
+
symbols: SymbolMatch[];
|
|
274
|
+
totalMatches: number;
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* File search result
|
|
278
|
+
*/
|
|
279
|
+
export interface FileMatch {
|
|
280
|
+
path: string;
|
|
281
|
+
name: string;
|
|
282
|
+
extension: string;
|
|
283
|
+
size?: number;
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* File search result container
|
|
287
|
+
*/
|
|
288
|
+
export interface FileResult {
|
|
289
|
+
files: FileMatch[];
|
|
290
|
+
totalMatches: number;
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* Reference location
|
|
294
|
+
*/
|
|
295
|
+
export interface ReferenceMatch {
|
|
296
|
+
file: string;
|
|
297
|
+
line: number;
|
|
298
|
+
column: number;
|
|
299
|
+
context: string;
|
|
300
|
+
type: "definition" | "usage" | "import";
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
303
|
+
* Import dependency info
|
|
304
|
+
*/
|
|
305
|
+
export interface ImportInfo {
|
|
306
|
+
source: string;
|
|
307
|
+
names: string[];
|
|
308
|
+
isDefault: boolean;
|
|
309
|
+
isNamespace: boolean;
|
|
310
|
+
resolvedPath?: string;
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Export info
|
|
314
|
+
*/
|
|
315
|
+
export interface ExportInfo {
|
|
316
|
+
name: string;
|
|
317
|
+
type: ElementType;
|
|
318
|
+
isDefault: boolean;
|
|
319
|
+
line: number;
|
|
320
|
+
signature?: string;
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* File dependencies result
|
|
324
|
+
*/
|
|
325
|
+
export interface DependencyResult {
|
|
326
|
+
file: string;
|
|
327
|
+
imports: ImportInfo[];
|
|
328
|
+
exports: ExportInfo[];
|
|
329
|
+
externalDeps: string[];
|
|
330
|
+
internalDeps: string[];
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* Call graph node
|
|
334
|
+
*/
|
|
335
|
+
export interface CallNode {
|
|
336
|
+
name: string;
|
|
337
|
+
file: string;
|
|
338
|
+
line: number;
|
|
339
|
+
calls: string[];
|
|
340
|
+
calledBy: string[];
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* Call graph result
|
|
344
|
+
*/
|
|
345
|
+
export interface CallGraphResult {
|
|
346
|
+
root: string;
|
|
347
|
+
nodes: CallNode[];
|
|
348
|
+
depth: number;
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* Directory structure entry
|
|
352
|
+
*/
|
|
353
|
+
export interface StructureEntry {
|
|
354
|
+
path: string;
|
|
355
|
+
type: "file" | "directory";
|
|
356
|
+
name: string;
|
|
357
|
+
children?: StructureEntry[];
|
|
358
|
+
language?: string;
|
|
359
|
+
exports?: number;
|
|
360
|
+
functions?: number;
|
|
361
|
+
classes?: number;
|
|
362
|
+
size?: number;
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* Pipeline step types
|
|
366
|
+
*/
|
|
367
|
+
export type PipelineStep = {
|
|
368
|
+
glob: string;
|
|
369
|
+
} | {
|
|
370
|
+
filter: (item: unknown) => boolean;
|
|
371
|
+
} | {
|
|
372
|
+
read: boolean;
|
|
373
|
+
} | {
|
|
374
|
+
map: (item: unknown) => unknown;
|
|
375
|
+
} | {
|
|
376
|
+
reduce: (acc: unknown, item: unknown) => unknown;
|
|
377
|
+
initial: unknown;
|
|
378
|
+
} | {
|
|
379
|
+
compress: "auto" | "semantic" | "logs";
|
|
380
|
+
ratio?: number;
|
|
381
|
+
} | {
|
|
382
|
+
limit: number;
|
|
383
|
+
} | {
|
|
384
|
+
sort: "asc" | "desc";
|
|
385
|
+
by?: string;
|
|
386
|
+
} | {
|
|
387
|
+
unique: boolean | string;
|
|
388
|
+
};
|
|
389
|
+
/**
|
|
390
|
+
* Pipeline execution result
|
|
391
|
+
*/
|
|
392
|
+
export interface PipelineResult<T = unknown> {
|
|
393
|
+
data: T;
|
|
394
|
+
stats: {
|
|
395
|
+
stepsExecuted: number;
|
|
396
|
+
itemsProcessed: number;
|
|
397
|
+
executionTimeMs: number;
|
|
398
|
+
};
|
|
399
|
+
}
|
|
400
|
+
/**
|
|
401
|
+
* Codebase overview result
|
|
402
|
+
*/
|
|
403
|
+
export interface CodebaseOverview {
|
|
404
|
+
totalFiles: number;
|
|
405
|
+
totalLines: number;
|
|
406
|
+
languages: Record<string, number>;
|
|
407
|
+
largestFiles: Array<{
|
|
408
|
+
path: string;
|
|
409
|
+
lines: number;
|
|
410
|
+
}>;
|
|
411
|
+
structure: StructureEntry;
|
|
412
|
+
}
|
|
413
|
+
/**
|
|
414
|
+
* Symbol usage result
|
|
415
|
+
*/
|
|
416
|
+
export interface SymbolUsage {
|
|
417
|
+
symbol: string;
|
|
418
|
+
definitions: Array<{
|
|
419
|
+
file: string;
|
|
420
|
+
line: number;
|
|
421
|
+
}>;
|
|
422
|
+
usages: Array<{
|
|
423
|
+
file: string;
|
|
424
|
+
line: number;
|
|
425
|
+
context: string;
|
|
426
|
+
}>;
|
|
427
|
+
totalReferences: number;
|
|
428
|
+
}
|
|
429
|
+
/**
|
|
430
|
+
* Dependency analysis result
|
|
431
|
+
*/
|
|
432
|
+
export interface DependencyAnalysis {
|
|
433
|
+
file: string;
|
|
434
|
+
directDeps: string[];
|
|
435
|
+
transitiveDeps: string[];
|
|
436
|
+
externalPackages: string[];
|
|
437
|
+
circularDeps: string[];
|
|
438
|
+
}
|
|
439
|
+
/**
|
|
440
|
+
* Multi-file compression options
|
|
441
|
+
*/
|
|
442
|
+
export interface MultiFileCompressOptions {
|
|
443
|
+
maxTokens?: number;
|
|
444
|
+
strategy?: "deduplicate" | "skeleton" | "smart-chunk";
|
|
445
|
+
preservePatterns?: string[];
|
|
446
|
+
}
|
|
447
|
+
/**
|
|
448
|
+
* Multi-file compression result
|
|
449
|
+
*/
|
|
450
|
+
export interface MultiFileCompressResult {
|
|
451
|
+
compressed: string;
|
|
452
|
+
filesIncluded: string[];
|
|
453
|
+
sharedElements: SharedElements;
|
|
454
|
+
stats: {
|
|
455
|
+
originalTokens: number;
|
|
456
|
+
compressedTokens: number;
|
|
457
|
+
filesProcessed: number;
|
|
458
|
+
deduplicatedItems: number;
|
|
459
|
+
reductionPercent: number;
|
|
460
|
+
};
|
|
461
|
+
}
|
|
462
|
+
/**
|
|
463
|
+
* Shared elements across files
|
|
464
|
+
*/
|
|
465
|
+
export interface SharedElements {
|
|
466
|
+
imports: Array<{
|
|
467
|
+
source: string;
|
|
468
|
+
names: string[];
|
|
469
|
+
usedIn: string[];
|
|
470
|
+
}>;
|
|
471
|
+
types: Array<{
|
|
472
|
+
name: string;
|
|
473
|
+
kind: string;
|
|
474
|
+
definition: string;
|
|
475
|
+
usedIn: string[];
|
|
476
|
+
}>;
|
|
477
|
+
constants: Array<{
|
|
478
|
+
name: string;
|
|
479
|
+
value: string;
|
|
480
|
+
usedIn: string[];
|
|
481
|
+
}>;
|
|
482
|
+
}
|
|
483
|
+
/**
|
|
484
|
+
* Chunk information for smart chunking
|
|
485
|
+
*/
|
|
486
|
+
export interface ChunkInfo {
|
|
487
|
+
id: string;
|
|
488
|
+
files: string[];
|
|
489
|
+
tokens: number;
|
|
490
|
+
dependencies: string[];
|
|
491
|
+
}
|
|
492
|
+
/**
|
|
493
|
+
* Conversation message
|
|
494
|
+
*/
|
|
495
|
+
export interface ConversationMessage {
|
|
496
|
+
role: "user" | "assistant" | "system";
|
|
497
|
+
content: string;
|
|
498
|
+
}
|
|
499
|
+
/**
|
|
500
|
+
* Conversation compression options
|
|
501
|
+
*/
|
|
502
|
+
export interface ConversationCompressOptions {
|
|
503
|
+
strategy: "rolling-summary" | "key-extraction" | "hybrid";
|
|
504
|
+
maxTokens: number;
|
|
505
|
+
preserveSystem?: boolean;
|
|
506
|
+
preserveLastN?: number;
|
|
507
|
+
}
|
|
508
|
+
/**
|
|
509
|
+
* Conversation compression result
|
|
510
|
+
*/
|
|
511
|
+
export interface ConversationCompressResult {
|
|
512
|
+
compressedMessages: ConversationMessage[];
|
|
513
|
+
summary?: string;
|
|
514
|
+
keyPoints?: string[];
|
|
515
|
+
originalTokens: number;
|
|
516
|
+
compressedTokens: number;
|
|
517
|
+
savings: number;
|
|
518
|
+
}
|
|
519
|
+
/**
|
|
520
|
+
* Decision extracted from conversation
|
|
521
|
+
*/
|
|
522
|
+
export interface Decision {
|
|
523
|
+
decision: string;
|
|
524
|
+
context: string;
|
|
525
|
+
timestamp: number;
|
|
526
|
+
}
|
|
527
|
+
/**
|
|
528
|
+
* Code reference from conversation
|
|
529
|
+
*/
|
|
530
|
+
export interface CodeReference {
|
|
531
|
+
file: string;
|
|
532
|
+
element?: string;
|
|
533
|
+
action: "created" | "modified" | "discussed" | "deleted";
|
|
534
|
+
}
|
|
535
|
+
/**
|
|
536
|
+
* Conversation memory state
|
|
537
|
+
*/
|
|
538
|
+
export interface ConversationMemory {
|
|
539
|
+
summary: string;
|
|
540
|
+
decisions: Decision[];
|
|
541
|
+
codeReferences: CodeReference[];
|
|
542
|
+
compressedHistory: ConversationMessage[];
|
|
543
|
+
lastUpdated: number;
|
|
544
|
+
}
|
|
545
|
+
/**
|
|
546
|
+
* Options for memory restoration
|
|
547
|
+
*/
|
|
548
|
+
export interface MemoryRestoreOptions {
|
|
549
|
+
includeSummary?: boolean;
|
|
550
|
+
recentMessages?: number;
|
|
551
|
+
includeCodeRefs?: boolean;
|
|
552
|
+
includeDecisions?: boolean;
|
|
553
|
+
}
|
|
554
|
+
/**
|
|
555
|
+
* Conversation memory result
|
|
556
|
+
*/
|
|
557
|
+
export interface ConversationMemoryResult {
|
|
558
|
+
context: string;
|
|
559
|
+
memory: ConversationMemory;
|
|
560
|
+
stats: {
|
|
561
|
+
originalTokens: number;
|
|
562
|
+
compressedTokens: number;
|
|
563
|
+
decisionsExtracted: number;
|
|
564
|
+
codeRefsFound: number;
|
|
565
|
+
};
|
|
566
|
+
}
|
|
567
|
+
/**
|
|
568
|
+
* Conversation memory summary
|
|
569
|
+
*/
|
|
570
|
+
export interface ConversationMemorySummary {
|
|
571
|
+
summary: string;
|
|
572
|
+
decisionsCount: number;
|
|
573
|
+
codeRefsCount: number;
|
|
574
|
+
messagesCount: number;
|
|
575
|
+
lastUpdated: number;
|
|
576
|
+
}
|
|
577
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/sandbox/types.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AAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,KAAK,EAAE;QACL,cAAc,EAAE,MAAM,CAAC;QACvB,gBAAgB,EAAE,MAAM,CAAC;QACzB,kBAAkB,EAAE,MAAM,CAAC;QAC3B,aAAa,EAAE,MAAM,CAAC;KACvB,CAAC;CACH;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;CACrB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sandbox Types
|
|
3
|
+
*
|
|
4
|
+
* Type definitions for the code execution SDK.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Default execution limits
|
|
8
|
+
*/
|
|
9
|
+
export const DEFAULT_LIMITS = {
|
|
10
|
+
timeout: 5000, // 5 seconds
|
|
11
|
+
maxTimeout: 30000, // 30 seconds max
|
|
12
|
+
memoryLimit: 128, // 128MB
|
|
13
|
+
maxOutputTokens: 4000,
|
|
14
|
+
};
|
package/dist/server.d.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CtxOpt MCP Server
|
|
3
|
+
*
|
|
4
|
+
* Main server implementation with dynamic tool loading.
|
|
5
|
+
* Only core tools are loaded at startup to minimize token consumption.
|
|
6
|
+
*/
|
|
7
|
+
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
8
|
+
import { type MiddlewareChain } from "./middleware/chain.js";
|
|
9
|
+
import { type ToolRegistry } from "./tools/registry.js";
|
|
10
|
+
export type LoadingMode = "lazy" | "core" | "all";
|
|
11
|
+
export interface ServerConfig {
|
|
12
|
+
verbose?: boolean;
|
|
13
|
+
/** Load all tools at startup instead of using dynamic loading */
|
|
14
|
+
loadAllTools?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Tool loading mode:
|
|
17
|
+
* - "lazy": Only 2 meta-tools (browse_tools, run_tool) - 95% token savings
|
|
18
|
+
* - "core": Core tools + discover_tools (default)
|
|
19
|
+
* - "all": Load all tools at startup
|
|
20
|
+
*/
|
|
21
|
+
mode?: LoadingMode;
|
|
22
|
+
}
|
|
23
|
+
export interface ServerInstance {
|
|
24
|
+
server: Server;
|
|
25
|
+
middleware: MiddlewareChain;
|
|
26
|
+
tools: ToolRegistry;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Create and configure the MCP server
|
|
30
|
+
*/
|
|
31
|
+
export declare function createServer(config?: ServerConfig): Promise<ServerInstance>;
|
|
32
|
+
/**
|
|
33
|
+
* Run the MCP server on stdio transport
|
|
34
|
+
*/
|
|
35
|
+
export declare function runServer(config?: ServerConfig): Promise<void>;
|
|
36
|
+
//# sourceMappingURL=server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAKnE,OAAO,EAAyB,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAIpF,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAK5E,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC;AAElD,MAAM,WAAW,YAAY;IAC3B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,iEAAiE;IACjE,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;CACpB;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,eAAe,CAAC;IAC5B,KAAK,EAAE,YAAY,CAAC;CACrB;AAED;;GAEG;AACH,wBAAsB,YAAY,CAAC,MAAM,GAAE,YAAiB,GAAG,OAAO,CAAC,cAAc,CAAC,CA+GrF;AAED;;GAEG;AACH,wBAAsB,SAAS,CAAC,MAAM,GAAE,YAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAgBxE"}
|