rowboat/apps/cli/src/app.ts

19 lines
491 B
TypeScript
Raw Normal View History

2025-11-15 01:51:22 +05:30
import { streamAgent } from "./application/lib/agent.js";
2025-10-28 13:17:06 +05:30
import { StreamRenderer } from "./application/lib/stream-renderer.js";
2025-11-15 01:51:22 +05:30
export async function app(opts: {
agent: string;
runId?: string;
input?: string;
}) {
2025-10-28 13:17:06 +05:30
const renderer = new StreamRenderer();
2025-11-15 01:51:22 +05:30
for await (const event of streamAgent({
...opts,
interactive: true,
})) {
2025-11-07 11:42:10 +05:30
renderer.render(event);
2025-11-11 12:32:46 +05:30
if (event?.type === "error") {
process.exitCode = 1;
}
2025-10-28 13:17:06 +05:30
}
2025-11-15 01:51:22 +05:30
}