fix(api): require api server callbacks

This commit is contained in:
ZacharyZhang-NY committed 2026-04-22 14:27:49 -04:00
1 parent 529bb109db
commit 5155136937
9 files changed
+103 -59

No files matched your search

+24
View File
@@ -0,0 +1,24 @@
import type { ApiServerEventCallbacks } from "../../src/main/api-server";
export function createTestApiServerCallbacks(
overrides: Partial<ApiServerEventCallbacks> = {},
): ApiServerEventCallbacks {
return {
onDomainChanged: () => {},
onWakeAgent: () => null,
onTaskCreated: () => {},
onTaskStatusChanged: () => {},
onCommentPosted: () => {},
onApprovalCreated: () => {},
onApprovalResolved: () => {},
createDocument: () => {
throw new Error("createDocument test callback was not provided.");
},
onAutoAssignTask: () => null,
onHumanMessage: () => {},
injectRuntimeMessage: () => false,
emitEvent: () => {},
notify: () => {},
...overrides,
};
}