summaryrefslogtreecommitdiffhomepage
path: root/tsconfig.json
diff options
context:
space:
mode:
authorAdam Malczewski <[email protected]>2026-06-24 18:50:24 +0900
committerAdam Malczewski <[email protected]>2026-06-24 18:50:24 +0900
commit94363d4e5b4fe7f026e06b65fb847342224428d8 (patch)
tree92b2016bfc3edb3a958d3e06b67bf2230db7576d /tsconfig.json
parent74a779331041b5aaf0350806a066cdb3444ca0a7 (diff)
downloaddispatch-94363d4e5b4fe7f026e06b65fb847342224428d8.tar.gz
dispatch-94363d4e5b4fe7f026e06b65fb847342224428d8.zip
feat(mcp): Model Context Protocol host extension
New `mcp` standard extension (`packages/mcp/`) that makes Dispatch an MCP host: spawns configured MCP servers (stdio child processes), performs the MCP handshake (initialize → notifications/initialized), discovers tools via tools/list, and registers each as a first-class Dispatch ToolContract via host.defineTool. When the model calls an MCP tool, the extension proxies the call to tools/call on the MCP server and returns the flattened result. Architecture (sibling of `lsp` extension): - Config: .dispatch/mcp.json (servers key) → opencode.json mcp key fallback, resolved per-cwd (mirrors LSP config resolution) - Transport: StdioTransport (spawn child, Content-Length framing + JSON-RPC 2.0) - Client: initialize → tools/list → tools/call; handles list_changed notifications for dynamic tool updates - Registry: tool name namespacing (<serverId>__<toolName>), ToolContract adapter that proxies execute → callTool, content flattening (text/image/ resource → string) - Manager: one client per server, lazy-spawn, status(), shutdownAll() - Extension: manifest (dependsOn session-orchestrator, capabilities spawn), registers tools + a toolsFilter (drops disconnected server's tools), mcpServiceHandle, deactivate kills all child processes Phase 1 scope: stdio only, Tools only (no Resources/Prompts/HTTP/sampling). Hand-rolled JSON-RPC + framing (zero external deps, adapts LSP patterns). Wave 1 (agent): 12 source + 8 test files, 69 new tests. Wave 2 (orchestrator): root tsconfig ref, host-bin CORE_EXTENSIONS registration + package.json dep, bun install. Verified: tsc -b EXIT 0, biome clean, 1537 vitest pass (was 1468, +69).
Diffstat (limited to 'tsconfig.json')
-rw-r--r--tsconfig.json143
1 files changed, 108 insertions, 35 deletions
diff --git a/tsconfig.json b/tsconfig.json
index 7babef3..3dea4a1 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -1,40 +1,113 @@
{
"files": [],
"references": [
- { "path": "./packages/wire" },
- { "path": "./packages/kernel" },
- { "path": "./packages/transport-contract" },
- { "path": "./packages/ui-contract" },
- { "path": "./packages/surface-registry" },
- { "path": "./packages/transport-ws" },
- { "path": "./packages/surface-loaded-extensions" },
- { "path": "./packages/storage-sqlite" },
- { "path": "./packages/auth-apikey" },
- { "path": "./packages/provider-openai-compat" },
- { "path": "./packages/openai-stream" },
- { "path": "./packages/provider-umans" },
- { "path": "./packages/credential-store" },
- { "path": "./packages/conversation-store" },
- { "path": "./packages/throughput-store" },
- { "path": "./packages/todo" },
- { "path": "./packages/session-orchestrator" },
- { "path": "./packages/transport-http" },
- { "path": "./packages/tool-read-file" },
- { "path": "./packages/tool-shell" },
- { "path": "./packages/tool-edit-file" },
- { "path": "./packages/tool-write-file" },
- { "path": "./packages/tool-web-search" },
- { "path": "./packages/tool-youtube-transcript" },
- { "path": "./packages/skills" },
- { "path": "./packages/cache-warming" },
- { "path": "./packages/message-queue" },
- { "path": "./packages/lsp" },
- { "path": "./packages/system-prompt" },
- { "path": "./packages/cli" },
- { "path": "./packages/journal-sink" },
- { "path": "./packages/trace-store" },
- { "path": "./packages/observability-collector" },
- { "path": "./packages/trace-replay" },
- { "path": "./packages/host-bin" }
+ {
+ "path": "./packages/wire"
+ },
+ {
+ "path": "./packages/kernel"
+ },
+ {
+ "path": "./packages/transport-contract"
+ },
+ {
+ "path": "./packages/ui-contract"
+ },
+ {
+ "path": "./packages/surface-registry"
+ },
+ {
+ "path": "./packages/transport-ws"
+ },
+ {
+ "path": "./packages/surface-loaded-extensions"
+ },
+ {
+ "path": "./packages/storage-sqlite"
+ },
+ {
+ "path": "./packages/auth-apikey"
+ },
+ {
+ "path": "./packages/provider-openai-compat"
+ },
+ {
+ "path": "./packages/openai-stream"
+ },
+ {
+ "path": "./packages/provider-umans"
+ },
+ {
+ "path": "./packages/credential-store"
+ },
+ {
+ "path": "./packages/conversation-store"
+ },
+ {
+ "path": "./packages/throughput-store"
+ },
+ {
+ "path": "./packages/todo"
+ },
+ {
+ "path": "./packages/session-orchestrator"
+ },
+ {
+ "path": "./packages/transport-http"
+ },
+ {
+ "path": "./packages/tool-read-file"
+ },
+ {
+ "path": "./packages/tool-shell"
+ },
+ {
+ "path": "./packages/tool-edit-file"
+ },
+ {
+ "path": "./packages/tool-write-file"
+ },
+ {
+ "path": "./packages/tool-web-search"
+ },
+ {
+ "path": "./packages/tool-youtube-transcript"
+ },
+ {
+ "path": "./packages/skills"
+ },
+ {
+ "path": "./packages/cache-warming"
+ },
+ {
+ "path": "./packages/message-queue"
+ },
+ {
+ "path": "./packages/mcp"
+ },
+ {
+ "path": "./packages/lsp"
+ },
+ {
+ "path": "./packages/system-prompt"
+ },
+ {
+ "path": "./packages/cli"
+ },
+ {
+ "path": "./packages/journal-sink"
+ },
+ {
+ "path": "./packages/trace-store"
+ },
+ {
+ "path": "./packages/observability-collector"
+ },
+ {
+ "path": "./packages/trace-replay"
+ },
+ {
+ "path": "./packages/host-bin"
+ }
]
}