TypeScript SDK · v0.1.0
The agent harness.
Embed a full agent loop — tools, sessions, permissions, streaming events — into any Node.js or Bun application with a single import. skawld is small, opinionated, and built to be quiet inside a larger app.
#What it does
Skawld is the loop that sits between your application code and a language model. It handles message turns, tool-call routing, streaming events, permission checks, session persistence, compaction, and graceful errors — so the rest of your app can stay an ordinary TypeScript program.
#The four pieces
Everything in skawld breaks into a handful of independent objects. You can swap any one without touching the others.
| Object | Responsibility |
|---|---|
| Agent | Top-level handle. Owns a provider, a tool registry, a permission engine, and a session store. |
| Session | A single conversation. Persists messages and tool calls, streams events back as an async iterator. |
| Provider | Adapter for a model API. Anthropic, OpenAI Responses, OpenAI Chat Completions — or roll your own. |
| Tool | A function the agent can call. File ops, shell, glob/grep, task tracking, MCP servers, and your own. |
#At a glance
agent.ts
import { Agent } from "@skawld/agent-sdk"; import { AnthropicProvider } from "@skawld/agent-sdk/providers"; import { defaultTools } from "@skawld/agent-sdk/tools"; const agent = new Agent({ provider: new AnthropicProvider(), // reads ANTHROPIC_API_KEY model: "claude-opus-4-5", tools: defaultTools(), permissions: { mode: "default" }, }); const session = await agent.session(); for await (const event of session.run("List the files in the current directory.")) { if (event.type === "assistant") { for (const block of event.message.content) { if (block.type === "text") process.stdout.write(block.text); } } if (event.type === "result") break; } await agent.close();
That’s the whole loop. The rest of these pages unpack each piece.