feat(FN-1269): complete routine engine integration with RoutineRunner and RoutineScheduler
- Add RoutineRunner class for routine execution via heartbeat system - Add RoutineScheduler class for cron-based routine polling - Add triggerManual and triggerWebhook methods for API and webhook triggers - Wire RoutineScheduler into InProcessRuntime lifecycle - Add routine trigger and webhook API endpoints - Fix type mismatches between PROMPT and actual FN-1519 types
This commit is contained in:
@@ -385,7 +385,12 @@ describe("RoutineStore", () => {
|
||||
store.on("routine:deleted", listener);
|
||||
|
||||
await store.deleteRoutine(routine.id);
|
||||
expect(listener).toHaveBeenCalledWith(routine);
|
||||
expect(listener).toHaveBeenCalled();
|
||||
const emittedRoutine = listener.mock.calls[0][0];
|
||||
// Verify the emitted routine has the expected fields
|
||||
expect(emittedRoutine.id).toBe(routine.id);
|
||||
expect(emittedRoutine.name).toBe("Delete test");
|
||||
expect(emittedRoutine.agentId).toBe("test-agent");
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -1907,7 +1907,7 @@ export interface AgentHeartbeatEvent {
|
||||
}
|
||||
|
||||
/** What triggered a heartbeat run */
|
||||
export type HeartbeatInvocationSource = "on_demand" | "timer" | "assignment" | "automation";
|
||||
export type HeartbeatInvocationSource = "on_demand" | "timer" | "assignment" | "automation" | "routine";
|
||||
|
||||
/** Snapshot of the last blocked state for a task, used for dedup comparison. */
|
||||
export interface BlockedStateSnapshot {
|
||||
|
||||
Reference in New Issue
Block a user