/** * cogitator schedule, cogitator inbox and cogitator trigger: the routines, schedules and inbox a * runtime keeps in files (`experimental_fileTriggerStores`, `.cogitator/triggers` by default), * changed while the runtime runs, and the API triggers of a running server */ import { Command } from 'commander'; import { type FileTriggerStores } from '@cogitator-ai/core'; import type { InboxItemKind, InboxItemStatus } from '@cogitator-ai/types'; /** Where the commands print */ export interface TriggersIo { print(line: string): void; } /** What the commands work on: the stores, how to print, how to reach a server */ export interface TriggersContext { io: TriggersIo; stores: (dir: string | undefined) => FileTriggerStores; fetch: typeof fetch; env: NodeJS.ProcessEnv; } interface Flags { dir?: string; json?: boolean; } /** cogitator schedule list */ export declare function runScheduleList(flags: Flags, context?: TriggersContext): Promise; export interface ScheduleAddFlags extends Flags { cron: string; timezone?: string; agent?: string; workflow?: string; prompt: string; name?: string; catchUp?: 'latest' | 'none' | 'all'; overlap?: 'skip' | 'queue' | 'parallel' | 'replace'; } /** cogitator schedule add */ export declare function runScheduleAdd(id: string, flags: ScheduleAddFlags, context?: TriggersContext): Promise; /** cogitator schedule rm */ export declare function runScheduleRemove(id: string, flags: Flags, context?: TriggersContext): Promise; /** cogitator schedule pause|resume */ export declare function runSchedulePause(id: string, enabled: boolean, flags: Flags, context?: TriggersContext): Promise; /** cogitator schedule run */ export declare function runScheduleRun(id: string, flags: Flags, context?: TriggersContext): Promise; export interface InboxFlags extends Flags { unread?: boolean; all?: boolean; archived?: boolean; kind?: InboxItemKind; limit?: number; } /** cogitator inbox */ export declare function runInboxList(flags: InboxFlags, context?: TriggersContext): Promise; /** cogitator inbox read|unread|archive */ export declare function runInboxMark(id: string, status: InboxItemStatus, flags: Flags, context?: TriggersContext): Promise; /** cogitator inbox show */ export declare function runInboxShow(id: string, flags: Flags, context?: TriggersContext): Promise; export interface FireFlags { text?: string; url?: string; token?: string; idempotencyKey?: string; json?: boolean; } /** cogitator trigger fire : POSTs to the API trigger of a running server */ export declare function runTriggerFire(id: string, flags: FireFlags, context?: TriggersContext): Promise; /** cogitator trigger token : issues a new token for an API trigger of a routine of the store */ export declare function runTriggerToken(id: string, flags: Flags, context?: TriggersContext): Promise; export declare const scheduleCommand: Command; export declare const inboxCommand: Command; export declare const triggerCommand: Command; export {}; //# sourceMappingURL=triggers.d.ts.map