/** * Task Discovery * * Discovers task definitions from user's project `tasks/` directory. * Follows the same patterns as workflow-discovery.ts. * * Scans: * - tasks/*.ts - task definition files * - tasks/**\/*.ts - nested task files * * Task files should export a task definition: * ```typescript * export default { * name: "Sync external data", * run: async (ctx) => { * console.log("Syncing data...") * return { synced: 42 } * } * } * ``` */ import type { RuntimeAdapter } from "../platform/index.js"; import type { VeryfrontConfig } from "../config/index.js"; import type { TaskDefinition } from "./types.js"; /** * Discovered task info. * * @deprecated Use project runtime discovery helpers from `veryfront/task` * instead. Runtime discovery keeps tasks, tools, agents, and cloud runs on the * same project discovery path. */ export interface DiscoveredTask { /** Task ID derived from file path (e.g., "sync-data" from tasks/sync-data.ts) */ id: string; /** Human-readable name from task definition */ name: string; /** File path where the task is defined */ filePath: string; /** Export name (e.g., "default" or named export) */ exportName: string; /** The task definition */ definition: TaskDefinition; } /** * Options for file-based task discovery. * * @deprecated Use `discoverProjectTaskRuntime` instead. */ export interface TaskDiscoveryOptions { /** Project directory */ projectDir: string; /** Runtime adapter for filesystem operations */ adapter: RuntimeAdapter; /** Veryfront config (for import maps, etc.) */ config?: VeryfrontConfig; /** Base directory for tasks (default: "tasks") */ tasksDir?: string; /** Enable debug logging */ debug?: boolean; /** Explicit host-owned capability for a trusted local or dedicated runtime. */ allowHostProjectCodeExecution?: boolean; } /** * Result of file-based task discovery. * * @deprecated Use `DiscoveryResult` from project runtime discovery instead. */ export interface TaskDiscoveryResult { /** All discovered tasks */ tasks: DiscoveredTask[]; /** Errors encountered during discovery */ errors: Array<{ filePath: string; error: string; }>; } /** * Derive task ID from file path (e.g., "tasks/sync-data.ts" -> "sync-data"). * * @deprecated Use project runtime task IDs from `discoverProjectTaskRuntime` * instead. */ export declare function deriveTaskId(filePath: string, tasksDir: string): string; /** * Discover all tasks in a project with the legacy file-based path. * * @deprecated Use `discoverProjectTaskRuntime` instead. */ export declare function discoverTasks(options: TaskDiscoveryOptions): Promise; /** * Find a specific task by ID through the legacy file-based path. * * @deprecated Use `discoverProjectTaskRuntime` and `findProjectRuntimeTask` * instead. */ export declare function findTaskById(taskId: string, options: TaskDiscoveryOptions): Promise; //# sourceMappingURL=discovery.d.ts.map