import { Agent, openai } from "@agentium/core";
import { AgentQueue, AgentWorker } from "@agentium/queue";
const reportAgent = new Agent({
name: "report-agent",
model: openai(process.env.OPENAI_FAST_MODEL ?? "gpt-6-luna"),
instructions: "You write a short status line.",
});
const connection = { host: "localhost", port: 6379 };
const queue = new AgentQueue({ connection, queueName: "scheduled-runs" });
await queue.schedule({
id: "status-check",
cron: "*/5 * * * *",
agent: { name: "report-agent", input: "System status check." },
});
await queue.schedule({
id: "daily-report",
cron: "0 9 * * *",
timezone: "Asia/Kolkata",
agent: {
name: "report-agent",
input: "Write the daily report.",
sessionId: "daily-report",
},
});
const worker = new AgentWorker({
connection,
queueName: "scheduled-runs",
agentRegistry: { "report-agent": reportAgent },
});
worker.start();