@kognitivedev/adapter-claude-agent-sdk
v0.2.28
Published
Claude Agent SDK adapter layer for Kognitive's provider-agnostic runtime
Maintainers
Readme
@kognitivedev/adapter-claude-agent-sdk
Claude Agent SDK bridge for Kognitive's provider-agnostic runtime.
Installation
bun add @kognitivedev/adapter-claude-agent-sdk @anthropic-ai/claude-agent-sdk zodWhat It Provides
createClaudeAgentRuntimeAdapter()- Claude Agent SDK streaming mapped into Kognitive stream events
- Session management helpers
- MCP server wiring and tool exposure through Claude's SDK
- Permission, sandbox, and delegation config mapping
Structured output is mapped to Claude Code's outputFormat: { type: "json_schema" }. The adapter accepts either Zod or raw JSON Schema and normalizes Zod input to JSON Schema automatically.
Example
import { createAgent } from "@kognitivedev/agents";
import { createClaudeAgentRuntimeAdapter } from "@kognitivedev/adapter-claude-agent-sdk";
const agent = createAgent({
name: "researcher",
instructions: "You are a careful research agent.",
runtime: createClaudeAgentRuntimeAdapter({
model: "sonnet",
allowedTools: ["Read", "Glob", "Grep", "Agent"],
}),
});
const result = await agent.generateObject<{ summary: string }>({
messages: [{ role: "user", content: "Summarize the repo and return one sentence." }],
resourceId: {},
structuredOutput: {
schema: {
type: "object",
properties: {
summary: { type: "string" },
},
required: ["summary"],
},
},
});