import { runFlow, runServeMode } from '@walkeros/docker';
/**
 * Execute run command locally
 *
 * @param mode - Run mode (collect | serve)
 * @param flowPath - Path to flow bundle (required for collect, optional for serve)
 * @param options - Runtime options
 */
export async function executeRunLocal(mode, flowPath, options) {
    switch (mode) {
        case 'collect': {
            if (!flowPath) {
                throw new Error('Flow path is required for collect mode');
            }
            const config = {
                port: options.port,
                host: options.host,
            };
            await runFlow(flowPath, config);
            break;
        }
        case 'serve': {
            const config = {
                port: options.port,
                host: options.host,
                serveName: options.serveName,
                servePath: options.servePath,
                filePath: flowPath || undefined,
            };
            await runServeMode(config);
            break;
        }
        default:
            throw new Error(`Unknown mode: ${mode}`);
    }
}
//# sourceMappingURL=execution.js.map