DotCraft SDKs
Use a DotCraft SDK to connect an application to AppServer. Start with the high-level API for threads, runs, tools, approvals, and user input.
Start here
- Quickstart — connect and run your first turn.
- Threads & runs — manage threads, input, streaming, and recovery.
- Tools & approvals — add runtime tools and interactive callbacks.
- MCP runtime — inspect configured servers, resources, tools, and authentication.
- Channel adapters — connect an external messaging platform.
Inside a DotCraft conversation, $dotcraft-api picks the right shape for your integration (client, in-process host, or extension) and checks names against the generated protocol contract.
Choose an API layer
| Layer | Use it for |
|---|---|
| High-level | Applications that work with DotCraft, threads, runs, callbacks, models, MCP runtime, or App Binding. Start here. |
| Wire | Typed JSON-RPC, connection state, timeouts, and explicit raw extension calls. |
| Contracts | Generated DTOs, method maps, registries, and protocol metadata without transport I/O. |
Host adapters and Channel runtimes build on these layers and add environment-specific integration: workspace routing, heartbeat, platform delivery, and UI interaction.
Packages
| Language | Package | Availability |
|---|---|---|
| TypeScript | @dotcraft/sdk | Published on npm. |
| .NET | DotCraft.Sdk | Published on NuGet. |
The Quickstart is the single source for installation commands.
Common capabilities
| Task | TypeScript | .NET |
|---|---|---|
| Connect to a workspace | DotCraft.local() | ConnectLocalAsync() |
| Connect to default Chat | DotCraft.localChat() | ConnectLocalChatAsync() |
| Connect remotely | DotCraft.remote() | ConnectRemoteAsync() |
| Run a turn | run() / runStreamed() | RunAsync() / RunStreamedAsync() |
| Read history pages | listTurns() / listItems() | ListTurnsAsync() / ListItemsAsync() |
| List models | models.list() | Models.GetCatalogAsync() |
| Use MCP runtime | mcpRuntime | McpRuntime |
| Use App Binding | appBindings | AppBindings |
TypeScript also provides a Channel Adapter profile. .NET does not.
Connection ownership
A local high-level client asks Hub to ensure the workspace AppServer, then connects to AppServer directly. Closing the SDK connection does not stop a Hub-managed AppServer.
Reconnect restores Wire transport and initialization. It does not replay in-flight requests or rebuild thread subscriptions, active runs, or runtime tool bindings. See Threads & runs for recovery steps.
Language reference
Related docs
- AppServer mode — how the AppServer an SDK connects to is started, secured, and exposed over WebSocket.
- AppServer Protocol — the methods and notifications these clients speak.
- DotCraft App — App Binding, for applications that expose their own capabilities to a thread.