sdl-mcp 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +132 -0
- package/config/benchmark.ci.config.json +86 -0
- package/config/benchmark.ci.windows.config.json +86 -0
- package/config/benchmark.config.example.json +86 -0
- package/config/benchmark.config.json +86 -0
- package/config/sdlmcp.config.example.json +139 -0
- package/config/sdlmcp.config.json +48 -0
- package/config/sdlmcp.config.schema.json +381 -0
- package/dist/agent/evidence.d.ts +18 -0
- package/dist/agent/evidence.d.ts.map +1 -0
- package/dist/agent/evidence.js +107 -0
- package/dist/agent/evidence.js.map +1 -0
- package/dist/agent/executor.d.ts +28 -0
- package/dist/agent/executor.d.ts.map +1 -0
- package/dist/agent/executor.js +261 -0
- package/dist/agent/executor.js.map +1 -0
- package/dist/agent/index.d.ts +6 -0
- package/dist/agent/index.d.ts.map +1 -0
- package/dist/agent/index.js +6 -0
- package/dist/agent/index.js.map +1 -0
- package/dist/agent/orchestrator.d.ts +14 -0
- package/dist/agent/orchestrator.d.ts.map +1 -0
- package/dist/agent/orchestrator.js +108 -0
- package/dist/agent/orchestrator.js.map +1 -0
- package/dist/agent/planner.d.ts +21 -0
- package/dist/agent/planner.d.ts.map +1 -0
- package/dist/agent/planner.js +153 -0
- package/dist/agent/planner.js.map +1 -0
- package/dist/agent/types.d.ts +86 -0
- package/dist/agent/types.d.ts.map +1 -0
- package/dist/agent/types.js +2 -0
- package/dist/agent/types.js.map +1 -0
- package/dist/benchmark/index.d.ts +4 -0
- package/dist/benchmark/index.d.ts.map +1 -0
- package/dist/benchmark/index.js +4 -0
- package/dist/benchmark/index.js.map +1 -0
- package/dist/benchmark/regression.d.ts +40 -0
- package/dist/benchmark/regression.d.ts.map +1 -0
- package/dist/benchmark/regression.js +199 -0
- package/dist/benchmark/regression.js.map +1 -0
- package/dist/benchmark/smoothing.d.ts +40 -0
- package/dist/benchmark/smoothing.d.ts.map +1 -0
- package/dist/benchmark/smoothing.js +121 -0
- package/dist/benchmark/smoothing.js.map +1 -0
- package/dist/benchmark/threshold.d.ts +64 -0
- package/dist/benchmark/threshold.d.ts.map +1 -0
- package/dist/benchmark/threshold.js +173 -0
- package/dist/benchmark/threshold.js.map +1 -0
- package/dist/cli/argParsing.d.ts +34 -0
- package/dist/cli/argParsing.d.ts.map +1 -0
- package/dist/cli/argParsing.js +329 -0
- package/dist/cli/argParsing.js.map +1 -0
- package/dist/cli/commands/benchmark.d.ts +16 -0
- package/dist/cli/commands/benchmark.d.ts.map +1 -0
- package/dist/cli/commands/benchmark.js +412 -0
- package/dist/cli/commands/benchmark.js.map +1 -0
- package/dist/cli/commands/doctor.d.ts +3 -0
- package/dist/cli/commands/doctor.d.ts.map +1 -0
- package/dist/cli/commands/doctor.js +218 -0
- package/dist/cli/commands/doctor.js.map +1 -0
- package/dist/cli/commands/export.d.ts +12 -0
- package/dist/cli/commands/export.d.ts.map +1 -0
- package/dist/cli/commands/export.js +70 -0
- package/dist/cli/commands/export.js.map +1 -0
- package/dist/cli/commands/import.d.ts +10 -0
- package/dist/cli/commands/import.d.ts.map +1 -0
- package/dist/cli/commands/import.js +40 -0
- package/dist/cli/commands/import.js.map +1 -0
- package/dist/cli/commands/index.d.ts +3 -0
- package/dist/cli/commands/index.d.ts.map +1 -0
- package/dist/cli/commands/index.js +89 -0
- package/dist/cli/commands/index.js.map +1 -0
- package/dist/cli/commands/init.d.ts +3 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +221 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/pull.d.ts +11 -0
- package/dist/cli/commands/pull.d.ts.map +1 -0
- package/dist/cli/commands/pull.js +47 -0
- package/dist/cli/commands/pull.js.map +1 -0
- package/dist/cli/commands/serve.d.ts +3 -0
- package/dist/cli/commands/serve.d.ts.map +1 -0
- package/dist/cli/commands/serve.js +72 -0
- package/dist/cli/commands/serve.js.map +1 -0
- package/dist/cli/commands/version.d.ts +3 -0
- package/dist/cli/commands/version.d.ts.map +1 -0
- package/dist/cli/commands/version.js +24 -0
- package/dist/cli/commands/version.js.map +1 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +213 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/logging.d.ts +10 -0
- package/dist/cli/logging.d.ts.map +1 -0
- package/dist/cli/logging.js +48 -0
- package/dist/cli/logging.js.map +1 -0
- package/dist/cli/transport/http.d.ts +3 -0
- package/dist/cli/transport/http.d.ts.map +1 -0
- package/dist/cli/transport/http.js +106 -0
- package/dist/cli/transport/http.js.map +1 -0
- package/dist/cli/transport/stdio.d.ts +3 -0
- package/dist/cli/transport/stdio.d.ts.map +1 -0
- package/dist/cli/transport/stdio.js +6 -0
- package/dist/cli/transport/stdio.js.map +1 -0
- package/dist/cli/types.d.ts +41 -0
- package/dist/cli/types.d.ts.map +1 -0
- package/dist/cli/types.js +2 -0
- package/dist/cli/types.js.map +1 -0
- package/dist/code/gate.d.ts +11 -0
- package/dist/code/gate.d.ts.map +1 -0
- package/dist/code/gate.js +134 -0
- package/dist/code/gate.js.map +1 -0
- package/dist/code/hotpath.d.ts +17 -0
- package/dist/code/hotpath.d.ts.map +1 -0
- package/dist/code/hotpath.js +200 -0
- package/dist/code/hotpath.js.map +1 -0
- package/dist/code/redact.d.ts +19 -0
- package/dist/code/redact.d.ts.map +1 -0
- package/dist/code/redact.js +92 -0
- package/dist/code/redact.js.map +1 -0
- package/dist/code/skeleton.d.ts +32 -0
- package/dist/code/skeleton.d.ts.map +1 -0
- package/dist/code/skeleton.js +610 -0
- package/dist/code/skeleton.js.map +1 -0
- package/dist/code/windows.d.ts +18 -0
- package/dist/code/windows.d.ts.map +1 -0
- package/dist/code/windows.js +236 -0
- package/dist/code/windows.js.map +1 -0
- package/dist/config/constants.d.ts +340 -0
- package/dist/config/constants.d.ts.map +1 -0
- package/dist/config/constants.js +379 -0
- package/dist/config/constants.js.map +1 -0
- package/dist/config/loadConfig.d.ts +3 -0
- package/dist/config/loadConfig.d.ts.map +1 -0
- package/dist/config/loadConfig.js +71 -0
- package/dist/config/loadConfig.js.map +1 -0
- package/dist/config/types.d.ts +509 -0
- package/dist/config/types.d.ts.map +1 -0
- package/dist/config/types.js +139 -0
- package/dist/config/types.js.map +1 -0
- package/dist/db/db.d.ts +4 -0
- package/dist/db/db.d.ts.map +1 -0
- package/dist/db/db.js +47 -0
- package/dist/db/db.js.map +1 -0
- package/dist/db/migrations.d.ts +15 -0
- package/dist/db/migrations.d.ts.map +1 -0
- package/dist/db/migrations.js +81 -0
- package/dist/db/migrations.js.map +1 -0
- package/dist/db/queries.d.ts +440 -0
- package/dist/db/queries.d.ts.map +1 -0
- package/dist/db/queries.js +1054 -0
- package/dist/db/queries.js.map +1 -0
- package/dist/db/schema.d.ts +132 -0
- package/dist/db/schema.d.ts.map +1 -0
- package/dist/db/schema.js +2 -0
- package/dist/db/schema.js.map +1 -0
- package/dist/delta/blastRadius.d.ts +24 -0
- package/dist/delta/blastRadius.d.ts.map +1 -0
- package/dist/delta/blastRadius.js +239 -0
- package/dist/delta/blastRadius.js.map +1 -0
- package/dist/delta/diff.d.ts +16 -0
- package/dist/delta/diff.d.ts.map +1 -0
- package/dist/delta/diff.js +236 -0
- package/dist/delta/diff.js.map +1 -0
- package/dist/delta/versioning.d.ts +11 -0
- package/dist/delta/versioning.d.ts.map +1 -0
- package/dist/delta/versioning.js +68 -0
- package/dist/delta/versioning.js.map +1 -0
- package/dist/graph/buildGraph.d.ts +12 -0
- package/dist/graph/buildGraph.d.ts.map +1 -0
- package/dist/graph/buildGraph.js +81 -0
- package/dist/graph/buildGraph.js.map +1 -0
- package/dist/graph/cache.d.ts +111 -0
- package/dist/graph/cache.d.ts.map +1 -0
- package/dist/graph/cache.js +237 -0
- package/dist/graph/cache.js.map +1 -0
- package/dist/graph/metrics.d.ts +12 -0
- package/dist/graph/metrics.d.ts.map +1 -0
- package/dist/graph/metrics.js +253 -0
- package/dist/graph/metrics.js.map +1 -0
- package/dist/graph/minHeap.d.ts +91 -0
- package/dist/graph/minHeap.d.ts.map +1 -0
- package/dist/graph/minHeap.js +159 -0
- package/dist/graph/minHeap.js.map +1 -0
- package/dist/graph/overview.d.ts +22 -0
- package/dist/graph/overview.d.ts.map +1 -0
- package/dist/graph/overview.js +379 -0
- package/dist/graph/overview.js.map +1 -0
- package/dist/graph/score.d.ts +27 -0
- package/dist/graph/score.d.ts.map +1 -0
- package/dist/graph/score.js +214 -0
- package/dist/graph/score.js.map +1 -0
- package/dist/graph/slice.d.ts +51 -0
- package/dist/graph/slice.d.ts.map +1 -0
- package/dist/graph/slice.js +1047 -0
- package/dist/graph/slice.js.map +1 -0
- package/dist/graph/sliceCache.d.ts +33 -0
- package/dist/graph/sliceCache.d.ts.map +1 -0
- package/dist/graph/sliceCache.js +140 -0
- package/dist/graph/sliceCache.js.map +1 -0
- package/dist/indexer/adapter/BaseAdapter.d.ts +29 -0
- package/dist/indexer/adapter/BaseAdapter.d.ts.map +1 -0
- package/dist/indexer/adapter/BaseAdapter.js +97 -0
- package/dist/indexer/adapter/BaseAdapter.js.map +1 -0
- package/dist/indexer/adapter/LanguageAdapter.d.ts +20 -0
- package/dist/indexer/adapter/LanguageAdapter.d.ts.map +1 -0
- package/dist/indexer/adapter/LanguageAdapter.js +2 -0
- package/dist/indexer/adapter/LanguageAdapter.js.map +1 -0
- package/dist/indexer/adapter/adapters.d.ts +57 -0
- package/dist/indexer/adapter/adapters.d.ts.map +1 -0
- package/dist/indexer/adapter/adapters.js +129 -0
- package/dist/indexer/adapter/adapters.js.map +1 -0
- package/dist/indexer/adapter/c.d.ts +18 -0
- package/dist/indexer/adapter/c.d.ts.map +1 -0
- package/dist/indexer/adapter/c.js +443 -0
- package/dist/indexer/adapter/c.js.map +1 -0
- package/dist/indexer/adapter/cpp.d.ts +18 -0
- package/dist/indexer/adapter/cpp.d.ts.map +1 -0
- package/dist/indexer/adapter/cpp.js +493 -0
- package/dist/indexer/adapter/cpp.js.map +1 -0
- package/dist/indexer/adapter/csharp.d.ts +48 -0
- package/dist/indexer/adapter/csharp.d.ts.map +1 -0
- package/dist/indexer/adapter/csharp.js +638 -0
- package/dist/indexer/adapter/csharp.js.map +1 -0
- package/dist/indexer/adapter/go.d.ts +14 -0
- package/dist/indexer/adapter/go.d.ts.map +1 -0
- package/dist/indexer/adapter/go.js +400 -0
- package/dist/indexer/adapter/go.js.map +1 -0
- package/dist/indexer/adapter/index.d.ts +14 -0
- package/dist/indexer/adapter/index.d.ts.map +1 -0
- package/dist/indexer/adapter/index.js +13 -0
- package/dist/indexer/adapter/index.js.map +1 -0
- package/dist/indexer/adapter/java.d.ts +14 -0
- package/dist/indexer/adapter/java.d.ts.map +1 -0
- package/dist/indexer/adapter/java.js +391 -0
- package/dist/indexer/adapter/java.js.map +1 -0
- package/dist/indexer/adapter/kotlin.d.ts +18 -0
- package/dist/indexer/adapter/kotlin.d.ts.map +1 -0
- package/dist/indexer/adapter/kotlin.js +599 -0
- package/dist/indexer/adapter/kotlin.js.map +1 -0
- package/dist/indexer/adapter/php.d.ts +18 -0
- package/dist/indexer/adapter/php.d.ts.map +1 -0
- package/dist/indexer/adapter/php.js +574 -0
- package/dist/indexer/adapter/php.js.map +1 -0
- package/dist/indexer/adapter/plugin/index.d.ts +3 -0
- package/dist/indexer/adapter/plugin/index.d.ts.map +1 -0
- package/dist/indexer/adapter/plugin/index.js +3 -0
- package/dist/indexer/adapter/plugin/index.js.map +1 -0
- package/dist/indexer/adapter/plugin/loader.d.ts +13 -0
- package/dist/indexer/adapter/plugin/loader.d.ts.map +1 -0
- package/dist/indexer/adapter/plugin/loader.js +154 -0
- package/dist/indexer/adapter/plugin/loader.js.map +1 -0
- package/dist/indexer/adapter/plugin/types.d.ts +76 -0
- package/dist/indexer/adapter/plugin/types.d.ts.map +1 -0
- package/dist/indexer/adapter/plugin/types.js +47 -0
- package/dist/indexer/adapter/plugin/types.js.map +1 -0
- package/dist/indexer/adapter/python.d.ts +14 -0
- package/dist/indexer/adapter/python.d.ts.map +1 -0
- package/dist/indexer/adapter/python.js +511 -0
- package/dist/indexer/adapter/python.js.map +1 -0
- package/dist/indexer/adapter/registry.d.ts +17 -0
- package/dist/indexer/adapter/registry.d.ts.map +1 -0
- package/dist/indexer/adapter/registry.js +134 -0
- package/dist/indexer/adapter/registry.js.map +1 -0
- package/dist/indexer/adapter/rust.d.ts +18 -0
- package/dist/indexer/adapter/rust.d.ts.map +1 -0
- package/dist/indexer/adapter/rust.js +709 -0
- package/dist/indexer/adapter/rust.js.map +1 -0
- package/dist/indexer/adapter/shell.d.ts +18 -0
- package/dist/indexer/adapter/shell.d.ts.map +1 -0
- package/dist/indexer/adapter/shell.js +345 -0
- package/dist/indexer/adapter/shell.js.map +1 -0
- package/dist/indexer/adapter/typescript.d.ts +14 -0
- package/dist/indexer/adapter/typescript.d.ts.map +1 -0
- package/dist/indexer/adapter/typescript.js +31 -0
- package/dist/indexer/adapter/typescript.js.map +1 -0
- package/dist/indexer/configEdges.d.ts +30 -0
- package/dist/indexer/configEdges.d.ts.map +1 -0
- package/dist/indexer/configEdges.js +260 -0
- package/dist/indexer/configEdges.js.map +1 -0
- package/dist/indexer/fileScanner.d.ts +16 -0
- package/dist/indexer/fileScanner.d.ts.map +1 -0
- package/dist/indexer/fileScanner.js +90 -0
- package/dist/indexer/fileScanner.js.map +1 -0
- package/dist/indexer/fingerprints.d.ts +23 -0
- package/dist/indexer/fingerprints.d.ts.map +1 -0
- package/dist/indexer/fingerprints.js +97 -0
- package/dist/indexer/fingerprints.js.map +1 -0
- package/dist/indexer/indexer.d.ts +58 -0
- package/dist/indexer/indexer.d.ts.map +1 -0
- package/dist/indexer/indexer.js +1229 -0
- package/dist/indexer/indexer.js.map +1 -0
- package/dist/indexer/summaries.d.ts +5 -0
- package/dist/indexer/summaries.d.ts.map +1 -0
- package/dist/indexer/summaries.js +331 -0
- package/dist/indexer/summaries.js.map +1 -0
- package/dist/indexer/treesitter/extractCalls.d.ts +40 -0
- package/dist/indexer/treesitter/extractCalls.d.ts.map +1 -0
- package/dist/indexer/treesitter/extractCalls.js +561 -0
- package/dist/indexer/treesitter/extractCalls.js.map +1 -0
- package/dist/indexer/treesitter/extractImports.d.ts +12 -0
- package/dist/indexer/treesitter/extractImports.d.ts.map +1 -0
- package/dist/indexer/treesitter/extractImports.js +184 -0
- package/dist/indexer/treesitter/extractImports.js.map +1 -0
- package/dist/indexer/treesitter/extractSymbols.d.ts +24 -0
- package/dist/indexer/treesitter/extractSymbols.d.ts.map +1 -0
- package/dist/indexer/treesitter/extractSymbols.js +389 -0
- package/dist/indexer/treesitter/extractSymbols.js.map +1 -0
- package/dist/indexer/treesitter/grammarLoader.d.ts +6 -0
- package/dist/indexer/treesitter/grammarLoader.d.ts.map +1 -0
- package/dist/indexer/treesitter/grammarLoader.js +125 -0
- package/dist/indexer/treesitter/grammarLoader.js.map +1 -0
- package/dist/indexer/treesitter/symbolUtils.d.ts +4 -0
- package/dist/indexer/treesitter/symbolUtils.d.ts.map +1 -0
- package/dist/indexer/treesitter/symbolUtils.js +26 -0
- package/dist/indexer/treesitter/symbolUtils.js.map +1 -0
- package/dist/indexer/treesitter/tsTreesitter.d.ts +9 -0
- package/dist/indexer/treesitter/tsTreesitter.d.ts.map +1 -0
- package/dist/indexer/treesitter/tsTreesitter.js +54 -0
- package/dist/indexer/treesitter/tsTreesitter.js.map +1 -0
- package/dist/indexer/treesitter/types.d.ts +19 -0
- package/dist/indexer/treesitter/types.d.ts.map +1 -0
- package/dist/indexer/treesitter/types.js +7 -0
- package/dist/indexer/treesitter/types.js.map +1 -0
- package/dist/indexer/ts/tsParser.d.ts +20 -0
- package/dist/indexer/ts/tsParser.d.ts.map +1 -0
- package/dist/indexer/ts/tsParser.js +114 -0
- package/dist/indexer/ts/tsParser.js.map +1 -0
- package/dist/indexer/worker.d.ts +2 -0
- package/dist/indexer/worker.d.ts.map +1 -0
- package/dist/indexer/worker.js +59 -0
- package/dist/indexer/worker.js.map +1 -0
- package/dist/indexer/workerPool.d.ts +20 -0
- package/dist/indexer/workerPool.d.ts.map +1 -0
- package/dist/indexer/workerPool.js +93 -0
- package/dist/indexer/workerPool.js.map +1 -0
- package/dist/main.d.ts +2 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +111 -0
- package/dist/main.js.map +1 -0
- package/dist/mcp/errors.d.ts +40 -0
- package/dist/mcp/errors.d.ts.map +1 -0
- package/dist/mcp/errors.js +66 -0
- package/dist/mcp/errors.js.map +1 -0
- package/dist/mcp/resources.d.ts +24 -0
- package/dist/mcp/resources.d.ts.map +1 -0
- package/dist/mcp/resources.js +140 -0
- package/dist/mcp/resources.js.map +1 -0
- package/dist/mcp/telemetry.d.ts +67 -0
- package/dist/mcp/telemetry.d.ts.map +1 -0
- package/dist/mcp/telemetry.js +128 -0
- package/dist/mcp/telemetry.js.map +1 -0
- package/dist/mcp/tools/agent.d.ts +241 -0
- package/dist/mcp/tools/agent.d.ts.map +1 -0
- package/dist/mcp/tools/agent.js +113 -0
- package/dist/mcp/tools/agent.js.map +1 -0
- package/dist/mcp/tools/code.d.ts +32 -0
- package/dist/mcp/tools/code.d.ts.map +1 -0
- package/dist/mcp/tools/code.js +388 -0
- package/dist/mcp/tools/code.js.map +1 -0
- package/dist/mcp/tools/delta.d.ts +12 -0
- package/dist/mcp/tools/delta.d.ts.map +1 -0
- package/dist/mcp/tools/delta.js +82 -0
- package/dist/mcp/tools/delta.js.map +1 -0
- package/dist/mcp/tools/index.d.ts +3 -0
- package/dist/mcp/tools/index.d.ts.map +1 -0
- package/dist/mcp/tools/index.js +35 -0
- package/dist/mcp/tools/index.js.map +1 -0
- package/dist/mcp/tools/policy.d.ts +20 -0
- package/dist/mcp/tools/policy.d.ts.map +1 -0
- package/dist/mcp/tools/policy.js +67 -0
- package/dist/mcp/tools/policy.js.map +1 -0
- package/dist/mcp/tools/prRisk.d.ts +34 -0
- package/dist/mcp/tools/prRisk.d.ts.map +1 -0
- package/dist/mcp/tools/prRisk.js +304 -0
- package/dist/mcp/tools/prRisk.js.map +1 -0
- package/dist/mcp/tools/repo.d.ts +46 -0
- package/dist/mcp/tools/repo.d.ts.map +1 -0
- package/dist/mcp/tools/repo.js +224 -0
- package/dist/mcp/tools/repo.js.map +1 -0
- package/dist/mcp/tools/slice.d.ts +44 -0
- package/dist/mcp/tools/slice.d.ts.map +1 -0
- package/dist/mcp/tools/slice.js +688 -0
- package/dist/mcp/tools/slice.js.map +1 -0
- package/dist/mcp/tools/symbol.d.ts +21 -0
- package/dist/mcp/tools/symbol.d.ts.map +1 -0
- package/dist/mcp/tools/symbol.js +416 -0
- package/dist/mcp/tools/symbol.js.map +1 -0
- package/dist/mcp/tools.d.ts +6003 -0
- package/dist/mcp/tools.d.ts.map +1 -0
- package/dist/mcp/tools.js +932 -0
- package/dist/mcp/tools.js.map +1 -0
- package/dist/mcp/types.d.ts +500 -0
- package/dist/mcp/types.d.ts.map +1 -0
- package/dist/mcp/types.js +2 -0
- package/dist/mcp/types.js.map +1 -0
- package/dist/policy/engine.d.ts +21 -0
- package/dist/policy/engine.d.ts.map +1 -0
- package/dist/policy/engine.js +477 -0
- package/dist/policy/engine.js.map +1 -0
- package/dist/policy/types.d.ts +73 -0
- package/dist/policy/types.d.ts.map +1 -0
- package/dist/policy/types.js +12 -0
- package/dist/policy/types.js.map +1 -0
- package/dist/server.d.ts +17 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +136 -0
- package/dist/server.js.map +1 -0
- package/dist/sync/pull.d.ts +4 -0
- package/dist/sync/pull.d.ts.map +1 -0
- package/dist/sync/pull.js +113 -0
- package/dist/sync/pull.js.map +1 -0
- package/dist/sync/sync.d.ts +6 -0
- package/dist/sync/sync.d.ts.map +1 -0
- package/dist/sync/sync.js +244 -0
- package/dist/sync/sync.js.map +1 -0
- package/dist/sync/types.d.ts +136 -0
- package/dist/sync/types.d.ts.map +1 -0
- package/dist/sync/types.js +2 -0
- package/dist/sync/types.js.map +1 -0
- package/dist/ts/diagnostics.d.ts +61 -0
- package/dist/ts/diagnostics.d.ts.map +1 -0
- package/dist/ts/diagnostics.js +259 -0
- package/dist/ts/diagnostics.js.map +1 -0
- package/dist/ts/mapping.d.ts +27 -0
- package/dist/ts/mapping.d.ts.map +1 -0
- package/dist/ts/mapping.js +68 -0
- package/dist/ts/mapping.js.map +1 -0
- package/dist/util/asyncFs.d.ts +103 -0
- package/dist/util/asyncFs.d.ts.map +1 -0
- package/dist/util/asyncFs.js +133 -0
- package/dist/util/asyncFs.js.map +1 -0
- package/dist/util/concurrency.d.ts +77 -0
- package/dist/util/concurrency.d.ts.map +1 -0
- package/dist/util/concurrency.js +146 -0
- package/dist/util/concurrency.js.map +1 -0
- package/dist/util/depLabels.d.ts +3 -0
- package/dist/util/depLabels.d.ts.map +1 -0
- package/dist/util/depLabels.js +19 -0
- package/dist/util/depLabels.js.map +1 -0
- package/dist/util/findPackageRoot.d.ts +7 -0
- package/dist/util/findPackageRoot.d.ts.map +1 -0
- package/dist/util/findPackageRoot.js +21 -0
- package/dist/util/findPackageRoot.js.map +1 -0
- package/dist/util/hashing.d.ts +9 -0
- package/dist/util/hashing.d.ts.map +1 -0
- package/dist/util/hashing.js +37 -0
- package/dist/util/hashing.js.map +1 -0
- package/dist/util/logger.d.ts +14 -0
- package/dist/util/logger.d.ts.map +1 -0
- package/dist/util/logger.js +51 -0
- package/dist/util/logger.js.map +1 -0
- package/dist/util/paths.d.ts +6 -0
- package/dist/util/paths.d.ts.map +1 -0
- package/dist/util/paths.js +79 -0
- package/dist/util/paths.js.map +1 -0
- package/dist/util/time.d.ts +4 -0
- package/dist/util/time.d.ts.map +1 -0
- package/dist/util/time.js +20 -0
- package/dist/util/time.js.map +1 -0
- package/dist/util/tokenize.d.ts +5 -0
- package/dist/util/tokenize.d.ts.map +1 -0
- package/dist/util/tokenize.js +30 -0
- package/dist/util/tokenize.js.map +1 -0
- package/dist/util/truncation.d.ts +38 -0
- package/dist/util/truncation.d.ts.map +1 -0
- package/dist/util/truncation.js +259 -0
- package/dist/util/truncation.js.map +1 -0
- package/migrations/.gitkeep +1 -0
- package/migrations/0001_init.sql +61 -0
- package/migrations/0002_edges_indexes.sql +2 -0
- package/migrations/0003_versions.sql +22 -0
- package/migrations/0004_metrics_audit.sql +23 -0
- package/migrations/0005_slice_handles.sql +15 -0
- package/migrations/0006_content_addressed.sql +29 -0
- package/migrations/0007_add_language_to_symbols.sql +28 -0
- package/migrations/0008_performance_indexes.sql +21 -0
- package/migrations/0009_fix_edge_fks.sql +37 -0
- package/migrations/0010_standardize_fks.sql +35 -0
- package/migrations/0011_add_directory_column.sql +20 -0
- package/migrations/0012_symbol_references.sql +16 -0
- package/migrations/0013_sync_artifacts.sql +17 -0
- package/package.json +107 -0
- package/templates/CLAUDE.md.template +179 -0
- package/templates/README.md +228 -0
- package/templates/claude-code.json +54 -0
- package/templates/codex.json +55 -0
- package/templates/gemini.json +66 -0
- package/templates/opencode.json +90 -0
- package/templates/plugin-template/LICENSE +21 -0
- package/templates/plugin-template/README.md +309 -0
- package/templates/plugin-template/index.ts +160 -0
- package/templates/plugin-template/package.json +31 -0
- package/templates/plugin-template/test/plugin.test.ts +186 -0
- package/templates/plugin-template/tsconfig.json +21 -0
|
@@ -0,0 +1,379 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Constants for SDL-MCP
|
|
3
|
+
*
|
|
4
|
+
* This file defines all named constants used throughout the codebase.
|
|
5
|
+
* Magic numbers have been extracted to improve maintainability and
|
|
6
|
+
* provide clear documentation for configuration values.
|
|
7
|
+
*/
|
|
8
|
+
// ============================================================================
|
|
9
|
+
// Database & Query Constants
|
|
10
|
+
// ============================================================================
|
|
11
|
+
/**
|
|
12
|
+
* Timeout for database busy state in milliseconds.
|
|
13
|
+
* SQLite returns SQLITE_BUSY if the database is locked; this sets how long
|
|
14
|
+
* to wait before giving up.
|
|
15
|
+
*/
|
|
16
|
+
export const DB_BUSY_TIMEOUT_MS = 5000;
|
|
17
|
+
/**
|
|
18
|
+
* Maximum number of prepared SQL statements to cache.
|
|
19
|
+
* Caching improves performance by avoiding statement recompilation.
|
|
20
|
+
*/
|
|
21
|
+
export const MAX_STATEMENT_CACHE_SIZE = 500;
|
|
22
|
+
/**
|
|
23
|
+
* Number of rows to insert in a single batch transaction.
|
|
24
|
+
* SQLite performs better with batched inserts; this size balances
|
|
25
|
+
* memory usage with transaction efficiency.
|
|
26
|
+
*/
|
|
27
|
+
export const DB_CHUNK_SIZE = 500;
|
|
28
|
+
/**
|
|
29
|
+
* Default limit for database query results.
|
|
30
|
+
*/
|
|
31
|
+
export const DB_QUERY_LIMIT_DEFAULT = 50;
|
|
32
|
+
/**
|
|
33
|
+
* Maximum limit for database query results.
|
|
34
|
+
*/
|
|
35
|
+
export const DB_QUERY_LIMIT_MAX = 100;
|
|
36
|
+
// ============================================================================
|
|
37
|
+
// Code Display & Window Constants
|
|
38
|
+
// ============================================================================
|
|
39
|
+
/**
|
|
40
|
+
* Default maximum number of lines to return in hot path excerpts.
|
|
41
|
+
*/
|
|
42
|
+
export const DEFAULT_MAX_LINES_HOTPATH = 50;
|
|
43
|
+
/**
|
|
44
|
+
* Default maximum token budget for hot path excerpts.
|
|
45
|
+
*/
|
|
46
|
+
export const DEFAULT_MAX_TOKENS_HOTPATH = 1000;
|
|
47
|
+
/**
|
|
48
|
+
* Default maximum number of lines to return in code skeletons.
|
|
49
|
+
*/
|
|
50
|
+
export const DEFAULT_MAX_LINES_SKELETON = 100;
|
|
51
|
+
/**
|
|
52
|
+
* Default maximum token budget for code skeletons.
|
|
53
|
+
*/
|
|
54
|
+
export const DEFAULT_MAX_TOKENS_SKELETON = 2000;
|
|
55
|
+
/**
|
|
56
|
+
* Maximum lines for detailed code skeletons.
|
|
57
|
+
*/
|
|
58
|
+
export const DEFAULT_MAX_LINES_SKELETON_DETAILED = 200;
|
|
59
|
+
/**
|
|
60
|
+
* Maximum token budget for detailed code skeletons.
|
|
61
|
+
*/
|
|
62
|
+
export const DEFAULT_MAX_TOKENS_SKELETON_DETAILED = 5000;
|
|
63
|
+
/**
|
|
64
|
+
* Default number of context lines to include around matched identifiers.
|
|
65
|
+
*/
|
|
66
|
+
export const DEFAULT_CONTEXT_LINES = 3;
|
|
67
|
+
/**
|
|
68
|
+
* Default maximum number of lines to return in code window requests.
|
|
69
|
+
*/
|
|
70
|
+
export const DEFAULT_MAX_WINDOW_LINES = 180;
|
|
71
|
+
/**
|
|
72
|
+
* Default maximum token budget for code window requests.
|
|
73
|
+
*/
|
|
74
|
+
export const DEFAULT_MAX_WINDOW_TOKENS = 1400;
|
|
75
|
+
// ============================================================================
|
|
76
|
+
// Graph & Slice Constants
|
|
77
|
+
// ============================================================================
|
|
78
|
+
/**
|
|
79
|
+
* Default maximum number of symbol cards to include in a graph slice.
|
|
80
|
+
* Tightened from 300 to 60 to reduce token cost per slice response.
|
|
81
|
+
*/
|
|
82
|
+
export const DEFAULT_MAX_CARDS = 60;
|
|
83
|
+
/**
|
|
84
|
+
* Default maximum estimated token budget for graph slices.
|
|
85
|
+
*/
|
|
86
|
+
export const DEFAULT_MAX_TOKENS_SLICE = 12000;
|
|
87
|
+
/**
|
|
88
|
+
* Maximum size of the frontier during beam search.
|
|
89
|
+
*/
|
|
90
|
+
export const MAX_FRONTIER = 1000;
|
|
91
|
+
/**
|
|
92
|
+
* Maximum number of start nodes sourced from free-form task text.
|
|
93
|
+
*/
|
|
94
|
+
export const TASK_TEXT_START_NODE_MAX = 40;
|
|
95
|
+
/**
|
|
96
|
+
* Maximum number of distinct task-text tokens considered for start-node seeding.
|
|
97
|
+
*/
|
|
98
|
+
export const TASK_TEXT_TOKEN_MAX = 24;
|
|
99
|
+
/**
|
|
100
|
+
* Maximum number of symbol matches to pull per task-text token.
|
|
101
|
+
*/
|
|
102
|
+
export const TASK_TEXT_TOKEN_QUERY_LIMIT = 6;
|
|
103
|
+
/**
|
|
104
|
+
* Minimum token length required for task-text seeding.
|
|
105
|
+
*/
|
|
106
|
+
export const TASK_TEXT_MIN_TOKEN_LENGTH = 3;
|
|
107
|
+
/**
|
|
108
|
+
* Max promoted first-hop dependencies (call/import) per explicit entry symbol.
|
|
109
|
+
*/
|
|
110
|
+
export const ENTRY_FIRST_HOP_MAX_PER_SYMBOL = 4;
|
|
111
|
+
/**
|
|
112
|
+
* Max same-file sibling symbols to promote per explicit entry symbol.
|
|
113
|
+
*/
|
|
114
|
+
export const ENTRY_SIBLING_MAX_PER_SYMBOL = 3;
|
|
115
|
+
/**
|
|
116
|
+
* Minimum shared prefix length for sibling promotion based on name similarity.
|
|
117
|
+
*/
|
|
118
|
+
export const ENTRY_SIBLING_MIN_SHARED_PREFIX = 6;
|
|
119
|
+
/**
|
|
120
|
+
* Minimum score threshold for including nodes in slice results.
|
|
121
|
+
*/
|
|
122
|
+
export const SLICE_SCORE_THRESHOLD = 0.2;
|
|
123
|
+
/**
|
|
124
|
+
* Number of frontier candidates to include as suggestions when slice is truncated.
|
|
125
|
+
*/
|
|
126
|
+
export const SLICE_FRONTIER_SUGGESTIONS = 10;
|
|
127
|
+
/**
|
|
128
|
+
* Base token cost for including a symbol in a slice estimate.
|
|
129
|
+
*/
|
|
130
|
+
export const SYMBOL_TOKEN_BASE = 50;
|
|
131
|
+
/**
|
|
132
|
+
* Maximum additional tokens to add for symbol summary in slice estimates.
|
|
133
|
+
*/
|
|
134
|
+
export const SYMBOL_TOKEN_ADDITIONAL_MAX = 150;
|
|
135
|
+
/**
|
|
136
|
+
* Maximum token cost for a single symbol card in slice estimates.
|
|
137
|
+
*/
|
|
138
|
+
export const SYMBOL_TOKEN_MAX = 200;
|
|
139
|
+
/**
|
|
140
|
+
* Estimated number of characters per token for rough token counting.
|
|
141
|
+
*/
|
|
142
|
+
export const TOKENS_PER_CHAR_ESTIMATE = 4;
|
|
143
|
+
// ============================================================================
|
|
144
|
+
// File & Content Limits
|
|
145
|
+
// ============================================================================
|
|
146
|
+
/**
|
|
147
|
+
* Maximum file size in bytes to index (2MB).
|
|
148
|
+
* Large files are skipped to prevent memory issues and slow indexing.
|
|
149
|
+
*/
|
|
150
|
+
export const MAX_FILE_BYTES = 2000000;
|
|
151
|
+
/**
|
|
152
|
+
* Maximum length of query strings to show in error messages.
|
|
153
|
+
*/
|
|
154
|
+
export const QUERY_PREVIEW_LENGTH = 50;
|
|
155
|
+
/**
|
|
156
|
+
* Maximum length for tree-sitter query strings.
|
|
157
|
+
*/
|
|
158
|
+
export const GRAMMAR_QUERY_LENGTH = 100;
|
|
159
|
+
// ============================================================================
|
|
160
|
+
// Timeout & Interval Constants
|
|
161
|
+
// ============================================================================
|
|
162
|
+
/**
|
|
163
|
+
* Interval in milliseconds for cleaning up expired slice handles (1 hour).
|
|
164
|
+
*/
|
|
165
|
+
export const CLEANUP_INTERVAL_MS = 3600000;
|
|
166
|
+
/**
|
|
167
|
+
* Time-to-live for slice handles in milliseconds (1 hour).
|
|
168
|
+
*/
|
|
169
|
+
export const SLICE_LEASE_TTL_MS = 3600000;
|
|
170
|
+
/**
|
|
171
|
+
* Debounce delay in milliseconds for file watch events.
|
|
172
|
+
*/
|
|
173
|
+
export const WATCH_DEBOUNCE_MS = 200;
|
|
174
|
+
/**
|
|
175
|
+
* Stability threshold in milliseconds for file watch events.
|
|
176
|
+
*/
|
|
177
|
+
export const WATCH_STABILITY_THRESHOLD_MS = 200;
|
|
178
|
+
/**
|
|
179
|
+
* Poll interval in milliseconds for file watchers.
|
|
180
|
+
*/
|
|
181
|
+
export const WATCH_POLL_INTERVAL_MS = 100;
|
|
182
|
+
// ============================================================================
|
|
183
|
+
// Indexer & Diagnostics Constants
|
|
184
|
+
// ============================================================================
|
|
185
|
+
/**
|
|
186
|
+
* Maximum number of TypeScript errors to report before truncating.
|
|
187
|
+
*/
|
|
188
|
+
export const TS_DIAGNOSTICS_MAX_ERRORS = 50;
|
|
189
|
+
/**
|
|
190
|
+
* Maximum number of watcher errors to accumulate before truncating.
|
|
191
|
+
*/
|
|
192
|
+
export const WATCHER_ERROR_MAX_COUNT = 100;
|
|
193
|
+
// ============================================================================
|
|
194
|
+
// API & Tool Constants
|
|
195
|
+
// ============================================================================
|
|
196
|
+
/**
|
|
197
|
+
* Maximum number of results to return from symbol search.
|
|
198
|
+
*/
|
|
199
|
+
export const SYMBOL_SEARCH_MAX_RESULTS = 1000;
|
|
200
|
+
/**
|
|
201
|
+
* Maximum page size for paginated results.
|
|
202
|
+
*/
|
|
203
|
+
export const PAGE_SIZE_MAX = 100;
|
|
204
|
+
/**
|
|
205
|
+
* Default number of symbols to return from search operations.
|
|
206
|
+
*/
|
|
207
|
+
export const SYMBOL_SEARCH_DEFAULT_LIMIT = 50;
|
|
208
|
+
/**
|
|
209
|
+
* Maximum number of query tokens to fan out when symbol search receives natural-language text.
|
|
210
|
+
*/
|
|
211
|
+
export const SYMBOL_SEARCH_MAX_QUERY_TOKENS = 8;
|
|
212
|
+
/**
|
|
213
|
+
* Minimum token length used for natural-language symbol search tokenization.
|
|
214
|
+
*/
|
|
215
|
+
export const SYMBOL_SEARCH_MIN_QUERY_TOKEN_LENGTH = 3;
|
|
216
|
+
/**
|
|
217
|
+
* Maximum dependency names to include per dependency kind in symbol cards.
|
|
218
|
+
* Trims high-degree symbols so card payloads remain practical.
|
|
219
|
+
*/
|
|
220
|
+
export const SYMBOL_CARD_MAX_DEPS_PER_KIND = 24;
|
|
221
|
+
/**
|
|
222
|
+
* Max deps per kind for lightweight slice cards (non-entry symbols).
|
|
223
|
+
*/
|
|
224
|
+
export const SYMBOL_CARD_MAX_DEPS_PER_KIND_LIGHT = 6;
|
|
225
|
+
/**
|
|
226
|
+
* Maximum number of test references stored in card metrics payload.
|
|
227
|
+
*/
|
|
228
|
+
export const SYMBOL_CARD_MAX_TEST_REFS = 8;
|
|
229
|
+
/**
|
|
230
|
+
* Maximum number of invariants kept in card payload.
|
|
231
|
+
*/
|
|
232
|
+
export const SYMBOL_CARD_MAX_INVARIANTS = 8;
|
|
233
|
+
/**
|
|
234
|
+
* Maximum invariants for lightweight (non-entry) slice cards.
|
|
235
|
+
*/
|
|
236
|
+
export const SYMBOL_CARD_MAX_INVARIANTS_LIGHT = 2;
|
|
237
|
+
/**
|
|
238
|
+
* Maximum number of side effects kept in card payload.
|
|
239
|
+
*/
|
|
240
|
+
export const SYMBOL_CARD_MAX_SIDE_EFFECTS = 8;
|
|
241
|
+
/**
|
|
242
|
+
* Maximum side effects for lightweight (non-entry) slice cards.
|
|
243
|
+
*/
|
|
244
|
+
export const SYMBOL_CARD_MAX_SIDE_EFFECTS_LIGHT = 2;
|
|
245
|
+
/**
|
|
246
|
+
* Maximum summary length stored in symbol card payload.
|
|
247
|
+
*/
|
|
248
|
+
export const SYMBOL_CARD_SUMMARY_MAX_CHARS = 240;
|
|
249
|
+
/**
|
|
250
|
+
* Max summary length for lightweight slice cards.
|
|
251
|
+
*/
|
|
252
|
+
export const SYMBOL_CARD_SUMMARY_MAX_CHARS_LIGHT = 90;
|
|
253
|
+
/**
|
|
254
|
+
* Maximum length for dependency labels in slice cards.
|
|
255
|
+
* Truncates long names to save tokens in wire format.
|
|
256
|
+
*/
|
|
257
|
+
export const DEP_LABEL_MAX_LENGTH = 40;
|
|
258
|
+
/**
|
|
259
|
+
* Default page size for spillover symbol retrieval.
|
|
260
|
+
* Reduced from 50 to 20 to limit per-page token cost.
|
|
261
|
+
*/
|
|
262
|
+
export const SPILLOVER_DEFAULT_PAGE_SIZE = 20;
|
|
263
|
+
/**
|
|
264
|
+
* Length to truncate astFingerprint in standard wire format.
|
|
265
|
+
*/
|
|
266
|
+
export const AST_FINGERPRINT_WIRE_LENGTH = 16;
|
|
267
|
+
/**
|
|
268
|
+
* Length to truncate astFingerprint in compact v2 wire format.
|
|
269
|
+
*/
|
|
270
|
+
export const AST_FINGERPRINT_COMPACT_WIRE_LENGTH = 8;
|
|
271
|
+
/**
|
|
272
|
+
* Length to truncate symbol IDs in compact v2 wire format.
|
|
273
|
+
* 16 hex chars = 64 bits. Collision probability among 1000 symbols is ~10^-14.
|
|
274
|
+
*/
|
|
275
|
+
export const SYMBOL_ID_COMPACT_WIRE_LENGTH = 16;
|
|
276
|
+
// ============================================================================
|
|
277
|
+
// Policy & Weights Constants
|
|
278
|
+
// ============================================================================
|
|
279
|
+
/**
|
|
280
|
+
* Priority weight for window size limit policy (highest).
|
|
281
|
+
*/
|
|
282
|
+
export const POLICY_PRIORITY_WINDOW_SIZE_LIMIT = 100;
|
|
283
|
+
/**
|
|
284
|
+
* Priority weight for identifier requirement policy.
|
|
285
|
+
*/
|
|
286
|
+
export const POLICY_PRIORITY_IDENTIFIERS_REQUIRED = 90;
|
|
287
|
+
/**
|
|
288
|
+
* Priority weight for budget enforcement policy.
|
|
289
|
+
*/
|
|
290
|
+
export const POLICY_PRIORITY_BUDGET_CAPS = 80;
|
|
291
|
+
/**
|
|
292
|
+
* Priority weight for break-glass override policy (lowest).
|
|
293
|
+
*/
|
|
294
|
+
export const POLICY_PRIORITY_BREAK_GLASS = 10;
|
|
295
|
+
/**
|
|
296
|
+
* Priority weight for default deny raw code policy.
|
|
297
|
+
*/
|
|
298
|
+
export const POLICY_PRIORITY_DEFAULT_DENY_RAW = 5;
|
|
299
|
+
/**
|
|
300
|
+
* Minimum Node.js major version required.
|
|
301
|
+
*/
|
|
302
|
+
export const NODE_MIN_MAJOR_VERSION = 18;
|
|
303
|
+
// ============================================================================
|
|
304
|
+
// CLI & Server Constants
|
|
305
|
+
// ============================================================================
|
|
306
|
+
/**
|
|
307
|
+
* Default HTTP port for the MCP server.
|
|
308
|
+
*/
|
|
309
|
+
export const DEFAULT_HTTP_PORT = 3000;
|
|
310
|
+
// ============================================================================
|
|
311
|
+
// Configuration Defaults
|
|
312
|
+
// ============================================================================
|
|
313
|
+
/**
|
|
314
|
+
* Default concurrency level for indexing operations.
|
|
315
|
+
* Set to 8 for modern SSD systems; parsing and SQLite are the actual bottlenecks.
|
|
316
|
+
*/
|
|
317
|
+
export const DEFAULT_INDEXING_CONCURRENCY = 8;
|
|
318
|
+
/**
|
|
319
|
+
* Maximum concurrency level for indexing operations.
|
|
320
|
+
*/
|
|
321
|
+
export const MAX_INDEXING_CONCURRENCY = 10;
|
|
322
|
+
/**
|
|
323
|
+
* Default timeout for operations in milliseconds.
|
|
324
|
+
*/
|
|
325
|
+
export const DEFAULT_OPERATION_TIMEOUT_MS = 2000;
|
|
326
|
+
/**
|
|
327
|
+
* Minimum operation timeout in milliseconds.
|
|
328
|
+
*/
|
|
329
|
+
export const MIN_OPERATION_TIMEOUT_MS = 100;
|
|
330
|
+
// ============================================================================
|
|
331
|
+
// Regex Pattern Constants
|
|
332
|
+
// ============================================================================
|
|
333
|
+
/**
|
|
334
|
+
* Minimum length for AWS Access Key ID in regex pattern.
|
|
335
|
+
*/
|
|
336
|
+
export const AWS_KEY_MIN_LENGTH = 16;
|
|
337
|
+
/**
|
|
338
|
+
* Maximum length for AWS Access Key ID in regex pattern.
|
|
339
|
+
*/
|
|
340
|
+
export const AWS_KEY_MAX_LENGTH = 32;
|
|
341
|
+
/**
|
|
342
|
+
* Length of GitHub personal access token in regex pattern.
|
|
343
|
+
*/
|
|
344
|
+
export const GITHUB_TOKEN_LENGTH = 36;
|
|
345
|
+
// ============================================================================
|
|
346
|
+
// Stability & Diff Constants
|
|
347
|
+
// ============================================================================
|
|
348
|
+
/**
|
|
349
|
+
* Stability score contribution for stable interface.
|
|
350
|
+
*/
|
|
351
|
+
export const STABILITY_SCORE_INTERFACE = 33;
|
|
352
|
+
/**
|
|
353
|
+
* Stability score contribution for stable behavior.
|
|
354
|
+
*/
|
|
355
|
+
export const STABILITY_SCORE_BEHAVIOR = 33;
|
|
356
|
+
/**
|
|
357
|
+
* Stability score contribution for stable side effects.
|
|
358
|
+
*/
|
|
359
|
+
export const STABILITY_SCORE_SIDE_EFFECTS = 34;
|
|
360
|
+
// ============================================================================
|
|
361
|
+
// Cache Constants
|
|
362
|
+
// ============================================================================
|
|
363
|
+
/**
|
|
364
|
+
* Default maximum number of symbol card entries in cache.
|
|
365
|
+
*/
|
|
366
|
+
export const DEFAULT_SYMBOL_CARD_CACHE_MAX_ENTRIES = 2000;
|
|
367
|
+
/**
|
|
368
|
+
* Default maximum size of symbol card cache in bytes (100MB).
|
|
369
|
+
*/
|
|
370
|
+
export const DEFAULT_SYMBOL_CARD_CACHE_MAX_SIZE_BYTES = 100 * 1024 * 1024;
|
|
371
|
+
/**
|
|
372
|
+
* Default maximum number of graph slice entries in cache.
|
|
373
|
+
*/
|
|
374
|
+
export const DEFAULT_GRAPH_SLICE_CACHE_MAX_ENTRIES = 1000;
|
|
375
|
+
/**
|
|
376
|
+
* Default maximum size of graph slice cache in bytes (50MB).
|
|
377
|
+
*/
|
|
378
|
+
export const DEFAULT_GRAPH_SLICE_CACHE_MAX_SIZE_BYTES = 50 * 1024 * 1024;
|
|
379
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/config/constants.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,+EAA+E;AAC/E,6BAA6B;AAC7B,+EAA+E;AAE/E;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,CAAC;AAEvC;;;GAGG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,CAAC;AAE5C;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,CAAC;AAEjC;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,EAAE,CAAC;AAEzC;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAEtC,+EAA+E;AAC/E,kCAAkC;AAClC,+EAA+E;AAE/E;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,EAAE,CAAC;AAE5C;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,IAAI,CAAC;AAE/C;;GAEG;AACH,MAAM,CAAC,M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C;AAE1D;;GAEG;AACH,MAAM,CAAC,MAAM,wCAAwC,GAAG,GAAG,GAAG,IAAI,GAAG,IAAI,CAAC;AAE1E;;GAEG;AACH,MAAM,CAAC,MAAM,qCAAqC,GAAG,IAAI,CAAC;AAE1D;;GAEG;AACH,MAAM,CAAC,MAAM,wCAAwC,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loadConfig.d.ts","sourceRoot":"","sources":["../../src/config/loadConfig.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAmB,MAAM,YAAY,CAAC;AAgCxD,wBAAgB,UAAU,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CA4CzD"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { readFileSync } from "fs";
|
|
2
|
+
import { resolve, dirname } from "path";
|
|
3
|
+
import { fileURLToPath } from "url";
|
|
4
|
+
import { AppConfigSchema } from "./types.js";
|
|
5
|
+
import { findPackageRoot } from "../util/findPackageRoot.js";
|
|
6
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = dirname(__filename);
|
|
8
|
+
function expandEnvVars(obj) {
|
|
9
|
+
if (typeof obj === "string") {
|
|
10
|
+
return obj.replace(/\$\{([^}]+)\}/g, (_, varName) => {
|
|
11
|
+
const value = process.env[varName];
|
|
12
|
+
if (value === undefined) {
|
|
13
|
+
throw new Error(`Environment variable "${varName}" is not set`);
|
|
14
|
+
}
|
|
15
|
+
return value;
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
if (Array.isArray(obj)) {
|
|
19
|
+
return obj.map((item) => expandEnvVars(item));
|
|
20
|
+
}
|
|
21
|
+
if (obj !== null && typeof obj === "object") {
|
|
22
|
+
const result = {};
|
|
23
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
24
|
+
result[key] = expandEnvVars(value);
|
|
25
|
+
}
|
|
26
|
+
return result;
|
|
27
|
+
}
|
|
28
|
+
return obj;
|
|
29
|
+
}
|
|
30
|
+
export function loadConfig(configPath) {
|
|
31
|
+
const packageRoot = findPackageRoot(__dirname);
|
|
32
|
+
const defaultConfigPath = resolve(packageRoot, "config", "sdlmcp.config.json");
|
|
33
|
+
const envConfigPath = process.env.SDL_CONFIG ?? process.env.SDL_CONFIG_PATH;
|
|
34
|
+
const filePath = configPath
|
|
35
|
+
? resolve(configPath)
|
|
36
|
+
: envConfigPath
|
|
37
|
+
? resolve(envConfigPath)
|
|
38
|
+
: defaultConfigPath;
|
|
39
|
+
try {
|
|
40
|
+
const rawContent = readFileSync(filePath, "utf-8");
|
|
41
|
+
let parsedConfig;
|
|
42
|
+
try {
|
|
43
|
+
parsedConfig = JSON.parse(rawContent);
|
|
44
|
+
}
|
|
45
|
+
catch (err) {
|
|
46
|
+
if (err instanceof SyntaxError) {
|
|
47
|
+
throw new Error(`Invalid JSON in config file: ${filePath}`);
|
|
48
|
+
}
|
|
49
|
+
throw err;
|
|
50
|
+
}
|
|
51
|
+
const expandedConfig = expandEnvVars(parsedConfig);
|
|
52
|
+
const result = AppConfigSchema.safeParse(expandedConfig);
|
|
53
|
+
if (!result.success) {
|
|
54
|
+
const errors = result.error.errors
|
|
55
|
+
.map((e) => {
|
|
56
|
+
const path = e.path.join(".");
|
|
57
|
+
return ` - ${path}: ${e.message}`;
|
|
58
|
+
})
|
|
59
|
+
.join("\n");
|
|
60
|
+
throw new Error(`Config validation failed:\n${errors}`);
|
|
61
|
+
}
|
|
62
|
+
return result.data;
|
|
63
|
+
}
|
|
64
|
+
catch (err) {
|
|
65
|
+
if (err instanceof Error && "code" in err && err.code === "ENOENT") {
|
|
66
|
+
throw new Error(`Config file not found: ${filePath}`);
|
|
67
|
+
}
|
|
68
|
+
throw err;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=loadConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load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