TypeScript SDK reference
Package identity and language-specific details for @dotcraft/sdk. For how-to, start with the Quickstart.
Package
| Package | @dotcraft/sdk (npm) |
| Module format | ESM ("type": "module") |
| Runtime baseline | Node.js 20+ |
| Version | version, sdkContractVersion exported from the package |
npm install @dotcraft/sdkEntry points
The package is split into subpath exports so apps only pull in what they use:
| Entry point | Purpose |
|---|---|
@dotcraft/sdk | High-level application API (DotCraft, DotCraftThread, run, events). |
@dotcraft/sdk/wire | Low-level JSON-RPC client, transports, raw DTOs. |
@dotcraft/sdk/hub | Hub discovery, startup, and SSE helpers. |
@dotcraft/sdk/channel | Channel adapter and hosted module runtime. |
@dotcraft/sdk/testing | Conformance test helpers. |
Top-level exports
DotCraft, DotCraftThread, DotCraftRunResult, DotCraftRunEvent, DotCraftError, the typed error classes (TurnInProgressError, TurnFailedError, …), input part builders (textPart, imageUrlPart, localImagePart, skillRefPart, commandRefPart, fileRefPart), App Binding helpers (parseAppBindingHandoff, appBindingToolError, APP_BINDING_ERROR_CODES), and the approval decision constants.
Channel modules
TypeScript owns the first-party hosted channel modules, each depending on @dotcraft/sdk:
@dotcraft/channel-feishu, @dotcraft/channel-weixin, @dotcraft/channel-telegram, @dotcraft/channel-qq, @dotcraft/channel-wecom. See Channel adapters.
Validation
cd sdk/typescript
npm run typecheck:all
npm run test:allSee also
- Quickstart · Threads & runs · Tools & approvals · Channel adapters
- TypeScript binding spec:
specs/sdk/typescript.md