/** * Task Types * * Type definitions for the task execution system. * Tasks are user-defined functions in `tasks/` that can run * locally via `veryfront task ` or in the cloud as runs and schedules. */ import type { ScheduleIntegrationRequirementConfig } from "../schedule/types.js"; /** * Context passed to task run() function */ export interface TaskContext { /** Environment variables */ env: Record; /** Run config (when executed by the platform) */ config: Record; /** Project ID (when executed by the platform) */ projectId?: string; /** Environment ID for the runtime target executing this task */ environmentId?: string; /** Cooperative cancellation for request- or runtime-scoped execution */ signal?: AbortSignal; } /** * Task definition exported from a tasks/ file */ export interface TaskDefinition { /** Human-readable name */ name?: string; /** Task description */ description?: string; /** Optional JSON-schema-like input contract surfaced in APIs/UIs */ inputSchema?: Record; /** Optional JSON-schema-like output contract surfaced in APIs/UIs */ outputSchema?: Record; /** Explicit integration scopes and resources required by scheduled runs. */ integrationRequirements?: ScheduleIntegrationRequirementConfig[]; /** Whether this task can be scheduled */ schedulable?: boolean; /** The function to execute */ run: (ctx: TaskContext) => Promise | unknown; } /** * Return true only when the runnable and every declared task metadata field * match the public `TaskDefinition` contract. */ export declare function isTaskDefinition(value: unknown): value is TaskDefinition; //# sourceMappingURL=types.d.ts.map