Provider Adapters
Keep provider code behind one small interface.
provider.use(openai(), anthropic(), custom())Shiro gives TypeScript agents a real execution model: provider calls, tools, handoffs, approvals, memory, and traces all move through the same run.
pnpm add @shiro-sdk/core @shiro-sdk/openai zodlive shiro run
Build, run, inspect
The example on the left creates the run. The panels on the right show the state Shiro emits while it executes.
1import { Agent, Engine, tool } from "@shiro-sdk/core";2import { openai } from "@shiro-sdk/openai";34const deploy = tool({5 name: "deploy",6 requiresApproval: true,7 execute: async ({ target }) => ({ target, status: "queued" }),8});910const agent = new Agent({11 name: "release-manager",12 provider: openai({ model: "gpt-5" }),13 tools: [deploy],14});1516await new Engine().run(agent, "Ship the canary build.");Run paused. Waiting for deploy approval.
agent run trace
Execution stream
Shiro exposes the run as structured events, so application code and Studio see the same provider calls, tool spans, handoffs, and approval waits.
agent.stream()
Run pipeline
event stream active
active: Triage Agent
Instructions, model, tools, memory, and policy are resolved for this run.
Step 2 of 5
// Triage Agent
const result = await engine.execute(agent, input);
traces.on("agent.plan()", event => studio.record(event));
await traces.export(new JsonTraceExporter());Runtime features
Shiro keeps operational concerns in the runtime instead of scattering them across app code.
Keep provider code behind one small interface.
provider.use(openai(), anthropic(), custom())Pause specific tools until a reviewer approves the action.
requiresApproval: trueAttach durable context without mutating agent definitions.
session.getMessages()Validate final answers before they leave the run.
output: z.object({ ... })Persist model calls, tools, handoffs, approvals, and timing.
result.trace.stepsUse Studio to inspect runs while you build and debug.
studio.open(run.id)runtime dependency
Zod core only
typed SDK surface
Strict TypeScript inference
core execution layers
Visible pipeline
Studio workspaces
Local product UI
The engine depends on Shiro’s provider contract. Use `@shiro-sdk/openai` today, or implement the same interface for another model without changing agent code.
Shiro Studio
Inspect a timeline, open an approval, follow a handoff, and compare memory state without adding one-off debug screens to your app.
Explore tracingAdd a provider, define one tool, and stream the trace before you build the surrounding app.
pnpm add @shiro-sdk/core @shiro-sdk/openai zod