vscode-copilot-bridge/vscode-bridge
Devin AI b1105e5869 feat(vscode-bridge): Copilot Chat bridge (OpenAI facade + JSON-RPC tools)
- Implements VS Code extension per AGENTS.md specification
- OpenAI-style HTTP facade: POST /v1/chat/completions (SSE), GET /v1/models, GET /healthz
- JSON-RPC WebSocket server with methods: mcp.fs.read/list, mcp.search.code, mcp.symbols.list, mcp.edit.applyPatch, mcp.format.apply, mcp.imports.organize
- Copilot Chat integration via vscode.chat.requestChatAccess('copilot')
- Commands: bridge.enable/disable/status with status bar indicator
- Security: localhost-only binding, optional bearer token, read-only by default
- Policy enforcement via optional .agent-policy.yaml
- Ephemeral port management with globalState persistence

Co-Authored-By: Lars Baunwall <larslb@thinkability.dk>
2025-08-12 16:59:51 +00:00
..
dist feat(vscode-bridge): Copilot Chat bridge (OpenAI facade + JSON-RPC tools) 2025-08-12 16:59:51 +00:00
node_modules feat(vscode-bridge): Copilot Chat bridge (OpenAI facade + JSON-RPC tools) 2025-08-12 16:59:51 +00:00
src feat(vscode-bridge): Copilot Chat bridge (OpenAI facade + JSON-RPC tools) 2025-08-12 16:59:51 +00:00
.vscodeignore feat(vscode-bridge): Copilot Chat bridge (OpenAI facade + JSON-RPC tools) 2025-08-12 16:59:51 +00:00
package-lock.json feat(vscode-bridge): Copilot Chat bridge (OpenAI facade + JSON-RPC tools) 2025-08-12 16:59:51 +00:00
package.json feat(vscode-bridge): Copilot Chat bridge (OpenAI facade + JSON-RPC tools) 2025-08-12 16:59:51 +00:00
README.md feat(vscode-bridge): Copilot Chat bridge (OpenAI facade + JSON-RPC tools) 2025-08-12 16:59:51 +00:00
tsconfig.json feat(vscode-bridge): Copilot Chat bridge (OpenAI facade + JSON-RPC tools) 2025-08-12 16:59:51 +00:00

Copilot Bridge (OpenAI Facade + JSON-RPC)

Overview

  • Runs inside VS Code Desktop.
  • Exposes an OpenAI-style HTTP API and a JSON-RPC WebSocket tool bus.
  • Uses Copilot Chat via the VS Code Chat API per request.

Endpoints

  • HTTP (OpenAI-like), bind to 127.0.0.1 by default:
    • POST /v1/chat/completions (SSE)
    • GET /v1/models
    • GET /healthz

JSON-RPC (WebSocket)

  • Methods:
    • mcp.fs.read { path }
    • mcp.fs.list { glob, limit }
    • mcp.search.code { query, glob, maxResults }
    • mcp.symbols.list { path }
    • mcp.edit.applyPatch { unifiedDiff, verify? }
    • mcp.format.apply { path }
    • mcp.imports.organize { path }

Commands

  • Copilot Bridge: Enable
  • Copilot Bridge: Disable
  • Copilot Bridge: Status

Settings

  • bridge.enabled (false)
  • bridge.bindAddress ("127.0.0.1")
  • bridge.openai.port (0 random)
  • bridge.rpc.port (0 random)
  • bridge.token ("")
  • bridge.readOnly (true)
  • bridge.history.maxTurns (3)

Example curl curl -N -H "Content-Type: application/json" -d '{"model":"gpt-4o-copilot","stream":true,"messages":[{"role":"user","content":"hello"}]}' http://127.0.0.1:PORT/v1/chat/completions

Policy

  • Optional .agent-policy.yaml at workspace root to allow/deny writes and shell.
  • Writes are denied by default unless bridge.readOnly=false and policy allows.