trellis
Version:
Agentic State Engine — event-sourced causal graph with branching, decision traces, and realtime sync for AI-native applications
32 lines • 1.45 kB
TypeScript
/**
* Kernel-backed CronStore + plugin factory.
* @module trellis/plugins/cron/plugin
*/
import type { PluginDef } from '../../core/plugins/types.js';
import type { TrellisKernel } from '../../core/kernel/trellis-kernel.js';
import type { TenantPool } from '../../server/tenancy.js';
import { CronScheduler } from './scheduler.js';
import type { CronStore } from './types.js';
/** Build a CronStore over a TrellisKernel. */
export declare function createKernelCronStore(kernel: TrellisKernel): CronStore;
/** CronStore over the default tenant in a TenantPool. */
export declare function createPoolCronStore(pool: TenantPool): CronStore;
export interface CreateCronPluginOptions {
tickMs?: number;
leaseMs?: number;
ownerId?: string;
/** When false, onLoad does not start the timer (tests). Default true. */
autoStart?: boolean;
}
export declare function createCronPlugin(kernel: TrellisKernel, opts?: CreateCronPluginOptions): PluginDef & {
scheduler: CronScheduler;
};
/**
* Attach a CronScheduler to a running server pool.
* Returns null when TRELLIS_CRON=0.
*/
export declare function attachCronToPool(pool: TenantPool, opts?: CreateCronPluginOptions): CronScheduler | null;
/** Ensure a demo job exists (idempotent). */
export declare function ensureDemoPingJob(store: CronStore): Promise<void>;
export declare function seedDemoPingJob(kernel: TrellisKernel): Promise<string>;
//# sourceMappingURL=plugin.d.ts.map