The orchestration methods are the central API for managing projects, threads, and AI agent sessions in DP Code. They use theDocumentation 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.
orchestration.* method namespace. All methods follow the WebSocket protocol described in the overview.
orchestration.dispatchCommand
Dispatch a client orchestration command. This is the primary write path for all state-changing operations — creating projects and threads, starting turns, responding to approvals, reverting checkpoints, and more. The method name in the_tag field is orchestration.dispatchCommand.
Returns: { sequence: number } — the event sequence number assigned to the resulting domain event.
Parameters
A tagged union. Set
type to one of the command types listed below.Response
The event sequence number produced by this command.
Example
- Request
- Response
orchestration.getSnapshot
Return the full orchestration read model: all projects and all threads with complete message, activity, checkpoint, and session data. No parameters required.Response
The event sequence number this snapshot was built from.
Array of all projects.
Array of all threads, each with full message and activity history.
ISO 8601 timestamp of the last update.
orchestration.getShellSnapshot
Return a lightweight snapshot containing only project and thread shell data (no messages, no activities, no checkpoints). Prefer this overgetSnapshot when you only need to render the sidebar list.
Response
Array of
OrchestrationProjectShell objects (same fields as full project, minus deletedAt).Array of
OrchestrationThreadShell objects — thread metadata plus latest turn and session status, no messages.orchestration.subscribeShell
Streaming. Subscribe to incremental shell updates. The server emits asnapshot item first, then streams project-upserted, project-removed, thread-upserted, and thread-removed events as state changes. No parameters required.
Stream items
One of:
"snapshot", "project-upserted", "project-removed", "thread-upserted", "thread-removed".Present on event items. Monotonically increasing sequence number.
Present when
kind is "snapshot". Contains the full OrchestrationShellSnapshot.Present when
kind is "project-upserted". Contains OrchestrationProjectShell.Present when
kind is "project-removed".Present when
kind is "thread-upserted". Contains OrchestrationThreadShell.Present when
kind is "thread-removed".orchestration.subscribeThread
Streaming. Subscribe to detailed events for a specific thread. The server emits asnapshot item first, then streams OrchestrationEvent items as they occur.
Parameters
ID of the thread to subscribe to.
Stream items
Present when
kind is "snapshot". Contains OrchestrationThreadDetailSnapshot with snapshotSequence and the full OrchestrationThread.Present when
kind is "event". Contains an OrchestrationEvent (see event types below).OrchestrationEvent structure
Every event shares these base fields:Monotonic sequence number.
Event type string (see list below).
Project or thread ID.
ISO 8601 timestamp.
Event-specific payload (varies by
type).| Type | Payload |
|---|---|
project.created | Project creation fields |
project.meta-updated | Changed project metadata fields |
project.deleted | { projectId, deletedAt } |
thread.created | Thread creation fields |
thread.deleted | { threadId, deletedAt } |
thread.archived / thread.unarchived | { threadId, archivedAt/unarchivedAt } |
thread.meta-updated | Changed thread metadata fields |
thread.runtime-mode-set | { threadId, runtimeMode, updatedAt } |
thread.interaction-mode-set | { threadId, interactionMode, updatedAt } |
thread.message-sent | Full message fields |
thread.turn-queued / thread.turn-start-requested | Turn request fields |
thread.turn-interrupt-requested | { threadId, turnId?, createdAt } |
thread.approval-response-requested | { threadId, requestId, decision, createdAt } |
thread.user-input-response-requested | { threadId, requestId, answers, createdAt } |
thread.checkpoint-revert-requested | { threadId, turnCount, createdAt } |
thread.reverted | { threadId, turnCount } |
thread.conversation-rollback-requested | { threadId, messageId, numTurns, createdAt } |
thread.conversation-rolled-back | { threadId, messageId, numTurns, removedTurnIds? } |
thread.session-set | { threadId, session } |
thread.proposed-plan-upserted | { threadId, proposedPlan } |
thread.turn-diff-completed | Checkpoint summary fields |
thread.activity-appended | { threadId, activity } |
orchestration.getTurnDiff
Retrieve the git diff for a range of turns in a thread.Parameters
ID of the thread.
Start of the turn count range (inclusive). Must be less than or equal to
toTurnCount.End of the turn count range (inclusive).
Response
Unified diff string.
orchestration.getFullThreadDiff
Retrieve the cumulative git diff for an entire thread up to a specified turn count.Parameters
The turn count ceiling for the diff.
Response
Same structure asgetTurnDiff: { threadId, fromTurnCount, toTurnCount, diff }.
orchestration.importThread
Import a thread from an external source by mapping it to an existing internal thread.Parameters
Internal thread ID to map to.
External identifier to import from.
Response
The internal thread ID that was created or updated.
orchestration.repairState
Repair inconsistent orchestration state by re-projecting from stored events. No parameters required. Returns the repaired fullOrchestrationReadModel.
orchestration.replayEvents
Replay orchestration domain events from a given sequence number. Useful after a reconnect to catch up on events missed while offline.Parameters
Replay all events with a sequence number greater than this value.
Response
An array ofOrchestrationEvent objects in sequence order.
Example
- Request
- Response
ModelSelection
TheModelSelection object identifies the provider and model for a session. The provider field is a discriminant:
| Provider | provider value | Options type |
|---|---|---|
| OpenAI Codex | "codex" | CodexModelOptions |
| Claude Code | "claudeAgent" | ClaudeModelOptions |
| Cursor | "cursor" | CursorModelOptions |
| Gemini | "gemini" | GeminiModelOptions |
| Grok | "grok" | GrokModelOptions |
| Kilo | "kilo" | OpenCodeModelOptions |
| OpenCode | "opencode" | OpenCodeModelOptions |
| Pi | "pi" | PiModelOptions |