sandbox-agent/foundry/packages/backend/src/services/queue.ts
Nathan Flurry d75e8c31d1
Rename Foundry handoffs to tasks (#239)
* Restore foundry onboarding stack

* Consolidate foundry rename

* Create foundry tasks without prompts

* Rename Foundry handoffs to tasks
2026-03-11 13:23:54 -07:00

16 lines
455 B
TypeScript

interface QueueSendResult {
status: "completed" | "timedOut";
response?: unknown;
}
export function expectQueueResponse<T>(result: QueueSendResult | void): T {
if (!result || result.status === "timedOut") {
throw new Error("Queue command timed out");
}
return result.response as T;
}
export function normalizeMessages<T>(input: T | T[] | null | undefined): T[] {
if (!input) return [];
return Array.isArray(input) ? input : [input];
}