Editor front-end for the gateway. You stay in your editor; the gateway fans your prompt out to every AI coding tool, verifies and judges the candidates, and returns one optimized answer. How you treat that answer (save / edit / undo) becomes the implicit feedback that trains the router and the RAG memory.
What it does
-
Ask / Refactor (
Ctrl/Cmd+Alt+A): select code (optional), describe the task. The extension callsPOST /v1/askwith yourdeveloper_id,team, and the file's language. -
Result panel: the winning answer with confidence, the routing mode, the verification result (syntax/lint/tests), why it was chosen, the learned patterns of yours that shaped it, and an Alternatives escape hatch.
-
Apply: replaces your selection with the answer (code fences stripped).
-
Implicit feedback →
POST /v1/feedback, recovering the "lost click":You do this after Apply Outcome sent Effect on backend Save with the code intact committedreward winner arm · learn the pattern · charge metering Edit the code, then save editedneutral arm · charge metering Undo (or Reject), then save revertedpenalize winner arm · no charge The save/edit/undo mapping is a deliberately simple heuristic (see
src/feedbackTracker.ts); a stronger signal (passed CI / survived in git) is the documented next step.
Run it
# 1. start the gateway (from the repo root)
uvicorn gateway.app2:app --reload # serves http://localhost:8000
# 2. build & launch the extension
cd ide/vscode
npm install
# press F5 in VS Code -> "Run Doctopus.ai Extension" (opens an Extension Dev Host)
Then in the dev-host window: open a file, select some code, press
Ctrl/Cmd+Alt+A, type an instruction.
Settings
| Setting | Default | Meaning |
|---|---|---|
doctopus.serverUrl |
https://doctopus-gateway.onrender.com |
Gateway base URL (hosted by default; override for local/self-hosted) |
doctopus.developerId |
OS username | per-developer routing & memory key |
doctopus.team |
default |
chargeback metering & team-shared patterns |
Layout
| File | Role |
|---|---|
src/extension.ts |
activation, the Ask command, apply-to-editor |
src/gatewayClient.ts |
typed HTTP client for /v1/ask and /v1/feedback |
src/feedbackTracker.ts |
maps save/edit/undo → committed/edited/reverted |
src/resultPanel.ts |
webview rendering the answer + transparency payload |
Other IDEs
The client/feedback logic is small and HTTP-only; a JetBrains plugin would
reimplement the same three calls (ask, apply, feedback) against the same
endpoints.