feat(FN-3389): fix scheduled evaluator integration types

Completes typing for the scheduled evaluator integration in the cron runner and project engine, with corresponding test updates in the evaluator test file.

Fusion-Task-Id: FN-3389
This commit is contained in:
Fusion
2026-05-06 05:59:05 -07:00
committed by gsxdsm
parent 323d6e7b21
commit 5ffb5097c4
20 changed files with 777 additions and 27 deletions

View File

@@ -1,5 +1,5 @@
import { describe, it, expect, vi, beforeEach, afterEach } from "vitest";
import { CronRunner, createAiPromptExecutor, isInProcessBackupCommand } from "../cron-runner.js";
import { CronRunner, createAiPromptExecutor, isInProcessBackupCommand, isInProcessScheduledEvalCommand } from "../cron-runner.js";
import type { AiPromptExecutor } from "../cron-runner.js";
import type { TaskStore, AutomationStore, ScheduledTask, AutomationRunResult, AutomationStep, Settings } from "@fusion/core";
import { randomUUID } from "node:crypto";
@@ -1842,4 +1842,17 @@ describe("CronRunner", () => {
});
}
});
describe("isInProcessScheduledEvalCommand", () => {
it("matches canonical scheduled eval command", () => {
expect(isInProcessScheduledEvalCommand("fn eval --scheduled-batch")).toBe(true);
expect(isInProcessScheduledEvalCommand("fusion eval --scheduled-batch --flag")).toBe(true);
});
it("rejects non-canonical and shell-metachar commands", () => {
expect(isInProcessScheduledEvalCommand("fn eval")).toBe(false);
expect(isInProcessScheduledEvalCommand("fn eval --scheduled-batch && echo x")).toBe(false);
expect(isInProcessScheduledEvalCommand("echo fn eval --scheduled-batch")).toBe(false);
});
});
});