/**
 * Base export target interface and abstract class
 *
 * Defines the contract for serverless export targets and provides
 * shared utilities for generating deployment artifacts.
 */
/**
 * Export options passed to targets
 */
export interface ExportOptions {
    /** Path to the workflow source file */
    sourceFile: string;
    /** Workflow function name */
    workflowName: string;
    /** Workflow display name */
    displayName: string;
    /** Output directory */
    outputDir: string;
    /** Workflow description */
    description?: string;
    /** Production mode (no trace events) */
    production?: boolean;
    /** Include API documentation routes (/docs and /openapi.json) */
    includeDocs?: boolean;
    /** Additional target-specific options */
    targetOptions?: Record<string, unknown>;
    /** Export all workflows in file as a single service */
    multi?: boolean;
    /** Specific workflow names to export (subset of file) */
    workflows?: string[];
}
/**
 * Compiled workflow metadata for multi-workflow export
 */
export interface CompiledWorkflow {
    /** Workflow name (used in URL path) */
    name: string;
    /** Function name in compiled code */
    functionName: string;
    /** Workflow description */
    description?: string;
    /** Compiled code content */
    code?: string;
}
/**
 * A single generated file
 */
export interface GeneratedFile {
    /** Relative path from output directory */
    relativePath: string;
    /** Absolute path */
    absolutePath: string;
    /** File content */
    content: string;
    /** File type for display */
    type: 'handler' | 'config' | 'workflow' | 'nodeType' | 'package' | 'other';
}
/**
 * Export result with all generated artifacts
 */
export interface ExportArtifacts {
    /** Generated files */
    files: GeneratedFile[];
    /** Target name */
    target: string;
    /** Workflow name */
    workflowName: string;
    /** Entry point file */
    entryPoint: string;
    /** Warnings about unsupported or dropped annotations */
    warnings?: string[];
}
/**
 * Deployment instructions
 */
export interface DeployInstructions {
    /** Title for the instructions */
    title: string;
    /** Step-by-step instructions */
    steps: string[];
    /** Required tools/dependencies */
    prerequisites: string[];
    /** Steps to test locally before deploying */
    localTestSteps?: string[];
    /** Links to documentation */
    links?: {
        label: string;
        url: string;
    }[];
}
/**
 * Multi-workflow export artifacts
 */
export interface MultiWorkflowArtifacts extends ExportArtifacts {
    /** All workflow names included */
    workflowNames: string[];
    /** OpenAPI spec if generated */
    openApiSpec?: object;
}
/**
 * Node type export options
 */
export interface NodeTypeExportOptions {
    /** Source file path */
    sourceFile: string;
    /** Service name for the exported handlers */
    serviceName: string;
    /** Output directory */
    outputDir: string;
    /** Production mode (no trace events) */
    production?: boolean;
    /** Include API documentation routes */
    includeDocs?: boolean;
}
/**
 * Node type export artifacts
 */
export interface NodeTypeArtifacts extends ExportArtifacts {
    /** All node type names included */
    nodeTypeNames: string[];
    /** OpenAPI spec if generated */
    openApiSpec?: object;
}
/**
 * Node type info for export (matches TNodeTypeAST structure)
 */
export interface NodeTypeInfo {
    name: string;
    functionName: string;
    description?: string;
    inputs: Record<string, {
        dataType?: string;
        tsType?: string;
        label?: string;
        optional?: boolean;
    }>;
    outputs: Record<string, {
        dataType?: string;
        tsType?: string;
        label?: string;
    }>;
    /** Generated wrapper code for standalone deployment */
    code?: string;
}
/**
 * Bundle item with expose flag - used for unified bundle export
 *
 * Key concepts:
 * - bundled items are included in the export
 * - exposed items get HTTP endpoints
 * - non-exposed bundled items are available as internal dependencies
 */
export interface BundleWorkflow extends CompiledWorkflow {
    /** Whether to create HTTP endpoint for this workflow */
    expose: boolean;
}
export interface BundleNodeType extends NodeTypeInfo {
    /** Whether to create HTTP endpoint for this node type */
    expose: boolean;
    /** Generated wrapper code for standalone deployment */
    code?: string;
}
/**
 * Bundle export artifacts
 */
export interface BundleArtifacts extends ExportArtifacts {
    /** All workflow names included */
    workflowNames?: string[];
    /** All node type names included */
    nodeTypeNames?: string[];
    /** OpenAPI spec if generated */
    openApiSpec?: object;
}
/**
 * Deploy schema field definition.
 * Describes a single key that a target accepts via @deploy annotations.
 */
export interface DeploySchemaField {
    type: 'string' | 'number' | 'boolean' | 'string[]';
    description: string;
    default?: unknown;
}
/**
 * Deploy schema — describes all @deploy keys a target accepts.
 * Used for validation, Studio autocomplete, and documentation.
 */
export type DeploySchema = Record<string, DeploySchemaField>;
/**
 * Export target interface
 */
