/** * Workflow Discovery * * Discovers workflow definitions from user's project files. * Uses the same patterns as API route discovery. * * Scans: * - workflows/*.ts - workflow definition files * - workflows/**\/*.ts - nested workflow files * * Workflow files should export a workflow definition: * ```typescript * import { workflow, step } from "veryfront/workflow"; * * export const myWorkflow = workflow({ * id: "my-workflow", * steps: [step("process", { agent: "processor" })], * }); * * // Or as default export * export default workflow({ ... }); * ``` */ import type { RuntimeAdapter } from "../../platform/index.js"; import type { VeryfrontConfig } from "../../config/index.js"; import type { WorkflowDefinition } from "../types.js"; /** * Discovered workflow info */ export interface DiscoveredWorkflow { /** Workflow ID from the definition */ id: string; /** File path where the workflow is defined */ filePath: string; /** Export name (e.g., "myWorkflow" or "default") */ exportName: string; /** The workflow definition */ definition: WorkflowDefinition; } /** * Options for workflow discovery */ export interface WorkflowDiscoveryOptions { /** Project directory */ projectDir: string; /** Runtime adapter for filesystem operations */ adapter: RuntimeAdapter; /** Veryfront config (for import maps, etc.) */ config?: VeryfrontConfig; /** Base directory for workflows (default: "workflows") */ workflowsDir?: string; /** Enable debug logging */ debug?: boolean; /** Explicit host-owned capability for a trusted local or dedicated runtime. */ allowHostProjectCodeExecution?: boolean; } /** * Result of workflow discovery */ export interface WorkflowDiscoveryResult { /** All discovered workflows */ workflows: DiscoveredWorkflow[]; /** Errors encountered during discovery */ errors: Array<{ filePath: string; error: string; }>; } /** * Discover all workflows in a project */ export declare function discoverWorkflows(options: WorkflowDiscoveryOptions): Promise; /** * Find a specific workflow by ID */ export declare function findWorkflowById(workflowId: string, options: WorkflowDiscoveryOptions): Promise; /** * Create a workflow registry from discovered workflows */ export declare function createWorkflowRegistry(workflows: DiscoveredWorkflow[]): Map; //# sourceMappingURL=workflow-discovery.d.ts.map