Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Emanuele-web04/dpcode/llms.txt

Use this file to discover all available pages before exploring further.

The DP Code server exposes a single WebSocket endpoint that powers all real-time communication between clients and the server. The protocol is a JSON-RPC-like design built on top of Effect RPC, carrying two distinct interaction patterns: request/response calls and streaming subscriptions. All messages are JSON.

Endpoint

GET /ws
Clients connect by upgrading an HTTP connection to WebSocket at this path. The server negotiates the upgrade and begins the session. Upon successful connection, the server immediately emits a server.welcome push event containing the server’s working directory, home directory, project name, and optional bootstrap identifiers.

Authentication

Authentication is optional and depends on whether the server was started with --auth-token.
Server modeHow to authenticate
No auth token configuredConnect without credentials — all connections are accepted.
Auth token configuredPass the auth token as ?token=<auth-token> in the connection URL.
GET /ws?token=<auth-token>
The value of <auth-token> is the same token you set with --auth-token (or T3CODE_AUTH_TOKEN) when starting the server. If the token is missing or does not match, the WebSocket handshake is rejected before the connection opens. For session-based auth flows (cookie or Bearer), the server also accepts a short-lived WebSocket token obtained from POST /api/auth/ws-token via the ?wsToken=<ws-token> query parameter.

Message format

Client → server requests

Every request carries a unique id and a body. The body contains a _tag field that selects the RPC method, plus the method’s input fields.
{
  "id": "req-001",
  "body": {
    "_tag": "git.status",
    "cwd": "/home/user/my-project"
  }
}

Server → client responses

Responses echo the same id. Exactly one of result or error will be present.
{
  "id": "req-001",
  "result": {
    "branch": "main",
    "hasWorkingTreeChanges": false
  }
}
{
  "id": "req-001",
  "error": {
    "message": "Repository not found at /home/user/my-project"
  }
}

Server → client push messages

The server proactively pushes events on named channels. Push messages carry a monotonically increasing sequence number that clients can use to detect gaps and replay missed events.
{
  "type": "push",
  "sequence": 42,
  "channel": "orchestration.domainEvent",
  "data": { ... }
}

Error type

All RPC errors use the WsRpcError structure:
message
string
required
Human-readable description of what went wrong.
cause
unknown
Optional root cause, present when the failure originated from an underlying system error.

Push channels

These channels emit events without an explicit subscription call. Clients receive them automatically for the lifetime of the connection.
ChannelDescription
server.welcomeEmitted once on connect with server identity and bootstrap hints.
server.maintenanceUpdatedServer lifecycle and maintenance task updates (e.g. thread retention).
server.configUpdatedProvider statuses and config issues changed.
server.providerStatusesUpdatedProvider health statuses refreshed.
server.settingsUpdatedServer settings changed.
git.actionProgressReal-time progress events for stacked git actions (commit/push/PR).
terminal.eventTerminal session I/O and lifecycle events.
orchestration.domainEventOrchestration domain events (project/thread state changes).
orchestration.shellEventShell-only project/thread list updates.
orchestration.threadEventDetailed events for a subscribed thread.

Method groups

The full set of RPC methods is organized into four groups:

Orchestration

Manage projects, threads, turns, subscriptions, and diffs. The core API for driving AI coding sessions.

Git

Status, branches, worktrees, stash, pull requests, and streaming commit/push/PR workflows.

Terminal

Open, write to, resize, clear, restart, and close terminal sessions inside the server.

Server

Configuration, settings, provider management, diagnostics, voice transcription, and keybindings.

Build docs developers (and LLMs) love