Skip to content

DotCraft SDKs

DotCraft SDKs are language bindings over the same AppServer protocol. They let applications, native apps, tools, and external channels connect to a workspace, reuse persistent threads, stream turn events, and participate in approvals without reimplementing Session Core.

Get started

bash
npm install @dotcraft/sdk
bash
dotnet add package DotCraft.Sdk
bash
pip install dotcraft

Then follow the Quickstart to connect, start a thread, and run your first turn.

Guide

  • Quickstart — install, connect, run a turn, stream events.
  • Threads & runs — thread lifecycle, run options, and the normalized event model.
  • Tools & approvals — runtime dynamic tools and approval / user-input callbacks.
  • Channel adapters — build external channels (TypeScript and Python).

Common Model

All SDKs build on the same layers:

LayerRole
Hub bootstrapFinds or starts the local Hub and ensures a workspace AppServer when using local mode.
AppServer JSON-RPCCarries initialize, thread and turn methods, notifications, server requests, and raw escape-hatch calls.
Session CoreProvides the durable Thread -> Turn -> Item model, approvals, event ordering, and persisted history.
SDK bindingAdds language-idiomatic clients, helpers, callbacks, stream reducers, and typed wrappers.

Use the SDK when you want a client library. Use the AppServer Protocol directly when you are implementing a new transport, debugging the wire protocol, or need complete control over JSON-RPC messages.

Capability Snapshot

The SDK specification tracks the full cross-language parity matrix.

CapabilityTypeScript.NETPython
Local Hub-managed connectionDotCraft.local()DotCraftClient.ConnectLocalAsync()DotCraft.connect_local()
Remote WebSocket connectionDotCraft.remote()DotCraftClient.ConnectRemoteAsync()DotCraft.connect_remote()
Raw AppServer requestrequest()RequestAsync()request()
High-level one-turn runthread.run() / runStreamed()RunAsync() / RunStreamedAsync()thread.run() / run_streamed()
Normalized streaming eventsDotCraftRunEvent + rawDotCraftRunEvent + rawRunEvent + raw
Approval & user-input callbacksTyped handlersTyped handlersTyped handlers
Runtime Dynamic ToolsDeclaration + typed callbacksDeclaration + typed callbacksDeclaration + typed callbacks
App Binding helpersTyped/generic + handoff parseTyped/generic + handoff parseTyped/generic + handoff parse
Channel adapter runtimeFirst-party TypeScript runtimeNot applicableChannel adapter base class

SDKs should not duplicate server authority. AppServer remains the source of truth for thread state, queue behavior, approvals, model catalog resolution, and persistence.

Event Topology

SDK clients consume AppServer notifications and sometimes answer server-initiated requests. Notifications have no JSON-RPC id; server requests do, and clients must respond to them.

DotCraft SDK event topology

All three SDKs normalize common wire notifications into run events (DotCraftRunEvent in TypeScript and .NET, RunEvent in Python) and keep unknown notifications as raw, while still exposing the raw notification stream for advanced clients.

Reference

Per-language package details — identity, exports/namespaces, runtime baseline, version, and language-specific profiles:

Further Reading

Apache License 2.0