rowboat/apps/cli/src/app.ts

15 lines
492 B
TypeScript
Raw Normal View History

2025-11-07 11:42:10 +05:30
import { executeWorkflow } from "./application/lib/exec-workflow.js";
2025-10-28 13:17:06 +05:30
import { StreamRenderer } from "./application/lib/stream-renderer.js";
2025-11-07 11:42:10 +05:30
async function runWorkflow(id: string, userInput: string) {
2025-10-28 13:17:06 +05:30
const renderer = new StreamRenderer();
2025-11-07 11:42:10 +05:30
for await (const event of executeWorkflow(id, userInput)) {
renderer.render(event);
2025-10-28 13:17:06 +05:30
}
}
2025-11-07 11:42:10 +05:30
const workflowId = process.argv[2] ?? "example_workflow";
const userInputMsg = process.argv[3] ?? "";
2025-10-28 13:17:06 +05:30
2025-11-07 11:42:10 +05:30
runWorkflow(workflowId, userInputMsg);