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,932 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { SYMBOL_SEARCH_MAX_RESULTS, PAGE_SIZE_MAX, DEFAULT_MAX_WINDOW_LINES, DEFAULT_MAX_WINDOW_TOKENS, } from "../config/constants.js";
|
|
3
|
+
const RangeSchema = z.object({
|
|
4
|
+
startLine: z.number().int().min(0),
|
|
5
|
+
startCol: z.number().int().min(0),
|
|
6
|
+
endLine: z.number().int().min(0),
|
|
7
|
+
endCol: z.number().int().min(0),
|
|
8
|
+
});
|
|
9
|
+
const SymbolSignatureParamSchema = z.object({
|
|
10
|
+
name: z.string(),
|
|
11
|
+
type: z.string().optional(),
|
|
12
|
+
});
|
|
13
|
+
const SymbolSignatureSchema = z.object({
|
|
14
|
+
name: z.string(),
|
|
15
|
+
params: z.array(SymbolSignatureParamSchema).optional(),
|
|
16
|
+
returns: z.string().optional(),
|
|
17
|
+
generics: z.array(z.string()).optional(),
|
|
18
|
+
overloads: z.array(z.string()).optional(),
|
|
19
|
+
});
|
|
20
|
+
const SymbolDepsSchema = z.object({
|
|
21
|
+
imports: z.array(z.string()),
|
|
22
|
+
calls: z.array(z.string()),
|
|
23
|
+
});
|
|
24
|
+
const SymbolMetricsSchema = z.object({
|
|
25
|
+
fanIn: z.number().int().min(0).optional(),
|
|
26
|
+
fanOut: z.number().int().min(0).optional(),
|
|
27
|
+
churn30d: z.number().int().min(0).optional(),
|
|
28
|
+
testRefs: z.array(z.string()).optional(),
|
|
29
|
+
});
|
|
30
|
+
const SymbolCardVersionSchema = z.object({
|
|
31
|
+
ledgerVersion: z.string(),
|
|
32
|
+
astFingerprint: z.string(),
|
|
33
|
+
});
|
|
34
|
+
const SliceSymbolCardVersionSchema = z.object({
|
|
35
|
+
astFingerprint: z.string(),
|
|
36
|
+
});
|
|
37
|
+
const CardDetailLevelSchema = z.enum(["compact", "full"]);
|
|
38
|
+
const SymbolCardSchema = z.object({
|
|
39
|
+
symbolId: z.string(),
|
|
40
|
+
repoId: z.string(),
|
|
41
|
+
file: z.string(),
|
|
42
|
+
range: RangeSchema,
|
|
43
|
+
kind: z.enum([
|
|
44
|
+
"function",
|
|
45
|
+
"class",
|
|
46
|
+
"interface",
|
|
47
|
+
"type",
|
|
48
|
+
"module",
|
|
49
|
+
"method",
|
|
50
|
+
"constructor",
|
|
51
|
+
"variable",
|
|
52
|
+
]),
|
|
53
|
+
name: z.string(),
|
|
54
|
+
exported: z.boolean(),
|
|
55
|
+
visibility: z
|
|
56
|
+
.enum(["public", "protected", "private", "exported", "internal"])
|
|
57
|
+
.optional(),
|
|
58
|
+
signature: SymbolSignatureSchema.optional(),
|
|
59
|
+
summary: z.string().optional(),
|
|
60
|
+
invariants: z.array(z.string()).optional(),
|
|
61
|
+
sideEffects: z.array(z.string()).optional(),
|
|
62
|
+
deps: SymbolDepsSchema,
|
|
63
|
+
metrics: SymbolMetricsSchema.optional(),
|
|
64
|
+
detailLevel: CardDetailLevelSchema.optional(),
|
|
65
|
+
etag: z.string().optional(),
|
|
66
|
+
version: SymbolCardVersionSchema,
|
|
67
|
+
});
|
|
68
|
+
const SliceSymbolCardSchema = SymbolCardSchema.omit({
|
|
69
|
+
repoId: true,
|
|
70
|
+
etag: true,
|
|
71
|
+
version: true,
|
|
72
|
+
}).extend({
|
|
73
|
+
version: SliceSymbolCardVersionSchema,
|
|
74
|
+
});
|
|
75
|
+
const CompressedEdgeSchema = z.tuple([
|
|
76
|
+
z.number().int().min(0),
|
|
77
|
+
z.number().int().min(0),
|
|
78
|
+
z.enum(["import", "call", "config"]),
|
|
79
|
+
z.number(),
|
|
80
|
+
]);
|
|
81
|
+
const SliceBudgetSchema = z.object({
|
|
82
|
+
maxCards: z.number().int().min(1).optional(),
|
|
83
|
+
maxEstimatedTokens: z.number().int().min(1).optional(),
|
|
84
|
+
});
|
|
85
|
+
const RequiredSliceBudgetSchema = z.object({
|
|
86
|
+
maxCards: z.number().int().min(1),
|
|
87
|
+
maxEstimatedTokens: z.number().int().min(1),
|
|
88
|
+
});
|
|
89
|
+
const FrontierItemSchema = z.object({
|
|
90
|
+
symbolId: z.string(),
|
|
91
|
+
score: z.number(),
|
|
92
|
+
why: z.string(),
|
|
93
|
+
});
|
|
94
|
+
const SliceCardRefSchema = z.object({
|
|
95
|
+
symbolId: z.string(),
|
|
96
|
+
etag: z.string(),
|
|
97
|
+
detailLevel: CardDetailLevelSchema,
|
|
98
|
+
});
|
|
99
|
+
const SliceTruncationSchema = z.object({
|
|
100
|
+
truncated: z.boolean(),
|
|
101
|
+
droppedCards: z.number().int().min(0),
|
|
102
|
+
droppedEdges: z.number().int().min(0),
|
|
103
|
+
howToResume: z
|
|
104
|
+
.object({
|
|
105
|
+
type: z.enum(["cursor", "token"]),
|
|
106
|
+
value: z.union([z.string(), z.number()]),
|
|
107
|
+
})
|
|
108
|
+
.nullable(),
|
|
109
|
+
});
|
|
110
|
+
const SliceBuildWireFormatSchema = z.enum(["standard", "compact"]);
|
|
111
|
+
const SliceBuildWireFormatVersionSchema = z.union([z.literal(1), z.literal(2)]);
|
|
112
|
+
const GraphSliceSchema = z.object({
|
|
113
|
+
repoId: z.string(),
|
|
114
|
+
versionId: z.string(),
|
|
115
|
+
budget: RequiredSliceBudgetSchema,
|
|
116
|
+
startSymbols: z.array(z.string()),
|
|
117
|
+
symbolIndex: z.array(z.string()),
|
|
118
|
+
cards: z.array(SliceSymbolCardSchema),
|
|
119
|
+
cardRefs: z.array(SliceCardRefSchema).optional(),
|
|
120
|
+
edges: z.array(CompressedEdgeSchema),
|
|
121
|
+
frontier: z.array(FrontierItemSchema).optional(),
|
|
122
|
+
truncation: SliceTruncationSchema.optional(),
|
|
123
|
+
});
|
|
124
|
+
const CompactRangeSchema = z.tuple([
|
|
125
|
+
z.number().int().min(0),
|
|
126
|
+
z.number().int().min(0),
|
|
127
|
+
z.number().int().min(0),
|
|
128
|
+
z.number().int().min(0),
|
|
129
|
+
]);
|
|
130
|
+
const CompactSymbolDepsSchema = z.object({
|
|
131
|
+
i: z.array(z.string()),
|
|
132
|
+
c: z.array(z.string()),
|
|
133
|
+
});
|
|
134
|
+
const CompactSymbolMetricsSchema = z.object({
|
|
135
|
+
fi: z.number().optional(),
|
|
136
|
+
fo: z.number().optional(),
|
|
137
|
+
ch: z.number().optional(),
|
|
138
|
+
t: z.array(z.string()).optional(),
|
|
139
|
+
});
|
|
140
|
+
const CompactSliceSymbolCardSchema = z.object({
|
|
141
|
+
sid: z.string(),
|
|
142
|
+
f: z.string(),
|
|
143
|
+
r: CompactRangeSchema,
|
|
144
|
+
k: z.enum([
|
|
145
|
+
"function",
|
|
146
|
+
"class",
|
|
147
|
+
"interface",
|
|
148
|
+
"type",
|
|
149
|
+
"module",
|
|
150
|
+
"method",
|
|
151
|
+
"constructor",
|
|
152
|
+
"variable",
|
|
153
|
+
]),
|
|
154
|
+
n: z.string(),
|
|
155
|
+
x: z.boolean(),
|
|
156
|
+
v: z
|
|
157
|
+
.enum(["public", "protected", "private", "exported", "internal"])
|
|
158
|
+
.optional(),
|
|
159
|
+
sig: SymbolSignatureSchema.optional(),
|
|
160
|
+
sum: z.string().optional(),
|
|
161
|
+
inv: z.array(z.string()).optional(),
|
|
162
|
+
se: z.array(z.string()).optional(),
|
|
163
|
+
d: CompactSymbolDepsSchema,
|
|
164
|
+
m: CompactSymbolMetricsSchema.optional(),
|
|
165
|
+
dl: CardDetailLevelSchema.optional(),
|
|
166
|
+
af: z.string(),
|
|
167
|
+
});
|
|
168
|
+
const CompactSliceCardRefSchema = z.object({
|
|
169
|
+
sid: z.string(),
|
|
170
|
+
e: z.string(),
|
|
171
|
+
dl: CardDetailLevelSchema.optional(),
|
|
172
|
+
});
|
|
173
|
+
const CompactFrontierItemSchema = z.object({
|
|
174
|
+
sid: z.string(),
|
|
175
|
+
s: z.number(),
|
|
176
|
+
w: z.string(),
|
|
177
|
+
});
|
|
178
|
+
const CompactSliceResumeSchema = z.object({
|
|
179
|
+
t: z.enum(["cursor", "token"]),
|
|
180
|
+
v: z.union([z.string(), z.number()]),
|
|
181
|
+
});
|
|
182
|
+
const CompactSliceTruncationSchema = z.object({
|
|
183
|
+
tr: z.boolean(),
|
|
184
|
+
dc: z.number().int().min(0),
|
|
185
|
+
de: z.number().int().min(0),
|
|
186
|
+
res: CompactSliceResumeSchema.optional(),
|
|
187
|
+
});
|
|
188
|
+
const CompactSliceBudgetSchema = z.object({
|
|
189
|
+
mc: z.number().int().min(1),
|
|
190
|
+
mt: z.number().int().min(1),
|
|
191
|
+
});
|
|
192
|
+
const CompactGraphSliceSchema = z.object({
|
|
193
|
+
wf: z.literal("compact"),
|
|
194
|
+
wv: z.literal(1),
|
|
195
|
+
rid: z.string(),
|
|
196
|
+
vid: z.string(),
|
|
197
|
+
b: CompactSliceBudgetSchema,
|
|
198
|
+
ss: z.array(z.string()),
|
|
199
|
+
si: z.array(z.string()),
|
|
200
|
+
c: z.array(CompactSliceSymbolCardSchema),
|
|
201
|
+
cr: z.array(CompactSliceCardRefSchema).optional(),
|
|
202
|
+
e: z.array(CompressedEdgeSchema),
|
|
203
|
+
f: z.array(CompactFrontierItemSchema).optional(),
|
|
204
|
+
t: CompactSliceTruncationSchema.optional(),
|
|
205
|
+
});
|
|
206
|
+
// ============================================================================
|
|
207
|
+
// Compact Wire Format V2 Schemas
|
|
208
|
+
// ============================================================================
|
|
209
|
+
const SymbolKindEnumSchema = z.enum([
|
|
210
|
+
"function",
|
|
211
|
+
"class",
|
|
212
|
+
"interface",
|
|
213
|
+
"type",
|
|
214
|
+
"module",
|
|
215
|
+
"method",
|
|
216
|
+
"constructor",
|
|
217
|
+
"variable",
|
|
218
|
+
]);
|
|
219
|
+
const CompactSliceSymbolCardV2Schema = z.object({
|
|
220
|
+
fi: z.number().int().min(0),
|
|
221
|
+
r: CompactRangeSchema,
|
|
222
|
+
k: SymbolKindEnumSchema,
|
|
223
|
+
n: z.string(),
|
|
224
|
+
x: z.boolean(),
|
|
225
|
+
v: z
|
|
226
|
+
.enum(["public", "protected", "private", "exported", "internal"])
|
|
227
|
+
.optional(),
|
|
228
|
+
sig: SymbolSignatureSchema.optional(),
|
|
229
|
+
sum: z.string().optional(),
|
|
230
|
+
inv: z.array(z.string()).optional(),
|
|
231
|
+
se: z.array(z.string()).optional(),
|
|
232
|
+
d: CompactSymbolDepsSchema,
|
|
233
|
+
m: CompactSymbolMetricsSchema.optional(),
|
|
234
|
+
dl: CardDetailLevelSchema.optional(),
|
|
235
|
+
af: z.string().optional(),
|
|
236
|
+
});
|
|
237
|
+
const CompactFrontierItemV2Schema = z.object({
|
|
238
|
+
ci: z.number().int().min(0),
|
|
239
|
+
s: z.number(),
|
|
240
|
+
w: z.string(),
|
|
241
|
+
});
|
|
242
|
+
const CompactSliceCardRefV2Schema = z.object({
|
|
243
|
+
ci: z.number().int().min(0),
|
|
244
|
+
e: z.string(),
|
|
245
|
+
dl: CardDetailLevelSchema.optional(),
|
|
246
|
+
});
|
|
247
|
+
const CompactEdgeV2Schema = z.tuple([
|
|
248
|
+
z.number().int().min(0),
|
|
249
|
+
z.number().int().min(0),
|
|
250
|
+
z.number().int().min(0),
|
|
251
|
+
z.number(),
|
|
252
|
+
]);
|
|
253
|
+
const CompactGraphSliceV2Schema = z.object({
|
|
254
|
+
wf: z.literal("compact"),
|
|
255
|
+
wv: z.literal(2).optional(),
|
|
256
|
+
rid: z.string().optional(),
|
|
257
|
+
vid: z.string(),
|
|
258
|
+
b: CompactSliceBudgetSchema,
|
|
259
|
+
ss: z.array(z.string()),
|
|
260
|
+
si: z.array(z.string()),
|
|
261
|
+
fp: z.array(z.string()),
|
|
262
|
+
et: z.array(z.string()).optional(),
|
|
263
|
+
c: z.array(CompactSliceSymbolCardV2Schema),
|
|
264
|
+
cr: z.array(CompactSliceCardRefV2Schema).optional(),
|
|
265
|
+
e: z.array(CompactEdgeV2Schema),
|
|
266
|
+
f: z.array(CompactFrontierItemV2Schema).optional(),
|
|
267
|
+
t: CompactSliceTruncationSchema.optional(),
|
|
268
|
+
});
|
|
269
|
+
const DeltaSymbolChangeSchema = z.object({
|
|
270
|
+
symbolId: z.string(),
|
|
271
|
+
changeType: z.enum(["added", "removed", "modified"]),
|
|
272
|
+
signatureDiff: z
|
|
273
|
+
.object({
|
|
274
|
+
before: z.string().optional(),
|
|
275
|
+
after: z.string().optional(),
|
|
276
|
+
})
|
|
277
|
+
.optional(),
|
|
278
|
+
invariantDiff: z
|
|
279
|
+
.object({
|
|
280
|
+
added: z.array(z.string()),
|
|
281
|
+
removed: z.array(z.string()),
|
|
282
|
+
})
|
|
283
|
+
.optional(),
|
|
284
|
+
sideEffectDiff: z
|
|
285
|
+
.object({
|
|
286
|
+
added: z.array(z.string()),
|
|
287
|
+
removed: z.array(z.string()),
|
|
288
|
+
})
|
|
289
|
+
.optional(),
|
|
290
|
+
});
|
|
291
|
+
const BlastRadiusItemSchema = z.object({
|
|
292
|
+
symbolId: z.string(),
|
|
293
|
+
reason: z.string().optional(),
|
|
294
|
+
distance: z.number(),
|
|
295
|
+
rank: z.number(),
|
|
296
|
+
signal: z.enum(["diagnostic", "directDependent", "graph"]),
|
|
297
|
+
});
|
|
298
|
+
const DiagnosticsSummarySchema = z.object({
|
|
299
|
+
totalErrors: z.number().int().min(0),
|
|
300
|
+
totalWarnings: z.number().int().min(0),
|
|
301
|
+
totalInfo: z.number().int().min(0),
|
|
302
|
+
topFiles: z.array(z.object({
|
|
303
|
+
file: z.string(),
|
|
304
|
+
errorCount: z.number().int().min(0),
|
|
305
|
+
})),
|
|
306
|
+
});
|
|
307
|
+
const DiagnosticSuspectSchema = z.object({
|
|
308
|
+
symbolId: z.string(),
|
|
309
|
+
file: z.string(),
|
|
310
|
+
range: z.object({
|
|
311
|
+
startLine: z.number().int().min(0),
|
|
312
|
+
startCol: z.number().int().min(0),
|
|
313
|
+
endLine: z.number().int().min(0),
|
|
314
|
+
endCol: z.number().int().min(0),
|
|
315
|
+
}),
|
|
316
|
+
code: z.union([z.string(), z.number()]),
|
|
317
|
+
messageShort: z.string(),
|
|
318
|
+
});
|
|
319
|
+
const DeltaPackTruncationSchema = z.object({
|
|
320
|
+
truncated: z.boolean(),
|
|
321
|
+
droppedChanges: z.number().int().min(0),
|
|
322
|
+
droppedBlastRadius: z.number().int().min(0),
|
|
323
|
+
howToResume: z
|
|
324
|
+
.object({
|
|
325
|
+
type: z.enum(["cursor", "token"]),
|
|
326
|
+
value: z.union([z.string(), z.number()]),
|
|
327
|
+
})
|
|
328
|
+
.nullable(),
|
|
329
|
+
});
|
|
330
|
+
const DroppedSymbolSchema = z.object({
|
|
331
|
+
symbolId: z.string(),
|
|
332
|
+
reason: z.string(),
|
|
333
|
+
priority: z.enum(["must", "should", "optional"]),
|
|
334
|
+
});
|
|
335
|
+
const TrimmedSetSchema = z.object({
|
|
336
|
+
trimmed: z.boolean(),
|
|
337
|
+
keptSymbols: z.array(z.string()),
|
|
338
|
+
droppedSymbols: z.array(DroppedSymbolSchema),
|
|
339
|
+
spilloverHandle: z.string().nullable(),
|
|
340
|
+
});
|
|
341
|
+
const DeltaPackSchema = z.object({
|
|
342
|
+
repoId: z.string(),
|
|
343
|
+
fromVersion: z.string(),
|
|
344
|
+
toVersion: z.string(),
|
|
345
|
+
changedSymbols: z.array(DeltaSymbolChangeSchema),
|
|
346
|
+
blastRadius: z.array(BlastRadiusItemSchema),
|
|
347
|
+
diagnosticsSummary: DiagnosticsSummarySchema.optional(),
|
|
348
|
+
diagnosticSuspects: z.array(DiagnosticSuspectSchema).optional(),
|
|
349
|
+
truncation: DeltaPackTruncationSchema.optional(),
|
|
350
|
+
trimmedSet: TrimmedSetSchema.optional(),
|
|
351
|
+
spilloverHandle: z.string().optional(),
|
|
352
|
+
});
|
|
353
|
+
const CodeWindowRequestSchema = z.object({
|
|
354
|
+
repoId: z.string(),
|
|
355
|
+
symbolId: z.string(),
|
|
356
|
+
reason: z.string(),
|
|
357
|
+
expectedLines: z.number().int().min(1),
|
|
358
|
+
identifiersToFind: z.array(z.string()),
|
|
359
|
+
granularity: z.enum(["symbol", "block", "fileWindow"]).optional(),
|
|
360
|
+
maxTokens: z.number().int().min(1).optional(),
|
|
361
|
+
sliceContext: z
|
|
362
|
+
.object({
|
|
363
|
+
taskText: z.string().min(1),
|
|
364
|
+
stackTrace: z.string().optional(),
|
|
365
|
+
failingTestPath: z.string().optional(),
|
|
366
|
+
editedFiles: z.array(z.string()).optional(),
|
|
367
|
+
entrySymbols: z.array(z.string()).optional(),
|
|
368
|
+
budget: SliceBudgetSchema.optional(),
|
|
369
|
+
})
|
|
370
|
+
.optional(),
|
|
371
|
+
});
|
|
372
|
+
export const RepoRegisterRequestSchema = z.object({
|
|
373
|
+
repoId: z.string().min(1),
|
|
374
|
+
rootPath: z.string().min(1),
|
|
375
|
+
ignore: z.array(z.string()).optional(),
|
|
376
|
+
languages: z.array(z.string()).optional(),
|
|
377
|
+
maxFileBytes: z.number().int().min(1).optional(),
|
|
378
|
+
});
|
|
379
|
+
export const RepoRegisterResponseSchema = z.object({
|
|
380
|
+
ok: z.boolean(),
|
|
381
|
+
repoId: z.string(),
|
|
382
|
+
});
|
|
383
|
+
export const RepoStatusRequestSchema = z.object({
|
|
384
|
+
repoId: z.string(),
|
|
385
|
+
});
|
|
386
|
+
export const RepoStatusResponseSchema = z.object({
|
|
387
|
+
repoId: z.string(),
|
|
388
|
+
rootPath: z.string(),
|
|
389
|
+
latestVersionId: z.string().nullable(),
|
|
390
|
+
filesIndexed: z.number().int(),
|
|
391
|
+
symbolsIndexed: z.number().int(),
|
|
392
|
+
lastIndexedAt: z.string().nullable(),
|
|
393
|
+
});
|
|
394
|
+
export const IndexRefreshRequestSchema = z.object({
|
|
395
|
+
repoId: z.string(),
|
|
396
|
+
mode: z.enum(["full", "incremental"]),
|
|
397
|
+
reason: z.string().optional(),
|
|
398
|
+
});
|
|
399
|
+
export const IndexRefreshResponseSchema = z.object({
|
|
400
|
+
ok: z.boolean(),
|
|
401
|
+
repoId: z.string(),
|
|
402
|
+
versionId: z.string(),
|
|
403
|
+
changedFiles: z.number().int(),
|
|
404
|
+
});
|
|
405
|
+
const SymbolSearchResultSchema = z.object({
|
|
406
|
+
symbolId: z.string(),
|
|
407
|
+
name: z.string(),
|
|
408
|
+
file: z.string(),
|
|
409
|
+
kind: z.enum([
|
|
410
|
+
"function",
|
|
411
|
+
"class",
|
|
412
|
+
"interface",
|
|
413
|
+
"type",
|
|
414
|
+
"module",
|
|
415
|
+
"method",
|
|
416
|
+
"constructor",
|
|
417
|
+
"variable",
|
|
418
|
+
]),
|
|
419
|
+
});
|
|
420
|
+
export const SymbolSearchRequestSchema = z.object({
|
|
421
|
+
repoId: z.string(),
|
|
422
|
+
query: z.string().min(1),
|
|
423
|
+
limit: z.number().int().min(1).max(SYMBOL_SEARCH_MAX_RESULTS).optional(),
|
|
424
|
+
});
|
|
425
|
+
export const SymbolSearchResponseSchema = z.object({
|
|
426
|
+
repoId: z.string().optional(),
|
|
427
|
+
results: z.array(SymbolSearchResultSchema),
|
|
428
|
+
truncation: z
|
|
429
|
+
.object({
|
|
430
|
+
truncated: z.boolean(),
|
|
431
|
+
droppedCount: z.number().int().min(0),
|
|
432
|
+
howToResume: z
|
|
433
|
+
.object({
|
|
434
|
+
type: z.enum(["cursor", "token"]),
|
|
435
|
+
value: z.union([z.string(), z.number()]),
|
|
436
|
+
})
|
|
437
|
+
.nullable(),
|
|
438
|
+
})
|
|
439
|
+
.optional(),
|
|
440
|
+
});
|
|
441
|
+
const NotModifiedResponseSchema = z.object({
|
|
442
|
+
notModified: z.literal(true),
|
|
443
|
+
etag: z.string(),
|
|
444
|
+
ledgerVersion: z.string(),
|
|
445
|
+
});
|
|
446
|
+
export const SymbolGetCardRequestSchema = z.object({
|
|
447
|
+
repoId: z.string(),
|
|
448
|
+
symbolId: z.string(),
|
|
449
|
+
ifNoneMatch: z.string().optional(),
|
|
450
|
+
});
|
|
451
|
+
const CardWithETagSchema = SymbolCardSchema.extend({
|
|
452
|
+
etag: z.string(),
|
|
453
|
+
});
|
|
454
|
+
export const SymbolGetCardResponseSchema = z.union([
|
|
455
|
+
z.object({
|
|
456
|
+
card: CardWithETagSchema,
|
|
457
|
+
truncation: z
|
|
458
|
+
.object({
|
|
459
|
+
truncated: z.boolean(),
|
|
460
|
+
droppedCount: z.number().int().min(0),
|
|
461
|
+
howToResume: z
|
|
462
|
+
.object({
|
|
463
|
+
type: z.enum(["cursor", "token"]),
|
|
464
|
+
value: z.union([z.string(), z.number()]),
|
|
465
|
+
})
|
|
466
|
+
.nullable(),
|
|
467
|
+
})
|
|
468
|
+
.optional(),
|
|
469
|
+
}),
|
|
470
|
+
NotModifiedResponseSchema,
|
|
471
|
+
]);
|
|
472
|
+
export const SliceBuildRequestSchema = z.object({
|
|
473
|
+
repoId: z.string(),
|
|
474
|
+
taskText: z.string().min(1),
|
|
475
|
+
stackTrace: z.string().optional(),
|
|
476
|
+
failingTestPath: z.string().optional(),
|
|
477
|
+
editedFiles: z.array(z.string()).optional(),
|
|
478
|
+
entrySymbols: z.array(z.string()).optional(),
|
|
479
|
+
knownCardEtags: z.record(z.string()).optional(),
|
|
480
|
+
cardDetail: CardDetailLevelSchema.optional(),
|
|
481
|
+
wireFormat: SliceBuildWireFormatSchema.optional(),
|
|
482
|
+
wireFormatVersion: SliceBuildWireFormatVersionSchema.optional(),
|
|
483
|
+
budget: SliceBudgetSchema.optional(),
|
|
484
|
+
});
|
|
485
|
+
const SliceLeaseSchema = z.object({
|
|
486
|
+
expiresAt: z.string(),
|
|
487
|
+
minVersion: z.string().nullable(),
|
|
488
|
+
maxVersion: z.string().nullable(),
|
|
489
|
+
});
|
|
490
|
+
const SliceEtagSchema = z.object({
|
|
491
|
+
handle: z.string(),
|
|
492
|
+
version: z.string(),
|
|
493
|
+
sliceHash: z.string(),
|
|
494
|
+
});
|
|
495
|
+
export const SliceRefreshRequestSchema = z.object({
|
|
496
|
+
sliceHandle: z.string(),
|
|
497
|
+
knownVersion: z.string(),
|
|
498
|
+
});
|
|
499
|
+
const DeltaPackWithGovernanceSchema = DeltaPackSchema.extend({
|
|
500
|
+
trimmedSet: z
|
|
501
|
+
.object({
|
|
502
|
+
trimmed: z.boolean(),
|
|
503
|
+
keptSymbols: z.array(z.string()),
|
|
504
|
+
droppedSymbols: z.array(z.object({
|
|
505
|
+
symbolId: z.string(),
|
|
506
|
+
reason: z.string(),
|
|
507
|
+
priority: z.enum(["must", "should", "optional"]),
|
|
508
|
+
})),
|
|
509
|
+
spilloverHandle: z.string().nullable(),
|
|
510
|
+
})
|
|
511
|
+
.optional(),
|
|
512
|
+
spilloverHandle: z.string().optional(),
|
|
513
|
+
changedSymbols: z.array(DeltaSymbolChangeSchema.extend({
|
|
514
|
+
tiers: z
|
|
515
|
+
.object({
|
|
516
|
+
interfaceStable: z.boolean(),
|
|
517
|
+
behaviorStable: z.boolean(),
|
|
518
|
+
sideEffectsStable: z.boolean(),
|
|
519
|
+
riskScore: z.number(),
|
|
520
|
+
})
|
|
521
|
+
.optional(),
|
|
522
|
+
})),
|
|
523
|
+
});
|
|
524
|
+
export const SliceRefreshResponseSchema = z.object({
|
|
525
|
+
sliceHandle: z.string(),
|
|
526
|
+
knownVersion: z.string(),
|
|
527
|
+
currentVersion: z.string(),
|
|
528
|
+
notModified: z.boolean().optional(),
|
|
529
|
+
delta: DeltaPackWithGovernanceSchema.nullable(),
|
|
530
|
+
lease: SliceLeaseSchema.optional(),
|
|
531
|
+
});
|
|
532
|
+
export const SliceBuildResponseSchema = z.union([
|
|
533
|
+
z.object({
|
|
534
|
+
sliceHandle: z.string(),
|
|
535
|
+
ledgerVersion: z.string(),
|
|
536
|
+
lease: SliceLeaseSchema,
|
|
537
|
+
sliceEtag: SliceEtagSchema.optional(),
|
|
538
|
+
slice: z.union([
|
|
539
|
+
GraphSliceSchema,
|
|
540
|
+
CompactGraphSliceSchema,
|
|
541
|
+
CompactGraphSliceV2Schema,
|
|
542
|
+
]),
|
|
543
|
+
}),
|
|
544
|
+
NotModifiedResponseSchema,
|
|
545
|
+
]);
|
|
546
|
+
export const DeltaGetRequestSchema = z.object({
|
|
547
|
+
repoId: z.string(),
|
|
548
|
+
fromVersion: z.string(),
|
|
549
|
+
toVersion: z.string(),
|
|
550
|
+
budget: SliceBudgetSchema.optional(),
|
|
551
|
+
});
|
|
552
|
+
export const DeltaGetResponseSchema = z.object({
|
|
553
|
+
delta: DeltaPackSchema,
|
|
554
|
+
});
|
|
555
|
+
export const SliceSpilloverGetRequestSchema = z.object({
|
|
556
|
+
spilloverHandle: z.string(),
|
|
557
|
+
cursor: z.string().optional(),
|
|
558
|
+
pageSize: z.number().int().min(1).max(PAGE_SIZE_MAX).optional(),
|
|
559
|
+
});
|
|
560
|
+
export const SliceSpilloverGetResponseSchema = z.object({
|
|
561
|
+
spilloverHandle: z.string(),
|
|
562
|
+
cursor: z.string().optional(),
|
|
563
|
+
hasMore: z.boolean(),
|
|
564
|
+
symbols: z.array(SymbolCardSchema),
|
|
565
|
+
});
|
|
566
|
+
export const CodeNeedWindowRequestSchema = z.object({
|
|
567
|
+
repoId: z.string(),
|
|
568
|
+
symbolId: z.string(),
|
|
569
|
+
reason: z.string().min(1),
|
|
570
|
+
expectedLines: z.number().int().min(1),
|
|
571
|
+
identifiersToFind: z.array(z.string()),
|
|
572
|
+
granularity: z.enum(["symbol", "block", "fileWindow"]).optional(),
|
|
573
|
+
maxTokens: z.number().int().min(1).optional(),
|
|
574
|
+
sliceContext: z
|
|
575
|
+
.object({
|
|
576
|
+
taskText: z.string().min(1),
|
|
577
|
+
stackTrace: z.string().optional(),
|
|
578
|
+
failingTestPath: z.string().optional(),
|
|
579
|
+
editedFiles: z.array(z.string()).optional(),
|
|
580
|
+
entrySymbols: z.array(z.string()).optional(),
|
|
581
|
+
budget: SliceBudgetSchema.optional(),
|
|
582
|
+
})
|
|
583
|
+
.optional(),
|
|
584
|
+
});
|
|
585
|
+
const CodeWindowResponseApprovedSchema = z.object({
|
|
586
|
+
approved: z.literal(true),
|
|
587
|
+
repoId: z.string().optional(),
|
|
588
|
+
symbolId: z.string(),
|
|
589
|
+
file: z.string(),
|
|
590
|
+
range: RangeSchema,
|
|
591
|
+
code: z.string(),
|
|
592
|
+
whyApproved: z.array(z.string()),
|
|
593
|
+
estimatedTokens: z.number().int(),
|
|
594
|
+
downgradedFrom: z.enum(["raw-code", "skeleton", "hotpath"]).optional(),
|
|
595
|
+
truncation: z
|
|
596
|
+
.object({
|
|
597
|
+
truncated: z.boolean(),
|
|
598
|
+
droppedCount: z.number().int().min(0),
|
|
599
|
+
howToResume: z
|
|
600
|
+
.object({
|
|
601
|
+
type: z.enum(["cursor", "token"]),
|
|
602
|
+
value: z.union([z.string(), z.number()]),
|
|
603
|
+
})
|
|
604
|
+
.nullable(),
|
|
605
|
+
})
|
|
606
|
+
.optional(),
|
|
607
|
+
matchedIdentifiers: z.array(z.string()).optional(),
|
|
608
|
+
matchedLineNumbers: z.array(z.number().int()).optional(),
|
|
609
|
+
});
|
|
610
|
+
const CodeWindowResponseDeniedSchema = z.object({
|
|
611
|
+
approved: z.literal(false),
|
|
612
|
+
whyDenied: z.array(z.string()),
|
|
613
|
+
suggestedNextRequest: CodeWindowRequestSchema.partial().optional(),
|
|
614
|
+
});
|
|
615
|
+
export const CodeNeedWindowResponseSchema = z.discriminatedUnion("approved", [
|
|
616
|
+
CodeWindowResponseApprovedSchema,
|
|
617
|
+
CodeWindowResponseDeniedSchema,
|
|
618
|
+
]);
|
|
619
|
+
export const GetSkeletonRequestSchema = z
|
|
620
|
+
.object({
|
|
621
|
+
repoId: z.string(),
|
|
622
|
+
symbolId: z.string().optional(),
|
|
623
|
+
file: z.string().optional(),
|
|
624
|
+
exportedOnly: z.boolean().optional(),
|
|
625
|
+
maxLines: z.number().int().min(1).optional(),
|
|
626
|
+
maxTokens: z.number().int().min(1).optional(),
|
|
627
|
+
identifiersToFind: z.array(z.string()).optional(),
|
|
628
|
+
})
|
|
629
|
+
.refine((data) => data.symbolId !== undefined || data.file !== undefined, {
|
|
630
|
+
message: "Either symbolId or file must be provided",
|
|
631
|
+
});
|
|
632
|
+
export const GetSkeletonResponseSchema = z.object({
|
|
633
|
+
skeleton: z.string(),
|
|
634
|
+
file: z.string(),
|
|
635
|
+
range: RangeSchema,
|
|
636
|
+
estimatedTokens: z.number().int(),
|
|
637
|
+
originalLines: z.number().int(),
|
|
638
|
+
truncated: z.boolean(),
|
|
639
|
+
truncation: z
|
|
640
|
+
.object({
|
|
641
|
+
truncated: z.boolean(),
|
|
642
|
+
droppedCount: z.number().int().min(0),
|
|
643
|
+
howToResume: z
|
|
644
|
+
.object({
|
|
645
|
+
type: z.enum(["cursor", "token"]),
|
|
646
|
+
value: z.union([z.string(), z.number()]),
|
|
647
|
+
})
|
|
648
|
+
.nullable(),
|
|
649
|
+
})
|
|
650
|
+
.optional(),
|
|
651
|
+
});
|
|
652
|
+
export const GetHotPathRequestSchema = z.object({
|
|
653
|
+
repoId: z.string(),
|
|
654
|
+
symbolId: z.string(),
|
|
655
|
+
identifiersToFind: z.array(z.string()).min(1),
|
|
656
|
+
maxLines: z.number().int().min(1).optional(),
|
|
657
|
+
maxTokens: z.number().int().min(1).optional(),
|
|
658
|
+
contextLines: z.number().int().min(0).optional(),
|
|
659
|
+
});
|
|
660
|
+
export const GetHotPathResponseSchema = z.object({
|
|
661
|
+
excerpt: z.string(),
|
|
662
|
+
file: z.string(),
|
|
663
|
+
range: RangeSchema,
|
|
664
|
+
estimatedTokens: z.number().int(),
|
|
665
|
+
matchedIdentifiers: z.array(z.string()),
|
|
666
|
+
matchedLineNumbers: z.array(z.number().int()),
|
|
667
|
+
truncated: z.boolean(),
|
|
668
|
+
});
|
|
669
|
+
const PolicyConfigSchema = z.object({
|
|
670
|
+
maxWindowLines: z.number().int().min(1).default(DEFAULT_MAX_WINDOW_LINES),
|
|
671
|
+
maxWindowTokens: z.number().int().min(1).default(DEFAULT_MAX_WINDOW_TOKENS),
|
|
672
|
+
requireIdentifiers: z.boolean().default(true),
|
|
673
|
+
allowBreakGlass: z.boolean().default(true),
|
|
674
|
+
});
|
|
675
|
+
export const PolicyGetRequestSchema = z.object({
|
|
676
|
+
repoId: z.string(),
|
|
677
|
+
});
|
|
678
|
+
export const PolicyGetResponseSchema = z.object({
|
|
679
|
+
policy: PolicyConfigSchema,
|
|
680
|
+
});
|
|
681
|
+
export const PolicySetRequestSchema = z.object({
|
|
682
|
+
repoId: z.string(),
|
|
683
|
+
policyPatch: PolicyConfigSchema.partial(),
|
|
684
|
+
});
|
|
685
|
+
export const PolicySetResponseSchema = z.object({
|
|
686
|
+
ok: z.boolean(),
|
|
687
|
+
repoId: z.string(),
|
|
688
|
+
});
|
|
689
|
+
// ============================================================================
|
|
690
|
+
// Repository Overview Schemas
|
|
691
|
+
// ============================================================================
|
|
692
|
+
const SymbolCountsByKindSchema = z.object({
|
|
693
|
+
function: z.number().int().min(0),
|
|
694
|
+
class: z.number().int().min(0),
|
|
695
|
+
interface: z.number().int().min(0),
|
|
696
|
+
type: z.number().int().min(0),
|
|
697
|
+
method: z.number().int().min(0),
|
|
698
|
+
variable: z.number().int().min(0),
|
|
699
|
+
module: z.number().int().min(0),
|
|
700
|
+
constructor: z.number().int().min(0),
|
|
701
|
+
});
|
|
702
|
+
const CompactSymbolRefSchema = z.object({
|
|
703
|
+
symbolId: z.string(),
|
|
704
|
+
name: z.string(),
|
|
705
|
+
kind: z.enum([
|
|
706
|
+
"function",
|
|
707
|
+
"class",
|
|
708
|
+
"interface",
|
|
709
|
+
"type",
|
|
710
|
+
"module",
|
|
711
|
+
"method",
|
|
712
|
+
"constructor",
|
|
713
|
+
"variable",
|
|
714
|
+
]),
|
|
715
|
+
exported: z.boolean(),
|
|
716
|
+
signature: z.string().optional(),
|
|
717
|
+
});
|
|
718
|
+
const DirectorySummarySchema = z.object({
|
|
719
|
+
path: z.string(),
|
|
720
|
+
fileCount: z.number().int().min(0),
|
|
721
|
+
symbolCount: z.number().int().min(0),
|
|
722
|
+
exportedCount: z.number().int().min(0),
|
|
723
|
+
byKind: SymbolCountsByKindSchema,
|
|
724
|
+
exports: z.array(z.string()),
|
|
725
|
+
topByFanIn: z.array(CompactSymbolRefSchema),
|
|
726
|
+
topByChurn: z.array(CompactSymbolRefSchema),
|
|
727
|
+
subdirectories: z.array(z.string()).optional(),
|
|
728
|
+
estimatedFullTokens: z.number().int().min(0),
|
|
729
|
+
summaryTokens: z.number().int().min(0),
|
|
730
|
+
});
|
|
731
|
+
const CodebaseHotspotsSchema = z.object({
|
|
732
|
+
mostDepended: z.array(CompactSymbolRefSchema),
|
|
733
|
+
mostChanged: z.array(CompactSymbolRefSchema),
|
|
734
|
+
largestFiles: z.array(z.object({
|
|
735
|
+
file: z.string(),
|
|
736
|
+
symbolCount: z.number().int().min(0),
|
|
737
|
+
})),
|
|
738
|
+
mostConnected: z.array(z.object({
|
|
739
|
+
file: z.string(),
|
|
740
|
+
edgeCount: z.number().int().min(0),
|
|
741
|
+
})),
|
|
742
|
+
});
|
|
743
|
+
const RepoStatsSchema = z.object({
|
|
744
|
+
fileCount: z.number().int().min(0),
|
|
745
|
+
symbolCount: z.number().int().min(0),
|
|
746
|
+
edgeCount: z.number().int().min(0),
|
|
747
|
+
exportedSymbolCount: z.number().int().min(0),
|
|
748
|
+
byKind: SymbolCountsByKindSchema,
|
|
749
|
+
byEdgeType: z.object({
|
|
750
|
+
call: z.number().int().min(0),
|
|
751
|
+
import: z.number().int().min(0),
|
|
752
|
+
config: z.number().int().min(0),
|
|
753
|
+
}),
|
|
754
|
+
avgSymbolsPerFile: z.number().min(0),
|
|
755
|
+
avgEdgesPerSymbol: z.number().min(0),
|
|
756
|
+
});
|
|
757
|
+
const TokenMetricsSchema = z.object({
|
|
758
|
+
fullCardsEstimate: z.number().int().min(0),
|
|
759
|
+
overviewTokens: z.number().int().min(0),
|
|
760
|
+
compressionRatio: z.number().min(0),
|
|
761
|
+
});
|
|
762
|
+
export const RepoOverviewRequestSchema = z.object({
|
|
763
|
+
repoId: z.string(),
|
|
764
|
+
level: z.enum(["stats", "directories", "full"]),
|
|
765
|
+
includeHotspots: z.boolean().optional(),
|
|
766
|
+
directories: z.array(z.string()).optional(),
|
|
767
|
+
maxDirectories: z.number().int().min(1).max(200).optional(),
|
|
768
|
+
maxExportsPerDirectory: z.number().int().min(1).max(50).optional(),
|
|
769
|
+
});
|
|
770
|
+
export const RepoOverviewResponseSchema = z.object({
|
|
771
|
+
repoId: z.string(),
|
|
772
|
+
versionId: z.string(),
|
|
773
|
+
generatedAt: z.string(),
|
|
774
|
+
stats: RepoStatsSchema,
|
|
775
|
+
directories: z.array(DirectorySummarySchema),
|
|
776
|
+
hotspots: CodebaseHotspotsSchema.optional(),
|
|
777
|
+
layers: z.array(z.string()).optional(),
|
|
778
|
+
entryPoints: z.array(z.string()).optional(),
|
|
779
|
+
tokenMetrics: TokenMetricsSchema,
|
|
780
|
+
});
|
|
781
|
+
const FindingSchema = z.object({
|
|
782
|
+
type: z.string(),
|
|
783
|
+
severity: z.enum(["low", "medium", "high"]),
|
|
784
|
+
message: z.string(),
|
|
785
|
+
affectedSymbols: z.array(z.string()),
|
|
786
|
+
metadata: z.record(z.unknown()).optional(),
|
|
787
|
+
});
|
|
788
|
+
const EvidenceSchema = z.object({
|
|
789
|
+
type: z.string(),
|
|
790
|
+
description: z.string(),
|
|
791
|
+
symbolId: z.string().optional(),
|
|
792
|
+
data: z.record(z.unknown()).optional(),
|
|
793
|
+
});
|
|
794
|
+
const RecommendedTestSchema = z.object({
|
|
795
|
+
type: z.string(),
|
|
796
|
+
description: z.string(),
|
|
797
|
+
targetSymbols: z.array(z.string()),
|
|
798
|
+
priority: z.enum(["high", "medium", "low"]),
|
|
799
|
+
});
|
|
800
|
+
const PRRiskAnalysisSchema = z.object({
|
|
801
|
+
repoId: z.string(),
|
|
802
|
+
fromVersion: z.string(),
|
|
803
|
+
toVersion: z.string(),
|
|
804
|
+
riskScore: z.number().int().min(0).max(100),
|
|
805
|
+
riskLevel: z.enum(["low", "medium", "high"]),
|
|
806
|
+
findings: z.array(FindingSchema),
|
|
807
|
+
impactedSymbols: z.array(z.string()),
|
|
808
|
+
evidence: z.array(EvidenceSchema),
|
|
809
|
+
recommendedTests: z.array(RecommendedTestSchema),
|
|
810
|
+
changedSymbolsCount: z.number().int().min(0),
|
|
811
|
+
blastRadiusCount: z.number().int().min(0),
|
|
812
|
+
});
|
|
813
|
+
const PolicyDecisionSummarySchema = z.object({
|
|
814
|
+
decision: z.enum([
|
|
815
|
+
"approve",
|
|
816
|
+
"deny",
|
|
817
|
+
"downgrade-to-skeleton",
|
|
818
|
+
"downgrade-to-hotpath",
|
|
819
|
+
]),
|
|
820
|
+
deniedReasons: z.array(z.string()).optional(),
|
|
821
|
+
auditHash: z.string(),
|
|
822
|
+
});
|
|
823
|
+
export const PRRiskAnalysisRequestSchema = z.object({
|
|
824
|
+
repoId: z.string(),
|
|
825
|
+
fromVersion: z.string(),
|
|
826
|
+
toVersion: z.string(),
|
|
827
|
+
riskThreshold: z.number().int().min(0).max(100).optional(),
|
|
828
|
+
});
|
|
829
|
+
export const PRRiskAnalysisResponseSchema = z.object({
|
|
830
|
+
analysis: PRRiskAnalysisSchema,
|
|
831
|
+
escalationRequired: z.boolean(),
|
|
832
|
+
policyDecision: PolicyDecisionSummarySchema.optional(),
|
|
833
|
+
});
|
|
834
|
+
export const AgentOrchestrateRequestSchema = z.object({
|
|
835
|
+
repoId: z.string().describe("Repository ID to work with"),
|
|
836
|
+
taskType: z
|
|
837
|
+
.enum(["debug", "review", "implement", "explain"])
|
|
838
|
+
.describe("Type of task to perform"),
|
|
839
|
+
taskText: z.string().describe("Task description or prompt"),
|
|
840
|
+
budget: z
|
|
841
|
+
.object({
|
|
842
|
+
maxTokens: z.number().optional().describe("Maximum tokens to consume"),
|
|
843
|
+
maxActions: z
|
|
844
|
+
.number()
|
|
845
|
+
.optional()
|
|
846
|
+
.describe("Maximum number of actions to execute"),
|
|
847
|
+
maxDurationMs: z
|
|
848
|
+
.number()
|
|
849
|
+
.optional()
|
|
850
|
+
.describe("Maximum duration in milliseconds"),
|
|
851
|
+
})
|
|
852
|
+
.optional()
|
|
853
|
+
.describe("Budget constraints for the task"),
|
|
854
|
+
options: z
|
|
855
|
+
.object({
|
|
856
|
+
focusSymbols: z
|
|
857
|
+
.array(z.string())
|
|
858
|
+
.optional()
|
|
859
|
+
.describe("List of symbol IDs to focus on"),
|
|
860
|
+
focusPaths: z
|
|
861
|
+
.array(z.string())
|
|
862
|
+
.optional()
|
|
863
|
+
.describe("List of file paths to focus on"),
|
|
864
|
+
includeTests: z
|
|
865
|
+
.boolean()
|
|
866
|
+
.optional()
|
|
867
|
+
.describe("Whether to include test files"),
|
|
868
|
+
requireDiagnostics: z
|
|
869
|
+
.boolean()
|
|
870
|
+
.optional()
|
|
871
|
+
.describe("Whether to require diagnostic information"),
|
|
872
|
+
})
|
|
873
|
+
.optional()
|
|
874
|
+
.describe("Task-specific options"),
|
|
875
|
+
});
|
|
876
|
+
export const AgentOrchestrateResponseSchema = z.object({
|
|
877
|
+
taskId: z.string().describe("Unique task identifier"),
|
|
878
|
+
taskType: z
|
|
879
|
+
.enum(["debug", "review", "implement", "explain"])
|
|
880
|
+
.describe("Type of task performed"),
|
|
881
|
+
actionsTaken: z
|
|
882
|
+
.array(z.object({
|
|
883
|
+
id: z.string(),
|
|
884
|
+
type: z.string(),
|
|
885
|
+
status: z.enum(["pending", "inProgress", "completed", "failed"]),
|
|
886
|
+
input: z.record(z.any()),
|
|
887
|
+
output: z.any().optional(),
|
|
888
|
+
error: z.string().optional(),
|
|
889
|
+
timestamp: z.number(),
|
|
890
|
+
durationMs: z.number(),
|
|
891
|
+
evidence: z.array(z.any()),
|
|
892
|
+
}))
|
|
893
|
+
.describe("Actions taken during execution"),
|
|
894
|
+
path: z
|
|
895
|
+
.object({
|
|
896
|
+
rungs: z.array(z.enum(["card", "skeleton", "hotPath", "raw"])),
|
|
897
|
+
estimatedTokens: z.number(),
|
|
898
|
+
estimatedDurationMs: z.number(),
|
|
899
|
+
reasoning: z.string(),
|
|
900
|
+
})
|
|
901
|
+
.describe("Rung path selected for execution"),
|
|
902
|
+
finalEvidence: z
|
|
903
|
+
.array(z.object({
|
|
904
|
+
type: z.string(),
|
|
905
|
+
reference: z.string(),
|
|
906
|
+
summary: z.string(),
|
|
907
|
+
timestamp: z.number(),
|
|
908
|
+
}))
|
|
909
|
+
.describe("Evidence collected during execution"),
|
|
910
|
+
summary: z.string().describe("Summary of execution"),
|
|
911
|
+
success: z.boolean().describe("Whether execution was successful"),
|
|
912
|
+
error: z.string().optional().describe("Error message if execution failed"),
|
|
913
|
+
metrics: z
|
|
914
|
+
.object({
|
|
915
|
+
totalDurationMs: z.number(),
|
|
916
|
+
totalTokens: z.number(),
|
|
917
|
+
totalActions: z.number(),
|
|
918
|
+
successfulActions: z.number(),
|
|
919
|
+
failedActions: z.number(),
|
|
920
|
+
cacheHits: z.number(),
|
|
921
|
+
})
|
|
922
|
+
.describe("Execution metrics"),
|
|
923
|
+
answer: z
|
|
924
|
+
.string()
|
|
925
|
+
.optional()
|
|
926
|
+
.describe("Answer to the task based on collected evidence"),
|
|
927
|
+
nextBestAction: z
|
|
928
|
+
.string()
|
|
929
|
+
.optional()
|
|
930
|
+
.describe("Suggested next action based on execution results and policy decisions"),
|
|
931
|
+
});
|
|
932
|
+
//# sourceMappingURL=tools.js.map
|