#!/usr/bin/env bun
import { createSmithersRoot } from "smithers";
import { createSmithersDB } from "smithers/smithers-orchestrator/src/db";
import { SmithersProvider } from "smithers/smithers-orchestrator/src/components/SmithersProvider";
import { Claude } from "smithers/smithers-orchestrator/src/components/Claude";
async function main() {
// Create database for state persistence
const db = await createSmithersDB({ path: ".smithers/hello-world" });
const executionId = await db.execution.start("Hello World", "hello-world.tsx");
function HelloWorld() {
return (
<SmithersProvider db={db} executionId={executionId}>
<Claude
model="haiku"
maxTurns={1}
onFinished={(result) => {
console.log("Claude says:", result.output);
}}
>
Say "Hello from Smithers!" in a creative way.
</Claude>
</SmithersProvider>
);
}
const root = createSmithersRoot();
await root.mount(HelloWorld);
await db.execution.complete(executionId);
await db.close();
}
main();