export interface ExportTarget {
    /** Target identifier */
    readonly name: string;
    /** Human-readable description */
    readonly description: string;
    /** Schema for @deploy keys this target accepts on workflows */
    readonly deploySchema?: DeploySchema;
    /** Schema for @deploy keys this target accepts on node types */
    readonly nodeTypeDeploySchema?: DeploySchema;
    /**
     * Generate deployment artifacts for single workflow
     */
    generate(options: ExportOptions): Promise<ExportArtifacts>;
    /**
     * Generate deployment artifacts for multiple workflows
     */
    generateMultiWorkflow?(workflows: CompiledWorkflow[], options: ExportOptions): Promise<MultiWorkflowArtifacts>;
    /**
     * Generate deployment artifacts for node types as standalone HTTP endpoints
     */
    generateNodeTypeService?(nodeTypes: NodeTypeInfo[], options: NodeTypeExportOptions): Promise<NodeTypeArtifacts>;
    /**
     * Generate deployment artifacts for a unified bundle of workflows and node types.
     * Supports mixed content with individual expose flags for each item.
     *
     * @param workflows - Workflows to include, with expose flags
     * @param nodeTypes - Node types to include, with expose flags
     * @param options - Export options
     * @returns Bundle artifacts including files and metadata
     */
    generateBundle?(workflows: BundleWorkflow[], nodeTypes: BundleNodeType[], options: ExportOptions): Promise<BundleArtifacts>;
    /**
     * Get deployment instructions
     */
    getDeployInstructions(artifacts: ExportArtifacts): DeployInstructions;
}
/**
 * Base export target with shared utilities
 */
export declare abstract class BaseExportTarget implements ExportTarget {
    abstract readonly name: string;
    abstract readonly description: string;
    abstract generate(options: ExportOptions): Promise<ExportArtifacts>;
    abstract generateMultiWorkflow(workflows: CompiledWorkflow[], options: ExportOptions): Promise<MultiWorkflowArtifacts>;
    abstract generateNodeTypeService(nodeTypes: NodeTypeInfo[], options: NodeTypeExportOptions): Promise<NodeTypeArtifacts>;
    abstract generateBundle(workflows: BundleWorkflow[], nodeTypes: BundleNodeType[], options: ExportOptions): Promise<BundleArtifacts>;
    abstract getDeployInstructions(artifacts: ExportArtifacts): DeployInstructions;
    /**
     * Generate a standard package.json
     */
    protected generatePackageJson(options: {
        name: string;
        description?: string;
        main?: string;
        scripts?: Record<string, string>;
        dependencies?: Record<string, string>;
        devDependencies?: Record<string, string>;
    }): string;
    /**
     * Generate a standard tsconfig.json
     */
    protected generateTsConfig(options?: {
        outDir?: string;
        module?: string;
        moduleResolution?: string;
        types?: string[];
    }): string;
    /**
     * Create a file object
     */
    protected createFile(outputDir: string, relativePath: string, content: string, type: GeneratedFile['type']): GeneratedFile;
    /**
     * Generate content files for workflows and node types in a bundle.
     * Creates files under workflows/ and node-types/ subdirectories.
     */
    protected generateBundleContentFiles(workflows: BundleWorkflow[], nodeTypes: BundleNodeType[], outputDir: string, workflowDir?: string, nodeTypeDir?: string): GeneratedFile[];
    /**
     * Generate content files for compiled workflows.
     * Creates files under the workflows/ subdirectory.
     */
    protected generateWorkflowContentFiles(workflows: CompiledWorkflow[], outputDir: string, workflowDir?: string): GeneratedFile[];
    /**
     * Generate content files for node types.
     * Creates files under the node-types/ subdirectory.
     */
    protected generateNodeTypeContentFiles(nodeTypes: NodeTypeInfo[], outputDir: string, nodeTypeDir?: string): GeneratedFile[];
    /**
     * Get relative import path for the workflow
     */
    protected getWorkflowImport(workflowFile: string): string;
    /**
     * Generate OpenAPI spec for node types as HTTP endpoints
     */
    protected generateNodeTypeOpenAPI(nodeTypes: NodeTypeInfo[], options: {
        title: string;
        version: string;
        baseUrl?: string;
    }): object;
    /**
     * Map Flow Weaver data types to JSON Schema types
     */
    private mapDataTypeToJsonSchema;
    /**
     * Generate consolidated OpenAPI spec for multiple workflows
     */
    protected generateConsolidatedOpenAPI(workflows: CompiledWorkflow[], options: {
        title: string;
        version: string;
        baseUrl?: string;
    }): object;
    /**
     * Generate OpenAPI spec for a unified bundle of workflows and node types.
     * Only includes exposed items as HTTP endpoints.
     */
    protected generateBundleOpenAPI(workflows: BundleWorkflow[], nodeTypes: BundleNodeType[], options: {
        title: string;
        version: string;
        baseUrl?: string;
    }): object;
    /**
     * Generate a README.md from deploy instructions
     */
    protected generateReadme(instructions: DeployInstructions, workflowName: string, target: string): string;
    /**
     * Generate real runtime files from the Flow Weaver runtime source.
     * Includes the function registry, builtin functions, and parameter resolver.
     * These replace the placeholder files that were previously generated.
     */
    protected generateRuntimeFiles(outputDir: string, workflows: BundleWorkflow[], nodeTypes: BundleNodeType[]): GeneratedFile[];
    /**
     * Generate function registry content with workflow/nodeType metadata.
     * Used as fallback when real runtime source files aren't available.
     */
    protected generateFunctionRegistryContent(workflows: BundleWorkflow[], nodeTypes: BundleNodeType[]): string;
}
/**
 * Registry of available export targets
 */
export declare class ExportTargetRegistry {
    private factories;
    private instances;
    /**
     * Register a target factory. The target is only instantiated on first use.
     * Also accepts a pre-instantiated target.
     */
    register(nameOrTarget: string | ExportTarget, factory?: () => ExportTarget): void;
    get(name: string): ExportTarget | undefined;
    getAll(): ExportTarget[];
    getNames(): string[];
    /** Get deploy schemas from all registered targets (for validation/autocomplete) */
    getDeploySchemas(): Record<string, DeploySchema>;
}
//# sourceMappingURL=base.d.ts.map