Overview
Duclaw SDK is the public TypeScript API exposed by duclaw-cli.
Use it when you want to build an agent runtime from explicit contracts instead of importing Duclaw product defaults.
What the SDK Provides
| Area | What to use |
|---|---|
| Agent loop | createAgent, SdkAgentConfig, SdkRunResult |
| Model access | LLMClient, anthropic |
| State | Storage<T>, memoryStorage |
| Capabilities | tool, Tool |
| Runtime activity | RuntimeEventBus, RuntimeEvent |
| Channels | ChannelPlugin, ChannelRegistry |
Package Boundary
Generic SDK integrations should import from the core entrypoint:
ts
import { createAgent } from "duclaw-cli/sdk";Duclaw product composition is opt-in:
ts
import { duclawPreset } from "duclaw-cli/sdk/duclaw";Runtime Shape
An SDK consumer owns composition:
txt
Your app
|-- createAgent(config).run(input)
|-- LLMClient
|-- Storage<Message[]>
|-- Tool[] + ToolExecutor
|-- RuntimeEventBus
`-- ChannelPlugin optionalNext Steps
- Start with Install.
- Review the package entrypoints.
- Read the Agent API.