import type { ActiveInstancePointer, WorkflowDefinition, WorkflowInstance } from "./types"; /** * Generate a unique instance ID. * Format: wf_{8 random hex chars} (e.g., "wf_a1b2c3d4"). */ export declare function generateInstanceId(): string; /** * Generate a URL-safe slug from a goal string. * Lowercase, spaces to hyphens, strip non-alphanumeric, truncate to 50 chars. */ export declare function generateSlug(goal: string): string; /** * Create a fresh WorkflowInstance for a definition + goal. */ export declare function createWorkflowInstance(definition: WorkflowDefinition, definitionPath: string, goal: string, sessionId: string): WorkflowInstance; /** * Read a workflow instance by ID. Returns null if not found or invalid. */ export declare function readWorkflowInstance(directory: string, instanceId: string): WorkflowInstance | null; /** * Write a workflow instance to its state directory. * Creates directories as needed. */ export declare function writeWorkflowInstance(directory: string, instance: WorkflowInstance): boolean; /** * Read the active instance pointer. Returns null if no active instance. */ export declare function readActiveInstance(directory: string): ActiveInstancePointer | null; /** * Set the active instance pointer. */ export declare function setActiveInstance(directory: string, instanceId: string): boolean; /** * Clear the active instance pointer (without deleting the instance). */ export declare function clearActiveInstance(directory: string): boolean; /** * Get the active workflow instance (resolves pointer -> reads instance). * Returns null if no active instance or instance not found. */ export declare function getActiveWorkflowInstance(directory: string): WorkflowInstance | null; /** * List all instance IDs (for status/history commands). * Returns IDs sorted alphabetically. */ export declare function listInstances(directory: string): string[]; /** * Append a session ID to an instance's session_ids. * Returns the updated instance, or null if the instance doesn't exist. */ export declare function appendInstanceSessionId(directory: string, instanceId: string, sessionId: string): WorkflowInstance | null;