import { createSmithers } from "smithers-orchestrator";
import { ToolLoopAgent as Agent } from "ai";
import { anthropic } from "@ai-sdk/anthropic";
import { z } from "zod";
const { Workflow, Task, smithers, outputs } = createSmithers({
research: z.object({ findings: z.string() }),
summary: z.object({ summary: z.string() }),
});
const researcher = new Agent({
model: anthropic("claude-sonnet-4-20250514"),
instructions: "You are a research assistant.",
});
export default smithers((ctx) => (
<Workflow name="research-pipeline" cache>
<Task id="research" output={outputs.research} agent={researcher}>
{`Research the topic: ${ctx.input.topic}`}
</Task>
<Task id="summary" output={outputs.summary}>
{{ summary: "Workflow complete." }}
</Task>
</Workflow>
));