mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-20 13:02:18 +00:00
Integrate OpenHandoff factory workspace (#212)
This commit is contained in:
parent
3d9476ed0b
commit
bf282199b5
251 changed files with 42824 additions and 692 deletions
16
factory/packages/backend/src/services/queue.ts
Normal file
16
factory/packages/backend/src/services/queue.ts
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
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];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue