Reference
IPC API
Renderer-to-main IPC contracts for scheduling and todo-runner automation.
IPC API
This page documents the in-app IPC contracts exposed through window.electronAPI.
Scheduler API
Path: window.electronAPI.scheduler
Methods:
list(): Promise<SchedulerTask[]>upsert(task: SchedulerTaskInput): Promise<SchedulerTask>delete(taskId: string): Promise<void>runNow(taskId: string): Promise<SchedulerTask>onUpdated(callback: () => void): Unsubscribe
SchedulerTaskInput
{
id?: string;
name: string;
cron: string; // minute hour day month weekday
prompt: string;
workingDirectory: string;
enabled: boolean;
yoloMode: boolean;
}Scheduler Runtime Fields
Returned schedule entries include runtime fields such as:
nextRunAtisRunninglastRunAtlastStatuslastErrorlastDurationMslastRunTrigger
Persistence location:
~/.agent-observer/schedules.json
Todo Runner API
Path: window.electronAPI.todoRunner
Methods:
list(): Promise<TodoRunnerJob[]>upsert(job: TodoRunnerJobInput): Promise<TodoRunnerJob>delete(jobId: string): Promise<TodoRunnerDeleteResult>start(jobId: string): Promise<TodoRunnerJob>pause(jobId: string): Promise<TodoRunnerPauseResult>reset(jobId: string): Promise<TodoRunnerJob>onUpdated(callback: () => void): Unsubscribe
TodoRunnerJobInput
{
id?: string;
name: string;
prompt: string;
workingDirectory: string;
runnerCommand: string;
enabled: boolean;
yoloMode: boolean;
todoItems: string[];
}TodoRunnerJob Runtime Fields
Returned jobs include runtime/progress fields:
isRunninglastRunAtlastStatuslastErrorlastDurationMslastRunTriggertotalTodoscompletedTodosfailedTodosblockedTodoscurrentTodoIndexnextTodoTextnextRetryAt
Persistence location:
~/.agent-observer/todo-runner.json
Update Events
- Scheduler update channel:
scheduler:updated - Todo Runner update channel:
todoRunner:updated
Both are subscribed through the preload helpers (onUpdated) and should trigger a fresh list() call in UI state.
Error Handling Expectations
- Invalid input throws from IPC handler and should be shown in UI.
- Missing directories are reported as runtime errors in task/job status.
- Long-running actions should always update UI via corresponding
onUpdatedevent.
Related Source Files
src/preload/index.tssrc/shared/electron-api.tssrc/main/scheduler.tssrc/main/todo-runner.ts