45fdf3ff9f
- Remove duplicate result.ts, import Result/ok/err from @uncaged/nerve-core - appendMessage uses INSERT...RETURNING instead of INSERT+SELECT - CloudRole.timeoutSeconds: per-role timeout (defaults to 300s) - TODO comments for rate limiting and capacity sensing
15 lines
485 B
TypeScript
15 lines
485 B
TypeScript
import { type CloudWorkflowDef, registerWorkflow } from "../workflows.js";
|
|
|
|
const pingPong: CloudWorkflowDef = {
|
|
name: "ping-pong",
|
|
roles: {
|
|
pinger: { prompt: "Send the literal word ping", timeoutSeconds: null },
|
|
ponger: { prompt: "Send the literal word pong", timeoutSeconds: null },
|
|
},
|
|
moderator: `$count(steps) >= 6 ? { "role": "__end__" } : $count(steps) % 2 = 0 ? { "role": "pinger" } : { "role": "ponger" }`,
|
|
};
|
|
|
|
registerWorkflow(pingPong);
|
|
|
|
export { pingPong };
|